vanilla-jui 1.5.5 → 1.5.7

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.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"vanilla-signal-i18n";import{For as t,bindAttr as n,bindClass as r,createDeepStore as i,createEffect as a,createMemo as o,createRoot as s,createSignal as c,createWatch as l,flushSync as u,insert as d,jsx as f,onCleanup as p,untrack as m,unwrap as h}from"vanilla-signal";import{createStorage as g}from"vanilla-create-storage";var _={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:`重置`}},v={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>`};const y=`http://www.w3.org/2000/svg`,b=v;function x(e){if(!(e in b))throw Error(`Icon "${e}" not found.`)}function S(e){return x(e),`<svg xmlns="${y}" viewBox="0 0 24 24" fill="currentColor">${b[e]}</svg>`}function C(e){return e!==null&&e.namespaceURI===y}function w(e,t={}){let n=document.createElement(`template`);n.innerHTML=S(e);let r=n.content.firstElementChild;if(!C(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 T(e){return S(e)}const E=T;function D(){return{...b}}function O(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}".`);b[t]=n}}function k(...e){return e.filter(Boolean).join(` `)}const A=Function.prototype.toString.call(Object);function j(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)===A}function M(e){return e==null}function N(e){return typeof Node<`u`&&e instanceof Node}function P(e){return typeof Element<`u`&&e instanceof Element}function F(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function I(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function L(e){return M(e)||I(e)||typeof e==`function`||Array.isArray(e)||N(e)}const R=e=>e===null?`null`:Array.isArray(e)?`array`:F(e)?`HTMLElement`:N(e)?`Node`:typeof e;function z(e){return Array.isArray(e)?e.slice():j(e)?{...e}:e}function B(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function V(e,t){throw Error(`Validator: ${e} ${t}`)}function H(e){return typeof e==`string`?e:String(e)}function ee(e){return typeof e==`string`?`string`:`array`}function te(e,t,n){if(M(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=ee(t);n.nonEmpty&&t.length===0&&V(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&V(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&V(e,`expects ${r} length to be at most ${n.maxLength}.`)}function ne(e,t,n){M(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&V(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&V(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&V(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&V(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&V(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&V(e,`expects a number less than ${n.lessThan}.`))}function re(e,t,n){!n.plain||M(t)||j(t)||V(e,`expects an object.`)}function ie(e,t,n){!n.items||M(t)||(Array.isArray(t)||V(e,`expects array.`),t.forEach((t,r)=>{U(String(r),t,n.items,e)}))}function ae(e,t,n){if(!n.shape||M(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&V(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))U(t,r[t],i,e)}function oe(e,t){return t===`renderable`?L(e):t===`Node`?N(e):t===`Element`?P(e):t===`HTMLElement`?F(e):t===`plainObject`?j(e):R(e)===t}function se(e){return j(e)?`object`:R(e)}function ce(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)||V(e,i)}}function le(e,t){return e?`${e}.${t}`:t}function U(e,t,n={},r=``){let i=B(n),a=le(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&M(t)&&V(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=se(t);e.some(e=>oe(t,e))||V(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&V(a,`expects one of ${i.enum.map(H).join(`, `)}.`),te(a,t,i),ne(a,t,i),re(a,t,i),ie(a,t,i),ae(a,t,i),ce(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||V(a,i.message||`does not satisfy the required condition.`)),t}function W(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=B(t);a[e]=Object.hasOwn(i,e)?i[e]:ue(n)}for(let[e,n]of o){let r=B(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)U(e,a[e],t,n);return a}function ue(e){if(!Object.hasOwn(e,`default`))return;let t=e.default;return z(e.factory&&typeof t==`function`?t():t)}const de=[`node`,`element`,`array`];function fe(e){return de.includes(e)}function pe(e){return N(e)}function G(e){return P(e)}function me(e){return typeof e==`string`||G(e)||pe(e)||Array.isArray(e)}function he(e){return e.find(G)||null}function ge(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!ge(n,t))return null;continue}if(pe(n)){t.push(n);continue}return null}return t}function _e(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=J(e);return t.length>0?t:null}if(Array.isArray(e)){let t=ge(e,[]);return t&&t.length>0?t:null}return pe(e)?[e]:null}function ve(e){return G(e)||pe(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(_e(e)||[])[0]||null}function K(e){if(!me(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return G(t)?t:null}if(Array.isArray(e)){let t=_e(e);return Array.isArray(t)?he(t):null}return G(e)?e:null}function ye(e,t=`Component`,n=`element`){if(!fe(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return me(e)?n===`array`?_e(e):n===`node`?ve(e):K(e):null}function be(e,t=`Component`,n=`element`){let r=ye(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function xe(e){return L(e)}function q(e,t=document){return t.querySelector(e)}function J(e,t=document){return Array.from(t.querySelectorAll(e))}function Se(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(!we(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),Ce;let c=Ce,l=Te(e);if(l&&document.body.contains(l))return c=Ee(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=Te(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=Ee(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function Ce(){}function we(e){return typeof e==`string`||G(e)}function Te(e){return typeof e==`string`?q(e):e}function Ee(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),Ce;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 De(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function Y(){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=De(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 Oe(){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 X(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,`_`)}const ke={},Ae={timers:ke,start(e,t,n){ke[e]&&clearTimeout(ke[e]),ke[e]=setTimeout(()=>{n(),delete ke[e]},t)},cancel(e){ke[e]&&(clearTimeout(ke[e]),delete ke[e])}},je={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,action:`j-toast is-action`,actions:`toast-actions`,button:`j-button is-sm`,closeBtn:`is-ghost`,actionBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},Me={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},Ne={type:`number`,min:0},Pe={type:`number`,greaterThan:0},Fe=new Set,Ie=new Map,Z=new Map,Le=new Map;let Re=je;function ze(e){return{...je,...e}}function Be(e){return ze({...Re,...e?.className})}function Ve(e){let t=q(`[data-toast-container]`);return t?t.className=e.container:(t=f(`div`,{className:e.container,"data-toast-container":``}),d(document.body,t)),t}function He(e,t,n,r){let i=`${e}-${t}`;return Fe.add(i),Ae.start(i,r,()=>{Fe.delete(i),n()}),i}function Ue(e){for(let t of Array.from(Fe))t.startsWith(`${e}-`)&&(Ae.cancel(t),Fe.delete(t))}function We(e){Z.get(e)?.cancel(),Z.delete(e),Le.delete(e),e.remove(),Ie.get(e)?.(),Ie.delete(e);let t=q(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function Ge(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function Ke(e){return e.finished.then(()=>void 0,()=>void 0)}function qe(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 Je(e,t){let n=(Le.get(e)||0)+1;if(Le.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(qe(e,t),Ge(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 Ke(i),Le.get(e)===n&&Z.get(e)===i&&Z.delete(e)}function Ye(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),Je(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function Xe(e){e&&e.getAttribute(`data-mount`)!==`false`&&(Ie.get(e)?.(),Ie.delete(e),Ue(e.dataset.toast||X()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),Je(e,`leave`).then(()=>{e.dataset.mount===`false`&&We(e)}))}function Ze(e=``,t=3e3,n=`info`,r={}){U(`message`,e,`string`,`Toast.show`),U(`duration`,t,Ne,`Toast.show`),U(`type`,n,Me,`Toast.show`);let i=Be(r),a=X(),o=f(`div`,{className:k(i.toast,i[n]),"data-toast":a,role:`alert`,"aria-atomic":`true`,children:[f(`span`,{className:i.icon,"data-toast-icon":a,children:w(n===`primary`?`info`:n)}),f(`span`,{className:i.message,"data-toast-message":a,children:e})]});return Ye(o,()=>d(Ve(i),o),n===`error`?`assertive`:`polite`),t>0&&He(a,`hide`,()=>Xe(o),t),Ie.set(o,De(o,`click`,()=>Xe(o))),o}function Qe(e=``,t=2e3,n={}){U(`message`,e,`string`,`Toast.lite`),U(`duration`,t,Pe,`Toast.lite`);let r=Be(n),i=q(`[data-toast-lite]`);i&&(Ue(i.dataset.toast||``),Z.get(i)?.cancel(),We(i));let a=X(),o=f(`div`,{className:r.lite,"data-toast":a,"data-toast-lite":``,children:e});return Ye(o,()=>d(document.body,o),`polite`),He(a,`hide`,()=>Xe(o),t),o}function $e(t=``,n={}){U(`message`,t,`string`,`Toast.action`);let r=n.text?.close||e(`Close`,_),i=n.text?.action||e(`Confirm`,_),a=Be(n),o=X(),s=f(`div`,{className:k(a.action,a[n.type||`info`]),"data-toast":o,"data-toast-action":``,children:[f(`div`,{className:a.message,"data-toast-message":o,children:t}),f(`div`,{className:a.actions,"data-toast-actions":o,children:[f(`button`,{className:k(a.button,a.closeBtn),children:r,"data-action":`close`,"aria-label":r,onClick:async()=>{await n.onClose?.(),Xe(s)}}),f(`button`,{className:k(a.button,a.actionBtn),children:i,"data-action":`toast-action`,"aria-label":i,onClick:async()=>{await n.onAction?.(),Xe(s)}})]})]});return Ye(s,()=>d(Ve(a),s),`polite`,()=>{q(`[data-action="toast-action"]`,s)?.focus()}),s}function et(){for(let e of Fe)Ae.cancel(e);Fe.clear();for(let e of Ie.values())e();Ie.clear();for(let e of Z.values())e.cancel();Z.clear(),Le.clear(),q(`[data-toast-container]`)?.remove(),q(`[data-toast-lite]`)?.remove()}const tt={timers:Fe,disposers:Ie,configure(e={}){return Re=ze(e.className),{className:Re}},show:Ze,success:(e=``,t=3e3,n={})=>Ze(e,t,`success`,n),info:(e=``,t=3e3,n={})=>Ze(e,t,`info`,n),primary:(e=``,t=3e3,n={})=>Ze(e,t,`primary`,n),warning:(e=``,t=3e3,n={})=>Ze(e,t,`warning`,n),error:(e=``,t=3e3,n={})=>Ze(e,t,`error`,n),hide:Xe,lite:Qe,action:$e,clearAll:et,destroyAll:et};function nt(){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 rt(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 it(t)}return it(t)}function it(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 at(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function ot(){return at()?!0:(tt.action(e(`wn`,_),{type:`error`,onAction:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{actionBtn:`j-button is-sm is-danger`}}),!1)}const st=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function ct(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()}function lt(...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 ut(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 dt(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 ft(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),dt(o,t)),await ut(n,a),a?.aborted)};return{enter:e=>a(1,e),leave:e=>a(-1,e),cancel(){n?.cancel(),n=null}}}function pt(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=dt(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 ut(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}}}let mt=null,ht=null,gt=!1;function _t(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function vt(){gt||(gt=!0,_t(bt))}function yt(e){e.enqueued=!0,ht?ht.next=e:mt=e,ht=e,vt()}function bt(){gt=!1;let e=mt;mt=null,ht=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 xt(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||yt(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function St(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function Ct(e){return St(e),e}function wt(e){return h(e)}function Tt(e,t,{deferInitial:n=!0,flushInitial:r=!1,flush:i=`microtask`}={}){let a=!1,o=!1,s,c=xt(()=>{o&&(o=!1,m(()=>t(s)))}),u=l(e,e=>{let t=!a;if(a=!0,s=e,o=!0,t&&r||i===`sync`){c.flush();return}c.schedule()},{defer:n});return()=>{c.dispose(),u.dispose()}}function Et(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function Dt(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(t){return n=>{e.set(t,n),p(()=>{e.get(t)===n&&e.delete(t)})}},delete(t){e.delete(t)},clear(){e.clear()}}}function Ot(e,t={}){let n,r=t.removeOnDispose!==!1,i=s(t=>(n=m(e),r&&p(()=>n.remove()),t));return{element:n,dispose:i}}function kt(e){return e.filter(e=>e!=null&&e.isConnected)}function At(e){e[0]?.getBoundingClientRect()}function jt(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 Mt(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function Nt(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 Pt(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=Nt(jt(n.transitionDuration),jt(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=Nt(jt(n.animationDuration),jt(n.animationDelay),Mt(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function Ft(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 It(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,Pt(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(Ft(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 Lt(e){let t=`hidden`,n=0,r=null,i=null,a=null,o=()=>(a?.abort(),a=new AbortController,a.signal);return{get phase(){return t},enter:()=>{if(t===`visible`)return Promise.resolve(!1);if(t===`entering`&&r)return r;let i=++n,a=o();return t=`entering`,r=(async()=>{e.mount();let r=kt(e.elements());return At(r),u(e.activate),e.motion?await e.motion.enter(a):await It(r,a),i===n?(t=`visible`,!0):!1})(),r},leave:()=>{if(t===`hidden`)return Promise.resolve(!1);if(t===`leaving`&&i)return i;let r=++n,a=o();return t=`leaving`,i=(async()=>{u(e.deactivate);let i=kt(e.elements());return e.motion?await e.motion.leave(a):await It(i,a),r===n?(e.unmount(),t=`hidden`,!0):!1})(),i},cancel(){n+=1,a?.abort(),a=null,e.motion?.cancel(),t=`hidden`,r=null,i=null}}}function Rt(e=`center`,t=`center`){let n=w(`loader`,{width:24});return requestAnimationFrame(()=>{typeof n.animate==`function`&&n.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),f(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:t,position:`absolute`,width:`100%`,height:`100%`,borderRadius:`inherit`,backdropFilter:`blur(4px)`},children:n})}const zt={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 Bt(e){let t=W(e,zt,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function Vt(e={}){let{className:t,position:n,component:r,labelledby:i,content:a}=Bt(e),o={className:`${t} is-${n}`,role:`dialog`,children:a};return r&&(o[`data-${r}`]=`root`,o[`aria-${r}`]=`true`),i&&(o[`aria-labelledby`]=i),f(`div`,o)}const Ht={root:`j-drop`,container:`drop-container`},Ut={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:Ht,type:`object`,normalize:e=>({...Ht,...e&&typeof e==`object`?e:{}})},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||X():e??X()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Wt(e){let t=W(e,Ut,`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 Gt(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 Kt(e){return typeof e==`number`&&e>0?e:0}function qt(e,t={}){let n=K(e),r=Wt(t),i=Y(),a=Gt(r.delay),o={show:null,hide:null},l={x:0,y:0,lastMoveTime:0},u=0,p=0,m=!1,h=!1,g,_=null,v=null,y=0,b=()=>{},[x,S]=c(typeof r.content==`function`?null:r.content),[C,w]=c(!1),T=()=>{if(C())return Rt();let e=x();return typeof e==`function`?e(g):e},{root:E}=s(e=>{b=e;let t=f(`div`,{className:r.className.container,"data-drop-container":r.name||r.id,"aria-live":()=>typeof r.content==`function`?`polite`:null,"aria-busy":()=>String(C()),children:T});return{root:f(`div`,{className:r.className.root,id:r.id,"data-drop":r.name||X(),"aria-expanded":`false`,children:t})}}),D=e=>{o[e]&&clearTimeout(o[e]),o[e]=null},O=async()=>{let e=r.content;if(typeof e!=`function`){S(e);return}let t=Kt(r.ttl);if(r.cache&&_&&(!t||Date.now()-_.updatedAt<=t)){S(_.content);return}if(v)return v;let n=++y;w(!0);let i=Promise.resolve().then(()=>e(g)).then(e=>{h||n!==y||(r.cache&&(_={content:e,updatedAt:Date.now()}),S(e))}).finally(()=>{n===y&&!h&&w(!1),v===i&&(v=null)});return v=i,i},k=()=>{if(!n)return;let e=n.getBoundingClientRect(),{offset:t,position:i}=r;E.style.visibility=`hidden`,E.style.display=`block`;let a=E.getBoundingClientRect(),o=0,s=0,c=i;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)),E.style.top=`${o+window.scrollY}px`,E.style.left=`${s+window.scrollX}px`,E.style.visibility=``,E.style.display=``},A=e=>{h||m===e||(e?(E.parentNode||d(document.body,E),k(),O().then(()=>{m&&!h&&k()})):(y+=1,v=null,w(!1),E.style.top=``,E.style.left=``,E.remove()),E.setAttribute(`aria-expanded`,e?`true`:`false`),m=e,e?r.onShown?.(g):r.onHidden?.(g))},j=e=>{e.target instanceof Node&&n&&!E.contains(e.target)&&!n.contains(e.target)&&g.hide()},M=e=>{e instanceof MouseEvent&&(u=e.clientX,p=e.clientY,l.lastMoveTime=Date.now(),l.x=e.clientX,l.y=e.clientY)},N=()=>{i.on(`document:mousemove`,document,`mousemove`,M),D(`show`),o.show=setTimeout(()=>{let e=Date.now()-l.lastMoveTime;Math.abs(l.x-u)+Math.abs(l.y-p)<5||e>100?(g.show(!1),i.off(`document:mousemove`)):N()},a.show)};return g={get target(){return n},props:r,get element(){return h?null:E},get isVisible(){return m},delayShow:a.show,delayHide:a.hide,show(e=!0){D(`hide`),!(m||h)&&(e&&a.show>0?(D(`show`),o.show=setTimeout(()=>A(!0),a.show)):A(!0))},hide(e=!0){D(`show`),!(!m||h)&&(e&&a.hide>0?(D(`hide`),o.hide=setTimeout(()=>A(!1),a.hide)):A(!1))},toggle(){m?g.hide():g.show()},destroy(){h||(h=!0,D(`show`),D(`hide`),i.clear(),y+=1,v=null,w(!1),E.remove(),b(),n=null,m=!1)}},n&&(r.mode===`hover`?(i.on(`target:enter`,n,`mouseenter`,()=>{r.hoverIntent?N():g.show()}),i.on(`target:leave`,n,`mouseleave`,()=>{D(`show`),i.off(`document:mousemove`),g.hide()}),i.on(`root:enter`,E,`mouseenter`,()=>g.show()),i.on(`root:leave`,E,`mouseleave`,()=>g.hide())):(i.on(`target:click`,n,`click`,()=>g.toggle()),i.on(`document:click`,document,`click`,j))),g}const Jt={container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}};function Yt(e){let t=e&&typeof e==`object`?e:{},n=`ui`in t&&t.ui&&typeof t.ui==`object`?t.ui:{};return{...Jt,...t,ui:{...Jt.ui,...n}}}const Xt={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:Jt,type:`object`,normalize:Yt},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 Zt(e){let t=W(e,Xt,`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 Qt(e,t={}){let n=Zt(t),r=f(`div`,{className:k(n.className.container,n.theme&&n.className.ui[n.theme]),"data-tooltip":n.name||n.id||``,children:f(`div`,{className:n.className.message,"data-tooltip-message":``,children:n.message})}),i=qt(e,{name:n.name,mode:n.mode,position:n.position,offset:n.offset,cache:n.cache,ttl:n.ttl,id:n.id,delay:n.delay,hoverIntent:n.hoverIntent,onShown:n.onShown,onHidden:n.onHidden,content:r});return{get element(){return i?.element||null},get drop(){return i},show(e=!0){i?.show(e)},hide(e=!0){i?.hide(e)},toggle(){i?.toggle()},destroy(){i?.destroy(),i=null}}}const $t={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`},en={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:$t},tn={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`};function nn(e){return{...$t,...e}}function rn(e={}){return{...en,...e,className:nn(e.className)}}function an(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function on(){return g({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:864e5*7})}function sn(e){if(!j(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 cn(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 ln(t={}){let a=i(rn(t)),o={configVersion:0,destroyed:!1},c=on(),l=new Set,d=Y(),p=t=>e(t,_),m=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,h=()=>{let{mode:e,theme:t,radius:n,shadow:r,font:i}=a,o={mode:e,theme:t,radius:n,shadow:r,font:i,render:e===`auto`?m():e};c.set(a.key,o).catch(()=>{})},g=e=>{let t=s(t=>{for(let t of J(`[data-theme-group]`,e)){let e=t.dataset.themeGroup;if(an(e))for(let i of J(`[data-theme-button]`,t)){let t=()=>i.dataset.themeValue===String(a[e]);r(i,a.className.active,t),n(i,`aria-selected`,()=>t()?`true`:null)}}return t});l.add(t)},v=(e=null,t=null)=>{let n=a.className,r=t||cn(p),i=f(`div`,{className:e||n.panel,"data-theme-palette":`root`,children:[f(`h3`,{className:n.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:p(`t`)}),f(`div`,{className:n.container,"data-theme-container":``,children:r.map(e=>f(`div`,{className:n.item,"data-palette":e.type,"data-theme-group":e.type,children:[f(`div`,{className:n.itemTitle,"data-theme-group-title":e.type,children:e.title}),f(`div`,{className:n.items,"data-theme-items":e.type,children:e.buttons.map(([t,r])=>{let i=String(a[e.type])===String(t);return f(`button`,{className:k(n.button,i&&n.active),"data-palette":t,"data-theme-button":e.type,"data-theme-value":t,"aria-selected":i?`true`:null,children:[e.type===`theme`?f(`span`,{className:k(n.prefix,n.swatch),"data-theme-swatch":t,style:{backgroundColor:`var(--ui-${t})`}}):null,f(`span`,{className:n.buttonText,"data-theme-button-text":t,children:r})]})})})]}))})]});return g(i),i},y=e=>{o.configVersion+=1,u(()=>{Object.assign(a,e,{className:nn({...a.className,...e.className})})}),h()},b=()=>{if(!o.destroyed){o.destroyed=!0,d.clear();for(let e of l)e();l.clear(),c.close().catch(()=>{})}};d.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-theme-button]`),n=(t?.closest(`[data-theme-group]`))?.dataset.themeGroup,r=t?.dataset.themeValue;if(!t||!an(n)||!r||t.classList.contains(a.className.active))return;let i=a[n];o.configVersion+=1,u(()=>{a[n]=r});let s=document.documentElement;if(n===`mode`)s.classList.remove(`light`,`dark`,i),s.classList.add(r===`auto`?m():r);else{let e=tn[n],t=Array.from(s.classList).filter(t=>t.startsWith(e));t.length&&s.classList.remove(...t),s.classList.add(`${e}${r}`)}h()});let x=o.configVersion;return c.get(a.key).then(e=>{if(o.destroyed||o.configVersion!==x)return;let t=sn(e);t&&u(()=>{Object.assign(a,t)})}).catch(()=>{}),{props:a,createPanel:v,setConfig:y,destroy:b}}const un={color:`var(--tone-solid)`,size:`12px`},dn={ball:`parabola-ball`},fn={types:[`string`,`Node`,`array`,`null`,`undefined`]},pn={ball:{default:un,type:`plainObject`,normalize:e=>({...un,...e&&typeof e==`object`?e:{}}),shape:{color:`string`,size:`string`}},className:{default:dn,type:`object`,normalize:e=>({...dn,...e&&typeof e==`object`?e:{}})},from:{default:null,...fn},to:{default:null,...fn},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 mn(e){let t=W(e,pn,`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 hn(e={}){let t=mn(e),n={destroyed:!1},r=new Set,i=new Map,a=new Map,o=null,s=K(t.from),c=K(t.to),l,u=()=>{if(!n.destroyed){if(o){o.isConnected||d(document.body,o);return}o=f(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),d(document.body,o)}},p=()=>{!n.destroyed||r.size>0||(o?.remove(),o=null)},m=(e,n)=>{if(!r.has(e))return;let i=a.get(e);i&&cancelAnimationFrame(i),a.delete(e),e.remove(),r.delete(e),n&&t.onHidden?.(l),p()},h=e=>{if(n.destroyed||(u(),!o))return null;let{color:i,size:a}=t.ball,s=f(`div`,{className:t.className.ball,"data-parabola":`ball`,style:{backgroundColor:i,width:a,height:a,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return d(o,s),r.add(s),s},g=()=>{let e=s?.getBoundingClientRect(),n=c?.getBoundingClientRect();if(!e||!n)return null;let{left:r,top:i,width:a,height:o}=e,{left:l,top:u,width:d,height:f}=n,p,m;switch(t.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=l+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},_=(e,t,r,i,o,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=o-r,d=i=>{if(n.destroyed||!e.isConnected){a.delete(e);return}let o=i-c,f=Math.min(o/s,1),p=1-(1-f)**3,h=t+l*p,g=r+-100*Math.sin(Math.PI*p)+u*p,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-p*.3})`,f<1?a.set(e,requestAnimationFrame(d)):(a.delete(e),m(e,!0))};a.set(e,requestAnimationFrame(d))},v=(e,n)=>{let r=`parabola-show-${X()}`;i.set(r,n),Ae.start(r,t.showDelay,()=>{i.delete(r),e()})},y=()=>{for(let[e,t]of i)Ae.cancel(e),t();i.clear()};return l={props:t,runtime:n,get element(){return o},show(){return n.destroyed?Promise.resolve(!1):new Promise(e=>{v(()=>{if(n.destroyed){e(!1);return}s=K(t.from),c=K(t.to);let r=g();if(!r){e(!1);return}let i=h(r);if(!i){e(!1);return}t.onShow?.(l),_(i,r.startX,r.startY,r.endX,r.endY),e(!0)},()=>e(!1))})},destroy(){if(!n.destroyed){y(),s=null,c=null,n.destroyed=!0;for(let e of r)m(e,!1);a.clear(),p()}}},u(),l}const gn={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 _n(e){let t=W(e,gn,`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 vn(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function yn(e){return e===!1||e==null?null:be(e,`Sticky.parent`,`element`)}function bn(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return vn(be(e,`Sticky.target`,`array`));let n=vn(J(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=vn(be(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 xn(e={}){let t=_n(e),n=i({items:[]}),r={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},a={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,d=e=>e.length<=t.max?e:t.overflow===`ignore`?[]:e.slice(-t.max),f=()=>{for(let e of a.originalStyles.values())p(e)},p=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},m=(e,t)=>{if(e.id)return e.id;let n=a.keys.get(e);if(n)return n;let r=`sticky-${X()}-${t}`;return a.keys.set(e,r),r},h=e=>{a.originalStyles.has(e)||a.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},g=()=>d(bn(t.target,o)),_=(e=t.top)=>{let r=e,i=[],o=new Set(s);for(let[e,t]of a.originalStyles)o.has(e)||(p(t),a.originalStyles.delete(e));return s.forEach((e,n)=>{h(e),e.style.position=`sticky`,e.style.top=`${r}px`,i.push({key:m(e,n),index:n,top:r}),r+=e.offsetHeight+t.gap}),u(()=>{n.items=i}),t.onReBuild?.(l),r},v=()=>{if(c?.disconnect(),c=null,!t.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{r.reBuilding||r.destroyed||!r.built||(r.reBuilding=!0,r.reBuildFrameId=requestAnimationFrame(()=>{r.reBuilding=!1,r.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:t,state:n,runtime:r,build:()=>{if(r.destroyed)throw Error(`Sticky.build: instance destroyed`);return r.built?l:(o=yn(t.parent),s=g(),r.built=!0,v(),s.length===0?(u(()=>{n.items=[]}),l):(_(),l))},reBuild:()=>(!r.destroyed&&r.built&&(s=g(),_()),l),destroy:()=>{r.destroyed||(r.reBuildFrameId&&cancelAnimationFrame(r.reBuildFrameId),c?.disconnect(),c=null,f(),r.destroyed=!0,r.built=!1,r.reBuilding=!1,r.reBuildFrameId=0,a.originalStyles.clear(),s=[],o=null)}},l}const Sn={rules:{default:{},type:`object`},messages:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]}};function Cn(e){let t=W(e,Sn,`Validator.props`);return{rules:t.rules,messages:t.messages,onSubmit:t.onSubmit}}function wn(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Tn(e){if(!e)return null;if(e instanceof Element)return wn(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&wn(t))return t;return null}function En(){return{valid:!0,message:``,destroyed:!1}}function Dn(e){return e.closest(`[data-form-control]`)||e.parentElement}function On(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function kn(e){return e instanceof HTMLInputElement&&e.type===`file`}function An(e){return!!e.files&&e.files.length>0}function jn(e,t){return t===!0?e instanceof HTMLSelectElement?On(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function Mn(e,t){return typeof t!=`number`||e.value.length>=t}function Nn(e,t){return typeof t!=`number`||e.value.length<=t}function Pn(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function Fn(e,t,n){if(!e||typeof n!=`string`)return!0;let r=Tn(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function In(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 Ln(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||On(e).some(e=>e.length>0)}function Rn(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 zn(e,t){return!(e instanceof HTMLSelectElement)||typeof t!=`number`||e.selectedOptions.length>=t}function Bn(e,t){return!(e instanceof HTMLSelectElement)||typeof t!=`number`||e.selectedOptions.length<=t}function Vn(e,t){return!/\s/.test(e.value)||t!==!0}function Hn(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function Un(e,t){return!kn(e)||t!==!0||An(e)}function Wn(e,t){return!kn(e)||!An(e)||typeof t!=`number`||e.files[0].size>=t}function Gn(e,t){return!kn(e)||!An(e)||typeof t!=`number`||e.files[0].size<=t}function Kn(e,t){if(!kn(e)||!An(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,t,n,r,i,a=``){(!(n instanceof HTMLInputElement)||n.type!==`checkbox`)&&(n.classList.remove(`is-valid`),n.classList.add(`is-invalid`));let o=a||e?.messages[r]?.[i]||``;if(!o)return;t.message=o;let s=Dn(n);if(!s)return;let c=J(`[data-validator-help]`,s).find(e=>e.dataset.validatorHelp===r)||null;c||(c=f(`div`,{className:`help-block is-invalid`,"data-validator-help":r}),s.appendChild(c)),c.textContent=o}function Jn(e){let t=Dn(e);if(t)for(let n of J(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)&&(e.classList.remove(`is-invalid`),e.classList.add(`is-valid`))}function Yn(e,t={},n=!1){U(`bindEvents`,n,`boolean`,`Validator`);let r=K(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=Cn(t),o=En(),s=Y(),c,l=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,c);return typeof n==`string`?n:!!n},u=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let s=n[r],c=``;switch(r){case`required`:o.valid=jn(e,s);break;case`minLength`:o.valid=Mn(e,s);break;case`maxLength`:o.valid=Nn(e,s);break;case`equalTo`:o.valid=Fn(i,e,s);break;case`email`:o.valid=Pn(e);break;case`checked`:o.valid=In(e,s);break;case`selected`:o.valid=Ln(e,s);break;case`multiple`:o.valid=Rn(e,s);break;case`min`:o.valid=zn(e,s);break;case`max`:o.valid=Bn(e,s);break;case`noSpace`:o.valid=Vn(e,s);break;case`noChinese`:o.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:o.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:o.valid=Hn(e,s);break;case`file`:o.valid=Un(e,s);break;case`minSize`:o.valid=Wn(e,s);break;case`maxSize`:o.valid=Gn(e,s);break;case`accept`:o.valid=Kn(e,s);break;case`validate`:{let t=l(e,s);o.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!o.valid){qn(a,o,e,t,r,c);break}Jn(e)}return o.valid},d=()=>{if(!i||!a||o.destroyed)return!1;o.valid=!0,o.message=``;for(let e of Array.from(i.elements))if(!(!wn(e)||!e.name)&&a.rules[e.name]&&(o.valid=u(e,e.name),!o.valid))break;return o.valid&&a.onSubmit?.(c),o.valid},f=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))wn(e)&&e.classList.remove(`is-valid`,`is-invalid`);for(let e of J(`[data-validator-help]`,i))e.remove();o.valid=!0,o.message=``}};return c={get element(){return i},get props(){return a},set props(e){a=e},runtime:o,validate:d,reset:f,destroy:()=>{o.destroyed||(o.destroyed=!0,s.clear(),f({native:!1}),i=null,a=null,o.valid=!1,o.message=``)}},n&&(s.on(`submit`,i,`submit`,e=>{e.preventDefault(),d()}),s.on(`reset`,i,`reset`,()=>f({native:!1}))),c}const Xn=new Map;function Zn(e,t){!e||!t||Xn.set(e,t)}function Qn(e){Xn.delete(e)}function $n(e){typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}function Q(e){let t={built:!1,mounted:!1,destroyed:!1},n=new Map,r=new Set,i=new Map,a=null,o=null,s,c=n=>{if(t.destroyed)throw Error(`${e.name}.${n}: instance destroyed`)},l=(e,...t)=>{for(let r of n.get(e)||[])try{r(...t)}catch{}},d={props:e.props,state:e.state,runtime:t,get element(){return a},own(e){e&&r.add(e)},assertActive:c,emit:l},f={props:e.props,state:e.state,runtime:t,get element(){return a},build(){if(c(`build`),t.built)return s;let n=Ot(()=>e.view(d),{removeOnDispose:e.ownsElement});return a=n.element,o=n.dispose,t.built=!0,e.onBuild?.(d),l(`build`,s),s},mount(n){if(c(`mount`),t.built||s.build(),!a)throw Error(`${e.name}.mount: view did not create an element.`);return a.parentNode!==n&&n.appendChild(a),t.mounted=!0,e.onMount?.(d),l(`mount`,s,n),s},unmount(){return c(`unmount`),!t.mounted&&!a?.parentNode?s:(e.onUnmount?.(d),e.ownsElement!==!1&&a?.remove(),t.mounted=!1,l(`unmount`,s),s)},setState(t={},n){c(`setState`);let r=typeof t==`string`&&arguments.length>1?{[t]:n}:t;if(!j(r))throw Error(`${e.name}.setState: expects a plain object patch.`);let i=e.normalizeStatePatch?e.normalizeStatePatch(r):r;if(!j(i))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(i,e.state);else for(let t of Object.keys(i))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return u(()=>{Object.assign(e.state,i)}),s},own(e){return e&&r.add(e),s},use(e,t){if(!e)return s;let n=typeof e==`function`?e(s,t):e.install(s,t);return i.set(e,n),s},on(e,t){if(!e||typeof t!=`function`)return s;let r=n.get(e);return r||(r=new Set,n.set(e,r)),r.add(t),s},off(e,t){return n.get(e)?.delete(t),s},emit(e,...t){return l(e,...t),s},destroy(){if(!t.destroyed){t.destroyed=!0,e.onDestroy?.(d),l(`destroy`,s);for(let e of r)try{$n(e)}catch{}r.clear();for(let e of i.values())try{$n(e)}catch{}i.clear(),o?.(),o=null,e.ownsElement!==!1&&a?.remove(),a=null,t.built=!1,t.mounted=!1,n.clear()}}};s=Object.assign(f,e.actions||{});for(let e of Xn.values())s.use(e);return s}const er={toc:`j-toc`,list:`toc-list`,link:`toc-link`,active:`is-active`,levelPrefix:`is-level-`},tr={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},reactive:{default:!1,type:`boolean`},className:{default:er,type:`object`,normalize:e=>({...er,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]}};function nr(e){let t=W(e,tr,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,reactive:t.reactive,className:t.className,onChange:t.onChange}}function rr(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function ir(e,t){return e.id||=`toc-${X()}-${t}`,{id:e.id,text:e.textContent||``,level:rr(e)}}function ar(e={}){let n=nr(e),r=i({items:[],current:{index:-1,item:null}}),a={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0},s=Y(),c=null,l=[],d=null,p,m=o(()=>r.items),h=e=>{if(e===r.current.index)return;let t=r.items[e]||null;u(()=>{r.current={index:e,item:t}}),n.onChange?.(t,e,p)},g=()=>{if(!p.runtime.built)return;let e=-1,t=n.offset+1;for(let n=l.length-1;n>=0;n--)if(l[n].getBoundingClientRect().top<=t){e=n;break}h(e)},_=()=>{a.ticking||(a.ticking=!0,a.frameId=requestAnimationFrame(()=>{a.ticking=!1,a.frameId=0,g()}))},v=()=>{a.refreshing||(a.refreshing=!0,a.refreshFrameId=requestAnimationFrame(()=>{a.refreshing=!1,a.refreshFrameId=0,b()}))},y=(e,{activeIndex:t=-1,updateHash:r=!1}={})=>{let i=l.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&&h(t),r&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},b=()=>{if(p.runtime.destroyed||!p.runtime.built||!c)return;l=J(n.headings,c);let e=l.map(ir);u(()=>{r.items=e,r.current={index:-1,item:null}}),g()};return p=Q({name:`Toc`,props:n,state:r,actions:{activate:e=>(p.runtime.built&&Number.isInteger(e)&&e>=0&&e<r.items.length&&y(r.items[e]),p)},view:()=>f(`nav`,{className:n.className.toc,"data-toc":`root`,children:f(`div`,{className:n.className.list,"data-toc-list":`root`,children:t({each:m,key:e=>e.id,children:(e,t)=>f(`a`,{className:()=>{let i=e();return k(n.className.link,`${n.className.levelPrefix}${i.level}`,r.current.index===t()?n.className.active:``)},href:()=>`#${e().id}`,"data-toc-index":()=>String(t()),"data-toc-target":()=>e().id,"data-active":()=>r.current.index===t()?`1`:`0`,onClick:n=>{n.preventDefault(),y(e(),{activeIndex:t(),updateHash:!0})},children:()=>e().text})})})}),onBuild(e){c=be(n.target,`Toc.target`),s.on(`scroll`,window,`scroll`,_,{passive:!0}),e.own(()=>s.clear()),b(),n.reactive&&(d=new MutationObserver(v),d.observe(c,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{d?.disconnect(),d=null}))},onDestroy(){a.frameId&&cancelAnimationFrame(a.frameId),a.refreshFrameId&&cancelAnimationFrame(a.refreshFrameId),a.frameId=0,a.refreshFrameId=0,a.ticking=!1,a.refreshing=!1,d?.disconnect(),d=null,c=null,l=[]}}),p}const or={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`},sr={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},cr={type:`array`,nonEmpty:!0,items:sr},lr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||X():e??X()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(ur):ur(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:or,type:`object`,normalize:e=>({...or,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]},data:{default:[],...cr}};function ur(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function dr(e){let t=W(e,lr,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,direction:t.direction,className:t.className,data:pr(t.data,!1),onChange:t.onChange}}function fr(e,t,n=!0){n&&U(String(t),e,sr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||X()}}function pr(e,t=!0){t&&U(`data`,e,cr,`Accordion`);let n=new Set;return e.map((e,t)=>{let r=fr(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 mr(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 hr(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 gr(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 _r(e){return typeof e==`number`&&e>0?e:0}function vr(e){let n=dr(e),r=mr(n.active,n.data,n.multiple),o=i({data:n.data,activeNames:r,loading:!1}),s=new WeakMap,l=Dt(),d=Dt(),m=new Map,h=new Map,g=new Map,_=new Set(r),v=Promise.resolve(),y=0,b=0,x=!1,S,C=e=>(typeof e.name==`string`?e.name.trim():``)||(s.has(e)||s.set(e,X()),s.get(e)),T=()=>{let e=o.data.map(e=>({...e,name:C(e)}));return gr(hr(o.activeNames,e,n.multiple),e)},E=e=>o.activeNames.includes(e),D=()=>{b+=1,!x&&!S.runtime.destroyed&&(x=!0,u(()=>{o.loading=!0}))},O=()=>{b=Math.max(0,b-1),b===0&&x&&!S.runtime.destroyed&&(x=!1,u(()=>{o.loading=!1}))},k=e=>typeof e==`number`?e:typeof e==`string`?o.data.findIndex(t=>C(t)===e):-1,A=e=>{let t=new Set(e),n=new Set([..._,...t]),r=[];for(let e of n){let n=_.has(e),i=t.has(e);if(n===i)continue;let a=d.get(e);a&&(a.inert=!i);let o=m.get(e);o&&r.push(i?o.enter():o.leave())}return _=t,r.length>0&&(v=Promise.all(r).then(()=>void 0)),v},j=e=>t=>{d.bind(e)(t),m.get(e)?.cancel();let r=pt(()=>d.get(e),{axis:n.direction,options:{duration:250,easing:`ease`}});m.set(e,r);let i=E(e);t.inert=!i,r.setExpanded(i),p(()=>{m.get(e)===r&&(r.cancel(),m.delete(e),_.delete(e),o.activeNames.includes(e)&&u(()=>{o.activeNames=o.activeNames.filter(t=>t!==e)}))})},M=async e=>{if(S.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!S.runtime.built)throw Error(`Accordion.activate: call build() first.`);let t=k(e),r=o.data[t];if(!r)return;let i=C(r),a=E(i);if(a&&!n.multiple&&!n.collapsible)return;let s;if(n.multiple)if(a){let e=o.activeNames.filter(e=>e!==i);s=!n.collapsible&&e.length===0?[...o.activeNames]:e}else s=[...o.activeNames,i];else s=a?n.collapsible?[]:[...o.activeNames]:[i];u(()=>{o.activeNames=s});let c=A(s),f=s.includes(i)&&g.get(i)?.()||Promise.resolve(),p=l.get(i),m=d.get(i),h=n.onChange&&p&&m?f.then(()=>n.onChange?.(t,i,p,m,S)):Promise.resolve();await Promise.all([c,h])},N=(e,t,n)=>{let r=C(e);return{accordion:S,item:e,index:t,type:n,active:E(r)}},P=(e,t,n)=>typeof e==`function`?e(N(t,n,`title`)):e,F=(e,t,n)=>{let r=e().content,[i,o]=c(typeof r==`function`?null:r),[s,l]=c(!1),u=r,d=0,f=null,m=()=>N(e(),t(),`content`),_=async()=>{let t=e(),r=t.content;if(typeof r!=`function`){o(r);return}let i=t.cache?h.get(n):null,a=_r(t.ttl);if(i&&(!a||Date.now()-i.updatedAt<=a)){o(i.content);return}if(f)return f;let s=++d;y+=1;let c=y;l(!0),D();let u=Promise.resolve().then(()=>r(m())).then(t=>{s!==d||S.runtime.destroyed||(e().cache&&h.set(n,{content:t,updatedAt:Date.now()}),o(t))}).finally(()=>{s===d&&!S.runtime.destroyed&&l(!1),c<=y&&O(),f===u&&(f=null)});return f=u,u};return g.set(n,_),p(()=>{d+=1,h.delete(n),g.delete(n),f=null}),a(()=>{let t=e().content;t!==u&&(u=t,d+=1,f=null,h.delete(n),o(typeof t==`function`?null:t)),E(n)&&_()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return Rt(`flex-start`,`flex-start`);let e=i();return typeof e==`function`?e(m()):e}}},I=(e,t)=>{let r=C(e()),i=F(e,t,r),a=`${n.id}_header_${r}`,o=`${n.id}_panel_${r}`;return[f(`div`,{className:n.className.header,id:a,"data-accordion-header":r,role:`button`,tabindex:`0`,"aria-controls":o,"aria-expanded":()=>E(r)?`true`:`false`,ref:l.bind(r),onClick:()=>void M(r),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),M(r))},children:[f(`span`,{className:n.className.title,"data-accordion-title":r,role:`heading`,children:()=>{let n=e();return P(n.title,n,t())}}),f(`span`,{className:n.className.arrow,"data-accordion-arrow":r,"aria-hidden":`true`,children:w(`arrow-down`)})]}),f(`div`,{className:n.className.panel,"data-accordion-panel":r,id:o,role:`region`,"aria-labelledby":a,"aria-hidden":()=>E(r)?`false`:`true`,"aria-live":()=>i.isAsync()?`polite`:null,"aria-busy":()=>String(i.loading()),"data-state":()=>E(r)?`open`:`closed`,ref:j(r),children:f(`div`,{className:n.className.content,"data-accordion-content":r,children:i.render})})]};return S=Q({name:`Accordion`,props:n,state:o,actions:{isActive:E,getIndex:k,activate:M},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:pr(e.data)}:{}}},view:()=>{let e=f(`div`,{className:n.className.root,id:n.id,"data-accordion":`root`,"data-direction":n.direction,children:t({each:()=>o.data,key:e=>C(e),children:(e,t)=>I(e,t)})});return _=new Set(o.activeNames),a(()=>{A([...o.activeNames])}),e},onDestroy(){y+=1,b=0,x=!1,h.clear(),g.clear();for(let e of m.values())e.cancel();m.clear(),l.clear(),d.clear()}}),Object.defineProperty(S,"current",{enumerable:!0,get:T}),S}const yr={form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-item`,label:`item-label`,required:`is-required`,control:`form-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,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`,switchDefault:`is-default`,switchSizeMd:`is-md`,switchSlider:`switch-slider`},br=[{type:`submit`,text:e(`Submit`,_),theme:`primary`,action:`submit`},{type:`reset`,text:e(`Reset`,_),theme:`ghost`,action:`reset`}],xr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():X():e??X()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:br,types:[`boolean`,`array`],normalize:e=>e===!1?[]:e===!0?Er(br):Array.isArray(e)?Er(e):e},buttonsPosition:{default:`end`,type:`string`,enum:[`start`,`center`,`end`]},className:{default:yr,type:`object`,normalize:e=>jr(e)},validator:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function Sr(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function Cr(e){return{...e,options:Sr(e.options)}}function wr(e){return{...e.id?{id:e.id}:{},type:e.type,payload:Cr(e.payload),next:e.next||null}}function Tr(e){return Array.isArray(e)?e.map(e=>wr(e)):[]}function Er(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function Dr(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 Or(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function kr(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e.name}function Ar(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function jr(e){return{...yr,...j(e)?e:{}}}function Mr(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!j(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 Nr(e){return e===`center`?`center`:`flex-${e}`}function Pr(e){let t=j(e)?e:{};return{...t,rules:j(t.rules)?t.rules:{},messages:j(t.messages)?t.messages:{}}}function Fr(e){let t=W(e,xr,`Form.props`),n=Tr(t.fields);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,style:t.style,fields:n,buttons:Er(t.buttons),buttonsPosition:t.buttonsPosition,className:jr(t.className),validator:Pr(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function Ir(e){return{...e,fields:Tr(e.fields),buttons:Er(e.buttons),className:jr(e.className),validator:Pr(e.validator)}}function Lr(e){let t=Ir(e);return delete t.buttonsPosition,t}function Rr(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function zr(e,t){return Array.isArray(e)?e.map(e=>kr(e)).includes(kr(t)):e==t}function Br(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>kr(e)).includes(kr(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||kr(e)===kr(t):n}function Vr(e){return e instanceof RadioNodeList?Array.from(e):[e]}function Hr(e={}){let n=Fr(e),r=Ir(n),s=Nr(n.buttonsPosition),l=i({...Lr(n),submitting:!1,data:null}),d={initial:r,fieldIds:new Map},p=new WeakMap,[m,h]=c(0),g=new WeakMap,_=null,v,y=e=>{if(l.fields.includes(e))return e;let t=g.get(e);if(t)return t;let n=i(wr(e));return g.set(e,n),n},b=o(()=>(m(),Dr(l.fields,y))),x=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(p.has(e)||p.set(e,X()),p.get(e)),S=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${x(n)}:${e.type}`:`item:${e.type}:${t}`},C=(e,t)=>{if(e.id)return e.id;let n=e.name||t;return d.fieldIds.has(n)||d.fieldIds.set(n,`${l.id}_field_${t}`),d.fieldIds.get(n)},w=()=>{let e=v.element;if(!e)return;let t={...l.validator,onSubmit:null};if(_?.element===e){_.props=t;return}_?.destroy(),_=Yn(e,t,!1)},T=()=>_?.validate()??!0,E=()=>{let e=v.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`);for(let t of J(`[data-form-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},D=()=>{let e={};if(!v.element)return e;for(let[t,n]of new FormData(v.element).entries())Object.hasOwn(e,t)?e[t]=Array.isArray(e[t])?[...e[t],n]:[e[t],n]:e[t]=n;return e},O=async e=>{if(e.preventDefault(),l.submitting||!T())return;let t=D();u(()=>{l.submitting=!0,l.data=t});try{await Promise.resolve(l.onSubmit?.(t,v))}finally{v.runtime.destroyed||u(()=>{l.submitting=!1})}},A=e=>{if(!e.name||!v.element)return[];let t=v.element.elements.namedItem(e.name);return t?Vr(t).filter(e=>e instanceof Element):[]},j=(e,t,n=`text`)=>{u(()=>{if(t instanceof HTMLSelectElement){e.value=t.multiple?Array.from(t.selectedOptions).map(e=>e.value):t.value;return}if(t instanceof HTMLTextAreaElement){e.value=t.value;return}if(n===`switch`){e.checked=t.checked,e.value=t.checked?t.value:``;return}if(n===`radio`){t.checked&&(e.value=t.value);return}if(n===`checkbox`){if(Array.isArray(e.options)){e.value=A(e).filter(e=>e instanceof HTMLInputElement&&e.checked).map(e=>e.value);return}e.checked=t.checked,e.value=t.checked?t.value:``;return}e.value=t.value,t.type===`checkbox`&&(e.checked=t.checked)}),h(e=>e+1)},M=(e,t,n)=>({...n,name:()=>e().name,id:t,placeholder:()=>e().placeholder||``,required:()=>!!e().required,disabled:()=>l.submitting||!!e().disabled,readonly:()=>!!e().readonly,"data-form-field":()=>e().name||t}),N=(e,t,n)=>f(`div`,{className:()=>{let t=e(),r=t.vertical?`vertical`:`horizontal`,i=l.className;return k(n===`radio`?i.radio:i.checkbox,r===`vertical`?i.choiceVertical:i.choiceHorizontal,t.group?i.choiceGroup:``,t.size?`is-${t.size}`:``)},"data-form-choice-group":()=>e().name||t,"data-choice-type":n,"data-choice-layout":()=>e().vertical?`vertical`:`horizontal`,children:()=>(e().options||[]).map((r,i)=>{let a=Or(r),o=`${t}_${i}`;return f(`label`,{className:()=>n===`radio`?l.className.radioLabel:``,"data-form-choice":()=>e().name||t,for:o,children:[f(`input`,{type:n,id:o,name:()=>e().name,value:a.value??``,checked:()=>n===`radio`?zr(e().value,a.value):Br(e().value,a.value,a.checked),disabled:()=>l.submitting||!!a.disabled||!!e().disabled,required:()=>!!e().required,onChange:t=>{let r=t.currentTarget;r instanceof HTMLInputElement&&j(e(),r,n)}}),f(`span`,{className:()=>n===`radio`?l.className.radioText:``,"data-form-choice-text":``,children:a.text??a.label??a.value??``})]})})}),P=(e,t,n,r)=>{let i=e().type;if(i===`textarea`)return f(`textarea`,M(t,n,{className:()=>t().className||l.className.textarea,autocomplete:()=>t().autocomplete,value:()=>t().value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLTextAreaElement&&j(t(),n,`textarea`)}}));if(i===`select`)return f(`select`,M(t,n,{className:()=>t().className||l.className.select,autocomplete:()=>t().autocomplete||`off`,multiple:()=>!!t().multiple,onChange:e=>{let n=e.currentTarget;n instanceof HTMLSelectElement&&j(t(),n,`select`)},children:()=>(t().options||[]).map(e=>{let n=Or(e);return f(`option`,{value:n.value??``,disabled:!!n.disabled,selected:()=>zr(t().value,n.value),children:n.text??n.label??n.value??``})})}));if(i===`radio`)return N(t,n,`radio`);if(i===`checkbox`&&Array.isArray(t().options))return N(t,n,`checkbox`);if(i===`switch`)return f(`label`,{className:()=>{let e=t(),n=l.className;return k(n.switch,e.variant?`is-${e.variant}`:n.switchDefault,e.size?`is-${e.size}`:n.switchSizeMd)},"data-form-switch":()=>t().name||n,for:n,children:[f(`input`,{type:`checkbox`,id:n,name:()=>t().name,value:()=>t().value??`1`,checked:()=>!!t().checked,disabled:()=>l.submitting||!!t().disabled,required:()=>!!t().required,onChange:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&j(t(),n,`switch`)}}),f(`span`,{className:()=>l.className.switchSlider,"data-form-switch-slider":``})]});if(i===`custom`){let n=t();return typeof n.content==`function`?n.content({form:v,field:n,index:r(),item:e()}):n.content}let a=i||`text`;return f(`input`,{...M(t,n,{type:a,className:()=>t().className||l.className.input,autocomplete:()=>t().autocomplete||Rr(a),value:()=>t().value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&j(t(),n,a)}}),checked:()=>{let e=t().checked;return e===void 0?void 0:!!e}})},F=(e,t)=>{let n=()=>e().payload,r=C(n(),t());return f(`div`,{className:()=>l.className.item,"data-form-item":()=>n().name||String(t()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{let e=n();return e.label===!1||e.label===void 0?null:f(`label`,{className:()=>k(l.className.label,Ar(n(),l.validator.rules)?l.className.required:``),"data-form-label":()=>n().name||r,for:r,children:()=>n().label})},f(`div`,{className:()=>l.className.control,"data-form-control":()=>n().name||String(t()),children:[P(e,n,r,t),()=>n().help?f(`div`,{className:`help-block`,"data-form-help":()=>n().name||String(t()),children:()=>n().help}):null]})]})},I=(e,t)=>F(e,t),L=()=>f(`div`,{className:()=>l.className.buttons,style:{justifyContent:s},"data-form-buttons":``,hidden:()=>l.buttons.length===0,children:t({each:()=>l.buttons,key:(e,t)=>`${e.action||e.type||`button`}:${t}`,children:e=>f(`button`,{type:()=>e().type||`button`,className:()=>{let t=e();return k(l.className.button,t.theme?`is-${t.theme}`:``,t.className||``)},"data-action":()=>{let t=e();return t.action||t.type||`button`},disabled:()=>l.submitting||!!e().disabled,children:()=>{let t=e(),n=t.text??t.label??``;return l.submitting&&(t.type===`submit`||t.action===`submit`)?[Rt(),n]:n}})})});return v=Q({name:`Form`,props:n,state:l,actions:{validate:T,reset(){return _?.reset(),u(()=>{l.data=null}),v},collectData:D,requestSubmit(){let e=v.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),v},setFields(e){return U(`fields`,e,`array`,`Form.setFields`),d.fieldIds.clear(),g=new WeakMap,u(()=>{l.fields=Tr(e)}),v},resetFields(){return d.fieldIds.clear(),g=new WeakMap,u(()=>{l.fields=Tr(r.fields)}),v}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:Tr(e.fields)}:{},...Object.hasOwn(e,`buttons`)?{buttons:Er(e.buttons)}:{},...Object.hasOwn(e,`className`)?{className:jr(e.className)}:{},...Object.hasOwn(e,`validator`)?{validator:Pr(e.validator)}:{}}},view:()=>{let e=f(`form`,{className:()=>k(l.className.form,l.vertical?l.className.vertical:l.className.horizontal,l.itemVertical?l.className.itemVertical:l.className.itemHorizontal),id:()=>l.id,"data-form":`root`,"data-form-layout":()=>l.vertical?`vertical`:`horizontal`,"data-form-item-layout":()=>l.itemVertical?`vertical`:`horizontal`,onSubmit:e=>void O(e),onReset:e=>{E(),u(()=>{l.data=null}),l.onReset?.(e,v)},children:[t({each:b,key:S,children:I}),L()]});return a(()=>Mr(e,l.style)),a(()=>{_&&(_.props={...l.validator,onSubmit:null})}),e},onBuild(){w()},onDestroy(){_?.destroy(),_=null,d.fieldIds.clear(),g=new WeakMap}}),v}const Ur={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`},Wr={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},Gr={type:`renderable`},Kr={types:[`plainObject`,`null`,`undefined`]};function $(e){return j(e)?{...e}:{}}function qr(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data),modal:typeof t.modal==`function`||t.modal==null?t.modal:$(t.modal)}}):[]}function Jr(e){return typeof e==`string`?{...Ur,root:[Ur.root,e.trim()].filter(Boolean).join(` `)}:{...Ur,...j(e)?e:{}}}function Yr(e,t){if(typeof e==`string`)return{id:e};if(!j(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:j(n.data)||n.data==null?n.data:void 0}:{id:t}}const Xr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||X()},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=j(e)?e:{};return{back:typeof t.back==`string`?t.back:`Back`,next:typeof t.next==`string`?t.next:`Next`,finish:typeof t.finish==`string`?t.finish:`Finish`,reset:typeof t.reset==`string`?t.reset:`Reset`}}},className:{default:Ur,types:[`object`,`string`],normalize:Jr},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 Zr(e){let t=W(e,Xr,`Flow.props`);return{id:t.id,steps:qr(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 Qr(e={}){let t=Zr(e),n=t.steps,r=new Map;for(let[e,t]of n.entries()){if(U(String(e),t,Wr,`Flow.props.steps`),U(`content`,t.content??null,Gr,`Flow.props.steps.${e}`),r.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);r.set(t.id,e)}let a=(()=>{if(typeof t.initial==`number`){let e=n[t.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof t.initial==`string`){if(!r.has(t.initial))throw Error(`Flow.props.initial step "${t.initial}" does not exist.`);return t.initial}return n[0].id})(),o={},s={};for(let e of n)o[e.id]=$(e.data),Object.assign(s,o[e.id]);let c=i({id:t.id,currentId:a,currentIndex:r.get(a)??0,previousId:null,previousIndex:null,direction:null,history:[a],data:$(s),stepData:$(o),loading:!1,error:null,busyAction:null,version:0}),l={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},d=new Set,p=new Set,m=null,h,g=e=>{if(l.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},_=()=>n[c.currentIndex],v=e=>$(c.stepData[e]),y=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},b=()=>({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:$(c.stepData),currentData:v(c.currentId),currentStep:y(_()),canBack:c.currentIndex>0&&!c.loading,canNext:c.currentIndex<n.length-1&&!c.loading,isLast:c.currentIndex===n.length-1,loading:c.loading,busyAction:c.busyAction,error:c.error}),x=(e=null)=>{let n=b();for(let t of d)t(n,h,e);t.onChange?.(n,h,e)},S=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},C=(e,n,i={})=>(g(`setStepData`),U(`stepId`,e,{type:`string`},`Flow.setStepData`),U(`data`,n,Kr,`Flow.setStepData`),!n||!r.has(e)?h:(u(()=>{c.stepData[e]={...$(c.stepData[e]),...n},t.cache&&Object.assign(c.data,n),c.version+=1}),i.silent||x(),h)),w=e=>(g(`setData`),U(`data`,e,Kr,`Flow.setData`),e?(u(()=>{Object.assign(c.data,e),c.version+=1}),x(),h):h),T=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return l.destroyed?(e(),()=>{}):(p.add(e),()=>p.delete(e))},E=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},D=async(e,t)=>{if(typeof e!=`function`)return;let n=await e(...t);if(l.destroyed)throw E();return n},O=(e={})=>{let t=e.step||_();return{...e,flow:h,step:t,state:c,signal:l.actionController?.signal||null,snapshot:b(),data:$(c.data),currentData:v(t.id),setData:w,setStepData:(e,t)=>C(e,t),getStepData:v,next:e=>h.next(e),back:e=>h.back(e),goTo:(e,t,n)=>h.goTo(e,t,n),addCleanup:T}},k=(e,n=null)=>{u(()=>{c.error=e,c.version+=1}),t.onError?.(e,b(),h,n)},A=(e,t)=>{let n=b();(c.loading!==e||c.busyAction!==t)&&(u(()=>{c.loading=e,c.busyAction=e?t:null,c.version+=1}),x(n))},j=e=>{if(!c.loading)return null;let n=Error(`Flow: action "${e}" ignored while loading.`);if(n.code=`FLOW_BUSY`,t.onBusy?.(e,b(),h),t.busyStrategy===`throw`)throw n;return b()},M=async(e,t,n=!1)=>{let r=!n&&!c.loading;r&&(l.actionController=new AbortController,l.activeAction=e,A(!0,e));try{return await t()}catch(e){if(l.destroyed)return null;throw c.error!==e&&k(e),e}finally{r&&!l.destroyed&&(A(!1,null),l.activeAction=null,l.actionController=null)}},N=()=>({currentId:c.currentId,currentIndex:c.currentIndex,previousId:c.previousId,previousIndex:c.previousIndex,direction:c.direction,history:[...c.history],data:$(c.data),stepData:$(c.stepData),loading:c.loading,busyAction:c.busyAction,error:c.error,version:c.version}),P=e=>{u(()=>{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),S(c.data,e.data),S(c.stepData,e.stepData),c.loading=!0,c.busyAction=e.busyAction,c.error=e.error,c.version=e.version+1})},F=e=>{if(typeof e==`number`){if(!n[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=r.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},I=async(e,n,i,a)=>{let o=b(),s=N();try{if(i&&C(a.id,i,{silent:!0}),a.canLeave&&await D(a.canLeave,[O({direction:n,targetId:e.id})])===!1)throw Error(`Flow: step "${a.id}" blocked leaving.`);if(e.canEnter&&await D(e.canEnter,[O({direction:n,fromId:a.id,step:e})])===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await D(a.onLeave,[O({direction:n,step:a,targetId:e.id})]);let t=c.currentId,s=c.currentIndex;u(()=>{c.previousId=t,c.previousIndex=s,c.currentId=e.id,c.currentIndex=r.get(e.id)??0,c.direction=n,n===`back`?c.history.pop():c.history.push(e.id),c.error=null,c.version+=1}),await D(e.onEnter,[O({direction:n,fromId:t,step:e})]),x(o)}catch(e){throw l.destroyed?e:(t.rollbackOnError&&P(s),k(e,o),e)}},L=async(e,n,r,i)=>{let a=e===`back`?n.onBack:n.onNext,o=e===`back`?t.onBack:t.onNext,s=O({payload:r,targetId:i});return await D(a,[s])??await D(o,[s])??i},R=e=>{let t=b();return{flow:h,snapshot:t,state:c,steps:n.map(y),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>h.next(e),back:e=>h.back(e),goTo:(e,t,n)=>h.goTo(e,t,n),reset:()=>h.reset()}},z=(e,n)=>{let r=t[e];return r===!1?null:typeof r==`function`?()=>c.version>=0?r(R(n)):null:n()},B=()=>{let e=_().content;return typeof e==`function`?e(O()):e??``},V=()=>Q({name:`FlowView`,props:{},state:c,view:()=>f(`div`,{className:t.className.root,id:t.id,role:`group`,"data-flow":`root`,"aria-busy":()=>c.loading?`true`:`false`,children:[f(`div`,{className:t.className.header,"data-flow-header":``,children:z(`renderHeader`,()=>f(`ol`,{className:t.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:n.map((e,n)=>f(`li`,{className:()=>[t.className.step,n===c.currentIndex?t.className.active:``,n<c.currentIndex?t.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(n),"aria-current":()=>n===c.currentIndex?`step`:null,children:f(`button`,{type:`button`,className:t.className.stepButton,disabled:()=>t.linear&&n>c.currentIndex,"aria-current":()=>n===c.currentIndex?`step`:null,onClick:()=>{n!==c.currentIndex&&h.goTo(n)},children:[f(`span`,{className:t.className.stepIndex,"data-flow-step-number":``,children:n+1}),f(`span`,{className:t.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))}))}),f(`div`,{className:t.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>c.loading?`true`:`false`,children:z(`renderBody`,()=>()=>c.version>=0?B():null)}),f(`div`,{className:t.className.footer,"data-flow-footer":``,children:z(`renderFooter`,()=>[t.showReset?f(`button`,{type:`button`,className:[t.className.button,t.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>h.reset(),disabled:()=>c.loading,children:t.text.reset}):null,t.showBack?f(`button`,{type:`button`,className:[t.className.button,t.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void h.back(),disabled:()=>!h.canBack,children:t.text.back}):null,t.showNext?f(`button`,{type:`button`,className:[t.className.button,t.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void h.next(),disabled:()=>c.loading,children:()=>h.isLast?t.text.finish:t.text.next}):null])})]})});return h={props:t,steps:n,state:c,runtime:l,get element(){return m?.element||null},get currentStep(){return _()},get currentData(){return v(c.currentId)},get canBack(){return c.currentIndex>0&&!c.loading},get canNext(){return c.currentIndex<n.length-1&&!c.loading},get isLast(){return c.currentIndex===n.length-1},build(){return g(`build`),l.built?h:(t.render&&(m||=V(),m.build()),l.built=!0,h)},mount(e){return g(`mount`),h.build(),m&&m.mount(e),l.mounted=!!m,h},unmount(){return g(`unmount`),m?.unmount(),l.mounted=!1,h},subscribe(e){if(g(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return d.add(e),e(b(),h,null),()=>d.delete(e)},snapshot:b,async next(e=null){return g(`next`),U(`payload`,e,Kr,`Flow.next`),j(`next`)||M(`next`,async()=>{if(h.isLast)return e&&C(c.currentId,e),await D(t.onFinish,[b(),h]),b();let r=_(),i=n[c.currentIndex+1]?.id,a=Yr(await L(`next`,r,e,i),i);return h.goTo(a.id,a.data??e,{direction:`next`,internal:!0})})},async back(e=null){return g(`back`),U(`payload`,e,Kr,`Flow.back`),j(`back`)||(h.canBack?M(`back`,async()=>{let t=_(),r=n[c.currentIndex-1]?.id,i=Yr(await L(`back`,t,e,r),r);return h.goTo(i.id,i.data??e,{direction:`back`,internal:!0})}):b())},async goTo(e,t=null,r={}){return g(`goTo`),U(`payload`,t,Kr,`Flow.goTo`),(r.internal?null:j(`goTo`))||M(`goTo`,async()=>{let i=F(e),a=n[i],o=_();return a.id===c.currentId?(t&&C(c.currentId,t),b()):(await I(a,r.direction||`go`,t,o),b())},!!r.internal)},setData:w,setStepData:C,getStepData:v,reset(){return g(`reset`),u(()=>{c.currentId=a,c.currentIndex=r.get(a)??0,c.previousId=null,c.previousIndex=null,c.direction=null,c.history.splice(0,c.history.length,a),S(c.data,$(s)),S(c.stepData,$(o)),c.loading=!1,c.busyAction=null,c.error=null,c.version+=1}),x(),h},async finish(e=null){return g(`finish`),U(`payload`,e,Kr,`Flow.finish`),j(`finish`)||M(`finish`,async()=>(e&&C(c.currentId,e),await D(t.onFinish,[b(),h]),b()))},destroy(){if(!l.destroyed){l.destroyed=!0,l.actionController?.abort(),l.actionController=null,l.activeAction=null,m?.destroy(),m=null;for(let e of p)e();p.clear(),d.clear(),l.built=!1,l.mounted=!1,r.clear()}}},h}const $r={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 ei(e){return{...e,text:{...e.text},className:{...e.className}}}function ti(e){return{content:e.content,loading:!1,processing:!1,visible:!1}}function ni(e){return!!e&&typeof e.then==`function`}function ri(e){return Number.isFinite(e)?Math.max(0,e):0}const ii={type:`renderable`},ai={default:{},type:`object`,plain:!0,normalize:e=>{let t=j(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`}}},oi={content:{default:``,...ii},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:ai,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()||X():e??X()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:$r,type:`object`,normalize:e=>({...$r,...e&&typeof e==`object`?e:{}})}},si={content:oi.content,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`}},ci={type:`plainObject`};function li(e){let t=W(e,oi,`Modal`);return{content:t.content,cache:t.cache,ttl:ri(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 ui=0,di=``;function fi(t={}){let n=li(t),r=i(ti(n)),o={initial:ei(n),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},s=new Map,[l,d]=c(!1),[p,h]=c({value:null}),g,v=null,y=null,b=!1,x=0,S=()=>r.processing,C=e=>{if(!n.cache||!o.hasContent||o.contentSource!==e)return!1;let t=ri(n.ttl);return!t||Date.now()-o.updatedAt<=t},T=(e,t)=>{n.cache&&(o.content=t,o.contentSource=e,o.hasContent=!0,o.updatedAt=Date.now())},E=()=>{o.content=null,o.contentSource=null,o.hasContent=!1,o.updatedAt=0},D=()=>{for(let e of s.values())e();s.clear()},O=(e,t,n,r)=>{s.get(e)?.(),t.addEventListener(n,r),s.set(e,()=>t.removeEventListener(n,r))},A=()=>{b||=(ui===0&&(di=document.body.style.overflow,document.body.style.overflow=`hidden`),ui+=1,!0)},j=()=>{b&&=(ui=Math.max(0,ui-1),ui===0&&(document.body.style.overflow=di,di=``),!1)},M=()=>{let e=o.previousActiveElement;o.previousActiveElement=null,e&&document.contains(e)&&e.focus()},N=Lt({elements:()=>[g.element,v],mount:()=>{g.mount(document.body),A()},activate:()=>d(!0),deactivate:()=>d(!1),motion:lt(ft(()=>g.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),ft(()=>v,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{g.unmount(),j(),M()}}),P=()=>{if(r.loading||r.processing){y||=Rt(),v&&y.parentElement!==v&&v.append(y);return}y?.remove(),y=null},F=e=>{r.processing!==e&&u(()=>{r.processing=e})},I=()=>{r.visible&&N.phase!==`leaving`&&F(!1)},L=(e=r.content)=>{if(C(e)){x+=1,u(()=>{h({value:o.content}),r.loading=!1});return}let t=++x;if(typeof e!=`function`){E(),u(()=>{h({value:e}),r.loading=!1});return}let n;try{n=e(g)}catch(e){console.error(`Modal.content error:`,e),u(()=>{h({value:null}),r.loading=!1});return}if(!ni(n)){T(e,n),u(()=>{h({value:n}),r.loading=!1});return}u(()=>{r.loading=!0,h({value:null})}),Promise.resolve(n).then(n=>{g.runtime.destroyed||t!==x||(T(e,n),u(()=>{h({value:n})}))}).catch(e=>{g.runtime.destroyed||t!==x||(console.error(`Modal.content error:`,e),u(()=>{h({value:null})}))}).finally(()=>{!g.runtime.destroyed&&t===x&&u(()=>{r.loading=!1})})},R=()=>{if(S())return;let e;try{e=n.onConfirm?.(g)}catch(e){console.error(`Modal.onConfirm error:`,e);return}ni(e)&&(F(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{g.runtime.destroyed||I()}))},z=()=>{if(S())return;let e;try{e=n.onCancel?.(g)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!ni(e)){g.hide();return}F(!0),Promise.resolve(e).then(()=>{g.runtime.destroyed||g.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{g.runtime.destroyed||I()})},B=e=>{if(!v)return;let t=J(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,v).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),v.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())},V=()=>{if(!v)return;let e=q(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,v);e?e.focus():(v.setAttribute(`tabindex`,`-1`),v.focus())},H=()=>{let e=g.element;!e||!v||(D(),O(`root`,e,`click`,t=>{n.bgClose&&!S()&&t.target===e&&g.hide()}),O(`dialog`,v,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?z():t===`confirm`&&R()}),O(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!r.visible||(e.key===`Escape`&&n.escClose&&!S()?(e.preventDefault(),g.hide()):e.key===`Tab`&&B(e))}))},ee=()=>{if(N.phase===`visible`||N.phase===`entering`)return;if(!g.element)throw Error(`Modal.show: build() must be called before show().`);n.onShow?.(g),o.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=N.enter();H(),V(),e.then(e=>{e&&!g.runtime.destroyed&&n.onShown?.(g)})},te=()=>{N.phase!==`hidden`&&N.phase!==`leaving`&&(n.onHide?.(g),D(),x+=1,N.leave().then(e=>{e&&!g.runtime.destroyed&&(u(()=>{r.loading=!1,r.processing=!1,n.cache||h({value:null})}),n.onHidden?.(g))}))};return g=Q({name:`Modal`,props:n,state:r,actions:{show(){if(!g.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return g.setState(`visible`,!0),g},hide(){return u(()=>{r.visible=!1}),g},reset(){return g.setState({content:o.initial.content,loading:!1,processing:!1}),E(),h({value:null}),g}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){U(`state`,e,ci,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(si,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);U(t,e[t],si[t],`Modal.setState`)}},view:()=>{v=f(`div`,{className:k(n.className.modal,n.fullscreen?`is-fullscreen`:``),id:n.id,role:`document`,"data-modal-dialog":n.id,...n.style?{style:n.style}:{},"data-mount":()=>l()?`true`:`false`,children:[n.header?f(`div`,{className:n.className.header,children:()=>r.loading?null:[f(`div`,{className:n.className.title,id:`${n.id}_title`,"aria-label":n.text.title,children:n.text.title}),n.showClose?f(`button`,{type:`button`,className:k(n.className.button,n.className.closeBtn),"data-action":`close`,"aria-label":e(`Close`,_),disabled:S,children:w(`close`)}):null]}):null,f(`div`,{className:n.className.body,"data-modal-body":``,children:()=>p().value}),n.footer?f(`div`,{className:n.className.footer,children:()=>r.loading?null:[n.showCancel?f(`button`,{type:`button`,className:k(n.className.button,n.className.cancelBtn),"data-action":`cancel`,disabled:S,children:n.text.cancel}):null,f(`button`,{type:`button`,className:k(n.className.button,n.className.confirmBtn),"data-action":`confirm`,disabled:S,children:n.text.confirm})]}):null]});let t=Vt({className:n.className.layout,position:n.position,component:`modal`,labelledby:n.header?`${n.id}_title`:``,content:v});return t.setAttribute(`data-mount`,`false`),n.header||t.setAttribute(`aria-label`,n.text.title||`Modal`),a(()=>{t.setAttribute(`data-mount`,l()?`true`:`false`)}),a(P),a(()=>{let e=r.visible;m(()=>e?ee():te())}),a(()=>{let e=r.visible,t=r.content;m(()=>{e?L(t):x+=1})}),t},onDestroy(){let e=N.phase!==`hidden`;e&&n.onHide?.(g),N.cancel(),D(),j(),M(),y?.remove(),y=null,v=null,e&&n.onHidden?.(g)}}),g}const pi={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`},mi={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:pi,type:`object`,normalize:e=>({...pi,...e&&typeof e==`object`?e:{}})}},hi={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`}},gi={data:{type:`array`},loading:{type:`boolean`},index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function _i(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function vi(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function yi(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function bi(e){return Array.isArray(e)?yi(e):e}function xi(e={}){let t=W(e,mi,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:bi(t.data),className:{...t.className}}}function Si(e={}){let n=xi(e),r=i({data:yi(Array.isArray(n.data)?n.data:[]),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),s=Y(),c=new WeakMap,l=new Set,d,p=null,m=[],h=()=>[],g=()=>[],_=0,v=null,y=null,b=[],x=null,S=!1,C=!1,T=!1,E=!1,D=e=>(c.has(e)||c.set(e,X()),c.get(e)),O=e=>{let t=e.map((e,t)=>(U(String(t),e,hi,`Swiper.state.data`),{...e,blank:e.blank!==!1,index:t,key:D(e)}));return t.some(e=>e.sort!=null)?t.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):t},A=e=>{let t=e.map((e,t)=>({item:e,index:t,clone:null,key:`real:${e.key}:${!!e.url}`}));if(!n.loop||e.length<=1)return t;let r=e[0],i=e[e.length-1];return[{item:i,index:e.length-1,clone:`last`,key:`clone:last:${i.key}:${!!i.url}`},...t,{item:r,index:0,clone:`first`,key:`clone:first:${r.key}:${!!r.url}`}]},j=()=>h().length,M=()=>g().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},P=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},F=()=>{m=p?J(`[data-swiper-slide]`,p):[]},I=()=>{for(let e of l)e();l.clear()},L=()=>{let e=d.element;if(!e)return;let t=e.clientWidth||e.offsetWidth;(t>0||!e.isConnected||r.width===0)&&u(()=>{r.width=t})},R=()=>!!d.element?.isConnected&&r.width>0,z=()=>(L(),R()),B=(e,t=!0)=>{let i=vi(e),a=-i*r.width,o=t&&n.speed>0&&r.width>0&&r.transform!==a;u(()=>{r.trackIndex=i,r.index=N(i),r.transform=a,r.animating=o})},V=()=>{let e=[r.trackIndex];r.trackIndex>0&&e.push(r.trackIndex-1),r.trackIndex<m.length-1&&e.push(r.trackIndex+1);for(let t of e){let e=m[t]?q(`img[data-lazy]`,m[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,l.delete(r)};l.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())}},H=()=>{v&&=(clearInterval(v),null)},ee=()=>{d.runtime.destroyed||v||j()<=1||z()&&(v=setInterval(()=>d.next(),Math.max(n.delay,16)))},te=()=>{n.autoplay&&!v&&!d.runtime.destroyed&&ee()},ne=()=>{H(),n.autoplay&&ee()},re=e=>{b.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),b.length>5&&b.shift()},ie=()=>b.length?{x:b[b.length-1].x-b[0].x,y:b[b.length-1].y-b[0].y}:{x:0,y:0},ae=(e=!0)=>{let t=-r.trackIndex*r.width,n=e&&r.transform!==t;S=!1,C=!1,T=!1,b=[],x=null,u(()=>{r.transform=t,r.animating=n}),te()},oe=(e,t)=>{r.animating||!z()||(b=[],re(e),x=t,S=!0,C=!1,T=!1,E=!1,H(),u(()=>{r.animating=!1}))},se=(e,t)=>{if(!S||C||r.animating)return;re(e);let i=ie(),a=Math.abs(i.x),o=Math.abs(i.y);if(!(a<6&&o<6)){if(!T)if(Math.atan2(o,a)*180/Math.PI<n.touchAngle)T=!0,E=_i(x);else{C=!0,ae(!0);return}t.preventDefault(),u(()=>{r.transform=-r.trackIndex*r.width+i.x*n.touchRatio})}},ce=()=>{if(!S)return;if(S=!1,!T||r.width<=0){ae(!0);return}let e=b.length?b[b.length-1].time-b[0].time:0,t=ie().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))),d.slideToTrack(r.trackIndex+a*(t>0?-1:1)),b=[],te()},le=e=>{e.target!==p||!(`propertyName`in e)||e.propertyName!==`transform`||(u(()=>{r.animating=!1}),!(!n.loop||j()<=1)&&(r.trackIndex===0?B(j(),!1):r.trackIndex===M()-1&&B(1,!1)))},W=()=>{let e=d.element;!e||!p||(s.clear(),s.on(`touchstart`,p,`touchstart`,e=>{let t=e.touches[0];t&&oe(t,e.target)},{passive:!0}),s.on(`touchmove`,p,`touchmove`,e=>{let t=e.touches[0];t&&se(t,e)},{passive:!1}),s.on(`touchend`,p,`touchend`,e=>{let t=e.changedTouches[0];t&&re(t),ce()}),s.on(`touchcancel`,window,`touchcancel`,()=>ae(!0)),s.on(`mousedown`,p,`mousedown`,e=>{let t=e;t.button===0&&(oe(t,t.target),p?.style.setProperty(`cursor`,`grabbing`))}),s.on(`mousemove`,window,`mousemove`,e=>{let t=e;S&&t.buttons===1&&se(t,e)}),s.on(`mouseup`,window,`mouseup`,e=>{S&&(p?.style.setProperty(`cursor`,`grab`),re(e),ce())}),s.on(`click`,p,`click`,e=>{!E||!n.preventClick||(e.preventDefault(),e.stopPropagation(),E=!1)},{capture:!0}),s.on(`dragstart`,p,`dragstart`,e=>e.preventDefault()),s.on(`transitionend`,p,`transitionend`,le),s.on(`resize`,window,`resize`,ue),s.on(`mouseenter`,e,`mouseenter`,H),s.on(`mouseleave`,e,`mouseleave`,te),s.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`?d.prev():n.dataset.action===`next`?d.next():n.dataset.swiperBullet!=null&&d.slideTo(Number(n.dataset.swiperBullet)))}))},ue=()=>{if(!d.runtime.built)return;H(),I(),F();let e=Math.min(r.index,Math.max(0,j()-1));L(),B(P(e),!1),n.lazyload&&V(),n.autoplay&&R()&&te()},de=xt(ue),fe=()=>{y==null&&typeof requestAnimationFrame==`function`&&(y=requestAnimationFrame(()=>{y=null,!d.runtime.destroyed&&d.element?.isConnected&&ue()}))},pe=async()=>{if(typeof n.data!=`function`)return;let e=++_;u(()=>{r.loading=!0});try{let t=await Promise.resolve(n.data(d));if(d.runtime.destroyed||e!==_)return;U(`data`,t,{type:`array`},`Swiper.data`);let i=yi(t);O(i),u(()=>{r.data=i})}finally{!d.runtime.destroyed&&e===_&&u(()=>{r.loading=!1})}},G=()=>{pe().catch(e=>{d.runtime.destroyed||console.error(`Swiper.data error:`,e)})},me=e=>f(e().item.url?`a`:`div`,{className:n.className.slide,href:()=>e().item.url||void 0,target:()=>e().item.url?e().item.blank?`_blank`:`_self`:void 0,"data-swiper-slide":()=>String(e().index),"data-swiper-index":()=>e().clone?null:String(e().index),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${e().index+1}`,children:()=>{let{item:t,index:r}=e(),i={swiper:d,item:t,index:r};return t.children==null?[t.image?f(`img`,{className:n.className.image,alt:t.title||``,loading:`lazy`,...n.lazyload?{"data-lazy":t.image}:{src:t.image}}):null,t.title?f(`span`,{className:n.className.title,children:t.title}):null]:typeof t.children==`function`?t.children(i):t.children}});return d=Q({name:`Swiper`,props:n,state:r,actions:{slideTo(e){d.slideToTrack(P(e))},slideToTrack(e){if(!d.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(r.animating||!m.length||!z())return;let t=n.loop?Math.max(0,Math.min(e,m.length-1)):Math.max(0,Math.min(e,j()-1));B(t,!0),n.lazyload&&V()},next(){r.animating||d.slideToTrack(r.trackIndex+1)},prev(){r.animating||d.slideToTrack(r.trackIndex-1)},play:ee,pause:H,resume:te,restartAutoplay:ne},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:yi(e.data)}:{}}},validateStatePatch(e){U(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(gi,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);U(t,e[t],gi[t],`Swiper.setState`)}Array.isArray(e.data)&&O(e.data)},view:()=>{h=o(()=>O(r.data)),g=o(()=>A(h()));let e=()=>{let e=Rt();return e.setAttribute(`data-swiper-loading`,``),e};p=f(`div`,{className:n.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>r.loading?e():t({each:g,key:e=>e.key,children:me})});let i=f(`div`,{id:n.id||X(),className:n.className.root,"data-swiper":`root`,"data-status":()=>r.loading?`loading`:`loaded`,children:[p,n.pagination?f(`div`,{className:k(n.className.pagination,n.className.paginationHorizontal,n.className.paginationClickable,n.className.paginationBulletGroup),"data-swiper-pagination":``,children:t({each:h,key:e=>e.key,children:(e,t)=>f(`button`,{type:`button`,className:()=>k(n.className.indicator,n.className.bullet,r.index===t()?n.className.active:``),"data-swiper-bullet":()=>String(t()),"aria-label":()=>`Go to slide ${t()+1}`,"aria-current":()=>r.index===t()?`true`:null})})}):null,n.navigation?f(`button`,{type:`button`,className:()=>k(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:w(`arrow-left`)}):null,n.navigation?f(`button`,{type:`button`,className:()=>k(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:w(`arrow-right`)}):null]});return a(()=>{p?.style.setProperty(`transform`,`translate3d(${r.transform}px, 0, 0)`),p?.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`)}),a(()=>{(h().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||r.data.length===0)&&de.schedule()}),i},onBuild(e){!e.element||!p||(p.setAttribute(`aria-live`,`polite`),F(),W(),L(),B(P(r.index),!1),n.lazyload&&V(),n.autoplay&&R()&&ee(),e.own(()=>s.clear()),G(),fe())},onMount(){ue(),fe()},onDestroy(){H(),de.dispose(),_+=1,I(),y!=null&&cancelAnimationFrame(y),y=null,p=null,m=[]}}),Object.defineProperties(d,{realCount:{enumerable:!0,get:j},realIndex:{enumerable:!0,get:()=>N()}}),d}const Ci={root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`panel-list`,panel:`panel-item`,dragging:`dragging`},wi={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||X():e??X()},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:Ci,type:`object`,normalize:e=>({...Ci,...e&&typeof e==`object`?e:{}})}},Ti={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},Ei={data:wi.data,active:wi.active,disabled:wi.disabled};function Di(e,t,n=`Tabs.data`){U(String(t),e,Ti,n);let r=(typeof e.name==`string`?e.name.trim():``)||X();return{...e,name:r}}function Oi(e,t=`Tabs.data`){U(`data`,e,Ei.data,t);let n=new Set;return e.map((e,r)=>{let i=Di(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 ki(e){return Array.isArray(e)?[...e]:e}function Ai(e){let t=W(e,wi,`Tabs.props`);return{id:t.id,direction:t.direction,active:t.active,disabled:ki(t.disabled),onChange:t.onChange,data:Oi(t.data,`Tabs.props.data`),className:t.className}}function ji(e){return typeof e==`number`&&e>0?e:0}function Mi(e={}){let n=Ai(e),r=i({data:n.data,active:n.active,disabled:n.disabled,draggable:!1,dragging:!1,loading:!1}),s=Y(),l=Et(),d=Et(),m=Dt(),h=Dt(),g=new Map,_=new Map,v,y=0,b=!1,x=0,S=0,C=0,w=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),T=()=>{let e=w(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},E=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},D=()=>{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`)))},O=e=>D().includes(e),A=e=>E()===e,j=o(()=>r.data),M=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=n.direction===`left`||n.direction===`right`?t.scrollHeight>e.clientHeight+5:t.scrollWidth>e.clientWidth+5;r.draggable!==i&&u(()=>{r.draggable=i})},N=xt(M),P=()=>{let e=l.current;if(!e)return;let t=C,r=performance.now(),i=n.direction===`left`||n.direction===`right`,a=n=>{let o=n-r;r=n,t*=.92,!(Math.abs(t)<.3)&&(i?e.scrollTop+=t*o*.05:e.scrollLeft+=t*o*.05,x=requestAnimationFrame(a))};x=requestAnimationFrame(a)},F=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=0,a=0,o=0,c=!1,f=0,p=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},m=t=>{r.draggable&&(!(t instanceof MouseEvent)&&!(t instanceof TouchEvent)||(b=!0,u(()=>{r.dragging=!0}),i=p(t),o=i,a=n.direction===`left`||n.direction===`right`?e.scrollTop:e.scrollLeft,C=0,cancelAnimationFrame(x)))},h=t=>{if(!b||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let r=p(t);f=i-r,C=o-r,o=r,!c&&(c=!0,requestAnimationFrame(()=>{c=!1,n.direction===`left`||n.direction===`right`?e.scrollTop=a+f:e.scrollLeft=a+f}))},g=()=>{b&&(b=!1,u(()=>{r.dragging=!1}),P())};s.on(`drag:mousedown`,t,`mousedown`,m),s.on(`drag:touchstart`,t,`touchstart`,m,{passive:!0}),s.on(`drag:mousemove`,window,`mousemove`,h,{passive:!1}),s.on(`drag:touchmove`,window,`touchmove`,h,{passive:!1}),s.on(`drag:mouseup`,window,`mouseup`,g),s.on(`drag:touchend`,window,`touchend`,g)},I=async e=>{if(!v.runtime.built)throw Error(`Tabs.activate: call build() first.`);let t=w(e),i=r.data[t];if(!i)return;let a=i.name;O(a)||A(a)||(u(()=>{r.active=e}),await _.get(a)?.(),await Promise.resolve(n.onChange?.(t,a,m.get(a),h.get(a))))},L=(e,t)=>{let i=e().name,o=e().content,[s,l]=c(typeof o==`function`?null:o),[d,m]=c(!1),b=o,x=0,S=null,C=()=>({tabs:v,item:e(),index:t(),name:i}),w=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){l(n);return}let a=t.cache?g.get(i):null,o=ji(t.ttl);if(a&&(!o||Date.now()-a.updatedAt<=o)){l(a.content);return}if(S)return S;let s=++x;y+=1;let c=y;m(!0),u(()=>{r.loading=!0});let d=Promise.resolve().then(()=>n(C())).then(t=>{s!==x||v.runtime.destroyed||(e().cache&&g.set(i,{content:t,updatedAt:Date.now()}),l(t))}).finally(()=>{s===x&&m(!1),c===y&&!v.runtime.destroyed&&u(()=>{r.loading=!1}),S===d&&(S=null)});return S=d,d};return _.set(i,w),p(()=>{g.delete(i),_.delete(i)}),a(()=>{let t=e().content;t!==b&&(b=t,x+=1,S=null,g.delete(i),l(typeof t==`function`?null:t)),A(i)&&w()}),f(`div`,{className:n.className.panel,"data-tabs-panel":i,role:`tabpanel`,"aria-hidden":()=>A(i)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(d()),hidden:()=>!A(i),ref:h.bind(i),children:()=>{if(d())return Rt(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(C()):e}})},R=(e,t)=>{let r=e().name;return f(`div`,{className:n.className.tab,"data-tabs-tab":r,role:`tab`,"aria-selected":()=>A(r)?`true`:`false`,"aria-disabled":()=>O(r)?`true`:`false`,ref:m.bind(r),children:e().title})};return v=Q({name:`Tabs`,props:n,state:r,actions:{activate:I},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Oi(e.data,`Tabs.setState.data`)}:{},...Object.hasOwn(e,`disabled`)&&Array.isArray(e.disabled)?{disabled:ki(e.disabled)}:{}}},validateStatePatch(e){U(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Ei,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;U(t,e[t],Ei[n],`Tabs.setState`)}},view:()=>(a(()=>{let e=r.data.length;return N.schedule(),e}),f(`div`,{className:n.className.root,id:n.id,"data-tabs":`root`,"data-tabs-direction":n.direction,children:[f(`div`,{className:n.className.wrap,"data-tabs-wrap":``,ref:l.set,children:f(`nav`,{className:()=>k(n.className.list,r.dragging&&n.className.dragging),"data-tabs-list":``,ref:d.set,children:t({each:j,key:e=>e.name,children:(e,t)=>R(e,t)})})}),f(`div`,{className:n.className.panelWrap,"data-tabs-panel-wrap":``,children:t({each:j,key:e=>e.name,children:(e,t)=>L(e,t)})})]})),onBuild(e){let t=e.element;t&&(s.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!O(t)&&I(t)}),s.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(S),S=requestAnimationFrame(M)}),F(),e.own(()=>s.clear()),N.schedule(),_.get(T().name||``)?.())},onMount(){N.schedule()},onDestroy(){y+=1,N.dispose(),cancelAnimationFrame(x),cancelAnimationFrame(S),g.clear(),_.clear(),m.clear(),h.clear()}}),Object.defineProperties(v,{current:{enumerable:!0,get:T},activeIndex:{enumerable:!0,get:()=>T().index},disabledNames:{enumerable:!0,get:D}}),v}const Ni={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},Pi={top:`translateY(-100%)`,right:`translateX(100%)`,bottom:`translateY(100%)`,left:`translateX(-100%)`},Fi={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()||X():e??X()},className:{default:Ni,type:`object`,normalize:e=>({...Ni,...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`]}},Ii={content:Fi.content,resolvedContent:{type:`renderable`},visible:{type:`boolean`},loading:{type:`boolean`}};function Li(e){return e>0?e:0}function Ri(e){let t=W(e,Fi,`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 zi=0,Bi=``;function Vi(e){U(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Ii,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;U(t,e[t],Ii[n],`Offcanvas.setState`)}}function Hi(e={}){let t=Ri(e),n=i({content:t.content,resolvedContent:typeof t.content==`function`?null:t.content,visible:!1,loading:!1}),r={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},o=Y(),s=Et(),c,l=!1,p=()=>{!t.bodyOverflow||l||(zi===0&&(Bi=document.body.style.overflow,document.body.style.overflow=`hidden`),zi+=1,l=!0)},h=()=>{l&&=(zi=Math.max(0,zi-1),zi===0&&(document.body.style.overflow=Bi,Bi=``),!1)},g=ft(()=>c.element,{keyframes:[{transform:Pi[t.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),_=Lt({elements:()=>[s.current,c.element],mount:()=>{let e=s.current;e&&!e.isConnected&&d(document.body,e),c.mount(document.body),p()},activate:()=>{n.visible=!0},deactivate:()=>{n.visible=!1},motion:lt(...t.animate===`slide`?[g]:[],ft(()=>s.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{s.current?.remove(),c.unmount(),h()}}),v=()=>{r.cache={content:null,hasContent:!1,updatedAt:0}},y=()=>{if(!t.cache||!r.cache.hasContent)return!1;let e=Li(t.ttl);return!e||Date.now()-r.cache.updatedAt<=e},b=async()=>{let e=n.content;if(typeof e!=`function`){r.contentLoadId+=1,u(()=>{n.resolvedContent=e,n.loading=!1});return}if(y()){r.contentLoadId+=1,u(()=>{n.resolvedContent=r.cache.content,n.loading=!1});return}let i=++r.contentLoadId;u(()=>{n.loading=!0,n.resolvedContent=null});try{let a=await Promise.resolve(e(c));if(c.runtime.destroyed||i!==r.contentLoadId)return;t.cache&&(r.cache={content:a,hasContent:!0,updatedAt:Date.now()}),u(()=>{n.resolvedContent=a})}finally{!c.runtime.destroyed&&i===r.contentLoadId&&u(()=>{n.loading=!1})}};return c=Q({name:`Offcanvas`,props:t,state:n,actions:{async show(){if(!c.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(n.visible)return;await Promise.resolve(t.onShow?.(c));let e=_.enter(),r=b();await e&&!c.runtime.destroyed&&t.onShown?.(c),await r},async hide(){if(!c.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!n.visible)return;let e=t.onHide?.(c);e&&await e,r.contentLoadId+=1,u(()=>{n.loading=!1}),await _.leave()&&t.onHidden?.(c)}},validateStatePatch:Vi,view(e){let i=t.overlay?f(`div`,{ref:s.set,className:t.className.overlay,"data-offcanvas-overlay":t.id,"data-mount":()=>n.visible?`true`:`false`,style:t.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{t.bgClose&&c.hide()}}):null;return i&&e.own(()=>i.remove()),a(()=>{let e=n.content;U(`content`,e,Ii.content,`Offcanvas.state`),v(),typeof e==`function`?(n.resolvedContent=null,m(()=>n.visible)&&b()):(r.contentLoadId+=1,n.resolvedContent=e,n.loading=!1)}),f(`div`,{className:t.className.root,id:t.id,role:`dialog`,"aria-modal":t.overlay?`true`:`false`,"aria-expanded":()=>String(n.visible),"data-mount":()=>n.visible?`true`:`false`,"data-offcanvas":`root`,"data-direction":t.direction,"data-animate":t.animate,onClick:e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-action]`);(t?.dataset.action===`close`||t?.dataset.action===`cancel`)&&c.hide()},children:f(`div`,{className:t.className.content,"data-offcanvas-content":t.id,children:()=>n.loading?Rt():typeof n.resolvedContent==`function`?n.resolvedContent(c):n.resolvedContent})})},onBuild(e){t.escClose&&o.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&n.visible&&c.hide()}),e.own(()=>o.clear())},onDestroy(){_.cancel(),r.contentLoadId+=1,s.current?.remove(),h()}}),c}const Ui={size:10,current:1},Wi={sibling:1,boundary:1},Gi={root:`j-pagination`,list:`pagination`,item:`item`,more:`more`,button:`j-button is-icon is-ghost`,current:`j-button is-icon is-active`,loading:`animate-spin`},Ki={default:0,type:`number`,finite:!0,min:0},qi={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},Ji={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},Yi={total:Ki,page:{default:()=>({...Ui}),factory:!0,normalize:e=>({...Ui,...e&&typeof e==`object`?e:{}}),...qi},count:{default:()=>({...Wi}),factory:!0,normalize:e=>({...Wi,...e&&typeof e==`object`?e:{}}),...Ji},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:Gi,type:`object`,normalize:e=>({...Gi,...e&&typeof e==`object`?e:{}})}},Xi={total:Ki,page:qi,count:Ji,locked:{type:`boolean`}};function Zi(e,t,n){return Math.min(Math.max(e,t),n)}function Qi(e,t){return Math.max(1,Math.ceil(e/t))}function $i(e){return{size:e.size,current:e.current}}function ea(e){return{sibling:e.sibling,boundary:e.boundary}}function ta(e={}){let t=W(e,Yi,`Pagination.props`),n=Qi(t.total,t.page.size);return{...t,page:{size:t.page.size,current:Zi(t.page.current,1,n)},count:ea(t.count),className:{...t.className}}}function na(e){return{type:`more`,key:e}}function ra(e){return{type:`page`,key:`page-${e}`,page:e}}function ia(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function aa(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 ia(1,t).map(ra);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?ra(t.page+1):na(`more-${t.page}-${e}`)),s.push(ra(e))}return s}function oa(e){if(e.type!==`page`)throw Error(`Pagination.itemView: expects page item.`);return e}function sa(e={}){let n=ta(e),r=i({total:n.total,page:$i(n.page),count:ea(n.count),locked:!1}),s=0,c,l=o(()=>Qi(r.total,r.page.size)),d=()=>n.lock&&r.locked,p=()=>d()||r.page.current<=1,m=()=>d()||r.page.current>=l(),h=o(()=>aa(r.page.current,l(),r.count)),g=e=>{n.lock&&!c.runtime.destroyed&&e===s&&u(()=>{r.locked=!1})},_=e=>{if(c.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!c.runtime.built)throw Error(`Pagination.go: call build() first.`);if(U(`page`,e,{type:`number`,integer:!0},`Pagination.go`),d())return c;let t=Zi(e,1,l());if(t===r.page.current)return c;let i=n.lock&&typeof n.onChange==`function`,a=i?++s:s;if(u(()=>{r.page.current=t,i&&(r.locked=!0)}),n.onChange){let e;try{e=n.onChange(t,c)}catch(e){throw g(a),e}if(i&&e&&typeof e.then==`function`){let t=()=>g(a);Promise.resolve(e).then(t,t)}else g(a)}return c},v=e=>{let t=e===`prev`?p:m;return f(`li`,{className:n.className.item,"data-pagination-control":e,children:f(`button`,{className:n.className.button,type:`button`,"data-page-action":e,"aria-label":e===`prev`?`Go to previous page`:`Go to next page`,"aria-disabled":()=>t()?`true`:`false`,tabindex:()=>t()?`-1`:null,disabled:t,onClick:()=>{t()||_(r.page.current+(e===`prev`?-1:1))},children:w(e===`prev`?`arrow-left`:`arrow-right`)})})},y=e=>{if(e().type===`more`)return f(`li`,{className:()=>k(n.className.item,e().type===`more`?n.className.more:``),"data-pagination-more":()=>e().type===`more`?e().key:null,children:f(`span`,{className:n.className.button,children:w(`more`)})});let t=()=>oa(e()).page,i=()=>t()===r.page.current;return f(`li`,{className:()=>k(n.className.item,e().type===`more`?n.className.more:``),"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:f(`button`,{className:()=>i()?n.className.current:n.className.button,type:`button`,"data-page":()=>String(t()),"data-current-page":()=>i()?String(t()):null,"aria-current":()=>i()?`page`:null,"aria-label":()=>i()?`Page ${t()}, current page`:`Go to page ${t()}`,"aria-disabled":()=>d()||i()?`true`:`false`,tabindex:()=>d()||i()?`-1`:null,disabled:()=>d()||i(),onClick:()=>{let e=t();!d()&&!i()&&_(e)},children:()=>d()&&i()?f(`i`,{className:n.className.loading,children:w(`loader`)}):String(t())})})};return c=Q({name:`Pagination`,props:n,state:r,actions:{go:_},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&j(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&j(t.count)&&(t.count={...r.count,...t.count}),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(Xi,t))throw Error(`Pagination.setState: "${t}" is not supported.`);let n=t;U(t,e[t],Xi[n],`Pagination.setState`)}},view:()=>(a(()=>{let e=Zi(r.page.current,1,l());e!==r.page.current&&(r.page.current=e)}),f(`div`,{className:n.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:f(`ul`,{className:n.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[v(`prev`),t({each:h,key:e=>e.key,children:e=>y(e)}),v(`next`)]})}))}),Object.defineProperty(c,"pageCount",{enumerable:!0,get:l}),c}const ca={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`},la={type:`object`,validate:_a,message:`expects { title, id?, url?, target?, classes?, children? }.`},ua={type:`array`,items:la},da={type:{default:void 0,types:[`string`,`undefined`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||X():e??X()},data:{default:[],type:`array`,normalize:va,items:la},backText:{default:e(`b`,_),type:`string`},className:{default:ca,type:`object`,normalize:e=>({...ca,...e&&typeof e==`object`?e:{}})}},fa={data:ua,activeKeys:{type:`array`,items:`string`}};function pa(e={}){let t=W(e,da,`Menu.props`);return{...t,data:va(t.data),className:{...t.className}}}function ma(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function ha(e){return`menu-item-${e??X()}`}function ga(e){return typeof e==`string`?e.trim():``}function _a(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.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(_a))}function va(e){return Array.isArray(e)?e.map(e=>{U(`item`,e,la,`Menu.data`);let t={...e};return Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=va(t.children)),t}):[]}function ya(e={}){let n=pa(e),r=i({data:va(n.data),activeKeys:[]}),a=new WeakMap,o=Y(),s,c=e=>e.id==null?(a.has(e)||a.set(e,X()),a.get(e)):String(e.id),l=e=>r.activeKeys.includes(e),d=e=>{u(()=>{r.activeKeys=n.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},p=e=>{u(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},m=e=>{u(()=>{r.activeKeys=l(e)?[]:[e]})},h=e=>f(`li`,{className:n.className.backItem,"data-menu-back":``,children:f(`a`,{className:n.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),p(e)},children:[f(`span`,{className:n.className.backIcon,children:w(`arrow-left`)}),f(`span`,{className:n.className.text,children:n.backText})]})}),g=(e,r=!1,i)=>f(`ul`,{className:r?n.className.list:n.className.subMenu,...r?{id:n.id}:{},"data-menu-list":r?`root`:`sub`,children:[t({each:()=>n.type===`mobile`&&i&&l(i)?[i]:[],key:e=>e,children:e=>h(e())}),t({each:e,key:e=>c(e),children:e=>{let t=c(e());return f(`li`,{className:()=>{let r=e();return k(n.className.item,r.children?.length?n.className.hasChildren:``,...ma(r.classes),l(t)?n.className.active:``)},id:()=>e().id==null?`menu-item-${t}`:ha(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>e().children?.length?``:null,onClick:r=>{n.type===`mobile`&&r.target===r.currentTarget&&e().children?.length&&d(t)},children:[()=>{let r=e(),i=!!r.children?.length,a=ga(r.url);return!i&&!a?f(`span`,{className:n.className.link,"data-menu-link":``,children:r.title}):f(`a`,{className:n.className.link,href:a,target:r.target,"data-menu-link":``,onClick:e=>{i&&(n.type===`mobile`||n.type===`bottom`)&&(e.preventDefault(),n.type===`bottom`?m(t):d(t))},children:r.title})},()=>e().children?.length?g(()=>e().children||[],!1,t):null]})}})]});return s=Q({name:`Menu`,props:n,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`data`)&&(t.data=va(t.data)),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(fa,t))throw Error(`Menu.setState: "${t}" is not supported.`);let n=t;U(t,e[t],fa[n],`Menu.setState`)}},view:()=>(U(`data`,r.data,ua,`Menu`),f(`nav`,{className:n.className.root,"data-menu":`root`,"data-menu-type":n.type,children:g(()=>r.data,!0)})),onBuild(e){n.type===`bottom`&&(o.on(`outside`,document,`click`,t=>{let n=t.target;!(n instanceof Node)||e.element?.contains(n)||u(()=>{r.activeKeys=[]})}),e.own(()=>o.clear()))}}),s}export{tt as Toast,O as addIcons,J as all,ot as checkModernBrowser,rt as copy,vr as createAccordion,pt as createCollapseTransition,qt as createDrop,Et as createElementRef,Y as createEventManager,Qr as createFlow,Hr as createForm,Dt as createKeyedElementRefs,Rt as createLoading,ya as createMenu,fi as createModal,lt as createMotionGroup,Hi as createOffcanvas,Ot as createOwnedView,sa as createPagination,hn as createParabola,Vt as createPopup,Lt as createPresence,xt as createScheduledTask,Tt as createStateSync,xn as createSticky,Si as createSwiper,Mi as createTabs,ln as createTheme,ar as createToc,Qt as createTooltip,ft as createTransition,Yn as createValidator,Q as defineComponent,D as getRegistedIconPath,St as getStoreVersion,R as getType,w as icon,T as iconHtml,E as iconMarkup,P as isDomElementValue,N as isDomNodeValue,G as isElement,F as isHtmlElementValue,nt as isMobile,at as isModernBrowser,M as isNilValue,pe as isNode,j as isPlainObject,xe as isRenderableContent,I as isRenderablePrimitive,L as isRenderableValue,Se as lazyRender,De as listen,ct as postJson,q,X as randomId,Qn as removeComponentPlugin,be as requireContainer,ye as resolveContainer,K as resolveElement,ve as resolveNode,_e as resolveNodeList,W as resolveProps,st as restUrl,wt as stateSnapshot,Ae as timer,Ct as trackStoreVersion,Zn as useComponentPlugin,Oe as uuid,U as validateParam,It as waitForMotion};
1
+ import{t as e}from"vanilla-signal-i18n";import{For as t,bindAttr as n,bindClass as r,createDeepStore as i,createEffect as a,createMemo as o,createRoot as s,createSignal as c,createWatch as l,flushSync as u,insert as d,jsx as f,onCleanup as p,untrack as m,unwrap as h}from"vanilla-signal";import{createStorage as g}from"vanilla-create-storage";var _={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:`重置`}},v={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>`};const y=`http://www.w3.org/2000/svg`,b=v;function x(e){if(!(e in b))throw Error(`Icon "${e}" not found.`)}function S(e){return x(e),`<svg xmlns="${y}" viewBox="0 0 24 24" fill="currentColor">${b[e]}</svg>`}function C(e){return e!==null&&e.namespaceURI===y}function w(e,t={}){let n=document.createElement(`template`);n.innerHTML=S(e);let r=n.content.firstElementChild;if(!C(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 T(e){return S(e)}const E=T;function D(){return{...b}}function O(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}".`);b[t]=n}}function k(...e){return e.filter(Boolean).join(` `)}const A=Function.prototype.toString.call(Object);function j(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)===A}function M(e){return e==null}function N(e){return typeof Node<`u`&&e instanceof Node}function P(e){return typeof Element<`u`&&e instanceof Element}function F(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function I(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function L(e){return M(e)||I(e)||typeof e==`function`||Array.isArray(e)||N(e)}const R=e=>e===null?`null`:Array.isArray(e)?`array`:F(e)?`HTMLElement`:N(e)?`Node`:typeof e;function ee(e){return Array.isArray(e)?e.slice():j(e)?{...e}:e}function z(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function B(e,t){throw Error(`Validator: ${e} ${t}`)}function te(e){return typeof e==`string`?e:String(e)}function ne(e){return typeof e==`string`?`string`:`array`}function re(e,t,n){if(M(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=ne(t);n.nonEmpty&&t.length===0&&B(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&B(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&B(e,`expects ${r} length to be at most ${n.maxLength}.`)}function ie(e,t,n){M(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&B(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&B(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&B(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&B(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&B(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&B(e,`expects a number less than ${n.lessThan}.`))}function ae(e,t,n){!n.plain||M(t)||j(t)||B(e,`expects an object.`)}function oe(e,t,n){!n.items||M(t)||(Array.isArray(t)||B(e,`expects array.`),t.forEach((t,r)=>{V(String(r),t,n.items,e)}))}function se(e,t,n){if(!n.shape||M(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&B(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))V(t,r[t],i,e)}function ce(e,t){return t===`renderable`?L(e):t===`Node`?N(e):t===`Element`?P(e):t===`HTMLElement`?F(e):t===`plainObject`?j(e):R(e)===t}function le(e){return j(e)?`object`:R(e)}function ue(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)||B(e,i)}}function de(e,t){return e?`${e}.${t}`:t}function V(e,t,n={},r=``){let i=z(n),a=de(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&M(t)&&B(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=le(t);e.some(e=>ce(t,e))||B(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&B(a,`expects one of ${i.enum.map(te).join(`, `)}.`),re(a,t,i),ie(a,t,i),ae(a,t,i),oe(a,t,i),se(a,t,i),ue(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||B(a,i.message||`does not satisfy the required condition.`)),t}function H(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=z(t);a[e]=Object.hasOwn(i,e)?i[e]:fe(n)}for(let[e,n]of o){let r=z(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)V(e,a[e],t,n);return a}function fe(e){if(!Object.hasOwn(e,`default`))return;let t=e.default;return ee(e.factory&&typeof t==`function`?t():t)}function U(e){return e}const pe=[`node`,`element`,`array`];function me(e){return pe.includes(e)}function he(e){return N(e)}function W(e){return P(e)}function ge(e){return typeof e==`string`||W(e)||he(e)||Array.isArray(e)}function _e(e){return e.find(W)||null}function ve(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!ve(n,t))return null;continue}if(he(n)){t.push(n);continue}return null}return t}function ye(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=K(e);return t.length>0?t:null}if(Array.isArray(e)){let t=ve(e,[]);return t&&t.length>0?t:null}return he(e)?[e]:null}function be(e){return W(e)||he(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(ye(e)||[])[0]||null}function xe(e){if(!ge(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return W(t)?t:null}if(Array.isArray(e)){let t=ye(e);return Array.isArray(t)?_e(t):null}return W(e)?e:null}function Se(e,t=`Component`,n=`element`){if(!me(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return ge(e)?n===`array`?ye(e):n===`node`?be(e):xe(e):null}function Ce(e,t=`Component`,n=`element`){let r=Se(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function we(e){return L(e)}function G(e,t=document){return t.querySelector(e)}function K(e,t=document){return Array.from(t.querySelectorAll(e))}function Te(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(!De(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),Ee;let c=Ee,l=Oe(e);if(l&&document.body.contains(l))return c=ke(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=Oe(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=ke(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function Ee(){}function De(e){return typeof e==`string`||W(e)}function Oe(e){return typeof e==`string`?G(e):e}function ke(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),Ee;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 Ae(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function q(){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=Ae(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 je(){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 J(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,`_`)}const Y={},Me={timers:Y,start(e,t,n){Y[e]&&clearTimeout(Y[e]),Y[e]=setTimeout(()=>{n(),delete Y[e]},t)},cancel(e){Y[e]&&(clearTimeout(Y[e]),delete Y[e])}},Ne={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,action:`j-toast is-action`,actions:`toast-actions`,button:`j-button is-sm`,closeBtn:`is-ghost`,actionBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},Pe={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},Fe={type:`number`,min:0},Ie={type:`number`,greaterThan:0},Le=new Set,X=new Map,Z=new Map,Re=new Map;let ze=Ne;function Be(e){return{...Ne,...e}}function Ve(e){return Be({...ze,...e?.className})}function He(e){let t=G(`[data-toast-container]`);return t?t.className=e.container:(t=f(`div`,{className:e.container,"data-toast-container":``}),d(document.body,t)),t}function Ue(e,t,n,r){let i=`${e}-${t}`;return Le.add(i),Me.start(i,r,()=>{Le.delete(i),n()}),i}function We(e){for(let t of Array.from(Le))t.startsWith(`${e}-`)&&(Me.cancel(t),Le.delete(t))}function Ge(e){Z.get(e)?.cancel(),Z.delete(e),Re.delete(e),e.remove(),X.get(e)?.(),X.delete(e);let t=G(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function Ke(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function qe(e){return e.finished.then(()=>void 0,()=>void 0)}function Je(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 Ye(e,t){let n=(Re.get(e)||0)+1;if(Re.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(Je(e,t),Ke(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 qe(i),Re.get(e)===n&&Z.get(e)===i&&Z.delete(e)}function Xe(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),Ye(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function Ze(e){e&&e.getAttribute(`data-mount`)!==`false`&&(X.get(e)?.(),X.delete(e),We(e.dataset.toast||J()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),Ye(e,`leave`).then(()=>{e.dataset.mount===`false`&&Ge(e)}))}function Qe(e=``,t=3e3,n=`info`,r={}){V(`message`,e,`string`,`Toast.show`),V(`duration`,t,Fe,`Toast.show`),V(`type`,n,Pe,`Toast.show`);let i=Ve(r),a=J(),o=f(`div`,{className:k(i.toast,i[n]),"data-toast":a,role:`alert`,"aria-atomic":`true`,children:[f(`span`,{className:i.icon,"data-toast-icon":a,children:w(n===`primary`?`info`:n)}),f(`span`,{className:i.message,"data-toast-message":a,children:e})]});return Xe(o,()=>d(He(i),o),n===`error`?`assertive`:`polite`),t>0&&Ue(a,`hide`,()=>Ze(o),t),X.set(o,Ae(o,`click`,()=>Ze(o))),o}function $e(e=``,t=2e3,n={}){V(`message`,e,`string`,`Toast.lite`),V(`duration`,t,Ie,`Toast.lite`);let r=Ve(n),i=G(`[data-toast-lite]`);i&&(We(i.dataset.toast||``),Z.get(i)?.cancel(),Ge(i));let a=J(),o=f(`div`,{className:r.lite,"data-toast":a,"data-toast-lite":``,children:e});return Xe(o,()=>d(document.body,o),`polite`),Ue(a,`hide`,()=>Ze(o),t),o}function et(t=``,n={}){V(`message`,t,`string`,`Toast.action`);let r=n.text?.close||e(`Close`,_),i=n.text?.action||e(`Confirm`,_),a=Ve(n),o=J(),s=f(`div`,{className:k(a.action,a[n.type||`info`]),"data-toast":o,"data-toast-action":``,children:[f(`div`,{className:a.message,"data-toast-message":o,children:t}),f(`div`,{className:a.actions,"data-toast-actions":o,children:[f(`button`,{className:k(a.button,a.closeBtn),children:r,"data-action":`close`,"aria-label":r,onClick:async()=>{await n.onClose?.(),Ze(s)}}),f(`button`,{className:k(a.button,a.actionBtn),children:i,"data-action":`toast-action`,"aria-label":i,onClick:async()=>{await n.onAction?.(),Ze(s)}})]})]});return Xe(s,()=>d(He(a),s),`polite`,()=>{G(`[data-action="toast-action"]`,s)?.focus()}),s}function tt(){for(let e of Le)Me.cancel(e);Le.clear();for(let e of X.values())e();X.clear();for(let e of Z.values())e.cancel();Z.clear(),Re.clear(),G(`[data-toast-container]`)?.remove(),G(`[data-toast-lite]`)?.remove()}const nt={timers:Le,disposers:X,configure(e={}){return ze=Be(e.className),{className:ze}},show:Qe,success:(e=``,t=3e3,n={})=>Qe(e,t,`success`,n),info:(e=``,t=3e3,n={})=>Qe(e,t,`info`,n),primary:(e=``,t=3e3,n={})=>Qe(e,t,`primary`,n),warning:(e=``,t=3e3,n={})=>Qe(e,t,`warning`,n),error:(e=``,t=3e3,n={})=>Qe(e,t,`error`,n),hide:Ze,lite:$e,action:et,clearAll:tt,destroyAll:tt};function rt(){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 it(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 at(t)}return at(t)}function at(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 ot(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function st(){return ot()?!0:(nt.action(e(`wn`,_),{type:`error`,onAction:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{actionBtn:`j-button is-sm is-danger`}}),!1)}const ct=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function lt(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()}function ut(...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 ft(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 pt(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),ft(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 mt(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=ft(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}}}let ht=null,gt=null,_t=!1;function vt(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function yt(){_t||(_t=!0,vt(xt))}function bt(e){e.enqueued=!0,gt?gt.next=e:ht=e,gt=e,yt()}function xt(){_t=!1;let e=ht;ht=null,gt=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 St(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||bt(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function Ct(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function wt(e){return Ct(e),e}function Tt(e){return h(e)}function Et(e,t,{deferInitial:n=!0,flushInitial:r=!1,flush:i=`microtask`}={}){let a=!1,o=!1,s,c=St(()=>{o&&(o=!1,m(()=>t(s)))}),u=l(e,e=>{let t=!a;if(a=!0,s=e,o=!0,t&&r||i===`sync`){c.flush();return}c.schedule()},{defer:n});return()=>{c.dispose(),u.dispose()}}function Dt(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function Ot(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(t){return n=>{e.set(t,n),p(()=>{e.get(t)===n&&e.delete(t)})}},delete(t){e.delete(t)},clear(){e.clear()}}}function kt(e,t={}){let n,r=t.removeOnDispose!==!1,i=s(t=>(n=m(e),r&&p(()=>n.remove()),t));return{element:n,dispose:i}}function At(e){return e.filter(e=>e!=null&&e.isConnected)}function jt(e){e[0]?.getBoundingClientRect()}function Mt(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 Nt(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function Pt(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 Ft(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=Pt(Mt(n.transitionDuration),Mt(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=Pt(Mt(n.animationDuration),Mt(n.animationDelay),Nt(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function It(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 Lt(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,Ft(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(It(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 Rt(e){let t=`hidden`,n=0,r=null,i=null,a=null,o=()=>(a?.abort(),a=new AbortController,a.signal);return{get phase(){return t},enter:()=>{if(t===`visible`)return Promise.resolve(!1);if(t===`entering`&&r)return r;let i=++n,a=o();return t=`entering`,r=(async()=>{e.mount();let r=At(e.elements());return jt(r),u(e.activate),e.motion?await e.motion.enter(a):await Lt(r,a),i===n?(t=`visible`,!0):!1})(),r},leave:()=>{if(t===`hidden`)return Promise.resolve(!1);if(t===`leaving`&&i)return i;let r=++n,a=o();return t=`leaving`,i=(async()=>{u(e.deactivate);let i=At(e.elements());return e.motion?await e.motion.leave(a):await Lt(i,a),r===n?(e.unmount(),t=`hidden`,!0):!1})(),i},cancel(){n+=1,a?.abort(),a=null,e.motion?.cancel(),t=`hidden`,r=null,i=null}}}function zt(e=`center`,t=`center`){let n=w(`loader`,{width:24});return requestAnimationFrame(()=>{typeof n.animate==`function`&&n.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),f(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:t,position:`absolute`,width:`100%`,height:`100%`,borderRadius:`inherit`,backdropFilter:`blur(4px)`},children:n})}const 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=H(e,Bt,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function Ht(e={}){let{className:t,position:n,component:r,labelledby:i,content:a}=Vt(e),o={className:`${t} is-${n}`,role:`dialog`,children:U(a)};return r&&(o[`data-${r}`]=`root`,o[`aria-${r}`]=`true`),i&&(o[`aria-labelledby`]=i),f(`div`,o)}const 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()||J():e??J()},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=H(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,t={}){let n=xe(e),r=Gt(t),i=q(),a=Kt(r.delay),o={show:null,hide:null},l={x:0,y:0,lastMoveTime:0},u=0,p=0,m=!1,h=!1,g,_=null,v=null,y=0,b=()=>{},[x,S]=c(typeof r.content==`function`?null:r.content),[C,w]=c(!1),T=()=>{if(C())return zt();let e=x();return typeof e==`function`?e(g):e},{root:E}=s(e=>{b=e;let t=f(`div`,{className:r.className.container,"data-drop-container":r.name||r.id,"aria-live":()=>typeof r.content==`function`?`polite`:null,"aria-busy":()=>String(C()),children:()=>U(T())});return{root:f(`div`,{className:r.className.root,id:r.id,"data-drop":r.name||J(),"aria-expanded":`false`,children:t})}}),D=e=>{o[e]&&clearTimeout(o[e]),o[e]=null},O=async()=>{let e=r.content;if(typeof e!=`function`){S(e);return}let t=qt(r.ttl);if(r.cache&&_&&(!t||Date.now()-_.updatedAt<=t)){S(_.content);return}if(v)return v;let n=++y;w(!0);let i=Promise.resolve().then(()=>e(g)).then(e=>{h||n!==y||(r.cache&&(_={content:e,updatedAt:Date.now()}),S(e))}).finally(()=>{n===y&&!h&&w(!1),v===i&&(v=null)});return v=i,i},k=()=>{if(!n)return;let e=n.getBoundingClientRect(),{offset:t,position:i}=r;E.style.visibility=`hidden`,E.style.display=`block`;let a=E.getBoundingClientRect(),o=0,s=0,c=i;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)),E.style.top=`${o+window.scrollY}px`,E.style.left=`${s+window.scrollX}px`,E.style.visibility=``,E.style.display=``},A=e=>{h||m===e||(e?(E.parentNode||d(document.body,E),k(),O().then(()=>{m&&!h&&k()})):(y+=1,v=null,w(!1),E.style.top=``,E.style.left=``,E.remove()),E.setAttribute(`aria-expanded`,e?`true`:`false`),m=e,e?r.onShown?.(g):r.onHidden?.(g))},j=e=>{e.target instanceof Node&&n&&!E.contains(e.target)&&!n.contains(e.target)&&g.hide()},M=e=>{e instanceof MouseEvent&&(u=e.clientX,p=e.clientY,l.lastMoveTime=Date.now(),l.x=e.clientX,l.y=e.clientY)},N=()=>{i.on(`document:mousemove`,document,`mousemove`,M),D(`show`),o.show=setTimeout(()=>{let e=Date.now()-l.lastMoveTime;Math.abs(l.x-u)+Math.abs(l.y-p)<5||e>100?(g.show(!1),i.off(`document:mousemove`)):N()},a.show)};return g={get target(){return n},props:r,get element(){return h?null:E},get isVisible(){return m},delayShow:a.show,delayHide:a.hide,show(e=!0){D(`hide`),!(m||h)&&(e&&a.show>0?(D(`show`),o.show=setTimeout(()=>A(!0),a.show)):A(!0))},hide(e=!0){D(`show`),!(!m||h)&&(e&&a.hide>0?(D(`hide`),o.hide=setTimeout(()=>A(!1),a.hide)):A(!1))},toggle(){m?g.hide():g.show()},destroy(){h||(h=!0,D(`show`),D(`hide`),i.clear(),y+=1,v=null,w(!1),E.remove(),b(),n=null,m=!1)}},n&&(r.mode===`hover`?(i.on(`target:enter`,n,`mouseenter`,()=>{r.hoverIntent?N():g.show()}),i.on(`target:leave`,n,`mouseleave`,()=>{D(`show`),i.off(`document:mousemove`),g.hide()}),i.on(`root:enter`,E,`mouseenter`,()=>g.show()),i.on(`root:leave`,E,`mouseleave`,()=>g.hide())):(i.on(`target:click`,n,`click`,()=>g.toggle()),i.on(`document:click`,document,`click`,j))),g}const 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}}}const 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=H(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,t={}){let n=Qt(t),r=f(`div`,{className:k(n.className.container,n.theme&&n.className.ui[n.theme]),"data-tooltip":n.name||n.id||``,children:f(`div`,{className:n.className.message,"data-tooltip-message":``,children:n.message})}),i=Jt(e,{name:n.name,mode:n.mode,position:n.position,offset:n.offset,cache:n.cache,ttl:n.ttl,id:n.id,delay:n.delay,hoverIntent:n.hoverIntent,onShown:n.onShown,onHidden:n.onHidden,content:r});return{get element(){return i?.element||null},get drop(){return i},show(e=!0){i?.show(e)},hide(e=!0){i?.hide(e)},toggle(){i?.toggle()},destroy(){i?.destroy(),i=null}}}const 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 g({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:864e5*7})}function cn(e){if(!j(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(t={}){let a=i(an(t)),o={configVersion:0,destroyed:!1},c=sn(),l=new Set,d=q(),p=t=>e(t,_),m=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,h=()=>{let{mode:e,theme:t,radius:n,shadow:r,font:i}=a,o={mode:e,theme:t,radius:n,shadow:r,font:i,render:e===`auto`?m():e};c.set(a.key,o).catch(()=>{})},g=e=>{let t=s(t=>{for(let t of K(`[data-theme-group]`,e)){let e=t.dataset.themeGroup;if(on(e))for(let i of K(`[data-theme-button]`,t)){let t=()=>i.dataset.themeValue===String(a[e]);r(i,a.className.active,t),n(i,`aria-selected`,()=>t()?`true`:null)}}return t});l.add(t)},v=(e=null,t=null)=>{let n=a.className,r=t||ln(p),i=f(`div`,{className:e||n.panel,"data-theme-palette":`root`,children:[f(`h3`,{className:n.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:p(`t`)}),f(`div`,{className:n.container,"data-theme-container":``,children:r.map(e=>f(`div`,{className:n.item,"data-palette":e.type,"data-theme-group":e.type,children:[f(`div`,{className:n.itemTitle,"data-theme-group-title":e.type,children:e.title}),f(`div`,{className:n.items,"data-theme-items":e.type,children:e.buttons.map(([t,r])=>{let i=String(a[e.type])===String(t);return f(`button`,{className:k(n.button,i&&n.active),"data-palette":t,"data-theme-button":e.type,"data-theme-value":t,"aria-selected":i?`true`:null,children:[e.type===`theme`?f(`span`,{className:k(n.prefix,n.swatch),"data-theme-swatch":t,style:{backgroundColor:`var(--ui-${t})`}}):null,f(`span`,{className:n.buttonText,"data-theme-button-text":t,children:r})]})})})]}))})]});return g(i),i},y=e=>{o.configVersion+=1,u(()=>{Object.assign(a,e,{className:rn({...a.className,...e.className})})}),h()},b=()=>{if(!o.destroyed){o.destroyed=!0,d.clear();for(let e of l)e();l.clear(),c.close().catch(()=>{})}};d.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-theme-button]`),n=(t?.closest(`[data-theme-group]`))?.dataset.themeGroup,r=t?.dataset.themeValue;if(!t||!on(n)||!r||t.classList.contains(a.className.active))return;let i=a[n];o.configVersion+=1,u(()=>{a[n]=r});let s=document.documentElement;if(n===`mode`)s.classList.remove(`light`,`dark`,i),s.classList.add(r===`auto`?m():r);else{let e=nn[n],t=Array.from(s.classList).filter(t=>t.startsWith(e));t.length&&s.classList.remove(...t),s.classList.add(`${e}${r}`)}h()});let x=o.configVersion;return c.get(a.key).then(e=>{if(o.destroyed||o.configVersion!==x)return;let t=cn(e);t&&u(()=>{Object.assign(a,t)})}).catch(()=>{}),{props:a,createPanel:v,setConfig:y,destroy:b}}const 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=H(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 t=hn(e),n={destroyed:!1},r=new Set,i=new Map,a=new Map,o=null,s=xe(t.from),c=xe(t.to),l,u=()=>{if(!n.destroyed){if(o){o.isConnected||d(document.body,o);return}o=f(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),d(document.body,o)}},p=()=>{!n.destroyed||r.size>0||(o?.remove(),o=null)},m=(e,n)=>{if(!r.has(e))return;let i=a.get(e);i&&cancelAnimationFrame(i),a.delete(e),e.remove(),r.delete(e),n&&t.onHidden?.(l),p()},h=e=>{if(n.destroyed||(u(),!o))return null;let{color:i,size:a}=t.ball,s=f(`div`,{className:t.className.ball,"data-parabola":`ball`,style:{backgroundColor:i,width:a,height:a,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return d(o,s),r.add(s),s},g=()=>{let e=s?.getBoundingClientRect(),n=c?.getBoundingClientRect();if(!e||!n)return null;let{left:r,top:i,width:a,height:o}=e,{left:l,top:u,width:d,height:f}=n,p,m;switch(t.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=l+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},_=(e,t,r,i,o,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=o-r,d=i=>{if(n.destroyed||!e.isConnected){a.delete(e);return}let o=i-c,f=Math.min(o/s,1),p=1-(1-f)**3,h=t+l*p,g=r+-100*Math.sin(Math.PI*p)+u*p,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-p*.3})`,f<1?a.set(e,requestAnimationFrame(d)):(a.delete(e),m(e,!0))};a.set(e,requestAnimationFrame(d))},v=(e,n)=>{let r=`parabola-show-${J()}`;i.set(r,n),Me.start(r,t.showDelay,()=>{i.delete(r),e()})},y=()=>{for(let[e,t]of i)Me.cancel(e),t();i.clear()};return l={props:t,runtime:n,get element(){return o},show(){return n.destroyed?Promise.resolve(!1):new Promise(e=>{v(()=>{if(n.destroyed){e(!1);return}s=xe(t.from),c=xe(t.to);let r=g();if(!r){e(!1);return}let i=h(r);if(!i){e(!1);return}t.onShow?.(l),_(i,r.startX,r.startY,r.endX,r.endY),e(!0)},()=>e(!1))})},destroy(){if(!n.destroyed){y(),s=null,c=null,n.destroyed=!0;for(let e of r)m(e,!1);a.clear(),p()}}},u(),l}const _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=H(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:Ce(e,`Sticky.parent`,`element`)}function xn(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return yn(Ce(e,`Sticky.target`,`array`));let n=yn(K(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=yn(Ce(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 t=vn(e),n=i({items:[]}),r={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},a={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,d=e=>e.length<=t.max?e:t.overflow===`ignore`?[]:e.slice(-t.max),f=()=>{for(let e of a.originalStyles.values())p(e)},p=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},m=(e,t)=>{if(e.id)return e.id;let n=a.keys.get(e);if(n)return n;let r=`sticky-${J()}-${t}`;return a.keys.set(e,r),r},h=e=>{a.originalStyles.has(e)||a.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},g=()=>d(xn(t.target,o)),_=(e=t.top)=>{let r=e,i=[],o=new Set(s);for(let[e,t]of a.originalStyles)o.has(e)||(p(t),a.originalStyles.delete(e));return s.forEach((e,n)=>{h(e),e.style.position=`sticky`,e.style.top=`${r}px`,i.push({key:m(e,n),index:n,top:r}),r+=e.offsetHeight+t.gap}),u(()=>{n.items=i}),t.onReBuild?.(l),r},v=()=>{if(c?.disconnect(),c=null,!t.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{r.reBuilding||r.destroyed||!r.built||(r.reBuilding=!0,r.reBuildFrameId=requestAnimationFrame(()=>{r.reBuilding=!1,r.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:t,state:n,runtime:r,build:()=>{if(r.destroyed)throw Error(`Sticky.build: instance destroyed`);return r.built?l:(o=bn(t.parent),s=g(),r.built=!0,v(),s.length===0?(u(()=>{n.items=[]}),l):(_(),l))},reBuild:()=>(!r.destroyed&&r.built&&(s=g(),_()),l),destroy:()=>{r.destroyed||(r.reBuildFrameId&&cancelAnimationFrame(r.reBuildFrameId),c?.disconnect(),c=null,f(),r.destroyed=!0,r.built=!1,r.reBuilding=!1,r.reBuildFrameId=0,a.originalStyles.clear(),s=[],o=null)}},l}const Cn={rules:{default:{},type:`object`},messages:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]}};function wn(e){let t=H(e,Cn,`Validator.props`);return{rules:t.rules,messages:t.messages,onSubmit:t.onSubmit}}function Tn(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function En(e){if(!e)return null;if(e instanceof Element)return Tn(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&Tn(t))return t;return null}function Dn(){return{valid:!0,message:``,destroyed:!1}}function On(e){return e.closest(`[data-form-control]`)||e.parentElement}function kn(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function An(e){return e instanceof HTMLInputElement&&e.type===`file`}function jn(e){return!!e.files&&e.files.length>0}function Mn(e,t){return t===!0?e instanceof HTMLSelectElement?kn(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function Nn(e,t){return typeof t!=`number`||e.value.length>=t}function Pn(e,t){return typeof t!=`number`||e.value.length<=t}function Fn(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function In(e,t,n){if(!e||typeof n!=`string`)return!0;let r=En(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function Ln(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 Rn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||kn(e).some(e=>e.length>0)}function zn(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 Bn(e,t){return!(e instanceof HTMLSelectElement)||typeof t!=`number`||e.selectedOptions.length>=t}function Vn(e,t){return!(e instanceof HTMLSelectElement)||typeof t!=`number`||e.selectedOptions.length<=t}function Hn(e,t){return!/\s/.test(e.value)||t!==!0}function Un(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function Wn(e,t){return!An(e)||t!==!0||jn(e)}function Gn(e,t){return!An(e)||!jn(e)||typeof t!=`number`||e.files[0].size>=t}function Kn(e,t){return!An(e)||!jn(e)||typeof t!=`number`||e.files[0].size<=t}function qn(e,t){if(!An(e)||!jn(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 Jn(e,t,n,r,i,a=``){(!(n instanceof HTMLInputElement)||n.type!==`checkbox`)&&(n.classList.remove(`is-valid`),n.classList.add(`is-invalid`));let o=a||e?.messages[r]?.[i]||``;if(!o)return;t.message=o;let s=On(n);if(!s)return;let c=K(`[data-validator-help]`,s).find(e=>e.dataset.validatorHelp===r)||null;c||(c=f(`div`,{className:`help-block is-invalid`,"data-validator-help":r}),s.appendChild(c)),c.textContent=o}function Yn(e){let t=On(e);if(t)for(let n of K(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)&&(e.classList.remove(`is-invalid`),e.classList.add(`is-valid`))}function Xn(e,t={},n=!1){V(`bindEvents`,n,`boolean`,`Validator`);let r=xe(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=wn(t),o=Dn(),s=q(),c,l=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,c);return typeof n==`string`?n:!!n},u=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let s=n[r],c=``;switch(r){case`required`:o.valid=Mn(e,s);break;case`minLength`:o.valid=Nn(e,s);break;case`maxLength`:o.valid=Pn(e,s);break;case`equalTo`:o.valid=In(i,e,s);break;case`email`:o.valid=Fn(e);break;case`checked`:o.valid=Ln(e,s);break;case`selected`:o.valid=Rn(e,s);break;case`multiple`:o.valid=zn(e,s);break;case`min`:o.valid=Bn(e,s);break;case`max`:o.valid=Vn(e,s);break;case`noSpace`:o.valid=Hn(e,s);break;case`noChinese`:o.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:o.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:o.valid=Un(e,s);break;case`file`:o.valid=Wn(e,s);break;case`minSize`:o.valid=Gn(e,s);break;case`maxSize`:o.valid=Kn(e,s);break;case`accept`:o.valid=qn(e,s);break;case`validate`:{let t=l(e,s);o.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!o.valid){Jn(a,o,e,t,r,c);break}Yn(e)}return o.valid},d=()=>{if(!i||!a||o.destroyed)return!1;o.valid=!0,o.message=``;for(let e of Array.from(i.elements))if(!(!Tn(e)||!e.name)&&a.rules[e.name]&&(o.valid=u(e,e.name),!o.valid))break;return o.valid&&a.onSubmit?.(c),o.valid},f=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))Tn(e)&&e.classList.remove(`is-valid`,`is-invalid`);for(let e of K(`[data-validator-help]`,i))e.remove();o.valid=!0,o.message=``}};return c={get element(){return i},get props(){return a},set props(e){a=e},runtime:o,validate:d,reset:f,destroy:()=>{o.destroyed||(o.destroyed=!0,s.clear(),f({native:!1}),i=null,a=null,o.valid=!1,o.message=``)}},n&&(s.on(`submit`,i,`submit`,e=>{e.preventDefault(),d()}),s.on(`reset`,i,`reset`,()=>f({native:!1}))),c}const Zn=new Map;function Qn(e,t){!e||!t||Zn.set(e,t)}function $n(e){Zn.delete(e)}function er(e){typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}function Q(e){let t={built:!1,mounted:!1,destroyed:!1},n=new Map,r=new Set,i=new Map,a=null,o=null,s,c=n=>{if(t.destroyed)throw Error(`${e.name}.${n}: instance destroyed`)},l=(e,...t)=>{for(let r of n.get(e)||[])try{r(...t)}catch{}},d={props:e.props,state:e.state,runtime:t,get element(){return a},own(e){e&&r.add(e)},assertActive:c,emit:l},f={props:e.props,state:e.state,runtime:t,get element(){return a},build(){if(c(`build`),t.built)return s;let n=kt(()=>e.view(d),{removeOnDispose:e.ownsElement});return a=n.element,o=n.dispose,t.built=!0,e.onBuild?.(d),l(`build`,s),s},mount(n){if(c(`mount`),t.built||s.build(),!a)throw Error(`${e.name}.mount: view did not create an element.`);return a.parentNode!==n&&n.appendChild(a),t.mounted=!0,e.onMount?.(d),l(`mount`,s,n),s},unmount(){return c(`unmount`),!t.mounted&&!a?.parentNode?s:(e.onUnmount?.(d),e.ownsElement!==!1&&a?.remove(),t.mounted=!1,l(`unmount`,s),s)},setState(t={},n){c(`setState`);let r=typeof t==`string`&&arguments.length>1?{[t]:n}:t;if(!j(r))throw Error(`${e.name}.setState: expects a plain object patch.`);let i=e.normalizeStatePatch?e.normalizeStatePatch(r):r;if(!j(i))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(i,e.state);else for(let t of Object.keys(i))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return u(()=>{Object.assign(e.state,i)}),s},own(e){return e&&r.add(e),s},use(e,t){if(!e)return s;let n=typeof e==`function`?e(s,t):e.install(s,t);return i.set(e,n),s},on(e,t){if(!e||typeof t!=`function`)return s;let r=n.get(e);return r||(r=new Set,n.set(e,r)),r.add(t),s},off(e,t){return n.get(e)?.delete(t),s},emit(e,...t){return l(e,...t),s},destroy(){if(!t.destroyed){t.destroyed=!0,e.onDestroy?.(d),l(`destroy`,s);for(let e of r)try{er(e)}catch{}r.clear();for(let e of i.values())try{er(e)}catch{}i.clear(),o?.(),o=null,e.ownsElement!==!1&&a?.remove(),a=null,t.built=!1,t.mounted=!1,n.clear()}}};s=Object.assign(f,e.actions||{});for(let e of Zn.values())s.use(e);return s}const tr={toc:`j-toc`,list:`toc-list`,link:`toc-link`,active:`is-active`,levelPrefix:`is-level-`},nr={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},reactive:{default:!1,type:`boolean`},className:{default:tr,type:`object`,normalize:e=>({...tr,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]}};function rr(e){let t=H(e,nr,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,reactive:t.reactive,className:t.className,onChange:t.onChange}}function ir(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function ar(e,t){return e.id||=`toc-${J()}-${t}`,{id:e.id,text:e.textContent||``,level:ir(e)}}function or(e={}){let n=rr(e),r=i({items:[],current:{index:-1,item:null}}),a={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0},s=q(),c=null,l=[],d=null,p,m=o(()=>r.items),h=e=>{if(e===r.current.index)return;let t=r.items[e]||null;u(()=>{r.current={index:e,item:t}}),n.onChange?.(t,e,p)},g=()=>{if(!p.runtime.built)return;let e=-1,t=n.offset+1;for(let n=l.length-1;n>=0;n--)if(l[n].getBoundingClientRect().top<=t){e=n;break}h(e)},_=()=>{a.ticking||(a.ticking=!0,a.frameId=requestAnimationFrame(()=>{a.ticking=!1,a.frameId=0,g()}))},v=()=>{a.refreshing||(a.refreshing=!0,a.refreshFrameId=requestAnimationFrame(()=>{a.refreshing=!1,a.refreshFrameId=0,b()}))},y=(e,{activeIndex:t=-1,updateHash:r=!1}={})=>{let i=l.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&&h(t),r&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},b=()=>{if(p.runtime.destroyed||!p.runtime.built||!c)return;l=K(n.headings,c);let e=l.map(ar);u(()=>{r.items=e,r.current={index:-1,item:null}}),g()};return p=Q({name:`Toc`,props:n,state:r,actions:{activate:e=>(p.runtime.built&&Number.isInteger(e)&&e>=0&&e<r.items.length&&y(r.items[e]),p)},view:()=>f(`nav`,{className:n.className.toc,"data-toc":`root`,children:f(`div`,{className:n.className.list,"data-toc-list":`root`,children:t({each:m,key:e=>e.id,children:(e,t)=>f(`a`,{className:()=>{let i=e();return k(n.className.link,`${n.className.levelPrefix}${i.level}`,r.current.index===t()?n.className.active:``)},href:()=>`#${e().id}`,"data-toc-index":()=>String(t()),"data-toc-target":()=>e().id,"data-active":()=>r.current.index===t()?`1`:`0`,onClick:n=>{n.preventDefault(),y(e(),{activeIndex:t(),updateHash:!0})},children:()=>e().text})})})}),onBuild(e){c=Ce(n.target,`Toc.target`),s.on(`scroll`,window,`scroll`,_,{passive:!0}),e.own(()=>s.clear()),b(),n.reactive&&(d=new MutationObserver(v),d.observe(c,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{d?.disconnect(),d=null}))},onDestroy(){a.frameId&&cancelAnimationFrame(a.frameId),a.refreshFrameId&&cancelAnimationFrame(a.refreshFrameId),a.frameId=0,a.refreshFrameId=0,a.ticking=!1,a.refreshing=!1,d?.disconnect(),d=null,c=null,l=[]}}),p}const sr={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`},cr={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},lr={type:`array`,nonEmpty:!0,items:cr},ur={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||J():e??J()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(dr):dr(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:sr,type:`object`,normalize:e=>({...sr,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]},data:{default:[],...lr}};function dr(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function fr(e){let t=H(e,ur,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,direction:t.direction,className:t.className,data:mr(t.data,!1),onChange:t.onChange}}function pr(e,t,n=!0){n&&V(String(t),e,cr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||J()}}function mr(e,t=!0){t&&V(`data`,e,lr,`Accordion`);let n=new Set;return e.map((e,t)=>{let r=pr(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 hr(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 gr(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 _r(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 vr(e){return typeof e==`number`&&e>0?e:0}function yr(e){let n=fr(e),r=hr(n.active,n.data,n.multiple),o=i({data:n.data,activeNames:r,loading:!1}),s=new WeakMap,l=Ot(),d=Ot(),m=new Map,h=new Map,g=new Map,_=new Set(r),v=Promise.resolve(),y=0,b=0,x=!1,S,C=e=>(typeof e.name==`string`?e.name.trim():``)||(s.has(e)||s.set(e,J()),s.get(e)),T=()=>{let e=o.data.map(e=>({...e,name:C(e)}));return _r(gr(o.activeNames,e,n.multiple),e)},E=e=>o.activeNames.includes(e),D=()=>{b+=1,!x&&!S.runtime.destroyed&&(x=!0,u(()=>{o.loading=!0}))},O=()=>{b=Math.max(0,b-1),b===0&&x&&!S.runtime.destroyed&&(x=!1,u(()=>{o.loading=!1}))},k=e=>typeof e==`number`?e:typeof e==`string`?o.data.findIndex(t=>C(t)===e):-1,A=e=>{let t=new Set(e),n=new Set([..._,...t]),r=[];for(let e of n){let n=_.has(e),i=t.has(e);if(n===i)continue;let a=d.get(e);a&&(a.inert=!i);let o=m.get(e);o&&r.push(i?o.enter():o.leave())}return _=t,r.length>0&&(v=Promise.all(r).then(()=>void 0)),v},j=e=>t=>{d.bind(e)(t),m.get(e)?.cancel();let r=mt(()=>d.get(e),{axis:n.direction,options:{duration:250,easing:`ease`}});m.set(e,r);let i=E(e);t.inert=!i,r.setExpanded(i),p(()=>{m.get(e)===r&&(r.cancel(),m.delete(e),_.delete(e),o.activeNames.includes(e)&&u(()=>{o.activeNames=o.activeNames.filter(t=>t!==e)}))})},M=async e=>{if(S.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!S.runtime.built)throw Error(`Accordion.activate: call build() first.`);let t=k(e),r=o.data[t];if(!r)return;let i=C(r),a=E(i);if(a&&!n.multiple&&!n.collapsible)return;let s;if(n.multiple)if(a){let e=o.activeNames.filter(e=>e!==i);s=!n.collapsible&&e.length===0?[...o.activeNames]:e}else s=[...o.activeNames,i];else s=a?n.collapsible?[]:[...o.activeNames]:[i];u(()=>{o.activeNames=s});let c=A(s),f=s.includes(i)&&g.get(i)?.()||Promise.resolve(),p=l.get(i),m=d.get(i),h=n.onChange&&p&&m?f.then(()=>n.onChange?.(t,i,p,m,S)):Promise.resolve();await Promise.all([c,h])},N=(e,t,n)=>{let r=C(e);return{accordion:S,item:e,index:t,type:n,active:E(r)}},P=(e,t,n)=>typeof e==`function`?e(N(t,n,`title`)):e,F=(e,t,n)=>{let r=e().content,[i,o]=c(typeof r==`function`?null:r),[s,l]=c(!1),u=r,d=0,f=null,m=()=>N(e(),t(),`content`),_=async()=>{let t=e(),r=t.content;if(typeof r!=`function`){o(r);return}let i=t.cache?h.get(n):null,a=vr(t.ttl);if(i&&(!a||Date.now()-i.updatedAt<=a)){o(i.content);return}if(f)return f;let s=++d;y+=1;let c=y;l(!0),D();let u=Promise.resolve().then(()=>r(m())).then(t=>{s!==d||S.runtime.destroyed||(e().cache&&h.set(n,{content:t,updatedAt:Date.now()}),o(t))}).finally(()=>{s===d&&!S.runtime.destroyed&&l(!1),c<=y&&O(),f===u&&(f=null)});return f=u,u};return g.set(n,_),p(()=>{d+=1,h.delete(n),g.delete(n),f=null}),a(()=>{let t=e().content;t!==u&&(u=t,d+=1,f=null,h.delete(n),o(typeof t==`function`?null:t)),E(n)&&_()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return zt(`flex-start`,`flex-start`);let e=i();return typeof e==`function`?e(m()):e}}},I=(e,t)=>{let r=C(e()),i=F(e,t,r),a=`${n.id}_header_${r}`,o=`${n.id}_panel_${r}`;return[f(`div`,{className:n.className.header,id:a,"data-accordion-header":r,role:`button`,tabindex:`0`,"aria-controls":o,"aria-expanded":()=>E(r)?`true`:`false`,ref:l.bind(r),onClick:()=>void M(r),onKeyDown:e=>{e instanceof KeyboardEvent&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),M(r))},children:[f(`span`,{className:n.className.title,"data-accordion-title":r,role:`heading`,children:()=>{let n=e();return U(P(n.title,n,t()))}}),f(`span`,{className:n.className.arrow,"data-accordion-arrow":r,"aria-hidden":`true`,children:w(`arrow-down`)})]}),f(`div`,{className:n.className.panel,"data-accordion-panel":r,id:o,role:`region`,"aria-labelledby":a,"aria-hidden":()=>E(r)?`false`:`true`,"aria-live":()=>i.isAsync()?`polite`:null,"aria-busy":()=>String(i.loading()),"data-state":()=>E(r)?`open`:`closed`,ref:j(r),children:f(`div`,{className:n.className.content,"data-accordion-content":r,children:()=>U(i.render())})})]};return S=Q({name:`Accordion`,props:n,state:o,actions:{isActive:E,getIndex:k,activate:M},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:mr(e.data)}:{}}},view:()=>{let e=f(`div`,{className:n.className.root,id:n.id,"data-accordion":`root`,"data-direction":n.direction,children:t({each:()=>o.data,key:e=>C(e),children:(e,t)=>I(e,t)})});return _=new Set(o.activeNames),a(()=>{A([...o.activeNames])}),e},onDestroy(){y+=1,b=0,x=!1,h.clear(),g.clear();for(let e of m.values())e.cancel();m.clear(),l.clear(),d.clear()}}),Object.defineProperty(S,"current",{enumerable:!0,get:T}),S}const br={form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-item`,label:`item-label`,required:`is-required`,control:`form-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,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`,switchDefault:`is-default`,switchSizeMd:`is-md`,switchSlider:`switch-slider`},xr=[{type:`submit`,text:e(`Submit`,_),theme:`primary`,action:`submit`},{type:`reset`,text:e(`Reset`,_),theme:`ghost`,action:`reset`}],Sr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():J():e??J()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:xr,types:[`boolean`,`array`],normalize:e=>e===!1?[]:e===!0?Dr(xr):Array.isArray(e)?Dr(e):e},buttonsPosition:{default:`end`,type:`string`,enum:[`start`,`center`,`end`]},className:{default:br,type:`object`,normalize:e=>Nr(e)},validator:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function Cr(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function wr(e){return{...e,options:Cr(e.options)}}function Tr(e){return{...e.id?{id:e.id}:{},type:e.type,payload:wr(e.payload),next:e.next||null}}function Er(e){return Array.isArray(e)?e.map(e=>Tr(e)):[]}function Dr(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function Or(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 kr(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function Ar(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function jr(e){return e==null||Array.isArray(e)?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function Mr(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function Nr(e){return{...br,...j(e)?e:{}}}function Pr(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!j(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 Fr(e){return e===`center`?`center`:`flex-${e}`}function Ir(e){let t=j(e)?e:{};return{...t,rules:j(t.rules)?t.rules:{},messages:j(t.messages)?t.messages:{}}}function Lr(e){let t=H(e,Sr,`Form.props`),n=Er(t.fields);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,style:t.style,fields:n,buttons:Dr(t.buttons),buttonsPosition:t.buttonsPosition,className:Nr(t.className),validator:Ir(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function Rr(e){return{...e,fields:Er(e.fields),buttons:Dr(e.buttons),className:Nr(e.className),validator:Ir(e.validator)}}function zr(e){let t=Rr(e);return delete t.buttonsPosition,t}function Br(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function Vr(e,t){return Array.isArray(e)?e.map(e=>Ar(e)).includes(Ar(t)):e==t}function Hr(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>Ar(e)).includes(Ar(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||Ar(e)===Ar(t):n}function Ur(e){return e instanceof RadioNodeList?Array.from(e):[e]}function Wr(e={}){let n=Lr(e),r=Rr(n),s=Fr(n.buttonsPosition),l=i({...zr(n),submitting:!1,data:null}),d={initial:r,fieldIds:new Map},p=new WeakMap,[m,h]=c(0),g=new WeakMap,_=null,v,y=e=>{if(l.fields.includes(e))return e;let t=g.get(e);if(t)return t;let n=i(Tr(e));return g.set(e,n),n},b=o(()=>(m(),Or(l.fields,y))),x=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(p.has(e)||p.set(e,J()),p.get(e)),S=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${x(n)}:${e.type}`:`item:${e.type}:${t}`},C=(e,t)=>{if(e.id)return e.id;let n=e.name||t;return d.fieldIds.has(n)||d.fieldIds.set(n,`${l.id}_field_${t}`),d.fieldIds.get(n)},w=()=>{let e=v.element;if(!e)return;let t={...l.validator,onSubmit:null};if(_?.element===e){_.props=t;return}_?.destroy(),_=Xn(e,t,!1)},T=()=>_?.validate()??!0,E=()=>{let e=v.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`);for(let t of K(`[data-form-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},D=()=>{let e={};if(!v.element)return e;for(let[t,n]of new FormData(v.element).entries())Object.hasOwn(e,t)?e[t]=Array.isArray(e[t])?[...e[t],n]:[e[t],n]:e[t]=n;return e},O=async e=>{if(e.preventDefault(),l.submitting||!T())return;let t=D();u(()=>{l.submitting=!0,l.data=t});try{await Promise.resolve(l.onSubmit?.(t,v))}finally{v.runtime.destroyed||u(()=>{l.submitting=!1})}},A=e=>{if(!e.name||!v.element)return[];let t=v.element.elements.namedItem(e.name);return t?Ur(t).filter(e=>e instanceof Element):[]},j=(e,t,n=`text`)=>{u(()=>{if(t instanceof HTMLSelectElement){e.value=t.multiple?Array.from(t.selectedOptions).map(e=>e.value):t.value;return}if(t instanceof HTMLTextAreaElement){e.value=t.value;return}if(n===`switch`){e.checked=t.checked,e.value=t.checked?t.value:``;return}if(n===`radio`){t.checked&&(e.value=t.value);return}if(n===`checkbox`){if(Array.isArray(e.options)){e.value=A(e).filter(e=>e instanceof HTMLInputElement&&e.checked).map(e=>e.value);return}e.checked=t.checked,e.value=t.checked?t.value:``;return}e.value=t.value,t.type===`checkbox`&&(e.checked=t.checked)}),h(e=>e+1)},M=(e,t,n)=>({...n,name:()=>e().name,id:t,placeholder:()=>e().placeholder||``,required:()=>!!e().required,disabled:()=>l.submitting||!!e().disabled,readonly:()=>!!e().readonly,"data-form-field":()=>e().name||t}),N=(e,t,n)=>f(`div`,{className:()=>{let t=e(),r=t.vertical?`vertical`:`horizontal`,i=l.className;return k(n===`radio`?i.radio:i.checkbox,r===`vertical`?i.choiceVertical:i.choiceHorizontal,t.group?i.choiceGroup:``,t.size?`is-${t.size}`:``)},"data-form-choice-group":()=>e().name||t,"data-choice-type":n,"data-choice-layout":()=>e().vertical?`vertical`:`horizontal`,children:()=>(e().options||[]).map((r,i)=>{let a=kr(r),o=`${t}_${i}`;return f(`label`,{className:()=>n===`radio`?l.className.radioLabel:``,"data-form-choice":()=>e().name||t,for:o,children:[f(`input`,{type:n,id:o,name:()=>e().name,value:a.value??``,checked:()=>n===`radio`?Vr(e().value,a.value):Hr(e().value,a.value,a.checked),disabled:()=>l.submitting||!!a.disabled||!!e().disabled,required:()=>!!e().required,onChange:t=>{let r=t.currentTarget;r instanceof HTMLInputElement&&j(e(),r,n)}}),f(`span`,{className:()=>n===`radio`?l.className.radioText:``,"data-form-choice-text":``,children:U(a.text??a.label??Ar(a.value))})]})})}),P=(e,t,n,r)=>{let i=e().type;if(i===`textarea`)return f(`textarea`,M(t,n,{className:()=>t().className||l.className.textarea,autocomplete:()=>t().autocomplete,value:()=>jr(t().value),onInput:e=>{let n=e.currentTarget;n instanceof HTMLTextAreaElement&&j(t(),n,`textarea`)}}));if(i===`select`)return f(`select`,M(t,n,{className:()=>t().className||l.className.select,autocomplete:()=>t().autocomplete||`off`,multiple:()=>!!t().multiple,value:()=>t().multiple?void 0:jr(t().value),onChange:e=>{let n=e.currentTarget;n instanceof HTMLSelectElement&&j(t(),n,`select`)},children:()=>(t().options||[]).map(e=>{let n=kr(e);return f(`option`,{value:n.value??``,disabled:!!n.disabled,selected:()=>Vr(t().value,n.value),children:U(n.text??n.label??Ar(n.value))})})}));if(i===`radio`)return N(t,n,`radio`);if(i===`checkbox`&&Array.isArray(t().options))return N(t,n,`checkbox`);if(i===`switch`)return f(`label`,{className:()=>{let e=t(),n=l.className;return k(n.switch,e.variant?`is-${e.variant}`:n.switchDefault,e.size?`is-${e.size}`:n.switchSizeMd)},"data-form-switch":()=>t().name||n,for:n,children:[f(`input`,{type:`checkbox`,id:n,name:()=>t().name,value:()=>t().value??`1`,checked:()=>!!t().checked,disabled:()=>l.submitting||!!t().disabled,required:()=>!!t().required,onChange:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&j(t(),n,`switch`)}}),f(`span`,{className:()=>l.className.switchSlider,"data-form-switch-slider":``})]});if(i===`custom`){let n=t();return typeof n.content==`function`?n.content({form:v,field:n,index:r(),item:e()}):n.content}let a=i||`text`;return f(`input`,{...M(t,n,{type:a,className:()=>t().className||l.className.input,autocomplete:()=>t().autocomplete||Br(a),value:()=>t().value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&j(t(),n,a)}}),checked:()=>{let e=t().checked;return e===void 0?void 0:!!e}})},F=(e,t)=>{let n=()=>e().payload,r=C(n(),t());return f(`div`,{className:()=>l.className.item,"data-form-item":()=>n().name||String(t()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{let e=n();return e.label===!1||e.label===void 0?null:f(`label`,{className:()=>k(l.className.label,Mr(n(),l.validator.rules)?l.className.required:``),"data-form-label":()=>n().name||r,for:r,children:()=>U(n().label)})},f(`div`,{className:()=>l.className.control,"data-form-control":()=>n().name||String(t()),children:[U(P(e,n,r,t)),()=>n().help?f(`div`,{className:`help-block`,"data-form-help":()=>n().name||String(t()),children:()=>U(n().help)}):null]})]})},I=(e,t)=>F(e,t),L=()=>f(`div`,{className:()=>l.className.buttons,style:{justifyContent:s},"data-form-buttons":``,hidden:()=>l.buttons.length===0,children:t({each:()=>l.buttons,key:(e,t)=>`${e.action||e.type||`button`}:${t}`,children:e=>f(`button`,{type:()=>e().type||`button`,className:()=>{let t=e();return k(l.className.button,t.theme?`is-${t.theme}`:``,t.className||``)},"data-action":()=>{let t=e();return t.action||t.type||`button`},disabled:()=>l.submitting||!!e().disabled,children:()=>{let t=e(),n=U(t.text??t.label??``);return l.submitting&&(t.type===`submit`||t.action===`submit`)?[zt(),n]:n}})})});return v=Q({name:`Form`,props:n,state:l,actions:{validate:T,reset(){return _?.reset(),u(()=>{l.data=null}),v},collectData:D,requestSubmit(){let e=v.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),v},setFields(e){return V(`fields`,e,`array`,`Form.setFields`),d.fieldIds.clear(),g=new WeakMap,u(()=>{l.fields=Er(e)}),v},resetFields(){return d.fieldIds.clear(),g=new WeakMap,u(()=>{l.fields=Er(r.fields)}),v}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:Er(e.fields)}:{},...Object.hasOwn(e,`buttons`)?{buttons:Dr(e.buttons)}:{},...Object.hasOwn(e,`className`)?{className:Nr(e.className)}:{},...Object.hasOwn(e,`validator`)?{validator:Ir(e.validator)}:{}}},view:()=>{let e=f(`form`,{className:()=>k(l.className.form,l.vertical?l.className.vertical:l.className.horizontal,l.itemVertical?l.className.itemVertical:l.className.itemHorizontal),id:()=>l.id,"data-form":`root`,"data-form-layout":()=>l.vertical?`vertical`:`horizontal`,"data-form-item-layout":()=>l.itemVertical?`vertical`:`horizontal`,onSubmit:e=>void O(e),onReset:e=>{E(),u(()=>{l.data=null}),l.onReset?.(e,v)},children:[t({each:b,key:S,children:I}),L()]});return a(()=>Pr(e,l.style)),a(()=>{_&&(_.props={...l.validator,onSubmit:null})}),e},onBuild(){w()},onDestroy(){_?.destroy(),_=null,d.fieldIds.clear(),g=new WeakMap}}),v}const Gr={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`},Kr={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},qr={type:`renderable`},Jr={types:[`plainObject`,`null`,`undefined`]};function $(e){return j(e)?{...e}:{}}function Yr(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data),modal:typeof t.modal==`function`||t.modal==null?t.modal:$(t.modal)}}):[]}function Xr(e){return typeof e==`string`?{...Gr,root:[Gr.root,e.trim()].filter(Boolean).join(` `)}:{...Gr,...j(e)?e:{}}}function Zr(e,t){if(typeof e==`string`)return{id:e};if(!j(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:j(n.data)||n.data==null?n.data:void 0}:{id:t}}const Qr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||J()},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=j(e)?e:{};return{back:typeof t.back==`string`?t.back:`Back`,next:typeof t.next==`string`?t.next:`Next`,finish:typeof t.finish==`string`?t.finish:`Finish`,reset:typeof t.reset==`string`?t.reset:`Reset`}}},className:{default:Gr,types:[`object`,`string`],normalize:Xr},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 $r(e){let t=H(e,Qr,`Flow.props`);return{id:t.id,steps:Yr(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 ei(e={}){let t=$r(e),n=t.steps,r=new Map;for(let[e,t]of n.entries()){if(V(String(e),t,Kr,`Flow.props.steps`),V(`content`,t.content??null,qr,`Flow.props.steps.${e}`),r.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);r.set(t.id,e)}let a=(()=>{if(typeof t.initial==`number`){let e=n[t.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof t.initial==`string`){if(!r.has(t.initial))throw Error(`Flow.props.initial step "${t.initial}" does not exist.`);return t.initial}return n[0].id})(),o={},s={};for(let e of n)o[e.id]=$(e.data),Object.assign(s,o[e.id]);let c=i({id:t.id,currentId:a,currentIndex:r.get(a)??0,previousId:null,previousIndex:null,direction:null,history:[a],data:$(s),stepData:$(o),loading:!1,error:null,busyAction:null,version:0}),l={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},d=new Set,p=new Set,m=null,h,g=e=>{if(l.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},_=()=>n[c.currentIndex],v=e=>$(c.stepData[e]),y=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},b=()=>({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:$(c.stepData),currentData:v(c.currentId),currentStep:y(_()),canBack:c.currentIndex>0&&!c.loading,canNext:c.currentIndex<n.length-1&&!c.loading,isLast:c.currentIndex===n.length-1,loading:c.loading,busyAction:c.busyAction,error:c.error}),x=(e=null)=>{let n=b();for(let t of d)t(n,h,e);t.onChange?.(n,h,e)},S=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},C=(e,n,i={})=>(g(`setStepData`),V(`stepId`,e,{type:`string`},`Flow.setStepData`),V(`data`,n,Jr,`Flow.setStepData`),!n||!r.has(e)?h:(u(()=>{c.stepData[e]={...$(c.stepData[e]),...n},t.cache&&Object.assign(c.data,n),c.version+=1}),i.silent||x(),h)),w=e=>(g(`setData`),V(`data`,e,Jr,`Flow.setData`),e?(u(()=>{Object.assign(c.data,e),c.version+=1}),x(),h):h),T=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return l.destroyed?(e(),()=>{}):(p.add(e),()=>p.delete(e))},E=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},D=async(e,t)=>{if(typeof e!=`function`)return;let n=await e(...t);if(l.destroyed)throw E();return n},O=(e={})=>{let t=e.step||_();return{...e,flow:h,step:t,state:c,signal:l.actionController?.signal||null,snapshot:b(),data:$(c.data),currentData:v(t.id),setData:w,setStepData:(e,t)=>C(e,t),getStepData:v,next:e=>h.next(e),back:e=>h.back(e),goTo:(e,t,n)=>h.goTo(e,t,n),addCleanup:T}},k=(e,n=null)=>{u(()=>{c.error=e,c.version+=1}),t.onError?.(e,b(),h,n)},A=(e,t)=>{let n=b();(c.loading!==e||c.busyAction!==t)&&(u(()=>{c.loading=e,c.busyAction=e?t:null,c.version+=1}),x(n))},j=e=>{if(!c.loading)return null;let n=Error(`Flow: action "${e}" ignored while loading.`);if(n.code=`FLOW_BUSY`,t.onBusy?.(e,b(),h),t.busyStrategy===`throw`)throw n;return b()},M=async(e,t,n=!1)=>{let r=!n&&!c.loading;r&&(l.actionController=new AbortController,l.activeAction=e,A(!0,e));try{return await t()}catch(e){if(l.destroyed)return null;throw c.error!==e&&k(e),e}finally{r&&!l.destroyed&&(A(!1,null),l.activeAction=null,l.actionController=null)}},N=()=>({currentId:c.currentId,currentIndex:c.currentIndex,previousId:c.previousId,previousIndex:c.previousIndex,direction:c.direction,history:[...c.history],data:$(c.data),stepData:$(c.stepData),loading:c.loading,busyAction:c.busyAction,error:c.error,version:c.version}),P=e=>{u(()=>{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),S(c.data,e.data),S(c.stepData,e.stepData),c.loading=!0,c.busyAction=e.busyAction,c.error=e.error,c.version=e.version+1})},F=e=>{if(typeof e==`number`){if(!n[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=r.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},I=async(e,n,i,a)=>{let o=b(),s=N();try{if(i&&C(a.id,i,{silent:!0}),a.canLeave&&await D(a.canLeave,[O({direction:n,targetId:e.id})])===!1)throw Error(`Flow: step "${a.id}" blocked leaving.`);if(e.canEnter&&await D(e.canEnter,[O({direction:n,fromId:a.id,step:e})])===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await D(a.onLeave,[O({direction:n,step:a,targetId:e.id})]);let t=c.currentId,s=c.currentIndex;u(()=>{c.previousId=t,c.previousIndex=s,c.currentId=e.id,c.currentIndex=r.get(e.id)??0,c.direction=n,n===`back`?c.history.pop():c.history.push(e.id),c.error=null,c.version+=1}),await D(e.onEnter,[O({direction:n,fromId:t,step:e})]),x(o)}catch(e){throw l.destroyed?e:(t.rollbackOnError&&P(s),k(e,o),e)}},L=async(e,n,r,i)=>{let a=e===`back`?n.onBack:n.onNext,o=e===`back`?t.onBack:t.onNext,s=O({payload:r,targetId:i});return await D(a,[s])??await D(o,[s])??i},R=e=>{let t=b();return{flow:h,snapshot:t,state:c,steps:n.map(y),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>h.next(e),back:e=>h.back(e),goTo:(e,t,n)=>h.goTo(e,t,n),reset:()=>h.reset()}},ee=(e,n)=>{let r=t[e];return r===!1?null:typeof r==`function`?()=>c.version>=0?r(R(n)):null:n()},z=()=>{let e=_().content;return typeof e==`function`?e(O()):e??``},B=()=>Q({name:`FlowView`,props:{},state:c,view:()=>f(`div`,{className:t.className.root,id:t.id,role:`group`,"data-flow":`root`,"aria-busy":()=>c.loading?`true`:`false`,children:[f(`div`,{className:t.className.header,"data-flow-header":``,children:U(ee(`renderHeader`,()=>f(`ol`,{className:t.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:n.map((e,n)=>f(`li`,{className:()=>[t.className.step,n===c.currentIndex?t.className.active:``,n<c.currentIndex?t.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(n),"aria-current":()=>n===c.currentIndex?`step`:null,children:f(`button`,{type:`button`,className:t.className.stepButton,disabled:()=>t.linear&&n>c.currentIndex,"aria-current":()=>n===c.currentIndex?`step`:null,onClick:()=>{n!==c.currentIndex&&h.goTo(n)},children:[f(`span`,{className:t.className.stepIndex,"data-flow-step-number":``,children:n+1}),f(`span`,{className:t.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))})))}),f(`div`,{className:t.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>c.loading?`true`:`false`,children:U(ee(`renderBody`,()=>()=>c.version>=0?z():null))}),f(`div`,{className:t.className.footer,"data-flow-footer":``,children:U(ee(`renderFooter`,()=>[t.showReset?f(`button`,{type:`button`,className:[t.className.button,t.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>h.reset(),disabled:()=>c.loading,children:t.text.reset}):null,t.showBack?f(`button`,{type:`button`,className:[t.className.button,t.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void h.back(),disabled:()=>!h.canBack,children:t.text.back}):null,t.showNext?f(`button`,{type:`button`,className:[t.className.button,t.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void h.next(),disabled:()=>c.loading,children:()=>h.isLast?t.text.finish:t.text.next}):null]))})]})});return h={props:t,steps:n,state:c,runtime:l,get element(){return m?.element||null},get currentStep(){return _()},get currentData(){return v(c.currentId)},get canBack(){return c.currentIndex>0&&!c.loading},get canNext(){return c.currentIndex<n.length-1&&!c.loading},get isLast(){return c.currentIndex===n.length-1},build(){return g(`build`),l.built?h:(t.render&&(m||=B(),m.build()),l.built=!0,h)},mount(e){return g(`mount`),h.build(),m&&m.mount(e),l.mounted=!!m,h},unmount(){return g(`unmount`),m?.unmount(),l.mounted=!1,h},subscribe(e){if(g(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return d.add(e),e(b(),h,null),()=>d.delete(e)},snapshot:b,async next(e=null){return g(`next`),V(`payload`,e,Jr,`Flow.next`),j(`next`)||M(`next`,async()=>{if(h.isLast)return e&&C(c.currentId,e),await D(t.onFinish,[b(),h]),b();let r=_(),i=n[c.currentIndex+1]?.id,a=Zr(await L(`next`,r,e,i),i);return h.goTo(a.id,a.data??e,{direction:`next`,internal:!0})})},async back(e=null){return g(`back`),V(`payload`,e,Jr,`Flow.back`),j(`back`)||(h.canBack?M(`back`,async()=>{let t=_(),r=n[c.currentIndex-1]?.id,i=Zr(await L(`back`,t,e,r),r);return h.goTo(i.id,i.data??e,{direction:`back`,internal:!0})}):b())},async goTo(e,t=null,r={}){return g(`goTo`),V(`payload`,t,Jr,`Flow.goTo`),(r.internal?null:j(`goTo`))||M(`goTo`,async()=>{let i=F(e),a=n[i],o=_();return a.id===c.currentId?(t&&C(c.currentId,t),b()):(await I(a,r.direction||`go`,t,o),b())},!!r.internal)},setData:w,setStepData:C,getStepData:v,reset(){return g(`reset`),u(()=>{c.currentId=a,c.currentIndex=r.get(a)??0,c.previousId=null,c.previousIndex=null,c.direction=null,c.history.splice(0,c.history.length,a),S(c.data,$(s)),S(c.stepData,$(o)),c.loading=!1,c.busyAction=null,c.error=null,c.version+=1}),x(),h},async finish(e=null){return g(`finish`),V(`payload`,e,Jr,`Flow.finish`),j(`finish`)||M(`finish`,async()=>(e&&C(c.currentId,e),await D(t.onFinish,[b(),h]),b()))},destroy(){if(!l.destroyed){l.destroyed=!0,l.actionController?.abort(),l.actionController=null,l.activeAction=null,m?.destroy(),m=null;for(let e of p)e();p.clear(),d.clear(),l.built=!1,l.mounted=!1,r.clear()}}},h}const ti={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 ni(e){return{...e,text:{...e.text},className:{...e.className}}}function ri(e){return{content:e.content,loading:!1,processing:!1,visible:!1}}function ii(e){return!!e&&typeof e.then==`function`}function ai(e){return Number.isFinite(e)?Math.max(0,e):0}const oi={type:`renderable`},si={default:{},type:`object`,plain:!0,normalize:e=>{let t=j(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`}}},ci={content:{default:``,...oi},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:si,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()||J():e??J()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:ti,type:`object`,normalize:e=>({...ti,...e&&typeof e==`object`?e:{}})}},li={content:ci.content,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`}},ui={type:`plainObject`};function di(e){let t=H(e,ci,`Modal`);return{content:t.content,cache:t.cache,ttl:ai(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 fi=0,pi=``;function mi(t={}){let n=di(t),r=i(ri(n)),o={initial:ni(n),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},s=new Map,[l,d]=c(!1),[p,h]=c({value:null}),g,v=null,y=null,b=!1,x=0,S=()=>r.processing,C=e=>{if(!n.cache||!o.hasContent||o.contentSource!==e)return!1;let t=ai(n.ttl);return!t||Date.now()-o.updatedAt<=t},T=(e,t)=>{n.cache&&(o.content=t,o.contentSource=e,o.hasContent=!0,o.updatedAt=Date.now())},E=()=>{o.content=null,o.contentSource=null,o.hasContent=!1,o.updatedAt=0},D=()=>{for(let e of s.values())e();s.clear()},O=(e,t,n,r)=>{s.get(e)?.(),t.addEventListener(n,r),s.set(e,()=>t.removeEventListener(n,r))},A=()=>{b||=(fi===0&&(pi=document.body.style.overflow,document.body.style.overflow=`hidden`),fi+=1,!0)},j=()=>{b&&=(fi=Math.max(0,fi-1),fi===0&&(document.body.style.overflow=pi,pi=``),!1)},M=()=>{let e=o.previousActiveElement;o.previousActiveElement=null,e&&document.contains(e)&&e.focus()},N=Rt({elements:()=>[g.element,v],mount:()=>{g.mount(document.body),A()},activate:()=>d(!0),deactivate:()=>d(!1),motion:ut(pt(()=>g.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),pt(()=>v,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{g.unmount(),j(),M()}}),P=()=>{if(r.loading||r.processing){y||=zt(),v&&y.parentElement!==v&&v.append(y);return}y?.remove(),y=null},F=e=>{r.processing!==e&&u(()=>{r.processing=e})},I=()=>{r.visible&&N.phase!==`leaving`&&F(!1)},L=(e=r.content)=>{if(C(e)){x+=1,u(()=>{h({value:o.content}),r.loading=!1});return}let t=++x;if(typeof e!=`function`){E(),u(()=>{h({value:e}),r.loading=!1});return}let n;try{n=e(g)}catch(e){console.error(`Modal.content error:`,e),u(()=>{h({value:null}),r.loading=!1});return}if(!ii(n)){T(e,n),u(()=>{h({value:n}),r.loading=!1});return}u(()=>{r.loading=!0,h({value:null})}),Promise.resolve(n).then(n=>{g.runtime.destroyed||t!==x||(T(e,n),u(()=>{h({value:n})}))}).catch(e=>{g.runtime.destroyed||t!==x||(console.error(`Modal.content error:`,e),u(()=>{h({value:null})}))}).finally(()=>{!g.runtime.destroyed&&t===x&&u(()=>{r.loading=!1})})},R=()=>{if(S())return;let e;try{e=n.onConfirm?.(g)}catch(e){console.error(`Modal.onConfirm error:`,e);return}ii(e)&&(F(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{g.runtime.destroyed||I()}))},ee=()=>{if(S())return;let e;try{e=n.onCancel?.(g)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!ii(e)){g.hide();return}F(!0),Promise.resolve(e).then(()=>{g.runtime.destroyed||g.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{g.runtime.destroyed||I()})},z=e=>{if(!v)return;let t=K(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,v).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),v.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())},B=()=>{if(!v)return;let e=G(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,v);e?e.focus():(v.setAttribute(`tabindex`,`-1`),v.focus())},te=()=>{let e=g.element;!e||!v||(D(),O(`root`,e,`click`,t=>{n.bgClose&&!S()&&t.target===e&&g.hide()}),O(`dialog`,v,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?ee():t===`confirm`&&R()}),O(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!r.visible||(e.key===`Escape`&&n.escClose&&!S()?(e.preventDefault(),g.hide()):e.key===`Tab`&&z(e))}))},ne=()=>{if(N.phase===`visible`||N.phase===`entering`)return;if(!g.element)throw Error(`Modal.show: build() must be called before show().`);n.onShow?.(g),o.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=N.enter();te(),B(),e.then(e=>{e&&!g.runtime.destroyed&&n.onShown?.(g)})},re=()=>{N.phase!==`hidden`&&N.phase!==`leaving`&&(n.onHide?.(g),D(),x+=1,N.leave().then(e=>{e&&!g.runtime.destroyed&&(u(()=>{r.loading=!1,r.processing=!1,n.cache||h({value:null})}),n.onHidden?.(g))}))};return g=Q({name:`Modal`,props:n,state:r,actions:{show(){if(!g.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return g.setState(`visible`,!0),g},hide(){return u(()=>{r.visible=!1}),g},reset(){return g.setState({content:o.initial.content,loading:!1,processing:!1}),E(),h({value:null}),g}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){V(`state`,e,ui,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(li,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);V(t,e[t],li[t],`Modal.setState`)}},view:()=>{v=f(`div`,{className:k(n.className.modal,n.fullscreen?`is-fullscreen`:``),id:n.id,role:`document`,"data-modal-dialog":n.id,...n.style?{style:n.style}:{},"data-mount":()=>l()?`true`:`false`,children:[n.header?f(`div`,{className:n.className.header,children:()=>r.loading?null:[f(`div`,{className:n.className.title,id:`${n.id}_title`,"aria-label":n.text.title,children:n.text.title}),n.showClose?f(`button`,{type:`button`,className:k(n.className.button,n.className.closeBtn),"data-action":`close`,"aria-label":e(`Close`,_),disabled:S,children:w(`close`)}):null]}):null,f(`div`,{className:n.className.body,"data-modal-body":``,children:()=>U(p().value)}),n.footer?f(`div`,{className:n.className.footer,children:()=>r.loading?null:[n.showCancel?f(`button`,{type:`button`,className:k(n.className.button,n.className.cancelBtn),"data-action":`cancel`,disabled:S,children:n.text.cancel}):null,f(`button`,{type:`button`,className:k(n.className.button,n.className.confirmBtn),"data-action":`confirm`,disabled:S,children:n.text.confirm})]}):null]});let t=Ht({className:n.className.layout,position:n.position,component:`modal`,labelledby:n.header?`${n.id}_title`:``,content:v});return t.setAttribute(`data-mount`,`false`),n.header||t.setAttribute(`aria-label`,n.text.title||`Modal`),a(()=>{t.setAttribute(`data-mount`,l()?`true`:`false`)}),a(P),a(()=>{let e=r.visible;m(()=>e?ne():re())}),a(()=>{let e=r.visible,t=r.content;m(()=>{e?L(t):x+=1})}),t},onDestroy(){let e=N.phase!==`hidden`;e&&n.onHide?.(g),N.cancel(),D(),j(),M(),y?.remove(),y=null,v=null,e&&n.onHidden?.(g)}}),g}const hi={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`},gi={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:hi,type:`object`,normalize:e=>({...hi,...e&&typeof e==`object`?e:{}})}},_i={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`}},vi={data:{type:`array`},loading:{type:`boolean`},index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function yi(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function bi(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function xi(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function Si(e){return Array.isArray(e)?xi(e):e}function Ci(e={}){let t=H(e,gi,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:Si(t.data),className:{...t.className}}}function wi(e={}){let n=Ci(e),r=i({data:xi(Array.isArray(n.data)?n.data:[]),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),s=q(),c=new WeakMap,l=new Set,d,p=null,m=[],h=()=>[],g=()=>[],_=0,v=null,y=null,b=[],x=null,S=!1,C=!1,T=!1,E=!1,D=e=>(c.has(e)||c.set(e,J()),c.get(e)),O=e=>{let t=e.map((e,t)=>(V(String(t),e,_i,`Swiper.state.data`),{...e,blank:e.blank!==!1,index:t,key:D(e)}));return t.some(e=>e.sort!=null)?t.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):t},A=e=>{let t=e.map((e,t)=>({item:e,index:t,clone:null,key:`real:${e.key}:${!!e.url}`}));if(!n.loop||e.length<=1)return t;let r=e[0],i=e[e.length-1];return[{item:i,index:e.length-1,clone:`last`,key:`clone:last:${i.key}:${!!i.url}`},...t,{item:r,index:0,clone:`first`,key:`clone:first:${r.key}:${!!r.url}`}]},j=()=>h().length,M=()=>g().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},P=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},F=()=>{m=p?K(`[data-swiper-slide]`,p):[]},I=()=>{for(let e of l)e();l.clear()},L=()=>{let e=d.element;if(!e)return;let t=e.clientWidth||e.offsetWidth;(t>0||!e.isConnected||r.width===0)&&u(()=>{r.width=t})},R=()=>!!d.element?.isConnected&&r.width>0,ee=()=>(L(),R()),z=(e,t=!0)=>{let i=bi(e),a=-i*r.width,o=t&&n.speed>0&&r.width>0&&r.transform!==a;u(()=>{r.trackIndex=i,r.index=N(i),r.transform=a,r.animating=o})},B=()=>{let e=[r.trackIndex];r.trackIndex>0&&e.push(r.trackIndex-1),r.trackIndex<m.length-1&&e.push(r.trackIndex+1);for(let t of e){let e=m[t]?G(`img[data-lazy]`,m[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,l.delete(r)};l.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())}},te=()=>{v&&=(clearInterval(v),null)},ne=()=>{d.runtime.destroyed||v||j()<=1||ee()&&(v=setInterval(()=>d.next(),Math.max(n.delay,16)))},re=()=>{n.autoplay&&!v&&!d.runtime.destroyed&&ne()},ie=()=>{te(),n.autoplay&&ne()},ae=e=>{b.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),b.length>5&&b.shift()},oe=()=>b.length?{x:b[b.length-1].x-b[0].x,y:b[b.length-1].y-b[0].y}:{x:0,y:0},se=(e=!0)=>{let t=-r.trackIndex*r.width,n=e&&r.transform!==t;S=!1,C=!1,T=!1,b=[],x=null,u(()=>{r.transform=t,r.animating=n}),re()},ce=(e,t)=>{r.animating||!ee()||(b=[],ae(e),x=t,S=!0,C=!1,T=!1,E=!1,te(),u(()=>{r.animating=!1}))},le=(e,t)=>{if(!S||C||r.animating)return;ae(e);let i=oe(),a=Math.abs(i.x),o=Math.abs(i.y);if(!(a<6&&o<6)){if(!T)if(Math.atan2(o,a)*180/Math.PI<n.touchAngle)T=!0,E=yi(x);else{C=!0,se(!0);return}t.preventDefault(),u(()=>{r.transform=-r.trackIndex*r.width+i.x*n.touchRatio})}},ue=()=>{if(!S)return;if(S=!1,!T||r.width<=0){se(!0);return}let e=b.length?b[b.length-1].time-b[0].time:0,t=oe().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))),d.slideToTrack(r.trackIndex+a*(t>0?-1:1)),b=[],re()},de=e=>{e.target!==p||!(`propertyName`in e)||e.propertyName!==`transform`||(u(()=>{r.animating=!1}),!(!n.loop||j()<=1)&&(r.trackIndex===0?z(j(),!1):r.trackIndex===M()-1&&z(1,!1)))},H=()=>{let e=d.element;!e||!p||(s.clear(),s.on(`touchstart`,p,`touchstart`,e=>{let t=e.touches[0];t&&ce(t,e.target)},{passive:!0}),s.on(`touchmove`,p,`touchmove`,e=>{let t=e.touches[0];t&&le(t,e)},{passive:!1}),s.on(`touchend`,p,`touchend`,e=>{let t=e.changedTouches[0];t&&ae(t),ue()}),s.on(`touchcancel`,window,`touchcancel`,()=>se(!0)),s.on(`mousedown`,p,`mousedown`,e=>{let t=e;t.button===0&&(ce(t,t.target),p?.style.setProperty(`cursor`,`grabbing`))}),s.on(`mousemove`,window,`mousemove`,e=>{let t=e;S&&t.buttons===1&&le(t,e)}),s.on(`mouseup`,window,`mouseup`,e=>{S&&(p?.style.setProperty(`cursor`,`grab`),ae(e),ue())}),s.on(`click`,p,`click`,e=>{!E||!n.preventClick||(e.preventDefault(),e.stopPropagation(),E=!1)},{capture:!0}),s.on(`dragstart`,p,`dragstart`,e=>e.preventDefault()),s.on(`transitionend`,p,`transitionend`,de),s.on(`resize`,window,`resize`,fe),s.on(`mouseenter`,e,`mouseenter`,te),s.on(`mouseleave`,e,`mouseleave`,re),s.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`?d.prev():n.dataset.action===`next`?d.next():n.dataset.swiperBullet!=null&&d.slideTo(Number(n.dataset.swiperBullet)))}))},fe=()=>{if(!d.runtime.built)return;te(),I(),F();let e=Math.min(r.index,Math.max(0,j()-1));L(),z(P(e),!1),n.lazyload&&B(),n.autoplay&&R()&&re()},pe=St(fe),me=()=>{y==null&&typeof requestAnimationFrame==`function`&&(y=requestAnimationFrame(()=>{y=null,!d.runtime.destroyed&&d.element?.isConnected&&fe()}))},he=async()=>{if(typeof n.data!=`function`)return;let e=++_;u(()=>{r.loading=!0});try{let t=await Promise.resolve(n.data(d));if(d.runtime.destroyed||e!==_)return;V(`data`,t,{type:`array`},`Swiper.data`);let i=xi(t);O(i),u(()=>{r.data=i})}finally{!d.runtime.destroyed&&e===_&&u(()=>{r.loading=!1})}},W=()=>{he().catch(e=>{d.runtime.destroyed||console.error(`Swiper.data error:`,e)})},ge=e=>{let t={className:n.className.slide,"data-swiper-slide":()=>String(e().index),"data-swiper-index":()=>e().clone?null:String(e().index),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${e().index+1}`,children:()=>{let{item:t,index:r}=e(),i={swiper:d,item:t,index:r};return t.children==null?[t.image?f(`img`,{className:n.className.image,alt:t.title||``,loading:`lazy`,...n.lazyload?{"data-lazy":t.image}:{src:t.image}}):null,t.title?f(`span`,{className:n.className.title,children:t.title}):null]:U(typeof t.children==`function`?t.children(i):t.children)}};return e().item.url?f(`a`,{...t,href:()=>e().item.url||``,target:()=>e().item.blank?`_blank`:`_self`}):f(`div`,t)};return d=Q({name:`Swiper`,props:n,state:r,actions:{slideTo(e){d.slideToTrack(P(e))},slideToTrack(e){if(!d.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(r.animating||!m.length||!ee())return;let t=n.loop?Math.max(0,Math.min(e,m.length-1)):Math.max(0,Math.min(e,j()-1));z(t,!0),n.lazyload&&B()},next(){r.animating||d.slideToTrack(r.trackIndex+1)},prev(){r.animating||d.slideToTrack(r.trackIndex-1)},play:ne,pause:te,resume:re,restartAutoplay:ie},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:xi(e.data)}:{}}},validateStatePatch(e){V(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(vi,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);V(t,e[t],vi[t],`Swiper.setState`)}Array.isArray(e.data)&&O(e.data)},view:()=>{h=o(()=>O(r.data)),g=o(()=>A(h()));let e=()=>{let e=zt();return e.setAttribute(`data-swiper-loading`,``),e};p=f(`div`,{className:n.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>r.loading?e():t({each:g,key:e=>e.key,children:ge})});let i=f(`div`,{id:n.id||J(),className:n.className.root,"data-swiper":`root`,"data-status":()=>r.loading?`loading`:`loaded`,children:[p,n.pagination?f(`div`,{className:k(n.className.pagination,n.className.paginationHorizontal,n.className.paginationClickable,n.className.paginationBulletGroup),"data-swiper-pagination":``,children:t({each:h,key:e=>e.key,children:(e,t)=>f(`button`,{type:`button`,className:()=>k(n.className.indicator,n.className.bullet,r.index===t()?n.className.active:``),"data-swiper-bullet":()=>String(t()),"aria-label":()=>`Go to slide ${t()+1}`,"aria-current":()=>r.index===t()?`true`:null})})}):null,n.navigation?f(`button`,{type:`button`,className:()=>k(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:w(`arrow-left`)}):null,n.navigation?f(`button`,{type:`button`,className:()=>k(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:w(`arrow-right`)}):null]});return a(()=>{p?.style.setProperty(`transform`,`translate3d(${r.transform}px, 0, 0)`),p?.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`)}),a(()=>{(h().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||r.data.length===0)&&pe.schedule()}),i},onBuild(e){!e.element||!p||(p.setAttribute(`aria-live`,`polite`),F(),H(),L(),z(P(r.index),!1),n.lazyload&&B(),n.autoplay&&R()&&ne(),e.own(()=>s.clear()),W(),me())},onMount(){fe(),me()},onDestroy(){te(),pe.dispose(),_+=1,I(),y!=null&&cancelAnimationFrame(y),y=null,p=null,m=[]}}),Object.defineProperties(d,{realCount:{enumerable:!0,get:j},realIndex:{enumerable:!0,get:()=>N()}}),d}const Ti={root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`panel-list`,panel:`panel-item`,dragging:`dragging`},Ei={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||J():e??J()},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:Ti,type:`object`,normalize:e=>({...Ti,...e&&typeof e==`object`?e:{}})}},Di={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},Oi={data:Ei.data,active:Ei.active,disabled:Ei.disabled};function ki(e,t,n=`Tabs.data`){V(String(t),e,Di,n);let r=(typeof e.name==`string`?e.name.trim():``)||J();return{...e,name:r}}function Ai(e,t=`Tabs.data`){V(`data`,e,Oi.data,t);let n=new Set;return e.map((e,r)=>{let i=ki(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 ji(e){return Array.isArray(e)?[...e]:e}function Mi(e){let t=H(e,Ei,`Tabs.props`);return{id:t.id,direction:t.direction,active:t.active,disabled:ji(t.disabled),onChange:t.onChange,data:Ai(t.data,`Tabs.props.data`),className:t.className}}function Ni(e){return typeof e==`number`&&e>0?e:0}function Pi(e={}){let n=Mi(e),r=i({data:n.data,active:n.active,disabled:n.disabled,draggable:!1,dragging:!1,loading:!1}),s=q(),l=Dt(),d=Dt(),m=Ot(),h=Ot(),g=new Map,_=new Map,v,y=0,b=!1,x=0,S=0,C=0,w=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),T=()=>{let e=w(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},E=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},D=()=>{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`)))},O=e=>D().includes(e),A=e=>E()===e,j=o(()=>r.data),M=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=n.direction===`left`||n.direction===`right`?t.scrollHeight>e.clientHeight+5:t.scrollWidth>e.clientWidth+5;r.draggable!==i&&u(()=>{r.draggable=i})},N=St(M),P=()=>{let e=l.current;if(!e)return;let t=C,r=performance.now(),i=n.direction===`left`||n.direction===`right`,a=n=>{let o=n-r;r=n,t*=.92,!(Math.abs(t)<.3)&&(i?e.scrollTop+=t*o*.05:e.scrollLeft+=t*o*.05,x=requestAnimationFrame(a))};x=requestAnimationFrame(a)},F=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=0,a=0,o=0,c=!1,f=0,p=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},m=t=>{r.draggable&&(!(t instanceof MouseEvent)&&!(t instanceof TouchEvent)||(b=!0,u(()=>{r.dragging=!0}),i=p(t),o=i,a=n.direction===`left`||n.direction===`right`?e.scrollTop:e.scrollLeft,C=0,cancelAnimationFrame(x)))},h=t=>{if(!b||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let r=p(t);f=i-r,C=o-r,o=r,!c&&(c=!0,requestAnimationFrame(()=>{c=!1,n.direction===`left`||n.direction===`right`?e.scrollTop=a+f:e.scrollLeft=a+f}))},g=()=>{b&&(b=!1,u(()=>{r.dragging=!1}),P())};s.on(`drag:mousedown`,t,`mousedown`,m),s.on(`drag:touchstart`,t,`touchstart`,m,{passive:!0}),s.on(`drag:mousemove`,window,`mousemove`,h,{passive:!1}),s.on(`drag:touchmove`,window,`touchmove`,h,{passive:!1}),s.on(`drag:mouseup`,window,`mouseup`,g),s.on(`drag:touchend`,window,`touchend`,g)},I=async e=>{if(!v.runtime.built)throw Error(`Tabs.activate: call build() first.`);let t=w(e),i=r.data[t];if(!i)return;let a=i.name;O(a)||A(a)||(u(()=>{r.active=e}),await _.get(a)?.(),await Promise.resolve(n.onChange?.(t,a,m.get(a),h.get(a))))},L=(e,t)=>{let i=e().name,o=e().content,[s,l]=c(typeof o==`function`?null:o),[d,m]=c(!1),b=o,x=0,S=null,C=()=>({tabs:v,item:e(),index:t(),name:i}),w=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){l(n);return}let a=t.cache?g.get(i):null,o=Ni(t.ttl);if(a&&(!o||Date.now()-a.updatedAt<=o)){l(a.content);return}if(S)return S;let s=++x;y+=1;let c=y;m(!0),u(()=>{r.loading=!0});let d=Promise.resolve().then(()=>n(C())).then(t=>{s!==x||v.runtime.destroyed||(e().cache&&g.set(i,{content:t,updatedAt:Date.now()}),l(t))}).finally(()=>{s===x&&m(!1),c===y&&!v.runtime.destroyed&&u(()=>{r.loading=!1}),S===d&&(S=null)});return S=d,d};_.set(i,w),p(()=>{g.delete(i),_.delete(i)}),a(()=>{let t=e().content;t!==b&&(b=t,x+=1,S=null,g.delete(i),l(typeof t==`function`?null:t)),A(i)&&w()});let T=()=>{if(d())return zt(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(C()):e};return f(`div`,{className:n.className.panel,"data-tabs-panel":i,role:`tabpanel`,"aria-hidden":()=>A(i)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(d()),hidden:()=>!A(i),ref:h.bind(i),children:()=>U(T())})},R=(e,t)=>{let r=e().name;return f(`div`,{className:n.className.tab,"data-tabs-tab":r,role:`tab`,"aria-selected":()=>A(r)?`true`:`false`,"aria-disabled":()=>O(r)?`true`:`false`,ref:m.bind(r),children:()=>U(e().title)})};return v=Q({name:`Tabs`,props:n,state:r,actions:{activate:I},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Ai(e.data,`Tabs.setState.data`)}:{},...Object.hasOwn(e,`disabled`)&&Array.isArray(e.disabled)?{disabled:ji(e.disabled)}:{}}},validateStatePatch(e){V(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Oi,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;V(t,e[t],Oi[n],`Tabs.setState`)}},view:()=>(a(()=>{let e=r.data.length;return N.schedule(),e}),f(`div`,{className:n.className.root,id:n.id,"data-tabs":`root`,"data-tabs-direction":n.direction,children:[f(`div`,{className:n.className.wrap,"data-tabs-wrap":``,ref:l.set,children:f(`nav`,{className:()=>k(n.className.list,r.dragging&&n.className.dragging),"data-tabs-list":``,ref:d.set,children:t({each:j,key:e=>e.name,children:(e,t)=>R(e,t)})})}),f(`div`,{className:n.className.panelWrap,"data-tabs-panel-wrap":``,children:t({each:j,key:e=>e.name,children:(e,t)=>L(e,t)})})]})),onBuild(e){let t=e.element;t&&(s.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!O(t)&&I(t)}),s.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(S),S=requestAnimationFrame(M)}),F(),e.own(()=>s.clear()),N.schedule(),_.get(T().name||``)?.())},onMount(){N.schedule()},onDestroy(){y+=1,N.dispose(),cancelAnimationFrame(x),cancelAnimationFrame(S),g.clear(),_.clear(),m.clear(),h.clear()}}),Object.defineProperties(v,{current:{enumerable:!0,get:T},activeIndex:{enumerable:!0,get:()=>T().index},disabledNames:{enumerable:!0,get:D}}),v}const Fi={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},Ii={top:`translateY(-100%)`,right:`translateX(100%)`,bottom:`translateY(100%)`,left:`translateX(-100%)`},Li={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()||J():e??J()},className:{default:Fi,type:`object`,normalize:e=>({...Fi,...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`]}},Ri={content:Li.content,resolvedContent:{type:`renderable`},visible:{type:`boolean`},loading:{type:`boolean`}};function zi(e){return e>0?e:0}function Bi(e){let t=H(e,Li,`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 Vi=0,Hi=``;function Ui(e){V(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Ri,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;V(t,e[t],Ri[n],`Offcanvas.setState`)}}function Wi(e={}){let t=Bi(e),n=i({content:t.content,resolvedContent:typeof t.content==`function`?null:t.content,visible:!1,loading:!1}),r={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},o=q(),s=Dt(),c,l=!1,p=()=>{!t.bodyOverflow||l||(Vi===0&&(Hi=document.body.style.overflow,document.body.style.overflow=`hidden`),Vi+=1,l=!0)},h=()=>{l&&=(Vi=Math.max(0,Vi-1),Vi===0&&(document.body.style.overflow=Hi,Hi=``),!1)},g=pt(()=>c.element,{keyframes:[{transform:Ii[t.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),_=Rt({elements:()=>[s.current,c.element],mount:()=>{let e=s.current;e&&!e.isConnected&&d(document.body,e),c.mount(document.body),p()},activate:()=>{n.visible=!0},deactivate:()=>{n.visible=!1},motion:ut(...t.animate===`slide`?[g]:[],pt(()=>s.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{s.current?.remove(),c.unmount(),h()}}),v=()=>{r.cache={content:null,hasContent:!1,updatedAt:0}},y=()=>{if(!t.cache||!r.cache.hasContent)return!1;let e=zi(t.ttl);return!e||Date.now()-r.cache.updatedAt<=e},b=async()=>{let e=n.content;if(typeof e!=`function`){r.contentLoadId+=1,u(()=>{n.resolvedContent=e,n.loading=!1});return}if(y()){r.contentLoadId+=1,u(()=>{n.resolvedContent=r.cache.content,n.loading=!1});return}let i=++r.contentLoadId;u(()=>{n.loading=!0,n.resolvedContent=null});try{let a=await Promise.resolve(e(c));if(c.runtime.destroyed||i!==r.contentLoadId)return;t.cache&&(r.cache={content:a,hasContent:!0,updatedAt:Date.now()}),u(()=>{n.resolvedContent=a})}finally{!c.runtime.destroyed&&i===r.contentLoadId&&u(()=>{n.loading=!1})}};return c=Q({name:`Offcanvas`,props:t,state:n,actions:{async show(){if(!c.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(n.visible)return;await Promise.resolve(t.onShow?.(c));let e=_.enter(),r=b();await e&&!c.runtime.destroyed&&t.onShown?.(c),await r},async hide(){if(!c.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!n.visible)return;let e=t.onHide?.(c);e&&await e,r.contentLoadId+=1,u(()=>{n.loading=!1}),await _.leave()&&t.onHidden?.(c)}},validateStatePatch:Ui,view(e){let i=t.overlay?f(`div`,{ref:s.set,className:t.className.overlay,"data-offcanvas-overlay":t.id,"data-mount":()=>n.visible?`true`:`false`,style:t.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{t.bgClose&&c.hide()}}):null;return i&&e.own(()=>i.remove()),a(()=>{let e=n.content;V(`content`,e,Ri.content,`Offcanvas.state`),v(),typeof e==`function`?(n.resolvedContent=null,m(()=>n.visible)&&b()):(r.contentLoadId+=1,n.resolvedContent=e,n.loading=!1)}),f(`div`,{className:t.className.root,id:t.id,role:`dialog`,"aria-modal":t.overlay?`true`:`false`,"aria-expanded":()=>String(n.visible),"data-mount":()=>n.visible?`true`:`false`,"data-offcanvas":`root`,"data-direction":t.direction,"data-animate":t.animate,onClick:e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-action]`);(t?.dataset.action===`close`||t?.dataset.action===`cancel`)&&c.hide()},children:f(`div`,{className:t.className.content,"data-offcanvas-content":t.id,children:()=>U(n.loading?zt():typeof n.resolvedContent==`function`?n.resolvedContent(c):n.resolvedContent)})})},onBuild(e){t.escClose&&o.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&n.visible&&c.hide()}),e.own(()=>o.clear())},onDestroy(){_.cancel(),r.contentLoadId+=1,s.current?.remove(),h()}}),c}const Gi={size:10,current:1},Ki={sibling:1,boundary:1},qi={root:`j-pagination`,list:`pagination`,item:`item`,more:`more`,button:`j-button is-icon is-ghost`,current:`j-button is-icon is-active`,loading:`animate-spin`},Ji={default:0,type:`number`,finite:!0,min:0},Yi={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},Xi={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},Zi={total:Ji,page:{default:()=>({...Gi}),factory:!0,normalize:e=>({...Gi,...e&&typeof e==`object`?e:{}}),...Yi},count:{default:()=>({...Ki}),factory:!0,normalize:e=>({...Ki,...e&&typeof e==`object`?e:{}}),...Xi},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:qi,type:`object`,normalize:e=>({...qi,...e&&typeof e==`object`?e:{}})}},Qi={total:Ji,page:Yi,count:Xi,locked:{type:`boolean`}};function $i(e,t,n){return Math.min(Math.max(e,t),n)}function ea(e,t){return Math.max(1,Math.ceil(e/t))}function ta(e){return{size:e.size,current:e.current}}function na(e){return{sibling:e.sibling,boundary:e.boundary}}function ra(e={}){let t=H(e,Zi,`Pagination.props`),n=ea(t.total,t.page.size);return{...t,page:{size:t.page.size,current:$i(t.page.current,1,n)},count:na(t.count),className:{...t.className}}}function ia(e){return{type:`more`,key:e}}function aa(e){return{type:`page`,key:`page-${e}`,page:e}}function oa(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function sa(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 oa(1,t).map(aa);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?aa(t.page+1):ia(`more-${t.page}-${e}`)),s.push(aa(e))}return s}function ca(e){if(e.type!==`page`)throw Error(`Pagination.itemView: expects page item.`);return e}function la(e={}){let n=ra(e),r=i({total:n.total,page:ta(n.page),count:na(n.count),locked:!1}),s=0,c,l=o(()=>ea(r.total,r.page.size)),d=()=>n.lock&&r.locked,p=()=>d()||r.page.current<=1,m=()=>d()||r.page.current>=l(),h=o(()=>sa(r.page.current,l(),r.count)),g=e=>{n.lock&&!c.runtime.destroyed&&e===s&&u(()=>{r.locked=!1})},_=e=>{if(c.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!c.runtime.built)throw Error(`Pagination.go: call build() first.`);if(V(`page`,e,{type:`number`,integer:!0},`Pagination.go`),d())return c;let t=$i(e,1,l());if(t===r.page.current)return c;let i=n.lock&&typeof n.onChange==`function`,a=i?++s:s;if(u(()=>{r.page.current=t,i&&(r.locked=!0)}),n.onChange){let e;try{e=n.onChange(t,c)}catch(e){throw g(a),e}if(i&&e&&typeof e.then==`function`){let t=()=>g(a);Promise.resolve(e).then(t,t)}else g(a)}return c},v=e=>{let t=e===`prev`?p:m;return f(`li`,{className:n.className.item,"data-pagination-control":e,children:f(`button`,{className:n.className.button,type:`button`,"data-page-action":e,"aria-label":e===`prev`?`Go to previous page`:`Go to next page`,"aria-disabled":()=>t()?`true`:`false`,tabindex:()=>t()?`-1`:null,disabled:t,onClick:()=>{t()||_(r.page.current+(e===`prev`?-1:1))},children:w(e===`prev`?`arrow-left`:`arrow-right`)})})},y=e=>{if(e().type===`more`)return f(`li`,{className:()=>k(n.className.item,e().type===`more`?n.className.more:``),"data-pagination-more":()=>e().type===`more`?e().key:null,children:f(`span`,{className:n.className.button,children:w(`more`)})});let t=()=>ca(e()).page,i=()=>t()===r.page.current;return f(`li`,{className:()=>k(n.className.item,e().type===`more`?n.className.more:``),"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:f(`button`,{className:()=>i()?n.className.current:n.className.button,type:`button`,"data-page":()=>String(t()),"data-current-page":()=>i()?String(t()):null,"aria-current":()=>i()?`page`:null,"aria-label":()=>i()?`Page ${t()}, current page`:`Go to page ${t()}`,"aria-disabled":()=>d()||i()?`true`:`false`,tabindex:()=>d()||i()?`-1`:null,disabled:()=>d()||i(),onClick:()=>{let e=t();!d()&&!i()&&_(e)},children:()=>d()&&i()?f(`i`,{className:n.className.loading,children:w(`loader`)}):String(t())})})};return c=Q({name:`Pagination`,props:n,state:r,actions:{go:_},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&j(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&j(t.count)&&(t.count={...r.count,...t.count}),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(Qi,t))throw Error(`Pagination.setState: "${t}" is not supported.`);let n=t;V(t,e[t],Qi[n],`Pagination.setState`)}},view:()=>(a(()=>{let e=$i(r.page.current,1,l());e!==r.page.current&&(r.page.current=e)}),f(`div`,{className:n.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:f(`ul`,{className:n.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[v(`prev`),t({each:h,key:e=>e.key,children:e=>y(e)}),v(`next`)]})}))}),Object.defineProperty(c,"pageCount",{enumerable:!0,get:l}),c}const ua={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`},da={type:`object`,validate:ya,message:`expects { title, id?, url?, target?, classes?, children? }.`},fa={type:`array`,items:da},pa={type:{default:void 0,types:[`string`,`undefined`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||J():e??J()},data:{default:[],type:`array`,normalize:ba,items:da},backText:{default:e(`b`,_),type:`string`},className:{default:ua,type:`object`,normalize:e=>({...ua,...e&&typeof e==`object`?e:{}})}},ma={data:fa,activeKeys:{type:`array`,items:`string`}};function ha(e={}){let t=H(e,pa,`Menu.props`);return{...t,data:ba(t.data),className:{...t.className}}}function ga(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function _a(e){return`menu-item-${e??J()}`}function va(e){return typeof e==`string`?e.trim():``}function ya(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.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(ya))}function ba(e){return Array.isArray(e)?e.map(e=>{V(`item`,e,da,`Menu.data`);let t={...e};return Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=ba(t.children)),t}):[]}function xa(e={}){let n=ha(e),r=i({data:ba(n.data),activeKeys:[]}),a=new WeakMap,o=q(),s,c=e=>e.id==null?(a.has(e)||a.set(e,J()),a.get(e)):String(e.id),l=e=>r.activeKeys.includes(e),d=e=>{u(()=>{r.activeKeys=n.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},p=e=>{u(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},m=e=>{u(()=>{r.activeKeys=l(e)?[]:[e]})},h=e=>f(`li`,{className:n.className.backItem,"data-menu-back":``,children:f(`a`,{className:n.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),p(e)},children:[f(`span`,{className:n.className.backIcon,children:w(`arrow-left`)}),f(`span`,{className:n.className.text,children:n.backText})]})}),g=(e,r=!1,i)=>f(`ul`,{className:r?n.className.list:n.className.subMenu,...r?{id:n.id}:{},"data-menu-list":r?`root`:`sub`,children:[t({each:()=>n.type===`mobile`&&i&&l(i)?[i]:[],key:e=>e,children:e=>h(e())}),t({each:e,key:e=>c(e),children:e=>{let t=c(e());return f(`li`,{className:()=>{let r=e();return k(n.className.item,r.children?.length?n.className.hasChildren:``,...ga(r.classes),l(t)?n.className.active:``)},id:()=>e().id==null?`menu-item-${t}`:_a(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>e().children?.length?``:null,onClick:r=>{n.type===`mobile`&&r.target===r.currentTarget&&e().children?.length&&d(t)},children:[()=>{let r=e(),i=!!r.children?.length,a=va(r.url);return!i&&!a?f(`span`,{className:n.className.link,"data-menu-link":``,children:r.title}):f(`a`,{className:n.className.link,href:a,target:r.target,"data-menu-link":``,onClick:e=>{i&&(n.type===`mobile`||n.type===`bottom`)&&(e.preventDefault(),n.type===`bottom`?m(t):d(t))},children:r.title})},()=>e().children?.length?g(()=>e().children||[],!1,t):null]})}})]});return s=Q({name:`Menu`,props:n,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`data`)&&(t.data=ba(t.data)),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(ma,t))throw Error(`Menu.setState: "${t}" is not supported.`);let n=t;V(t,e[t],ma[n],`Menu.setState`)}},view:()=>(V(`data`,r.data,fa,`Menu`),f(`nav`,{className:n.className.root,"data-menu":`root`,"data-menu-type":n.type,children:g(()=>r.data,!0)})),onBuild(e){n.type===`bottom`&&(o.on(`outside`,document,`click`,t=>{let n=t.target;!(n instanceof Node)||e.element?.contains(n)||u(()=>{r.activeKeys=[]})}),e.own(()=>o.clear()))}}),s}export{nt as Toast,O as addIcons,K as all,U as asRenderable,st as checkModernBrowser,it as copy,yr as createAccordion,mt as createCollapseTransition,Jt as createDrop,Dt as createElementRef,q as createEventManager,ei as createFlow,Wr as createForm,Ot as createKeyedElementRefs,zt as createLoading,xa as createMenu,mi as createModal,ut as createMotionGroup,Wi as createOffcanvas,kt as createOwnedView,la as createPagination,gn as createParabola,Ht as createPopup,Rt as createPresence,St as createScheduledTask,Et as createStateSync,Sn as createSticky,wi as createSwiper,Pi as createTabs,un as createTheme,or as createToc,$t as createTooltip,pt as createTransition,Xn as createValidator,Q as defineComponent,D as getRegistedIconPath,Ct as getStoreVersion,R as getType,w as icon,T as iconHtml,E as iconMarkup,P as isDomElementValue,N as isDomNodeValue,W as isElement,F as isHtmlElementValue,rt as isMobile,ot as isModernBrowser,M as isNilValue,he as isNode,j as isPlainObject,we as isRenderableContent,I as isRenderablePrimitive,L as isRenderableValue,Te as lazyRender,Ae as listen,lt as postJson,G as q,J as randomId,$n as removeComponentPlugin,Ce as requireContainer,Se as resolveContainer,xe as resolveElement,be as resolveNode,ye as resolveNodeList,H as resolveProps,ct as restUrl,Tt as stateSnapshot,Me as timer,wt as trackStoreVersion,Qn as useComponentPlugin,je as uuid,V as validateParam,Lt as waitForMotion};