@lattice-php/lattice 0.58.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-standalone/chunks/{chart-view-eWW-pC-B.js → chart-view-BxNPMybJ.js} +1 -1
- package/dist-standalone/chunks/{date-picker-field-FY2OOgtu.js → date-picker-field-D_73rR_m.js} +1 -1
- package/dist-standalone/chunks/{field-DMXnzaJF.js → field-CGZayHGR.js} +1 -1
- package/dist-standalone/chunks/{rich-editor-field-B0XwZGpp.js → rich-editor-field-Cp8zPFKl.js} +1 -1
- package/dist-standalone/chunks/runtime-DGQM7tBp.js +162 -0
- package/dist-standalone/chunks/{subscriptions-CSh5RtT7.js → subscriptions-CJ3H8KiC.js} +1 -1
- package/dist-standalone/lattice.js +1 -1
- package/dist-standalone/manifest.json +1 -1
- package/dist-standalone/runtime.js +1 -1
- package/dist-standalone/sprite.svg +1 -1
- package/package.json +6 -6
- package/dist-standalone/chunks/runtime-BjRIrbqh.js +0 -162
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./date-picker-field-D_73rR_m.js","./rolldown-runtime-hePW80VL.js","./react-CwJFpaho.js","./react-dom-Dl-LT-t1.js","./locale-BZOrJtMq.js","./jsx-runtime-NZYk81nU.js","./floating-ui.dom-CAMzcZKV.js","./clsx-CjueKrWZ.js","./input-0lNoXsuO.js","./field-CGZayHGR.js","./instance-D6cXaqIT.js","./timezone-Ckl1gbqB.js","./dist-DAHNiLp2.js","./w3c-keyname-BOAvb0qz.js","./with-selector-Cse0iXU1.js","./rich-editor-field-Cp8zPFKl.js","./registry-context-gXwNT8GJ.js","./notifications-echo-BLO9_g1w.js","./dist-D2qBbka0.js","./code-block-view-4IbUdTmO.js","./chart-view-BxNPMybJ.js","./materialize-CWqnSEHR.js","./color-CXV-Y5Qv.js","./subscriptions-CJ3H8KiC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{t as r}from"./react-CwJFpaho.js";import{n as i,t as a}from"./materialize-CWqnSEHR.js";import{t as o}from"./react-dom-Dl-LT-t1.js";import{a as s,n as c,o as l,r as u,s as d}from"./locale-BZOrJtMq.js";import{t as f}from"./jsx-runtime-NZYk81nU.js";import{i as p,n as m,r as h,t as g}from"./registry-context-gXwNT8GJ.js";import{_,a as v,c as y,d as b,f as x,g as S,h as C,i as w,l as T,m as E,n as D,o as O,p as k,r as ee,s as A,t as j,u as M}from"./floating-ui.dom-CAMzcZKV.js";import{a as N,c as P,i as F,n as I,o as te,r as ne,s as re}from"./instance-D6cXaqIT.js";import{a as L,i as R,o as ie,r as z,s as ae}from"./timezone-Ckl1gbqB.js";import{n as oe,r as se,t as ce}from"./input-0lNoXsuO.js";import{i as le,n as ue,r as de,t as fe}from"./color-CXV-Y5Qv.js";var B=t(r(),1),pe=`modulepreload`,me=function(e,t){return new URL(e,t).href},he={},ge=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=me(t,n),t=s(t),t in he)return;he[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:pe,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function V(e){return{component:e,mode:`eager`}}var _e=[250,1e3,4e3];function ve(e){return async()=>{try{return await e()}catch(t){for(let t of _e){await new Promise(e=>setTimeout(e,t));try{return await e()}catch{continue}}throw t}}}function ye(e){let t=ve(e);return{component:(0,B.lazy)(t),load:t,mode:`lazy`}}var be=e=>ge(()=>import(e),[],import.meta.url);function xe(e){return e===void 0||a(e)&&Object.values(e).every(e=>a(e)&&(e.mode===`eager`&&typeof e.component==`function`||e.mode===`lazy`&&a(e.component)&&typeof e.load==`function`))}function Se(e){return e===void 0||a(e)&&Object.values(e).every(e=>a(e))}function Ce(e,t){let n=a(e)?e.default:void 0;if(!a(n)||typeof n.name!=`string`||n.name.trim()===``||!xe(n.components)||!Se(n.extensions)||n.i18n!==void 0&&(!a(n.i18n)||typeof n.i18n.namespace!=`string`||n.i18n.namespace.trim()===``))throw TypeError(`[lattice] Plugin module [${t}] must default export a Plugin object.`);return n}function we(e,t=be){return Promise.all(e.map(async e=>Ce(await t(e),e)))}function Te(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n??{}))t[e]={...t[e],...r};return t}function Ee(...e){return e.reduce((e,t)=>({components:{...e.components,...t.components},extensions:Te(e.extensions,t.extensions)}),{components:{},extensions:{}})}function De(e,...t){return Ee({name:`registry`,...e},...t)}var Oe=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function ke(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Ae(){}function je(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Me(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ne(e){if(je(e))return e;if(Array.isArray(e)||Me(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function Pe(e){return Oe.Buffer!==void 0&&Oe.Buffer.isBuffer(e)}function Fe(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Ie(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Le=`[object RegExp]`,Re=`[object String]`,ze=`[object Number]`,Be=`[object Boolean]`,Ve=`[object Arguments]`,He=`[object Symbol]`,Ue=`[object Date]`,We=`[object Map]`,Ge=`[object Set]`,Ke=`[object Array]`,qe=`[object Function]`,Je=`[object ArrayBuffer]`,Ye=`[object Object]`,Xe=`[object Error]`,Ze=`[object DataView]`,Qe=`[object Uint8Array]`,$e=`[object Uint8ClampedArray]`,et=`[object Uint16Array]`,tt=`[object Uint32Array]`,nt=`[object BigUint64Array]`,rt=`[object Int8Array]`,it=`[object Int16Array]`,at=`[object Int32Array]`,ot=`[object BigInt64Array]`,st=`[object Float32Array]`,ct=`[object Float64Array]`;function lt(e,t){return ut(e,void 0,e,new Map,t)}function ut(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(je(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=ut(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,ut(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(ut(a,void 0,n,r,i));return t}if(Pe(e))return e.subarray();if(Me(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=ut(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),dt(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),dt(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),dt(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,dt(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),dt(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),dt(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),dt(t,e,n,r,i),t}if(typeof e==`object`&&ft(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),dt(t,e,n,r,i),t}return e}function dt(e,t,n=e,r,i){let a=[...Object.keys(t),...Fe(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=ut(t[s],s,n,r,i))}}function ft(e){switch(Ie(e)){case Ve:case Ke:case Je:case Ze:case Be:case Ue:case st:case ct:case rt:case it:case at:case We:case ze:case Ye:case Le:case Ge:case Re:case He:case Qe:case $e:case et:case tt:return!0;default:return!1}}function pt(e){return ut(e,void 0,e,new Map,void 0)}function mt(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:Object.prototype.toString.call(e)===`[object Object]`}function ht(e){return e===`__proto__`}function gt(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function _t(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function vt(e,t,n){return yt(e,t,void 0,void 0,void 0,void 0,n)}function yt(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return bt(e,t,a,o)}return bt(e,t,a,o)}function bt(e,t,n,r){if(Object.is(e,t))return!0;let i=Ie(e),a=Ie(t);if(i===`[object Arguments]`&&(i=Ye),a===`[object Arguments]`&&(a=Ye),i!==a)return!1;switch(i){case Re:return e.toString()===t.toString();case ze:return _t(e.valueOf(),t.valueOf());case Be:case Ue:case He:return Object.is(e.valueOf(),t.valueOf());case Le:return e.source===t.source&&e.flags===t.flags;case qe:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case We:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!yt(a,t.get(i),i,e,t,n,r))return!1;return!0;case Ge:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>yt(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case Ke:case Qe:case $e:case et:case tt:case nt:case rt:case it:case at:case ot:case st:case ct:if(Pe(e)!==Pe(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!yt(e[i],t[i],i,e,t,n,r))return!1;return!0;case Je:return e.byteLength===t.byteLength&&bt(new Uint8Array(e),new Uint8Array(t),n,r);case Ze:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:bt(new Uint8Array(e),new Uint8Array(t),n,r);case Xe:return e.name===t.name&&e.message===t.message;case Ye:{if(!(bt(e.constructor,t.constructor,n,r)||mt(e)&&mt(t)))return!1;let i=[...Object.keys(e),...Fe(e)],a=[...Object.keys(t),...Fe(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!yt(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function xt(e,t){return vt(e,t,Ae)}function St(e){return Number.isSafeInteger(e)&&e>=0}var Ct={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function wt(e){return e.replace(/[&<>"']/g,e=>Ct[e])}function Tt(e){return e!=null&&typeof e!=`function`&&St(e.length)}function Et(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Et).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Dt(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function Ot(e){if(Array.isArray(e))return e.map(Dt);if(typeof e==`symbol`)return[e];e=Et(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let s=e[r];if(a)s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s;else if(o)s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s;else if(s===`[`)o=!0,i&&=(t.push(i),``);else if(s===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=s;r++}return i&&t.push(i),t}var kt=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function At(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:kt.test(e);default:return!1}}function jt(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(ht(t))return n;let r=e[t];return r===void 0?At(t)&&!Object.hasOwn(e,t)?jt(e,Ot(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=Dt(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Mt(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),ht(t))return n;let r=e[t];return r===void 0?n:r}}}function Mt(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||ht(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function Nt(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Pt(e,t){return lt(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Ie(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),dt(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case ze:case Re:case Be:{let t=new e.constructor(e?.valueOf());return dt(t,e),t}case Ve:{let t={};return dt(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function Ft(e){return Pt(e)}function It(e){return typeof e==`object`&&!!e&&Ie(e)===`[object Arguments]`}var Lt=/^(?:0|[1-9]\d*)$/;function Rt(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return Lt.test(e)}}function zt(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&At(t)&&!(t in Object(e))?Ot(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||It(r))&&Rt(t)&&t<r.length))return!1;r=r[t]}return!0}function Bt(e){return typeof e==`object`&&!!e}function Vt(e){return Bt(e)&&Tt(e)}function Ht(e){return typeof e==`symbol`||e instanceof Symbol}var Ut=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wt=/^\w*$/;function Gt(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||Ht(e)?!0:typeof e==`string`&&(Wt.test(e)||!Ut.test(e))||t!=null&&Object.hasOwn(t,e)}function Kt(e){return Me(e)}var qt=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&_t(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function Jt(e,t,n,r){if(e==null&&!Nt(e))return e;let i;i=Gt(t,e)?[t]:Array.isArray(t)?t:Ot(t);let a=n(jt(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=Dt(i[t]);if(ht(n))continue;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?Nt(a)?a:Rt(i[t+1])?[]:{}:c}qt(o,n,s),o=o[n]}return e}function Yt(e,t,n){return Jt(e,t,()=>n,()=>void 0)}function Xt(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=ke(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Zt(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=Qt(i,t,r,new Map)}return i}function Qt(e,t,n,r){if(je(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return Ne(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...Fe(t)];for(let a=0;a<i.length;a++){let o=i[a];if(ht(o))continue;let s=t[o],c=e[o];if(It(s)&&(s={...s}),It(c)&&(c={...c}),Pe(s)&&(s=Ft(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(Vt(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||Bt(c)&&Bt(s)&&(gt(c)||gt(s)||Kt(c)||Kt(s))?e[o]=Qt(c,s,n,r):c==null&>(s)?e[o]=Qt({},s,n,r):c==null&&Kt(s)?e[o]=Ft(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function $t(e,...t){return Zt(e,...t,Ae)}function en(e){return wt(Et(e))}var tn=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0,nn=e=>e instanceof FormData||tn(e)||typeof e==`object`&&!!e&&Object.values(e).some(e=>nn(e)),rn=class extends Error{response;constructor(e){super(`HTTP error ${e.status}`),this.name=`HttpResponseError`,this.response=e}},an=class extends Error{constructor(e=`Request was cancelled`){super(e),this.name=`HttpCancelledError`}},on=class extends Error{constructor(e=`Network error`){super(e),this.name=`HttpNetworkError`}};function sn(e){let t=new URLSearchParams;return Object.entries(e).forEach(([e,n])=>{n!=null&&(Array.isArray(n)?n.forEach(n=>t.append(`${e}[]`,String(n))):typeof n==`object`?t.append(e,JSON.stringify(n)):t.append(e,String(n)))}),t.toString()}function cn(e,t,n){if(t&&!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&(e=t.replace(/\/$/,``)+`/`+e.replace(/^\//,``)),n&&Object.keys(n).length>0){let t=sn(n);t&&(e+=(e.includes(`?`)?`&`:`?`)+t)}return e}function ln(){return typeof window>`u`?null:window.axios?.defaults?.headers?.common?.[`X-Requested-With`]??null}function un(e,t=new FormData,n=null){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&dn(t,n?`${n}[${r}]`:r,e[r]);return t}function dn(e,t,n){if(Array.isArray(n))return n.forEach((n,r)=>dn(e,`${t}[${r}]`,n));if(n instanceof Date)return e.append(t,n.toISOString());if(typeof File<`u`&&n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);un(n,e,t)}function fn(e,t){if(e!=null)return e instanceof FormData?e:typeof e==`object`&&nn(e)?un(e):typeof e==`object`||t[`Content-Type`]?.includes(`application/json`)?JSON.stringify(e):String(e)}function pn(e){let t={};return e.forEach((e,n)=>{t[n.toLowerCase()]=e}),t}function mn(e={}){let t=e.xsrfCookieName??`XSRF-TOKEN`,n=e.xsrfHeaderName??`X-XSRF-TOKEN`;function r(){if(typeof document>`u`)return null;let e=document.cookie.match(RegExp(`(^|;\\s*)`+t+`=([^;]*)`));return e?decodeURIComponent(e[2]):null}return{setXsrfCookieName(e){t=e},setXsrfHeaderName(e){n=e},async request(e){let t=cn(e.url,e.baseURL,e.params),i=e.method.toUpperCase(),a={},o=ln();o&&(a[`X-Requested-With`]=o),e.data!==void 0&&![`GET`,`DELETE`].includes(i)&&!(e.data instanceof FormData)&&!nn(e.data)&&(a[`Content-Type`]=`application/json`),e.headers&&Object.entries(e.headers).forEach(([e,t])=>{t!==void 0&&(a[e]=String(t))});let s=r();s&&![`GET`,`HEAD`,`OPTIONS`].includes(i)&&(a[n]=s);let c=e.signal,l,u=e.timeout??3e4;if(u>0&&!c){let e=new AbortController;c=e.signal,l=setTimeout(()=>e.abort(),u)}let d=[`GET`,`DELETE`].includes(i)?void 0:fn(e.data,a);d instanceof FormData&&delete a[`Content-Type`];try{let n=await fetch(t,{method:i,headers:a,body:d,signal:c,credentials:e.credentials??`same-origin`});l&&clearTimeout(l);let r;r=n.headers.get(`content-type`)?.includes(`application/json`)?await n.json():await n.text();let o={status:n.status,data:r,headers:pn(n.headers)};if(!n.ok)throw new rn(o);return o}catch(e){throw l&&clearTimeout(l),e instanceof rn?e:e instanceof DOMException&&e.name===`AbortError`?new an:e instanceof TypeError?new on(e.message):e}}}}var hn=mn(),gn=hn,_n=void 0,vn=void 0,yn=`same-origin`,bn=e=>`${e.method}:${e.baseURL??_n??``}${e.url}`,xn=e=>e.status===204&&e.headers[`precognition-success`]===`true`,Sn={},Cn={get:(e,t={},n={})=>Tn(wn(`get`,e,t,n)),post:(e,t={},n={})=>Tn(wn(`post`,e,t,n)),patch:(e,t={},n={})=>Tn(wn(`patch`,e,t,n)),put:(e,t={},n={})=>Tn(wn(`put`,e,t,n)),delete:(e,t={},n={})=>Tn(wn(`delete`,e,t,n)),useHttpClient(e){return gn=e,Cn},withBaseURL(e){return _n=e,Cn},withTimeout(e){return vn=e,Cn},withCredentials(e){return yn=typeof e==`string`?e:e?`include`:`omit`,Cn},fingerprintRequestsUsing(e){return bn=e===null?()=>null:e,Cn},determineSuccessUsing(e){return xn=e,Cn},withXsrfCookieName(e){return hn.setXsrfCookieName(e),Cn},withXsrfHeaderName(e){return hn.setXsrfHeaderName(e),Cn}},wn=(e,t,n,r)=>({url:t,method:e,...r,...[`get`,`delete`].includes(e)?{params:$t({},n,r?.params)}:{data:$t({},n,r?.data)}}),Tn=(e={})=>{let t=[En,On,kn].reduce((e,t)=>t(e),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),gn.request({method:t.method,url:t.url,baseURL:t.baseURL??_n,data:t.data,params:t.params,headers:t.headers,signal:t.signal,timeout:t.timeout,credentials:yn}).then(async e=>{t.precognitive&&An(e);let n=e.status,r=e;return t.precognitive&&t.onPrecognitionSuccess&&xn(e)&&(r=await Promise.resolve(t.onPrecognitionSuccess(e)??r)),t.onSuccess&&Dn(n)&&(r=await Promise.resolve(t.onSuccess(r)??r)),(Mn(t,n)??(e=>e))(r)??r},e=>{if(jn(e))return Promise.reject(e);let n=e;return t.precognitive&&An(n.response),(Mn(t,n.response.status)??((e,t)=>Promise.reject(t)))(n.response,n)}).finally(t.onFinish??(()=>null)))},En=e=>{let t=e.only??e.validate;return{...e,timeout:e.timeout??vn,precognitive:e.precognitive!==!1,fingerprint:e.fingerprint===void 0?bn(e,gn):e.fingerprint,headers:{...e.headers,Accept:`application/json`,"Content-Type":Nn(e),...e.precognitive===!1?{}:{Precognition:!0},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},Dn=e=>e>=200&&e<300,On=e=>typeof e.fingerprint==`string`?(Sn[e.fingerprint]?.abort(),delete Sn[e.fingerprint],e):e,kn=e=>typeof e.fingerprint!=`string`||e.signal||!e.precognitive?e:(Sn[e.fingerprint]=new AbortController,{...e,signal:Sn[e.fingerprint].signal}),An=e=>{if(e.headers?.precognition!==`true`)throw Error(`Did not receive a Precognition response. Ensure you have the Precognition middleware in place for the route.`)},jn=e=>!(e instanceof rn)||typeof e.response?.status!=`number`,Mn=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],Nn=e=>e.headers?.[`Content-Type`]??e.headers?.[`Content-type`]??e.headers?.[`content-type`]??(nn(e.data)?`multipart/form-data`:`application/json`),Pn=(e,t)=>{if(!e.includes(`*`))return[e];let n=e.split(`.`),r=[``];for(let e of n)if(e===`*`){let e=[];for(let n of r){let r=n?jt(t,n):t;if(Array.isArray(r))for(let t=0;t<r.length;t++)e.push(n?`${n}.${t}`:String(t));else if(typeof r==`object`&&r)for(let t of Object.keys(r))e.push(n?`${n}.${t}`:t)}r=e}else r=r.map(t=>t?`${t}.${e}`:e);return r},Fn=(e,t)=>t.includes(`*`)?RegExp(`^`+t.replace(/\./g,`\\.`).replace(/\*/g,`[^.]+`)+`$`).test(e):e===t,In=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.some(t=>Fn(e,t)))),Ln=(e,t={})=>{let n={errorsChanged:[],touchedChanged:[],validatingChanged:[],validatedChanged:[]},r=!1,i=!1,a=e=>e===i?[]:(i=e,n.validatingChanged),o=[],s=e=>{let t=[...new Set(e)];return o.length!==t.length||!t.every(e=>o.includes(e))?(o=t,n.validatedChanged):[]},c=()=>o.filter(e=>d[e]===void 0),l=[],u=e=>{let t=[...new Set(e)];return l.length!==t.length||!t.every(e=>l.includes(e))?(l=t,n.touchedChanged):[]},d={},f=e=>{let t=zn(e);return xt(d,t)?[]:(d=t,n.errorsChanged)},p=e=>{let t={...d};return delete t[Bn(e)],f(t)},m=()=>Object.keys(d).length>0,h=1500,g=e=>{h=e,S.cancel(),S=x()},_=t,v=null,y=[],b=null,x=()=>Xt(t=>{e({get:(e,n={},r={})=>Cn.get(e,T(n),C(r,t,n)),post:(e,n={},r={})=>Cn.post(e,T(n),C(r,t,n)),patch:(e,n={},r={})=>Cn.patch(e,T(n),C(r,t,n)),put:(e,n={},r={})=>Cn.put(e,T(n),C(r,t,n)),delete:(e,n={},r={})=>Cn.delete(e,T(n),C(r,t,n))}).catch(e=>e instanceof an||e instanceof rn&&e.response?.status===422?null:Promise.reject(e))},h,{leading:!0,trailing:!0}),S=x(),C=(e,t,n={})=>{let r={...e,...t},i=Array.from(r.only??r.validate??l);return{...t,...$t({},e,t),only:i,timeout:r.timeout??5e3,onValidationError:(e,t)=>([...s([...o,...i]),...f($t(In({...d},i),e.data.errors))].forEach(e=>e()),r.onValidationError?r.onValidationError(e,t):Promise.reject(t)),onSuccess:e=>(s([...o,...i]).forEach(e=>e()),r.onSuccess?r.onSuccess(e):e),onPrecognitionSuccess:e=>([...s([...o,...i]),...f(In({...d},i))].forEach(e=>e()),r.onPrecognitionSuccess?r.onPrecognitionSuccess(e):e),onBefore:()=>{let e=l.some(e=>e.includes(`*`)),t=e?[...new Set(l.flatMap(e=>Pn(e,n)))]:l;return r.onBeforeValidation&&r.onBeforeValidation({data:n,touched:t},{data:_,touched:y})===!1||(r.onBefore||(()=>!0))()===!1?!1:(e&&u(t).forEach(e=>e()),b=l,v=n,!0)},onStart:()=>{a(!0).forEach(e=>e()),(r.onStart??(()=>null))()},onFinish:()=>{a(!1).forEach(e=>e()),y=b,_=v,b=v=null,(r.onFinish??(()=>null))()}}},w=(e,t,n)=>{if(e===void 0){let e=Array.from(n?.only??n?.validate??[]);u([...l,...e]).forEach(e=>e()),S(n??{});return}if(tn(t)&&!r){console.warn(`Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.`);return}e=Bn(e),(e.includes(`*`)||jt(_,e)!==t)&&(u([e,...l]).forEach(e=>e()),S(n??{}))},T=e=>r===!1?Vn(e):e,E={touched:()=>l,validate(e,t,n){return typeof e==`object`&&!(`target`in e)&&(n=e,e=t=void 0),w(e,t,n),E},touch(e){let t=Array.isArray(e)?e:[Bn(e)];return u([...l,...t]).forEach(e=>e()),E},validating:()=>i,valid:c,errors:()=>d,hasErrors:m,setErrors(e){return f(e).forEach(e=>e()),E},forgetError(e){return p(e).forEach(e=>e()),E},defaults(e){return t=e,_=e,E},reset(...e){if(e.length===0)u([]).forEach(e=>e());else{let n=[...l];e.forEach(e=>{n.includes(e)&&n.splice(n.indexOf(e),1),Yt(_,e,jt(t,e))}),u(n).forEach(e=>e())}return E},setTimeout(e){return g(e),E},on(e,t){return n[e].push(t),E},validateFiles(){return r=!0,E},withoutFileValidation(){return r=!1,E}};return E},Rn=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:Array.isArray(e[n])?e[n][0]:e[n]}),{}),zn=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:typeof e[n]==`string`?[e[n]]:e[n]}),{}),Bn=e=>typeof e==`string`?e:e.target.name,Vn=e=>{let t={...e};return Object.keys(t).forEach(e=>{let n=t[e];if(n!==null){if(tn(n)){delete t[e];return}if(Array.isArray(n)){t[e]=Object.values(Vn({...n}));return}if(typeof n==`object`){t[e]=Vn(t[e]);return}}}),t},Hn=new class{config={};defaults;constructor(e){this.defaults=e}extend(e){return e&&(this.defaults={...this.defaults,...e}),this}replace(e){this.config=e}get(e){return zt(this.config,e)?jt(this.config,e):jt(this.defaults,e)}set(e,t){typeof e==`string`?Yt(this.config,e,t):Object.entries(e).forEach(([e,t])=>{Yt(this.config,e,t)})}}({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function Un(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Wn(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var Gn=e=>Wn(`before`,{cancelable:!0,detail:{visit:e}}),Kn=(e,{page:t,visitId:n}={})=>Wn(`error`,{detail:{errors:e,page:t,visitId:n}}),qn=e=>Wn(`networkError`,{cancelable:!0,detail:{error:e}}),Jn=e=>Wn(`finish`,{detail:{visit:e}}),Yn=e=>Wn(`httpException`,{cancelable:!0,detail:{response:e}}),Xn=e=>Wn(`beforeUpdate`,{detail:{page:e}}),Zn=(e,{cached:t=!1,visitId:n}={})=>Wn(`navigate`,{detail:{page:e,cached:t,visitId:n}}),Qn=(e,{replace:t,visitId:n})=>Wn(`clientVisit`,{detail:{page:e,replace:t,visitId:n}}),$n=e=>Wn(`progress`,{detail:{progress:e}}),er=e=>Wn(`start`,{detail:{visit:e}}),tr=(e,{visitId:t}={})=>Wn(`success`,{detail:{page:e,visitId:t}}),nr=(e,t)=>Wn(`prefetched`,{detail:{fetchedAt:Date.now(),response:e,visit:t}}),rr=e=>Wn(`prefetching`,{detail:{visit:e}}),ir=e=>Wn(`flash`,{detail:{flash:e}}),ar=(e,t)=>Wn(`location`,{cancelable:!0,detail:{url:e,versionChange:t}}),or=class{static locationVisitKey=`inertiaLocationVisit`;static set(e,t){typeof window<`u`&&window.sessionStorage.setItem(e,JSON.stringify(t))}static get(e){if(typeof window<`u`)return JSON.parse(window.sessionStorage.getItem(e)||`null`)}static merge(e,t){let n=this.get(e);n===null?this.set(e,t):this.set(e,{...n,...t})}static remove(e){typeof window<`u`&&window.sessionStorage.removeItem(e)}static removeNested(e,t){let n=this.get(e);n!==null&&(delete n[t],this.set(e,n))}static exists(e){try{return this.get(e)!==null}catch{return!1}}static clear(){typeof window<`u`&&window.sessionStorage.clear()}},sr=async e=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);let t=fr(),n=await hr(await gr());if(!n)throw Error(`Unable to encrypt history`);return await ur(t,n,e)},cr={key:`historyKey`,iv:`historyIv`},lr=async e=>{let t=fr(),n=await gr();if(!n)throw Error(`Unable to decrypt history`);return await dr(t,n,e)},ur=async(e,t,n)=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=new TextEncoder,i=JSON.stringify(n),a=new Uint8Array(i.length*3),o=r.encodeInto(i,a);return window.crypto.subtle.encrypt({name:`AES-GCM`,iv:e},t,a.subarray(0,o.written))},dr=async(e,t,n)=>{if(window.crypto.subtle===void 0)return console.warn(`Decryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=await window.crypto.subtle.decrypt({name:`AES-GCM`,iv:e},t,n);return JSON.parse(new TextDecoder().decode(r))},fr=()=>{let e=or.get(cr.iv);if(e)return new Uint8Array(e);let t=window.crypto.getRandomValues(new Uint8Array(12));return or.set(cr.iv,Array.from(t)),t},pr=async()=>window.crypto.subtle===void 0?(console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(null)):window.crypto.subtle.generateKey({name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]),mr=async e=>{if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve();let t=await window.crypto.subtle.exportKey(`raw`,e);or.set(cr.key,Array.from(new Uint8Array(t)))},hr=async e=>{if(e)return e;let t=await pr();return t?(await mr(t),t):null},gr=async()=>{let e=or.get(cr.key);return e?await window.crypto.subtle.importKey(`raw`,new Uint8Array(e),{name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]):null},_r=e=>{let t={};for(let n of Object.keys(e))e[n]!==void 0&&(t[n]=e[n]);return t},vr=(e,t,n)=>{if(e===t)return!0;for(let r in e)if(!n.includes(r)&&e[r]!==t[r]&&!yr(e[r],t[r]))return!1;for(let r in t)if(!n.includes(r)&&!(r in e))return!1;return!0},yr=(e,t)=>{switch(typeof e){case`object`:return vr(e,t,[]);case`function`:return e.toString()===t.toString();default:return e===t}},br={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},xr=e=>{if(typeof e==`number`)return e;for(let[t,n]of Object.entries(br))if(e.endsWith(t))return parseFloat(e)*n;return parseInt(e)},Sr=new class{cached=[];inFlightRequests=[];removalTimers=[];currentUseId=null;add(e,t,{cacheFor:n,cacheTags:r}){if(this.findInFlight(e))return Promise.resolve();let i=this.findCached(e);if(!e.fresh&&i&&i.staleTimestamp>Date.now())return Promise.resolve();let[a,o]=this.extractStaleValues(n),s=new Promise((n,r)=>{t({...e,onCancel:()=>{this.remove(e),e.onCancel(),r()},onError:t=>{this.remove(e),e.onError(t),r()},onPrefetching(t){e.onPrefetching(t)},onPrefetched(t,n){e.onPrefetched(t,n)},onPrefetchResponse(e){n(e)},onPrefetchError(t){Sr.removeFromInFlight(e),r(t)}})}).then(t=>{this.remove(e);let n=t.getPageResponse();H.mergeOncePropsIntoResponse(n),this.cached.push({params:{...e},staleTimestamp:Date.now()+a,expiresAt:Date.now()+o,response:s,singleUse:o===0,timestamp:Date.now(),inFlight:!1,tags:Array.isArray(r)?r:[r]});let i=this.getShortestOncePropTtl(n);return this.scheduleForRemoval(e,i?Math.min(o,i):o),this.removeFromInFlight(e),t.handlePrefetch(),t});return this.inFlightRequests.push({params:{...e},response:s,staleTimestamp:null,inFlight:!0}),s}removeAll(){this.cached=[],this.removalTimers.forEach(e=>{clearTimeout(e.timer)}),this.removalTimers=[]}removeByTags(e){this.cached=this.cached.filter(t=>!t.tags.some(t=>e.includes(t)))}remove(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)),this.clearTimer(e)}removeFromInFlight(e){this.inFlightRequests=this.inFlightRequests.filter(t=>!this.paramsAreEqual(t.params,e))}extractStaleValues(e){let[t,n]=this.cacheForToStaleAndExpires(e);return[xr(t),xr(n)]}cacheForToStaleAndExpires(e){if(!Array.isArray(e))return[e,e];switch(e.length){case 0:return[0,0];case 1:return[e[0],e[0]];default:return[e[0],e[1]]}}clearTimer(e){let t=this.removalTimers.find(t=>this.paramsAreEqual(t.params,e));t&&(clearTimeout(t.timer),this.removalTimers=this.removalTimers.filter(e=>e!==t))}scheduleForRemoval(e,t){if(!(typeof window>`u`)&&(this.clearTimer(e),t>0)){let n=window.setTimeout(()=>this.remove(e),t);this.removalTimers.push({params:e,timer:n})}}get(e){return this.findCached(e)||this.findInFlight(e)}use(e,t){let n=`${t.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`;this.currentUseId=n;let r={...t,cached:!0};return e.response.then(e=>{if(this.currentUseId===n)return e.mergeParams({...r,onPrefetched:()=>{}}),this.removeSingleUseItems(t),e.handle()})}removeSingleUseItems(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)||!t.singleUse)}findCached(e){return this.cached.find(t=>this.paramsAreEqual(t.params,e))||null}findInFlight(e){return this.inFlightRequests.find(t=>this.paramsAreEqual(t.params,e))||null}withoutPurposePrefetchHeader(e){let t=pt(e);return t.headers.Purpose===`prefetch`&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return vr(this.withoutPurposePrefetchHeader(e),this.withoutPurposePrefetchHeader(t),[`id`,`showProgress`,`replace`,`prefetch`,`preserveScroll`,`preserveState`,`onBefore`,`onBeforeUpdate`,`onStart`,`onProgress`,`onFinish`,`onCancel`,`onSuccess`,`onError`,`onFlash`,`onPrefetched`,`onCancelToken`,`onPrefetching`,`async`,`viewTransition`,`optimistic`,`component`,`pageProps`,`cached`])}updateCachedOncePropsFromCurrentPage(){this.cached.forEach(e=>{e.response.then(t=>{let n=t.getPageResponse();H.mergeOncePropsIntoResponse(n,{force:!0});for(let[e,t]of Object.entries(n.deferredProps??{})){let r=t.filter(e=>jt(n.props,e)===void 0);r.length>0?n.deferredProps[e]=r:delete n.deferredProps[e]}let r=this.getShortestOncePropTtl(n);if(r===null)return;let i=e.expiresAt-Date.now(),a=Math.min(i,r);a>0?this.scheduleForRemoval(e.params,a):this.remove(e.params)})})}getShortestOncePropTtl(e){let t=Object.values(e.onceProps??{}).map(e=>e.expiresAt).filter(e=>!!e);return t.length===0?null:Math.min(...t)-Date.now()}},Cr=e=>{if(e.offsetParent===null)return!1;let t=e.getBoundingClientRect(),n=t.top<window.innerHeight&&t.bottom>=0,r=t.left<window.innerWidth&&t.right>=0;return n&&r},wr=e=>{let t=e=>{let t=window.getComputedStyle(e);return t.overflowY===`scroll`?!0:t.overflowY===`auto`?[`visible`,`clip`].includes(t.overflowX)?!0:r(t.maxHeight,e.style.height)||i(e,`height`):!1},n=e=>{let t=window.getComputedStyle(e);return t.overflowX===`scroll`?!0:t.overflowX===`auto`?[`visible`,`clip`].includes(t.overflowY)?!0:r(t.maxWidth,e.style.width)||i(e,`width`):!1},r=(e,t)=>!!(e&&e!==`none`&&e!==`0px`||t&&t!==`auto`&&t!==`0`),i=(e,t)=>{let n=e.parentElement;if(!n)return!1;let r=window.getComputedStyle(n);if([`flex`,`inline-flex`].includes(r.display)){let e=[`column`,`column-reverse`].includes(r.flexDirection);return t===`height`?e:!e}return[`grid`,`inline-grid`].includes(r.display)},a=e?.parentElement;for(;a;){let e=t(a)||n(a);if(window.getComputedStyle(a).display!==`contents`&&e)return a;a=a.parentElement}return null},Tr=(e,t)=>{if(!t)return e.filter(e=>Cr(e));let n=e.indexOf(t),r=[],i=[];for(let t=n;t>=0;t--){let n=e[t];if(Cr(n))r.push(n);else break}for(let t=n+1;t<e.length;t++){let n=e[t];if(Cr(n))i.push(n);else break}return[...r.reverse(),...i]},Er=(e,t=1)=>{window.requestAnimationFrame(()=>{t>1?Er(e,t-1):e()})},Dr=e=>{if(typeof window>`u`)return null;let t=document.querySelector(`script[data-page="${e}"][type="application/json"]`);return t?.textContent?JSON.parse(t.textContent):null},Or=typeof window>`u`,kr=!Or&&/Firefox/i.test(window.navigator.userAgent),Ar=class{static save(){U.saveScrollPositions(this.getScrollRegions())}static getScrollRegions(){return Array.from(this.regions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))}static regions(){return document.querySelectorAll(`[scroll-region]`)}static scrollToTop(){if(kr&&getComputedStyle(document.documentElement).scrollBehavior===`smooth`)return Er(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){!Or&&window.location.hash||this.scrollToTop(),this.regions().forEach(e=>{typeof e.scrollTo==`function`?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.save(),this.scrollToAnchor()}static scrollToAnchor(){let e=Or?null:window.location.hash;e&&setTimeout(()=>{let t=document.getElementById(e.slice(1));t?t.scrollIntoView():this.scrollToTop()})}static restore(e){Or||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(e)})}static restoreScrollRegions(e){Or||this.regions().forEach((t,n)=>{let r=e[n];r&&(typeof t.scrollTo==`function`?t.scrollTo(r.left,r.top):(t.scrollTop=r.top,t.scrollLeft=r.left))})}static restoreDocument(){let e=U.getDocumentScrollPosition();window.scrollTo(e.left,e.top)}static onScroll(e){let t=e.target;typeof t.hasAttribute==`function`&&t.hasAttribute(`scroll-region`)&&this.save()}static onWindowScroll(){U.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},jr=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0;function Mr(e){return jr(e)||e instanceof FormData&&Array.from(e.values()).some(e=>Mr(e))||typeof e==`object`&&!!e&&Object.values(e).some(e=>Mr(e))}var Nr=e=>e instanceof FormData;function Pr(e,t=new FormData,n=null,r=`brackets`){e||={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&Ir(t,Fr(n,i,`indices`),e[i],r);return t}function Fr(e,t,n){return e?n===`brackets`?`${e}[]`:`${e}[${t}]`:t}function Ir(e,t,n,r){if(Array.isArray(n))return Array.from(n.keys()).forEach(i=>Ir(e,Fr(t,i.toString(),r),n[i],r));if(n instanceof Date)return e.append(t,n.toISOString());if(n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);Pr(n,e,t,r)}function Lr(e){return/\[\d+\]/.test(decodeURIComponent(e.search))}function Rr(e){if(!e||e===`?`)return{};let t={};return e.replace(/^\?/,``).split(`&`).filter(Boolean).forEach(e=>{let[n,r]=Br(e);Hr(t,Vr(n),Vr(r))}),t}function zr(e,t){let n=[];return Wr(e,``,n,t),n.length?`?`+n.join(`&`):``}function Br(e){let t=e.indexOf(`=`);return t===-1?[e,``]:[e.substring(0,t),e.substring(t+1)]}function Vr(e){return decodeURIComponent(e.replace(/\+/g,` `))}function Hr(e,t,n){let r=Ur(t);if(r.some(e=>e===`__proto__`))return;let i=e;for(;r.length>1;){let e=r.shift(),t=r[0]===``;(typeof i[e]!=`object`||i[e]===null)&&(i[e]=t?[]:{}),i=i[e]}let a=r.shift();a===``&&Array.isArray(i)?i.push(n):i[a]=n}function Ur(e){let t=[],n=e.split(`[`)[0];n&&t.push(n);let r,i=/\[([^\]]*)\]/g;for(;(r=i.exec(e))!==null;)t.push(r[1]);return t}function Wr(e,t,n,r){if(e!==void 0){if(e===null){n.push(`${t}=`);return}if(Array.isArray(e)){e.forEach((e,i)=>{Wr(e,r===`indices`?`${t}[${i}]`:`${t}[]`,n,r)});return}if(typeof e==`object`){Object.keys(e).forEach(i=>{Wr(e[i],t?`${t}[${i}]`:i,n,r)});return}n.push(`${t}=${encodeURIComponent(String(e))}`)}}function Gr(e){return new URL(e.toString(),typeof window>`u`?void 0:window.location.toString())}var Kr=(e,t,n,r,i)=>{let a=typeof e==`string`?Gr(e):e;if((Mr(t)||r)&&!Nr(t)&&(Hn.get(`form.forceIndicesArrayFormatInFormData`)&&(i=`indices`),t=Pr(t,new FormData,null,i)),Nr(t))return[a,t];let[o,s]=qr(n,a,t,i);return[Gr(o),s]};function qr(e,t,n,r=`brackets`){let i=e===`get`&&!Nr(n)&&Object.keys(n).length>0,a=ei(t.toString()),o=a||t.toString().startsWith(`/`)||t.toString()===``,s=!o&&!t.toString().startsWith(`#`)&&!t.toString().startsWith(`?`),c=/^[.]{1,2}([/]|$)/.test(t.toString()),l=t.toString().includes(`?`)||i,u=t.toString().includes(`#`),d=new URL(t.toString(),typeof window>`u`?`http://localhost`:window.location.toString());if(i){let e=Lr(d)?`indices`:r;d.search=zr({...Rr(d.search),...n},e)}return[[a?`${d.protocol}//${d.host}`:``,o?d.pathname:``,s?d.pathname.substring(+!c):``,l?d.search:``,u?d.hash:``].join(``),i?{}:n]}function Jr(e){return e=new URL(e.href),e.hash=``,e}var Yr=(e,t)=>{e.hash&&!t.hash&&Jr(e).href===t.href&&(t.hash=e.hash)},Xr=(e,t)=>Jr(e).href===Jr(t).href,Zr=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function Qr(e){return typeof e==`object`&&!!e&&e!==void 0&&`url`in e&&`method`in e}function $r(e){return e.component?typeof e.component==`string`?e.component:(console.error(`The "component" property on the URL method pair received multiple components (${Object.keys(e.component).join(`, `)}), but only a single component string is supported for instant visits. Use the withComponent() method to specify which component to use.`),null):null}function ei(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}function ti(e,t){let n=typeof e==`string`?Gr(e):e;return t?`${n.protocol}//${n.host}${n.pathname}${n.search}${n.hash}`:`${n.pathname}${n.search}${n.hash}`}var H=new class{page;swapComponent;resolveComponent;onFlashCallback;componentId={};listeners=[];isFirstPageLoad=!0;cleared=!1;pendingDeferredProps=null;historyQuotaExceeded=!1;optimisticBaseline={};pendingOptimistics=[];optimisticCounter=0;init({initialPage:e,swapComponent:t,resolveComponent:n,onFlash:r}){return this.page={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]},this.swapComponent=t,this.resolveComponent=n,this.onFlashCallback=r,si.on(`historyQuotaExceeded`,()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:n=!1,preserveState:r=!1,viewTransition:i=!1,cached:a=!1,visitId:o}={}){Object.keys(e.deferredProps||{}).length&&(this.pendingDeferredProps={deferredProps:e.deferredProps,component:e.component,url:e.url},e.initialDeferredProps===void 0&&(e.initialDeferredProps=e.deferredProps)),this.componentId={};let s=this.componentId;return e.clearHistory&&U.clear(),this.resolve(e.component,e).then(c=>{if(s!==this.componentId)return;e.rememberedState??={};let l=typeof window>`u`,u=l?new URL(e.url):window.location,d=!l&&n?Ar.getScrollRegions():[];t||=Xr(Gr(e.url),u);let f={...e,flash:{}};return new Promise(e=>t?U.replaceState(f,e):U.pushState(f,e)).then(()=>{let s=!this.isTheSame(e);if(!s&&Object.keys(e.props.errors||{}).length>0&&(i=!1),this.page=e,this.cleared=!1,this.hasOnceProps()&&Sr.updateCachedOncePropsFromCurrentPage(),s&&this.fireEventsFor(`newComponent`),this.isFirstPageLoad&&this.fireEventsFor(`firstLoad`),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:c,page:e,preserveState:r,viewTransition:i}).then(()=>{n?window.requestAnimationFrame(()=>Ar.restoreScrollRegions(d)):Ar.reset(),this.pendingDeferredProps&&this.pendingDeferredProps.component===e.component&&this.pendingDeferredProps.url===e.url&&si.fireInternalEvent(`loadDeferredProps`,this.pendingDeferredProps.deferredProps),this.pendingDeferredProps=null,t||Zn(e,{cached:a,visitId:o})})})})}setQuietly(e,{preserveState:t=!1}={}){return this.resolve(e.component,e).then(n=>(this.page=e,this.cleared=!1,U.setCurrent(e),this.swap({component:n,page:e,preserveState:t,viewTransition:!1})))}clear(){this.cleared=!0}isCleared(){return this.cleared}get(){return this.page}getWithoutFlashData(){return{...this.page,flash:{}}}hasOnceProps(){return Object.keys(this.page.onceProps??{}).length>0}merge(e){this.page={...this.page,...e}}setPropsQuietly(e){return this.page={...this.page,props:e},this.resolve(this.page.component,this.page).then(e=>this.swap({component:e,page:this.page,preserveState:!0,viewTransition:!1}))}setFlash(e){this.page={...this.page,flash:e},this.onFlashCallback?.(e)}setUrlHash(e){this.page.url.includes(e)||(this.page.url+=e)}remember(e){this.page.rememberedState=e}swap({component:e,page:t,preserveState:n,viewTransition:r}){let i=()=>this.swapComponent({component:e,page:t,preserveState:n});if(!r||!document?.startViewTransition||document.visibilityState===`hidden`)return i();let a=typeof r==`boolean`?()=>null:r;return new Promise(e=>{let t=document.startViewTransition(()=>i().then(e));t.ready.catch(()=>{}),a(t)})}resolve(e,t){return Promise.resolve(this.resolveComponent(e,t))}nextOptimisticId(){return++this.optimisticCounter}setBaseline(e,t){e in this.optimisticBaseline||(this.optimisticBaseline[e]=t)}updateBaseline(e,t){e in this.optimisticBaseline&&(this.optimisticBaseline[e]=t)}hasBaseline(e){return e in this.optimisticBaseline}registerOptimistic(e,t){this.pendingOptimistics.push({id:e,callback:t})}unregisterOptimistic(e){this.pendingOptimistics=this.pendingOptimistics.filter(t=>t.id!==e)}replayOptimistics(){let e=Object.keys(this.optimisticBaseline);if(e.length===0)return{};let t=pt(this.page.props);for(let n of e)t[n]=pt(this.optimisticBaseline[n]);for(let{callback:e}of this.pendingOptimistics){let n=e(pt(t));n&&Object.assign(t,n)}let n={};for(let r of e)n[r]=t[r];return n}pendingOptimisticCount(){return this.pendingOptimistics.length}clearOptimisticState(){this.optimisticBaseline={},this.pendingOptimistics=[]}isTheSame(e){return this.page.component===e.component}on(e,t){return this.listeners.push({event:e,callback:t}),()=>{this.listeners=this.listeners.filter(n=>n.event!==e&&n.callback!==t)}}fireEventsFor(e){this.listeners.filter(t=>t.event===e).forEach(e=>e.callback())}mergeOncePropsIntoResponse(e,{force:t=!1}={}){Object.entries(e.onceProps??{}).forEach(([n,r])=>{let i=this.page.onceProps?.[n];i!==void 0&&(t||jt(e.props,r.prop)===void 0)&&(Yt(e.props,r.prop,jt(this.page.props,i.prop)),e.onceProps[n].expiresAt=i.expiresAt)})}},ni=class{items=[];processingPromise=null;add(e){return this.items.push(e),this.process()}process(){return this.processingPromise??=this.processNext().finally(()=>{this.processingPromise=null}),this.processingPromise}processNext(){let e=this.items.shift();return e?Promise.resolve(e()).then(()=>this.processNext()):Promise.resolve()}},ri=typeof window>`u`,ii=new ni,ai=!ri&&/CriOS/.test(window.navigator.userAgent),oi=class{rememberedState=`rememberedState`;scrollRegions=`scrollRegions`;preserveUrl=!1;current={};initialState=null;remember(e,t){this.replaceState({...H.getWithoutFlashData(),rememberedState:{...H.get()?.rememberedState??{},[t]:e}})}restore(e){if(!ri)return this.current[this.rememberedState]?.[e]===void 0?this.initialState?.[this.rememberedState]?.[e]:this.current[this.rememberedState]?.[e]}pushState(e,t=null){if(!ri){if(this.preserveUrl){t&&t();return}this.current=e,ii.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doPushState({page:n},e.url).then(()=>t?.());return ai?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}clonePageProps(e){try{return structuredClone(e.props),e}catch{return{...e,props:pt(e.props)}}}getPageData(e){let t=this.clonePageProps(e);return new Promise(n=>e.encryptHistory?sr(t).then(n):n(t))}processQueue(){return ii.process()}decrypt(e=null){if(ri)return Promise.resolve(e??H.get());let t=e??window.history.state?.page;return this.decryptPageData(t).then(e=>{if(!e)throw Error(`Unable to decrypt history`);return this.initialState===null?this.initialState=e??void 0:this.current=e??{},e})}decryptPageData(e){return e instanceof ArrayBuffer?lr(e):Promise.resolve(e)}saveScrollPositions(e){ii.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!xt(this.getScrollRegions(),e))return this.doReplaceState({page:window.history.state.page,scrollRegions:e})}))}saveDocumentScrollPosition(e){ii.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!xt(this.getDocumentScrollPosition(),e))return this.doReplaceState({page:window.history.state.page,documentScrollPosition:e})}))}getScrollRegions(){return window.history.state?.scrollRegions||[]}getDocumentScrollPosition(){return window.history.state?.documentScrollPosition||{top:0,left:0}}replaceState(e,t=null){if(xt(this.current,e)){t&&t();return}let{flash:n,...r}=e;if(H.merge(r),!ri){if(this.preserveUrl){t&&t();return}this.current=e,ii.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doReplaceState({page:n},e.url).then(()=>t?.());return ai?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}isHistoryThrottleError(e){return e instanceof Error&&e.name===`SecurityError`&&(e.message.includes(`history.pushState`)||e.message.includes(`history.replaceState`))}isQuotaExceededError(e){return e instanceof Error&&e.name===`QuotaExceededError`}withThrottleProtection(e){return Promise.resolve().then(()=>{try{return e()}catch(e){if(!this.isHistoryThrottleError(e))throw e;console.error(e.message)}})}doReplaceState(e,t){return this.withThrottleProtection(()=>{window.history.replaceState({...e,scrollRegions:e.scrollRegions??window.history.state?.scrollRegions,documentScrollPosition:e.documentScrollPosition??window.history.state?.documentScrollPosition},``,t)})}doPushState(e,t){return this.withThrottleProtection(()=>{try{window.history.pushState(e,``,t)}catch(e){if(!this.isQuotaExceededError(e))throw e;si.fireInternalEvent(`historyQuotaExceeded`,t)}})}getState(e,t){return this.current?.[e]??t}deleteState(e){this.current[e]!==void 0&&(delete this.current[e],this.replaceState(this.current))}clearInitialState(e){this.initialState&&this.initialState[e]!==void 0&&delete this.initialState[e]}browserHasHistoryEntry(){return!ri&&!!window.history.state?.page}clear(){or.remove(cr.key),or.remove(cr.iv)}setCurrent(e){this.current=e}isValidState(e){return!!e.page}getAllState(){return this.current}};typeof window<`u`&&window.history.scrollRestoration&&(window.history.scrollRestoration=`manual`);var U=new oi,si=new class{internalListeners=[];init(){typeof window<`u`&&(window.addEventListener(`popstate`,this.handlePopstateEvent.bind(this)),window.addEventListener(`pageshow`,this.handlePageshowEvent.bind(this)),window.addEventListener(`scroll`,Un(Ar.onWindowScroll.bind(Ar),100),!0)),typeof document<`u`&&document.addEventListener(`scroll`,Un(Ar.onScroll.bind(Ar),100),!0)}onGlobalEvent(e,t){return this.registerListener(`inertia:${e}`,(e=>{let n=t(e);e.cancelable&&!e.defaultPrevented&&n===!1&&e.preventDefault()}))}on(e,t){return this.internalListeners.push({event:e,listener:t}),()=>{this.internalListeners=this.internalListeners.filter(e=>e.listener!==t)}}onMissingHistoryItem(){H.clear(),this.fireInternalEvent(`missingHistoryItem`)}fireInternalEvent(e,...t){this.internalListeners.filter(t=>t.event===e).forEach(e=>e.listener(...t))}registerListener(e,t){return document.addEventListener(e,t),()=>document.removeEventListener(e,t)}handlePageshowEvent(e){e.persisted&&U.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){let t=e.state||null;if(t===null){let e=Gr(H.get().url);e.hash=window.location.hash,U.replaceState({...H.getWithoutFlashData(),url:e.href}),Ar.reset();return}if(!U.isValidState(t))return this.onMissingHistoryItem();U.decrypt(t.page).then(e=>{if(H.get().version!==e.version){this.onMissingHistoryItem();return}G.cancelAll({prefetch:!1}),H.setQuietly(e,{preserveState:!1}).then(()=>{Ar.restore(U.getScrollRegions()),Zn(H.get());let t={},n=H.get().props;for(let[r,i]of Object.entries(e.initialDeferredProps??e.deferredProps??{})){let e=i.filter(e=>jt(n,e)===void 0);e.length>0&&(t[r]=e)}Object.keys(t).length>0&&this.fireInternalEvent(`loadDeferredProps`,t)})}).catch(()=>{this.onMissingHistoryItem()})}},ci=new class{type;constructor(){this.type=this.resolveType()}resolveType(){return typeof window>`u`?`navigate`:window.performance?.getEntriesByType(`navigation`)[0]?.type??`navigate`}get(){return this.type}isBackForward(){return this.type===`back_forward`}isReload(){return this.type===`reload`}};function li(){let e=typeof window<`u`?window.crypto:void 0;if(e?.randomUUID)return e.randomUUID();let t=()=>e?.getRandomValues?e.getRandomValues(new Uint8Array(1))[0]:Math.floor(Math.random()*256);return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^t()&15>>e/4).toString(16))}var ui=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(e=>e.bind(this)())}static clearRememberedStateOnReload(){ci.isReload()&&(U.deleteState(U.rememberedState),U.clearInitialState(U.rememberedState))}static handleBackForward(){if(!ci.isBackForward()||!U.browserHasHistoryEntry())return!1;let e=U.getScrollRegions();return U.decrypt().then(t=>{let n=li();H.set(t,{preserveScroll:!0,preserveState:!0,visitId:n}).then(()=>{Ar.restore(e),Zn(H.get(),{visitId:n})})}).catch(()=>{si.onMissingHistoryItem()}),!0}static handleLocation(){if(!or.exists(or.locationVisitKey))return!1;let e=or.get(or.locationVisitKey)||{};return or.remove(or.locationVisitKey),typeof window<`u`&&H.setUrlHash(window.location.hash),U.decrypt(H.get()).then(()=>{let t=li(),n=U.getState(U.rememberedState,{}),r=U.getScrollRegions();H.remember(n),H.set(H.get(),{preserveScroll:e.preserveScroll,preserveState:!0,visitId:t}).then(()=>{e.preserveScroll&&Ar.restore(r),this.fireInitialEvents(t)})}).catch(()=>{si.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<`u`&&H.setUrlHash(window.location.hash);let e=li();H.set(H.get(),{preserveScroll:!0,preserveState:!0,visitId:e}).then(()=>{ci.isReload()?Ar.restore(U.getScrollRegions()):Ar.scrollToAnchor(),this.fireInitialEvents(e)})}static fireInitialEvents(e){let t=H.get();Zn(t,{visitId:e}),Object.keys(t.flash).length>0&&queueMicrotask(()=>ir(t.flash))}},di=class{intervalId=null;timeoutId=null;throttle=!1;keepAlive=!1;cb;interval;cbCount=0;mode;inFlight=!1;currentCancel=null;stopped=!0;instanceId=0;constructor(e,t,n){this.keepAlive=n.keepAlive??!1,this.mode=n.mode??`overlap`,this.cb=t,this.interval=e,(n.autoStart??!0)&&this.start()}stop(){this.stopped=!0,this.instanceId++,this.inFlight=!1,this.currentCancel=null,this.intervalId&&=(clearInterval(this.intervalId),null),this.timeoutId&&=(clearTimeout(this.timeoutId),null)}start(){if(!(typeof window>`u`)){if(this.stop(),this.stopped=!1,this.mode===`rest`){this.scheduleNext();return}this.intervalId=window.setInterval(()=>this.tick(),this.interval)}}isInBackground(e){this.throttle=!this.keepAlive&&e,this.throttle&&(this.cbCount=0)}scheduleNext(){this.stopped||(this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.tick()},this.interval))}tick(){!this.throttle||this.cbCount%10==0?this.fire():this.mode===`rest`&&this.scheduleNext(),this.throttle&&this.cbCount++}fire(){this.inFlight&&this.mode===`cancel`&&this.currentCancel?.();let e=this.instanceId;this.cb({onStart:t=>{e===this.instanceId&&(this.inFlight=!0,this.currentCancel=t)},onFinish:()=>{e===this.instanceId&&(this.inFlight=!1,this.currentCancel=null,this.mode===`rest`&&this.scheduleNext())}})}},fi=new class{polls=[];constructor(){this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,n){let r=new di(e,t,n);return this.polls.push(r),{stop:()=>r.stop(),start:()=>r.start(),destroy:()=>{r.stop(),this.polls=this.polls.filter(e=>e!==r)}}}clear(){this.polls.forEach(e=>e.stop()),this.polls=[]}setupVisibilityListener(){typeof document>`u`||document.addEventListener(`visibilitychange`,()=>{this.polls.forEach(e=>e.isInBackground(document.hidden))},!1)}},pi=new class{requestHandlers=[];responseHandlers=[];errorHandlers=[];onRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}onError(e){return this.errorHandlers.push(e),()=>{this.errorHandlers=this.errorHandlers.filter(t=>t!==e)}}async processRequest(e){let t=e;for(let e of this.requestHandlers)t=await e(t);return t}async processResponse(e){let t=e;for(let e of this.responseHandlers)t=await e(t);return t}async processError(e){for(let t of this.errorHandlers)await t(e)}},mi=class extends Error{code;url;constructor(e,t,n){super(n?`${e} (${n})`:e),this.name=`HttpError`,this.code=t,this.url=n}},hi=class extends mi{response;constructor(e,t,n){super(e,`ERR_HTTP_RESPONSE`,n),this.name=`HttpResponseError`,this.response=t}},gi=class extends mi{constructor(e=`Request was cancelled`,t){super(e,`ERR_CANCELLED`,t),this.name=`HttpCancelledError`}},_i=class extends mi{cause;constructor(e,t,n){super(e,`ERR_NETWORK`,t),this.name=`HttpNetworkError`,this.cause=n}};function vi(e){let t=document.cookie.match(RegExp(`(^|;\\s*)(`+e+`)=([^;]*)`));return t?decodeURIComponent(t[3]):null}function yi(e){let t={};return e.getAllResponseHeaders().split(`\r
|
|
3
|
+
`).forEach(e=>{let n=e.indexOf(`:`);n>0&&(t[e.slice(0,n).toLowerCase().trim()]=e.slice(n+1).trim())}),t}function bi(e){return typeof FormData<`u`&&e instanceof FormData}function xi(e){return typeof e==`string`||bi(e)||typeof Blob<`u`&&e instanceof Blob||typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer||typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)||typeof URLSearchParams<`u`&&e instanceof URLSearchParams}function Si(e,t){if(!t.headers)return;let n=bi(t.data);Object.entries(t.headers).forEach(([t,r])=>{(t.toLowerCase()!==`content-type`||!n)&&e.setRequestHeader(t,String(r))})}function Ci(e,t){if(!t||Object.keys(t).length===0)return e;let[n]=qr(`get`,e,t);return n}var wi=class{xsrfCookieName;xsrfHeaderName;constructor(e={}){this.xsrfCookieName=e.xsrfCookieName??`XSRF-TOKEN`,this.xsrfHeaderName=e.xsrfHeaderName??`X-XSRF-TOKEN`}async request(e){let t=await pi.processRequest(e);try{let e=await this.doRequest(t);return await pi.processResponse(e)}catch(e){throw(e instanceof hi||e instanceof _i||e instanceof gi)&&await pi.processError(e),e}}doRequest(e){return new Promise((t,n)=>{let r=new XMLHttpRequest,i=Ci(e.url,e.params);r.open(e.method.toUpperCase(),i,!0);let a=vi(this.xsrfCookieName);a&&r.setRequestHeader(this.xsrfHeaderName,a),Object.keys(e.headers??{}).some(e=>e.toLowerCase()===`x-requested-with`)||r.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`);let o=null;e.data!==null&&e.data!==void 0&&(xi(e.data)?o=e.data:typeof e.data==`object`?(o=JSON.stringify(e.data),!e.headers?.[`Content-Type`]&&!e.headers?.[`content-type`]&&r.setRequestHeader(`Content-Type`,`application/json`)):o=String(e.data)),Si(r,e),e.onUploadProgress&&(r.upload.onprogress=t=>{let n=t.lengthComputable?t.loaded/t.total:void 0;e.onUploadProgress({progress:n,percentage:n?Math.round(n*100):0,loaded:t.loaded,total:t.lengthComputable?t.total:void 0})}),e.signal&&e.signal.addEventListener(`abort`,()=>r.abort()),r.onabort=()=>n(new gi(`Request was cancelled`,e.url)),r.onerror=()=>n(new _i(`Network error`,e.url)),r.onload=()=>{let i={status:r.status,data:r.responseText,headers:yi(r)};r.status>=400?n(new hi(`Request failed with status ${r.status}`,i,e.url)):t(i)},r.send(o)})}},Ti=new wi;function Ei(e){return!(`request`in e)}var Di={getClient(){return Ti},setClient(e){if(!Ei(e)){Ti=e;return}Ti=new wi(e),e.xsrfCookieName&&Cn.withXsrfCookieName(e.xsrfCookieName),e.xsrfHeaderName&&Cn.withXsrfHeaderName(e.xsrfHeaderName)},onRequest:pi.onRequest.bind(pi),onResponse:pi.onResponse.bind(pi),onError:pi.onError.bind(pi),processRequest:pi.processRequest.bind(pi),processResponse:pi.processResponse.bind(pi),processError:pi.processError.bind(pi)},Oi=new class{requestHandlers=[];responseHandlers=[];onVisitRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onVisitResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}async processRequest(e,t){let n=t;for(let t of this.requestHandlers)n=await t(e,n);return n}async processResponse(e,t){let n=t;for(let t of this.responseHandlers)n=await t(e,n);return n}};function W(){typeof window>`u`||(window.__inertia_interceptors__=Oi)}var ki=class e{callbacks=[];params;constructor(e){if(!e.prefetch)this.params=e;else{let t={onBefore:this.wrapCallback(e,`onBefore`),onBeforeUpdate:this.wrapCallback(e,`onBeforeUpdate`),onStart:this.wrapCallback(e,`onStart`),onProgress:this.wrapCallback(e,`onProgress`),onFinish:this.wrapCallback(e,`onFinish`),onCancel:this.wrapCallback(e,`onCancel`),onSuccess:this.wrapCallback(e,`onSuccess`),onError:this.wrapCallback(e,`onError`),onHttpException:this.wrapCallback(e,`onHttpException`),onNetworkError:this.wrapCallback(e,`onNetworkError`),onFlash:this.wrapCallback(e,`onFlash`),onCancelToken:this.wrapCallback(e,`onCancelToken`),onPrefetched:this.wrapCallback(e,`onPrefetched`),onPrefetching:this.wrapCallback(e,`onPrefetching`)};this.params={...e,...t,onPrefetchResponse:e.onPrefetchResponse||(()=>{}),onPrefetchError:e.onPrefetchError||(()=>{})}}}static create(t){return new e(t)}data(){return this.params.method===`get`?null:this.params.data}queryParams(){return this.params.method===`get`?this.params.data:{}}isPartial(){return this.params.only.length>0||this.params.except.length>0||this.params.reset.length>0}isPrefetch(){return this.params.prefetch===!0}isDeferredPropsRequest(){return this.params.deferredProps===!0}isPollRequest(){return this.params.poll===!0}onCancelToken(e){this.params.onCancelToken({cancel:e})}markAsFinished(){this.params.completed=!0,this.params.cancelled=!1,this.params.interrupted=!1}markAsCancelled({cancelled:e=!0,interrupted:t=!1}){this.params.onCancel(),this.params.completed=!1,this.params.cancelled=e,this.params.interrupted=t}wasCancelledAtAll(){return this.params.cancelled||this.params.interrupted}onFinish(){this.params.onFinish(this.params)}onStart(){this.params.onStart(this.params)}onPrefetching(){this.params.onPrefetching(this.params)}onPrefetchResponse(e){this.params.onPrefetchResponse&&this.params.onPrefetchResponse(e)}onPrefetchError(e){this.params.onPrefetchError&&this.params.onPrefetchError(e)}all(){return this.params}headers(){let e={...this.params.headers};this.isPartial()&&(e[`X-Inertia-Partial-Component`]=H.get().component);let t=this.params.only.concat(this.params.reset);return t.length>0&&(e[`X-Inertia-Partial-Data`]=t.join(`,`)),this.params.except.length>0&&(e[`X-Inertia-Partial-Except`]=this.params.except.join(`,`)),this.params.reset.length>0&&(e[`X-Inertia-Reset`]=this.params.reset.join(`,`)),this.params.errorBag&&this.params.errorBag.length>0&&(e[`X-Inertia-Error-Bag`]=this.params.errorBag),e}setPreserveOptions(t){this.params.preserveScroll=e.resolvePreserveOption(this.params.preserveScroll,t),this.params.preserveState=e.resolvePreserveOption(this.params.preserveState,t)}runCallbacks(){this.callbacks.forEach(({name:e,args:t})=>{this.params[e](...t)})}merge(e){this.params={...this.params,...e}}wrapCallback(e,t){return(...n)=>{this.recordCallback(t,n),e[t](...n)}}recordCallback(e,t){this.callbacks.push({name:e,args:t})}static resolvePreserveOption(e,t){return typeof e==`function`?e(t):e===`errors`?Object.keys(t.props.errors||{}).length>0:e}},Ai={createIframeAndPage(e){typeof e==`object`&&(e=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(e)}`);let t=document.createElement(`html`);t.innerHTML=e,t.querySelectorAll(`a`).forEach(e=>e.setAttribute(`target`,`_top`));let n=document.createElement(`iframe`);return n.style.backgroundColor=`white`,n.style.borderRadius=`5px`,n.style.width=`100%`,n.style.height=`100%`,n.setAttribute(`sandbox`,`allow-scripts`),{iframe:n,page:t}},show(e){let{iframe:t,page:n}=this.createIframeAndPage(e);t.style.boxSizing=`border-box`,t.style.display=`block`;let r=document.createElement(`dialog`);r.id=`inertia-error-dialog`,Object.assign(r.style,{width:`calc(100vw - 100px)`,height:`calc(100vh - 100px)`,padding:`0`,margin:`auto`,border:`none`,backgroundColor:`transparent`});let i=document.createElement(`style`);i.textContent=`
|
|
4
|
+
dialog#inertia-error-dialog::backdrop {
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
dialog#inertia-error-dialog:focus {
|
|
9
|
+
outline: none;
|
|
10
|
+
}
|
|
11
|
+
`;let a=Hn.get(`nonce`);a&&(i.nonce=a),document.head.appendChild(i),r.addEventListener(`click`,e=>{e.target===r&&r.close()}),r.addEventListener(`close`,()=>{i.remove(),r.remove()}),r.appendChild(t),document.body.prepend(r),r.showModal(),r.focus(),t.srcdoc=n.outerHTML}},ji=(e,t)=>e===t||e.startsWith(`${t}.`),Mi=(e,t)=>{let{only:n,except:r}=e;return!(n.length===0&&r.length===0||n.length>0&&!n.some(e=>ji(t,e))||r.length>0&&r.some(e=>ji(t,e)))},Ni=new ni,Pi=class e{constructor(e,t,n){this.requestParams=e,this.response=t,this.originatingPage=n}requestParams;response;originatingPage;wasPrefetched=!1;processed=!1;static create(t,n,r){return new e(t,n,r)}isProcessed(){return this.processed}async handlePrefetch(){Xr(this.requestParams.all().url,window.location)&&this.handle()}async handle(){return Ni.add(()=>this.process())}async process(){if(this.requestParams.all().prefetch)return this.wasPrefetched=!0,this.requestParams.all().prefetch=!1,this.requestParams.all().onPrefetched(this.response,this.requestParams.all()),nr(this.response,this.requestParams.all()),Promise.resolve();if(this.requestParams.runCallbacks(),this.processed=!0,!this.isInertiaResponse())return this.handleNonInertiaResponse();if(this.isHttpException()){let e={...this.response,data:this.getDataFromResponse(this.response.data)};if(this.requestParams.all().onHttpException(e)===!1||!Yn(e))return}await U.processQueue(),U.preserveUrl=this.requestParams.all().preserveUrl,await this.setPage();let{flash:e}=H.get();Object.keys(e).length>0&&!this.requestParams.isDeferredPropsRequest()&&(ir(e),this.requestParams.all().onFlash(e));let t=H.get().props.errors||{};if(Object.keys(t).length>0){let e=this.getScopedErrors(t);return Kn(e,{page:H.get(),visitId:this.requestParams.all().id}),this.requestParams.all().onError(e)}G.flushByCacheTags(this.requestParams.all().invalidateCacheTags||[]),this.wasPrefetched||G.flush(H.get().url),tr(H.get(),{visitId:this.requestParams.all().id}),await this.requestParams.all().onSuccess(H.get()),U.preserveUrl=!1}mergeParams(e){this.requestParams.merge(e)}getPageResponse(){let e=this.getDataFromResponse(this.response.data);return typeof e==`object`?this.response.data={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]}:this.response.data=e}async handleNonInertiaResponse(){if(this.isInertiaRedirect()){G.visit(this.getHeader(`x-inertia-redirect`),{...this.requestParams.all(),method:`get`,data:{}});return}if(this.isLocationVisit()){let e=Gr(this.getHeader(`x-inertia-location`));return Yr(this.requestParams.all().url,e),this.locationVisit(e)}let e={...this.response,data:this.getDataFromResponse(this.response.data)};if(this.requestParams.all().onHttpException(e)!==!1&&Yn(e))return Ai.show(e.data)}isInertiaResponse(){return this.hasHeader(`x-inertia`)}isHttpException(){return this.response.status>=400}hasStatus(e){return this.response.status===e}getHeader(e){return this.response.headers[e]}hasHeader(e){return this.getHeader(e)!==void 0}isInertiaRedirect(){return this.hasStatus(409)&&this.hasHeader(`x-inertia-redirect`)}isLocationVisit(){return this.hasStatus(409)&&this.hasHeader(`x-inertia-location`)}locationVisit(e){try{if(typeof window>`u`)return;let t=this.getHeader(`x-inertia-version`),n=!!t&&t!==H.get().version;if(!ar(e,n)||n&&this.requestParams.all().async)return;or.set(or.locationVisitKey,{preserveScroll:this.requestParams.all().preserveScroll===!0}),Xr(window.location,e)?window.location.reload():window.location.href=e.href}catch{return!1}}async setPage(){let e=this.getPageResponse();return this.shouldSetPage(e)?(this.response=await Oi.processResponse(this.requestParams.all(),this.response),this.mergeProps(e),H.mergeOncePropsIntoResponse(e),this.preserveOptimisticProps(e),this.preserveEqualProps(e),await this.setRememberedState(e),this.requestParams.setPreserveOptions(e),e.url=U.preserveUrl?H.get().url:this.pageUrl(e),this.requestParams.all().onBeforeUpdate(e),Xn(e),H.set(e,{replace:this.requestParams.all().replace,preserveScroll:this.requestParams.all().preserveScroll,preserveState:this.requestParams.all().preserveState,viewTransition:this.requestParams.all().viewTransition,cached:this.requestParams.all().cached,visitId:this.requestParams.all().id})):Promise.resolve()}getDataFromResponse(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}shouldSetPage(e){if(!this.requestParams.all().async||this.originatingPage.component!==e.component)return!0;if(this.originatingPage.component!==H.get().component)return!1;let t=Gr(this.originatingPage.url),n=Gr(H.get().url);return t.origin===n.origin&&t.pathname===n.pathname}pageUrl(e){let t=Gr(e.url);return e.preserveFragment?t.hash=this.requestParams.all().url.hash:Yr(this.requestParams.all().url,t),t.pathname+t.search+t.hash}preserveOptimisticProps(e){if(G.hasPendingOptimistic())for(let t of Object.keys(e.props))H.hasBaseline(t)&&(H.updateBaseline(t,e.props[t]),e.props[t]=H.get().props[t])}preserveEqualProps(e){if(e.component!==H.get().component)return;let t=H.get().props;Object.entries(e.props).forEach(([n,r])=>{xt(r,t[n])&&(e.props[n]=t[n])})}mergeProps(e){if(!this.requestParams.isPartial()||e.component!==H.get().component)return;let t=e.mergeProps||[],n=e.prependProps||[],r=e.deepMergeProps||[],i=e.matchPropsOn||[],a=(t,n)=>{let r=jt(H.get().props,t),a=jt(e.props,t);if(Array.isArray(a)){let o=this.mergeOrMatchItems(r||[],a,t,i,n);Yt(e.props,t,o)}else if(typeof a==`object`&&a){let n={...r||{},...a};Yt(e.props,t,n)}};t.forEach(e=>a(e,!0)),n.forEach(e=>a(e,!1)),r.forEach(t=>{let n=jt(H.get().props,t),r=jt(e.props,t),a=(e,t,n)=>Array.isArray(t)?this.mergeOrMatchItems(e,t,n,i):typeof t==`object`&&t?Object.keys(t).reduce((r,i)=>(r[i]=a(e?e[i]:void 0,t[i],`${n}.${i}`),r),{...e}):t;Yt(e.props,t,a(n,r,t))});let o=new Set([...this.requestParams.all().only,...this.requestParams.all().except].filter(e=>e.includes(`.`)).map(e=>e.split(`.`)[0]));for(let t of o){let n=H.get().props[t];this.isObject(n)&&this.isObject(e.props[t])&&(e.props[t]=this.deepMergeObjects(n,e.props[t]))}e.props={...H.get().props,...e.props},this.shouldPreserveErrors(e)&&(e.props.errors=H.get().props.errors),H.get().scrollProps&&(e.scrollProps={...H.get().scrollProps||{},...e.scrollProps||{}}),H.hasOnceProps()&&(e.onceProps={...H.get().onceProps||{},...e.onceProps||{}}),this.requestParams.isDeferredPropsRequest()&&(e.flash={...H.get().flash});let s=H.get().initialDeferredProps;s&&Object.keys(s).length>0&&(e.initialDeferredProps=s),e.rescuedProps=this.mergeRescuedProps(e)}mergeRescuedProps(e){let t=H.get().rescuedProps??[],n=e.rescuedProps??[],r=new Set(t.filter(e=>!Mi(this.requestParams.all(),e)));return n.forEach(e=>r.add(e)),Array.from(r)}shouldPreserveErrors(e){if(!this.requestParams.all().preserveErrors)return!1;let t=H.get().props.errors;if(!t||Object.keys(t).length===0)return!1;let n=e.props.errors;return!(n&&Object.keys(n).length>0)}isObject(e){return e&&typeof e==`object`&&!Array.isArray(e)}deepMergeObjects(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];n[r]=this.isObject(i)&&this.isObject(a)?this.deepMergeObjects(i,a):a}return n}mergeOrMatchItems(e,t,n,r,i=!0){let a=Array.isArray(e)?e:[],o=r.find(e=>e.split(`.`).slice(0,-1).join(`.`)===n);if(!o)return i?[...a,...t]:[...t,...a];let s=o.split(`.`).pop()||``,c=new Map;return t.forEach(e=>{this.hasUniqueProperty(e,s)&&c.set(e[s],e)}),i?this.appendWithMatching(a,t,c,s):this.prependWithMatching(a,t,c,s)}appendWithMatching(e,t,n,r){let i=e.map(e=>this.hasUniqueProperty(e,r)&&n.has(e[r])?n.get(e[r]):e),a=t.filter(t=>!this.hasUniqueProperty(t,r)||!e.some(e=>this.hasUniqueProperty(e,r)&&e[r]===t[r]));return[...i,...a]}prependWithMatching(e,t,n,r){let i=e.filter(e=>!this.hasUniqueProperty(e,r)||!n.has(e[r]));return[...t,...i]}hasUniqueProperty(e,t){return e&&typeof e==`object`&&t in e}async setRememberedState(e){let t=await U.getState(U.rememberedState,{});this.requestParams.all().preserveState&&t&&e.component===H.get().component&&(e.rememberedState=t)}getScopedErrors(e){return this.requestParams.all().errorBag?e[this.requestParams.all().errorBag||``]||{}:e}},Fi=class e{constructor(e,t,{optimistic:n=!1}={}){this.page=t,this.requestParams=ki.create(e),this.cancelToken=new AbortController,this.optimistic=n}page;response;cancelToken;requestParams;requestHasFinished=!1;optimistic;static create(t,n,r){return new e(t,n,r)}isPrefetch(){return this.requestParams.isPrefetch()}isOptimistic(){return this.optimistic}isPendingOptimistic(){return this.isOptimistic()&&(!this.response||!this.response.isProcessed())}async send(){this.requestParams.onCancelToken(()=>this.cancel({cancelled:!0})),er(this.requestParams.all()),this.requestParams.onStart(),this.requestParams.all().prefetch&&(this.requestParams.onPrefetching(),rr(this.requestParams.all()));let e=this.requestParams.all().prefetch,t={method:this.requestParams.all().method,url:Jr(this.requestParams.all().url).href,data:this.requestParams.data(),signal:this.cancelToken.signal,headers:this.getHeaders(),onUploadProgress:this.onProgress.bind(this)},n=await Oi.processRequest(this.requestParams.all(),t);return Di.getClient().request(n).then(e=>(this.response=Pi.create(this.requestParams,e,this.page),this.response.handle())).catch(e=>e instanceof hi?(this.response=Pi.create(this.requestParams,e.response,this.page),this.response.handle()):Promise.reject(e)).catch(t=>{if(!(t instanceof gi)&&this.requestParams.all().onNetworkError(t)!==!1&&qn(t))return e&&this.requestParams.onPrefetchError(t),Promise.reject(t)}).finally(()=>{this.finish(),e&&this.response&&this.requestParams.onPrefetchResponse(this.response)})}finish(){this.requestParams.wasCancelledAtAll()||(this.requestParams.markAsFinished(),this.fireFinishEvents())}fireFinishEvents(){this.requestHasFinished||(this.requestHasFinished=!0,Jn(this.requestParams.all()),this.requestParams.onFinish())}cancel({cancelled:e=!1,interrupted:t=!1}){this.requestHasFinished||(this.cancelToken.abort(),this.requestParams.markAsCancelled({cancelled:e,interrupted:t}),this.fireFinishEvents())}onProgress(e){this.requestParams.data()instanceof FormData&&($n(e),this.requestParams.all().onProgress(e))}getHeaders(){let e={...this.requestParams.headers(),Accept:`text/html, application/xhtml+xml`,"X-Requested-With":`XMLHttpRequest`,"X-Inertia":!0},t=H.get();t.version&&(e[`X-Inertia-Version`]=t.version);let n=Object.entries(t.onceProps||{}).filter(([,e])=>jt(t.props,e.prop)===void 0?!1:!e.expiresAt||e.expiresAt>Date.now()).map(([e])=>e);return n.length>0&&(e[`X-Inertia-Except-Once-Props`]=n.join(`,`)),e}},Ii=class{requests=[];maxConcurrent;interruptible;constructor({maxConcurrent:e,interruptible:t}){this.maxConcurrent=e,this.interruptible=t}send(e){this.requests.push(e),e.send().finally(()=>{this.requests=this.requests.filter(t=>t!==e)})}interruptInFlight(){this.cancel({interrupted:!0},!1)}cancelInFlight({prefetch:e=!0,optimistic:t=!0}={}){this.requests.filter(t=>e||!t.isPrefetch()).filter(e=>t||!e.isOptimistic()).forEach(e=>e.cancel({cancelled:!0}))}cancel({cancelled:e=!1,interrupted:t=!1}={},n=!1){!n&&!this.shouldCancel()||this.requests.shift()?.cancel({cancelled:e,interrupted:t})}shouldCancel(){return this.interruptible&&this.requests.length>=this.maxConcurrent}hasPendingOptimistic(){return this.requests.some(e=>e.isPendingOptimistic())}},Li=()=>{},Ri=class{syncRequestStream=new Ii({maxConcurrent:1,interruptible:!0});asyncRequestStream=new Ii({maxConcurrent:1/0,interruptible:!1});clientVisitQueue=new ni;pendingOptimisticCallback=void 0;init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}){H.init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}),ui.handle(),si.init(),si.on(`missingHistoryItem`,()=>{typeof window<`u`&&this.visit(window.location.href,{preserveState:!0,preserveScroll:!0,replace:!0})}),si.on(`loadDeferredProps`,e=>{this.loadDeferredProps(e)}),si.on(`historyQuotaExceeded`,e=>{window.location.href=e})}optimistic(e){return this.pendingOptimisticCallback=e,this}get(e,t={},n={}){return this.visit(e,{...n,method:`get`,data:t})}post(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`post`,data:t})}put(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`put`,data:t})}patch(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`patch`,data:t})}delete(e,t={}){return this.visit(e,{preserveState:!0,...t,method:`delete`})}reload(e={}){return this.doReload(e)}doReload(e={}){if(!(typeof window>`u`))return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0,async:!0,headers:{...e.headers||{},"Cache-Control":`no-cache`}})}remember(e,t=`default`){U.remember(e,t)}restore(e=`default`){return U.restore(e)}on(e,t){return typeof window>`u`?()=>{}:si.onGlobalEvent(e,t)}once(e,t){if(typeof window>`u`)return()=>{};let n=this.on(e,e=>(n(),t(e)));return n}hasPendingOptimistic(){return this.asyncRequestStream.hasPendingOptimistic()}get activePolls(){return fi.count}cancelAll({async:e=!0,prefetch:t=!0,sync:n=!0}={}){e&&this.asyncRequestStream.cancelInFlight({prefetch:t}),n&&this.syncRequestStream.cancelInFlight()}poll(e,t={},n={}){return fi.add(e,({onStart:e,onFinish:n})=>{let r=typeof t==`function`?t():t;this.doReload({poll:!0,preserveErrors:!0,...r,onCancelToken:t=>{e(t.cancel),r.onCancelToken?.(t)},onFinish:e=>{n(),r.onFinish?.(e)}})},{autoStart:n.autoStart??!0,keepAlive:n.keepAlive??!1,mode:n.mode})}visit(e,t={}){t.optimistic=t.optimistic??this.pendingOptimisticCallback,this.pendingOptimisticCallback=void 0,t.optimistic&&(t.async=t.async??!0);let n=this.getPendingVisit(e,{...t,showProgress:t.showProgress??(!t.async||!!t.optimistic)}),r=this.getVisitEvents(t);if(r.onBefore(n)===!1||!Gn(n))return;let i=Gr(H.get().url);(n.only.length>0||n.except.length>0||n.reset.length>0?Zr(n.url,i):Xr(n.url,i))||this.asyncRequestStream.cancelInFlight({prefetch:!1,optimistic:!1}),n.async||this.syncRequestStream.interruptInFlight(),t.optimistic&&this.applyOptimisticUpdate(t.optimistic,r),!H.isCleared()&&!n.preserveUrl&&Ar.save();let a={...n,...r},o=()=>{let e=Sr.get(a);e?(Ga.reveal(e.inFlight),Sr.use(e,a)):(Ga.reveal(!0),(n.async?this.asyncRequestStream:this.syncRequestStream).send(Fi.create(a,H.get(),{optimistic:!!t.optimistic})))};Array.isArray(n.component)&&(console.error(`The "component" prop received an array of components (${n.component.join(`, `)}), but only a single component string is supported for instant visits. Pass an explicit component name instead.`),n.component=null),n.component?U.processQueue().then(()=>{this.performInstantSwap(n).then(()=>{a.preserveScroll=!0,a.preserveState=!0,a.replace=!0,a.viewTransition=!1,o()})}):o()}getCached(e,t={}){return Sr.findCached(this.getPrefetchParams(e,t))}flush(e,t={}){Sr.remove(this.getPrefetchParams(e,t))}flushAll(){Sr.removeAll()}flushByCacheTags(e){Sr.removeByTags(Array.isArray(e)?e:[e])}getPrefetching(e,t={}){return Sr.findInFlight(this.getPrefetchParams(e,t))}prefetch(e,t={},n={}){if((t.method??(Qr(e)?e.method:`get`))!==`get`)throw Error(`Prefetch requests must use the GET method`);let r=this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1});if(r.url.origin+r.url.pathname+r.url.search===window.location.origin+window.location.pathname+window.location.search)return;let i=this.getVisitEvents(t);if(i.onBefore(r)===!1||!Gn(r))return;Ga.hide(),this.asyncRequestStream.interruptInFlight();let a={...r,...i};new Promise(e=>{let t=()=>{H.get()?e():setTimeout(t,50)};t()}).then(()=>{Sr.add(a,e=>{this.asyncRequestStream.send(Fi.create(e,H.get()))},{cacheFor:Hn.get(`prefetch.cacheFor`),cacheTags:[],...n})})}clearHistory(){U.clear()}decryptHistory(){return U.decrypt()}resolveComponent(e,t){return H.resolve(e,t)}replace(e){this.clientVisit(e,{replace:!0})}replaceProp(e,t,n){this.replace({preserveScroll:!0,preserveState:!0,props(n){let r=typeof t==`function`?t(jt(n,e),n):t;return Yt(pt(n),e,r)},...n||{}})}appendToProp(e,t,n){this.replaceProp(e,(e,n)=>{let r=typeof t==`function`?t(e,n):t;return Array.isArray(e)||(e=e===void 0?[]:[e]),[...e,r]},n)}prependToProp(e,t,n){this.replaceProp(e,(e,n)=>{let r=typeof t==`function`?t(e,n):t;return Array.isArray(e)||(e=e===void 0?[]:[e]),[r,...e]},n)}push(e){this.clientVisit(e)}flash(e,t){let n=H.get().flash,r;if(typeof e==`function`)r=e(n);else if(typeof e==`string`)r={...n,[e]:t};else if(e&&Object.keys(e).length)r={...n,...e};else return;H.setFlash(r),Object.keys(r).length&&ir(r)}clientVisit(e,{replace:t=!1}={}){this.clientVisitQueue.add(()=>this.performClientVisit(e,{replace:t}))}performClientVisit(e,{replace:t=!1}={}){let n=H.get(),r=typeof e.props==`function`?Object.fromEntries(Object.values(n.onceProps??{}).map(e=>[e.prop,jt(n.props,e.prop)])):{},i=typeof e.props==`function`?e.props(n.props,r):e.props??n.props,a=typeof e.flash==`function`?e.flash(n.flash):e.flash,{viewTransition:o,onError:s,onFinish:c,onFlash:l,onSuccess:u,...d}=e,f={...n,...d,flash:a??{},props:i},p=ki.resolvePreserveOption(e.preserveScroll??!1,f),m=ki.resolvePreserveOption(e.preserveState??!1,f),h=this.createVisitId();return H.set(f,{replace:t,preserveScroll:p,preserveState:m,viewTransition:o,visitId:h}).then(()=>{Qn(H.get(),{replace:t,visitId:h});let n=H.get().flash;Object.keys(n).length>0&&(ir(n),l?.(n));let r=H.get().props.errors||{};if(Object.keys(r).length===0){u?.(H.get());return}let i=e.errorBag?r[e.errorBag||``]||{}:r;s?.(i)}).finally(()=>c?.(e))}performInstantSwap(e){let t=H.get(),n=Object.fromEntries((t.sharedProps??[]).filter(e=>e in t.props).map(e=>[e,t.props[e]])),r=typeof e.pageProps==`function`?e.pageProps(pt(t.props),pt(n)):e.pageProps,i=r===null?{...n}:{...r},a={component:e.component,url:e.url.pathname+e.url.search+e.url.hash,version:t.version,props:{...i,errors:{}},flash:{},rescuedProps:[],clearHistory:!1,encryptHistory:t.encryptHistory,sharedProps:t.sharedProps,rememberedState:{}};return H.set(a,{replace:e.replace,preserveScroll:ki.resolvePreserveOption(e.preserveScroll,a),preserveState:!1,viewTransition:e.viewTransition,visitId:e.id})}getPrefetchParams(e,t){return{...this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1}),...this.getVisitEvents(t)}}createVisitId(){return li()}getPendingVisit(e,t){if(Qr(e)){let n=e;e=n.url,t.method=t.method??n.method}let n=Hn.get(`visitOptions`),r=n&&n(e.toString(),pt(t))||{},i={method:`get`,data:{},replace:!1,preserveScroll:!1,preserveState:!1,only:[],except:[],headers:{},errorBag:``,forceFormData:!1,queryStringArrayFormat:`brackets`,async:!1,showProgress:!0,fresh:!1,reset:[],preserveUrl:!1,preserveErrors:!1,prefetch:!1,invalidateCacheTags:[],viewTransition:!1,component:null,pageProps:null,cached:!1,..._r(t),..._r(r)},[a,o]=Kr(e,i.data,i.method,i.forceFormData,i.queryStringArrayFormat),s={id:this.createVisitId(),cancelled:!1,completed:!1,interrupted:!1,...i,url:a,data:o};return s.prefetch&&(s.headers.Purpose=`prefetch`),s}getVisitEvents(e){return{onCancelToken:e.onCancelToken||Li,onBefore:e.onBefore||Li,onBeforeUpdate:e.onBeforeUpdate||Li,onStart:e.onStart||Li,onProgress:e.onProgress||Li,onFinish:e.onFinish||Li,onCancel:e.onCancel||Li,onSuccess:e.onSuccess||Li,onError:e.onError||Li,onHttpException:e.onHttpException||Li,onNetworkError:e.onNetworkError||Li,onFlash:e.onFlash||Li,onPrefetched:e.onPrefetched||Li,onPrefetching:e.onPrefetching||Li}}applyOptimisticUpdate(e,t){let n=H.get().props,r=e(pt(n));if(!r)return;let i=[];for(let e of Object.keys(r))xt(n[e],r[e])||i.push(e);if(i.length===0)return;let a=H.nextOptimisticId(),o=H.get().component;for(let e of i)H.setBaseline(e,pt(n[e]));H.registerOptimistic(a,e),H.setPropsQuietly({...n,...r});let s=!0,c=t.onSuccess;t.onSuccess=e=>(s=!1,c(e));let l=t.onFinish;t.onFinish=e=>{if(H.unregisterOptimistic(a),s&&H.get().component===o){let e=H.replayOptimistics();Object.keys(e).length>0&&H.setPropsQuietly({...H.get().props,...e})}return H.pendingOptimisticCount()===0&&H.clearOptimisticState(),l(e)}}loadDeferredProps(e){e&&Object.values(e).forEach(e=>{this.doReload({only:e,deferredProps:!0,preserveErrors:!0})})}},zi=class{static createWayfinderCallback(...e){return()=>e.length===1?Qr(e[0])?e[0]:e[0]():{method:typeof e[0]==`function`?e[0]():e[0],url:typeof e[1]==`function`?e[1]():e[1]}}static parseUseFormArguments(...e){return e.length===0?{rememberKey:null,data:{},precognitionEndpoint:null}:e.length===1?{rememberKey:null,data:e[0],precognitionEndpoint:null}:e.length===2?typeof e[0]==`string`?{rememberKey:e[0],data:e[1],precognitionEndpoint:null}:{rememberKey:null,data:e[1],precognitionEndpoint:this.createWayfinderCallback(e[0])}:{rememberKey:null,data:e[2],precognitionEndpoint:this.createWayfinderCallback(e[0],e[1])}}static parseSubmitArguments(e,t){return e.length===3||e.length===2&&typeof e[0]==`string`?{method:e[0],url:e[1],options:e[2]??{}}:Qr(e[0])?{...e[0],options:e[1]??{}}:{...t(),options:e[0]??{}}}static mergeHeadersForValidation(e,t,n){let r=e=>(e.headers={...n??{},...e.headers??{}},e);return e&&typeof e==`object`&&!(`target`in e)?e=r(e):t&&typeof t==`object`?t=r(t):typeof e==`string`?t=r(t??{}):e=r(e??{}),[e,t]}};function Bi(e){return e.includes(`.`)?e.replace(/\\\./g,`__ESCAPED_DOT__`).split(/(\[[^\]]*\])/).filter(Boolean).map(e=>e.startsWith(`[`)&&e.endsWith(`]`)?e:e.split(`.`).reduce((e,t,n)=>n===0?t:`${e}[${t}]`)).join(``).replace(/__ESCAPED_DOT__/g,`.`):e}function Vi(e){let t=[],n=/([^\[\]]+)|\[(\d*)\]/g,r;for(;(r=n.exec(e))!==null;)r[1]===void 0?r[2]!==void 0&&t.push(r[2]===``?``:Number(r[2])):t.push(r[1]);return t}function Hi(e,t,n){let r=e;for(let e=0;e<t.length-1;e++)t[e]in r||(r[t[e]]={}),r=r[t[e]];r[t[t.length-1]]=n}function Ui(e){let t=Object.keys(e),n=t.filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>e-t);return t.length===n.length&&n.length>0&&n[0]===0&&n.every((e,t)=>e===t)}function Wi(e){if(Array.isArray(e))return e.map(Wi);if(typeof e!=`object`||!e||jr(e))return e;if(Ui(e)){let t=[];for(let n=0;n<Object.keys(e).length;n++)t[n]=Wi(e[n]);return t}let t={};for(let n in e)t[n]=Wi(e[n]);return t}function Gi(e){let t={};for(let[n,r]of e.entries()){if(r instanceof File&&r.size===0&&r.name===``)continue;let e=Vi(Bi(n));if(e[e.length-1]===``){let n=e.slice(0,-1),i=jt(t,n);if(Array.isArray(i))i.push(r);else if(i&&typeof i==`object`&&!jr(i)){let e=Object.keys(i).filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>e-t);Yt(t,n,e.length>0?[...e.map(e=>i[e]),r]:[r])}else Yt(t,n,[r]);continue}Hi(t,e.map(String),r)}return Wi(t)}var Ki=`server`;function qi(e,t){return e.match(/\sdata-inertia(=|\s|>)/)?e:e.replace(/^<([a-zA-Z][^\s/>]*)/,`<$1 data-inertia="server-head-${t}"`)}function Ji(e,t){if(!t)return[];let n=typeof t==`function`?t(e):e.props[t===!0?`head`:t];return Array.isArray(n)?n.map(e=>typeof e==`string`?e.trim():e).filter(e=>typeof e==`string`&&e.length>0).map(qi):[]}var Yi={buildDOMElement(e){let t=document.createElement(`template`);t.innerHTML=e;let n=t.content.firstChild;if(!e.startsWith(`<script `))return n;let r=document.createElement(`script`);return r.innerHTML=n.innerHTML,n.getAttributeNames().forEach(e=>{r.setAttribute(e,n.getAttribute(e)||``)}),r},isInertiaManagedElement(e){return e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`data-inertia`)!==null},findMatchingElementIndex(e,t){let n=e.getAttribute(`data-inertia`);return n===null?-1:t.findIndex(e=>e.getAttribute(`data-inertia`)===n)},update:Un(function(e){let t=e.map(e=>this.buildDOMElement(e)),n=Array.from(document.head.childNodes).filter(e=>this.isInertiaManagedElement(e));t.some(e=>e instanceof HTMLTitleElement)&&document.head.querySelectorAll(`title:not([data-inertia])`).forEach(e=>e.remove()),n.forEach(e=>{let n=this.findMatchingElementIndex(e,t);if(n===-1){e.remove();return}let r=t.splice(n,1)[0];r&&!e.isEqualNode(r)&&e.replaceWith(r)}),t.forEach(e=>{document.head.appendChild(e)})},1)};function Xi(e,t,n,r=[]){let i=r.length?{[Ki]:r}:{},a=0;function o(){let e=a+=1;return i[e]=[],e.toString()}function s(e){e!==null&&Object.keys(i).indexOf(e)!==-1&&(delete i[e],f())}function c(e){Object.keys(i).indexOf(e)===-1&&(i[e]=[])}function l(e,t=[]){e!==null&&Object.keys(i).indexOf(e)>-1&&(i[e]=t),f()}function u(e=[]){e.length?i[Ki]=e:delete i[Ki],f()}function d(){let e=t(``),n=i[Ki]||[],r=Object.keys(i).filter(e=>e!==Ki).flatMap(e=>i[e]),a={...e?{title:`<title data-inertia="">${e}</title>`}:{}},o=n.concat(r).reduce((e,n)=>{if(n.indexOf(`<`)===-1)return e;if(n.indexOf(`<title `)===0){let r=n.match(/(<title [^>]+>)(.*?)(<\/title>)/s);return e.title=r?`${r[1]}${t(r[2])}${r[3]}`:n,e}let r=n.match(/ data-inertia=(["'])[^"']+\1/);return r?e[r[0]]=n:e[Object.keys(e).length]=n,e},a);return Object.values(o)}function f(){e?n(d()):Yi.update(d())}return f(),{forceUpdate:f,updateServerHead:u,createProvider:function(){let e=o();return{reconnect:()=>c(e),update:t=>l(e,t),disconnect:()=>s(e)}}}}var Zi=`X-Inertia-Infinite-Scroll-Merge-Intent`,Qi=e=>{let t=()=>{let t=H.get().scrollProps?.[e.getPropName()];if(t)return t;throw Error(`The page object does not contain a scroll prop named "${e.getPropName()}".`)},n={component:null,loading:!1,previousPage:null,nextPage:null,lastLoadedPage:null,requestCount:0},r=()=>{let e=t();n.component=H.get().component,n.loading=!1,n.previousPage=e.previousPage,n.nextPage=e.nextPage,n.lastLoadedPage=e.currentPage,n.requestCount=0},i=()=>`inertia:infinite-scroll-data:${e.getPropName()}`;if(typeof window<`u`){r();let e=G.restore(i());e&&typeof e==`object`&&e.lastLoadedPage===t().currentPage&&(n.previousPage=e.previousPage,n.nextPage=e.nextPage,n.lastLoadedPage=e.lastLoadedPage,n.requestCount=e.requestCount||0)}let a=G.on(`success`,i=>{n.component===i.detail.page.component&&t().reset&&(r(),e.onReset?.())}),o=e=>e===`next`?`nextPage`:`previousPage`,s=e=>{let t=o(e);return n[t]},c=e=>{let r=t(),a=o(e);n.lastLoadedPage=r.currentPage,n[a]=r[a],n.requestCount+=1,G.remember({previousPage:n.previousPage,nextPage:n.nextPage,lastLoadedPage:n.lastLoadedPage,requestCount:n.requestCount},i())},l=()=>t().pageName,u=()=>n.requestCount,d=(t,r={})=>{let i=s(t);n.loading||i===null||(n.loading=!0,G.reload({preserveErrors:!0,...r,data:{...r.data||{},[l()]:i},only:[...r.only||[],e.getPropName()],preserveUrl:!0,headers:{[Zi]:t===`previous`?`prepend`:`append`,...r.headers},onBefore:n=>{t===`next`?e.onBeforeNextRequest():e.onBeforePreviousRequest(),r.onBefore?.(n)},onBeforeUpdate:t=>{e.onBeforeUpdate(),r.onBeforeUpdate?.(t)},onSuccess:e=>{c(t),r.onSuccess?.(e)},onFinish:i=>{n.loading=!1;let a=i.completed,o=a?n.lastLoadedPage:null;t===`next`?e.onCompleteNextRequest(o,{page:o,completed:a}):e.onCompletePreviousRequest(o,{page:o,completed:a}),r.onFinish?.(i)}}))};return{getLastLoadedPage:()=>n.lastLoadedPage,getPageName:l,getRequestCount:u,hasPrevious:()=>!!n.previousPage,hasNext:()=>!!n.nextPage,fetchNext:e=>d(`next`,e),fetchPrevious:e=>d(`previous`,e),removeEventListener:a}},$i=()=>{let e=[];return{new:(t,n={})=>{let r=new IntersectionObserver(e=>{for(let n of e)n.isIntersecting&&t(n)},n);return e.push(r),r},flushAll:()=>{e.forEach(e=>e.disconnect()),e.length=0}}},ea=`infiniteScrollPage`,ta=`infiniteScrollIgnore`,na=e=>e.dataset[ea],ra=e=>{let t=$i(),n,r,i,a,o=!1,s=()=>{a=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&f.add(e)})}),b()}),a.observe(e.getItemsElement(),{childList:!0}),n=t.new(t=>e.onItemIntersected(t.target));let o={root:e.getScrollableParent(),rootMargin:`${Math.max(1,e.getTriggerMargin())}px`};r=t.new(e.onPreviousTriggered,o),i=t.new(e.onNextTriggered,o)},c=()=>{o&&l();let t=e.getStartElement(),n=e.getEndElement();t&&e.shouldFetchPrevious()&&r.observe(t),n&&e.shouldFetchNext()&&i.observe(n),o=!0},l=()=>{o&&=(r.disconnect(),i.disconnect(),!1)},u=()=>{o&&c()},d=()=>{l(),t.flushAll(),a?.disconnect()},f=new Set,p=e=>!(ea in e.dataset)&&!(ta in e.dataset),m=()=>{Array.from(f).forEach(e=>{p(e)&&(e.dataset[ta]=`true`),n.observe(e)}),f.clear()},h=e=>Array.from(e.querySelectorAll(`:scope > *:not([data-infinite-scroll-page]):not([data-infinite-scroll-ignore])`)),g=!1,_=t=>{!g&&(g=!0,x())||(h(e.getItemsElement()).forEach(e=>{p(e)&&(e.dataset[ea]=t?.toString()||`1`),n.observe(e)}),y())},v=()=>`inertia:infinite-scroll-elements:${e.getPropName()}`,y=()=>{let t={},n=e.getItemsElement().childNodes;for(let e=0;e<n.length;e++){let r=n[e];if(r.nodeType!==Node.ELEMENT_NODE)continue;let i=na(r);i!==void 0&&(i in t?t[i].to=e:t[i]={from:e,to:e})}G.remember(t,v())},b=Un(y,250),x=()=>{let t=G.restore(v());if(!t||typeof t!=`object`)return!1;let r=e.getItemsElement().childNodes;for(let e=0;e<r.length;e++){let i=r[e];if(i.nodeType!==Node.ELEMENT_NODE)continue;let a=i,o;for(let[n,r]of Object.entries(t))if(e>=r.from&&e<=r.to){o=n;break}if(o)a.dataset[ea]=o;else if(p(a))a.dataset[ta]=`true`;else continue;n.observe(a)}return!0};return{setupObservers:s,enableTriggers:c,disableTriggers:l,refreshTriggers:u,flushAll:d,processManuallyAddedElements:m,processServerLoadedElements:_}},ia=new ni,aa,oa,sa=null,ca=e=>{let t=!0,n=n=>{ia.add(()=>new Promise(r=>{if(!t)return aa=oa=null,r();if(!aa||!oa){let e=H.get().url;aa=Gr(e),oa=Gr(e),sa=ei(e)}let i=e.getPageName(),a=oa.searchParams;n===`1`?a.delete(i):a.set(i,n),setTimeout(()=>r())})).finally(()=>{t&&aa&&oa&&aa.href!==oa.href&&sa!==null&&G.replace({url:ti(oa,sa),preserveScroll:!0,preserveState:!0}),aa=oa=sa=null})};return{onItemIntersected:Un(r=>{let i=e.getItemsElement();if(!t||e.shouldPreserveUrl()||!r||!i)return;let a=new Map;Tr([...i.children],r).forEach(e=>{let t=na(e)??`1`;a.has(t)?a.set(t,a.get(t)+1):a.set(t,1)});let o=Array.from(a.entries()).sort((e,t)=>t[1]-e[1])[0]?.[0];o!==void 0&&n(o)},250),cancel:()=>t=!1}},la=e=>({createCallbacks:()=>{let t,n=null,r=0;return{captureScrollPosition:()=>{let i=e.getScrollableParent(),a=e.getItemsElement();t=i?.scrollTop||window.scrollY;let o=Tr([...a.children]);if(o.length>0){n=o[0];let e=i?.getBoundingClientRect()||{top:0},t=i?e.top:0;r=n.getBoundingClientRect().top-t}},restoreScrollPosition:()=>{if(!n)return;let i=0,a=!1,o=()=>{if(i++,a||i>10)return!1;let s=e.getScrollableParent(),c=s?.getBoundingClientRect()||{top:0},l=s?c.top:0,u=n.getBoundingClientRect().top-l-r;if(u===0){window.requestAnimationFrame(o);return}s?s.scrollTo({top:t+u}):window.scrollTo(0,window.scrollY+u),a=!0};window.requestAnimationFrame(o)}}}});function ua(e){let t=ca({...e,getPageName:()=>i.getPageName()}),n=la(e),r=ra({...e,onItemIntersected:t.onItemIntersected,onPreviousTriggered:()=>i.fetchPrevious(),onNextTriggered:()=>i.fetchNext()}),i=Qi({...e,onBeforeUpdate:r.processManuallyAddedElements,onCompletePreviousRequest:(t,n)=>{e.onCompletePreviousRequest(n),n.completed&&Er(()=>r.processServerLoadedElements(n.page),2)},onCompleteNextRequest:(t,n)=>{e.onCompleteNextRequest(n),n.completed&&Er(()=>r.processServerLoadedElements(n.page),2)},onReset:e.onDataReset}),a=e=>{let{captureScrollPosition:t,restoreScrollPosition:r}=n.createCallbacks(),i=e.onBeforeUpdate||(()=>{}),a=e.onSuccess||(()=>{});return e.onBeforeUpdate=e=>{i(e),t()},e.onSuccess=e=>{a(e),r()},e},o=i.fetchNext;i.fetchNext=(t={})=>{t={...e.getReloadOptions?.(),...t},e.inReverseMode()&&(t=a(t)),o(t)};let s=i.fetchPrevious;i.fetchPrevious=(t={})=>{t={...e.getReloadOptions?.(),...t},e.inReverseMode()||(t=a(t)),s(t)};let c=G.on(`success`,()=>Er(r.refreshTriggers,2));return{dataManager:i,elementManager:r,flush:()=>{c(),i.removeEventListener(),r.flushAll(),t.cancel()}}}function da(){let e={},t={},n={shared:e,named:t},r=new Set,i=!1,a=()=>{n={shared:e,named:t}},o=()=>{i||(i=!0,queueMicrotask(()=>{i=!1,r.forEach(e=>e())}))};return{set(t){let n={...e,...t};xt(e,n)||(e=n,a(),o())},setFor(e,n){let r=t[e]||{},i={...r,...n};xt(r,i)||(t={...t,[e]:i},a(),o())},reset(){e={},t={},a(),o()},subscribe(e){return r.add(e),()=>r.delete(e)},get:()=>n}}function fa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function pa(e){return fa(e)&&`component`in e}function ma(e,t){return`component`in e&&t(e.component)}function ha(e,t){return!fa(e)||t(e)||ma(e,t)?!1:Object.values(e).every(e=>t(e)||Array.isArray(e)&&t(e[0])||pa(e)&&t(e.component))}function ga(e,t){return fa(e)&&!t(e)&&!ma(e,t)&&!ha(e,t)}function _a(e,t){if(ga(e,t))return!0;if(!fa(e)||t(e)||ma(e,t))return!1;let n=Object.values(e);return n.length>0&&n.every(e=>typeof e==`function`)}function va(e,t){return Array.isArray(e)&&e.length===2&&t(e[0])&&fa(e[1])&&!t(e[1])}function ya(e,t){if(Array.isArray(e)&&t(e[0]))return{component:e[0],props:e[1]??{}};if(pa(e)&&t(e.component))return{component:e.component,props:e.props??{}};if(t(e))return{component:e,props:{}};throw Error(`Invalid layout definition: received ${typeof e}`)}function ba(e,t,n){return!e||n&&n(e)?[]:ha(e,t)?Object.entries(e).map(([e,n])=>({...ya(n,t),name:e})):va(e,t)?[{component:e[0],props:e[1]??{}}]:Array.isArray(e)?e.map(e=>ya(e,t)):pa(e)&&t(e.component)?[{component:e.component,props:e.props??{}}]:t(e)?[{component:e,props:{}}]:[]}function xa(e){return e.target instanceof HTMLElement&&e.target.isContentEditable||e.defaultPrevented}function Sa(e){let t=e.currentTarget.tagName.toLowerCase()===`a`,n=t?e.currentTarget.target:``;return!(xa(e)||t&&e.altKey||t&&e.ctrlKey||t&&e.metaKey||t&&e.shiftKey||t&&n!==``&&n!==`_self`||t&&`button`in e&&e.button!==0)}function Ca(e){let t=e.currentTarget.tagName.toLowerCase()===`button`;return!xa(e)&&(e.key===`Enter`||t&&e.key===` `)}var wa=`nprogress`,Ta,Ea,Da={minimum:.08,easing:`linear`,speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:`.bar, [role="bar"]`,spinnerSelector:`.spinner, [role="spinner"]`,parent:`body`,color:`#29d`,includeCSS:!0,popover:null,template:[`<div class="bar">`,`<div class="peg"></div>`,`</div>`,`<div class="spinner">`,`<div class="spinner-icon"></div>`,`</div>`].join(``)},Oa=null,ka=!1,Aa=e=>{Object.assign(Da,e),Ta=Da.popover??`popover`in HTMLElement.prototype,Da.includeCSS&&Ua(Da.color),Ea=document.createElement(`div`),Ea.id=wa,Ea.setAttribute(`aria-hidden`,`true`),Ea.innerHTML=Da.template,Ta&&(Ea.popover=`manual`)},ja=e=>{let t=Ma();e=Ba(e,Da.minimum,1),Oa=e===1?null:e;let n=Ia(!t),r=n.querySelector(Da.barSelector),i=Da.speed,a=Da.easing;n.offsetWidth,Ha(t=>{let o={transition:`all ${i}ms ${a}`,transform:`translate3d(${Va(e)}%,0,0)`};for(let e in o)r.style[e]=o[e];if(e!==1)return setTimeout(t,i);n.style.transition=`none`,n.style.opacity=`1`,n.offsetWidth,setTimeout(()=>{n.style.transition=`all ${i}ms linear`,n.style.opacity=`0`,setTimeout(()=>{Ra(),n.style.transition=``,n.style.opacity=``,t()},i)},i)})},Ma=()=>typeof Oa==`number`,Na=()=>{Oa||ja(0);let e=function(){setTimeout(function(){Oa&&(Fa(),e())},Da.trickleSpeed)};Da.trickle&&e()},Pa=e=>{!e&&!Oa||(Fa(.3+.5*Math.random()),ja(1))},Fa=e=>{let t=Oa;if(t===null)return Na();if(!(t>1))return e=typeof e==`number`?e:(()=>{let e={.1:[0,.2],.04:[.2,.5],.02:[.5,.8],.005:[.8,.99]};for(let n in e)if(t>=e[n][0]&&t<e[n][1])return parseFloat(n);return 0})(),ja(Ba(t+e,0,.994))},Ia=e=>{if(za())return document.getElementById(wa);document.documentElement.classList.add(`${wa}-busy`);let t=Ea.querySelector(Da.barSelector),n=e?`-100`:Va(Oa||0);if(t.style.transition=`all 0 linear`,t.style.transform=`translate3d(${n}%,0,0)`,Da.showSpinner||Ea.querySelector(Da.spinnerSelector)?.remove(),Ta)document.body.appendChild(Ea),ka||Ea.showPopover();else{let e=La();e!==document.body&&e.classList.add(`${wa}-custom-parent`),e.appendChild(Ea),ka&&(Ea.style.display=`none`)}return Ea},La=()=>document.querySelector(Da.parent),Ra=()=>{if(document.documentElement.classList.remove(`${wa}-busy`),Ta&&Ea?.isConnected)try{Ea.hidePopover()}catch{}Ta||La().classList.remove(`${wa}-custom-parent`),Ea?.remove()},za=()=>document.getElementById(wa)!==null;function Ba(e,t,n){return e<t?t:e>n?n:e}var Va=e=>(-1+e)*100,Ha=(()=>{let e=[],t=()=>{let n=e.shift();n&&n(t)};return n=>{e.push(n),e.length===1&&t()}})(),Ua=e=>{let t=document.createElement(`style`),n=Hn.get(`nonce`);n&&(t.nonce=n),t.textContent=`
|
|
12
|
+
#${wa} {
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
background: none;
|
|
15
|
+
border: none;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
overflow: visible;
|
|
19
|
+
inset: unset;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 0;
|
|
22
|
+
position: fixed;
|
|
23
|
+
top: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#${wa}::backdrop {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#${wa} .bar {
|
|
32
|
+
background: ${e};
|
|
33
|
+
|
|
34
|
+
position: fixed;
|
|
35
|
+
z-index: 1031;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 2px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#${wa} .peg {
|
|
44
|
+
display: block;
|
|
45
|
+
position: absolute;
|
|
46
|
+
right: 0px;
|
|
47
|
+
width: 100px;
|
|
48
|
+
height: 100%;
|
|
49
|
+
box-shadow: 0 0 10px ${e}, 0 0 5px ${e};
|
|
50
|
+
opacity: 1.0;
|
|
51
|
+
|
|
52
|
+
transform: rotate(3deg) translate(0px, -4px);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#${wa} .spinner {
|
|
56
|
+
display: block;
|
|
57
|
+
position: fixed;
|
|
58
|
+
z-index: 1031;
|
|
59
|
+
top: 15px;
|
|
60
|
+
right: 15px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#${wa} .spinner-icon {
|
|
64
|
+
width: 18px;
|
|
65
|
+
height: 18px;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
|
|
68
|
+
border: solid 2px transparent;
|
|
69
|
+
border-top-color: ${e};
|
|
70
|
+
border-left-color: ${e};
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
|
|
73
|
+
animation: ${wa}-spinner 400ms linear infinite;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.${wa}-custom-parent {
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
position: relative;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.${wa}-custom-parent #${wa} .spinner,
|
|
82
|
+
.${wa}-custom-parent #${wa} .bar {
|
|
83
|
+
position: absolute;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes ${wa}-spinner {
|
|
87
|
+
0% { transform: rotate(0deg); }
|
|
88
|
+
100% { transform: rotate(360deg); }
|
|
89
|
+
}
|
|
90
|
+
`,document.head.appendChild(t)},Wa={configure:Aa,isStarted:Ma,done:Pa,set:ja,remove:Ra,start:Na,status:Oa,show:()=>{if(ka=!1,Ea?.isConnected)if(Ta)try{Ea.showPopover()}catch{}else Ea.style.display=``},hide:()=>{if(ka=!0,Ea?.isConnected)if(Ta)try{Ea.hidePopover()}catch{}else Ea.style.display=`none`}},Ga=new class{hideCount=0;start(){Wa.start()}reveal(e=!1){this.hideCount=Math.max(0,this.hideCount-1),(e||this.hideCount===0)&&Wa.show()}hide(){this.hideCount++,Wa.hide()}set(e){Wa.set(Math.max(0,Math.min(1,e)))}finish(){Wa.done()}reset(){Wa.set(0)}remove(){Wa.done(),Wa.remove()}isStarted(){return Wa.isStarted()}getStatus(){return Wa.status}};function Ka(e){document.addEventListener(`inertia:start`,t=>qa(t,e)),document.addEventListener(`inertia:progress`,Ja)}function qa(e,t){e.detail.visit.showProgress||Ga.hide();let n=setTimeout(()=>Ga.start(),t);document.addEventListener(`inertia:finish`,e=>Ya(e,n),{once:!0})}function Ja(e){Ga.isStarted()&&e.detail.progress?.percentage&&Ga.set(Math.max(Ga.getStatus(),e.detail.progress.percentage/100*.9))}function Ya(e,t){clearTimeout(t),Ga.isStarted()&&(e.detail.visit.completed?Ga.finish():e.detail.visit.interrupted?Ga.reset():e.detail.visit.cancelled&&Ga.remove())}function Xa({delay:e=250,color:t=`#29d`,includeCSS:n=!0,showSpinner:r=!1,popover:i=null}={}){Ka(e),Wa.configure({showSpinner:r,includeCSS:n,color:t,popover:i})}var Za=Symbol(`FormComponentReset`);function Qa(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function $a(e,t){let n=e.value,r=e.checked;switch(e.type.toLowerCase()){case`checkbox`:e.checked=t.includes(e.value);break;case`radio`:e.checked=t[0]===e.value;break;case`file`:e.value=``;break;case`button`:case`submit`:case`reset`:case`image`:break;default:e.value=t[0]!==null&&t[0]!==void 0?String(t[0]):``}return e.value!==n||e.checked!==r}function eo(e,t){let n=e.value,r=Array.from(e.selectedOptions).map(e=>e.value);if(e.multiple){let n=t.map(e=>String(e));Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}else e.value=t[0]===void 0?``:String(t[0]);let i=Array.from(e.selectedOptions).map(e=>e.value);return e.multiple?JSON.stringify(r.sort())!==JSON.stringify(i.sort()):e.value!==n}function to(e,t){if(e.disabled){if(e instanceof HTMLInputElement){let t=e.value,n=e.checked;switch(e.type.toLowerCase()){case`checkbox`:case`radio`:return e.checked=e.defaultChecked,e.checked!==n;case`file`:return e.value=``,t!==``;case`button`:case`submit`:case`reset`:case`image`:return!1;default:return e.value=e.defaultValue,e.value!==t}}else if(e instanceof HTMLSelectElement){let t=Array.from(e.selectedOptions).map(e=>e.value);Array.from(e.options).forEach(e=>{e.selected=e.defaultSelected});let n=Array.from(e.selectedOptions).map(e=>e.value);return JSON.stringify(t.sort())!==JSON.stringify(n.sort())}else if(e instanceof HTMLTextAreaElement){let t=e.value;return e.value=e.defaultValue,e.value!==t}return!1}if(e instanceof HTMLInputElement)return $a(e,t);if(e instanceof HTMLSelectElement)return eo(e,t);if(e instanceof HTMLTextAreaElement){let n=e.value;return e.value=t[0]===void 0?``:String(t[0]),e.value!==n}return!1}function no(e,t){let n=!1;return e instanceof RadioNodeList||e instanceof HTMLCollection?Array.from(e).forEach((e,r)=>{e instanceof Element&&Qa(e)&&(e instanceof HTMLInputElement&&[`checkbox`,`radio`].includes(e.type.toLowerCase())?to(e,t)&&(n=!0):to(e,t[r]===void 0?[t[0]??null].filter(Boolean):[t[r]])&&(n=!0))}):Qa(e)&&(n=to(e,t)),n}function ro(e,t,n){if(!e)return;let r=!n||n.length===0;if(r){let r=new FormData(e),i=Array.from(e.elements).map(e=>Qa(e)?e.name:``).filter(Boolean);n=[...new Set([...t.keys(),...r.keys(),...i])]}let i=!1;n.forEach(n=>{let r=e.elements.namedItem(n);r&&no(r,t.getAll(n))&&(i=!0)}),i&&r&&e.dispatchEvent(new CustomEvent(`reset`,{bubbles:!0,cancelable:!0,detail:{[Za]:!0}}))}function io(e,t,n){return`<script data-page="${e}" type="application/json">${JSON.stringify(t).replace(/\//g,`\\/`)}<\/script><div data-server-rendered="true" id="${e}">${n}</div>`}var G=new Ri,ao=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),oo=n(((e,t)=>{t.exports=ao()})),K=n((e=>{var t=oo(),n=r(),i=o();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return d(i),e;if(o===r)return d(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},te=[],ne=-1;function re(e){return{current:e}}function L(e){0>ne||(e.current=te[ne],te[ne]=null,ne--)}function R(e,t){ne++,te[ne]=e.current,e.current=t}var ie=re(null),z=re(null),ae=re(null),oe=re(null);function se(e,t){switch(R(ae,t),R(z,e),R(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}L(ie),R(ie,e)}function ce(){L(ie),L(z),L(ae)}function le(e){e.memoizedState!==null&&R(oe,e);var t=ie.current,n=Hd(t,e.type);t!==n&&(R(z,e),R(ie,n))}function ue(e){z.current===e&&(L(ie),L(z)),oe.current===e&&(L(oe),Qf._currentValue=I)}var de,fe;function B(e){if(de===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||``,fe=-1<e.stack.indexOf(`
|
|
91
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
92
|
+
`+de+e+fe}var pe=!1;function me(e,t){if(!e||pe)return``;pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
93
|
+
`),l=s.split(`
|
|
94
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
95
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?B(n):``}function he(e,t){switch(e.tag){case 26:case 27:case 5:return B(e.type);case 16:return B(`Lazy`);case 13:return e.child!==t&&t!==null?B(`Suspense Fallback`):B(`Suspense`);case 19:return B(`SuspenseList`);case 0:case 15:return me(e.type,!1);case 11:return me(e.type.render,!1);case 1:return me(e.type,!0);case 31:return B(`Activity`);default:return``}}function ge(e){try{var t=``,n=null;do t+=he(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
96
|
+
Error generating stack: `+e.message+`
|
|
97
|
+
`+e.stack}}var V=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,ve=t.unstable_cancelCallback,ye=t.unstable_shouldYield,be=t.unstable_requestPaint,xe=t.unstable_now,Se=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,we=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,Ee=t.unstable_LowPriority,De=t.unstable_IdlePriority,Oe=t.log,ke=t.unstable_setDisableYieldValue,Ae=null,je=null;function Me(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Ne=Math.clz32?Math.clz32:Ie,Pe=Math.log,Fe=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(Pe(e)/Fe|0)|0}var Le=256,Re=262144,ze=4194304;function Be(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ve(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function We(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ne(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ne(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ne(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function et(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[nt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),xt={},St={};function Ct(e){return V.call(St,e)?!0:V.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Tt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Et(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Mt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Dt(s):e.removeAttribute(`name`)}function It(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Dt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(N(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ut(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Ut(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Kt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),qt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[rt]||null;if(!i)throw Error(a(90));Ft(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(vu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return un=i.slice(e,1<r?1-r:void 0)}function fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pn(){return!0}function mn(){return!1}function hn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?pn:mn,this.isPropagationStopped=mn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=m({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=m({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(m({},Cn,{dataTransfer:0})),En=hn(m({},vn,{relatedTarget:0})),Dn=hn(m({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(m({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(m({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(m({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(m({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(m({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(m({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(m({},Cn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Bn=hn(m({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=an&&`CompositionEvent`in window,Un=null;an&&`documentMode`in document&&(Un=document.documentMode);var Wn=an&&`TextEvent`in window&&!Un,Gn=an&&(!Hn||Un&&8<Un&&11>=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=null,Xn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Gn&&t.locale!==`ko`?null:t.data;default:return null}}var $n={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!$n[e.type]:t===`textarea`}function tr(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Td(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,rr=null;function ir(e){vd(e,0)}function ar(e){if(jt(pt(e)))return e}function or(e,t){if(e===`change`)return t}var sr=!1;if(an){var cr;if(an){var lr=`oninput`in document;if(!lr){var ur=document.createElement(`div`);ur.setAttribute(`oninput`,`return;`),lr=typeof ur.oninput==`function`}cr=lr}else cr=!1;sr=cr&&(!document.documentMode||9<document.documentMode)}function dr(){nr&&(nr.detachEvent(`onpropertychange`,fr),rr=nr=null)}function fr(e){if(e.propertyName===`value`&&ar(rr)){var t=[];tr(t,rr,e,Zt(e)),nn(ir,t)}}function pr(e,t,n){e===`focusin`?(dr(),nr=t,rr=n,nr.attachEvent(`onpropertychange`,fr)):e===`focusout`&&dr()}function mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ar(rr)}function hr(e,t){if(e===`click`)return ar(t)}function gr(e,t){if(e===`input`||e===`change`)return ar(t)}function _r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var vr=typeof Object.is==`function`?Object.is:_r;function yr(e,t){if(vr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!V.call(t,i)||!vr(e[i],t[i]))return!1}return!0}function br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xr(e,t){var n=br(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mt(e.document)}return t}function wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Tr=an&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==Mt(r)||(r=Er,`selectionStart`in r&&wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Or&&yr(Or,r)||(Or=r,r=Td(Dr,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Er)))}function jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Mr={animationend:jr(`Animation`,`AnimationEnd`),animationiteration:jr(`Animation`,`AnimationIteration`),animationstart:jr(`Animation`,`AnimationStart`),transitionrun:jr(`Transition`,`TransitionRun`),transitionstart:jr(`Transition`,`TransitionStart`),transitioncancel:jr(`Transition`,`TransitionCancel`),transitionend:jr(`Transition`,`TransitionEnd`)},Nr={},Pr={};an&&(Pr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Mr.animationend.animation,delete Mr.animationiteration.animation,delete Mr.animationstart.animation),`TransitionEvent`in window||delete Mr.transitionend.transition);function Fr(e){if(Nr[e])return Nr[e];if(!Mr[e])return e;var t=Mr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pr)return Nr[e]=t[n];return e}var Ir=Fr(`animationend`),Lr=Fr(`animationiteration`),Rr=Fr(`animationstart`),zr=Fr(`transitionrun`),Br=Fr(`transitionstart`),Vr=Fr(`transitioncancel`),Hr=Fr(`transitionend`),Ur=new Map,Wr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Wr.push(`scrollEnd`);function Gr(e,t){Ur.set(e,t),vt(t,[e])}var Kr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},qr=[],Jr=0,Yr=0;function Xr(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=qr[t];qr[t++]=null;var r=qr[t];qr[t++]=null;var i=qr[t];qr[t++]=null;var a=qr[t];if(qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ei(n,i,a)}}function Zr(e,t,n,r){qr[Jr++]=e,qr[Jr++]=t,qr[Jr++]=n,qr[Jr++]=r,Yr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qr(e,t,n,r){return Zr(e,t,n,r),ti(e)}function $r(e,t){return Zr(e,null,null,t),ti(e)}function ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ne(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ti(e){if(50<lu)throw lu=0,uu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var H={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function U(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ie.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=ri(31,n,t,i),e.elementType=O,e.lanes=o,e;case v:return si(n.children,i,o,t);case y:s=8,i|=24;break;case b:return e=ri(12,n,t,i|2),e.elementType=b,e.lanes=o,e;case w:return e=ri(13,n,t,i),e.elementType=w,e.lanes=o,e;case T:return e=ri(19,n,t,i),e.elementType=T,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function li(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==`object`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:ge(t)},di.set(e,t),t):n}return{value:e,source:t,stack:ge(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=``;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-Ne(r)-1;r&=~(1<<i),n+=1;var a=32-Ne(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Ne(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,W=!1,ki=null,Ai=!1,ji=Error(a(519));function Mi(e){throw Ri(fi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[nt]=e,t[rt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Bt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Di=Di.return}}function Fi(e){if(e!==Di)return!1;if(!W)return Pi(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ud(e.type,e.memoizedProps)),n=!n),n&&Oi&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Oi=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Oi=uf(e)}else t===27?(t=Oi,Zd(e.type)?(e=lf,lf=null,Oi=e):Oi=t):Oi=Di?cf(e.stateNode.nextSibling):null;return!0}function Ii(){Oi=Di=null,W=!1}function Li(){var e=ki;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=re(null),Bi=null,Vi=null;function Hi(e,t,n){R(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,L(zi)}function Wi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Gi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Ki(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;vr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===oe.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(a(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=ud(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=P.S;P.S=function(e,t){Ql=xe(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=re(null);function pa(){var e=fa.current;return e===null?Il.pooledCache:e}function ma(e,t){t===null?R(fa,fa.current):R(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(a(460)),_a=Error(a(474)),va=Error(a(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Il,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(a(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(a(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===h?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===D&&Sa(a)===t.type)?(t=i(t,n.props),ka(t,n),t.return=e,t):(t=U(n.type,n.key,n.props,null,e.mode,r),ka(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ui(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=si(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=U(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case _:return t=ui(t,e.mode,n),t.return=e,t;case D:return t=Sa(t),f(e,t,n)}if(N(t)||A(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===S)return f(e,Xi(e,t),n);Aa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case D:return n=Sa(n),p(e,t,n,r)}if(N(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===S)return p(e,t,Xi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Sa(r),m(e,t,n,r,i)}if(N(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===S)return m(e,t,n,Xi(t,r),i);Aa(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),W&&Si(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return W&&Si(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),W&&Si(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),W&&Si(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return W&&Si(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),W&&Si(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===v&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Sa(l)===r.type){n(e,r.sibling),c=i(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===v?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=U(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case _:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}t(e,r),r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Sa(o),b(e,r,o,c)}if(N(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===S)return b(e,r,Xi(e,o),c);Aa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}function Ba(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Pa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=re(null),qa=re(0);function Ja(e,t){e=Vl,R(qa,e),R(Ka,t),Vl=e|t.baseLanes}function Ya(){R(qa,Vl),R(Ka,Ka.current)}function Xa(){Vl=qa.current,L(Ka),L(qa)}var Za=re(null),Qa=null;function $a(e){var t=e.alternate;R(io,io.current&1),R(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){R(io,io.current),R(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(R(io,io.current),R(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){R(io,io.current),R(Za,Za.current)}function ro(e){L(Za),Qa===e&&(Qa=null),L(io)}var io=re(0);function G(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ao=0,K=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(a(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return ao=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Fs:Is,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){P.H=Ps;var t=so!==null&&so.next!==null;if(ao=0,co=so=K=null,lo=!1,mo=0,ho=null,t)throw Error(a(300));e===null||$s||(e=e.dependencies,e!==null&&qi(e)&&($s=!0))}function xo(e,t,n,r){K=e;var i=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=i)throw Error(a(301));if(i+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ls,o=t(n,r)}while(uo);return o}function So(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}ao=0,co=so=K=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?K.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?K.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw K.alternate===null?Error(a(467)):Error(a(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?K.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=K,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Fs:Is),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===S)return Yi(e)}throw Error(a(438,String(e)))}function jo(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ao&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===oa&&(d=!0);else if((ao&p)===p){u=u.next,p===oa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,K.lanes|=p,Ul|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,K.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!vr(o,e.memoizedState)&&($s=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);vr(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=K,i=Do(),o=W;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!vr((so||i).memoizedState,n);if(s&&(i.memoizedState=n,$s=!0),i=i.queue,os(zo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Ro.bind(null,r,i,n,t),null),Il===null)throw Error(a(349));o||ao&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Oo(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vr(e,n)}catch{return!0}}function Vo(e){var t=$r(e,2);t!==null&&pu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){Me(!0);try{n()}finally{Me(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function q(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Uo(e,t,n,r,i){if(js(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(W){var n=Il.formState;if(n!==null){a:{var r=K;if(W){if(Oi){b:{for(var i=Oi,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Oi=cf(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,K,r),r.dispatch=n,r=Ho(!1),a=As.bind(null,K,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Do(),so,e)}function Qo(e,t,n){if(t=Po(e,t,Yo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Do(),n=so;if(n!==null)return Qo(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Oo(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return Do().memoizedState}function rs(e,t,n,r){var i=Eo();K.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(K.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Oo(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Do().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||ao&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),K.lanes|=e,Ul|=e,n)}function _s(e,t,n,r){return vr(n,t)?n:Ka.current===null?!(ao&42)||ao&1073741824&&!(Z&261930)?($s=!0,e.memoizedState=n):(e=fu(),K.lanes|=e,Ul|=e,t):(e=gs(e,n,r),vr(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,As(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,ua(c,r),du(e)):ks(e,t,r,du(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=xs(e).queue;vs(e,i,t,I,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},du())}function Cs(){return Yi(Qf)}function ws(){return Do().memoizedState}function Ts(){return Do().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=La(n);var r=Ra(t,e,n);r!==null&&(pu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Qr(e,t,n,r),n!==null&&(pu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,du())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,vr(s,o))return Zr(e,t,i,0),Il===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return pu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(a(479))}else t=Qr(e,n,r,2),t!==null&&pu(t,e,2)}function js(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ms(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var Ps={readContext:Yi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Ps.useEffectEvent=_o;var Fs={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){Me(!0);try{n(t)}finally{Me(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=Os.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=vs.bind(null,K,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,i=Eo();if(W){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Il===null)throw Error(a(349));Z&127||Lo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,as(zo.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Il.identifierPrefix;if(W){var n=xi,r=bi;n=(r&~(1<<32-Ne(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Es.bind(null,K)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Yi,use:Ao,useCallback:ms,useContext:Yi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:No,useRef:ns,useState:function(){return No(Mo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return q(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:Yi,use:Ao,useCallback:ms,useContext:Yi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Fo,useRef:ns,useState:function(){return Fo(Mo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Do();return so===null?gs(n,e,t):_s(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):q(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(pu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(pu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(pu(t,e,n),za(t,e,n))}};function Bs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!yr(n,r)||!yr(i,a):!0}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function Hs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Kr(e)}function Ws(e){console.error(e)}function Gs(e){Kr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=La(e),e.tag=3,e}function Xs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,i,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,i)),!1;case 22:return n.flags|=65536,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,i)),!1}throw Error(a(435,n.tag))}return Wu(e,r,i),Tu(),!1}if(W)return t=Za.current,t===null?(r!==ji&&(t=Error(a(423),{cause:r}),Ri(fi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=fi(r,n),i=Js(e.stateNode,r,i),Ba(e,i),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ji&&(e=Error(a(422),{cause:r}),Ri(fi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=fi(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Js(n.stateNode,r,e),Ba(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Ys(i),Xs(i,e,n,r),Ba(n,i),!1}n=n.return}while(n!==null);return!1}var Qs=Error(a(461)),$s=!1;function J(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function ec(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!$s?(wo(e,t,i),wc(e,t,i)):(W&&s&&wi(t),t.flags|=1,J(e,t,r,i),t.child)}function tc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nc(e,t,a,r,i)):(e=U(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Tc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?yr:n,n(o,r)&&e.ref===t.ref)return wc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(yr(a,r)&&e.ref===t.ref)if($s=!1,t.pendingProps=r=a,Tc(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,wc(e,t,i)}return uc(e,t,n,r,i)}function rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ac(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return J(e,t,i,n),t.child}function ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ac(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function oc(e,t){return t=yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sc(e,t,n){return Ma(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function cc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=oc(t,r),t.lanes=536870912,ic(null,e);if(eo(t),(e=Oi)?(e=rf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return oc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),i)if(t.flags&256)t.flags&=-257,t=sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if($s||Ki(e,t,n,!1),i=(n&e.childLanes)!==0,$s||i){if(r=Il,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,$r(e,s),pu(r,e,s),Qs;Tu(),t=sc(e,t,n)}else e=o.treeContext,Oi=cf(s.nextSibling),Di=t,W=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=oc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function uc(e,t,n,r,i){return Ji(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!$s?(wo(e,t,i),wc(e,t,i)):(W&&r&&wi(t),t.flags|=1,J(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!$s?(wo(e,t,a),wc(e,t,a)):(W&&r&&wi(t),t.flags|=1,J(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=H,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):H,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&zs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=H,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Pa||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=H,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Pa||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,lc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):J(e,t,n,i),t.memoizedState=a.state,e=t.child):e=wc(e,t,i),e}function pc(e,t,n,r){return Ii(),t.flags|=256,J(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:ha()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function _c(e,t,n){var r=t.pendingProps,i=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(io.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(W){if(i?$a(t):no(t),(e=Oi)?(e=rf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Mi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(no(t),i=t.mode,c=yc({mode:`hidden`,children:c},i),r=si(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(null,r)):($a(t),vc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=bc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,i=t.mode,r=yc({mode:`visible`,children:r.children},i),c=si(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=ic(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=bc(e,t,n)}else if($s||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Il,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,$r(e,r),pu(s,e,r),Qs;af(c)||Tu(),t=bc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=cf(c.nextSibling),Di=t,W=!0,ki=null,Ai=!1,e!==null&&Ei(t,e),t=vc(t,r.children),t.flags|=4096);return t}return i?(no(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,i,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ic(null,r),r=t.child,c=e.child.memoizedState,c===null?c=hc(n):(i=c.cachePool,i===null?i=ha():(l=ta._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function vc(e,t){return t=yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function bc(e,t,n){return Ma(t,e.child,null,n),e=vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function Sc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Cc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,R(io,o),J(e,t,r,n),r=W?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&G(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&G(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,a,r);break;case`together`:Sc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function wc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&qi(e)))}function Ec(e,t,n){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:le(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=wc(e,t,n),e===null?null:e.sibling):_c(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Cc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),R(io,io.current),r)break;return null;case 22:return t.lanes=0,rc(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return wc(e,t,n)}function Dc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Tc(e,n)&&!(t.flags&128))return $s=!1,Ec(e,t,n);$s=!!(e.flags&131072)}else $s=!1,W&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Hs(e,r),t.tag=1,t=fc(null,t,e,r,n)):(t.tag=0,t=uc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===C){t.tag=11,t=ec(null,t,e,r,n);break a}if(i===E){t.tag=14,t=tc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(a(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Hs(r,t.pendingProps),fc(e,t,r,i,n);case 3:a:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=pc(e,t,r,n);break a}else if(r!==i){i=fi(Error(a(424)),t),Ri(i),t=pc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Oi=cf(e.firstChild),Di=t,W=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===i){t=wc(e,t,n);break a}J(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(n=t.type,e=t.pendingProps,r=Bd(ae.current).createElement(n),r[nt]=t,r[rt]=e,Pd(r,n,e),ht(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&W&&(r=t.stateNode=ff(t.type,t.pendingProps,ae.current),Di=t,Ai=!0,i=Oi,Zd(t.type)?(lf=i,Oi=cf(r.firstChild)):Oi=i),J(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((i=r=Oi)&&(r=tf(r,t.type,t.pendingProps,Ai),r===null?i=!1:(t.stateNode=r,Di=t,Oi=cf(r.firstChild),Ai=!1,i=!0)),i||Mi(t)),le(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=yo(e,t,So,null,null,n),Qf._currentValue=i),lc(e,t),J(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=Oi)&&(n=nf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Mi(t)),null;case 13:return _c(e,t,n);case 4:return se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):J(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return J(e,t,t.pendingProps,n),t.child;case 8:return J(e,t,t.pendingProps.children,n),t.child;case 12:return J(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),J(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Ji(t),i=Yi(i),r=r(i),t.flags|=1,J(e,t,r,n),t.child;case 14:return tc(e,t,t.type,t.pendingProps,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 19:return Cc(e,t,n);case 31:return cc(e,t,n);case 22:return rc(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(i=pa(),i===null&&(i=Il,o=na(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Fa(t),Hi(t,ta,i)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Hi(t,ta,r),r!==i.cache&&Gi(t,[ta],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Hi(t,ta,r))),J(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Oc(e){e.flags|=4}function kc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function Ac(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw Ca=ya,_a}function jc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,ql|=t)}function Mc(e,t){if(!W)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Nc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Pc(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nc(t),null;case 1:return Nc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?Oc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Nc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Oc(t),o===null?(Nc(t),kc(t,i,null,r,n)):(Nc(t),Ac(t,o))):o?o===e.memoizedState?(Nc(t),t.flags&=-16777217):(Oc(t),Nc(t),Ac(t,o)):(e=e.memoizedProps,e!==r&&Oc(t),Nc(t),kc(t,i,e,r,n)),null;case 27:if(ue(t),n=ae.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Nc(t),null}e=ie.current,Fi(t)?Ni(t,e):(e=ff(i,r,n),t.stateNode=e,Oc(t))}return Nc(t),null;case 5:if(ue(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Nc(t),null}if(o=ie.current,Fi(t))Ni(t,o);else{var s=Bd(ae.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[nt]=t,o[rt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Oc(t)}}return Nc(t),kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=ae.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Di,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Mi(t,!0)}else e=Bd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return Nc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[nt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(a(558))}return Nc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[nt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),i=!1}else i=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),jc(t,t.updateQueue),Nc(t),null);case 4:return ce(),e===null&&xd(t.stateNode.containerInfo),Nc(t),null;case 10:return Ui(t.type),Nc(t),null;case 19:if(L(io),r=t.memoizedState,r===null)return Nc(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null)if(i)Mc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=G(e),o!==null){for(t.flags|=128,Mc(r,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return R(io,io.current&1|2),W&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xe()>$l&&(t.flags|=128,i=!0,Mc(r,!1),t.lanes=4194304)}else{if(!i)if(e=G(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),Mc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!W)return Nc(t),null}else 2*xe()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,i=!0,Mc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Nc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xe(),e.sibling=null,n=io.current,R(io,i?n&1|2:n&1),W&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Nc(t),t.subtreeFlags&6&&(t.flags|=8192)):Nc(t),n=t.updateQueue,n!==null&&jc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&L(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Nc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Fc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(a(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(io),null;case 4:return ce(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&L(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Ic(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),ce();break;case 26:case 27:case 5:ue(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:L(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&L(fa);break;case 24:Ui(ta)}}function Lc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Rc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Uu(e,e.return,t)}}}function Bc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Vc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Hc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Uc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Wc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[rt]=t}catch(t){Uu(e,e.return,t)}}function Gc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Kc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Gc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[nt]=e,t[rt]=n}catch(t){Uu(e,e.return,t)}}var Xc=!1,Y=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=Cr(e),wr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Lc(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&zc(n),r&512&&Vc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Yc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Uc(n),r&512&&Vc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Xc,!r){t=t!==null&&t.memoizedState!==null||Y,i=Xc;var a=Y;Xc=r,(Y=t)&&!a?vl(e,n,!!(n.subtreeFlags&8772)):gl(e,n),Xc=i,Y=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:Y||Hc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Y||Hc(n,t);var r=rl,i=il;Zd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),pf(n.stateNode),rl=r,il=i;break;case 5:Y||Hc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Rc(2,n,t),Y||Rc(4,n,t),al(e,t,n);break;case 1:Y||(Hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Bc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Y=(r=Y)||n.memoizedState!==null,al(e,t,n),Y=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(a(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(a(160));ol(o,s,i),rl=null,il=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Rc(3,e,e.return),Lc(3,e),Rc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Y||n===null||Hc(n,n.return)),r&64&&Xc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=fl;if(dl(t,e),ml(e),r&512&&(Y||n===null||Hc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Pd(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Y||n===null||Hc(n,n.return)),n!==null&&r&4&&Wc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Y||n===null||Hc(n,n.return)),e.flags&32){i=e.stateNode;try{Vt(i,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Wc(e,i,n===null?i:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,i=fl,fl=gf(t.containerInfo),dl(t,e),fl=i,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=gf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=xe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Xc,d=Y;if(Xc=u||i,Y=d||l,dl(t,e),Y=d,Xc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Xc||Y||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Gc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Jc(e,Kc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),Jc(e,Kc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;qc(e,Kc(e),s);break;default:throw Error(a(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Rc(4,t,t.return),_l(t);break;case 1:Hc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Bc(t,t.return,n),_l(t);break;case 27:pf(t.stateNode);case 26:case 5:Hc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Lc(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&zc(a),Vc(a,a.return);break;case 27:Yc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Uc(a),Vc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Vc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Lc(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Cl(a,o,s,c,i),Lc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Gf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=gf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Rc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Rc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,X=null,Z=0,Ll=0,Q=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Fl&2&&Z!==0?Z&-Z:P.T===null?$e():ud()}function fu(){if(Kl===0)if(!(Z&536870912)||W){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),Kl=e}else Kl=536870912;return e=Za.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Il&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Z,Kl,!1)),Ke(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(Wl|=n),Hl===4&&_u(e,Z,Kl,!1)),nd(e))}function mu(e,t,n){if(Fl&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||He(e,t),i=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(i===0){zl&&!r&&_u(e,t,0,!1);break}if(n=e.current.alternate,o&&!gu(n)){i=Eu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,i=4;break a}o=Yl,Yl=i,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=Zl+300-xe(),10<i)){if(_u(r,t,Kl,!Rl),Ve(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),i);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yt},Dl(t,a,d);var m=(a&62914560)===a?Zl-xe():(a&4194048)===a?Ql-xe():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!vr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ne(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function vu(){return Fl&6?!0:(rd(0,!1),!1)}function yu(){if(X!==null){if(Ll===0)var e=X.return;else e=X,Vi=Bi=null,To(e),Ea=null,Da=0,e=X;for(;e!==null;)Ic(e.alternate,e),e=e.return;X=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Il=e,X=n=ai(e.current,null),Z=t,Ll=0,Q=null,Rl=!1,zl=He(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ne(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Xr(),n}function xu(e,t){K=null,P.H=Ps,t===ga||t===va?(t=wa(),Ll=3):t===_a?(t=wa(),Ll=4):Ll=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Q=t,X===null&&(Hl=1,Ks(e,fi(t,e.current)))}function Su(){var e=Za.current;return e===null?!0:(Z&4194048)===Z?Qa===null:(Z&62914560)===Z||Z&536870912?e===Qa:!1}function Cu(){var e=P.H;return P.H=Ps,e===null?Ps:e}function wu(){var e=P.A;return P.A=Nl,e}function Tu(){Hl=4,Rl||(Z&4194048)!==Z&&Za.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Il===null||_u(Il,Z,Kl,!1)}function Eu(e,t,n){var r=Fl;Fl|=2;var i=Cu(),a=wu();(Il!==e||Z!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Ll!==0&&X!==null){var s=X,c=Q;switch(Ll){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Ll;if(Ll=0,Q=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Ll,Ll=0,Q=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Fl=r,P.H=i,P.A=a,X===null&&(Il=null,Z=0,Xr()),o}function Du(){for(;X!==null;)Au(X)}function Ou(e,t){var n=Fl;Fl|=2;var r=Cu(),i=wu();Il!==e||Z!==t?(eu=null,$l=xe()+500,bu(e,t)):zl=He(e,t);a:do try{if(Ll!==0&&X!==null){t=X;var o=Q;b:switch(Ll){case 1:Ll=0,Q=null,Mu(e,t,o,1);break;case 2:case 9:if(ba(o)){Ll=0,Q=null,ju(t);break}t=function(){Ll!==2&&Ll!==9||Il!==e||(Ll=7),nd(e)},o.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:ba(o)?(Ll=0,Q=null,ju(t)):(Ll=0,Q=null,Mu(e,t,o,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Wf(s):c.stateNode.complete){Ll=0,Q=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,Nu(u))}break b}}Ll=0,Q=null,Mu(e,t,o,5);break;case 6:Ll=0,Q=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(a(462))}}ku();break}catch(t){xu(e,t)}while(1);return Vi=Bi=null,P.H=r,P.A=i,Fl=n,X===null?(Il=null,Z=0,Xr(),Hl):0}function ku(){for(;X!==null&&!ye();)Au(X)}function Au(e){var t=Dc(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):X=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:To(t);default:Ic(n,t),t=X=oi(t,Vl),t=Dc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):X=t}function Mu(e,t,n,r){Vi=Bi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Zs(e,i,t,n,Z)){Hl=1,Ks(e,fi(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;Hl=1,Ks(e,fi(n,e.current)),X=null;return}t.flags&32768?(W||r===1?e=!0:zl||Z&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Pc(t.alternate,t,Vl);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Fc(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);Hl=6,X=null}function Fu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Fl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=Yr,qe(e,n,o,s,c,l),e===Il&&(X=Il=null,Z=0),iu=t,ru=e,au=n,ou=o,su=i,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Te,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,s=Fl,Fl|=4;try{el(e,t,n)}finally{Fl=s,F.p=i,P.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Fl;Fl|=4;try{pl(t,e);var a=zd,o=Cr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Sr(s.ownerDocument.documentElement,s)){if(c!==null&&wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=xr(s,h),v=xr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{Fl=i,F.p=r,P.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Fl;Fl|=4;try{tl(e,t.alternate,t)}finally{Fl=i,F.p=r,P.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,be();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),Qe(n),t=t.stateNode,je&&typeof je.onCommitFiberRoot==`function`)try{je.onCommitFiberRoot(Ae,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=Qe(au),r=P.T,i=F.p;try{F.p=32>n?32:n,P.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Fl&6)throw Error(a(331));var c=Fl;if(Fl|=4,Al(o.current),Sl(o,o.current,s,n),Fl=c,rd(0,!1),je&&typeof je.onPostCommitFiberRoot==`function`)try{je.onPostCommitFiberRoot(Ae,o)}catch{}return!0}finally{F.p=i,P.T=r,zu(e,t)}}function Hu(e,t,n){t=fi(n,t),t=Js(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Ke(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=fi(n,e),n=Ys(2),r=Ra(t,n,2),r!==null&&(Xs(n,r,t,e),Ke(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Z&n)===n&&(Hl===4||Hl===3&&(Z&62914560)===Z&&300>xe()-Zl?!(Fl&2)&&bu(e,0):Gl|=n,ql===Z&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=We()),e=$r(e,t),e!==null&&(Ke(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return _e(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ne(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Z,a=Ve(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=xe(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ne(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Z,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ve(r),Qe(n)){case 2:case 8:n=we;break;case 32:n=Te;break;case 268435456:n=De;break;default:n=Te}return r=sd.bind(null,e),n=_e(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ve(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Z;return r=Ve(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,xe()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){Fl&6?_e(Ce,id):ad()})}function ud(){if(td===0){var e=oa;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Wr.length;md++){var hd=Wr[md];Gr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Gr(Ir,`onAnimationEnd`),Gr(Lr,`onAnimationIteration`),Gr(Rr,`onAnimationStart`),Gr(`dblclick`,`onDoubleClick`),Gr(`focusin`,`onFocus`),Gr(`focusout`,`onBlur`),Gr(zr,`onTransitionRun`),Gr(Br,`onTransitionStart`),Gr(Vr,`onTransitionCancel`),Gr(Hr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Kr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Kr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!on||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=dt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),o=[];a:{var s=Ur.get(e);if(s!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Ir:case Lr:case Rr:l=Dn;break;case Hr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=rn(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?dt(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:pt(l),h=u==null?s:pt(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,dt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(o,s,l,d,!1),u!==null&&f!==null&&Dd(o,f,u,d,!0)}}a:{if(s=r?pt(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=or;else if(er(s))if(sr)v=gr;else{v=mr;var y=pr}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Gt(r.elementType)&&(v=or):v=hr;if(v&&=v(e,r)){tr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Lt(s,`number`,s.value)}switch(y=r?pt(r):window,e){case`focusin`:(er(y)||y.contentEditable===`true`)&&(Er=y,Dr=r,Or=null);break;case`focusout`:Or=Dr=Er=null;break;case`mousedown`:kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:kr=!1,Ar(o,n,i);break;case`selectionchange`:if(Tr)break;case`keydown`:case`keyup`:Ar(o,n,i)}var b;if(Hn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Xn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Gn&&n.locale!==`ko`&&(Xn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Xn&&(b=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Xn=!0)),y=Td(r,x),0<y.length&&(x=new kn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Yn(n),b!==null&&(x.data=b)))),(b=Wn?Zn(e,n):Qn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),pd(o,e,r,n,i)}vd(o,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=rn(e,n),i!=null&&r.unshift(wd(e,i,a)),i=rn(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=rn(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
98
|
+
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,i.name,i,null),Md(e,t,`formEncType`,i.formEncType,i,null),Md(e,t,`formMethod`,i.formMethod,i,null),Md(e,t,`formTarget`,i.formTarget,i,null)):(Md(e,t,`encType`,i.encType,i,null),Md(e,t,`method`,i.method,i,null),Md(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Jt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Kt.get(n)||n,wt(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:Wt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):wt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,o,s,n,null)}}i&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Md(e,t,r,d,n,null)}}It(e,o,c,l,u,s,i,!1);return;case`select`:for(i in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Md(e,t,s,c,n,null)}Bt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Ft(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Md(e,t,s,i,r,o)}zt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e!==Wd&&(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[lt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),ht(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=mt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);ht(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=mt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ht(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=mt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ht(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=ae.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=mt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=mt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=mt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Pt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),ht(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Pt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,ht(i),i):(r=n,(i=mf.get(o))&&(r=m({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),ht(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[lt]||a[nt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:S,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function tp(e){return e?(e=H,e):H}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(pu(n,e,t),za(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=$r(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=Ze(t);var n=$r(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ne(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Fl&6)&&($l=xe()+500,rd(0,!1))}}break;case 31:case 13:s=$r(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Zt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=dt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Se()){case Ce:return 2;case we:return 8;case Te:case Ee:return 32;case De:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ft(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=dt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,et(e.priority,function(){op(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,et(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[rt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[it]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.8`)throw Error(a(527,Lp,`19.2.8`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ae=zp.inject(Rp),je=zp}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Us,o=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,o,c,Pp),e[it]=t.current,xd(e),new Fp(t)},e.hydrateRoot=function(e,t,n){if(!s(e))throw Error(a(299));var r=!1,i=``,o=Us,c=Ws,l=Gs,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=ep(e,1,!0,t,n??null,r,i,u,o,c,l,Pp),t.context=tp(null),n=t.current,r=du(),r=Ze(r),i=La(r),i.callback=null,Ra(n,i,r),n=r,t.current.lanes=n,Ke(t,n),nd(t),e[it]=t.current,xd(e),new Ip(t)}})),so=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=K()})),co=t(o(),1),lo=so(),uo=(0,B.createContext)(null);uo.displayName=`InertiaHeadContext`;var fo=uo,po=da();function mo(){po.reset()}var ho=(0,B.createContext)(null);ho.displayName=`InertiaPageContext`;var go=ho;function _o(e){return typeof e==`function`||typeof e==`object`&&!!e&&`$$typeof`in e}function vo(e){if(typeof e!=`function`)return!1;let t=e;return t.length===1&&t.prototype===void 0}function yo(e){return typeof e==`function`&&e.length<=1&&e.prototype===void 0}var bo=!0,xo=!1,So=async()=>{bo=!1},Co={shared:{},named:{}};function wo({children:e,initialPage:t,initialComponent:n,resolveComponent:r,titleCallback:i,onHeadUpdate:a,defaultLayout:o,serverHead:s}){let[c,l]=(0,B.useState)({component:n||null,page:{...t,flash:t.flash??{}},key:null}),u=(0,B.useRef)(c.page);u.current=c.page;let d=(0,B.useMemo)(()=>Xi(typeof window>`u`,e=>i?i(e,u.current):e,a||(()=>{}),Ji(t,s)),[]),f=(0,B.useSyncExternalStore)(po.subscribe,po.get,()=>Co);if(xo||=(G.init({initialPage:t,resolveComponent:r,swapComponent:async e=>So(e),onFlash:e=>{l(t=>({...t,page:{...t.page,flash:e}}))}}),!0),(0,B.useEffect)(()=>{So=async({component:e,page:t,preserveState:n})=>{if(bo){bo=!1;return}n||mo(),(0,co.flushSync)(()=>l(r=>({component:e,page:t,key:n?r.key:Date.now()})))};let e=e=>{d.updateServerHead(Ji(e.detail.page,s))},t=G.on(`navigate`,e),n=G.on(`clientVisit`,e);return()=>{t(),n()}},[]),!c.component)return(0,B.createElement)(fo.Provider,{value:d},(0,B.createElement)(go.Provider,{value:c.page},null));let p=e||(({Component:e,props:t,key:n})=>{let r=(0,B.createElement)(e,{key:n,...t}),i,a=null,s=e.layout;if(yo(s)){let e=s(t);if((0,B.isValidElement)(e))return s(r);_a(e,_o)?(i=o?.(c.page.component,c.page),a=e):i=e}else ga(s,_o)?(i=o?.(c.page.component,c.page),a=s):i=s??o?.(c.page.component,c.page);let l=ba(i,_o,s&&!a?vo:void 0);return a&&(l=l.map(e=>({...e,props:{...e.props,...a}}))),l.length>0?l.reduceRight((e,n)=>(0,B.createElement)(n.component,{...t,...n.props,...f.shared,...n.name&&f.named[n.name]||{}},e),r):r});return(0,B.createElement)(fo.Provider,{value:d},(0,B.createElement)(go.Provider,{value:c.page},p({Component:c.component,key:c.key,props:c.page.props})))}wo.displayName=`Inertia`;async function To({id:e=`app`,resolve:t,setup:n,title:r,progress:i={},page:a,render:o,defaults:s={},nonce:c,http:l,layout:u,serverHead:d,strictMode:f=!1,withApp:p,dev:m=!1}={}){Ho.replace(s),c&&Ho.set(`nonce`,c),l&&Di.setClient(l),m&&W();let h=typeof window>`u`,g=e=>f?(0,B.createElement)(B.StrictMode,null,e):e,_=(e,n)=>Promise.resolve(t(e,n)).then(e=>e.default||e);if(h&&!a&&!o)return async(t,i)=>{let a=[],o={initialPage:t,initialComponent:await _(t.component,t),resolveComponent:_,titleCallback:r,onHeadUpdate:e=>a=e,defaultLayout:u,serverHead:d},s;n?s=n({el:null,App:wo,props:o}):(s=g((0,B.createElement)(wo,o)),p&&(s=p(s,{ssr:!0,page:t})));let c=io(e,t,i(s));return{head:a,body:c}};let v=a||Dr(e),y=[],b=await Promise.all([_(v.component,v),G.decryptHistory().catch(()=>{})]).then(([t])=>{let i={initialPage:v,initialComponent:t,resolveComponent:_,titleCallback:r,onHeadUpdate:h?e=>y=e:void 0,defaultLayout:u,serverHead:d};if(h)return n({el:null,App:wo,props:i});let a=document.getElementById(e);if(n)return n({el:a,App:wo,props:i});let o=g((0,B.createElement)(wo,i));p&&(o=p(o,{ssr:!1,page:v})),a.hasAttribute(`data-server-rendered`)?(0,lo.hydrateRoot)(a,o):(0,lo.createRoot)(a).render(o)});if(!h&&i&&Xa(i),h&&o&&b){let t=io(e,v,o(b));return{head:y,body:t}}}function Eo(){let e=(0,B.use)(go);if(!e)throw Error(`usePage must be used within the Inertia component`);return e}function Do(e){let{data:t,useDataState:n,useErrorsState:r}=e,i=typeof t==`function`,a=()=>i?t():t,o=pt(a()),s=(0,B.useRef)(!1),c=(0,B.useRef)(e.precognitionEndpoint??null),[l,u]=(0,B.useState)(pt(o)),[d,f]=n?n():(0,B.useState)(pt(o)),[p,m]=r?r():(0,B.useState)({}),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(!1),C=(0,B.useRef)(void 0),w=(0,B.useRef)(e=>e),T=(0,B.useRef)(!1),E=(0,B.useRef)(null),[D,O]=(0,B.useState)(!1),[k,ee]=(0,B.useState)([]),[A,j]=(0,B.useState)([]),M=(0,B.useRef)(null),N=()=>M.current??Ho.get(`form.withAllErrors`),P=(0,B.useRef)(d);(0,B.useEffect)(()=>{P.current=d}),(0,B.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let F=(0,B.useCallback)(e=>{P.current=e,f(e)},[f]),I=(0,B.useCallback)((e,t)=>{F(typeof e==`string`?Yt(pt(P.current),e,t):typeof e==`function`?e(P.current):e)},[F]),te=(0,B.useCallback)((e,t)=>{if(i)throw Error("You cannot call `defaults()` when using a function to define your form data.");T.current=!0;let n={};e===void 0?(n={...P.current},u(P.current)):u(r=>(n=typeof e==`string`?Yt(pt(r),e,t):Object.assign(pt(r),e),n)),E.current?.defaults(n)},[u]),ne=(0,B.useCallback)((...e)=>{let t=pt(i?pt(a()):l);if(e.length===0)i&&u(t),F(t);else{i&&u(n=>{let r=pt(n);return e.filter(e=>zt(t,e)).forEach(e=>{Yt(r,e,jt(t,e))}),r});let n=e.filter(e=>zt(t,e)).reduce((e,n)=>Yt(e,n,jt(t,n)),{...P.current});F(n)}E.current?.reset(...e)},[F,l]),re=(0,B.useCallback)((e,t)=>{m(n=>{let r={...n,...typeof e==`string`?{[e]:t}:e};return E.current?.setErrors(r),r})},[m]),L=(0,B.useCallback)((...e)=>{m(t=>{let n=Object.keys(t).reduce((n,r)=>({...n,...e.length>0&&!e.includes(r)?{[r]:t[r]}:{}}),{});return E.current&&(e.length===0?E.current.setErrors({}):e.forEach(E.current.forgetError)),n})},[m]),R=(0,B.useCallback)((...e)=>{ne(...e),L(...e)},[ne,L]),ie=(0,B.useCallback)(()=>{L(),b(!0),S(!0),C.current=window.setTimeout(()=>{s.current&&S(!1)},Ho.get(`form.recentlySuccessfulDuration`))},[L,b,S]),z=(0,B.useCallback)(()=>{b(!1),S(!1),clearTimeout(C.current)},[b,S]),ae=(0,B.useCallback)(()=>{g(!1),v(null)},[g,v]),oe=(0,B.useCallback)(e=>{w.current=e},[]),se=(e,t)=>(t(e),e),ce=(0,B.useCallback)(e=>A.includes(e),[A]),le=(0,B.useCallback)(e=>e in p,[p]),ue=(0,B.useCallback)(e=>typeof e==`string`?k.includes(e):k.length>0,[k]),de={data:d,isDirty:!xt(d,l),errors:p,hasErrors:Object.keys(p).length>0,processing:h,progress:_,wasSuccessful:y,recentlySuccessful:x,setData:I,transform:oe,setDefaults:te,reset:ne,setError:re,clearErrors:L,resetAndClearErrors:R},fe=(e,t)=>{if(typeof e==`object`&&!(`target`in e)&&(t=e,e=void 0),e===void 0)E.current.validate(t);else{let n=Bn(e),r=w.current(P.current);E.current.validate(n,jt(r,n),t)}return de};return de.withPrecognition=(...e)=>{if(c.current=zi.createWayfinderCallback(...e),!E.current){let e=Ln(e=>{let{method:t,url:n}=c.current(),r=P.current,i=w.current(r);return e[t](n,i)},pt(l));E.current=e,e.on(`validatingChanged`,()=>{O(e.validating())}).on(`validatedChanged`,()=>{j(e.valid())}).on(`touchedChanged`,()=>{ee(e.touched())}).on(`errorsChanged`,()=>{let t=N()?e.errors():Rn(e.errors());m(t),j(e.valid())})}let t=Object.assign(de,{validating:D,validator:()=>E.current,valid:ce,invalid:le,touched:ue,withoutFileValidation:()=>se(t,()=>E.current?.withoutFileValidation()),touch:(e,...n)=>(Array.isArray(e)?E.current?.touch(e):typeof e==`string`?E.current?.touch([e,...n]):E.current?.touch(e),t),withAllErrors:()=>se(t,()=>M.current=!0),setValidationTimeout:e=>se(t,()=>E.current?.setTimeout(e)),validateFiles:()=>se(t,()=>E.current?.validateFiles()),validate:fe,setErrors:e=>se(t,()=>de.setError(e)),forgetError:e=>se(t,()=>de.clearErrors(Bn(e)))});return t},c.current&&de.withPrecognition(c.current),{form:de,setDefaultsState:u,transformRef:w,precognitionEndpointRef:c,dataRef:P,isMounted:s,setProcessing:g,setProgress:v,markAsSuccessful:ie,clearErrors:L,setError:re,defaultsCalledInOnSuccessRef:T,resetBeforeSubmit:z,finishProcessing:ae,withAllErrors:{enabled:N,enable:()=>{M.current=!0}}}}function Oo(e,t,n){let[r,i]=(0,B.useState)(()=>{let n=G.restore(t);return n===void 0?e:n});return(0,B.useEffect)(()=>{let e=n?.current;if(e&&e.length>0&&typeof r==`object`&&r){let n={...r};e.forEach(e=>delete n[e]),G.remember(n,t)}else G.remember(r,t)},[r,t]),[r,i]}function ko(...e){let{rememberKey:t,data:n,precognitionEndpoint:r}=zi.parseUseFormArguments(...e),i=pt(typeof n==`function`?n():n),a=(0,B.useRef)(null),o=(0,B.useRef)([]),s=(0,B.useRef)(null),{form:c,setDefaultsState:l,transformRef:u,precognitionEndpointRef:d,dataRef:f,isMounted:p,setProcessing:m,setProgress:h,markAsSuccessful:g,clearErrors:_,setError:v,defaultsCalledInOnSuccessRef:y,resetBeforeSubmit:b,finishProcessing:x}=Do({data:n,precognitionEndpoint:r,useDataState:t?()=>Oo(i,`${t}:data`,o):void 0,useErrorsState:t?()=>Oo({},`${t}:errors`):void 0}),S=(0,B.useCallback)((...e)=>{let{method:t,url:n,options:r}=zi.parseSubmitArguments(e,d.current);y.current=!1;let i={...r,onCancelToken:e=>(a.current=e,r.onCancelToken?.(e)),onBefore:e=>(b(),r.onBefore?.(e)),onStart:e=>(m(!0),r.onStart?.(e)),onProgress:e=>(h(e||null),r.onProgress?.(e)),onSuccess:async e=>{p.current&&g();let t=r.onSuccess?await r.onSuccess(e):null;return p.current&&!y.current&&c.setData(e=>(l(pt(e)),e)),t},onError:e=>(p.current&&(_(),v(e)),r.onError?.(e)),onCancel:()=>r.onCancel?.(),onFinish:e=>(p.current&&x(),a.current=null,r.onFinish?.(e))};i.optimistic=i.optimistic??s.current??void 0,s.current=null;let o=u.current(f.current);t===`delete`?G.delete(n,{...i,data:o}):G[t](n,o,i)},[_,v,u]),C=(0,B.useCallback)(()=>{a.current&&a.current.cancel()},[]),w=(0,B.useMemo)(()=>({get:(e,t={})=>S(`get`,e,t),post:(e,t={})=>S(`post`,e,t),put:(e,t={})=>S(`put`,e,t),patch:(e,t={})=>S(`patch`,e,t),delete:(e,t={})=>S(`delete`,e,t)}),[S]);Object.assign(c,{submit:S,...w,cancel:C,dontRemember:(...e)=>(o.current=e,T),optimistic:e=>(s.current=e,T)});let T=c,E=c.withPrecognition;return T.withPrecognition=(...e)=>(E(...e),T),d.current,T}var Ao=e=>{typeof B.startTransition==`function`?B.startTransition(e):setTimeout(e,0)},jo=()=>void 0,Mo=(0,B.createContext)(void 0),No=(0,B.forwardRef)(({action:e=``,method:t=`get`,headers:n={},queryStringArrayFormat:r=`brackets`,errorBag:i=null,showProgress:a=!0,transform:o=e=>e,optimistic:s,options:c={},onStart:l=jo,onProgress:u=jo,onFinish:d=jo,onBefore:f=jo,onCancel:p=jo,onSuccess:m=jo,onError:h=jo,onCancelToken:g=jo,onSubmitComplete:_=jo,disableWhileProcessing:v=!1,resetOnError:y=!1,resetOnSuccess:b=!1,setDefaultsOnSuccess:x=!1,invalidateCacheTags:S=[],validateFiles:C=!1,validationTimeout:w=1500,withAllErrors:T=null,component:E=null,instant:D=!1,children:O,...k},ee)=>{let A=()=>{let[e,t]=L();return o(t)},j=ko({}).withPrecognition(()=>N,()=>L()[0]).setValidationTimeout(w);C&&j.validateFiles(),(T??Hn.get(`form.withAllErrors`))&&j.withAllErrors(),j.transform(A);let M=(0,B.useRef)(void 0),N=(0,B.useMemo)(()=>Qr(e)?e.method:t.toLowerCase(),[e,t]),P=(0,B.useMemo)(()=>E||(D&&Qr(e)?$r(e):null),[E,D,e]),[F,I]=(0,B.useState)(!1),te=(0,B.useRef)(new FormData),ne=e=>new FormData(M.current,e),re=e=>Gi(ne(e)),L=t=>qr(N,Qr(e)?e.url:e,re(t),r),R=e=>{e.type===`reset`&&e.detail?.[Za]&&e.preventDefault(),Ao(()=>I(e.type!==`reset`&&!xt(re(),Gi(te.current))))},ie=(...e)=>(j.clearErrors(...e),j);(0,B.useEffect)(()=>{te.current=ne(),j.setDefaults(re());let e=[`input`,`change`,`reset`];return e.forEach(e=>M.current.addEventListener(e,R)),()=>{e.forEach(e=>M.current?.removeEventListener(e,R))}},[]),(0,B.useEffect)(()=>{j.setValidationTimeout(w)},[w]),(0,B.useEffect)(()=>{C?j.validateFiles():j.withoutFileValidation()},[C]);let z=(...e)=>{M.current&&ro(M.current,te.current,e),j.reset(...e)},ae=(...e)=>{ie(...e),z(...e)},oe=e=>{e&&(e===!0?z():e.length>0&&z(...e))},se=e=>{let[t,v]=L(e);if(e?.getAttribute(`formtarget`)===`_blank`&&N===`get`){window.open(t,`_blank`);return}let C={headers:n,queryStringArrayFormat:r,errorBag:i,showProgress:a,invalidateCacheTags:S,component:P,optimistic:s?e=>s(e,v):void 0,onCancelToken:g,onBefore:f,onStart:l,onProgress:u,onFinish:d,onCancel:p,onSuccess:async(...e)=>{let t=await m(...e);return _({reset:z,defaults:ce}),oe(b),x===!0&&ce(),t},onError(...e){h(...e),oe(y)},...c};j.transform(()=>o(v)),j.submit(N,t,C),j.transform(A)},ce=()=>{te.current=ne(),I(!1)},le={errors:j.errors,hasErrors:j.hasErrors,processing:j.processing,progress:j.progress,wasSuccessful:j.wasSuccessful,recentlySuccessful:j.recentlySuccessful,isDirty:F,clearErrors:ie,resetAndClearErrors:ae,setError:j.setError,reset:z,submit:se,defaults:ce,getData:re,getFormData:ne,validator:()=>j.validator(),validating:j.validating,valid:j.valid,invalid:j.invalid,validate:(e,t)=>j.validate(...zi.mergeHeadersForValidation(e,t,n)),touch:j.touch,touched:j.touched};(0,B.useImperativeHandle)(ee,()=>le,[j,F,se]);let ue=(0,B.createElement)(`form`,{...k,ref:M,action:Qr(e)?e.url:e,method:N,onSubmit:e=>{e.preventDefault(),se(e.nativeEvent.submitter)},inert:v&&j.processing},typeof O==`function`?O(le):O);return(0,B.createElement)(Mo.Provider,{value:le},ue)});No.displayName=`InertiaForm`;var Po=No,Fo=function({children:e,title:t}){let n=(0,B.use)(fo),r=(0,B.useMemo)(()=>n.createProvider(),[n]),i=typeof window>`u`;(0,B.useEffect)(()=>(r.reconnect(),r.update(d(e)),()=>{r.disconnect()}),[r,e,t]);function a(e){return typeof e.type==`string`&&[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`].indexOf(e.type)>-1}function o(e){let t=Object.keys(e.props).reduce((t,n)=>{if([`head-key`,`children`,`dangerouslySetInnerHTML`].includes(n))return t;let r=String(e.props[n]);return r===``?t+` ${n}`:t+` ${n}="${en(r)}"`},``);return`<${String(e.type)}${t}>`}function s(e){let{children:t}=e.props;return typeof t==`string`?t:Array.isArray(t)?t.reduce((e,t)=>e+c(t),``):``}function c(e){let t=o(e);return e.props.children&&(t+=s(e)),e.props.dangerouslySetInnerHTML&&(t+=e.props.dangerouslySetInnerHTML.__html),a(e)||(t+=`</${String(e.type)}>`),t}function l(e){return B.cloneElement(e,{"data-inertia":e.props[`head-key`]===void 0?``:e.props[`head-key`]})}function u(e){return c(l(e))}function d(e){let n=B.Children.toArray(e).filter(e=>e).map(e=>u(e));return t&&!n.find(e=>e.startsWith(`<title`))&&n.push(`<title data-inertia="">${en(t)}</title>`),n}return i&&r.update(d(e)),null},Io=(e,t)=>e?e&&typeof e==`object`&&`current`in e?e.current:typeof e==`string`?document.querySelector(e):t:t,Lo=(e,t,n=null)=>e?typeof e==`function`?e(t):e:n,Ro=(0,B.forwardRef)(({data:e,buffer:t=0,as:n=`div`,manual:r=!1,manualAfter:i=0,preserveUrl:a=!1,reverse:o=!1,autoScroll:s,children:c,startElement:l,endElement:u,itemsElement:d,previous:f,next:p,loading:m,params:h={},onlyNext:g=!1,onlyPrevious:_=!1,...v},y)=>{let[b,x]=(0,B.useState)(null),S=(0,B.useCallback)(e=>x(e),[]),[C,w]=(0,B.useState)(null),T=(0,B.useCallback)(e=>w(e),[]),[E,D]=(0,B.useState)(null),O=(0,B.useCallback)(e=>D(e),[]),k=Eo().scrollProps?.[e],[ee,A]=(0,B.useState)(!1),[j,M]=(0,B.useState)(!1),[N,P]=(0,B.useState)(0),[F,I]=(0,B.useState)(!!k?.previousPage),[te,ne]=(0,B.useState)(!!k?.nextPage),[re,L]=(0,B.useState)(null),[R,ie]=(0,B.useState)(null),[z,ae]=(0,B.useState)(null);(0,B.useEffect)(()=>{let e=l?Io(l,b):b;L(e)},[l,b]),(0,B.useEffect)(()=>{let e=u?Io(u,C):C;ie(e)},[u,C]),(0,B.useEffect)(()=>{let e=d?Io(d,E):E;ae(e)},[d,E]);let oe=(0,B.useMemo)(()=>wr(z),[z]),se=(0,B.useRef)({buffer:t,onlyNext:g,onlyPrevious:_,reverse:o,preserveUrl:a,params:h});se.current={buffer:t,onlyNext:g,onlyPrevious:_,reverse:o,preserveUrl:a,params:h};let[ce,le]=(0,B.useState)(null),ue=(0,B.useMemo)(()=>ce?.dataManager,[ce]),de=(0,B.useMemo)(()=>ce?.elementManager,[ce]),fe=(0,B.useCallback)(()=>{oe?oe.scrollTo({top:oe.scrollHeight,behavior:`instant`}):window.scrollTo({top:document.body.scrollHeight,behavior:`instant`})},[oe]);(0,B.useEffect)(()=>{if(!z)return;function t(){P(n.dataManager.getRequestCount()),I(n.dataManager.hasPrevious()),ne(n.dataManager.hasNext())}let n=ua({getPropName:()=>e,inReverseMode:()=>se.current.reverse,shouldFetchNext:()=>!se.current.onlyPrevious,shouldFetchPrevious:()=>!se.current.onlyNext,shouldPreserveUrl:()=>se.current.preserveUrl,getReloadOptions:()=>se.current.params,getTriggerMargin:()=>se.current.buffer,getStartElement:()=>re,getEndElement:()=>R,getItemsElement:()=>z,getScrollableParent:()=>oe,onBeforePreviousRequest:()=>A(!0),onBeforeNextRequest:()=>M(!0),onCompletePreviousRequest:({completed:e})=>{A(!1),e&&t()},onCompleteNextRequest:({completed:e})=>{M(!1),e&&t()},onDataReset:t});le(n);let{dataManager:r,elementManager:i}=n;return t(),i.setupObservers(),i.processServerLoadedElements(r.getLastLoadedPage()),me&&i.enableTriggers(),()=>{n.flush(),le(null)}},[e,z,re,R,oe]);let pe=(0,B.useMemo)(()=>r||i>0&&N>=i,[r,i,N]),me=(0,B.useMemo)(()=>!pe,[pe]);(0,B.useEffect)(()=>{me?de?.enableTriggers():de?.disableTriggers()},[me,g,_,re,R]),(0,B.useEffect)(()=>{(s===void 0?o:s)&&fe()},[oe]),(0,B.useImperativeHandle)(y,()=>({fetchNext:ue?.fetchNext||(()=>{}),fetchPrevious:ue?.fetchPrevious||(()=>{}),hasPrevious:ue?.hasPrevious||(()=>!1),hasNext:ue?.hasNext||(()=>!1)}),[ue]);let he=me&&!g,ge=me&&!_,V={loadingPrevious:ee,loadingNext:j,hasPrevious:F,hasNext:te},_e={loading:ee,fetch:ue?.fetchPrevious??(()=>{}),autoMode:he,manualMode:!he,hasMore:F,...V},ve={loading:j,fetch:ue?.fetchNext??(()=>{}),autoMode:ge,manualMode:!ge,hasMore:te,...V},ye={loading:ee||j,loadingPrevious:ee,loadingNext:j},be=[];return l||be.push((0,B.createElement)(`div`,{ref:S},Lo(f,_e,ee?Lo(m,_e):null))),be.push((0,B.createElement)(n,{...v,ref:O},typeof c==`function`?c(ye):c)),u||be.push((0,B.createElement)(`div`,{ref:T},Lo(p,ve,j?Lo(m,ve):null))),(0,B.createElement)(B.Fragment,{},...o?[...be].reverse():be)});Ro.displayName=`InertiaInfiniteScroll`;var zo=()=>void 0,Bo=(0,B.forwardRef)(({children:e,as:t=`a`,data:n={},href:r=``,method:i=`get`,preserveScroll:a=!1,preserveState:o=null,preserveUrl:s=!1,replace:c=!1,only:l=[],except:u=[],headers:d={},queryStringArrayFormat:f=`brackets`,async:p=!1,onClick:m=zo,onCancelToken:h=zo,onBefore:g=zo,onStart:_=zo,onProgress:v=zo,onFinish:y=zo,onCancel:b=zo,onSuccess:x=zo,onError:S=zo,onPrefetching:C=zo,onPrefetched:w=zo,prefetch:T=!1,cacheFor:E=0,cacheTags:D=[],viewTransition:O=!1,component:k=null,instant:ee=!1,pageProps:A=null,...j},M)=>{let[N,P]=(0,B.useState)(0),F=(0,B.useRef)(void 0),I=(0,B.useMemo)(()=>Qr(r)?r.method:i.toLowerCase(),[r,i]),te=(0,B.useMemo)(()=>k||(ee&&Qr(r)?$r(r):null),[k,ee,r]),ne=(0,B.useMemo)(()=>typeof t!=`string`||t.toLowerCase()!==`a`?t:I===`get`?t.toLowerCase():`button`,[t,I]),re=(0,B.useMemo)(()=>qr(I,Qr(r)?r.url:r,n,f),[r,I,n,f]),L=(0,B.useMemo)(()=>re[0],[re]),R=(0,B.useMemo)(()=>re[1],[re]),ie=(0,B.useMemo)(()=>({data:R,method:I,preserveScroll:a,preserveState:o??I!==`get`,preserveUrl:s,replace:c,only:l,except:u,headers:d,async:p,component:te,pageProps:A}),[R,I,a,o,s,c,l,u,d,p,te,A]),z=(0,B.useMemo)(()=>({...ie,viewTransition:O,onCancelToken:h,onBefore:g,onStart(e){P(e=>e+1),_(e)},onProgress:v,onFinish(e){P(e=>e-1),y(e)},onCancel:b,onSuccess:x,onError:S}),[ie,O,h,g,_,v,y,b,x,S]),ae=(0,B.useMemo)(()=>T===!0?[`hover`]:T===!1?[]:Array.isArray(T)?T:[T],Array.isArray(T)?T:[T]),oe=(0,B.useMemo)(()=>E===0?ae.length===1&&ae[0]===`click`?0:Ho.get(`prefetch.cacheFor`):E,[E,ae]),se=(0,B.useMemo)(()=>()=>{G.prefetch(L,{...ie,onPrefetching:C,onPrefetched:w},{cacheFor:oe,cacheTags:D})},[L,ie,C,w,oe,D]);(0,B.useEffect)(()=>()=>{clearTimeout(F.current)},[]),(0,B.useEffect)(()=>{ae.includes(`mount`)&&setTimeout(()=>se())},ae);let ce={onClick:e=>{m(e),Sa(e)&&(e.preventDefault(),G.visit(L,z))}},le={onMouseEnter:()=>{F.current=window.setTimeout(()=>{se()},Ho.get(`prefetch.hoverDelay`))},onMouseLeave:()=>{clearTimeout(F.current)},onClick:ce.onClick},ue={onMouseDown:e=>{Sa(e)&&(e.preventDefault(),se())},onKeyDown:e=>{Ca(e)&&(e.preventDefault(),se())},onMouseUp:e=>{Sa(e)&&(e.preventDefault(),G.visit(L,z))},onKeyUp:e=>{Ca(e)&&(e.preventDefault(),G.visit(L,z))},onClick:e=>{m(e),Sa(e)&&e.preventDefault()}},de=(0,B.useMemo)(()=>ne===`button`?{type:`button`}:ne===`a`||typeof ne!=`string`?{href:L}:{},[ne,L]);return(0,B.createElement)(ne,{...j,...de,ref:M,...ae.includes(`hover`)?le:ae.includes(`click`)?ue:ce,"data-loading":N>0?``:void 0},e)});Bo.displayName=`InertiaLink`;var Vo=Bo,Ho=Hn.extend(),q=t(f(),1),Uo=`effects`;function Wo(){return p(Uo)}function Go(e,t){return t}function Ko(e){let t=document.createElement(`a`);t.href=e,t.rel=`noopener`,document.body.appendChild(t),t.click(),t.remove()}function qo(e){return t=>window.dispatchEvent(new CustomEvent(e,{detail:t.props}))}var Jo={"reload-page":()=>window.location.reload(),redirect:e=>window.location.assign(e.props.url),download:e=>Ko(e.props.url),"locale-change":e=>u(e.props.locale),toast:qo(d.toast),callout:qo(d.callout),"retract-callout":qo(d.retractCallout),"reload-component":qo(d.reloadComponent),"open-modal":qo(d.openModal),"close-modal":qo(d.closeModal),"reset-form":qo(d.resetForm),"toggle-sidebar":qo(d.toggleSidebar)};function Yo(...e){return Object.assign({},...e)}function Xo({href:e,method:t=`get`,children:n,...r}){return(0,q.jsx)(Vo,{href:e,method:t,...r,children:n})}var Zo={Link:Xo,visit:(e,t)=>G.visit(e,t),reload:()=>G.reload()};function Qo(){window.dispatchEvent(new CustomEvent(d.closeModal,{detail:{modal:null}}))}function $o(){(0,B.useEffect)(()=>G.on(`navigate`,Qo),[])}var es={name:`lattice/navigation`,extensions:{effects:{redirect:Go(`redirect`,e=>G.visit(e.props.url)),"reload-page":Go(`reload-page`,e=>e.props.full?window.location.reload():G.reload())}}},ts=(0,B.createContext)([]);function ns({children:e,renderer:t}){let n=(0,B.useContext)(ts),r=(0,B.useMemo)(()=>[t,...n],[n,t]);return(0,q.jsx)(ts.Provider,{value:r,children:e})}function rs({className:e,icon:t}){let n=(0,B.useContext)(ts),{ids:r}=x();for(let r of n){let n=r({className:e,icon:t});if(n!=null&&n!==!1)return n}return r&&!r.includes(t)?(0,q.jsx)(is,{className:e}):(0,q.jsx)(M,{className:e,name:t})}function is({className:e}){return(0,q.jsxs)(`svg`,{"aria-hidden":`true`,className:k(`size-lt-icon-md text-lt-muted-fg`,e),"data-lattice-missing-icon":``,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,q.jsx)(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),(0,q.jsx)(`path`,{d:`M12 17h.01`})]})}var as=E(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lt-sm text-base font-medium transition-[color,box-shadow] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-lt-icon-md [&_svg]:shrink-0 outline-none focus-visible:border-lt-ring focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)] aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger`,{variants:{emphasis:{solid:`shadow-lt-xs disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:shadow-none`,outline:`border border-lt-input bg-lt-bg shadow-lt-xs hover:bg-lt-accent hover:text-lt-accent-fg disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:border-transparent disabled:shadow-none`,ghost:`hover:bg-lt-accent hover:text-lt-accent-fg disabled:text-lt-disabled-fg`,link:`underline-offset-4 hover:underline disabled:text-lt-disabled-fg disabled:no-underline`},variant:{primary:``,secondary:``,success:``,info:``,warning:``,danger:``},size:{md:`h-lt-control-md px-4 py-2 has-[>svg]:px-3`,sm:`h-lt-control-sm rounded-lt-sm px-3 has-[>svg]:px-2.5`,lg:`h-lt-control-lg rounded-lt-sm px-6 has-[>svg]:px-4`,icon:`size-lt-control-md`}},compoundVariants:[{emphasis:`solid`,variant:`primary`,class:`bg-lt-primary text-lt-primary-fg hover:bg-lt-primary-hover active:bg-lt-primary-active`},{emphasis:`solid`,variant:`secondary`,class:`bg-lt-secondary text-lt-secondary-fg hover:bg-lt-secondary-hover active:bg-lt-secondary-active`},{emphasis:`solid`,variant:`success`,class:`bg-lt-success text-lt-success-fg hover:bg-lt-success-hover active:bg-lt-success-active`},{emphasis:`solid`,variant:`info`,class:`bg-lt-info text-lt-info-fg hover:bg-lt-info-hover active:bg-lt-info-active`},{emphasis:`solid`,variant:`warning`,class:`bg-lt-warning text-lt-warning-fg hover:bg-lt-warning-hover active:bg-lt-warning-active`},{emphasis:`solid`,variant:`danger`,class:`bg-lt-danger text-lt-danger-fg hover:bg-lt-danger-hover active:bg-lt-danger-active focus-visible:ring-lt-danger/20 dark:focus-visible:ring-lt-danger/40`},{emphasis:`outline`,variant:`primary`,class:`border-lt-primary/40 text-lt-primary hover:bg-lt-primary/10 hover:text-lt-primary`},{emphasis:`outline`,variant:`secondary`,class:`border-lt-secondary text-lt-secondary-fg hover:bg-lt-secondary hover:text-lt-secondary-fg`},{emphasis:`outline`,variant:`success`,class:`border-lt-success/40 text-lt-success hover:bg-lt-success/10 hover:text-lt-success`},{emphasis:`outline`,variant:`info`,class:`border-lt-info/40 text-lt-info hover:bg-lt-info/10 hover:text-lt-info`},{emphasis:`outline`,variant:`warning`,class:`border-lt-warning/40 text-lt-warning hover:bg-lt-warning/10 hover:text-lt-warning`},{emphasis:`outline`,variant:`danger`,class:`border-lt-danger/40 text-lt-danger hover:bg-lt-danger/10 hover:text-lt-danger`},{emphasis:`ghost`,variant:`primary`,class:`text-lt-primary hover:bg-lt-primary/10 hover:text-lt-primary`},{emphasis:`ghost`,variant:`secondary`,class:`text-lt-secondary-fg hover:bg-lt-secondary hover:text-lt-secondary-fg`},{emphasis:`ghost`,variant:`success`,class:`text-lt-success hover:bg-lt-success/10 hover:text-lt-success`},{emphasis:`ghost`,variant:`info`,class:`text-lt-info hover:bg-lt-info/10 hover:text-lt-info`},{emphasis:`ghost`,variant:`warning`,class:`text-lt-warning hover:bg-lt-warning/10 hover:text-lt-warning`},{emphasis:`ghost`,variant:`danger`,class:`text-lt-danger hover:bg-lt-danger/10 hover:text-lt-danger`},{emphasis:`link`,variant:`primary`,class:`text-lt-primary`},{emphasis:`link`,variant:`secondary`,class:`text-lt-secondary-fg`},{emphasis:`link`,variant:`success`,class:`text-lt-success`},{emphasis:`link`,variant:`info`,class:`text-lt-info`},{emphasis:`link`,variant:`warning`,class:`text-lt-warning`},{emphasis:`link`,variant:`danger`,class:`text-lt-danger`}],defaultVariants:{emphasis:`solid`,size:`md`}});function os(e,t){return t||((e??`solid`)===`solid`||e===`link`?`primary`:void 0)}function ss({className:e,variant:t,emphasis:n,size:r,asChild:i=!1,icon:a,children:o,...s}){let c=i?C:`button`,l=a&&!i?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(M,{name:a,"aria-hidden":`true`}),o]}):o;return(0,q.jsx)(c,{"data-slot":`button`,className:k(as({emphasis:n,variant:os(n,t),size:r,className:e})),...s,children:l})}var cs=[];cs.forEach,cs.slice;var ls=[`__proto__`,`constructor`,`prototype`];function us(e){return!(typeof e!=`string`||e.length===0||e.length>128||ls.indexOf(e)>-1||e.indexOf(`..`)>-1||e.indexOf(`\\`)>-1||/[?#%\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function ds(e){return!(!us(e)||e.indexOf(`/`)>-1||e.indexOf(`@`)>-1)}function fs(e){return us(e)}var ps={lng:ds,ns:fs};function ms(e){return typeof e==`string`?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e}function hs(e){if(typeof e!=`string`||e.length===0)return e;try{let t=new URL(e);return t.username||t.password?(t.username=``,t.password=``,t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,`$1`)}}function gs(){return typeof XMLHttpRequest==`function`||typeof XMLHttpRequest==`object`}function _s(e){return!!e&&typeof e.then==`function`}function vs(e){return _s(e)?e:Promise.resolve(e)}var ys=/\{\{(.+?)\}\}/g;function bs(e,t){let n=!1,r=e.replace(ys,(e,r)=>{let i=r.trim();if(ls.indexOf(i)>-1)return e;let a=t[i];if(a==null)return e;let o=ps[i]||ds,s=String(a).split(`+`);for(let t of s)if(!o(t))return n=!0,e;return s.join(`+`)});return n?null:r}var xs=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof window<`u`?window:void 0,Ss;typeof fetch==`function`?Ss=fetch:xs&&typeof xs.fetch==`function`&&(Ss=xs.fetch);var Cs=gs()&&xs?xs.XMLHttpRequest:void 0,ws=typeof ActiveXObject==`function`&&xs?xs.ActiveXObject:void 0,Ts=[`__proto__`,`constructor`,`prototype`],Es=(e,t)=>{if(t&&typeof t==`object`){let n=``;for(let e of Object.keys(t))Ts.indexOf(e)>-1||(n+=`&`+encodeURIComponent(e)+`=`+encodeURIComponent(t[e]));if(!n)return e;e=e+(e.indexOf(`?`)===-1?`?`:`&`)+n.slice(1)}return e},Ds=(e,t,n,r)=>{let i=e=>{if(!e.ok)return n(e.statusText||`Error`,{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(r){let a=r(e,t);if(a instanceof Promise){a.then(i).catch(n);return}}typeof fetch==`function`?fetch(e,t).then(i).catch(n):Ss(e,t).then(i).catch(n)},Os=(e,t,n,r)=>{e.queryStringParams&&(t=Es(t,e.queryStringParams));let i={...typeof e.customHeaders==`function`?e.customHeaders():e.customHeaders};typeof window>`u`&&typeof global<`u`&&global.process!==void 0&&global.process.versions&&global.process.versions.node&&(i[`User-Agent`]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),n&&(i[`Content-Type`]=`application/json`);let a=typeof e.requestOptions==`function`?e.requestOptions(n):e.requestOptions,o={method:n?`POST`:`GET`,body:n?e.stringify(n):void 0,headers:i,...e._omitFetchOptions?{}:a},s=typeof e.alternateFetch==`function`&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{Ds(t,o,r,s)}catch(n){if(!a||Object.keys(a).length===0||!n.message||n.message.indexOf(`not implemented`)<0)return r(n);try{Object.keys(a).forEach(e=>{delete o[e]}),Ds(t,o,r,s),e._omitFetchOptions=!0}catch(e){r(e)}}},ks=(e,t,n,r)=>{n&&typeof n==`object`&&(n=Es(``,n).slice(1)),e.queryStringParams&&(t=Es(t,e.queryStringParams));try{let i=Cs?new Cs:new ws(`MSXML2.XMLHTTP.3.0`);i.open(n?`POST`:`GET`,t,1),e.crossDomain||i.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),i.overrideMimeType&&i.overrideMimeType(`application/json`);let a=e.customHeaders;if(a=typeof a==`function`?a():a,a)for(let e of Object.keys(a))Ts.indexOf(e)>-1||i.setRequestHeader(e,a[e]);i.onreadystatechange=()=>{i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}},As=(e,t,n,r)=>{if(typeof n==`function`&&(r=n,n=void 0),r||=(()=>{}),Ss&&t.indexOf(`file:`)!==0)return Os(e,t,n,r);if(gs()||typeof ActiveXObject==`function`)return ks(e,t,n,r);r(Error(`No fetch and no xhr implementation found!`))},js=()=>({loadPath:`/locales/{{lng}}/{{ns}}.json`,addPath:`/locales/add/{{lng}}/{{ns}}`,parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||``}),parseLoadPayload:(e,t)=>void 0,request:As,reloadInterval:typeof window<`u`?!1:36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:`cors`,credentials:`same-origin`,cache:`default`}}),Ms=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type=`backend`,this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...js(),...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);typeof e==`object`&&typeof e.unref==`function`&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,r,i){let a=this.options.loadPath;typeof this.options.loadPath==`function`&&(a=this.options.loadPath(e,n)),a=vs(a),a.then(a=>{if(!a)return i(null,{});let o=bs(a,{lng:e.join(`+`),ns:n.join(`+`)});if(o==null){let t=e.map(ms).join(`, `),r=n.map(ms).join(`, `);return i(Error(`i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[`+t+`] namespaces=[`+r+`]`),!1)}this.loadUrl(o,i,t,r)})}loadUrl(e,t,n,r){let i=typeof n==`string`?[n]:n,a=typeof r==`string`?[r]:r,o=this.options.parseLoadPayload(i,a),s=ms(hs(e));this.options.request(this.options,e,o,(e,i)=>{if(i&&(i.status>=500&&i.status<600||!i.status))return t(`failed loading `+s+`; status code: `+i.status,!0);if(i&&i.status>=400&&i.status<500)return t(`failed loading `+s+`; status code: `+i.status,!1);if(!i&&e&&e.message){let n=e.message.toLowerCase();if([`failed`,`fetch`,`network`,`load`].find(e=>n.indexOf(e)>-1))return t(`failed loading `+s+`: `+ms(e.message),!0)}if(e)return t(e,!1);let a,o;try{a=typeof i.data==`string`?this.options.parse(i.data,n,r):i.data}catch{o=`failed parsing `+s+` to json`}if(o)return t(o,!1);t(null,a)})}create(e,t,n,r,i){if(!this.options.addPath)return;typeof e==`string`&&(e=[e]);let a=this.options.parsePayload(t,n,r),o=0,s=[],c=[];e.forEach(n=>{let r=this.options.addPath;typeof this.options.addPath==`function`&&(r=this.options.addPath(n,t));let l=bs(r,{lng:n,ns:t});if(l==null){o+=1,i&&o===e.length&&i(s,c);return}this.options.request(this.options,l,a,(t,n)=>{o+=1,s.push(t),c.push(n),o===e.length&&typeof i==`function`&&i(s,c)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,r=e.language;if(r&&r.toLowerCase()===`cimode`)return;let i=[],a=e=>{t.toResolveHierarchy(e).forEach(e=>{i.indexOf(e)<0&&i.push(e)})};a(r),this.allOptions.preload&&this.allOptions.preload.forEach(e=>a(e)),i.forEach(t=>{this.allOptions.ns.forEach(r=>{e.read(t,r,`read`,null,null,(i,a)=>{i&&n.warn(`loading namespace ${r} for language ${t} failed`,i),!i&&a&&n.log(`loaded namespace ${r} for language ${t}`,a),e.loaded(`${t}|${r}`,i,a)})})})}};Ms.type=`backend`;var Ns=`/locales/{{lng}}/{{ns}}.json`,Ps=`/locales/add/{{lng}}/{{ns}}`;async function Fs(e,t={}){if(ae(e),!e?.enabled){await ne(e=>({...e,ns:t.namespaces??e.ns}));return}await Is({saveMissing:e.saveMissing,namespaces:t.namespaces}),te(e.preloadLocales)}async function Is(e={}){let{namespaces:t,loadPath:n=Ns,addPath:r=Ps,saveMissing:i=!1,customHeaders:a}=e,o=()=>({...c(),...a?.()});N.use(Ms),await ne(e=>({...e,ns:t??e.ns,partialBundledLanguages:!0,saveMissing:i,backend:{loadPath:n,addPath:r,customHeaders:o,withCredentials:!0}}))}function Ls(e,t,n={}){let{enabled:r=!0}=n,i=(0,B.useRef)(t);i.current=t,(0,B.useEffect)(()=>{if(!r||typeof window>`u`)return;let t=e=>i.current(e);return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e,r])}function Rs({href:e,method:t,...n}){return(0,q.jsx)(`a`,{href:e,...n})}var zs={Link:Rs,visit:e=>window.location.assign(e),reload:()=>window.location.reload()},Bs=(0,B.createContext)(zs);function Vs({adapter:e,children:t}){return(0,q.jsx)(Bs.Provider,{value:e,children:t})}function Hs(){return(0,B.useContext)(Bs)}function Us({preserveScroll:e=!0,preserveState:t=!0}){let{visit:n}=Hs();return Ls(d.localeChange,r=>{let i=r.detail?.locale;typeof i==`string`&&i!==``&&n(window.location.href,{preserveScroll:e,preserveState:t})}),null}function Ws({namespace:e=`lattice`,label:t}={}){let{t:n,locale:r,locales:i,setLocale:a}=P(e),o=i.length>0?i:[r],s=t??(e=>n(`language.${e}`,e));return{locale:r,locales:o,options:o.map(e=>({value:e,label:s(e),active:e===r})),setLocale:a}}function Gs(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Ks(e){return a(e)&&typeof e.enabled==`boolean`&&typeof e.saveMissing==`boolean`&&Gs(e.locales)&&Gs(e.preloadLocales)&&(e.timezone===void 0||e.timezone===null||typeof e.timezone==`string`)}function qs(e){if(!a(e))return;let t=e.lattice,n=a(t)?t.i18n:void 0;return Ks(n)?n:void 0}var Js=e({configureI18nFromPageProps:()=>Ys,i18nConfigFromPageProps:()=>qs});function Ys(e,t={}){return Fs(qs(e),t)}function Xs({value:e,dateStyle:t=`medium`,timeStyle:n=`short`}){let{locale:r}=s(),{timezone:i}=z();if(e==null||e===``)return null;let a={locale:r,timeZone:i},o=R(e,{dateStyle:t,timeStyle:n},a),c=Zs(e),l=L(e,a);return(0,q.jsx)(`time`,{dateTime:c??void 0,title:l||void 0,children:o})}function Zs(e){return ie(e)?.toISOString()??null}function Qs({className:e,...t}){let{t:n}=P(I);return(0,q.jsx)(M,{name:`loader-2`,role:`status`,"aria-label":n(`common.loading`,`Loading`),"aria-hidden":!1,className:k(`animate-spin`,e),...t})}function $s(e){return e==null||e===``?void 0:e}function J(e){return $s(e.key)??$s(e.id)}function ec(e){return $s(e)?.split(`.`).at(-1)}function tc(e,t){let n=ec(t);return n?`${e}-${n}`:void 0}function nc(e,t){return tc(e,J(t))}var rc=(0,B.createContext)(!1),ic=`flex h-lt-control-sm w-full items-center justify-start gap-2 rounded-lt-sm px-2.5 text-left text-sm font-normal text-lt-popover-fg no-underline decoration-transparent shadow-none transition-colors hover:bg-lt-accent/70 hover:text-lt-popover-fg focus-visible:bg-lt-accent/70 focus-visible:text-lt-popover-fg focus-visible:ring-0 focus-visible:outline-none disabled:pointer-events-none disabled:text-lt-disabled-fg [&_svg]:size-lt-icon-sm [&_svg]:text-lt-muted-fg`;function ac({children:e}){return(0,q.jsx)(rc.Provider,{value:!0,children:e})}function oc(){return(0,B.useContext)(rc)}var sc=`X-Lattice-Ref`,cc=new Map;function lc(e){return cc.get(e)??e}function uc(e,t){cc.set(e,t)}function dc(e){let t=lc(e);return t?{[sc]:t}:{}}var fc=()=>({});function pc(e){fc=e}function mc(e={}){return{...fc(),...e}}function hc(e=``,t={}){return{...mc(),...dc(e),...t}}var gc=class extends Error{response;constructor(e){super(`HTTP ${e.status}`),this.response=e}};function _c(){let e=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return e?decodeURIComponent(e[1]):``}var vc=1e4,yc=new Map,bc=new Map;function xc(e){return e===void 0||e===`GET`||e===`HEAD`?{Accept:`application/json`}:{Accept:`application/json`,"Content-Type":`application/json`,"X-Requested-With":`XMLHttpRequest`,"X-XSRF-TOKEN":_c()}}var Sc=`/lattice/refs/refresh`;function Cc(e){Sc=e}var wc=new Map;async function Tc(e){let t=wc.get(e);if(t)return t;let n=Dc(Sc,{method:`POST`,body:JSON.stringify({ref:lc(e)})}).then(t=>(uc(e,t.ref),t.ref)).catch(()=>null).finally(()=>{wc.delete(e)});return wc.set(e,n),n}async function Ec(e,t={}){let{ref:n=``,headers:r,throwOnError:i=!0,method:a,...o}=t,s=a?.toUpperCase(),c=()=>fetch(e,{credentials:`same-origin`,...o,method:s,headers:hc(n,{...xc(s),...r})}),l=await c();if(n!==``&&l.status===403&&await Tc(n)!==null&&(l=await c()),i&&!l.ok)throw new gc(l);return l}async function Dc(e,t){return(await Ec(e,t)).json()}function Oc(e){return[e.source,e.audience,[...e.scopes].sort().join(` `)].join(``)}function kc(e){yc.delete(Oc(e))}async function Ac(e){let t=Oc(e),n=yc.get(t);if(n&&n.expiresAt>Date.now()+vc)return n.token;let r=bc.get(t);if(r)return r;let i=Dc(e.tokenEndpoint,{method:`POST`,ref:e.ref,body:JSON.stringify({nodeId:e.nodeId,nodeType:e.nodeType,audience:e.audience,scopes:e.scopes})}).then(e=>(yc.set(t,{token:e,expiresAt:Date.now()+Math.max(0,e.expiresIn)*1e3}),e)).finally(()=>{bc.delete(t)});return bc.set(t,i),i}function jc(e){return e.status===401||e.status===403}async function Mc(e,t,n){let{headers:r,...i}=t;return fetch(e,{...i,credentials:`omit`,headers:mc({Accept:`application/json`,...r,Authorization:`${n.tokenType} ${n.accessToken}`})})}async function Nc(e,t){let{remote:n,throwOnError:r=!0,...i}=t,a=await Ac(n),o=await Mc(e,i,a);if(jc(o)&&(kc(n),a=await Ac(n),o=await Mc(e,i,a)),r&&!o.ok)throw new gc(o);return o}async function Pc(e,t){return(await Nc(e,t)).json()}function Fc(e,t=Jo){if(!(typeof window>`u`))for(let n of e){let e=t[n.type];if(e===void 0){console.warn(`[lattice] No handler registered for effect type "${n.type}".`);continue}e(n)}}function Ic(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(d.actionError,{detail:{error:e}}))}function Lc(e){return Array.isArray(e)?e.filter(Rc):[]}function Rc(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}function zc(){let e=Wo(),t=(0,B.useMemo)(()=>Yo(Jo,e),[e]);return(0,B.useCallback)(e=>Fc(e,t),[t])}function Bc(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`):[]}function Vc(e,t){return e.key??e.id??`${e.type}-${t}`}var Hc=(0,B.createContext)(!1);function Uc({collapsed:e,children:t}){return(0,q.jsx)(Hc.Provider,{value:e,children:t})}function Wc(){return(0,B.useContext)(Hc)}var Gc={sm:`sm:hidden`,md:`md:hidden`,lg:`lg:hidden`,xl:`xl:hidden`,"2xl":`2xl:hidden`},Kc={sm:`sm:contents`,md:`md:contents`,lg:`lg:contents`,xl:`xl:contents`,"2xl":`2xl:contents`};function qc(e){let t=Gc[e?.hiddenFrom??``],n=Kc[e?.visibleFrom??``];return n&&t?`hidden ${n} ${t}`:n?`hidden ${n}`:t?`contents ${t}`:null}function Jc(){return(0,q.jsxs)(`svg`,{"aria-hidden":`true`,className:`size-lt-icon-md shrink-0`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:[(0,q.jsx)(`rect`,{height:`18`,rx:`2`,strokeDasharray:`4 3`,width:`18`,x:`3`,y:`3`}),(0,q.jsx)(`path`,{d:`M12 8v4`}),(0,q.jsx)(`path`,{d:`M12 16h.01`})]})}function Yc({node:e}){e.type;let t=`Missing component: ${e.type}`;return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 align-middle text-lt-muted-fg`,"data-lattice-missing-component":e.type,title:t,children:[(0,q.jsx)(Jc,{}),(0,q.jsx)(`span`,{className:`sr-only`,children:t})]})}function Xc({nodes:e}){return e.map((e,t)=>(0,q.jsx)(Zc,{node:e},Vc(e,t)))}function Y({node:e}){return(0,q.jsx)(Zc,{node:e})}var Zc=(0,B.memo)(function({node:e}){let t=Wc(),n=h()[e.type];if(t&&e.props?.hideWhenCollapsed===!0)return null;if(!n)return(0,q.jsx)(Yc,{node:e});let r=n.component,i=e.schema?.length?(0,q.jsx)(Xc,{nodes:e.schema}):null,a=(0,q.jsx)(r,{node:e,children:i});n.mode===`lazy`&&(a=(0,q.jsx)(B.Suspense,{fallback:null,children:a}));let o=qc(e.props);return o?(0,q.jsx)(`span`,{className:o,children:a}):a}),Qc=`Embedded modals require a ModalProvider.`,$c=(0,B.createContext)(null);function el(){return(0,B.useContext)($c)}var tl=(0,B.createContext)(null);function nl(){return(0,B.useContext)(tl)}function rl(){let e=nl();if(!e)throw Error(Qc);return e}function il({children:e}){let[t,n]=(0,B.useState)([]),r=(0,B.useRef)(t),i=(0,B.useRef)(0),a=(0,B.useRef)(new Map),o=(0,B.useCallback)(e=>{let t=e(r.current);return r.current=t,n(t),t},[]),s=(0,B.useCallback)(e=>{o(t=>{let n=t.findIndex(t=>t.key===e);if(n===-1||!t[n].open)return t;let r=[...t];return r[n]={...r[n],open:!1},r})},[o]),c=(0,B.useCallback)(e=>{let t=(0,B.isValidElement)(e)?null:e.id??null,n=document.activeElement instanceof HTMLElement?document.activeElement:null,r=-1;return o(a=>{if(t!==null){let n=a.findIndex(e=>e.nodeId===t&&e.open);if(n!==-1){r=a[n].key;let t=[...a];return t[n]={...t[n],content:e},t}}return r=i.current++,[...a,{key:r,content:e,nodeId:t,open:!0,opener:n}]}),{close:()=>s(r)}},[s,o]);(0,B.useEffect)(()=>{function e(e){let t=e.detail?.node;t&&c(t)}function t(e){let t=e.detail?.modal;o(e=>{if(t==null)return e.map(e=>e.open?{...e,open:!1}:e);let n=e.findIndex(e=>e.nodeId===t);if(n===-1)return e;let r=[...e];return r[n]={...r[n],open:!1},r})}return window.addEventListener(d.openModal,e),window.addEventListener(d.closeModal,t),()=>{window.removeEventListener(d.openModal,e),window.removeEventListener(d.closeModal,t)}},[c,o]);let l=(0,B.useCallback)(e=>{let t=a.current.get(e);return t||(t={onOpenChange:t=>{t||s(e)},onExited:t=>{o(n=>{let r=n.find(t=>t.key===e)?.opener??null;return r?.isConnected&&(t.preventDefault(),requestAnimationFrame(()=>r.focus())),n.filter(t=>t.key!==e)}),a.current.delete(e)}},a.current.set(e,t),t)},[s,o]),u=(0,B.useMemo)(()=>({open:c}),[c]);return(0,q.jsxs)(tl.Provider,{value:u,children:[e,t.map(e=>{let t={open:e.open,...l(e.key)};return(0,q.jsx)($c.Provider,{value:t,children:(0,B.isValidElement)(e.content)?e.content:(0,q.jsx)(Y,{node:e.content})},e.key)})]})}async function al(e,t){try{let n=await e();return t(Lc((await n.json().catch(()=>({}))).effects)),n.ok}catch(e){return Ic(e),!1}}var ol=Object.defineProperty,sl=(e,t)=>ol(e,`name`,{value:t,configurable:!0}),cl=!!(typeof window<`u`&&window.document&&window.document.createElement);function ll(e,t,{checkForDefaultPrevented:n=!0}={}){return sl(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}sl(ll,`composeEventHandlers`);function ul(e){if(!cl)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}sl(ul,`getOwnerWindow`);function dl(e){if(!cl)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}sl(dl,`getOwnerDocument`);function fl(e,t=!1){let{activeElement:n}=dl(e);if(!n?.nodeName)return null;if(pl(n)&&n.contentDocument)return fl(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=dl(n).getElementById(e);if(t)return t}}return n}sl(fl,`getActiveElement`);function pl(e){return e.tagName===`IFRAME`}sl(pl,`isFrame`);var ml=Object.defineProperty,hl=(e,t)=>ml(e,`name`,{value:t,configurable:!0});function gl(e,t){let n=B.createContext(t);n.displayName=e+`Context`;let r=hl(e=>{let{children:t,...r}=e,i=B.useMemo(()=>r,Object.values(r));return(0,q.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=B.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return hl(i,`useContext`),[r,i]}hl(gl,`createContext`);function _l(e,t=[]){let n=[];function r(t,r){let i=B.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=hl(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=B.useMemo(()=>o,Object.values(o));return(0,q.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=B.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return hl(s,`useContext`),[o,s]}hl(r,`createContext`);let i=hl(()=>{let t=n.map(e=>B.createContext(e));return hl(function(n){let r=n?.[e]||t;return B.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,vl(i,...t)]}hl(_l,`createContextScope`);function vl(...e){let t=e[0];if(e.length===1)return t;let n=hl(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return hl(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return B.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}hl(vl,`composeContextScopes`);var yl=globalThis?.document?B.useLayoutEffect:()=>{},bl=Object.defineProperty,xl=(e,t)=>bl(e,`name`,{value:t,configurable:!0}),Sl=B.useId||(()=>void 0),Cl=0;function wl(e){let[t,n]=B.useState(Sl());return yl(()=>{e||n(e=>e??String(Cl++))},[e]),e||(t?`radix-${t}`:``)}xl(wl,`useId`);var Tl=Object.defineProperty,El=(e,t)=>Tl(e,`name`,{value:t,configurable:!0}),Dl=B.useEffectEvent,Ol=B.useInsertionEffect;function kl(e){if(typeof Dl==`function`)return Dl(e);let t=B.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ol==`function`?Ol(()=>{t.current=e}):yl(()=>{t.current=e}),B.useMemo(()=>((...e)=>t.current?.(...e)),[])}El(kl,`useEffectEvent`);var Al=Object.defineProperty,jl=(e,t)=>Al(e,`name`,{value:t,configurable:!0}),Ml=B.useInsertionEffect||yl;function Nl({prop:e,defaultProp:t,onChange:n=jl(()=>{},`onChange`),caller:r}){let[i,a,o]=Pl({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,B.useCallback(t=>{if(s){let n=Fl(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}jl(Nl,`useControllableState`);function Pl({defaultProp:e,onChange:t}){let[n,r]=B.useState(e),i=B.useRef(n),a=B.useRef(t);return Ml(()=>{a.current=t},[t]),B.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}jl(Pl,`useUncontrolledState`);function Fl(e){return typeof e==`function`}jl(Fl,`isFunction`);var Il=Symbol(`RADIX:SYNC_STATE`);function X(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=kl(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=B.useReducer((t,n)=>{if(n.type===Il)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=B.useRef(p);B.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=B.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return B.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Il,state:i})},[i,d.state,c]),[h,f]}jl(X,`useControllableStateReducer`);var Z=Object.defineProperty,Ll=(e,t)=>Z(e,`name`,{value:t,configurable:!0}),Q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=S(`Primitive.${t}`),r=B.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Rl(e,t){e&&co.flushSync(()=>e.dispatchEvent(t))}Ll(Rl,`dispatchDiscreteCustomEvent`);var zl=Object.defineProperty,Bl=(e,t)=>zl(e,`name`,{value:t,configurable:!0});function Vl(e){let t=B.useRef(e);return B.useEffect(()=>{t.current=e}),B.useMemo(()=>((...e)=>t.current?.(...e)),[])}Bl(Vl,`useCallbackRef`);var Hl=Object.defineProperty,Ul=(e,t)=>Hl(e,`name`,{value:t,configurable:!0}),Wl=`dismissableLayer.update`,Gl=`dismissableLayer.pointerDownOutside`,Kl=`dismissableLayer.focusOutside`,ql,Jl=B.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Yl=B.forwardRef(Ul(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=B.useContext(Jl),[d,f]=B.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=B.useState({}),h=_(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=B.useRef(!1),w=$l(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:B.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=eu(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Vl(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return B.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),B.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ql=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),tu(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ql))}},[d,p,n,u]),B.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),tu())},[d,u]),B.useEffect(()=>{let e=Ul(()=>m({}),`handleUpdate`);return document.addEventListener(Wl,e),()=>document.removeEventListener(Wl,e)},[]),(0,q.jsx)(Q.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:ll(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ll(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ll(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`)),Xl=B.forwardRef(Ul(function(e,t){let n=B.useContext(Jl),r=B.useRef(null),i=_(t,r);return B.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,q.jsx)(Q.div,{...e,ref:i})},`DismissableLayerBranch`));function Zl(){let e=B.useContext(Jl),[t,n]=B.useState(null);return B.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ul(Zl,`useDismissableLayerSurface`);var Ql=Ul(()=>!0,`IS_TRUE`);function $l(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ql}=t,s=Vl(e),c=B.useRef(!1),l=B.useRef(!1),u=B.useRef(new Map),d=B.useRef(()=>{});return B.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Ul(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Ul(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Ul(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Ul(p,`handleInteractionBubble`);let m=Ul(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||nu(Gl,s,p,{discrete:!0})};if(Ul(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Ul(()=>c.current=!0,`onPointerDownCapture`)}}Ul($l,`usePointerDownOutside`);function eu(e,t=globalThis?.document){let n=Vl(e),r=B.useRef(!1);return B.useEffect(()=>{let e=Ul(e=>{e.target&&!r.current&&nu(Kl,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Ul(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Ul(()=>r.current=!1,`onBlurCapture`)}}Ul(eu,`useFocusOutside`);function tu(){let e=new CustomEvent(Wl);document.dispatchEvent(e)}Ul(tu,`dispatchUpdate`);function nu(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Rl(i,a):i.dispatchEvent(a)}Ul(nu,`handleAndDispatchCustomEvent`);var ru=Yl,iu=Xl,au=Object.defineProperty,ou=(e,t)=>au(e,`name`,{value:t,configurable:!0}),su=`focusScope.autoFocusOnMount`,cu=`focusScope.autoFocusOnUnmount`,lu={bubbles:!1,cancelable:!0},uu=B.forwardRef(ou(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=B.useState(null),l=Vl(i),u=Vl(a),d=B.useRef(null),f=_(t,c),p=B.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;B.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:_u(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||_u(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_u(s)};ou(e,`handleFocusIn`),ou(t,`handleFocusOut`),ou(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),B.useEffect(()=>{if(s){vu.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(su,lu);s.addEventListener(su,l),s.dispatchEvent(t),t.defaultPrevented||(du(xu(pu(s)),{select:!0}),document.activeElement===e&&_u(s))}return()=>{s.removeEventListener(su,l),setTimeout(()=>{let t=new CustomEvent(cu,lu);s.addEventListener(cu,u),s.dispatchEvent(t),t.defaultPrevented||_u(e??document.body,{select:!0}),s.removeEventListener(cu,u),vu.remove(p)},0)}}},[s,l,u,p]);let m=B.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=fu(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&_u(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&_u(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,q.jsx)(Q.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function du(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(_u(r,{select:t}),document.activeElement!==n)return}ou(du,`focusFirst`);function fu(e){let t=pu(e);return[mu(t,e),mu(t.reverse(),e)]}ou(fu,`getTabbableEdges`);function pu(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ou(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ou(pu,`getTabbableCandidates`);function mu(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):hu(r,{upTo:t})))return r}ou(mu,`findVisible`);function hu(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ou(hu,`isHidden`);function gu(e){return e instanceof HTMLInputElement&&`select`in e}ou(gu,`isSelectableInput`);function _u(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gu(e)&&t&&e.select()}}ou(_u,`focus`);var vu=yu();function yu(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=bu(e,t),e.unshift(t)},remove(t){e=bu(e,t),e[0]?.resume()}}}ou(yu,`createFocusScopesStack`);function bu(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ou(bu,`arrayRemove`);function xu(e){return e.filter(e=>e.tagName!==`A`)}ou(xu,`removeLinks`);var Su=Object.defineProperty,Cu=B.forwardRef(((e,t)=>Su(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=B.useState(!1);yl(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?co.createPortal((0,q.jsx)(Q.div,{...r,ref:t}),o):null},`Portal`)),wu=Object.defineProperty,Tu=(e,t)=>wu(e,`name`,{value:t,configurable:!0});function Eu(e,t){return B.useReducer((e,n)=>t[e][n]??e,e)}Tu(Eu,`useStateMachine`);var Du=Tu(e=>{let{present:t,children:n}=e,r=Ou(t),i=typeof n==`function`?n({present:r.isPresent}):B.Children.only(n),a=Au(r.ref,Mu(i));return typeof n==`function`||r.isPresent?B.cloneElement(i,{ref:a}):null},`Presence`);function Ou(e){let[t,n]=B.useState(),r=B.useRef(null),i=B.useRef(e),a=B.useRef(`none`),o=B.useRef(void 0),[s,c]=Eu(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return B.useEffect(()=>{s===`mounted`?(a.current=o.current??ju(r.current),o.current=void 0):a.current=`none`},[s]),yl(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ju(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),yl(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Tu(a=>{let o=ju(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Tu(e=>{e.target===t&&(a.current=ju(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:B.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ju(t)}else r.current=null;n(e)},[])}}Tu(Ou,`usePresence`);function ku(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Tu(ku,`setRef`);function Au(...e){let t=B.useRef(e);return t.current=e,B.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ku(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ku(n[e],null)}}},[])}Tu(Au,`useStableComposedRefs`);function ju(e){return e?.animationName||`none`}Tu(ju,`getAnimationName`);function Mu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Tu(Mu,`getElementRef`);var Nu=Object.defineProperty,Pu=(e,t)=>Nu(e,`name`,{value:t,configurable:!0}),Fu=0,Iu=null;function Lu(e){return Ru(),e.children}Pu(Lu,`FocusGuards`);function Ru(){B.useEffect(()=>{Iu||={start:zu(),end:zu()};let{start:e,end:t}=Iu;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Fu++,()=>{Fu===1&&(Iu?.start.remove(),Iu?.end.remove(),Iu=null),Fu=Math.max(0,Fu-1)}},[])}Pu(Ru,`useFocusGuards`);function zu(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Pu(zu,`createFocusGuard`);var Bu=function(){return Bu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Bu.apply(this,arguments)};function Vu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Hu(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Uu=`right-scroll-bar-position`,Wu=`width-before-scroll-bar`,Gu=`with-scroll-bars-hidden`,Ku=`--removed-body-scroll-bar-size`;function qu(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ju(e,t){var n=(0,B.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Yu=typeof window<`u`?B.useLayoutEffect:B.useEffect,Xu=new WeakMap;function Zu(e,t){var n=Ju(t||null,function(t){return e.forEach(function(e){return qu(e,t)})});return Yu(function(){var t=Xu.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||qu(e,null)}),i.forEach(function(e){r.has(e)||qu(e,a)})}Xu.set(n,e)},[e]),n}function Qu(e){return e}function $u(e,t){t===void 0&&(t=Qu);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ed(e){e===void 0&&(e={});var t=$u(null);return t.options=Bu({async:!0,ssr:!1},e),t}var td=function(e){var t=e.sideCar,n=Vu(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return B.createElement(r,Bu({},n))};td.isSideCarExport=!0;function nd(e,t){return e.useMedium(t),td}var rd=ed(),id=function(){},ad=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:id,onWheelCapture:id,onTouchMoveCapture:id}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Vu(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Zu([n,t]),C=Bu(Bu({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:rd,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),Bu(Bu({},C),{ref:S})):B.createElement(v,Bu({},C,{className:c,ref:S}),s))});ad.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ad.classNames={fullWidth:Wu,zeroRight:Uu};var od,sd=function(){if(od)return od;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function cd(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=sd();return t&&e.setAttribute(`nonce`,t),e}function ld(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ud(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var dd=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cd())&&(ld(t,n),ud(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fd=function(){var e=dd();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pd=function(){var e=fd();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},md={left:0,top:0,right:0,gap:0},hd=function(e){return parseInt(e||``,10)||0},gd=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[hd(n),hd(r),hd(i)]},_d=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return md;var t=gd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},vd=pd(),$=`data-scroll-locked`,yd=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
99
|
+
.${Gu} {
|
|
100
|
+
overflow: hidden ${r};
|
|
101
|
+
padding-right: ${s}px ${r};
|
|
102
|
+
}
|
|
103
|
+
body[${$}] {
|
|
104
|
+
overflow: hidden ${r};
|
|
105
|
+
overscroll-behavior: contain;
|
|
106
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
107
|
+
padding-left: ${i}px;
|
|
108
|
+
padding-top: ${a}px;
|
|
109
|
+
padding-right: ${o}px;
|
|
110
|
+
margin-left:0;
|
|
111
|
+
margin-top:0;
|
|
112
|
+
margin-right: ${s}px ${r};
|
|
113
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.${Uu} {
|
|
117
|
+
right: ${s}px ${r};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.${Wu} {
|
|
121
|
+
margin-right: ${s}px ${r};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.${Uu} .${Uu} {
|
|
125
|
+
right: 0 ${r};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.${Wu} .${Wu} {
|
|
129
|
+
margin-right: 0 ${r};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
body[${$}] {
|
|
133
|
+
${Ku}: ${s}px;
|
|
134
|
+
}
|
|
135
|
+
`},bd=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},xd=function(){B.useEffect(function(){return document.body.setAttribute($,(bd()+1).toString()),function(){var e=bd()-1;e<=0?document.body.removeAttribute($):document.body.setAttribute($,e.toString())}},[])},Sd=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;xd();var a=B.useMemo(function(){return _d(i)},[i]);return B.createElement(vd,{styles:yd(a,!t,i,n?``:`!important`)})},Cd=!1;if(typeof window<`u`)try{var wd=Object.defineProperty({},"passive",{get:function(){return Cd=!0,!0}});window.addEventListener(`test`,wd,wd),window.removeEventListener(`test`,wd,wd)}catch{Cd=!1}var Td=Cd?{passive:!1}:!1,Ed=function(e){return e.tagName===`TEXTAREA`},Dd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ed(e)&&n[t]===`visible`)},Od=function(e){return Dd(e,`overflowY`)},kd=function(e){return Dd(e,`overflowX`)},Ad=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Nd(e,r)){var i=Pd(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jd=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Md=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Nd=function(e,t){return e===`v`?Od(t):kd(t)},Pd=function(e,t){return e===`v`?jd(t):Md(t)},Fd=function(e,t){return e===`h`&&t===`rtl`?-1:1},Id=function(e,t,n,r,i){var a=Fd(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Pd(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Nd(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ld=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rd=function(e){return[e.deltaX,e.deltaY]},zd=function(e){return e&&`current`in e?e.current:e},Bd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vd=function(e){return`
|
|
136
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
137
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
138
|
+
`},Hd=0,Ud=[];function Wd(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(Hd++)[0],a=B.useState(pd)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Hu([e.lockRef.current],(e.shards||[]).map(zd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ld(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ad(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ad(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Id(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(!(!Ud.length||Ud[Ud.length-1]!==a)){var r=`deltaY`in n?Rd(n):Ld(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Bd(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(zd).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Gd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=Ld(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,Rd(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,Ld(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return Ud.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Td),document.addEventListener(`touchmove`,c,Td),document.addEventListener(`touchstart`,u,Td),function(){Ud=Ud.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Td),document.removeEventListener(`touchmove`,c,Td),document.removeEventListener(`touchstart`,u,Td)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:Vd(i)}):null,p?B.createElement(Sd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Gd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Kd=nd(rd,Wd),qd=B.forwardRef(function(e,t){return B.createElement(ad,Bu({},e,{ref:t,sideCar:Kd}))});qd.classNames=ad.classNames;var Jd=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Yd=new WeakMap,Xd=new WeakMap,Zd={},Qd=0,$d=function(e){return e&&(e.host||$d(e.parentNode))},ef=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=$d(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},tf=function(e,t,n,r){var i=ef(t,Array.isArray(e)?e:[e]);Zd[n]||(Zd[n]=new WeakMap);var a=Zd[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Yd.get(e)||0)+1,l=(a.get(e)||0)+1;Yd.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Xd.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Qd++,function(){o.forEach(function(e){var t=Yd.get(e)-1,i=a.get(e)-1;Yd.set(e,t),a.set(e,i),t||(Xd.has(e)||e.removeAttribute(r),Xd.delete(e)),i||e.removeAttribute(n)}),Qd--,Qd||(Yd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Zd={})}},nf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Jd(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),tf(r,i,n,`aria-hidden`)):function(){return null}},rf=Object.defineProperty,af=(e,t)=>rf(e,`name`,{value:t,configurable:!0}),of=`Dialog`,[sf,cf]=_l(of),[lf,uf]=sf(of),df=af(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=B.useRef(null),c=B.useRef(null),[l,u]=Nl({prop:r,defaultProp:i??!1,onChange:a,caller:of}),[d,f]=B.useState(0),[p,m]=B.useState(0);return(0,q.jsx)(lf,{scope:t,triggerRef:s,contentRef:c,contentId:wl(),titleId:wl(),descriptionId:wl(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:B.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),ff=`DialogTrigger`,pf=B.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(ff,n),a=_(t,i.triggerRef);return(0,q.jsx)(Q.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Nf(i.open),...r,ref:a,onClick:ll(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),mf=`DialogPortal`,[hf,gf]=sf(mf,{forceMount:void 0}),_f=af(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=uf(mf,t);return(0,q.jsx)(hf,{scope:t,forceMount:n,children:B.Children.map(r,e=>(0,q.jsx)(Du,{present:n||a.open,children:(0,q.jsx)(Cu,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),vf=`DialogOverlay`,yf=B.forwardRef(af(function(e,t){let n=gf(vf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=uf(vf,e.__scopeDialog);return a.modal?(0,q.jsx)(Du,{present:r||a.open,children:(0,q.jsx)(xf,{...i,ref:t})}):null},`DialogOverlay`)),bf=S(`DialogOverlay.RemoveScroll`),xf=B.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(vf,n),a=Zl(),o=_(t,a);return(0,q.jsx)(qd,{as:bf,allowPinchZoom:!0,shards:[i.contentRef],children:(0,q.jsx)(Q.div,{"data-state":Nf(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Sf=`DialogContent`,Cf=B.forwardRef(af(function(e,t){let n=gf(Sf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=uf(Sf,e.__scopeDialog);return(0,q.jsx)(Du,{present:r||a.open,children:a.modal?(0,q.jsx)(wf,{...i,ref:t}):(0,q.jsx)(Tf,{...i,ref:t})})},`DialogContent`)),wf=B.forwardRef(af(function(e,t){let n=uf(Sf,e.__scopeDialog),r=B.useRef(null),i=_(t,n.contentRef,r);return B.useEffect(()=>{let e=r.current;if(e)return nf(e)},[]),(0,q.jsx)(Ef,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ll(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ll(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ll(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Tf=B.forwardRef(af(function(e,t){let n=uf(Sf,e.__scopeDialog),r=B.useRef(!1),i=B.useRef(!1);return(0,q.jsx)(Ef,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ef=B.forwardRef(af(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=uf(Sf,n);return Ru(),(0,q.jsx)(q.Fragment,{children:(0,q.jsx)(uu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)(Yl,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Nf(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Df=`DialogTitle`,Of=B.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(Df,n),{setTitleCount:a}=i;return yl(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,q.jsx)(Q.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),kf=`DialogDescription`,Af=B.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(kf,n),{setDescriptionCount:a}=i;return yl(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,q.jsx)(Q.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),jf=`DialogClose`,Mf=B.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(jf,n);return(0,q.jsx)(Q.button,{type:`button`,...r,ref:t,onClick:ll(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Nf(e){return e?`open`:`closed`}af(Nf,`getState`);var Pf=E(`fixed z-lt-modal w-full overflow-y-auto bg-lt-bg p-6 shadow-lt-lg`,{variants:{placement:{center:`left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-lt border border-lt-border data-[state=open]:animate-lt-dialog-in data-[state=closed]:animate-lt-dialog-out`,start:`inset-y-0 start-0 border-e border-lt-border data-[state=open]:animate-lt-sheet-in-start data-[state=closed]:animate-lt-sheet-out-start`,end:`inset-y-0 end-0 border-s border-lt-border data-[state=open]:animate-lt-sheet-in-end data-[state=closed]:animate-lt-sheet-out-end`},width:{sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-xl`,"2xl":`max-w-2xl`,"3xl":`max-w-3xl`},height:{sm:``,md:``,lg:``,xl:``,"2xl":``,"3xl":``}},compoundVariants:[{placement:`center`,height:`sm`,class:`max-h-[min(480px,calc(100vh-2rem))]`},{placement:`center`,height:`md`,class:`max-h-[min(600px,calc(100vh-2rem))]`},{placement:`center`,height:`lg`,class:`max-h-[min(680px,calc(100vh-2rem))]`},{placement:`center`,height:`xl`,class:`max-h-[min(820px,calc(100vh-2rem))]`},{placement:`center`,height:`2xl`,class:`max-h-[min(920px,calc(100vh-2rem))]`},{placement:`center`,height:`3xl`,class:`max-h-[min(1040px,calc(100vh-2rem))]`}],defaultVariants:{placement:`center`,width:`lg`,height:`lg`}});function Ff(e){return(0,q.jsx)(df,{"data-slot":`dialog`,...e})}function If(e){return(0,q.jsx)(Mf,{"data-slot":`dialog-close`,...e})}function Lf(e){return(0,q.jsx)(pf,{"data-slot":`dialog-trigger`,...e})}function Rf({className:e,...t}){return(0,q.jsx)(Of,{className:k(`text-lg font-semibold leading-none tracking-tight`,e),"data-slot":`dialog-title`,...t})}function zf({className:e,...t}){return(0,q.jsx)(Af,{className:k(`text-sm text-lt-muted-fg`,e),"data-slot":`dialog-description`,...t})}function Bf({children:e,className:t,placement:n=`center`,width:r=`lg`,height:i=`lg`,...a}){return(0,q.jsxs)(_f,{children:[(0,q.jsx)(yf,{className:`fixed inset-0 z-lt-overlay bg-lt-overlay data-[state=open]:animate-lt-fade-in data-[state=closed]:animate-lt-fade-out`,"data-slot":`dialog-overlay`}),(0,q.jsx)(Cf,{className:k(Pf({placement:n,width:r,height:i}),t),"data-slot":`dialog-content`,...a,children:e})]})}function Vf({closeLabel:e,description:t,title:n}){return(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,q.jsx)(Rf,{children:n}),t?(0,q.jsx)(zf,{children:t}):null]}),(0,q.jsx)(If,{asChild:!0,children:(0,q.jsx)(ss,{"aria-label":e,"data-test":`dialog-close`,size:`icon`,emphasis:`ghost`,children:(0,q.jsx)(M,{name:`x`,"aria-hidden":`true`,className:`size-lt-icon-md`})})})]})}function Hf({open:e,title:t,description:n,confirmLabel:r,cancelLabel:i=`Cancel`,confirmVariant:a=null,confirmEmphasis:o=null,processing:s=!1,confirmDisabled:c=!1,onConfirm:l,onCancel:u,onExited:d}){let f=e=>{s&&e.preventDefault()};return(0,q.jsx)(Ff,{open:e,onOpenChange:e=>{e||u()},children:(0,q.jsxs)(Bf,{...n?{}:{"aria-describedby":void 0},width:`md`,onCloseAutoFocus:d,onEscapeKeyDown:f,onInteractOutside:f,children:[(0,q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,q.jsx)(Rf,{children:t}),n&&(0,q.jsx)(zf,{children:n})]}),(0,q.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,q.jsx)(ss,{type:`button`,emphasis:`outline`,"data-test":`confirm-cancel`,disabled:s,onClick:u,children:i}),(0,q.jsxs)(ss,{type:`button`,emphasis:o,variant:a,"data-test":`confirm-accept`,disabled:s||c,onClick:l,children:[s&&(0,q.jsx)(Qs,{}),r]})]})]})})}function Uf(e){return e.props.label??re(`lattice`,`common.action.run`,`Run action`)}function Wf(e){let t=Uf(e),n=e.props.confirmation;return{title:n?.title??t,description:n?.description??void 0,confirmLabel:n?.confirmLabel??t,cancelLabel:n?.cancelLabel??re(`lattice`,`common.cancel`,`Cancel`)}}function Gf({node:e,extraData:t,onSuccess:n}){let r=el();if(!r)throw Error(Qc);let i=e.props.endpoint??``,a=e.props.ref??``,o=e.props.method??`post`,{variant:s,emphasis:c}=e.props,l=Wf(e),[u,d]=(0,B.useState)(!1),f=zc(),p=async()=>{if(!i)return;if(o===`get`){G.visit(i,{headers:hc(a)}),r.onOpenChange(!1);return}d(!0);let e=await al(()=>Ec(i,{method:o,ref:a,body:t?JSON.stringify(t):void 0,throwOnError:!1}),f);d(!1),e&&(r.onOpenChange(!1),n?.())};return(0,q.jsx)(Hf,{open:r.open,onExited:r.onExited,title:l.title,description:l.description,confirmLabel:l.confirmLabel,cancelLabel:l.cancelLabel,confirmVariant:s,confirmEmphasis:c,processing:u,confirmDisabled:!i,onConfirm:()=>void p(),onCancel:()=>r.onOpenChange(!1)})}function Kf({className:e,...t}){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:k(`animate-pulse rounded-lt-sm bg-lt-muted`,e),"data-slot":`skeleton`,...t})}var qf=(0,B.createContext)({action:`#`,clearErrors:()=>{},componentId:void 0,componentRef:``,errors:{},fieldIdPrefix:void 0,fieldLabels:{},precognitive:!1,processing:!1,touch:()=>{},validate:()=>{},validateFields:()=>{},validating:!1});function Jf({children:e,value:t}){return(0,q.jsx)(qf.Provider,{value:t,children:e})}function Yf(){return(0,B.useContext)(qf)}var Xf=(0,B.createContext)(null),Zf=Xf.Provider;function Qf(){return(0,B.useContext)(Xf)}var $f=new Set([`field.builder`,`field.repeater`]);function ep(e){return $f.has(e.type)||Array.isArray(e.props.templates)}function tp(e){let t=e.props.nestedRowsKey;return typeof t==`string`&&t!==``?t:null}function np(e){return e.props}function rp(e,t){for(let n of e??[])t(np(n),n),rp(n.schema,t)}function ip(e){return e.split(`.`).filter(e=>e!==``)}function ap(e,...t){let n=t.map(String).filter(e=>e!==``);return[e??``,...n].filter(e=>e!==``).join(`.`)}function op(e){let[t,...n]=ip(e);return n.reduce((e,t)=>`${e}[${t}]`,t??``)}function sp(e,t){let n=e;for(let e of ip(t)){if(n==null)return;n=n[e]}return n}function cp(e){return e!==void 0&&/^\d+$/.test(e)?[]:{}}function lp(e,t,n){let r=ip(t);if(r.length===0)return e;let i=(e,t)=>{let a=r[t],o=t===r.length-1,s=e&&typeof e==`object`?e:cp(r[t+1]),c=Array.isArray(s)?[...s]:{...s};return c[a]=o?n:i(s[a],t+1),c};return i(e,0)}var up=`rowId`;function dp(e){return e.rowId?e:{...e,[up]:crypto.randomUUID()}}function fp(e){return e.every(e=>!!e.rowId)?e:e.map(dp)}function pp(e,t){return Array.isArray(e)&&e.length>0?e.map(e=>e&&typeof e==`object`?{...e}:{}):Array.from({length:Math.max(0,t)},()=>({}))}function mp(e){return[...e,{}]}function hp(e,t){return e.filter((e,n)=>n!==t)}function gp(e,t){let n=e[t];if(!n)return e;let{[up]:r,...i}=n;return[...e.slice(0,t+1),dp(i),...e.slice(t+1)]}function _p(e,t,n){let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r}function vp(e){return typeof e.rowId==`string`?e[up]:null}function yp(e,t,n,r){return`${e}.${t??String(n)}.${r}`}var bp=(0,B.createContext)(null);function xp(e,t){if(!t)return e;let n=e.startsWith(`${t.path}.`)?e.slice(t.path.length+1):e;return ap(t.identityPath,n)}function Sp({base:e,index:t,row:n,onChange:r,children:i}){let a=(0,B.useContext)(bp),o=(0,B.useMemo)(()=>{let i=n??{},o=vp(i),s=ap(e,t),c=xp(e,a),l=ap(c,o??t);return{row:i,rowId:o,path:s,values:a?{...a.values,...i}:i,identityPath:l,getValue:e=>sp(i,e),setValue:r,scopedName:e=>op(ap(s,e)),errorKey:e=>ap(s,e),overrideKey:e=>yp(c,o,t,e)}},[e,t,n,r,a]);return(0,q.jsx)(bp.Provider,{value:o,children:i})}function Cp(){return(0,B.useContext)(bp)}var wp=(0,B.createContext)({});function Tp({nodes:e,children:t}){return(0,q.jsx)(wp.Provider,{value:e,children:t})}function Ep(e){let t=(0,B.useContext)(wp),n=np(e).name??``,r=Cp(),i=n&&r?r.errorKey(n):n;return i&&t[i]||n&&t[n]||e}var Dp={},Op={},kp=(0,B.createContext)(null),Ap=(0,B.createContext)(()=>{});function jp(e,t){if(Object.is(e,t))return!0;if(!e||!t||typeof e!=`object`||typeof t!=`object`)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>jp(e,t[n]));let n=Object.entries(e),r=t;return n.length===Object.keys(r).length&&n.every(([e,t])=>jp(t,r[e]))}function Mp(e){return e.split(`.`).filter(e=>e!==``).join(`.`)}function Np(e,t){return e===``||t===``||e===t||e.startsWith(`${t}.`)||t.startsWith(`${e}.`)}function Pp(e){let t=e,n=e,r=new Set,i=new Map,a=new Map,o=e=>{for(let e of r)e();let t=Mp(e);for(let[e,n]of i)if(Np(e,t))for(let e of n)e()},s=(e,t)=>{Object.is(n,e)||(n=e,a.clear(),o(t))},c=(e,t)=>{let n=Mp(e),r=i.get(n)??new Set;return r.add(t),i.set(n,r),()=>{r.delete(t),r.size===0&&i.delete(n)}};return{getPathSnapshot:e=>sp(n,e),getPathsSnapshot:e=>{if(e.length===0)return Op;let t=e.map(Mp),r=JSON.stringify(e),i=t.map(e=>sp(n,e)),o=a.get(r);if(o&&o.values.length===i.length&&i.every((e,t)=>Object.is(e,o.values[t])))return o.snapshot;let s=Object.fromEntries(e.map((e,t)=>[e,i[t]]));return a.set(r,{snapshot:s,values:i}),s},getSnapshot:()=>n,replaceInitial:e=>{jp(t,e)||(t=e,s(e,``))},reset:e=>{if(e===void 0){s(t,``);return}let r=e.reduce((e,n)=>lp(e,n,sp(t,n)),n);s(r,``)},setValue:(e,t)=>{let r=sp(n,e),i=typeof t==`function`?t(r):t;Object.is(r,i)||s(lp(n,e,i),e)},subscribe:e=>(r.add(e),()=>r.delete(e)),subscribePath:c,subscribePaths:(e,t)=>{let n=Array.from(new Set(e.map(Mp))).map(e=>c(e,t));return()=>{for(let e of n)e()}}}}var Fp=Pp(Dp);function Ip({initial:e,children:t}){let n=(0,B.useRef)(null);return n.current===null&&(n.current=Pp(e)),(0,B.useEffect)(()=>{n.current?.replaceInitial(e)},[e]),(0,q.jsx)(kp.Provider,{value:n.current,children:(0,q.jsx)(Ap.Provider,{value:n.current.setValue,children:t})})}function Lp(){return(0,B.useContext)(kp)??Fp}function Rp(){let e=Lp();return(0,B.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function zp(e){let t=Lp(),n=(0,B.useCallback)(n=>t.subscribePath(e,n),[e,t]),r=(0,B.useCallback)(()=>t.getPathSnapshot(e),[e,t]);return(0,B.useSyncExternalStore)(n,r,r)}function Bp(e){let t=Lp(),n=JSON.stringify(e),r=(0,B.useMemo)(()=>JSON.parse(n),[n]),i=(0,B.useCallback)(e=>t.subscribePaths(r,e),[r,t]),a=(0,B.useCallback)(()=>t.getPathsSnapshot(r),[r,t]);return(0,B.useSyncExternalStore)(i,a,a)}function Vp(){return(0,B.useContext)(Ap)}function Hp(){let e=Lp();return(0,B.useCallback)(t=>e.reset(t),[e])}var Up=(0,B.createContext)(null);function Wp({children:e,value:t}){return(0,B.createElement)(Up.Provider,{value:t},e)}function Gp(){let e=(0,B.useContext)(Up),{clearErrors:t,precognitive:n,validate:r}=Yf(),i=Vp(),a=Cp(),o=Qf();if(e)return e;let s=(e,t)=>{a?a.setValue(e,t):i(e,t),o?.markUserEdit(a?a.overrideKey(e):e)},c=e=>a?a.errorKey(e):e;return{commit(e,i){s(e,i),n?r(c(e)):t(c(e))},change(e,n){s(e,n),t(c(e))},blur(e){n&&r(c(e))}}}var Kp=(0,B.createContext)(!1);function qp({children:e}){return(0,q.jsx)(Kp.Provider,{value:!0,children:e})}function Jp(){return(0,B.useContext)(Kp)}var Yp=typeof window>`u`?B.useEffect:B.useLayoutEffect;function Xp(e,t,n,r){return Ec(e,{method:`POST`,ref:t,signal:r,body:JSON.stringify(n),throwOnError:!1}).then(e=>e.ok?e.json():null)}function Zp(e){let t=e.props.templates;return t?.length?t:void 0}function Qp(e,t){let n=Zp(e);return n?n.find(e=>e.type===t.type)?.schema??[]:e.schema??[]}function $p(e,t){return e.startsWith(`@`)?e.slice(1):t===null?e:ap(t,e)}function em(e,t,n,r=0,i={}){let a=np(e);if(!a.editablePrefill||!a.name)return null;let o=vp(i);return{path:t===null?a.name:ap(t,a.name),overrideKey:n===null?a.name:yp(n,o,r,a.name),resetOn:(a.prefillResetOn??[]).map(e=>$p(e,t)),refreshOn:(a.prefillRefreshOn??[]).map(e=>$p(e,t))}}function tm(e,t){let n=[];function r(e,a=null,o=null,s=null,c=0,l={}){for(let u of e??[]){if(ep(u)){let e=np(u).name;e&&i(u,ap(a,e),ap(o,e),sp(t,ap(a,e)));continue}let e=em(u,a,s,c,l);e&&n.push(e),r(u.schema,a,o,s,c,l)}}function i(e,t,n,a){let o=Array.isArray(a)?a:[],s=tp(e);o.forEach((a,o)=>{let c=ap(t,o),l=ap(n,vp(a)??o);r(Qp(e,a),c,l,n,o,a),s&&i(e,ap(c,s),ap(l,s),a[s])})}return r(e),n}function nm(e,t){let n=new Map(e.targets.map(e=>[e.overrideKey,e]));return t.targets.filter(r=>{let i=n.get(r.overrideKey);return r.resetOn.some((n,r)=>{let a=i?.resetOn[r]??n;return!Object.is(sp(e.values,a),sp(t.values,n))})}).map(e=>e.overrideKey)}function rm(e,t){return e.filter(e=>{let n=sp(t,e.path);return n!=null&&n!==``}).map(e=>e.overrideKey)}function im(e,t){let n=new Set(t.map(e=>e.overrideKey));return new Set([...e].filter(e=>n.has(e)))}function am(e,t,n){let r=Rp(),i=Vp(),[a,o]=(0,B.useState)({}),s=(0,B.useMemo)(()=>tm(n,r),[n,r]),c=(0,B.useRef)(new Set),l=(0,B.useRef)(new Set),u=(0,B.useRef)(r),d=(0,B.useRef)(s),f=(0,B.useRef)(s);f.current=s,Yp(()=>{let e=new Set(s.map(e=>e.overrideKey));l.current=new Set([...l.current].filter(t=>e.has(t)));let t=s.filter(e=>!l.current.has(e.overrideKey));for(let e of rm(t,r))c.current.add(e);for(let e of t)l.current.add(e.overrideKey)},[s,r]);let p=(0,B.useCallback)(e=>{c.current.add(e)},[]),m=(0,B.useMemo)(()=>{let e=new Set,t=!1;return rp(n,n=>{if(Array.isArray(n.dependsOnKeys))for(let t of n.dependsOnKeys)e.add(String(t));n.dependsOnAny&&(t=!0)}),{keys:[...e],any:t}},[n]),h=(0,B.useMemo)(()=>{let e=new Set(m.keys);for(let t of s){for(let n of t.resetOn)e.add(n);for(let n of t.refreshOn)e.add(n)}return[...e]},[m.keys,s]),g=m.any?r:JSON.stringify(h.map(e=>sp(r,e)));return(0,B.useEffect)(()=>{if(h.length===0&&!m.any)return;let n=u.current;u.current=r;for(let e of nm({targets:d.current,values:n},{targets:f.current,values:r}))c.current.delete(e);d.current=f.current,c.current=im(c.current,f.current);let a=new AbortController,s=window.setTimeout(()=>{Xp(e,t,{_sub:`resolve`,...r},a.signal).then(e=>{if(!e)return;for(let[t,n]of Object.entries(e.values??{}))i(t,n);let t=new Map(f.current.map(e=>[e.path,e]));for(let[n,r]of Object.entries(e.prefill??{})){let e=t.get(n);e&&!c.current.has(e.overrideKey)&&i(n,r)}e.fields&&o(e.fields)}).catch(()=>{})},250);return()=>{window.clearTimeout(s),a.abort()}},[g,e,t,m.any,i]),{nodes:a,markUserEdit:p}}function om(e){let t={labels:{},values:{}};return rp(e,e=>{e.name&&(e.label&&(t.labels[e.name]=e.label),e.value!==void 0&&(t.values[e.name]=e.value))}),t}function sm(e,t){return e===t||e.startsWith(`${t}.`)}function cm(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]=Array.isArray(r)?r[0]:r;return t}function lm(e,t){let n=(0,B.useRef)(e);n.current=e;let r=(0,B.useRef)(null),i=(0,B.useCallback)(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);return(0,B.useEffect)(()=>i,[i]),(0,B.useMemo)(()=>{let e=(...e)=>{i(),r.current=setTimeout(()=>{r.current=null,n.current(...e)},t)};return e.cancel=i,e},[i,t])}function um(e,t,n,r){let[i,a]=(0,B.useState)(null);return(0,B.useEffect)(()=>{if(!n){a(null);return}let i=new AbortController;return Ec(e,{body:JSON.stringify({_sub:`schema`,...r}),ref:t,method:`POST`,signal:i.signal,throwOnError:!1}).then(e=>e.ok?e.json():null).then(e=>a(e)).catch(()=>{}),()=>i.abort()},[n,e,t]),i}function dm(){return(0,q.jsxs)(`div`,{className:`space-y-4`,"data-lattice-action-form-loading":!0,children:[(0,q.jsx)(Kf,{className:`h-4 w-24`}),(0,q.jsx)(Kf,{className:`h-10 w-full`}),(0,q.jsx)(Kf,{className:`h-10 w-full`})]})}function fm({cancelLabel:e,componentRef:t,endpoint:n,extraData:r,fieldLabels:i,formNode:a,method:o,onClose:s,onSuccess:c,precognitive:l,submitLabel:u}){let d=Rp(),f=(0,B.useRef)(d);f.current=d;let p=(0,B.useRef)(r);p.current=r;let{nodes:m,markUserEdit:h}=am(n,t,a.schema),g=zc(),[_,v]=(0,B.useState)({}),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(!1),C=(0,B.useCallback)(e=>Ec(n,{body:JSON.stringify({...f.current,...p.current}),method:o,ref:t,headers:e,throwOnError:!1}),[t,n,o]),w=(0,B.useCallback)(e=>{v(t=>t[e]===void 0?t:{...t,[e]:void 0})},[]),T=lm(e=>{C({Precognition:`true`,"Precognition-Validate-Only":e}).then(async t=>{if(t.status===422){let e=await t.json();v(t=>({...t,...cm(e.errors)}));return}w(e)}).catch(()=>{})},250),E=(0,B.useCallback)(e=>{l&&T(e)},[l,T]),D=(0,B.useCallback)(()=>{},[]),O=(0,B.useCallback)((e,t)=>{S(!0),C({Precognition:`true`,"Precognition-Validate-Only":e.join(`,`)}).then(async n=>{if(n.status===422){let e=await n.json();v(t=>({...t,...cm(e.errors)})),t?.onValidationError?.();return}if(!n.ok){t?.onValidationError?.();return}let r=e.filter(e=>!e.includes(`*`));v(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r.some(t=>sm(e,t))))),t?.onSuccess?.()}).catch(()=>t?.onValidationError?.()).finally(()=>S(!1))},[C]),k=(0,B.useCallback)(()=>{b(!0),C().then(async e=>{let t=await e.json().catch(()=>({}));if(g(Lc(t.effects)),e.status===422&&t.errors){v(cm(t.errors));return}e.ok&&c(t)}).catch(e=>Ic(e)).finally(()=>b(!1))},[g,c,C]),ee=(0,B.useMemo)(()=>({action:n,clearErrors:w,componentRef:t,errors:_,fieldLabels:i,precognitive:l,processing:y,touch:D,validate:E,validateFields:O,validating:x}),[w,t,n,_,i,l,y,D,E,O,x]);return(0,q.jsx)(Jf,{value:ee,children:(0,q.jsxs)(`form`,{className:`flex flex-col gap-6`,onSubmit:e=>{e.preventDefault(),k()},children:[(0,q.jsx)(Zf,{value:{markUserEdit:h},children:(0,q.jsx)(Tp,{nodes:m,children:(0,q.jsx)(Xc,{nodes:a.schema??[]})})}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-3`,children:[(0,q.jsx)(ss,{"data-test":`action-form-cancel`,disabled:y,onClick:s,type:`button`,emphasis:`ghost`,children:e}),a.props?.submitButton!==!1&&(0,q.jsxs)(ss,{"data-test":`action-form-submit`,disabled:y,type:`submit`,children:[y&&(0,q.jsx)(Qs,{}),u]})]})]})})}function pm({formNode:e,...t}){let n=!!e.props?.precognitive,{labels:r,values:i}=(0,B.useMemo)(()=>{let{labels:t,values:n}=om(e.schema);return{labels:t,values:{...n,...e.props?.state}}},[e]);return(0,q.jsx)(Ip,{initial:i,children:(0,q.jsx)(fm,{fieldLabels:r,formNode:e,precognitive:n,...t})})}function mm({description:e,formNode:t,onClose:n,onExited:r,open:i,placement:a,title:o,width:s,...c}){let{t:l}=P(`lattice`);return(0,q.jsx)(Ff,{open:i,onOpenChange:e=>{e||n()},children:(0,q.jsxs)(Bf,{...e?{}:{"aria-describedby":void 0},onCloseAutoFocus:r,placement:a,width:s,children:[(0,q.jsx)(Vf,{closeLabel:l(`common.close`,`Close`),description:e,title:o}),(0,q.jsx)(`div`,{className:`mt-6`,children:t?(0,q.jsx)(pm,{formNode:t,onClose:n,...c}):(0,q.jsx)(dm,{})})]})})}function hm({node:e,extraData:t,onSuccess:n}){let r=el();if(!r)throw Error(Qc);let i=e.props.endpoint??``,a=e.props.ref??``,o=e.props.method??`post`,s=e.props.lazyForm===!0,c=um(i,a,s,t),l=s?c:e.props.form,u=Wf(e);return(0,q.jsx)(mm,{open:r.open,onExited:r.onExited,cancelLabel:u.cancelLabel,componentRef:a,description:u.description,endpoint:i,extraData:t,formNode:l,method:o,onClose:()=>r.onOpenChange(!1),onSuccess:()=>{r.onOpenChange(!1),n?.()},placement:e.props.modalSide??`center`,submitLabel:u.confirmLabel,title:u.title,width:e.props.modalWidth??void 0})}function gm(e,t){let n=e.props.endpoint??``,r=e.props.ref??``,i=e.props.method??`post`,a=e.props.confirmation,o=e.props.form,s=e.props.lazyForm===!0,c=!!o||s,[l,u]=(0,B.useState)(!1),d=zc(),f=nl(),p=async()=>{if(!n)return;let e=t?.extraData?.();if(i===`get`){G.visit(n,{headers:hc(r)});return}u(!0);let a=await al(()=>Ec(n,{method:i,ref:r,body:e?JSON.stringify(e):void 0,throwOnError:!1}),d);u(!1),a&&t?.onSuccess?.()};return{processing:l,requestSubmit:()=>{if(c){if(!f)throw Error(Qc);f.open((0,q.jsx)(hm,{node:e,extraData:t?.extraData?.(),onSuccess:t?.onSuccess}));return}if(a){if(!f)throw Error(Qc);f.open((0,q.jsx)(Gf,{node:e,extraData:t?.extraData?.(),onSuccess:t?.onSuccess}));return}p()}}}var _m=({node:e})=>{let t=e.props.endpoint??``,n=e.props.icon,r=Uf(e),i=oc(),{variant:a,emphasis:o}=e.props,{processing:s,requestSubmit:c}=gm(e),l=e.key??tc(`action`,e.id);return(0,q.jsxs)(ss,{className:i?ic:void 0,"data-lattice-component":e.id,"data-test":l,disabled:s||!t,onClick:c,type:`button`,emphasis:i?`ghost`:o,variant:i?null:a,children:[s?(0,q.jsx)(Qs,{className:i?`size-lt-icon-sm`:void 0}):n&&(0,q.jsx)(rs,{className:i?`size-lt-icon-sm`:`size-lt-icon-md`,icon:n}),r]})},vm=typeof document<`u`?B.useLayoutEffect:function(){};function ym(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ym(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ym(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xm(e,t){let n=bm(e);return Math.round(t*n)/n}function Sm(e){let t=B.useRef(e);return vm(()=>{t.current=e}),t}function Cm(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);ym(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=Sm(c),D=Sm(i),O=Sm(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),ee(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!ym(w.current,t)&&(w.current=t,co.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);vm(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);vm(()=>(A.current=!0,()=>{A.current=!1}),[]),vm(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=xm(M.floating,u.x),r=xm(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...bm(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var wm=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:j({element:r.current,padding:i}).fn(n):r?j({element:r,padding:i}).fn(n):{}}}},Tm=(e,t)=>{let n=A(e);return{name:n.name,fn:n.fn,options:[e,t]}},Em=(e,t)=>{let n=y(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dm=(e,t)=>({fn:O(e).fn,options:[e,t]}),Om=(e,t)=>{let n=w(e);return{name:n.name,fn:n.fn,options:[e,t]}},km=(e,t)=>{let n=T(e);return{name:n.name,fn:n.fn,options:[e,t]}},Am=(e,t)=>{let n=v(e);return{name:n.name,fn:n.fn,options:[e,t]}},jm=(e,t)=>{let n=wm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mm=Object.defineProperty,Nm=(e,t)=>Mm(e,`name`,{value:t,configurable:!0});function Pm(e){let[t,n]=B.useState(void 0);return yl(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Nm(Pm,`useSize`);var Fm=Object.defineProperty,Im=(e,t)=>Fm(e,`name`,{value:t,configurable:!0}),Lm=`Popper`,[Rm,zm]=_l(Lm),[Bm,Vm]=Rm(Lm),Hm=Im(e=>{let{__scopePopper:t,children:n}=e,[r,i]=B.useState(null),[a,o]=B.useState(void 0);return(0,q.jsx)(Bm,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Um=`PopperAnchor`,Wm=B.forwardRef(Im(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Vm(Um,n),o=B.useRef(null),s=a.onAnchorChange,c=B.useCallback(e=>{o.current=e,e&&s(e)},[s]),l=_(t,c),u=B.useRef(null);B.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=a.placementState&&Zm(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,q.jsx)(Q.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),Gm=`PopperContent`,[Km,qm]=Rm(Gm),Jm=B.forwardRef(Im(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Vm(Gm,n),[v,y]=B.useState(null),b=_(t,y),[x,S]=B.useState(null),C=Pm(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],ee=k.length>0,A={padding:O,boundary:k.filter(Ym),altBoundary:ee},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=Cm({strategy:`fixed`,placement:E,whileElementsMounted:Im((...e)=>D(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Tm({mainAxis:i+T,alignmentAxis:o}),c&&Em({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Dm():void 0,...A}),c&&Om({...A}),km({...A,apply:Im(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&jm({element:x,padding:s}),Xm({arrowWidth:w,arrowHeight:T}),f&&Am({strategy:`referenceHidden`,...A,boundary:ee?A.boundary:void 0})]}),I=g.setPlacementState;yl(()=>(I(N),()=>{I(void 0)}),[N,I]);let[te,ne]=Zm(N),re=Vl(m);yl(()=>{P&&re?.()},[P,re]);let L=F.arrow?.x,R=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[z,ae]=B.useState();return yl(()=>{v&&ae(window.getComputedStyle(v).zIndex)},[v]),(0,q.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:z,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,q.jsx)(Km,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:S,arrowX:L,arrowY:R,shouldHideArrow:ie,children:(0,q.jsx)(Q.div,{"data-side":te,"data-align":ne,...h,ref:b,style:{...h.style,animation:P?h.style?.animation:`none`}})})})},`PopperContent`));function Ym(e){return e!==null}Im(Ym,`isNotNull`);var Xm=Im(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Zm(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Zm(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Im(Zm,`getSideAndAlignFromPlacement`);var Qm=Hm,$m=Wm,eh=Jm,th=Object.defineProperty,nh=(e,t)=>th(e,`name`,{value:t,configurable:!0}),rh=`Popover`,[ih,ah]=_l(rh,[zm]),oh=zm(),[sh,ch]=ih(rh),lh=nh(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=oh(t),c=B.useRef(null),[l,u]=B.useState(!1),[d,f]=Nl({prop:r,defaultProp:i??!1,onChange:a,caller:rh});return(0,q.jsx)(Qm,{...s,children:(0,q.jsx)(sh,{scope:t,contentId:wl(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:B.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:B.useCallback(()=>u(!0),[]),onCustomAnchorRemove:B.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),uh=`PopoverTrigger`,dh=B.forwardRef(nh(function(e,t){let{__scopePopover:n,...r}=e,i=ch(uh,n),a=oh(n),o=_(t,i.triggerRef),s=(0,q.jsx)(Q.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":wh(i.open),...r,ref:o,onClick:ll(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,q.jsx)($m,{asChild:!0,...a,children:s})},`PopoverTrigger`)),fh=`PopoverPortal`,[ph,mh]=ih(fh,{forceMount:void 0}),hh=nh(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ch(fh,t);return(0,q.jsx)(ph,{scope:t,forceMount:n,children:(0,q.jsx)(Du,{present:n||a.open,children:(0,q.jsx)(Cu,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),gh=`PopoverContent`,_h=B.forwardRef(nh(function(e,t){let n=mh(gh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ch(gh,e.__scopePopover);return(0,q.jsx)(Du,{present:r||a.open,children:a.modal?(0,q.jsx)(yh,{...i,ref:t}):(0,q.jsx)(bh,{...i,ref:t})})},`PopoverContent`)),vh=S(`PopoverContent.RemoveScroll`),yh=B.forwardRef(nh(function(e,t){let n=ch(gh,e.__scopePopover),r=B.useRef(null),i=_(t,r),a=B.useRef(!1);return B.useEffect(()=>{let e=r.current;if(e)return nf(e)},[]),(0,q.jsx)(qd,{as:vh,allowPinchZoom:!0,children:(0,q.jsx)(xh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ll(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ll(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:ll(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),bh=B.forwardRef(nh(function(e,t){let n=ch(gh,e.__scopePopover),r=B.useRef(!1),i=B.useRef(!1);return(0,q.jsx)(xh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),xh=B.forwardRef(nh(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=ch(gh,n),p=oh(n);return Ru(),(0,q.jsx)(uu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)(Yl,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,q.jsx)(eh,{"data-state":wh(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`)),Sh=`PopoverClose`,Ch=B.forwardRef(nh(function(e,t){let{__scopePopover:n,...r}=e,i=ch(Sh,n);return(0,q.jsx)(Q.button,{type:`button`,...r,ref:t,onClick:ll(e.onClick,()=>i.onOpenChange(!1))})},`PopoverClose`));function wh(e){return e?`open`:`closed`}nh(wh,`getState`);var Th=lh,Eh=dh,Dh=hh,Oh=_h,kh=Ch,Ah=`z-lt-popover rounded-lt-sm border border-lt-border bg-lt-popover text-lt-popover-fg shadow-lt-md`;function jh(e){return(0,q.jsx)(Th,{"data-slot":`popover`,...e})}function Mh(e){return(0,q.jsx)(Eh,{"data-slot":`popover-trigger`,...e})}function Nh(e){return(0,q.jsx)(kh,{"data-slot":`popover-close`,...e})}function Ph({align:e=`start`,className:t,sideOffset:n=4,...r}){return(0,q.jsx)(Dh,{children:(0,q.jsx)(Oh,{align:e,className:k(Ah,t),"data-slot":`popover-content`,sideOffset:n,...r})})}function Fh(e){return(0,q.jsx)(jh,{...e})}function Ih(e){return(0,q.jsx)(Mh,{...e})}function Lh({className:e,...t}){return(0,q.jsx)(Ph,{className:k(`grid min-w-40 gap-1 p-1`,e),role:`menu`,...t})}function Rh({children:e,className:t,danger:n=!1,icon:r,...i}){return(0,q.jsx)(Nh,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,role:`menuitem`,className:k(`flex w-full items-center gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm [&_svg]:size-lt-icon-sm`,n?`text-lt-danger hover:bg-lt-danger/10`:`hover:bg-lt-accent hover:text-lt-accent-fg`,t),...i,children:[r?(0,q.jsx)(M,{name:r,"aria-hidden":`true`}):null,e]})})}var zh={components:{action:V(_m),"action.group":V(({children:e,node:t})=>{let{t:n}=P(`lattice`),r=t.props.label??n(`common.action-group.label`,`Actions`),i=t.props.orientation;return i?(0,q.jsx)(`div`,{"aria-label":r,className:k(`inline-flex max-w-full gap-1`,i===`vertical`?`flex-col items-stretch`:`flex-row flex-wrap items-center`),"data-lattice-component":t.id,role:`group`,children:e}):(0,q.jsx)(`div`,{className:`inline-flex`,"data-lattice-component":t.id,children:(0,q.jsxs)(Fh,{children:[(0,q.jsx)(Ih,{asChild:!0,children:(0,q.jsx)(ss,{"aria-label":r,className:`size-lt-control-sm text-lt-muted-fg shadow-none hover:text-lt-fg`,"data-test":J(t),size:`icon`,type:`button`,emphasis:`ghost`,children:(0,q.jsx)(M,{name:`more-horizontal`,"aria-hidden":`true`,className:`size-lt-icon-md`})})}),(0,q.jsx)(Lh,{align:`end`,"aria-label":r,className:`min-w-44 gap-0.5 p-1.5`,sideOffset:8,children:(0,q.jsx)(ac,{children:e})})]})})})},name:`lattice/action`};function Bh({message:e,className:t=``,...n}){return e?(0,q.jsx)(`p`,{...n,className:k(`text-sm text-lt-danger`,t),children:e}):null}function Vh({content:e}){let{t}=P(I);return e?(0,q.jsxs)(jh,{children:[(0,q.jsx)(Mh,{type:`button`,"aria-label":t(`common.more-info`,`More information`),className:`ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]`,children:(0,q.jsx)(M,{name:`info`,className:`size-lt-icon-sm`})}),(0,q.jsx)(Ph,{align:`start`,className:`max-w-xs p-3 text-sm [&_a]:underline`,dangerouslySetInnerHTML:{__html:e}})]}):null}var Hh=Object.defineProperty,Uh=B.forwardRef(((e,t)=>Hh(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,q.jsx)(Q.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));function Wh({className:e,...t}){return(0,q.jsx)(Uh,{"data-slot":`label`,className:k(`text-base leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:text-lt-disabled-fg peer-disabled:cursor-not-allowed peer-disabled:text-lt-disabled-fg`,e),...t})}function Gh({children:e,className:t,error:n,helperText:r,id:i,label:a,labelAction:o,required:s,tooltip:c,...l}){let u=Jp(),d=`${i}-label`,f=!u&&r?`${i}-helper`:void 0,p=n?`${i}-error`:void 0,m=e({id:i,"aria-describedby":[f,p].filter(Boolean).join(` `)||void 0,"aria-invalid":n?!0:void 0,"aria-labelledby":a?d:void 0,"aria-required":s||void 0});return u?(0,q.jsxs)(`div`,{...l,className:k(`grid gap-1`,t),children:[(0,q.jsx)(Wh,{id:d,htmlFor:i,className:`sr-only`,children:a}),m,(0,q.jsx)(Bh,{id:p,message:n})]}):(0,q.jsxs)(`div`,{...l,className:k(`grid gap-2`,t),children:[(0,q.jsxs)(`div`,{className:`flex min-h-5 items-center`,children:[(0,q.jsx)(Wh,{id:d,htmlFor:i,children:a}),s&&(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`ml-0.5 leading-none text-lt-danger`,children:`*`}),(0,q.jsx)(Vh,{content:c}),o&&(0,q.jsx)(`span`,{className:`ml-auto text-sm`,children:o})]}),m,r&&(0,q.jsx)(`p`,{id:f,className:`text-sm text-lt-muted-fg`,children:r}),(0,q.jsx)(Bh,{id:p,message:n})]})}function Kh(e){return e?(0,q.jsx)(Y,{node:e}):void 0}function qh(e){let t=new Set;for(let n of[e?.visible,e?.required,e?.readOnly,e?.disabled])for(let e of n??[])t.add(e.field);return Array.from(t)}var Jh=new Set([`1`,`true`,`on`,`yes`]);function Yh(e){return typeof e==`boolean`?e:typeof e==`number`?e===1:Jh.has(String(e).toLowerCase())}function Xh(e,t){return typeof t==`boolean`?Yh(e)===t:String(e??``)===String(t??``)}function Zh(e,t){return(Array.isArray(t)?t:[t]).map(e=>String(e)).includes(String(e??``))}function Qh(e){return e==null||String(e).trim()===``}function $h(e,t){let n=Date.parse(String(e)),r=Date.parse(String(t));return Number.isNaN(n)||Number.isNaN(r)?null:n===r?0:n<r?-1:1}function eg(e){return!0}function tg(e,t,n){switch(e){case`eq`:return Xh(t,n);case`neq`:return!Xh(t,n);case`gt`:return Number(t)>Number(n);case`lt`:return Number(t)<Number(n);case`gte`:return Number(t)>=Number(n);case`lte`:return Number(t)<=Number(n);case`contains`:return String(t??``).includes(String(n??``));case`starts_with`:return String(t??``).startsWith(String(n??``));case`ends_with`:return String(t??``).endsWith(String(n??``));case`in`:return Zh(t,n);case`not_in`:return!Zh(t,n);case`before`:return $h(t,n)===-1;case`after`:return $h(t,n)===1;case`empty`:return Qh(t);case`filled`:return!Qh(t);default:return eg(e)}}function ng(e,t){return e.every(e=>tg(e.operator,t[e.field],e.value))}function rg(e,t){return!!e?.some(e=>tg(e.operator,t[e.field],e.value))}function ig(e,t,n){let r=!e?.visible?.length||ng(e.visible,t);return{hidden:!!n.hidden||!r,required:!!n.required||rg(e?.required,t),readOnly:!!n.readOnly||rg(e?.readOnly,t),disabled:!!n.disabled||rg(e?.disabled,t)}}function ag(e){let t=Cp(),n=np(e),r=Bp((0,B.useMemo)(()=>qh(n.conditions),[n.conditions])),i=t?{...r,...t.values}:r;return ig(n.conditions??void 0,i,{required:n.required??!1,readOnly:n.readOnly??!1,disabled:n.disabled??!1})}function og({addLabel:e,options:t,onSelect:n,icon:r,testId:i=`builder-add`}){return(0,q.jsxs)(Fh,{children:[(0,q.jsx)(Ih,{asChild:!0,children:r?(0,q.jsx)(`button`,{type:`button`,"aria-label":e,title:e,"data-test":i,className:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-sm`,children:(0,q.jsx)(M,{name:r})}):(0,q.jsxs)(`button`,{type:`button`,"data-test":i,className:`inline-flex items-center gap-1.5 self-start rounded-lt-sm border border-lt-border px-3 py-1.5 text-sm hover:bg-lt-accent [&_svg]:size-lt-icon-sm`,children:[(0,q.jsx)(M,{name:`plus`}),e]})}),(0,q.jsx)(Lh,{align:`start`,className:`min-w-[12rem]`,children:t.map(e=>(0,q.jsx)(Rh,{"data-test":`${i}-${e.type}`,onClick:()=>n(e.type),children:e.label},e.type))})]})}var sg={duplicate:{key:`table.row-actions.duplicate`,fallback:`Duplicate`,icon:`copy`},remove:{key:`table.row-actions.remove`,fallback:`Remove`,icon:`trash-2`}};function cg(e,t){return(e??lg(t.removable)).map(e=>ug(e,t)).filter(e=>e!==null)}function lg(e){return e?[{type:`remove`,key:`remove`,label:null,icon:null,danger:!0}]:[]}function ug(e,t){if(e.type===`duplicate`){let n=sg.duplicate;return{key:e.key,label:e.label??t.t(n.key,n.fallback),icon:e.icon??n.icon,danger:e.danger,onClick:()=>t.onDuplicate(t.index)}}if(e.type===`remove`){if(!t.removable)return null;let n=sg.remove;return{key:e.key,label:e.label??t.t(n.key,n.fallback),icon:e.icon??n.icon,danger:e.danger,onClick:()=>t.onRemove(t.index)}}return null}function dg(e){return e?`text-lt-danger hover:text-lt-danger [&_svg]:size-lt-icon-sm`:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-sm`}function fg({actions:e}){let{t}=P(`lattice`);if(e.length===0)return null;if(e.length===1){let t=e[0];return(0,q.jsx)(`button`,{type:`button`,"aria-label":t.label,"data-test":`row-action-${t.key}`,className:dg(t.danger),onClick:t.onClick,children:(0,q.jsx)(M,{name:t.icon})})}return(0,q.jsxs)(Fh,{children:[(0,q.jsx)(Ih,{asChild:!0,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":t(`common.action-group.label`,`Actions`),"data-test":`row-actions-menu`,className:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-sm`,children:(0,q.jsx)(M,{name:`more-horizontal`})})}),(0,q.jsx)(Lh,{align:`end`,className:`min-w-[10rem]`,children:e.map(e=>(0,q.jsx)(Rh,{"data-test":`row-action-${e.key}`,danger:e.danger,icon:e.icon,onClick:e.onClick,children:e.label},e.key))})]})}function pg({path:e,rows:t,rowKey:n}){return(0,q.jsx)(q.Fragment,{children:t.map((t,r)=>(0,q.jsx)(`input`,{type:`hidden`,name:op(ap(e,r,n)),value:String(t[n]??``)},String(t.rowId??r)))})}function mg({label:e,testId:t,onClick:n,children:r}){return(0,q.jsx)(`button`,{type:`button`,"aria-label":e,"data-test":t,className:`text-lt-muted-fg hover:text-lt-fg`,onClick:n,children:r})}var hg=(0,B.memo)(function({base:e,index:t,row:n,template:r,heading:i,reorderable:a,isFirst:o,isLast:s,removable:c,rowActions:l,onField:u,onRemove:d,onMove:f,onDuplicate:p}){let{t:m}=P(`lattice`);return(0,q.jsxs)(`div`,{"data-test":`repeater-${e}-row-${t}`,className:`rounded-lt border border-lt-border bg-lt-surface p-4`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-lt-muted-fg`,children:i}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1 [&_svg]:size-lt-icon-sm`,children:[a&&!o&&(0,q.jsx)(mg,{label:`Move up`,testId:`repeater-${e}-up-${t}`,onClick:()=>f(t,-1),children:(0,q.jsx)(M,{name:`arrow-up`})}),a&&!s&&(0,q.jsx)(mg,{label:`Move down`,testId:`repeater-${e}-down-${t}`,onClick:()=>f(t,1),children:(0,q.jsx)(M,{name:`arrow-down`})}),(0,q.jsx)(fg,{actions:cg(l,{index:t,removable:c,onRemove:d,onDuplicate:p,t:m})})]})]}),(0,q.jsx)(Sp,{base:e,index:t,row:n,onChange:(e,n)=>u(t,e,n),children:(0,q.jsx)(`div`,{className:`flex flex-col gap-4`,children:r.map((e,t)=>(0,q.jsx)(Y,{node:e},Vc(e,t)))})})]})}),gg={xs:{track:`minmax(4rem, 0.35fr)`,minPx:64,defaultPx:96},sm:{track:`minmax(6rem, 0.5fr)`,minPx:96,defaultPx:128},md:{track:`minmax(8rem, 1fr)`,minPx:128,defaultPx:176},lg:{track:`minmax(12rem, 1.5fr)`,minPx:192,defaultPx:240},xl:{track:`minmax(16rem, 2fr)`,minPx:256,defaultPx:320}},_g=1024;function vg(e){return gg[e].track}function yg(e){return gg[e.width].minPx}function bg(e){return gg[e.width].defaultPx}function xg({columns:e,leadingTracks:t=[],trailingTracks:n=[],overrides:r={}}){return[...t,...e.map(e=>{let t=r[e.key];return t===void 0?vg(e.width):`${Math.min(_g,Math.max(yg(e),t))}px`}),...n].join(` `)}function Sg(e,t,n={}){let{enabled:r=!0,parse:i,serialize:a}=n,o=()=>typeof t==`function`?t():t,[s,c]=(0,B.useState)(()=>{if(!r||typeof window>`u`)return o();let t;try{t=window.localStorage.getItem(e)}catch{return o()}if(t===null)return o();try{return i?i(t):JSON.parse(t)}catch{try{window.localStorage.removeItem(e)}catch{return o()}return o()}}),l=(0,B.useRef)(s);l.current=s;let u=(0,B.useRef)({enabled:r,key:e,serialize:a});return u.current={enabled:r,key:e,serialize:a},[s,(0,B.useCallback)(e=>{let t=typeof e==`function`?e(l.current):e;l.current=t,c(t);let{enabled:n,key:r,serialize:i}=u.current;if(!(!n||typeof window>`u`))try{let e=i?i(t):JSON.stringify(t);e===null?window.localStorage.removeItem(r):window.localStorage.setItem(r,e)}catch{return}},[])]}var Cg=[];function wg({columnGapPx:e=0,columns:t,enabled:n,leadingTracks:r=Cg,showIndicator:i=!1,storageKey:a,trailingTracks:o=Cg}){let s=(0,B.useMemo)(()=>t.map(e=>e.key),[t]),[c,l]=Sg(a??``,{},{enabled:!!a,parse:e=>Eg(e,t),serialize:e=>Dg(e,s)}),u=(0,B.useRef)(c),d=(0,B.useRef)(null),f=(0,B.useRef)(null),p=(0,B.useCallback)(e=>xg({columns:t,leadingTracks:r,trailingTracks:o,overrides:n?e:{}}),[t,n,r,o]),m=(0,B.useMemo)(()=>p(c),[c,p]),h=(0,B.useCallback)(e=>{let t=f.current;t&&(t.style.gridTemplateColumns=e,t.style.setProperty(`--lattice-table-columns`,e))},[]),g=(0,B.useCallback)(e=>{u.current=e,l(e),h(p(e))},[h,l,p]),_=(0,B.useCallback)((e,t,n,r)=>({...e,[t.key]:Math.min(r??1024,Math.max(yg(t),n))}),[]),v=(0,B.useCallback)((e,t,n)=>{g(_(u.current,e,t,n))},[g,_]),y=(0,B.useCallback)(e=>{let t={...u.current};delete t[e.key],g(t)},[g]),b=(0,B.useCallback)(()=>{g({})},[g]),x=n&&Object.values(c).some(e=>typeof e==`number`),S=(0,B.useCallback)(e=>u.current[e.key]??bg(e),[]);return{getResizeHandleProps:(0,B.useCallback)(a=>{let s=_g,c=yg(a),l=S(a),m=a.label??a.key,b=i?`after:bg-lt-border`:`after:bg-transparent`,x=n=>Tg({column:a,columnGapPx:e,columns:t,grid:f.current??n.parentElement?.parentElement,leadingTracks:r,trailingTracks:o}),C=(e,t)=>v(a,l+t,x(e)),w=(e,t)=>{let n=d.current;n?.key===a.key&&(d.current=null,n.overrides!==null&&g(n.overrides),t&&e.currentTarget.releasePointerCapture?.(e.pointerId))};return{"aria-label":`Resize ${m}`,"aria-orientation":`vertical`,"aria-valuemax":s,"aria-valuemin":c,"aria-valuenow":l,className:`absolute inset-y-0 right-0 hidden w-2 cursor-col-resize touch-none items-stretch justify-center md:flex after:my-1 after:w-px ${b} hover:after:bg-lt-border focus-visible:outline-none focus-visible:after:bg-lt-ring`,onDoubleClick:()=>y(a),onKeyDown:e=>{if(!n)return;let t=e.shiftKey?32:8;if(e.key===`ArrowLeft`&&(e.preventDefault(),C(e.currentTarget,-t)),e.key===`ArrowRight`&&(e.preventDefault(),C(e.currentTarget,t)),e.key===`Home`&&(e.preventDefault(),v(a,c)),e.key===`End`){e.preventDefault();let t=x(e.currentTarget);v(a,t,t)}(e.key===`Enter`||e.key===`Escape`)&&(e.preventDefault(),y(a))},onPointerDown:e=>{if(!n)return;let t=e.currentTarget.parentElement?.getBoundingClientRect().width??0;d.current={key:a.key,maxWidth:x(e.currentTarget),overrides:null,startWidth:t>0?t:l,startX:e.clientX},e.currentTarget.setPointerCapture?.(e.pointerId),e.preventDefault()},onPointerMove:e=>{let t=d.current;if(!n||t?.key!==a.key)return;let r=_(u.current,a,t.startWidth+e.clientX-t.startX,t.maxWidth);t.overrides=r,u.current=r,h(p(r))},onPointerUp:e=>{w(e,!0)},onPointerCancel:e=>{w(e,!0)},onLostPointerCapture:e=>{w(e,!1)},role:`separator`,tabIndex:0}},[e,t,S,n,r,h,g,_,y,v,i,p,o]),gridTemplateColumns:m,hasOverrides:x,resizeRootRef:f,resetColumns:b,resetColumnWidth:y}}function Tg({column:e,columnGapPx:t,columns:n,grid:r,leadingTracks:i,trailingTracks:a}){let o=r?.getBoundingClientRect().width??0;if(o<=0)return _g;let s=[...i,...a].reduce((e,t)=>e+kg(t),0),c=n.reduce((t,n)=>n.key===e.key?t:t+yg(n),0),l=n.length+i.length+a.length,u=Math.max(0,l-1)*t,d=o-s-c-u;return Math.min(_g,Math.max(yg(e),d))}function Eg(e,t){let n=JSON.parse(e)?.overrides;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`unexpected stored column widths shape`);let r=Og(n,t);if(Object.keys(r).length===0)throw Error(`stored column widths hold no usable overrides`);return r}function Dg(e,t){let n={},r=new Set(t);for(let[t,i]of Object.entries(e))r.has(t)&&typeof i==`number`&&Number.isFinite(i)&&(n[t]=i);return Object.keys(n).length===0?null:JSON.stringify({overrides:n})}function Og(e,t){let n={};for(let r of t){let t=e[r.key];typeof t!=`number`||!Number.isFinite(t)||(n[r.key]=Math.min(_g,Math.max(yg(r),t)))}return n}function kg(e){let t=e.trim(),n=t.match(/^([0-9.]+)px$/);if(n)return Number.parseFloat(n[1]);let r=t.match(/^([0-9.]+)rem$/);return r?Number.parseFloat(r[1])*Ag():0}function Ag(){if(typeof window>`u`)return 16;let e=Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize);return Number.isFinite(e)&&e>0?e:16}function jg(e,t){return typeof window>`u`||typeof window.matchMedia!=`function`?t:window.matchMedia(e).matches}function Mg(e,t=!1){let[n,r]=(0,B.useState)(()=>jg(e,t));return(0,B.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),n=()=>r(t.matches);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),n}var Ng=`3rem`,Pg=`3rem`,Fg=[Ng],Ig=[Pg],Lg=`(min-width: 768px)`;function Rg(){return Mg(Lg,!0)}function zg(e){return e.map(e=>{let t=e.props;return{name:String(t.name),label:String(t.label??t.name),columnWidth:t.columnWidth??`md`}})}var Bg=(0,B.memo)(function({base:e,index:t,row:n,template:r,span:i,isFirst:a,isLast:o,columnCount:s,flipKey:c,reorderable:l,removable:u,rowActions:d,onField:f,onMove:p,onRemove:m,onDuplicate:h,registerRow:g}){let{t:_}=P(`lattice`);return(0,q.jsxs)(`div`,{ref:e=>g?.(c,e),"data-flip-key":c,"data-test":`table-row-${e}-${t}`,className:`grid grid-cols-[var(--lattice-table-columns)] items-start gap-x-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1 [&_svg]:size-lt-icon-sm`,children:[l&&!a&&(0,q.jsx)(mg,{label:`Move up`,testId:`table-${e}-up-${t}`,onClick:()=>p(t,-1),children:(0,q.jsx)(M,{name:`arrow-up`})}),l&&!o&&(0,q.jsx)(mg,{label:`Move down`,testId:`table-${e}-down-${t}`,onClick:()=>p(t,1),children:(0,q.jsx)(M,{name:`arrow-down`})})]}),(0,q.jsx)(Sp,{base:e,index:t,row:n,onChange:(e,n)=>f(t,e,n),children:(0,q.jsx)(qp,{children:i?(0,q.jsx)(`div`,{"data-test":`table-row-${e}-${t}-span`,className:`flex flex-col gap-2`,style:{gridColumn:`span ${s}`},children:r.map((e,t)=>(0,q.jsx)(Y,{node:e},Vc(e,t)))}):r.map((e,t)=>(0,q.jsx)(`div`,{children:(0,q.jsx)(Y,{node:e})},Vc(e,t)))})}),(0,q.jsx)(`div`,{className:`flex items-center`,children:(0,q.jsx)(fg,{actions:cg(d,{index:t,removable:u,onRemove:m,onDuplicate:h,t:_})})})]})});function Vg({base:e,columns:t,rows:n,reorderable:r,removable:i,rowActions:a,onField:o,onMove:s,onRemove:c,onDuplicate:l,registerRow:u,resizableColumns:d=!1,resizeIndicator:f=!1}){let{t:p}=P(`lattice`),m=Rg(),h=(0,B.useMemo)(()=>t.map(e=>({key:e.name,label:e.label,width:e.columnWidth})),[t]),{getResizeHandleProps:g,gridTemplateColumns:_,hasOverrides:v,resizeRootRef:y,resetColumns:b}=wg({columns:h,enabled:d,columnGapPx:12,leadingTracks:Fg,showIndicator:f,storageKey:d?`lattice:table-columns:form:${e}`:void 0,trailingTracks:Ig});return m?(0,q.jsxs)(`div`,{className:`relative`,children:[v&&(0,q.jsx)(`button`,{"aria-label":p(`table.reset-column-widths`,`Reset column widths`),className:`absolute right-1 top-1 z-10 hidden rounded-lt-sm p-1 text-lt-muted-fg hover:text-lt-fg md:inline-flex`,"data-test":`table-reset-columns`,onClick:b,title:p(`table.reset-column-widths`,`Reset column widths`),type:`button`,children:(0,q.jsx)(M,{name:`rotate-ccw`,className:`size-lt-icon-sm`})}),(0,q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,q.jsxs)(`div`,{ref:y,className:`flex min-w-max flex-col gap-2`,style:{"--lattice-table-columns":_},children:[(0,q.jsxs)(`div`,{className:`grid grid-cols-[var(--lattice-table-columns)] items-center gap-x-3`,children:[(0,q.jsx)(`div`,{}),t.map((e,t)=>(0,q.jsxs)(`div`,{className:`relative min-w-0 pr-3 text-xs font-medium text-lt-muted-fg`,children:[e.label,d&&(0,q.jsx)(`div`,{...g(h[t])})]},e.name)),(0,q.jsx)(`div`,{})]}),n.map(d=>(0,q.jsx)(Bg,{base:e,index:d.index,row:d.row,template:d.template,span:d.span,isFirst:d.index===0,isLast:d.index===n.length-1,columnCount:t.length,flipKey:d.key,reorderable:r,removable:i(d.index),rowActions:a,onField:o,onMove:s,onRemove:c,onDuplicate:l,registerRow:u},d.key))]})})]}):(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:n.map(t=>(0,q.jsx)(`div`,{ref:e=>u?.(t.key,e),"data-flip-key":t.key,children:(0,q.jsx)(hg,{base:e,index:t.index,row:t.row,template:t.template,heading:t.heading??`#${t.index+1}`,reorderable:r,isFirst:t.index===0,isLast:t.index===n.length-1,removable:i(t.index),rowActions:a,onField:o,onRemove:c,onMove:s,onDuplicate:l})},t.key))})}var Hg=180;function Ug(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Wg(e){let t=(0,B.useRef)(new Map),n=(0,B.useRef)(new Map),r=(0,B.useCallback)((e,n)=>{n?t.current.set(e,n):t.current.delete(e)},[]);return Yp(()=>{let e=[],r=new Map;return t.current.forEach((e,t)=>{e.style.transition=``,e.style.transform=``,r.set(t,e.getBoundingClientRect())}),Ug()||t.current.forEach((t,i)=>{let a=n.current.get(i),o=r.get(i);if(a&&o){let n=a.top-o.top;n&&(t.style.transform=`translateY(${n}px)`,e.push(requestAnimationFrame(()=>{t.style.transition=`transform ${Hg}ms ease-out`,t.style.transform=``})))}}),n.current=r,()=>{for(let t of e)cancelAnimationFrame(t)}},[e]),r}function Gg(e,t){let n=Cp(),r=n?n.errorKey(e):e,i=Vp(),a=zp(r),o=Array.isArray(a)?a:pp(a,t),s=fp(o);Yp(()=>{s!==o&&i(r,s)},[o,s,i,r]);let c=(0,B.useCallback)(e=>{i(r,n=>e(Array.isArray(n)?n:pp(n,t)))},[i,r,t]);return{path:r,rows:s,onField:(0,B.useCallback)((e,t,n)=>c(r=>r.map((r,i)=>i===e?{...r,[t]:n}:r)),[c]),onRemove:(0,B.useCallback)(e=>c(t=>hp(t,e)),[c]),onMove:(0,B.useCallback)((e,t)=>c(n=>_p(n,e,e+t)),[c]),onDuplicate:(0,B.useCallback)(e=>c(t=>gp(t,e)),[c]),append:(0,B.useCallback)(e=>c(t=>[...t,dp(e)]),[c]),insert:(0,B.useCallback)((e,t)=>c(n=>[...n.slice(0,e),dp(t),...n.slice(e)]),[c])}}var Kg=[],qg=({node:e})=>{let t=e.props,n=t.name,r=t.templates,{errors:i}=Yf(),{hidden:a,required:o}=ag(e),{path:s,rows:c,onField:l,onRemove:u,onMove:d,onDuplicate:f,append:p}=Gg(n,t.defaultItems??0),{t:m}=P(`lattice`),h=Wg(c.map(e=>String(e.rowId??``)).join(`,`)),g=t.maxItems!=null&&c.length>=t.maxItems,_=t.minItems!=null&&c.length<=t.minItems,v=t.layout===`table`,y=e=>r.find(t=>t.type===e),b=r.map(e=>({type:e.type,label:e.label}));if(a)return null;let x=r[0],S=c.map((e,t)=>{let n=y(e.type),r=!!n&&!!x&&n.type===x.type;return{key:String(e.rowId??t),index:t,row:e,template:n?.schema??Kg,span:!r,heading:n?.label??`Unknown block: ${String(e.type)}`}});return(0,q.jsx)(Gh,{error:i[s],helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,labelAction:Kh(t.labelAction),label:t.label??``,id:s,required:o,children:e=>(0,q.jsxs)(`div`,{...e,className:`flex flex-col gap-3`,role:`group`,children:[(0,q.jsx)(pg,{path:s,rows:c,rowKey:up}),(0,q.jsx)(pg,{path:s,rows:c,rowKey:`type`}),v?(0,q.jsx)(q.Fragment,{children:(0,q.jsx)(Vg,{base:s,columns:zg(x?.schema??[]),rows:S,reorderable:t.reorderable??!1,removable:()=>!_,rowActions:t.rowActions,onField:l,onMove:d,onRemove:u,onDuplicate:f,registerRow:h,resizableColumns:t.resizableColumns===!0,resizeIndicator:t.resizeIndicator===!0})}):c.map((e,r)=>{let i=y(e.type),a=String(e.rowId??r);return(0,q.jsx)(`div`,{ref:e=>h(a,e),"data-flip-key":a,children:i?(0,q.jsx)(hg,{base:s,index:r,row:e,template:i.schema??Kg,heading:i.label,reorderable:t.reorderable??!1,isFirst:r===0,isLast:r===c.length-1,removable:!_,rowActions:t.rowActions,onField:l,onRemove:u,onMove:d,onDuplicate:f}):(0,q.jsxs)(`div`,{"data-test":`repeater-${n}-row-${r}`,className:`flex items-center justify-between rounded-lt border border-dashed border-lt-border p-4 text-sm text-lt-muted-fg`,children:[(0,q.jsxs)(`span`,{children:[`Unknown block: `,String(e.type)]}),(0,q.jsx)(fg,{actions:cg(t.rowActions,{index:r,removable:!_,onRemove:u,onDuplicate:f,t:m})})]})},a)}),!g&&(0,q.jsx)(og,{addLabel:t.addLabel??`Add`,options:b,onSelect:e=>p({type:e})})]})})},Jg=Object.defineProperty,Yg=(e,t)=>Jg(e,`name`,{value:t,configurable:!0}),Xg=`Checkbox`,[Zg,Qg]=_l(Xg),[$g,e_]=Zg(Xg);function t_(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Nl({prop:n,defaultProp:i??!1,onChange:c,caller:Xg}),[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useRef(!1),[y,b]=B.useReducer(e=>e+1,0),x=!m||!!o||!!m.closest(`form`),S={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:!u_(i)&&i,isFormControl:x,bubbleInput:g,setBubbleInput:_};return(0,q.jsx)($g,{scope:t,...S,children:l_(d)?d(S):r})}Yg(t_,`CheckboxProvider`);var n_=`CheckboxTrigger`,r_=B.forwardRef(Yg(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=e_(n_,e),g=_(i,u),v=B.useRef(c);return B.useEffect(()=>{let e=a?.form;if(e){let t=Yg(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,q.jsx)(Q.button,{type:`button`,role:`checkbox`,"aria-checked":u_(c)?`mixed`:c,"aria-required":l,"data-state":d_(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:ll(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:ll(n,e=>{p(),d(e=>u_(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),i_=B.forwardRef(Yg(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,q.jsx)(t_,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(r_,{...d,ref:t,__scopeCheckbox:n}),e&&(0,q.jsx)(c_,{__scopeCheckbox:n})]})})},`Checkbox`)),a_=`CheckboxIndicator`,o_=B.forwardRef(Yg(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=e_(a_,n);return(0,q.jsx)(Du,{present:r||u_(a.checked)||a.checked===!0,children:(0,q.jsx)(Q.span,{"data-state":d_(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),s_=`CheckboxBubbleInput`,c_=B.forwardRef(Yg(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=e_(s_,e),g=_(r,h),v=Pm(i),y=B.useRef(!1),b=B.useRef(s),x=B.useRef(o);B.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=u_(s),n.call(e,!u_(s)&&s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=B.useRef(!u_(s)&&s);return(0,q.jsx)(Q.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:ll(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function l_(e){return typeof e==`function`}Yg(l_,`isFunction`);function u_(e){return e===`indeterminate`}Yg(u_,`isIndeterminate`);function d_(e){return u_(e)?`indeterminate`:e?`checked`:`unchecked`}Yg(d_,`getState`);function f_({className:e,...t}){return(0,q.jsx)(i_,{"data-slot":`checkbox`,className:k(`peer border-lt-input data-[state=checked]:bg-lt-primary data-[state=checked]:text-lt-primary-fg data-[state=checked]:border-lt-primary focus-visible:border-lt-ring focus-visible:ring-lt-ring/50 aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger size-4 shrink-0 rounded-lt-xs border shadow-lt-xs transition-shadow outline-none focus-visible:ring-[length:var(--lt-ring-width)] disabled:cursor-not-allowed disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:data-[state=checked]:bg-lt-disabled disabled:data-[state=checked]:text-lt-disabled-fg disabled:data-[state=checked]:border-lt-disabled`,e),...t,children:(0,q.jsx)(o_,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current transition-none`,children:(0,q.jsx)(M,{name:`check`,className:`size-lt-icon-sm`})})})}function p_(e,t){if(!t)return e;let n=e.replace(/[^A-Za-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``);return n?`${t}-${n}`:t}function m_(e,t){let n=Cp(),r=zp(e),i=n?n.getValue(e):r,a=Vp();(0,B.useEffect)(()=>{i==null&&t!==void 0&&(n?n.setValue(e,t):a(e,t))},[e,t,i,a,n])}var h_=({node:e})=>{let{hidden:t,readOnly:n,disabled:r}=ag(e),i=e.props.name,a=Cp(),{fieldIdPrefix:o}=Yf(),s=p_(a?a.scopedName(i):i,o),c=zp(i),l=a?a.getValue(i):c,{commit:u}=Gp(),d=Yh(e.props.value),f=l===void 0?d:Yh(l);return m_(i,d),t?null:(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center space-x-3`,children:[(0,q.jsx)(f_,{autoFocus:e.props.autoFocus??void 0,checked:f,"data-test":$s(i),disabled:n||r,id:s,name:s,onCheckedChange:e=>{u(i,e===!0)},tabIndex:e.props.tabIndex??void 0}),(0,q.jsx)(Wh,{htmlFor:s,children:e.props.label})]}),e.props.helperText&&(0,q.jsx)(`p`,{className:`mt-1 pl-7 text-sm text-lt-muted-fg`,children:e.props.helperText})]})},g_=new Set([`ArrowUp`,`ArrowLeft`]),__=new Set([`ArrowDown`,`ArrowRight`]);function v_({ariaLabel:e,autoFocus:t=!1,className:n,disabled:r=!1,name:a,onSelect:o,optionSchema:s,options:c,tabIndex:l,value:u,...d}){let f=(0,B.useRef)(null),p=c.some(e=>e.value===u);(0,B.useEffect)(()=>{if(!t)return;let e=f.current;(e?.querySelector(`button[aria-checked="true"]`)??e?.querySelector(`button`))?.focus()},[t]);let m=e=>{if(r||c.length===0)return;let t=__.has(e.key)?1:g_.has(e.key)?-1:0;if(t===0)return;e.preventDefault();let n=c[(c.findIndex(e=>e.value===u)+t+c.length)%c.length];n&&(o(n.value),f.current?.querySelector(`[data-test="${a}-${n.value}"]`)?.focus())};return(0,q.jsx)(`div`,{...d,"aria-label":e,className:k(`grid w-full gap-2`,n),onKeyDown:m,ref:f,role:`radiogroup`,children:c.map((e,t)=>{let n=u===e.value,c=n||!p&&t===0;return(0,q.jsx)(`button`,{"aria-checked":n,className:k(`rounded-lt border p-4 text-left transition-colors`,n?`border-lt-primary bg-lt-accent text-lt-accent-fg`:`border-lt-border hover:border-lt-input`,r&&`cursor-not-allowed opacity-60`),"data-test":`${a}-${e.value}`,disabled:r,onClick:()=>o(e.value),role:`radio`,tabIndex:c?l??0:-1,type:`button`,children:(0,q.jsx)(Xc,{nodes:i(s,{...e.data,label:e.label,value:e.value})})},e.value)})})}function y_(e){return k(`whitespace-nowrap rounded-lt-sm px-3 py-1.5 text-sm font-medium transition-colors`,e?`bg-lt-bg text-lt-fg shadow-lt-xs`:`text-lt-muted-fg hover:bg-lt-bg/60 hover:text-lt-fg`)}function b_({"aria-label":e,autoFocus:t=!1,className:n,defaultValue:r,disabled:i=!1,name:a,onValueChange:o,options:s,tabIndex:c,value:l,...u}){let d=(0,B.useRef)(null),[f,p]=(0,B.useState)(r??s[0]?.value??``),m=l??f;if((0,B.useEffect)(()=>{if(!t)return;let e=d.current;(e?.querySelector(`button[aria-checked="true"]`)??e?.querySelector(`button`))?.focus()},[t]),s.length===0)return null;function h(e){l===void 0&&p(e),o?.(e)}return(0,q.jsx)(`div`,{...u,"aria-label":e,className:k(`inline-flex w-fit max-w-full gap-1 overflow-x-auto rounded-lt bg-lt-muted p-1`,n),ref:d,role:`radiogroup`,children:s.map(e=>{let t=m===e.value;return(0,q.jsx)(`button`,{"aria-checked":t,"data-test":a?`${a}-${e.value}`:void 0,className:k(y_(t),i&&`cursor-not-allowed opacity-60`),disabled:i,onClick:()=>h(e.value),role:`radio`,tabIndex:c,type:`button`,children:e.label},e.value)})})}function x_(e){let{errors:t,fieldIdPrefix:n}=Yf(),r=Cp(),i=ag(e),a=np(e),o=a.name??``,s=zp(o),c=r?r.getValue(o):s,l=c===void 0?a.value:c,u=typeof l==`string`||typeof l==`number`?String(l):``,d=p_(r?r.scopedName(o):o,n),f=r?r.errorKey(o):o,{commit:p,change:m,blur:h}=Gp(),g=e=>p(o,e),_=e=>m(o,e),v=()=>h(o);return{...i,localName:o,name:d,testId:$s(o),value:u,error:t[f],commit:g,change:_,blur:v}}var S_=({node:e})=>{let t=Ep(e),{localName:n,name:r,testId:i,value:a,error:o,hidden:s,required:c,readOnly:l,disabled:u,commit:d}=x_(e),f=(0,B.useMemo)(()=>t.props.options??[],[t.props]),p=t.props.optionSchema,m=f[0]?.value??``,h=a||m;return m_(n,h||void 0),s||f.length===0?null:(0,q.jsx)(Gh,{error:o,helperText:e.props.helperText??void 0,tooltip:e.props.tooltip??void 0,labelAction:Kh(e.props.labelAction),label:e.props.label??``,id:r,required:c,children:t=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`input`,{name:r,type:`hidden`,value:h}),p?.length?(0,q.jsx)(v_,{...t,ariaLabel:e.props.label??void 0,autoFocus:e.props.autoFocus??void 0,disabled:l||u,name:i??`choice`,onSelect:d,optionSchema:p,options:f,tabIndex:e.props.tabIndex??void 0,value:h}):(0,q.jsx)(b_,{...t,"aria-label":e.props.label??void 0,autoFocus:e.props.autoFocus??void 0,disabled:l||u,name:i??`segment`,onValueChange:d,options:f,tabIndex:e.props.tabIndex??void 0,value:h})]})})};function C_(){return(C_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function w_(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function T_(e){var t=(0,B.useRef)(e),n=(0,B.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var E_=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},D_=function(e){return`touches`in e},O_=function(e){return e&&e.ownerDocument.defaultView||self},k_=function(e,t,n){var r=e.getBoundingClientRect(),i=D_(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:E_((i.pageX-(r.left+O_(e).pageXOffset))/r.width),top:E_((i.pageY-(r.top+O_(e).pageYOffset))/r.height)}},A_=function(e){!D_(e)&&e.preventDefault()},j_=B.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=w_(e,[`onMove`,`onKey`,`onEnd`]),a=(0,B.useRef)(null),o=T_(t),s=T_(n),c=T_(r),l=(0,B.useRef)(null),u=(0,B.useRef)(!1),d=(0,B.useMemo)(function(){var e=function(e){A_(e),(D_(e)?e.touches.length>0:e.buttons>0)&&a.current?o(k_(a.current,e,l.current)):(n(!1),c())},t=function(){n(!1),c()};function n(n){var r=u.current,i=O_(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(A_(t),!function(e,t){return t&&!D_(e)}(t,u.current)&&r)){if(D_(t)){u.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),o(k_(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&c()},n]},[s,o,c]),f=d[0],p=d[1],m=d[2],h=d[3];return(0,B.useEffect)(function(){return h},[h]),B.createElement(`div`,C_({},i,{onTouchStart:f,onMouseDown:f,className:`react-colorful__interactive`,ref:a,onKeyDown:p,onKeyUp:m,tabIndex:0,role:`slider`}))}),M_=function(e){return e.filter(Boolean).join(` `)},N_=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=M_([`react-colorful__pointer`,e.className]);return B.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},B.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},P_=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var F_=function(e){return U_(I_(e))},I_=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?P_(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?P_(parseInt(e.substring(6,8),16)/255,2):1}},L_=function(e){return H_(B_(e))},R_=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:P_(e.h),s:P_(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:P_(i/2),a:P_(r,2)}},z_=function(e){var t=R_(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},B_=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:P_(255*[r,s,o,o,c,r][l]),g:P_(255*[c,r,r,s,o,o][l]),b:P_(255*[o,o,c,r,r,s][l]),a:P_(i,2)}},V_=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},H_=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?V_(P_(255*i)):``;return`#`+V_(t)+V_(n)+V_(r)+a},U_=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:P_(60*(s<0?s+6:s)),s:P_(a?o/a*100:0),v:P_(a/255*100),a:i}},W_=B.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=M_([`react-colorful__hue`,e.className]);return B.createElement(`div`,{className:i},B.createElement(j_,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:E_(t+360*e.left,0,360)})},onEnd:r,"aria-label":`Hue`,"aria-valuenow":P_(t),"aria-valuemax":`360`,"aria-valuemin":`0`},B.createElement(N_,{className:`react-colorful__hue-pointer`,left:t/360,color:z_({h:t,s:100,v:100,a:1})})))}),G_=B.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:z_({h:t.h,s:100,v:100,a:1})};return B.createElement(`div`,{className:`react-colorful__saturation`,style:i},B.createElement(j_,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:E_(t.s+100*e.left,0,100),v:E_(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":`Color`,"aria-valuetext":`Saturation `+P_(t.s)+`%, Brightness `+P_(t.v)+`%`},B.createElement(N_,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:z_(t)})))}),K_=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},q_=function(e,t){return e.toLowerCase()===t.toLowerCase()||K_(I_(e),I_(t))};function J_(e,t,n,r){var i=T_(n),a=T_(r),o=(0,B.useState)(function(){return e.toHsva(t)}),s=o[0],c=o[1],l=(0,B.useRef)({color:t,hsva:s}),u=(0,B.useRef)(!1);return(0,B.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},c(n),u.current=!1}},[t,e]),(0,B.useEffect)(function(){var t;K_(s,l.current.hsva)||e.equal(t=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:t},i(t),u.current=!0)},[s,e,i]),[s,(0,B.useCallback)(function(e){c(function(t){return Object.assign({},t,e)})},[]),(0,B.useCallback)(function(){u.current&&(u.current=!1,a(l.current.color))},[a])]}var Y_,X_=typeof window<`u`?B.useLayoutEffect:B.useEffect,Z_=function(){return Y_||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},Q_=new WeakMap,$_=function(e){X_(function(){var t=e.current;if(typeof document<`u`&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&(`head`in n||`host`in n)?n:t.ownerDocument;if(!Q_.has(r)){var i=`head`in r?r.head:r,a=(i.ownerDocument||document).createElement(`style`);a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var o=Z_();o&&a.setAttribute(`nonce`,o),Q_.set(r,a),i.appendChild(a)}}},[])},ev=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=e.onChangeEnd,s=w_(e,[`className`,`colorModel`,`color`,`onChange`,`onChangeEnd`]),c=(0,B.useRef)(null);$_(c);var l=J_(n,i,a,o),u=l[0],d=l[1],f=l[2],p=M_([`react-colorful`,t]);return B.createElement(`div`,C_({},s,{ref:c,className:p}),B.createElement(G_,{hsva:u,onChange:d,onChangeEnd:f}),B.createElement(W_,{hue:u.h,onChange:d,onChangeEnd:f,className:`react-colorful__last-control`}))},tv={defaultColor:`000`,toHsva:F_,fromHsva:function(e){return L_({h:e.h,s:e.s,v:e.v,a:1})},equal:q_},nv=function(e){return B.createElement(ev,C_({},e,{colorModel:tv}))};function rv(e){let t=e.trim().replace(/^#/,``).toLowerCase();return/^[0-9a-f]{6}$/.test(t)?`#${t}`:/^[0-9a-f]{3}$/.test(t)?`#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`:null}function iv({value:e,onChange:t,palette:n,hexLabel:r=`Hex color`,paletteLabel:i=`Color palette`}){let[a,o]=(0,B.useState)(null),s=rv(e)??`#6b7280`;return(0,q.jsxs)(`div`,{className:`flex w-56 flex-col gap-3`,"data-slot":`color-picker`,children:[(0,q.jsx)(nv,{className:`!w-full`,color:s,onChange:t}),n.length>0&&(0,q.jsx)(`div`,{"aria-label":i,className:`flex flex-wrap gap-1.5`,role:`listbox`,children:n.map(e=>{let n=rv(e)??e;return(0,q.jsx)(`button`,{"aria-label":n,"aria-selected":n===s,className:k(`size-6 shrink-0 rounded-full border border-lt-border`,n===s&&`ring-2 ring-lt-ring ring-offset-1`),onClick:()=>t(n),role:`option`,style:{background:e},type:`button`},e)})}),(0,q.jsx)(ce,{"aria-label":r,onBlur:()=>o(null),onChange:e=>{let n=e.target.value,r=rv(n);o(n),r!==null&&t(r)},value:a??s})]})}function av({node:e,label:t,children:n}){let r=x_(e);return r.hidden?null:(0,q.jsx)(Gh,{error:r.error,helperText:np(e).helperText??void 0,tooltip:np(e).tooltip??void 0,labelAction:Kh(np(e).labelAction),label:t,id:r.name,required:r.required,children:e=>n(r,e)})}var ov=({node:e})=>{let t=e.props;return(0,q.jsx)(av,{node:e,label:t.label??``,children:({name:e,value:n,readOnly:r,disabled:i,commit:a},o)=>{let s=rv(n);return(0,q.jsxs)(jh,{children:[(0,q.jsx)(`input`,{name:e,type:`hidden`,value:s??``}),(0,q.jsx)(Mh,{asChild:!0,children:(0,q.jsx)(`button`,{...o,className:k(se(),`flex items-center gap-2 text-left`),"data-test":`color-picker-${e}`,disabled:i||r,type:`button`,children:s?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`size-4 shrink-0 rounded-full border border-lt-border`,style:{background:s}}),(0,q.jsx)(`span`,{className:`tabular-nums`,children:s})]}):(0,q.jsx)(`span`,{className:`text-lt-muted-fg`,children:t.placeholder??``})})}),(0,q.jsx)(Ph,{className:`p-3`,children:(0,q.jsx)(iv,{onChange:e=>a(e),palette:t.palette,value:s??`#6b7280`})})]})}})},sv=(0,B.lazy)(async()=>{let{DatePickerField:e}=await ge(async()=>{let{DatePickerField:e}=await import(`./date-picker-field-D_73rR_m.js`);return{DatePickerField:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url);return{default:e}});function cv(e){return(0,q.jsx)(B.Suspense,{fallback:null,children:(0,q.jsx)(sv,{...e})})}var lv=({node:e})=>{let t=e.props;return(0,q.jsx)(av,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,change:o,blur:s},c)=>(0,q.jsx)(cv,{controlProps:c,autoFocus:t.autoFocus??!1,disabled:a,label:t.label??t.name,max:t.max||void 0,min:t.min||void 0,mode:`date`,name:e,onBlur:s,onChange:o,readOnly:i,tabIndex:t.tabIndex??void 0,testId:n??t.name,value:r})})},uv=({node:e})=>{let t=e.props,{timezone:n}=z();return(0,q.jsx)(av,{node:e,label:t.label??``,children:({name:e,testId:r,value:i,readOnly:a,disabled:o,change:s,blur:c},l)=>(0,q.jsx)(cv,{controlProps:l,autoFocus:t.autoFocus??!1,disabled:o,label:t.label??t.name,max:t.max,min:t.min,mode:`date-time`,name:e,onBlur:c,onChange:s,readOnly:a,step:t.step,tabIndex:t.tabIndex??void 0,testId:r??t.name,timezone:n,value:i})})};function dv({url:e,method:t,body:n,headers:r,onProgress:i}){return new Promise((a,o)=>{let s=new XMLHttpRequest;s.open(t,e,!0),Object.entries(r).forEach(([e,t])=>s.setRequestHeader(e,String(t))),s.upload.onprogress=e=>{e.lengthComputable&&i?.(Math.round(e.loaded/e.total*100))},s.onload=()=>{try{a(new Response(s.responseText||null,{status:s.status||500}))}catch{o(Error(`Upload to ${e} returned an unusable response`))}},s.onerror=()=>o(Error(`Upload to ${e} failed`)),s.send(n)})}function fv(e,{ref:t,target:n,filename:r,contentType:i,values:a}){return Ec(e,{method:`POST`,ref:t,body:JSON.stringify({...a,_sub:`upload`,_target:n,filename:r,contentType:i}),throwOnError:!1})}var pv=E(k(`relative inline-flex shrink-0 items-center justify-center rounded-lt-sm transition-colors`,`outline-none focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50`,`disabled:pointer-events-none disabled:bg-lt-disabled disabled:text-lt-disabled-fg`),{variants:{emphasis:{ghost:k(`text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg`,`data-[state=open]:bg-lt-accent data-[state=open]:text-lt-accent-fg`,`aria-pressed:bg-lt-accent aria-pressed:text-lt-accent-fg`),segmented:k(`-ml-px rounded-l-none border border-lt-input text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg`,`data-[state=open]:z-10 data-[state=open]:border-lt-primary data-[state=open]:text-lt-fg`)},size:{xs:`size-5 [&_svg]:size-lt-icon-sm`,sm:`size-7 [&_svg]:size-lt-icon-md`,md:`size-lt-control-md [&_svg]:size-lt-icon-md`}},defaultVariants:{emphasis:`ghost`,size:`sm`}});function mv({icon:e,label:t,active:n,size:r,emphasis:i,className:a,children:o,ref:s,...c}){return(0,q.jsxs)(`button`,{ref:s,type:`button`,"aria-label":t,"aria-pressed":n,className:k(pv({emphasis:i,size:r}),a),...c,children:[e?(0,q.jsx)(M,{name:e,"aria-hidden":`true`}):null,o]})}function hv(e,t){return Array.isArray(t)?Array.isArray(e)&&e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}var gv=({node:e})=>{let{t}=P(`lattice`),n=e.props,{hidden:r,required:i,readOnly:a,disabled:o}=ag(e),{action:s,componentRef:c,errors:l}=Yf(),u=n.name,d=Cp(),f=d?d.scopedName(u):u,p=d?d.errorKey(u):u,m=p,h=Rp(),g=Vp(),_=(0,B.useId)(),v=(0,B.useRef)(null),y=(0,B.useRef)(new Set),b=a||o,x=n.signed,S=n.multiple,C=S?`${f}[]`:f,w=(0,B.useMemo)(()=>(n.files??[]).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,status:`ready`,progress:100,key:e.key,url:e.url,token:e.token,existing:!0})),[n.files]),[T,E]=(0,B.useState)(w),[D,O]=(0,B.useState)([]);(0,B.useEffect)(()=>{if(!x)return;let e=T.filter(e=>!e.existing&&e.key&&e.status===`ready`).map(e=>e.key),t=S?e:e[0]??``;if(d){hv(d.getValue(u),t)||d.setValue(u,t);return}g(u,t)},[T,S,u,d,g,x]),(0,B.useEffect)(()=>{!x||d||g(`${u}__removed`,D)},[u,D,d,g,x]),(0,B.useEffect)(()=>()=>{y.current.forEach(e=>URL.revokeObjectURL(e)),y.current.clear()},[]);let k=(0,B.useMemo)(()=>T.filter(e=>e.file&&!e.existing).map(e=>e.file),[T]);(0,B.useEffect)(()=>{if(x||!v.current)return;let e=new DataTransfer;k.forEach(t=>e.items.add(t)),v.current.files=e.files},[k,x]);function ee(e){if(!n.image)return;let t=URL.createObjectURL(e);return y.current.add(t),t}function A(e){!e.url||!y.current.has(e.url)||(URL.revokeObjectURL(e.url),y.current.delete(e.url))}async function j(e,t){let n=()=>{E(t=>t.map(t=>t.id===e.id?{...t,status:`error`}:t))},r=await fv(s,{ref:c,target:m,filename:t.name,contentType:t.type,values:h});if(!r.ok){n();return}let i=await r.json();try{let n=await dv({url:i.url,method:i.method.toUpperCase(),body:t,headers:i.headers,onProgress:t=>E(n=>n.map(n=>n.id===e.id?{...n,progress:t}:n))});E(t=>t.map(t=>t.id===e.id?{...t,status:n.ok?`ready`:`error`,key:i.key,progress:100}:t))}catch{n()}}function M(e){if(!e||b)return;let t=Array.from(e),n=t.map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,status:x?`uploading`:`ready`,progress:0,file:e,url:ee(e),existing:!1}));if(!S&&(T.forEach(A),!d)){let e=T.filter(e=>e.existing&&e.token).map(e=>e.token);e.length>0&&O(t=>[...t,...e])}E(e=>S?[...e,...n]:n),x&&n.forEach((e,n)=>void j(e,t[n]))}function N(e){let t=T.find(t=>t.id===e);t&&A(t),t?.existing&&t.token&&!d&&O(e=>[...e,t.token]),E(t=>t.filter(t=>t.id!==e))}return r?null:(0,q.jsx)(Gh,{error:l[p],helperText:n.helperText??void 0,tooltip:n.tooltip??void 0,labelAction:Kh(n.labelAction),label:n.label??``,id:_,required:i,children:e=>(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lt-sm border border-dashed border-lt-border bg-lt-surface px-4 py-6`,"data-test":$s(u),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),M(e.dataTransfer.files)},children:[(0,q.jsx)(`button`,{className:`text-sm text-lt-muted-fg`,disabled:b,onClick:()=>v.current?.click(),type:`button`,children:t(`form.file-upload.dropzone`,`Drop files here or click to browse`)}),(0,q.jsx)(`ul`,{className:n.image?`grid grid-cols-1 gap-3 sm:grid-cols-2`:`flex flex-col gap-2`,children:T.map(e=>(0,q.jsxs)(`li`,{className:n.image?`flex min-w-0 items-center gap-3 rounded-lt-sm border border-lt-border bg-lt-bg p-2 text-sm`:`flex items-center justify-between gap-3 text-sm`,children:[n.image&&e.url?(0,q.jsx)(`img`,{alt:e.name,className:`size-16 shrink-0 rounded-lt-sm border border-lt-border object-cover`,"data-test":$s(`${u}-preview`),src:e.url}):null,(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`span`,{className:`block truncate`,"data-test":$s(`${u}-item`),children:e.name}),e.status===`uploading`&&(0,q.jsxs)(`span`,{className:`text-xs text-lt-muted-fg`,children:[e.progress,`%`]}),e.status===`error`&&(0,q.jsx)(`span`,{className:`text-xs text-lt-danger`,children:t(`form.file-upload.failed`,`Failed`)})]}),(!e.existing||!d)&&(0,q.jsx)(mv,{size:`sm`,icon:`x`,label:t(`form.file-upload.remove`,`Remove {{name}}`,{name:e.name}),"data-test":$s(e.existing?`${u}-remove-existing`:`${u}-remove`),disabled:b,onClick:()=>N(e.id)}),x&&!e.existing&&e.key&&e.status===`ready`&&(0,q.jsx)(`input`,{"data-test":$s(`${u}-uploaded`),name:C,type:`hidden`,value:e.key})]},e.id))}),!d&&D.map(e=>(0,q.jsx)(`input`,{name:`${u}__removed[]`,type:`hidden`,value:e},e)),(0,q.jsx)(`input`,{...e,accept:n.accept??void 0,"aria-label":n.label??u,className:`sr-only`,"data-test":$s(`${u}-input`),multiple:S,name:x?void 0:C,onChange:e=>{M(e.target.files),x&&(e.target.value=``)},ref:v,type:`file`})]})})};function _v({label:e,summaryLabel:t,variant:n,emphasis:r}){let{componentId:i,errors:a,fieldLabels:o,processing:s}=Yf(),c=Object.entries(a).filter(([,e])=>!!e).map(([e,t])=>({label:o[e]??e,message:t})),l=c.length>0;return(0,q.jsxs)(`span`,{className:`group relative inline-flex flex-col`,children:[(0,q.jsxs)(ss,{"data-lattice-form":i,"data-test":`form-submit`,disabled:s||l,emphasis:r,type:`submit`,variant:n,children:[s&&(0,q.jsx)(Qs,{}),e]}),l&&(0,q.jsxs)(`div`,{className:`pointer-events-none absolute bottom-full left-1/2 z-lt-popover mb-2 w-max max-w-xs -translate-x-1/2 rounded-lt border border-lt-border bg-lt-surface p-3 text-left text-sm opacity-0 shadow-lt-md transition-opacity group-hover:opacity-100`,role:`tooltip`,children:[(0,q.jsx)(`p`,{className:`mb-1 font-medium text-lt-fg`,children:t}),(0,q.jsx)(`ul`,{className:`space-y-1`,children:c.map(e=>(0,q.jsxs)(`li`,{className:`text-lt-muted-fg`,children:[(0,q.jsx)(`span`,{className:`font-medium text-lt-fg`,children:e.label}),` — `,e.message]},e.label))})]})]})}var vv={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`};function yv({componentId:e,reset:t}){let n=Hp();return Ls(d.resetForm,r=>{let i=r.detail;(!i?.form||i.form===e)&&(t(),n())}),null}function bv({action:e,children:t,componentRef:n,nodes:r,shouldRenderSubmitButton:i,submitButtons:a,submitEmphasis:o,submitJustify:s,submitLabel:c,submitVariant:l,summaryLabel:u}){let{nodes:d,markUserEdit:f}=am(e,n,r),p=(0,B.useMemo)(()=>({markUserEdit:f}),[f]);return(0,q.jsx)(Zf,{value:p,children:(0,q.jsx)(Tp,{nodes:d,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[t,i&&(0,q.jsx)(`div`,{className:`flex gap-3 ${vv[s??`end`]}`,children:a?.length?a.map((e,t)=>e.props.buttonType===`submit`?(0,q.jsx)(_v,{emphasis:e.props.emphasis??o,label:e.props.label??c,summaryLabel:u,variant:e.props.variant??l},Vc(e,t)):(0,q.jsx)(Y,{node:e},Vc(e,t))):(0,q.jsx)(_v,{emphasis:o,label:c,summaryLabel:u,variant:l})})]})})})}function xv(e){return!e||Array.isArray(e)&&e.length===0?!1:Array.isArray(e)?e:void 0}var Sv=({children:e,node:t})=>{let n=(0,B.useMemo)(()=>({...om(t.schema).values,...t.props.state}),[t.schema,t.props.state]);return(0,q.jsx)(Ip,{initial:n,children:(0,q.jsx)(Cv,{node:t,children:e})})};function Cv({children:e,node:t}){let{t:n}=P(`lattice`),r=t.props,i=r.action??`#`,a=r.errorBag,o=r.ref??``,s=r.method??`post`,c=r.precognitive,l=r.resetOnError??!1,u=r.resetOnSuccess??[],d=(0,B.useMemo)(()=>om(t.schema).labels,[t.schema]),f=r.submitButton,p=r.submitButtons??void 0,m=r.submitJustify??void 0,h=r.submitLabel??n(`form.submit`,`Submit`),g=r.submitVariant??void 0,_=r.submitEmphasis??void 0,v=r.validationSummaryLabel,y=r.validationTimeout??void 0,b=Hp(),x=e=>{let t=xv(e);t!==!1&&b(t)},S=(0,B.useRef)(null),C=(0,B.useRef)(`idle`),[w,T]=(0,B.useState)(0);return(0,B.useEffect)(()=>{w>0&&C.current===`renewing`&&S.current?.submit()},[w]),(0,q.jsx)(Po,{ref:S,action:i,"data-slot":`form`,"data-lattice-component":t.id,errorBag:a,method:s,resetOnError:l,resetOnSuccess:u,validationTimeout:c?y:void 0,headers:hc(o),className:`flex w-full flex-col gap-6`,onStart:()=>{C.current=C.current===`renewing`?`retried`:`idle`},onSuccess:()=>x(u),onError:()=>x(l),onHttpException:e=>{if(e.status===403&&o!==``&&C.current!==`retried`)return C.current=`renewing`,Tc(o).finally(()=>T(e=>e+1)),!1},children:({clearErrors:n,errors:a,processing:s,reset:l,touch:u,validate:y,validating:b})=>(0,q.jsxs)(Jf,{value:{action:i,clearErrors:e=>n(e),componentId:t.id,componentRef:o,errors:a,fieldLabels:d,precognitive:c,processing:s,touch:e=>u(...e),validate:e=>y(e),validateFields:(e,t)=>y({only:e,...t}),validating:b},children:[(0,q.jsx)(yv,{componentId:t.id,reset:l}),r.status&&(0,q.jsx)(`div`,{className:`text-center text-sm font-medium text-lt-success`,children:r.status}),(0,q.jsx)(bv,{action:i,componentRef:o,nodes:t.schema,shouldRenderSubmitButton:f,submitButtons:p,submitEmphasis:_,submitJustify:m,submitLabel:h,submitVariant:g,summaryLabel:v,children:e})]})})}var wv=({node:e})=>{let t=Cp(),n=e.props.name,r=t?t.getValue(n):e.props.value;return(0,q.jsx)(`input`,{defaultValue:typeof r==`string`?r:``,name:t?t.scopedName(n):n,type:`hidden`})};function Tv({affix:e,side:t,squared:n=!1}){return(0,q.jsx)(`span`,{"data-slot":`affix-${t}`,className:k(`inline-flex h-lt-control-md shrink-0 items-center border border-lt-input bg-lt-muted px-3 text-base whitespace-nowrap text-lt-muted-fg`,`group-has-[:focus-visible]:border-lt-ring`,t===`start`?`rounded-l-lt-sm border-r-0`:`rounded-r-lt-sm border-l-0`,n&&`rounded-r-none border-r-0`),children:e.icon?(0,q.jsx)(rs,{className:`size-lt-icon-md`,icon:e.icon}):e.text})}function Ev({prefix:e,suffix:t,end:n,children:r}){return!e&&!t&&!n?r(``):(0,q.jsxs)(`div`,{className:`group flex w-full rounded-lt-sm transition-[color,box-shadow] has-[:focus-visible]:ring-[length:var(--lt-ring-width)] has-[:focus-visible]:ring-lt-ring/50`,"data-slot":`affix-group`,children:[e?(0,q.jsx)(Tv,{affix:e,side:`start`}):null,(0,q.jsx)(`div`,{className:`min-w-0 flex-1`,children:r(k(`focus-visible:ring-0`,e&&`rounded-l-none`,(t||n)&&`rounded-r-none`))}),t?(0,q.jsx)(Tv,{affix:t,side:`end`,squared:!!n}):null,n]})}var Dv=({node:e})=>{let t=e.props;return(0,q.jsx)(av,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>{let c=e=>o(e.target.value);return t.slider?(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(`input`,{...s,"aria-label":t.label??``,className:`h-2 w-full cursor-pointer appearance-none rounded-lt-sm bg-lt-muted accent-lt-primary disabled:cursor-not-allowed disabled:accent-lt-disabled`,"data-test":n,disabled:a||i,max:t.max??void 0,min:t.min??void 0,name:e,onChange:c,step:t.step??void 0,tabIndex:t.tabIndex??void 0,type:`range`,value:r}),(0,q.jsx)(`output`,{className:`w-10 shrink-0 text-right text-sm tabular-nums text-lt-fg`,children:r})]}):(0,q.jsx)(Ev,{prefix:t.prefix,suffix:t.suffix,children:o=>(0,q.jsx)(ce,{...s,autoFocus:t.autoFocus??!1,className:o,"data-test":n,disabled:a,max:t.max??void 0,min:t.min??void 0,name:e,onChange:c,placeholder:t.placeholder??``,readOnly:i,step:t.step??void 0,tabIndex:t.tabIndex??void 0,type:`number`,value:r})})}})},Ov=Object.defineProperty,kv=Object.defineProperties,Av=Object.getOwnPropertyDescriptors,jv=Object.getOwnPropertySymbols,Mv=Object.prototype.hasOwnProperty,Nv=Object.prototype.propertyIsEnumerable,Pv=(e,t,n)=>t in e?Ov(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fv=(e,t)=>{for(var n in t||={})Mv.call(t,n)&&Pv(e,n,t[n]);if(jv)for(var n of jv(t))Nv.call(t,n)&&Pv(e,n,t[n]);return e},Iv=(e,t)=>kv(e,Av(t)),Lv=(e,t)=>{var n={};for(var r in e)Mv.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jv)for(var r of jv(e))t.indexOf(r)<0&&Nv.call(e,r)&&(n[r]=e[r]);return n};function Rv(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}function zv(e){let t=B.useRef();return B.useEffect(()=>{t.current=e}),t.current}var Bv=18,Vv=40,Hv=`${Vv}px`,Uv=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function Wv({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[i,a]=B.useState(!1),[o,s]=B.useState(!1),[c,l]=B.useState(!1),u=B.useMemo(()=>n!==`none`&&(n===`increase-width`||n===`experimental-no-flickering`)&&i&&o,[i,o,n]),d=B.useCallback(()=>{let r=e.current,i=t.current;if(!r||!i||c||n===`none`)return;let o=r,s=o.getBoundingClientRect().left+o.offsetWidth,u=o.getBoundingClientRect().top+o.offsetHeight/2,d=s-Bv,f=u;document.querySelectorAll(Uv).length===0&&document.elementFromPoint(d,f)===r||(a(!0),l(!0))},[e,t,c,n]);return B.useEffect(()=>{let t=e.current;if(!t||n===`none`)return;function r(){let e=window.innerWidth-t.getBoundingClientRect().right;s(e>=Vv)}r();let i=setInterval(r,1e3);return()=>{clearInterval(i)}},[e,n]),B.useEffect(()=>{let e=r||document.activeElement===t.current;if(n===`none`||!e)return;let i=setTimeout(d,0),a=setTimeout(d,2e3),o=setTimeout(d,5e3),s=setTimeout(()=>{l(!0)},6e3);return()=>{clearTimeout(i),clearTimeout(a),clearTimeout(o),clearTimeout(s)}},[t,r,n,d]),{hasPWMBadge:i,willPushPWMBadge:u,PWM_BADGE_SPACE_WIDTH:Hv}}var Gv=B.createContext({}),Kv=B.forwardRef((e,t)=>{var n=e,{value:r,onChange:i,maxLength:a,textAlign:o=`left`,pattern:s,placeholder:c,inputMode:l=`numeric`,onComplete:u,pushPasswordManagerStrategy:d=`increase-width`,pasteTransformer:f,containerClassName:p,noScriptCSSFallback:m=Jv,render:h,children:g}=n,_=Lv(n,[`value`,`onChange`,`maxLength`,`textAlign`,`pattern`,`placeholder`,`inputMode`,`onComplete`,`pushPasswordManagerStrategy`,`pasteTransformer`,`containerClassName`,`noScriptCSSFallback`,`render`,`children`]),v;let[y,b]=B.useState(typeof _.defaultValue==`string`?_.defaultValue:``),x=r??y,S=zv(x),C=B.useCallback(e=>{i?.(e),b(e)},[i]),w=B.useMemo(()=>s?typeof s==`string`?new RegExp(s):s:null,[s]),T=B.useRef(null),E=B.useRef(null),D=B.useRef({value:x,onChange:C,isIOS:typeof window<`u`&&((v=window==null?void 0:window.CSS)?.supports)?.call(v,`-webkit-touch-callout`,`none`)}),O=B.useRef({prev:[T.current?.selectionStart,T.current?.selectionEnd,T.current?.selectionDirection]});B.useImperativeHandle(t,()=>T.current,[]),B.useEffect(()=>{let e=T.current,t=E.current;if(!e||!t)return;D.current.value!==e.value&&D.current.onChange(e.value),O.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection];function n(){if(document.activeElement!==e){N(null),F(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=O.current.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let e=t===n,r=t===a.length&&a.length<i;if(e&&!r){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&T.current.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;N(u),F(d),O.current.prev=[u,d,f]}if(document.addEventListener(`selectionchange`,n,{capture:!0}),n(),document.activeElement===e&&j(!0),!document.getElementById(`input-otp-style`)){let e=document.createElement(`style`);if(e.id=`input-otp-style`,document.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;qv(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),qv(e.sheet,`[data-input-otp]:autofill { ${t} }`),qv(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),qv(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),qv(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let r=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};r();let i=new ResizeObserver(r);return i.observe(e),()=>{document.removeEventListener(`selectionchange`,n,{capture:!0}),i.disconnect()}},[]);let[k,ee]=B.useState(!1),[A,j]=B.useState(!1),[M,N]=B.useState(null),[P,F]=B.useState(null);B.useEffect(()=>{Rv(()=>{var e;(e=T.current)==null||e.dispatchEvent(new Event(`input`));let t=T.current?.selectionStart,n=T.current?.selectionEnd,r=T.current?.selectionDirection;t!==null&&n!==null&&(N(t),F(n),O.current.prev=[t,n,r])})},[x,A]),B.useEffect(()=>{S!==void 0&&x!==S&&S.length<a&&x.length===a&&u?.(x)},[a,u,S,x]);let I=Wv({containerRef:E,inputRef:T,pushPasswordManagerStrategy:d,isFocused:A}),te=B.useCallback(e=>{let t=e.currentTarget.value.slice(0,a);if(t.length>0&&w&&!w.test(t)){e.preventDefault();return}typeof S==`string`&&t.length<S.length&&document.dispatchEvent(new Event(`selectionchange`)),C(t)},[a,C,S,w]),ne=B.useCallback(()=>{var e;if(T.current){let t=Math.min(T.current.value.length,a-1),n=T.current.value.length;(e=T.current)==null||e.setSelectionRange(t,n),N(t),F(n)}j(!0)},[a]),re=B.useCallback(e=>{let t=T.current;if(!f&&(!D.current.isIOS||!e.clipboardData||!t))return;let n=e.clipboardData.getData(`text/plain`),r=f?f(n):n;e.preventDefault();let i=T.current?.selectionStart,o=T.current?.selectionEnd,s=(i===o?x.slice(0,i)+r+x.slice(i):x.slice(0,i)+r+x.slice(o)).slice(0,a);if(s.length>0&&w&&!w.test(s))return;t.value=s,C(s);let c=Math.min(s.length,a-1),l=s.length;t.setSelectionRange(c,l),N(c),F(l)},[a,C,w,x]),L=B.useMemo(()=>({position:`relative`,cursor:_.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`}),[_.disabled]),R=B.useMemo(()=>({position:`absolute`,inset:0,width:I.willPushPWMBadge?`calc(100% + ${I.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:I.willPushPWMBadge?`inset(0 ${I.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:o,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`}),[I.PWM_BADGE_SPACE_WIDTH,I.willPushPWMBadge,o]),ie=B.useMemo(()=>B.createElement(`input`,Iv(Fv({autoComplete:_.autoComplete||`one-time-code`},_),{"data-input-otp":!0,"data-input-otp-placeholder-shown":x.length===0||void 0,"data-input-otp-mss":M,"data-input-otp-mse":P,inputMode:l,pattern:w?.source,"aria-placeholder":c,style:R,maxLength:a,value:x,ref:T,onPaste:e=>{var t;re(e),(t=_.onPaste)==null||t.call(_,e)},onChange:te,onMouseOver:e=>{var t;ee(!0),(t=_.onMouseOver)==null||t.call(_,e)},onMouseLeave:e=>{var t;ee(!1),(t=_.onMouseLeave)==null||t.call(_,e)},onFocus:e=>{var t;ne(),(t=_.onFocus)==null||t.call(_,e)},onBlur:e=>{var t;j(!1),(t=_.onBlur)==null||t.call(_,e)}})),[te,ne,re,l,R,a,P,M,_,w?.source,x]),z=B.useMemo(()=>({slots:Array.from({length:a}).map((e,t)=>{let n=A&&M!==null&&P!==null&&(M===P&&t===M||t>=M&&t<P),r=x[t]===void 0?null:x[t];return{char:r,placeholderChar:x[0]===void 0?c?.[t]??null:null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:A,isHovering:!_.disabled&&k}),[A,k,a,P,M,_.disabled,x]),ae=B.useMemo(()=>h?h(z):B.createElement(Gv.Provider,{value:z},g),[g,z,h]);return B.createElement(B.Fragment,null,m!==null&&B.createElement(`noscript`,null,B.createElement(`style`,null,m)),B.createElement(`div`,{ref:E,"data-input-otp-container":!0,style:L,className:p},ae,B.createElement(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`}},ie)))});Kv.displayName=`Input`;function qv(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}var Jv=`
|
|
139
|
+
[data-input-otp] {
|
|
140
|
+
--nojs-bg: white !important;
|
|
141
|
+
--nojs-fg: black !important;
|
|
142
|
+
|
|
143
|
+
background-color: var(--nojs-bg) !important;
|
|
144
|
+
color: var(--nojs-fg) !important;
|
|
145
|
+
caret-color: var(--nojs-fg) !important;
|
|
146
|
+
letter-spacing: .25em !important;
|
|
147
|
+
text-align: center !important;
|
|
148
|
+
border: 1px solid var(--nojs-fg) !important;
|
|
149
|
+
border-radius: 4px !important;
|
|
150
|
+
width: 100% !important;
|
|
151
|
+
}
|
|
152
|
+
@media (prefers-color-scheme: dark) {
|
|
153
|
+
[data-input-otp] {
|
|
154
|
+
--nojs-bg: black !important;
|
|
155
|
+
--nojs-fg: white !important;
|
|
156
|
+
}
|
|
157
|
+
}`,Yv=`^\\d+$`;function Xv({char:e,hasFakeCaret:t,isActive:n}){return(0,q.jsxs)(`div`,{className:k(`relative flex h-lt-control-md w-10 items-center justify-center border-y border-r border-lt-input text-base shadow-lt-xs transition-all first:rounded-l-lt-sm first:border-l last:rounded-r-lt-sm`,n&&`z-10 border-lt-ring ring-lt-ring/50 ring-[length:var(--lt-ring-width)]`),children:[e,t?(0,q.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,q.jsx)(`div`,{className:`bg-lt-fg h-5 w-px animate-pulse`})}):null]})}function Zv({length:e,containerClassName:t,pattern:n=Yv,...r}){return(0,q.jsx)(Kv,{maxLength:e,pattern:n,containerClassName:k(`flex items-center gap-2 has-[:disabled]:opacity-50`,t),render:({slots:e})=>(0,q.jsx)(`div`,{className:`flex items-center`,children:e.map((e,t)=>(0,q.jsx)(Xv,{...e},t))}),...r})}var Qv=({node:e})=>{let t=e.props;return(0,q.jsx)(av,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>(0,q.jsx)(Zv,{...s,autoFocus:t.autoFocus??!1,"data-test":n,disabled:a||i,length:t.length,name:e,onChange:e=>o(e),value:r})})};function $v({className:e,ref:t,...n}){let[r,i]=(0,B.useState)(!1);return(0,q.jsxs)(`div`,{className:`relative`,children:[(0,q.jsx)(ce,{type:r?`text`:`password`,className:k(`pr-10`,e),ref:t,...n}),(0,q.jsx)(`button`,{type:`button`,"data-test":typeof n.name==`string`?`${n.name}-visibility`:`password-visibility`,onClick:()=>i(e=>!e),className:`absolute inset-y-0 right-0 flex items-center rounded-r-lt-sm px-3 text-lt-muted-fg hover:text-lt-fg focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 focus-visible:outline-none`,"aria-label":r?`Hide password`:`Show password`,tabIndex:-1,children:r?(0,q.jsx)(M,{name:`eye-off`,className:`size-lt-icon-md`}):(0,q.jsx)(M,{name:`eye`,className:`size-lt-icon-md`})})]})}var ey=({node:e})=>{let t=e.props,{errors:n}=Yf(),r=x_(e),{commit:i}=Gp(),a=Cp(),o=t.confirmation,s=o?.name??`${r.localName}_confirmation`,c=a?a.scopedName(s):s,l=a?a.errorKey(s):s,u=(t.passwordRules??``)||void 0;return r.hidden?null:(0,q.jsxs)(`div`,{className:`grid gap-6`,children:[(0,q.jsx)(Gh,{error:r.error,helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,label:t.label??``,labelAction:Kh(t.labelAction),id:r.name,required:r.required,children:e=>(0,q.jsx)(Ev,{prefix:t.prefix,suffix:t.suffix,children:n=>(0,q.jsx)($v,{...e,autoComplete:t.autoComplete??``,autoFocus:t.autoFocus??!1,className:n,"data-test":r.testId,disabled:r.disabled,name:r.name,onChange:e=>{r.commit(e.target.value)},placeholder:t.placeholder??``,passwordrules:u,readOnly:r.readOnly,tabIndex:t.tabIndex??void 0,value:r.value})})}),o&&(0,q.jsx)(Gh,{error:n[l],label:o.label??`Confirm password`,id:c,required:r.required,children:e=>(0,q.jsx)($v,{...e,autoComplete:`new-password`,"data-test":$s(s),disabled:r.disabled,name:c,onChange:e=>{i(s,e.target.value)},placeholder:o.placeholder??o.label??`Confirm password`,passwordrules:u,readOnly:r.readOnly,tabIndex:t.tabIndex??void 0})})]})},ty=[],ny=({node:e})=>{let t=e.props,n=t.name,{errors:r}=Yf(),{hidden:i,required:a}=ag(e),{path:o,rows:s,onField:c,onRemove:l,onMove:u,onDuplicate:d,append:f}=Gg(n,t.defaultItems??1),p=e.schema??ty,m=Wg(s.map(e=>String(e.rowId??``)).join(`,`)),h=t.maxItems!=null&&s.length>=t.maxItems,g=t.minItems!=null&&s.length<=t.minItems,_=t.layout===`table`,v=t.itemLabels,y=e=>{let n=v?.[e];return typeof n==`string`&&n!==``?n:t.itemLabel?`${t.itemLabel} ${e+1}`:`#${e+1}`};if(i)return null;let b=s.map((e,t)=>({key:String(e.rowId??t),index:t,row:e,template:p,span:!1,heading:y(t)}));return(0,q.jsx)(Gh,{error:r[o],helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,labelAction:Kh(t.labelAction),label:t.label??``,id:o,required:a,children:e=>(0,q.jsxs)(`div`,{...e,className:`flex flex-col gap-3`,role:`group`,children:[(0,q.jsx)(pg,{path:o,rows:s,rowKey:up}),_?(0,q.jsx)(Vg,{base:o,columns:zg(p),rows:b,reorderable:t.reorderable??!1,removable:()=>!g,rowActions:t.rowActions,onField:c,onMove:u,onRemove:l,onDuplicate:d,registerRow:m,resizableColumns:t.resizableColumns===!0,resizeIndicator:t.resizeIndicator===!0}):s.map((e,n)=>{let r=String(e.rowId??n);return(0,q.jsx)(`div`,{ref:e=>m(r,e),"data-flip-key":r,children:(0,q.jsx)(hg,{base:o,index:n,row:e,template:p,heading:y(n),reorderable:t.reorderable??!1,isFirst:n===0,isLast:n===s.length-1,removable:!g,rowActions:t.rowActions,onField:c,onRemove:l,onMove:u,onDuplicate:d})},r)}),!h&&(0,q.jsxs)(`button`,{type:`button`,"data-test":`repeater-${n}-add`,className:`inline-flex items-center gap-1.5 self-start rounded-lt-sm border border-lt-border px-3 py-1.5 text-sm hover:bg-lt-accent [&_svg]:size-lt-icon-sm`,onClick:()=>f({}),children:[(0,q.jsx)(M,{name:`plus`}),t.addLabel??`Add`]})]})})},ry=250;function iy({contentClassName:e,creatable:t=!1,emptyLabel:n,loading:r=!1,multiple:i=!1,onCommit:a,onCreate:o,onSearch:s,onSelect:c,open:l,onOpenChange:u,options:d,renderOption:f,searchLabel:p,searchPlaceholder:m,selected:h,showSearch:g=!0,testId:_,trigger:v,triggerClassName:y,triggerProps:b}){let{t:x}=P(`lattice`),[S,C]=(0,B.useState)(``),w=(0,B.useRef)(null),[T,E]=(0,B.useState)(!1);(0,B.useLayoutEffect)(()=>{E(!!w.current?.closest(`[role="dialog"]`))},[]);function D(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);for(let e of t){let t=d.find(t=>t.label.toLowerCase()===e.toLowerCase());t?(a??c)(t.value):o?.(e)}i?C(``):j()}let O=d.some(e=>e.label.toLowerCase()===S.trim().toLowerCase()),ee=lm(e=>s?.(e),ry);(0,B.useEffect)(()=>{if(!(!s||!l))return ee(S),()=>ee.cancel()},[S,s,l,ee]);let A=s?d:d.filter(e=>e.label.toLowerCase().includes(S.toLowerCase()));function j(){C(``),u(!1)}function N(e){c(e),i||j()}return(0,q.jsxs)(jh,{modal:T,open:l,onOpenChange:e=>e?u(!0):j(),children:[(0,q.jsx)(Mh,{asChild:!0,children:(0,q.jsx)(`button`,{type:`button`,className:y,ref:w,...b,children:v})}),(0,q.jsxs)(Ph,{align:`start`,className:k(`w-[var(--radix-popover-trigger-width)] overflow-hidden p-0`,e),children:[g&&(0,q.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-lt-border px-3 py-2`,children:[(0,q.jsx)(`input`,{"aria-label":p??x(`form.search-options`,`Search options`),"data-slot":`combobox-search`,"data-test":_?`${_}-search`:void 0,className:`w-full bg-transparent text-sm outline-none placeholder:text-lt-muted-fg`,onChange:e=>{let n=e.target.value;if(t&&n.includes(`,`)){D(n);return}C(n)},onKeyDown:e=>{t&&e.key===`Enter`&&S.trim()!==``&&(e.preventDefault(),D(S))},placeholder:m,value:S}),r&&(0,q.jsx)(M,{name:`loader-2`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0 animate-spin text-lt-muted-fg`})]}),(0,q.jsxs)(`div`,{className:`max-h-60 overflow-y-auto p-1`,role:`listbox`,children:[t&&S.trim()!==``&&!O&&(0,q.jsxs)(`button`,{className:`flex w-full items-center gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm transition-colors hover:bg-lt-accent hover:text-lt-accent-fg`,"data-test":_?`${_}-create`:void 0,onClick:()=>D(S),type:`button`,children:[(0,q.jsx)(M,{name:`plus`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0`}),x(`form.create-option`,`Create "{{label}}"`,{label:S.trim()})]}),A.length===0&&!(t&&S.trim()!==``&&!O)?(0,q.jsx)(`p`,{className:`px-3 py-2 text-sm text-lt-muted-fg`,children:n}):A.map(e=>{let t=h.includes(e.value);return(0,q.jsxs)(`button`,{"aria-label":f?e.label:void 0,"aria-selected":t,className:k(`flex w-full items-center justify-between gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm transition-colors hover:bg-lt-accent hover:text-lt-accent-fg`,t&&`bg-lt-accent/60`),"data-slot":`combobox-option`,"data-test":_?`${_}-option-${e.value}`:void 0,"data-value":e.value,onClick:()=>N(e.value),role:`option`,type:`button`,children:[f?(0,q.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:f(e)}):e.label,t&&(0,q.jsx)(M,{name:`check`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0`})]},e.value)})]})]})]})}function ay(e,t){let n=e??t;return Array.isArray(n)?n.map(String):n==null||n===``?[]:[String(n)]}var oy=({node:e})=>{let{t}=P(`lattice`),n=e.props,{action:r,componentRef:a,errors:o,fieldIdPrefix:s,searchOptions:c}=Yf(),{hidden:l,required:u,readOnly:d,disabled:f}=ag(e),{change:p,blur:m}=Gp(),h=Ep(e),g=n.name,_=Cp(),v=p_(_?_.scopedName(g):g,s),y=_?_.errorKey(g):g,b=y,x=n.placeholder||`Select…`,S=n.multiple,C=n.searchable,w=n.creatable,T=(0,B.useMemo)(()=>h.props.options,[h.props]),E=h.props.optionSchema,D=zp(g),O=Rp(),ee=(0,B.useRef)(O);ee.current=O;let A=_?_.getValue(g):D,j=(0,B.useMemo)(()=>ay(A,n.value),[A,n.value]),N=(0,B.useRef)(j);N.current=j;let[F,I]=(0,B.useState)(!1),[te,ne]=(0,B.useState)(null),[re,L]=(0,B.useState)(!1),R=(0,B.useRef)(null),ie=(0,B.useMemo)(()=>{let e=new Map;for(let t of[...T,...te??[]])e.set(t.value,t);return e},[T,te]),z=e=>ie.get(e)?.label??e,ae=e=>fe(ie.get(e)?.data?.color),oe=d||f,ce=(0,B.useCallback)(e=>{if(R.current?.abort(),e.trim()===``){ne(null),L(!1);return}let t=new AbortController;if(R.current=t,L(!0),c){c(b,e,ee.current,t.signal).then(e=>{ne(e),L(!1)}).catch(()=>{});return}Xp(r,a,{...ee.current,_sub:`search`,_target:b,_q:e},t.signal).then(e=>{ne(e?.options??[]),L(!1)}).catch(()=>{})},[r,a,b,c]);function le(e){p(g,S?e:e[0]??``)}function de(e){if(S){let t=N.current.includes(e)?N.current.filter(t=>t!==e):[...N.current,e];N.current=t,le(t);return}N.current=[e],le([e])}function pe(e){le(j.filter(t=>t!==e))}function me(e){if(!S){N.current=[e],le([e]);return}if(!N.current.includes(e)){let t=[...N.current,e];N.current=t,le(t)}}if(l)return null;let he=C?te??T:T,ge=E?.length?e=>(0,q.jsx)(Xc,{nodes:i(E,{...e.data,label:e.label,value:e.value})}):void 0;return(0,q.jsx)(Gh,{error:o[y],helperText:n.helperText??void 0,tooltip:n.tooltip??void 0,labelAction:Kh(n.labelAction),label:n.label??``,id:v,required:u,children:e=>(0,q.jsxs)(q.Fragment,{children:[S?j.map(e=>(0,q.jsx)(`input`,{name:`${v}[]`,type:`hidden`,value:e},e)):(0,q.jsx)(`input`,{name:v,type:`hidden`,value:j[0]??``}),(0,q.jsxs)(`div`,{children:[S&&j.length>0&&(0,q.jsx)(`div`,{className:`mb-1.5 flex flex-wrap gap-1`,children:j.map(e=>{let n=ae(e);return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-lt-sm bg-lt-muted px-2 py-0.5 text-xs`,children:[n&&(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full`,style:{background:ue(n)}}),z(e),!oe&&(0,q.jsx)(`button`,{"aria-label":t(`form.remove-option`,`Remove {{label}}`,{label:z(e)}),"data-test":`select-${g}-remove-${e}`,className:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-xs`,onClick:()=>pe(e),type:`button`,children:(0,q.jsx)(M,{name:`x`})})]},e)})}),(0,q.jsx)(iy,{creatable:w,emptyLabel:n.emptyLabel??void 0,loading:re,multiple:S,onCommit:me,onCreate:me,onSearch:C?ce:void 0,onSelect:de,open:F&&!oe,onOpenChange:e=>{I(e),e||m(g)},options:he,renderOption:ge,searchPlaceholder:n.searchPlaceholder??void 0,showSearch:!!(C||w),selected:j,testId:`select-${g}`,trigger:(0,q.jsxs)(q.Fragment,{children:[!S&&j.length>0?(0,q.jsx)(`span`,{children:z(j[0])}):(0,q.jsx)(`span`,{className:`text-lt-muted-fg`,children:x}),(0,q.jsx)(M,{name:`chevrons-up-down`,className:`size-lt-icon-md shrink-0 text-lt-muted-fg`})]}),triggerClassName:k(se(),`flex items-center justify-between gap-2 text-left`,oe&&`cursor-not-allowed opacity-60`),triggerProps:{...e,"aria-haspopup":`listbox`,autoFocus:n.autoFocus??void 0,"data-test":`select-${g}`,disabled:oe,tabIndex:n.tabIndex??void 0}})]})]})})};function sy({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:k(`border-lt-input placeholder:text-lt-muted-fg flex field-sizing-content min-h-16 w-full rounded-lt-sm border bg-transparent px-3 py-2 text-base shadow-lt-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-lt-disabled disabled:text-lt-disabled-fg`,oe,`aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger`,e),...t})}var cy=({node:e})=>{let t=e.props;return(0,q.jsx)(av,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>(0,q.jsx)(sy,{...s,autoFocus:t.autoFocus??!1,"data-test":n,disabled:a,name:e,onChange:e=>o(e.target.value),placeholder:t.placeholder??``,readOnly:i,rows:t.rows??void 0,tabIndex:t.tabIndex??void 0,value:r})})};async function ly(e){if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function uy({value:e,label:t,testId:n,className:r,iconOnly:i=!1,children:a}){let{t:o}=P(I),[s,c]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(!s)return;let e=window.setTimeout(()=>c(!1),1500);return()=>window.clearTimeout(e)},[s]);async function l(){await ly(e)&&c(!0)}let u=s?o(`common.copied-value`,`Copied {{label}}`,{label:t}):o(`common.copy-value`,`Copy {{label}}`,{label:t});return i?(0,q.jsx)(mv,{icon:s?`check`:`copy`,label:u,"data-test":n,className:r,onClick:()=>void l()}):(0,q.jsx)(ss,{type:`button`,size:`sm`,emphasis:`outline`,icon:s?`check`:`copy`,"data-test":n,className:r,"aria-label":u,onClick:()=>void l(),children:s?o(`common.copied`,`Copied`):a??o(`common.copy`,`Copy`)})}function dy({value:e,label:t,testId:n,children:r}){return(0,q.jsxs)(`div`,{className:`inline-flex items-center gap-2`,children:[r??e,(0,q.jsx)(uy,{value:e,label:t,testId:n})]})}var fy=({node:e})=>{let t=e.props;return(0,q.jsx)(av,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>(0,q.jsx)(Ev,{prefix:t.prefix,suffix:t.suffix,end:t.copyable?(0,q.jsx)(uy,{className:`h-lt-control-md gap-1.5 rounded-l-none rounded-r-lt-sm border-l-0 border-lt-input px-3 group-has-[:focus-visible]:border-lt-ring`,label:t.label??e,testId:`${n}-copy`,value:r}):null,children:c=>(0,q.jsx)(ce,{...s,autoComplete:t.autoComplete??``,autoFocus:t.autoFocus??!1,className:c,"data-test":n,disabled:a,name:e,onChange:e=>o(e.target.value),placeholder:t.placeholder??``,readOnly:i,tabIndex:t.tabIndex??void 0,type:t.type??`text`,value:r})})})},py=/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/;function my(e){if(typeof e!=`string`)return null;let t=py.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=t[3]?Number(t[3]):0;return n>23||r>59||i>59?null:{hour:n,minute:r,second:i}}function hy(e,t){let n=[Sy(e.hour),Sy(e.minute)];return t&&n.push(Sy(e.second)),n.join(`:`)}function gy(e){return e!=null&&e<60}function _y(e,t={}){let{min:n,max:r,current:i}=t,a=yy(n),o=yy(r),s=e==null||e<60?1:e%60==0?e/60:1;return{hours:xy(0,23,1).map(e=>({value:e,label:Sy(e),disabled:a!=null&&e<a.hour||o!=null&&e>o.hour})),minutes:by(xy(0,59,s),i?.minute).map(e=>({value:e,label:Sy(e),disabled:vy(e,i,a,o)})),seconds:gy(e)?xy(0,59,1).map(e=>({value:e,label:Sy(e),disabled:!1})):null}}function vy(e,t,n,r){return t?n!=null&&t.hour===n.hour&&e<n.minute||r!=null&&t.hour===r.hour&&e>r.minute:!1}function yy(e){let t=my(e);return t?{hour:t.hour,minute:t.minute}:null}function by(e,t){return t==null||e.includes(t)?e:[...e,t].sort((e,t)=>e-t)}function xy(e,t,n){let r=[];for(let i=e;i<=t;i+=n)r.push(i);return r}function Sy(e){return String(e).padStart(2,`0`)}function Cy({value:e,onChange:t,step:n,min:r,max:i,disabled:a=!1,readOnly:o=!1,labels:s,testId:c}){let l=(0,B.useRef)(null),u=_y(n,{min:r,max:i,current:e}),d=e??{hour:0,minute:0,second:0},f=!a&&!o,p=[{key:`hour`,label:s?.hour??`Hour`,options:u.hours,selected:d.hour},{key:`minute`,label:s?.minute??`Minute`,options:u.minutes,selected:d.minute},...u.seconds?[{key:`second`,label:s?.second??`Second`,options:u.seconds,selected:d.second}]:[]];function m(e){let t=l.current?.querySelectorAll(`[role="listbox"]`)?.[e];t&&(t.querySelector(`[data-active="true"]`)??t.querySelector(`[role="option"]`))?.focus()}return(0,q.jsx)(`div`,{ref:l,className:`flex gap-1`,"data-test":c,children:p.map((n,r)=>(0,q.jsx)(wy,{label:n.label,options:n.options,selected:e?n.selected:null,disabled:!f,onSelect:e=>f&&t({...d,[n.key]:e}),onHorizontal:e=>m(r+e)},n.key))})}function wy({label:e,options:t,selected:n,disabled:r,onSelect:i,onHorizontal:a}){let o=(0,B.useRef)(null),s=t.filter(e=>!e.disabled).map(e=>e.value),c=n??s[0]??t[0]?.value??0;(0,B.useEffect)(()=>{(o.current?.querySelector(`[data-active="true"]`))?.scrollIntoView?.({block:`nearest`})},[n]);function l(e){e!=null&&(o.current?.querySelector(`[data-value="${e}"]`)?.focus(),i(e))}function u(e){if(r)return;let t=s.indexOf(c);switch(e.key){case`ArrowDown`:e.preventDefault(),l(s[Math.min(t+1,s.length-1)]);break;case`ArrowUp`:e.preventDefault(),l(s[Math.max(t-1,0)]);break;case`Home`:e.preventDefault(),l(s[0]);break;case`End`:e.preventDefault(),l(s[s.length-1]);break;case`ArrowRight`:e.preventDefault(),a(1);break;case`ArrowLeft`:e.preventDefault(),a(-1)}}return(0,q.jsx)(`div`,{ref:o,role:`listbox`,"aria-label":e,"aria-orientation":`vertical`,tabIndex:-1,className:`flex max-h-40 w-14 flex-col overflow-y-auto`,onKeyDown:u,children:t.map(t=>{let a=n===t.value;return(0,q.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":a,"aria-label":`${e} ${t.label}`,"data-value":t.value,"data-active":c===t.value,disabled:r||t.disabled,tabIndex:c===t.value?0:-1,onClick:()=>i(t.value),className:k(`shrink-0 rounded-lt-sm px-2 py-1 text-sm text-lt-fg hover:bg-lt-muted`,a&&`bg-lt-primary text-lt-primary-fg`,(r||t.disabled)&&`cursor-not-allowed opacity-40`),children:t.label},t.value)})})}var Ty=({node:e})=>{let t=e.props,n=gy(t.step),r=t.label??t.name;return(0,q.jsx)(av,{node:e,label:t.label??``,children:({name:e,testId:i,value:a,readOnly:o,disabled:s,commit:c,blur:l},u)=>(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(ce,{...u,"aria-label":r,autoFocus:t.autoFocus??!1,"data-test":i,disabled:s,name:e,onBlur:()=>{let e=my(a);e&&c(hy(e,n)),l()},onChange:e=>c(e.target.value),readOnly:o,tabIndex:t.tabIndex??void 0,type:`text`,value:a}),(0,q.jsxs)(jh,{children:[(0,q.jsx)(Mh,{asChild:!0,children:(0,q.jsx)(ss,{"aria-label":`Open ${r} time picker`,disabled:s||o,size:`icon`,type:`button`,variant:`secondary`,children:(0,q.jsx)(M,{name:`clock`,className:`size-lt-icon-md`,"aria-hidden":`true`})})}),(0,q.jsx)(Ph,{className:`p-2`,children:(0,q.jsx)(Cy,{value:my(a),onChange:e=>c(hy(e,n)),step:t.step,min:t.min,max:t.max,disabled:s,readOnly:o,testId:`${i}-picker`})})]})]})})},Ey=({node:e})=>{let{hidden:t,required:n,readOnly:r,disabled:i}=ag(e),a=e.props,o=a.name,s=Cp(),{errors:c,fieldIdPrefix:l}=Yf(),u=p_(s?s.scopedName(o):o,l),d=s?s.errorKey(o):o,f=zp(o),p=s?s.getValue(o):f,m=Yh(a.value),h=p===void 0?m:Yh(p),g=r||i,{commit:_}=Gp();return m_(o,m),t?null:(0,q.jsx)(Gh,{error:c[d],helperText:a.helperText??void 0,tooltip:a.tooltip??void 0,labelAction:Kh(a.labelAction),label:a.label??``,id:u,required:n,children:e=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`input`,{disabled:g,name:u,type:`hidden`,value:h?`1`:`0`}),(0,q.jsx)(`button`,{...e,"aria-checked":h,"aria-label":a.label??o,autoFocus:a.autoFocus??!1,className:k(`inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-lt-muted p-0.5 shadow-lt-xs transition-colors outline-none focus-visible:border-lt-ring focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 disabled:cursor-not-allowed disabled:bg-lt-disabled data-[state=checked]:bg-lt-primary disabled:data-[state=checked]:bg-lt-disabled`),"data-state":h?`checked`:`unchecked`,"data-test":$s(o),disabled:g,name:u,onClick:()=>_(o,!h),role:`switch`,tabIndex:a.tabIndex??void 0,type:`button`,children:(0,q.jsx)(`span`,{className:`size-5 rounded-full bg-lt-bg shadow-lt-sm transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`,"data-state":h?`checked`:`unchecked`})})]})})};function Dy(e){let t=[],n=e=>{let r=np(e).name;if(r&&t.push(r),!(r&&ep(e)))for(let t of e.schema??[])n(t)};for(let t of e.schema??[])n(t);return t}function Oy(e){let t=[],n=e=>{let r=np(e).name;if(r&&t.push(r,`${r}.*`),r&&ep(e)){for(let n of Dy(e))t.push(`${r}.*.${n}`);return}for(let t of e.schema??[])n(t)};for(let t of e.schema??[])n(t);return t}function ky(e,t){let n=Object.keys(t).filter(e=>!!t[e]),r=new Set;return e.forEach((e,t)=>{n.some(t=>e.some(e=>sm(t,e)))&&r.add(t)}),r}function Ay(e,t){let n=ky(e,t);return n.size>0?Math.min(...n):null}var jy={center:`justify-center`,left:`justify-start`,start:`justify-start`,stretch:`justify-stretch`},My=(0,B.createContext)({activeName:``});function Ny(e){let t=(e.schema??[]).filter(e=>e.type===`wizard-step`);return{items:t.map(e=>e.props),nodes:t}}var Py=({children:e,node:t})=>{let{t:n}=P(`lattice`),{errors:r,processing:i,touch:a,validateFields:o,validating:s}=Yf(),{items:c,nodes:l}=(0,B.useMemo)(()=>Ny(t),[t]),u=(0,B.useMemo)(()=>l.map(e=>Dy(e)),[l]),d=t.props.orientation===`vertical`,[f,p]=(0,B.useState)(0),[m,h]=(0,B.useState)(()=>new Set([0])),[g,_]=(0,B.useState)(()=>new Set),v=(0,B.useMemo)(()=>ky(u,r),[u,r]),y=f===c.length-1,b=e=>{p(e),h(t=>new Set(t).add(e))},x=()=>{_(e=>new Set(e).add(f)),y||b(f+1)},S=()=>{let e=l[f],t=e?Oy(e):[];if(t.length===0){x();return}a(t),o(t,{onSuccess:x})},C=(0,B.useRef)(!1);(0,B.useEffect)(()=>{if(C.current&&!i){let e=Ay(u,r);e!==null&&e!==f&&b(e)}C.current=i},[i,r,u,f]);let w=(0,B.useMemo)(()=>({activeName:c[f]?.name??``}),[c,f]);return(0,q.jsx)(My.Provider,{value:w,children:(0,q.jsxs)(`div`,{className:k(`gap-6`,d?`flex`:`grid`),"data-slot":`wizard`,children:[(0,q.jsx)(`ol`,{"aria-label":n(`form.wizard.steps`,`Steps`),className:k(`gap-1`,d?`flex w-56 shrink-0 flex-col`:`flex flex-wrap`,!d&&jy[t.props.align??`start`]),children:c.map((e,t)=>{let n=t===f,r=g.has(t),i=v.has(t);return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{"aria-current":n?`step`:void 0,className:k(`flex w-full items-center gap-2 rounded-lt px-3 py-2 text-left text-sm`,n?`bg-lt-muted font-medium text-lt-fg`:`text-lt-muted-fg`,!m.has(t)&&`cursor-not-allowed opacity-60`),"data-error":i||void 0,"data-test":`wizard-rail-${e.name}`,disabled:!m.has(t),id:`wizard-step-${e.name}-trigger`,onClick:()=>b(t),type:`button`,children:[(0,q.jsx)(`span`,{className:k(`flex size-5 shrink-0 items-center justify-center rounded-full border text-xs`,i?`border-lt-danger text-lt-danger`:r?`border-lt-primary bg-lt-primary text-lt-primary-fg`:`border-lt-border`),children:r&&!i?(0,q.jsx)(M,{className:`size-lt-icon-sm`,name:`check`}):t+1}),(0,q.jsxs)(`span`,{className:`min-w-0`,children:[(0,q.jsx)(`span`,{className:`block truncate`,children:e.label}),d&&e.description&&(0,q.jsx)(`span`,{className:`block truncate text-xs text-lt-muted-fg`,children:e.description})]})]})},e.name)})}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-6`,children:[e,(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(ss,{"data-test":`wizard-back`,disabled:f===0||i,onClick:()=>b(f-1),type:`button`,emphasis:`outline`,children:n(`form.wizard.back`,`Back`)}),y?(0,q.jsxs)(ss,{"data-test":`wizard-finish`,disabled:i,type:`submit`,children:[i&&(0,q.jsx)(Qs,{}),n(`form.wizard.finish`,`Finish`)]}):(0,q.jsxs)(ss,{"data-test":`wizard-next`,disabled:i||s,onClick:S,type:`button`,children:[s&&(0,q.jsx)(Qs,{}),n(`form.wizard.next`,`Next`)]})]})]})]})})},Fy=({children:e,node:t})=>{let{activeName:n}=(0,B.useContext)(My),r=t.props.name,i=n===r,[a,o]=(0,B.useState)(i);return(0,B.useEffect)(()=>{i&&o(!0)},[i]),(0,q.jsx)(`section`,{"aria-labelledby":`wizard-step-${r}-trigger`,className:k(`space-y-8`,!i&&`hidden`),hidden:!i,id:`wizard-step-${r}-panel`,children:a?e:null})},Iy=(0,B.lazy)(()=>ge(()=>import(`./field-CGZayHGR.js`),__vite__mapDeps([9,1,2,5,6,7,10,4,11,8,12,3,13,14]),import.meta.url)),Ly=({children:e,node:t})=>(0,q.jsx)(B.Suspense,{fallback:null,children:(0,q.jsx)(Iy,{node:t,children:e})}),Ry=(0,B.lazy)(()=>ge(()=>import(`./rich-editor-field-Cp8zPFKl.js`),__vite__mapDeps([15,1,2,5,16,6,7,10,4,11,12,3,13,14]),import.meta.url)),zy={components:{form:V(Sv),"field.builder":V(qg),"field.checkbox":V(h_),"field.choice":V(S_),"field.color-picker":V(ov),"field.date-input":V(lv),"field.date-time-input":V(uv),"field.file-upload":V(gv),"field.hidden-input":V(wv),"field.number-input":V(Dv),"field.otp":V(Qv),"field.password-input":V(ey),"field.pattern-input":V(Ly),"field.repeater":V(ny),"field.rich-editor":V(({children:e,node:t})=>(0,q.jsx)(B.Suspense,{fallback:null,children:(0,q.jsx)(Ry,{node:t,children:e})})),"field.select":V(oy),"field.textarea":V(cy),"field.text-input":V(fy),"field.time-input":V(Ty),"field.toggle":V(Ey),wizard:V(Py),"wizard-step":V(Fy)},name:`lattice/form`},By={lg:320,md:64,sm:40,xl:384,xs:32,"2xl":448,"3xl":512,"4xl":576},Vy={components:{fragment:V(({node:e})=>{let t=e.props.endpoint??``,n=e.props.lazy===!0,r=e.props.ref??``,i=By[e.props.size],[a,o]=(0,B.useState)(()=>e.schema??[]),[s,c]=(0,B.useState)(!n),[l,u]=(0,B.useState)(n&&t!==``),f=(0,B.useCallback)(async()=>{if(t){u(!0);try{let e=await Dc(t,{ref:r});o(Bc(e.schema)),c(!0)}finally{u(!1)}}},[t,r]);return(0,B.useEffect)(()=>{!n||s||f()},[s,n,f]),(0,B.useEffect)(()=>{function t(t){t.detail?.component===e.id&&f()}return window.addEventListener(d.reloadComponent,t),()=>window.removeEventListener(d.reloadComponent,t)},[f,e.id]),(0,B.useEffect)(()=>{function e(){s&&f()}return window.addEventListener(d.localeChange,e),()=>window.removeEventListener(d.localeChange,e)},[s,f]),(0,q.jsx)(`div`,{"data-lattice-fragment":e.id,style:l&&a.length===0?{minHeight:i}:void 0,children:l&&a.length===0?(0,q.jsx)(Kf,{className:`w-full`,style:{height:i}}):(0,q.jsx)(Xc,{nodes:a})})})},name:`lattice/fragments`},Hy=({node:e})=>{let{t}=P(`lattice`),n=Eo().props.lattice?.breadcrumbs??[];return n.length===0?null:(0,q.jsx)(`nav`,{"aria-label":t(`common.breadcrumb`,`Breadcrumb`),className:`min-w-0 flex-1`,"data-lattice-component":J(e),children:(0,q.jsx)(`ol`,{className:`flex items-center gap-2 text-sm text-lt-muted-fg`,children:n.map((e,t)=>{let r=t===n.length-1;return(0,q.jsxs)(B.Fragment,{children:[(0,q.jsx)(`li`,{className:`min-w-0`,children:r?(0,q.jsx)(`span`,{"aria-current":`page`,className:`block truncate text-lt-fg`,children:e.title}):(0,q.jsx)(Vo,{className:`block truncate hover:text-lt-fg`,href:e.href,children:e.title})}),r?null:(0,q.jsx)(`li`,{"aria-hidden":`true`,children:`/`})]},e.href)})})})};function Uy(e){return typeof e==`object`&&!!e&&typeof e.key==`string`}function Wy(e,t){return t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e)return e[t]},e)}function Gy(e,t){return Uy(e)?Ky(e,{},t):e}function Ky(e,t,n){let r={};for(let[n,i]of Object.entries(e.payload)){let e=Wy(t,i);r[n]=e===void 0?``:e}return n(e.key,e.key,{...e.replacements,...r})}var qy=[`primary`,`secondary`,`success`,`info`,`warning`,`danger`];function Jy(e){return qy.some(t=>t===e)}function Yy(e){let t=typeof e==`string`||Uy(e)?e:null;return t===``?null:t}function Xy(e,t,n){let r=e=>{let r=t(e.detail);r!==null&&n(r)};return window.addEventListener(e,r),()=>window.removeEventListener(e,r)}function Zy(e){if(typeof e!=`object`||!e)return null;let t=e,n=Yy(t.message);return n===null?null:{action:t.action??null,dismissible:t.dismissible!==!1,duration:typeof t.duration==`number`?t.duration:null,message:n,persistent:t.persistent===!0,variant:Jy(t.variant)?t.variant:`success`}}function Qy(e){return Xy(d.toast,Zy,e)}function $y(e){if(typeof e!=`object`||!e)return null;let t=e,n=Yy(t.message);return n===null?null:{action:t.action??null,dismissible:t.dismissible!==!1,message:n,title:typeof t.title==`string`||Uy(t.title)?t.title:null,unique:typeof t.unique==`string`?t.unique:null,variant:Jy(t.variant)?t.variant:`info`}}function eb(e){return Xy(d.callout,$y,e)}function tb(e){return Xy(d.retractCallout,e=>{let t=e?.unique;return typeof t==`string`?t:null},e)}var nb=Object.defineProperty,rb=(e,t)=>nb(e,`name`,{value:t,configurable:!0});function ib(e){let t=e+`CollectionProvider`,[n,r]=_l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=rb(e=>{let{scope:t,children:n}=e,r=B.useRef(null),a=B.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=S(s),l=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=_(t,i.collectionRef);return(0,q.jsx)(c,{ref:o,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=S(u),p=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),s=_(t,o),c=a(u,n);return B.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,q.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return B.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return rb(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}rb(ib,`createCollection`);var ab=new WeakMap,ob=class e extends Map{static{rb(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ab.set(this,!0)}set(e,t){return ab.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=lb(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=sb(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=sb(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return sb(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function sb(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=cb(e,t);return n===-1?void 0:e[n]}rb(sb,`at`);function cb(e,t){let n=e.length,r=lb(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}rb(cb,`toSafeIndex`);function lb(e){return e!==e||e===0?0:Math.trunc(e)}rb(lb,`toSafeInteger`);function ub(e){let t=e+`CollectionProvider`,[n,r]=_l(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ob,setItemMap:rb(()=>void 0,`setItemMap`)}),o=rb(({state:e,...t})=>e?(0,q.jsx)(c,{...t,state:e}):(0,q.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=rb(e=>{let t=h();return(0,q.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=rb(e=>{let{scope:t,children:n,state:r}=e,a=B.useRef(null),[o,s]=B.useState(null),c=_(a,s),[l,u]=r;return B.useEffect(()=>{if(!o)return;let e=mb(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,q.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=S(l),d=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(l,n),o=_(t,i.collectionRef);return(0,q.jsx)(u,{ref:o,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=S(f),m=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),[s,c]=B.useState(null),l=_(t,o,c),{setItemMap:u}=a(f,n),d=B.useRef(i);db(d.current,i)||(d.current=i);let m=d.current;return B.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(pb):(t.set(s,{...e,element:s}),t.toSorted(pb)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new ob(e)))}},[s,m,u]),(0,q.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return B.useState(new ob)}rb(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return rb(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}rb(ub,`createCollection`);function db(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}rb(db,`shallowEqual`);function fb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}rb(fb,`isElementPreceding`);function pb(e,t){return!e[1].element||!t[1].element?0:fb(e[1].element,t[1].element)?-1:1}rb(pb,`sortByDocumentPosition`);function mb(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}rb(mb,`getChildListObserver`);var hb=Object.defineProperty,gb=(e,t)=>hb(e,`name`,{value:t,configurable:!0}),_b=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),vb=B.forwardRef(gb(function(e,t){return(0,q.jsx)(Q.span,{...e,ref:t,style:{..._b,...e.style}})},`VisuallyHidden`)),yb=Object.defineProperty,bb=(e,t)=>yb(e,`name`,{value:t,configurable:!0}),xb=`ToastProvider`,[Sb,Cb,wb]=ib(`Toast`),[Tb,Eb]=_l(`Toast`,[wb]),[Db,Ob]=Tb(xb),kb=bb(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=B.useState(null),[u,d]=B.useState(0),f=B.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${xb}\`. Expected non-empty \`string\`.`),(0,q.jsx)(Sb.Provider,{scope:t,children:(0,q.jsx)(Db,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:B.useCallback(()=>d(e=>e+1),[]),onToastRemove:B.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),Ab=`ToastViewport`,jb=[`F8`],Mb=`toast.viewportPause`,Nb=`toast.viewportResume`,Pb=B.forwardRef(bb(function(e,t){let{__scopeToast:n,hotkey:r=jb,label:i=`Notifications ({hotkey})`,...a}=e,o=Ob(Ab,n),s=Cb(n),c=B.useRef(null),l=B.useRef(null),u=B.useRef(null),d=B.useRef(null),f=_(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;B.useEffect(()=>{let e=bb(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),B.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=bb(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(Mb);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=bb(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(Nb);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=bb(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=bb(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=B.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...nx(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return B.useEffect(()=>{let e=d.current;if(e){let t=bb(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);rx(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,q.jsxs)(iu,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,q.jsx)(Ib,{ref:l,onFocusFromOutsideViewport:()=>{rx(h({tabbingDirection:`forwards`}))}}),(0,q.jsx)(Sb.Slot,{scope:n,children:(0,q.jsx)(Q.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,q.jsx)(Ib,{ref:u,onFocusFromOutsideViewport:()=>{rx(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),Fb=`ToastFocusProxy`,Ib=B.forwardRef(bb(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Ob(Fb,n);return(0,q.jsx)(vb,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),Lb=`Toast`,Rb=`toast.swipeStart`,zb=`toast.swipeMove`,Bb=`toast.swipeCancel`,Vb=`toast.swipeEnd`,Hb=B.forwardRef(bb(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Nl({prop:r,defaultProp:i??!0,onChange:a,caller:Lb});return(0,q.jsx)(Du,{present:n||s,children:(0,q.jsx)(Gb,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Vl(e.onPause),onResume:Vl(e.onResume),onSwipeStart:ll(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:ll(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:ll(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:ll(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[Ub,Wb]=Tb(Lb,{onClose(){}}),Gb=B.forwardRef(bb(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=Ob(Lb,n),g=Cb(n),[v,y]=B.useState(null),b=_(t,y),x=B.useRef(null),S=B.useRef(null),C=i||h.duration,w=B.useRef(0),T=B.useRef(C),E=B.useRef(0),{onToastAdd:D,onToastRemove:O}=h,k=Vl(()=>{v?.contains(document.activeElement)&&h.viewport?.focus(),o()}),ee=B.useCallback(e=>{!e||e===1/0||(window.clearTimeout(E.current),w.current=new Date().getTime(),E.current=window.setTimeout(k,e))},[k]);B.useEffect(()=>{let e=h.viewport;if(e){let t=bb(()=>{ee(T.current),l?.()},`handleResume`),n=bb(()=>{let e=new Date().getTime()-w.current;T.current-=e,window.clearTimeout(E.current),c?.()},`handlePause`);return e.addEventListener(Mb,n),e.addEventListener(Nb,t),()=>{e.removeEventListener(Mb,n),e.removeEventListener(Nb,t)}}},[h.viewport,C,c,l,ee]),B.useEffect(()=>{a&&!h.isClosePausedRef.current&&ee(C)},[a,C,h.isClosePausedRef,ee]),B.useEffect(()=>()=>{window.clearTimeout(E.current)},[]),B.useEffect(()=>(D(),()=>O()),[D,O]);let A=B.useMemo(()=>v?Zb(v):null,[v]);return h.viewport?(0,q.jsxs)(q.Fragment,{children:[A&&(0,q.jsx)(Kb,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:A}),(0,q.jsx)(Ub,{scope:n,onClose:k,children:co.createPortal((0,q.jsx)(Sb.ItemSlot,{scope:n,children:(0,q.jsx)(ru,{asChild:!0,onEscapeKeyDown:ll(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||k()}),children:(0,q.jsx)(Q.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:b,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:ll(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||k())}),onPointerDown:ll(e.onPointerDown,e=>{e.button===0&&(x.current={x:e.clientX,y:e.clientY})}),onPointerMove:ll(e.onPointerMove,e=>{if(!x.current)return;let t=e.clientX-x.current.x,n=e.clientY-x.current.y,r=!!S.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(S.current=l,Qb(zb,d,f,{discrete:!1})):$b(l,h.swipeDirection,c)?(S.current=l,Qb(Rb,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(x.current=null)}),onPointerUp:ll(e.onPointerUp,e=>{let t=S.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),S.current=null,x.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};$b(t,h.swipeDirection,h.swipeThreshold)?Qb(Vb,p,r,{discrete:!0}):Qb(Bb,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),Kb=bb(e=>{let{__scopeToast:t,children:n,...r}=e,i=Ob(Lb,t),[a,o]=B.useState(!1),[s,c]=B.useState(!1);return ex(()=>o(!0)),B.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,q.jsx)(Cu,{asChild:!0,container:i.announcerContainer||void 0,children:(0,q.jsx)(vb,{...r,children:a&&(0,q.jsxs)(q.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),qb=B.forwardRef(bb(function(e,t){let{__scopeToast:n,...r}=e;return(0,q.jsx)(Q.div,{...r,ref:t})},`ToastTitle`)),Jb=`ToastClose`,Yb=B.forwardRef(bb(function(e,t){let{__scopeToast:n,...r}=e,i=Wb(Jb,n);return(0,q.jsx)(Xb,{asChild:!0,children:(0,q.jsx)(Q.button,{type:`button`,...r,ref:t,onClick:ll(e.onClick,i.onClose)})})},`ToastClose`)),Xb=B.forwardRef(bb(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,q.jsx)(Q.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Zb(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),tx(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Zb(e))}}),t}bb(Zb,`getAnnounceTextContent`);function Qb(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Rl(i,a):i.dispatchEvent(a)}bb(Qb,`handleAndDispatchCustomEvent`);var $b=bb((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function ex(e=()=>{}){let t=Vl(e);yl(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}bb(ex,`useNextFrame`);function tx(e){return e.nodeType===e.ELEMENT_NODE}bb(tx,`isHTMLElement`);function nx(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:bb(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}bb(nx,`getTabbableCandidates`);function rx(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}bb(rx,`focusFirst`);var ix=kb,ax=Pb,ox=Hb,sx=qb,cx=Yb,lx={primary:{accent:`border-l-lt-primary`,icon:(0,q.jsx)(M,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-primary`})},secondary:{accent:`border-l-lt-secondary`,icon:(0,q.jsx)(M,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-muted-fg`})},success:{accent:`border-l-lt-success`,icon:(0,q.jsx)(M,{name:`circle-check`,className:`size-lt-icon-lg shrink-0 text-lt-success`})},info:{accent:`border-l-lt-info`,icon:(0,q.jsx)(M,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-info`})},warning:{accent:`border-l-lt-warning`,icon:(0,q.jsx)(M,{name:`circle-alert`,className:`size-lt-icon-lg shrink-0 text-lt-warning`})},danger:{accent:`border-l-lt-danger`,icon:(0,q.jsx)(M,{name:`circle-x`,className:`size-lt-icon-lg shrink-0 text-lt-danger`})}},ux=0;function dx({duration:e=4e3}){let{t}=P(`lattice`),[n,r]=(0,B.useState)([]);function i(e){r(t=>t.filter(t=>t.id!==e))}return(0,B.useEffect)(()=>Qy(e=>{r(t=>[...t,{...e,id:ux++}])}),[]),(0,q.jsxs)(ix,{duration:e,swipeDirection:`down`,children:[n.map(n=>(0,q.jsxs)(ox,{className:k(`flex items-start gap-3 rounded-lt border border-l-4 border-lt-border bg-lt-popover p-4 text-lt-popover-fg shadow-lt-lg`,lx[n.variant].accent,`data-[state=open]:animate-lt-toast-in data-[state=closed]:animate-lt-toast-out`,`data-[swipe=move]:translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=cancel]:translate-y-0 data-[swipe=cancel]:transition-transform`),"data-test":`toast-${n.variant}`,duration:n.persistent?1/0:n.duration??e,onOpenChange:e=>{e||i(n.id)},children:[lx[n.variant].icon,(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[(0,q.jsx)(sx,{className:`text-sm text-lt-fg`,children:Gy(n.message,t)}),n.action?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,q.jsx)(Y,{node:n.action})}):null]}),n.dismissible?(0,q.jsx)(cx,{"aria-label":t(`common.dismiss`,`Dismiss`),className:`shrink-0 rounded-lt-sm p-1 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`,"data-test":`toast-dismiss`,children:(0,q.jsx)(M,{name:`x`,className:`size-lt-icon-md`})}):null]},n.id)),(0,q.jsx)(ax,{className:`fixed inset-x-0 bottom-0 z-lt-toast mx-auto flex w-full max-w-sm flex-col gap-2 p-4 outline-none`})]})}var fx=0,px=()=>{let{t:e}=P(`lattice`),[t,n]=(0,B.useState)([]);(0,B.useEffect)(()=>eb(e=>{n(t=>[...e.unique?t.filter(t=>t.unique!==e.unique):t,{...e,id:fx++}])}),[]),(0,B.useEffect)(()=>G.on(`navigate`,()=>{n(e=>e.filter(e=>!e.unique))}),[]),(0,B.useEffect)(()=>tb(e=>{n(t=>t.filter(t=>t.unique!==e))}),[]);function r(e){n(t=>t.filter(t=>t.id!==e))}return t.length===0?null:(0,q.jsx)(`div`,{className:`flex w-full flex-col gap-2`,children:t.map(t=>(0,q.jsxs)(`div`,{role:`status`,"data-test":`callout-${t.variant}`,className:k(`flex items-start gap-3 rounded-lt border border-l-4 border-lt-border bg-lt-popover p-4 text-lt-popover-fg`,lx[t.variant].accent),children:[lx[t.variant].icon,(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[t.title?(0,q.jsx)(`p`,{className:`text-sm font-medium text-lt-fg`,children:Gy(t.title,e)}):null,(0,q.jsx)(`p`,{className:`text-sm text-lt-fg`,children:Gy(t.message,e)}),t.action?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,q.jsx)(Y,{node:t.action})}):null]}),t.dismissible?(0,q.jsx)(`button`,{type:`button`,"aria-label":e(`common.dismiss`,`Dismiss`),"data-test":`callout-dismiss`,className:`shrink-0 rounded-lt-sm p-1 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`,onClick:()=>r(t.id),children:(0,q.jsx)(M,{name:`x`,className:`size-lt-icon-md`})}):null]},t.id))})};function mx({align:e=`start`,children:t,className:n,placement:r=`bottom`,testId:i,trigger:a,triggerClassName:o,triggerLabel:s}){let[c,l]=(0,B.useState)(!1),u=Eo().url;return(0,B.useEffect)(()=>l(!1),[u]),(0,q.jsxs)(jh,{open:c,onOpenChange:l,children:[(0,q.jsx)(Mh,{asChild:!0,children:(0,q.jsx)(`button`,{"aria-label":s,className:k(`w-full`,o),"data-test":i,title:s,type:`button`,children:a})}),(0,q.jsx)(Ph,{align:e,className:k(`min-w-56 p-1`,n),role:`menu`,side:r,children:(0,q.jsx)(Uc,{collapsed:!1,children:t})})]})}var hx=({children:e,node:t})=>{let n=t.key??`dropdown`;return(0,q.jsx)(mx,{placement:t.props.placement,testId:n,triggerClassName:`w-auto`,trigger:(0,q.jsx)(`span`,{className:`flex min-w-0 items-center rounded-lt-sm px-2 py-1.5 text-sm hover:bg-lt-muted`,children:t.props.trigger.map((e,t)=>(0,q.jsx)(Y,{node:e},e.key??`${e.type}-${t}`))}),children:(0,q.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e})})},gx=({children:e,node:t})=>(0,q.jsx)(`nav`,{"data-lattice-component":J(t),children:(0,q.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e})}),_x=(0,B.createContext)(null);function vx(e){return e.type===`action`||e.type===`action.bulk`}function yx({children:e,render:t}){return(0,q.jsx)(_x.Provider,{value:t,children:e})}function bx(){return(0,B.useContext)(_x)}function xx({action:e,children:t,options:n}){let r=bx();if(!r)throw Error(`Action triggers require an ActionTriggerProvider.`);return(0,q.jsx)(q.Fragment,{children:r({action:e,children:t,options:n})})}function Sx(e){let t=zc(),n=nl(),r=e.action??null,i=e.effects??[],a=e.modal??null;if(a)return{kind:`modal`,onClick:()=>{if(!n)throw Error(Qc);n.open(a)}};if(r){if(!vx(r))throw Error(`Clickable action nodes must have type [action] or [action.bulk].`);return{kind:`action`,action:r}}return i.length>0?{kind:`effects`,onClick:()=>t(Lc(i))}:e.href!=null&&e.href!==``?{kind:`navigate`,href:e.href,method:e.method??`get`}:{kind:`none`}}var Cx=`flex items-center gap-2 rounded-lt-sm px-3 py-2 text-base font-medium text-lt-fg transition-colors hover:bg-lt-muted`;function wx({affix:e,className:t}){return e.icon?(0,q.jsx)(rs,{className:k(`size-lt-icon-md shrink-0`,t),icon:e.icon}):(0,q.jsx)(`span`,{className:k(`shrink-0 text-sm text-lt-muted-fg`,t),children:e.text})}function Tx(e,t){return(e??[]).some(e=>e.props?.href===t||Tx(e.schema,t))}var Ex=({children:e,node:t})=>{let n=Wc(),{icon:r,label:i,prefix:a,suffix:o}=t.props,s=i??``,c=!!r,l=r??a?.icon??null,u=Eo().url.split(`?`)[0],d=nc(`menu`,t),f=Sx(t.props),p=r?(0,q.jsx)(rs,{className:`size-lt-icon-md shrink-0`,icon:r}):(0,q.jsxs)(q.Fragment,{children:[a?(0,q.jsx)(wx,{affix:a}):null,n?(0,q.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-full z-lt-popover ml-2 hidden -translate-y-1/2 rounded-lt-sm border border-lt-border bg-lt-popover px-2 py-1 text-sm whitespace-nowrap text-lt-popover-fg shadow-lt-md group-hover:block`,role:`tooltip`,children:s}):(0,q.jsx)(`span`,{children:s}),o?(0,q.jsx)(wx,{affix:o,className:`ml-auto`}):null]}),m=k(Cx,`w-full`,n&&`group relative justify-center`,c&&`justify-center`),h=({onClick:e,processing:t})=>(0,q.jsx)(`button`,{"aria-label":n||c?s:void 0,className:m,"data-test":d,disabled:t,onClick:e,type:`button`,children:p});if(f.kind===`action`)return(0,q.jsx)(`li`,{children:(0,q.jsx)(xx,{action:f.action,children:h})});if(f.kind===`effects`||f.kind===`modal`)return(0,q.jsx)(`li`,{children:h({onClick:f.onClick,processing:!1})});if(f.kind===`navigate`){let e=u===f.href;return(0,q.jsx)(`li`,{children:(0,q.jsx)(Vo,{"aria-current":e?`page`:void 0,"aria-label":n||c?s:void 0,as:f.method===`get`?void 0:`button`,className:k(m,e&&`bg-lt-muted font-medium`),"data-test":d,href:f.href,method:f.method,children:p})})}return e?n?(0,q.jsx)(Ox,{icon:l,label:s,testId:d,children:e}):(0,q.jsx)(Dx,{content:p,defaultOpen:Tx(t.schema,u),testId:d,children:e}):n?null:(0,q.jsx)(`li`,{children:(0,q.jsx)(`span`,{className:`flex items-center gap-2 px-3 py-2 text-xs font-semibold tracking-wide text-lt-muted-fg uppercase`,children:p})})};function Dx({children:e,content:t,defaultOpen:n,testId:r}){let[i,a]=(0,B.useState)(n);return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`button`,{"aria-expanded":i,className:k(Cx,`w-full`),"data-test":r,onClick:()=>a(e=>!e),type:`button`,children:[t,(0,q.jsx)(M,{name:`chevron-right`,className:k(`ml-auto size-lt-icon-md shrink-0 transition-transform`,i&&`rotate-90`)})]}),i?(0,q.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1 pl-3`,children:e}):null]})}function Ox({children:e,icon:t,label:n,testId:r}){return(0,q.jsx)(`li`,{children:(0,q.jsx)(mx,{className:`min-w-48`,placement:`right`,testId:r,trigger:t?(0,q.jsx)(rs,{className:`size-lt-icon-md shrink-0`,icon:t}):(0,q.jsx)(`span`,{children:n}),triggerClassName:k(Cx,`justify-center`),triggerLabel:n,children:(0,q.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`li`,{className:`px-3 py-1.5 text-xs font-semibold tracking-wide text-lt-muted-fg uppercase`,children:n}),e]})})})}var kx=(0,B.createContext)(null);function Ax({outlet:e,children:t}){return(0,q.jsx)(kx.Provider,{value:e,children:t})}function jx(){return(0,B.useContext)(kx)}var Mx=()=>(0,q.jsx)(q.Fragment,{children:jx()});function Nx(e,t,n){let[r,i]=Sg(e,t,{enabled:n,parse:e=>e===`true`,serialize:String});return[r,(0,B.useCallback)(()=>i(e=>!e),[i])]}var Px=`(min-width: 768px)`;function Fx(e,t){let n=e.detail?.target;return n==null||n===t}var Ix={components:{breadcrumbs:V(Hy),callouts:V(px),dropdown:V(hx),menu:V(gx),"menu-item":V(Ex),outlet:V(Mx),sidebar:V(({children:e,node:t})=>{let n=t.props.collapsible,r=t.props.rememberState,i=J(t),a=`lattice:sidebar:${i??`default`}`,o=Mg(Px,!0),[s,c]=Nx(a,!1,n&&r),[l,u]=(0,B.useState)(!1);Ls(d.toggleSidebar,e=>{Fx(e,i)&&(window.matchMedia?.(Px).matches??!0?n&&c():u(e=>!e))}),(0,B.useEffect)(()=>G.on(`navigate`,()=>u(!1)),[]),Ls(`keydown`,e=>{e.key===`Escape`&&u(!1)},{enabled:l});let f=n&&s&&o;return(0,q.jsxs)(Uc,{collapsed:f,children:[l?(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`fixed inset-0 z-lt-overlay bg-lt-overlay md:hidden`,"data-test":`sidebar-backdrop`,onClick:()=>u(!1)}):null,(0,q.jsx)(`aside`,{className:k(`fixed inset-y-0 left-0 z-lt-modal flex h-svh w-72 max-w-[80vw] shrink-0 flex-col gap-4 border-r border-lt-border bg-lt-bg p-4 transition-transform`,`md:sticky md:top-0 md:z-auto md:max-w-none md:translate-x-0 md:transition-[width]`,l?`translate-x-0`:`-translate-x-full`,f?`md:w-16 md:overflow-visible`:`md:w-64 md:overflow-x-hidden md:overflow-y-auto`),"data-collapsed":f?`true`:`false`,"data-lattice-component":i,"data-test":`sidebar`,children:e})]})}),"sidebar.footer":V(({children:e,node:t})=>(0,q.jsx)(`div`,{className:`mt-auto flex flex-col gap-4`,"data-lattice-component":J(t),children:e})),topbar:V(({children:e,node:t})=>{let n=t.props.sticky;return(0,q.jsx)(`header`,{"data-lattice-component":J(t),className:k(`flex h-14 w-full items-center gap-2 border-b border-lt-border bg-lt-bg px-4 text-lt-fg`,n&&`sticky top-0 z-lt-sticky`),children:e})})},name:`lattice/layout`};function Lx(e,t=1){return Dc(`${e}?page=${t}`)}function Rx(e,t){return Dc(`${e}/${t}/read`,{method:`PATCH`})}function zx(e){return Dc(`${e}/read-all`,{method:`POST`})}function Bx(e,t){return Dc(`${e}/${t}`,{method:`DELETE`})}function Vx(e){return Dc(e,{method:`DELETE`})}function Hx(e,t){return e.some(e=>e.id===t.id)?e:[t,...e]}function Ux(e,t){return e.map(e=>e.id===t?{...e,isRead:!0}:e)}function Wx(e,t){return e.filter(e=>e.id!==t)}function Gx({endpoint:e,pollingInterval:t}){let[n,r]=(0,B.useState)([]),[i,a]=(0,B.useState)(0),[o,s]=(0,B.useState)(`loading`),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(!1),f=(0,B.useRef)(1),p=(0,B.useRef)(c);p.current=c;let m=(0,B.useRef)(!1),h=(0,B.useCallback)(async()=>{try{let t=await Lx(e,1);f.current=1,r(t.notifications),a(t.unreadCount),l(t.hasMore),s(`idle`)}catch{s(`error`)}},[e]);return(0,B.useEffect)(()=>{h()},[h]),(0,B.useEffect)(()=>{if(!t||t<=0)return;let e=setInterval(()=>void h(),t*1e3);return()=>clearInterval(e)},[h,t]),{notifications:n,unreadCount:i,status:o,hasMore:c,open:u,setOpen:d,loadMore:(0,B.useCallback)(()=>{if(m.current||!p.current)return;m.current=!0;let t=f.current+1;Lx(e,t).then(e=>{f.current=t,r(t=>[...t,...e.notifications]),l(e.hasMore)}).catch(()=>void h()).finally(()=>{m.current=!1})},[e,h]),markRead:(0,B.useCallback)(t=>{r(e=>Ux(e,t)),a(e=>Math.max(0,e-1)),Rx(e,t).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),markAllRead:(0,B.useCallback)(()=>{r(e=>e.map(e=>({...e,isRead:!0}))),a(0),zx(e).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),dismiss:(0,B.useCallback)(t=>{r(e=>Wx(e,t)),Bx(e,t).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),clearAll:(0,B.useCallback)(()=>{r([]),a(0),Vx(e).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),receive:(0,B.useCallback)(e=>{r(t=>{let n=Hx(t,e);return n!==t&&a(e=>e+1),n})},[])}}function Kx(e){let t=e,n=new Set;return{publish(e){t=e,n.forEach(e=>e())},subscribe(e){return n.add(e),()=>n.delete(e)},getSnapshot:()=>t}}var qx=(0,B.createContext)(null),Jx=qx.Provider;function Yx(){let e=(0,B.useContext)(qx);if(!e)throw Error(`useLiveNotifications must be used within a NotificationsBridgeProvider.`);return(0,B.useSyncExternalStore)(e.subscribe,e.getSnapshot)}function Xx(){let{t:e}=P(`lattice`);return(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-lt-muted-fg`,children:[(0,q.jsx)(M,{name:`bell`,className:`size-lt-icon-lg`}),(0,q.jsx)(`p`,{className:`text-sm`,children:e(`notifications.empty`,`No notifications yet`)})]})}var Zx={primary:`text-lt-primary`,secondary:`text-lt-muted-fg`,success:`text-lt-success`,info:`text-lt-info`,warning:`text-lt-warning`,danger:`text-lt-danger`};function Qx({notification:e,onMarkRead:t,onDismiss:n}){let{t:r}=P(`lattice`),i=Gy(e.title,r),a=Gy(e.body,r),o=(0,q.jsxs)(q.Fragment,{children:[i?(0,q.jsx)(`p`,{className:`truncate text-sm font-medium text-lt-fg`,children:i}):null,a?(0,q.jsx)(`p`,{className:`text-sm text-lt-muted-fg`,children:a}):null]});return(0,q.jsxs)(`li`,{className:k(`flex gap-3 px-3 py-3`,!e.isRead&&`bg-lt-muted/40`),"data-test":`notification`,children:[e.icon?(0,q.jsx)(rs,{icon:e.icon,className:k(`mt-0.5 size-lt-icon-md`,e.variant?Zx[e.variant]:void 0)}):null,(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.href?(0,q.jsx)(Vo,{href:e.href,className:`block`,"data-test":`notification-link`,onClick:()=>t(e.id),children:o}):o,e.actions.length>0?(0,q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.actions.map((e,t)=>(0,q.jsx)(Y,{node:e},e.key??e.id??`action-${t}`))}):null]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1`,children:[e.isRead?null:(0,q.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:()=>t(e.id),children:r(`notifications.mark-read`,`Mark read`)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":r(`notifications.dismiss`,`Dismiss`),className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:()=>n(e.id),children:r(`notifications.dismiss`,`Dismiss`)})]})]})}function $x({notifications:e,status:t,hasMore:n,onMarkRead:r,onDismiss:i,onLoadMore:a}){let{t:o}=P(`lattice`);return t===`loading`&&e.length===0?(0,q.jsxs)(`div`,{className:`space-y-2 p-3`,children:[(0,q.jsx)(Kf,{className:`h-12 w-full`}),(0,q.jsx)(Kf,{className:`h-12 w-full`}),(0,q.jsx)(Kf,{className:`h-12 w-full`})]}):e.length===0?(0,q.jsx)(Xx,{}):(0,q.jsxs)(`div`,{className:`max-h-96 overflow-y-auto`,children:[(0,q.jsx)(`ul`,{className:`divide-y divide-lt-border`,children:e.map(e=>(0,q.jsx)(Qx,{notification:e,onMarkRead:r,onDismiss:i},e.id))}),n?(0,q.jsx)(`button`,{type:`button`,className:`w-full py-2 text-sm text-lt-muted-fg hover:text-lt-fg`,onClick:a,children:o(`notifications.load-more`,`Load more`)}):null]})}function eS({onClosed:e}){let t=el();if(!t)throw Error(Qc);let n=Yx(),{t:r}=P(`lattice`),i=r(`notifications.label`,`Notifications`),a=r(`notifications.heading`,`Notifications`);return(0,q.jsx)(Ff,{open:t.open,onOpenChange:t.onOpenChange,children:(0,q.jsxs)(Bf,{"aria-describedby":void 0,className:`p-0`,onCloseAutoFocus:n=>{t.onExited(n),e()},placement:`end`,width:`sm`,children:[(0,q.jsx)(Rf,{className:`sr-only`,children:i}),(0,q.jsxs)(`div`,{className:`w-full`,"data-test":`notifications-panel`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-lt-border px-3 py-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:a}),n.unreadCount>0?(0,q.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:n.markAllRead,children:r(`notifications.mark-all-read`,`Mark all read`)}):null]}),(0,q.jsx)($x,{notifications:n.notifications,status:n.status,hasMore:n.hasMore,onMarkRead:n.markRead,onDismiss:n.dismiss,onLoadMore:n.loadMore})]})]})})}var tS=(0,B.lazy)(()=>ge(()=>import(`./notifications-echo-BLO9_g1w.js`).then(e=>({default:e.NotificationsEcho})),__vite__mapDeps([17,18,1,2]),import.meta.url)),nS=class extends B.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(){console.warn(`[lattice] The notifications bell declares a realtime channel but Echo is unavailable. Install @laravel/echo-react and call configureEcho().`)}render(){return this.state.failed?null:this.props.children}},rS={name:`lattice/notifications`,components:{notifications:V(({node:e})=>{let{t}=P(`lattice`),n=Gx({endpoint:e.props.endpoint,pollingInterval:e.props.pollingInterval}),r=rl(),i=(0,B.useRef)(null),[a]=(0,B.useState)(()=>Kx(n));(0,B.useEffect)(()=>{a.publish(n)},[a,n]);let o=t(`notifications.label`,`Notifications`),s=(0,B.useCallback)(()=>{i.current||=r.open((0,q.jsx)(Jx,{value:a,children:(0,q.jsx)(eS,{onClosed:()=>{i.current=null}})}))},[a,r]),c=(0,q.jsxs)(`span`,{className:`relative inline-flex items-center justify-center rounded-lt-sm p-2 hover:bg-lt-muted`,children:[(0,q.jsx)(M,{name:`bell`,className:`size-lt-icon-md`}),n.unreadCount>0?(0,q.jsx)(`span`,{"data-test":`notifications-badge`,className:`absolute -right-0.5 -top-0.5 inline-flex min-w-4 items-center justify-center rounded-lt-full bg-lt-danger px-1 py-0 text-[10px] font-medium text-lt-danger-fg`,children:n.unreadCount}):null]}),l=(0,q.jsxs)(`div`,{className:`w-80`,"data-test":`notifications-panel`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-lt-border px-3 py-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:t(`notifications.heading`,`Notifications`)}),n.unreadCount>0?(0,q.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:n.markAllRead,children:t(`notifications.mark-all-read`,`Mark all read`)}):null]}),(0,q.jsx)($x,{notifications:n.notifications,status:n.status,hasMore:n.hasMore,onMarkRead:n.markRead,onDismiss:n.dismiss,onLoadMore:n.loadMore})]});return(0,q.jsxs)(q.Fragment,{children:[e.props.channel?(0,q.jsx)(nS,{children:(0,q.jsx)(B.Suspense,{fallback:null,children:(0,q.jsx)(tS,{channel:e.props.channel,onReceive:e=>n.receive(e)})})}):null,e.props.slideOut?(0,q.jsx)(`button`,{type:`button`,"aria-label":o,"data-test":`notifications-trigger`,onClick:s,children:c}):(0,q.jsxs)(jh,{open:n.open,onOpenChange:n.setOpen,children:[(0,q.jsx)(Mh,{asChild:!0,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":o,"data-test":`notifications-trigger`,children:c})}),(0,q.jsx)(Ph,{align:`end`,className:`p-0`,children:l})]})]})})}};function iS(e){return e==null?``:String(e)}function aS({props:e}){let{t}=P(`lattice`),[n,r]=(0,B.useState)([]),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{if(!e.remote||!e.dataEndpoint){r([]),c(!1);return}let t=!1;return o(null),c(!0),Pc(e.dataEndpoint,{remote:e.remote}).then(e=>{t||r(e.data??[])}).catch(e=>{t||o(e instanceof Error?e.message:String(e))}).finally(()=>{t||c(!1)}),()=>{t=!0}},[e.dataEndpoint,e.remote]),a?(0,q.jsx)(`div`,{className:`rounded-lt border border-lt-danger/40 p-3 text-sm`,children:a}):s||!e.remote?(0,q.jsx)(`div`,{className:`rounded-lt border border-lt-border p-3 text-sm`,children:t(`common.remote.data-list.loading`,`Loading...`)}):(0,q.jsxs)(`div`,{className:`rounded-lt border border-lt-border bg-lt-bg`,children:[(0,q.jsx)(`div`,{className:`border-b border-lt-border px-3 py-2 text-sm font-medium`,children:t(`common.remote.data-list.title`,`Remote data`)}),(0,q.jsxs)(`div`,{className:`divide-y divide-lt-border`,children:[n.map((t,n)=>(0,q.jsx)(`div`,{className:`px-3 py-2`,children:(0,q.jsx)(Xc,{nodes:i(e.schema,t)})},iS(t.id)||n)),n.length===0?(0,q.jsx)(`div`,{className:`px-3 py-2 text-sm text-lt-muted-fg`,children:e.emptyLabel??t(`common.remote.data-list.empty`,`No data`)}):null]})]})}var oS={components:{"remote.data-list":V(({node:e})=>(0,q.jsx)(aS,{props:{...e.props,schema:e.schema}}))},name:`lattice/remote`};function sS(e){return e==null||e===``}function cS(e){return sS(e)?!0:Array.isArray(e)?e.every(cS):typeof e==`object`&&e?Object.values(e).every(cS):!1}function lS(e){return!cS(e)}function uS(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function dS(e){return uS(e)?e:{}}function fS(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.field==`string`&&typeof e.operator==`string`&&typeof e.value==`string`):[]}function pS(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&`key`in e&&`props`in e&&typeof e.key==`string`&&typeof e.props==`object`&&e.props!==null&&typeof e.props.label==`string`):[]}function mS(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&!Array.isArray(e)):[]}var hS={mode:`none`,currentPage:null,lastPage:null,perPage:null,total:null,from:null,to:null,hasMore:!1,nextPage:null};function gS(e){return typeof e!=`object`||!e||Array.isArray(e)?hS:e}function _S(e){if(typeof e!=`object`||!e||Array.isArray(e))return{filters:[],sorts:[],page:1,perPage:25,tableFilters:{},tableFilterIndicators:[],search:``,mode:null};let t=e;return{filters:fS(t.filters),sorts:Array.isArray(t.sorts)?t.sorts:[],page:typeof t.page==`number`?t.page:1,perPage:typeof t.perPage==`number`?t.perPage:25,tableFilters:xS(t.tableFilters),tableFilterIndicators:SS(t.tableFilterIndicators),search:typeof t.search==`string`?t.search:``,mode:yS(t.mode)}}var vS=new Set([`none`,`simple`,`table`,`infinite`]);function yS(e){return typeof e==`string`&&vS.has(e)?e:null}function bS(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`||e===`infinite`):[]}function xS(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`object`&&e[1]!==null&&!Array.isArray(e[1])))}function SS(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.filter==`string`&&typeof e.label==`string`&&typeof e.value==`string`):[]}function CS(e,t){let n=e.id??e.uuid??e.key??t;return String(n)}function wS(e){return Array.isArray(e.actions)?e.actions:[]}function TS(e){let t=e.detail;return typeof t==`object`&&t&&!Array.isArray(t)?t:null}function ES(e,t){return e.sorts.find(e=>e.key===t.key)}function DS(e){if(e?.direction===`asc`)return`ascending`;if(e?.direction===`desc`)return`descending`}function OS(e,t){let n=new URL(e,window.location.origin);return t.filters.length>0&&n.searchParams.set(`filter`,FS(t)),t.sorts.length>0&&n.searchParams.set(`sort`,IS(t)),t.search!==``&&n.searchParams.set(`q`,t.search),kS(n,t.tableFilters),n.searchParams.set(`page`,String(t.page)),n.searchParams.set(`per_page`,String(t.perPage)),t.mode!=null&&n.searchParams.set(`mode`,t.mode),`${n.pathname}${n.search}`}function kS(e,t){for(let[n,r]of Object.entries(AS(t)))NS(e,`tf[${n}]`,r)}function AS(e){let t={};for(let[n,r]of Object.entries(e)){let e=jS(r);e!==void 0&&(t[n]=e)}return t}function jS(e){if(sS(e)||Array.isArray(e)||typeof e!=`object`)return;let t=Object.entries(e).map(([e,t])=>[e,MS(t)]).filter(e=>e[1]!==void 0);return t.length>0?Object.fromEntries(t):void 0}function MS(e){if(!sS(e)){if(Array.isArray(e)){let t=e.map(MS).filter(e=>e!==void 0);return t.length>0?t:void 0}if(typeof e==`object`){if(e===null)return;let t=Object.entries(e).map(([e,t])=>[e,MS(t)]).filter(e=>e[1]!==void 0);return t.length>0?Object.fromEntries(t):void 0}return String(e)}}function NS(e,t,n){if(Array.isArray(n)){for(let r of n)NS(e,`${t}[]`,r);return}if(typeof n==`object`&&n){for(let[r,i]of Object.entries(n))NS(e,`${t}[${r}]`,i);return}e.searchParams.append(t,String(n))}function PS(e){let t={};e.filters.length>0&&(t.filter=FS(e)),e.sorts.length>0&&(t.sort=IS(e));let n=AS(e.tableFilters);return Object.keys(n).length>0&&(t.tf=n),e.search!==``&&(t.q=e.search),t}function FS(e){return e.filters.map(e=>`${e.field}:${e.operator}:${encodeURIComponent(e.value)}`).join(`,`)}function IS(e){return e.sorts.map(e=>e.direction===`desc`?`-${e.key}`:e.key).join(`,`)}var LS={contains:`contains`,starts_with:`starts with`,ends_with:`ends with`,eq:`equals`,neq:`not equals`,gt:`>`,gte:`≥`,lt:`<`,lte:`≤`,in:`in`,not_in:`not in`,before:`before`,after:`after`,empty:`is empty`,filled:`is not empty`},RS=new Set([`empty`,`filled`]);function zS(e){return re(`lattice`,`table.operators.${e}`,LS[e]??e)}function BS(e){return e===`desc`?`descending`:`ascending`}function VS(e,t){if(!t.props.sortable)return e;let n=e.find(e=>e.key===t.key),r=e.filter(e=>e.key!==t.key);return n?n.direction===`asc`?[...r,{key:t.key,direction:`desc`}]:r:[...e,{key:t.key,direction:`asc`}]}function HS(e,t){if(t<=5)return Array.from({length:t},(e,t)=>t+1);let n=Math.max(1,Math.min(e-2,t-4));return Array.from({length:5},(e,t)=>n+t)}function US(e){return e.map(e=>({key:e.key,label:e.props.label,width:WS(e)}))}function WS(e){return e.props.width??`md`}function GS(e,t,n=!1){return{leadingTracks:[...n?[`2.5rem`]:[],...t?[`3rem`]:[]],trailingTracks:e?[`10rem`]:[]}}function KS(e){let t=(0,B.useMemo)(()=>pS(e.props?.columns),[e.props?.columns]),n=typeof e.props?.endpoint==`string`?e.props.endpoint:null,r=typeof e.props?.ref==`string`?e.props.ref:``,i=e.props?.lazy===!0,a=(0,B.useMemo)(()=>_S(e.props?.query),[e.props?.query]),o=(0,B.useMemo)(()=>mS(e.props?.data),[e.props?.data]),s=(0,B.useMemo)(()=>gS(e.props?.pagination),[e.props?.pagination]),[c,l]=(0,B.useState)(o),[u,f]=(0,B.useState)(s),[p,m]=(0,B.useState)(a),[h,g]=(0,B.useState)(i),[_,v]=(0,B.useState)(!i),y=(0,B.useRef)(null),b=u.currentPage??p.page,x=(u.mode??`table`)===`infinite`,S=(0,B.useCallback)(async(e,t=!1)=>{if(n){g(!0);try{let i=await Dc(OS(n,e),{ref:r}),a=_S(i.query),o=mS(i.data);l(e=>t?[...e,...o]:o),f(gS(i.pagination)),m(a),v(!0)}finally{g(!1)}}},[n,r]);function C(e){S({...p,page:1,sorts:VS(p.sorts,e)})}function w(e){S({...p,page:1,sorts:p.sorts.filter(t=>t.key!==e.key)})}function T(e){let t={...p,filters:e,page:1};m(t),S(t)}function E(e){T([...p.filters,e])}function D(e,t){T(p.filters.map((n,r)=>r===e?t:n))}function O(e){T(p.filters.filter((t,n)=>n!==e))}function k(e,t){T([...p.filters.filter(t=>t.field!==e),...t])}function ee(e,t){let n={...p.tableFilters};cS(t)||!uS(t)?delete n[e]:n[e]=t;let r={...p,tableFilters:n,tableFilterIndicators:p.tableFilterIndicators.filter(t=>t.filter!==e),page:1};m(r),S(r)}function A(){let e={...p,filters:[],tableFilters:{},tableFilterIndicators:[],search:``,page:1};m(e),S(e)}function j(e){let t={...p,search:e,page:1};m(t),S(t)}let M=(0,B.useCallback)(async(e,t,i)=>{if(!n)return[];let a=new URL(n,window.location.origin);a.searchParams.set(`_sub`,`search`),a.searchParams.set(`_target`,e),a.searchParams.set(`_q`,t);let o=await Ec(`${a.pathname}${a.search}`,{ref:r,signal:i,throwOnError:!1});return o.ok?(await o.json()).options??[]:[]},[n,r]);function N(e){S({...p,page:e})}function P(e){let t=s.mode??`table`,n={...p,perPage:e===`infinite`?p.perPage:e,mode:e===`infinite`?`infinite`:t===`infinite`?`table`:null,page:1};m(n),S(n)}let F=(0,B.useCallback)(()=>{h||!u.hasMore||S({...p,page:u.nextPage??b+1},!0)},[b,S,u.hasMore,u.nextPage,h,p]);return(0,B.useEffect)(()=>{l(o),f(s),m(a),g(i),v(!i)},[o,s,a,i]),(0,B.useEffect)(()=>{!i||_||S(p)},[_,i,S,p]),Ls(d.reloadComponent,t=>{t.detail?.component===e.id&&S(p)}),(0,B.useEffect)(()=>{if(!x||!u.hasMore||h||!y.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&F()},{rootMargin:`240px`});return e.observe(y.current),()=>e.disconnect()},[x,F,u.hasMore,h]),{columns:t,rows:c,pagination:u,query:p,filters:p.filters,tableFilters:p.tableFilters,search:p.search,addFilter:E,updateFilter:D,removeFilter:O,replaceColumnFilters:k,setTableFilter:ee,resetFilters:A,setSearch:j,searchFilterOptions:M,processing:h,hasLoaded:_,infiniteLoaderRef:y,sort:C,clearSort:w,goToPage:N,setPerPage:P,loadMore:F}}function qS(e){let[t,n]=(0,B.useState)(()=>new Set),[r,i]=(0,B.useState)(!1),a=e.join(` `);(0,B.useEffect)(()=>{n(new Set),i(!1)},[a]);let o=(0,B.useCallback)(e=>{i(!1),n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),s=(0,B.useCallback)(()=>{i(!1),n(t=>t.size===e.length?new Set:new Set(e))},[e]),c=(0,B.useCallback)(()=>i(!0),[]),l=(0,B.useCallback)(()=>{i(!1),n(new Set)},[]),u=e.filter(e=>t.has(e)),d=e.length>0&&u.length===e.length;return{selectedKeys:u,allMatching:r,allVisibleSelected:d,allSelected:r||d,active:r||u.length>0,isSelected:e=>r||t.has(e),toggle:o,toggleAll:s,selectAllMatching:c,clear:l}}function JS({columns:e,storageKey:t}){let n=(0,B.useMemo)(()=>e.filter(e=>e.props.toggleable),[e]),r=(0,B.useMemo)(()=>n.map(e=>e.key),[n]),[i,a]=Sg(t??``,{},{enabled:!!t,parse:e=>XS(e,r),serialize:e=>ZS(e,r)}),o=(0,B.useCallback)(e=>e.props.toggleable?i[e.key]??!e.props.hiddenByDefault:!0,[i]),s=(0,B.useMemo)(()=>e.filter(e=>o(e)),[e,o]),c=(0,B.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[a]),l=(0,B.useCallback)(()=>a({}),[a]),u=n.length>0;return{hasHidden:n.some(e=>!o(e)),hasToggleableColumns:u,isVisible:o,resetVisibility:l,setColumnVisible:c,toggleableColumns:n,visibleColumns:s}}function YS(e,t){let n=new Set(t),r={};for(let[t,i]of Object.entries(e))n.has(t)&&typeof i==`boolean`&&(r[t]=i);return r}function XS(e,t){let n=JSON.parse(e)?.overrides;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`unexpected stored column visibility shape`);return YS(n,t)}function ZS(e,t){let n=YS(e,t);return Object.keys(n).length===0?null:JSON.stringify({overrides:n})}function QS(){let[e,t]=(0,B.useState)(()=>new Set);return{isExpanded:(0,B.useCallback)(t=>e.has(t),[e]),toggle:(0,B.useCallback)(e=>{t(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[])}}var $S={start:`text-start`,center:`text-center`,end:`text-end`},eC={start:`justify-start`,center:`justify-center`,end:`justify-end`},tC={start:`justify-items-start`,center:`justify-items-center`,end:`justify-items-end`},nC=e=>$S[e],rC=e=>eC[e],iC=e=>tC[e];function aC(e){return Array.isArray(e)?e.flatMap(e=>e.type!==`action`&&e.type!==`action.bulk`||!e.props?.endpoint?[]:[e]):[]}function oC({actions:e,selectedKeys:t,allMatching:n,total:r,query:i,canSelectAllMatching:a,onSelectAllMatching:o,onCompleted:s}){let{t:c}=P(`lattice`),l=()=>n?{allMatching:!0,...i}:{selected:t},u=n?r??t.length:t.length;return(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-lt-border bg-lt-muted/50 p-4 text-sm`,children:[(0,q.jsx)(`span`,{className:`font-medium`,children:n?c(`table.bulk.all-selected`,`All {{count}} selected`,{count:u}):c(`table.bulk.selected`,`{{count}} selected`,{count:u})}),a&&(0,q.jsx)(`button`,{type:`button`,"data-test":`bulk-select-all-matching`,className:`font-medium text-lt-primary underline underline-offset-2`,onClick:o,children:c(`table.bulk.select-all-matching`,`Select all {{total}} matching`,{total:r})}),(0,q.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:e.map((e,t)=>(0,q.jsx)(xx,{action:e,options:{extraData:l,onSuccess:s},children:({onClick:t,processing:n})=>(0,q.jsxs)(ss,{type:`button`,"data-test":tc(`bulk-action`,e.id),variant:e.props.variant,emphasis:e.props.emphasis,disabled:n,onClick:t,children:[n&&(0,q.jsx)(Qs,{}),e.props.label]})},e.key??e.id??t))})]})}function sC({className:e,density:t,children:n,ref:r,...i}){return(0,q.jsx)(`select`,{ref:r,"data-slot":`native-select`,className:k(se({density:t}),`cursor-pointer`,e),...i,children:n})}function cC(e){return e===!0||e===1||e===`1`||e===`true`}function lC({filter:e,value:t,processing:n,bare:r=!1,onChange:i,onSearch:a}){let{t:o}=P(`lattice`),s=e.schema??[];return s.length===0?(0,q.jsx)(fC,{filter:e,value:t,processing:n,onChange:i}):(0,q.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,q.jsx)(uC,{filter:e,schema:s,value:t,processing:n,bare:r,onChange:i,onSearch:a})}),lS(t)&&(0,q.jsx)(mv,{size:`md`,icon:`x`,label:o(`table.filter.clear`,`Clear {{label}} filter`,{label:e.props.label}),disabled:n,onClick:()=>i(void 0)})]})}function uC({filter:e,schema:t,value:n,processing:r,bare:i,onChange:a,onSearch:o}){let s=(0,B.useMemo)(()=>dS(n),[n]),c=(0,B.useMemo)(()=>({action:`#`,clearErrors:()=>{},componentId:`table-filter-${e.key}`,componentRef:``,errors:{},fieldIdPrefix:`table-filter-${e.key}`,fieldLabels:{},precognitive:!1,processing:r,searchOptions:(e,t,n,r)=>o?o(e,t,r):Promise.resolve([]),touch:()=>{},validate:()=>{},validateFields:()=>{},validating:!1}),[e.key,o,r]),l=(0,q.jsx)(`div`,{"aria-disabled":r,className:k(`grid gap-3`,r&&`pointer-events-none opacity-60`),children:(0,q.jsx)(Xc,{nodes:t})});return(0,q.jsx)(Jf,{value:c,children:(0,q.jsx)(Zf,{value:{markUserEdit:()=>{}},children:(0,q.jsx)(Tp,{nodes:{},children:(0,q.jsx)(Ip,{initial:s,children:(0,q.jsx)(dC,{onChange:a,children:i?(0,q.jsx)(qp,{children:l}):l})})})})})}function dC({children:e,onChange:t}){let n=Rp(),r=Vp(),i=(0,B.useRef)(n);i.current=n;let a=(0,B.useCallback)((e,n)=>{let a=typeof n==`function`?n(sp(i.current,e)):n,o=lp(i.current,e,a);i.current=o,r(e,a),t(o)},[t,r]),o=(0,B.useMemo)(()=>({blur:()=>{},change:a,commit:a}),[a]);return(0,q.jsx)(Wp,{value:o,children:e})}function fC({filter:e,value:t,processing:n,onChange:r}){let i=cC(dS(t).value);return(0,q.jsxs)(`label`,{className:`flex h-lt-control-md cursor-pointer items-center gap-2 text-sm`,children:[(0,q.jsx)(f_,{"aria-label":e.props.label,"data-test":`table-filter-${e.key}`,checked:i,disabled:n,onCheckedChange:e=>r(e===!0?{value:`1`}:void 0)}),(0,q.jsx)(`span`,{children:e.props.label})]})}function pC({type:e,label:t,value:n,processing:r,withSearchIcon:i=!1,grouped:a=!1,ariaLabel:o,testId:s,onCommit:c,onClear:l}){let{t:u}=P(`lattice`),[d,f]=(0,B.useState)(n),p=o??u(`table.filter.filter-by`,`Filter {{label}}`,{label:t}),m=a?`rounded-r-none`:``;return(0,B.useEffect)(()=>{f(n)},[n]),e===`boolean`?(0,q.jsxs)(sC,{density:`compact`,"aria-label":p,"data-test":s,className:m,disabled:r,value:n,onChange:e=>c(e.target.value),children:[(0,q.jsx)(`option`,{value:``,children:u(`table.filter.all`,`All`)}),(0,q.jsx)(`option`,{value:`true`,children:u(`table.filter.true`,`True`)}),(0,q.jsx)(`option`,{value:`false`,children:u(`table.filter.false`,`False`)})]}):e===`date`?(0,q.jsx)(ce,{type:`date`,density:`compact`,"aria-label":p,"data-test":s,className:m,disabled:r,value:d,onChange:e=>{f(e.target.value),c(e.target.value)}}):(0,q.jsxs)(`div`,{className:`relative flex w-full min-w-0 items-center`,children:[i&&(0,q.jsx)(M,{name:`search`,"aria-hidden":`true`,className:`pointer-events-none absolute left-2 size-lt-icon-md text-lt-muted-fg`}),(0,q.jsx)(ce,{type:e===`number`?`number`:`text`,density:`compact`,"aria-label":p,"data-test":s,className:k(m,i&&`pl-8`,l&&`pr-8`),disabled:r,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&c(d)},onBlur:()=>{d!==n&&c(d)}}),l&&d!==``&&(0,q.jsx)(mv,{size:`xs`,icon:`x`,label:u(`table.filter.clear`,`Clear {{label}} filter`,{label:t}),"data-test":s?`${s}-clear`:void 0,className:`absolute right-1 size-6`,disabled:r,onClick:l})]})}function mC({column:e,clauses:t,processing:n,onAdd:r,onUpdate:i,onRemove:a,onReplace:o,onSearch:s}){let{t:c}=P(`lattice`),{filter:l,label:u}=e.props,d=u??e.key;if(!l)return null;if(l.control===`filter.select`)return(0,q.jsx)(gC,{column:e,clauses:t,processing:n,onReplace:o,onSearch:s});let f=l.type??`text`,p=l.operators??[],m=l.defaultOperator??p[0]??`eq`,h=t.find(e=>e.clause.operator===m)??t[0];function g(t){if(t===``){h&&a(h.index);return}h?i(h.index,{...h.clause,value:t}):r({field:e.key,operator:m,value:t})}return(0,q.jsxs)(`div`,{className:`flex min-w-0 max-w-80 items-stretch`,children:[(0,q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,q.jsx)(pC,{type:f,label:d,value:h?.clause.value??``,processing:n,withSearchIcon:f===`text`||f===`number`,grouped:!0,testId:`filter-${e.key}-value`,onCommit:g,onClear:h?()=>a(h.index):void 0})}),(0,q.jsxs)(jh,{children:[(0,q.jsx)(Mh,{asChild:!0,children:(0,q.jsx)(mv,{emphasis:`segmented`,size:`md`,icon:`filter`,label:c(`table.filter.column-filters`,`{{label}} filters`,{label:d}),"data-test":`filter-${e.key}`,disabled:n,children:t.length>0&&(0,q.jsx)(`span`,{className:`absolute -right-1.5 -top-1.5 inline-flex size-4 items-center justify-center rounded-full bg-lt-primary text-xs font-medium text-lt-primary-fg`,children:t.length})})}),(0,q.jsx)(Ph,{align:`start`,className:`w-80 p-4`,children:(0,q.jsx)(bC,{column:e,clauses:t,operators:p,defaultOperator:m,processing:n,onAdd:r,onUpdate:i,onRemove:a})})]})]})}function hC(e){return Array.isArray(e)?e.join(`,`):typeof e==`string`?e:``}function gC({column:e,clauses:t,processing:n,onReplace:r,onSearch:i}){let{filter:a,label:o}=e.props,s=o??e.key;if(!a)return null;let c=a.multiple,l=a.defaultOperator,u=a.clauseOptions??[],d=vC(t.map(e=>e.clause),u),f=t.find(e=>e.clause.operator===l)??t[0],p=d?d.value:c?f?.clause.value?f.clause.value.split(`,`):[]:f?.clause.value??``,m={key:e.key,type:`filter.select`,props:{label:s,options:a.options,multiple:c,searchable:a.searchable,placeholder:null},schema:[{type:`field.select`,key:e.key,props:{name:`value`,label:s,options:a.options,multiple:c,searchable:a.searchable,placeholder:null}}]};function h(t){let n=hC(dS(t).value);if(n===``){r(e.key,[]);return}let i=u.find(e=>e.value===n);if(i){r(e.key,_C(e.key,i));return}r(e.key,[{field:e.key,operator:l,value:n}])}return(0,q.jsx)(lC,{filter:m,value:{value:p},processing:n,bare:!0,onChange:h,onSearch:i?(e,t,n)=>i(t,n):void 0})}function _C(e,t){return t.clauses.map(t=>({field:e,operator:t.operator,value:t.value}))}function vC(e,t){return t.find(t=>yC(e,_C(``,t)))}function yC(e,t){return e.length===t.length&&t.every(t=>e.some(e=>e.operator===t.operator&&e.value===t.value))}function bC({column:e,clauses:t,operators:n,defaultOperator:r,processing:i,onAdd:a,onUpdate:o,onRemove:s}){let{t:c}=P(`lattice`),l=e.props.filter?.type??`text`,[u,d]=(0,B.useState)(r),[f,p]=(0,B.useState)(t.length===0);return(0,q.jsxs)(`div`,{className:`grid gap-3`,children:[t.map(t=>(0,q.jsx)(xC,{column:e,type:l,operators:n,clause:t.clause,processing:i,onOperator:e=>o(t.index,{...t.clause,operator:e}),onValue:e=>e===``?s(t.index):o(t.index,{...t.clause,value:e}),onRemove:()=>s(t.index)},t.index)),f&&(0,q.jsx)(xC,{column:e,type:l,operators:n,clause:{field:e.key,operator:u,value:``},processing:i,onOperator:t=>{if(RS.has(t)){a({field:e.key,operator:t,value:``}),d(r),p(!1);return}d(t)},onValue:t=>{t!==``&&(a({field:e.key,operator:u,value:t}),d(r),p(!1))},onRemove:()=>p(!1)}),(0,q.jsx)(`div`,{className:`border-t border-lt-border pt-3`,children:(0,q.jsx)(ss,{variant:`secondary`,icon:`plus`,"data-test":`filter-${e.key}-add`,className:`w-full`,disabled:i,onClick:()=>p(!0),children:c(`table.filter.add`,`Add filter`)})})]})}function xC({column:e,type:t,operators:n,clause:r,processing:i,onOperator:a,onValue:o,onRemove:s}){let{t:c}=P(`lattice`),l=e.props.label??e.key,u=RS.has(r.operator);return(0,q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.length>1?(0,q.jsx)(sC,{density:`compact`,"aria-label":c(`table.filter.operator`,`{{label}} operator`,{label:l}),"data-test":`filter-${e.key}-operator`,className:`flex-1`,disabled:i,value:r.operator,onChange:e=>a(e.target.value),children:n.map(e=>(0,q.jsx)(`option`,{value:e,children:zS(e)},e))}):(0,q.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:zS(r.operator)}),(0,q.jsx)(ss,{emphasis:`outline`,size:`icon`,icon:`trash-2`,"aria-label":c(`table.filter.remove`,`Remove {{label}} filter`,{label:l}),"data-test":`filter-${e.key}-remove`,disabled:i,onClick:s})]}),!u&&(0,q.jsx)(pC,{type:t,label:l,ariaLabel:c(`table.filter.value`,`{{label}} filter value`,{label:l}),value:r.value,processing:i,onCommit:o,onClear:()=>o(``)})]})}function SC({sort:e}){return e?.direction===`asc`?(0,q.jsx)(M,{name:`arrow-up`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0`}):e?.direction===`desc`?(0,q.jsx)(M,{name:`arrow-down`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0`}):(0,q.jsx)(M,{name:`chevrons-up-down`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0 opacity-50`})}function CC({bottomBordered:e,column:t,processing:n,resizeHandleProps:r,sort:i,query:a}){let o=ES(a,t),{t:s}=P(`lattice`),{align:c,label:l,sortable:u}=t.props;return(0,q.jsxs)(`div`,{"aria-sort":DS(o),className:k(`relative min-w-0 bg-lt-muted/50 px-4 py-3 pr-5 align-middle font-semibold text-lt-fg`,e&&`border-b border-lt-border`,nC(c)),role:`columnheader`,children:[u?(0,q.jsxs)(`button`,{type:`button`,"aria-label":s(`table.sort.column`,`Sort {{label}}`,{label:l}),className:k(`flex w-full items-center gap-1.5 font-semibold`,rC(c)),"data-test":`sort-${t.key}`,disabled:n,onClick:()=>i(t),children:[(0,q.jsx)(`span`,{className:k(`min-w-0 flex-1 truncate`,nC(c)),children:l}),(0,q.jsx)(SC,{sort:o})]}):(0,q.jsx)(`span`,{className:k(`block truncate`,nC(c)),children:l}),r&&(0,q.jsx)(`div`,{...r})]})}function wC({columns:e,hasHidden:t,isVisible:n,onReset:r,onToggle:i,processing:a,visibleColumnCount:o}){let{t:s}=P(`lattice`),c=s(`table.columns.label`,`Columns`);return(0,q.jsxs)(jh,{children:[(0,q.jsx)(Mh,{asChild:!0,children:(0,q.jsx)(mv,{size:`sm`,icon:`columns-3`,label:c,"data-test":`table-columns-menu`,disabled:a})}),(0,q.jsx)(Ph,{align:`end`,className:`w-64 p-4`,children:(0,q.jsxs)(`div`,{className:`grid gap-3`,children:[e.map(e=>{let t=n(e),r=t&&o<=1;return(0,q.jsxs)(`label`,{className:`flex items-center gap-2 text-base text-lt-fg`,children:[(0,q.jsx)(f_,{"data-test":`table-column-toggle-${e.key}`,checked:t,disabled:r,onCheckedChange:t=>i(e.key,t===!0)}),(0,q.jsx)(`span`,{children:e.props.label??e.key})]},e.key)}),t&&(0,q.jsx)(`button`,{type:`button`,"data-test":`table-columns-reset`,className:`mt-1 justify-self-start text-sm text-lt-muted-fg hover:text-lt-fg`,onClick:r,children:s(`table.columns.reset`,`Reset`)})]})})]})}function TC({clauses:e,columnsByKey:t,indicators:n,processing:r,onRemoveClause:i,onChange:a,onReset:o}){let{t:s}=P(`lattice`);return e.length===0&&n.length===0?null:(0,q.jsx)(`div`,{className:`border-b border-lt-border px-4 py-3`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[e.map((e,n)=>{let a=t.get(e.field)?.props.label??e.field,o=RS.has(e.operator);return(0,q.jsx)(EC,{label:`${a} ${zS(e.operator)}`,value:o?``:e.value,removeTestId:`filter-chip-${e.field}-remove`,removeLabel:s(`table.filter.remove`,`Remove {{label}} filter`,{label:a}),processing:r,onRemove:()=>i(n)},`${e.field}-${e.operator}-${n}`)}),n.map(e=>(0,q.jsx)(EC,{label:e.label,value:e.value,removeTestId:`table-filter-chip-${e.filter}-remove`,removeLabel:s(`table.filter.remove`,`Remove {{label}} filter`,{label:e.label}),processing:r,onRemove:()=>a(e.filter,void 0)},`${e.filter}:${e.label}:${e.value}`)),(0,q.jsx)(`button`,{type:`button`,"data-test":`table-filters-reset`,className:`text-lt-muted-fg underline-offset-2 hover:underline disabled:text-lt-disabled-fg`,disabled:r,onClick:o,children:s(`table.filter.reset-all`,`Reset all`)})]})})}function EC({label:e,value:t,removeTestId:n,removeLabel:r,processing:i,onRemove:a}){return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-lt-sm bg-lt-muted px-2 py-1`,children:[(0,q.jsx)(`span`,{children:t===``?(0,q.jsx)(`span`,{className:`font-semibold`,children:e}):(0,q.jsxs)(q.Fragment,{children:[`${e}: `,(0,q.jsx)(`span`,{className:`font-semibold`,children:t})]})}),(0,q.jsx)(mv,{size:`xs`,icon:`x`,label:r,"data-test":n,disabled:i,onClick:a})]})}function DC({filters:e,values:t,processing:n,onChange:r,onSearch:i}){let{t:a}=P(`lattice`),o=e.filter(e=>lS(t[e.key])),s=a(`table.filter.filters`,`Filters`);return(0,q.jsxs)(jh,{children:[(0,q.jsx)(Mh,{asChild:!0,children:(0,q.jsx)(mv,{size:`sm`,icon:`filter`,label:s,"data-test":`table-filters-menu`,disabled:n,children:o.length>0&&(0,q.jsx)(`span`,{className:`absolute -right-1 -top-1 inline-flex size-3.5 items-center justify-center rounded-full bg-lt-primary text-[10px] font-medium leading-none text-lt-primary-fg`,children:o.length})})}),(0,q.jsx)(Ph,{align:`end`,className:`w-80 p-4`,children:(0,q.jsx)(`div`,{className:`grid gap-3`,children:e.map(e=>(0,q.jsx)(`div`,{className:`grid gap-1`,children:(0,q.jsx)(lC,{filter:e,value:t[e.key],processing:n,onChange:t=>r(e.key,t),onSearch:i?(t,n,r)=>i(`filter:${e.key}.${t}`,n,r):void 0})},e.key))})})]})}function OC({pagination:e,currentPage:t,processing:n,mode:r,hasNextPage:i,visiblePages:a,infiniteLoaderRef:o,perPageOptions:s,perPageValue:c,onPerPage:l,onPage:u,onLoadMore:d}){let{t:f}=P(`lattice`);return(0,q.jsxs)(`div`,{"data-slot":`table-pagination`,className:`flex items-center justify-between gap-3 border-t border-lt-border p-4 text-sm`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,q.jsx)(`span`,{children:e.total==null?f(`table.pagination.page`,`Page {{page}}`,{page:t}):f(`table.pagination.showing`,`Showing {{from}}-{{to}} of {{total}}`,{from:e.from??0,to:e.to??0,total:e.total})}),s.length>0&&r!==`none`&&(0,q.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-lt-muted-fg`,children:f(`table.pagination.per-page`,`Rows per page`)}),(0,q.jsx)(sC,{"data-test":`pagination-per-page`,disabled:n,value:String(c),onChange:e=>l(e.target.value===`infinite`?`infinite`:Number(e.target.value)),children:s.map(e=>(0,q.jsx)(`option`,{value:String(e),children:e===`infinite`?f(`table.pagination.infinite`,`Infinite`):e},String(e)))})]})]}),r===`infinite`?(0,q.jsx)(`div`,{ref:o,className:`flex items-center gap-2`,children:e.hasMore?(0,q.jsx)(ss,{emphasis:`outline`,"data-test":`pagination-load-more`,disabled:n,onClick:d,children:n?f(`table.pagination.loading`,`Loading...`):f(`table.pagination.load-more`,`Load more`)}):(0,q.jsx)(`span`,{className:`text-lt-muted-fg`,children:f(`table.pagination.all-loaded`,`All rows loaded`)})}):r===`simple`?(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(ss,{emphasis:`outline`,"data-test":`pagination-previous`,disabled:n||t<=1,onClick:()=>u(t-1),children:f(`table.pagination.previous`,`Previous`)}),(0,q.jsx)(ss,{emphasis:`outline`,"data-test":`pagination-next`,disabled:n||!i,onClick:()=>u(t+1),children:f(`table.pagination.next`,`Next`)})]}):r===`table`?(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(ss,{emphasis:`outline`,"data-test":`pagination-previous`,disabled:n||t<=1,onClick:()=>u(t-1),children:f(`table.pagination.previous`,`Previous`)}),a.map(e=>(0,q.jsx)(ss,{emphasis:`outline`,size:`icon`,"data-test":`pagination-page-${e}`,disabled:n||e===t,"aria-current":e===t?`page`:void 0,"aria-label":f(`table.pagination.page`,`Page {{page}}`,{page:e}),onClick:()=>u(e),children:e},e)),(0,q.jsx)(ss,{emphasis:`outline`,"data-test":`pagination-next`,disabled:n||!i,onClick:()=>u(t+1),children:f(`table.pagination.next`,`Next`)})]}):null]})}function kC({columnsByKey:e,query:t,processing:n,onClear:r}){let{t:i}=P(`lattice`);return(0,q.jsx)(`div`,{className:`flex flex-wrap items-center gap-4 border-b border-lt-border px-4 py-2.5 text-sm`,children:t.sorts.map((t,a)=>{let o=e.get(t.key)?.props.label??t.key,s=t.direction===`desc`?`arrow-down`:`arrow-up`;return(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,q.jsx)(`span`,{className:`font-medium`,children:`${a+1}. ${o}`}),(0,q.jsx)(M,{name:s,role:`img`,"aria-hidden":!1,"aria-label":BS(t.direction),className:`size-lt-icon-sm text-lt-muted-fg`}),(0,q.jsx)(mv,{size:`xs`,icon:`x`,label:i(`table.sort.clear`,`Clear {{label}} sort`,{label:o}),"data-test":`clear-${t.key}-sort`,disabled:n,onClick:()=>r(t)})]},t.key)})})}var AC=300;function jC({value:e,onSearch:t}){let{t:n}=P(`lattice`),[r,i]=(0,B.useState)(e),a=(0,B.useRef)(e);(0,B.useEffect)(()=>{e!==a.current&&(a.current=e,i(e))},[e]);function o(e){a.current=e,t(e)}let s=lm(o,AC);function c(e){i(e),s(e)}function l(){s.cancel(),i(``),o(``)}let u=n(`table.search.placeholder`,`Search`);return(0,q.jsxs)(`div`,{className:`relative w-full max-w-xs`,children:[(0,q.jsx)(M,{name:`search`,"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 top-1/2 size-lt-icon-sm -translate-y-1/2 text-lt-muted-fg`}),(0,q.jsx)(ce,{type:`search`,"data-test":`table-search`,value:r,placeholder:u,"aria-label":u,onChange:e=>c(e.target.value),className:k(`px-8`,`[&::-webkit-search-cancel-button]:hidden`)}),r!==``&&(0,q.jsx)(mv,{size:`xs`,icon:`x`,label:n(`table.search.clear`,`Clear search`),"data-test":`table-search-clear`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,onClick:l})]})}var MC=`table.columns`;function NC(){return p(MC)}function PC(e){return e}function FC({color:e,className:t,style:n,...r}){let i=le(fe(e??void 0)??de(`gray`));return(0,q.jsx)(`span`,{"data-slot":`badge`,className:k(`lt-badge`,i.className,t),style:{...i.style,...n},...r})}function IC(e,t,n){if(e==null)return``;let r=t?.props?.date;if(r)return R(e,r,n);let i=(t?.props)?.options?.find(t=>t.value===String(e))?.label;return i===void 0?typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e):i}function LC(e,t,n){let r=e.props.link;if(!r)return null;let i=r.href??String(n??``);return i===``?null:i.replace(/\{([^}]+)\}/g,(e,r)=>encodeURIComponent(String(r===`value`?n??``:t[r]??``)))}var RC=({column:e,props:t,value:n})=>{let r=IC(n,e);return r===``?null:(0,q.jsx)(FC,{color:t.colors?.[String(n)],children:r})},zC=({value:e})=>{let{t}=P(`lattice`),n=cC(e);return(0,q.jsx)(`span`,{"aria-label":n?t(`common.yes`,`Yes`):t(`common.no`,`No`),role:`img`,children:(0,q.jsx)(M,{name:n?`check`:`x`,className:k(`size-lt-icon-md`,n?`text-lt-success`:`text-lt-muted-fg`)})})},BC=({props:e,value:t})=>{let n=e.icons?.[String(t)]??e.icon??void 0;if(!n)return null;let r=fe(e.colors?.[String(t)]),i=r?le(r):void 0;return(0,q.jsx)(`span`,{"aria-label":String(t),className:k(`lt-cell-icon`,i?.className),style:i?.style,children:(0,q.jsx)(rs,{className:`size-lt-icon-md`,icon:n})})};function VC({src:e,alt:t,previewable:n,width:r,height:i,className:a,style:o,testId:s,...c}){let{t:l}=P(I),[u,d]=(0,B.useState)(!1),f=(0,q.jsx)(`img`,{...c,alt:t,src:e,width:r,height:i,className:a,style:r?{...o,width:r,height:i}:o});if(!n)return f;let p=l(`common.image.open-preview`,`View image`);return(0,q.jsxs)(Ff,{open:u,onOpenChange:d,children:[(0,q.jsx)(Lf,{asChild:!0,children:(0,q.jsx)(`button`,{type:`button`,"data-test":s,className:`cursor-zoom-in`,"aria-label":p,children:f})}),(0,q.jsxs)(Bf,{"aria-describedby":void 0,className:`max-h-[90vh] w-auto max-w-[90vw] border-none bg-transparent p-0 shadow-none`,children:[(0,q.jsx)(Rf,{className:`sr-only`,children:t||p}),(0,q.jsx)(`img`,{alt:t,src:e,"data-slot":`image-lightbox`,className:`max-h-[90vh] max-w-[90vw] rounded-lt object-contain`}),(0,q.jsx)(If,{asChild:!0,children:(0,q.jsx)(ss,{icon:`x`,"aria-label":l(`common.close`,`Close`),"data-test":`lightbox-close`,size:`icon`,emphasis:`ghost`,className:`absolute top-2 right-2 bg-lt-bg/80 hover:bg-lt-bg`})})]})]})}var HC=({column:e,props:t,value:n})=>{let r=typeof n==`string`?n:``;if(r===``)return null;let i=t.size??32;return(0,q.jsx)(VC,{alt:e.props.label??``,className:k(`object-cover`,t.circular?`rounded-full`:`rounded-lt-sm`),height:i,previewable:t.previewable,src:r,testId:`preview-${e.key}`,width:i})};function UC(e){let t=typeof e==`number`?e:Number(e);return e!=null&&e!==``&&!Number.isNaN(t)?t:null}function WC(e,t,n){let r=UC(e);if(r===null)return String(e??``);let i={notation:t.notation,minimumFractionDigits:t.minimumFractionDigits??void 0,maximumFractionDigits:t.maximumFractionDigits??void 0};return t.currency?(i.style=`currency`,i.currency=t.currency):t.unit&&(i.style=`unit`,i.unit=t.unit),new Intl.NumberFormat(n,i).format(r)}function GC({children:e,column:t,copyable:n,value:r}){return n?(0,q.jsx)(dy,{value:r,label:t.props.label??t.key,testId:`copy-${t.key}`,children:e}):e}function KC({column:e,copyable:t,format:n,value:r}){let{locale:i}=s();return UC(r)===null?(0,q.jsx)(`span`,{children:IC(r,e)}):(0,q.jsx)(GC,{column:e,copyable:t,value:String(r),children:(0,q.jsx)(`span`,{className:`tabular-nums`,children:WC(r,n,i)})})}var qC=({column:e,props:t,row:n,value:r})=>{let i=t.currencyField?n[t.currencyField]:void 0,a=t.currency??(typeof i==`string`?i:null);return(0,q.jsx)(KC,{column:e,copyable:t.copyable,value:r,format:{kind:`number`,notation:`standard`,minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,currency:a,unit:null}})},JC=({column:e,props:t,value:n})=>(0,q.jsx)(KC,{column:e,copyable:t.copyable,value:n,format:{kind:`number`,notation:t.compact?`compact`:`standard`,minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,currency:null,unit:t.unit}}),YC=({column:e,row:t})=>(0,q.jsx)(`div`,{className:`grid gap-1`,children:(0,q.jsx)(Xc,{nodes:i(e.schema,t)})}),XC=e=>e.props.multiple?(0,q.jsx)(QC,{...e}):e.props.badge?(0,q.jsx)($C,{...e}):(0,q.jsx)(ew,{...e});function ZC({label:e,color:t}){return e===``?null:(0,q.jsx)(FC,{color:t,children:e})}function QC({column:e,props:t,value:n}){let r=Array.isArray(n)?n:[];return r.length===0?null:t.badge?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map((t,n)=>{let r=t;return(0,q.jsx)(ZC,{label:IC(r.value,e),color:r.color},n)})}):(0,q.jsx)(`span`,{children:r.map(t=>IC(t,e)).join(`, `)})}function $C({column:e,props:t,row:n,value:r}){let i=t.badge.colorKey;return(0,q.jsx)(ZC,{label:IC(r,e),color:String(n[i]??``)})}function ew({column:e,props:t,row:n,value:r}){let i=e.props.date,a=LC(e,n,r),o=IC(r,e),s=a?(0,q.jsx)(`a`,{className:`underline underline-offset-2`,href:a,rel:t.link?.external?`noreferrer`:void 0,target:t.link?.external?`_blank`:void 0,children:o}):o;return i&&!a&&!t.copyable&&r!=null?(0,q.jsx)(Xs,{value:r,dateStyle:i.dateStyle,timeStyle:i.timeStyle}):(0,q.jsx)(GC,{column:e,copyable:t.copyable,value:o,children:s})}var tw={"column.badge":PC(RC),"column.boolean":PC(zC),"column.icon":PC(BC),"column.image":PC(HC),"column.money":PC(qC),"column.number":PC(JC),"column.stack":PC(YC),"column.text":PC(XC)};function nw({column:e,row:t}){let n=NC()[e.type]??tw[e.type]??tw[`column.text`];return(0,q.jsx)(n,{column:e,props:e.props,row:t,value:t[e.key]})}var rw={components:{table:V(({node:e})=>{let{t}=P(`lattice`),{columns:n,rows:r,pagination:i,query:a,filters:o,tableFilters:s,search:c,addFilter:l,updateFilter:u,removeFilter:d,replaceColumnFilters:f,setTableFilter:p,resetFilters:m,setSearch:h,searchFilterOptions:g,processing:_,hasLoaded:v,infiniteLoaderRef:y,sort:b,clearSort:x,goToPage:S,setPerPage:C,loadMore:w}=KS(e),T=(0,B.useMemo)(()=>aC(e.props?.bulkActions),[e.props?.bulkActions]),E=T.length>0,D=(0,B.useMemo)(()=>r.map((e,t)=>({row:e,actions:wS(e),detail:TS(e),key:CS(e,t)})),[r]),O=qS(D.map(e=>e.key)),{isExpanded:ee,toggle:A}=QS(),j=D.some(e=>e.detail!=null),N=(0,B.useMemo)(()=>new Map(n.map(e=>[e.key,e])),[n]),F=J(e),{hasToggleableColumns:I,hasHidden:te,isVisible:ne,resetVisibility:re,setColumnVisible:L,toggleableColumns:R,visibleColumns:ie}=JS({columns:n,storageKey:F?`lattice:table-column-visibility:${F}`:void 0}),z=i.currentPage??a.page,ae=i.lastPage??z,oe=i.mode??`table`,se=(0,B.useMemo)(()=>bS(e.props?.perPageOptions),[e.props?.perPageOptions]),ce=HS(z,ae),le=i.hasMore??z<ae,ue=D.some(e=>e.actions.length>0),de=e.props?.striped===!0,fe=ie.some(e=>e.props.filter!=null),pe=o.map((e,t)=>({clause:e,index:t})),me=(0,B.useMemo)(()=>Array.isArray(e.props?.filters)?e.props.filters:[],[e.props?.filters]),he=me.length>0,ge=ue,V=(0,B.useMemo)(()=>Array.isArray(e.props?.toolbar)?e.props.toolbar:[],[e.props?.toolbar]),_e=(0,B.useMemo)(()=>US(ie),[ie]),ve=(0,B.useMemo)(()=>GS(ge,E,j),[ge,E,j]),ye=e.props?.resizableColumns===!0,be=J(e),{getResizeHandleProps:xe,gridTemplateColumns:Se,hasOverrides:Ce,resizeRootRef:we,resetColumns:Te}=wg({columns:_e,enabled:ye,leadingTracks:ve.leadingTracks,showIndicator:e.props?.resizeIndicator===!0,storageKey:ye&&be?`lattice:table-columns:${be}`:void 0,trailingTracks:ve.trailingTracks}),Ee=e.props?.searchable===!0||V.length>0||he||I||Ce;return(0,q.jsx)(`div`,{"data-slot":`table`,"data-lattice-component":e.id,className:`relative min-w-0`,children:(0,q.jsxs)(`div`,{"data-slot":`table-scroll`,className:`rounded-lt-sm border border-lt-border`,children:[Ee&&(0,q.jsxs)(`div`,{"data-slot":`table-toolbar`,className:`flex items-center gap-2 border-b border-lt-border px-4 py-2`,children:[e.props?.searchable&&(0,q.jsx)(jC,{value:c,onSearch:h}),(0,q.jsxs)(`div`,{className:`ms-auto flex items-center gap-1`,children:[he&&(0,q.jsx)(DC,{filters:me,values:s,processing:_,onChange:p,onSearch:g}),I&&(0,q.jsx)(wC,{columns:R,isVisible:ne,visibleColumnCount:ie.length,hasHidden:te,onToggle:L,onReset:re,processing:_}),Ce&&(0,q.jsx)(`button`,{"aria-label":t(`table.reset-column-widths`,`Reset column widths`),className:`hidden rounded-lt-sm p-1 text-lt-muted-fg hover:text-lt-fg md:inline-flex`,"data-test":`table-reset-columns`,onClick:Te,title:t(`table.reset-column-widths`,`Reset column widths`),type:`button`,children:(0,q.jsx)(M,{name:`rotate-ccw`,className:`size-lt-icon-sm`})}),V.map((e,t)=>(0,q.jsx)(Y,{node:e},e.key??e.id??t))]})]}),(0,q.jsx)(TC,{clauses:o,columnsByKey:N,indicators:a.tableFilterIndicators,processing:_,onRemoveClause:d,onChange:p,onReset:m}),E&&O.active&&(0,q.jsx)(oC,{actions:T,selectedKeys:O.selectedKeys,allMatching:O.allMatching,total:i.total??void 0,query:PS(a),canSelectAllMatching:O.allVisibleSelected&&!O.allMatching&&i.total!=null&&i.total>O.selectedKeys.length,onSelectAllMatching:O.selectAllMatching,onCompleted:O.clear}),a.sorts.length>0&&(0,q.jsx)(kC,{columnsByKey:N,query:a,processing:_,onClear:x}),(0,q.jsx)(`div`,{"data-slot":`table-grid-scroll`,className:`relative overflow-x-auto`,children:(0,q.jsxs)(`div`,{ref:we,className:`min-w-full text-base`,role:`table`,style:{"--lattice-table-columns":Se},children:[(0,q.jsxs)(`div`,{"data-slot":`table-header`,role:`rowgroup`,children:[(0,q.jsxs)(`div`,{className:`hidden min-w-full md:grid md:grid-cols-[var(--lattice-table-columns)]`,role:`row`,children:[j&&(0,q.jsx)(`div`,{className:k(`bg-lt-muted/50 px-2 py-3`,!fe&&`border-b border-lt-border`),role:`columnheader`,"aria-hidden":`true`}),E&&(0,q.jsx)(`div`,{className:k(`flex items-center bg-lt-muted/50 px-4 py-3`,!fe&&`border-b border-lt-border`),role:`columnheader`,children:(0,q.jsx)(f_,{"aria-label":t(`table.select-all-rows`,`Select all rows`),"data-test":`select-all`,checked:O.allSelected,onCheckedChange:()=>O.toggleAll()})}),ie.map((e,t)=>(0,q.jsx)(CC,{column:e,processing:_,resizeHandleProps:ye?xe(_e[t]):void 0,sort:b,query:a,bottomBordered:!fe},e.key)),ge&&(0,q.jsx)(`div`,{className:k(`flex items-center justify-end gap-2 bg-lt-muted/50 px-4 py-2 align-middle font-semibold text-lt-fg`,!fe&&`border-b border-lt-border`),role:`columnheader`,children:(0,q.jsx)(`span`,{className:`sr-only`,children:e.props?.actionsLabel??t(`table.actions`,`Actions`)})})]}),fe&&(0,q.jsxs)(`div`,{className:`hidden min-w-full md:grid md:grid-cols-[var(--lattice-table-columns)]`,role:`row`,children:[j&&(0,q.jsx)(`div`,{className:`border-t border-b border-lt-border bg-lt-muted/50 px-2 py-2`,role:`cell`}),E&&(0,q.jsx)(`div`,{className:`border-t border-b border-lt-border bg-lt-muted/50 px-4 py-2`,role:`cell`}),ie.map(e=>(0,q.jsx)(`div`,{className:`min-w-0 border-t border-b border-lt-border bg-lt-muted/50 px-2 py-2`,role:`cell`,children:e.props.filter!=null&&(0,q.jsx)(mC,{column:e,clauses:pe.filter(t=>t.clause.field===e.key),processing:_,onAdd:l,onUpdate:u,onRemove:d,onReplace:f,onSearch:(t,n)=>g(`column:${e.key}`,t,n)})},e.key)),ge&&(0,q.jsx)(`div`,{className:`border-t border-b border-lt-border bg-lt-muted/50 px-4 py-2`,role:`cell`})]})]}),(0,q.jsx)(`div`,{role:`rowgroup`,children:v?D.length===0?(0,q.jsx)(`div`,{"data-slot":`table-empty`,className:`p-8 text-center text-lt-muted-fg`,role:`row`,children:(0,q.jsx)(`div`,{role:`cell`,children:e.props?.emptyLabel??t(`table.empty`,`No results`)})}):D.map(({row:n,actions:r,detail:i,key:a})=>{let o=i!=null&&ee(a),s=`${J(e)??`table`}-row-detail-${a}`;return(0,q.jsxs)(B.Fragment,{children:[(0,q.jsxs)(`div`,{"data-slot":`table-row`,className:`grid grid-cols-1 border-b border-lt-border last:border-b-0 md:grid-cols-[var(--lattice-table-columns)] ${de?`odd:bg-lt-muted/30`:``}`,role:`row`,children:[j&&(0,q.jsx)(`div`,{className:`flex items-center px-2 py-lt-cell-y`,role:`cell`,children:i&&(0,q.jsx)(`button`,{type:`button`,"data-test":`row-expand-${a}`,"aria-expanded":o,"aria-controls":s,"aria-label":t(`table.row-detail.toggle`,`Toggle detail`),className:`inline-flex size-6 items-center justify-center rounded-lt-sm text-lt-muted-fg hover:bg-lt-muted hover:text-lt-fg`,onClick:()=>A(a),children:(0,q.jsx)(M,{name:`chevron-down`,"aria-hidden":`true`,className:k(`size-lt-icon-md transition-transform`,!o&&`-rotate-90`)})})}),E&&(0,q.jsx)(`div`,{className:`flex items-center px-lt-cell-x py-lt-cell-y`,role:`cell`,children:(0,q.jsx)(f_,{"aria-label":t(`table.select-row`,`Select row {{key}}`,{key:a}),"data-test":`select-row-${a}`,checked:O.isSelected(a),onCheckedChange:()=>O.toggle(a)})}),ie.map(e=>(0,q.jsxs)(`div`,{"data-slot":`table-cell`,className:k(`grid min-w-0 content-center gap-1 overflow-hidden px-lt-cell-x py-lt-cell-y`,nC(e.props.align),iC(e.props.align)),role:`cell`,children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs font-medium text-lt-muted-fg md:hidden`,children:e.props.label}),(0,q.jsx)(`div`,{"data-slot":`table-cell-content`,className:`min-w-0 max-w-full overflow-hidden truncate`,children:(0,q.jsx)(nw,{column:e,row:n})})]},e.key)),ge&&(0,q.jsx)(`div`,{className:k(`items-center justify-start gap-2 px-lt-cell-x py-lt-cell-y md:justify-end`,r.length>0?`flex`:`hidden md:flex`),role:`cell`,children:r.map((e,t)=>(0,q.jsx)(Y,{node:e},e.key??e.id??t))})]}),o&&i&&(0,q.jsx)(`div`,{id:s,role:`region`,"data-slot":`table-row-detail`,className:`border-b border-lt-border bg-lt-muted/20 px-lt-cell-x py-lt-cell-y`,children:(0,q.jsx)(Xc,{nodes:[i]})})]},a)}):(0,q.jsx)(`div`,{className:`p-4 text-lt-muted-fg`,role:`row`,children:(0,q.jsx)(`div`,{role:`cell`,children:t(`table.loading`,`Loading rows...`)})})})]})}),v&&(0,q.jsx)(OC,{pagination:i,currentPage:z,processing:_,mode:oe,hasNextPage:le,visiblePages:ce,infiniteLoaderRef:y,perPageOptions:se,perPageValue:oe===`infinite`?`infinite`:a.perPage,onPerPage:C,onPage:S,onLoadMore:w})]})})})},name:`lattice/table`},iw={xs:`size-6 text-[0.5rem]`,sm:`size-8 text-xs`,md:`size-10 text-sm`,lg:`size-12 text-base`,xl:`size-16 text-lg`,"2xl":`size-20 text-xl`,"3xl":`size-24 text-2xl`,"4xl":`size-32 text-3xl`};function aw({className:e,name:t,shape:n=`circle`,size:r=`md`,src:i,...a}){let o=t??void 0;return(0,q.jsx)(`span`,{"data-slot":`avatar`,role:i?void 0:`img`,"aria-label":i?void 0:o,className:k(`inline-flex shrink-0 items-center justify-center overflow-hidden bg-lt-muted font-medium text-lt-muted-fg select-none`,n===`rounded`?`rounded-lt`:`rounded-full`,iw[r],e),...a,children:i?(0,q.jsx)(`img`,{src:i,alt:o??``,className:`size-full object-cover`}):t?ow(t):(0,q.jsx)(sw,{})})}function ow(e){return e.trim().split(/\s+/).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)}function sw(){return(0,q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`size-[60%]`,children:[(0,q.jsx)(`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`7`,r:`4`})]})}function cw({children:e,className:t,defaultOpen:n,onOpenChange:r,open:i,storageKey:a,tooltip:o,trigger:s,triggerProps:c,...l}){let u=(0,B.useId)(),[d,f]=Nx(a??``,n??!1,i===void 0&&a!==void 0),p=i??d,{className:m,onClick:h,onKeyDown:g,..._}=c??{};function v(e){i===void 0&&e!==d&&f(),r?.(e)}function y(e){h?.(e),!(e.defaultPrevented||lw(e.target,e.currentTarget))&&v(!p)}function b(e){g?.(e),!(e.defaultPrevented||e.target!==e.currentTarget)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!p))}return(0,q.jsxs)(`div`,{"data-slot":`collapsible`,"data-state":p?`open`:`closed`,className:t,...l,children:[(0,q.jsxs)(`div`,{..._,"aria-controls":u,"aria-expanded":p,"data-slot":`collapsible-trigger`,className:k(`flex min-h-11 w-full cursor-pointer items-center justify-between gap-4 rounded-lt-sm py-2 text-left text-lt-fg transition-colors select-none hover:bg-lt-muted focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 focus-visible:outline-none`,m),onClick:y,onKeyDown:b,role:`button`,tabIndex:0,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[s,o?(0,q.jsx)(Vh,{content:o}):null]}),(0,q.jsx)(M,{name:`chevron-down`,className:k(`size-lt-icon-md shrink-0 text-lt-muted-fg transition-transform motion-reduce:transition-none`,!p&&`-rotate-90`)})]}),p&&e!=null?(0,q.jsx)(`div`,{id:u,"data-slot":`collapsible-content`,className:`flex flex-col gap-4 pt-2`,children:e}):null]})}function lw(e,t){if(!(e instanceof Element))return!1;let n=e.closest(`a[href], button, input, select, textarea, [contenteditable="true"], [role="button"]`);return n!==null&&n!==t}var uw=(0,B.createContext)(`description-list`),dw=uw.Provider;function fw(){return(0,B.useContext)(uw)}function pw({bleed:e=!1,children:t,className:n,divided:r=!1,emptyLabel:i,semantic:a=`description-list`,...o}){let s=a===`description-list`,c=k(`w-full`,r&&`divide-y divide-lt-border`,e&&`-mx-lt-gutter w-auto`,n),l=t??(i?(0,q.jsx)(`p`,{className:`px-lt-gutter py-3 text-sm text-lt-muted-fg`,children:i}):null);return(0,q.jsx)(dw,{value:a,children:s?(0,q.jsx)(`dl`,{...o,className:c,"data-slot":`description-list`,children:l}):(0,q.jsx)(`div`,{...o,className:c,"data-slot":`description-list`,role:`list`,children:l})})}function mw({"aria-label":e,children:t,className:n,defaultOpen:r=!1,offset:i=16,onOpenChange:a,open:o,placement:s=`bottom-end`,role:c,style:l,trigger:u,triggerProps:d,...f}){let[p,m]=(0,B.useState)(r),h=o??p,{className:g,onClick:_,...v}=d??{},y=hw(s,Math.max(0,i));if(u==null)return(0,q.jsx)(`div`,{"aria-label":e,className:k(`fixed z-lt-popover max-w-[calc(100vw-2rem)] rounded-lt border border-lt-border bg-lt-popover p-1 text-lt-popover-fg shadow-lt-md`,n),role:e?c??`group`:c,...f,style:{...y,...l},children:t});let b=s===`bottom-start`||s===`bottom-end`,x=s===`top-start`||s===`bottom-start`;function S(e){if(_?.(e),e.defaultPrevented)return;let t=!h;o===void 0&&m(t),a?.(t)}return(0,q.jsx)(`div`,{"aria-label":e,className:k(`fixed z-lt-popover max-w-[calc(100vw-2rem)]`,n),role:e?c??`group`:c,...f,style:{...y,...l},children:(0,q.jsxs)(`div`,{className:k(`flex w-fit gap-2`,b?`flex-col-reverse`:`flex-col`),children:[(0,q.jsx)(`button`,{...v,"aria-expanded":h,className:k(`inline-flex items-center gap-2 rounded-lt border border-lt-border bg-lt-popover px-3 py-1.5 text-sm font-medium text-lt-popover-fg shadow-lt-md hover:bg-lt-muted`,x?`self-start`:`self-end`,g),onClick:S,type:`button`,children:u}),(0,q.jsx)(`div`,{className:h?`block`:`hidden`,children:t})]})})}function hw(e,t){return e===`top-start`?{left:t,top:t}:e===`top-end`?{right:t,top:t}:e===`bottom-start`?{bottom:t,left:t}:{bottom:t,right:t}}function gw(e,t,n){let r=Object.entries(e??{});if(r.length!==0)return Object.fromEntries(r.map(([e,r])=>[`${t}-${e}`,n(r)]))}var _w=e=>typeof e==`number`?`repeat(${e}, minmax(0, 1fr))`:e,vw=e=>e===`full`?`1 / -1`:`span ${e} / span ${e}`;function yw({className:e,columns:t,style:n,...r}){return(0,q.jsx)(`div`,{"data-slot":`grid`,className:k(`lt-grid grid gap-x-4 gap-y-6`,e),style:{...n,...gw(t,`--lt-grid-cols`,_w)},...r})}function bw({className:e,columnSpan:t,style:n,...r}){return(0,q.jsx)(`div`,{"data-slot":`grid-item`,className:e,style:{...n,...gw(t,`--lt-col-span`,vw)},...r})}function xw({children:e,className:t,copyable:n=!1,copyLabel:r,copyValue:i,level:a=1,tooltip:o,...s}){let c=Math.min(Math.max(a,1),6),l=Sw(c),u=(0,q.jsxs)(l,{"data-slot":`heading`,className:k(`font-semibold tracking-normal text-balance text-lt-fg`,c===1&&`text-2xl font-bold leading-tight`,c===2&&`text-xl`,c>2&&`text-base`,t),...s,children:[e,(0,q.jsx)(Vh,{content:o})]}),d=i??(typeof e==`string`?e:void 0);return!n||d===void 0?u:(0,q.jsx)(dy,{value:d,label:r??d,children:u})}function Sw(e){switch(e){case 1:return`h1`;case 2:return`h2`;case 3:return`h3`;case 4:return`h4`;case 5:return`h5`;default:return`h6`}}function Cw({alt:e,circular:t=!1,className:n,height:r,previewable:i=!1,size:a,width:o,...s}){return(0,q.jsx)(VC,{...s,alt:e??``,className:k(`object-cover`,t?`rounded-full`:`rounded-lt-sm`,n),height:a??r,previewable:i,width:a??o})}var ww={xs:`h-1`,sm:`h-1.5`,md:`h-2.5`,lg:`h-3`,xl:`h-4`,"2xl":`h-5`,"3xl":`h-6`,"4xl":`h-8`},Tw={xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":96,"4xl":128},Ew={xs:`text-[0.5rem]`,sm:`text-[0.625rem]`,md:`text-xs`,lg:`text-sm`,xl:`text-base`,"2xl":`text-lg`,"3xl":`text-xl`,"4xl":`text-2xl`};function Dw({"aria-label":e,className:t,color:n,locale:r,max:i=100,shape:a=`bar`,showValue:o=!1,size:c=`md`,value:l,...u}){let{locale:d}=s(),f=ue(fe(n)??de(`primary`)),p=i>0?Math.min(Math.max(l,0),i):0,m=i>0?p/i:0,h=new Intl.NumberFormat(r??d,{maximumFractionDigits:0,style:`percent`}).format(m),g={"aria-label":e,"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":p,"aria-valuetext":h,role:`progressbar`};if(a===`circle`){let e=Tw[c],n=Math.max(3,e/10),r=(e-n)/2,i=2*Math.PI*r;return(0,q.jsxs)(`div`,{...u,...g,className:k(`relative inline-flex`,t),"data-lattice-progress":`circle`,children:[(0,q.jsxs)(`svg`,{className:`-rotate-90`,height:e,width:e,children:[(0,q.jsx)(`circle`,{className:`text-lt-muted`,cx:e/2,cy:e/2,fill:`none`,r,stroke:`currentColor`,strokeWidth:n}),(0,q.jsx)(`circle`,{cx:e/2,cy:e/2,fill:`none`,r,stroke:`currentColor`,strokeDasharray:i,strokeDashoffset:i*(1-m),strokeLinecap:`round`,strokeWidth:n,style:{color:f}})]}),o?(0,q.jsx)(`span`,{className:k(`absolute inset-0 flex items-center justify-center font-medium text-lt-fg tabular-nums`,Ew[c]),children:h}):null]})}return(0,q.jsxs)(`div`,{...u,className:k(`flex w-full items-center gap-2`,t),"data-lattice-progress":`bar`,children:[(0,q.jsx)(`div`,{...g,className:k(`w-full overflow-hidden rounded-full bg-lt-muted`,ww[c]),children:(0,q.jsx)(`div`,{className:`h-full rounded-full`,style:{background:f,width:`${m*100}%`}})}),o?(0,q.jsx)(`span`,{className:`shrink-0 text-lt-muted-fg text-sm tabular-nums`,children:h}):null]})}function Ow({children:e,className:t,collapsed:n,collapsible:r=!1,collapseLabel:i=`Collapse section`,defaultCollapsed:a=!1,description:o,expandLabel:s=`Expand section`,headerActions:c,onCollapsedChange:l,storageKey:u,title:d,toggleProps:f,tooltip:p,...m}){let[h,g]=Nx(u??``,a,r&&n===void 0&&u!==void 0),_=r&&(n??h),v=kw(d),y=kw(o),b=kw(c),x=v||y||b||r,{className:S,onClick:C,...w}=f??{};function T(e){if(C?.(e),e.defaultPrevented)return;let t=!_;n===void 0&&g(),l?.(t)}return(0,q.jsxs)(`section`,{...m,"data-slot":`section`,className:k(`flex flex-col gap-6 rounded-lt border border-lt-border bg-lt-surface py-lt-gutter text-lt-surface-fg shadow-lt-sm`,t),children:[x?(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-lt-gutter`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[r?(0,q.jsx)(`button`,{...w,"aria-expanded":!_,"aria-label":_?s:i,className:k(`mt-0.5 inline-flex shrink-0 items-center rounded-lt-sm p-0.5 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`,S),onClick:T,type:`button`,children:(0,q.jsx)(M,{name:`chevron-down`,className:k(`size-lt-icon-md transition-transform`,_&&`-rotate-90`)})}):null,(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[v?(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(`div`,{className:`font-semibold leading-none`,children:d}),(0,q.jsx)(Vh,{content:p})]}):null,y?(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(`div`,{className:`text-sm text-lt-muted-fg`,children:o}),v?null:(0,q.jsx)(Vh,{content:p})]}):null]})]}),b?(0,q.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c}):null]}):null,!_&&kw(e)?(0,q.jsx)(`div`,{className:`flex flex-col gap-6 px-lt-gutter`,children:e}):null]})}function kw(e){return e!=null&&e!==!1&&e!==``}function Aw({bleed:e=!1,className:t,orientation:n=`horizontal`,...r}){let i=n===`horizontal`;return(0,q.jsx)(`div`,{...r,role:`separator`,"aria-orientation":n,"data-bleed":e?``:void 0,"data-slot":`separator`,className:k(`shrink-0 bg-lt-border`,i?`h-px w-full`:`h-full w-px self-stretch`,e&&(i?`-mx-lt-gutter w-auto`:`-my-lt-gutter h-auto`),t)})}var jw={center:`justify-items-center text-center`,start:`justify-items-start text-left`,stretch:`justify-items-stretch`},Mw={center:`items-center text-center`,start:`items-center text-left`,stretch:`items-stretch justify-stretch`},Nw={none:`gap-0`,xs:`gap-1`,sm:`gap-2`,md:`gap-4`,lg:`gap-6`,xl:`gap-8`},Pw={full:`w-full`,auto:`w-auto`,sm:`mx-auto w-full max-w-md`,md:`mx-auto w-full max-w-2xl`,lg:`mx-auto w-full max-w-4xl`,fill:`min-w-0 flex-1`},Fw={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`},Iw={full:`h-full`,screen:`min-h-screen`},Lw={start:`mr-auto`,end:`ml-auto`};function Rw({align:e=`stretch`,className:t,direction:n=`column`,float:r,gap:i=`md`,height:a,justify:o,width:s=`full`,...c}){let l=n===`row`||o!==void 0;return(0,q.jsx)(`div`,{"data-slot":`stack`,className:k(l?k(`flex`,n===`row`?`flex-wrap`:`flex-col`):`grid content-start`,l?Mw[e]??Mw.stretch:jw[e]??jw.stretch,Nw[i],Pw[s],o?Fw[o]:null,a?Iw[a]:null,r?Lw[r]:null,t),...c})}var zw=(0,B.createContext)(null),Bw=3;function Vw(){return(0,B.useContext)(zw)??{activeValue:``,hasTablist:!0}}function Hw({"aria-label":e=`Tabs`,alignment:t=`stretch`,children:n,className:r,defaultValue:i,items:a,onValueChange:o,orientation:s=`horizontal`,value:c,...l}){let u=Ww(n),d=a??u.map(({props:e})=>e),f=d[0]?.value??``,[p,m]=(0,B.useState)(()=>i||f),h=c??p,g=(0,B.useRef)(null),_=s===`vertical`,v=!_&&t===`stretch`,y=!Mg(`(min-width: 768px)`,!0)&&(_||d.length>Bw),b=(0,B.useMemo)(()=>({activeValue:h,hasTablist:!y}),[h,y]);function x(e){d.some(t=>t.value===e)&&(c===void 0&&m(e),o?.(e))}function S(e){let t=_?`ArrowDown`:`ArrowRight`,n=_?`ArrowUp`:`ArrowLeft`;if(e.key!==t&&e.key!==n&&e.key!==`Home`&&e.key!==`End`)return;let r=Array.from(g.current?.querySelectorAll(`[role="tab"]`)??[]);if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement),a;if(e.key===`Home`)a=0;else if(e.key===`End`)a=r.length-1;else{let n=e.key===t?1:-1;a=((i<0?0:i)+n+r.length)%r.length}r[a]?.focus()}return(0,q.jsx)(zw.Provider,{value:b,children:(0,q.jsxs)(`div`,{...l,className:k(`gap-6`,_&&!y?k(`flex`,t===`end`&&`flex-row-reverse`):`grid`,r),children:[y?(0,q.jsx)(sC,{"aria-label":e,"data-test":`tabs-select`,onChange:e=>x(e.target.value),value:h,children:d.map(e=>(0,q.jsx)(`option`,{value:e.value,children:e.selectLabel??Gw(e.label,e.value)},e.value))}):(0,q.jsx)(`div`,{"aria-label":e,"aria-orientation":s,className:k(`gap-1`,_?`flex w-44 shrink-0 flex-col self-start`:`rounded-lt bg-lt-muted p-1`,v&&`flex w-full`,!_&&!v&&k(`inline-flex w-fit max-w-full overflow-x-auto`,{"justify-self-center":t===`center`,"justify-self-end":t===`end`})),ref:g,role:`tablist`,children:d.map(e=>{let t=h===e.value;return(0,q.jsx)(`button`,{"aria-controls":`${e.value}-panel`,"aria-selected":t,"data-test":`tab-${e.value}`,className:k(_?Kw(t):y_(t),v&&`flex-1`),id:`${e.value}-tab`,onClick:()=>x(e.value),onKeyDown:S,role:`tab`,tabIndex:t?0:-1,type:`button`,children:e.label},e.value)})}),(0,q.jsx)(`div`,{className:k(`min-w-0`,_&&!y&&`flex-1`),children:n})]})})}function Uw({"aria-label":e,children:t,className:n,label:r,selectLabel:i,value:a,...o}){let{activeValue:s,hasTablist:c}=Vw(),l=s===a,[u,d]=(0,B.useState)(l);return(0,B.useEffect)(()=>{l&&d(!0)},[l]),(0,q.jsx)(`section`,{...o,"aria-label":c?void 0:e??i??Gw(r,a),"aria-labelledby":c?`${a}-tab`:void 0,className:k(`space-y-8`,!l&&`hidden`,n),hidden:!l,id:`${a}-panel`,role:`tabpanel`,tabIndex:0,children:u?t:null})}function Ww(e){let t=[];return B.Children.forEach(e,e=>{if((0,B.isValidElement)(e)){if(e.type===Uw){t.push(e);return}e.type===B.Fragment&&t.push(...Ww(e.props.children))}}),t}function Gw(e,t){return typeof e==`string`||typeof e==`number`||typeof e==`bigint`?String(e):(0,B.isValidElement)(e)?Gw(e.props.children,t):Array.isArray(e)&&e.map(e=>Gw(e,``)).join(``)||t}function Kw(e){return k(`relative rounded-lt-sm px-3 py-2.5 text-left text-sm font-medium transition-colors`,e?`bg-lt-muted text-lt-fg before:absolute before:inset-y-2 before:left-0 before:w-1 before:rounded-full before:bg-lt-primary`:`text-lt-muted-fg hover:bg-lt-muted/60 hover:text-lt-fg`)}var qw={center:`text-center`,left:`text-left`},Jw={xs:`text-xs leading-5`,sm:`text-sm leading-6`,md:`text-base leading-7`,lg:`text-lg leading-8`,xl:`text-xl leading-8`,"2xl":`text-2xl leading-9`,"3xl":`text-3xl leading-10`,"4xl":`text-4xl leading-none`};function Yw({align:e=`left`,children:t,className:n,color:r,copyable:i=!1,copyLabel:a,copyValue:o,size:s=`md`,style:c,...l}){let u=ue(fe(r)??de(`muted`)),d=(0,q.jsx)(`p`,{"data-slot":`text`,className:k(`m-0`,qw[e],Jw[s],n),style:{color:u,...c},...l,children:t}),f=o??(typeof t==`string`?t:void 0);return!i||f===void 0?d:(0,q.jsx)(dy,{value:f,label:a??f,children:d})}function Xw({"aria-label":e,content:t,trigger:n}){let{t:r}=P(I);if(!Zw(t))return null;let i=Zw(n);return(0,q.jsxs)(jh,{children:[(0,q.jsx)(Mh,{type:`button`,"aria-label":e??(i?void 0:r(`common.more-info`,`More information`)),className:i?`inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]`:`ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]`,children:i?n:(0,q.jsx)(M,{name:`info`,className:`size-lt-icon-sm`})}),(0,q.jsx)(Ph,{align:`start`,className:`max-w-xs p-3 text-sm [&_a]:underline`,children:t})]})}function Zw(e){return e!=null&&e!==!1&&e!==``}function Qw({children:e,className:t,description:n,headerActions:r,title:i,tooltip:a,...o}){let s=rT(i),c=rT(n),l=rT(r),u=s||c||l;return(0,q.jsxs)(`article`,{...o,"data-slot":`card`,className:k(`flex flex-col gap-6 rounded-lt border border-lt-border bg-lt-surface py-lt-gutter text-lt-surface-fg shadow-lt-sm`,t),children:[u?(0,q.jsxs)($w,{children:[s||l?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[s?(0,q.jsx)(eT,{children:i}):null,s?(0,q.jsx)(Xw,{content:a}):null]}),l?(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]}):null,c?(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(tT,{children:n}),s?null:(0,q.jsx)(Xw,{content:a})]}):null]}):null,rT(e)?(0,q.jsx)(nT,{className:`flex flex-col gap-6`,children:e}):null]})}function $w({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-header`,className:k(`flex flex-col gap-1.5 px-lt-gutter`,e),...t})}function eT({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-title`,className:k(`font-semibold leading-none`,e),...t})}function tT({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-description`,className:k(`text-sm text-lt-muted-fg`,e),...t})}function nT({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-lt-gutter`,e),...t})}function rT(e){return e!=null&&e!==!1&&e!==``}var iT=(0,B.lazy)(()=>ge(()=>import(`./code-block-view-4IbUdTmO.js`),__vite__mapDeps([19,1,2,5,13]),import.meta.url));function aT({"aria-label":e,children:t,className:n,copyable:r=!1,language:i=`text`,lineNumbers:a=!1,maxHeight:o=null,role:s=e?`region`:void 0,wrap:c=!1,...l}){let u=(0,q.jsx)(`pre`,{className:k(`max-w-full overflow-auto p-3 font-lt-mono text-xs`,c&&`whitespace-pre-wrap wrap-anywhere`),style:{maxHeight:o??void 0},children:a?(0,q.jsx)(`code`,{className:`grid grid-cols-[auto_1fr]`,children:t.split(`
|
|
158
|
+
`).map((e,t)=>(0,q.jsxs)(B.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`mr-3 border-r border-lt-border pr-3 text-right text-lt-muted-fg select-none`,children:t+1}),(0,q.jsx)(`span`,{children:e||``})]},t))}):t});return(0,q.jsxs)(`div`,{"data-slot":`code-block`,"aria-label":e,role:s,...l,className:k(`relative max-w-full overflow-hidden rounded-lt-sm bg-lt-muted text-lt-fg`,n),children:[r?(0,q.jsx)(uy,{value:t,label:e??`code`,iconOnly:!0,className:`absolute top-3 right-6 z-10 bg-lt-bg/80 hover:bg-lt-bg`}):null,(0,q.jsx)(B.Suspense,{fallback:u,children:(0,q.jsx)(iT,{language:i,lineNumbers:a,maxHeight:o,wrap:c,children:t})})]})}function oT({className:e=``,children:t,...n}){let{Link:r}=Hs();return(0,q.jsx)(r,{className:k(`text-lt-fg underline decoration-lt-border underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-lt-border`,e),...n,children:t})}function sT(){let{locale:e}=s(),{timezone:t}=z();return(0,B.useMemo)(()=>({locale:e,timezone:t}),[e,t])}function cT(e){return e.kind===`date`}function lT(e,t,n){return t===null?String(e??``):cT(t)?R(e,t,{locale:n.locale,timeZone:n.timezone}):WC(e,t,n.locale)}var uT=({node:e})=>(0,q.jsx)(aw,{"data-lattice-component":J(e),name:e.props.name,shape:e.props.shape,size:e.props.size,src:e.props.src}),dT=({node:e})=>(0,q.jsx)(FC,{color:e.props.color,children:e.props.label}),fT=({node:e})=>{let{label:t,icon:n}=e.props,r=e.props.variant??null,i=e.props.emphasis??`solid`,a=J(e),o=Sx(e.props),{Link:s}=Hs(),c=n?`icon`:`md`,l=n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(rs,{className:`size-lt-icon-md`,icon:n}),t?(0,q.jsx)(`span`,{className:`sr-only`,children:t}):null]}):t,u=({onClick:e,processing:t})=>(0,q.jsx)(ss,{"data-test":a,disabled:t,emphasis:i,onClick:e,size:c,variant:r,children:l});return o.kind===`navigate`?(0,q.jsx)(ss,{asChild:!0,"data-test":a,emphasis:i,variant:r,size:c,children:(0,q.jsx)(s,{href:o.href,method:o.method??void 0,children:l})}):o.kind===`action`?(0,q.jsx)(xx,{action:o.action,children:u}):o.kind===`effects`||o.kind===`modal`?u({onClick:o.onClick,processing:!1}):(0,q.jsx)(ss,{"data-test":a,emphasis:i,size:c,type:e.props.buttonType,variant:r,children:l})},pT=({children:e,node:t})=>{let n=Bc(t.props.headerActions),r=t.props.tooltip;return(0,q.jsx)(Qw,{"data-lattice-component":J(t),description:t.props.description,headerActions:n.length>0?(0,q.jsx)(Xc,{nodes:n}):null,title:t.props.title,tooltip:r?(0,q.jsx)(`div`,{dangerouslySetInnerHTML:{__html:r}}):null,children:e})},mT=(0,B.lazy)(()=>ge(()=>import(`./chart-view-BxNPMybJ.js`),__vite__mapDeps([20,1,2,21,3,5,7,22,14]),import.meta.url)),hT=({children:e,node:t})=>(0,q.jsx)(B.Suspense,{fallback:null,children:(0,q.jsx)(mT,{node:t,children:e})}),gT=({node:e})=>(0,q.jsx)(aT,{copyable:e.props.copyable,language:e.props.language,lineNumbers:e.props.lineNumbers,maxHeight:e.props.maxHeight,wrap:e.props.wrap,children:e.props.code}),_T=({children:e,node:t})=>{let n=t.props.rememberState!==!1,r=Bc(t.props.trigger),i=J(t);return(0,q.jsx)(cw,{...n?{storageKey:`lattice:collapsible:${i??`default`}`}:{},"data-lattice-component":i,defaultOpen:t.props.collapsed===!1,tooltip:t.props.tooltip,trigger:(0,q.jsx)(Xc,{nodes:r}),triggerProps:{"data-test":tc(`collapsible-toggle`,i)??`collapsible-toggle-default`},children:e})},vT=({children:e,node:t})=>(0,q.jsx)(pw,{bleed:t.props.bleed,"data-lattice-component":J(t),divided:t.props.divided,emptyLabel:t.props.emptyLabel,semantic:t.props.semantic===`list`?`list`:`description-list`,children:e}),yT=({children:e,node:t})=>{let n=Bc(t.props.trigger),r=J(t);return(0,q.jsx)(mw,{"aria-label":t.props.label??void 0,"data-lattice-component":r,offset:t.props.offset??16,placement:t.props.placement??`bottom-end`,trigger:n.length>0?(0,q.jsx)(Xc,{nodes:n}):void 0,triggerProps:{"data-test":r?`${r}-trigger`:void 0},children:e})},bT=({node:e})=>(0,q.jsx)(yw,{columns:e.props.columns??void 0,"data-lattice-component":J(e),children:(e.schema??[]).map((e,t)=>(0,q.jsx)(bw,{columnSpan:e.props?.columnSpan,children:(0,q.jsx)(Y,{node:e})},Vc(e,t)))}),xT=({node:e})=>(0,q.jsx)(xw,{copyable:e.props.copyable,copyLabel:e.props.text,copyValue:e.props.text,"data-lattice-component":J(e),level:e.props.level,tooltip:e.props.tooltip,children:e.props.text}),ST={xs:`size-lt-icon-xs`,sm:`size-lt-icon-sm`,md:`size-lt-icon-md`,lg:`size-lt-icon-lg`,xl:`size-lt-icon-xl`,"2xl":`size-lt-icon-2xl`,"3xl":`size-lt-icon-3xl`,"4xl":`size-lt-icon-4xl`},CT=({node:e})=>{let{name:t,size:n,color:r,class:i}=e.props,a=(0,q.jsx)(rs,{icon:t,className:k(ST[n],i)}),o=fe(r);return o?(0,q.jsx)(`span`,{className:`contents`,style:{color:ue(o)},children:a}):a},wT=({node:e})=>(0,q.jsx)(Cw,{alt:e.props.alt,circular:e.props.circular,"data-lattice-component":J(e),previewable:e.props.previewable,size:e.props.size,src:e.props.src,testId:J(e)}),TT=`text-lt-fg underline decoration-lt-border underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-lt-border`;function ET({affix:e,className:t}){return e.icon?(0,q.jsx)(rs,{className:k(`size-lt-icon-md shrink-0`,t),icon:e.icon}):(0,q.jsx)(`span`,{className:k(`shrink-0 text-sm text-lt-muted-fg`,t),children:e.text})}function DT({icon:e,isMenuItem:t,label:n,prefix:r,suffix:i}){return e?(0,q.jsx)(rs,{className:`size-lt-icon-md shrink-0`,icon:e}):t?(0,q.jsxs)(q.Fragment,{children:[r?(0,q.jsx)(ET,{affix:r}):null,(0,q.jsx)(`span`,{children:n}),i?(0,q.jsx)(ET,{affix:i,className:`ml-auto`}):null]}):r||i?(0,q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 align-baseline`,children:[r?(0,q.jsx)(ET,{affix:r}):null,(0,q.jsx)(`span`,{children:n}),i?(0,q.jsx)(ET,{affix:i}):null]}):n}function OT(e,t,n){if(!(!t?.text&&!n?.text))return[t?.text,e,n?.text].filter(e=>!!e).join(` `)}var kT=({node:e})=>{let t=oc(),{icon:n,label:r,prefix:i,suffix:a}=e.props,o=r??``,s=Sx(e.props),c=t?ic:void 0,l=J(e),u=(0,q.jsx)(DT,{icon:n,isMenuItem:t,label:o,prefix:i,suffix:a}),d=n?o:OT(o,i,a),f=({onClick:e,processing:t})=>(0,q.jsx)(`button`,{"aria-label":d,className:k(TT,c),"data-test":l,disabled:t,onClick:e,type:`button`,children:u});return s.kind===`action`?(0,q.jsx)(xx,{action:s.action,children:f}):s.kind===`effects`||s.kind===`modal`?f({onClick:s.onClick,processing:!1}):(0,q.jsx)(oT,{"aria-label":d,className:c,"data-test":l,href:s.kind===`navigate`?s.href:`#`,method:s.kind===`navigate`?s.method:`get`,tabIndex:e.props.tabIndex??void 0,children:u})},AT=({children:e,node:t})=>{let{t:n}=P(I),r=el();if(!r)return null;let i=t.props.title??n(`common.dialog`,`Dialog`),a=t.props.description,o=t.props.closeLabel;return(0,q.jsx)(Ff,{open:r.open,onOpenChange:r.onOpenChange,children:(0,q.jsxs)(Bf,{...a?{}:{"aria-describedby":void 0},onCloseAutoFocus:r.onExited,placement:t.props.side??`center`,width:t.props.width,height:t.props.height,children:[(0,q.jsx)(Vf,{closeLabel:o,description:a,title:i}),(0,q.jsx)(`div`,{className:`mt-6 space-y-6`,children:e})]})})},jT=({node:e})=>(0,q.jsx)(Dw,{color:e.props.color,max:e.props.max,shape:e.props.shape,showValue:e.props.showValue,size:e.props.size,value:e.props.value}),MT=({node:e})=>(0,q.jsx)(`span`,{style:{display:`contents`},dangerouslySetInnerHTML:{__html:e.props.html}}),NT=({children:e,node:t})=>{let n=t.props.collapsible===!0,r=Bc(t.props.headerActions),i=J(t),a=t.props.rememberState!==!1;return(0,q.jsx)(Ow,{...n&&a?{storageKey:`lattice:section:${i??`default`}`}:{},collapsible:n,"data-lattice-component":i,defaultCollapsed:t.props.collapsed===!0,description:t.props.description,headerActions:r.length>0?(0,q.jsx)(Xc,{nodes:r}):null,title:t.props.title,toggleProps:{"data-test":tc(`section-toggle`,i)??`section-toggle-default`},tooltip:t.props.tooltip,children:e})},PT=({node:e})=>{let{emits:t,name:n,options:r}=e.props;function i(e){t&&window.dispatchEvent(new CustomEvent(t,{detail:{name:n,value:e}}))}return(0,q.jsx)(b_,{"aria-label":e.props.label??void 0,defaultValue:e.props.value||void 0,name:n,onValueChange:i,options:r})},FT=({node:e})=>(0,q.jsx)(Aw,{bleed:e.props.bleed,"data-lattice-component":J(e),orientation:e.props.orientation}),IT=({children:e,node:t})=>(0,q.jsx)(Rw,{align:t.props.align??void 0,"data-lattice-component":J(t),direction:t.props.direction??void 0,float:t.props.float??void 0,gap:t.props.gap??void 0,height:t.props.height??void 0,justify:t.props.justify??void 0,width:t.props.width??void 0,children:e}),LT=({children:e,node:t})=>{let{t:n}=P(I),r=(0,B.useMemo)(()=>zT(t),[t]),i=r[0]?.value??``,a=t.props.queryKey,{visit:o}=Hs(),s=t.props.activeValue,c=t.props.defaultValue??i,[l,u]=(0,B.useState)(()=>s||(BT(a,r)??c)||i),d=(0,B.useCallback)(e=>{let t=r.find(t=>t.value===e);if(t){if(t.confirm?.required){o(HT(a,e),{preserveScroll:!0});return}u(e),VT(a,e)}},[a,r,o]);return(0,q.jsx)(Hw,{"aria-label":n(`common.tabs`,`Tabs`),alignment:t.props.alignment,"data-lattice-component":J(t),items:r.map(e=>({label:e.label,value:e.value})),onValueChange:d,orientation:t.props.orientation,value:l,children:e})},RT=({children:e,node:t})=>(0,q.jsx)(Uw,{label:t.props.label,value:t.props.value,children:e});function zT(e){return(e.schema??[]).filter(e=>e.type===`tab`).map(e=>e.props).filter(e=>e.value!==``)}function BT(e,t){if(typeof window>`u`)return null;let n=new URLSearchParams(window.location.search).get(e);return!n||!t.some(e=>e.value===n)?null:n}function VT(e,t){if(typeof window>`u`)return;let n=new URL(window.location.href);n.searchParams.set(e,t),window.history.replaceState(window.history.state,``,`${n.pathname}${n.search}${n.hash}`)}function HT(e,t){if(typeof window>`u`)return``;let n=new URL(window.location.href);return n.searchParams.set(e,t),`${n.pathname}${n.search}${n.hash}`}var UT=({node:e})=>(0,q.jsx)(Yw,{align:e.props.align===`center`?`center`:`left`,color:e.props.color,copyable:e.props.copyable,copyLabel:e.props.text,copyValue:e.props.text,"data-lattice-component":J(e),size:e.props.size,children:e.props.text}),WT=({node:e})=>{let t=e.props.content,n=Bc(e.props.trigger);return(0,q.jsx)(Xw,{content:t?(0,q.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t}}):null,trigger:n.length>0?(0,q.jsx)(Xc,{nodes:n}):null})},GT=`flex flex-wrap items-center justify-between gap-x-4 gap-y-1 px-lt-gutter py-3`,KT=`text-sm text-lt-muted-fg`,qT=`min-w-0 text-lt-fg`;function JT({children:e,description:t,disclosure:n,identity:r,label:i}){let a=fw(),o=`${r??`entry`}-panel`,[s,c]=Nx(`lattice:entry:${r??`default`}`,!1,!1),l=(0,q.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,q.jsx)(`span`,{children:i}),t&&(0,q.jsx)(`span`,{className:`text-xs text-lt-muted-fg`,children:t})]});return n?(0,q.jsxs)(`div`,{"data-lattice-component":r,role:`listitem`,children:[(0,q.jsxs)(`button`,{"aria-controls":o,"aria-expanded":s,className:k(GT,`w-full cursor-pointer text-left transition-colors hover:bg-lt-muted`),onClick:c,type:`button`,children:[(0,q.jsx)(`span`,{className:KT,children:l}),(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`span`,{className:qT,children:e}),(0,q.jsx)(M,{name:`chevron-down`,className:k(`size-lt-icon-md shrink-0 text-lt-muted-fg transition-transform`,!s&&`-rotate-90`)})]})]}),s&&(0,q.jsx)(`div`,{className:`px-lt-gutter pt-2 pb-4`,id:o,children:n})]}):a===`list`?(0,q.jsxs)(`div`,{className:GT,"data-lattice-component":r,role:`listitem`,children:[(0,q.jsx)(`span`,{className:KT,children:l}),(0,q.jsx)(`span`,{className:qT,children:e})]}):(0,q.jsxs)(`div`,{className:GT,"data-lattice-component":r,children:[(0,q.jsx)(`dt`,{className:KT,children:l}),(0,q.jsx)(`dd`,{className:qT,children:e})]})}function YT(e,t){return(t.schema??[]).length>0?e:void 0}var XT=Ee({components:{avatar:V(uT),badge:V(dT),button:V(fT),card:V(pT),chart:V(hT),"code-block":V(gT),collapsible:V(_T),"description-list":V(vT),"entry.badge":V(({children:e,node:t})=>{let{value:n,color:r,label:i,description:a}=t.props,o=n==null||n===``?null:String(n);return(0,q.jsx)(JT,{description:a,disclosure:YT(e,t),identity:J(t),label:i,children:o===null?(0,q.jsx)(`span`,{className:`text-lt-muted-fg`,children:`—`}):(0,q.jsx)(FC,{color:r,children:o})})}),"entry.boolean":V(({children:e,node:t})=>{let{value:n,trueIcon:r,falseIcon:i,label:a,description:o}=t.props,{t:s}=P(`lattice`),c=cC(n);return(0,q.jsx)(JT,{description:o,disclosure:YT(e,t),identity:J(t),label:a,children:(0,q.jsx)(`span`,{"aria-label":c?s(`common.yes`,`Yes`):s(`common.no`,`No`),role:`img`,children:(0,q.jsx)(M,{name:c?r:i,className:k(`size-lt-icon-md`,c?`text-lt-success`:`text-lt-muted-fg`)})})})}),"entry.component":V(({children:e,node:t})=>(0,q.jsx)(JT,{description:t.props.description,disclosure:YT(e,t),identity:J(t),label:t.props.label,children:(0,q.jsx)(Xc,{nodes:Bc(t.props.value)})})),"entry.date":V(({children:e,node:t})=>{let{value:n,format:r,label:i,description:a}=t.props,o=sT();return(0,q.jsx)(JT,{description:a,disclosure:YT(e,t),identity:J(t),label:i,children:(0,q.jsx)(`span`,{children:n==null?`—`:lT(n,r,o)})})}),"entry.text":V(({children:e,node:t})=>{let{value:n,placeholder:r,copyable:i,label:a,description:o}=t.props,s=n==null||n===``?null:String(n);return(0,q.jsx)(JT,{description:o,disclosure:YT(e,t),identity:J(t),label:a,children:s===null?(0,q.jsx)(`span`,{className:`text-lt-muted-fg`,children:r??`—`}):i?(0,q.jsx)(dy,{label:s,value:s,children:(0,q.jsx)(`span`,{children:s})}):(0,q.jsx)(`span`,{children:s})})}),"floating-panel":V(yT),grid:V(bT),heading:V(xT),icon:V(CT),image:V(wT),link:V(kT),modal:V(AT),progress:V(jT),"raw-block":V(MT),section:V(NT),"segmented-control":V(PT),separator:V(FT),stack:V(IT),tab:V(RT),tabs:V(LT),text:V(UT),tooltip:V(WT)},i18n:{namespace:I},name:`lattice/ui`},Vy,zh,zy,Ix,rw,rS,oS,es),ZT=[`light`,`dark`,`system`],{subscribe:QT,notify:$T}=l(),eE=`system`,tE=`system`;function nE(e){rE(e)&&(tE=e)}function rE(e){return ZT.some(t=>t===e)}var iE=()=>typeof window>`u`?!1:window.matchMedia(`(prefers-color-scheme: dark)`).matches,aE=(e,t,n=365)=>{if(typeof document>`u`)return;let r=n*24*60*60;document.cookie=`${e}=${t};path=/;max-age=${r};SameSite=Lax`},oE=()=>{if(typeof window>`u`)return`system`;let e=localStorage.getItem(`appearance`);return rE(e)?e:`system`},sE=e=>e===`dark`||e===`system`&&iE(),cE=()=>iE()?`dark`:`light`,lE=e=>{if(typeof document>`u`)return;let t=sE(e);document.documentElement.classList.toggle(`dark`,t),document.documentElement.style.colorScheme=t?`dark`:`light`},uE=()=>typeof window>`u`?null:window.matchMedia(`(prefers-color-scheme: dark)`),dE=()=>{lE(eE),$T()};function fE(e){eE=e,localStorage.setItem(`appearance`,e),aE(`appearance`,e),lE(e),$T()}function pE(){typeof window>`u`||(localStorage.getItem(`appearance`)||(localStorage.setItem(`appearance`,`system`),aE(`appearance`,`system`)),eE=oE(),lE(eE),uE()?.addEventListener(`change`,dE))}function mE(){let e=(0,B.useSyncExternalStore)(QT,()=>eE,()=>tE),t=(0,B.useSyncExternalStore)(QT,cE,()=>`light`);return{appearance:e,resolvedAppearance:e===`system`?t:e,updateAppearance:fE}}function hE({children:e}){let t=Eo().props.lattice.layout;return t?(0,q.jsx)(Ax,{outlet:e,children:(0,q.jsx)(Xc,{nodes:t.schema})}):(0,q.jsx)(q.Fragment,{children:e})}var gE=(0,B.lazy)(()=>ge(()=>import(`./subscriptions-CJ3H8KiC.js`),__vite__mapDeps([23,1,2,5,10,4,11,18]),import.meta.url)),_E=class extends B.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(){console.warn(`[lattice] Real-time listeners are declared but Echo is unavailable. Install @laravel/echo-react and call configureEcho().`)}render(){return this.state.failed?null:this.props.children}};function vE({listeners:e}){return e.length===0?null:(0,q.jsx)(_E,{children:(0,q.jsx)(B.Suspense,{fallback:null,children:(0,q.jsx)(gE,{listeners:e})})})}var yE={full:`max-w-none`,lg:`max-w-4xl`,md:`max-w-2xl`,sm:`max-w-md`};function bE({lattice:e}){return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Fo,{title:e.title??void 0}),(0,q.jsx)(vE,{listeners:e.listeners}),(0,q.jsx)(`div`,{"data-test":`lattice-page-container`,"data-page-width":e.width,className:k(`mx-auto w-full px-4 py-6 sm:px-6 lg:px-8`,yE[e.width]??yE.full),children:(0,q.jsx)(Xc,{nodes:e.schema})})]})}var xE=`lattice/page`;function SE(e){return t=>{if(t===`lattice/page`)return{default:bE};let n=e[`./Pages/${t}.tsx`]??e[`./pages/${t}.tsx`];if(n)return n();throw Error(`Page not found: ${t}`)}}function CE({defaultLayout:e}={}){return(t,n)=>t===`lattice/page`?n.props.lattice?.layout?hE:null:e?.(t,n)??null}function wE(e,t){return{...t,headers:hc(``,t.headers)}}var TE=!1;function EE(){TE||(TE=!0,Di.onRequest(e=>{let t=e.headers?.[sc];return e.headers&&typeof t==`string`&&t!==``&&(e.headers[sc]=lc(t)),e}))}function DE({action:e,children:t,options:n}){let{processing:r,requestSubmit:i}=gm(e,n);return t({onClick:i,processing:r})}function OE({children:e}){return(0,q.jsx)(yx,{render:e=>(0,q.jsx)(DE,{action:e.action,options:e.options,children:e.children}),children:e})}function kE(){let e=zc();(0,B.useEffect)(()=>G.on(`flash`,t=>{let n=Lc(t.detail?.flash?.latticeEffects);n.length>0&&e(n)}),[e])}function AE({onAppearanceChange:e}){return Ls(d.appearanceChange,t=>{let n=t.detail?.value;rE(n)&&e?.(n)},{enabled:!!e}),null}var jE={href:``};function ME({children:e,registry:t,sprite:n=jE,toaster:r=!0}){return kE(),$o(),(0,q.jsx)(g,{registry:t,children:(0,q.jsx)(Vs,{adapter:Zo,children:(0,q.jsx)(OE,{children:(0,q.jsx)(b,{sprite:n,children:(0,q.jsxs)(il,{children:[e,(0,q.jsx)(AE,{onAppearanceChange:fE}),r?(0,q.jsx)(dx,{}):null]})})})})})}function NE(e,t){let n=new Set([...e.namespaces??[`lattice`,`lattice-ui`],...t.map(e=>e.namespace)]);return{...e,namespaces:[...n]}}function PE({ready:e,children:t}){let[n,r]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{let t=!0,n=()=>{t&&r(!0)};return e.then(n,n),()=>{t=!1}},[e]),n?t:null}function FE({registry:e,plugins:t,sprite:n,pages:r={},defaultLayout:i,strictMode:o=!0,i18n:s,boot:l,wrap:u,...d}={}){let f=e??XT,p=t&&t.length>0?De(f,...t):f;m(p),pc(c),EE();let h=s!==!1,g=t?.flatMap(e=>e.i18n?[e.i18n]:[])??[],_=h?NE(s??{},g):{},v=d.defaults?.visitOptions,y=h?{...d.defaults,visitOptions:(e,t)=>wE(e,v?.(e,t)??t)}:d.defaults,b=To({...d,defaults:y,strictMode:o,resolve:SE(r),layout:CE({defaultLayout:i}),withApp:(e,{ssr:t,page:r})=>{let i=[],o=r.props.lattice,s=!1;if(a(o)&&nE(o.appearance),!t){s=document.getElementById(d.id??`app`)?.hasAttribute(`data-server-rendered`)===!0,a(o)&&a(o.urls)&&typeof o.urls.refreshRef==`string`&&Cc(o.urls.refreshRef),h&&qs(r.props)!==void 0&&i.push(ge(()=>Promise.resolve().then(()=>Js).then(e=>e.configureI18nFromPageProps(r.props,_)),void 0,import.meta.url));let e=l?.({page:r});e&&i.push(e)}let c=(0,q.jsxs)(q.Fragment,{children:[e,h?(0,q.jsx)(Us,{}):null]}),f=(0,q.jsx)(ME,{registry:p,sprite:n,children:u?u(c):c});return i.length===0?f:s?(F(Promise.all(i)),f):(0,q.jsx)(PE,{ready:Promise.all(i),children:f})}});return pE(),b}m(XT);function IE({registry:e=XT,...t}){return(0,q.jsx)(ME,{...t,registry:e})}function LE(e){if(typeof e!=`object`||!e)return{};let{data:t}=e;return typeof t==`object`&&t&&!Array.isArray(t)?t:{}}async function RE(e,t,n){let r=e.props.endpoint,i={data:{},ok:!0,status:0};return r&&(i.ok=await al(async()=>{let n=await Ec(r,{body:JSON.stringify(t),method:e.props.method??`post`,ref:e.props.ref??``,throwOnError:!1});return i.status=n.status,i.data=LE(await n.clone().json().catch(()=>({}))),n},n)),i}function zE(){let e=zc();return(0,B.useCallback)((t,n)=>RE(t,n,e),[e])}var BE=`form.rich-editor`;function VE(e,t){let n=[];for(let r of e){let e=t[r.type];e&&n.push({type:r.type,props:r.props,definition:e,group:e.group??r.type})}return n}var HE={blockquote:!1,bold:!1,bulletList:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,italic:!1,link:!1,listItem:!1,orderedList:!1,strike:!1,underline:!1};function UE(e){return e.reduce((e,t)=>({...e,...t.definition.starterKit?.(t.props)}),{...HE})}function WE(e){return e.flatMap(e=>e.definition.extensions?.(e.props)??[])}function GE(e){let t=[],n=null;for(let r of e){let e=r.definition.toolbar?.(r.props)??[];e.length!==0&&(n!==null&&n!==r.group&&t.push(`separator`),t.push(...e),n=r.group)}return t}function KE({active:e=!1,icon:t,label:n,testId:r,...i}){return(0,q.jsx)(mv,{size:`sm`,icon:t,label:n,title:n,active:e,"data-test":r,...i,onMouseDown:e=>{e.preventDefault(),i.onMouseDown?.(e)}})}function qE(e){if(Array.isArray(e))return e}function JE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function YE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function XE(e,t){if(e){if(typeof e==`string`)return YE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?YE(e,t):void 0}}function ZE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
159
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QE(e,t){return qE(e)||JE(e,t)||XE(e,t)||ZE()}var $E=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),eD=n((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var n=$E();function r(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function i(e,n){return n==null?e:t(t({},e),{options:t(t({},r(n)),r(e.options))})}function a(e,t,r){var a=t.map(function(t){var a=i(t,r);return(0,n.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}e.bindAll=a})),tD=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=$E();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=eD();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))(),nD=`data-pdnd-honey-pot`;function rD(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function iD(e){var t=QE(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?rD(n)?r??null:n:null}function aD(e){"@babel/helpers - typeof";return aD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},aD(e)}function oD(e,t){if(aD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(aD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function sD(e){var t=oD(e,`string`);return aD(t)==`symbol`?t:t+``}function cD(e,t,n){return(t=sD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lD=2147483647,uD={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function dD(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var fD=dD(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function pD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?pD(Object(n),!0).forEach(function(t){cD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var hD=2,gD=hD/2;function _D(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function vD(e){return{x:e.x-gD,y:e.y-gD}}function yD(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function bD(e){return{x:Math.min(e.x,window.innerWidth-hD),y:Math.min(e.y,window.innerHeight-hD)}}function xD(e){var t=e.client,n=bD(yD(vD(_D(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:hD,height:hD})}function SD(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function CD(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function wD(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(nD,`true`),fD()&&n.setAttribute(`popover`,`manual`);var r=xD({client:t});Object.assign(n.style,mD(mD({position:`fixed`},fD()?uD:{zIndex:lD}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},SD({clientRect:r}))),document.body.appendChild(n),fD()&&n.showPopover();var i=(0,tD.bind)(window,{type:`pointermove`,listener:function(e){r=xD({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,SD({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),CD({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,tD.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function TD(){var e=null;function t(){return e=null,(0,tD.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=wD({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function ED(e){if(Array.isArray(e))return YE(e)}function DD(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function OD(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
160
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kD(e){return ED(e)||DD(e)||XE(e)||OD()}var AD=dD(function(){return navigator.userAgent.includes(`Firefox`)}),jD=dD(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)}),MD={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};function ND(e){var t=e.dragLeave;return jD()?t.hasOwnProperty(MD.isLeavingWindow):!1}(function(){if(typeof window>`u`||!jD())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,tD.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[MD.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[MD.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function PD(e){return`nodeName`in e}function FD(e){return PD(e)&&e.ownerDocument!==document}function ID(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?jD()?ND({dragLeave:t}):r==null?!0:AD()?FD(r):r instanceof HTMLIFrameElement:!1}function LD(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){if(e<20){e++;return}t()}}()},{type:`pointerdown`,listener:t}]}function RD(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var zD=function(e){var t=[],n=null,r=function(){t=[...arguments],!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),BD=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function VD(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),BD.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;BD.flush(),zD.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;zD(function(){BD.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;BD.flush(),zD.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var HD={isActive:!1};function UD(){return!HD.isActive}function WD(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function GD(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function KD(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!UD())return;var a=JD({event:t,dragType:n,getDropTargetsOver:r});HD.isActive=!0;var o={current:a};qD({event:t,current:a.dropTargets});var s=VD({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=GD({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=RD(e),i=r({target:rD(e.target)?iD({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.preventDefault(),qD({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){HD.isActive=!1,f()}var f=(0,tD.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){ID({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){if(o.current={dropTargets:o.current.dropTargets,input:RD(e)},!o.current.dropTargets.length){u();return}e.preventDefault(),qD({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:RD(e)},u()}}].concat(kD(LD({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:WD(t)})}function qD(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function JD(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=RD(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var YD={canStart:UD,start:KD},XD=new Map;function ZD(e){var t=e.typeKey,n=e.mount,r=XD.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return XD.set(t,i),i}function QD(e){var t=ZD(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),XD.delete(e.typeKey))}}function $D(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function eO(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function tO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tO(Object(n),!0).forEach(function(t){cD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rO(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=iO(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
161
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function iO(e,t){if(e){if(typeof e==`string`)return aO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aO(e,t):void 0}}function aO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oO(e){return e.slice(0).reverse()}function sO(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return dD($D(eO(e.element,{attribute:i,value:`true`}),o(e)))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.result,l=s===void 0?[]:s;if(i==null)return l;if(!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:l}):l;var u=i.closest(a);if(u==null)return l;var d=r.get(u);if(d==null)return l;var f={input:o,source:t,element:d.element};if(d.canDrop&&!d.canDrop(f))return c({source:t,target:d.element.parentElement,input:o,result:l});var p=d.getData?.call(d,f)??{},m=d.getDropEffect?.call(d,f)??n,h={data:p,element:d.element,dropEffect:m,isActiveDueToStickiness:!1};return c({source:t,target:d.element.parentElement,input:o,result:[].concat(kD(l),[h])})}function l(e){var t=e.eventName,n=e.payload,i=rO(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=nO(nO({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=new Set,a=rO(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=nO(nO({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=rO(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=nO(nO({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.current,o=c({source:t,target:n,input:i});if(o.length>=a.length)return o;for(var s=oO(a),l=oO(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=l[d];if(m!=null){u.push(m);continue}var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=r.get(p.element);if(!_)break;var v={input:i,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(nO(nO({},p),{},{isActiveDueToStickiness:!0}))}return oO(u)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function cO(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=lO(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
162
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function lO(e,t){if(e){if(typeof e==`string`)return uO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uO(e,t):void 0}}function uO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dO(Object(n),!0).forEach(function(t){cD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pO(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=fO({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return dD(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=cO(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function mO(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=pO(),s=sO({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;YD.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:YD.canStart,start:l})}return QD({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var hO=dD(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),gO=`pdnd:android-fallback`,_O=`text/plain`,vO=`application/vnd.pdnd`,yO=new WeakMap;function bO(e){return yO.set(e.element,e),function(){yO.delete(e.element)}}var xO=TD(),SO=mO({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return $D(xO.bindEvents(),(0,tD.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=yO.get(n);if(r){var i=RD(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a)){t.preventDefault();return}if(r.dragHandle){var o=iD({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=QE(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}hO()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(_O,gO),t.dataTransfer.setData(vO,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=yO.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:xO.getOnPostDispatch()}),CO=SO.dropTarget;SO.monitor;function wO(e){return dD($D(SO.registerUsage(),bO(e),eO(e.element,{attribute:`draggable`,value:`true`})))}function TO(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function EO(e,t){if(e==null)return{};var n,r,i=TO(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DO(e,t){var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(n){return Object.is(e[n],t[n])})}function OO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:DO,t=null;return function(n){return t&&e(t.value,n)||(t={value:n}),t.value}}var kO=[`block`];function AO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?AO(Object(n),!0).forEach(function(t){cD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var MO=Symbol(`tree-item-instruction`);function NO(e){return{x:(e.right+e.left)/2,y:(e.bottom+e.top)/2}}function PO(e){var t=e.client,n=e.borderBox,r=n.height/4;return t.y<=n.top+r?`reorder-above`:t.y>=n.bottom-r?`reorder-below`:`make-child`}function FO(e){var t=e.element,n=e.input,r=e.currentLevel,i=e.indentPerLevel,a=e.mode,o={x:n.clientX,y:n.clientY},s=t.getBoundingClientRect();if(a===`standard`)return{type:PO({borderBox:s,client:o}),indentPerLevel:i,currentLevel:r};var c=NO(s);if(a===`expanded`){var l=PO({borderBox:s,client:o});return{type:l===`reorder-above`?l:`make-child`,indentPerLevel:i,currentLevel:r}}var u=i*r;if(o.x<s.left+u){if(o.y<c.y)return{type:`reorder-above`,indentPerLevel:i,currentLevel:r};var d=(o.x-s.left)/i;return{type:`reparent`,desiredLevel:Math.max(Math.floor(d),0),indentPerLevel:i,currentLevel:r}}return{type:PO({borderBox:s,client:o}),indentPerLevel:i,currentLevel:r}}function IO(e,t){return e.type===t.type?e.type===`instruction-blocked`&&t.type===`instruction-blocked`?IO(e.desired,t.desired):DO(e,t):!1}var LO=OO(IO);function RO(e){var t=e.desired,n=e.block;return n!=null&&n.includes(t.type)&&t.type!==`instruction-blocked`?{type:`instruction-blocked`,desired:t}:t}function zO(e,t){var n=t.block,r=LO(RO({desired:FO(EO(t,kO)),block:n}));return jO(jO({},e),{},cD({},MO,r))}function BO(e){return e[MO]??null}var VO=1e3,HO=null,UO=`1px`,WO={width:UO,height:UO,padding:`0`,position:`absolute`,border:`0`,clip:`rect(${UO}, ${UO}, ${UO}, ${UO})`,overflow:`hidden`,whiteSpace:`nowrap`,marginTop:`-${UO}`,pointerEvents:`none`};function GO(){var e=document.createElement(`div`);return e.setAttribute(`role`,`status`),Object.assign(e.style,WO),document.body.append(e),e}function KO(){return HO===null&&(HO=GO()),HO}var qO=null;function JO(){qO!==null&&clearTimeout(qO),qO=null}function YO(e){KO(),JO(),qO=setTimeout(function(){qO=null;var t=KO();t.textContent=e},VO)}export{sy as $,pt as $n,Rf as $t,aT as A,ss as An,Vp as At,Ix as B,Gt as Bn,dp as Bt,hE as C,Ws as Cn,gm as Ct,XT as D,Hs as Dn,Gp as Dt,mE as E,zs as En,Zp as Et,NC as F,Jo as Fn,gp as Ft,eb as G,Ft as Gn,np as Gt,jx as H,Vt as Hn,sp as Ht,sC as I,Go as In,fp as It,Ky as J,Ot as Jn,Gf as Jt,Qy as K,Nt as Kn,rp as Kt,aC as L,Yo as Ln,_p as Lt,VC as M,ns as Mn,Cp as Mt,FC as N,Zo as Nn,up as Nt,lT as O,Fs as On,zp as Ot,PC as P,es as Pn,mp as Pt,ly as Q,_t as Qn,Vf as Qt,qS as R,G as Rn,hp as Rt,vE as S,qs as Sn,Mh as St,fE as T,Vs as Tn,Qp as Tt,px as U,zt as Un,lp as Ut,Ax as V,Ht as Vn,ap as Vt,dx as W,Rt as Wn,op as Wt,my as X,Tt as Xn,Ff as Xt,Cy as Y,Dt as Yn,Hf as Yt,uy as Z,xt as Zn,Bf as Zt,AE as _,dc as _n,Lh as _t,CO as a,Xc as an,we as ar,b_ as at,xE as b,Xs as bn,jh as bt,BE as c,Fc as cn,Sg as ct,GE as d,Ec as dn,ag as dt,al as en,je as er,iy as et,VE as f,Dc as fn,Kh as ft,FE as g,sc as gn,Fh as gt,IE as h,hc as hn,Vh as ht,wO as i,Y as in,ye as ir,av as it,UC as j,rs as jn,Sp as jt,sT as k,Is as kn,Rp as kt,UE as l,Lc as ln,pg as lt,RE as m,_c as mn,Wh as mt,zO as n,el as nn,V as nr,fv as nt,$D as o,zc as on,ge as or,f_ as ot,zE as p,Cc as pn,Gh as pt,Uy as q,jt as qn,Yf as qt,BO as r,rl as rn,De as rr,dv as rt,KE as s,Ic as sn,Gg as st,YO as t,Qc as tn,Ee as tr,mv as tt,WE as u,Rc as un,og as ut,CE as v,J as vn,Rh as vt,pE as w,Us as wn,lm as wt,wE as x,Ys as xn,Ph as xt,SE as y,Qs as yn,Ih as yt,KS as z,Xt as zn,pp as zt};
|