vanilla-jui 1.5.30 → 1.5.31

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/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vanilla-signal"),require("vanilla-signal-i18n"),require("vanilla-create-storage")):typeof define==`function`&&define.amd?define([`exports`,`vanilla-signal`,`vanilla-signal-i18n`,`vanilla-create-storage`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.jui={},e.vanillaSignal,e.vanillaSignalI18n,e.vanillaStorage))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i={en:{b:`Back`,t:`Customize`,sm:`Small`,md:`Medium`,lg:`Large`,wn:`Your browser is outdated and may pose security risks. Please upgrade your browser to access this site.`},zh:{b:`返回`,t:`自定义主题`,Primary:`主色`,Radius:`圆角`,Shadow:`阴影`,Font:`字号`,Mode:`模式`,Gray:`灰色`,Olive:`橄榄绿`,Tomato:`番茄红`,Ruby:`红宝石`,Pink:`粉红`,Violet:`紫罗兰`,Indigo:`靛蓝`,Blue:`蓝色`,Teal:`青色`,Grass:`草绿`,Mint:`薄荷绿`,Lime:`酸橙绿`,Yellow:`黄色`,Orange:`橙色`,Gold:`金色`,None:`无`,sm:`小`,md:`中`,lg:`大`,XL:`更大`,Round:`圆角`,Light:`浅色`,Dark:`深色`,Auto:`自动`,Close:`关闭`,Confirm:`确认`,Upgrade:`升级`,wn:`您的浏览器版本过低,存在安全风险。请升级浏览器后再访问本站。`,Submit:`提交`,Reset:`重置`,"Loading...":`加载中...`,"Go to previous page":`访问上一页`,"Go to next page":`访问下一页`,Next:`下一步`,Finish:`完成`}};function a(e){return(0,n.t)(e,i)}var o={info:`<path d="M12 22C6.47715 22 2 17.5228 2 12 2 6.47715 6.47715 2 12 2 17.5228 2 22 6.47715 22 12 22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM13 10.5V15H14V17H10V15H11V12.5H10V10.5H13ZM13.5 8C13.5 8.82843 12.8284 9.5 12 9.5 11.1716 9.5 10.5 8.82843 10.5 8 10.5 7.17157 11.1716 6.5 12 6.5 12.8284 6.5 13.5 7.17157 13.5 8Z"></path>`,success:`<path d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"></path>`,warning:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"></path>`,error:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"></path>`,"arrow-left":`<path d="M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"></path>`,"arrow-right":`<path d="M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"></path>`,"arrow-up":`<path d="M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"></path>`,"arrow-down":`<path d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"></path>`,more:`<path d="M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"></path>`,close:`<path d="M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"></path>`,loader:`<path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path>`,menu:`<path d="M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z"></path>`,palette:`<path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM10.8111 18.1111C10.8111 16.0843 12.451 14.4444 14.4778 14.4444H16.4444C18.4065 14.4444 20 12.851 20 10.8889C20 7.1392 16.4677 4 12 4C7.58235 4 4 7.58235 4 12C4 16.19 7.2226 19.6285 11.324 19.9718C10.9948 19.4168 10.8111 18.7761 10.8111 18.1111ZM7.5 12C6.67157 12 6 11.3284 6 10.5C6 9.67157 6.67157 9 7.5 9C8.32843 9 9 9.67157 9 10.5C9 11.3284 8.32843 12 7.5 12ZM16.5 12C15.6716 12 15 11.3284 15 10.5C15 9.67157 15.6716 9 16.5 9C17.3284 9 18 9.67157 18 10.5C18 11.3284 17.3284 12 16.5 12ZM12 9C11.1716 9 10.5 8.32843 10.5 7.5C10.5 6.67157 11.1716 6 12 6C12.8284 6 13.5 6.67157 13.5 7.5C13.5 8.32843 12.8284 9 12 9Z"></path>`,message:`<path d="M2 8.99374C2 5.68349 4.67654 3 8.00066 3H15.9993C19.3134 3 22 5.69478 22 8.99374V21H8.00066C4.68659 21 2 18.3052 2 15.0063V8.99374ZM20 19V8.99374C20 6.79539 18.2049 5 15.9993 5H8.00066C5.78458 5 4 6.78458 4 8.99374V15.0063C4 17.2046 5.79512 19 8.00066 19H20ZM14 11H16V13H14V11ZM8 11H10V13H8V11Z"></path>`,chat:`<path d="M10 3H14C18.4183 3 22 6.58172 22 11C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3ZM12 17H14C17.3137 17 20 14.3137 20 11C20 7.68629 17.3137 5 14 5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17Z"></path>`,discuss:`<path d="M14 22.5L11.2 19H6C5.44772 19 5 18.5523 5 18V7.10256C5 6.55028 5.44772 6.10256 6 6.10256H22C22.5523 6.10256 23 6.55028 23 7.10256V18C23 18.5523 22.5523 19 22 19H16.8L14 22.5ZM15.8387 17H21V8.10256H7V17H11.2H12.1613L14 19.2984L15.8387 17ZM2 2H19V4H3V15H1V3C1 2.44772 1.44772 2 2 2Z"></path>`};let s=`http://www.w3.org/2000/svg`,c=o;function l(e){if(!(e in c))throw Error(`Icon "${e}" not found.`)}function u(e){return l(e),`<svg xmlns="${s}" viewBox="0 0 24 24" fill="currentColor">${c[e]}</svg>`}function d(e){return e!==null&&e.namespaceURI===s}function f(e,t={}){let n=document.createElement(`template`);n.innerHTML=u(e);let r=n.content.firstElementChild;if(!d(r))throw Error(`Icon "${e}" cannot be rendered.`);for(let[e,n]of Object.entries(t||{})){if(n==null||n===!1)continue;let t=e===`className`?`class`:e;r.setAttribute(t,n===!0?``:String(n))}return r}function p(e){return u(e)}let m=p;function h(){return{...c}}function g(e){if(typeof e!=`object`||!e)throw Error(`Icons must be a valid object.`);for(let[t,n]of Object.entries(e)){if(typeof n!=`string`||!n.trim().startsWith(`<`))throw Error(`Invalid SVG path for icon "${t}".`);c[t]=n}}function _(e=`center`,n=`center`){let r=f(`loader`,{width:24});return requestAnimationFrame(()=>{typeof r.animate==`function`&&r.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),(0,t.jsx)(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:n,position:`absolute`,width:`100%`,height:`100%`,borderRadius:`inherit`,backdropFilter:`blur(4px)`},children:r})}let v=Function.prototype.toString.call(Object);function y(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&Function.prototype.toString.call(n)===v}function b(e){return e==null}function x(e){return typeof Node<`u`&&e instanceof Node}function S(e){return typeof Element<`u`&&e instanceof Element}function C(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function w(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function T(e){return b(e)||w(e)||typeof e==`function`||Array.isArray(e)||x(e)}let E=e=>e===null?`null`:Array.isArray(e)?`array`:C(e)?`HTMLElement`:x(e)?`Node`:typeof e;function D(e){return Array.isArray(e)?e.slice():y(e)?{...e}:e}function O(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function k(e,t){throw Error(`Validator: ${e} ${t}`)}function A(e){return typeof e==`string`?e:String(e)}function j(e){return typeof e==`string`?`string`:`array`}function M(e,t,n){if(b(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=j(t);n.nonEmpty&&t.length===0&&k(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&k(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&k(e,`expects ${r} length to be at most ${n.maxLength}.`)}function N(e,t,n){b(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&k(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&k(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&k(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&k(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&k(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&k(e,`expects a number less than ${n.lessThan}.`))}function ee(e,t,n){!n.plain||b(t)||y(t)||k(e,`expects an object.`)}function te(e,t,n){!n.items||b(t)||(Array.isArray(t)||k(e,`expects array.`),t.forEach((t,r)=>{L(String(r),t,n.items,e)}))}function ne(e,t,n){if(!n.shape||b(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&k(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))L(t,r[t],i,e)}function P(e,t){return t===`renderable`?T(e):t===`Node`?x(e):t===`Element`?S(e):t===`HTMLElement`?C(e):t===`plainObject`?y(e):E(e)===t}function re(e){return y(e)?`object`:E(e)}function F(e,t,n=[]){let r=Array.isArray(n)?n:n?[n]:[];for(let n of r){let r,i;if(typeof n==`function`)r=n,i=`does not satisfy the required condition.`;else if(n&&typeof n.test==`function`)r=n.test,i=n.message||`condition failed.`;else throw Error(`Validator: Condition must be a function or { test, message }.`);r(t)||k(e,i)}}function I(e,t){return e?`${e}.${t}`:t}function L(e,t,n={},r=``){let i=O(n),a=I(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&b(t)&&k(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=re(t);e.some(e=>P(t,e))||k(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&k(a,`expects one of ${i.enum.map(A).join(`, `)}.`),M(a,t,i),N(a,t,i),ee(a,t,i),te(a,t,i),ne(a,t,i),F(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||k(a,i.message||`does not satisfy the required condition.`)),t}function R(e={},t={},n=`Options`){let r=e??{};if(typeof r!=`object`||Array.isArray(r))throw Error(`${n} expects object.`);let i=r,a={...i},o=Object.entries(t||{});for(let[e,t]of o){let n=O(t);a[e]=Object.hasOwn(i,e)?i[e]:ie(n)}for(let[e,n]of o){let r=O(n);typeof r.normalize==`function`&&(a[e]=r.normalize(a[e],{key:e,input:i,options:a,schema:t}))}for(let[e,t]of o)L(e,a[e],t,n);return a}function ie(e){if(!Object.hasOwn(e,`default`))return;let t=e.default;return D(e.factory&&typeof t==`function`?t():t)}function z(e){return e}function B(...e){return e.filter(Boolean).join(` `)}let V=[`node`,`element`,`array`];function ae(e){return V.includes(e)}function H(e){return x(e)}function U(e){return S(e)}function oe(e){return typeof e==`string`||U(e)||H(e)||Array.isArray(e)}function se(e){return e.find(U)||null}function W(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!W(n,t))return null;continue}if(H(n)){t.push(n);continue}return null}return t}function ce(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=q(e);return t.length>0?t:null}if(Array.isArray(e)){let t=W(e,[]);return t&&t.length>0?t:null}return H(e)?[e]:null}function le(e){return U(e)||H(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(ce(e)||[])[0]||null}function G(e){if(!oe(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return U(t)?t:null}if(Array.isArray(e)){let t=ce(e);return Array.isArray(t)?se(t):null}return U(e)?e:null}function ue(e,t=`Component`,n=`element`){if(!ae(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return oe(e)?n===`array`?ce(e):n===`node`?le(e):G(e):null}function de(e,t=`Component`,n=`element`){let r=ue(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function fe(e){return T(e)}function K(e,t=document){return t.querySelector(e)}function q(e,t=document){return Array.from(t.querySelectorAll(e))}function pe(e,t,n={}){if(typeof t!=`function`)throw TypeError(`lazyRender: renderCallback expects function.`);let{threshold:r=.1,rootMargin:i=`0px`,root:a=null,waitForDOM:o=!0}=n,s={threshold:r,rootMargin:i,root:a};if(!he(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),me;let c=me,l=ge(e);if(l&&document.body.contains(l))return c=_e(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=ge(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=_e(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function me(){}function he(e){return typeof e==`string`||U(e)}function ge(e){return typeof e==`string`?K(e):e}function _e(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),me;let r=new window.IntersectionObserver(n=>{for(let i of n)if(i.isIntersecting){r.unobserve(e),r.disconnect(),t();break}},n);return r.observe(e),()=>{r.unobserve(e),r.disconnect()}}function ve(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function J(){let e=new Map,t=t=>{let n=e.get(t);return n?(n(),e.delete(t),!0):!1};return{on(n,r,i,a,o){if(typeof n!=`string`||n.trim()===``)throw TypeError(`EventManager.on: key expects a non-empty string.`);if(t(n),r==null)return()=>{};let s=ve(r,i,a,o);return e.set(n,s),s},off:t,clear(){for(let t of e.values())t();e.clear()},size(){return e.size}}}function ye(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(16);if(typeof crypto.getRandomValues!=`function`)throw Error(`Your browser is too old to support secure login.`);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20,32)].join(`-`)}function Y(e=8){if(!Number.isInteger(e)||e<1||e>87381)throw Error(`Length must be an integer between 1 and 87381`);let t=Math.ceil(e*3/4),n=new Uint8Array(t);crypto.getRandomValues(n);let r=``;for(let e of n)r+=String.fromCharCode(e);return btoa(r).substring(0,e).replace(/\+/g,`-`).replace(/\//g,`_`)}let be={},xe={timers:be,start(e,t,n){be[e]&&clearTimeout(be[e]),be[e]=setTimeout(()=>{n(),delete be[e]},t)},cancel(e){be[e]&&(clearTimeout(be[e]),delete be[e])}},Se={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,confirm:`j-toast is-confirm`,buttons:`toast-buttons`,button:`j-button is-sm`,closeBtn:`is-ghost`,confirmBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},Ce={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},we={type:`number`,min:0},Te={type:`number`,greaterThan:0},Ee=new Set,X=new Map,Z=new Map,De=new Map,Oe=new Map,ke=Se;function Ae(e){return{...Se,...e}}function je(e){return Ae({...ke,...e?.className})}function Me(e,t){let n=X.get(e);X.set(e,()=>{n?.(),t()})}function Ne(e){let t=Oe.get(e);return t?!t.isConnected||t.getAttribute(`data-mount`)===`false`?(Oe.delete(e),null):t:null}function Pe(e,t,n){n&&Oe.set(e,t)}function Fe(e){for(let[t,n]of Oe)n===e&&Oe.delete(t)}function Ie(e){return!!(0,t.access)(e.loading??!1)}function Le(e){return e===`primary`?`info`:e}function Re(e){return Ie(e)?{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`var(--toast-icon-size, 1em)`,height:`var(--toast-icon-size, 1em)`,flex:`0 0 auto`}:{}}function ze(e,t){return Ie(t)?_():f(Le(e))}function Be(e,t){return Ie(t)?t.text?.loading||a(`Loading...`):e}async function Ve(e,t){let n=Ie(t);Qe(e),n&&await t.onCancel?.(),await t.onClose?.()}function He(e,n,r,i,a,o,s=0){let c=e.dataset.toast||Y();Me(e,(0,t.createRoot)(l=>((0,t.insert)(n,()=>ze(a,o)),(0,t.insert)(r,()=>Be(i,o)),(0,t.createEffect)(()=>{Ge(c),s>0&&!Ie(o)&&We(c,`hide`,()=>Qe(e),s)}),l)))}function Ue(e){let n=K(`[data-toast-container]`);return n?n.className=e.container:(n=(0,t.jsx)(`div`,{className:e.container,"data-toast-container":``}),(0,t.insert)(document.body,n)),n}function We(e,t,n,r){let i=`${e}-${t}`;return Ee.add(i),xe.start(i,r,()=>{Ee.delete(i),n()}),i}function Ge(e){for(let t of Array.from(Ee))t.startsWith(`${e}-`)&&(xe.cancel(t),Ee.delete(t))}function Ke(e){Z.get(e)?.cancel(),Z.delete(e),De.delete(e),e.remove(),X.get(e)?.(),X.delete(e),Fe(e);let t=K(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function qe(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function Je(e){return e.finished.then(()=>void 0,()=>void 0)}function Ye(e,t){let n=e.hasAttribute(`data-toast-lite`);return n&&t===`enter`?[{opacity:0},{opacity:1}]:n?[{opacity:1,transform:`translate(-50%, -50%)`},{opacity:0,transform:`translate(-50%, calc(-50% - 8px))`}]:t===`enter`?[{opacity:0,transform:`translate3d(0, -16px, 0)`},{opacity:1,transform:`translate3d(0, 0, 0)`}]:[{opacity:1,transform:`translate3d(0, 0, 0)`},{opacity:0,transform:`translate3d(0, -16px, 0)`}]}async function Xe(e,t){let n=(De.get(e)||0)+1;if(De.set(e,n),Z.get(e)?.cancel(),Z.delete(e),typeof e.animate!=`function`)return;let r=e.hasAttribute(`data-toast-lite`),i=e.animate(Ye(e,t),qe(e,t===`enter`?r?150:240:r?120:180,t===`enter`?`cubic-bezier(0.16, 1, 0.3, 1)`:`cubic-bezier(0.4, 0, 1, 1)`));Z.set(e,i),await Je(i),De.get(e)===n&&Z.get(e)===i&&Z.delete(e)}function Ze(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),Xe(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function Qe(e){e&&e.getAttribute(`data-mount`)!==`false`&&(X.get(e)?.(),X.delete(e),Ge(e.dataset.toast||Y()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),Xe(e,`leave`).then(()=>{e.dataset.mount===`false`&&Ke(e)}))}function $e(e=``,n={}){let r=n.once??!1;if(r){let e=Ne(`show`);if(e)return e}L(`message`,e,`string`,`Toast.show`);let i=n.duration??3e3,a=n.theme||`info`;L(`once`,r,`boolean`,`Toast.show`),L(`duration`,i,we,`Toast.show`),L(`theme`,a,Ce,`Toast.show`);let o=je(n),s=Y(),c=(0,t.jsx)(`span`,{className:o.icon,"data-toast-icon":s,style:()=>Re(n)}),l=(0,t.jsx)(`span`,{className:o.message,"data-toast-message":s}),u=(0,t.jsx)(`div`,{className:B(o.toast,o[a]),"data-toast":s,role:`alert`,"aria-atomic":`true`,children:[c,l]});return He(u,c,l,e,a,n,i),Ze(u,()=>(0,t.insert)(Ue(o),u),a===`error`?`assertive`:`polite`),Pe(`show`,u,r),Me(u,ve(u,`click`,()=>void Ve(u,n))),u}function et(e=``,n=2e3,r){L(`message`,e,`string`,`Toast.lite`),L(`duration`,n,Te,`Toast.lite`);let i=Ae({...ke,...r}),a=K(`[data-toast-lite]`);a&&(Ge(a.dataset.toast||``),Z.get(a)?.cancel(),Ke(a));let o=Y(),s=(0,t.jsx)(`div`,{className:i.lite,"data-toast":o,"data-toast-lite":``,children:e});return Ze(s,()=>(0,t.insert)(document.body,s),`polite`),We(o,`hide`,()=>Qe(s),n),s}function tt(e=``,n={}){let r=n.once??!0;if(r){let e=Ne(`confirm`);if(e)return e}L(`message`,e,`string`,`Toast.confirm`);let i=n.text?.close||a(`Close`),o=n.text?.confirm||a(`Confirm`),s=n.theme||`info`;L(`once`,r,`boolean`,`Toast.confirm`),L(`theme`,s,Ce,`Toast.confirm`);let c=je(n),l=Y(),u=(0,t.jsx)(`div`,{className:B(c.confirm,c[s]),"data-toast":l,"data-toast-confirm":``,children:[(0,t.jsx)(`div`,{className:c.message,"data-toast-message":l,children:e}),(0,t.jsx)(`div`,{className:c.buttons,"data-toast-buttons":l,children:[(0,t.jsx)(`button`,{className:B(c.button,c.closeBtn),children:i,"data-toast-button":`close`,"aria-label":i,onClick:async()=>{await n.onClose?.(),Qe(u)}}),(0,t.jsx)(`button`,{className:B(c.button,c.confirmBtn),children:o,"data-toast-button":`confirm`,"aria-label":o,onClick:async()=>{await n.onConfirm?.(),Qe(u)}})]})]});return Ze(u,()=>(0,t.insert)(Ue(c),u),`polite`,()=>{K(`[data-toast-button="confirm"]`,u)?.focus()}),Pe(`confirm`,u,r),u}function nt(){for(let e of Ee)xe.cancel(e);Ee.clear();for(let e of X.values())e();X.clear();for(let e of Z.values())e.cancel();Z.clear(),De.clear(),Oe.clear(),K(`[data-toast-container]`)?.remove(),K(`[data-toast-lite]`)?.remove()}let rt={timers:Ee,disposers:X,configure(e={}){return ke=Ae(e.className),{className:ke}},show:$e,success:(e=``,t={})=>$e(e,{...t,theme:`success`}),info:(e=``,t={})=>$e(e,{...t,theme:`info`}),primary:(e=``,t={})=>$e(e,{...t,theme:`primary`}),warning:(e=``,t={})=>$e(e,{...t,theme:`warning`}),error:(e=``,t={})=>$e(e,{...t,theme:`error`}),hide:Qe,lite:et,confirm:tt,clearAll:nt,destroyAll:nt};function it(){if(typeof navigator>`u`)return!1;if(typeof navigator.userAgentData?.mobile==`boolean`)return navigator.userAgentData.mobile;let e=navigator.userAgent||``;return/\b(BlackBerry|webOS|iPhone|IEMobile|Android|Windows Phone|iPad|iPod)\b/i.test(e)?!0:typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(pointer: coarse)`).matches&&window.matchMedia(`(max-width: 820px)`).matches}async function at(e){if(typeof window>`u`||typeof document>`u`)return Promise.resolve(!1);let t=String(e);if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)try{return await navigator.clipboard.writeText(t),!0}catch{return ot(t)}return ot(t)}function ot(e){let t=null;try{return t=document.createElement(`textarea`),t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{t&&t.parentNode&&t.parentNode.removeChild(t)}}function st(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function ct(){return st()?!0:(rt.confirm(a(`wn`),{theme:`error`,onConfirm:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{confirmBtn:`j-button is-sm is-danger`}}),!1)}let lt=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function ut(e,t,n={}){let r=new Headers(n.headers);return r.has(`Content-Type`)||r.set(`Content-Type`,`application/json`),(await fetch(e,{...n,method:`POST`,headers:r,body:JSON.stringify(t)})).json()}let dt=null,ft=null,pt=!1;function mt(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function ht(){pt||(pt=!0,mt(_t))}function gt(e){e.enqueued=!0,ft?ft.next=e:dt=e,ft=e,ht()}function _t(){pt=!1;let e=dt;dt=null,ft=null;let t=e;for(;t;){let e=t.next;t.next=null,t.enqueued=!1,!t.disposed&&t.queued&&(t.queued=!1,t.run()),t=e}}function vt(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||gt(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function yt(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function bt(e){return yt(e),e}function xt(e){return(0,t.unwrap)(e)}function St(e,n,{deferInitial:r=!0,flushInitial:i=!1,flush:a=`microtask`}={}){let o=!1,s=!1,c,l=vt(()=>{s&&(s=!1,(0,t.untrack)(()=>n(c)))}),u=(0,t.createWatch)(e,e=>{let t=!o;if(o=!0,c=e,s=!0,t&&i||a===`sync`){l.flush();return}l.schedule()},{defer:r});return()=>{l.dispose(),u.dispose()}}function Ct(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function wt(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(n){return r=>{e.set(n,r),(0,t.onCleanup)(()=>{e.get(n)===r&&e.delete(n)})}},delete(t){e.delete(t)},clear(){e.clear()}}}function Tt(e,n={}){let r,i=n.removeOnDispose!==!1,a=(0,t.createRoot)(n=>(r=(0,t.untrack)(e),i&&(0,t.onCleanup)(()=>r.remove()),n));return{element:r,dispose:a}}function Et(...e){return{async enter(t){await Promise.all(e.map(e=>e.enter(t)))},async leave(t){await Promise.all(e.map(e=>e.leave(t)))},cancel(){for(let t of e)t.cancel()}}}function Dt(e,t){let n=e.finished.then(()=>void 0,()=>void 0);return t?new Promise(e=>{let r=()=>{t.removeEventListener(`abort`,r),e()};if(t.aborted){r();return}t.addEventListener(`abort`,r,{once:!0}),n.then(r)}):n}function Ot(e,t){let n={fill:`both`,...t.options},r=e.ownerDocument.defaultView;return t.respectReducedMotion!==!1&&r?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches&&(n.duration=0,n.delay=0,n.endDelay=0),n}function kt(e,t){let n=null,r=()=>{let t=e()||null;return!t||typeof t.animate!=`function`?null:t},i=e=>e===1||!Array.isArray(t.keyframes)?t.keyframes:t.keyframes.slice().reverse(),a=async(e,a)=>{if(a?.aborted)return;let o=r();o&&(n?.cancel(),n=o.animate(i(e),Ot(o,t)),await Dt(n,a),a?.aborted)};return{enter:e=>a(1,e),leave:e=>a(-1,e),cancel(){n?.cancel(),n=null}}}function At(e,t={}){let n=t.axis||`vertical`,r=null,i=null,a=null,o=`1`,s=0,c=e=>n===`vertical`?e.style.height:e.style.width,l=(e,t)=>{n===`vertical`?e.style.height=t:e.style.width=t},u=()=>{!r||!a||(l(r,a.size),r.style.opacity=a.opacity,r.style.overflow=a.overflow,r.style.visibility=a.visibility)},d=()=>{let t=e()||null;return t===r?r:(i?.cancel(),u(),i=null,r=t,a=t?{size:c(t),opacity:t.style.opacity,overflow:t.style.overflow,visibility:t.style.visibility}:null,o=t?.ownerDocument.defaultView?.getComputedStyle(t).opacity||`1`,r)},f=e=>{let n=d();if(!(!n||!a)){if(e){u();return}l(n,`0px`),n.style.overflow=`hidden`,n.style.visibility=`hidden`,t.fade!==!1&&(n.style.opacity=`0`)}},p=e=>{if(!a)return 0;let t=c(e),r=e.style.visibility;l(e,a.size),e.style.visibility=a.visibility;let i=e.getBoundingClientRect(),o=n===`vertical`?Math.max(i.height,e.scrollHeight):Math.max(i.width,e.scrollWidth);return l(e,t),e.style.visibility=r,o},m=async(e,r)=>{if(r?.aborted)return;let c=d();if(!c||!a)return;let l=c.getBoundingClientRect(),u=n===`vertical`?l.height:l.width,m=c.ownerDocument.defaultView?.getComputedStyle(c).opacity,h=i?m||(e?`0`:o):c.style.opacity||m||(e?`0`:o),g=++s;i?.cancel(),i=null;let _=e?p(c):0;if(c.style.overflow=`hidden`,c.style.visibility=a.visibility,typeof c.animate!=`function`){f(e);return}let v=Ot(c,{keyframes:[],options:{duration:250,easing:`ease`,...t.options,fill:`both`},respectReducedMotion:t.respectReducedMotion});i=c.animate([{[n===`vertical`?`height`:`width`]:`${u}px`,...t.fade===!1?{}:{opacity:h}},{[n===`vertical`?`height`:`width`]:`${_}px`,...t.fade===!1?{}:{opacity:e?o:`0`}}],v);let y=i;await Dt(y,r),!(g!==s||r?.aborted)&&(y.cancel(),i===y&&(i=null),f(e))};return{enter:e=>m(!0,e),leave:e=>m(!1,e),setExpanded(e){s+=1,i?.cancel(),i=null,f(e)},cancel(){s+=1,i?.cancel(),i=null,u(),r=null,a=null}}}function jt(e){return e.filter(e=>e!=null&&e.isConnected)}function Mt(e){e[0]?.getBoundingClientRect()}function Nt(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?Number.parseFloat(t)||0:t.endsWith(`s`)?(Number.parseFloat(t)||0)*1e3:0})}function Pt(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function Ft(e,t,n=[1],r=[!0]){let i=Math.max(e.length,t.length,n.length,r.length),a=0;for(let o=0;o<i;o+=1){if(!r[o%r.length])continue;let i=(e[o%e.length]||0)*(n[o%n.length]||0)+(t[o%t.length]||0);a=Math.max(a,i)}return Math.max(0,a)}function It(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=Ft(Nt(n.transitionDuration),Nt(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=Ft(Nt(n.animationDuration),Nt(n.animationDelay),Pt(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function Lt(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=()=>{clearTimeout(i),t?.removeEventListener(`abort`,r),n()},i=setTimeout(r,e);t?.addEventListener(`abort`,r,{once:!0})})}async function Rt(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,It(t));continue}for(let e of t.getAnimations()){let t=e.effect?.getComputedTiming().endTime;(typeof t!=`number`||Number.isFinite(t))&&n.add(e)}}let i=Array.from(n,e=>e.finished);if(r>0&&i.push(Lt(r,t)),i.length===0)return;let a=Promise.allSettled(i);if(!t){await a;return}await new Promise(e=>{let n=()=>{t.removeEventListener(`abort`,n),e()};if(t.aborted){n();return}t.addEventListener(`abort`,n,{once:!0}),a.then(n)})}function zt(e){let n=`hidden`,r=0,i=null,a=null,o=null,s=()=>(o?.abort(),o=new AbortController,o.signal);return{get phase(){return n},enter:()=>{if(n===`visible`)return Promise.resolve(!1);if(n===`entering`&&i)return i;let a=++r,o=s();return n=`entering`,i=(async()=>{e.mount();let i=jt(e.elements());return Mt(i),(0,t.flushSync)(e.activate),e.motion?await e.motion.enter(o):await Rt(i,o),a===r?(n=`visible`,!0):!1})(),i},leave:()=>{if(n===`hidden`)return Promise.resolve(!1);if(n===`leaving`&&a)return a;let i=++r,o=s();return n=`leaving`,a=(async()=>{(0,t.flushSync)(e.deactivate);let a=jt(e.elements());return e.motion?await e.motion.leave(o):await Rt(a,o),i===r?(e.unmount(),n=`hidden`,!0):!1})(),a},cancel(){r+=1,o?.abort(),o=null,e.motion?.cancel(),n=`hidden`,i=null,a=null}}}let Bt={className:{default:`j-popup-layout`,type:`string`},position:{default:`center`,type:`string`},component:{default:``,type:`string`},labelledby:{default:``,type:`string`},content:{default:``,type:`renderable`}};function Vt(e){let t=R(e,Bt,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function Ht(e={}){let{className:n,position:r,component:i,labelledby:a,content:o}=Vt(e),s={className:`${n} is-${r}`,role:`dialog`,children:z(o)};return i&&(s[`data-${i}`]=`root`,s[`aria-${i}`]=`true`),a&&(s[`aria-labelledby`]=a),(0,t.jsx)(`div`,s)}let Ut={root:`j-drop`,container:`drop-container`},Wt={name:{default:null,types:[`string`,`null`]},mode:{default:`click`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:10,type:`number`,min:0},content:{default:``,type:`renderable`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:Ut,type:`object`,normalize:e=>({...Ut,...e&&typeof e==`object`?e:{}})},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Gt(e){let t=R(e,Wt,`Drop`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,content:t.content,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function Kt(e){return typeof e==`number`&&e>=0?{show:e,hide:e}:typeof e==`object`&&e?{show:Number(e.show)||0,hide:Number(e.hide)||0}:{show:0,hide:0}}function qt(e){return typeof e==`number`&&e>0?e:0}function Jt(e,n={}){let r=G(e),i=Gt(n),a=J(),o=Kt(i.delay),s={show:null,hide:null},c={x:0,y:0,lastMoveTime:0},l=0,u=0,d=!1,f=!1,p,m=null,h=null,g=0,v=()=>{},[y,b]=(0,t.createSignal)(typeof i.content==`function`?null:i.content),[x,S]=(0,t.createSignal)(!1),C=()=>{if(x())return _();let e=y();return typeof e==`function`?e(p):e},{root:w}=(0,t.createRoot)(e=>{v=e;let n=(0,t.jsx)(`div`,{className:i.className.container,"data-drop-container":i.name||i.id,"aria-live":()=>typeof i.content==`function`?`polite`:null,"aria-busy":()=>String(x()),children:()=>z(C())});return{root:(0,t.jsx)(`div`,{className:i.className.root,id:i.id,"data-drop":i.name||Y(),"aria-expanded":`false`,children:n})}}),T=e=>{s[e]&&clearTimeout(s[e]),s[e]=null},E=async()=>{let e=i.content;if(typeof e!=`function`){b(e);return}let t=qt(i.ttl);if(i.cache&&m&&(!t||Date.now()-m.updatedAt<=t)){b(m.content);return}if(h)return h;let n=++g;S(!0);let r=Promise.resolve().then(()=>e(p)).then(e=>{f||n!==g||(i.cache&&(m={content:e,updatedAt:Date.now()}),b(e))}).finally(()=>{n===g&&!f&&S(!1),h===r&&(h=null)});return h=r,r},D=()=>{if(!r)return;let e=r.getBoundingClientRect(),{offset:t,position:n}=i;w.style.visibility=`hidden`,w.style.display=`block`;let a=w.getBoundingClientRect(),o=0,s=0,c=n;switch(c===`auto`&&(c=window.innerHeight-e.bottom>a.height+t?`bottom-center`:`top-center`),c){case`top-left`:o=e.top-a.height-t,s=e.left;break;case`top-center`:o=e.top-a.height-t,s=e.left+e.width/2-a.width/2;break;case`top-right`:o=e.top-a.height-t,s=e.right-a.width;break;case`bottom-left`:o=e.bottom+t,s=e.left;break;case`bottom-center`:o=e.bottom+t,s=e.left+e.width/2-a.width/2;break;case`bottom-right`:o=e.bottom+t,s=e.right-a.width;break;case`left`:o=e.top+e.height/2-a.height/2,s=e.left-a.width-t;break;case`right`:o=e.top+e.height/2-a.height/2,s=e.right+t;break;default:break}o=Math.max(8,Math.min(o,window.innerHeight-a.height-8)),s=Math.max(8,Math.min(s,window.innerWidth-a.width-8)),w.style.top=`${o+window.scrollY}px`,w.style.left=`${s+window.scrollX}px`,w.style.visibility=``,w.style.display=``},O=e=>{f||d===e||(e?(w.parentNode||(0,t.insert)(document.body,w),D(),E().then(()=>{d&&!f&&D()})):(g+=1,h=null,S(!1),w.style.top=``,w.style.left=``,w.remove()),w.setAttribute(`aria-expanded`,e?`true`:`false`),d=e,e?i.onShown?.(p):i.onHidden?.(p))},k=e=>{e.target instanceof Node&&r&&!w.contains(e.target)&&!r.contains(e.target)&&p.hide()},A=e=>{e instanceof MouseEvent&&(l=e.clientX,u=e.clientY,c.lastMoveTime=Date.now(),c.x=e.clientX,c.y=e.clientY)},j=()=>{a.on(`document:mousemove`,document,`mousemove`,A),T(`show`),s.show=setTimeout(()=>{let e=Date.now()-c.lastMoveTime;Math.abs(c.x-l)+Math.abs(c.y-u)<5||e>100?(p.show(!1),a.off(`document:mousemove`)):j()},o.show)};return p={get target(){return r},props:i,get element(){return f?null:w},get isVisible(){return d},delayShow:o.show,delayHide:o.hide,show(e=!0){T(`hide`),!(d||f)&&(e&&o.show>0?(T(`show`),s.show=setTimeout(()=>O(!0),o.show)):O(!0))},hide(e=!0){T(`show`),!(!d||f)&&(e&&o.hide>0?(T(`hide`),s.hide=setTimeout(()=>O(!1),o.hide)):O(!1))},toggle(){d?p.hide():p.show()},destroy(){f||(f=!0,T(`show`),T(`hide`),a.clear(),g+=1,h=null,S(!1),w.remove(),v(),r=null,d=!1)}},r&&(i.mode===`hover`?(a.on(`target:enter`,r,`mouseenter`,()=>{i.hoverIntent?j():p.show()}),a.on(`target:leave`,r,`mouseleave`,()=>{T(`show`),a.off(`document:mousemove`),p.hide()}),a.on(`root:enter`,w,`mouseenter`,()=>p.show()),a.on(`root:leave`,w,`mouseleave`,()=>p.hide())):(a.on(`target:click`,r,`click`,()=>p.toggle()),a.on(`document:click`,document,`click`,k))),p}let Yt={container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}};function Xt(e){let t=e&&typeof e==`object`?e:{},n=`ui`in t&&t.ui&&typeof t.ui==`object`?t.ui:{};return{...Yt,...t,ui:{...Yt.ui,...n}}}let Zt={name:{default:null,types:[`string`,`null`]},mode:{default:`hover`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:8,type:`number`},message:{default:``,type:`string`,normalize:e=>typeof e==`string`?e.trim():e,nonEmpty:!0},theme:{default:!1,types:[`string`,`boolean`],enum:[!1,`reverse`,`primary`,`success`,`warning`,`error`]},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:Yt,type:`object`,normalize:Xt},id:{default:null,types:[`string`,`null`]},delay:{default:100,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Qt(e){let t=R(e,Zt,`Tooltip.props`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,message:t.message,theme:t.theme,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function $t(e,n={}){let r=Qt(n),i=(0,t.jsx)(`div`,{className:B(r.className.container,r.theme&&r.className.ui[r.theme]),"data-tooltip":r.name||r.id||``,children:(0,t.jsx)(`div`,{className:r.className.message,"data-tooltip-message":``,children:r.message})}),a=Jt(e,{name:r.name,mode:r.mode,position:r.position,offset:r.offset,cache:r.cache,ttl:r.ttl,id:r.id,delay:r.delay,hoverIntent:r.hoverIntent,onShown:r.onShown,onHidden:r.onHidden,content:i});return{get element(){return a?.element||null},get drop(){return a},show(e=!0){a?.show(e)},hide(e=!0){a?.hide(e)},toggle(){a?.toggle()},destroy(){a?.destroy(),a=null}}}let en={panel:`j-theme-palette`,title:`theme-palette-title`,container:`palette-container`,item:`palette-item`,itemTitle:`item-title`,items:`items`,button:`j-button is-default`,active:`is-active`,prefix:`el-prefix`,swatch:`item-hex`,buttonText:`button-text`},tn={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:en},nn={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`};function rn(e){return{...en,...e}}function an(e={}){return{...tn,...e,className:rn(e.className)}}function on(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function sn(){return(0,r.createStorage)({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:864e5*7})}function cn(e){if(!y(e))return null;let t=e,n={};for(let e of[`mode`,`theme`,`radius`,`shadow`,`font`]){let r=t[e];typeof r==`string`&&(n[e]=r)}return Object.keys(n).length?n:null}function ln(e){return[{title:e(`Primary`),type:`theme`,buttons:[[`gray`,e(`Gray`)],[`olive`,e(`Olive`)],[`tomato`,e(`Tomato`)],[`ruby`,e(`Ruby`)],[`pink`,e(`Pink`)],[`violet`,e(`Violet`)],[`indigo`,e(`Indigo`)],[`blue`,e(`Blue`)],[`teal`,e(`Teal`)],[`grass`,e(`Grass`)],[`mint`,e(`Mint`)],[`lime`,e(`Lime`)],[`yellow`,e(`Yellow`)],[`orange`,e(`Orange`)],[`gold`,e(`Gold`)]]},{title:e(`Radius`),type:`radius`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)],[`xl`,e(`XL`)],[`round`,e(`Round`)]]},{title:e(`Shadow`),type:`shadow`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)]]},{title:e(`Font`),type:`font`,buttons:[[`sm`,e(`sm`)],[`md`,e(`md`)]]},{title:e(`Mode`),type:`mode`,buttons:[[`light`,e(`Light`)],[`dark`,e(`Dark`)],[`auto`,e(`Auto`)]]}]}function un(e={}){let n=(0,t.createDeepStore)(an(e)),r={configVersion:0,destroyed:!1},i=sn(),o=new Set,s=J(),c=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,l=()=>{let{mode:e,theme:t,radius:r,shadow:a,font:o}=n,s={mode:e,theme:t,radius:r,shadow:a,font:o,render:e===`auto`?c():e};i.set(n.key,s).catch(()=>{})},u=e=>{let r=(0,t.createRoot)(r=>{for(let r of q(`[data-theme-group]`,e)){let e=r.dataset.themeGroup;if(on(e))for(let i of q(`[data-theme-button]`,r)){let r=()=>i.dataset.themeValue===String(n[e]);(0,t.bindClass)(i,n.className.active,r),(0,t.bindAttr)(i,`aria-selected`,()=>r()?`true`:null)}}return r});o.add(r)},d=(e=null,r=null)=>{let i=n.className,o=r||ln(a),s=(0,t.jsx)(`div`,{className:e||i.panel,"data-theme-palette":`root`,children:[(0,t.jsx)(`h3`,{className:i.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:a(`t`)}),(0,t.jsx)(`div`,{className:i.container,"data-theme-container":``,children:o.map(e=>(0,t.jsx)(`div`,{className:i.item,"data-theme-group":e.type,children:[(0,t.jsx)(`div`,{className:i.itemTitle,"data-theme-group-title":e.type,children:e.title}),(0,t.jsx)(`div`,{className:i.items,"data-theme-items":e.type,children:e.buttons.map(([r,a])=>{let o=String(n[e.type])===String(r);return(0,t.jsx)(`button`,{className:B(i.button,o&&i.active),"data-action":`customTheme`,"data-theme-button":e.type,"data-theme-value":r,"aria-selected":o?`true`:null,children:[e.type===`theme`?(0,t.jsx)(`span`,{className:B(i.prefix,i.swatch),"data-theme-swatch":r,style:{backgroundColor:`var(--ui-${r})`}}):null,(0,t.jsx)(`span`,{className:i.buttonText,"data-theme-button-text":r,children:a})]})})})]}))})]});return u(s),s},f=e=>{r.configVersion+=1,(0,t.flushSync)(()=>{Object.assign(n,e,{className:rn({...n.className,...e.className})})}),l()},p=()=>{if(!r.destroyed){r.destroyed=!0,s.clear();for(let e of o)e();o.clear(),i.close().catch(()=>{})}};s.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let i=e.target.closest(`[data-theme-button]`),a=(i?.closest(`[data-theme-group]`))?.dataset.themeGroup,o=i?.dataset.themeValue;if(!i||!on(a)||!o||i.classList.contains(n.className.active))return;let s=n[a];r.configVersion+=1,(0,t.flushSync)(()=>{n[a]=o});let u=document.documentElement;if(a===`mode`)u.classList.remove(`light`,`dark`,s),u.classList.add(o===`auto`?c():o);else{let e=nn[a],t=Array.from(u.classList).filter(t=>t.startsWith(e));t.length&&u.classList.remove(...t),u.classList.add(`${e}${o}`)}l()});let m=r.configVersion;return i.get(n.key).then(e=>{if(r.destroyed||r.configVersion!==m)return;let i=cn(e);i&&(0,t.flushSync)(()=>{Object.assign(n,i)})}).catch(()=>{}),{props:n,createPanel:d,setConfig:f,destroy:p}}let dn={color:`var(--tone-solid)`,size:`12px`},fn={ball:`parabola-ball`},pn={types:[`string`,`Node`,`array`,`null`,`undefined`]},mn={ball:{default:dn,type:`plainObject`,normalize:e=>({...dn,...e&&typeof e==`object`?e:{}}),shape:{color:`string`,size:`string`}},className:{default:fn,type:`object`,normalize:e=>({...fn,...e&&typeof e==`object`?e:{}})},from:{default:null,...pn},to:{default:null,...pn},direction:{default:`center`,type:`string`,enum:[`center`,`top-right`,`top-left`,`bottom-right`,`bottom-left`]},showDelay:{default:0,type:`number`},onShow:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function hn(e){let t=R(e,mn,`Parabola.props`);return{ball:t.ball,className:t.className,from:t.from,to:t.to,direction:t.direction,showDelay:t.showDelay,onShow:t.onShow,onHidden:t.onHidden}}function gn(e={}){let n=hn(e),r={destroyed:!1},i=new Set,a=new Map,o=new Map,s=null,c=G(n.from),l=G(n.to),u,d=()=>{if(!r.destroyed){if(s){s.isConnected||(0,t.insert)(document.body,s);return}s=(0,t.jsx)(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),(0,t.insert)(document.body,s)}},f=()=>{i.size>0||(s?.remove(),s=null)},p=(e,t)=>{if(!i.has(e))return;let r=o.get(e);r!==void 0&&cancelAnimationFrame(r),o.delete(e),e.remove(),i.delete(e),t&&n.onHidden?.(u),f()},m=e=>{if(r.destroyed||(d(),!s))return null;let{color:a,size:o}=n.ball,c=(0,t.jsx)(`div`,{className:n.className.ball,"data-parabola":`ball`,style:{backgroundColor:a,width:o,height:o,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return(0,t.insert)(s,c),i.add(c),c},h=()=>{let e=c?.getBoundingClientRect(),t=l?.getBoundingClientRect();if(!e||!t)return null;let{left:r,top:i,width:a,height:o}=e,{left:s,top:u,width:d,height:f}=t,p,m;switch(n.direction){case`top-left`:p=r+a*.2,m=i+o*.2;break;case`top-right`:p=r+a*.8,m=i+o*.2;break;case`bottom-left`:p=r+a*.2,m=i+o*.8;break;case`bottom-right`:p=r+a*.8,m=i+o*.8;break;default:p=r+a/2,m=i+o/2}let h=s+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},g=(e,t,n,i,a,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=a-n,d=i=>{if(r.destroyed||!e.isConnected){o.delete(e);return}let a=i-c,f=Math.min(a/s,1),m=1-(1-f)**3,h=t+l*m,g=n+-100*Math.sin(Math.PI*m)+u*m,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-m*.3})`,f<1?o.set(e,requestAnimationFrame(d)):(o.delete(e),p(e,!0))};o.set(e,requestAnimationFrame(d))},_=(e,t)=>{let r=`parabola-show-${Y()}`;a.set(r,t),xe.start(r,n.showDelay,()=>{a.delete(r),e()})},v=()=>{for(let[e,t]of a)xe.cancel(e),t();a.clear()};return u={props:n,runtime:r,get element(){return s},show(){return r.destroyed?Promise.resolve(!1):new Promise(e=>{_(()=>{if(r.destroyed){e(!1);return}c=G(n.from),l=G(n.to);let t=h();if(!t){e(!1);return}let i=m(t);if(!i){e(!1);return}n.onShow?.(u),g(i,t.startX,t.startY,t.endX,t.endY),e(!0)},()=>e(!1))})},destroy(){if(!r.destroyed){v(),c=null,l=null,r.destroyed=!0;for(let e of i)p(e,!1);o.clear(),f()}}},u}let _n={target:{default:null},parent:{default:null},max:{default:10,type:`number`,integer:!0,greaterThan:0},top:{default:16,type:`number`,min:0},gap:{default:16,type:`number`,min:0},overflow:{default:`destroy`,type:`string`,enum:[`destroy`,`ignore`]},reactive:{default:!1,type:`boolean`},onReBuild:{default:null,types:[`function`,`null`]}};function vn(e){let t=R(e,_n,`Sticky.props`);return{target:t.target,parent:t.parent,max:t.max,top:t.top,gap:t.gap,overflow:t.overflow,reactive:t.reactive,onReBuild:t.onReBuild}}function yn(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function bn(e){return e===!1||e==null?null:de(e,`Sticky.parent`,`element`)}function xn(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return yn(de(e,`Sticky.target`,`array`));let n=yn(q(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=yn(de(e,`Sticky.target`,`array`));if(!t)return n;let r=n.filter(e=>e===t||t.contains(e));if(r.length===0)throw Error(`Sticky.target: target not found in parent.`);return r}function Sn(e={}){let n=vn(e),r=(0,t.createDeepStore)({items:[]}),i={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},a={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,u=e=>e.length<=n.max?e:n.overflow===`ignore`?[]:e.slice(-n.max),d=()=>{for(let e of a.originalStyles.values())f(e)},f=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},p=(e,t)=>{if(e.id)return e.id;let n=a.keys.get(e);if(n)return n;let r=`sticky-${Y()}-${t}`;return a.keys.set(e,r),r},m=e=>{a.originalStyles.has(e)||a.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},h=()=>u(xn(n.target,o)),g=(e=n.top)=>{let i=e,o=[],c=new Set(s);for(let[e,t]of a.originalStyles)c.has(e)||(f(t),a.originalStyles.delete(e));return s.forEach((e,t)=>{m(e),e.style.position=`sticky`,e.style.top=`${i}px`,o.push({key:p(e,t),index:t,top:i}),i+=e.offsetHeight+n.gap}),(0,t.flushSync)(()=>{r.items=o}),n.onReBuild?.(l),i},_=()=>{if(c?.disconnect(),c=null,!n.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{i.reBuilding||i.destroyed||!i.built||(i.reBuilding=!0,i.reBuildFrameId=requestAnimationFrame(()=>{i.reBuilding=!1,i.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:n,state:r,runtime:i,build:()=>{if(i.destroyed)throw Error(`Sticky.build: instance destroyed`);return i.built?l:(o=bn(n.parent),s=h(),i.built=!0,_(),s.length===0?((0,t.flushSync)(()=>{r.items=[]}),l):(g(),l))},reBuild:()=>(!i.destroyed&&i.built&&(s=h(),g()),l),destroy:()=>{i.destroyed||(i.reBuildFrameId&&cancelAnimationFrame(i.reBuildFrameId),c?.disconnect(),c=null,d(),i.destroyed=!0,i.built=!1,i.reBuilding=!1,i.reBuildFrameId=0,a.originalStyles.clear(),s=[],o=null)}},l}let Cn={help:`help-block`},wn={rules:{default:{},type:`object`},messages:{default:{},type:`object`},vanilla:{default:!1,type:`boolean`},className:{default:Cn,type:`object`,normalize:e=>Tn(e)},onSubmit:{default:null,types:[`function`,`null`]}};function Tn(e){return{...Cn,...y(e)?e:{}}}function En(e){let t=R(e,wn,`Validator.props`);return{rules:t.rules,messages:t.messages,vanilla:t.vanilla,className:t.className,onSubmit:t.onSubmit}}function Dn(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function On(e){if(!e)return null;if(e instanceof Element)return Dn(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&Dn(t))return t;return null}function kn(){return{valid:!0,error:!1,message:``,destroyed:!1}}function An(e){return e.closest(`[data-field-control]`)||e.parentElement}function jn(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function Mn(e){return e instanceof HTMLInputElement&&e.type===`file`}function Nn(e){return!!e.files&&e.files.length>0}function Pn(e,t){return t===!0?e instanceof HTMLSelectElement?jn(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function Fn(e,t){return typeof t!=`number`||e.value.length>=t}function In(e,t){return typeof t!=`number`||e.value.length<=t}function Ln(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function Rn(e,t,n){if(!e||typeof n!=`string`)return!0;let r=On(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function zn(e,t){if(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)throw Error(`Validator: element expects a checkbox input, but ${e.tagName.toLowerCase()} given.`);return e.checked===t}function Bn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||jn(e).some(e=>e.length>0)}function Vn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||e.selectedOptions.length>0}function Hn(e,t){if(!e||!(t instanceof HTMLInputElement)||t.type!==`checkbox`)return[];let n=Array.from(e.elements).filter(e=>e instanceof HTMLInputElement&&e.type===`checkbox`&&e.name===t.name&&!e.closest(`[data-field-switch]`));return n.length>1||t.closest(`[data-choice-type="checkbox"], [data-field-choice-group]`)?n:[]}function Un(e,t){let n=Hn(e,t);return n.length===0?null:n.filter(e=>e.checked).length}function Wn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length>=n;let r=Un(e,t);return r===null||r>=n}function Gn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length<=n;let r=Un(e,t);return r===null||r<=n}function Kn(e,t){return!/\s/.test(e.value)||t!==!0}function qn(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function Jn(e,t){return!Mn(e)||t!==!0||Nn(e)}function Yn(e,t){return!Mn(e)||!Nn(e)||typeof t!=`number`||e.files[0].size>=t}function Xn(e,t){return!Mn(e)||!Nn(e)||typeof t!=`number`||e.files[0].size<=t}function Zn(e,t){if(!Mn(e)||!Nn(e)||typeof t!=`string`)return!0;let n=e.files[0];return t.split(`,`).map(e=>e.trim().toLowerCase()).some(e=>e.startsWith(`.`)?n.name.toLowerCase().endsWith(e):e.endsWith(`/*`)?n.type.startsWith(e.replace(`/*`,`/`)):n.type===e)}function Qn(e,n,r,i,a,o=``){r.dataset.valid=`false`;let s=o||e?.messages[i]?.[a]||``;if(!s)return;n.message=s;let c=An(r);if(!c)return;let l=q(`[data-validator-help]`,c).find(e=>e.dataset.validatorHelp===i)||null;l||(l=(0,t.jsx)(`div`,{"data-valid":`false`,"data-validator-help":i}),c.appendChild(l)),l.className=B(e?.className.help),l.dataset.valid=`false`,l.textContent=s}function $n(e){let t=An(e);if(t)for(let n of q(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();e.removeAttribute(`data-valid`)}function er(e,t={},n=!1){L(`bindEvents`,n,`boolean`,`Validator`);let r=G(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=En(t),o=i.noValidate,s=kn(),c=J(),l=new Set,u,d=()=>{i&&(i.noValidate=a?.vanilla===!1)},f=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,u);return typeof n==`string`?n:!!n},p=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let o=n[r],c=``;switch(r){case`required`:s.valid=Pn(e,o);break;case`minLength`:s.valid=Fn(e,o);break;case`maxLength`:s.valid=In(e,o);break;case`equalTo`:s.valid=Rn(i,e,o);break;case`email`:s.valid=Ln(e);break;case`checked`:s.valid=zn(e,o);break;case`selected`:s.valid=Bn(e,o);break;case`multiple`:s.valid=Vn(e,o);break;case`min`:s.valid=Wn(i,e,o);break;case`max`:s.valid=Gn(i,e,o);break;case`noSpace`:s.valid=Kn(e,o);break;case`noChinese`:s.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:s.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:s.valid=qn(e,o);break;case`file`:s.valid=Jn(e,o);break;case`minSize`:s.valid=Yn(e,o);break;case`maxSize`:s.valid=Xn(e,o);break;case`accept`:s.valid=Zn(e,o);break;case`validate`:{let t=f(e,o);s.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!s.valid){s.error=!0,l.add(t),Qn(a,s,e,t,r,c);break}$n(e)}return s.valid&&l.delete(t),s.valid},m=e=>{if(!a||s.destroyed||!e.name||!a.rules[e.name])return!0;let t=p(e,e.name);return t&&l.size===0&&(s.valid=!0,s.error=!1,s.message=``),t},h=()=>{if(!i||!a||s.destroyed)return!1;s.valid=!0,s.error=!1,s.message=``,l.clear();for(let e of Array.from(i.elements))if(!(!Dn(e)||!e.name)&&a.rules[e.name]&&(s.valid=p(e,e.name),!s.valid))break;return s.valid&&a.onSubmit?.(u),s.valid},g=e=>{if(!s.error)return;let t=e.target;!(t instanceof Element)||!Dn(t)||!t.name||!l.has(t.name)||m(t)},_=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))Dn(e)&&e.removeAttribute(`data-valid`);for(let e of q(`[data-validator-help]`,i))e.remove();s.valid=!0,s.error=!1,s.message=``,l.clear()}};return u={get element(){return i},get props(){return a},set props(e){a=e,d()},runtime:s,validate:h,reset:_,destroy:()=>{s.destroyed||(s.destroyed=!0,c.clear(),_({native:!1}),i&&(i.noValidate=o),i=null,a=null,s.valid=!1,s.error=!1,s.message=``,l.clear())}},n&&(c.on(`submit`,i,`submit`,e=>{e.preventDefault(),h()}),c.on(`reset`,i,`reset`,()=>_({native:!1}))),c.on(`input`,i,`input`,g),c.on(`change`,i,`change`,g),d(),u}let tr=new Map;function nr(e,t){!e||!t||tr.set(e,t)}function rr(e){tr.delete(e)}function ir(e){typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}function Q(e){let n={built:!1,mounted:!1,destroyed:!1},r=new Map,i=new Set,a=new Map,o=null,s=null,c,l=t=>{if(n.destroyed)throw Error(`${e.name}.${t}: instance destroyed`)},u=(e,...t)=>{for(let n of r.get(e)||[])try{n(...t)}catch{}},d={props:e.props,state:e.state,runtime:n,get element(){return o},own(e){e&&i.add(e)},assertActive:l,emit:u},f={props:e.props,state:e.state,runtime:n,get element(){return o},build(){if(l(`build`),n.built)return c;let t=Tt(()=>e.view(d),{removeOnDispose:e.ownsElement});return o=t.element,s=t.dispose,n.built=!0,e.onBuild?.(d),u(`build`,c),c},mount(t){if(l(`mount`),n.built||c.build(),!o)throw Error(`${e.name}.mount: view did not create an element.`);return o.parentNode!==t&&t.appendChild(o),n.mounted=!0,e.onMount?.(d),u(`mount`,c,t),c},unmount(){return l(`unmount`),!n.mounted&&!o?.parentNode?c:(e.onUnmount?.(d),e.ownsElement!==!1&&o?.remove(),n.mounted=!1,u(`unmount`,c),c)},setState(n={},r){l(`setState`);let i=typeof n==`string`&&arguments.length>1?{[n]:r}:n;if(!y(i))throw Error(`${e.name}.setState: expects a plain object patch.`);let a=e.normalizeStatePatch?e.normalizeStatePatch(i):i;if(!y(a))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(a,e.state);else for(let t of Object.keys(a))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return(0,t.flushSync)(()=>{Object.assign(e.state,a)}),c},own(e){return e&&i.add(e),c},use(e,t){if(!e)return c;let n=typeof e==`function`?e(c,t):e.install(c,t);return a.set(e,n),c},on(e,t){if(!e||typeof t!=`function`)return c;let n=r.get(e);return n||(n=new Set,r.set(e,n)),n.add(t),c},off(e,t){return r.get(e)?.delete(t),c},emit(e,...t){return u(e,...t),c},destroy(){if(!n.destroyed){n.destroyed=!0,e.onDestroy?.(d),u(`destroy`,c);for(let e of i)try{ir(e)}catch{}i.clear();for(let e of a.values())try{ir(e)}catch{}a.clear(),s?.(),s=null,e.ownsElement!==!1&&o?.remove(),o=null,n.built=!1,n.mounted=!1,r.clear()}}};c=Object.assign(f,e.actions||{});for(let e of tr.values())c.use(e);return c}let ar={toc:`j-toc`,list:`toc-list`,link:`toc-link`,active:`is-active`,levelPrefix:`is-level-`},or={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},reactive:{default:!1,type:`boolean`},className:{default:ar,type:`object`,normalize:e=>({...ar,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]}};function sr(e){let t=R(e,or,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,reactive:t.reactive,className:t.className,onChange:t.onChange}}function cr(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function lr(e,t){return e.id||=`toc-${Y()}-${t}`,{id:e.id,text:e.textContent||``,level:cr(e)}}function ur(e={}){let n=sr(e),r=(0,t.createDeepStore)({items:[],current:{index:-1,item:null}}),i={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0},a=J(),o=null,s=[],c=null,l,u=(0,t.createMemo)(()=>r.items),d=e=>{if(e===r.current.index)return;let i=r.items[e]||null;(0,t.flushSync)(()=>{r.current={index:e,item:i}}),n.onChange?.(i,e,l)},f=()=>{if(!l.runtime.built)return;let e=-1,t=n.offset+1;for(let n=s.length-1;n>=0;n--)if(s[n].getBoundingClientRect().top<=t){e=n;break}d(e)},p=()=>{i.ticking||(i.ticking=!0,i.frameId=requestAnimationFrame(()=>{i.ticking=!1,i.frameId=0,f()}))},m=()=>{i.refreshing||(i.refreshing=!0,i.refreshFrameId=requestAnimationFrame(()=>{i.refreshing=!1,i.refreshFrameId=0,g()}))},h=(e,{activeIndex:t=-1,updateHash:r=!1}={})=>{let i=s.find(t=>t.id===e.id);if(!i)return;let a=window.scrollY||window.pageYOffset||0,o=Math.max(0,i.getBoundingClientRect().top+a-n.offset);window.scrollTo({top:o,behavior:`smooth`}),t>=0&&d(t),r&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},g=()=>{if(l.runtime.destroyed||!l.runtime.built||!o)return;s=q(n.headings,o);let e=s.map(lr);(0,t.flushSync)(()=>{r.items=e,r.current={index:-1,item:null}}),f()};return l=Q({name:`Toc`,props:n,state:r,actions:{activate:e=>(l.runtime.built&&Number.isInteger(e)&&e>=0&&e<r.items.length&&h(r.items[e]),l)},view:()=>(0,t.jsx)(`nav`,{className:n.className.toc,"data-toc":`root`,children:(0,t.jsx)(`div`,{className:n.className.list,"data-toc-list":`root`,children:(0,t.For)({each:u,key:e=>e.id,children:(e,i)=>(0,t.jsx)(`a`,{className:()=>{let t=e();return B(n.className.link,`${n.className.levelPrefix}${t.level}`,r.current.index===i()?n.className.active:``)},href:()=>`#${e().id}`,"data-toc-index":()=>String(i()),"data-toc-target":()=>e().id,"data-active":()=>r.current.index===i()?`1`:`0`,onClick:t=>{t.preventDefault(),h(e(),{activeIndex:i(),updateHash:!0})},children:()=>e().text})})})}),onBuild(e){o=de(n.target,`Toc.target`),a.on(`scroll`,window,`scroll`,p,{passive:!0}),e.own(()=>a.clear()),g(),n.reactive&&(c=new MutationObserver(m),c.observe(o,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{c?.disconnect(),c=null}))},onDestroy(){i.frameId&&cancelAnimationFrame(i.frameId),i.refreshFrameId&&cancelAnimationFrame(i.refreshFrameId),i.frameId=0,i.refreshFrameId=0,i.ticking=!1,i.refreshing=!1,c?.disconnect(),c=null,o=null,s=[]}}),l}let dr={root:`j-accordion`,header:`accordion-header`,title:`header-title`,arrow:`header-arrow j-button is-icon is-ghost is-sm`,panel:`accordion-panel`,content:`panel-content`},fr={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},pr={type:`array`,nonEmpty:!0,items:fr},mr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(hr):hr(e),message:`expects a non-negative integer, non-empty string, array or null.`},collapsible:{default:!1,type:`boolean`},multiple:{default:!1,type:`boolean`},direction:{default:`vertical`,type:`string`,enum:[`vertical`,`horizontal`]},className:{default:dr,type:`object`,normalize:e=>({...dr,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]},data:{default:[],...pr}};function hr(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function gr(e){let t=R(e,mr,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,direction:t.direction,className:t.className,data:vr(t.data,!1),onChange:t.onChange}}function _r(e,t,n=!0){n&&L(String(t),e,fr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||Y()}}function vr(e,t=!0){t&&L(`data`,e,pr,`Accordion`);let n=new Set;return e.map((e,t)=>{let r=_r(e,t,!1),i=r.name;if(n.has(i))throw Error(`Accordion: item name "${i}" must be unique.`);return n.add(i),r})}function yr(e,t,n){if(e==null)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){let r=t[typeof e==`number`?e:t.findIndex(t=>t.name===e)]?.name;if(r&&(i.push(r),!n))break}return Array.from(new Set(i))}function br(e,t,n){let r=new Set(t.map(e=>e.name).filter(Boolean)),i=e.filter(e=>r.has(e));return n?i:i.slice(0,1)}function xr(e,t){let n=e[0]||null;if(!n)return{index:null,name:null};let r=t.findIndex(e=>e.name===n);return r>=0?{index:r,name:n}:{index:null,name:null}}function Sr(e){return typeof e==`number`&&e>0?e:0}function Cr(e){let n=gr(e),r=yr(n.active,n.data,n.multiple),i=(0,t.createDeepStore)({data:n.data,activeNames:r,loading:!1}),a=new WeakMap,o=wt(),s=wt(),c=new Map,l=new Map,u=new Map,d=new Set(r),p=Promise.resolve(),m=0,h=0,g=!1,v,y=e=>(typeof e.name==`string`?e.name.trim():``)||(a.has(e)||a.set(e,Y()),a.get(e)),b=()=>{let e=i.data.map(e=>({...e,name:y(e)}));return xr(br(i.activeNames,e,n.multiple),e)},x=e=>i.activeNames.includes(e),S=()=>{h+=1,!g&&!v.runtime.destroyed&&(g=!0,(0,t.flushSync)(()=>{i.loading=!0}))},C=()=>{h=Math.max(0,h-1),h===0&&g&&!v.runtime.destroyed&&(g=!1,(0,t.flushSync)(()=>{i.loading=!1}))},w=e=>typeof e==`number`?e:typeof e==`string`?i.data.findIndex(t=>y(t)===e):-1,T=e=>{let t=new Set(e),n=new Set([...d,...t]),r=[];for(let e of n){let n=d.has(e),i=t.has(e);if(n===i)continue;let a=s.get(e);a&&(a.inert=!i);let o=c.get(e);o&&r.push(i?o.enter():o.leave())}return d=t,r.length>0&&(p=Promise.all(r).then(()=>void 0)),p},E=e=>r=>{s.bind(e)(r),c.get(e)?.cancel();let a=At(()=>s.get(e),{axis:n.direction,options:{duration:250,easing:`ease`}});c.set(e,a);let o=x(e);r.inert=!o,a.setExpanded(o),(0,t.onCleanup)(()=>{c.get(e)===a&&(a.cancel(),c.delete(e),d.delete(e),i.activeNames.includes(e)&&(0,t.flushSync)(()=>{i.activeNames=i.activeNames.filter(t=>t!==e)}))})},D=async e=>{if(v.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!v.runtime.built)throw Error(`Accordion.activate: call build() first.`);let r=w(e),a=i.data[r];if(!a)return;let c=y(a),l=x(c);if(l&&!n.multiple&&!n.collapsible)return;let d;if(n.multiple)if(l){let e=i.activeNames.filter(e=>e!==c);d=!n.collapsible&&e.length===0?[...i.activeNames]:e}else d=[...i.activeNames,c];else d=l?n.collapsible?[]:[...i.activeNames]:[c];(0,t.flushSync)(()=>{i.activeNames=d});let f=T(d),p=d.includes(c)&&u.get(c)?.()||Promise.resolve(),m=o.get(c),h=s.get(c),g=n.onChange&&m&&h?p.then(()=>n.onChange?.(r,c,m,h,v)):Promise.resolve();await Promise.all([f,g])},O=(e,t,n)=>{let r=y(e);return{accordion:v,item:e,index:t,type:n,active:x(r)}},k=(e,t,n)=>typeof e==`function`?e(O(t,n,`title`)):e,A=(e,n,r)=>{let i=e().content,[a,o]=(0,t.createSignal)(typeof i==`function`?null:i),[s,c]=(0,t.createSignal)(!1),d=i,f=0,p=null,h=()=>O(e(),n(),`content`),g=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){o(n);return}let i=t.cache?l.get(r):null,a=Sr(t.ttl);if(i&&(!a||Date.now()-i.updatedAt<=a)){o(i.content);return}if(p)return p;let s=++f;m+=1;let u=m;c(!0),S();let d=Promise.resolve().then(()=>n(h())).then(t=>{s!==f||v.runtime.destroyed||(e().cache&&l.set(r,{content:t,updatedAt:Date.now()}),o(t))}).finally(()=>{s===f&&!v.runtime.destroyed&&c(!1),u<=m&&C(),p===d&&(p=null)});return p=d,d};return u.set(r,g),(0,t.onCleanup)(()=>{f+=1,l.delete(r),u.delete(r),p=null}),(0,t.createEffect)(()=>{let t=e().content;t!==d&&(d=t,f+=1,p=null,l.delete(r),o(typeof t==`function`?null:t)),x(r)&&g()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return _(`flex-start`,`flex-start`);let e=a();return typeof e==`function`?e(h()):e}}},j=(e,r)=>{let i=y(e()),a=A(e,r,i),s=`${n.id}_header_${i}`,c=`${n.id}_panel_${i}`;return[(0,t.jsx)(`div`,{className:n.className.header,id:s,"data-accordion-header":i,role:`button`,tabindex:`0`,"aria-controls":c,"aria-expanded":()=>x(i)?`true`:`false`,ref:o.bind(i),onClick:()=>void D(i),onKeyDown:e=>{e instanceof KeyboardEvent&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),D(i))},children:[(0,t.jsx)(`span`,{className:n.className.title,"data-accordion-title":i,role:`heading`,children:()=>{let t=e();return z(k(t.title,t,r()))}}),(0,t.jsx)(`span`,{className:n.className.arrow,"data-accordion-arrow":i,"aria-hidden":`true`,children:f(`arrow-down`)})]}),(0,t.jsx)(`div`,{className:n.className.panel,"data-accordion-panel":i,id:c,role:`region`,"aria-labelledby":s,"aria-hidden":()=>x(i)?`false`:`true`,"aria-live":()=>a.isAsync()?`polite`:null,"aria-busy":()=>String(a.loading()),"data-state":()=>x(i)?`open`:`closed`,ref:E(i),children:(0,t.jsx)(`div`,{className:n.className.content,"data-accordion-content":i,children:()=>z(a.render())})})]};return v=Q({name:`Accordion`,props:n,state:i,actions:{isActive:x,getIndex:w,activate:D},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:vr(e.data)}:{}}},view:()=>{let e=(0,t.jsx)(`div`,{className:n.className.root,id:n.id,"data-accordion":`root`,"data-direction":n.direction,children:(0,t.For)({each:()=>i.data,key:e=>y(e),children:(e,t)=>j(e,t)})});return d=new Set(i.activeNames),(0,t.createEffect)(()=>{T([...i.activeNames])}),e},onDestroy(){m+=1,h=0,g=!1,l.clear(),u.clear();for(let e of c.values())e.cancel();c.clear(),o.clear(),s.clear()}}),Object.defineProperty(v,"current",{enumerable:!0,get:b}),v}let wr={form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-field`,label:`field-legend`,required:`is-required`,control:`field-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,submitBtn:`is-primary`,resetBtn:`is-ghost`,input:`j-input`,textarea:`j-textarea`,select:`j-select`,radio:`j-radio`,checkbox:`j-checkbox`,choiceVertical:`is-vertical`,choiceHorizontal:`is-horizontal`,choiceGroup:`is-group`,radioLabel:`radio-label`,radioText:`radio-text`,switch:`j-switch is-default`,switchSlider:`switch-slider`},Tr={submit:a(`Submit`),reset:a(`Reset`)},Er={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():Y():e??Y()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},size:{default:`md`,type:`string`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:!0,types:[`boolean`,`string`]},buttonsPosition:{default:`start`,type:`string`},text:{default:Tr,type:`object`,normalize:e=>Lr(e)},className:{default:wr,type:`object`,normalize:e=>Ir(e)},validator:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function Dr(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function Or(e){return{...e,options:Dr(e.options)}}function kr(e){return{...e.id?{id:e.id}:{},type:e.type,payload:Or(e.payload),next:e.next||null}}function Ar(e){return Array.isArray(e)?e.map(e=>kr(e)):[]}function jr(e,t){let n=[],r=Array.isArray(e)?e:[],i=new WeakSet,a=e=>{let t=r.indexOf(e);return t>=0&&r[t+1]||null};for(let e of r){if(i.has(e))continue;let r=e,o=[],s=0;for(;r&&s<1e3&&(s+=1,!i.has(r));){i.add(r),n.push(r),o.push(r);let e=r.next?r.next(r,o):a(r);r=e?t(e):null}}return n}function Mr(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function Nr(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function Pr(e){return e==null||Array.isArray(e)?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function Fr(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function Ir(e){return{...wr,...y(e)?e:{}}}function Lr(e){return{...Tr,...y(e)?e:{}}}function Rr(e,t){return typeof e==`function`?e(t):e}function zr(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!y(t))return;let n=t;for(let[t,r]of Object.entries(n)){if(r==null||typeof r!=`string`&&typeof r!=`number`)continue;let n=t.startsWith(`--`)?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);e.style.setProperty(n,String(r))}}function Br(e){return e===`center`?e:`flex-${e}`}function Vr(e){let t=y(e)?e:{};return{...t,vanilla:t.vanilla===!0,rules:y(t.rules)?t.rules:{},messages:y(t.messages)?t.messages:{}}}function Hr(e){let t=R(e,Er,`Form.props`),n=Ar(t.fields);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,size:t.size,style:t.style,fields:n,buttons:t.buttons,buttonsPosition:t.buttonsPosition,text:Lr(t.text),className:Ir(t.className),validator:Vr(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function Ur(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function Wr(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Gr(e,n,r){(0,t.bindAttr)(e,n,()=>Wr(r()))}function Kr(e,t){return Array.isArray(e)?e.map(e=>Nr(e)).includes(Nr(t)):e==t}function qr(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>Nr(e)).includes(Nr(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||Nr(e)===Nr(t):n}function Jr(e){return e instanceof RadioNodeList?Array.from(e):[e]}function Yr(e={}){let n=Hr(e),r=(0,t.createDeepStore)({fields:Ar(n.fields),submitting:!1}),i={fieldIds:new Map},a=new WeakMap,[o,s]=(0,t.createSignal)(0),c=new WeakMap,l=null,u,d=e=>{if(r.fields.includes(e))return e;let n=c.get(e);if(n)return n;let i=(0,t.createDeepStore)(kr(e));return c.set(e,i),i},f=(0,t.createMemo)(()=>(o(),jr(r.fields,d))),p=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(a.has(e)||a.set(e,Y()),a.get(e)),m=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${p(n)}:${e.type}`:`item:${e.type}:${t}`},h=(e,t)=>{if(e.id)return e.id;let r=e.name||t;return i.fieldIds.has(r)||i.fieldIds.set(r,`${n.id}_field_${t}`),i.fieldIds.get(r)},g=()=>{let e=u.element;if(!e)return;let t={...n.validator,onSubmit:null};if(l?.element===e){l.props=t;return}l?.destroy(),l=er(e,t,!1)},v=()=>l?.validate()??!0,y=()=>{let e=u.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`),t.removeAttribute(`data-valid`);for(let t of q(`[data-field-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},b=()=>{let e={};if(!u.element)return e;for(let[t,n]of new FormData(u.element).entries())Object.hasOwn(e,t)?e[t]=Array.isArray(e[t])?[...e[t],n]:[e[t],n]:e[t]=n;return e},x=async e=>{if(e.preventDefault(),r.submitting||!v())return;let i=b();(0,t.flushSync)(()=>{r.submitting=!0});try{await Promise.resolve(n.onSubmit?.(i,u))}finally{u.runtime.destroyed||(0,t.flushSync)(()=>{r.submitting=!1})}},S=e=>{if(!e.name||!u.element)return[];let t=u.element.elements.namedItem(e.name);return t?Jr(t).filter(e=>e instanceof Element):[]},C=(e,n,r=`text`)=>{(0,t.flushSync)(()=>{if(n instanceof HTMLSelectElement){e.value=n.multiple?Array.from(n.selectedOptions).map(e=>e.value):n.value;return}if(n instanceof HTMLTextAreaElement){e.value=n.value;return}if(r===`switch`){e.checked=n.checked,e.value=n.checked?n.value:``;return}if(r===`radio`){n.checked&&(e.value=n.value);return}if(r===`checkbox`){if(Array.isArray(e.options)){e.value=S(e).filter(e=>e instanceof HTMLInputElement&&e.checked).map(e=>e.value);return}e.checked=n.checked,e.value=n.checked?n.value:``;return}e.value=n.value,n.type===`checkbox`&&(e.checked=n.checked)}),s(e=>e+1)},w=(e,t,n)=>({...n,name:()=>e().name,id:t,required:()=>!!e().required,disabled:()=>r.submitting||!!e().disabled,"data-field-item":()=>e().name||t}),T=()=>n.size?`is-${n.size}`:``,E=e=>{let t=e.size||n.size;return t?`is-${t}`:``},D=(e,t)=>B(e.className||t,E(e)),O=(e,i,a)=>(0,t.jsx)(`div`,{className:()=>{let t=e(),r=t.vertical?`vertical`:`horizontal`,i=n.className;return B(a===`radio`?i.radio:i.checkbox,r===`vertical`?i.choiceVertical:i.choiceHorizontal,t.group?i.choiceGroup:``,t.size?`is-${t.size}`:``)},"data-field-choice-group":()=>e().name||i,"data-choice-type":a,"data-choice-layout":()=>e().vertical?`vertical`:`horizontal`,children:()=>(e().options||[]).map((o,s)=>{let c=Mr(o),l=`${i}_${s}`;return(0,t.jsx)(`label`,{className:()=>a===`radio`?n.className.radioLabel:``,"data-field-choice":()=>e().name||i,for:l,children:[(0,t.jsx)(`input`,{type:a,id:l,name:()=>e().name,value:c.value??``,checked:()=>a===`radio`?Kr(e().value,c.value):qr(e().value,c.value,c.checked),disabled:()=>r.submitting||!!c.disabled||!!e().disabled,required:()=>!!e().required,onChange:t=>{let n=t.currentTarget;n instanceof HTMLInputElement&&C(e(),n,a)}}),(0,t.jsx)(`span`,{className:()=>a===`radio`?n.className.radioText:``,"data-field-choice-text":``,children:z(c.text??c.label??Nr(c.value))})]})})}),k=(e,i,a,o)=>{let s=e().type;if(s===`textarea`)return(0,t.jsx)(`textarea`,w(i,a,{className:()=>i().className||n.className.textarea,placeholder:()=>i().placeholder||``,readonly:()=>!!i().readonly,ref:e=>Gr(e,`autocomplete`,()=>i().autocomplete),value:()=>Pr(i().value),onInput:e=>{let t=e.currentTarget;t instanceof HTMLTextAreaElement&&C(i(),t,`textarea`)}}));if(s===`select`)return(0,t.jsx)(`select`,w(i,a,{className:()=>D(i(),n.className.select),ref:e=>Gr(e,`autocomplete`,()=>i().autocomplete),multiple:()=>!!i().multiple,value:()=>i().multiple?void 0:Pr(i().value),onChange:e=>{let t=e.currentTarget;t instanceof HTMLSelectElement&&C(i(),t,`select`)},children:()=>(i().options||[]).map(e=>{let n=Mr(e);return(0,t.jsx)(`option`,{value:n.value??``,disabled:!!n.disabled,selected:()=>Kr(i().value,n.value),children:z(n.text??n.label??Nr(n.value))})})}));if(s===`radio`)return O(i,a,`radio`);if(s===`checkbox`&&Array.isArray(i().options))return O(i,a,`checkbox`);if(s===`switch`)return(0,t.jsx)(`label`,{className:()=>{let e=n.className;return B(e.switch,E(i()))},"data-field-switch":()=>i().name||a,for:a,children:[(0,t.jsx)(`input`,{type:`checkbox`,id:a,name:()=>i().name,value:()=>i().value??`1`,checked:()=>!!i().checked,disabled:()=>r.submitting||!!i().disabled,required:()=>!!i().required,onChange:e=>{let t=e.currentTarget;t instanceof HTMLInputElement&&C(i(),t,`switch`)}}),(0,t.jsx)(`span`,{className:()=>n.className.switchSlider,"data-field-switch-slider":``})]});if(s===`custom`){let t=i();return typeof t.content==`function`?t.content({form:u,field:t,index:o(),item:e()}):t.content}let c=s||`text`;return(0,t.jsx)(`input`,{...w(i,a,{type:c,className:()=>D(i(),n.className.input),placeholder:()=>i().placeholder||``,readonly:()=>!!i().readonly,autocomplete:()=>i().autocomplete||Ur(c),value:()=>i().value??``,onInput:e=>{let t=e.currentTarget;t instanceof HTMLInputElement&&C(i(),t,c)}}),checked:()=>{let e=i().checked;return e===void 0?void 0:!!e}})},A=(e,r)=>{let i=()=>e().payload,a=h(i(),r()),o=()=>{let t=e().type;return t===`custom`||t===`radio`||t===`checkbox`&&Array.isArray(i().options)},s=()=>{let e=i().label;return e!==!1&&e!==void 0};return(0,t.jsx)(`fieldset`,{className:()=>n.className.item,"data-form-field":()=>i().name||String(r()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{if(!s())return null;let e={className:()=>B(n.className.label,Fr(i(),n.validator.rules)?n.className.required:``),"data-field-label":()=>i().name||a,children:()=>z(i().label)};return o()?(0,t.jsx)(`legend`,e):(0,t.jsx)(`label`,{...e,for:a})},()=>(0,t.jsx)(`div`,{className:()=>n.className.control,"data-field-control":()=>i().name||String(r()),children:[z(k(e,i,a,r)),()=>i().help?(0,t.jsx)(`div`,{className:`help-block`,"data-field-help":()=>i().name||String(r()),children:()=>z(i().help)}):null]})]})},j=(e,t)=>A(e,t),M=()=>(0,t.jsx)(`button`,{type:`submit`,className:()=>B(n.className.button,n.className.submitBtn,T()),"data-action":`submit`,disabled:()=>r.submitting,children:()=>{let e=z(Rr(n.text.submit,u));return r.submitting?[_(),e]:e}}),N=()=>(0,t.jsx)(`button`,{type:`reset`,className:()=>B(n.className.button,n.className.resetBtn,T()),"data-action":`reset`,disabled:()=>r.submitting,children:()=>z(Rr(n.text.reset,u))}),ee=()=>(0,t.jsx)(`div`,{className:n.className.buttons,style:{justifyContent:Br(n.buttonsPosition)},"data-field-buttons":``,children:n.buttons===`reverse`?[N(),M()]:[M(),N()]});return u=Q({name:`Form`,props:n,state:r,actions:{validate:v,reset(){return l?.reset(),u},collectData:b,requestSubmit(){let e=u.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),u},setFields(e){return L(`fields`,e,`array`,`Form.setFields`),i.fieldIds.clear(),c=new WeakMap,(0,t.flushSync)(()=>{r.fields=Ar(e)}),u},resetFields(){return i.fieldIds.clear(),c=new WeakMap,(0,t.flushSync)(()=>{r.fields=Ar(n.fields)}),u}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:Ar(e.fields)}:{}}},view:()=>{let e=(0,t.jsx)(`form`,{className:B(n.className.form,n.vertical?n.className.vertical:n.className.horizontal,n.itemVertical?n.className.itemVertical:n.className.itemHorizontal,T()),id:n.id,novalidate:n.validator.vanilla===!1,"data-form":`root`,"data-form-layout":n.vertical?`vertical`:`horizontal`,"data-form-field-layout":n.itemVertical?`vertical`:`horizontal`,onSubmit:e=>void x(e),onReset:e=>{y(),n.onReset?.(e,u)},children:[(0,t.For)({each:f,key:m,children:j}),n.buttons===!1?null:ee()]});return zr(e,n.style),e},onBuild(){g()},onDestroy(){l?.destroy(),l=null,i.fieldIds.clear(),c=new WeakMap}}),u}let Xr={root:`j-flow`,header:`flow-header`,steps:`flow-steps`,step:`flow-step`,active:`is-active`,complete:`is-complete`,stepButton:`flow-step-button`,stepIndex:`flow-step-index`,stepTitle:`flow-step-title`,body:`flow-body`,footer:`flow-footer`,button:`j-button`,reset:`is-ghost flow-reset`,back:`is-ghost flow-back`,next:`is-primary flow-next`},Zr={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},Qr={type:`renderable`},$r={types:[`plainObject`,`null`,`undefined`]};function $(e){return y(e)?{...e}:{}}function ei(e){let t={};for(let n of Object.keys(e))t[n]=$(e[n]);return t}function ti(e){return{...e,history:[...e.history],data:$(e.data),stepData:ei(e.stepData),currentData:$(e.currentData),currentStep:e.currentStep?{...e.currentStep}:null}}function ni(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data)}}):[]}function ri(e){return typeof e==`string`?{...Xr,root:[Xr.root,e.trim()].filter(Boolean).join(` `)}:{...Xr,...y(e)?e:{}}}function ii(e,t){if(typeof e==`string`)return{id:e};if(!y(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:y(n.data)||n.data==null?n.data:void 0}:{id:t,data:e}}let ai={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||Y()},steps:{default:[],type:`array`,nonEmpty:!0},initial:{default:null,types:[`string`,`number`,`null`]},cache:{default:!0,type:`boolean`},linear:{default:!0,type:`boolean`},render:{default:!0,type:`boolean`},rollbackOnError:{default:!0,type:`boolean`},busyStrategy:{default:`ignore`,type:`string`,enum:[`ignore`,`throw`]},showBack:{default:!0,type:`boolean`},showNext:{default:!0,type:`boolean`},showReset:{default:!1,type:`boolean`},text:{default:{},type:`plainObject`,normalize:e=>{let t=y(e)?e:{};return{back:typeof t.back==`string`?t.back:a(`b`),next:typeof t.next==`string`?t.next:a(`Next`),finish:typeof t.finish==`string`?t.finish:a(`Finish`),reset:typeof t.reset==`string`?t.reset:a(`Reset`)}}},className:{default:Xr,types:[`object`,`string`],normalize:ri},renderHeader:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderBody:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderFooter:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},onChange:{default:null,types:[`function`,`null`]},onNext:{default:null,types:[`function`,`null`]},onBack:{default:null,types:[`function`,`null`]},onFinish:{default:null,types:[`function`,`null`]},onError:{default:null,types:[`function`,`null`]},onBusy:{default:null,types:[`function`,`null`]}};function oi(e){let t=R(e,ai,`Flow.props`);return{id:t.id,steps:ni(t.steps),initial:t.initial,cache:t.cache,linear:t.linear,render:t.render,rollbackOnError:t.rollbackOnError,busyStrategy:t.busyStrategy,showBack:t.showBack,showNext:t.showNext,showReset:t.showReset,text:t.text,className:t.className,renderHeader:t.renderHeader,renderBody:t.renderBody,renderFooter:t.renderFooter,onChange:t.onChange,onNext:t.onNext,onBack:t.onBack,onFinish:t.onFinish,onError:t.onError,onBusy:t.onBusy}}function si(e={}){let n=oi(e),r=n.steps,i=new Map;for(let[e,t]of r.entries()){if(L(String(e),t,Zr,`Flow.props.steps`),L(`content`,t.content??null,Qr,`Flow.props.steps.${e}`),i.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);i.set(t.id,e)}let a=(()=>{if(typeof n.initial==`number`){let e=r[n.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof n.initial==`string`){if(!i.has(n.initial))throw Error(`Flow.props.initial step "${n.initial}" does not exist.`);return n.initial}return r[0].id})(),o={},s={};for(let e of r)o[e.id]=$(e.data),Object.assign(s,o[e.id]);let c=(0,t.createDeepStore)({id:n.id,currentId:a,currentIndex:i.get(a)??0,previousId:null,previousIndex:null,direction:null,history:[a],data:$(s),stepData:ei(o),loading:!1,error:null,busyAction:null,version:0}),l={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},u=new Set,d=new Set,f=new Set,p=0,m=null,h=null,g,_=e=>{if(l.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},v=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},y=(0,t.createMemo)(()=>r[c.currentIndex]),b=(0,t.createMemo)(()=>c.version>=0?$(c.stepData[c.currentId]):{}),x=(0,t.createMemo)(()=>v(y())),S=(0,t.createMemo)(()=>r.map(v)),C=(0,t.createMemo)(()=>c.currentIndex>0&&!c.loading),w=(0,t.createMemo)(()=>c.currentIndex<r.length-1&&!c.loading),T=(0,t.createMemo)(()=>c.currentIndex===r.length-1),E=(0,t.createMemo)(()=>({id:c.id,currentId:c.currentId,currentIndex:c.currentIndex,previousId:c.previousId,previousIndex:c.previousIndex,direction:c.direction,history:[...c.history],data:$(c.data),stepData:ei(c.stepData),currentData:b(),currentStep:x(),canBack:C(),canNext:w(),isLast:T(),loading:c.loading,busyAction:c.busyAction,error:c.error})),D=()=>y(),O=e=>$(c.stepData[e]),k=()=>ti(E()),A=(e=null)=>{let t=k();for(let n of u)n(t,g,e);n.onChange?.(t,g,e)},j=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},M=(e,r,a={})=>{if(_(`setStepData`),L(`stepId`,e,{type:`string`},`Flow.setStepData`),L(`data`,r,$r,`Flow.setStepData`),!i.has(e))throw Error(`Flow.setStepData: step "${e}" does not exist.`);return r?((0,t.flushSync)(()=>{c.stepData[e]={...$(c.stepData[e]),...r},n.cache&&Object.assign(c.data,r),c.version+=1}),a.silent||A(),g):g},N=e=>(_(`setData`),L(`data`,e,$r,`Flow.setData`),e?((0,t.flushSync)(()=>{Object.assign(c.data,e),c.version+=1}),A(),g):g),ee=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return l.destroyed?(e(),()=>{}):(d.add(e),()=>d.delete(e))},te=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},ne=e=>e instanceof Error&&e.code===`FLOW_ABORTED`,P=e=>{if(l.destroyed||e!=null&&f.has(e))throw te()},re=()=>{let e=m;e!=null&&f.add(e),l.actionController?.abort(),l.actionController=null,l.activeAction=null,m=null},F=async(e,t,n=m)=>{if(typeof e!=`function`)return;let r=await e(...t);return P(n),r},I=(e={})=>{let t=e.step||D();return{...e,flow:g,step:t,state:c,signal:l.actionController?.signal||null,snapshot:k(),data:$(c.data),currentData:O(t.id),setData:N,setStepData:(e,t)=>M(e,t),getStepData:O,next:e=>g.next(e),back:e=>g.back(e),goTo:(e,t,n)=>g.goTo(e,t,n),addCleanup:ee}},R=(e,r=null)=>{(0,t.flushSync)(()=>{c.error=e,c.version+=1}),n.onError?.(e,k(),g,r)},ie=(e,n)=>{let r=k();(c.loading!==e||c.busyAction!==n)&&((0,t.flushSync)(()=>{c.loading=e,c.busyAction=e?n:null,c.version+=1}),A(r))},B=e=>{if(!c.loading)return null;let t=Error(`Flow: action "${e}" ignored while loading.`);if(t.code=`FLOW_BUSY`,n.onBusy?.(e,k(),g),n.busyStrategy===`throw`)throw t;return k()},V=async(e,t,n=!1)=>{let r=!n&&!c.loading,i=r?++p:m;r&&(l.actionController=new AbortController,l.activeAction=e,m=i,ie(!0,e));try{P(i);let e=await t(i);return P(i),e}catch(e){if(l.destroyed||ne(e))return null;throw c.error!==e&&R(e),e}finally{i!=null&&f.delete(i),r&&!l.destroyed&&m===i&&(ie(!1,null),l.activeAction=null,l.actionController=null,m=null)}},ae=()=>({currentId:c.currentId,currentIndex:c.currentIndex,previousId:c.previousId,previousIndex:c.previousIndex,direction:c.direction,history:[...c.history],data:$(c.data),stepData:ei(c.stepData),loading:c.loading,busyAction:c.busyAction,error:c.error,version:c.version}),H=e=>{(0,t.flushSync)(()=>{c.currentId=e.currentId,c.currentIndex=e.currentIndex,c.previousId=e.previousId,c.previousIndex=e.previousIndex,c.direction=e.direction,c.history.splice(0,c.history.length,...e.history),j(c.data,e.data),j(c.stepData,e.stepData),c.loading=e.loading,c.busyAction=e.busyAction,c.error=e.error,c.version=e.version+1})},U=e=>{if(typeof e==`number`){if(!r[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=i.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},oe=async(e,r,a,o,s)=>{let u=k(),d=ae();try{if(a&&M(o.id,a,{silent:!0}),o.canLeave&&await F(o.canLeave,[I({direction:r,targetId:e.id})],s)===!1)throw Error(`Flow: step "${o.id}" blocked leaving.`);if(e.canEnter&&await F(e.canEnter,[I({direction:r,fromId:o.id,step:e})],s)===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await F(o.onLeave,[I({direction:r,step:o,targetId:e.id})],s),P(s);let n=c.currentId,l=c.currentIndex;(0,t.flushSync)(()=>{c.previousId=n,c.previousIndex=l,c.currentId=e.id,c.currentIndex=i.get(e.id)??0,c.direction=r,r===`back`?c.history.pop():c.history.push(e.id),c.error=null,c.version+=1}),await F(e.onEnter,[I({direction:r,fromId:n,step:e})],s),P(s),A(u)}catch(e){throw l.destroyed||ne(e)?e:(n.rollbackOnError&&H(d),R(e,u),e)}},se=async(e,t,r,i,a)=>{let o=e===`back`?t.onBack:t.onNext,s=e===`back`?n.onBack:n.onNext,c=I({payload:r,targetId:i});return await F(o,[c],a)??await F(s,[c],a)??i},W=async(e,t,n={})=>V(`goTo`,async i=>{let a=U(e),o=r[a],s=D();return o.id===c.currentId?(t&&M(c.currentId,t),k()):(await oe(o,n.direction||`go`,t,s,i),k())},!!n.internal),ce=e=>{let t=k();return{flow:g,snapshot:t,state:c,steps:S(),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>g.next(e),back:e=>g.back(e),goTo:(e,t,n)=>g.goTo(e,t,n),reset:()=>g.reset()}},le=(e,t)=>{let r=n[e];return r===!1?null:typeof r==`function`?()=>c.version>=0?r(ce(t)):null:t()},G=()=>{let e=D().content;return typeof e==`function`?e(I()):e??``},ue=()=>Q({name:`FlowView`,props:{},state:c,view:()=>(0,t.jsx)(`div`,{className:n.className.root,id:n.id,role:`group`,"data-flow":`root`,"aria-busy":()=>c.loading?`true`:`false`,children:[(0,t.jsx)(`div`,{className:n.className.header,"data-flow-header":``,children:z(le(`renderHeader`,()=>(0,t.jsx)(`ol`,{className:n.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:r.map((e,r)=>(0,t.jsx)(`li`,{className:()=>[n.className.step,r===c.currentIndex?n.className.active:``,r<c.currentIndex?n.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(r),"aria-current":()=>r===c.currentIndex?`step`:null,children:(0,t.jsx)(`button`,{type:`button`,className:n.className.stepButton,disabled:()=>n.linear&&r>c.currentIndex,"aria-current":()=>r===c.currentIndex?`step`:null,onClick:()=>{r!==c.currentIndex&&g.goTo(r)},children:[(0,t.jsx)(`span`,{className:n.className.stepIndex,"data-flow-step-number":``,children:r+1}),(0,t.jsx)(`span`,{className:n.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))})))}),(0,t.jsx)(`div`,{className:n.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>c.loading?`true`:`false`,children:z(le(`renderBody`,()=>()=>c.version>=0?G():null))}),(0,t.jsx)(`div`,{className:n.className.footer,"data-flow-footer":``,children:z(le(`renderFooter`,()=>[n.showReset?(0,t.jsx)(`button`,{type:`button`,className:[n.className.button,n.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>g.reset(),disabled:()=>c.loading,children:n.text.reset}):null,n.showBack?(0,t.jsx)(`button`,{type:`button`,className:[n.className.button,n.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void g.back(),disabled:()=>!g.canBack,children:n.text.back}):null,n.showNext?(0,t.jsx)(`button`,{type:`button`,className:[n.className.button,n.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void g.next(),disabled:()=>c.loading,children:()=>g.isLast?n.text.finish:n.text.next}):null]))})]})});return g={props:n,steps:r,state:c,runtime:l,get element(){return h?.element||null},get currentStep(){return D()},get currentData(){return $(b())},get canBack(){return C()},get canNext(){return w()},get isLast(){return T()},build(){return _(`build`),l.built?g:(n.render&&(h||=ue(),h.build()),l.built=!0,g)},mount(e){return _(`mount`),g.build(),h&&h.mount(e),l.mounted=!!h,g},unmount(){return _(`unmount`),h?.unmount(),l.mounted=!1,g},subscribe(e){if(_(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return u.add(e),e(k(),g,null),()=>u.delete(e)},snapshot:k,async next(e=null){return _(`next`),L(`payload`,e,$r,`Flow.next`),B(`next`)||V(`next`,async t=>{if(g.isLast)return e&&M(c.currentId,e),await F(n.onFinish,[k(),g],t),k();let i=D(),a=r[c.currentIndex+1]?.id,o=ii(await se(`next`,i,e,a,t),a);return W(o.id,o.data??e,{direction:`next`,internal:!0})})},async back(e=null){return _(`back`),L(`payload`,e,$r,`Flow.back`),B(`back`)||(g.canBack?V(`back`,async t=>{let n=D(),i=r[c.currentIndex-1]?.id,a=ii(await se(`back`,n,e,i,t),i);return W(a.id,a.data??e,{direction:`back`,internal:!0})}):k())},async goTo(e,t=null,n={}){return _(`goTo`),L(`payload`,t,$r,`Flow.goTo`),B(`goTo`)||W(e,t,{direction:n.direction})},setData:N,setStepData:M,getStepData:O,reset(){_(`reset`);let e=k();return re(),(0,t.flushSync)(()=>{c.currentId=a,c.currentIndex=i.get(a)??0,c.previousId=null,c.previousIndex=null,c.direction=null,c.history.splice(0,c.history.length,a),j(c.data,$(s)),j(c.stepData,ei(o)),c.loading=!1,c.busyAction=null,c.error=null,c.version+=1}),A(e),g},async finish(e=null){return _(`finish`),L(`payload`,e,$r,`Flow.finish`),B(`finish`)||V(`finish`,async t=>(e&&M(c.currentId,e),await F(n.onFinish,[k(),g],t),k()))},destroy(){if(!l.destroyed){l.destroyed=!0,re(),h?.destroy(),h=null;for(let e of d)e();d.clear(),u.clear(),l.built=!1,l.mounted=!1,i.clear()}}},g}let ci={layout:`j-popup-layout`,modal:`j-modal`,header:`modal-header`,body:`modal-body`,footer:`modal-footer`,title:`modal-title`,button:`j-button`,closeBtn:`is-icon is-sm is-ghost`,cancelBtn:`is-ghost`,confirmBtn:`is-primary`};function li(e){return{...e,text:{...e.text},className:{...e.className}}}function ui(e){return{content:e.content,loading:!1,processing:!1,visible:!1}}function di(e){return!!e&&typeof e.then==`function`}function fi(e){return Number.isFinite(e)?Math.max(0,e):0}let pi={type:`renderable`},mi={default:{},type:`object`,plain:!0,normalize:e=>{let t=y(e)?e:{};return{...t,title:typeof t.title==`string`?t.title:`Tip`,confirm:typeof t.confirm==`string`?t.confirm:`Confirm`,cancel:typeof t.cancel==`string`?t.cancel:`Cancel`}}},hi={content:{default:``,...pi},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},position:{default:`center`,type:`string`},showCancel:{default:!0,type:`boolean`},showClose:{default:!0,type:`boolean`},fullscreen:{default:!1,type:`boolean`},text:mi,onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]},onConfirm:{default:null,types:[`function`,`null`]},onCancel:{default:null,types:[`function`,`null`]},header:{default:!0,type:`boolean`},footer:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:ci,type:`object`,normalize:e=>({...ci,...e&&typeof e==`object`?e:{}})}},gi={content:hi.content,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`}},_i={type:`plainObject`};function vi(e){let t=R(e,hi,`Modal`);return{content:t.content,cache:t.cache,ttl:fi(t.ttl),position:t.position,showCancel:t.showCancel,showClose:t.showClose,fullscreen:t.fullscreen,text:t.text,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden,onConfirm:t.onConfirm,onCancel:t.onCancel,header:t.header,footer:t.footer,id:t.id,escClose:t.escClose,bgClose:t.bgClose,className:t.className,style:t.style}}let yi=0,bi=``;function xi(e={}){let n=vi(e),r=(0,t.createDeepStore)(ui(n)),i={initial:li(n),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},o=new Map,[s,c]=(0,t.createSignal)(!1),[l,u]=(0,t.createSignal)({value:null}),d,p=null,m=null,h=!1,g=0,v=()=>r.processing,y=e=>{if(!n.cache||!i.hasContent||i.contentSource!==e)return!1;let t=fi(n.ttl);return!t||Date.now()-i.updatedAt<=t},b=(e,t)=>{n.cache&&(i.content=t,i.contentSource=e,i.hasContent=!0,i.updatedAt=Date.now())},x=()=>{i.content=null,i.contentSource=null,i.hasContent=!1,i.updatedAt=0},S=()=>{for(let e of o.values())e();o.clear()},C=(e,t,n,r)=>{o.get(e)?.(),t.addEventListener(n,r),o.set(e,()=>t.removeEventListener(n,r))},w=()=>{h||=(yi===0&&(bi=document.body.style.overflow,document.body.style.overflow=`hidden`),yi+=1,!0)},T=()=>{h&&=(yi=Math.max(0,yi-1),yi===0&&(document.body.style.overflow=bi,bi=``),!1)},E=()=>{let e=i.previousActiveElement;i.previousActiveElement=null,e&&document.contains(e)&&e.focus()},D=zt({elements:()=>[d.element,p],mount:()=>{d.mount(document.body),w()},activate:()=>c(!0),deactivate:()=>c(!1),motion:Et(kt(()=>d.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),kt(()=>p,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{d.unmount(),T(),E()}}),O=()=>{if(r.loading||r.processing){m||=_(),p&&m.parentElement!==p&&p.append(m);return}m?.remove(),m=null},k=e=>{r.processing!==e&&(0,t.flushSync)(()=>{r.processing=e})},A=()=>{r.visible&&D.phase!==`leaving`&&k(!1)},j=(e=r.content)=>{if(y(e)){g+=1,(0,t.flushSync)(()=>{u({value:i.content}),r.loading=!1});return}let n=++g;if(typeof e!=`function`){x(),(0,t.flushSync)(()=>{u({value:e}),r.loading=!1});return}let a;try{a=e(d)}catch(e){console.error(`Modal.content error:`,e),(0,t.flushSync)(()=>{u({value:null}),r.loading=!1});return}if(!di(a)){b(e,a),(0,t.flushSync)(()=>{u({value:a}),r.loading=!1});return}(0,t.flushSync)(()=>{r.loading=!0,u({value:null})}),Promise.resolve(a).then(r=>{d.runtime.destroyed||n!==g||(b(e,r),(0,t.flushSync)(()=>{u({value:r})}))}).catch(e=>{d.runtime.destroyed||n!==g||(console.error(`Modal.content error:`,e),(0,t.flushSync)(()=>{u({value:null})}))}).finally(()=>{!d.runtime.destroyed&&n===g&&(0,t.flushSync)(()=>{r.loading=!1})})},M=()=>{if(v())return;let e;try{e=n.onConfirm?.(d)}catch(e){console.error(`Modal.onConfirm error:`,e);return}di(e)&&(k(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{d.runtime.destroyed||A()}))},N=()=>{if(v())return;let e;try{e=n.onCancel?.(d)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!di(e)){d.hide();return}k(!0),Promise.resolve(e).then(()=>{d.runtime.destroyed||d.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{d.runtime.destroyed||A()})},ee=e=>{if(!p)return;let t=q(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,p).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),p.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},te=()=>{if(!p)return;let e=K(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,p);e?e.focus():(p.setAttribute(`tabindex`,`-1`),p.focus())},ne=()=>{let e=d.element;!e||!p||(S(),C(`root`,e,`click`,t=>{n.bgClose&&!v()&&t.target===e&&d.hide()}),C(`dialog`,p,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?N():t===`confirm`&&M()}),C(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!r.visible||(e.key===`Escape`&&n.escClose&&!v()?(e.preventDefault(),d.hide()):e.key===`Tab`&&ee(e))}))},P=()=>{if(D.phase===`visible`||D.phase===`entering`)return;if(!d.element)throw Error(`Modal.show: build() must be called before show().`);n.onShow?.(d),i.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=D.enter();ne(),te(),e.then(e=>{e&&!d.runtime.destroyed&&n.onShown?.(d)})},re=()=>{D.phase!==`hidden`&&D.phase!==`leaving`&&(n.onHide?.(d),S(),g+=1,D.leave().then(e=>{e&&!d.runtime.destroyed&&((0,t.flushSync)(()=>{r.loading=!1,r.processing=!1,n.cache||u({value:null})}),n.onHidden?.(d))}))};return d=Q({name:`Modal`,props:n,state:r,actions:{show(){if(!d.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return d.setState(`visible`,!0),d},hide(){return(0,t.flushSync)(()=>{r.visible=!1}),d},reset(){return d.setState({content:i.initial.content,loading:!1,processing:!1}),x(),u({value:null}),d}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){L(`state`,e,_i,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(gi,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);L(t,e[t],gi[t],`Modal.setState`)}},view:()=>{p=(0,t.jsx)(`div`,{className:B(n.className.modal,n.fullscreen?`is-fullscreen`:``),id:n.id,role:`document`,"data-modal-dialog":n.id,...n.style?{style:n.style}:{},"data-mount":()=>s()?`true`:`false`,children:[n.header?(0,t.jsx)(`div`,{className:n.className.header,children:()=>r.loading?null:[(0,t.jsx)(`div`,{className:n.className.title,id:`${n.id}_title`,"aria-label":n.text.title,children:n.text.title}),n.showClose?(0,t.jsx)(`button`,{type:`button`,className:B(n.className.button,n.className.closeBtn),"data-action":`close`,"aria-label":a(`Close`),disabled:v,children:f(`close`)}):null]}):null,(0,t.jsx)(`div`,{className:n.className.body,"data-modal-body":``,children:()=>z(l().value)}),n.footer?(0,t.jsx)(`div`,{className:n.className.footer,children:()=>r.loading?null:[n.showCancel?(0,t.jsx)(`button`,{type:`button`,className:B(n.className.button,n.className.cancelBtn),"data-action":`cancel`,disabled:v,children:n.text.cancel}):null,(0,t.jsx)(`button`,{type:`button`,className:B(n.className.button,n.className.confirmBtn),"data-action":`confirm`,disabled:v,children:n.text.confirm})]}):null]});let e=Ht({className:n.className.layout,position:n.position,component:`modal`,labelledby:n.header?`${n.id}_title`:``,content:p});return e.setAttribute(`data-mount`,`false`),n.header||e.setAttribute(`aria-label`,n.text.title||`Modal`),(0,t.createEffect)(()=>{e.setAttribute(`data-mount`,s()?`true`:`false`)}),(0,t.createEffect)(O),(0,t.createEffect)(()=>{let e=r.visible;(0,t.untrack)(()=>e?P():re())}),(0,t.createEffect)(()=>{let e=r.visible,n=r.content;(0,t.untrack)(()=>{e?j(n):g+=1})}),e},onDestroy(){let e=D.phase!==`hidden`;e&&n.onHide?.(d),D.cancel(),S(),T(),E(),m?.remove(),m=null,p=null,e&&n.onHidden?.(d)}}),d}let Si={root:`j-swiper`,wrapper:`swiper-wrapper`,slide:`swiper-slide`,image:`swiper-image`,title:`swiper-slide-title`,pagination:`swiper-pagination`,paginationHorizontal:`is-horizontal`,paginationClickable:`is-clickable`,paginationBulletGroup:`is-bullet`,indicator:`swiper-pagination-indicator`,bullet:`swiper-pagination-bullet`,navigation:`swiper-navigation`,prev:`is-prev`,next:`is-next`,active:`is-active`,disabled:`is-disabled`},Ci={id:{default:null,types:[`string`,`null`],nonEmpty:!0,normalize:e=>typeof e==`string`?e.trim():e},data:{default:[],types:[`array`,`function`]},loop:{default:!0,type:`boolean`},autoplay:{default:!0,type:`boolean`},delay:{default:3e3,type:`number`,min:0},lazyload:{default:!0,type:`boolean`},pagination:{default:!0,type:`boolean`},navigation:{default:!0,type:`boolean`},speed:{default:300,type:`number`,min:0},touchRatio:{default:1,type:`number`,greaterThan:0},touchAngle:{default:45,type:`number`,min:0,max:90},longSwipesMs:{default:300,type:`number`,min:0},longSwipesRatio:{default:.05,type:`number`,min:0,max:1},preventClick:{default:!0,type:`boolean`},className:{default:Si,type:`object`,normalize:e=>({...Si,...e&&typeof e==`object`?e:{}})}},wi={type:`plainObject`,shape:{image:[`string`,`null`,`undefined`],url:[`string`,`null`,`undefined`],title:[`string`,`null`,`undefined`],sort:[`number`,`null`,`undefined`],blank:[`boolean`,`null`,`undefined`],children:`renderable`}},Ti={data:{type:`array`},loading:{type:`boolean`},index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function Ei(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function Di(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function Oi(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function ki(e){return Array.isArray(e)?Oi(e):e}function Ai(e={}){let t=R(e,Ci,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:ki(t.data),className:{...t.className}}}function ji(e={}){let n=Ai(e),r=(0,t.createDeepStore)({data:Oi(Array.isArray(n.data)?n.data:[]),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),i=J(),a=new WeakMap,o=new Map,s=new Map,c=new Set,l,u=null,d=[],p=()=>[],m=()=>[],h=0,g=null,v=null,y=[],b=null,x=!1,S=!1,C=!1,w=!1,T=e=>(a.has(e)||a.set(e,Y()),a.get(e)),E=e=>{let t=Object.keys(e);return{keys:t,values:t.map(t=>e[t])}},D=(e,t,n)=>{if(!e||e.keys.length!==t.length)return!1;for(let r=0;r<t.length;r+=1)if(e.keys[r]!==t[r]||!Object.is(e.values[r],n[r]))return!1;return!0},O=e=>{let t=new Set,n=e.map((e,n)=>{L(String(n),e,wi,`Swiper.state.data`);let r=T(e);t.add(r);let{keys:i,values:a}=E(e),s=o.get(r);if(s&&D(s,i,a))return s.item.index=n,s.item;let c={...e,blank:e.blank!==!1,index:n,key:r};return o.set(r,{item:c,keys:i,values:a}),c});for(let e of o.keys())t.has(e)||o.delete(e);return n.some(e=>e.sort!=null)?n.sort((e,t)=>e.sort==null&&t.sort==null?e.index-t.index:e.sort==null?1:t.sort==null?-1:e.sort-t.sort||e.index-t.index):n},k=(e,t,n)=>{let r=n===null?`real:${e.key}:${!!e.url}`:`clone:${n}:${e.key}:${!!e.url}`,i=s.get(r);if(i&&i.item===e&&i.clone===n)return i.index=t,i;let a={item:e,index:t,clone:n,key:r};return s.set(r,a),a},A=e=>{let t=new Set,r=e.map((e,n)=>{let r=k(e,n,null);return t.add(r.key),r});if(!n.loop||e.length<=1){for(let e of s.keys())t.has(e)||s.delete(e);return r}let i=e[0],a=e[e.length-1],o=k(a,e.length-1,`last`),c=k(i,0,`first`);t.add(o.key),t.add(c.key);for(let e of s.keys())t.has(e)||s.delete(e);return[o,...r,c]},j=()=>p().length,M=()=>m().length,N=(e=r.trackIndex)=>{let t=j();return t?!n.loop||t<=1?Math.max(0,Math.min(e,t-1)):e===0?t-1:e===M()-1?0:e-1:0},ee=e=>n.loop?N(e):Math.max(0,e),te=e=>{let t=j();if(!t)return 0;let r=Math.max(0,Math.min(e,t-1));return n.loop&&t>1?r+1:r},ne=()=>{d=u?q(`[data-swiper-slide]`,u):[]},P=()=>{for(let e of c)e();c.clear()},re=()=>{let e=l.element;if(!e)return;let n=e.clientWidth||e.offsetWidth;(n>0||!e.isConnected||r.width===0)&&(0,t.flushSync)(()=>{r.width=n})},F=()=>!!l.element?.isConnected&&r.width>0,I=()=>(re(),F()),R=(e,i=!0)=>{let a=Di(e),o=-a*r.width,s=i&&n.speed>0&&r.width>0&&r.transform!==o;(0,t.flushSync)(()=>{r.trackIndex=a,r.index=N(a),r.transform=o,r.animating=s})},ie=()=>{let e=[r.trackIndex];r.trackIndex>0&&e.push(r.trackIndex-1),r.trackIndex<d.length-1&&e.push(r.trackIndex+1);for(let t of e){let e=d[t]?K(`img[data-lazy]`,d[t]):null;if(!e)continue;let n=!!e.getAttribute(`src`);if(n&&!e.complete&&(e.onload||e.onerror))continue;e.dataset.status=`loading`;let r=()=>{e.onload=null,e.onerror=null,c.delete(r)};c.add(r);let i=()=>{e.dataset.status=`loaded`,r()},a=()=>{e.dataset.status=`error`,r()};e.onload=i,e.onerror=a,n||(e.src=e.dataset.lazy||``),e.complete&&(e.naturalWidth>0?i():a())}},V=()=>{g&&=(clearInterval(g),null)},ae=()=>{l.runtime.destroyed||g||j()<=1||I()&&(g=setInterval(()=>l.next(),Math.max(n.delay,16)))},H=()=>{n.autoplay&&!g&&!l.runtime.destroyed&&ae()},U=()=>{V(),n.autoplay&&ae()},oe=e=>{y.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),y.length>5&&y.shift()},se=()=>y.length?{x:y[y.length-1].x-y[0].x,y:y[y.length-1].y-y[0].y}:{x:0,y:0},W=(e=!0)=>{let n=-r.trackIndex*r.width,i=e&&r.transform!==n;x=!1,S=!1,C=!1,y=[],b=null,(0,t.flushSync)(()=>{r.transform=n,r.animating=i}),H()},ce=(e,n)=>{r.animating||!I()||(y=[],oe(e),b=n,x=!0,S=!1,C=!1,w=!1,V(),(0,t.flushSync)(()=>{r.animating=!1}))},le=(e,i)=>{if(!x||S||r.animating)return;oe(e);let a=se(),o=Math.abs(a.x),s=Math.abs(a.y);if(!(o<6&&s<6)){if(!C)if(Math.atan2(s,o)*180/Math.PI<n.touchAngle)C=!0,w=Ei(b);else{S=!0,W(!0);return}i.preventDefault(),(0,t.flushSync)(()=>{r.transform=-r.trackIndex*r.width+a.x*n.touchRatio})}},G=()=>{if(!x)return;if(x=!1,!C||r.width<=0){W(!0);return}let e=y.length?y[y.length-1].time-y[0].time:0,t=se().x,i=Math.abs(t)/r.width,a=0;e>n.longSwipesMs?a=Math.ceil(i-n.longSwipesRatio):i>=n.longSwipesRatio&&(a=Math.max(1,Math.ceil(i-n.longSwipesRatio))),l.slideToTrack(r.trackIndex+a*(t>0?-1:1)),y=[],H()},ue=e=>{e.target!==u||!(`propertyName`in e)||e.propertyName!==`transform`||((0,t.flushSync)(()=>{r.animating=!1}),!(!n.loop||j()<=1)&&(r.trackIndex===0?R(j(),!1):r.trackIndex===M()-1&&R(1,!1)))},de=()=>{let e=l.element;!e||!u||(i.clear(),i.on(`touchstart`,u,`touchstart`,e=>{let t=e.touches[0];t&&ce(t,e.target)},{passive:!0}),i.on(`touchmove`,u,`touchmove`,e=>{let t=e.touches[0];t&&le(t,e)},{passive:!1}),i.on(`touchend`,u,`touchend`,e=>{let t=e.changedTouches[0];t&&oe(t),G()}),i.on(`touchcancel`,window,`touchcancel`,()=>W(!0)),i.on(`mousedown`,u,`mousedown`,e=>{let t=e;t.button===0&&(ce(t,t.target),u?.style.setProperty(`cursor`,`grabbing`))}),i.on(`mousemove`,window,`mousemove`,e=>{let t=e;x&&t.buttons===1&&le(t,e)}),i.on(`mouseup`,window,`mouseup`,e=>{x&&(u?.style.setProperty(`cursor`,`grab`),oe(e),G())}),i.on(`click`,u,`click`,e=>{!w||!n.preventClick||(e.preventDefault(),e.stopPropagation(),w=!1)},{capture:!0}),i.on(`dragstart`,u,`dragstart`,e=>e.preventDefault()),i.on(`transitionend`,u,`transitionend`,ue),i.on(`resize`,window,`resize`,fe),i.on(`mouseenter`,e,`mouseenter`,V),i.on(`mouseleave`,e,`mouseleave`,H),i.on(`controls`,e,`click`,t=>{if(!(t.target instanceof Element))return;let n=t.target.closest(`[data-action], [data-swiper-bullet]`);!n||!e.contains(n)||(n.dataset.action===`prev`?l.prev():n.dataset.action===`next`?l.next():n.dataset.swiperBullet!=null&&l.slideTo(Number(n.dataset.swiperBullet)))}))},fe=()=>{if(!l.runtime.built)return;V(),P(),ne();let e=Math.min(r.index,Math.max(0,j()-1));re(),R(te(e),!1),n.lazyload&&ie(),n.autoplay&&F()&&H()},pe=vt(fe),me=()=>{v==null&&typeof requestAnimationFrame==`function`&&(v=requestAnimationFrame(()=>{v=null,!l.runtime.destroyed&&l.element?.isConnected&&fe()}))},he=async()=>{if(typeof n.data!=`function`)return;let e=++h;(0,t.flushSync)(()=>{r.loading=!0});try{let i=await Promise.resolve(n.data(l));if(l.runtime.destroyed||e!==h)return;L(`data`,i,{type:`array`},`Swiper.data`);let a=Oi(i);O(a),(0,t.flushSync)(()=>{r.data=a})}finally{!l.runtime.destroyed&&e===h&&(0,t.flushSync)(()=>{r.loading=!1})}},ge=()=>{he().catch(e=>{l.runtime.destroyed||console.error(`Swiper.data error:`,e)})},_e=(e,r)=>{let i=()=>ee(r()),a={className:n.className.slide,"data-swiper-slide":()=>String(i()),"data-swiper-index":()=>e().clone?null:String(i()),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${i()+1}`,children:()=>{let{item:r}=e();if(r.children!=null){let e={swiper:l,item:r,get index(){return i()}};return z(typeof r.children==`function`?r.children(e):r.children)}return[r.image?(0,t.jsx)(`img`,{className:n.className.image,alt:r.title||``,loading:`lazy`,...n.lazyload?{"data-lazy":r.image}:{src:r.image}}):null,r.title?(0,t.jsx)(`span`,{className:n.className.title,children:r.title}):null]}};return e().item.url?(0,t.jsx)(`a`,{...a,href:()=>e().item.url||``,target:()=>e().item.blank?`_blank`:`_self`}):(0,t.jsx)(`div`,a)};return l=Q({name:`Swiper`,props:n,state:r,actions:{slideTo(e){l.slideToTrack(te(e))},slideToTrack(e){if(!l.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(r.animating||!d.length||!I())return;let t=n.loop?Math.max(0,Math.min(e,d.length-1)):Math.max(0,Math.min(e,j()-1));R(t,!0),n.lazyload&&ie()},next(){r.animating||l.slideToTrack(r.trackIndex+1)},prev(){r.animating||l.slideToTrack(r.trackIndex-1)},play:ae,pause:V,resume:H,restartAutoplay:U},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:Oi(e.data)}:{}}},validateStatePatch(e){L(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Ti,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);L(t,e[t],Ti[t],`Swiper.setState`)}Array.isArray(e.data)&&O(e.data)},view:()=>{p=(0,t.createMemo)(()=>O(r.data)),m=(0,t.createMemo)(()=>A(p()));let e=()=>{let e=_();return e.setAttribute(`data-swiper-loading`,``),e};u=(0,t.jsx)(`div`,{className:n.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>r.loading?e():(0,t.For)({each:m,key:e=>e.key,children:_e})});let i=(0,t.jsx)(`div`,{id:n.id||Y(),className:n.className.root,"data-swiper":`root`,"data-status":()=>r.loading?`loading`:`loaded`,children:[u,n.pagination?(0,t.jsx)(`div`,{className:B(n.className.pagination,n.className.paginationHorizontal,n.className.paginationClickable,n.className.paginationBulletGroup),"data-swiper-pagination":``,children:(0,t.For)({each:p,key:e=>e.key,children:(e,i)=>(0,t.jsx)(`button`,{type:`button`,className:()=>B(n.className.indicator,n.className.bullet,r.index===i()?n.className.active:``),"data-swiper-bullet":()=>String(i()),"aria-label":()=>`Go to slide ${i()+1}`,"aria-current":()=>r.index===i()?`true`:null})})}):null,n.navigation?(0,t.jsx)(`button`,{type:`button`,className:()=>B(n.className.navigation,n.className.prev,!n.loop&&r.index<=0?n.className.disabled:``),"data-action":`prev`,"data-swiper-navigation":`prev`,"aria-label":`Previous slide`,disabled:()=>!n.loop&&r.index<=0,children:f(`arrow-left`)}):null,n.navigation?(0,t.jsx)(`button`,{type:`button`,className:()=>B(n.className.navigation,n.className.next,!n.loop&&r.index>=j()-1?n.className.disabled:``),"data-action":`next`,"data-swiper-navigation":`next`,"aria-label":`Next slide`,disabled:()=>!n.loop&&r.index>=j()-1,children:f(`arrow-right`)}):null]});return(0,t.createEffect)(()=>{u?.style.setProperty(`transform`,`translate3d(${r.transform}px, 0, 0)`),u?.style.setProperty(`transition`,r.animating?`transform ${n.speed}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`:`none`),i.style.setProperty(`--swiper-slide-width`,`${r.width}px`)}),(0,t.createEffect)(()=>{(p().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||r.data.length===0)&&pe.schedule()}),i},onBuild(e){!e.element||!u||(u.setAttribute(`aria-live`,`polite`),ne(),de(),re(),R(te(r.index),!1),n.lazyload&&ie(),n.autoplay&&F()&&ae(),e.own(()=>i.clear()),ge(),me())},onMount(){fe(),me()},onDestroy(){V(),pe.dispose(),h+=1,P(),v!=null&&cancelAnimationFrame(v),v=null,u=null,d=[]}}),Object.defineProperties(l,{realCount:{enumerable:!0,get:j},realIndex:{enumerable:!0,get:()=>N()}}),l}let Mi={root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`panel-list`,panel:`panel-item`,dragging:`dragging`},Ni={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},direction:{default:`top`,type:`string`,enum:[`top`,`bottom`,`left`,`right`]},active:{default:0,types:[`number`,`string`]},disabled:{default:[],types:[`number`,`string`,`array`]},onChange:{default:null,types:[`function`,`null`]},data:{default:[],type:`array`},className:{default:Mi,type:`object`,normalize:e=>({...Mi,...e&&typeof e==`object`?e:{}})}},Pi={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},Fi={data:Ni.data,active:Ni.active,disabled:Ni.disabled};function Ii(e,t,n=`Tabs.data`){L(String(t),e,Pi,n);let r=(typeof e.name==`string`?e.name.trim():``)||Y();return{...e,name:r}}function Li(e,t=`Tabs.data`){L(`data`,e,Fi.data,t);let n=new Set;return e.map((e,r)=>{let i=Ii(e,r,t),a=i.name;if(n.has(a))throw Error(`${t}: item name "${a}" must be unique.`);return n.add(a),i})}function Ri(e){return Array.isArray(e)?[...e]:e}function zi(e){let t=R(e,Ni,`Tabs.props`);return{id:t.id,direction:t.direction,active:t.active,disabled:Ri(t.disabled),onChange:t.onChange,data:Li(t.data,`Tabs.props.data`),className:t.className}}function Bi(e){return typeof e==`number`&&e>0?e:0}function Vi(e={}){let n=zi(e),r=(0,t.createDeepStore)({data:n.data,active:n.active,disabled:n.disabled,draggable:!1,dragging:!1,loading:!1}),i=J(),a=Ct(),o=Ct(),s=wt(),c=wt(),l=new Map,u=new Map,d,f=0,p=!1,m=0,h=0,g=0,v=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),y=()=>{let e=v(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},b=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},x=()=>{let e=Array.isArray(r.disabled)?r.disabled:[r.disabled];return Array.from(new Set(e.map(e=>typeof e==`number`?r.data[e]?.name:e).filter(e=>typeof e==`string`)))},S=e=>x().includes(e),C=e=>b()===e,w=(0,t.createMemo)(()=>r.data),T=()=>{let e=a.current,i=o.current;if(!e||!i)return;let s=n.direction===`left`||n.direction===`right`?i.scrollHeight>e.clientHeight+5:i.scrollWidth>e.clientWidth+5;r.draggable!==s&&(0,t.flushSync)(()=>{r.draggable=s})},E=vt(T),D=()=>{let e=a.current;if(!e)return;let t=g,r=performance.now(),i=n.direction===`left`||n.direction===`right`,o=n=>{let a=n-r;r=n,t*=.92,!(Math.abs(t)<.3)&&(i?e.scrollTop+=t*a*.05:e.scrollLeft+=t*a*.05,m=requestAnimationFrame(o))};m=requestAnimationFrame(o)},O=()=>{let e=a.current,s=o.current;if(!e||!s)return;let c=0,l=0,u=0,d=!1,f=0,h=e=>{let t=n.direction===`left`||n.direction===`right`;if(`touches`in e){let n=e.touches[0]||e.changedTouches[0];return t?n.pageY:n.pageX}return t?e.pageY:e.pageX},_=i=>{r.draggable&&(!(i instanceof MouseEvent)&&!(i instanceof TouchEvent)||(p=!0,(0,t.flushSync)(()=>{r.dragging=!0}),c=h(i),u=c,l=n.direction===`left`||n.direction===`right`?e.scrollTop:e.scrollLeft,g=0,cancelAnimationFrame(m)))},v=t=>{if(!p||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let r=h(t);f=c-r,g=u-r,u=r,!d&&(d=!0,requestAnimationFrame(()=>{d=!1,n.direction===`left`||n.direction===`right`?e.scrollTop=l+f:e.scrollLeft=l+f}))},y=()=>{p&&(p=!1,(0,t.flushSync)(()=>{r.dragging=!1}),D())};i.on(`drag:mousedown`,s,`mousedown`,_),i.on(`drag:touchstart`,s,`touchstart`,_,{passive:!0}),i.on(`drag:mousemove`,window,`mousemove`,v,{passive:!1}),i.on(`drag:touchmove`,window,`touchmove`,v,{passive:!1}),i.on(`drag:mouseup`,window,`mouseup`,y),i.on(`drag:touchend`,window,`touchend`,y)},k=async e=>{if(!d.runtime.built)throw Error(`Tabs.activate: call build() first.`);let i=v(e),a=r.data[i];if(!a)return;let o=a.name;S(o)||C(o)||((0,t.flushSync)(()=>{r.active=e}),await u.get(o)?.(),await Promise.resolve(n.onChange?.(i,o,s.get(o),c.get(o))))},A=(e,i)=>{let a=e().name,o=e().content,[s,p]=(0,t.createSignal)(typeof o==`function`?null:o),[m,h]=(0,t.createSignal)(!1),g=o,v=0,y=null,b=()=>({tabs:d,item:e(),index:i(),name:a}),x=async()=>{let n=e(),i=n.content;if(typeof i!=`function`){p(i);return}let o=n.cache?l.get(a):null,s=Bi(n.ttl);if(o&&(!s||Date.now()-o.updatedAt<=s)){p(o.content);return}if(y)return y;let c=++v;f+=1;let u=f;h(!0),(0,t.flushSync)(()=>{r.loading=!0});let m=Promise.resolve().then(()=>i(b())).then(t=>{c!==v||d.runtime.destroyed||(e().cache&&l.set(a,{content:t,updatedAt:Date.now()}),p(t))}).finally(()=>{c===v&&h(!1),u===f&&!d.runtime.destroyed&&(0,t.flushSync)(()=>{r.loading=!1}),y===m&&(y=null)});return y=m,m};u.set(a,x),(0,t.onCleanup)(()=>{l.delete(a),u.delete(a)}),(0,t.createEffect)(()=>{let t=e().content;t!==g&&(g=t,v+=1,y=null,l.delete(a),p(typeof t==`function`?null:t)),C(a)&&x()});let S=()=>{if(m())return _(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(b()):e};return(0,t.jsx)(`div`,{className:n.className.panel,"data-tabs-panel":a,role:`tabpanel`,"aria-hidden":()=>C(a)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(m()),hidden:()=>!C(a),ref:c.bind(a),children:()=>z(S())})},j=(e,r)=>{let i=e().name,a=()=>{let t=e().title,n={tabs:d,item:e(),index:r(),name:i};return typeof t==`function`?t(n):t};return(0,t.jsx)(`div`,{className:n.className.tab,"data-tabs-tab":i,role:`tab`,"aria-selected":()=>C(i)?`true`:`false`,"aria-disabled":()=>S(i)?`true`:`false`,ref:s.bind(i),children:()=>z(a())})};return d=Q({name:`Tabs`,props:n,state:r,actions:{activate:k},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Li(e.data,`Tabs.setState.data`)}:{},...Object.hasOwn(e,`disabled`)&&Array.isArray(e.disabled)?{disabled:Ri(e.disabled)}:{}}},validateStatePatch(e){L(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Fi,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;L(t,e[t],Fi[n],`Tabs.setState`)}},view:()=>((0,t.createEffect)(()=>{let e=r.data.length;return E.schedule(),e}),(0,t.jsx)(`div`,{className:n.className.root,id:n.id,"data-tabs":`root`,"data-tabs-direction":n.direction,children:[(0,t.jsx)(`div`,{className:n.className.wrap,"data-tabs-wrap":``,ref:a.set,children:(0,t.jsx)(`nav`,{className:()=>B(n.className.list,r.dragging&&n.className.dragging),"data-tabs-list":``,ref:o.set,children:(0,t.For)({each:w,key:e=>e.name,children:(e,t)=>j(e,t)})})}),(0,t.jsx)(`div`,{className:n.className.panelWrap,"data-tabs-panel-wrap":``,children:(0,t.For)({each:w,key:e=>e.name,children:(e,t)=>A(e,t)})})]})),onBuild(e){let t=e.element;t&&(i.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!S(t)&&k(t)}),i.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(h),h=requestAnimationFrame(T)}),O(),e.own(()=>i.clear()),E.schedule(),u.get(y().name||``)?.())},onMount(){E.schedule()},onDestroy(){f+=1,E.dispose(),cancelAnimationFrame(m),cancelAnimationFrame(h),l.clear(),u.clear(),s.clear(),c.clear()}}),Object.defineProperties(d,{current:{enumerable:!0,get:y}}),d}let Hi={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},Ui={top:`translateY(-100%)`,right:`translateX(100%)`,bottom:`translateY(100%)`,left:`translateX(-100%)`},Wi={content:{default:``,type:`renderable`},overlay:{default:!0,type:`boolean`},filter:{default:!0,type:`boolean`},bodyOverflow:{default:!0,type:`boolean`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},direction:{default:`left`,type:`string`,enum:[`top`,`right`,`bottom`,`left`]},animate:{default:`slide`,type:`string`},bgClose:{default:!0,type:`boolean`},escClose:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},className:{default:Hi,type:`object`,normalize:e=>({...Hi,...e&&typeof e==`object`?e:{}})},onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}},Gi={content:Wi.content,visible:{type:`boolean`},loading:{type:`boolean`}};function Ki(e){return e>0?e:0}function qi(e){let t=R(e,Wi,`Offcanvas`);return{content:t.content,overlay:t.overlay,filter:t.filter,bodyOverflow:t.bodyOverflow,cache:t.cache,ttl:t.ttl,direction:t.direction,animate:t.animate,bgClose:t.bgClose,escClose:t.escClose,id:t.id,className:t.className,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden}}let Ji=0,Yi=``;function Xi(e){L(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Gi,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;L(t,e[t],Gi[n],`Offcanvas.setState`)}}function Zi(e={}){let n=qi(e),r=(0,t.createDeepStore)({content:n.content,visible:!1,loading:!1}),[i,a]=(0,t.createSignal)({value:typeof n.content==`function`?null:n.content}),o={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},s=J(),c=Ct(),l,u=!1,d=()=>{!n.bodyOverflow||u||(Ji===0&&(Yi=document.body.style.overflow,document.body.style.overflow=`hidden`),Ji+=1,u=!0)},f=()=>{u&&=(Ji=Math.max(0,Ji-1),Ji===0&&(document.body.style.overflow=Yi,Yi=``),!1)},p=kt(()=>l.element,{keyframes:[{transform:Ui[n.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),m=zt({elements:()=>[c.current,l.element],mount:()=>{let e=c.current;e&&!e.isConnected&&(0,t.insert)(document.body,e),l.mount(document.body),d()},activate:()=>{r.visible=!0},deactivate:()=>{r.visible=!1},motion:Et(...n.animate===`slide`?[p]:[],kt(()=>c.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{c.current?.remove(),l.unmount(),f()}}),h=()=>{o.cache={content:null,hasContent:!1,updatedAt:0}},g=()=>{if(!n.cache||!o.cache.hasContent)return!1;let e=Ki(n.ttl);return!e||Date.now()-o.cache.updatedAt<=e},v=()=>{let e=i().value;return typeof e==`function`?e(l):e},y=async()=>{let e=r.content;if(typeof e!=`function`){o.contentLoadId+=1,(0,t.flushSync)(()=>{a({value:e}),r.loading=!1});return}if(g()){o.contentLoadId+=1,(0,t.flushSync)(()=>{a({value:o.cache.content}),r.loading=!1});return}let i=++o.contentLoadId;(0,t.flushSync)(()=>{r.loading=!0,a({value:null})});try{let r=await Promise.resolve(e(l));if(l.runtime.destroyed||i!==o.contentLoadId)return;n.cache&&(o.cache={content:r,hasContent:!0,updatedAt:Date.now()}),(0,t.flushSync)(()=>{a({value:r})})}finally{!l.runtime.destroyed&&i===o.contentLoadId&&(0,t.flushSync)(()=>{r.loading=!1})}};return l=Q({name:`Offcanvas`,props:n,state:r,actions:{async show(){if(!l.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(r.visible)return;await Promise.resolve(n.onShow?.(l));let e=m.enter(),t=y();await e&&!l.runtime.destroyed&&n.onShown?.(l),await t},async hide(){if(!l.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!r.visible)return;let e=n.onHide?.(l);e&&await e,o.contentLoadId+=1,(0,t.flushSync)(()=>{r.loading=!1}),await m.leave()&&n.onHidden?.(l)}},validateStatePatch:Xi,view(e){let i=n.overlay?(0,t.jsx)(`div`,{ref:c.set,className:n.className.overlay,"data-offcanvas-overlay":n.id,"data-mount":()=>r.visible?`true`:`false`,style:n.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{n.bgClose&&l.hide()}}):null;return i&&e.own(()=>i.remove()),(0,t.createEffect)(()=>{let e=r.content;L(`content`,e,Gi.content,`Offcanvas.state`),h(),typeof e==`function`?(a({value:null}),(0,t.untrack)(()=>r.visible)&&y()):(o.contentLoadId+=1,a({value:e}),r.loading=!1)}),(0,t.jsx)(`div`,{className:n.className.root,id:n.id,role:`dialog`,"aria-modal":n.overlay?`true`:`false`,"aria-expanded":()=>String(r.visible),"data-mount":()=>r.visible?`true`:`false`,"data-offcanvas":`root`,"data-direction":n.direction,"data-animate":n.animate,onClick:e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-action]`);(t?.dataset.action===`close`||t?.dataset.action===`cancel`)&&l.hide()},children:(0,t.jsx)(`div`,{className:n.className.content,"data-offcanvas-content":n.id,children:()=>z(r.loading?_():v())})})},onBuild(e){n.escClose&&s.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&r.visible&&l.hide()}),e.own(()=>s.clear())},onDestroy(){m.cancel(),o.contentLoadId+=1,c.current?.remove(),f()}}),l}let Qi={size:10,current:1},$i={sibling:1,boundary:1},ea={root:`j-pagination`,list:`pagination`,item:`item`,button:`j-button is-default is-icon`,currentBtn:`j-button is-ghost is-icon is-active`,moreBtn:`j-button is-ghost is-icon`,loading:`animate-spin`},ta={default:0,type:`number`,finite:!0,min:0},na={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},ra={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},ia={total:ta,page:{default:()=>({...Qi}),factory:!0,normalize:e=>({...Qi,...e&&typeof e==`object`?e:{}}),...na},count:{default:()=>({...$i}),factory:!0,normalize:e=>({...$i,...e&&typeof e==`object`?e:{}}),...ra},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:ea,type:`object`,normalize:e=>({...ea,...e&&typeof e==`object`?e:{}})}},aa={total:ta,page:na,count:ra,locked:{type:`boolean`}};function oa(e,t,n){return Math.min(Math.max(e,t),n)}function sa(e,t){return Math.max(1,Math.ceil(e/t))}function ca(e){return{size:e.size,current:e.current}}function la(e){return{sibling:e.sibling,boundary:e.boundary}}function ua(e={}){let t=R(e,ia,`Pagination.props`),n=sa(t.total,t.page.size);return{...t,page:{size:t.page.size,current:oa(t.page.current,1,n)},count:la(t.count),className:{...t.className}}}function da(e){return{type:`more`,key:e}}function fa(e){return{type:`page`,key:`page-${e}`,page:e}}function pa(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ma(e,t,n){if(t<=0)return[];let r=Math.max(0,n.boundary),i=Math.max(0,n.sibling);if(t<=r*2+i*2+3)return pa(1,t).map(fa);let a=new Set;for(let e=1;e<=Math.min(r,t);e++)a.add(e);for(let n=Math.max(1,e-i);n<=Math.min(t,e+i);n++)a.add(n);for(let e=Math.max(1,t-r+1);e<=t;e++)a.add(e);let o=Array.from(a).sort((e,t)=>e-t),s=[];for(let e of o){let t=s[s.length-1];t?.type===`page`&&e-t.page>1&&s.push(e-t.page===2?fa(t.page+1):da(`more-${t.page}-${e}`)),s.push(fa(e))}return s}function ha(e){if(e.type!==`page`)throw Error(`Pagination.itemView: expects page item.`);return e}function ga(e={}){let n=ua(e),r=(0,t.createDeepStore)({total:n.total,page:ca(n.page),count:la(n.count),locked:!1}),i=0,o,s=(0,t.createMemo)(()=>sa(r.total,r.page.size)),c=()=>n.lock&&r.locked,l=()=>c()||r.page.current<=1,u=()=>c()||r.page.current>=s(),d=(0,t.createMemo)(()=>ma(r.page.current,s(),r.count)),p=e=>{n.lock&&!o.runtime.destroyed&&e===i&&(0,t.flushSync)(()=>{r.locked=!1})},m=e=>{if(o.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!o.runtime.built)throw Error(`Pagination.go: call build() first.`);if(L(`page`,e,{type:`number`,integer:!0},`Pagination.go`),c())return o;let a=oa(e,1,s());if(a===r.page.current)return o;let l=n.lock&&typeof n.onChange==`function`,u=l?++i:i;if((0,t.flushSync)(()=>{r.page.current=a,l&&(r.locked=!0)}),n.onChange){let e;try{e=n.onChange(a,o)}catch(e){throw p(u),e}if(l&&e&&typeof e.then==`function`){let t=()=>p(u);Promise.resolve(e).then(t,t)}else p(u)}return o},h=e=>{let i=e===`prev`?l:u;return(0,t.jsx)(`li`,{className:n.className.item,"data-pagination-control":e,children:(0,t.jsx)(`button`,{className:n.className.button,type:`button`,"data-page-action":e,"aria-label":a(e===`prev`?`Go to previous page`:`Go to next page`),"aria-disabled":()=>i()?`true`:`false`,tabindex:()=>i()?`-1`:null,disabled:i,onClick:()=>{i()||m(r.page.current+(e===`prev`?-1:1))},children:f(e===`prev`?`arrow-left`:`arrow-right`)})})},g=e=>{if(e().type===`more`)return(0,t.jsx)(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,children:(0,t.jsx)(`span`,{className:n.className.moreBtn,"aria-disabled":!0,disabled:``,children:f(`more`)})});let i=()=>ha(e()).page,a=()=>i()===r.page.current;return(0,t.jsx)(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:(0,t.jsx)(`button`,{className:()=>a()?n.className.currentBtn:n.className.button,type:`button`,"data-page":()=>String(i()),"data-current-page":()=>a()?String(i()):null,"aria-current":()=>a()?`page`:null,"aria-label":()=>a()?`Page ${i()}, current page`:`Go to page ${i()}`,"aria-disabled":()=>c()||a()?`true`:`false`,tabindex:()=>c()||a()?`-1`:null,disabled:()=>c()||a(),onClick:()=>{let e=i();!c()&&!a()&&m(e)},children:()=>c()&&a()?_():String(i())})})};return o=Q({name:`Pagination`,props:n,state:r,actions:{go:m},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&y(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&y(t.count)&&(t.count={...r.count,...t.count}),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(aa,t))throw Error(`Pagination.setState: "${t}" is not supported.`);let n=t;L(t,e[t],aa[n],`Pagination.setState`)}},view:()=>((0,t.createEffect)(()=>{let e=oa(r.page.current,1,s());e!==r.page.current&&(r.page.current=e)}),(0,t.jsx)(`div`,{className:n.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:(0,t.jsx)(`ul`,{className:n.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[h(`prev`),(0,t.For)({each:d,key:e=>e.key,children:e=>g(e)}),h(`next`)]})}))}),Object.defineProperty(o,"pageCount",{enumerable:!0,get:s}),o}let _a={root:`j-menu`,list:`menu`,item:`menu-item`,hasChildren:`menu-item-has-children`,link:`menu-link`,subMenu:`sub-menu`,active:`is-active`,text:`menu-text`,backItem:`menu-item back`,backIcon:`el-icon el-prefix`},va={type:`object`,validate:Ea,message:`expects { title, id?, type?, url?, target?, classes?, children? }.`},ya={type:`array`,items:va},ba={type:{default:void 0,types:[`string`,`undefined`]},user:{default:0,types:[`number`,`function`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},data:{default:[],types:[`array`,`function`]},backText:{default:a(`b`),type:`string`},className:{default:_a,type:`object`,normalize:e=>({..._a,...e&&typeof e==`object`?e:{}})}},xa={user:{type:`number`},data:ya,activeKeys:{type:`array`,items:`string`}};function Sa(e={}){let t=R(e,ba,`Menu.props`);return{...t,user:t.user,data:t.data,className:{...t.className}}}function Ca(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function wa(e){return`menu-item-${e??Y()}`}function Ta(e){return typeof e==`string`?e.trim():``}function Ea(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return(typeof t.title==`string`||typeof t.title==`number`)&&(t.id==null||typeof t.id==`string`||typeof t.id==`number`)&&(t.type==null||t.type===0||t.type===1||t.type===2)&&(t.url==null||typeof t.url==`string`)&&(t.target==null||typeof t.target==`string`)&&(t.classes==null||typeof t.classes==`string`||Array.isArray(t.classes)&&t.classes.every(e=>typeof e==`string`))&&(t.children==null||Array.isArray(t.children)&&t.children.every(Ea))}function Da(e){return Array.isArray(e)?e.map(e=>{L(`item`,e,va,`Menu.data`);let t={...e};return t.type=t.type??0,Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=Da(t.children)),t}):[]}function Oa(e){let n=(0,t.access)(e??0);return L(`user`,n,`number`,`Menu.props`),n}function ka(e){let n=(0,t.access)(e??[]);return L(`data`,n,ya,`Menu.props`),Da(n)}function Aa(e={}){let n=Sa(e),r=(0,t.createDeepStore)({user:Oa(n.user),data:ka(n.data),activeKeys:[]}),i=new WeakMap,a=J(),o,s=e=>e.id==null?(i.has(e)||i.set(e,Y()),i.get(e)):String(e.id),c=e=>r.activeKeys.includes(e),l=()=>r.user>0,u=e=>e.type===1?l():e.type!==2||!l(),d=e=>Array.isArray(e)?e.filter(u):[],p=e=>{(0,t.flushSync)(()=>{r.activeKeys=n.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},m=e=>{(0,t.flushSync)(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},h=e=>{(0,t.flushSync)(()=>{r.activeKeys=c(e)?[]:[e]})},g=e=>(0,t.jsx)(`li`,{className:n.className.backItem,"data-menu-back":``,children:(0,t.jsx)(`a`,{className:n.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),m(e)},children:[(0,t.jsx)(`span`,{className:n.className.backIcon,children:f(`arrow-left`)}),(0,t.jsx)(`span`,{className:n.className.text,children:n.backText})]})}),_=(e,r=!1,i)=>(0,t.jsx)(`ul`,{className:r?n.className.list:n.className.subMenu,...r?{id:n.id}:{},"data-menu-list":r?`root`:`sub`,children:[(0,t.For)({each:()=>n.type===`mobile`&&i&&c(i)?[i]:[],key:e=>e,children:e=>g(e())}),(0,t.For)({each:e,key:e=>s(e),children:e=>{let r=s(e()),i=(0,t.createMemo)(()=>d(e().children)),a=()=>i().length>0;return(0,t.jsx)(`li`,{className:()=>{let t=e();return B(n.className.item,a()?n.className.hasChildren:``,...Ca(t.classes),c(r)?n.className.active:``)},id:()=>e().id==null?`menu-item-${r}`:wa(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>a()?``:null,onClick:e=>{n.type===`mobile`&&e.target===e.currentTarget&&a()&&p(r)},children:[()=>{let i=e(),o=a(),s=Ta(i.url);return!o&&!s?(0,t.jsx)(`span`,{className:n.className.link,"data-menu-link":``,children:i.title}):(0,t.jsx)(`a`,{className:n.className.link,href:s,target:i.target,"data-menu-link":``,onClick:e=>{o&&(n.type===`mobile`||n.type===`bottom`)&&(e.preventDefault(),n.type===`bottom`?h(r):p(r))},children:i.title})},()=>a()?_(i,!1,r):null]})}})]});return o=Q({name:`Menu`,props:n,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`user`)&&(t.user=Oa(t.user)),Object.hasOwn(t,`data`)&&(t.data=Da(t.data)),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(xa,t))throw Error(`Menu.setState: "${t}" is not supported.`);let n=t;L(t,e[t],xa[n],`Menu.setState`)}},view:()=>{let e=(0,t.createMemo)(()=>d(r.data));return(0,t.createEffect)(()=>{r.user=Oa(n.user),r.data=ka(n.data)}),(0,t.createEffect)(()=>L(`data`,r.data,ya,`Menu`)),(0,t.jsx)(`nav`,{className:n.className.root,"data-menu":`root`,"data-menu-type":n.type,children:_(e,!0)})},onBuild(e){n.type===`bottom`&&(a.on(`outside`,document,`click`,n=>{let i=n.target;!(i instanceof Node)||e.element?.contains(i)||(0,t.flushSync)(()=>{r.activeKeys=[]})}),e.own(()=>a.clear()))}}),o}e.Toast=rt,e.addIcons=g,e.all=q,e.asRenderable=z,e.checkModernBrowser=ct,e.copy=at,e.createAccordion=Cr,e.createCollapseTransition=At,e.createDrop=Jt,e.createElementRef=Ct,e.createEventManager=J,e.createFlow=si,e.createForm=Yr,e.createKeyedElementRefs=wt,e.createLoading=_,e.createMenu=Aa,e.createModal=xi,e.createMotionGroup=Et,e.createOffcanvas=Zi,e.createOwnedView=Tt,e.createPagination=ga,e.createParabola=gn,e.createPopup=Ht,e.createPresence=zt,e.createScheduledTask=vt,e.createStateSync=St,e.createSticky=Sn,e.createSwiper=ji,e.createTabs=Vi,e.createTheme=un,e.createToc=ur,e.createTooltip=$t,e.createTransition=kt,e.createValidator=er,e.defineComponent=Q,e.getRegistedIconPath=h,e.getStoreVersion=yt,e.getType=E,e.icon=f,e.iconHtml=p,e.iconMarkup=m,e.isDomElementValue=S,e.isDomNodeValue=x,e.isElement=U,e.isHtmlElementValue=C,e.isMobile=it,e.isModernBrowser=st,e.isNilValue=b,e.isNode=H,e.isPlainObject=y,e.isRenderableContent=fe,e.isRenderablePrimitive=w,e.isRenderableValue=T,e.joinClasses=B,e.lazyRender=pe,e.listen=ve,e.postJson=ut,e.q=K,e.randomId=Y,e.removeComponentPlugin=rr,e.requireContainer=de,e.resolveContainer=ue,e.resolveElement=G,e.resolveNode=le,e.resolveNodeList=ce,e.resolveProps=R,e.restUrl=lt,e.stateSnapshot=xt,e.timer=xe,e.trackStoreVersion=bt,e.translate=a,e.useComponentPlugin=nr,e.uuid=ye,e.validateParam=L,e.waitForMotion=Rt});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vanilla-signal"),require("vanilla-signal-i18n"),require("vanilla-create-storage")):typeof define==`function`&&define.amd?define([`exports`,`vanilla-signal`,`vanilla-signal-i18n`,`vanilla-create-storage`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.jui={},e.vanillaSignal,e.vanillaSignalI18n,e.vanillaStorage))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i={en:{b:`Back`,t:`Customize`,sm:`Small`,md:`Medium`,lg:`Large`,wn:`Your browser is outdated and may pose security risks. Please upgrade your browser to access this site.`},zh:{b:`返回`,t:`自定义主题`,Primary:`主色`,Radius:`圆角`,Shadow:`阴影`,Font:`字号`,Mode:`模式`,Gray:`灰色`,Olive:`橄榄绿`,Tomato:`番茄红`,Ruby:`红宝石`,Pink:`粉红`,Violet:`紫罗兰`,Indigo:`靛蓝`,Blue:`蓝色`,Teal:`青色`,Grass:`草绿`,Mint:`薄荷绿`,Lime:`酸橙绿`,Yellow:`黄色`,Orange:`橙色`,Gold:`金色`,None:`无`,sm:`小`,md:`中`,lg:`大`,XL:`更大`,Round:`圆角`,Light:`浅色`,Dark:`深色`,Auto:`自动`,Tip:`提示`,Close:`关闭`,Confirm:`确认`,Cancel:`取消`,Upgrade:`升级`,wn:`您的浏览器版本过低,存在安全风险。请升级浏览器后再访问本站。`,Submit:`提交`,Reset:`重置`,"Loading...":`加载中...`,"Go to previous page":`访问上一页`,"Go to next page":`访问下一页`,Next:`下一步`,Finish:`完成`}};function a(e){return(0,n.t)(e,i)}var o={info:`<path d="M12 22C6.47715 22 2 17.5228 2 12 2 6.47715 6.47715 2 12 2 17.5228 2 22 6.47715 22 12 22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM13 10.5V15H14V17H10V15H11V12.5H10V10.5H13ZM13.5 8C13.5 8.82843 12.8284 9.5 12 9.5 11.1716 9.5 10.5 8.82843 10.5 8 10.5 7.17157 11.1716 6.5 12 6.5 12.8284 6.5 13.5 7.17157 13.5 8Z"></path>`,success:`<path d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"></path>`,warning:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"></path>`,error:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"></path>`,"arrow-left":`<path d="M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"></path>`,"arrow-right":`<path d="M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"></path>`,"arrow-up":`<path d="M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"></path>`,"arrow-down":`<path d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"></path>`,more:`<path d="M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"></path>`,close:`<path d="M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"></path>`,loader:`<path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path>`,menu:`<path d="M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z"></path>`,palette:`<path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM10.8111 18.1111C10.8111 16.0843 12.451 14.4444 14.4778 14.4444H16.4444C18.4065 14.4444 20 12.851 20 10.8889C20 7.1392 16.4677 4 12 4C7.58235 4 4 7.58235 4 12C4 16.19 7.2226 19.6285 11.324 19.9718C10.9948 19.4168 10.8111 18.7761 10.8111 18.1111ZM7.5 12C6.67157 12 6 11.3284 6 10.5C6 9.67157 6.67157 9 7.5 9C8.32843 9 9 9.67157 9 10.5C9 11.3284 8.32843 12 7.5 12ZM16.5 12C15.6716 12 15 11.3284 15 10.5C15 9.67157 15.6716 9 16.5 9C17.3284 9 18 9.67157 18 10.5C18 11.3284 17.3284 12 16.5 12ZM12 9C11.1716 9 10.5 8.32843 10.5 7.5C10.5 6.67157 11.1716 6 12 6C12.8284 6 13.5 6.67157 13.5 7.5C13.5 8.32843 12.8284 9 12 9Z"></path>`,message:`<path d="M2 8.99374C2 5.68349 4.67654 3 8.00066 3H15.9993C19.3134 3 22 5.69478 22 8.99374V21H8.00066C4.68659 21 2 18.3052 2 15.0063V8.99374ZM20 19V8.99374C20 6.79539 18.2049 5 15.9993 5H8.00066C5.78458 5 4 6.78458 4 8.99374V15.0063C4 17.2046 5.79512 19 8.00066 19H20ZM14 11H16V13H14V11ZM8 11H10V13H8V11Z"></path>`,chat:`<path d="M10 3H14C18.4183 3 22 6.58172 22 11C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3ZM12 17H14C17.3137 17 20 14.3137 20 11C20 7.68629 17.3137 5 14 5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17Z"></path>`,discuss:`<path d="M14 22.5L11.2 19H6C5.44772 19 5 18.5523 5 18V7.10256C5 6.55028 5.44772 6.10256 6 6.10256H22C22.5523 6.10256 23 6.55028 23 7.10256V18C23 18.5523 22.5523 19 22 19H16.8L14 22.5ZM15.8387 17H21V8.10256H7V17H11.2H12.1613L14 19.2984L15.8387 17ZM2 2H19V4H3V15H1V3C1 2.44772 1.44772 2 2 2Z"></path>`};let s=`http://www.w3.org/2000/svg`,c=o;function l(e){if(!(e in c))throw Error(`Icon "${e}" not found.`)}function u(e){return l(e),`<svg xmlns="${s}" viewBox="0 0 24 24" fill="currentColor">${c[e]}</svg>`}function d(e){return e!==null&&e.namespaceURI===s}function f(e,t={}){let n=document.createElement(`template`);n.innerHTML=u(e);let r=n.content.firstElementChild;if(!d(r))throw Error(`Icon "${e}" cannot be rendered.`);for(let[e,n]of Object.entries(t||{})){if(n==null||n===!1)continue;let t=e===`className`?`class`:e;r.setAttribute(t,n===!0?``:String(n))}return r}function p(e){return u(e)}let m=p;function h(){return{...c}}function g(e){if(typeof e!=`object`||!e)throw Error(`Icons must be a valid object.`);for(let[t,n]of Object.entries(e)){if(typeof n!=`string`||!n.trim().startsWith(`<`))throw Error(`Invalid SVG path for icon "${t}".`);c[t]=n}}function _(e=`center`,n=`center`){let r=f(`loader`,{width:24});return requestAnimationFrame(()=>{typeof r.animate==`function`&&r.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),(0,t.jsx)(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:n,position:`absolute`,width:`100%`,height:`100%`,borderRadius:`inherit`,backdropFilter:`blur(4px)`},children:r})}let v=Function.prototype.toString.call(Object);function y(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&Function.prototype.toString.call(n)===v}function b(e){return e==null}function x(e){return typeof Node<`u`&&e instanceof Node}function S(e){return typeof Element<`u`&&e instanceof Element}function C(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function w(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function T(e){return b(e)||w(e)||typeof e==`function`||Array.isArray(e)||x(e)}let E=e=>e===null?`null`:Array.isArray(e)?`array`:C(e)?`HTMLElement`:x(e)?`Node`:typeof e;function D(e){return Array.isArray(e)?e.slice():y(e)?{...e}:e}function O(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function k(e,t){throw Error(`Validator: ${e} ${t}`)}function A(e){return typeof e==`string`?e:String(e)}function j(e){return typeof e==`string`?`string`:`array`}function M(e,t,n){if(b(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=j(t);n.nonEmpty&&t.length===0&&k(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&k(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&k(e,`expects ${r} length to be at most ${n.maxLength}.`)}function N(e,t,n){b(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&k(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&k(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&k(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&k(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&k(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&k(e,`expects a number less than ${n.lessThan}.`))}function ee(e,t,n){!n.plain||b(t)||y(t)||k(e,`expects an object.`)}function te(e,t,n){!n.items||b(t)||(Array.isArray(t)||k(e,`expects array.`),t.forEach((t,r)=>{L(String(r),t,n.items,e)}))}function ne(e,t,n){if(!n.shape||b(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&k(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))L(t,r[t],i,e)}function P(e,t){return t===`renderable`?T(e):t===`Node`?x(e):t===`Element`?S(e):t===`HTMLElement`?C(e):t===`plainObject`?y(e):E(e)===t}function re(e){return y(e)?`object`:E(e)}function F(e,t,n=[]){let r=Array.isArray(n)?n:n?[n]:[];for(let n of r){let r,i;if(typeof n==`function`)r=n,i=`does not satisfy the required condition.`;else if(n&&typeof n.test==`function`)r=n.test,i=n.message||`condition failed.`;else throw Error(`Validator: Condition must be a function or { test, message }.`);r(t)||k(e,i)}}function I(e,t){return e?`${e}.${t}`:t}function L(e,t,n={},r=``){let i=O(n),a=I(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&b(t)&&k(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=re(t);e.some(e=>P(t,e))||k(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&k(a,`expects one of ${i.enum.map(A).join(`, `)}.`),M(a,t,i),N(a,t,i),ee(a,t,i),te(a,t,i),ne(a,t,i),F(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||k(a,i.message||`does not satisfy the required condition.`)),t}function R(e={},t={},n=`Options`){let r=e??{};if(typeof r!=`object`||Array.isArray(r))throw Error(`${n} expects object.`);let i=r,a={...i},o=Object.entries(t||{});for(let[e,t]of o){let n=O(t);a[e]=Object.hasOwn(i,e)?i[e]:ie(n)}for(let[e,n]of o){let r=O(n);typeof r.normalize==`function`&&(a[e]=r.normalize(a[e],{key:e,input:i,options:a,schema:t}))}for(let[e,t]of o)L(e,a[e],t,n);return a}function ie(e){if(!Object.hasOwn(e,`default`))return;let t=e.default;return D(e.factory&&typeof t==`function`?t():t)}function z(e){return e}function B(...e){return e.filter(Boolean).join(` `)}let V=[`node`,`element`,`array`];function ae(e){return V.includes(e)}function H(e){return x(e)}function U(e){return S(e)}function oe(e){return typeof e==`string`||U(e)||H(e)||Array.isArray(e)}function se(e){return e.find(U)||null}function W(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!W(n,t))return null;continue}if(H(n)){t.push(n);continue}return null}return t}function ce(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=q(e);return t.length>0?t:null}if(Array.isArray(e)){let t=W(e,[]);return t&&t.length>0?t:null}return H(e)?[e]:null}function le(e){return U(e)||H(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(ce(e)||[])[0]||null}function G(e){if(!oe(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return U(t)?t:null}if(Array.isArray(e)){let t=ce(e);return Array.isArray(t)?se(t):null}return U(e)?e:null}function ue(e,t=`Component`,n=`element`){if(!ae(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return oe(e)?n===`array`?ce(e):n===`node`?le(e):G(e):null}function de(e,t=`Component`,n=`element`){let r=ue(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function fe(e){return T(e)}function K(e,t=document){return t.querySelector(e)}function q(e,t=document){return Array.from(t.querySelectorAll(e))}function pe(e,t,n={}){if(typeof t!=`function`)throw TypeError(`lazyRender: renderCallback expects function.`);let{threshold:r=.1,rootMargin:i=`0px`,root:a=null,waitForDOM:o=!0}=n,s={threshold:r,rootMargin:i,root:a};if(!he(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),me;let c=me,l=ge(e);if(l&&document.body.contains(l))return c=_e(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=ge(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=_e(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function me(){}function he(e){return typeof e==`string`||U(e)}function ge(e){return typeof e==`string`?K(e):e}function _e(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),me;let r=new window.IntersectionObserver(n=>{for(let i of n)if(i.isIntersecting){r.unobserve(e),r.disconnect(),t();break}},n);return r.observe(e),()=>{r.unobserve(e),r.disconnect()}}function ve(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function J(){let e=new Map,t=t=>{let n=e.get(t);return n?(n(),e.delete(t),!0):!1};return{on(n,r,i,a,o){if(typeof n!=`string`||n.trim()===``)throw TypeError(`EventManager.on: key expects a non-empty string.`);if(t(n),r==null)return()=>{};let s=ve(r,i,a,o);return e.set(n,s),s},off:t,clear(){for(let t of e.values())t();e.clear()},size(){return e.size}}}function ye(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(16);if(typeof crypto.getRandomValues!=`function`)throw Error(`Your browser is too old to support secure login.`);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20,32)].join(`-`)}function Y(e=8){if(!Number.isInteger(e)||e<1||e>87381)throw Error(`Length must be an integer between 1 and 87381`);let t=Math.ceil(e*3/4),n=new Uint8Array(t);crypto.getRandomValues(n);let r=``;for(let e of n)r+=String.fromCharCode(e);return btoa(r).substring(0,e).replace(/\+/g,`-`).replace(/\//g,`_`)}let be={},xe={timers:be,start(e,t,n){be[e]&&clearTimeout(be[e]),be[e]=setTimeout(()=>{n(),delete be[e]},t)},cancel(e){be[e]&&(clearTimeout(be[e]),delete be[e])}},Se={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,confirm:`j-toast is-confirm`,buttons:`toast-buttons`,button:`j-button is-sm`,closeBtn:`is-ghost`,confirmBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},Ce={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},we={type:`number`,min:0},Te={type:`number`,greaterThan:0},Ee=new Set,X=new Map,Z=new Map,De=new Map,Oe=new Map,ke=Se;function Ae(e){return{...Se,...e}}function je(e){return Ae({...ke,...e?.className})}function Me(e,t){let n=X.get(e);X.set(e,()=>{n?.(),t()})}function Ne(e){let t=Oe.get(e);return t?!t.isConnected||t.getAttribute(`data-mount`)===`false`?(Oe.delete(e),null):t:null}function Pe(e,t,n){n&&Oe.set(e,t)}function Fe(e){for(let[t,n]of Oe)n===e&&Oe.delete(t)}function Ie(e){return!!(0,t.access)(e.loading??!1)}function Le(e){return e===`primary`?`info`:e}function Re(e){return Ie(e)?{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`var(--toast-icon-size, 1em)`,height:`var(--toast-icon-size, 1em)`,flex:`0 0 auto`}:{}}function ze(e,t){return Ie(t)?_():f(Le(e))}function Be(e,t){return Ie(t)?t.text?.loading||a(`Loading...`):e}async function Ve(e,t){let n=Ie(t);Qe(e),n&&await t.onCancel?.(),await t.onClose?.()}function He(e,n,r,i,a,o,s=0){let c=e.dataset.toast||Y();Me(e,(0,t.createRoot)(l=>((0,t.insert)(n,()=>ze(a,o)),(0,t.insert)(r,()=>Be(i,o)),(0,t.createEffect)(()=>{Ge(c),s>0&&!Ie(o)&&We(c,`hide`,()=>Qe(e),s)}),l)))}function Ue(e){let n=K(`[data-toast-container]`);return n?n.className=e.container:(n=(0,t.jsx)(`div`,{className:e.container,"data-toast-container":``}),(0,t.insert)(document.body,n)),n}function We(e,t,n,r){let i=`${e}-${t}`;return Ee.add(i),xe.start(i,r,()=>{Ee.delete(i),n()}),i}function Ge(e){for(let t of Array.from(Ee))t.startsWith(`${e}-`)&&(xe.cancel(t),Ee.delete(t))}function Ke(e){Z.get(e)?.cancel(),Z.delete(e),De.delete(e),e.remove(),X.get(e)?.(),X.delete(e),Fe(e);let t=K(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function qe(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function Je(e){return e.finished.then(()=>void 0,()=>void 0)}function Ye(e,t){let n=e.hasAttribute(`data-toast-lite`);return n&&t===`enter`?[{opacity:0},{opacity:1}]:n?[{opacity:1,transform:`translate(-50%, -50%)`},{opacity:0,transform:`translate(-50%, calc(-50% - 8px))`}]:t===`enter`?[{opacity:0,transform:`translate3d(0, -16px, 0)`},{opacity:1,transform:`translate3d(0, 0, 0)`}]:[{opacity:1,transform:`translate3d(0, 0, 0)`},{opacity:0,transform:`translate3d(0, -16px, 0)`}]}async function Xe(e,t){let n=(De.get(e)||0)+1;if(De.set(e,n),Z.get(e)?.cancel(),Z.delete(e),typeof e.animate!=`function`)return;let r=e.hasAttribute(`data-toast-lite`),i=e.animate(Ye(e,t),qe(e,t===`enter`?r?150:240:r?120:180,t===`enter`?`cubic-bezier(0.16, 1, 0.3, 1)`:`cubic-bezier(0.4, 0, 1, 1)`));Z.set(e,i),await Je(i),De.get(e)===n&&Z.get(e)===i&&Z.delete(e)}function Ze(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),Xe(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function Qe(e){e&&e.getAttribute(`data-mount`)!==`false`&&(X.get(e)?.(),X.delete(e),Ge(e.dataset.toast||Y()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),Xe(e,`leave`).then(()=>{e.dataset.mount===`false`&&Ke(e)}))}function $e(e=``,n={}){let r=n.once??!1;if(r){let e=Ne(`show`);if(e)return e}L(`message`,e,`string`,`Toast.show`);let i=n.duration??3e3,a=n.theme||`info`;L(`once`,r,`boolean`,`Toast.show`),L(`duration`,i,we,`Toast.show`),L(`theme`,a,Ce,`Toast.show`);let o=je(n),s=Y(),c=(0,t.jsx)(`span`,{className:o.icon,"data-toast-icon":s,style:()=>Re(n)}),l=(0,t.jsx)(`span`,{className:o.message,"data-toast-message":s}),u=(0,t.jsx)(`div`,{className:B(o.toast,o[a]),"data-toast":s,role:`alert`,"aria-atomic":`true`,children:[c,l]});return He(u,c,l,e,a,n,i),Ze(u,()=>(0,t.insert)(Ue(o),u),a===`error`?`assertive`:`polite`),Pe(`show`,u,r),Me(u,ve(u,`click`,()=>void Ve(u,n))),u}function et(e=``,n=2e3,r){L(`message`,e,`string`,`Toast.lite`),L(`duration`,n,Te,`Toast.lite`);let i=Ae({...ke,...r}),a=K(`[data-toast-lite]`);a&&(Ge(a.dataset.toast||``),Z.get(a)?.cancel(),Ke(a));let o=Y(),s=(0,t.jsx)(`div`,{className:i.lite,"data-toast":o,"data-toast-lite":``,children:e});return Ze(s,()=>(0,t.insert)(document.body,s),`polite`),We(o,`hide`,()=>Qe(s),n),s}function tt(e=``,n={}){let r=n.once??!0;if(r){let e=Ne(`confirm`);if(e)return e}L(`message`,e,`string`,`Toast.confirm`);let i=n.text?.close||a(`Close`),o=n.text?.confirm||a(`Confirm`),s=n.theme||`info`;L(`once`,r,`boolean`,`Toast.confirm`),L(`theme`,s,Ce,`Toast.confirm`);let c=je(n),l=Y(),u=(0,t.jsx)(`div`,{className:B(c.confirm,c[s]),"data-toast":l,"data-toast-confirm":``,children:[(0,t.jsx)(`div`,{className:c.message,"data-toast-message":l,children:e}),(0,t.jsx)(`div`,{className:c.buttons,"data-toast-buttons":l,children:[(0,t.jsx)(`button`,{className:B(c.button,c.closeBtn),children:i,"data-toast-button":`close`,"aria-label":i,onClick:async()=>{await n.onClose?.(),Qe(u)}}),(0,t.jsx)(`button`,{className:B(c.button,c.confirmBtn),children:o,"data-toast-button":`confirm`,"aria-label":o,onClick:async()=>{await n.onConfirm?.(),Qe(u)}})]})]});return Ze(u,()=>(0,t.insert)(Ue(c),u),`polite`,()=>{K(`[data-toast-button="confirm"]`,u)?.focus()}),Pe(`confirm`,u,r),u}function nt(){for(let e of Ee)xe.cancel(e);Ee.clear();for(let e of X.values())e();X.clear();for(let e of Z.values())e.cancel();Z.clear(),De.clear(),Oe.clear(),K(`[data-toast-container]`)?.remove(),K(`[data-toast-lite]`)?.remove()}let rt={timers:Ee,disposers:X,configure(e={}){return ke=Ae(e.className),{className:ke}},show:$e,success:(e=``,t={})=>$e(e,{...t,theme:`success`}),info:(e=``,t={})=>$e(e,{...t,theme:`info`}),primary:(e=``,t={})=>$e(e,{...t,theme:`primary`}),warning:(e=``,t={})=>$e(e,{...t,theme:`warning`}),error:(e=``,t={})=>$e(e,{...t,theme:`error`}),hide:Qe,lite:et,confirm:tt,clearAll:nt,destroyAll:nt};function it(){if(typeof navigator>`u`)return!1;if(typeof navigator.userAgentData?.mobile==`boolean`)return navigator.userAgentData.mobile;let e=navigator.userAgent||``;return/\b(BlackBerry|webOS|iPhone|IEMobile|Android|Windows Phone|iPad|iPod)\b/i.test(e)?!0:typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(pointer: coarse)`).matches&&window.matchMedia(`(max-width: 820px)`).matches}async function at(e){if(typeof window>`u`||typeof document>`u`)return Promise.resolve(!1);let t=String(e);if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)try{return await navigator.clipboard.writeText(t),!0}catch{return ot(t)}return ot(t)}function ot(e){let t=null;try{return t=document.createElement(`textarea`),t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{t&&t.parentNode&&t.parentNode.removeChild(t)}}function st(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function ct(){return st()?!0:(rt.confirm(a(`wn`),{theme:`error`,onConfirm:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{confirmBtn:`j-button is-sm is-danger`}}),!1)}let lt=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function ut(e,t,n={}){let r=new Headers(n.headers);return r.has(`Content-Type`)||r.set(`Content-Type`,`application/json`),(await fetch(e,{...n,method:`POST`,headers:r,body:JSON.stringify(t)})).json()}let dt=null,ft=null,pt=!1;function mt(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function ht(){pt||(pt=!0,mt(_t))}function gt(e){e.enqueued=!0,ft?ft.next=e:dt=e,ft=e,ht()}function _t(){pt=!1;let e=dt;dt=null,ft=null;let t=e;for(;t;){let e=t.next;t.next=null,t.enqueued=!1,!t.disposed&&t.queued&&(t.queued=!1,t.run()),t=e}}function vt(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||gt(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function yt(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function bt(e){return yt(e),e}function xt(e){return(0,t.unwrap)(e)}function St(e,n,{deferInitial:r=!0,flushInitial:i=!1,flush:a=`microtask`}={}){let o=!1,s=!1,c,l=vt(()=>{s&&(s=!1,(0,t.untrack)(()=>n(c)))}),u=(0,t.createWatch)(e,e=>{let t=!o;if(o=!0,c=e,s=!0,t&&i||a===`sync`){l.flush();return}l.schedule()},{defer:r});return()=>{l.dispose(),u.dispose()}}function Ct(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function wt(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(n){return r=>{e.set(n,r),(0,t.onCleanup)(()=>{e.get(n)===r&&e.delete(n)})}},delete(t){e.delete(t)},clear(){e.clear()}}}function Tt(e,n={}){let r,i=n.removeOnDispose!==!1,a=(0,t.createRoot)(n=>(r=(0,t.untrack)(e),i&&(0,t.onCleanup)(()=>r.remove()),n));return{element:r,dispose:a}}function Et(...e){return{async enter(t){await Promise.all(e.map(e=>e.enter(t)))},async leave(t){await Promise.all(e.map(e=>e.leave(t)))},cancel(){for(let t of e)t.cancel()}}}function Dt(e,t){let n=e.finished.then(()=>void 0,()=>void 0);return t?new Promise(e=>{let r=()=>{t.removeEventListener(`abort`,r),e()};if(t.aborted){r();return}t.addEventListener(`abort`,r,{once:!0}),n.then(r)}):n}function Ot(e,t){let n={fill:`both`,...t.options},r=e.ownerDocument.defaultView;return t.respectReducedMotion!==!1&&r?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches&&(n.duration=0,n.delay=0,n.endDelay=0),n}function kt(e,t){let n=null,r=()=>{let t=e()||null;return!t||typeof t.animate!=`function`?null:t},i=e=>e===1||!Array.isArray(t.keyframes)?t.keyframes:t.keyframes.slice().reverse(),a=async(e,a)=>{if(a?.aborted)return;let o=r();o&&(n?.cancel(),n=o.animate(i(e),Ot(o,t)),await Dt(n,a),a?.aborted)};return{enter:e=>a(1,e),leave:e=>a(-1,e),cancel(){n?.cancel(),n=null}}}function At(e,t={}){let n=t.axis||`vertical`,r=null,i=null,a=null,o=`1`,s=0,c=e=>n===`vertical`?e.style.height:e.style.width,l=(e,t)=>{n===`vertical`?e.style.height=t:e.style.width=t},u=()=>{!r||!a||(l(r,a.size),r.style.opacity=a.opacity,r.style.overflow=a.overflow,r.style.visibility=a.visibility)},d=()=>{let t=e()||null;return t===r?r:(i?.cancel(),u(),i=null,r=t,a=t?{size:c(t),opacity:t.style.opacity,overflow:t.style.overflow,visibility:t.style.visibility}:null,o=t?.ownerDocument.defaultView?.getComputedStyle(t).opacity||`1`,r)},f=e=>{let n=d();if(!(!n||!a)){if(e){u();return}l(n,`0px`),n.style.overflow=`hidden`,n.style.visibility=`hidden`,t.fade!==!1&&(n.style.opacity=`0`)}},p=e=>{if(!a)return 0;let t=c(e),r=e.style.visibility;l(e,a.size),e.style.visibility=a.visibility;let i=e.getBoundingClientRect(),o=n===`vertical`?Math.max(i.height,e.scrollHeight):Math.max(i.width,e.scrollWidth);return l(e,t),e.style.visibility=r,o},m=async(e,r)=>{if(r?.aborted)return;let c=d();if(!c||!a)return;let l=c.getBoundingClientRect(),u=n===`vertical`?l.height:l.width,m=c.ownerDocument.defaultView?.getComputedStyle(c).opacity,h=i?m||(e?`0`:o):c.style.opacity||m||(e?`0`:o),g=++s;i?.cancel(),i=null;let _=e?p(c):0;if(c.style.overflow=`hidden`,c.style.visibility=a.visibility,typeof c.animate!=`function`){f(e);return}let v=Ot(c,{keyframes:[],options:{duration:250,easing:`ease`,...t.options,fill:`both`},respectReducedMotion:t.respectReducedMotion});i=c.animate([{[n===`vertical`?`height`:`width`]:`${u}px`,...t.fade===!1?{}:{opacity:h}},{[n===`vertical`?`height`:`width`]:`${_}px`,...t.fade===!1?{}:{opacity:e?o:`0`}}],v);let y=i;await Dt(y,r),!(g!==s||r?.aborted)&&(y.cancel(),i===y&&(i=null),f(e))};return{enter:e=>m(!0,e),leave:e=>m(!1,e),setExpanded(e){s+=1,i?.cancel(),i=null,f(e)},cancel(){s+=1,i?.cancel(),i=null,u(),r=null,a=null}}}function jt(e){return e.filter(e=>e!=null&&e.isConnected)}function Mt(e){e[0]?.getBoundingClientRect()}function Nt(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?Number.parseFloat(t)||0:t.endsWith(`s`)?(Number.parseFloat(t)||0)*1e3:0})}function Pt(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function Ft(e,t,n=[1],r=[!0]){let i=Math.max(e.length,t.length,n.length,r.length),a=0;for(let o=0;o<i;o+=1){if(!r[o%r.length])continue;let i=(e[o%e.length]||0)*(n[o%n.length]||0)+(t[o%t.length]||0);a=Math.max(a,i)}return Math.max(0,a)}function It(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=Ft(Nt(n.transitionDuration),Nt(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=Ft(Nt(n.animationDuration),Nt(n.animationDelay),Pt(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function Lt(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=()=>{clearTimeout(i),t?.removeEventListener(`abort`,r),n()},i=setTimeout(r,e);t?.addEventListener(`abort`,r,{once:!0})})}async function Rt(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,It(t));continue}for(let e of t.getAnimations()){let t=e.effect?.getComputedTiming().endTime;(typeof t!=`number`||Number.isFinite(t))&&n.add(e)}}let i=Array.from(n,e=>e.finished);if(r>0&&i.push(Lt(r,t)),i.length===0)return;let a=Promise.allSettled(i);if(!t){await a;return}await new Promise(e=>{let n=()=>{t.removeEventListener(`abort`,n),e()};if(t.aborted){n();return}t.addEventListener(`abort`,n,{once:!0}),a.then(n)})}function zt(e){let n=`hidden`,r=0,i=null,a=null,o=null,s=()=>(o?.abort(),o=new AbortController,o.signal);return{get phase(){return n},enter:()=>{if(n===`visible`)return Promise.resolve(!1);if(n===`entering`&&i)return i;let a=++r,o=s();return n=`entering`,i=(async()=>{e.mount();let i=jt(e.elements());return Mt(i),(0,t.flushSync)(e.activate),e.motion?await e.motion.enter(o):await Rt(i,o),a===r?(n=`visible`,!0):!1})(),i},leave:()=>{if(n===`hidden`)return Promise.resolve(!1);if(n===`leaving`&&a)return a;let i=++r,o=s();return n=`leaving`,a=(async()=>{(0,t.flushSync)(e.deactivate);let a=jt(e.elements());return e.motion?await e.motion.leave(o):await Rt(a,o),i===r?(e.unmount(),n=`hidden`,!0):!1})(),a},cancel(){r+=1,o?.abort(),o=null,e.motion?.cancel(),n=`hidden`,i=null,a=null}}}let Bt={className:{default:`j-popup-layout`,type:`string`},position:{default:`center`,type:`string`},component:{default:``,type:`string`},labelledby:{default:``,type:`string`},content:{default:``,type:`renderable`}};function Vt(e){let t=R(e,Bt,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function Ht(e={}){let{className:n,position:r,component:i,labelledby:a,content:o}=Vt(e),s={className:`${n} is-${r}`,role:`dialog`,children:z(o)};return i&&(s[`data-${i}`]=`root`,s[`aria-${i}`]=`true`),a&&(s[`aria-labelledby`]=a),(0,t.jsx)(`div`,s)}let Ut={root:`j-drop`,container:`drop-container`},Wt={name:{default:null,types:[`string`,`null`]},mode:{default:`click`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:10,type:`number`,min:0},content:{default:``,type:`renderable`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:Ut,type:`object`,normalize:e=>({...Ut,...e&&typeof e==`object`?e:{}})},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Gt(e){let t=R(e,Wt,`Drop`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,content:t.content,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function Kt(e){return typeof e==`number`&&e>=0?{show:e,hide:e}:typeof e==`object`&&e?{show:Number(e.show)||0,hide:Number(e.hide)||0}:{show:0,hide:0}}function qt(e){return typeof e==`number`&&e>0?e:0}function Jt(e,n={}){let r=G(e),i=Gt(n),a=J(),o=Kt(i.delay),s={show:null,hide:null},c={x:0,y:0,lastMoveTime:0},l=0,u=0,d=!1,f=!1,p,m=null,h=null,g=0,v=()=>{},[y,b]=(0,t.createSignal)(typeof i.content==`function`?null:i.content),[x,S]=(0,t.createSignal)(!1),C=()=>{if(x())return _();let e=y();return typeof e==`function`?e(p):e},{root:w}=(0,t.createRoot)(e=>{v=e;let n=(0,t.jsx)(`div`,{className:i.className.container,"data-drop-container":i.name||i.id,"aria-live":()=>typeof i.content==`function`?`polite`:null,"aria-busy":()=>String(x()),children:()=>z(C())});return{root:(0,t.jsx)(`div`,{className:i.className.root,id:i.id,"data-drop":i.name||Y(),"aria-expanded":`false`,children:n})}}),T=e=>{s[e]&&clearTimeout(s[e]),s[e]=null},E=async()=>{let e=i.content;if(typeof e!=`function`){b(e);return}let t=qt(i.ttl);if(i.cache&&m&&(!t||Date.now()-m.updatedAt<=t)){b(m.content);return}if(h)return h;let n=++g;S(!0);let r=Promise.resolve().then(()=>e(p)).then(e=>{f||n!==g||(i.cache&&(m={content:e,updatedAt:Date.now()}),b(e))}).finally(()=>{n===g&&!f&&S(!1),h===r&&(h=null)});return h=r,r},D=()=>{if(!r)return;let e=r.getBoundingClientRect(),{offset:t,position:n}=i;w.style.visibility=`hidden`,w.style.display=`block`;let a=w.getBoundingClientRect(),o=0,s=0,c=n;switch(c===`auto`&&(c=window.innerHeight-e.bottom>a.height+t?`bottom-center`:`top-center`),c){case`top-left`:o=e.top-a.height-t,s=e.left;break;case`top-center`:o=e.top-a.height-t,s=e.left+e.width/2-a.width/2;break;case`top-right`:o=e.top-a.height-t,s=e.right-a.width;break;case`bottom-left`:o=e.bottom+t,s=e.left;break;case`bottom-center`:o=e.bottom+t,s=e.left+e.width/2-a.width/2;break;case`bottom-right`:o=e.bottom+t,s=e.right-a.width;break;case`left`:o=e.top+e.height/2-a.height/2,s=e.left-a.width-t;break;case`right`:o=e.top+e.height/2-a.height/2,s=e.right+t;break;default:break}o=Math.max(8,Math.min(o,window.innerHeight-a.height-8)),s=Math.max(8,Math.min(s,window.innerWidth-a.width-8)),w.style.top=`${o+window.scrollY}px`,w.style.left=`${s+window.scrollX}px`,w.style.visibility=``,w.style.display=``},O=e=>{f||d===e||(e?(w.parentNode||(0,t.insert)(document.body,w),D(),E().then(()=>{d&&!f&&D()})):(g+=1,h=null,S(!1),w.style.top=``,w.style.left=``,w.remove()),w.setAttribute(`aria-expanded`,e?`true`:`false`),d=e,e?i.onShown?.(p):i.onHidden?.(p))},k=e=>{e.target instanceof Node&&r&&!w.contains(e.target)&&!r.contains(e.target)&&p.hide()},A=e=>{e instanceof MouseEvent&&(l=e.clientX,u=e.clientY,c.lastMoveTime=Date.now(),c.x=e.clientX,c.y=e.clientY)},j=()=>{a.on(`document:mousemove`,document,`mousemove`,A),T(`show`),s.show=setTimeout(()=>{let e=Date.now()-c.lastMoveTime;Math.abs(c.x-l)+Math.abs(c.y-u)<5||e>100?(p.show(!1),a.off(`document:mousemove`)):j()},o.show)};return p={get target(){return r},props:i,get element(){return f?null:w},get isVisible(){return d},delayShow:o.show,delayHide:o.hide,show(e=!0){T(`hide`),!(d||f)&&(e&&o.show>0?(T(`show`),s.show=setTimeout(()=>O(!0),o.show)):O(!0))},hide(e=!0){T(`show`),!(!d||f)&&(e&&o.hide>0?(T(`hide`),s.hide=setTimeout(()=>O(!1),o.hide)):O(!1))},toggle(){d?p.hide():p.show()},destroy(){f||(f=!0,T(`show`),T(`hide`),a.clear(),g+=1,h=null,S(!1),w.remove(),v(),r=null,d=!1)}},r&&(i.mode===`hover`?(a.on(`target:enter`,r,`mouseenter`,()=>{i.hoverIntent?j():p.show()}),a.on(`target:leave`,r,`mouseleave`,()=>{T(`show`),a.off(`document:mousemove`),p.hide()}),a.on(`root:enter`,w,`mouseenter`,()=>p.show()),a.on(`root:leave`,w,`mouseleave`,()=>p.hide())):(a.on(`target:click`,r,`click`,()=>p.toggle()),a.on(`document:click`,document,`click`,k))),p}let Yt={container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}};function Xt(e){let t=e&&typeof e==`object`?e:{},n=`ui`in t&&t.ui&&typeof t.ui==`object`?t.ui:{};return{...Yt,...t,ui:{...Yt.ui,...n}}}let Zt={name:{default:null,types:[`string`,`null`]},mode:{default:`hover`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:8,type:`number`},message:{default:``,type:`string`,normalize:e=>typeof e==`string`?e.trim():e,nonEmpty:!0},theme:{default:!1,types:[`string`,`boolean`],enum:[!1,`reverse`,`primary`,`success`,`warning`,`error`]},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:Yt,type:`object`,normalize:Xt},id:{default:null,types:[`string`,`null`]},delay:{default:100,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Qt(e){let t=R(e,Zt,`Tooltip.props`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,message:t.message,theme:t.theme,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function $t(e,n={}){let r=Qt(n),i=(0,t.jsx)(`div`,{className:B(r.className.container,r.theme&&r.className.ui[r.theme]),"data-tooltip":r.name||r.id||``,children:(0,t.jsx)(`div`,{className:r.className.message,"data-tooltip-message":``,children:r.message})}),a=Jt(e,{name:r.name,mode:r.mode,position:r.position,offset:r.offset,cache:r.cache,ttl:r.ttl,id:r.id,delay:r.delay,hoverIntent:r.hoverIntent,onShown:r.onShown,onHidden:r.onHidden,content:i});return{get element(){return a?.element||null},get drop(){return a},show(e=!0){a?.show(e)},hide(e=!0){a?.hide(e)},toggle(){a?.toggle()},destroy(){a?.destroy(),a=null}}}let en={panel:`j-theme-palette`,title:`theme-palette-title`,container:`palette-container`,item:`palette-item`,itemTitle:`item-title`,items:`items`,button:`j-button is-default`,active:`is-active`,prefix:`el-prefix`,swatch:`item-hex`,buttonText:`button-text`},tn={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:en},nn={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`};function rn(e){return{...en,...e}}function an(e={}){return{...tn,...e,className:rn(e.className)}}function on(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function sn(){return(0,r.createStorage)({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:864e5*7})}function cn(e){if(!y(e))return null;let t=e,n={};for(let e of[`mode`,`theme`,`radius`,`shadow`,`font`]){let r=t[e];typeof r==`string`&&(n[e]=r)}return Object.keys(n).length?n:null}function ln(e){return[{title:e(`Primary`),type:`theme`,buttons:[[`gray`,e(`Gray`)],[`olive`,e(`Olive`)],[`tomato`,e(`Tomato`)],[`ruby`,e(`Ruby`)],[`pink`,e(`Pink`)],[`violet`,e(`Violet`)],[`indigo`,e(`Indigo`)],[`blue`,e(`Blue`)],[`teal`,e(`Teal`)],[`grass`,e(`Grass`)],[`mint`,e(`Mint`)],[`lime`,e(`Lime`)],[`yellow`,e(`Yellow`)],[`orange`,e(`Orange`)],[`gold`,e(`Gold`)]]},{title:e(`Radius`),type:`radius`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)],[`xl`,e(`XL`)],[`round`,e(`Round`)]]},{title:e(`Shadow`),type:`shadow`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)]]},{title:e(`Font`),type:`font`,buttons:[[`sm`,e(`sm`)],[`md`,e(`md`)]]},{title:e(`Mode`),type:`mode`,buttons:[[`light`,e(`Light`)],[`dark`,e(`Dark`)],[`auto`,e(`Auto`)]]}]}function un(e={}){let n=(0,t.createDeepStore)(an(e)),r={configVersion:0,destroyed:!1},i=sn(),o=new Set,s=J(),c=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,l=()=>{let{mode:e,theme:t,radius:r,shadow:a,font:o}=n,s={mode:e,theme:t,radius:r,shadow:a,font:o,render:e===`auto`?c():e};i.set(n.key,s).catch(()=>{})},u=e=>{let r=(0,t.createRoot)(r=>{for(let r of q(`[data-theme-group]`,e)){let e=r.dataset.themeGroup;if(on(e))for(let i of q(`[data-theme-button]`,r)){let r=()=>i.dataset.themeValue===String(n[e]);(0,t.bindClass)(i,n.className.active,r),(0,t.bindAttr)(i,`aria-selected`,()=>r()?`true`:null)}}return r});o.add(r)},d=(e=null,r=null)=>{let i=n.className,o=r||ln(a),s=(0,t.jsx)(`div`,{className:e||i.panel,"data-theme-palette":`root`,children:[(0,t.jsx)(`h3`,{className:i.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:a(`t`)}),(0,t.jsx)(`div`,{className:i.container,"data-theme-container":``,children:o.map(e=>(0,t.jsx)(`div`,{className:i.item,"data-theme-group":e.type,children:[(0,t.jsx)(`div`,{className:i.itemTitle,"data-theme-group-title":e.type,children:e.title}),(0,t.jsx)(`div`,{className:i.items,"data-theme-items":e.type,children:e.buttons.map(([r,a])=>{let o=String(n[e.type])===String(r);return(0,t.jsx)(`button`,{className:B(i.button,o&&i.active),"data-action":`customTheme`,"data-theme-button":e.type,"data-theme-value":r,"aria-selected":o?`true`:null,children:[e.type===`theme`?(0,t.jsx)(`span`,{className:B(i.prefix,i.swatch),"data-theme-swatch":r,style:{backgroundColor:`var(--ui-${r})`}}):null,(0,t.jsx)(`span`,{className:i.buttonText,"data-theme-button-text":r,children:a})]})})})]}))})]});return u(s),s},f=e=>{r.configVersion+=1,(0,t.flushSync)(()=>{Object.assign(n,e,{className:rn({...n.className,...e.className})})}),l()},p=()=>{if(!r.destroyed){r.destroyed=!0,s.clear();for(let e of o)e();o.clear(),i.close().catch(()=>{})}};s.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let i=e.target.closest(`[data-theme-button]`),a=(i?.closest(`[data-theme-group]`))?.dataset.themeGroup,o=i?.dataset.themeValue;if(!i||!on(a)||!o||i.classList.contains(n.className.active))return;let s=n[a];r.configVersion+=1,(0,t.flushSync)(()=>{n[a]=o});let u=document.documentElement;if(a===`mode`)u.classList.remove(`light`,`dark`,s),u.classList.add(o===`auto`?c():o);else{let e=nn[a],t=Array.from(u.classList).filter(t=>t.startsWith(e));t.length&&u.classList.remove(...t),u.classList.add(`${e}${o}`)}l()});let m=r.configVersion;return i.get(n.key).then(e=>{if(r.destroyed||r.configVersion!==m)return;let i=cn(e);i&&(0,t.flushSync)(()=>{Object.assign(n,i)})}).catch(()=>{}),{props:n,createPanel:d,setConfig:f,destroy:p}}let dn={color:`var(--tone-solid)`,size:`12px`},fn={ball:`parabola-ball`},pn={types:[`string`,`Node`,`array`,`null`,`undefined`]},mn={ball:{default:dn,type:`plainObject`,normalize:e=>({...dn,...e&&typeof e==`object`?e:{}}),shape:{color:`string`,size:`string`}},className:{default:fn,type:`object`,normalize:e=>({...fn,...e&&typeof e==`object`?e:{}})},from:{default:null,...pn},to:{default:null,...pn},direction:{default:`center`,type:`string`,enum:[`center`,`top-right`,`top-left`,`bottom-right`,`bottom-left`]},showDelay:{default:0,type:`number`},onShow:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function hn(e){let t=R(e,mn,`Parabola.props`);return{ball:t.ball,className:t.className,from:t.from,to:t.to,direction:t.direction,showDelay:t.showDelay,onShow:t.onShow,onHidden:t.onHidden}}function gn(e={}){let n=hn(e),r={destroyed:!1},i=new Set,a=new Map,o=new Map,s=null,c=G(n.from),l=G(n.to),u,d=()=>{if(!r.destroyed){if(s){s.isConnected||(0,t.insert)(document.body,s);return}s=(0,t.jsx)(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),(0,t.insert)(document.body,s)}},f=()=>{i.size>0||(s?.remove(),s=null)},p=(e,t)=>{if(!i.has(e))return;let r=o.get(e);r!==void 0&&cancelAnimationFrame(r),o.delete(e),e.remove(),i.delete(e),t&&n.onHidden?.(u),f()},m=e=>{if(r.destroyed||(d(),!s))return null;let{color:a,size:o}=n.ball,c=(0,t.jsx)(`div`,{className:n.className.ball,"data-parabola":`ball`,style:{backgroundColor:a,width:o,height:o,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return(0,t.insert)(s,c),i.add(c),c},h=()=>{let e=c?.getBoundingClientRect(),t=l?.getBoundingClientRect();if(!e||!t)return null;let{left:r,top:i,width:a,height:o}=e,{left:s,top:u,width:d,height:f}=t,p,m;switch(n.direction){case`top-left`:p=r+a*.2,m=i+o*.2;break;case`top-right`:p=r+a*.8,m=i+o*.2;break;case`bottom-left`:p=r+a*.2,m=i+o*.8;break;case`bottom-right`:p=r+a*.8,m=i+o*.8;break;default:p=r+a/2,m=i+o/2}let h=s+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},g=(e,t,n,i,a,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=a-n,d=i=>{if(r.destroyed||!e.isConnected){o.delete(e);return}let a=i-c,f=Math.min(a/s,1),m=1-(1-f)**3,h=t+l*m,g=n+-100*Math.sin(Math.PI*m)+u*m,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-m*.3})`,f<1?o.set(e,requestAnimationFrame(d)):(o.delete(e),p(e,!0))};o.set(e,requestAnimationFrame(d))},_=(e,t)=>{let r=`parabola-show-${Y()}`;a.set(r,t),xe.start(r,n.showDelay,()=>{a.delete(r),e()})},v=()=>{for(let[e,t]of a)xe.cancel(e),t();a.clear()};return u={props:n,runtime:r,get element(){return s},show(){return r.destroyed?Promise.resolve(!1):new Promise(e=>{_(()=>{if(r.destroyed){e(!1);return}c=G(n.from),l=G(n.to);let t=h();if(!t){e(!1);return}let i=m(t);if(!i){e(!1);return}n.onShow?.(u),g(i,t.startX,t.startY,t.endX,t.endY),e(!0)},()=>e(!1))})},destroy(){if(!r.destroyed){v(),c=null,l=null,r.destroyed=!0;for(let e of i)p(e,!1);o.clear(),f()}}},u}let _n={target:{default:null},parent:{default:null},max:{default:10,type:`number`,integer:!0,greaterThan:0},top:{default:16,type:`number`,min:0},gap:{default:16,type:`number`,min:0},overflow:{default:`destroy`,type:`string`,enum:[`destroy`,`ignore`]},reactive:{default:!1,type:`boolean`},onReBuild:{default:null,types:[`function`,`null`]}};function vn(e){let t=R(e,_n,`Sticky.props`);return{target:t.target,parent:t.parent,max:t.max,top:t.top,gap:t.gap,overflow:t.overflow,reactive:t.reactive,onReBuild:t.onReBuild}}function yn(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function bn(e){return e===!1||e==null?null:de(e,`Sticky.parent`,`element`)}function xn(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return yn(de(e,`Sticky.target`,`array`));let n=yn(q(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=yn(de(e,`Sticky.target`,`array`));if(!t)return n;let r=n.filter(e=>e===t||t.contains(e));if(r.length===0)throw Error(`Sticky.target: target not found in parent.`);return r}function Sn(e={}){let n=vn(e),r=(0,t.createDeepStore)({items:[]}),i={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},a={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,u=e=>e.length<=n.max?e:n.overflow===`ignore`?[]:e.slice(-n.max),d=()=>{for(let e of a.originalStyles.values())f(e)},f=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},p=(e,t)=>{if(e.id)return e.id;let n=a.keys.get(e);if(n)return n;let r=`sticky-${Y()}-${t}`;return a.keys.set(e,r),r},m=e=>{a.originalStyles.has(e)||a.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},h=()=>u(xn(n.target,o)),g=(e=n.top)=>{let i=e,o=[],c=new Set(s);for(let[e,t]of a.originalStyles)c.has(e)||(f(t),a.originalStyles.delete(e));return s.forEach((e,t)=>{m(e),e.style.position=`sticky`,e.style.top=`${i}px`,o.push({key:p(e,t),index:t,top:i}),i+=e.offsetHeight+n.gap}),(0,t.flushSync)(()=>{r.items=o}),n.onReBuild?.(l),i},_=()=>{if(c?.disconnect(),c=null,!n.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{i.reBuilding||i.destroyed||!i.built||(i.reBuilding=!0,i.reBuildFrameId=requestAnimationFrame(()=>{i.reBuilding=!1,i.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:n,state:r,runtime:i,build:()=>{if(i.destroyed)throw Error(`Sticky.build: instance destroyed`);return i.built?l:(o=bn(n.parent),s=h(),i.built=!0,_(),s.length===0?((0,t.flushSync)(()=>{r.items=[]}),l):(g(),l))},reBuild:()=>(!i.destroyed&&i.built&&(s=h(),g()),l),destroy:()=>{i.destroyed||(i.reBuildFrameId&&cancelAnimationFrame(i.reBuildFrameId),c?.disconnect(),c=null,d(),i.destroyed=!0,i.built=!1,i.reBuilding=!1,i.reBuildFrameId=0,a.originalStyles.clear(),s=[],o=null)}},l}let Cn={help:`help-block`},wn={rules:{default:{},type:`object`},messages:{default:{},type:`object`},vanilla:{default:!1,type:`boolean`},className:{default:Cn,type:`object`,normalize:e=>Tn(e)},onSubmit:{default:null,types:[`function`,`null`]}};function Tn(e){return{...Cn,...y(e)?e:{}}}function En(e){let t=R(e,wn,`Validator.props`);return{rules:t.rules,messages:t.messages,vanilla:t.vanilla,className:t.className,onSubmit:t.onSubmit}}function Dn(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function On(e){if(!e)return null;if(e instanceof Element)return Dn(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&Dn(t))return t;return null}function kn(){return{valid:!0,error:!1,message:``,destroyed:!1}}function An(e){return e.closest(`[data-field-control]`)||e.parentElement}function jn(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function Mn(e){return e instanceof HTMLInputElement&&e.type===`file`}function Nn(e){return!!e.files&&e.files.length>0}function Pn(e,t){return t===!0?e instanceof HTMLSelectElement?jn(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function Fn(e,t){return typeof t!=`number`||e.value.length>=t}function In(e,t){return typeof t!=`number`||e.value.length<=t}function Ln(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function Rn(e,t,n){if(!e||typeof n!=`string`)return!0;let r=On(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function zn(e,t){if(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)throw Error(`Validator: element expects a checkbox input, but ${e.tagName.toLowerCase()} given.`);return e.checked===t}function Bn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||jn(e).some(e=>e.length>0)}function Vn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||e.selectedOptions.length>0}function Hn(e,t){if(!e||!(t instanceof HTMLInputElement)||t.type!==`checkbox`)return[];let n=Array.from(e.elements).filter(e=>e instanceof HTMLInputElement&&e.type===`checkbox`&&e.name===t.name&&!e.closest(`[data-field-switch]`));return n.length>1||t.closest(`[data-choice-type="checkbox"], [data-field-choice-group]`)?n:[]}function Un(e,t){let n=Hn(e,t);return n.length===0?null:n.filter(e=>e.checked).length}function Wn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length>=n;let r=Un(e,t);return r===null||r>=n}function Gn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length<=n;let r=Un(e,t);return r===null||r<=n}function Kn(e,t){return!/\s/.test(e.value)||t!==!0}function qn(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function Jn(e,t){return!Mn(e)||t!==!0||Nn(e)}function Yn(e,t){return!Mn(e)||!Nn(e)||typeof t!=`number`||e.files[0].size>=t}function Xn(e,t){return!Mn(e)||!Nn(e)||typeof t!=`number`||e.files[0].size<=t}function Zn(e,t){if(!Mn(e)||!Nn(e)||typeof t!=`string`)return!0;let n=e.files[0];return t.split(`,`).map(e=>e.trim().toLowerCase()).some(e=>e.startsWith(`.`)?n.name.toLowerCase().endsWith(e):e.endsWith(`/*`)?n.type.startsWith(e.replace(`/*`,`/`)):n.type===e)}function Qn(e,n,r,i,a,o=``){r.dataset.valid=`false`;let s=o||e?.messages[i]?.[a]||``;if(!s)return;n.message=s;let c=An(r);if(!c)return;let l=q(`[data-validator-help]`,c).find(e=>e.dataset.validatorHelp===i)||null;l||(l=(0,t.jsx)(`div`,{"data-valid":`false`,"data-validator-help":i}),c.appendChild(l)),l.className=B(e?.className.help),l.dataset.valid=`false`,l.textContent=s}function $n(e){let t=An(e);if(t)for(let n of q(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();e.removeAttribute(`data-valid`)}function er(e,t={},n=!1){L(`bindEvents`,n,`boolean`,`Validator`);let r=G(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=En(t),o=i.noValidate,s=kn(),c=J(),l=new Set,u,d=()=>{i&&(i.noValidate=a?.vanilla===!1)},f=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,u);return typeof n==`string`?n:!!n},p=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let o=n[r],c=``;switch(r){case`required`:s.valid=Pn(e,o);break;case`minLength`:s.valid=Fn(e,o);break;case`maxLength`:s.valid=In(e,o);break;case`equalTo`:s.valid=Rn(i,e,o);break;case`email`:s.valid=Ln(e);break;case`checked`:s.valid=zn(e,o);break;case`selected`:s.valid=Bn(e,o);break;case`multiple`:s.valid=Vn(e,o);break;case`min`:s.valid=Wn(i,e,o);break;case`max`:s.valid=Gn(i,e,o);break;case`noSpace`:s.valid=Kn(e,o);break;case`noChinese`:s.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:s.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:s.valid=qn(e,o);break;case`file`:s.valid=Jn(e,o);break;case`minSize`:s.valid=Yn(e,o);break;case`maxSize`:s.valid=Xn(e,o);break;case`accept`:s.valid=Zn(e,o);break;case`validate`:{let t=f(e,o);s.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!s.valid){s.error=!0,l.add(t),Qn(a,s,e,t,r,c);break}$n(e)}return s.valid&&l.delete(t),s.valid},m=e=>{if(!a||s.destroyed||!e.name||!a.rules[e.name])return!0;let t=p(e,e.name);return t&&l.size===0&&(s.valid=!0,s.error=!1,s.message=``),t},h=()=>{if(!i||!a||s.destroyed)return!1;s.valid=!0,s.error=!1,s.message=``,l.clear();for(let e of Array.from(i.elements))if(!(!Dn(e)||!e.name)&&a.rules[e.name]&&(s.valid=p(e,e.name),!s.valid))break;return s.valid&&a.onSubmit?.(u),s.valid},g=e=>{if(!s.error)return;let t=e.target;!(t instanceof Element)||!Dn(t)||!t.name||!l.has(t.name)||m(t)},_=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))Dn(e)&&e.removeAttribute(`data-valid`);for(let e of q(`[data-validator-help]`,i))e.remove();s.valid=!0,s.error=!1,s.message=``,l.clear()}};return u={get element(){return i},get props(){return a},set props(e){a=e,d()},runtime:s,validate:h,reset:_,destroy:()=>{s.destroyed||(s.destroyed=!0,c.clear(),_({native:!1}),i&&(i.noValidate=o),i=null,a=null,s.valid=!1,s.error=!1,s.message=``,l.clear())}},n&&(c.on(`submit`,i,`submit`,e=>{e.preventDefault(),h()}),c.on(`reset`,i,`reset`,()=>_({native:!1}))),c.on(`input`,i,`input`,g),c.on(`change`,i,`change`,g),d(),u}let tr=new Map;function nr(e,t){!e||!t||tr.set(e,t)}function rr(e){tr.delete(e)}function ir(e){typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}function Q(e){let n={built:!1,mounted:!1,destroyed:!1},r=new Map,i=new Set,a=new Map,o=null,s=null,c,l=t=>{if(n.destroyed)throw Error(`${e.name}.${t}: instance destroyed`)},u=(e,...t)=>{for(let n of r.get(e)||[])try{n(...t)}catch{}},d={props:e.props,state:e.state,runtime:n,get element(){return o},own(e){e&&i.add(e)},assertActive:l,emit:u},f={props:e.props,state:e.state,runtime:n,get element(){return o},build(){if(l(`build`),n.built)return c;let t=Tt(()=>e.view(d),{removeOnDispose:e.ownsElement});return o=t.element,s=t.dispose,n.built=!0,e.onBuild?.(d),u(`build`,c),c},mount(t){if(l(`mount`),n.built||c.build(),!o)throw Error(`${e.name}.mount: view did not create an element.`);return o.parentNode!==t&&t.appendChild(o),n.mounted=!0,e.onMount?.(d),u(`mount`,c,t),c},unmount(){return l(`unmount`),!n.mounted&&!o?.parentNode?c:(e.onUnmount?.(d),e.ownsElement!==!1&&o?.remove(),n.mounted=!1,u(`unmount`,c),c)},setState(n={},r){l(`setState`);let i=typeof n==`string`&&arguments.length>1?{[n]:r}:n;if(!y(i))throw Error(`${e.name}.setState: expects a plain object patch.`);let a=e.normalizeStatePatch?e.normalizeStatePatch(i):i;if(!y(a))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(a,e.state);else for(let t of Object.keys(a))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return(0,t.flushSync)(()=>{Object.assign(e.state,a)}),c},own(e){return e&&i.add(e),c},use(e,t){if(!e)return c;let n=typeof e==`function`?e(c,t):e.install(c,t);return a.set(e,n),c},on(e,t){if(!e||typeof t!=`function`)return c;let n=r.get(e);return n||(n=new Set,r.set(e,n)),n.add(t),c},off(e,t){return r.get(e)?.delete(t),c},emit(e,...t){return u(e,...t),c},destroy(){if(!n.destroyed){n.destroyed=!0,e.onDestroy?.(d),u(`destroy`,c);for(let e of i)try{ir(e)}catch{}i.clear();for(let e of a.values())try{ir(e)}catch{}a.clear(),s?.(),s=null,e.ownsElement!==!1&&o?.remove(),o=null,n.built=!1,n.mounted=!1,r.clear()}}};c=Object.assign(f,e.actions||{});for(let e of tr.values())c.use(e);return c}let ar={toc:`j-toc`,list:`toc-list`,link:`toc-link`,active:`is-active`,levelPrefix:`is-level-`},or={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},reactive:{default:!1,type:`boolean`},className:{default:ar,type:`object`,normalize:e=>({...ar,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]}};function sr(e){let t=R(e,or,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,reactive:t.reactive,className:t.className,onChange:t.onChange}}function cr(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function lr(e,t){return e.id||=`toc-${Y()}-${t}`,{id:e.id,text:e.textContent||``,level:cr(e)}}function ur(e={}){let n=sr(e),r=(0,t.createDeepStore)({items:[],current:{index:-1,item:null}}),i={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0},a=J(),o=null,s=[],c=null,l,u=(0,t.createMemo)(()=>r.items),d=e=>{if(e===r.current.index)return;let i=r.items[e]||null;(0,t.flushSync)(()=>{r.current={index:e,item:i}}),n.onChange?.(i,e,l)},f=()=>{if(!l.runtime.built)return;let e=-1,t=n.offset+1;for(let n=s.length-1;n>=0;n--)if(s[n].getBoundingClientRect().top<=t){e=n;break}d(e)},p=()=>{i.ticking||(i.ticking=!0,i.frameId=requestAnimationFrame(()=>{i.ticking=!1,i.frameId=0,f()}))},m=()=>{i.refreshing||(i.refreshing=!0,i.refreshFrameId=requestAnimationFrame(()=>{i.refreshing=!1,i.refreshFrameId=0,g()}))},h=(e,{activeIndex:t=-1,updateHash:r=!1}={})=>{let i=s.find(t=>t.id===e.id);if(!i)return;let a=window.scrollY||window.pageYOffset||0,o=Math.max(0,i.getBoundingClientRect().top+a-n.offset);window.scrollTo({top:o,behavior:`smooth`}),t>=0&&d(t),r&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},g=()=>{if(l.runtime.destroyed||!l.runtime.built||!o)return;s=q(n.headings,o);let e=s.map(lr);(0,t.flushSync)(()=>{r.items=e,r.current={index:-1,item:null}}),f()};return l=Q({name:`Toc`,props:n,state:r,actions:{activate:e=>(l.runtime.built&&Number.isInteger(e)&&e>=0&&e<r.items.length&&h(r.items[e]),l)},view:()=>(0,t.jsx)(`nav`,{className:n.className.toc,"data-toc":`root`,children:(0,t.jsx)(`div`,{className:n.className.list,"data-toc-list":`root`,children:(0,t.For)({each:u,key:e=>e.id,children:(e,i)=>(0,t.jsx)(`a`,{className:()=>{let t=e();return B(n.className.link,`${n.className.levelPrefix}${t.level}`,r.current.index===i()?n.className.active:``)},href:()=>`#${e().id}`,"data-toc-index":()=>String(i()),"data-toc-target":()=>e().id,"data-active":()=>r.current.index===i()?`1`:`0`,onClick:t=>{t.preventDefault(),h(e(),{activeIndex:i(),updateHash:!0})},children:()=>e().text})})})}),onBuild(e){o=de(n.target,`Toc.target`),a.on(`scroll`,window,`scroll`,p,{passive:!0}),e.own(()=>a.clear()),g(),n.reactive&&(c=new MutationObserver(m),c.observe(o,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{c?.disconnect(),c=null}))},onDestroy(){i.frameId&&cancelAnimationFrame(i.frameId),i.refreshFrameId&&cancelAnimationFrame(i.refreshFrameId),i.frameId=0,i.refreshFrameId=0,i.ticking=!1,i.refreshing=!1,c?.disconnect(),c=null,o=null,s=[]}}),l}let dr={root:`j-accordion`,header:`accordion-header`,title:`header-title`,arrow:`header-arrow j-button is-icon is-ghost is-sm`,panel:`accordion-panel`,content:`panel-content`},fr={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},pr={type:`array`,nonEmpty:!0,items:fr},mr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(hr):hr(e),message:`expects a non-negative integer, non-empty string, array or null.`},collapsible:{default:!1,type:`boolean`},multiple:{default:!1,type:`boolean`},direction:{default:`vertical`,type:`string`,enum:[`vertical`,`horizontal`]},className:{default:dr,type:`object`,normalize:e=>({...dr,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]},data:{default:[],...pr}};function hr(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function gr(e){let t=R(e,mr,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,direction:t.direction,className:t.className,data:vr(t.data,!1),onChange:t.onChange}}function _r(e,t,n=!0){n&&L(String(t),e,fr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||Y()}}function vr(e,t=!0){t&&L(`data`,e,pr,`Accordion`);let n=new Set;return e.map((e,t)=>{let r=_r(e,t,!1),i=r.name;if(n.has(i))throw Error(`Accordion: item name "${i}" must be unique.`);return n.add(i),r})}function yr(e,t,n){if(e==null)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){let r=t[typeof e==`number`?e:t.findIndex(t=>t.name===e)]?.name;if(r&&(i.push(r),!n))break}return Array.from(new Set(i))}function br(e,t,n){let r=new Set(t.map(e=>e.name).filter(Boolean)),i=e.filter(e=>r.has(e));return n?i:i.slice(0,1)}function xr(e,t){let n=e[0]||null;if(!n)return{index:null,name:null};let r=t.findIndex(e=>e.name===n);return r>=0?{index:r,name:n}:{index:null,name:null}}function Sr(e){return typeof e==`number`&&e>0?e:0}function Cr(e){let n=gr(e),r=yr(n.active,n.data,n.multiple),i=(0,t.createDeepStore)({data:n.data,activeNames:r,loading:!1}),a=new WeakMap,o=wt(),s=wt(),c=new Map,l=new Map,u=new Map,d=new Set(r),p=Promise.resolve(),m=0,h=0,g=!1,v,y=e=>(typeof e.name==`string`?e.name.trim():``)||(a.has(e)||a.set(e,Y()),a.get(e)),b=()=>{let e=i.data.map(e=>({...e,name:y(e)}));return xr(br(i.activeNames,e,n.multiple),e)},x=e=>i.activeNames.includes(e),S=()=>{h+=1,!g&&!v.runtime.destroyed&&(g=!0,(0,t.flushSync)(()=>{i.loading=!0}))},C=()=>{h=Math.max(0,h-1),h===0&&g&&!v.runtime.destroyed&&(g=!1,(0,t.flushSync)(()=>{i.loading=!1}))},w=e=>typeof e==`number`?e:typeof e==`string`?i.data.findIndex(t=>y(t)===e):-1,T=e=>{let t=new Set(e),n=new Set([...d,...t]),r=[];for(let e of n){let n=d.has(e),i=t.has(e);if(n===i)continue;let a=s.get(e);a&&(a.inert=!i);let o=c.get(e);o&&r.push(i?o.enter():o.leave())}return d=t,r.length>0&&(p=Promise.all(r).then(()=>void 0)),p},E=e=>r=>{s.bind(e)(r),c.get(e)?.cancel();let a=At(()=>s.get(e),{axis:n.direction,options:{duration:250,easing:`ease`}});c.set(e,a);let o=x(e);r.inert=!o,a.setExpanded(o),(0,t.onCleanup)(()=>{c.get(e)===a&&(a.cancel(),c.delete(e),d.delete(e),i.activeNames.includes(e)&&(0,t.flushSync)(()=>{i.activeNames=i.activeNames.filter(t=>t!==e)}))})},D=async e=>{if(v.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!v.runtime.built)throw Error(`Accordion.activate: call build() first.`);let r=w(e),a=i.data[r];if(!a)return;let c=y(a),l=x(c);if(l&&!n.multiple&&!n.collapsible)return;let d;if(n.multiple)if(l){let e=i.activeNames.filter(e=>e!==c);d=!n.collapsible&&e.length===0?[...i.activeNames]:e}else d=[...i.activeNames,c];else d=l?n.collapsible?[]:[...i.activeNames]:[c];(0,t.flushSync)(()=>{i.activeNames=d});let f=T(d),p=d.includes(c)&&u.get(c)?.()||Promise.resolve(),m=o.get(c),h=s.get(c),g=n.onChange&&m&&h?p.then(()=>n.onChange?.(r,c,m,h,v)):Promise.resolve();await Promise.all([f,g])},O=(e,t,n)=>{let r=y(e);return{accordion:v,item:e,index:t,type:n,active:x(r)}},k=(e,t,n)=>typeof e==`function`?e(O(t,n,`title`)):e,A=(e,n,r)=>{let i=e().content,[a,o]=(0,t.createSignal)(typeof i==`function`?null:i),[s,c]=(0,t.createSignal)(!1),d=i,f=0,p=null,h=()=>O(e(),n(),`content`),g=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){o(n);return}let i=t.cache?l.get(r):null,a=Sr(t.ttl);if(i&&(!a||Date.now()-i.updatedAt<=a)){o(i.content);return}if(p)return p;let s=++f;m+=1;let u=m;c(!0),S();let d=Promise.resolve().then(()=>n(h())).then(t=>{s!==f||v.runtime.destroyed||(e().cache&&l.set(r,{content:t,updatedAt:Date.now()}),o(t))}).finally(()=>{s===f&&!v.runtime.destroyed&&c(!1),u<=m&&C(),p===d&&(p=null)});return p=d,d};return u.set(r,g),(0,t.onCleanup)(()=>{f+=1,l.delete(r),u.delete(r),p=null}),(0,t.createEffect)(()=>{let t=e().content;t!==d&&(d=t,f+=1,p=null,l.delete(r),o(typeof t==`function`?null:t)),x(r)&&g()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return _(`flex-start`,`flex-start`);let e=a();return typeof e==`function`?e(h()):e}}},j=(e,r)=>{let i=y(e()),a=A(e,r,i),s=`${n.id}_header_${i}`,c=`${n.id}_panel_${i}`;return[(0,t.jsx)(`div`,{className:n.className.header,id:s,"data-accordion-header":i,role:`button`,tabindex:`0`,"aria-controls":c,"aria-expanded":()=>x(i)?`true`:`false`,ref:o.bind(i),onClick:()=>void D(i),onKeyDown:e=>{e instanceof KeyboardEvent&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),D(i))},children:[(0,t.jsx)(`span`,{className:n.className.title,"data-accordion-title":i,role:`heading`,children:()=>{let t=e();return z(k(t.title,t,r()))}}),(0,t.jsx)(`span`,{className:n.className.arrow,"data-accordion-arrow":i,"aria-hidden":`true`,children:f(`arrow-down`)})]}),(0,t.jsx)(`div`,{className:n.className.panel,"data-accordion-panel":i,id:c,role:`region`,"aria-labelledby":s,"aria-hidden":()=>x(i)?`false`:`true`,"aria-live":()=>a.isAsync()?`polite`:null,"aria-busy":()=>String(a.loading()),"data-state":()=>x(i)?`open`:`closed`,ref:E(i),children:(0,t.jsx)(`div`,{className:n.className.content,"data-accordion-content":i,children:()=>z(a.render())})})]};return v=Q({name:`Accordion`,props:n,state:i,actions:{isActive:x,getIndex:w,activate:D},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:vr(e.data)}:{}}},view:()=>{let e=(0,t.jsx)(`div`,{className:n.className.root,id:n.id,"data-accordion":`root`,"data-direction":n.direction,children:(0,t.For)({each:()=>i.data,key:e=>y(e),children:(e,t)=>j(e,t)})});return d=new Set(i.activeNames),(0,t.createEffect)(()=>{T([...i.activeNames])}),e},onDestroy(){m+=1,h=0,g=!1,l.clear(),u.clear();for(let e of c.values())e.cancel();c.clear(),o.clear(),s.clear()}}),Object.defineProperty(v,"current",{enumerable:!0,get:b}),v}let wr={form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-field`,label:`field-legend`,required:`is-required`,control:`field-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,submitBtn:`is-primary`,resetBtn:`is-ghost`,input:`j-input`,textarea:`j-textarea`,select:`j-select`,radio:`j-radio`,checkbox:`j-checkbox`,choiceVertical:`is-vertical`,choiceHorizontal:`is-horizontal`,choiceGroup:`is-group`,radioLabel:`radio-label`,radioText:`radio-text`,switch:`j-switch is-default`,switchSlider:`switch-slider`},Tr={submit:a(`Submit`),reset:a(`Reset`)},Er={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():Y():e??Y()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},size:{default:`md`,type:`string`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:!0,types:[`boolean`,`string`]},buttonsPosition:{default:`start`,type:`string`},text:{default:Tr,type:`object`,normalize:e=>Lr(e)},className:{default:wr,type:`object`,normalize:e=>Ir(e)},validator:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function Dr(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function Or(e){return{...e,options:Dr(e.options)}}function kr(e){return{...e.id?{id:e.id}:{},type:e.type,payload:Or(e.payload),next:e.next||null}}function Ar(e){return Array.isArray(e)?e.map(e=>kr(e)):[]}function jr(e,t){let n=[],r=Array.isArray(e)?e:[],i=new WeakSet,a=e=>{let t=r.indexOf(e);return t>=0&&r[t+1]||null};for(let e of r){if(i.has(e))continue;let r=e,o=[],s=0;for(;r&&s<1e3&&(s+=1,!i.has(r));){i.add(r),n.push(r),o.push(r);let e=r.next?r.next(r,o):a(r);r=e?t(e):null}}return n}function Mr(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function Nr(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function Pr(e){return e==null||Array.isArray(e)?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function Fr(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function Ir(e){return{...wr,...y(e)?e:{}}}function Lr(e){return{...Tr,...y(e)?e:{}}}function Rr(e,t){return typeof e==`function`?e(t):e}function zr(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!y(t))return;let n=t;for(let[t,r]of Object.entries(n)){if(r==null||typeof r!=`string`&&typeof r!=`number`)continue;let n=t.startsWith(`--`)?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);e.style.setProperty(n,String(r))}}function Br(e){return e===`center`?e:`flex-${e}`}function Vr(e){let t=y(e)?e:{};return{...t,vanilla:t.vanilla===!0,rules:y(t.rules)?t.rules:{},messages:y(t.messages)?t.messages:{}}}function Hr(e){let t=R(e,Er,`Form.props`),n=Ar(t.fields);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,size:t.size,style:t.style,fields:n,buttons:t.buttons,buttonsPosition:t.buttonsPosition,text:Lr(t.text),className:Ir(t.className),validator:Vr(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function Ur(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function Wr(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Gr(e,n,r){(0,t.bindAttr)(e,n,()=>Wr(r()))}function Kr(e,t){return Array.isArray(e)?e.map(e=>Nr(e)).includes(Nr(t)):e==t}function qr(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>Nr(e)).includes(Nr(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||Nr(e)===Nr(t):n}function Jr(e){return e instanceof RadioNodeList?Array.from(e):[e]}function Yr(e={}){let n=Hr(e),r=(0,t.createDeepStore)({fields:Ar(n.fields),submitting:!1}),i={fieldIds:new Map},a=new WeakMap,[o,s]=(0,t.createSignal)(0),c=new WeakMap,l=null,u,d=e=>{if(r.fields.includes(e))return e;let n=c.get(e);if(n)return n;let i=(0,t.createDeepStore)(kr(e));return c.set(e,i),i},f=(0,t.createMemo)(()=>(o(),jr(r.fields,d))),p=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(a.has(e)||a.set(e,Y()),a.get(e)),m=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${p(n)}:${e.type}`:`item:${e.type}:${t}`},h=(e,t)=>{if(e.id)return e.id;let r=e.name||t;return i.fieldIds.has(r)||i.fieldIds.set(r,`${n.id}_field_${t}`),i.fieldIds.get(r)},g=()=>{let e=u.element;if(!e)return;let t={...n.validator,onSubmit:null};if(l?.element===e){l.props=t;return}l?.destroy(),l=er(e,t,!1)},v=()=>l?.validate()??!0,y=()=>{let e=u.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`),t.removeAttribute(`data-valid`);for(let t of q(`[data-field-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},b=()=>{let e={};if(!u.element)return e;for(let[t,n]of new FormData(u.element).entries())Object.hasOwn(e,t)?e[t]=Array.isArray(e[t])?[...e[t],n]:[e[t],n]:e[t]=n;return e},x=async e=>{if(e.preventDefault(),r.submitting||!v())return;let i=b();(0,t.flushSync)(()=>{r.submitting=!0});try{await Promise.resolve(n.onSubmit?.(i,u))}finally{u.runtime.destroyed||(0,t.flushSync)(()=>{r.submitting=!1})}},S=e=>{if(!e.name||!u.element)return[];let t=u.element.elements.namedItem(e.name);return t?Jr(t).filter(e=>e instanceof Element):[]},C=(e,n,r=`text`)=>{(0,t.flushSync)(()=>{if(n instanceof HTMLSelectElement){e.value=n.multiple?Array.from(n.selectedOptions).map(e=>e.value):n.value;return}if(n instanceof HTMLTextAreaElement){e.value=n.value;return}if(r===`switch`){e.checked=n.checked,e.value=n.checked?n.value:``;return}if(r===`radio`){n.checked&&(e.value=n.value);return}if(r===`checkbox`){if(Array.isArray(e.options)){e.value=S(e).filter(e=>e instanceof HTMLInputElement&&e.checked).map(e=>e.value);return}e.checked=n.checked,e.value=n.checked?n.value:``;return}e.value=n.value,n.type===`checkbox`&&(e.checked=n.checked)}),s(e=>e+1)},w=(e,t,n)=>({...n,name:()=>e().name,id:t,required:()=>!!e().required,disabled:()=>r.submitting||!!e().disabled,"data-field-item":()=>e().name||t}),T=()=>n.size?`is-${n.size}`:``,E=e=>{let t=e.size||n.size;return t?`is-${t}`:``},D=(e,t)=>B(e.className||t,E(e)),O=(e,i,a)=>(0,t.jsx)(`div`,{className:()=>{let t=e(),r=t.vertical?`vertical`:`horizontal`,i=n.className;return B(a===`radio`?i.radio:i.checkbox,r===`vertical`?i.choiceVertical:i.choiceHorizontal,t.group?i.choiceGroup:``,t.size?`is-${t.size}`:``)},"data-field-choice-group":()=>e().name||i,"data-choice-type":a,"data-choice-layout":()=>e().vertical?`vertical`:`horizontal`,children:()=>(e().options||[]).map((o,s)=>{let c=Mr(o),l=`${i}_${s}`;return(0,t.jsx)(`label`,{className:()=>a===`radio`?n.className.radioLabel:``,"data-field-choice":()=>e().name||i,for:l,children:[(0,t.jsx)(`input`,{type:a,id:l,name:()=>e().name,value:c.value??``,checked:()=>a===`radio`?Kr(e().value,c.value):qr(e().value,c.value,c.checked),disabled:()=>r.submitting||!!c.disabled||!!e().disabled,required:()=>!!e().required,onChange:t=>{let n=t.currentTarget;n instanceof HTMLInputElement&&C(e(),n,a)}}),(0,t.jsx)(`span`,{className:()=>a===`radio`?n.className.radioText:``,"data-field-choice-text":``,children:z(c.text??c.label??Nr(c.value))})]})})}),k=(e,i,a,o)=>{let s=e().type;if(s===`textarea`)return(0,t.jsx)(`textarea`,w(i,a,{className:()=>i().className||n.className.textarea,placeholder:()=>i().placeholder||``,readonly:()=>!!i().readonly,ref:e=>Gr(e,`autocomplete`,()=>i().autocomplete),value:()=>Pr(i().value),onInput:e=>{let t=e.currentTarget;t instanceof HTMLTextAreaElement&&C(i(),t,`textarea`)}}));if(s===`select`)return(0,t.jsx)(`select`,w(i,a,{className:()=>D(i(),n.className.select),ref:e=>Gr(e,`autocomplete`,()=>i().autocomplete),multiple:()=>!!i().multiple,value:()=>i().multiple?void 0:Pr(i().value),onChange:e=>{let t=e.currentTarget;t instanceof HTMLSelectElement&&C(i(),t,`select`)},children:()=>(i().options||[]).map(e=>{let n=Mr(e);return(0,t.jsx)(`option`,{value:n.value??``,disabled:!!n.disabled,selected:()=>Kr(i().value,n.value),children:z(n.text??n.label??Nr(n.value))})})}));if(s===`radio`)return O(i,a,`radio`);if(s===`checkbox`&&Array.isArray(i().options))return O(i,a,`checkbox`);if(s===`switch`)return(0,t.jsx)(`label`,{className:()=>{let e=n.className;return B(e.switch,E(i()))},"data-field-switch":()=>i().name||a,for:a,children:[(0,t.jsx)(`input`,{type:`checkbox`,id:a,name:()=>i().name,value:()=>i().value??`1`,checked:()=>!!i().checked,disabled:()=>r.submitting||!!i().disabled,required:()=>!!i().required,onChange:e=>{let t=e.currentTarget;t instanceof HTMLInputElement&&C(i(),t,`switch`)}}),(0,t.jsx)(`span`,{className:()=>n.className.switchSlider,"data-field-switch-slider":``})]});if(s===`custom`){let t=i();return typeof t.content==`function`?t.content({form:u,field:t,index:o(),item:e()}):t.content}let c=s||`text`;return(0,t.jsx)(`input`,{...w(i,a,{type:c,className:()=>D(i(),n.className.input),placeholder:()=>i().placeholder||``,readonly:()=>!!i().readonly,autocomplete:()=>i().autocomplete||Ur(c),value:()=>i().value??``,onInput:e=>{let t=e.currentTarget;t instanceof HTMLInputElement&&C(i(),t,c)}}),checked:()=>{let e=i().checked;return e===void 0?void 0:!!e}})},A=(e,r)=>{let i=()=>e().payload,a=h(i(),r()),o=()=>{let t=e().type;return t===`custom`||t===`radio`||t===`checkbox`&&Array.isArray(i().options)},s=()=>{let e=i().label;return e!==!1&&e!==void 0};return(0,t.jsx)(`fieldset`,{className:()=>n.className.item,"data-form-field":()=>i().name||String(r()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{if(!s())return null;let e={className:()=>B(n.className.label,Fr(i(),n.validator.rules)?n.className.required:``),"data-field-label":()=>i().name||a,children:()=>z(i().label)};return o()?(0,t.jsx)(`legend`,e):(0,t.jsx)(`label`,{...e,for:a})},()=>(0,t.jsx)(`div`,{className:()=>n.className.control,"data-field-control":()=>i().name||String(r()),children:[z(k(e,i,a,r)),()=>i().help?(0,t.jsx)(`div`,{className:`help-block`,"data-field-help":()=>i().name||String(r()),children:()=>z(i().help)}):null]})]})},j=(e,t)=>A(e,t),M=()=>(0,t.jsx)(`button`,{type:`submit`,className:()=>B(n.className.button,n.className.submitBtn,T()),"data-action":`submit`,disabled:()=>r.submitting,children:()=>{let e=z(Rr(n.text.submit,u));return r.submitting?[_(),e]:e}}),N=()=>(0,t.jsx)(`button`,{type:`reset`,className:()=>B(n.className.button,n.className.resetBtn,T()),"data-action":`reset`,disabled:()=>r.submitting,children:()=>z(Rr(n.text.reset,u))}),ee=()=>(0,t.jsx)(`div`,{className:n.className.buttons,style:{justifyContent:Br(n.buttonsPosition)},"data-field-buttons":``,children:n.buttons===`reverse`?[N(),M()]:[M(),N()]});return u=Q({name:`Form`,props:n,state:r,actions:{validate:v,reset(){return l?.reset(),u},collectData:b,requestSubmit(){let e=u.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),u},setFields(e){return L(`fields`,e,`array`,`Form.setFields`),i.fieldIds.clear(),c=new WeakMap,(0,t.flushSync)(()=>{r.fields=Ar(e)}),u},resetFields(){return i.fieldIds.clear(),c=new WeakMap,(0,t.flushSync)(()=>{r.fields=Ar(n.fields)}),u}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:Ar(e.fields)}:{}}},view:()=>{let e=(0,t.jsx)(`form`,{className:B(n.className.form,n.vertical?n.className.vertical:n.className.horizontal,n.itemVertical?n.className.itemVertical:n.className.itemHorizontal,T()),id:n.id,novalidate:n.validator.vanilla===!1,"data-form":`root`,"data-form-layout":n.vertical?`vertical`:`horizontal`,"data-form-field-layout":n.itemVertical?`vertical`:`horizontal`,onSubmit:e=>void x(e),onReset:e=>{y(),n.onReset?.(e,u)},children:[(0,t.For)({each:f,key:m,children:j}),n.buttons===!1?null:ee()]});return zr(e,n.style),e},onBuild(){g()},onDestroy(){l?.destroy(),l=null,i.fieldIds.clear(),c=new WeakMap}}),u}let Xr={root:`j-flow`,header:`flow-header`,steps:`flow-steps`,step:`flow-step`,active:`is-active`,complete:`is-complete`,stepButton:`flow-step-button`,stepIndex:`flow-step-index`,stepTitle:`flow-step-title`,body:`flow-body`,footer:`flow-footer`,button:`j-button`,reset:`is-ghost flow-reset`,back:`is-ghost flow-back`,next:`is-primary flow-next`},Zr={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},Qr={type:`renderable`},$r={types:[`plainObject`,`null`,`undefined`]};function $(e){return y(e)?{...e}:{}}function ei(e){let t={};for(let n of Object.keys(e))t[n]=$(e[n]);return t}function ti(e){return{...e,history:[...e.history],data:$(e.data),stepData:ei(e.stepData),currentData:$(e.currentData),currentStep:e.currentStep?{...e.currentStep}:null}}function ni(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data)}}):[]}function ri(e){return typeof e==`string`?{...Xr,root:[Xr.root,e.trim()].filter(Boolean).join(` `)}:{...Xr,...y(e)?e:{}}}function ii(e,t){if(typeof e==`string`)return{id:e};if(!y(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:y(n.data)||n.data==null?n.data:void 0}:{id:t,data:e}}let ai={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||Y()},steps:{default:[],type:`array`,nonEmpty:!0},initial:{default:null,types:[`string`,`number`,`null`]},cache:{default:!0,type:`boolean`},linear:{default:!0,type:`boolean`},render:{default:!0,type:`boolean`},rollbackOnError:{default:!0,type:`boolean`},busyStrategy:{default:`ignore`,type:`string`,enum:[`ignore`,`throw`]},showBack:{default:!0,type:`boolean`},showNext:{default:!0,type:`boolean`},showReset:{default:!1,type:`boolean`},text:{default:{},type:`plainObject`,normalize:e=>{let t=y(e)?e:{};return{back:typeof t.back==`string`?t.back:a(`b`),next:typeof t.next==`string`?t.next:a(`Next`),finish:typeof t.finish==`string`?t.finish:a(`Finish`),reset:typeof t.reset==`string`?t.reset:a(`Reset`)}}},className:{default:Xr,types:[`object`,`string`],normalize:ri},renderHeader:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderBody:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderFooter:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},onChange:{default:null,types:[`function`,`null`]},onNext:{default:null,types:[`function`,`null`]},onBack:{default:null,types:[`function`,`null`]},onFinish:{default:null,types:[`function`,`null`]},onError:{default:null,types:[`function`,`null`]},onBusy:{default:null,types:[`function`,`null`]}};function oi(e){let t=R(e,ai,`Flow.props`);return{id:t.id,steps:ni(t.steps),initial:t.initial,cache:t.cache,linear:t.linear,render:t.render,rollbackOnError:t.rollbackOnError,busyStrategy:t.busyStrategy,showBack:t.showBack,showNext:t.showNext,showReset:t.showReset,text:t.text,className:t.className,renderHeader:t.renderHeader,renderBody:t.renderBody,renderFooter:t.renderFooter,onChange:t.onChange,onNext:t.onNext,onBack:t.onBack,onFinish:t.onFinish,onError:t.onError,onBusy:t.onBusy}}function si(e={}){let n=oi(e),r=n.steps,i=new Map;for(let[e,t]of r.entries()){if(L(String(e),t,Zr,`Flow.props.steps`),L(`content`,t.content??null,Qr,`Flow.props.steps.${e}`),i.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);i.set(t.id,e)}let a=(()=>{if(typeof n.initial==`number`){let e=r[n.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof n.initial==`string`){if(!i.has(n.initial))throw Error(`Flow.props.initial step "${n.initial}" does not exist.`);return n.initial}return r[0].id})(),o={},s={};for(let e of r)o[e.id]=$(e.data),Object.assign(s,o[e.id]);let c=(0,t.createDeepStore)({id:n.id,currentId:a,currentIndex:i.get(a)??0,previousId:null,previousIndex:null,direction:null,history:[a],data:$(s),stepData:ei(o),loading:!1,error:null,busyAction:null,version:0}),l={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},u=new Set,d=new Set,f=new Set,p=0,m=null,h=null,g,_=e=>{if(l.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},v=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},y=(0,t.createMemo)(()=>r[c.currentIndex]),b=(0,t.createMemo)(()=>c.version>=0?$(c.stepData[c.currentId]):{}),x=(0,t.createMemo)(()=>v(y())),S=(0,t.createMemo)(()=>r.map(v)),C=(0,t.createMemo)(()=>c.currentIndex>0&&!c.loading),w=(0,t.createMemo)(()=>c.currentIndex<r.length-1&&!c.loading),T=(0,t.createMemo)(()=>c.currentIndex===r.length-1),E=(0,t.createMemo)(()=>({id:c.id,currentId:c.currentId,currentIndex:c.currentIndex,previousId:c.previousId,previousIndex:c.previousIndex,direction:c.direction,history:[...c.history],data:$(c.data),stepData:ei(c.stepData),currentData:b(),currentStep:x(),canBack:C(),canNext:w(),isLast:T(),loading:c.loading,busyAction:c.busyAction,error:c.error})),D=()=>y(),O=e=>$(c.stepData[e]),k=()=>ti(E()),A=(e=null)=>{let t=k();for(let n of u)n(t,g,e);n.onChange?.(t,g,e)},j=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},M=(e,r,a={})=>{if(_(`setStepData`),L(`stepId`,e,{type:`string`},`Flow.setStepData`),L(`data`,r,$r,`Flow.setStepData`),!i.has(e))throw Error(`Flow.setStepData: step "${e}" does not exist.`);return r?((0,t.flushSync)(()=>{c.stepData[e]={...$(c.stepData[e]),...r},n.cache&&Object.assign(c.data,r),c.version+=1}),a.silent||A(),g):g},N=e=>(_(`setData`),L(`data`,e,$r,`Flow.setData`),e?((0,t.flushSync)(()=>{Object.assign(c.data,e),c.version+=1}),A(),g):g),ee=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return l.destroyed?(e(),()=>{}):(d.add(e),()=>d.delete(e))},te=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},ne=e=>e instanceof Error&&e.code===`FLOW_ABORTED`,P=e=>{if(l.destroyed||e!=null&&f.has(e))throw te()},re=()=>{let e=m;e!=null&&f.add(e),l.actionController?.abort(),l.actionController=null,l.activeAction=null,m=null},F=async(e,t,n=m)=>{if(typeof e!=`function`)return;let r=await e(...t);return P(n),r},I=(e={})=>{let t=e.step||D();return{...e,flow:g,step:t,state:c,signal:l.actionController?.signal||null,snapshot:k(),data:$(c.data),currentData:O(t.id),setData:N,setStepData:(e,t)=>M(e,t),getStepData:O,next:e=>g.next(e),back:e=>g.back(e),goTo:(e,t,n)=>g.goTo(e,t,n),addCleanup:ee}},R=(e,r=null)=>{(0,t.flushSync)(()=>{c.error=e,c.version+=1}),n.onError?.(e,k(),g,r)},ie=(e,n)=>{let r=k();(c.loading!==e||c.busyAction!==n)&&((0,t.flushSync)(()=>{c.loading=e,c.busyAction=e?n:null,c.version+=1}),A(r))},B=e=>{if(!c.loading)return null;let t=Error(`Flow: action "${e}" ignored while loading.`);if(t.code=`FLOW_BUSY`,n.onBusy?.(e,k(),g),n.busyStrategy===`throw`)throw t;return k()},V=async(e,t,n=!1)=>{let r=!n&&!c.loading,i=r?++p:m;r&&(l.actionController=new AbortController,l.activeAction=e,m=i,ie(!0,e));try{P(i);let e=await t(i);return P(i),e}catch(e){if(l.destroyed||ne(e))return null;throw c.error!==e&&R(e),e}finally{i!=null&&f.delete(i),r&&!l.destroyed&&m===i&&(ie(!1,null),l.activeAction=null,l.actionController=null,m=null)}},ae=()=>({currentId:c.currentId,currentIndex:c.currentIndex,previousId:c.previousId,previousIndex:c.previousIndex,direction:c.direction,history:[...c.history],data:$(c.data),stepData:ei(c.stepData),loading:c.loading,busyAction:c.busyAction,error:c.error,version:c.version}),H=e=>{(0,t.flushSync)(()=>{c.currentId=e.currentId,c.currentIndex=e.currentIndex,c.previousId=e.previousId,c.previousIndex=e.previousIndex,c.direction=e.direction,c.history.splice(0,c.history.length,...e.history),j(c.data,e.data),j(c.stepData,e.stepData),c.loading=e.loading,c.busyAction=e.busyAction,c.error=e.error,c.version=e.version+1})},U=e=>{if(typeof e==`number`){if(!r[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=i.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},oe=async(e,r,a,o,s)=>{let u=k(),d=ae();try{if(a&&M(o.id,a,{silent:!0}),o.canLeave&&await F(o.canLeave,[I({direction:r,targetId:e.id})],s)===!1)throw Error(`Flow: step "${o.id}" blocked leaving.`);if(e.canEnter&&await F(e.canEnter,[I({direction:r,fromId:o.id,step:e})],s)===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await F(o.onLeave,[I({direction:r,step:o,targetId:e.id})],s),P(s);let n=c.currentId,l=c.currentIndex;(0,t.flushSync)(()=>{c.previousId=n,c.previousIndex=l,c.currentId=e.id,c.currentIndex=i.get(e.id)??0,c.direction=r,r===`back`?c.history.pop():c.history.push(e.id),c.error=null,c.version+=1}),await F(e.onEnter,[I({direction:r,fromId:n,step:e})],s),P(s),A(u)}catch(e){throw l.destroyed||ne(e)?e:(n.rollbackOnError&&H(d),R(e,u),e)}},se=async(e,t,r,i,a)=>{let o=e===`back`?t.onBack:t.onNext,s=e===`back`?n.onBack:n.onNext,c=I({payload:r,targetId:i});return await F(o,[c],a)??await F(s,[c],a)??i},W=async(e,t,n={})=>V(`goTo`,async i=>{let a=U(e),o=r[a],s=D();return o.id===c.currentId?(t&&M(c.currentId,t),k()):(await oe(o,n.direction||`go`,t,s,i),k())},!!n.internal),ce=e=>{let t=k();return{flow:g,snapshot:t,state:c,steps:S(),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>g.next(e),back:e=>g.back(e),goTo:(e,t,n)=>g.goTo(e,t,n),reset:()=>g.reset()}},le=(e,t)=>{let r=n[e];return r===!1?null:typeof r==`function`?()=>c.version>=0?r(ce(t)):null:t()},G=()=>{let e=D().content;return typeof e==`function`?e(I()):e??``},ue=()=>Q({name:`FlowView`,props:{},state:c,view:()=>(0,t.jsx)(`div`,{className:n.className.root,id:n.id,role:`group`,"data-flow":`root`,"aria-busy":()=>c.loading?`true`:`false`,children:[(0,t.jsx)(`div`,{className:n.className.header,"data-flow-header":``,children:z(le(`renderHeader`,()=>(0,t.jsx)(`ol`,{className:n.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:r.map((e,r)=>(0,t.jsx)(`li`,{className:()=>[n.className.step,r===c.currentIndex?n.className.active:``,r<c.currentIndex?n.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(r),"aria-current":()=>r===c.currentIndex?`step`:null,children:(0,t.jsx)(`button`,{type:`button`,className:n.className.stepButton,disabled:()=>n.linear&&r>c.currentIndex,"aria-current":()=>r===c.currentIndex?`step`:null,onClick:()=>{r!==c.currentIndex&&g.goTo(r)},children:[(0,t.jsx)(`span`,{className:n.className.stepIndex,"data-flow-step-number":``,children:r+1}),(0,t.jsx)(`span`,{className:n.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))})))}),(0,t.jsx)(`div`,{className:n.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>c.loading?`true`:`false`,children:z(le(`renderBody`,()=>()=>c.version>=0?G():null))}),(0,t.jsx)(`div`,{className:n.className.footer,"data-flow-footer":``,children:z(le(`renderFooter`,()=>[n.showReset?(0,t.jsx)(`button`,{type:`button`,className:[n.className.button,n.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>g.reset(),disabled:()=>c.loading,children:n.text.reset}):null,n.showBack?(0,t.jsx)(`button`,{type:`button`,className:[n.className.button,n.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void g.back(),disabled:()=>!g.canBack,children:n.text.back}):null,n.showNext?(0,t.jsx)(`button`,{type:`button`,className:[n.className.button,n.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void g.next(),disabled:()=>c.loading,children:()=>g.isLast?n.text.finish:n.text.next}):null]))})]})});return g={props:n,steps:r,state:c,runtime:l,get element(){return h?.element||null},get currentStep(){return D()},get currentData(){return $(b())},get canBack(){return C()},get canNext(){return w()},get isLast(){return T()},build(){return _(`build`),l.built?g:(n.render&&(h||=ue(),h.build()),l.built=!0,g)},mount(e){return _(`mount`),g.build(),h&&h.mount(e),l.mounted=!!h,g},unmount(){return _(`unmount`),h?.unmount(),l.mounted=!1,g},subscribe(e){if(_(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return u.add(e),e(k(),g,null),()=>u.delete(e)},snapshot:k,async next(e=null){return _(`next`),L(`payload`,e,$r,`Flow.next`),B(`next`)||V(`next`,async t=>{if(g.isLast)return e&&M(c.currentId,e),await F(n.onFinish,[k(),g],t),k();let i=D(),a=r[c.currentIndex+1]?.id,o=ii(await se(`next`,i,e,a,t),a);return W(o.id,o.data??e,{direction:`next`,internal:!0})})},async back(e=null){return _(`back`),L(`payload`,e,$r,`Flow.back`),B(`back`)||(g.canBack?V(`back`,async t=>{let n=D(),i=r[c.currentIndex-1]?.id,a=ii(await se(`back`,n,e,i,t),i);return W(a.id,a.data??e,{direction:`back`,internal:!0})}):k())},async goTo(e,t=null,n={}){return _(`goTo`),L(`payload`,t,$r,`Flow.goTo`),B(`goTo`)||W(e,t,{direction:n.direction})},setData:N,setStepData:M,getStepData:O,reset(){_(`reset`);let e=k();return re(),(0,t.flushSync)(()=>{c.currentId=a,c.currentIndex=i.get(a)??0,c.previousId=null,c.previousIndex=null,c.direction=null,c.history.splice(0,c.history.length,a),j(c.data,$(s)),j(c.stepData,ei(o)),c.loading=!1,c.busyAction=null,c.error=null,c.version+=1}),A(e),g},async finish(e=null){return _(`finish`),L(`payload`,e,$r,`Flow.finish`),B(`finish`)||V(`finish`,async t=>(e&&M(c.currentId,e),await F(n.onFinish,[k(),g],t),k()))},destroy(){if(!l.destroyed){l.destroyed=!0,re(),h?.destroy(),h=null;for(let e of d)e();d.clear(),u.clear(),l.built=!1,l.mounted=!1,i.clear()}}},g}let ci={layout:`j-popup-layout`,modal:`j-modal`,header:`modal-header`,body:`modal-body`,footer:`modal-footer`,title:`modal-title`,button:`j-button`,closeBtn:`is-icon is-sm is-ghost`,cancelBtn:`is-ghost`,confirmBtn:`is-primary`};function li(e){return{...e,text:{...e.text},className:{...e.className}}}function ui(e){return{content:e.content,loading:!1,processing:!1,visible:!1}}function di(e){return!!e&&typeof e.then==`function`}function fi(e){return Number.isFinite(e)?Math.max(0,e):0}let pi={type:`renderable`},mi={default:{},type:`object`,plain:!0,normalize:e=>{let t=y(e)?e:{};return{...t,title:typeof t.title==`string`?t.title:a(`Tip`),confirm:typeof t.confirm==`string`?t.confirm:a(`Confirm`),cancel:typeof t.cancel==`string`?t.cancel:a(`Cancel`)}}},hi={content:{default:``,...pi},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},position:{default:`center`,type:`string`},showCancel:{default:!0,type:`boolean`},showClose:{default:!0,type:`boolean`},fullscreen:{default:!1,type:`boolean`},text:mi,onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]},onConfirm:{default:null,types:[`function`,`null`]},onCancel:{default:null,types:[`function`,`null`]},header:{default:!0,type:`boolean`},footer:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:ci,type:`object`,normalize:e=>({...ci,...e&&typeof e==`object`?e:{}})}},gi={content:hi.content,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`}},_i={type:`plainObject`};function vi(e){let t=R(e,hi,`Modal`);return{content:t.content,cache:t.cache,ttl:fi(t.ttl),position:t.position,showCancel:t.showCancel,showClose:t.showClose,fullscreen:t.fullscreen,text:t.text,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden,onConfirm:t.onConfirm,onCancel:t.onCancel,header:t.header,footer:t.footer,id:t.id,escClose:t.escClose,bgClose:t.bgClose,className:t.className,style:t.style}}let yi=0,bi=``;function xi(e={}){let n=vi(e),r=(0,t.createDeepStore)(ui(n)),i={initial:li(n),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},o=new Map,[s,c]=(0,t.createSignal)(!1),[l,u]=(0,t.createSignal)({value:null}),d,p=null,m=null,h=!1,g=0,v=()=>r.processing,y=e=>{if(!n.cache||!i.hasContent||i.contentSource!==e)return!1;let t=fi(n.ttl);return!t||Date.now()-i.updatedAt<=t},b=(e,t)=>{n.cache&&(i.content=t,i.contentSource=e,i.hasContent=!0,i.updatedAt=Date.now())},x=()=>{i.content=null,i.contentSource=null,i.hasContent=!1,i.updatedAt=0},S=()=>{for(let e of o.values())e();o.clear()},C=(e,t,n,r)=>{o.get(e)?.(),t.addEventListener(n,r),o.set(e,()=>t.removeEventListener(n,r))},w=()=>{h||=(yi===0&&(bi=document.body.style.overflow,document.body.style.overflow=`hidden`),yi+=1,!0)},T=()=>{h&&=(yi=Math.max(0,yi-1),yi===0&&(document.body.style.overflow=bi,bi=``),!1)},E=()=>{let e=i.previousActiveElement;i.previousActiveElement=null,e&&document.contains(e)&&e.focus()},D=zt({elements:()=>[d.element,p],mount:()=>{d.mount(document.body),w()},activate:()=>c(!0),deactivate:()=>c(!1),motion:Et(kt(()=>d.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),kt(()=>p,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{d.unmount(),T(),E()}}),O=()=>{if(r.loading||r.processing){m||=_(),p&&m.parentElement!==p&&p.append(m);return}m?.remove(),m=null},k=e=>{r.processing!==e&&(0,t.flushSync)(()=>{r.processing=e})},A=()=>{r.visible&&D.phase!==`leaving`&&k(!1)},j=(e=r.content)=>{if(y(e)){g+=1,(0,t.flushSync)(()=>{u({value:i.content}),r.loading=!1});return}let n=++g;if(typeof e!=`function`){x(),(0,t.flushSync)(()=>{u({value:e}),r.loading=!1});return}let a;try{a=e(d)}catch(e){console.error(`Modal.content error:`,e),(0,t.flushSync)(()=>{u({value:null}),r.loading=!1});return}if(!di(a)){b(e,a),(0,t.flushSync)(()=>{u({value:a}),r.loading=!1});return}(0,t.flushSync)(()=>{r.loading=!0,u({value:null})}),Promise.resolve(a).then(r=>{d.runtime.destroyed||n!==g||(b(e,r),(0,t.flushSync)(()=>{u({value:r})}))}).catch(e=>{d.runtime.destroyed||n!==g||(console.error(`Modal.content error:`,e),(0,t.flushSync)(()=>{u({value:null})}))}).finally(()=>{!d.runtime.destroyed&&n===g&&(0,t.flushSync)(()=>{r.loading=!1})})},M=()=>{if(v())return;let e;try{e=n.onConfirm?.(d)}catch(e){console.error(`Modal.onConfirm error:`,e);return}di(e)&&(k(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{d.runtime.destroyed||A()}))},N=()=>{if(v())return;let e;try{e=n.onCancel?.(d)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!di(e)){d.hide();return}k(!0),Promise.resolve(e).then(()=>{d.runtime.destroyed||d.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{d.runtime.destroyed||A()})},ee=e=>{if(!p)return;let t=q(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,p).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),p.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},te=()=>{if(!p)return;let e=K(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,p);e?e.focus():(p.setAttribute(`tabindex`,`-1`),p.focus())},ne=()=>{let e=d.element;!e||!p||(S(),C(`root`,e,`click`,t=>{n.bgClose&&!v()&&t.target===e&&d.hide()}),C(`dialog`,p,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?N():t===`confirm`&&M()}),C(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!r.visible||(e.key===`Escape`&&n.escClose&&!v()?(e.preventDefault(),d.hide()):e.key===`Tab`&&ee(e))}))},P=()=>{if(D.phase===`visible`||D.phase===`entering`)return;if(!d.element)throw Error(`Modal.show: build() must be called before show().`);n.onShow?.(d),i.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=D.enter();ne(),te(),e.then(e=>{e&&!d.runtime.destroyed&&n.onShown?.(d)})},re=()=>{D.phase!==`hidden`&&D.phase!==`leaving`&&(n.onHide?.(d),S(),g+=1,D.leave().then(e=>{e&&!d.runtime.destroyed&&((0,t.flushSync)(()=>{r.loading=!1,r.processing=!1,n.cache||u({value:null})}),n.onHidden?.(d))}))};return d=Q({name:`Modal`,props:n,state:r,actions:{show(){if(!d.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return d.setState(`visible`,!0),d},hide(){return(0,t.flushSync)(()=>{r.visible=!1}),d},reset(){return d.setState({content:i.initial.content,loading:!1,processing:!1}),x(),u({value:null}),d}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){L(`state`,e,_i,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(gi,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);L(t,e[t],gi[t],`Modal.setState`)}},view:()=>{p=(0,t.jsx)(`div`,{className:B(n.className.modal,n.fullscreen?`is-fullscreen`:``),id:n.id,role:`document`,"data-modal-dialog":n.id,...n.style?{style:n.style}:{},"data-mount":()=>s()?`true`:`false`,children:[n.header?(0,t.jsx)(`div`,{className:n.className.header,children:()=>r.loading?null:[(0,t.jsx)(`div`,{className:n.className.title,id:`${n.id}_title`,"aria-label":n.text.title,children:n.text.title}),n.showClose?(0,t.jsx)(`button`,{type:`button`,className:B(n.className.button,n.className.closeBtn),"data-action":`close`,"aria-label":a(`Close`),disabled:v,children:f(`close`)}):null]}):null,(0,t.jsx)(`div`,{className:n.className.body,"data-modal-body":``,children:()=>z(l().value)}),n.footer?(0,t.jsx)(`div`,{className:n.className.footer,children:()=>r.loading?null:[n.showCancel?(0,t.jsx)(`button`,{type:`button`,className:B(n.className.button,n.className.cancelBtn),"data-action":`cancel`,disabled:v,children:n.text.cancel}):null,(0,t.jsx)(`button`,{type:`button`,className:B(n.className.button,n.className.confirmBtn),"data-action":`confirm`,disabled:v,children:n.text.confirm})]}):null]});let e=Ht({className:n.className.layout,position:n.position,component:`modal`,labelledby:n.header?`${n.id}_title`:``,content:p});return e.setAttribute(`data-mount`,`false`),n.header||e.setAttribute(`aria-label`,n.text.title||`Modal`),(0,t.createEffect)(()=>{e.setAttribute(`data-mount`,s()?`true`:`false`)}),(0,t.createEffect)(O),(0,t.createEffect)(()=>{let e=r.visible;(0,t.untrack)(()=>e?P():re())}),(0,t.createEffect)(()=>{let e=r.visible,n=r.content;(0,t.untrack)(()=>{e?j(n):g+=1})}),e},onDestroy(){let e=D.phase!==`hidden`;e&&n.onHide?.(d),D.cancel(),S(),T(),E(),m?.remove(),m=null,p=null,e&&n.onHidden?.(d)}}),d}let Si={root:`j-swiper`,wrapper:`swiper-wrapper`,slide:`swiper-slide`,image:`swiper-image`,title:`swiper-slide-title`,pagination:`swiper-pagination`,paginationHorizontal:`is-horizontal`,paginationClickable:`is-clickable`,paginationBulletGroup:`is-bullet`,indicator:`swiper-pagination-indicator`,bullet:`swiper-pagination-bullet`,navigation:`swiper-navigation`,prev:`is-prev`,next:`is-next`,active:`is-active`,disabled:`is-disabled`},Ci={id:{default:null,types:[`string`,`null`],nonEmpty:!0,normalize:e=>typeof e==`string`?e.trim():e},data:{default:[],types:[`array`,`function`]},loop:{default:!0,type:`boolean`},autoplay:{default:!0,type:`boolean`},delay:{default:3e3,type:`number`,min:0},lazyload:{default:!0,type:`boolean`},pagination:{default:!0,type:`boolean`},navigation:{default:!0,type:`boolean`},speed:{default:300,type:`number`,min:0},touchRatio:{default:1,type:`number`,greaterThan:0},touchAngle:{default:45,type:`number`,min:0,max:90},longSwipesMs:{default:300,type:`number`,min:0},longSwipesRatio:{default:.05,type:`number`,min:0,max:1},preventClick:{default:!0,type:`boolean`},className:{default:Si,type:`object`,normalize:e=>({...Si,...e&&typeof e==`object`?e:{}})}},wi={type:`plainObject`,shape:{image:[`string`,`null`,`undefined`],url:[`string`,`null`,`undefined`],title:[`string`,`null`,`undefined`],sort:[`number`,`null`,`undefined`],blank:[`boolean`,`null`,`undefined`],children:`renderable`}},Ti={data:{type:`array`},loading:{type:`boolean`},index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function Ei(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function Di(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function Oi(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function ki(e){return Array.isArray(e)?Oi(e):e}function Ai(e={}){let t=R(e,Ci,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:ki(t.data),className:{...t.className}}}function ji(e={}){let n=Ai(e),r=(0,t.createDeepStore)({data:Oi(Array.isArray(n.data)?n.data:[]),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),i=J(),a=new WeakMap,o=new Map,s=new Map,c=new Set,l,u=null,d=[],p=()=>[],m=()=>[],h=0,g=null,v=null,y=[],b=null,x=!1,S=!1,C=!1,w=!1,T=e=>(a.has(e)||a.set(e,Y()),a.get(e)),E=e=>{let t=Object.keys(e);return{keys:t,values:t.map(t=>e[t])}},D=(e,t,n)=>{if(!e||e.keys.length!==t.length)return!1;for(let r=0;r<t.length;r+=1)if(e.keys[r]!==t[r]||!Object.is(e.values[r],n[r]))return!1;return!0},O=e=>{let t=new Set,n=e.map((e,n)=>{L(String(n),e,wi,`Swiper.state.data`);let r=T(e);t.add(r);let{keys:i,values:a}=E(e),s=o.get(r);if(s&&D(s,i,a))return s.item.index=n,s.item;let c={...e,blank:e.blank!==!1,index:n,key:r};return o.set(r,{item:c,keys:i,values:a}),c});for(let e of o.keys())t.has(e)||o.delete(e);return n.some(e=>e.sort!=null)?n.sort((e,t)=>e.sort==null&&t.sort==null?e.index-t.index:e.sort==null?1:t.sort==null?-1:e.sort-t.sort||e.index-t.index):n},k=(e,t,n)=>{let r=n===null?`real:${e.key}:${!!e.url}`:`clone:${n}:${e.key}:${!!e.url}`,i=s.get(r);if(i&&i.item===e&&i.clone===n)return i.index=t,i;let a={item:e,index:t,clone:n,key:r};return s.set(r,a),a},A=e=>{let t=new Set,r=e.map((e,n)=>{let r=k(e,n,null);return t.add(r.key),r});if(!n.loop||e.length<=1){for(let e of s.keys())t.has(e)||s.delete(e);return r}let i=e[0],a=e[e.length-1],o=k(a,e.length-1,`last`),c=k(i,0,`first`);t.add(o.key),t.add(c.key);for(let e of s.keys())t.has(e)||s.delete(e);return[o,...r,c]},j=()=>p().length,M=()=>m().length,N=(e=r.trackIndex)=>{let t=j();return t?!n.loop||t<=1?Math.max(0,Math.min(e,t-1)):e===0?t-1:e===M()-1?0:e-1:0},ee=e=>n.loop?N(e):Math.max(0,e),te=e=>{let t=j();if(!t)return 0;let r=Math.max(0,Math.min(e,t-1));return n.loop&&t>1?r+1:r},ne=()=>{d=u?q(`[data-swiper-slide]`,u):[]},P=()=>{for(let e of c)e();c.clear()},re=()=>{let e=l.element;if(!e)return;let n=e.clientWidth||e.offsetWidth;(n>0||!e.isConnected||r.width===0)&&(0,t.flushSync)(()=>{r.width=n})},F=()=>!!l.element?.isConnected&&r.width>0,I=()=>(re(),F()),R=(e,i=!0)=>{let a=Di(e),o=-a*r.width,s=i&&n.speed>0&&r.width>0&&r.transform!==o;(0,t.flushSync)(()=>{r.trackIndex=a,r.index=N(a),r.transform=o,r.animating=s})},ie=()=>{let e=[r.trackIndex];r.trackIndex>0&&e.push(r.trackIndex-1),r.trackIndex<d.length-1&&e.push(r.trackIndex+1);for(let t of e){let e=d[t]?K(`img[data-lazy]`,d[t]):null;if(!e)continue;let n=!!e.getAttribute(`src`);if(n&&!e.complete&&(e.onload||e.onerror))continue;e.dataset.status=`loading`;let r=()=>{e.onload=null,e.onerror=null,c.delete(r)};c.add(r);let i=()=>{e.dataset.status=`loaded`,r()},a=()=>{e.dataset.status=`error`,r()};e.onload=i,e.onerror=a,n||(e.src=e.dataset.lazy||``),e.complete&&(e.naturalWidth>0?i():a())}},V=()=>{g&&=(clearInterval(g),null)},ae=()=>{l.runtime.destroyed||g||j()<=1||I()&&(g=setInterval(()=>l.next(),Math.max(n.delay,16)))},H=()=>{n.autoplay&&!g&&!l.runtime.destroyed&&ae()},U=()=>{V(),n.autoplay&&ae()},oe=e=>{y.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),y.length>5&&y.shift()},se=()=>y.length?{x:y[y.length-1].x-y[0].x,y:y[y.length-1].y-y[0].y}:{x:0,y:0},W=(e=!0)=>{let n=-r.trackIndex*r.width,i=e&&r.transform!==n;x=!1,S=!1,C=!1,y=[],b=null,(0,t.flushSync)(()=>{r.transform=n,r.animating=i}),H()},ce=(e,n)=>{r.animating||!I()||(y=[],oe(e),b=n,x=!0,S=!1,C=!1,w=!1,V(),(0,t.flushSync)(()=>{r.animating=!1}))},le=(e,i)=>{if(!x||S||r.animating)return;oe(e);let a=se(),o=Math.abs(a.x),s=Math.abs(a.y);if(!(o<6&&s<6)){if(!C)if(Math.atan2(s,o)*180/Math.PI<n.touchAngle)C=!0,w=Ei(b);else{S=!0,W(!0);return}i.preventDefault(),(0,t.flushSync)(()=>{r.transform=-r.trackIndex*r.width+a.x*n.touchRatio})}},G=()=>{if(!x)return;if(x=!1,!C||r.width<=0){W(!0);return}let e=y.length?y[y.length-1].time-y[0].time:0,t=se().x,i=Math.abs(t)/r.width,a=0;e>n.longSwipesMs?a=Math.ceil(i-n.longSwipesRatio):i>=n.longSwipesRatio&&(a=Math.max(1,Math.ceil(i-n.longSwipesRatio))),l.slideToTrack(r.trackIndex+a*(t>0?-1:1)),y=[],H()},ue=e=>{e.target!==u||!(`propertyName`in e)||e.propertyName!==`transform`||((0,t.flushSync)(()=>{r.animating=!1}),!(!n.loop||j()<=1)&&(r.trackIndex===0?R(j(),!1):r.trackIndex===M()-1&&R(1,!1)))},de=()=>{let e=l.element;!e||!u||(i.clear(),i.on(`touchstart`,u,`touchstart`,e=>{let t=e.touches[0];t&&ce(t,e.target)},{passive:!0}),i.on(`touchmove`,u,`touchmove`,e=>{let t=e.touches[0];t&&le(t,e)},{passive:!1}),i.on(`touchend`,u,`touchend`,e=>{let t=e.changedTouches[0];t&&oe(t),G()}),i.on(`touchcancel`,window,`touchcancel`,()=>W(!0)),i.on(`mousedown`,u,`mousedown`,e=>{let t=e;t.button===0&&(ce(t,t.target),u?.style.setProperty(`cursor`,`grabbing`))}),i.on(`mousemove`,window,`mousemove`,e=>{let t=e;x&&t.buttons===1&&le(t,e)}),i.on(`mouseup`,window,`mouseup`,e=>{x&&(u?.style.setProperty(`cursor`,`grab`),oe(e),G())}),i.on(`click`,u,`click`,e=>{!w||!n.preventClick||(e.preventDefault(),e.stopPropagation(),w=!1)},{capture:!0}),i.on(`dragstart`,u,`dragstart`,e=>e.preventDefault()),i.on(`transitionend`,u,`transitionend`,ue),i.on(`resize`,window,`resize`,fe),i.on(`mouseenter`,e,`mouseenter`,V),i.on(`mouseleave`,e,`mouseleave`,H),i.on(`controls`,e,`click`,t=>{if(!(t.target instanceof Element))return;let n=t.target.closest(`[data-action], [data-swiper-bullet]`);!n||!e.contains(n)||(n.dataset.action===`prev`?l.prev():n.dataset.action===`next`?l.next():n.dataset.swiperBullet!=null&&l.slideTo(Number(n.dataset.swiperBullet)))}))},fe=()=>{if(!l.runtime.built)return;V(),P(),ne();let e=Math.min(r.index,Math.max(0,j()-1));re(),R(te(e),!1),n.lazyload&&ie(),n.autoplay&&F()&&H()},pe=vt(fe),me=()=>{v==null&&typeof requestAnimationFrame==`function`&&(v=requestAnimationFrame(()=>{v=null,!l.runtime.destroyed&&l.element?.isConnected&&fe()}))},he=async()=>{if(typeof n.data!=`function`)return;let e=++h;(0,t.flushSync)(()=>{r.loading=!0});try{let i=await Promise.resolve(n.data(l));if(l.runtime.destroyed||e!==h)return;L(`data`,i,{type:`array`},`Swiper.data`);let a=Oi(i);O(a),(0,t.flushSync)(()=>{r.data=a})}finally{!l.runtime.destroyed&&e===h&&(0,t.flushSync)(()=>{r.loading=!1})}},ge=()=>{he().catch(e=>{l.runtime.destroyed||console.error(`Swiper.data error:`,e)})},_e=(e,r)=>{let i=()=>ee(r()),a={className:n.className.slide,"data-swiper-slide":()=>String(i()),"data-swiper-index":()=>e().clone?null:String(i()),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${i()+1}`,children:()=>{let{item:r}=e();if(r.children!=null){let e={swiper:l,item:r,get index(){return i()}};return z(typeof r.children==`function`?r.children(e):r.children)}return[r.image?(0,t.jsx)(`img`,{className:n.className.image,alt:r.title||``,loading:`lazy`,...n.lazyload?{"data-lazy":r.image}:{src:r.image}}):null,r.title?(0,t.jsx)(`span`,{className:n.className.title,children:r.title}):null]}};return e().item.url?(0,t.jsx)(`a`,{...a,href:()=>e().item.url||``,target:()=>e().item.blank?`_blank`:`_self`}):(0,t.jsx)(`div`,a)};return l=Q({name:`Swiper`,props:n,state:r,actions:{slideTo(e){l.slideToTrack(te(e))},slideToTrack(e){if(!l.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(r.animating||!d.length||!I())return;let t=n.loop?Math.max(0,Math.min(e,d.length-1)):Math.max(0,Math.min(e,j()-1));R(t,!0),n.lazyload&&ie()},next(){r.animating||l.slideToTrack(r.trackIndex+1)},prev(){r.animating||l.slideToTrack(r.trackIndex-1)},play:ae,pause:V,resume:H,restartAutoplay:U},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:Oi(e.data)}:{}}},validateStatePatch(e){L(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Ti,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);L(t,e[t],Ti[t],`Swiper.setState`)}Array.isArray(e.data)&&O(e.data)},view:()=>{p=(0,t.createMemo)(()=>O(r.data)),m=(0,t.createMemo)(()=>A(p()));let e=()=>{let e=_();return e.setAttribute(`data-swiper-loading`,``),e};u=(0,t.jsx)(`div`,{className:n.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>r.loading?e():(0,t.For)({each:m,key:e=>e.key,children:_e})});let i=(0,t.jsx)(`div`,{id:n.id||Y(),className:n.className.root,"data-swiper":`root`,"data-status":()=>r.loading?`loading`:`loaded`,children:[u,n.pagination?(0,t.jsx)(`div`,{className:B(n.className.pagination,n.className.paginationHorizontal,n.className.paginationClickable,n.className.paginationBulletGroup),"data-swiper-pagination":``,children:(0,t.For)({each:p,key:e=>e.key,children:(e,i)=>(0,t.jsx)(`button`,{type:`button`,className:()=>B(n.className.indicator,n.className.bullet,r.index===i()?n.className.active:``),"data-swiper-bullet":()=>String(i()),"aria-label":()=>`Go to slide ${i()+1}`,"aria-current":()=>r.index===i()?`true`:null})})}):null,n.navigation?(0,t.jsx)(`button`,{type:`button`,className:()=>B(n.className.navigation,n.className.prev,!n.loop&&r.index<=0?n.className.disabled:``),"data-action":`prev`,"data-swiper-navigation":`prev`,"aria-label":`Previous slide`,disabled:()=>!n.loop&&r.index<=0,children:f(`arrow-left`)}):null,n.navigation?(0,t.jsx)(`button`,{type:`button`,className:()=>B(n.className.navigation,n.className.next,!n.loop&&r.index>=j()-1?n.className.disabled:``),"data-action":`next`,"data-swiper-navigation":`next`,"aria-label":`Next slide`,disabled:()=>!n.loop&&r.index>=j()-1,children:f(`arrow-right`)}):null]});return(0,t.createEffect)(()=>{u?.style.setProperty(`transform`,`translate3d(${r.transform}px, 0, 0)`),u?.style.setProperty(`transition`,r.animating?`transform ${n.speed}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`:`none`),i.style.setProperty(`--swiper-slide-width`,`${r.width}px`)}),(0,t.createEffect)(()=>{(p().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||r.data.length===0)&&pe.schedule()}),i},onBuild(e){!e.element||!u||(u.setAttribute(`aria-live`,`polite`),ne(),de(),re(),R(te(r.index),!1),n.lazyload&&ie(),n.autoplay&&F()&&ae(),e.own(()=>i.clear()),ge(),me())},onMount(){fe(),me()},onDestroy(){V(),pe.dispose(),h+=1,P(),v!=null&&cancelAnimationFrame(v),v=null,u=null,d=[]}}),Object.defineProperties(l,{realCount:{enumerable:!0,get:j},realIndex:{enumerable:!0,get:()=>N()}}),l}let Mi={root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`panel-list`,panel:`panel-item`,dragging:`dragging`},Ni={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},direction:{default:`top`,type:`string`,enum:[`top`,`bottom`,`left`,`right`]},active:{default:0,types:[`number`,`string`]},disabled:{default:[],types:[`number`,`string`,`array`]},onChange:{default:null,types:[`function`,`null`]},data:{default:[],type:`array`},className:{default:Mi,type:`object`,normalize:e=>({...Mi,...e&&typeof e==`object`?e:{}})}},Pi={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},Fi={data:Ni.data,active:Ni.active,disabled:Ni.disabled};function Ii(e,t,n=`Tabs.data`){L(String(t),e,Pi,n);let r=(typeof e.name==`string`?e.name.trim():``)||Y();return{...e,name:r}}function Li(e,t=`Tabs.data`){L(`data`,e,Fi.data,t);let n=new Set;return e.map((e,r)=>{let i=Ii(e,r,t),a=i.name;if(n.has(a))throw Error(`${t}: item name "${a}" must be unique.`);return n.add(a),i})}function Ri(e){return Array.isArray(e)?[...e]:e}function zi(e){let t=R(e,Ni,`Tabs.props`);return{id:t.id,direction:t.direction,active:t.active,disabled:Ri(t.disabled),onChange:t.onChange,data:Li(t.data,`Tabs.props.data`),className:t.className}}function Bi(e){return typeof e==`number`&&e>0?e:0}function Vi(e={}){let n=zi(e),r=(0,t.createDeepStore)({data:n.data,active:n.active,disabled:n.disabled,draggable:!1,dragging:!1,loading:!1}),i=J(),a=Ct(),o=Ct(),s=wt(),c=wt(),l=new Map,u=new Map,d,f=0,p=!1,m=0,h=0,g=0,v=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),y=()=>{let e=v(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},b=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},x=()=>{let e=Array.isArray(r.disabled)?r.disabled:[r.disabled];return Array.from(new Set(e.map(e=>typeof e==`number`?r.data[e]?.name:e).filter(e=>typeof e==`string`)))},S=e=>x().includes(e),C=e=>b()===e,w=(0,t.createMemo)(()=>r.data),T=()=>{let e=a.current,i=o.current;if(!e||!i)return;let s=n.direction===`left`||n.direction===`right`?i.scrollHeight>e.clientHeight+5:i.scrollWidth>e.clientWidth+5;r.draggable!==s&&(0,t.flushSync)(()=>{r.draggable=s})},E=vt(T),D=()=>{let e=a.current;if(!e)return;let t=g,r=performance.now(),i=n.direction===`left`||n.direction===`right`,o=n=>{let a=n-r;r=n,t*=.92,!(Math.abs(t)<.3)&&(i?e.scrollTop+=t*a*.05:e.scrollLeft+=t*a*.05,m=requestAnimationFrame(o))};m=requestAnimationFrame(o)},O=()=>{let e=a.current,s=o.current;if(!e||!s)return;let c=0,l=0,u=0,d=!1,f=0,h=e=>{let t=n.direction===`left`||n.direction===`right`;if(`touches`in e){let n=e.touches[0]||e.changedTouches[0];return t?n.pageY:n.pageX}return t?e.pageY:e.pageX},_=i=>{r.draggable&&(!(i instanceof MouseEvent)&&!(i instanceof TouchEvent)||(p=!0,(0,t.flushSync)(()=>{r.dragging=!0}),c=h(i),u=c,l=n.direction===`left`||n.direction===`right`?e.scrollTop:e.scrollLeft,g=0,cancelAnimationFrame(m)))},v=t=>{if(!p||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let r=h(t);f=c-r,g=u-r,u=r,!d&&(d=!0,requestAnimationFrame(()=>{d=!1,n.direction===`left`||n.direction===`right`?e.scrollTop=l+f:e.scrollLeft=l+f}))},y=()=>{p&&(p=!1,(0,t.flushSync)(()=>{r.dragging=!1}),D())};i.on(`drag:mousedown`,s,`mousedown`,_),i.on(`drag:touchstart`,s,`touchstart`,_,{passive:!0}),i.on(`drag:mousemove`,window,`mousemove`,v,{passive:!1}),i.on(`drag:touchmove`,window,`touchmove`,v,{passive:!1}),i.on(`drag:mouseup`,window,`mouseup`,y),i.on(`drag:touchend`,window,`touchend`,y)},k=async e=>{if(!d.runtime.built)throw Error(`Tabs.activate: call build() first.`);let i=v(e),a=r.data[i];if(!a)return;let o=a.name;S(o)||C(o)||((0,t.flushSync)(()=>{r.active=e}),await u.get(o)?.(),await Promise.resolve(n.onChange?.(i,o,s.get(o),c.get(o))))},A=(e,i)=>{let a=e().name,o=e().content,[s,p]=(0,t.createSignal)(typeof o==`function`?null:o),[m,h]=(0,t.createSignal)(!1),g=o,v=0,y=null,b=()=>({tabs:d,item:e(),index:i(),name:a}),x=async()=>{let n=e(),i=n.content;if(typeof i!=`function`){p(i);return}let o=n.cache?l.get(a):null,s=Bi(n.ttl);if(o&&(!s||Date.now()-o.updatedAt<=s)){p(o.content);return}if(y)return y;let c=++v;f+=1;let u=f;h(!0),(0,t.flushSync)(()=>{r.loading=!0});let m=Promise.resolve().then(()=>i(b())).then(t=>{c!==v||d.runtime.destroyed||(e().cache&&l.set(a,{content:t,updatedAt:Date.now()}),p(t))}).finally(()=>{c===v&&h(!1),u===f&&!d.runtime.destroyed&&(0,t.flushSync)(()=>{r.loading=!1}),y===m&&(y=null)});return y=m,m};u.set(a,x),(0,t.onCleanup)(()=>{l.delete(a),u.delete(a)}),(0,t.createEffect)(()=>{let t=e().content;t!==g&&(g=t,v+=1,y=null,l.delete(a),p(typeof t==`function`?null:t)),C(a)&&x()});let S=()=>{if(m())return _(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(b()):e};return(0,t.jsx)(`div`,{className:n.className.panel,"data-tabs-panel":a,role:`tabpanel`,"aria-hidden":()=>C(a)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(m()),hidden:()=>!C(a),ref:c.bind(a),children:()=>z(S())})},j=(e,r)=>{let i=e().name,a=()=>{let t=e().title,n={tabs:d,item:e(),index:r(),name:i};return typeof t==`function`?t(n):t};return(0,t.jsx)(`div`,{className:n.className.tab,"data-tabs-tab":i,role:`tab`,"aria-selected":()=>C(i)?`true`:`false`,"aria-disabled":()=>S(i)?`true`:`false`,ref:s.bind(i),children:()=>z(a())})};return d=Q({name:`Tabs`,props:n,state:r,actions:{activate:k},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Li(e.data,`Tabs.setState.data`)}:{},...Object.hasOwn(e,`disabled`)&&Array.isArray(e.disabled)?{disabled:Ri(e.disabled)}:{}}},validateStatePatch(e){L(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Fi,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;L(t,e[t],Fi[n],`Tabs.setState`)}},view:()=>((0,t.createEffect)(()=>{let e=r.data.length;return E.schedule(),e}),(0,t.jsx)(`div`,{className:n.className.root,id:n.id,"data-tabs":`root`,"data-tabs-direction":n.direction,children:[(0,t.jsx)(`div`,{className:n.className.wrap,"data-tabs-wrap":``,ref:a.set,children:(0,t.jsx)(`nav`,{className:()=>B(n.className.list,r.dragging&&n.className.dragging),"data-tabs-list":``,ref:o.set,children:(0,t.For)({each:w,key:e=>e.name,children:(e,t)=>j(e,t)})})}),(0,t.jsx)(`div`,{className:n.className.panelWrap,"data-tabs-panel-wrap":``,children:(0,t.For)({each:w,key:e=>e.name,children:(e,t)=>A(e,t)})})]})),onBuild(e){let t=e.element;t&&(i.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!S(t)&&k(t)}),i.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(h),h=requestAnimationFrame(T)}),O(),e.own(()=>i.clear()),E.schedule(),u.get(y().name||``)?.())},onMount(){E.schedule()},onDestroy(){f+=1,E.dispose(),cancelAnimationFrame(m),cancelAnimationFrame(h),l.clear(),u.clear(),s.clear(),c.clear()}}),Object.defineProperties(d,{current:{enumerable:!0,get:y}}),d}let Hi={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},Ui={top:`translateY(-100%)`,right:`translateX(100%)`,bottom:`translateY(100%)`,left:`translateX(-100%)`},Wi={content:{default:``,type:`renderable`},overlay:{default:!0,type:`boolean`},filter:{default:!0,type:`boolean`},bodyOverflow:{default:!0,type:`boolean`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},direction:{default:`left`,type:`string`,enum:[`top`,`right`,`bottom`,`left`]},animate:{default:`slide`,type:`string`},bgClose:{default:!0,type:`boolean`},escClose:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},className:{default:Hi,type:`object`,normalize:e=>({...Hi,...e&&typeof e==`object`?e:{}})},onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}},Gi={content:Wi.content,visible:{type:`boolean`},loading:{type:`boolean`}};function Ki(e){return e>0?e:0}function qi(e){let t=R(e,Wi,`Offcanvas`);return{content:t.content,overlay:t.overlay,filter:t.filter,bodyOverflow:t.bodyOverflow,cache:t.cache,ttl:t.ttl,direction:t.direction,animate:t.animate,bgClose:t.bgClose,escClose:t.escClose,id:t.id,className:t.className,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden}}let Ji=0,Yi=``;function Xi(e){L(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Gi,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;L(t,e[t],Gi[n],`Offcanvas.setState`)}}function Zi(e={}){let n=qi(e),r=(0,t.createDeepStore)({content:n.content,visible:!1,loading:!1}),[i,a]=(0,t.createSignal)({value:typeof n.content==`function`?null:n.content}),o={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},s=J(),c=Ct(),l,u=!1,d=()=>{!n.bodyOverflow||u||(Ji===0&&(Yi=document.body.style.overflow,document.body.style.overflow=`hidden`),Ji+=1,u=!0)},f=()=>{u&&=(Ji=Math.max(0,Ji-1),Ji===0&&(document.body.style.overflow=Yi,Yi=``),!1)},p=kt(()=>l.element,{keyframes:[{transform:Ui[n.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),m=zt({elements:()=>[c.current,l.element],mount:()=>{let e=c.current;e&&!e.isConnected&&(0,t.insert)(document.body,e),l.mount(document.body),d()},activate:()=>{r.visible=!0},deactivate:()=>{r.visible=!1},motion:Et(...n.animate===`slide`?[p]:[],kt(()=>c.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{c.current?.remove(),l.unmount(),f()}}),h=()=>{o.cache={content:null,hasContent:!1,updatedAt:0}},g=()=>{if(!n.cache||!o.cache.hasContent)return!1;let e=Ki(n.ttl);return!e||Date.now()-o.cache.updatedAt<=e},v=()=>{let e=i().value;return typeof e==`function`?e(l):e},y=async()=>{let e=r.content;if(typeof e!=`function`){o.contentLoadId+=1,(0,t.flushSync)(()=>{a({value:e}),r.loading=!1});return}if(g()){o.contentLoadId+=1,(0,t.flushSync)(()=>{a({value:o.cache.content}),r.loading=!1});return}let i=++o.contentLoadId;(0,t.flushSync)(()=>{r.loading=!0,a({value:null})});try{let r=await Promise.resolve(e(l));if(l.runtime.destroyed||i!==o.contentLoadId)return;n.cache&&(o.cache={content:r,hasContent:!0,updatedAt:Date.now()}),(0,t.flushSync)(()=>{a({value:r})})}finally{!l.runtime.destroyed&&i===o.contentLoadId&&(0,t.flushSync)(()=>{r.loading=!1})}};return l=Q({name:`Offcanvas`,props:n,state:r,actions:{async show(){if(!l.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(r.visible)return;await Promise.resolve(n.onShow?.(l));let e=m.enter(),t=y();await e&&!l.runtime.destroyed&&n.onShown?.(l),await t},async hide(){if(!l.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!r.visible)return;let e=n.onHide?.(l);e&&await e,o.contentLoadId+=1,(0,t.flushSync)(()=>{r.loading=!1}),await m.leave()&&n.onHidden?.(l)}},validateStatePatch:Xi,view(e){let i=n.overlay?(0,t.jsx)(`div`,{ref:c.set,className:n.className.overlay,"data-offcanvas-overlay":n.id,"data-mount":()=>r.visible?`true`:`false`,style:n.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{n.bgClose&&l.hide()}}):null;return i&&e.own(()=>i.remove()),(0,t.createEffect)(()=>{let e=r.content;L(`content`,e,Gi.content,`Offcanvas.state`),h(),typeof e==`function`?(a({value:null}),(0,t.untrack)(()=>r.visible)&&y()):(o.contentLoadId+=1,a({value:e}),r.loading=!1)}),(0,t.jsx)(`div`,{className:n.className.root,id:n.id,role:`dialog`,"aria-modal":n.overlay?`true`:`false`,"aria-expanded":()=>String(r.visible),"data-mount":()=>r.visible?`true`:`false`,"data-offcanvas":`root`,"data-direction":n.direction,"data-animate":n.animate,onClick:e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-action]`);(t?.dataset.action===`close`||t?.dataset.action===`cancel`)&&l.hide()},children:(0,t.jsx)(`div`,{className:n.className.content,"data-offcanvas-content":n.id,children:()=>z(r.loading?_():v())})})},onBuild(e){n.escClose&&s.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&r.visible&&l.hide()}),e.own(()=>s.clear())},onDestroy(){m.cancel(),o.contentLoadId+=1,c.current?.remove(),f()}}),l}let Qi={size:10,current:1},$i={sibling:1,boundary:1},ea={root:`j-pagination`,list:`pagination`,item:`item`,button:`j-button is-default is-icon`,currentBtn:`j-button is-ghost is-icon is-active`,moreBtn:`j-button is-ghost is-icon`,loading:`animate-spin`},ta={default:0,type:`number`,finite:!0,min:0},na={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},ra={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},ia={total:ta,page:{default:()=>({...Qi}),factory:!0,normalize:e=>({...Qi,...e&&typeof e==`object`?e:{}}),...na},count:{default:()=>({...$i}),factory:!0,normalize:e=>({...$i,...e&&typeof e==`object`?e:{}}),...ra},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:ea,type:`object`,normalize:e=>({...ea,...e&&typeof e==`object`?e:{}})}},aa={total:ta,page:na,count:ra,locked:{type:`boolean`}};function oa(e,t,n){return Math.min(Math.max(e,t),n)}function sa(e,t){return Math.max(1,Math.ceil(e/t))}function ca(e){return{size:e.size,current:e.current}}function la(e){return{sibling:e.sibling,boundary:e.boundary}}function ua(e={}){let t=R(e,ia,`Pagination.props`),n=sa(t.total,t.page.size);return{...t,page:{size:t.page.size,current:oa(t.page.current,1,n)},count:la(t.count),className:{...t.className}}}function da(e){return{type:`more`,key:e}}function fa(e){return{type:`page`,key:`page-${e}`,page:e}}function pa(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ma(e,t,n){if(t<=0)return[];let r=Math.max(0,n.boundary),i=Math.max(0,n.sibling);if(t<=r*2+i*2+3)return pa(1,t).map(fa);let a=new Set;for(let e=1;e<=Math.min(r,t);e++)a.add(e);for(let n=Math.max(1,e-i);n<=Math.min(t,e+i);n++)a.add(n);for(let e=Math.max(1,t-r+1);e<=t;e++)a.add(e);let o=Array.from(a).sort((e,t)=>e-t),s=[];for(let e of o){let t=s[s.length-1];t?.type===`page`&&e-t.page>1&&s.push(e-t.page===2?fa(t.page+1):da(`more-${t.page}-${e}`)),s.push(fa(e))}return s}function ha(e){if(e.type!==`page`)throw Error(`Pagination.itemView: expects page item.`);return e}function ga(e={}){let n=ua(e),r=(0,t.createDeepStore)({total:n.total,page:ca(n.page),count:la(n.count),locked:!1}),i=0,o,s=(0,t.createMemo)(()=>sa(r.total,r.page.size)),c=()=>n.lock&&r.locked,l=()=>c()||r.page.current<=1,u=()=>c()||r.page.current>=s(),d=(0,t.createMemo)(()=>ma(r.page.current,s(),r.count)),p=e=>{n.lock&&!o.runtime.destroyed&&e===i&&(0,t.flushSync)(()=>{r.locked=!1})},m=e=>{if(o.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!o.runtime.built)throw Error(`Pagination.go: call build() first.`);if(L(`page`,e,{type:`number`,integer:!0},`Pagination.go`),c())return o;let a=oa(e,1,s());if(a===r.page.current)return o;let l=n.lock&&typeof n.onChange==`function`,u=l?++i:i;if((0,t.flushSync)(()=>{r.page.current=a,l&&(r.locked=!0)}),n.onChange){let e;try{e=n.onChange(a,o)}catch(e){throw p(u),e}if(l&&e&&typeof e.then==`function`){let t=()=>p(u);Promise.resolve(e).then(t,t)}else p(u)}return o},h=e=>{let i=e===`prev`?l:u;return(0,t.jsx)(`li`,{className:n.className.item,"data-pagination-control":e,children:(0,t.jsx)(`button`,{className:n.className.button,type:`button`,"data-page-action":e,"aria-label":a(e===`prev`?`Go to previous page`:`Go to next page`),"aria-disabled":()=>i()?`true`:`false`,tabindex:()=>i()?`-1`:null,disabled:i,onClick:()=>{i()||m(r.page.current+(e===`prev`?-1:1))},children:f(e===`prev`?`arrow-left`:`arrow-right`)})})},g=e=>{if(e().type===`more`)return(0,t.jsx)(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,children:(0,t.jsx)(`span`,{className:n.className.moreBtn,"aria-disabled":!0,disabled:``,children:f(`more`)})});let i=()=>ha(e()).page,a=()=>i()===r.page.current;return(0,t.jsx)(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:(0,t.jsx)(`button`,{className:()=>a()?n.className.currentBtn:n.className.button,type:`button`,"data-page":()=>String(i()),"data-current-page":()=>a()?String(i()):null,"aria-current":()=>a()?`page`:null,"aria-label":()=>a()?`Page ${i()}, current page`:`Go to page ${i()}`,"aria-disabled":()=>c()||a()?`true`:`false`,tabindex:()=>c()||a()?`-1`:null,disabled:()=>c()||a(),onClick:()=>{let e=i();!c()&&!a()&&m(e)},children:()=>c()&&a()?_():String(i())})})};return o=Q({name:`Pagination`,props:n,state:r,actions:{go:m},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&y(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&y(t.count)&&(t.count={...r.count,...t.count}),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(aa,t))throw Error(`Pagination.setState: "${t}" is not supported.`);let n=t;L(t,e[t],aa[n],`Pagination.setState`)}},view:()=>((0,t.createEffect)(()=>{let e=oa(r.page.current,1,s());e!==r.page.current&&(r.page.current=e)}),(0,t.jsx)(`div`,{className:n.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:(0,t.jsx)(`ul`,{className:n.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[h(`prev`),(0,t.For)({each:d,key:e=>e.key,children:e=>g(e)}),h(`next`)]})}))}),Object.defineProperty(o,"pageCount",{enumerable:!0,get:s}),o}let _a={root:`j-menu`,list:`menu`,item:`menu-item`,hasChildren:`menu-item-has-children`,link:`menu-link`,subMenu:`sub-menu`,active:`is-active`,text:`menu-text`,backItem:`menu-item back`,backIcon:`el-icon el-prefix`},va={type:`object`,validate:Ea,message:`expects { title, id?, type?, url?, target?, classes?, children? }.`},ya={type:`array`,items:va},ba={type:{default:void 0,types:[`string`,`undefined`]},user:{default:0,types:[`number`,`function`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},data:{default:[],types:[`array`,`function`]},backText:{default:a(`b`),type:`string`},className:{default:_a,type:`object`,normalize:e=>({..._a,...e&&typeof e==`object`?e:{}})}},xa={user:{type:`number`},data:ya,activeKeys:{type:`array`,items:`string`}};function Sa(e={}){let t=R(e,ba,`Menu.props`);return{...t,user:t.user,data:t.data,className:{...t.className}}}function Ca(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function wa(e){return`menu-item-${e??Y()}`}function Ta(e){return typeof e==`string`?e.trim():``}function Ea(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return(typeof t.title==`string`||typeof t.title==`number`)&&(t.id==null||typeof t.id==`string`||typeof t.id==`number`)&&(t.type==null||t.type===0||t.type===1||t.type===2)&&(t.url==null||typeof t.url==`string`)&&(t.target==null||typeof t.target==`string`)&&(t.classes==null||typeof t.classes==`string`||Array.isArray(t.classes)&&t.classes.every(e=>typeof e==`string`))&&(t.children==null||Array.isArray(t.children)&&t.children.every(Ea))}function Da(e){return Array.isArray(e)?e.map(e=>{L(`item`,e,va,`Menu.data`);let t={...e};return t.type=t.type??0,Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=Da(t.children)),t}):[]}function Oa(e){let n=(0,t.access)(e??0);return L(`user`,n,`number`,`Menu.props`),n}function ka(e){let n=(0,t.access)(e??[]);return L(`data`,n,ya,`Menu.props`),Da(n)}function Aa(e={}){let n=Sa(e),r=(0,t.createDeepStore)({user:Oa(n.user),data:ka(n.data),activeKeys:[]}),i=new WeakMap,a=J(),o,s=e=>e.id==null?(i.has(e)||i.set(e,Y()),i.get(e)):String(e.id),c=e=>r.activeKeys.includes(e),l=()=>r.user>0,u=e=>e.type===1?l():e.type!==2||!l(),d=e=>Array.isArray(e)?e.filter(u):[],p=e=>{(0,t.flushSync)(()=>{r.activeKeys=n.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},m=e=>{(0,t.flushSync)(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},h=e=>{(0,t.flushSync)(()=>{r.activeKeys=c(e)?[]:[e]})},g=e=>(0,t.jsx)(`li`,{className:n.className.backItem,"data-menu-back":``,children:(0,t.jsx)(`a`,{className:n.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),m(e)},children:[(0,t.jsx)(`span`,{className:n.className.backIcon,children:f(`arrow-left`)}),(0,t.jsx)(`span`,{className:n.className.text,children:n.backText})]})}),_=(e,r=!1,i)=>(0,t.jsx)(`ul`,{className:r?n.className.list:n.className.subMenu,...r?{id:n.id}:{},"data-menu-list":r?`root`:`sub`,children:[(0,t.For)({each:()=>n.type===`mobile`&&i&&c(i)?[i]:[],key:e=>e,children:e=>g(e())}),(0,t.For)({each:e,key:e=>s(e),children:e=>{let r=s(e()),i=(0,t.createMemo)(()=>d(e().children)),a=()=>i().length>0;return(0,t.jsx)(`li`,{className:()=>{let t=e();return B(n.className.item,a()?n.className.hasChildren:``,...Ca(t.classes),c(r)?n.className.active:``)},id:()=>e().id==null?`menu-item-${r}`:wa(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>a()?``:null,onClick:e=>{n.type===`mobile`&&e.target===e.currentTarget&&a()&&p(r)},children:[()=>{let i=e(),o=a(),s=Ta(i.url);return!o&&!s?(0,t.jsx)(`span`,{className:n.className.link,"data-menu-link":``,children:i.title}):(0,t.jsx)(`a`,{className:n.className.link,href:s,target:i.target,"data-menu-link":``,onClick:e=>{o&&(n.type===`mobile`||n.type===`bottom`)&&(e.preventDefault(),n.type===`bottom`?h(r):p(r))},children:i.title})},()=>a()?_(i,!1,r):null]})}})]});return o=Q({name:`Menu`,props:n,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`user`)&&(t.user=Oa(t.user)),Object.hasOwn(t,`data`)&&(t.data=Da(t.data)),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(xa,t))throw Error(`Menu.setState: "${t}" is not supported.`);let n=t;L(t,e[t],xa[n],`Menu.setState`)}},view:()=>{let e=(0,t.createMemo)(()=>d(r.data));return(0,t.createEffect)(()=>{r.user=Oa(n.user),r.data=ka(n.data)}),(0,t.createEffect)(()=>L(`data`,r.data,ya,`Menu`)),(0,t.jsx)(`nav`,{className:n.className.root,"data-menu":`root`,"data-menu-type":n.type,children:_(e,!0)})},onBuild(e){n.type===`bottom`&&(a.on(`outside`,document,`click`,n=>{let i=n.target;!(i instanceof Node)||e.element?.contains(i)||(0,t.flushSync)(()=>{r.activeKeys=[]})}),e.own(()=>a.clear()))}}),o}e.Toast=rt,e.addIcons=g,e.all=q,e.asRenderable=z,e.checkModernBrowser=ct,e.copy=at,e.createAccordion=Cr,e.createCollapseTransition=At,e.createDrop=Jt,e.createElementRef=Ct,e.createEventManager=J,e.createFlow=si,e.createForm=Yr,e.createKeyedElementRefs=wt,e.createLoading=_,e.createMenu=Aa,e.createModal=xi,e.createMotionGroup=Et,e.createOffcanvas=Zi,e.createOwnedView=Tt,e.createPagination=ga,e.createParabola=gn,e.createPopup=Ht,e.createPresence=zt,e.createScheduledTask=vt,e.createStateSync=St,e.createSticky=Sn,e.createSwiper=ji,e.createTabs=Vi,e.createTheme=un,e.createToc=ur,e.createTooltip=$t,e.createTransition=kt,e.createValidator=er,e.defineComponent=Q,e.getRegistedIconPath=h,e.getStoreVersion=yt,e.getType=E,e.icon=f,e.iconHtml=p,e.iconMarkup=m,e.isDomElementValue=S,e.isDomNodeValue=x,e.isElement=U,e.isHtmlElementValue=C,e.isMobile=it,e.isModernBrowser=st,e.isNilValue=b,e.isNode=H,e.isPlainObject=y,e.isRenderableContent=fe,e.isRenderablePrimitive=w,e.isRenderableValue=T,e.joinClasses=B,e.lazyRender=pe,e.listen=ve,e.postJson=ut,e.q=K,e.randomId=Y,e.removeComponentPlugin=rr,e.requireContainer=de,e.resolveContainer=ue,e.resolveElement=G,e.resolveNode=le,e.resolveNodeList=ce,e.resolveProps=R,e.restUrl=lt,e.stateSnapshot=xt,e.timer=xe,e.trackStoreVersion=bt,e.translate=a,e.useComponentPlugin=nr,e.uuid=ye,e.validateParam=L,e.waitForMotion=Rt});