Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m46s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m49s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m8s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m51s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m12s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m11s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m33s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
218 lines
No EOL
742 KiB
JavaScript
218 lines
No EOL
742 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Sample-BVyIfRvs.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/PageContent-DFl6pRYQ.js","assets/registry-x_qn3WiB.js","assets/preload-helper-CwIXHf_L.js","assets/DirectoryLogin-DuQybgJj.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/arrow-left-DROE4wuA.js","assets/createLucideIcon-VlaMqNX_.js","assets/eye-off-CneL5LCR.js","assets/eye-Cklkscvg.js","assets/loader-circle-Wr6tQn-J.js","assets/GuestLayout-Dbr_Rclh.js","assets/ForgotPassword-CodQAGms.js","assets/Login-fjC2XdrT.js","assets/ResetPassword-CRM3s-q2.js","assets/Dashboard-Cd3vEBP_.js","assets/widgets-BlND5Lrk.js","assets/Index-BkEHcS67.js","assets/Index-Bl5Izsbf.js","assets/useMediaList-CZOCtFnS.js","assets/circle-alert-AqOvEy07.js","assets/circle-check-K9QH5jex.js","assets/external-link-Ddmamed9.js","assets/image-off-BO5qjHGQ.js","assets/link-2-Cy2KvWtg.js","assets/dist-CZxP9TJf.js","assets/copy-CO_pOs8v.js","assets/download-K4OGj5k2.js","assets/ellipsis-vertical-CZkQIeOR.js","assets/search-x-Bfzq4V3S.js","assets/trash-CONUPzoz.js","assets/createContext-CgVTZeqH.js","assets/Teleport-gLFWhBwt.js","assets/Presence-DEjNbTl8.js","assets/useForwardExpose-CxX7fZdu.js","assets/Primitive-Bc3V858a.js","assets/getActiveElement-DWEoD8ZB.js","assets/nullish-DHihWhf5.js","assets/useForwardPropsEmits-CXqK2gMN.js","assets/DialogTitle-CJ4_uV5l.js","assets/utils-DOQQTBMN.js","assets/Index-CeqrPBop.js","assets/chevron-left-DSEhAEgi.js","assets/Organigram-C_DgaEG6.js","assets/chevron-up-B0PLh6a4.js","assets/minus-CHpU4ANA.js","assets/plus-CQwC4vy-.js","assets/smartphone-DpYdBNLx.js","assets/useStoredChoice-BAacDiWy.js","assets/Organigram-D2H6GNN8.css","assets/Edit-SHtMKq99.js","assets/Show-BzXirZNm.js","assets/Index--v_e-KvJ.js","assets/Index-BfGAF0a4.js","assets/BirthdayItem-Br_-8VAL.js","assets/Index-BmyznyT3.js","assets/arrow-up-DXJcYM_I.js","assets/file-plus-corner-D3rJfYC7.js","assets/folder-tree-Cd0MblOB.js","assets/info-ByKJSon9.js","assets/pencil-line-5xb0u6Cg.js","assets/rotate-ccw-clock-Bma3-VjO.js","assets/upload-QwHKBTTM.js","assets/Index-CWwV6mxe.js","assets/EventDateBlock-CAb9npsd.js","assets/Show-DcqIy7Qn.js","assets/Builder-DjY3Sbso.js","assets/vue-draggable-plus-BMJbPKYz.js","assets/lock-yku43otw.js","assets/paperclip-BU1eARzf.js","assets/save-Bjo-pGWz.js","assets/settings-2-CJxhDbCG.js","assets/table-properties-DOd7BPqt.js","assets/FormRenderer-Dg9yEOjS.js","assets/send-B_gp9Kto.js","assets/Index-DlQTmlxi.js","assets/Show-jc1aTCk_.js","assets/calendar-clock-DpH3ndNA.js","assets/Index-CFxKWBzg.js","assets/Index-CTf0z9Rh.js","assets/message-square-plus-3BKsmzEu.js","assets/StatusBadge-PqKhkx81.js","assets/status-p0CPKwc2.js","assets/Loans-BxT71Dej.js","assets/Ticket-DmEA5-IK.js","assets/TicketCreate-Bwbme5_V.js","assets/Editor-BmVEWWo0.js","assets/useMediaPicker-Bvyg7s0I.js","assets/message-square-warning-Bf7QtZts.js","assets/play-BGJiFgAn.js","assets/useMediaPicker-D8CaLfE4.css","assets/Index-Ci1ncmvT.js","assets/pen-line-B1UtLKH3.js","assets/NewsCard-DXAVah5a.js","assets/NewsImage-C8bxvQSu.js","assets/Show-CCzdl3Yp.js","assets/message-circle-C0OAlJBT.js","assets/Editor-p521_XuN.js","assets/NewPageDialog-qBoI6W4v.js","assets/Index-BBA1xg--.js","assets/Show-lMsU0jMK.js","assets/Folder-3kIxb0j1.js","assets/FolderTile-C1L4PuX4.js","assets/colors-RDOJqd57.js","assets/format-20VMi8w8.js","assets/QmSearchBox-DJiT4c2J.js","assets/Index-Ca3LVA6C.js","assets/Search-DB5hNAVL.js","assets/Search-5WfA9Ai4.css","assets/Viewer-j00_0TXn.js","assets/Index-DqIP0n--.js","assets/Print-B8elfoj2.js","assets/Print-juRIblN_.css"])))=>i.map(i=>d[i]);
|
||
import{a as e,i as t,n,t as r}from"./Presence-DEjNbTl8.js";import{$ as i,$n as a,B as o,D as s,E as c,En as l,Ft as u,H as d,Ht as f,J as p,L as m,Nt as h,O as g,On as _,Q as v,Tn as y,Ut as b,Wt as x,Xt as S,Yt as C,Z as w,Zn as T,_ as E,an as ee,b as D,bn as te,bt as ne,cn as re,ct as ie,er as ae,et as O,fn as oe,ft as se,g as k,gn as ce,gt as le,it as ue,jt as de,k as A,mt as j,nn as fe,o as M,pn as pe,qt as N,tr as P,tt as me,un as he,v as F,vn as I,wt as ge,xn as _e,xt as L,y as R,z as ve}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as ye,S as be,a as xe,b as Se,i as Ce,w as we,x as Te}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{t as z}from"./preload-helper-CwIXHf_L.js";import{t as B}from"./createLucideIcon-VlaMqNX_.js";import{t as Ee}from"./circle-check-K9QH5jex.js";import{t as De}from"./info-ByKJSon9.js";import{t as Oe}from"./loader-circle-Wr6tQn-J.js";import{t as ke}from"./createContext-CgVTZeqH.js";import{t as Ae}from"./getActiveElement-DWEoD8ZB.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,t as Ie}from"./Teleport-gLFWhBwt.js";import{t as Le}from"./nullish-DHihWhf5.js";import{_ as Re,a as ze,c as Be,d as Ve,g as He,i as Ue,m as We,p as Ge,s as Ke,t as V,u as qe}from"./useForwardExpose-CxX7fZdu.js";import{t as Je}from"./Primitive-Bc3V858a.js";import{t as Ye}from"./useDirection-DA6i3jxU.js";import{n as Xe,r as Ze,t as Qe}from"./useForwardPropsEmits-CXqK2gMN.js";import{t as $e}from"./usePrimitiveElement-CquXUboG.js";import{_ as et,a as tt,c as nt,d as rt,f as it,g as at,h as ot,i as st,l as ct,m as lt,n as ut,o as dt,p as ft,r as pt,s as mt,t as ht,u as gt}from"./DialogTitle-CJ4_uV5l.js";import{a as _t,i as vt,n as yt,o as bt,r as xt,t as St}from"./RovingFocusGroup-Cc2A9ECP.js";import{a as Ct,c as wt,d as Tt,f as Et,h as Dt,i as Ot,l as kt,m as At,n as jt,o as Mt,p as Nt,r as Pt,s as Ft,t as It,u as Lt}from"./dist-CZxP9TJf.js";import{n as Rt,t as H}from"./utils-DOQQTBMN.js";var zt=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function Bt(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 Vt(){}function Ht(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Ut(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Wt(e){if(Ht(e))return e;if(Array.isArray(e)||Ut(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 Gt(e){return zt.Buffer!==void 0&&zt.Buffer.isBuffer(e)}function Kt(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function qt(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Jt=`[object RegExp]`,Yt=`[object String]`,Xt=`[object Number]`,Zt=`[object Boolean]`,Qt=`[object Arguments]`,$t=`[object Symbol]`,en=`[object Date]`,tn=`[object Map]`,nn=`[object Set]`,rn=`[object Array]`,an=`[object Function]`,on=`[object ArrayBuffer]`,sn=`[object Object]`,cn=`[object Error]`,ln=`[object DataView]`,un=`[object Uint8Array]`,dn=`[object Uint8ClampedArray]`,fn=`[object Uint16Array]`,pn=`[object Uint32Array]`,mn=`[object BigUint64Array]`,hn=`[object Int8Array]`,gn=`[object Int16Array]`,_n=`[object Int32Array]`,vn=`[object BigInt64Array]`,yn=`[object Float32Array]`,bn=`[object Float64Array]`;function xn(e,t){return Sn(e,void 0,e,new Map,t)}function Sn(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Ht(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]=Sn(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,Sn(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(Sn(a,void 0,n,r,i));return t}if(Gt(e))return e.subarray();if(Ut(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=Sn(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),Cn(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),Cn(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),Cn(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,Cn(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),Cn(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),Cn(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),Cn(t,e,n,r,i),t}if(typeof e==`object`&&wn(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),Cn(t,e,n,r,i),t}return e}function Cn(e,t,n=e,r,i){let a=[...Object.keys(t),...Kt(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=Sn(t[s],s,n,r,i))}}function wn(e){switch(qt(e)){case Qt:case rn:case on:case ln:case Zt:case en:case yn:case bn:case hn:case gn:case _n:case tn:case Xt:case sn:case Jt:case nn:case Yt:case $t:case un:case dn:case fn:case pn:return!0;default:return!1}}function Tn(e){return Sn(e,void 0,e,new Map,void 0)}function En(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 Dn(e){return e===`__proto__`}function On(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 kn(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function An(e,t,n){return jn(e,t,void 0,void 0,void 0,void 0,n)}function jn(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 Mn(e,t,a,o)}return Mn(e,t,a,o)}function Mn(e,t,n,r){if(Object.is(e,t))return!0;let i=qt(e),a=qt(t);if(i===`[object Arguments]`&&(i=sn),a===`[object Arguments]`&&(a=sn),i!==a)return!1;switch(i){case Yt:return e.toString()===t.toString();case Xt:return kn(e.valueOf(),t.valueOf());case Zt:case en:case $t:return Object.is(e.valueOf(),t.valueOf());case Jt:return e.source===t.source&&e.flags===t.flags;case an: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 tn:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!jn(a,t.get(i),i,e,t,n,r))return!1;return!0;case nn:{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=>jn(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case rn:case un:case dn:case fn:case pn:case mn:case hn:case gn:case _n:case vn:case yn:case bn:if(Gt(e)!==Gt(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!jn(e[i],t[i],i,e,t,n,r))return!1;return!0;case on:return e.byteLength===t.byteLength&&Mn(new Uint8Array(e),new Uint8Array(t),n,r);case ln:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:Mn(new Uint8Array(e),new Uint8Array(t),n,r);case cn:return e.name===t.name&&e.message===t.message;case sn:{if(!(Mn(e.constructor,t.constructor,n,r)||En(e)&&En(t)))return!1;let i=[...Object.keys(e),...Kt(e)],a=[...Object.keys(t),...Kt(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(!jn(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function Nn(e,t){return An(e,t,Vt)}function Pn(e){return Number.isSafeInteger(e)&&e>=0}var Fn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function In(e){return e.replace(/[&<>"']/g,e=>Fn[e])}function Ln(e){return e!=null&&typeof e!=`function`&&Pn(e.length)}function Rn(e){return typeof e==`symbol`||e instanceof Symbol}function zn(e){return e==null?``:Bn(e)}function Bn(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Bn).join(`,`);if(Rn(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Vn(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function Hn(e){if(Array.isArray(e))return e.map(Vn);if(typeof e==`symbol`)return[e];e=zn(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let l=e[r];if(a)l===`\\`&&r+1<n?(r++,i+=e[r]):l===a?a=``:i+=l;else if(o){if(l===`"`||l===`'`)a=l,s=!0;else if(l===`]`){if(o=!1,!s&&i.includes(`.`)&&!c.test(i)){let e=i.split(`.`);for(let n=0;n<e.length;n++)e[n]!==``&&t.push(e[n])}else t.push(i);i=``}else i+=l}else if(l===`[`)o=!0,s=!1,i&&=(t.push(i),``);else if(l===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=l;r++}return i&&t.push(i),t}var Un=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function Wn(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:Un.test(e);default:return!1}}function Gn(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(Dn(t))return n;let r=e[t];return r===void 0?Wn(t)&&!Object.hasOwn(e,t)?Gn(e,Hn(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=Vn(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Kn(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),Dn(t))return n;let r=e[t];return r===void 0?n:r}}}function Kn(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||Dn(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function qn(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Jn(e,t){return xn(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(qt(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),Cn(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Xt:case Yt:case Zt:{let t=new e.constructor(e?.valueOf());return Cn(t,e),t}case Qt:{let t={};return Cn(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function Yn(e){return Jn(e)}function Xn(e){return typeof e==`object`&&!!e&&qt(e)===`[object Arguments]`}var Zn=/^(?:0|[1-9]\d*)$/;function Qn(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 Zn.test(e)}}function $n(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&Wn(t)&&!(t in Object(e))?Hn(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=Vn(n[e]);if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||Xn(r))&&Qn(t)&&Number(t)<r.length))return!1;r=r[t]}return!0}function er(e){return typeof e==`object`&&!!e}function tr(e){return er(e)&&Ln(e)}var nr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rr=/^\w*$/;function ir(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||Rn(e)?!0:typeof e==`string`&&(rr.test(e)||!nr.test(e))||t!=null&&Object.hasOwn(t,e)}function ar(e){return Ut(e)}var or=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&kn(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function sr(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function cr(e,t,n,r){if(e==null&&!qn(e))return e;let i;i=ir(t,e)?[t]:Array.isArray(t)?t:Hn(t);let a=n(Gn(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=Vn(i[t]);if(sr(n))return e;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?qn(a)?a:Qn(i[t+1])?[]:{}:c}or(o,n,s),o=o[n]}return e}function lr(e,t,n){return cr(e,t,()=>n,()=>void 0)}function ur(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=Bt(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)?((r||i)&&(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 dr(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=fr(i,t,r,new Map)}return i}function fr(e,t,n,r){if(Ht(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return Wt(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)e in t||(t[e]=void 0)}let i=[...Object.keys(t),...Kt(t)];for(let a=0;a<i.length;a++){let o=i[a];if(Dn(o))continue;let s=t[o],c=e[o];if(Xn(s)&&(s={...s}),Xn(c)&&(c={...c}),Gt(s)&&(s=Yn(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(tr(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)||er(c)&&er(s)&&(On(c)||On(s)||ar(c)||ar(s))?e[o]=fr(c,s,n,r):c==null&&On(s)?e[o]=fr({},s,n,r):c==null&&ar(s)?e[o]=Yn(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function pr(e,...t){return dr(e,...t,Vt)}function mr(e){return In(zn(e))}var hr=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0,gr=e=>e instanceof FormData||hr(e)||typeof e==`object`&&!!e&&Object.values(e).some(e=>gr(e)),_r=class extends Error{response;constructor(e){super(`HTTP error ${e.status}`),this.name=`HttpResponseError`,this.response=e}},vr=class extends Error{constructor(e=`Request was cancelled`){super(e),this.name=`HttpCancelledError`}},yr=class extends Error{constructor(e=`Network error`){super(e),this.name=`HttpNetworkError`}};function br(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 xr(e,t,n){if(t&&!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&(e=t.replace(/\/$/,``)+`/`+e.replace(/^\//,``)),n&&Object.keys(n).length>0){let t=br(n);t&&(e+=(e.includes(`?`)?`&`:`?`)+t)}return e}function Sr(){return typeof window>`u`?null:window.axios?.defaults?.headers?.common?.[`X-Requested-With`]??null}function Cr(e,t=new FormData,n=null){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&wr(t,n?`${n}[${r}]`:r,e[r]);return t}function wr(e,t,n){if(Array.isArray(n))return n.forEach((n,r)=>wr(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,``);Cr(n,e,t)}function Tr(e,t){if(e!=null)return e instanceof FormData?e:typeof e==`object`&&gr(e)?Cr(e):typeof e==`object`||t[`Content-Type`]?.includes(`application/json`)?JSON.stringify(e):String(e)}function Er(e){let t={};return e.forEach((e,n)=>{t[n.toLowerCase()]=e}),t}function Dr(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=xr(e.url,e.baseURL,e.params),i=e.method.toUpperCase(),a={},o=Sr();o&&(a[`X-Requested-With`]=o),e.data!==void 0&&![`GET`,`DELETE`].includes(i)&&!(e.data instanceof FormData)&&!gr(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:Tr(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:Er(n.headers)};if(!n.ok)throw new _r(o);return o}catch(e){throw l&&clearTimeout(l),e instanceof _r?e:e instanceof DOMException&&e.name===`AbortError`?new vr:e instanceof TypeError?new yr(e.message):e}}}}var Or=Dr(),kr=Or,Ar=void 0,jr=void 0,Mr=`same-origin`,Nr=e=>`${e.method}:${e.baseURL??Ar??``}${e.url}`,Pr=e=>e.status===204&&e.headers[`precognition-success`]===`true`,Fr={},Ir={get:(e,t={},n={})=>Rr(Lr(`get`,e,t,n)),post:(e,t={},n={})=>Rr(Lr(`post`,e,t,n)),patch:(e,t={},n={})=>Rr(Lr(`patch`,e,t,n)),put:(e,t={},n={})=>Rr(Lr(`put`,e,t,n)),delete:(e,t={},n={})=>Rr(Lr(`delete`,e,t,n)),useHttpClient(e){return kr=e,Ir},withBaseURL(e){return Ar=e,Ir},withTimeout(e){return jr=e,Ir},withCredentials(e){return Mr=typeof e==`string`?e:e?`include`:`omit`,Ir},fingerprintRequestsUsing(e){return Nr=e===null?()=>null:e,Ir},determineSuccessUsing(e){return Pr=e,Ir},withXsrfCookieName(e){return Or.setXsrfCookieName(e),Ir},withXsrfHeaderName(e){return Or.setXsrfHeaderName(e),Ir}},Lr=(e,t,n,r)=>({url:t,method:e,...r,...[`get`,`delete`].includes(e)?{params:pr({},n,r?.params)}:{data:pr({},n,r?.data)}}),Rr=(e={})=>{let t=[zr,Vr,Hr].reduce((e,t)=>t(e),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),kr.request({method:t.method,url:t.url,baseURL:t.baseURL??Ar,data:t.data,params:t.params,headers:t.headers,signal:t.signal,timeout:t.timeout,credentials:Mr}).then(async e=>{t.precognitive&&Ur(e);let n=e.status,r=e;return t.precognitive&&t.onPrecognitionSuccess&&Pr(e)&&(r=await Promise.resolve(t.onPrecognitionSuccess(e)??r)),t.onSuccess&&Br(n)&&(r=await Promise.resolve(t.onSuccess(r)??r)),(Gr(t,n)??(e=>e))(r)??r},e=>{if(Wr(e))return Promise.reject(e);let n=e;return t.precognitive&&Ur(n.response),(Gr(t,n.response.status)??((e,t)=>Promise.reject(t)))(n.response,n)}).finally(t.onFinish??(()=>null)))},zr=e=>{let t=e.only??e.validate;return{...e,timeout:e.timeout??jr,precognitive:e.precognitive!==!1,fingerprint:e.fingerprint===void 0?Nr(e,kr):e.fingerprint,headers:{...e.headers,Accept:`application/json`,"Content-Type":Kr(e),...e.precognitive===!1?{}:{Precognition:!0},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},Br=e=>e>=200&&e<300,Vr=e=>typeof e.fingerprint==`string`?(Fr[e.fingerprint]?.abort(),delete Fr[e.fingerprint],e):e,Hr=e=>typeof e.fingerprint!=`string`||e.signal||!e.precognitive?e:(Fr[e.fingerprint]=new AbortController,{...e,signal:Fr[e.fingerprint].signal}),Ur=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.`)},Wr=e=>!(e instanceof _r)||typeof e.response?.status!=`number`,Gr=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],Kr=e=>e.headers?.[`Content-Type`]??e.headers?.[`Content-type`]??e.headers?.[`content-type`]??(gr(e.data)?`multipart/form-data`:`application/json`),qr=(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?Gn(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},Jr=(e,t)=>t.includes(`*`)?RegExp(`^`+t.replace(/\./g,`\\.`).replace(/\*/g,`[^.]+`)+`$`).test(e):e===t,Yr=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.some(t=>Jr(e,t)))),Xr=(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=Qr(e);return Nn(d,t)?[]:(d=t,n.errorsChanged)},p=e=>{let t={...d};return delete t[$r(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=()=>ur(t=>{e({get:(e,n={},r={})=>Ir.get(e,T(n),C(r,t,n)),post:(e,n={},r={})=>Ir.post(e,T(n),C(r,t,n)),patch:(e,n={},r={})=>Ir.patch(e,T(n),C(r,t,n)),put:(e,n={},r={})=>Ir.put(e,T(n),C(r,t,n)),delete:(e,n={},r={})=>Ir.delete(e,T(n),C(r,t,n))}).catch(e=>e instanceof vr||e instanceof _r&&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,...pr({},e,t),only:i,timeout:r.timeout??5e3,onValidationError:(e,t)=>([...s([...o,...i]),...f(pr(Yr({...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(Yr({...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=>qr(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(hr(t)&&!r){console.warn(`Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.`);return}e=$r(e),(e.includes(`*`)||Gn(_,e)!==t)&&(u([e,...l]).forEach(e=>e()),S(n??{}))},T=e=>r===!1?ei(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:[$r(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),lr(_,e,Gn(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},Zr=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:Array.isArray(e[n])?e[n][0]:e[n]}),{}),Qr=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:typeof e[n]==`string`?[e[n]]:e[n]}),{}),$r=e=>typeof e==`string`?e:e.target.name,ei=e=>{let t={...e};return Object.keys(t).forEach(e=>{let n=t[e];if(n!==null){if(hr(n)){delete t[e];return}if(Array.isArray(n)){t[e]=Object.values(ei({...n}));return}if(typeof n==`object`){t[e]=ei(t[e]);return}}}),t},ti=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 $n(this.config,e)?Gn(this.config,e):Gn(this.defaults,e)}set(e,t){typeof e==`string`?lr(this.config,e,t):Object.entries(e).forEach(([e,t])=>{lr(this.config,e,t)})}}({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function ni(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function ri(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var ii=e=>ri(`before`,{cancelable:!0,detail:{visit:e}}),ai=(e,{page:t,visitId:n}={})=>ri(`error`,{detail:{errors:e,page:t,visitId:n}}),oi=e=>ri(`networkError`,{cancelable:!0,detail:{error:e}}),si=e=>ri(`finish`,{detail:{visit:e}}),ci=e=>ri(`httpException`,{cancelable:!0,detail:{response:e}}),li=e=>ri(`beforeUpdate`,{detail:{page:e}}),ui=(e,{cached:t=!1,visitId:n}={})=>ri(`navigate`,{detail:{page:e,cached:t,visitId:n}}),di=(e,{replace:t,visitId:n})=>ri(`clientVisit`,{detail:{page:e,replace:t,visitId:n}}),fi=e=>ri(`progress`,{detail:{progress:e}}),pi=e=>ri(`start`,{detail:{visit:e}}),mi=(e,{visitId:t}={})=>ri(`success`,{detail:{page:e,visitId:t}}),hi=(e,t)=>ri(`prefetched`,{detail:{fetchedAt:Date.now(),response:e,visit:t}}),gi=e=>ri(`prefetching`,{detail:{visit:e}}),_i=e=>ri(`flash`,{detail:{flash:e}}),vi=(e,t)=>ri(`location`,{cancelable:!0,detail:{url:e,versionChange:t}}),yi=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()}},bi=async e=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);let t=Ti(),n=await Oi(await ki());if(!n)throw Error(`Unable to encrypt history`);return await Ci(t,n,e)},xi={key:`historyKey`,iv:`historyIv`},Si=async e=>{let t=Ti(),n=await ki();if(!n)throw Error(`Unable to decrypt history`);return await wi(t,n,e)},Ci=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))},wi=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))},Ti=()=>{let e=yi.get(xi.iv);if(e)return new Uint8Array(e);let t=window.crypto.getRandomValues(new Uint8Array(12));return yi.set(xi.iv,Array.from(t)),t},Ei=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`]),Di=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);yi.set(xi.key,Array.from(new Uint8Array(t)))},Oi=async e=>{if(e)return e;let t=await Ei();return t?(await Di(t),t):null},ki=async()=>{let e=yi.get(xi.key);return e?await window.crypto.subtle.importKey(`raw`,new Uint8Array(e),{name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]):null},Ai=e=>{let t={};for(let n of Object.keys(e))e[n]!==void 0&&(t[n]=e[n]);return t},ji=(e,t,n)=>{if(e===t)return!0;for(let r in e)if(!n.includes(r)&&e[r]!==t[r]&&!Mi(e[r],t[r]))return!1;for(let r in t)if(!n.includes(r)&&!(r in e))return!1;return!0},Mi=(e,t)=>{switch(typeof e){case`object`:return ji(e,t,[]);case`function`:return e.toString()===t.toString();default:return e===t}},Ni=(e,t,n)=>{let r=Hn(t);if(r.length===0)return e;let i=(e,t)=>{if(t===r.length)return n;let a=r[t],o=Array.isArray(e)?[...e]:e&&typeof e==`object`?{...e}:/^(?:0|[1-9]\d*)$/.test(a)?[]:{};return o[a]=i(e?.[a],t+1),o};return i(e,0)},Pi={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},Fi=e=>{if(typeof e==`number`)return e;for(let[t,n]of Object.entries(Pi))if(e.endsWith(t))return parseFloat(e)*n;return parseInt(e)},Ii=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){Ii.removeFromInFlight(e),r(t)}})}).then(t=>{this.remove(e);let n=t.getPageResponse();U.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[Fi(t),Fi(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=Tn(e);return t.headers.Purpose===`prefetch`&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return ji(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();U.mergeOncePropsIntoResponse(n,{force:!0});for(let[e,t]of Object.entries(n.deferredProps??{})){let r=t.filter(e=>Gn(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()}},Li=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},Ri=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},zi=(e,t)=>{if(!t)return e.filter(e=>Li(e));let n=e.indexOf(t),r=[],i=[];for(let t=n;t>=0;t--){let n=e[t];if(Li(n))r.push(n);else break}for(let t=n+1;t<e.length;t++){let n=e[t];if(Li(n))i.push(n);else break}return[...r.reverse(),...i]},Bi=(e,t=1)=>{window.requestAnimationFrame(()=>{t>1?Bi(e,t-1):e()})},Vi=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},Hi=typeof window>`u`,Ui=!Hi&&/Firefox/i.test(window.navigator.userAgent),Wi=class{static save(){xa.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(Ui&&getComputedStyle(document.documentElement).scrollBehavior===`smooth`)return Bi(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){(Hi||!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=Hi?null:window.location.hash;e&&setTimeout(()=>{let t=document.getElementById(e.slice(1));t?t.scrollIntoView():this.scrollToTop()})}static restore(e){Hi||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(e)})}static restoreScrollRegions(e){Hi||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=xa.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(){xa.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},Gi=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0;function Ki(e){return Gi(e)||e instanceof FormData&&Array.from(e.values()).some(e=>Ki(e))||typeof e==`object`&&!!e&&Object.values(e).some(e=>Ki(e))}var qi=e=>e instanceof FormData;function Ji(e,t=new FormData,n=null,r=`brackets`){e||={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&Xi(t,Yi(n,i,`indices`),e[i],r);return t}function Yi(e,t,n){return e?n===`brackets`?`${e}[]`:`${e}[${t}]`:t}function Xi(e,t,n,r){if(Array.isArray(n))return Array.from(n.keys()).forEach(i=>Xi(e,Yi(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,``);Ji(n,e,t,r)}function Zi(e){return/\[\d+\]/.test(decodeURIComponent(e.search))}function Qi(e){if(!e||e===`?`)return{};let t={};return e.replace(/^\?/,``).split(`&`).filter(Boolean).forEach(e=>{let[n,r]=ea(e);na(t,ta(n),ta(r))}),t}function $i(e,t){let n=[];return ia(e,``,n,t),n.length?`?`+n.join(`&`):``}function ea(e){let t=e.indexOf(`=`);return t===-1?[e,``]:[e.substring(0,t),e.substring(t+1)]}function ta(e){return decodeURIComponent(e.replace(/\+/g,` `))}function na(e,t,n){let r=ra(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 ra(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 ia(e,t,n,r){if(e!==void 0){if(e===null){n.push(`${t}=`);return}if(Array.isArray(e)){e.forEach((e,i)=>{ia(e,r===`indices`?`${t}[${i}]`:`${t}[]`,n,r)});return}if(typeof e==`object`){Object.keys(e).forEach(i=>{ia(e[i],t?`${t}[${i}]`:i,n,r)});return}n.push(`${t}=${encodeURIComponent(String(e))}`)}}function aa(e){return new URL(e.toString(),typeof window>`u`?void 0:window.location.toString())}var oa=(e,t,n,r,i)=>{let a=typeof e==`string`?aa(e):e;if((Ki(t)||r)&&!qi(t)&&(ti.get(`form.forceIndicesArrayFormatInFormData`)&&(i=`indices`),t=Ji(t,new FormData,null,i)),qi(t))return[a,t];let[o,s]=sa(n,a,t,i);return[aa(o),s]};function sa(e,t,n,r=`brackets`){let i=e===`get`&&!qi(n)&&Object.keys(n).length>0,a=ma(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=Zi(d)?`indices`:r;d.search=$i({...Qi(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 ca(e){return e=new URL(e.href),e.hash=``,e}var la=(e,t)=>{e.hash&&!t.hash&&ca(e).href===t.href&&(t.hash=e.hash)},ua=(e,t)=>ca(e).href===ca(t).href,da=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function fa(e){return typeof e==`object`&&!!e&&e!==void 0&&`url`in e&&`method`in e}function pa(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 ma(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}function ha(e,t){let n=typeof e==`string`?aa(e):e;return t?`${n.protocol}//${n.host}${n.pathname}${n.search}${n.hash}`:`${n.pathname}${n.search}${n.hash}`}var U=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,Sa.on(`historyQuotaExceeded`,()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:n=!1,preserveState:r=!1,viewTransition:i=!1,cached:a=!1,initialRender:o=!1,visitId:s}={}){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 c=this.componentId;return e.clearHistory&&xa.clear(),this.resolve(e.component,e).then(l=>{if(c!==this.componentId)return;e.rememberedState??={};let u=typeof window>`u`,d=u?new URL(e.url):window.location,f=!u&&n?Wi.getScrollRegions():[];t||=ua(aa(e.url),d);let p={...e,flash:{}};return new Promise(e=>t?xa.replaceState(p,e):xa.pushState(p,e)).then(()=>{let c=!this.isTheSame(e);if(!c&&Object.keys(e.props.errors||{}).length>0&&(i=!1),this.page=e,this.cleared=!1,this.hasOnceProps()&&Ii.updateCachedOncePropsFromCurrentPage(),c&&this.fireEventsFor(`newComponent`),this.isFirstPageLoad&&this.fireEventsFor(`firstLoad`),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:l,page:e,preserveState:r,viewTransition:i,initialRender:o}).then(()=>{n?window.requestAnimationFrame(()=>Wi.restoreScrollRegions(f)):Wi.reset(),this.pendingDeferredProps&&this.pendingDeferredProps.component===e.component&&this.pendingDeferredProps.url===e.url&&Sa.fireInternalEvent(`loadDeferredProps`,this.pendingDeferredProps.deferredProps),this.pendingDeferredProps=null,t||ui(e,{cached:a,visitId:s})})})})}setQuietly(e,{preserveState:t=!1}={}){return this.resolve(e.component,e).then(n=>(this.page=e,this.cleared=!1,xa.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,initialRender:i=!1}){let a=()=>this.swapComponent({component:e,page:t,preserveState:n,initialRender:i});if(!r||!document?.startViewTransition||document.visibilityState===`hidden`)return a();let o=typeof r==`boolean`?()=>null:r,s=e=>{e.catch(e=>{if(!(e instanceof DOMException))throw e})};return new Promise(e=>{let t=document.startViewTransition(()=>a().then(e));s(t.ready),s(t.finished),s(t.updateCallbackDone),o(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=Tn(this.page.props);for(let n of e)t[n]=Tn(this.optimisticBaseline[n]);for(let{callback:e}of this.pendingOptimistics){let n=e(Tn(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||Gn(e.props,r.prop)===void 0)&&(lr(e.props,r.prop,Gn(this.page.props,i.prop)),e.onceProps[n].expiresAt=i.expiresAt)})}},ga=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()}},_a=typeof window>`u`,va=new ga,ya=!_a&&/CriOS/.test(window.navigator.userAgent),ba=class{rememberedState=`rememberedState`;scrollRegions=`scrollRegions`;preserveUrl=!1;current={};initialState=null;remember(e,t){this.replaceState({...U.getWithoutFlashData(),rememberedState:{...U.get()?.rememberedState??{},[t]:e}})}restore(e){if(!_a)return this.current[this.rememberedState]?.[e]===void 0?this.initialState?.[this.rememberedState]?.[e]:this.current[this.rememberedState]?.[e]}pushState(e,t=null){if(!_a){if(this.preserveUrl){t&&t();return}this.current=e,va.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doPushState({page:n},e.url).then(()=>t?.());return ya?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}clonePageProps(e){try{return structuredClone(e.props),e}catch{return{...e,props:Tn(e.props)}}}getPageData(e){let t=this.clonePageProps(e);return new Promise(n=>e.encryptHistory?bi(t).then(n):n(t))}processQueue(){return va.process()}decrypt(e=null){if(_a)return Promise.resolve(e??U.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?Si(e):Promise.resolve(e)}saveScrollPositions(e){va.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!Nn(this.getScrollRegions(),e))return this.doReplaceState({page:window.history.state.page,scrollRegions:e})}))}saveDocumentScrollPosition(e){va.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!Nn(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(Nn(this.current,e)){t&&t();return}let{flash:n,...r}=e;if(U.merge(r),!_a){if(this.preserveUrl){t&&t();return}this.current=e,va.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doReplaceState({page:n},e.url).then(()=>t?.());return ya?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;Sa.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!_a&&!!window.history.state?.page}clear(){yi.remove(xi.key),yi.remove(xi.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 xa=new ba,Sa=new class{internalListeners=[];init(){typeof window<`u`&&(window.addEventListener(`popstate`,this.handlePopstateEvent.bind(this)),window.addEventListener(`pageshow`,this.handlePageshowEvent.bind(this)),window.addEventListener(`scroll`,ni(Wi.onWindowScroll.bind(Wi),100),!0)),typeof document<`u`&&document.addEventListener(`scroll`,ni(Wi.onScroll.bind(Wi),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(){U.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&&xa.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){let t=e.state||null;if(t===null){let e=aa(U.get().url);e.hash=window.location.hash,xa.replaceState({...U.getWithoutFlashData(),url:e.href}),Wi.reset();return}if(!xa.isValidState(t))return this.onMissingHistoryItem();xa.decrypt(t.page).then(e=>{if(U.get().version!==e.version){this.onMissingHistoryItem();return}W.cancelAll({prefetch:!1}),U.setQuietly(e,{preserveState:!1}).then(()=>{Wi.restore(xa.getScrollRegions()),ui(U.get());let t={},n=U.get().props;for(let[r,i]of Object.entries(e.initialDeferredProps??e.deferredProps??{})){let e=i.filter(e=>Gn(n,e)===void 0);e.length>0&&(t[r]=e)}Object.keys(t).length>0&&this.fireInternalEvent(`loadDeferredProps`,t)})}).catch(()=>{this.onMissingHistoryItem()})}},Ca=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 wa(){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 Ta=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(e=>e.bind(this)())}static clearRememberedStateOnReload(){Ca.isReload()&&(xa.deleteState(xa.rememberedState),xa.clearInitialState(xa.rememberedState))}static handleBackForward(){if(!Ca.isBackForward()||!xa.browserHasHistoryEntry())return!1;let e=xa.getScrollRegions();return xa.decrypt().then(t=>{let n=wa();U.set(t,{preserveScroll:!0,preserveState:!0,visitId:n}).then(()=>{Wi.restore(e),ui(U.get(),{visitId:n})})}).catch(()=>{Sa.onMissingHistoryItem()}),!0}static handleLocation(){if(!yi.exists(yi.locationVisitKey))return!1;let e=yi.get(yi.locationVisitKey)||{};return yi.remove(yi.locationVisitKey),typeof window<`u`&&U.setUrlHash(window.location.hash),xa.decrypt(U.get()).then(()=>{let t=wa(),n=xa.getState(xa.rememberedState,{}),r=xa.getScrollRegions();U.remember(n),U.set(U.get(),{preserveScroll:e.preserveScroll,preserveState:!0,initialRender:!0,visitId:t}).then(()=>{e.preserveScroll&&Wi.restore(r),this.fireInitialEvents(t)})}).catch(()=>{Sa.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<`u`&&U.setUrlHash(window.location.hash);let e=wa();U.set(U.get(),{preserveScroll:!0,preserveState:!0,initialRender:!0,visitId:e}).then(()=>{Ca.isReload()?Wi.restore(xa.getScrollRegions()):Wi.scrollToAnchor(),this.fireInitialEvents(e)})}static fireInitialEvents(e){let t=U.get();ui(t,{visitId:e}),Object.keys(t.flash).length>0&&queueMicrotask(()=>_i(t.flash))}},Ea=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())}})}},Da=new class{polls=[];constructor(){this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,n){let r=new Ea(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)}},Oa=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)}},ka=class extends Error{code;url;constructor(e,t,n){super(n?`${e} (${n})`:e),this.name=`HttpError`,this.code=t,this.url=n}},Aa=class extends ka{response;constructor(e,t,n){super(e,`ERR_HTTP_RESPONSE`,n),this.name=`HttpResponseError`,this.response=t}},ja=class extends ka{constructor(e=`Request was cancelled`,t){super(e,`ERR_CANCELLED`,t),this.name=`HttpCancelledError`}},Ma=class extends ka{cause;constructor(e,t,n){super(e,`ERR_NETWORK`,t),this.name=`HttpNetworkError`,this.cause=n}};function Na(e){let t=document.cookie.match(RegExp(`(^|;\\s*)(`+e+`)=([^;]*)`));return t?decodeURIComponent(t[3]):null}function Pa(e){let t={};return e.getAllResponseHeaders().split(`\r
|
||
`).forEach(e=>{let n=e.indexOf(`:`);n>0&&(t[e.slice(0,n).toLowerCase().trim()]=e.slice(n+1).trim())}),t}function Fa(e){return typeof FormData<`u`&&e instanceof FormData}function Ia(e){return typeof e==`string`||Fa(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 La(e,t){if(!t.headers)return;let n=Fa(t.data);Object.entries(t.headers).forEach(([t,r])=>{(t.toLowerCase()!==`content-type`||!n)&&e.setRequestHeader(t,String(r))})}function Ra(e,t){if(!t||Object.keys(t).length===0)return e;let[n]=sa(`get`,e,t);return n}var za=class{xsrfCookieName;xsrfHeaderName;constructor(e={}){this.xsrfCookieName=e.xsrfCookieName??`XSRF-TOKEN`,this.xsrfHeaderName=e.xsrfHeaderName??`X-XSRF-TOKEN`}async request(e){let t=await Oa.processRequest(e);try{let e=await this.doRequest(t);return await Oa.processResponse(e)}catch(e){throw(e instanceof Aa||e instanceof Ma||e instanceof ja)&&await Oa.processError(e),e}}doRequest(e){return new Promise((t,n)=>{let r=new XMLHttpRequest,i=Ra(e.url,e.params);r.open(e.method.toUpperCase(),i,!0);let a=Na(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&&(Ia(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)),La(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 ja(`Request was cancelled`,e.url)),r.onerror=()=>n(new Ma(`Network error`,e.url)),r.onload=()=>{let i={status:r.status,data:r.responseText,headers:Pa(r)};r.status>=400?n(new Aa(`Request failed with status ${r.status}`,i,e.url)):t(i)},r.send(o)})}},Ba=new za;function Va(e){return!(`request`in e)}var Ha={getClient(){return Ba},setClient(e){if(!Va(e)){Ba=e;return}Ba=new za(e),e.xsrfCookieName&&Ir.withXsrfCookieName(e.xsrfCookieName),e.xsrfHeaderName&&Ir.withXsrfHeaderName(e.xsrfHeaderName)},onRequest:Oa.onRequest.bind(Oa),onResponse:Oa.onResponse.bind(Oa),onError:Oa.onError.bind(Oa),processRequest:Oa.processRequest.bind(Oa),processResponse:Oa.processResponse.bind(Oa),processError:Oa.processError.bind(Oa)},Ua=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 Wa(){typeof window<`u`&&(window.__inertia_interceptors__=Ua)}var Ga=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`]=U.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}},Ka={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=`
|
||
dialog#inertia-error-dialog::backdrop {
|
||
background-color: rgba(0, 0, 0, 0.6);
|
||
}
|
||
|
||
dialog#inertia-error-dialog:focus {
|
||
outline: none;
|
||
}
|
||
`;let a=ti.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}},qa=(e,t)=>e===t||e.startsWith(`${t}.`),Ja=(e,t)=>{let{only:n,except:r}=e;return!(n.length===0&&r.length===0||n.length>0&&!n.some(e=>qa(t,e))||r.length>0&&r.some(e=>qa(t,e)))},Ya=(e,t)=>t.some(t=>Ja(e,t)),Xa=new ga,Za=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(){ua(this.requestParams.all().url,window.location)&&this.handle()}async handle(){return Xa.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()),hi(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||!ci(e))return}await xa.processQueue(),xa.preserveUrl=this.requestParams.all().preserveUrl,await this.setPage();let{flash:e}=U.get();Object.keys(e).length>0&&!this.requestParams.isDeferredPropsRequest()&&(_i(e),this.requestParams.all().onFlash(e));let t=U.get().props.errors||{};if(Object.keys(t).length>0){let e=this.getScopedErrors(t);return ai(e,{page:U.get(),visitId:this.requestParams.all().id}),this.requestParams.all().onError(e)}W.flushByCacheTags(this.requestParams.all().invalidateCacheTags||[]),this.wasPrefetched||W.flush(U.get().url),mi(U.get(),{visitId:this.requestParams.all().id}),await this.requestParams.all().onSuccess(U.get()),xa.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()){W.visit(this.getHeader(`x-inertia-redirect`),{...this.requestParams.all(),method:`get`,data:{}});return}if(this.isLocationVisit()){let e=aa(this.getHeader(`x-inertia-location`));return la(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&&ci(e))return Ka.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!==U.get().version;if(!vi(e,n)||n&&this.requestParams.all().async)return;yi.set(yi.locationVisitKey,{preserveScroll:this.requestParams.all().preserveScroll===!0}),ua(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 Ua.processResponse(this.requestParams.all(),this.response),this.mergeProps(e),U.mergeOncePropsIntoResponse(e),this.preserveOptimisticProps(e),this.preserveEqualProps(e),await this.setRememberedState(e),this.requestParams.setPreserveOptions(e),e.url=xa.preserveUrl?U.get().url:this.pageUrl(e),this.requestParams.all().onBeforeUpdate(e),li(e),U.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!==U.get().component)return!1;let t=aa(this.originatingPage.url),n=aa(U.get().url);return t.origin===n.origin&&t.pathname===n.pathname}pageUrl(e){let t=aa(e.url);return e.preserveFragment?t.hash=this.requestParams.all().url.hash:la(this.requestParams.all().url,t),t.pathname+t.search+t.hash}preserveOptimisticProps(e){if(W.hasPendingOptimistic())for(let t of Object.keys(e.props))U.hasBaseline(t)&&(U.updateBaseline(t,e.props[t]),e.props[t]=U.get().props[t])}preserveEqualProps(e){if(e.component!==U.get().component)return;let t=U.get().props;Object.entries(e.props).forEach(([n,r])=>{Nn(r,t[n])&&(e.props[n]=t[n])})}mergeProps(e){if(!this.requestParams.isPartial()||e.component!==U.get().component)return;let t=e.mergeProps||[],n=e.prependProps||[],r=e.deepMergeProps||[],i=e.matchPropsOn||[],a=(t,n)=>{let r=Gn(U.get().props,t),a=Gn(e.props,t);if(Array.isArray(a)){let o=this.mergeOrMatchItems(r||[],a,t,i,n);lr(e.props,t,o)}else if(typeof a==`object`&&a){let n={...r||{},...a};lr(e.props,t,n)}};t.forEach(e=>a(e,!0)),n.forEach(e=>a(e,!1)),r.forEach(t=>{let n=Gn(U.get().props,t),r=Gn(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;lr(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=U.get().props[t];this.isObject(n)&&this.isObject(e.props[t])&&(e.props[t]=this.deepMergeObjects(n,e.props[t]))}e.props={...U.get().props,...e.props},this.shouldPreserveErrors(e)&&(e.props.errors=U.get().props.errors),U.get().scrollProps&&(e.scrollProps={...U.get().scrollProps||{},...e.scrollProps||{}}),U.hasOnceProps()&&(e.onceProps={...U.get().onceProps||{},...e.onceProps||{}}),this.requestParams.isDeferredPropsRequest()&&(e.flash={...U.get().flash});let s=U.get().initialDeferredProps;s&&Object.keys(s).length>0&&(e.initialDeferredProps=s),e.rescuedProps=this.mergeRescuedProps(e)}mergeRescuedProps(e){let t=U.get().rescuedProps??[],n=e.rescuedProps??[],r=new Set(t.filter(e=>!Ja(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=U.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 xa.getState(xa.rememberedState,{});this.requestParams.all().preserveState&&t&&e.component===U.get().component&&(e.rememberedState=t)}getScopedErrors(e){return this.requestParams.all().errorBag?e[this.requestParams.all().errorBag||``]||{}:e}},Qa=class e{constructor(e,t,{optimistic:n=!1}={}){this.page=t,this.requestParams=Ga.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()}getUrl(){return this.requestParams.all().url}isOptimistic(){return this.optimistic}isPendingOptimistic(){return this.isOptimistic()&&(!this.response||!this.response.isProcessed())}async send(){this.requestParams.onCancelToken(()=>{this.response||this.cancel({cancelled:!0})}),pi(this.requestParams.all()),this.requestParams.onStart(),this.requestParams.all().prefetch&&(this.requestParams.onPrefetching(),gi(this.requestParams.all()));let e=this.requestParams.all().prefetch,t={method:this.requestParams.all().method,url:ca(this.requestParams.all().url).href,data:this.requestParams.data(),signal:this.cancelToken.signal,headers:this.getHeaders(),onUploadProgress:this.onProgress.bind(this)},n=await Ua.processRequest(this.requestParams.all(),t);return Ha.getClient().request(n).then(e=>(this.response=Za.create(this.requestParams,e,this.page),this.response.handle())).catch(e=>e instanceof Aa?(this.response=Za.create(this.requestParams,e.response,this.page),this.response.handle()):Promise.reject(e)).catch(t=>{if(!(t instanceof ja)&&this.requestParams.all().onNetworkError(t)!==!1&&oi(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,si(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&&(fi(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=U.get();t.version&&(e[`X-Inertia-Version`]=t.version);let n=Object.entries(t.onceProps||{}).filter(([,e])=>Gn(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}},$a=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(e={}){let t=typeof e==`function`?e:t=>{let{prefetch:n=!0,optimistic:r=!0}=e;return(n||!t.isPrefetch())&&(r||!t.isOptimistic())};this.requests.filter(t).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())}},eo=()=>{},to=class{syncRequestStream=new $a({maxConcurrent:1,interruptible:!0});asyncRequestStream=new $a({maxConcurrent:1/0,interruptible:!1});clientVisitQueue=new ga;pendingOptimisticCallback=void 0;init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}){U.init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}),Ta.handle(),Sa.init(),Sa.on(`missingHistoryItem`,()=>{typeof window<`u`&&this.visit(window.location.href,{preserveState:!0,preserveScroll:!0,replace:!0})}),Sa.on(`loadDeferredProps`,e=>{this.loadDeferredProps(e)}),Sa.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`){xa.remember(e,t)}restore(e=`default`){return xa.restore(e)}on(e,t){return typeof window>`u`?()=>{}:Sa.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 Da.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 Da.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||!ii(n))return;let i=aa(U.get().url);(n.only.length>0||n.except.length>0||n.reset.length>0?da(n.url,i):ua(n.url,i))||this.asyncRequestStream.cancelInFlight(e=>!e.isPrefetch()&&!e.isOptimistic()&&da(e.getUrl(),i)),n.async||this.syncRequestStream.interruptInFlight(),t.optimistic&&this.applyOptimisticUpdate(t.optimistic,r),!U.isCleared()&&!n.preserveUrl&&Wi.save();let a={...n,...r},o=()=>{let e=Ii.get(a);e?(us.reveal(e.inFlight),Ii.use(e,a)):(us.reveal(!0),(n.async?this.asyncRequestStream:this.syncRequestStream).send(Qa.create(a,U.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?xa.processQueue().then(()=>{this.performInstantSwap(n).then(()=>{a.preserveScroll=!0,a.preserveState=!0,a.replace=!0,a.viewTransition=!1,o()})}):o()}getCached(e,t={}){return Ii.findCached(this.getPrefetchParams(e,t))}flush(e,t={}){Ii.remove(this.getPrefetchParams(e,t))}flushAll(){Ii.removeAll()}flushByCacheTags(e){Ii.removeByTags(Array.isArray(e)?e:[e])}getPrefetching(e,t={}){return Ii.findInFlight(this.getPrefetchParams(e,t))}prefetch(e,t={},n={}){if((t.method??(fa(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||!ii(r))return;us.hide(),this.asyncRequestStream.interruptInFlight();let a={...r,...i};new Promise(e=>{let t=()=>{U.get()?e():setTimeout(t,50)};t()}).then(()=>{Ii.add(a,e=>{this.asyncRequestStream.send(Qa.create(e,U.get()))},{cacheFor:ti.get(`prefetch.cacheFor`),cacheTags:[],...n})})}clearHistory(){xa.clear()}decryptHistory(){return xa.decrypt()}resolveComponent(e,t){return U.resolve(e,t)}replace(e){this.clientVisit(e,{replace:!0})}replaceProp(e,t,n){this.replace({preserveScroll:!0,preserveState:!0,props(n){return Ni(n,e,typeof t==`function`?t(Gn(n,e),n):t)},...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=U.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;U.setFlash(r),Object.keys(r).length&&_i(r)}clientVisit(e,{replace:t=!1}={}){this.clientVisitQueue.add(()=>this.performClientVisit(e,{replace:t}))}performClientVisit(e,{replace:t=!1}={}){let n=U.get(),r=typeof e.props==`function`?Object.fromEntries(Object.values(n.onceProps??{}).map(e=>[e.prop,Gn(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=Ga.resolvePreserveOption(e.preserveScroll??!1,f),m=Ga.resolvePreserveOption(e.preserveState??!1,f),h=this.createVisitId();return U.set(f,{replace:t,preserveScroll:p,preserveState:m,viewTransition:o,visitId:h}).then(()=>{di(U.get(),{replace:t,visitId:h});let n=U.get().flash;Object.keys(n).length>0&&(_i(n),l?.(n));let r=U.get().props.errors||{};if(Object.keys(r).length===0){u?.(U.get());return}let i=e.errorBag?r[e.errorBag||``]||{}:r;s?.(i)}).finally(()=>c?.(e))}performInstantSwap(e){let t=U.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(Tn(t.props),Tn(n)):e.pageProps,i=r===null?{...n}:{...r},a=this.preserveOncePropsOnInstantVisit(t,i),o={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,onceProps:a,rememberedState:{}};return U.set(o,{replace:e.replace,preserveScroll:Ga.resolvePreserveOption(e.preserveScroll,o),preserveState:!1,viewTransition:e.viewTransition,visitId:e.id})}preserveOncePropsOnInstantVisit(e,t){let n={};return Object.entries(e.onceProps??{}).forEach(([r,i])=>{if(Gn(t,i.prop)!==void 0)return;let a=Gn(e.props,i.prop);a!==void 0&&(lr(t,i.prop,a),n[r]=i)}),n}getPrefetchParams(e,t){return{...this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1}),...this.getVisitEvents(t)}}createVisitId(){return wa()}getPendingVisit(e,t){if(fa(e)){let n=e;e=n.url,t.method=t.method??n.method}let n=ti.get(`visitOptions`),r=n&&n(e.toString(),Tn(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,...Ai(t),...Ai(r)},[a,o]=oa(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||eo,onBefore:e.onBefore||eo,onBeforeUpdate:e.onBeforeUpdate||eo,onStart:e.onStart||eo,onProgress:e.onProgress||eo,onFinish:e.onFinish||eo,onCancel:e.onCancel||eo,onSuccess:e.onSuccess||eo,onError:e.onError||eo,onHttpException:e.onHttpException||eo,onNetworkError:e.onNetworkError||eo,onFlash:e.onFlash||eo,onPrefetched:e.onPrefetched||eo,onPrefetching:e.onPrefetching||eo}}applyOptimisticUpdate(e,t){let n=U.get().props,r=e(Tn(n));if(!r)return;let i=[];for(let e of Object.keys(r))Nn(n[e],r[e])||i.push(e);if(i.length===0)return;let a=U.nextOptimisticId(),o=U.get().component;for(let e of i)U.setBaseline(e,Tn(n[e]));U.registerOptimistic(a,e),U.setPropsQuietly({...n,...r});let s=!0,c=t.onSuccess;t.onSuccess=e=>(s=!1,c(e));let l=t.onFinish;t.onFinish=e=>{if(U.unregisterOptimistic(a),s&&U.get().component===o){let e=U.replayOptimistics();Object.keys(e).length>0&&U.setPropsQuietly({...U.get().props,...e})}return U.pendingOptimisticCount()===0&&U.clearOptimisticState(),l(e)}}loadDeferredProps(e){e&&Object.values(e).forEach(e=>{this.doReload({only:e,deferredProps:!0,preserveErrors:!0})})}},no=class{static createWayfinderCallback(...e){return()=>e.length===1?fa(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]??{}}:fa(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 ro(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 io(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 ao(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 oo(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 so(e){if(Array.isArray(e))return e.map(so);if(typeof e!=`object`||!e||Gi(e))return e;if(oo(e)){let t=[];for(let n=0;n<Object.keys(e).length;n++)t[n]=so(e[n]);return t}let t={};for(let n in e)t[n]=so(e[n]);return t}function co(e){let t={};for(let[n,r]of e.entries()){if(r instanceof File&&r.size===0&&r.name===``)continue;let e=io(ro(n));if(e[e.length-1]===``){let n=e.slice(0,-1),i=Gn(t,n);if(Array.isArray(i))i.push(r);else if(i&&typeof i==`object`&&!Gi(i)){let e=Object.keys(i).filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>e-t);lr(t,n,e.length>0?[...e.map(e=>i[e]),r]:[r])}else lr(t,n,[r]);continue}ao(t,e.map(String),r)}return so(t)}var lo=`server`;function uo(e,t){return e.match(/\sdata-inertia(=|\s|>)/)?e:e.replace(/^<([a-zA-Z][^\s/>]*)/,`<$1 data-inertia="server-head-${t}"`)}function fo(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(uo):[]}var po={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:ni(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 mo(e,t,n,r=[]){let i=r.length?{[lo]: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[lo]=e:delete i[lo],f()}function d(){let e=t(``),n=i[lo]||[],r=Object.keys(i).filter(e=>e!==lo).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()):po.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 ho=`X-Inertia-Infinite-Scroll-Merge-Intent`,go=e=>{let t=()=>{let t=U.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=U.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=W.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=W.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,W.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,W.reload({preserveErrors:!0,...r,data:{...r.data||{},[l()]:i},only:[...r.only||[],e.getPropName()],preserveUrl:!0,headers:{[ho]: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}},_o=()=>{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}}},vo=`infiniteScrollPage`,yo=`infiniteScrollIgnore`,bo=e=>e.dataset[vo],xo=e=>{let t=_o(),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=>!(vo in e.dataset)&&!(yo in e.dataset),m=()=>{Array.from(f).forEach(e=>{p(e)&&(e.dataset[yo]=`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[vo]=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=bo(r);i!==void 0&&(i in t?t[i].to=e:t[i]={from:e,to:e})}W.remember(t,v())},b=ni(y,250),x=()=>{let t=W.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[vo]=o;else if(p(a))a.dataset[yo]=`true`;else continue;n.observe(a)}return!0};return{setupObservers:s,enableTriggers:c,disableTriggers:l,refreshTriggers:u,flushAll:d,processManuallyAddedElements:m,processServerLoadedElements:_}},So=new ga,Co,wo,To=null,Eo=e=>{let t=!0,n=n=>{So.add(()=>new Promise(r=>{if(!t)return Co=wo=null,r();if(!Co||!wo){let e=U.get().url;Co=aa(e),wo=aa(e),To=ma(e)}let i=e.getPageName(),a=wo.searchParams;n===`1`?a.delete(i):a.set(i,n),setTimeout(()=>r())})).finally(()=>{t&&Co&&wo&&Co.href!==wo.href&&To!==null&&W.replace({url:ha(wo,To),preserveScroll:!0,preserveState:!0}),Co=wo=To=null})};return{onItemIntersected:ni(r=>{let i=e.getItemsElement();if(!t||e.shouldPreserveUrl()||!r||!i)return;let a=new Map;zi([...i.children],r).forEach(e=>{let t=bo(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}},Do=e=>({createCallbacks:()=>{let t,n=null,r=0;return{captureScrollPosition:()=>{let i=e.getScrollableParent(),a=e.getItemsElement();t=i?.scrollTop||window.scrollY;let o=zi([...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 Oo(e){let t=Eo({...e,getPageName:()=>i.getPageName()}),n=Do(e),r=xo({...e,onItemIntersected:t.onItemIntersected,onPreviousTriggered:()=>i.fetchPrevious(),onNextTriggered:()=>i.fetchNext()}),i=go({...e,onBeforeUpdate:r.processManuallyAddedElements,onCompletePreviousRequest:(t,n)=>{e.onCompletePreviousRequest(n),n.completed&&Bi(()=>r.processServerLoadedElements(n.page),2)},onCompleteNextRequest:(t,n)=>{e.onCompleteNextRequest(n),n.completed&&Bi(()=>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=W.on(`success`,()=>Bi(r.refreshTriggers,2));return{dataManager:i,elementManager:r,flush:()=>{c(),i.removeEventListener(),r.flushAll(),t.cancel()}}}function ko(){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};Nn(e,n)||(e=n,a(),o())},setFor(e,n){let r=t[e]||{},i={...r,...n};Nn(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 Ao(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jo(e){return Ao(e)&&`component`in e}function Mo(e,t){return`component`in e&&t(e.component)}function No(e,t){return!Ao(e)||t(e)||Mo(e,t)?!1:Object.values(e).every(e=>t(e)||Array.isArray(e)&&t(e[0])||jo(e)&&t(e.component))}function Po(e,t){return Ao(e)&&!t(e)&&!Mo(e,t)&&!No(e,t)}function Fo(e,t){if(Po(e,t))return!0;if(!Ao(e)||t(e)||Mo(e,t))return!1;let n=Object.values(e);return n.length>0&&n.every(e=>typeof e==`function`)}function Io(e,t){return Array.isArray(e)&&e.length===2&&t(e[0])&&Ao(e[1])&&!t(e[1])}function Lo(e,t){if(Array.isArray(e)&&t(e[0]))return{component:e[0],props:e[1]??{}};if(jo(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 Ro(e,t,n){return!e||n&&n(e)?[]:No(e,t)?Object.entries(e).map(([e,n])=>({...Lo(n,t),name:e})):Io(e,t)?[{component:e[0],props:e[1]??{}}]:Array.isArray(e)?e.map(e=>Lo(e,t)):jo(e)&&t(e.component)?[{component:e.component,props:e.props??{}}]:t(e)?[{component:e,props:{}}]:[]}function zo(e){return e.target instanceof HTMLElement&&e.target.isContentEditable||e.defaultPrevented}function Bo(e){let t=e.currentTarget.tagName.toLowerCase()===`a`,n=t?e.currentTarget.target:``;return!(zo(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 Vo(e){let t=e.currentTarget.tagName.toLowerCase()===`button`;return!zo(e)&&(e.key===`Enter`||t&&e.key===` `)}var Ho=`nprogress`,Uo,Wo,Go={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(``)},Ko=null,qo=!1,Jo=e=>{Object.assign(Go,e),Uo=Go.popover??`popover`in HTMLElement.prototype,Go.includeCSS&&cs(Go.color),Wo=document.createElement(`div`),Wo.id=Ho,Wo.setAttribute(`aria-hidden`,`true`),Wo.innerHTML=Go.template,Uo&&(Wo.popover=`manual`)},Yo=e=>{let t=Xo();e=is(e,Go.minimum,1),Ko=e===1?null:e;let n=es(!t),r=n.querySelector(Go.barSelector),i=Go.speed,a=Go.easing;n.offsetWidth,ss(t=>{let o={transition:`all ${i}ms ${a}`,transform:`translate3d(${as(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(()=>{ns(),n.style.transition=``,n.style.opacity=``,t()},i)},i)})},Xo=()=>typeof Ko==`number`,Zo=()=>{Ko||Yo(0);let e=function(){setTimeout(function(){Ko&&($o(),e())},Go.trickleSpeed)};Go.trickle&&e()},Qo=e=>{(e||Ko)&&($o(.3+.5*Math.random()),Yo(1))},$o=e=>{let t=Ko;if(t===null)return Zo();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})(),Yo(is(t+e,0,.994))},es=e=>{if(rs())return document.getElementById(Ho);document.documentElement.classList.add(`${Ho}-busy`);let t=Wo.querySelector(Go.barSelector),n=e?`-100`:as(Ko||0);if(t.style.transition=`all 0 linear`,t.style.transform=`translate3d(${n}%,0,0)`,Go.showSpinner||Wo.querySelector(Go.spinnerSelector)?.remove(),Uo)document.body.appendChild(Wo),qo||Wo.showPopover();else{let e=ts();e!==document.body&&e.classList.add(`${Ho}-custom-parent`),e.appendChild(Wo),qo&&(Wo.style.display=`none`)}return Wo},ts=()=>document.querySelector(Go.parent),ns=()=>{if(document.documentElement.classList.remove(`${Ho}-busy`),Uo&&Wo?.isConnected)try{Wo.hidePopover()}catch{}Uo||ts().classList.remove(`${Ho}-custom-parent`),Wo?.remove()},rs=()=>document.getElementById(Ho)!==null;function is(e,t,n){return e<t?t:e>n?n:e}var as=e=>(-1+e)*100,ss=(()=>{let e=[],t=()=>{let n=e.shift();n&&n(t)};return n=>{e.push(n),e.length===1&&t()}})(),cs=e=>{let t=document.createElement(`style`),n=ti.get(`nonce`);n&&(t.nonce=n),t.textContent=`
|
||
#${Ho} {
|
||
pointer-events: none;
|
||
background: none;
|
||
border: none;
|
||
margin: 0;
|
||
padding: 0;
|
||
overflow: visible;
|
||
inset: unset;
|
||
width: 100%;
|
||
height: 0;
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
}
|
||
|
||
#${Ho}::backdrop {
|
||
display: none;
|
||
}
|
||
|
||
#${Ho} .bar {
|
||
background: ${e};
|
||
|
||
position: fixed;
|
||
z-index: 1031;
|
||
top: 0;
|
||
left: 0;
|
||
|
||
width: 100%;
|
||
height: 2px;
|
||
}
|
||
|
||
#${Ho} .peg {
|
||
display: block;
|
||
position: absolute;
|
||
right: 0px;
|
||
width: 100px;
|
||
height: 100%;
|
||
box-shadow: 0 0 10px ${e}, 0 0 5px ${e};
|
||
opacity: 1.0;
|
||
|
||
transform: rotate(3deg) translate(0px, -4px);
|
||
}
|
||
|
||
#${Ho} .spinner {
|
||
display: block;
|
||
position: fixed;
|
||
z-index: 1031;
|
||
top: 15px;
|
||
right: 15px;
|
||
}
|
||
|
||
#${Ho} .spinner-icon {
|
||
width: 18px;
|
||
height: 18px;
|
||
box-sizing: border-box;
|
||
|
||
border: solid 2px transparent;
|
||
border-top-color: ${e};
|
||
border-left-color: ${e};
|
||
border-radius: 50%;
|
||
|
||
animation: ${Ho}-spinner 400ms linear infinite;
|
||
}
|
||
|
||
.${Ho}-custom-parent {
|
||
overflow: hidden;
|
||
position: relative;
|
||
}
|
||
|
||
.${Ho}-custom-parent #${Ho} .spinner,
|
||
.${Ho}-custom-parent #${Ho} .bar {
|
||
position: absolute;
|
||
}
|
||
|
||
@keyframes ${Ho}-spinner {
|
||
0% { transform: rotate(0deg); }
|
||
100% { transform: rotate(360deg); }
|
||
}
|
||
`,document.head.appendChild(t)},ls={configure:Jo,isStarted:Xo,done:Qo,set:Yo,remove:ns,start:Zo,status:Ko,show:()=>{if(qo=!1,Wo?.isConnected){if(Uo)try{Wo.showPopover()}catch{}else Wo.style.display=``}},hide:()=>{if(qo=!0,Wo?.isConnected){if(Uo)try{Wo.hidePopover()}catch{}else Wo.style.display=`none`}}},us=new class{hideCount=0;start(){ls.start()}reveal(e=!1){this.hideCount=Math.max(0,this.hideCount-1),(e||this.hideCount===0)&&ls.show()}hide(){this.hideCount++,ls.hide()}set(e){ls.set(Math.max(0,Math.min(1,e)))}finish(){ls.done()}reset(){ls.set(0)}remove(){ls.done(),ls.remove()}isStarted(){return ls.isStarted()}getStatus(){return ls.status}};function ds(e){document.addEventListener(`inertia:start`,t=>fs(t,e)),document.addEventListener(`inertia:progress`,ps)}function fs(e,t){e.detail.visit.showProgress||us.hide();let n=setTimeout(()=>us.start(),t);document.addEventListener(`inertia:finish`,e=>ms(e,n),{once:!0})}function ps(e){us.isStarted()&&e.detail.progress?.percentage&&us.set(Math.max(us.getStatus(),e.detail.progress.percentage/100*.9))}function ms(e,t){clearTimeout(t),us.isStarted()&&(e.detail.visit.completed?us.finish():e.detail.visit.interrupted?us.reset():e.detail.visit.cancelled&&us.remove())}function hs({delay:e=250,color:t=`#29d`,includeCSS:n=!0,showSpinner:r=!1,popover:i=null}={}){ds(e),ls.configure({showSpinner:r,includeCSS:n,color:t,popover:i})}var gs=Symbol(`FormComponentReset`);function _s(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function vs(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 ys(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 bs(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 vs(e,t);if(e instanceof HTMLSelectElement)return ys(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 xs(e,t){let n=!1;return e instanceof RadioNodeList||e instanceof HTMLCollection?Array.from(e).forEach((e,r)=>{e instanceof Element&&_s(e)&&(e instanceof HTMLInputElement&&[`checkbox`,`radio`].includes(e.type.toLowerCase())?bs(e,t)&&(n=!0):bs(e,t[r]===void 0?[t[0]??null].filter(Boolean):[t[r]])&&(n=!0))}):_s(e)&&(n=bs(e,t)),n}function Ss(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=>_s(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&&xs(r,t.getAll(n))&&(i=!0)}),i&&r&&e.dispatchEvent(new CustomEvent(`reset`,{bubbles:!0,cancelable:!0,detail:{[gs]:!0}}))}function Cs(e,t,n){return`<script data-page="${e}" type="application/json">${JSON.stringify(t).replace(/\//g,`\\/`).replace(/</g,`\\u003c`)}<\/script><div data-server-rendered="true" id="${e}">${n}</div>`}var W=new to,ws=e({App:()=>Us,Deferred:()=>qs,Form:()=>$s,Head:()=>fc,InfiniteScroll:()=>mc,Link:()=>gc,WhenVisible:()=>xc,config:()=>Sc,createForm:()=>Qs,createInertiaApp:()=>Ks,http:()=>Ha,progress:()=>us,resetLayoutProps:()=>Os,router:()=>W,setLayoutProps:()=>Ds,useForm:()=>Ps,useFormContext:()=>Zs,useHttp:()=>_c,usePage:()=>Gs,usePoll:()=>vc,usePrefetch:()=>yc,useRemember:()=>bc}),Ts=ko(),Es=I(Ts.get());Ts.subscribe(()=>{Es.value=Ts.get()});function Ds(e,t){typeof e==`string`?Ts.setFor(e,t):Ts.set(e)}function Os(){Ts.reset(),Es.value=Ts.get()}var ks={created(){if(!this.$options.remember)return;Array.isArray(this.$options.remember)&&(this.$options.remember={data:this.$options.remember}),typeof this.$options.remember==`string`&&(this.$options.remember={data:[this.$options.remember]}),typeof this.$options.remember.data==`string`&&(this.$options.remember={data:[this.$options.remember.data]});let e=this.$options.remember.key instanceof Function?this.$options.remember.key.call(this):this.$options.remember.key,t=W.restore(e),n=this.$options.remember.data.filter(e=>this[e]===null||typeof this[e]!=`object`||this[e].__rememberable!==!1),r=e=>this[e]!==null&&typeof this[e]==`object`&&typeof this[e].__remember==`function`&&typeof this[e].__restore==`function`;n.forEach(i=>{this[i]!==void 0&&t!==void 0&&t[i]!==void 0&&(r(i)?this[i].__restore(t[i]):this[i]=t[i]),this.$watch(i,()=>{W.remember(n.reduce((e,t)=>({...e,[t]:Tn(r(t)?this[t].__remember():this[t])}),{}),e)},{immediate:!0,deep:!0})})}};function As(e){let{data:t,rememberKey:n}=e,{precognitionEndpoint:r}=e,i=typeof t==`function`,a=()=>i?t():t,o=n?W.restore(n):null,s=Tn(o?.data??Tn(a())),c=e=>e,l=null,u=null,d=()=>u??Sc.get(`form.withAllErrors`),p,m=!1,h=[],g=ce({...Tn(s),isDirty:!1,errors:{},hasErrors:!1,processing:!1,progress:null,wasSuccessful:!1,recentlySuccessful:!1,withPrecognition(...e){r=no.createWayfinderCallback(...e);let t=this,n=Xr(e=>{let{method:t,url:n}=r(),i=Tn(c(this.data()));return e[t](n,i)},Tn(s));l=n,n.on(`validatingChanged`,()=>{t.validating=n.validating()}).on(`validatedChanged`,()=>{t.__valid=n.valid()}).on(`touchedChanged`,()=>{t.__touched=n.touched()}).on(`errorsChanged`,()=>{let e=d()?n.errors():Zr(n.errors());this.errors={},this.setError(e),t.__valid=n.valid()});let i=(e,t)=>(t(e),e);return Object.assign(t,{__touched:[],__valid:[],validating:!1,validator:()=>n,withAllErrors:()=>i(t,()=>u=!0),valid:e=>t.__valid.includes(e),invalid:e=>e in this.errors,setValidationTimeout:e=>i(t,()=>n.setTimeout(e)),validateFiles:()=>i(t,()=>n.validateFiles()),withoutFileValidation:()=>i(t,()=>n.withoutFileValidation()),touch:(e,...r)=>(Array.isArray(e)?n.touch(e):typeof e==`string`?n.touch([e,...r]):n.touch(e),t),touched:e=>typeof e==`string`?t.__touched.includes(e):t.__touched.length>0,validate:(e,r)=>{if(typeof e==`object`&&!(`target`in e)&&(r=e,e=void 0),e===void 0)n.validate(r);else{let t=$r(e),i=c(this.data());n.validate(t,Gn(i,t),r)}return t},setErrors:e=>i(t,()=>this.setError(e)),forgetError:e=>i(t,()=>this.clearErrors($r(e)))}),t},data(){return Object.keys(s).reduce((e,t)=>lr(e,t,Gn(this,t)),{})},transform(e){return c=e,this},defaults(e,t){if(i)throw Error("You cannot call `defaults()` when using a function to define your form data.");return m=!0,e===void 0?(s=Tn(this.data()),this.isDirty=!1):s=typeof e==`string`?lr(Tn(s),e,t):Object.assign({},Tn(s),e),l?.defaults(s),this},reset(...e){let t=Tn(i?Tn(a()):s);return e.length===0?(i&&(s=t),Object.assign(this,t)):e.filter(e=>$n(t,e)).forEach(e=>{i&&lr(s,e,Gn(t,e)),lr(this,e,Gn(t,e))}),l?.reset(...e),this},setError(e,t){let n=typeof e==`string`?{[e]:t}:e;return Object.assign(this.errors,n),this.hasErrors=Object.keys(this.errors).length>0,l?.setErrors(n),this},clearErrors(...e){return this.errors=Object.keys(this.errors).reduce((t,n)=>({...t,...e.length>0&&!e.includes(n)?{[n]:this.errors[n]}:{}}),{}),this.hasErrors=Object.keys(this.errors).length>0,l&&(e.length===0?l.setErrors({}):e.forEach(l.forgetError)),this},resetAndClearErrors(...e){return this.reset(...e),this.clearErrors(...e),this},__rememberable:n===null,__remember(){let e=this.data();if(h.length>0){let t={...e};return h.forEach(e=>delete t[e]),{data:t,errors:this.errors}}return{data:e,errors:this.errors}},__restore(e){Object.assign(this,e.data),this.setError(e.errors)}});return o?.errors&&g.setError(o.errors),f(g,()=>{g.isDirty=!Nn(g.data(),s)},{immediate:!0,deep:!0}),f(g,e=>{if(!n)return;let t=W.restore(n),r=Tn(e.__remember());Nn(t,r)||W.remember(r,n)},{immediate:!0,deep:!0}),r&&g.withPrecognition(r),{form:g,setDefaults:e=>{s=e},getTransform:()=>c,getPrecognitionEndpoint:()=>r??null,markAsSuccessful:()=>{g.clearErrors(),g.wasSuccessful=!0,g.recentlySuccessful=!0,p=setTimeout(()=>g.recentlySuccessful=!1,Sc.get(`form.recentlySuccessfulDuration`))},wasDefaultsCalledInOnSuccess:()=>m,resetDefaultsCalledInOnSuccess:()=>{m=!1},setRememberExcludeKeys:e=>{h=e},resetBeforeSubmit:()=>{g.wasSuccessful=!1,g.recentlySuccessful=!1,clearTimeout(p)},finishProcessing:()=>{g.processing=!1,g.progress=null},withAllErrors:{enabled:d,enable:()=>{u=!0}}}}var js=null,Ms=!1;function Ns(e){if(Ms)return;js===null&&(Ms=!0,js=new Set(Object.keys(Ps({}))),Ms=!1);let t=Object.keys(e).filter(e=>js.has(e));t.length>0&&console.error(`[Inertia] useForm() data contains field(s) that conflict with form properties: ${t.map(e=>`"${e}"`).join(`, `)}. These fields will be overwritten by form methods/properties. Please rename these fields.`)}function Ps(...e){let{rememberKey:t,data:n,precognitionEndpoint:r}=no.parseUseFormArguments(...e);Ns(Tn(typeof n==`function`?n():n));let i=null,a=null,{form:o,setDefaults:s,getTransform:c,getPrecognitionEndpoint:l,markAsSuccessful:u,wasDefaultsCalledInOnSuccess:d,resetDefaultsCalledInOnSuccess:f,setRememberExcludeKeys:p,resetBeforeSubmit:m,finishProcessing:h}=As({data:n,rememberKey:t,precognitionEndpoint:r}),g=o,_=e=>(t,n={})=>{g.submit(e,t,n)};return Object.assign(g,{submit(...e){let{method:t,url:n,options:r}=no.parseSubmitArguments(e,l());f();let o={...r,onCancelToken:e=>(i=e,r.onCancelToken?.(e)),onBefore:e=>(m(),r.onBefore?.(e)),onStart:e=>(g.processing=!0,r.onStart?.(e)),onProgress:e=>(g.progress=e??null,r.onProgress?.(e)),onSuccess:async e=>{u();let t=r.onSuccess?await r.onSuccess(e):null;return d()||(s(Tn(g.data())),g.isDirty=!1),t},onError:e=>(g.clearErrors().setError(e),r.onError?.(e)),onCancel:()=>r.onCancel?.(),onFinish:e=>(h(),i=null,r.onFinish?.(e))};o.optimistic=o.optimistic??a??void 0,a=null;let p=c()(g.data());t===`delete`?W.delete(n,{...o,data:p}):W[t](n,p,o)},get:_(`get`),post:_(`post`),put:_(`put`),patch:_(`patch`),delete:_(`delete`),cancel(){i&&i.cancel()},dontRemember(...e){return p(e),g},optimistic(e){return a=e,g}}),l(),g}function Fs(e){if(!e)return!1;if(typeof e==`function`)return!0;if(typeof e==`object`){let t=e;return typeof t.render==`function`||typeof t.setup==`function`||typeof t.template==`string`||`__file`in t||`__name`in t}return!1}function Is(e){if(typeof e!=`function`)return!1;let t=e;return t.length===2&&t.prototype===void 0}var Ls=I(void 0),Rs=I(),zs=null,Bs=_e(null),Vs=I(void 0),Hs,Us=A({name:`Inertia`,props:{initialPage:{type:Object,required:!0},initialComponent:{type:Object,required:!1},resolveComponent:{type:Function,required:!1},titleCallback:{type:Function,required:!1,default:e=>e},onHeadUpdate:{type:Function,required:!1,default:()=>()=>{}},defaultLayout:{type:Function,required:!1},serverHead:{type:[Boolean,String,Function],required:!1}},setup({initialPage:e,initialComponent:t,resolveComponent:n,titleCallback:r,onHeadUpdate:i,defaultLayout:a,serverHead:s}){Ls.value=t?oe(t):void 0,Rs.value={...e,flash:e.flash??{}},Vs.value=void 0;let c=typeof window>`u`;if(Hs=mo(c,e=>r?r(e,Rs.value):e,i||(()=>{}),fo(e,s)),!c){W.init({initialPage:e,resolveComponent:n,swapComponent:async e=>{e.preserveState||Os(),Ls.value=oe(e.component),Rs.value=e.page,Vs.value=e.preserveState?Vs.value:Date.now()},onFlash:e=>{Rs.value={...Rs.value,flash:e}}});let t=e=>{Hs.updateServerHead(fo(e.detail.page,s))};W.on(`navigate`,t),W.on(`clientVisit`,t)}return()=>{if(Ls.value){Ls.value.inheritAttrs=!!Ls.value.inheritAttrs;let e=o(Ls.value,{...Rs.value.props,key:Vs.value});if(Bs.value&&=(Ls.value.layout=Bs.value,null),Ls.value.layout&&Is(Ls.value.layout))return Ls.value.layout(o,e);let t,n=null,r=Ls.value.layout;if(typeof r==`function`&&r.length<=1&&r.prototype===void 0){let e=r(Rs.value.props);Fo(e,Fs)?(t=a?.(Rs.value.component,Rs.value),n=e):t=e}else Po(r,Fs)?(t=a?.(Rs.value.component,Rs.value),n=r):t=r??a?.(Rs.value.component,Rs.value);if(t){let r=Ro(t,Fs,Ls.value.layout&&!n?Is:void 0);if(n&&(r=r.map(e=>({...e,props:{...e.props,...n}}))),r.length>0){let t=c?{shared:{},named:{}}:Es.value;return r.reduceRight((e,n)=>{let r=n.component;return r.inheritAttrs=!!r.inheritAttrs,o(r,{...Rs.value.props,...n.props,...t.shared,...n.name&&t.named[n.name]||{}},()=>e)},e)}}return e}}}}),Ws={install(e){W.form=Ps,Object.defineProperty(e.config.globalProperties,"$inertia",{get:()=>W}),Object.defineProperty(e.config.globalProperties,"$page",{get:()=>Rs.value}),Object.defineProperty(e.config.globalProperties,"$headManager",{get:()=>Hs}),e.mixin(ks)}};function Gs(){return zs||=ce({props:k(()=>Rs.value?.props),url:k(()=>Rs.value?.url),component:k(()=>Rs.value?.component),version:k(()=>Rs.value?.version),clearHistory:k(()=>Rs.value?.clearHistory),deferredProps:k(()=>Rs.value?.deferredProps),rescuedProps:k(()=>Rs.value?.rescuedProps),mergeProps:k(()=>Rs.value?.mergeProps),prependProps:k(()=>Rs.value?.prependProps),deepMergeProps:k(()=>Rs.value?.deepMergeProps),matchPropsOn:k(()=>Rs.value?.matchPropsOn),rememberedState:k(()=>Rs.value?.rememberedState),encryptHistory:k(()=>Rs.value?.encryptHistory),scrollProps:k(()=>Rs.value?.scrollProps),flash:k(()=>Rs.value?.flash)}),zs}async function Ks({id:e=`app`,resolve:t,setup:n,title:r,progress:i={},page:a,render:s,defaults:c={},nonce:l,http:u,layout:d,serverHead:f,withApp:p,dev:m=!1}={}){Sc.replace(c),l&&Sc.set(`nonce`,l),u&&Ha.setClient(u),m&&Wa();let h=typeof window>`u`,g=(e,n)=>Promise.resolve(t(e,n)).then(e=>e.default||e);if(h&&!a&&!s)return async(t,i)=>{let a=[],s={initialPage:t,initialComponent:await g(t.component,t),resolveComponent:g,titleCallback:r,onHeadUpdate:e=>a=e,defaultLayout:d,serverHead:f},c;n?c=n({el:null,App:Us,props:s,plugin:Ws}):(c=xe({render:()=>o(Us,s)}),c.use(Ws),p&&p(c,{ssr:!0,page:t}));let l=Cs(e,t,await i(c));return{head:a,body:l}};let _=a||Vi(e),v=[],y=await Promise.all([g(_.component,_),W.decryptHistory().catch(()=>{})]).then(([t])=>{let i={initialPage:_,initialComponent:t,resolveComponent:g,titleCallback:r,onHeadUpdate:h?e=>v=e:void 0,defaultLayout:d,serverHead:f};if(h)return n({el:null,App:Us,props:i,plugin:Ws});let a=document.getElementById(e);if(n)return n({el:a,App:Us,props:i,plugin:Ws});if(a.hasAttribute(`data-server-rendered`)){let e=xe({render:()=>o(Us,i)});e.use(Ws),p&&p(e,{ssr:!1,page:_}),e.mount(a)}else{let e=Ce({render:()=>o(Us,i)});e.use(Ws),p&&p(e,{ssr:!1,page:_}),e.mount(a)}});if(!h&&i&&hs(i),h&&s&&y){let t=Cs(e,_,await s(y));return{head:v,body:t}}}var qs=A({name:`Deferred`,props:{data:{type:[String,Array],required:!0}},slots:Object,setup(e,{slots:t}){let n=I(!1),r=new Set,i=Gs(),a=k(()=>Array.isArray(e.data)?e.data:[e.data]),s=k(()=>new Set(i.rescuedProps)),c=null,l=null;return ie(()=>{c=W.on(`start`,e=>{let t=e.detail.visit;t.preserveState===!0&&da(t.url,window.location)&&Ya(t,a.value)&&(r.add(t),n.value=!0)}),l=W.on(`finish`,e=>{let t=e.detail.visit;r.has(t)&&(r.delete(t),n.value=r.size>0)})}),se(()=>{c?.(),l?.(),r.clear()}),()=>{if(!t.fallback)throw Error("`<Deferred>` requires a `<template #fallback>` slot");let e=a.value.every(e=>Gn(i.props,e)!==void 0),r=a.value.some(e=>s.value.has(e)),c={reloading:n.value};return e&&!r?o(M,{key:`default`},t.default?.(c)??[]):r&&t.rescue?o(M,{key:`rescue`},t.rescue(c)):o(M,{key:`fallback`},t.fallback({}))}}}),Js=()=>void 0,Ys=Symbol(`InertiaFormContext`),Xs=A({name:`Form`,slots:Object,props:{action:{type:[String,Object],default:``},method:{type:String,default:`get`},headers:{type:Object,default:()=>({})},queryStringArrayFormat:{type:String,default:`brackets`},errorBag:{type:[String,null],default:null},showProgress:{type:Boolean,default:!0},transform:{type:Function,default:e=>e},options:{type:Object,default:()=>({})},resetOnError:{type:[Boolean,Array],default:!1},resetOnSuccess:{type:[Boolean,Array],default:!1},setDefaultsOnSuccess:{type:Boolean,default:!1},onCancelToken:{type:Function,default:Js},onBefore:{type:Function,default:Js},onStart:{type:Function,default:Js},onProgress:{type:Function,default:Js},onFinish:{type:Function,default:Js},onCancel:{type:Function,default:Js},onSuccess:{type:Function,default:Js},onError:{type:Function,default:Js},onSubmitComplete:{type:Function,default:Js},disableWhileProcessing:{type:Boolean,default:!1},cancelOnUnmount:{type:Boolean,default:!1},invalidateCacheTags:{type:[String,Array],default:()=>[]},validateFiles:{type:Boolean,default:!1},validationTimeout:{type:Number,default:1500},optimistic:{type:Function,default:void 0},withAllErrors:{type:Boolean,default:null},component:{type:String,default:null},instant:{type:Boolean,default:!1}},setup(e,{slots:t,attrs:n,expose:r}){let i=()=>{let[t,n]=_();return e.transform(n)},a=Ps({}).withPrecognition(()=>c.value,()=>_()[0]).transform(i).setValidationTimeout(e.validationTimeout);e.validateFiles&&a.validateFiles(),(e.withAllErrors??ti.get(`form.withAllErrors`))&&a.withAllErrors();let s=I(),c=k(()=>fa(e.action)?e.action.method:e.method.toLowerCase()),l=k(()=>e.component?e.component:e.instant&&fa(e.action)?pa(e.action):null),u=I(!1),d=I(new FormData),p=e=>{e.type===`reset`&&e.detail?.[gs]&&e.preventDefault(),u.value=e.type!==`reset`&&!Nn(g(),co(d.value))},m=[`input`,`change`,`reset`];ie(()=>{d.value=h(),a.defaults(g()),m.forEach(e=>s.value.addEventListener(e,p))}),f(()=>e.validateFiles,e=>e?a.validateFiles():a.withoutFileValidation()),f(()=>e.validationTimeout,e=>a.setValidationTimeout(e)),ue(()=>{m.forEach(e=>s.value?.removeEventListener(e,p)),e.cancelOnUnmount&&a.cancel()});let h=e=>new FormData(s.value,e),g=e=>co(h(e)),_=t=>sa(c.value,fa(e.action)?e.action.url:e.action,g(t),e.queryStringArrayFormat),v=t=>{let[n,r]=_(t);if(t?.getAttribute(`formtarget`)===`_blank`&&c.value===`get`){window.open(n,`_blank`);return}let o=e=>{e&&(e===!0?y():e.length>0&&y(...e))},s={headers:e.headers,queryStringArrayFormat:e.queryStringArrayFormat,errorBag:e.errorBag,showProgress:e.showProgress,invalidateCacheTags:e.invalidateCacheTags,component:l.value,optimistic:e.optimistic?t=>e.optimistic(t,r):void 0,onCancelToken:e.onCancelToken,onBefore:e.onBefore,onStart:e.onStart,onProgress:e.onProgress,onFinish:e.onFinish,onCancel:e.onCancel,onSuccess:async(...t)=>{let n=await e.onSuccess?.(...t);return e.onSubmitComplete?.(C),o(e.resetOnSuccess),e.setDefaultsOnSuccess===!0&&S(),n},onError:(...t)=>{e.onError?.(...t),o(e.resetOnError)},...e.options};a.transform(()=>e.transform(r)).submit(c.value,n,s),a.transform(i)},y=(...e)=>{Ss(s.value,d.value,e),a.reset(...e)},b=(...e)=>{a.clearErrors(...e)},x=(...e)=>{b(...e),y(...e)},S=()=>{d.value=h(),u.value=!1},C={get errors(){return a.errors},get hasErrors(){return a.hasErrors},get processing(){return a.processing},get progress(){return a.progress},get wasSuccessful(){return a.wasSuccessful},get recentlySuccessful(){return a.recentlySuccessful},get validating(){return a.validating},clearErrors:b,resetAndClearErrors:x,setError:(e,t)=>a.setError(typeof e==`string`?{[e]:t}:e),get isDirty(){return u.value},reset:y,submit:v,cancel:()=>a.cancel(),defaults:S,getData:g,getFormData:h,touch:a.touch,valid:a.valid,invalid:a.invalid,touched:a.touched,validate:(t,n)=>a.validate(...no.mergeHeadersForValidation(t,n,e.headers)),validator:()=>a.validator()};return r(C),le(Ys,C),()=>o(`form`,{...n,ref:s,action:fa(e.action)?e.action.url:e.action,method:c.value,onSubmit:e=>{e.preventDefault(),v(e.submitter)},inert:e.disableWhileProcessing&&a.processing},t.default?t.default(C):[])}});function Zs(){return p(Ys)}function Qs(){return Xs}var $s=Xs;function ec(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 tc(e){e.props=e.props||{},e.props[`data-inertia`]=e.props[`head-key`]===void 0?``:e.props[`head-key`];let t=Object.keys(e.props).reduce((t,n)=>{let r=String(e.props[n]);return[`key`,`head-key`].includes(n)?t:r===``?t+` ${n}`:t+` ${n}="${mr(r)}"`},``);return`<${String(e.type)}${t}>`}function nc(e){let{children:t}=e;return typeof t==`string`?t:Array.isArray(t)?t.reduce((e,t)=>e+cc(t),``):``}function rc(e){return typeof e.type==`function`}function ic(e){return typeof e.type==`object`}function ac(e){return/(comment|cmt)/i.test(e.type.toString())}function oc(e){return/(fragment|fgt|symbol\(\))/i.test(e.type.toString())}function sc(e){return/(text|txt)/i.test(e.type.toString())}function cc(e){if(sc(e))return String(e.children);if(oc(e)||ac(e))return``;let t=tc(e);return e.children&&(t+=nc(e)),ec(e)||(t+=`</${String(e.type)}>`),t}function lc(e,t){return t&&!e.find(e=>e.startsWith(`<title`))&&e.push(`<title data-inertia="">${mr(t)}</title>`),e}function uc(e,t){return lc(e.flatMap(e=>dc(e)).map(e=>cc(e)).filter(e=>e),t)}function dc(e){return rc(e)?dc(e.type()):ic(e)?(console.warn(`Using components in the <Head> component is not supported.`),[]):sc(e)&&e.children?e:oc(e)&&e.children?e.children.flatMap(e=>dc(e)):ac(e)?[]:e}var fc=A({props:{title:{type:String,required:!1}},setup(e,{slots:t}){let n=Hs.createProvider();return ue(()=>{n.disconnect()}),()=>{n.update(uc(t.default?t.default():[],e.title))}}}),pc=(e,t)=>e?typeof e==`string`?document.querySelector(e):typeof e==`function`?e()||null:t:t,mc=A({name:`InfiniteScroll`,slots:Object,props:{data:{type:String,required:!0},buffer:{type:Number,default:0},onlyNext:{type:Boolean,default:!1},onlyPrevious:{type:Boolean,default:!1},as:{type:String,default:`div`},manual:{type:Boolean,default:!1},manualAfter:{type:Number,default:0},preserveUrl:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},autoScroll:{type:Boolean,default:void 0},itemsElement:{type:[String,Function,Object],default:null},startElement:{type:[String,Function,Object],default:null},endElement:{type:[String,Function,Object],default:null},params:{type:Object,default:()=>({})}},inheritAttrs:!1,setup(e,{slots:t,attrs:n,expose:r}){let i=I(null),a=I(null),s=I(null),c=k(()=>pc(e.itemsElement,i.value)),l=k(()=>Ri(c.value)),u=k(()=>pc(e.startElement,a.value)),d=k(()=>pc(e.endElement,s.value)),p=I(!1),m=I(!1),h=I(0),g=I(!1),_=I(!1),v=()=>{h.value=y.getRequestCount(),g.value=y.hasPrevious(),_.value=y.hasNext()},{dataManager:y,elementManager:b,flush:x}=Oo({getPropName:()=>e.data,inReverseMode:()=>e.reverse,shouldFetchNext:()=>!e.onlyPrevious,shouldFetchPrevious:()=>!e.onlyNext,shouldPreserveUrl:()=>e.preserveUrl,getReloadOptions:()=>e.params,getTriggerMargin:()=>e.buffer,getStartElement:()=>u.value,getEndElement:()=>d.value,getItemsElement:()=>c.value,getScrollableParent:()=>l.value,onBeforePreviousRequest:()=>p.value=!0,onBeforeNextRequest:()=>m.value=!0,onCompletePreviousRequest:({completed:e})=>{p.value=!1,e&&v()},onCompleteNextRequest:({completed:e})=>{m.value=!1,e&&v()},onDataReset:v});if(v(),typeof window>`u`){let t=Gs().scrollProps?.[e.data];t&&(g.value=!!t.previousPage,_.value=!!t.nextPage)}let S=k(()=>!C.value),C=k(()=>e.manual||e.manualAfter>0&&h.value>=e.manualAfter),w=()=>{l.value?l.value.scrollTo({top:l.value.scrollHeight,behavior:`instant`}):window.scrollTo({top:document.body.scrollHeight,behavior:`instant`})};return ie(()=>{b.setupObservers(),b.processServerLoadedElements(y.getLastLoadedPage()),(e.autoScroll===void 0?e.reverse:e.autoScroll)&&w(),S.value&&b.enableTriggers()}),se(x),f(()=>[S.value,e.onlyNext,e.onlyPrevious],([e])=>{e?b.enableTriggers():b.disableTriggers()}),r({fetchNext:y.fetchNext,fetchPrevious:y.fetchPrevious,hasPrevious:y.hasPrevious,hasNext:y.hasNext}),()=>{let r=[],c={loadingPrevious:p.value,loadingNext:m.value,hasPrevious:g.value,hasNext:_.value};if(!e.startElement){let n=S.value&&!e.onlyNext,i={loading:p.value,fetch:y.fetchPrevious,autoMode:n,manualMode:!n,hasMore:g.value,...c};r.push(o(`div`,{ref:a},t.previous?t.previous(i):p.value?t.loading?.(i):void 0))}if(r.push(o(e.as,{...n,ref:i},t.default?.({loading:p.value||m.value,loadingPrevious:p.value,loadingNext:m.value}))),!e.endElement){let n=S.value&&!e.onlyPrevious,i={loading:m.value,fetch:y.fetchNext,autoMode:n,manualMode:!n,hasMore:_.value,...c};r.push(o(`div`,{ref:s},t.next?t.next(i):m.value?t.loading?.(i):void 0))}return o(M,{},e.reverse?[...r].reverse():r)}}}),hc=()=>{},gc=A({name:`Link`,props:{as:{type:[String,Object],default:`a`},data:{type:Object,default:()=>({})},href:{type:[String,Object],default:``},method:{type:String,default:`get`},replace:{type:Boolean,default:!1},preserveScroll:{type:[Boolean,String,Function],default:!1},preserveState:{type:[Boolean,String,Function],default:null},preserveUrl:{type:Boolean,default:!1},only:{type:Array,default:()=>[]},except:{type:Array,default:()=>[]},headers:{type:Object,default:()=>({})},queryStringArrayFormat:{type:String,default:`brackets`},async:{type:Boolean,default:!1},prefetch:{type:[Boolean,String,Array],default:!1},cacheFor:{type:[Number,String,Array],default:0},onStart:{type:Function,default:hc},onProgress:{type:Function,default:hc},onFinish:{type:Function,default:hc},onBefore:{type:Function,default:hc},onCancel:{type:Function,default:hc},onSuccess:{type:Function,default:hc},onError:{type:Function,default:hc},onCancelToken:{type:Function,default:hc},onPrefetching:{type:Function,default:hc},onPrefetched:{type:Function,default:hc},cacheTags:{type:[String,Array],default:()=>[]},viewTransition:{type:[Boolean,Object],default:!1},component:{type:String,default:null},instant:{type:Boolean,default:!1},pageProps:{type:[Object,Function],default:null}},setup(e,{slots:t,attrs:n}){let r=I(0),i=I(),a=k(()=>e.prefetch===!0?[`hover`]:e.prefetch===!1?[]:Array.isArray(e.prefetch)?e.prefetch:[e.prefetch]),s=k(()=>e.cacheFor===0?a.value.length===1&&a.value[0]===`click`?0:Sc.get(`prefetch.cacheFor`):e.cacheFor);ie(()=>{a.value.includes(`mount`)&&_()}),se(()=>{clearTimeout(i.value)});let c=k(()=>fa(e.href)?e.href.method:(e.method??`get`).toLowerCase()),l=k(()=>typeof e.as!=`string`||e.as.toLowerCase()!==`a`?e.as:c.value===`get`?e.as.toLowerCase():`button`),u=k(()=>sa(c.value,fa(e.href)?e.href.url:e.href,e.data||{},e.queryStringArrayFormat)),d=k(()=>u.value[0]),f=k(()=>u.value[1]),p=k(()=>e.component?e.component:e.instant&&fa(e.href)?pa(e.href):null),m=k(()=>l.value===`button`?{type:`button`}:l.value===`a`||typeof l.value!=`string`?{href:d.value}:{}),h=k(()=>({data:f.value,method:c.value,replace:e.replace,preserveScroll:e.preserveScroll,preserveState:e.preserveState??c.value!==`get`,preserveUrl:e.preserveUrl,only:e.only,except:e.except,headers:e.headers,async:e.async,component:p.value,pageProps:e.pageProps})),g=k(()=>({...h.value,viewTransition:e.viewTransition,onCancelToken:e.onCancelToken,onBefore:e.onBefore,onStart:t=>{r.value++,e.onStart?.(t)},onProgress:e.onProgress,onFinish:t=>{r.value--,e.onFinish?.(t)},onCancel:e.onCancel,onSuccess:e.onSuccess,onError:e.onError})),_=()=>{W.prefetch(d.value,{...h.value,onPrefetching:e.onPrefetching,onPrefetched:e.onPrefetched},{cacheFor:s.value,cacheTags:e.cacheTags})},v={onClick:e=>{Bo(e)&&(e.preventDefault(),W.visit(d.value,g.value))}},y={onMouseenter:()=>{i.value=setTimeout(()=>{_()},Sc.get(`prefetch.hoverDelay`))},onMouseleave:()=>{clearTimeout(i.value)},onClick:e=>{clearTimeout(i.value),v.onClick(e)}},b={onMousedown:e=>{Bo(e)&&(e.preventDefault(),_())},onKeydown:e=>{Vo(e)&&(e.preventDefault(),_())},onMouseup:e=>{Bo(e)&&(e.preventDefault(),W.visit(d.value,g.value))},onKeyup:e=>{Vo(e)&&(e.preventDefault(),W.visit(d.value,g.value))},onClick:e=>{Bo(e)&&e.preventDefault()}};return()=>o(l.value,{...n,...m.value,"data-loading":r.value>0?``:void 0,...a.value.includes(`hover`)?y:a.value.includes(`click`)?b:v},t)}});function _c(...e){let{rememberKey:t,data:n,precognitionEndpoint:r}=no.parseUseFormArguments(...e),i=null,a=null,{form:o,setDefaults:s,getTransform:c,getPrecognitionEndpoint:l,markAsSuccessful:u,wasDefaultsCalledInOnSuccess:d,resetDefaultsCalledInOnSuccess:f,setRememberExcludeKeys:p,resetBeforeSubmit:m,finishProcessing:h,withAllErrors:g}=As({data:n,rememberKey:t,precognitionEndpoint:r}),_=o;_.response=null;let v=async(e,t,n)=>{if(n.onBefore?.()===!1)return Promise.reject(Error(`Request cancelled by onBefore`));f(),m(),i=new AbortController,n.onCancelToken?.({cancel:()=>i?.abort()}),n.optimistic=n.optimistic??a??void 0,a=null;let r;if(n.optimistic){r=Tn(_.data());let e=n.optimistic(Tn(r));e&&Object.keys(e).forEach(t=>{_[t]=e[t]})}_.processing=!0,n.onStart?.();let o=c()(_.data()),l=Ki(o),p=t,v,y;if(e===`get`){let[n]=sa(e,t,o);p=n}else l?v=Ji(o):(v=JSON.stringify(o),y=`application/json`);try{let r=await Ha.getClient().request({method:e,url:p,data:v,headers:{Accept:`application/json`,...y?{"Content-Type":y}:{},...n.headers},signal:i.signal,onUploadProgress:e=>{_.progress=e,n.onProgress?.(e)}}),a=r.data?JSON.parse(r.data):null;if(r.status>=200&&r.status<300)return u(),_.response=a,n.onSuccess?.(a,r),d()||s(Tn(_.data())),_.isDirty=!1,a;throw new Aa(`Request failed with status ${r.status}`,r,t)}catch(e){if(r&&Object.keys(r).forEach(e=>{_[e]=r[e]}),e instanceof Aa){if(e.response.status===422){let t=JSON.parse(e.response.data).errors||{},r=g.enabled()?t:Zr(t);_.clearErrors().setError(r),n.onError?.(r);return}throw n.onHttpException?.(e.response),e}throw e instanceof ja||e instanceof Error&&e.name===`AbortError`?(n.onCancel?.(),new ja(`Request was cancelled`,t)):(n.onNetworkError?.(e instanceof Error?e:Error(`Unknown error`)),e)}finally{h(),i=null,n.onFinish?.()}},y=e=>async(t,n={})=>v(e,t,n);Object.assign(_,{submit(...e){let t=no.parseSubmitArguments(e,l());return v(t.method,t.url,t.options)},get:y(`get`),post:y(`post`),put:y(`put`),patch:y(`patch`),delete:y(`delete`),cancel(){i&&i.abort()},dontRemember(...e){return p(e),_},optimistic(e){return a=e,_},withAllErrors(){return g.enable(),_}});let b=_.withPrecognition;return _.withPrecognition=(...e)=>(b.call(_,...e),_),l(),_}function vc(e,t={},n={keepAlive:!1,autoStart:!0}){let r=n.autoStart??!0,{stop:i,start:a,destroy:o}=W.poll(e,t,{...n,autoStart:!1}),s=I(r);return ie(()=>{r&&a()}),se(()=>{o()}),{polling:s,stop:()=>{i(),s.value=!1},start:()=>{a(),s.value=!0}}}function yc(e={}){let t=I(!1),n=I(null),r=I(!1),i=typeof window>`u`?null:W.getCached(window.location.pathname,e),a=typeof window>`u`?null:W.getPrefetching(window.location.pathname,e);n.value=i?.staleTimestamp||null,t.value=a!==null,r.value=i!==null;let o,s;return ie(()=>{s=W.on(`prefetching`,e=>{e.detail.visit.url.pathname===window.location.pathname&&(t.value=!0)}),o=W.on(`prefetched`,e=>{e.detail.visit.url.pathname===window.location.pathname&&(t.value=!1,r.value=!0)})}),se(()=>{o(),s()}),{lastUpdatedAt:n,isPrefetching:t,isPrefetched:r,flush:()=>W.flush(window.location.pathname,e)}}function bc(e,t){if(typeof e==`object`&&e&&e.__rememberable===!1)return e;let n=W.restore(t),r=re(e)?ce:I,i=typeof e.__remember==`function`&&typeof e.__restore==`function`,a=r(n===void 0?e:i?e.__restore(Tn(n)):Tn(n));return f(a,n=>{W.remember(Tn(i?e.__remember():n),t)},{immediate:!0,deep:!0}),a}var xc=A({name:`WhenVisible`,slots:Object,props:{data:{type:[String,Array]},params:{type:Object},buffer:{type:Number,default:0},as:{type:String,default:`div`},always:{type:Boolean,default:!1}},setup(e,{slots:t}){let n=I(!1),r=I(!1),i=I(null),a=I(null),s=Gs(),c=k(()=>e.data?Array.isArray(e.data)?e.data:[e.data]:[]);function l(){let t={preserveErrors:!0,...e.params};return e.data&&(t.only=Array.isArray(e.data)?e.data:[e.data]),t}function u(){typeof window<`u`&&(i.value?.disconnect(),i.value=new IntersectionObserver(t=>{if(!t[0].isIntersecting||r.value||!e.always&&n.value)return;r.value=!0;let a=l();W.reload({...a,onStart:e=>{r.value=!0,a.onStart?.(e)},onFinish:t=>{n.value=!0,r.value=!1,a.onFinish?.(t),e.always||i.value?.disconnect()}})},{rootMargin:`${e.buffer}px`}),a.value&&i.value.observe(a.value))}return f(()=>c.value.map(e=>Gn(s.props,e)),()=>{let t=c.value.length>0&&c.value.every(e=>Gn(s.props,e)!==void 0);n.value=t,(!t||e.always)&&(!i.value||!t)&&me(u)},{immediate:!0}),se(()=>{i.value?.disconnect()}),()=>{let i=[];return(e.always||!n.value)&&i.push(o(e.as,{ref:a})),n.value?t.default&&i.push(t.default({fetching:r.value})):i.push(t.fallback?t.fallback({}):null),i}}}),Sc=ti.extend({}),Cc=B({name:`accessibility`,size:24,node:[[`circle`,{cx:`16`,cy:`4`,r:`1`,key:`1grugj`}],[`path`,{d:`m18 19 1-7-6 1`,key:`r0i19z`}],[`path`,{d:`m5 8 3-3 5.5 3-2.36 3.5`,key:`9ptxx2`}],[`path`,{d:`M4.24 14.5a5 5 0 0 0 6.88 6`,key:`10kmtu`}],[`path`,{d:`M13.76 17.5a5 5 0 0 0-6.88-6`,key:`2qq6rc`}]]}),wc=B({name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]}),Tc=B({name:`baby`,size:24,node:[[`path`,{d:`M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5`,key:`1u7htd`}],[`path`,{d:`M15 12h.01`,key:`1k8ypt`}],[`path`,{d:`M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1`,key:`11xh7x`}],[`path`,{d:`M9 12h.01`,key:`157uk2`}]]}),Ec=B({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),Dc=B({name:`bike`,size:24,node:[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]}),Oc=B({name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]}),kc=B({name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]}),Ac=B({name:`briefcase`,size:24,node:[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]}),jc=B({name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]}),Mc=B({name:`bus`,size:24,node:[[`path`,{d:`M8 6v6`,key:`18i7km`}],[`path`,{d:`M15 6v6`,key:`1sg6z9`}],[`path`,{d:`M2 12h19.6`,key:`de5uta`}],[`path`,{d:`M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3`,key:`1wwztk`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}],[`path`,{d:`M9 18h5`,key:`lrx6i`}],[`circle`,{cx:`16`,cy:`18`,r:`2`,key:`1v4tcr`}]]}),Nc=B({name:`cake`,size:24,node:[[`path`,{d:`M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8`,key:`1w3rig`}],[`path`,{d:`M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1`,key:`n2jgmb`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}],[`path`,{d:`M7 8v3`,key:`1qtyvj`}],[`path`,{d:`M12 8v3`,key:`hwp4zt`}],[`path`,{d:`M17 8v3`,key:`1i6e5u`}],[`path`,{d:`M7 4h.01`,key:`1bh4kh`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M17 4h.01`,key:`1upcoc`}]]}),Pc=B({name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]}),Fc=B({name:`car`,size:24,node:[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]}),Ic=B({name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]}),Lc=B({name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]}),Rc=B({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),zc=B({name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}),Bc=B({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}),Vc=B({name:`church`,size:24,node:[[`path`,{d:`M10 9h4`,key:`u4k05v`}],[`path`,{d:`M12 7v5`,key:`ma6bk`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`m18 9 3.52 2.147a1 1 0 0 1 .48.854V19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-6.999a1 1 0 0 1 .48-.854L6 9`,key:`flvdwo`}],[`path`,{d:`M6 21V7a1 1 0 0 1 .376-.782l5-3.999a1 1 0 0 1 1.249.001l5 4A1 1 0 0 1 18 7v14`,key:`a5i0n2`}]]}),Hc=B({name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]}),Uc=B({name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),Wc=B({name:`clipboard-list`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]}),Gc=B({name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]}),Kc=B({name:`coffee`,size:24,node:[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]}),qc=B({name:`euro`,size:24,node:[[`path`,{d:`M4 10h12`,key:`1y6xl8`}],[`path`,{d:`M4 14h9`,key:`1loblj`}],[`path`,{d:`M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2`,key:`1j6lzo`}]]}),Jc=B({name:`file-archive`,size:24,node:[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]}),Yc=B({name:`file-check`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]}),Xc=B({name:`file-down`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]}),Zc=B({name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]}),Qc=B({name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]}),$c=B({name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}),el=B({name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]}),tl=B({name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]}),nl=B({name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]}),rl=B({name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]}),il=B({name:`graduation-cap`,size:24,node:[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]}),al=B({name:`hammer`,size:24,node:[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]}),ol=B({name:`handshake`,size:24,node:[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]}),sl=B({name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]}),cl=B({name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]}),ll=B({name:`headset`,size:24,node:[[`path`,{d:`M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z`,key:`12oyoe`}],[`path`,{d:`M21 16v2a4 4 0 0 1-4 4h-5`,key:`1x7m43`}]]}),ul=B({name:`heart-handshake`,size:24,node:[[`path`,{d:`M19.414 14.414C21 12.828 22 11.5 22 9.5a5.5 5.5 0 0 0-9.591-3.676.6.6 0 0 1-.818.001A5.5 5.5 0 0 0 2 9.5c0 2.3 1.5 4 3 5.5l5.535 5.362a2 2 0 0 0 2.879.052 2.12 2.12 0 0 0-.004-3 2.124 2.124 0 1 0 3-3 2.124 2.124 0 0 0 3.004 0 2 2 0 0 0 0-2.828l-1.881-1.882a2.41 2.41 0 0 0-3.409 0l-1.71 1.71a2 2 0 0 1-2.828 0 2 2 0 0 1 0-2.828l2.823-2.762`,key:`17lmqv`}]]}),dl=B({name:`heart`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]}),fl=B({name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]}),pl=B({name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]}),ml=B({name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]}),hl=B({name:`images`,size:24,node:[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]}),gl=B({name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]}),_l=B({name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]}),vl=B({name:`landmark`,size:24,node:[[`path`,{d:`M10 18v-7`,key:`wt116b`}],[`path`,{d:`M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z`,key:`yxxwt6`}],[`path`,{d:`M14 18v-7`,key:`vav6t3`}],[`path`,{d:`M18 18v-7`,key:`aexdmj`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M6 18v-7`,key:`1ivflk`}]]}),yl=B({name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]}),bl=B({name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]}),xl=B({name:`leaf`,size:24,node:[[`path`,{d:`M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20`,key:`1wjnjv`}],[`path`,{d:`M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13`,key:`c1ejpn`}]]}),Sl=B({name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]}),Cl=B({name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]}),wl=B({name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]}),Tl=B({name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]}),El=B({name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]}),Dl=B({name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]}),Ol=B({name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]}),kl=B({name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]}),Al=B({name:`megaphone`,size:24,node:[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]}),jl=B({name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]}),Ml=B({name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}),Nl=B({name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]}),Pl=B({name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]}),Fl=B({name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]}),Il=B({name:`newspaper`,size:24,node:[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]}),Ll=B({name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]}),Rl=B({name:`phone`,size:24,node:[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]}),zl=B({name:`plane`,size:24,node:[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]}),Bl=B({name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]}),Vl=B({name:`printer`,size:24,node:[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]}),Hl=B({name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]}),Ul=B({name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]}),Wl=B({name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]}),Gl=B({name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]}),Kl=B({name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]}),ql=B({name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]}),Jl=B({name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]}),Yl=B({name:`shopping-cart`,size:24,node:[[`path`,{d:`m2.05 2.05 1.099-.028a1 1 0 0 1 1.008.815l2.69 14.347A1 1 0 0 0 7.83 18H18`,key:`uebgi3`}],[`path`,{d:`M4.563 5h16.435a1 1 0 0 1 .981 1.204l-1.026 6.226A2 2 0 0 1 18.962 14H6.25`,key:`1j7c9p`}],[`circle`,{cx:`18`,cy:`20`,r:`2`,key:`t9985n`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]}),Xl=B({name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]}),Zl=B({name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]}),Ql=B({name:`stethoscope`,size:24,node:[[`path`,{d:`M11 2v2`,key:`1539x4`}],[`path`,{d:`M5 2v2`,key:`1yf1q8`}],[`path`,{d:`M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1`,key:`rb5t3r`}],[`path`,{d:`M8 15a6 6 0 0 0 12 0v-3`,key:`x18d4x`}],[`circle`,{cx:`20`,cy:`10`,r:`2`,key:`ts1r5v`}]]}),$l=B({name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]}),eu=B({name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]}),tu=B({name:`trophy`,size:24,node:[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]}),nu=B({name:`truck`,size:24,node:[[`path`,{d:`M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2`,key:`wrbu53`}],[`path`,{d:`M15 18H9`,key:`1lyqi6`}],[`path`,{d:`M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14`,key:`lysw3i`}],[`circle`,{cx:`17`,cy:`18`,r:`2`,key:`332jqn`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}]]}),ru=B({name:`underline`,size:24,node:[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]}),iu=B({name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]}),au=B({name:`unlink`,size:24,node:[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]}),ou=B({name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]}),su=B({name:`user-round-pen`,size:24,node:[[`path`,{d:`M2 21a8 8 0 0 1 10.821-7.487`,key:`1c8h7z`}],[`path`,{d:`M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`1817ys`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}]]}),cu=B({name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]}),lu=B({name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]}),uu=B({name:`utensils`,size:24,node:[[`path`,{d:`M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2`,key:`cjf0a3`}],[`path`,{d:`M7 2v20`,key:`1473qp`}],[`path`,{d:`M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7`,key:`j28e5`}]],aliases:[`fork-knife`]}),du=B({name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]}),fu=B({name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]}),pu=B({name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]});function mu(e){return typeof e==`string`?`'${e}'`:new vu().serialize(e)}var hu=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,gu=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[hu.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function _u(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&gu[n]?gu[n]:n+128,s=a<128&&gu[a]?gu[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var vu=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?_u(e,t):n===`number`&&r===`number`?e-t:_u(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(_u),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})();function yu(e,t){return e===t||mu(e)===mu(t)}function bu(e,t){return Le(e)?!1:Array.isArray(e)?e.some(e=>yu(e,t)):yu(e,t)}var xu=[`INPUT`,`TEXTAREA`];function Su(e,t,n,r={}){if(!t||r.enableIgnoredElement&&xu.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=Cu(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function Cu(e,t,n,r=e.includes(t)?e.length:e.length+1){if(--r===0)return null;let i=e.indexOf(t),a;if(a=i===-1?n.goForward?0:e.length-1:n.goForward?i+1:i-1,!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?Cu(e,o,n,r):o:null}var wu=0;function Tu(){b(e=>{if(!Ve)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??Eu()),document.body.insertAdjacentElement(`beforeend`,t[1]??Eu()),wu++,e(()=>{wu===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),wu--})})}function Eu(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function Du(e){return k(()=>!l(e)||!!Ue(e)?.closest(`form`))}function Ou(){let e=m()?.vnode?.scopeId;return e?{[e]:``}:{}}function ku(e,t){let n=We(!1,300);He(()=>{n.value=!1});let r=I(null),i=Be();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=ju(a,Au(a,i.getBoundingClientRect()),1),s=Mu(t.getBoundingClientRect()),c=Pu([...o,...s]);r.value=c,n.value=!0}return b(n=>{if(e.value&&t.value){let r=e.value,i=t.value,a=e=>o(e,i),s=e=>o(e,r);r.addEventListener(`pointerleave`,a),i.addEventListener(`pointerleave`,s),n(()=>{r.removeEventListener(`pointerleave`,a),i.removeEventListener(`pointerleave`,s)})}}),b(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!Nu(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())},s=e.value?.ownerDocument;s?.addEventListener(`pointermove`,o),n(()=>s?.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function Au(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ju(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function Mu(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Nu(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Pu(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Fu(t)}function Fu(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}function Iu(e){let t=I(),n=k(()=>t.value?.width??0),r=k(()=>t.value?.height??0),i;return ie(()=>{let n=Ue(e);n?(t.value={width:n.offsetWidth,height:n.offsetHeight},i=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[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=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}}),i.observe(n,{box:`border-box`})):t.value=void 0}),se(()=>{i?.disconnect(),i=void 0}),{width:n,height:r}}function Lu(e){let t=We(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=Ae(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=zu(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function Ru(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zu(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ru(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}var[Bu,Vu]=ke(`CollapsibleRoot`),Hu=A({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=Ke(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=y(r);return Vu({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),V(),(e,t)=>(j(),F(_(Je),{as:e.as,"as-child":r.asChild,"data-state":_(i)?`open`:`closed`,"data-disabled":_(a)?``:void 0},{default:N(()=>[L(e.$slots,`default`,{open:_(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),Uu=A({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let i=e,a=t,o=Bu();o.contentId||=n(void 0,`reka-collapsible-content`);let c=I(),{forwardRef:l,currentElement:u}=V(),d=I(0),p=I(0),m=k(()=>o.open.value),h=I(m.value),g=I();f(()=>[m.value,c.value?.present],async()=>{await me();let e=u.value;if(!e)return;g.value=g.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();p.value=t.height,d.value=t.width,h.value||(e.style.transitionDuration=g.value.transitionDuration,e.style.animationName=g.value.animationName)},{immediate:!0});let v=k(()=>h.value&&o.open.value);return ie(()=>{requestAnimationFrame(()=>{h.value=!1})}),ze(u,`beforematch`,e=>{requestAnimationFrame(()=>{o.onOpenToggle(),a(`contentFound`)})}),(e,t)=>(j(),F(_(r),{ref_key:`presentRef`,ref:c,present:e.forceMount||_(o).open.value,"force-mount":!0},{default:N(({present:t})=>[s(_(Je),O(e.$attrs,{id:_(o).contentId,ref:_(l),"as-child":i.asChild,as:e.as,hidden:t?void 0:_(o).unmountOnHide.value?``:`until-found`,"data-state":v.value?void 0:_(o).open.value?`open`:`closed`,"data-disabled":_(o).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${p.value}px`,"--reka-collapsible-content-width":`${d.value}px`}}),{default:N(()=>[!_(o).unmountOnHide.value||t?L(e.$slots,`default`,{key:0}):R(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),Wu=A({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;V();let n=Bu();return(e,r)=>(j(),F(_(Je),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":_(n).contentId,"aria-expanded":_(n).open.value,"data-state":_(n).open.value?`open`:`closed`,"data-disabled":_(n).disabled?.value?``:void 0,disabled:_(n).disabled?.value,onClick:_(n).onOpenToggle},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function Gu({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Ku({type:e,defaultValue:t,modelValue:n}){return e||Gu({type:e,defaultValue:t,modelValue:n})}function qu({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Ju(e,t){let n=k(()=>Ku(e)),r=Ke(e,`modelValue`,t,{defaultValue:qu(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=yu(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(bu(t,e)){let n=t.findIndex(t=>yu(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:k(()=>n.value===`single`)}}var[Yu,Xu]=ke(`AccordionRoot`),Zu=A({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,disabled:a,unmountOnHide:o}=y(n),s=Ye(i),{modelValue:c,changeModelValue:l,isSingle:u}=Ju(n,r),{forwardRef:d,currentElement:f}=V();return Xu({disabled:a,direction:s,orientation:n.orientation,parentElement:f,isSingle:u,collapsible:n.collapsible,modelValue:c,changeModelValue:l,unmountOnHide:o}),(e,t)=>(j(),F(_(Je),{ref:_(d),"as-child":e.asChild,as:e.as},{default:N(()=>[L(e.$slots,`default`,{modelValue:_(c)})]),_:3},8,[`as-child`,`as`]))}}),Qu=function(e){return e.Open=`open`,e.Closed=`closed`,e}(Qu||{}),[$u,ed]=ke(`AccordionItem`),td=A({__name:`AccordionItem`,props:{disabled:{type:Boolean,required:!1},value:{type:String,required:!0},unmountOnHide:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=Yu(),i=k(()=>r.isSingle.value?n.value===r.modelValue.value:Array.isArray(r.modelValue.value)&&r.modelValue.value.includes(n.value)),a=k(()=>r.disabled.value||n.disabled),o=k(()=>a.value?``:void 0),s=k(()=>i.value?Qu.Open:Qu.Closed);t({open:i,dataDisabled:o});let{currentRef:c,currentElement:l}=V();ed({open:i,dataState:s,disabled:a,dataDisabled:o,triggerId:``,currentRef:c,currentElement:l,value:k(()=>n.value)});function u(e){let t=e.target;if(Array.from(r.parentElement.value?.querySelectorAll(`[data-reka-collection-item]`)??[]).findIndex(e=>e===t)===-1)return null;Su(e,t,r.parentElement.value,{arrowKeyOptions:r.orientation,dir:r.direction.value,focus:!0})}return(e,t)=>(j(),F(_(Hu),{"data-orientation":_(r).orientation,"data-disabled":o.value,"data-state":s.value,disabled:a.value,open:i.value,as:n.as,"as-child":n.asChild,"unmount-on-hide":n.unmountOnHide??_(r).unmountOnHide.value,onKeydown:ye(u,[`up`,`down`,`left`,`right`,`home`,`end`])},{default:N(()=>[L(e.$slots,`default`,{open:i.value})]),_:3},8,[`data-orientation`,`data-disabled`,`data-state`,`disabled`,`open`,`as`,`as-child`,`unmount-on-hide`]))}}),nd=A({__name:`AccordionContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Yu(),r=$u();return V(),(e,i)=>(j(),F(_(Uu),{role:`region`,"as-child":t.asChild,as:e.as,"force-mount":t.forceMount,"aria-labelledby":_(r).triggerId,"data-state":_(r).dataState.value,"data-disabled":_(r).dataDisabled.value,"data-orientation":_(n).orientation,style:{"--reka-accordion-content-width":`var(--reka-collapsible-content-width)`,"--reka-accordion-content-height":`var(--reka-collapsible-content-height)`},onContentFound:i[0]||=e=>_(n).changeModelValue(_(r).value.value)},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`force-mount`,`aria-labelledby`,`data-state`,`data-disabled`,`data-orientation`]))}}),rd=A({__name:`AccordionHeader`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h3`}},setup(e){let t=e,n=Yu(),r=$u();return V(),(e,i)=>(j(),F(_(Je),{as:t.as,"as-child":t.asChild,"data-orientation":_(n).orientation,"data-state":_(r).dataState.value,"data-disabled":_(r).dataDisabled.value},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-orientation`,`data-state`,`data-disabled`]))}}),id=A({__name:`AccordionTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,r=Yu(),i=$u();i.triggerId||=n(void 0,`reka-accordion-trigger`);function a(){let e=r.isSingle.value&&i.open.value&&!r.collapsible;i.disabled.value||e||r.changeModelValue(i.value.value)}return(e,n)=>(j(),F(_(Wu),{id:_(i).triggerId,ref:_(i).currentRef,"data-reka-collection-item":``,as:t.as,"as-child":t.asChild,"aria-disabled":_(i).disabled.value||void 0,"aria-expanded":_(i).open.value||!1,"data-disabled":_(i).dataDisabled.value,"data-orientation":_(r).orientation,"data-state":_(i).dataState.value,disabled:_(i).disabled.value,onClick:a},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`aria-disabled`,`aria-expanded`,`data-disabled`,`data-orientation`,`data-state`,`disabled`]))}}),ad=A({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;V();let n=et();return(e,r)=>(j(),F(_(Je),O(t,{id:_(n).descriptionId}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`id`]))}}),od=A({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,r=et(),{forwardRef:i,currentElement:a}=V();return r.contentId||=n(void 0,`reka-dialog-content`),ie(()=>{r.triggerElement.value=a.value}),(e,n)=>(j(),F(_(Je),O(t,{ref:_(i),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":_(r).open.value||!1,"aria-controls":_(r).open.value?_(r).contentId:void 0,"data-state":_(r).open.value?`open`:`closed`,onClick:_(r).onOpenToggle}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),sd=A({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(j(),F(_(Je),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`||e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),cd=A({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=$e(),i=k(()=>t.checked??t.value);return f(i,(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(j(),F(sd,O({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),ld=A({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=k(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=k(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(j(),D(M,null,[R(` We render single input if it's required `),n.value?(j(),F(cd,O({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(j(!0),D(M,{key:1},ne(r.value,n=>(j(),F(cd,O({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),[ud,dd]=ke(`PopperRoot`),fd=A({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=I();return dd({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>L(e.$slots,`default`)}}),pd=A({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=V(),i=ud();return x(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(j(),F(_(Je),{ref:_(n),as:e.as,"as-child":e.asChild},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}}),md={key:0,d:`M0 0L6 6L12 0`},hd={key:1,d:`M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0`},gd=A({__name:`Arrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return V(),(e,n)=>(j(),F(_(Je),O(t,{width:e.width,height:e.height,viewBox:e.asChild?void 0:`0 0 12 6`,preserveAspectRatio:e.asChild?void 0:`none`}),{default:N(()=>[L(e.$slots,`default`,{},()=>[e.rounded?(j(),D(`path`,hd)):(j(),D(`path`,md))])]),_:3},16,[`width`,`height`,`viewBox`,`preserveAspectRatio`]))}});function _d(e){return e!==null}function vd(e){return{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]=yd(n),u={start:e.dir===`rtl`?`100%`:`0%`,center:`50%`,end:e.dir===`rtl`?`0%`:`100%`}[l],d={start:`0%`,center:`50%`,end:`100%`}[l],f=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+s/2,m=``,h=``;return c===`bottom`?(m=a?u:`${f}px`,h=`${-s}px`):c===`top`?(m=a?u:`${f}px`,h=`${r.floating.height+s}px`):c===`right`?(m=`${-s}px`,h=a?d:`${p}px`):c===`left`&&(m=`${r.floating.width+s}px`,h=a?d:`${p}px`),{data:{x:m,y:h}}}}}function yd(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var bd=[`top`,`right`,`bottom`,`left`],xd=Math.min,Sd=Math.max,Cd=Math.round,wd=Math.floor,Td=e=>({x:e,y:e}),Ed={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Dd(e,t,n){return Sd(e,xd(t,n))}function Od(e,t){return typeof e==`function`?e(t):e}function kd(e){return e.split(`-`)[0]}function Ad(e){return e.split(`-`)[1]}function jd(e){return e===`x`?`y`:`x`}function Md(e){return e===`y`?`height`:`width`}function Nd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Pd(e){return jd(Nd(e))}function Fd(e,t,n){n===void 0&&(n=!1);let r=Ad(e),i=Pd(e),a=Md(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Wd(o)),[o,Wd(o)]}function Id(e){let t=Wd(e);return[Ld(e),t,Ld(t)]}function Ld(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Rd=[`left`,`right`],zd=[`right`,`left`],Bd=[`top`,`bottom`],Vd=[`bottom`,`top`];function Hd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?zd:Rd:t?Rd:zd;case`left`:case`right`:return t?Bd:Vd;default:return[]}}function Ud(e,t,n,r){let i=Ad(e),a=Hd(kd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ld)))),a}function Wd(e){let t=kd(e);return Ed[t]+e.slice(t.length)}function Gd(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Kd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Gd(e)}function qd(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Jd(e,t,n){let{reference:r,floating:i}=e,a=Nd(t),o=Pd(t),s=Md(o),c=kd(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ad(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Yd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Od(t,e),p=Kd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=qd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=qd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Xd=50,Zd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Yd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Jd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Xd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Jd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Qd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Od(e,t)||{};if(l==null)return{};let d=Kd(u),f={x:n,y:r},p=Pd(i),m=Md(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=xd(d[_],T),ee=xd(d[v],T),D=C-h[m]-ee,te=C/2-h[m]/2+w,ne=Dd(E,te,D),re=!c.arrow&&Ad(i)!=null&&te!==ne&&a.reference[m]/2-(te<E?E:ee)-h[m]/2<0,ie=re?te<E?te-E:te-D:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:te-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),$d=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Od(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=kd(r),_=Nd(o),v=kd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Wd(o)]:Id(o)),x=p!==`none`;!d&&x&&b.push(...Ud(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Fd(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Nd(t)||T.every(e=>Nd(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Nd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ef(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tf(e){return bd.some(t=>e[t]>=0)}var nf=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Od(e,t);switch(i){case`referenceHidden`:{let e=ef(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:tf(e)}}}case`escaped`:{let e=ef(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:tf(e)}}}default:return{}}}}},rf=new Set([`left`,`top`]);async function af(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=kd(n),s=Ad(n),c=Nd(n)===`y`,l=rf.has(o)?-1:1,u=a&&c?-1:1,d=Od(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var of=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await af(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},sf=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Od(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Nd(i),p=jd(f),m=u[p],h=u[f],g=(e,t)=>Dd(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},cf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Od(e,t),u={x:n,y:r},d=Nd(i),f=jd(d),p=u[f],m=u[d],h=Od(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=rf.has(kd(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},lf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Od(e,t),c=await i.detectOverflow(t,s),l=kd(n),u=Ad(n),d=Nd(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=xd(p-c[m],g),y=xd(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Sd(c.left,c.right):S=p-2*Sd(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function uf(){return typeof window<`u`}function df(e){return mf(e)?(e.nodeName||``).toLowerCase():`#document`}function ff(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pf(e){return((mf(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function mf(e){return uf()?e instanceof Node||e instanceof ff(e).Node:!1}function hf(e){return uf()?e instanceof Element||e instanceof ff(e).Element:!1}function gf(e){return uf()?e instanceof HTMLElement||e instanceof ff(e).HTMLElement:!1}function _f(e){return!uf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ff(e).ShadowRoot}function vf(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=kf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function yf(e){return/^(table|td|th)$/.test(df(e))}function bf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var xf=/transform|translate|scale|rotate|perspective|filter/,Sf=/paint|layout|strict|content/,Cf=e=>!!e&&e!==`none`,wf;function Tf(e){let t=hf(e)?kf(e):e;return Cf(t.transform)||Cf(t.translate)||Cf(t.scale)||Cf(t.rotate)||Cf(t.perspective)||!Df()&&(Cf(t.backdropFilter)||Cf(t.filter))||xf.test(t.willChange||``)||Sf.test(t.contain||``)}function Ef(e){let t=jf(e);for(;gf(t)&&!Of(t);){if(Tf(t))return t;if(bf(t))return null;t=jf(t)}return null}function Df(){return wf??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),wf}function Of(e){return/^(html|body|#document)$/.test(df(e))}function kf(e){return ff(e).getComputedStyle(e)}function Af(e){return hf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jf(e){if(df(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_f(e)&&e.host||pf(e);return _f(t)?t.host:t}function Mf(e){let t=jf(e);return Of(t)?(e.ownerDocument||e).body:gf(t)&&vf(t)?t:Mf(t)}function Nf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Mf(e),i=r===e.ownerDocument?.body,a=ff(r);if(i){let e=Pf(a);return t.concat(a,a.visualViewport||[],vf(r)?r:[],e&&n?Nf(e):[])}return t.concat(r,Nf(r,[],n))}function Pf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ff(e){let t=kf(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=gf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Cd(n)!==a||Cd(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function If(e){return hf(e)?e:e.contextElement}function Lf(e){let t=If(e);if(!gf(t))return Td(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ff(t),o=(a?Cd(n.width):n.width)/r,s=(a?Cd(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Rf=Td(0);function zf(e){let t=ff(e);return!Df()||!t.visualViewport?Rf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bf(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ff(e)}function Vf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=If(e),o=Td(1);t&&(r?hf(r)&&(o=Lf(r)):o=Lf(e));let s=Bf(a,n,r)?zf(a):Td(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ff(a),t=hf(r)?ff(r):r,n=e,i=Pf(n);for(;i&&t!==n;){let e=Lf(i),t=i.getBoundingClientRect(),r=kf(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ff(i),i=Pf(n)}}return qd({width:u,height:d,x:c,y:l})}function Hf(e,t){let n=Af(e).scrollLeft;return t?t.left+n:Vf(pf(e)).left+n}function Uf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Hf(e,n),y:n.top+t.scrollTop}}function Wf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=pf(r),s=t?bf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Td(1),u=Td(0),d=gf(r);if((d||!a)&&((df(r)!==`body`||vf(o))&&(c=Af(r)),d)){let e=Vf(r);l=Lf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Uf(o,c):Td(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Gf(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Kf(e){let t=Af(e),n=e.ownerDocument.body,r=Sd(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Sd(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Hf(e),o=-t.scrollTop;return kf(n).direction===`rtl`&&(a+=Sd(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var qf=25;function Jf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ff(e),a=pf(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Df()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Hf(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=qf&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Yf(e,t){let n=Vf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Lf(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Xf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Jf(e,n,t);else if(t===`document`)r=Kf(pf(e));else if(hf(t))r=Yf(t,n);else{let n=zf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qd(r)}function Zf(e,t){let n=t.get(e);if(n)return n;let r=Nf(e,[],!1).filter(e=>hf(e)&&df(e)!==`body`),i=null,a=kf(e).position===`fixed`,o=a?jf(e):e;for(;hf(o)&&!Of(o);){let e=kf(o),t=Tf(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=jf(o)}return t.set(e,r),r}function Qf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?bf(t)?[]:Zf(t,this._c):[].concat(n),r],o=Xf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Xf(t,a[e],i);s=Sd(n.top,s),c=xd(n.right,c),l=xd(n.bottom,l),u=Sd(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $f(e){let{width:t,height:n}=Ff(e);return{width:t,height:n}}function ep(e,t,n){let r=gf(t),i=pf(t),a=n===`fixed`,o=Vf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Td(0);if((r||!a)&&((df(t)!==`body`||vf(i))&&(s=Af(t)),r)){let e=Vf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Hf(i));let l=i&&!r&&!a?Uf(i,s):Td(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function tp(e){return kf(e).position===`static`}function np(e,t){if(!gf(e)||kf(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return pf(e)===n&&(n=n.ownerDocument.body),n}function rp(e,t){let n=ff(e);if(bf(e))return n;if(!gf(e)){let t=jf(e);for(;t&&!Of(t);){if(hf(t)&&!tp(t))return t;t=jf(t)}return n}let r=np(e,t);for(;r&&yf(r)&&tp(r);)r=np(r,t);return r&&Of(r)&&tp(r)&&!Tf(r)?n:r||Ef(e)||n}var ip=async function(e){let t=this.getOffsetParent||rp,n=this.getDimensions,r=await n(e.floating);return{reference:ep(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ap(e){return kf(e).direction===`rtl`}var op={convertOffsetParentRelativeRectToViewportRelativeRect:Wf,getDocumentElement:pf,getClippingRect:Qf,getOffsetParent:rp,getElementRects:ip,getClientRects:Gf,getDimensions:$f,getScale:Lf,isElement:hf,isRTL:ap};function sp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cp(e,t,n){let r=null,i,a=pf(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=wd(d),h=wd(a.clientWidth-(u+f)),g=wd(a.clientHeight-(d+p)),_=wd(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Sd(0,xd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!sp(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ff(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function lp(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=If(e),u=i||a?[...l?Nf(l):[],...t?Nf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?cp(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Vf(e):null;c&&g();function g(){let t=Vf(e);h&&!sp(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var up=of,dp=sf,fp=$d,pp=lf,mp=nf,hp=Qd,gp=cf,_p=(e,t,n)=>{let r=new Map,i=n??{},a={...op,...i.platform,_c:r};return Zd(e,t,{...i,platform:a})};function vp(e){return typeof e==`object`&&!!e&&`$el`in e}function yp(e){if(vp(e)){let t=e.$el;return mf(t)&&df(t)===`#comment`?null:t}return e}function bp(e){return typeof e==`function`?e():_(e)}function xp(e){return{name:`arrow`,options:e,fn(t){let n=yp(bp(e.element));return n==null?{}:hp({element:n,padding:e.padding}).fn(t)}}}function Sp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cp(e,t){let n=Sp(e);return Math.round(t*n)/n}function wp(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=k(()=>bp(n.open)??!0),a=k(()=>bp(n.middleware)),o=k(()=>bp(n.placement)??`bottom`),s=k(()=>bp(n.strategy)??`absolute`),c=k(()=>bp(n.transform)??!0),l=k(()=>yp(e.value)),u=k(()=>yp(t.value)),d=I(0),p=I(0),m=I(s.value),h=I(o.value),g=_e({}),_=I(!1),v=k(()=>{let e={position:m.value,left:`0`,top:`0`};if(!u.value)return e;let t=Cp(u.value,d.value),n=Cp(u.value,p.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...Sp(u.value)>=1.5&&{willChange:`transform`}}:{position:m.value,left:t+`px`,top:n+`px`}}),y;function b(){if(l.value==null||u.value==null)return;let e=i.value;_p(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,p.value=t.y,m.value=t.strategy,h.value=t.placement,g.value=t.middlewareData,_.value=e!==!1})}function x(){typeof y==`function`&&(y(),y=void 0)}function S(){if(x(),r===void 0){b();return}if(l.value!=null&&u.value!=null){y=r(l.value,u.value,b);return}}function C(){i.value||(_.value=!1)}return f([a,o,s,i],b,{flush:`sync`}),f([l,u],S,{flush:`sync`}),f(i,C,{flush:`sync`}),ee()&&pe(x),{x:te(d),y:te(p),strategy:te(m),placement:te(h),middlewareData:te(g),isPositioned:te(_),floatingStyles:v,update:b}}var Tp=[`dir`],Ep={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[Dp,Op]=ke(`PopperContent`),kp=A({inheritAttrs:!1,__name:`PopperContent`,props:v({memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Ep}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=ud(),{forwardRef:a,currentElement:o}=V(),s=Ye(k(()=>n.dir)),c=I(),l=I(),{width:u,height:d}=Iu(l),f=k(()=>n.side+(n.align===`center`?``:`-${n.align}`)),p=k(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),m=k(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=k(()=>({padding:p.value,boundary:m.value.filter(_d),altBoundary:m.value.length>0})),g=k(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),v=k(()=>[up({mainAxis:n.sideOffset+d.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&fp({...h.value,...g.value}),n.avoidCollisions&&dp({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?gp():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&fp({...h.value,...g.value}),pp({...h.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),l.value&&xp({element:l.value,padding:n.arrowPadding}),vd({arrowWidth:u.value,arrowHeight:d.value,dir:s.value}),n.hideWhenDetached&&mp({strategy:`referenceHidden`,...h.value})]),{floatingStyles:y,placement:C,isPositioned:w,middlewareData:T,update:E}=wp(k(()=>n.reference??i.anchor.value),c,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...e)=>lp(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:v}),ee=k(()=>yd(C.value)[0]),te=k(()=>yd(C.value)[1]);x(()=>{w.value&&r(`placed`)});let ne=k(()=>{let e=T.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),re=I(``);return b(()=>{o.value&&(re.value=window.getComputedStyle(o.value).zIndex)}),Op({placedSide:ee,onArrowChange:e=>l.value=e,arrowX:k(()=>T.value.arrow?.x??0),arrowY:k(()=>T.value.arrow?.y??0),shouldHideArrow:ne}),(e,t)=>(j(),D(`div`,{ref_key:`floatingRef`,ref:c,"data-reka-popper-content-wrapper":``,dir:_(s),style:ae({..._(y),transform:_(w)?_(y).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re.value,"--reka-popper-transform-origin":[_(T).transformOrigin?.x,_(T).transformOrigin?.y].join(` `),..._(T).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[n.memoDependencies?S([n.asChild,n.as,ee.value,te.value,_(w),...Object.values(e.$attrs),...n.memoDependencies],()=>(j(),F(_(Je),O({key:0,ref:_(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":ee.value,"data-align":te.value,style:{animation:_(w)?void 0:`none`}}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])),t,0):(j(),F(_(Je),O({key:1,ref:_(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":ee.value,"data-align":te.value,dir:_(s),style:{animation:_(w)?void 0:`none`}}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`dir`,`style`]))],12,Tp))}}),Ap={top:`bottom`,right:`left`,bottom:`top`,left:`right`},jp=A({inheritAttrs:!1,__name:`PopperArrow`,props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let{forwardRef:t}=V(),n=Dp(),r=k(()=>Ap[n.placedSide.value]);return(e,i)=>(j(),D(`span`,{ref:e=>{_(n).onArrowChange(e??void 0)},style:ae({position:`absolute`,left:_(n).arrowX?.value?`${_(n).arrowX?.value}px`:void 0,top:_(n).arrowY?.value?`${_(n).arrowY?.value}px`:void 0,[r.value]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[_(n).placedSide.value],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[_(n).placedSide.value],visibility:_(n).shouldHideArrow.value?`hidden`:void 0})},[s(gd,O(e.$attrs,{ref:_(t),style:{display:`block`},as:e.as,"as-child":e.asChild,rounded:e.rounded,width:e.width,height:e.height}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`rounded`,`width`,`height`])],4))}}),[Mp,Np]=ke(`AvatarRoot`),Pp=A({__name:`AvatarRoot`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return V(),Np({imageLoadingStatus:I(`idle`)}),(e,t)=>(j(),F(_(Je),{"as-child":e.asChild,as:e.as},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),Fp=A({__name:`AvatarFallback`,props:{delayMs:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=Mp();V();let r=I(t.delayMs===void 0);return b(e=>{if(t.delayMs&&Ve){let n=window.setTimeout(()=>{r.value=!0},t.delayMs);e(()=>{window.clearTimeout(n)})}}),(e,t)=>r.value&&_(n).imageLoadingStatus.value!==`loaded`?(j(),F(_(Je),{key:0,"as-child":e.asChild,as:e.as},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as-child`,`as`])):R(`v-if`,!0)}});function Ip(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?`loaded`:`loading`):`error`:`idle`}function Lp(e,{referrerPolicy:t,crossOrigin:n}={}){let r=I(!1),i=I(null),a=k(()=>r.value?(!i.value&&Ve&&(i.value=new window.Image),i.value):null),o=I(Ip(a.value,e.value)),s=e=>()=>{r.value&&(o.value=e)};return ie(()=>{r.value=!0,b(r=>{let i=a.value;if(!i)return;o.value=Ip(i,e.value);let c=s(`loaded`),l=s(`error`);i.addEventListener(`load`,c),i.addEventListener(`error`,l),t?.value&&(i.referrerPolicy=t.value),typeof n?.value==`string`&&(i.crossOrigin=n.value),r(()=>{i.removeEventListener(`load`,c),i.removeEventListener(`error`,l)})})}),se(()=>{r.value=!1}),o}var Rp=A({__name:`AvatarImage`,props:{src:{type:String,required:!0},referrerPolicy:{type:null,required:!1},crossOrigin:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`img`}},emits:[`loadingStatusChange`],setup(e,{emit:t}){let n=e,r=t,{src:i,referrerPolicy:a,crossOrigin:o}=y(n);V();let s=Mp(),c=Lp(i,{referrerPolicy:a,crossOrigin:o});return f(c,e=>{r(`loadingStatusChange`,e),e!==`idle`&&(s.imageLoadingStatus.value=e)},{immediate:!0}),(e,t)=>C((j(),F(_(Je),{role:`img`,"as-child":e.asChild,as:e.as,src:_(i),referrerpolicy:_(a),crossorigin:_(o)},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`src`,`referrerpolicy`,`crossorigin`])),[[be,_(c)===`loaded`]])}}),zp=A({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,r=yt(),i=n(),a=k(()=>t.tabStopId||i),o=k(()=>r.currentTabStopId.value===a.value),{getItems:c,CollectionItem:l}=bt();ie(()=>{t.focusable&&r.onFocusableItemAdd()}),se(()=>{t.focusable&&r.onFocusableItemRemove()}),f(()=>t.focusable,(e,t)=>{e!==t&&(e?r.onFocusableItemAdd():r.onFocusableItemRemove())});function u(e){if(e.key===`Tab`&&e.shiftKey){r.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let n=vt(e,r.orientation.value,r.dir.value);if(n!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...c().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(n===`last`)i.reverse();else if(n===`prev`||n===`next`){n===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=r.loop.value?_t(i,t+1):i.slice(t+1)}me(()=>xt(i))}}return(e,t)=>(j(),F(_(l),null,{default:N(()=>[s(_(Je),{tabindex:o.value?0:-1,"data-orientation":_(r).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?_(r).onItemFocus(a.value):t.preventDefault()},onFocus:t[1]||=e=>_(r).onItemFocus(a.value),onKeydown:u},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[Bp,Vp]=ke(`CheckboxGroupRoot`);function Hp(e){return e===`indeterminate`}function Up(e){return Hp(e)?`indeterminate`:e?`checked`:`unchecked`}var[Wp,Gp]=ke(`CheckboxRoot`),Kp=A({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=V(),o=Bp(null),s=Ke(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),c=k(()=>o?.disabled.value||n.disabled),l=k(()=>yu(s.value,n.trueValue)),u=k(()=>Le(o?.modelValue.value)?s.value===`indeterminate`?`indeterminate`:l.value:bu(o.modelValue.value,n.value));function d(){if(Le(o?.modelValue.value))s.value===`indeterminate`?s.value=n.trueValue:s.value=l.value?n.falseValue:n.trueValue;else{let e=[...o.modelValue.value||[]];if(bu(e,n.value)){let t=e.findIndex(e=>yu(e,n.value));e.splice(t,1)}else e.push(n.value);o.modelValue.value=e}}let f=Du(a),p=Ou(),m=h(),g=k(()=>{if(!m[`aria-label`])return n.id&&a.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0});return Gp({disabled:c,state:u}),(e,t)=>(j(),D(M,null,[(j(),F(ge(_(o)?.rovingFocus.value?_(zp):_(Je)),O({...e.$attrs,..._(p)},{id:e.id,ref:_(i),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":_(Hp)(u.value)?`mixed`:u.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||g.value,"data-state":_(Up)(u.value),"data-disabled":c.value?``:void 0,disabled:c.value,focusable:_(o)?.rovingFocus.value?!c.value:void 0,onKeydown:ye(we(()=>{},[`prevent`]),[`enter`]),onClick:d}),{default:N(()=>[L(e.$slots,`default`,{modelValue:_(s),state:u.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),_(f)&&e.name&&!_(o)?(j(),F(_(ld),O({key:0,type:`checkbox`,checked:!!u.value,name:e.name,value:e.value,disabled:c.value,required:e.required},_(p)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):R(`v-if`,!0)],64))}}),qp=A({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=V(),n=Wp();return(e,i)=>(j(),F(_(r),{present:e.forceMount||_(Hp)(_(n).state.value)||_(n).state.value===!0},{default:N(()=>[s(_(Je),O({ref:_(t),"data-state":_(Up)(_(n).state.value),"data-disabled":_(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),Jp=A({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(j(),F(_(pd),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}});function Yp(){let e=I(!1);return ie(()=>{ze(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),ze([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var Xp=qe(Yp),[Zp,Qp]=ke([`MenuRoot`,`MenuSub`],`MenuContext`),[$p,em]=ke(`MenuRoot`),tm=A({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i,dir:a}=y(n),o=Ye(a),s=Ke(n,`open`,r),c=I(),l=Xp();return Qp({open:s,onOpenChange:e=>{s.value=e},content:c,onContentChange:e=>{c.value=e}}),em({onClose:()=>{s.value=!1},isUsingKeyboardRef:l,dir:o,modal:i}),(e,t)=>(j(),F(_(fd),null,{default:N(()=>[L(e.$slots,`default`)]),_:3}))}}),[nm,rm]=ke(`MenuContent`),im=A({__name:`MenuContentImpl`,props:v({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Ep}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,i=Zp(),a=$p(),{trapFocus:o,disableOutsidePointerEvents:c,loop:l}=y(n);Tu(),je(c.value);let u=I(``),d=I(0),p=I(0),m=I(null),h=I(`right`),g=I(0),v=I(null),b=I(),{forwardRef:x,currentElement:S}=V(),{handleTypeaheadSearch:C}=Lu(),w=I();function T(e){let t=Su(e,w.value||Ae(),S.value,{loop:l.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!1,attributeName:`[data-reka-collection-item]:not([data-disabled])`});t&&(w.value=t,t.scrollIntoView({block:`nearest`}))}function E(){w.value&&w.value.click()}let ee=I(),D=I();f(w,e=>{if(D.value&&(e===void 0||e!==D.value.trigger.value)){if(e===void 0)return;D.value.onOpenChange(!1),D.value=void 0}}),f(S,e=>{i.onContentChange(e)}),se(()=>{window.clearTimeout(d.value)});function te(e){return h.value===m.value?.side&<(e,m.value?.area)}async function ne(e){r(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),S.value?.focus({preventScroll:!0}))}function re(e){if(e.defaultPrevented)return;let t=e.target,n=t.closest(`[data-reka-menu-content]`)===e.currentTarget,r=[`input`,`textarea`].includes(t.tagName.toLowerCase()),i=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1,s=Su(e,Ae(),S.value,{loop:l.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(s)return s?.focus();if(e.code===`Space`)return;let c=b.value?.getItems()??[];if(n&&(e.key===`Tab`&&a.modal.value&&e.preventDefault(),!i&&o&&!r&&C(e.key,c)),e.target!==S.value||!tt.includes(e.key))return;e.preventDefault();let u=[...c.map(e=>e.ref)];mt.includes(e.key)&&u.reverse(),ct(u)}function ie(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(d.value),u.value=``)}function ae(e){if(!ft(e))return;let t=e.target,n=g.value!==e.clientX;if((e?.currentTarget)?.contains(t)&&n){let t=e.clientX>g.value?`right`:`left`;h.value=t,g.value=e.clientX}}function O(e){ft(e)&&ee.value&&ee.value.focus()}return rm({onItemEnter:e=>!!te(e),onItemLeave:e=>te(e)?!0:([`INPUT`,`TEXTAREA`].includes(Ae()?.tagName||``)||S.value?.focus(),v.value=null,!1),onTriggerLeave:e=>!!te(e),searchRef:u,highlightedElement:w,onKeydownNavigation:T,onKeydownEnter:E,filterElement:ee,onFilterElementChange:e=>{ee.value=e},activeSubmenuContext:D,pointerGraceTimerRef:p,onPointerGraceIntentChange:e=>{m.value=e}}),(e,t)=>(j(),F(_(Ne),{"as-child":``,trapped:_(o),onMountAutoFocus:ne,onUnmountAutoFocus:t[7]||=e=>r(`closeAutoFocus`,e)},{default:N(()=>[s(_(Fe),{"as-child":``,"disable-outside-pointer-events":_(c),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>r(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>r(`focusOutside`,e),onInteractOutside:t[5]||=e=>r(`interactOutside`,e),onDismiss:t[6]||=e=>r(`dismiss`)},{default:N(()=>[s(_(St),{ref_key:`rovingFocusGroupRef`,ref:b,"current-tab-stop-id":v.value,"onUpdate:currentTabStopId":t[0]||=e=>v.value=e,"as-child":``,orientation:`vertical`,dir:_(a).dir.value,loop:_(l),onEntryFocus:t[1]||=e=>{r(`entryFocus`,e),_(a).isUsingKeyboardRef.value||e.preventDefault()}},{default:N(()=>[s(_(kp),{ref:_(x),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":_(rt)(_(i).open.value),dir:_(a).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:re,onBlur:ie,onPointermove:ae,onPointerenter:O},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),am=A({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=nm(),{forwardRef:r,currentElement:i}=V(),{CollectionItem:a}=bt(),o=I(!1),c=k(()=>o.value||i.value!=null&&n.highlightedElement.value===i.value);async function l(e){if(!e.defaultPrevented&&ft(e)){if(t.disabled)n.onItemLeave(e);else if(!n.onItemEnter(e)){let t=e.currentTarget;n.highlightedElement.value=t,[`INPUT`,`TEXTAREA`].includes(Ae()?.tagName||``)||t.focus({preventScroll:!0})}}}async function u(e){await me(),!e.defaultPrevented&&ft(e)&&n.highlightedElement.value===i.value&&!n.onItemLeave(e)&&n.highlightedElement.value===i.value&&(n.highlightedElement.value=void 0)}return(e,t)=>(j(),F(_(a),{value:{textValue:e.textValue}},{default:N(()=>[s(_(Je),O({ref:_(r),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":c.value?``:void 0,onPointermove:l,onPointerleave:u,onFocus:t[0]||=async t=>{let r=t.currentTarget;await me(),!(t.defaultPrevented||e.disabled)&&(o.value=!0,_(n).highlightedElement.value=r)},onBlur:t[1]||=async e=>{await me(),!e.defaultPrevented&&(o.value=!1)}}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),om=A({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=V(),o=$p(),s=nm(),c=I(!1);async function l(){let e=a.value;if(!n.disabled&&e){let e=new CustomEvent(dt,{bubbles:!0,cancelable:!0});r(`select`,e),await me(),e.defaultPrevented?c.value=!1:o.onClose()}}return(e,t)=>(j(),F(am,O(n,{ref:_(i),onClick:l,onPointerdown:t[0]||=()=>{c.value=!0},onPointerup:t[1]||=async e=>{await me(),!e.defaultPrevented&&(c.value||e.currentTarget?.click())},onKeydown:t[2]||=async t=>{let n=_(s).searchRef.value!==``;e.disabled||n&&t.key===` `||_(nt).includes(t.key)&&(t.currentTarget?.click(),t.preventDefault())}}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),[sm,cm]=ke([`MenuCheckboxItem`,`MenuRadioItem`],`MenuItemIndicatorContext`),lm=A({__name:`MenuItemIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=sm({modelValue:I(!1)});return(e,n)=>(j(),F(_(r),{present:e.forceMount||_(it)(_(t).modelValue.value)||_(t).modelValue.value===!0},{default:N(()=>[s(_(Je),{as:e.as,"as-child":e.asChild,"data-state":_(gt)(_(t).modelValue.value)},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`])]),_:3},8,[`present`]))}}),um=A({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Qe(n,r),a=Zp(),{forwardRef:o,currentElement:s}=V();return Me(s),(e,t)=>(j(),F(im,O(_(i),{ref:_(o),"trap-focus":_(a).open.value,"disable-outside-pointer-events":_(a).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>_(a).onOpenChange(!1),onFocusOutside:t[1]||=we(e=>r(`focusOutside`,e),[`prevent`])}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),dm=A({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=Qe(e,t),r=Zp();return(e,t)=>(j(),F(im,O(_(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>_(r).onOpenChange(!1)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),fm=A({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=Qe(e,t),i=Zp(),o=$p();return(e,t)=>(j(),F(_(r),{present:e.forceMount||_(i).open.value},{default:N(()=>[_(o).modal.value?(j(),F(um,a(O({key:0},{...e.$attrs,..._(n)})),{default:N(()=>[L(e.$slots,`default`)]),_:3},16)):(j(),F(dm,a(O({key:1},{...e.$attrs,..._(n)})),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),[pm,mm]=ke(`MenuGroup`),hm=A({__name:`MenuGroup`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,r=n(void 0,`reka-menu-group`);return mm({id:r}),(e,n)=>(j(),F(_(Je),O({role:`group`},t,{"aria-labelledby":_(r)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`aria-labelledby`]))}}),gm=A({__name:`MenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=pm({id:``});return(e,r)=>(j(),F(_(Je),O(t,{id:_(n).id||void 0}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`id`]))}}),_m=A({__name:`MenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(j(),F(_(Ie),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),[vm,ym]=ke(`MenuRadioGroup`),bm=A({__name:`MenuRadioGroup`,props:{modelValue:{type:null,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Ge(n,[`modelValue`]),o=Xe(i),s=Ke(n,`modelValue`,r);return ym({modelValue:s,onValueChange:e=>{s.value=e}}),(e,t)=>(j(),F(hm,a(ve(_(o))),{default:N(()=>[L(e.$slots,`default`,{modelValue:_(s)})]),_:3},16))}}),xm=A({__name:`MenuRadioItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=Ge(n,[`value`]),a=Xe(i),{value:o}=y(n),s=vm(),c=k(()=>s.modelValue.value===o?.value);return cm({modelValue:c}),(e,t)=>(j(),F(om,O({role:`menuitemradio`},_(a),{"aria-checked":c.value,"data-state":_(gt)(c.value),onSelect:t[0]||=async e=>{r(`select`,e),_(s).onValueChange(_(o))}}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`aria-checked`,`data-state`]))}}),Sm=A({__name:`MenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(j(),F(_(Je),O(t,{role:`separator`,"aria-orientation":`horizontal`}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),[Cm,wm]=ke(`PopoverRoot`),Tm=A({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=y(n),a=Ke(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return wm({contentId:``,triggerId:``,modal:i,open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerElement:I(),hasCustomAnchor:I(!1)}),(e,t)=>(j(),F(_(fd),null,{default:N(()=>[L(e.$slots,`default`,{open:_(a),close:()=>a.value=!1})]),_:3}))}}),Em=A({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Xe(Ge(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:a}=V(),o=Cm();return Tu(),(e,t)=>(j(),F(_(Ne),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:N(()=>[s(_(Fe),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>_(o).onOpenChange(!1)},{default:N(()=>[s(_(kp),O(_(i),{id:_(o).contentId,ref:_(a),"data-state":_(o).open.value?`open`:`closed`,"aria-labelledby":_(o).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),Dm=A({__name:`PopoverContentModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Cm(),a=I(!1);je(!0);let o=Qe(n,r),{forwardRef:s,currentElement:c}=V();return Me(c),(e,t)=>(j(),F(Em,O(_(o),{ref:_(s),"trap-focus":_(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=we(e=>{r(`closeAutoFocus`,e),a.value||_(i).triggerElement.value?.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,i=t.button===2||n;a.value=i},onFocusOutside:t[2]||=we(()=>{},[`prevent`])}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),Om=A({__name:`PopoverContentNonModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=Cm(),a=I(!1),o=I(!1),s=Qe(n,r);return(e,t)=>(j(),F(Em,O(_(s),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||_(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;_(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),km=A({__name:`PopoverContent`,props:{forceMount:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let i=e,a=t,o=Cm(),s=Qe(i,a),{forwardRef:c}=V();return o.contentId||=n(void 0,`reka-popover-content`),(e,t)=>(j(),F(_(r),{present:e.forceMount||_(o).open.value},{default:N(()=>[_(o).modal.value?(j(),F(Dm,O({key:0},_(s),{ref:_(c)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16)):(j(),F(Om,O({key:1},_(s),{ref:_(c)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Am=A({__name:`PopoverPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(j(),F(_(Ie),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),jm=A({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,r=Cm(),{forwardRef:i,currentElement:a}=V();return r.triggerId||=n(void 0,`reka-popover-trigger`),r.contentId||=n(void 0,`reka-popover-content`),ie(()=>{r.triggerElement.value=a.value}),(e,n)=>(j(),F(ge(_(r).hasCustomAnchor.value?_(Je):_(pd)),{"as-child":``},{default:N(()=>[s(_(Je),{id:_(r).triggerId,ref:_(i),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":_(r).open.value,"aria-controls":_(r).open.value?_(r).contentId:void 0,"data-state":_(r).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:_(r).onOpenToggle},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),[Mm,Nm]=ke(`DropdownMenuRoot`),Pm=A({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;V();let i=Ke(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=I(),{modal:o,dir:s}=y(n),c=Ye(s);return Nm({open:i,onOpenChange:e=>{i.value=e},onOpenToggle:()=>{i.value=!i.value},triggerId:``,triggerElement:a,contentId:``,modal:o,dir:c}),(e,t)=>(j(),F(_(tm),{open:_(i),"onUpdate:open":t[0]||=e=>he(i)?i.value=e:null,dir:_(c),modal:_(o)},{default:N(()=>[L(e.$slots,`default`,{open:_(i)})]),_:3},8,[`open`,`dir`,`modal`]))}}),Fm=A({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let r=Qe(e,t);V();let i=Mm(),a=I(!1);function o(e){e.defaultPrevented||(a.value||setTimeout(()=>{i.triggerElement.value?.focus()},0),a.value=!1,e.preventDefault())}return i.contentId||=n(void 0,`reka-dropdown-menu-content`),(e,t)=>(j(),F(_(fm),O(_(r),{id:_(i).contentId,"aria-labelledby":_(i)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:o,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!_(i).modal.value||r)&&(a.value=!0),_(i).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),Im=A({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=Ze(t);return V(),(e,t)=>(j(),F(_(om),a(ve({...n,..._(r)})),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Lm=A({__name:`DropdownMenuItemIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return V(),(e,n)=>(j(),F(_(lm),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Rm=A({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return V(),(e,n)=>(j(),F(_(gm),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),zm=A({__name:`DropdownMenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(j(),F(_(_m),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Bm=A({__name:`DropdownMenuRadioGroup`,props:{modelValue:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=Ze(t);return V(),(e,t)=>(j(),F(_(bm),a(ve({...n,..._(r)})),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Vm=A({__name:`DropdownMenuRadioItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=Qe(e,t);return V(),(e,t)=>(j(),F(_(xm),a(ve(_(n))),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Hm=A({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return V(),(e,n)=>(j(),F(_(Sm),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Um=A({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,r=Mm(),{forwardRef:i,currentElement:a}=V();return ie(()=>{r.triggerElement=a}),r.triggerId||=n(void 0,`reka-dropdown-menu-trigger`),(e,n)=>(j(),F(_(Jp),{"as-child":``},{default:N(()=>[s(_(Je),{id:_(r).triggerId,ref:_(i),type:e.as===`button`?`button`:void 0,"as-child":t.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":_(r).open.value,"aria-controls":_(r).open.value?_(r).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":_(r).open.value?`open`:`closed`,onClick:n[0]||=async t=>{!e.disabled&&t.button===0&&t.ctrlKey===!1&&(_(r)?.onOpenToggle(),await me(),_(r).open.value&&t.preventDefault())},onKeydown:n[1]||=ye(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&_(r).onOpenToggle(),t.key===`ArrowDown`&&_(r).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),Wm=A({__name:`Label`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`label`}},setup(e){let t=e;return V(),(e,n)=>(j(),F(_(Je),O(t,{onMousedown:n[0]||=e=>{!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Gm=A({__name:`BaseSeparator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=[`horizontal`,`vertical`];function r(e){return n.includes(e)}let i=k(()=>r(t.orientation)?t.orientation:`horizontal`),a=k(()=>i.value===`vertical`?t.orientation:void 0),o=k(()=>t.decorative?{role:`none`}:{"aria-orientation":a.value,role:`separator`});return(e,t)=>(j(),F(_(Je),O({as:e.as,"as-child":e.asChild,"data-orientation":i.value},o.value),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-orientation`]))}}),Km=A({__name:`Separator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(j(),F(Gm,a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),[qm,Jm]=ke(`SwitchRoot`),Ym=A({inheritAttrs:!1,__name:`SwitchRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:`on`},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=y(n),a=Ke(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),o=k(()=>a.value===n.trueValue);function c(){i.value||(a.value=o.value?n.falseValue:n.trueValue)}let{forwardRef:l,currentElement:u}=V(),d=Du(u),f=Ou(),p=k(()=>n.id&&u.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);return Jm({checked:o,toggleCheck:c,disabled:i}),(e,t)=>(j(),D(M,null,[s(_(Je),O({id:e.id,ref:_(l),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||p.value,"aria-checked":o.value,"aria-required":e.required,"data-state":o.value?`checked`:`unchecked`,"data-disabled":_(i)?``:void 0,"as-child":e.asChild,as:e.as,disabled:_(i)},{..._(f),...e.$attrs},{onClick:c,onKeydown:ye(we(c,[`prevent`]),[`enter`])}),{default:N(()=>[L(e.$slots,`default`,{modelValue:_(a),checked:o.value})]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]),_(d)&&e.name?(j(),F(_(ld),O({key:0,type:`checkbox`,name:e.name,disabled:_(i),required:e.required,value:e.value,checked:o.value},_(f)),null,16,[`name`,`disabled`,`required`,`value`,`checked`])):R(`v-if`,!0)],64))}}),Xm=A({__name:`SwitchThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=qm();return V(),(e,n)=>(j(),F(_(Je),{"data-state":_(t).checked.value?`checked`:`unchecked`,"data-disabled":_(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`]))}}),[Zm,Qm]=ke(`TabsRoot`),$m=A({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t,{orientation:a,unmountOnHide:o,dir:s}=y(r),c=Ye(s);V();let l=Ke(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),u=I(),d=_e(new Set);return Qm({modelValue:l,changeModelValue:e=>{l.value=e},orientation:a,dir:c,unmountOnHide:o,activationMode:r.activationMode,baseId:n(void 0,`reka-tabs`),tabsList:u,contentIds:d,registerContent:e=>{d.value=new Set([...d.value,e])},unregisterContent:e=>{let t=new Set(d.value);t.delete(e),d.value=t}}),(e,t)=>(j(),F(_(Je),{dir:_(c),"data-orientation":_(a),"as-child":e.asChild,as:e.as},{default:N(()=>[L(e.$slots,`default`,{modelValue:_(l)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function eh(e,t){return`${e}-trigger-${t}`}function th(e,t){return`${e}-content-${t}`}var nh=A({__name:`TabsContent`,props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=V(),i=Zm(),a=k(()=>eh(i.baseId,t.value)),o=k(()=>th(i.baseId,t.value)),c=k(()=>t.value===i.modelValue.value),l=I(c.value);return ie(()=>{i.registerContent(t.value),requestAnimationFrame(()=>{l.value=!1})}),ue(()=>{i.unregisterContent(t.value)}),(e,t)=>(j(),F(_(r),{present:e.forceMount||c.value,"force-mount":``},{default:N(({present:t})=>[s(_(Je),{id:o.value,ref:_(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":c.value?`active`:`inactive`,"data-orientation":_(i).orientation.value,"aria-labelledby":a.value,hidden:!t,tabindex:`0`,style:ae({animationDuration:l.value?`0s`:void 0})},{default:N(()=>[!_(i).unmountOnHide.value||t?L(e.$slots,`default`,{key:0}):R(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),rh=A({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=y(e),{forwardRef:n,currentElement:r}=V(),i=Zm();return i.tabsList=r,(e,r)=>(j(),F(_(St),{"as-child":``,orientation:_(i).orientation.value,dir:_(i).dir.value,loop:_(t)},{default:N(()=>[s(_(Je),{ref:_(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":_(i).orientation.value},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),ih=A({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=V(),r=Zm(),i=k(()=>eh(r.baseId,t.value)),a=k(()=>r.contentIds.value.has(t.value)?th(r.baseId,t.value):void 0),o=k(()=>t.value===r.modelValue.value);return(e,t)=>(j(),F(_(zp),{"as-child":``,focusable:!e.disabled,active:o.value},{default:N(()=>[s(_(Je),{id:i.value,ref:_(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":_(r).orientation.value,onMousedown:t[0]||=we(t=>{!e.disabled&&t.ctrlKey===!1?_(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=ye(t=>_(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=_(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&_(r).changeModelValue(e.value)}},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),ah=A({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return V(),(e,n)=>(j(),F(_(jp),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),[oh,sh]=ke(`TooltipProvider`),ch=A({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:a,disabled:o,content:s}=y(e);V();let c=I(!0),l=I(!1),{start:u,stop:d}=Re(()=>{c.value=!0},n,{immediate:!1});return sh({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:o,ignoreNonKeyboardFocus:a,content:s}),(e,t)=>L(e.$slots,`default`)}}),lh=`tooltip.open`,[uh,dh]=ke(`TooltipRoot`),fh=A({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;V();let i=oh(),a=k(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=k(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=k(()=>n.disabled??i.disabled.value),c=k(()=>n.delayDuration??i.delayDuration.value),l=k(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),u=Ke(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});f(u,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(lh))):i.onClose())});let d=I(!1),p=I(),m=k(()=>u.value?d.value?`delayed-open`:`instant-open`:`closed`),{start:h,stop:g}=Re(()=>{d.value=!0,u.value=!0},c,{immediate:!1});function v(){g(),d.value=!1,u.value=!0}function y(){g(),u.value=!1}function b(){h()}return dh({contentId:``,open:u,stateAttribute:m,trigger:p,onTriggerChange(e){p.value=e},onTriggerEnter(){i.isOpenDelayed.value?b():v()},onTriggerLeave(){a.value?y():g()},onOpen:v,onClose:y,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(j(),F(_(fd),null,{default:N(()=>[L(e.$slots,`default`,{open:_(u)})]),_:3}))}}),ph=A({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=uh(),a=oh(),{forwardRef:o,currentElement:l}=V(),u=k(()=>n.ariaLabel||l.value?.textContent),d=k(()=>{let{ariaLabel:e,...t}=n;return Pe(t,a.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return ie(()=>{ze(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()},{capture:!0}),ze(document,lh,i.onClose)}),(e,t)=>(j(),F(_(Fe),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{_(i).disableClosingTrigger.value&&_(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=we(()=>{},[`prevent`]),onDismiss:t[3]||=e=>_(i).onClose()},{default:N(()=>[s(_(kp),O({ref:_(o),"data-state":_(i).stateAttribute.value},{...e.$attrs,...d.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:N(()=>[L(e.$slots,`default`),s(_(sd),{id:_(i).contentId,role:`tooltip`},{default:N(()=>[c(P(u.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),mh=A({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=Xe(e),{forwardRef:n,currentElement:r}=V(),{trigger:i,onClose:a}=uh(),o=oh(),{isPointerInTransit:s,onPointerExit:c}=ku(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),ze(r,`pointermove`,e=>{let t=r.value;t&&e.pointerType!==`touch`&&t.ownerDocument.elementsFromPoint?.(e.clientX,e.clientY).some(e=>{if(t.contains(e))return!1;let n=e.closest(`[data-grace-area-trigger]`);return!!n&&n!==i.value})&&a()}),(e,r)=>(j(),F(ph,O({ref:_(n)},_(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),hh=A({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,i=t,a=uh(),o=Qe(n,i),{forwardRef:s}=V();return(e,t)=>(j(),F(_(r),{present:e.forceMount||_(a).open.value},{default:N(()=>[(j(),F(ge(_(a).disableHoverableContent.value?ph:mh),O({ref:_(s)},_(o)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),gh=A({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(j(),F(_(Ie),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),_h=A({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,r=uh(),i=oh();r.contentId||=n(void 0,`reka-tooltip-content`);let{forwardRef:a,currentElement:o}=V(),c=I(!1),l=I(!1),u=k(()=>r.disabled.value?{}:{click:y,focus:g,pointermove:m,pointerleave:h,pointerdown:p,blur:v});f(o,e=>{r.onTriggerChange(e)},{immediate:!0});function d(){setTimeout(()=>{c.value=!1},1)}function p(){r.open&&!r.disableClosingTrigger.value&&r.onClose(),c.value=!0,document.addEventListener(`pointerup`,d,{once:!0})}function m(e){e.pointerType!==`touch`&&!l.value&&!i.isPointerInTransitRef.value&&(r.onTriggerEnter(),l.value=!0)}function h(){r.onTriggerLeave(),l.value=!1}function g(e){c.value||(!r.ignoreNonKeyboardFocus.value||e.target.matches?.(`:focus-visible`))&&r.onOpen()}function v(){r.onClose()}function y(){r.disableClosingTrigger.value||r.onClose()}return(e,n)=>(j(),F(_(pd),{"as-child":``,reference:e.reference??_(o)},{default:N(()=>[s(_(Je),O({ref:_(a),"aria-describedby":_(r).open.value?_(r).contentId:void 0,"data-state":_(r).stateAttribute.value,as:e.as,"as-child":t.asChild,"data-grace-area-trigger":``},de(u.value)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),vh=A({__name:`Sheet`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean},unmountOnHide:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Qe(e,t);return(e,t)=>(j(),F(_(at),O({"data-slot":`sheet`},_(n)),{default:N(t=>[L(e.$slots,`default`,a(ve(t)))]),_:3},16))}}),yh=jt?window:void 0;jt&&window.document,jt&&window.navigator,jt&&window.location;function bh(e){let t=l(e);return t?.$el??t}function xh(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=k(()=>{let t=Lt(l(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return Dt(()=>[n.value?.map(e=>bh(e))??[yh].filter(e=>e!=null),Lt(l(n.value?e[1]:e[0])),Lt(_(n.value?e[2]:e[1])),l(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=Ct(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}var Sh=!1;function Ch(e,t,n={}){let{window:r=yh,ignore:i=[],capture:a=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:Mt,cancel:Mt,trigger:Mt}:Mt;if(Ot&&!Sh){Sh=!0;let e={passive:!0};Array.from(r.document.body.children).forEach(t=>t.addEventListener(`click`,Mt,e)),r.document.documentElement.addEventListener(`click`,Mt,e)}let c=!0,u=e=>l(i).some(t=>{if(typeof t==`string`)return Array.from(r.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{let n=bh(t);return n&&(e.target===n||e.composedPath().includes(n))}});function d(e){let t=l(e);return t&&t.$.subTree.shapeFlag===16}function f(e,t){let n=l(e),r=n.$.subTree&&n.$.subTree.children;return r==null||!Array.isArray(r)?!1:r.some(e=>e.el===t.target||t.composedPath().includes(e.el))}let p=n=>{let r=bh(e);if(n.target!=null&&!(!(r instanceof Element)&&d(e)&&f(e,n))&&r&&r!==n.target&&!n.composedPath().includes(r)){if(`detail`in n&&n.detail===0&&(c=!u(n)),!c){c=!0;return}t(n)}},m=!1,h=[xh(r,`click`,e=>{m||(m=!0,setTimeout(()=>{m=!1},0),p(e))},{passive:!0,capture:a}),xh(r,`pointerdown`,t=>{let n=bh(e);c=!u(t)&&!(!n||t.composedPath().includes(n))},{passive:!0}),o&&xh(r,`blur`,n=>{setTimeout(()=>{let i=bh(e),a=r.document.activeElement;for(;a?.shadowRoot;)a=a.shadowRoot.activeElement;a?.tagName===`IFRAME`&&!i?.contains(r.document.activeElement)&&t(n)},0)},{passive:!0})].filter(Boolean),g=()=>h.forEach(e=>e());return s?{stop:g,cancel:()=>{c=!1},trigger:e=>{c=!0,p(e),c=!1}}:g}function wh(){let e=_e(!1),t=m();return t&&ie(()=>{e.value=!0},t),e}function Th(e){let t=wh();return k(()=>(t.value,!!e()))}function Eh(e,t,n={}){let{window:r=yh,...i}=n,a,o=Th(()=>r&&`MutationObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=k(()=>{let t=l(e),n=Lt(t).map(bh).filter(Ft);return new Set(n)}),u=f(c,e=>{s(),o.value&&e.size&&(a=new MutationObserver(t),e.forEach(e=>a.observe(e,i)))},{immediate:!0,flush:`post`}),d=()=>a?.takeRecords(),p=()=>{u(),s()};return Et(p),{isSupported:o,stop:p,takeRecords:d}}var Dh=Symbol(`vueuse-ssr-width`);function Oh(){let e=d()?It(Dh,null):null;return typeof e==`number`?e:void 0}function kh(e,t={}){let{window:n=yh,ssrWidth:r=Oh()}=t,i=Th(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=_e(typeof r==`number`),o=_e(),s=_e(!1);return b(()=>{if(a.value){a.value=!i.value;let t=l(e).split(`,`);s.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=wt(n[1])),i&&a&&(a=r<=wt(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(l(e)),s.value=o.value.matches)}),xh(o,`change`,e=>{s.value=e.matches},{passive:!0}),k(()=>s.value)}function Ah(e){return JSON.parse(JSON.stringify(e))}function jh(e,t,n={}){let{window:r=yh,...i}=n,a,o=Th(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=k(()=>{let t=l(e);return Array.isArray(t)?t.map(e=>bh(e)):[bh(t)]}),u=f(c,e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t instanceof Element&&a.observe(t,i)}},{immediate:!0,flush:`post`}),d=()=>{s(),u()};return Et(d),{isSupported:o,stop:d}}var Mh=1;function Nh(e,t={}){let{throttle:n=0,idle:r=200,onStop:i=Mt,onScroll:a=Mt,offset:o={left:0,right:0,top:0,bottom:0},observe:s={mutation:!1},eventListenerOptions:c={capture:!1,passive:!0},behavior:u=`auto`,window:d=yh,onError:f=e=>{console.error(e)}}=t,p=typeof s==`boolean`?{mutation:s}:s,m=_e(0),h=_e(0),g=k({get(){return m.value},set(e){v(e,void 0)}}),_=k({get(){return h.value},set(e){v(void 0,e)}});function v(t,n){var r,i;if(!d)return;let a=l(e);if(!a)return;(r=a instanceof Document?d.document.body:a)==null||r.scrollTo({top:l(n)??_.value,left:l(t)??g.value,behavior:l(u)});let o=(a==null||(i=a.document)==null?void 0:i.documentElement)||a?.documentElement||a;g!=null&&(m.value=o.scrollLeft),_!=null&&(h.value=o.scrollTop)}let y=_e(!1),b=ce({left:!0,right:!1,top:!0,bottom:!1}),x=ce({left:!1,right:!1,top:!1,bottom:!1}),S=e=>{y.value&&(y.value=!1,x.left=!1,x.right=!1,x.top=!1,x.bottom=!1,i(e))},C=Nt(S,n+r),w=e=>{var t;if(!d)return;let n=(e==null||(t=e.document)==null?void 0:t.documentElement)||e?.documentElement||bh(e),{display:r,flexDirection:i,direction:a}=d.getComputedStyle(n),s=a===`rtl`?-1:1,c=n.scrollLeft;x.left=c<m.value,x.right=c>m.value;let l=Math.abs(c*s)<=(o.left||0),u=Math.abs(c*s)+n.clientWidth>=n.scrollWidth-(o.right||0)-Mh;r===`flex`&&i===`row-reverse`?(b.left=u,b.right=l):(b.left=l,b.right=u),m.value=c;let f=n.scrollTop;e===d.document&&!f&&(f=d.document.body.scrollTop),x.top=f<h.value,x.bottom=f>h.value;let p=Math.abs(f)<=(o.top||0),g=Math.abs(f)+n.clientHeight>=n.scrollHeight-(o.bottom||0)-Mh;r===`flex`&&i===`column-reverse`?(b.top=g,b.bottom=p):(b.top=p,b.bottom=g),h.value=f},T=e=>{if(!d)return;let t=e.target.documentElement??e.target;w(t),y.value=!0,C(e),a(e)};return xh(e,`scroll`,n?At(T,n,!0,!1):T,c),Tt(()=>{try{let t=l(e);if(!t)return;w(t)}catch(e){f(e)}}),p?.mutation&&e!=null&&e!==d&&e!==document&&Eh(e,()=>{let t=l(e);t&&w(t)},{attributes:!0,childList:!0,subtree:!0}),xh(e,`scrollend`,S,c),{x:g,y:_,isScrolling:y,arrivedState:b,directions:x,measure(){let t=l(e);d&&t&&w(t)}}}function Ph(e,t,n,r={}){var i,a;let{clone:o=!1,passive:s=!1,eventName:c,deep:l=!1,defaultValue:u,shouldEmit:d}=r,p=m(),h=n||p?.emit||(p==null||(i=p.$emit)==null?void 0:i.bind(p))||(p==null||(a=p.proxy)==null||(a=a.$emit)==null?void 0:a.bind(p?.proxy)),g=c;t||=`modelValue`,g||=`update:${t.toString()}`;let _=e=>o?typeof o==`function`?o(e):Ah(e):e,v=()=>Pt(e[t])?_(e[t]):u,y=e=>{d?d(e)&&h(g,e):h(g,e)};if(s){let n=v(),r=I(n),i=!1;return f(()=>e[t],e=>{i||(i=!0,r.value=_(e),me(()=>i=!1))}),f(r,n=>{!i&&(n!==e[t]||l)&&y(n)},{deep:l}),r}return k({get(){return v()},set(e){y(e)}})}function Fh(e={}){let{window:t=yh,...n}=e;return Nh(t,n)}var Ih=A({__name:`SheetOverlay`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(pt),O({"data-slot":`sheet-overlay`,class:_(H)(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80`,t.class)},_(n)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),Lh=A({inheritAttrs:!1,__name:`SheetContent`,props:{class:{type:[Boolean,null,String,Object,Array]},side:{default:`right`},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`,`side`),a=Qe(i,r);return(t,r)=>(j(),F(_(ut),null,{default:N(()=>[s(Ih),s(_(st),O({"data-slot":`sheet-content`,class:_(H)(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,e.side===`right`&&`data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`,e.side===`left`&&`data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm`,e.side===`top`&&`data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b`,e.side===`bottom`&&`data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t`,n.class)},{...t.$attrs,..._(a)}),{default:N(()=>[L(t.$slots,`default`),s(_(ot),{class:`ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none`},{default:N(()=>[s(_(pu),{class:`size-4`}),r[0]||=E(`span`,{class:`sr-only`},`Schließen`,-1)]),_:1})]),_:3},16,[`class`])]),_:3}))}}),Rh=A({__name:`SheetHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(j(),D(`div`,{"data-slot":`sheet-header`,class:T(_(H)(`flex flex-col gap-1.5 p-4`,t.class))},[L(e.$slots,`default`)],2))}}),zh=A({__name:`SheetTitle`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(ht),O({"data-slot":`sheet-title`,class:_(H)(`text-foreground font-semibold`,t.class)},_(n)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),Bh=A({__name:`SheetTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(j(),F(_(od),O({"data-slot":`sheet-trigger`},t),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Vh=A({__name:`DropdownMenu`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},dir:{},modal:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Qe(e,t);return(e,t)=>(j(),F(_(Pm),O({"data-slot":`dropdown-menu`},_(n)),{default:N(t=>[L(e.$slots,`default`,a(ve(t)))]),_:3},16))}}),Hh=A({inheritAttrs:!1,__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`),a=Qe(i,r);return(e,t)=>(j(),F(_(zm),null,{default:N(()=>[s(_(Fm),O({"data-slot":`dropdown-menu-content`},{...e.$attrs,..._(a)},{class:_(H)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--reka-dropdown-menu-content-available-height) min-w-[8rem] origin-(--reka-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,n.class)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),Uh=A({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean},variant:{default:`default`}},setup(e){let t=e,n=kt(t,`inset`,`variant`,`class`),r=Xe(n);return(n,i)=>(j(),F(_(Im),O({"data-slot":`dropdown-menu-item`,"data-inset":e.inset?``:void 0,"data-variant":e.variant},_(r),{class:_(H)(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,t.class)}),{default:N(()=>[L(n.$slots,`default`)]),_:3},16,[`data-inset`,`data-variant`,`class`]))}}),Wh=A({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean}},setup(e){let t=e,n=kt(t,`class`,`inset`),r=Xe(n);return(n,i)=>(j(),F(_(Rm),O({"data-slot":`dropdown-menu-label`,"data-inset":e.inset?``:void 0},_(r),{class:_(H)(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,t.class)}),{default:N(()=>[L(n.$slots,`default`)]),_:3},16,[`data-inset`,`class`]))}}),Gh=A({__name:`DropdownMenuRadioGroup`,props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=Qe(e,t);return(e,t)=>(j(),F(_(Bm),O({"data-slot":`dropdown-menu-radio-group`},_(n)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Kh={class:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`},qh=A({__name:`DropdownMenuRadioItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`),a=Qe(i,r);return(e,t)=>(j(),F(_(Vm),O({"data-slot":`dropdown-menu-radio-item`},_(a),{class:_(H)(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n.class)}),{default:N(()=>[E(`span`,Kh,[s(_(Lm),null,{default:N(()=>[L(e.$slots,`indicator-icon`,{},()=>[s(_(Uc),{class:`size-2 fill-current`})])]),_:3})]),L(e.$slots,`default`)]),_:3},16,[`class`]))}}),Jh=A({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(Hm),O({"data-slot":`dropdown-menu-separator`},_(n),{class:_(H)(`bg-border -mx-1 my-1 h-px`,t.class)}),null,16,[`class`]))}}),Yh=A({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){let t=Xe(e);return(e,n)=>(j(),F(_(Um),O({"data-slot":`dropdown-menu-trigger`},_(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),Xh=1,Zh=new class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{let{message:t,...n}=e,r=typeof e.id==`number`||e.id&&e.id?.length>0?e.id:Xh++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:`default`});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],w(e))i=!1,this.create({id:n,type:`default`,message:e});else if($h(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!w(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!w(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!w(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!w(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})};custom=(e,t)=>{let n=t?.id||Xh++,r=this.toasts.find(e=>e.id===n),i=t?.dismissible===void 0||t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:e,dismissible:i,id:n,...t}),{...r,component:e,dismissible:i,id:n,...t}):r):this.addToast({component:e,dismissible:i,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};function Qh(e,t){let n=t?.id||Xh++;return Zh.create({message:e,id:n,type:`default`,...t}),n}var $h=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,eg=Object.assign(Qh,{success:Zh.success,info:Zh.info,warning:Zh.warning,error:Zh.error,custom:Zh.custom,message:Zh.message,promise:Zh.promise,dismiss:Zh.dismiss,loading:Zh.loading},{getHistory:()=>Zh.toasts,getToasts:()=>Zh.getActiveToasts()});function tg(e){return e.label!==void 0}var ng=3,rg=`24px`,ig=`16px`,ag=4e3,og=356,sg=14,cg=45,lg=200;function ug(){let e=I(!1);return b(()=>{let t=()=>{e.value=document.hidden};return document.addEventListener(`visibilitychange`,t),()=>window.removeEventListener(`visibilitychange`,t)}),{isDocumentHidden:e}}function dg(...e){return e.filter(Boolean).join(` `)}function fg(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function pg(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?ig:rg;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var mg=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`,`data-testid`],hg=[`aria-label`,`data-disabled`,`data-close-button-position`],gg=A({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(e,{emit:t}){let n=e,r=t,i=I(null),o=I(null),s=I(!1),l=I(!1),u=I(!1),d=I(!1),p=I(!1),m=I(0),h=I(0),g=I(n.toast.duration||n.duration||ag),v=I(null),y=I(null),x=k(()=>n.index===0),S=k(()=>n.index+1<=n.visibleToasts),C=k(()=>n.toast.type),w=k(()=>n.toast.dismissible!==!1),ee=k(()=>n.toast.class||``),te=k(()=>n.descriptionClass||``),ne=k(()=>{let e=n.toast.position||n.position,t=n.heights.filter(t=>t.position===e).findIndex(e=>e.toastId===n.toast.id);return t>=0?t:0}),re=k(()=>{let e=n.toast.position||n.position;return n.heights.filter(t=>t.position===e).reduce((e,t,n)=>n>=ne.value?e:e+t.height,0)}),oe=k(()=>ne.value*n.gap+re.value||0),se=k(()=>n.toast.closeButton??n.closeButton),ce=k(()=>n.toast.duration||n.duration||ag),le=I(0),de=I(0),A=I(null),fe=k(()=>n.position.split(`-`)),pe=k(()=>fe.value[0]),N=k(()=>fe.value[1]),he=k(()=>typeof n.toast.title!=`string`),_e=k(()=>typeof n.toast.description!=`string`),{isDocumentHidden:ve}=ug(),ye=k(()=>C.value&&C.value===`loading`);ie(()=>{s.value=!0,g.value=ce.value}),b(async()=>{if(!s.value||!y.value)return;await me();let e=y.value,t=e.style.height;e.style.height=`auto`;let i=e.getBoundingClientRect().height;e.style.height=t,h.value=i,r(`update:height`,{toastId:n.toast.id,height:i,position:n.toast.position||n.position})});function be(){l.value=!0,m.value=oe.value,setTimeout(()=>{r(`removeToast`,n.toast)},lg)}function xe(){if(ye.value||!w.value)return{};be(),n.toast.onDismiss?.(n.toast)}function Se(e){e.button!==2&&!ye.value&&w.value&&(v.value=new Date,m.value=oe.value,e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(u.value=!0,A.value={x:e.clientX,y:e.clientY}))}function Ce(){if(d.value||!w.value)return;A.value=null;let e=Number(y.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(y.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-(v.value?.getTime()||0),a=i.value===`x`?e:t,s=Math.abs(a)/r;if(Math.abs(a)>=cg||s>.11){m.value=oe.value,n.toast.onDismiss?.(n.toast),i.value===`x`?o.value=e>0?`right`:`left`:o.value=t>0?`down`:`up`,be(),d.value=!0;return}y.value?.style.setProperty(`--swipe-amount-x`,`0px`),y.value?.style.setProperty(`--swipe-amount-y`,`0px`),p.value=!1,u.value=!1,i.value=null}function we(e){if(!A.value||!w.value||(window?.getSelection()?.toString()?.length??!1))return;let t=e.clientY-A.value.y,r=e.clientX-A.value.x,a=n.swipeDirections??fg(n.position);!i.value&&(Math.abs(r)>1||Math.abs(t)>1)&&(i.value=Math.abs(r)>Math.abs(t)?`x`:`y`);let o={x:0,y:0},s=e=>1/(1.5+Math.abs(e)/20);if(i.value===`y`){if(a.includes(`top`)||a.includes(`bottom`)){if(a.includes(`top`)&&t<0||a.includes(`bottom`)&&t>0)o.y=t;else{let e=t*s(t);o.y=Math.abs(e)<Math.abs(t)?e:t}}}else if(i.value===`x`&&(a.includes(`left`)||a.includes(`right`))){if(a.includes(`left`)&&r<0||a.includes(`right`)&&r>0)o.x=r;else{let e=r*s(r);o.x=Math.abs(e)<Math.abs(r)?e:r}}(Math.abs(o.x)>0||Math.abs(o.y)>0)&&(p.value=!0),y.value?.style.setProperty(`--swipe-amount-x`,`${o.x}px`),y.value?.style.setProperty(`--swipe-amount-y`,`${o.y}px`)}ie(()=>{if(s.value=!0,!y.value)return;let e=y.value.getBoundingClientRect().height;h.value=e;let t=[{toastId:n.toast.id,height:e,position:n.toast.position},...n.heights];r(`update:heights`,t)}),ue(()=>{y.value&&r(`removeToast`,n.toast)}),b(e=>{if(n.toast.promise&&C.value===`loading`||n.toast.duration===1/0||n.toast.type===`loading`)return;let t;n.expanded||n.interacting||ve.value?(()=>{if(de.value<le.value){let e=new Date().getTime()-le.value;g.value-=e}de.value=new Date().getTime()})():g.value!==1/0&&(le.value=new Date().getTime(),t=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),be()},g.value)),e(()=>{clearTimeout(t)})}),f(()=>n.toast.delete,e=>{e!==void 0&&e&&(be(),n.toast.onDismiss?.(n.toast))},{deep:!0});function Te(){u.value=!1,i.value=null,A.value=null}return(e,t)=>(j(),D(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:y,class:T(_(dg)(n.class,ee.value,e.classes?.toast,e.toast.classes?.toast,e.classes?.[C.value],e.toast?.classes?.[C.value])),"data-sonner-toast":``,"data-rich-colors":e.toast.richColors??e.defaultRichColors,"data-styled":!(e.toast.component||e.toast?.unstyled||e.unstyled),"data-mounted":s.value,"data-promise":!!e.toast.promise,"data-swiped":p.value,"data-removed":l.value,"data-visible":S.value,"data-y-position":pe.value,"data-x-position":N.value,"data-index":e.index,"data-front":x.value,"data-swiping":u.value,"data-dismissible":w.value,"data-type":C.value,"data-invert":e.toast.invert||e.invert,"data-swipe-out":d.value,"data-swipe-direction":o.value,"data-expanded":!!(e.expanded||e.expandByDefault&&s.value),"data-testid":e.toast.testId,style:ae({"--index":e.index,"--toasts-before":e.index,"--z-index":e.toasts.length-e.index,"--offset":`${l.value?m.value:oe.value}px`,"--initial-height":e.expandByDefault?`auto`:`${h.value}px`,...e.style,...n.toast.style}),onDragend:Te,onPointerdown:Se,onPointerup:Ce,onPointermove:we},[se.value&&!e.toast.component&&C.value!==`loading`?(j(),D(`button`,{key:0,"aria-label":e.closeButtonAriaLabel||`Close toast`,"data-disabled":ye.value,"data-close-button":`true`,"data-close-button-position":e.closeButtonPosition,class:T(_(dg)(e.classes?.closeButton,e.toast?.classes?.closeButton)),onClick:xe},[e.icons?.close?(j(),F(ge(e.icons?.close),{key:0})):L(e.$slots,`close-icon`,{key:1})],10,hg)):R(`v-if`,!0),e.toast.component?(j(),F(ge(e.toast.component),O({key:1},e.toast.componentProps,{onCloseToast:xe,isPaused:e.$props.expanded||e.$props.interacting||_(ve)}),null,16,[`isPaused`])):(j(),D(M,{key:2},[C.value!=="default"||e.toast.icon||e.toast.promise?(j(),D(`div`,{key:0,"data-icon":``,class:T(_(dg)(e.classes?.icon,e.toast?.classes?.icon))},[e.toast.icon?(j(),F(ge(e.toast.icon),{key:0})):(j(),D(M,{key:1},[C.value===`loading`?L(e.$slots,`loading-icon`,{key:0}):C.value===`success`?L(e.$slots,`success-icon`,{key:1}):C.value===`error`?L(e.$slots,`error-icon`,{key:2}):C.value===`warning`?L(e.$slots,`warning-icon`,{key:3}):C.value===`info`?L(e.$slots,`info-icon`,{key:4}):R(`v-if`,!0)],64))],2)):R(`v-if`,!0),E(`div`,{"data-content":``,class:T(_(dg)(e.classes?.content,e.toast?.classes?.content))},[E(`div`,{"data-title":``,class:T(_(dg)(e.classes?.title,e.toast.classes?.title))},[he.value?(j(),F(ge(e.toast.title),a(O({key:0},e.toast.componentProps)),null,16)):(j(),D(M,{key:1},[c(P(e.toast.title),1)],64))],2),e.toast.description?(j(),D(`div`,{key:0,"data-description":``,class:T(_(dg)(e.descriptionClass,te.value,e.classes?.description,e.toast.classes?.description))},[_e.value?(j(),F(ge(e.toast.description),a(O({key:0},e.toast.componentProps)),null,16)):(j(),D(M,{key:1},[c(P(e.toast.description),1)],64))],2)):R(`v-if`,!0)],2),e.toast.cancel?(j(),D(`button`,{key:1,style:ae(e.toast.cancelButtonStyle||e.cancelButtonStyle),class:T(_(dg)(e.classes?.cancelButton,e.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:t[0]||=t=>{_(tg)(e.toast.cancel)&&w.value&&(e.toast.cancel.onClick?.(t),be())}},P(_(tg)(e.toast.cancel)?e.toast.cancel?.label:e.toast.cancel),7)):R(`v-if`,!0),e.toast.action?(j(),D(`button`,{key:2,style:ae(e.toast.actionButtonStyle||e.actionButtonStyle),class:T(_(dg)(e.classes?.actionButton,e.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:t[1]||=t=>{_(tg)(e.toast.action)&&(e.toast.action.onClick?.(t),!t.defaultPrevented&&be())}},P(_(tg)(e.toast.action)?e.toast.action?.label:e.toast.action),7)):R(`v-if`,!0)],64))],46,mg))}}),_g=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},vg={},yg={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function bg(e,t){return j(),D(`svg`,yg,t[0]||=[E(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),E(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var xg=_g(vg,[[`render`,bg]]),Sg=[`data-visible`],Cg={class:`sonner-spinner`},wg=A({__name:`Loader`,props:{visible:{type:Boolean}},setup(e){let t=Array(12).fill(0);return(e,n)=>(j(),D(`div`,{class:`sonner-loading-wrapper`,"data-visible":e.visible},[E(`div`,Cg,[(j(!0),D(M,null,ne(_(t),e=>(j(),D(`div`,{key:`spinner-bar-${e}`,class:`sonner-loading-bar`}))),128))])],8,Sg))}}),Tg={},Eg={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function Dg(e,t){return j(),D(`svg`,Eg,t[0]||=[E(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var Og=_g(Tg,[[`render`,Dg]]),kg={},Ag={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function jg(e,t){return j(),D(`svg`,Ag,t[0]||=[E(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var Mg=_g(kg,[[`render`,jg]]),Ng={},Pg={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function Fg(e,t){return j(),D(`svg`,Pg,t[0]||=[E(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var Ig=_g(Ng,[[`render`,Fg]]),Lg={},Rg={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function zg(e,t){return j(),D(`svg`,Rg,t[0]||=[E(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var Bg=_g(Lg,[[`render`,zg]]),Vg=[`aria-label`],Hg=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`],Ug=typeof window<`u`&&typeof document<`u`;function Wg(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}var Gg=A({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{id:{},invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},closeButtonPosition:{default:`top-left`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:sg},visibleToasts:{default:ng},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:rg},mobileOffset:{default:ig},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(e){let t=e,n=h(),r=I([]),i=k(()=>t.id?r.value.filter(e=>e.toasterId===t.id):r.value.filter(e=>!e.toasterId));function a(e,t){return i.value.filter(n=>!n.position&&t===0||n.position===e)}let o=k(()=>{let e=i.value.filter(e=>e.position).map(e=>e.position);return e.length>0?Array.from(new Set([t.position].concat(e))):[t.position]}),c=k(()=>{let e={};return o.value.forEach(t=>{e[t]=r.value.filter(e=>e.position===t)}),e}),l=I([]),u=I({}),d=I(!1);b(()=>{o.value.forEach(e=>{e in u.value||(u.value[e]=!1)})});let f=I(t.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t.theme),p=I(null),m=I(null),g=I(!1),v=t.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function y(e){r.value.find(t=>t.id===e.id)?.delete||Zh.dismiss(e.id),r.value=r.value.filter(({id:t})=>t!==e.id),setTimeout(()=>{r.value.find(t=>t.id===e.id)||(l.value=l.value.filter(t=>t.toastId!==e.id))},250)}function x(e){g.value&&!e.currentTarget?.contains?.(e.relatedTarget)&&(g.value=!1,m.value&&=(m.value.focus({preventScroll:!0}),null))}function S(e){e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||g.value||(g.value=!0,m.value=e.relatedTarget)}function C(e){e.target&&e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||(d.value=!0)}b(e=>{e(Zh.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{r.value=r.value.map(t=>t.id===e.id?{...t,delete:!0}:t)});return}me(()=>{let t=r.value.findIndex(t=>t.id===e.id);t===-1?r.value=[e,...r.value]:r.value=[...r.value.slice(0,t),{...r.value[t],...e},...r.value.slice(t+1)]})}))}),b(e=>{if(typeof window>`u`)return;if(t.theme!==`system`){f.value=t.theme;return}let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>{f.value=e?`dark`:`light`};r(n.matches);let i=e=>{r(e.matches)};try{n.addEventListener(`change`,i)}catch{n.addListener(i)}e(()=>{try{n.removeEventListener(`change`,i)}catch{n.removeListener(i)}})}),b(()=>{p.value&&m.value&&(m.value.focus({preventScroll:!0}),m.value=null,g.value=!1)}),b(()=>{r.value.length<=1&&Object.keys(u.value).forEach(e=>{u.value[e]=!1})}),b(e=>{function n(e){let n=t.hotkey.every(t=>e[t]||e.code===t),r=Array.isArray(p.value)?p.value[0]:p.value;n&&(o.value.forEach(e=>{u.value[e]=!0}),r?.focus());let i=document.activeElement===p.value||r?.contains(document.activeElement);e.code===`Escape`&&i&&o.value.forEach(e=>{u.value[e]=!1})}Ug&&(document.addEventListener(`keydown`,n),e(()=>{document.removeEventListener(`keydown`,n)}))});function w(e){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);u.value[n]=!0}function ee(e){if(!d.value){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);u.value[n]=!1}}function te(){Object.keys(u.value).forEach(e=>{u.value[e]=!1})}function re(){d.value=!1}function ie(e){l.value=e}function oe(e){let t=l.value.findIndex(t=>t.toastId===e.toastId);if(t!==-1)l.value[t]=e;else{let t=l.value.findIndex(t=>t.position===e.position);t===-1?l.value.unshift(e):l.value.splice(t,0,e)}}return(e,r)=>(j(),D(M,null,[R(` Remove item from normal navigation flow, only available via hotkey `),E(`section`,{"aria-label":`${e.containerAriaLabel} ${_(v)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(j(!0),D(M,null,ne(o.value,(r,i)=>(j(),D(`ol`,O({key:r,ref_for:!0,ref_key:`listRef`,ref:p,"data-sonner-toaster":``,"data-sonner-theme":f.value,class:t.class,dir:e.dir===`auto`?Wg():e.dir,tabIndex:-1,"data-theme":e.theme,"data-rich-colors":e.richColors,"data-y-position":r.split(`-`)[0],"data-x-position":r.split(`-`)[1],style:{"--front-toast-height":`${l.value[0]?.height||0}px`,"--width":`${_(og)}px`,"--gap":`${e.gap}px`,...e.style,..._(n).style,..._(pg)(e.offset,e.mobileOffset)}},{ref_for:!0},e.$attrs,{onBlur:x,onFocus:S,onMouseenter:w,onMousemove:w,onMouseleave:ee,onDragend:te,onPointerdown:C,onPointerup:re}),[(j(!0),D(M,null,ne(a(r,i),(n,i)=>(j(),F(gg,{key:n.id,heights:l.value,icons:e.icons,index:i,toast:n,defaultRichColors:e.richColors,duration:e.toastOptions?.duration??e.duration,class:T(e.toastOptions?.class??``),descriptionClass:e.toastOptions?.descriptionClass,invert:e.invert,visibleToasts:e.visibleToasts,closeButton:e.toastOptions?.closeButton??e.closeButton,interacting:d.value,position:r,closeButtonPosition:e.toastOptions?.closeButtonPosition??e.closeButtonPosition,style:ae(e.toastOptions?.style),unstyled:e.toastOptions?.unstyled,classes:e.toastOptions?.classes,cancelButtonStyle:e.toastOptions?.cancelButtonStyle,actionButtonStyle:e.toastOptions?.actionButtonStyle,"close-button-aria-label":e.toastOptions?.closeButtonAriaLabel,toasts:c.value[r],expandByDefault:e.expand,gap:e.gap,expanded:u.value[r]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":ie,"onUpdate:height":oe,onRemoveToast:y},{"close-icon":N(()=>[L(e.$slots,`close-icon`,{},()=>[s(xg)])]),"loading-icon":N(()=>[L(e.$slots,`loading-icon`,{},()=>[s(wg,{visible:n.type===`loading`},null,8,[`visible`])])]),"success-icon":N(()=>[L(e.$slots,`success-icon`,{},()=>[s(Og)])]),"error-icon":N(()=>[L(e.$slots,`error-icon`,{},()=>[s(Bg)])]),"warning-icon":N(()=>[L(e.$slots,`warning-icon`,{},()=>[s(Ig)])]),"info-icon":N(()=>[L(e.$slots,`info-icon`,{},()=>[s(Mg)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`closeButtonPosition`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,Hg))),128))],8,Vg)],2112))}}),Kg=A({__name:`Sonner`,props:{id:{},invert:{type:Boolean},theme:{},position:{},closeButtonPosition:{},hotkey:{},richColors:{type:Boolean},expand:{type:Boolean},duration:{},gap:{},visibleToasts:{},closeButton:{type:Boolean},toastOptions:{},class:{},style:{},offset:{},mobileOffset:{},dir:{},swipeDirections:{},icons:{},containerAriaLabel:{}},setup(e){let t=e;return(e,n)=>(j(),F(_(Gg),O({class:_(H)(`toaster group`,t.class),style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`}},t),{"success-icon":N(()=>[s(_(Ee),{class:`size-4`})]),"info-icon":N(()=>[s(_(De),{class:`size-4`})]),"warning-icon":N(()=>[s(_(eu),{class:`size-4`})]),"error-icon":N(()=>[s(_(Ll),{class:`size-4`})]),"loading-icon":N(()=>[E(`div`,null,[s(_(Oe),{class:`size-4 animate-spin`})])]),"close-icon":N(()=>[s(_(pu),{class:`size-4`})]),_:1},16,[`class`]))}}),qg={class:`flex items-center gap-3`},Jg=[`src`,`alt`],Yg=[`src`,`alt`],Xg=[`src`,`alt`],Zg=[`src`,`alt`],Qg=[`src`],$g={class:`text-[17px] font-semibold tracking-tight`},e_={__name:`BrandLogo`,props:{inverted:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},setup(e){let t=e,n=k(()=>Gs().props.branding),r=k(()=>n.value.portal_name.trim().charAt(0).toUpperCase()),i=k(()=>n.value.logo_dark_url??n.value.logo_url);return(a,o)=>(j(),D(`span`,qg,[n.value.logo_url?(j(),D(M,{key:0},[e.compact&&n.value.logo_mark_url?(j(),D(`img`,{key:0,src:n.value.logo_mark_url,alt:n.value.portal_name,class:`size-8 sm:hidden`},null,8,Jg)):R(``,!0),E(`span`,{class:T(e.compact&&n.value.logo_mark_url?`hidden sm:contents`:`contents`)},[t.inverted?(j(),D(`img`,{key:0,src:i.value,alt:n.value.portal_name,class:`h-8 w-auto`},null,8,Yg)):(j(),D(M,{key:1},[E(`img`,{src:n.value.logo_url,alt:n.value.portal_name,class:`h-8 w-auto dark:hidden`},null,8,Xg),E(`img`,{src:i.value,alt:n.value.portal_name,class:`hidden h-8 w-auto dark:block`},null,8,Zg)],64))],2)],64)):(j(),D(M,{key:1},[n.value.logo_mark_url?(j(),D(`img`,{key:0,src:n.value.logo_mark_url,alt:``,class:`size-8`},null,8,Qg)):(j(),D(`span`,{key:1,class:T([`grid size-8 place-items-center rounded-md text-base font-bold`,t.inverted?`bg-white/15 text-current`:`bg-brand text-brand-foreground`])},P(r.value),3)),E(`span`,$g,P(n.value.portal_name),1)],64))]))}},t_=A({__name:`Popover`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Qe(e,t);return(e,t)=>(j(),F(_(Tm),O({"data-slot":`popover`},_(n)),{default:N(t=>[L(e.$slots,`default`,a(ve(t)))]),_:3},16))}}),n_=A({inheritAttrs:!1,__name:`PopoverContent`,props:{forceMount:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{default:`center`},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`),a=Qe(i,r);return(e,t)=>(j(),F(_(Am),null,{default:N(()=>[s(_(km),O({"data-slot":`popover-content`},{...e.$attrs,..._(a)},{class:_(H)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 max-w-(--reka-popover-content-available-width) rounded-md border p-4 shadow-md origin-(--reka-popover-content-transform-origin) outline-hidden`,n.class)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),r_=A({__name:`PopoverTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(j(),F(_(jm),O({"data-slot":`popover-trigger`},t),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}});function i_(){let e=document.cookie.match(/(?:^|; )XSRF-TOKEN=([^;]*)/);return e?decodeURIComponent(e[1]):``}var a_=class extends Error{constructor(e,t){super(t?.message||`Anfrage fehlgeschlagen (${e})`),this.status=e,this.data=t??{}}get fieldErrors(){return Object.fromEntries(Object.entries(this.data.errors??{}).map(([e,t])=>[e,t[0]]))}};async function o_(e,t,n,r={}){let i={Accept:`application/json`,"X-Requested-With":`XMLHttpRequest`,"X-XSRF-TOKEN":i_()},a=n;n!==void 0&&!(n instanceof FormData)&&(i[`Content-Type`]=`application/json`,a=JSON.stringify(n));let o=await fetch(t,{method:e,headers:i,body:a,credentials:`same-origin`,keepalive:r.keepalive??!1}),s=o.headers.get(`content-type`)?.includes(`application/json`)?await o.json():null;if(!o.ok)throw new a_(o.status,s);return s}var s_={get:e=>o_(`GET`,e),post:(e,t,n)=>o_(`POST`,e,t??{},n),put:(e,t)=>o_(`PUT`,e,t),delete:(e,t)=>o_(`DELETE`,e,t)},c_=new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`long`,year:`numeric`}),l_=new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`short`,year:`numeric`}),u_=new Intl.DateTimeFormat(`de-DE`,{hour:`2-digit`,minute:`2-digit`});new Intl.DateTimeFormat(`de-DE`,{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`});var d_=new Intl.DateTimeFormat(`de-DE`,{month:`short`}),f_=new Intl.DateTimeFormat(`de-DE`,{month:`long`,year:`numeric`}),p_=new Intl.RelativeTimeFormat(`de-DE`,{numeric:`auto`}),m_=e=>c_.format(new Date(e)),h_=e=>l_.format(new Date(e)),g_=e=>u_.format(new Date(e)),__=e=>f_.format(new Date(e));function v_(e){let t=(new Date(e).getTime()-Date.now())/1e3,n=Math.abs(t);return n<60?`gerade eben`:n<3600?p_.format(Math.round(t/60),`minute`):n<86400?p_.format(Math.round(t/3600),`hour`):n<604800?p_.format(Math.round(t/86400),`day`):m_(e)}function y_(e){let t=new Date(e);return{day:t.getDate(),month:d_.format(t).replace(`.`,``).toUpperCase()}}function b_(e){let t=new Date(e.starts_at),n=e.ends_at?new Date(e.ends_at):null,r=n&&t.toDateString()===n.toDateString();return e.all_day?n&&!r?`${h_(e.starts_at)} – ${h_(e.ends_at)}`:`${h_(e.starts_at)}, ganztägig`:n?r?`${h_(e.starts_at)}, ${g_(e.starts_at)} – ${g_(e.ends_at)} Uhr`:`${h_(e.starts_at)}, ${g_(e.starts_at)} Uhr – ${h_(e.ends_at)}, ${g_(e.ends_at)} Uhr`:`${h_(e.starts_at)}, ${g_(e.starts_at)} Uhr`}var x_={key:0,class:`absolute top-1.5 right-1.5 grid h-4 min-w-4 place-items-center rounded-pill bg-brand px-1 text-[10px] leading-none font-semibold text-brand-foreground`},S_={class:`flex items-center justify-between border-b px-4 py-3`},C_={class:`max-h-[60vh] overflow-y-auto`},w_={key:0,class:`grid place-items-center py-8`},T_={key:1,class:`px-4 py-8 text-center text-sm text-muted-foreground`},E_={key:2,class:`divide-y`},D_=[`onClick`],O_={class:`min-w-0 flex-1`},k_={key:0,class:`mt-0.5 line-clamp-2 block text-[13px] text-muted-foreground`},A_={class:`mt-1 block text-xs text-muted-foreground`},j_={key:0,class:`mt-2 size-2 shrink-0 rounded-full bg-brand`,"aria-label":`ungelesen`},M_={__name:`NotificationBell`,setup(e){let t=Gs(),n=k(()=>t.props.notifications?.unread??0),r=I(null),i=I(null),a=k(()=>i.value??n.value),o={"file-check":Yc,newspaper:Il,undo:iu,message:Ml};async function l(e){if(!e)return;r.value=null;let t=await s_.get(`/benachrichtigungen`);r.value=t.notifications,i.value=t.unread}async function u(){await s_.post(`/benachrichtigungen/gelesen`),r.value=r.value.map(e=>({...e,read:!0})),i.value=0}function d(e){i.value=null,W.visit(`/benachrichtigungen/${e.id}`)}return(e,t)=>(j(),F(_(t_),{"onUpdate:open":l},{default:N(()=>[s(_(r_),{class:`relative grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground`,"aria-label":a.value?`Benachrichtigungen, ${a.value} ungelesen`:`Benachrichtigungen`},{default:N(()=>[s(_(Ec),{class:`size-5`}),a.value?(j(),D(`span`,x_,P(a.value>9?`9+`:a.value),1)):R(``,!0)]),_:1},8,[`aria-label`]),s(_(n_),{align:`end`,class:`w-[22rem] p-0`},{default:N(()=>[E(`div`,S_,[t[1]||=E(`h2`,{class:`text-sm font-semibold`},`Benachrichtigungen`,-1),a.value?(j(),D(`button`,{key:0,type:`button`,class:`inline-flex items-center gap-1 text-xs font-medium text-brand-text hover:underline`,onClick:u},[s(_(Lc),{class:`size-3.5`}),t[0]||=c(` Alle gelesen `,-1)])):R(``,!0)]),E(`div`,C_,[r.value===null?(j(),D(`div`,w_,[s(_(Oe),{class:`size-5 animate-spin text-muted-foreground`})])):r.value.length?(j(),D(`ul`,E_,[(j(!0),D(M,null,ne(r.value,e=>(j(),D(`li`,{key:e.id},[E(`button`,{type:`button`,class:`flex w-full gap-3 px-4 py-3 text-left hover:bg-accent/60`,onClick:t=>d(e)},[E(`span`,{class:T([`mt-0.5 grid size-8 shrink-0 place-items-center rounded-full`,e.read?`bg-muted text-muted-foreground`:`bg-brand-soft text-brand-text`])},[(j(),F(ge(o[e.icon]??_(Ec)),{class:`size-4`}))],2),E(`span`,O_,[E(`span`,{class:T([`block text-sm`,e.read?`text-foreground/80`:`font-semibold`])},P(e.title),3),e.body?(j(),D(`span`,k_,P(e.body),1)):R(``,!0),E(`span`,A_,P(_(v_)(e.created_at)),1)]),e.read?R(``,!0):(j(),D(`span`,j_))],8,D_)]))),128))])):(j(),D(`p`,T_,`Keine Benachrichtigungen.`))])]),_:1})]),_:1}))}},N_=A({__name:`Avatar`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(j(),F(_(Pp),{"data-slot":`avatar`,class:T(_(H)(`relative flex size-8 shrink-0 overflow-hidden rounded-full`,t.class))},{default:N(()=>[L(e.$slots,`default`)]),_:3},8,[`class`]))}}),P_=A({__name:`AvatarFallback`,props:{delayMs:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(Fp),O({"data-slot":`avatar-fallback`},_(n),{class:_(H)(`bg-muted flex size-full items-center justify-center rounded-full`,t.class)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),F_=A({__name:`AvatarImage`,props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(j(),F(_(Rp),O({"data-slot":`avatar-image`},t,{class:`aspect-square size-full`}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),I_=[{soft:`bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200`,bar:`bg-sky-500`,text:`text-sky-700 dark:text-sky-300`},{soft:`bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200`,bar:`bg-emerald-500`,text:`text-emerald-700 dark:text-emerald-300`},{soft:`bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-200`,bar:`bg-amber-500`,text:`text-amber-700 dark:text-amber-300`},{soft:`bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200`,bar:`bg-rose-500`,text:`text-rose-700 dark:text-rose-300`},{soft:`bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200`,bar:`bg-violet-500`,text:`text-violet-700 dark:text-violet-300`},{soft:`bg-teal-100 text-teal-800 dark:bg-teal-950 dark:text-teal-200`,bar:`bg-teal-500`,text:`text-teal-700 dark:text-teal-300`},{soft:`bg-orange-100 text-orange-800 dark:bg-orange-950 dark:text-orange-200`,bar:`bg-orange-500`,text:`text-orange-700 dark:text-orange-300`},{soft:`bg-indigo-100 text-indigo-800 dark:bg-indigo-950 dark:text-indigo-200`,bar:`bg-indigo-500`,text:`text-indigo-700 dark:text-indigo-300`}],L_={soft:`bg-muted text-muted-foreground`,bar:`bg-border`,text:`text-muted-foreground`};function R_(e){let t=0;for(let n of String(e))t=t*31+n.codePointAt(0)>>>0;return t}function z_(e){return e==null||e===``?L_:I_[R_(typeof e==`string`?e.trim().toLowerCase():e)%I_.length]}var B_={__name:`PersonAvatar`,props:{person:{type:Object,required:!0},class:{type:[String,Array,Object],default:``}},setup(e){let t=e,n=k(()=>z_(t.person.id??t.person.name));return(t,r)=>(j(),F(_(N_),{class:T(_(H)(`size-10`,t.$props.class))},{default:N(()=>[e.person.avatar_url?(j(),F(_(F_),{key:0,src:e.person.avatar_url,alt:e.person.name},null,8,[`src`,`alt`])):R(``,!0),s(_(P_),{class:T([`font-semibold`,n.value.soft])},{default:N(()=>[c(P(e.person.initials),1)]),_:1},8,[`class`])]),_:1},8,[`class`]))}},V_=[`href`,`target`,`rel`],H_={__name:`NavLink`,props:{item:{type:Object,required:!0}},setup(e){return(t,n)=>e.item.new_tab||!e.item.href.startsWith(`/`)?(j(),D(`a`,{key:0,href:e.item.href,target:e.item.new_tab?`_blank`:void 0,rel:e.item.new_tab?`noopener`:void 0},[L(t.$slots,`default`)],8,V_)):(j(),F(_(gc),{key:1,href:e.item.href},{default:N(()=>[L(t.$slots,`default`)]),_:3},8,[`href`]))}},U_={house:fl,newspaper:Il,"calendar-days":Pc,folder:nl,"folder-open":tl,"file-text":$c,"file-down":Xc,"clipboard-list":Wc,users:lu,network:Fl,"user-round":cu,"user-plus":ou,cake:Nc,"layout-grid":bl,info:De,"circle-help":Hc,settings:ql,star:Zl,bell:Ec,megaphone:Al,clock:Gc,plane:zl,receipt:Ul,"graduation-cap":il,briefcase:Ac,"list-checks":wl,"book-open":kc,scale:Gl,euro:qc,"chart-column":Ic,landmark:vl,"building-2":jc,"map-pin":kl,"key-round":_l,"shopping-cart":Yl,truck:nu,monitor:Nl,laptop:yl,headset:ll,printer:Vl,globe:rl,mail:Ol,phone:Rl,"message-square":Ml,link:Cl,image:ml,video:du,"heart-handshake":ul,handshake:ol,heart:dl,stethoscope:Ql,baby:Tc,church:Vc,accessibility:Cc,"shield-check":Jl,lightbulb:Sl,sparkles:Xl,trophy:tu,leaf:xl,utensils:uu,coffee:Kc,car:Fc,bus:Mc,bike:Dc,wrench:fu,hammer:al},W_=_e(null),G_=null;function K_(){return G_??=z(()=>import(`./icon-set-B_oGzY3h.js`).then(e=>(W_.value={icons:e.default,aliases:e.aliases},W_.value)),[]),G_}function q_(e){let t=W_.value;return!t||!e?null:t.icons[e]??t.icons[t.aliases[e]]??null}var J_=[`stroke-width`,`innerHTML`],Y_={__name:`AppIcon`,props:{name:{type:String,default:null},strokeWidth:{type:[Number,String],default:2}},setup(e){let t=e,n=k(()=>t.name?U_[t.name]:null),r=k(()=>n.value?null:q_(t.name));return b(()=>{t.name&&!n.value&&K_()}),(t,i)=>n.value?(j(),F(ge(n.value),{key:0,"stroke-width":e.strokeWidth,"aria-hidden":`true`},null,8,[`stroke-width`])):e.name?(j(),D(`svg`,{key:1,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":e.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,innerHTML:r.value??``},null,8,J_)):R(``,!0)}},X_=[`title`],Z_={key:0,class:`absolute -bottom-1.5 rounded-[3px] bg-card px-1 text-[9px] leading-tight font-bold tracking-wide text-current ring-1 ring-border`},Q_={__name:`FileIcon`,props:{extension:{type:String,default:``},size:{type:String,default:`md`}},setup(e){let t=e,n={icon:$c},r={icon:Qc},i={PDF:{...n,class:`bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300`},DOC:{...n,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},DOCX:{...n,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},ODT:{...n,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},RTF:{...n,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},TXT:{...n,class:`bg-muted text-muted-foreground`},XLS:{...r,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},XLSX:{...r,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},CSV:{...r,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},ODS:{...r,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},PPT:{icon:Bl,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},PPTX:{icon:Bl,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},JPG:{icon:Zc,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},JPEG:{icon:Zc,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},PNG:{icon:Zc,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},ZIP:{icon:Jc,class:`bg-amber-50 text-amber-700 dark:bg-amber-950/50 dark:text-amber-300`}},a=k(()=>i[t.extension?.toUpperCase()]??{icon:el,class:`bg-muted text-muted-foreground`}),o=k(()=>({sm:`size-8 rounded-md`,md:`size-10 rounded-md`,lg:`size-14 rounded-lg`})[t.size]),s=k(()=>({sm:`size-4`,md:`size-5`,lg:`size-7`})[t.size]);return(t,n)=>(j(),D(`span`,{class:T([`relative grid shrink-0 place-items-center`,[o.value,a.value.class]]),title:e.extension||void 0},[(j(),F(ge(a.value.icon),{class:T(s.value),"stroke-width":1.75},null,8,[`class`])),e.extension&&e.size!==`sm`?(j(),D(`span`,Z_,P(e.extension),1)):R(``,!0)],10,X_))}},$_=e=>String(e??``).replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]);function ev(e,t){let n=$_(e),r=String(t??``).trim().split(/\s+/).filter(e=>e.length>=2).map(e=>$_(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`));return r.length?n.replace(RegExp(`(${r.join(`|`)})`,`gi`),`<mark class="rounded-sm bg-brand-soft px-0.5 text-foreground">$1</mark>`):n}var tv={class:`relative block`},nv=[`aria-expanded`],rv={key:0,id:`global-search-results`,class:`absolute top-full right-0 z-50 mt-2 max-h-[min(70vh,560px)] w-[min(92vw,30rem)] overflow-y-auto rounded-lg border bg-popover text-popover-foreground shadow-lg`},iv={class:`flex items-center gap-2 px-4 pt-3 pb-1 text-[11px] font-semibold tracking-wider text-muted-foreground uppercase`},av={class:`pb-2`},ov=[`src`],sv={class:`min-w-0 flex-1`},cv=[`innerHTML`],lv={key:0,class:`block truncate text-xs text-muted-foreground`},uv=[`innerHTML`],dv={key:1,class:`px-4 py-6 text-center text-sm text-muted-foreground`},fv={key:2,class:`px-4 py-6 text-center text-sm text-muted-foreground`},pv={__name:`GlobalSearchBox`,props:{initial:{type:String,default:``}},setup(e){let t=e,n=I(null),r=I(null),i=I(t.initial),a=I([]),o=I(!1),l=I(!1),u=I(-1),d=0,p=k(()=>a.value.flatMap(e=>e.items)),m=(e,t)=>p.value.indexOf(t),h=Nt(async e=>{let t=++d;try{let n=await s_.get(`/suche/live?q=${encodeURIComponent(e)}`);t===d&&(a.value=n.groups,u.value=-1)}catch{t===d&&(a.value=[])}finally{t===d&&(o.value=!1)}},220);f(i,e=>{if(e.trim().length<2){d++,a.value=[],o.value=!1;return}o.value=!0,l.value=!0,h(e.trim())}),Ch(n,()=>l.value=!1);function g(e){p.value.length&&(l.value=!0,u.value=(u.value+e+p.value.length)%p.value.length)}function v(e){l.value=!1,e.external?window.location.href=e.url:W.visit(e.url)}function y(){let e=p.value[u.value];if(e)return v(e);i.value.trim().length<2||(l.value=!1,W.get(`/suche`,{q:i.value.trim()}))}let b=k(()=>l.value&&i.value.trim().length>=2);return(e,t)=>(j(),D(`div`,{ref_key:`root`,ref:n,class:`relative`},[E(`form`,{role:`search`,onSubmit:we(y,[`prevent`])},[E(`label`,tv,[t[7]||=E(`span`,{class:`sr-only`},`Portal durchsuchen`,-1),s(_(Kl),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),C(E(`input`,{ref_key:`input`,ref:r,"onUpdate:modelValue":t[0]||=e=>i.value=e,type:`search`,placeholder:`Portal durchsuchen …`,autocomplete:`off`,role:`combobox`,"aria-expanded":b.value,"aria-controls":`global-search-results`,class:`h-10 w-full rounded-md border border-input bg-card pr-9 pl-9 text-sm shadow-xs placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,onFocus:t[1]||=e=>l.value=!0,onKeydown:[t[2]||=ye(we(e=>g(1),[`prevent`]),[`down`]),t[3]||=ye(we(e=>g(-1),[`prevent`]),[`up`]),t[4]||=ye(e=>l.value=!1,[`esc`])]},null,40,nv),[[Te,i.value]]),o.value?(j(),F(_(Oe),{key:0,class:`absolute top-1/2 right-3 size-4 -translate-y-1/2 animate-spin text-muted-foreground`})):R(``,!0)])],32),b.value?(j(),D(`div`,rv,[a.value.length?(j(!0),D(M,{key:0},ne(a.value,e=>(j(),D(`section`,{key:e.key,class:`border-b last:border-b-0`},[E(`h3`,iv,[s(Y_,{name:e.icon,class:`size-3.5`},null,8,[`name`]),c(` `+P(e.label),1)]),E(`ul`,av,[(j(!0),D(M,null,ne(e.items,n=>(j(),D(`li`,{key:n.url},[(j(),F(ge(n.external?`a`:_(gc)),{href:n.url,class:T([`flex items-start gap-3 px-4 py-2 transition-colors`,m(e,n)===u.value?`bg-accent`:`hover:bg-accent/60`]),onClick:t[5]||=e=>l.value=!1,onMouseenter:t=>u.value=m(e,n)},{default:N(()=>[n.image?(j(),D(`img`,{key:0,src:n.image,alt:``,class:`mt-0.5 size-10 shrink-0 rounded-md object-cover`},null,8,ov)):n.file?(j(),F(Q_,{key:1,extension:n.file,size:`sm`,class:`mt-0.5`},null,8,[`extension`])):R(``,!0),E(`span`,sv,[E(`span`,{class:`block truncate text-sm font-medium`,innerHTML:_(ev)(n.title,i.value)},null,8,cv),n.meta?(j(),D(`span`,lv,P(n.meta),1)):R(``,!0),n.excerpt?(j(),D(`span`,{key:1,class:`mt-0.5 line-clamp-1 text-xs text-muted-foreground`,innerHTML:_(ev)(n.excerpt,i.value)},null,8,uv)):R(``,!0)])]),_:2},1064,[`href`,`class`,`onMouseenter`]))]))),128))])]))),128)):o.value?(j(),D(`p`,fv,`Suche läuft …`)):(j(),D(`p`,dv,`Keine Treffer für „`+P(i.value.trim())+`“.`,1)),s(_(gc),{href:`/suche?q=${encodeURIComponent(i.value.trim())}`,class:`sticky bottom-0 flex items-center justify-between gap-2 border-t bg-muted/60 px-4 py-2.5 text-sm font-medium text-brand-text backdrop-blur hover:bg-muted`,onClick:t[6]||=e=>l.value=!1},{default:N(()=>[c(` Alle Ergebnisse für „`+P(i.value.trim())+`“ `,1),s(_(wc),{class:`size-4`})]),_:1},8,[`href`])])):R(``,!0)],512))}},mv=typeof window<`u`?window.matchMedia(`(prefers-color-scheme: dark)`):null;function hv(e){let t=e===`dark`||e===`system`&&mv?.matches;document.documentElement.classList.toggle(`dark`,t),document.documentElement.dataset.theme=e}mv?.addEventListener(`change`,()=>hv(document.documentElement.dataset.theme??`system`));function gv(){let e=Gs(),t=k(()=>e.props.auth.user?.theme??`system`);function n(e){hv(e),W.put(`/profil/darstellung`,{theme:e},{preserveScroll:!0,preserveState:!0})}return{preference:t,setPreference:n}}var _v={class:`flex min-h-screen flex-col`},vv={key:0,class:`flex flex-wrap items-center justify-center gap-x-3 gap-y-1 bg-amber-400 px-4 py-1.5 text-center text-[13px] font-medium text-amber-950`},yv=[`data-header`],bv={class:`mx-auto flex h-16 max-w-[1440px] items-center gap-2 px-4 lg:gap-6 lg:px-6`},xv={class:`grid gap-1 overflow-y-auto p-3`,"aria-label":`Hauptnavigation`},Sv={key:1,class:`px-3 pt-3 pb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},Cv={key:2,class:`mb-1 ml-3 grid gap-0.5 border-l pl-2`},wv={class:`pointer-events-none invisible absolute inset-0 overflow-hidden`,"aria-hidden":`true`},Tv={class:`flex h-full items-stretch gap-1`},Ev={key:1,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},Dv={key:1,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},Ov={key:0,class:`flex`},kv={key:0,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},Av={class:`ml-auto flex shrink-0 items-center gap-1`},jv={key:0,href:`/admin`,class:`grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground`,"aria-label":`Administration`,title:`Administration`},Mv={class:`min-w-0`},Nv={class:`truncate text-sm font-semibold`},Pv={class:`truncate text-xs text-muted-foreground`},Fv={href:`/admin`},Iv={class:`mx-auto w-full max-w-[1440px] flex-1 px-4 py-6 lg:px-6 lg:py-7`},Lv={key:1,class:`border-t`},Rv={class:`mx-auto flex max-w-[1440px] flex-wrap items-center justify-between gap-x-6 gap-y-2 px-4 py-5 text-[13px] text-muted-foreground lg:px-6`},zv={key:0},Bv={key:1,class:`flex flex-wrap gap-x-5 gap-y-1`,"aria-label":`Fußzeile`},Vv=[`href`],Hv=84,Uv={__name:`AppLayout`,props:{title:{type:String,default:``}},setup(e){let t=Gs(),n=k(()=>t.props.auth.user),r=k(()=>t.props.branding),i=k(()=>r.value.header_style??`light`),a=k(()=>t.props.navigation),o=I(null),l=I(null),u=I(a.value.length);function d(){let e=o.value,t=l.value?[...l.value.children]:[];if(!e||!t.length)return;let n=t.map(e=>e.getBoundingClientRect().width+4),r=e.clientWidth;if(n.reduce((e,t)=>e+t,0)<=r){u.value=n.length;return}let i=Hv,a=0;for(let e of n){if(i+e>r)break;i+=e,a++}u.value=Math.max(1,a)}let p;ie(()=>{p=new ResizeObserver(d),o.value&&p.observe(o.value),me(d),document.fonts?.ready.then(d)}),ue(()=>p?.disconnect()),f(a,()=>me(d));let m=k(()=>a.value.slice(0,u.value)),h=k(()=>a.value.slice(u.value)),{preference:g,setPreference:v}=gv(),y=I(!1),b=t.url.startsWith(`/suche?`)?new URLSearchParams(t.url.split(`?`)[1]).get(`q`)??``:``,x=[{value:`system`,label:`Wie im System`,icon:Nl},{value:`light`,label:`Hell`,icon:$l},{value:`dark`,label:`Dunkel`,icon:Pl}];return(t,u)=>(j(),D(M,null,[e.title?(j(),F(_(fc),{key:0,title:e.title},null,8,[`title`])):R(``,!0),E(`div`,_v,[r.value.preview?(j(),D(`div`,vv,[...u[3]||=[c(` Vorschau des Entwurfs – so sieht das Portal nach dem Veröffentlichen aus. `,-1),E(`a`,{href:`?vorschau=aus`,class:`underline`},`Vorschau beenden`,-1)]])):R(``,!0),E(`header`,{class:T([`sticky top-0 z-40 border-b`,i.value===`light`?`bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/85`:``]),"data-header":i.value},[E(`div`,bv,[s(_(vh),{open:y.value,"onUpdate:open":u[2]||=e=>y.value=e},{default:N(()=>[s(_(Bh),{class:`-ml-2 grid size-10 place-items-center rounded-md text-foreground/80 hover:bg-accent lg:hidden`,"aria-label":`Menü öffnen`},{default:N(()=>[s(_(jl),{class:`size-5`})]),_:1}),s(_(Lh),{side:`left`,class:`w-72 p-0`},{default:N(()=>[s(_(Rh),{class:`border-b px-5 py-4`},{default:N(()=>[s(_(zh),{class:`text-left`},{default:N(()=>[s(e_)]),_:1})]),_:1}),E(`nav`,xv,[(j(!0),D(M,null,ne(a.value,e=>(j(),D(M,{key:e.key},[e.href?(j(),F(H_,{key:0,item:e,class:T([`flex items-center gap-2.5 rounded-md px-3 py-2.5 text-[15px] font-medium`,e.active&&!e.children.some(e=>e.active)?`bg-brand-soft text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent`]),onClick:u[0]||=e=>y.value=!1},{default:N(()=>[e.icon?(j(),F(Y_,{key:0,name:e.icon,class:`size-[18px] opacity-80`},null,8,[`name`])):R(``,!0),c(P(e.label),1)]),_:2},1032,[`item`,`class`])):(j(),D(`p`,Sv,P(e.label),1)),e.children.length?(j(),D(`div`,Cv,[(j(!0),D(M,null,ne(e.children,e=>(j(),F(H_,{key:e.key,item:e,class:T([`flex items-center gap-2 rounded-md px-3 py-2 text-sm`,e.active?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/75 hover:bg-accent`]),onClick:u[1]||=e=>y.value=!1},{default:N(()=>[e.icon?(j(),F(Y_,{key:0,name:e.icon,class:`size-4 opacity-70`},null,8,[`name`])):R(``,!0),c(P(e.label),1)]),_:2},1032,[`item`,`class`]))),128))])):R(``,!0)],64))),128))])]),_:1})]),_:1},8,[`open`]),s(_(gc),{href:`/`,class:`shrink-0 text-foreground`,"aria-label":`Startseite`},{default:N(()=>[s(e_,{inverted:i.value!==`light`,compact:``},null,8,[`inverted`])]),_:1}),E(`nav`,{ref_key:`navBox`,ref:o,class:`relative hidden h-full min-w-0 flex-1 lg:block`,"aria-label":`Hauptnavigation`},[E(`div`,wv,[E(`ul`,{ref_key:`navMeasure`,ref:l,class:`flex w-max gap-1`},[(j(!0),D(M,null,ne(a.value,e=>(j(),D(`li`,{key:e.key,class:`flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap`},[e.icon?(j(),F(Y_,{key:0,name:e.icon,class:`size-4`},null,8,[`name`])):R(``,!0),c(P(e.label),1),e.children.length?(j(),F(_(zc),{key:1,class:`size-4`})):R(``,!0)]))),128))],512)]),E(`ul`,Tv,[(j(!0),D(M,null,ne(m.value,e=>(j(),D(`li`,{key:e.key,class:`flex`},[e.children.length?(j(),F(_(Vh),{key:0},{default:N(()=>[s(_(Yh),{class:T([`relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none`,e.active?`text-foreground`:`text-foreground/70 hover:text-foreground`])},{default:N(()=>[e.icon?(j(),F(Y_,{key:0,name:e.icon,class:`size-4 opacity-80`},null,8,[`name`])):R(``,!0),c(P(e.label)+` `,1),s(_(zc),{class:`size-4 opacity-70`}),e.active?(j(),D(`span`,Ev)):R(``,!0)]),_:2},1032,[`class`]),s(_(Hh),{align:`start`,class:`min-w-56`},{default:N(()=>[e.href?(j(),D(M,{key:0},[s(_(Uh),{"as-child":``},{default:N(()=>[s(H_,{item:e,class:T(e.active&&!e.children.some(e=>e.active)?`font-semibold text-brand-text`:`font-medium`)},{default:N(()=>[c(P(e.label)+` – Übersicht`,1)]),_:2},1032,[`item`,`class`])]),_:2},1024),s(_(Jh))],64)):R(``,!0),(j(!0),D(M,null,ne(e.children,e=>(j(),F(_(Uh),{key:e.key,"as-child":``},{default:N(()=>[s(H_,{item:e,class:T(e.active?`font-semibold text-brand-text`:``)},{default:N(()=>[e.icon?(j(),F(Y_,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):R(``,!0),c(P(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)):(j(),F(H_,{key:1,item:e,class:T([`relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors`,e.active?`text-foreground`:`text-foreground/70 hover:text-foreground`]),"aria-current":e.active?`page`:void 0},{default:N(()=>[e.icon?(j(),F(Y_,{key:0,name:e.icon,class:`size-4 opacity-80`},null,8,[`name`])):R(``,!0),c(P(e.label)+` `,1),e.active?(j(),D(`span`,Dv)):R(``,!0)]),_:2},1032,[`item`,`class`,`aria-current`]))]))),128)),h.value.length?(j(),D(`li`,Ov,[s(_(Vh),null,{default:N(()=>[s(_(Yh),{class:T([`relative flex items-center gap-1 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none`,h.value.some(e=>e.active)?`text-foreground`:`text-foreground/70 hover:text-foreground`])},{default:N(()=>[u[4]||=c(` Mehr `,-1),s(_(zc),{class:`size-4`}),h.value.some(e=>e.active)?(j(),D(`span`,kv)):R(``,!0)]),_:1},8,[`class`]),s(_(Hh),{align:`start`,class:`min-w-48`},{default:N(()=>[(j(!0),D(M,null,ne(h.value,(e,t)=>(j(),D(M,{key:e.key},[e.children.length?(j(),D(M,{key:0},[t?(j(),F(_(Jh),{key:0})):R(``,!0),s(_(Wh),{class:`text-xs text-muted-foreground`},{default:N(()=>[c(P(e.label),1)]),_:2},1024),e.href?(j(),F(_(Uh),{key:1,"as-child":``},{default:N(()=>[s(H_,{item:e},{default:N(()=>[...u[5]||=[c(`Übersicht`,-1)]]),_:1},8,[`item`])]),_:2},1024)):R(``,!0),(j(!0),D(M,null,ne(e.children,e=>(j(),F(_(Uh),{key:e.key,"as-child":``},{default:N(()=>[s(H_,{item:e,class:T(e.active?`font-semibold text-brand-text`:``)},{default:N(()=>[e.icon?(j(),F(Y_,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):R(``,!0),c(P(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))),128))],64)):(j(),F(_(Uh),{key:1,"as-child":``},{default:N(()=>[s(H_,{item:e,class:T(e.active?`font-semibold text-brand-text`:``)},{default:N(()=>[e.icon?(j(),F(Y_,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):R(``,!0),c(P(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))],64))),128))]),_:1})]),_:1})])):R(``,!0)])],512),E(`div`,Av,[s(pv,{initial:_(b),class:`mr-2 hidden w-64 md:block xl:w-80`},null,8,[`initial`]),s(_(gc),{href:`/suche`,class:`grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground md:hidden`,"aria-label":`Portal durchsuchen`},{default:N(()=>[s(_(Kl),{class:`size-5`})]),_:1}),s(M_),n.value.can_admin?(j(),D(`a`,jv,[s(_(ql),{class:`size-5`})])):R(``,!0),s(_(Vh),null,{default:N(()=>[s(_(Yh),{class:`ml-1 flex items-center gap-1.5 rounded-full py-1 pr-1.5 pl-1 hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,"aria-label":`Menü für ${n.value.name}`},{default:N(()=>[s(B_,{person:n.value,class:`size-9`},null,8,[`person`]),s(_(zc),{class:`size-4 text-muted-foreground`})]),_:1},8,[`aria-label`]),s(_(Hh),{align:`end`,class:`w-72`},{default:N(()=>[s(_(Wh),{class:`flex items-center gap-3 py-2 font-normal`},{default:N(()=>[s(B_,{person:n.value,class:`size-10`},null,8,[`person`]),E(`div`,Mv,[E(`div`,Nv,P(n.value.name),1),E(`div`,Pv,P(n.value.email),1)])]),_:1}),s(_(Jh)),s(_(Uh),{"as-child":``},{default:N(()=>[s(_(gc),{href:`/personen/${n.value.id}`},{default:N(()=>[s(_(cu)),u[6]||=c(` Mein Profil`,-1)]),_:1},8,[`href`])]),_:1}),s(_(Uh),{"as-child":``},{default:N(()=>[s(_(gc),{href:`/profil/bearbeiten`},{default:N(()=>[s(_(su)),u[7]||=c(` Profil bearbeiten`,-1)]),_:1})]),_:1}),n.value.can_admin?(j(),F(_(Uh),{key:0,"as-child":``},{default:N(()=>[E(`a`,Fv,[s(_(ql)),u[8]||=c(` Administration`,-1)])]),_:1})):R(``,!0),r.value.color_mode?R(``,!0):(j(),D(M,{key:1},[s(_(Jh)),s(_(Wh),{class:`text-xs font-medium text-muted-foreground`},{default:N(()=>[...u[9]||=[c(`Darstellung`,-1)]]),_:1}),s(_(Gh),{"model-value":_(g),"onUpdate:modelValue":_(v)},{default:N(()=>[(j(),D(M,null,ne(x,e=>s(_(qh),{key:e.value,value:e.value},{default:N(()=>[(j(),F(ge(e.icon),{class:`size-4 text-muted-foreground`})),c(` `+P(e.label),1)]),_:2},1032,[`value`])),64))]),_:1},8,[`model-value`,`onUpdate:modelValue`])],64)),s(_(Jh)),s(_(Uh),{"as-child":``},{default:N(()=>[s(_(gc),{href:`/logout`,method:`post`,as:`button`,class:`w-full`},{default:N(()=>[s(_(Dl)),u[10]||=c(` Abmelden`,-1)]),_:1})]),_:1})]),_:1})]),_:1})])])],10,yv),E(`main`,Iv,[L(t.$slots,`default`)]),r.value.footer.text||r.value.footer.links.length?(j(),D(`footer`,Lv,[E(`div`,Rv,[r.value.footer.text?(j(),D(`p`,zv,P(r.value.footer.text),1)):R(``,!0),r.value.footer.links.length?(j(),D(`nav`,Bv,[(j(!0),D(M,null,ne(r.value.footer.links,e=>(j(),D(`a`,{key:e.url,href:e.url,class:`hover:text-foreground hover:underline`},P(e.label),9,Vv))),128))])):R(``,!0)])])):R(``,!0)]),s(_(Kg),{position:`bottom-right`})],64))}},Wv={class:`mb-6 flex flex-wrap items-end justify-between gap-x-6 gap-y-4`},Gv={class:`flex min-w-0 items-end gap-3.5`},Kv={class:`min-w-0`},qv={key:0,class:`mb-1 flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground`,"aria-label":`Brotkrumen`},Jv={class:`text-2xl leading-tight font-semibold tracking-tight`},Yv={key:1,class:`mt-1 max-w-3xl text-sm text-muted-foreground`},Xv={key:0,class:`flex w-full flex-wrap items-center gap-2 sm:w-auto`},Zv={__name:`PageHeader`,props:{title:{type:String,required:!0},description:{type:String,default:``},breadcrumbs:{type:Array,default:()=>[]}},setup(e){return(t,n)=>(j(),D(`header`,Wv,[E(`div`,Gv,[L(t.$slots,`leading`),E(`div`,Kv,[e.breadcrumbs.length?(j(),D(`nav`,qv,[(j(!0),D(M,null,ne(e.breadcrumbs,(e,t)=>(j(),D(M,{key:e.href},[t?(j(),F(_(Bc),{key:0,class:`size-3.5`})):R(``,!0),s(_(gc),{href:e.href,class:`hover:text-foreground hover:underline`},{default:N(()=>[c(P(e.label),1)]),_:2},1032,[`href`])],64))),128))])):R(``,!0),E(`h1`,Jv,P(e.title),1),e.description||t.$slots.description?(j(),D(`p`,Yv,[L(t.$slots,`description`,{},()=>[c(P(e.description),1)])])):R(``,!0)])]),t.$slots.actions?(j(),D(`div`,Xv,[L(t.$slots,`actions`)])):R(``,!0)]))}},Qv={class:`rounded-lg border bg-card text-card-foreground`},$v={key:0,class:`flex items-center justify-between gap-4 px-5 pt-4 pb-3`},ey={class:`text-base font-semibold`},ty={__name:`Panel`,props:{title:{type:String,default:``},actionLabel:{type:String,default:``},actionHref:{type:String,default:``}},setup(e){return(t,n)=>(j(),D(`section`,Qv,[e.title||t.$slots.actions?(j(),D(`header`,$v,[E(`h2`,ey,P(e.title),1),L(t.$slots,`actions`,{},()=>[e.actionHref?(j(),F(_(gc),{key:0,href:e.actionHref,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:N(()=>[c(P(e.actionLabel)+` `,1),s(_(Bc),{class:`size-3.5`})]),_:1},8,[`href`])):R(``,!0)])])):R(``,!0),E(`div`,{class:T([`px-5 pb-5`,{"pt-5":!e.title&&!t.$slots.actions}])},[L(t.$slots,`default`)],2)]))}},ny={class:`grid place-items-center px-6 py-10 text-center`},ry={class:`mt-3 text-sm font-medium`},iy={key:0,class:`mt-1 max-w-sm text-[13px] text-muted-foreground`},ay={__name:`EmptyState`,props:{icon:{type:[Object,Function],required:!0},title:{type:String,required:!0},text:{type:String,default:``}},setup(e){return(t,n)=>(j(),D(`div`,ny,[(j(),F(ge(e.icon),{class:`size-8 text-muted-foreground`,"stroke-width":1.5})),E(`p`,ry,P(e.title),1),e.text?(j(),D(`p`,iy,P(e.text),1)):R(``,!0),L(t.$slots,`default`)]))}},oy=A({__name:`Label`,props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(Wm),O({"data-slot":`label`},_(n),{class:_(H)(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,t.class)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),sy={class:`grid content-start gap-1.5`},cy={key:0,class:`text-[13px] text-destructive`},ly={key:1,class:`text-[13px] text-muted-foreground`},uy={__name:`FormField`,props:{id:{type:String,required:!0},label:{type:String,required:!0},error:{type:String,default:``},hint:{type:String,default:``}},setup(e){return(t,n)=>(j(),D(`div`,sy,[s(_(oy),{for:e.id,class:`text-[13px] font-medium`},{default:N(()=>[c(P(e.label),1)]),_:1},8,[`for`]),L(t.$slots,`default`),e.error?(j(),D(`p`,cy,P(e.error),1)):e.hint?(j(),D(`p`,ly,P(e.hint),1)):R(``,!0)]))}},dy={class:`relative`},fy={key:0,value:null},py=[`value`],my={__name:`NativeSelect`,props:i({options:{type:Array,required:!0},placeholder:{type:String,default:``}},{modelValue:{type:[String,Number,null],default:null},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=u(e,`modelValue`);return(n,r)=>(j(),D(`div`,dy,[C(E(`select`,O({"onUpdate:modelValue":r[0]||=e=>t.value=e,class:`h-9 w-full appearance-none rounded-md border border-input bg-card pr-8 pl-3 text-sm shadow-xs focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none disabled:opacity-60`},n.$attrs),[e.placeholder?(j(),D(`option`,fy,P(e.placeholder),1)):R(``,!0),(j(!0),D(M,null,ne(e.options,e=>(j(),D(`option`,{key:e.value,value:e.value},P(e.label),9,py))),128))],16),[[Se,t.value]]),s(_(zc),{class:`pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground`})]))}},hy=Object.defineProperty,gy=(e,t)=>{let n={};for(var r in e)hy(n,r,{get:e[r],enumerable:!0});return t||hy(n,Symbol.toStringTag,{value:`Module`}),n};function _y(e){this.content=e}_y.prototype={constructor:_y,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new _y(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new _y(n)},addToStart:function(e,t){return new _y([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new _y(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new _y(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=_y.from(e),e.size?new _y(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=_y.from(e),e.size?new _y(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=_y.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},_y.from=function(e){if(e instanceof _y)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new _y(t)};function vy(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&xy(e.charCodeAt(r-1))&&by(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=vy(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function yy(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&xy(e.charCodeAt(i-1))&&by(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=yy(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function by(e){return e>=56320&&e<57344}function xy(e){return e>=55296&&e<56320}var G=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return vy(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return yy(this,e,t,n)}findIndex(e){if(e==0)return Cy(0,e);if(e==this.size)return Cy(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Cy(t+1,i):Cy(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};G.empty=new G([],0);var Sy={index:0,offset:0};function Cy(e,t){return Sy.index=e,Sy.offset=t,Sy}function wy(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!wy(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!wy(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Ty=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wy(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Ty.none=[];var Ey=class extends Error{},K=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Oy(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Dy(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(G.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};K.empty=new K(G.empty,0,0);function Dy(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Dy(a.content,t-i-1,n-i-1)))}function Oy(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Oy(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function ky(e,t,n){if(n.openStart>e.depth)throw new Ey(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ey(`Inconsistent open depths`);return Ay(e,t,n,0)}function Ay(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Ay(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Fy(a,Ly(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Fy(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Ry(n,e);return Fy(a,Iy(e,i,o,t,r))}}function jy(e,t){if(!t.type.compatibleContent(e.type))throw new Ey(`Cannot join `+t.type.name+` onto `+e.type.name)}function My(e,t,n){let r=e.node(n);return jy(r,t.node(n)),r}function Ny(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Py(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Ny(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Ny(i.child(e),r);t&&t.depth==n&&t.textOffset&&Ny(t.nodeBefore,r)}function Fy(e,t){if(!e.type.validContent(t))throw new Ey(`Invalid content for node `+e.type.name);return e.copy(t)}function Iy(e,t,n,r,i){let a=e.depth>i&&My(e,t,i+1),o=r.depth>i&&My(n,r,i+1),s=[];return Py(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(jy(a,o),Ny(Fy(a,Iy(e,t,n,r,i+1)),s)):(a&&Ny(Fy(a,Ly(e,t,i+1)),s),Py(t,n,i,s),o&&Ny(Fy(o,Ly(n,r,i+1)),s)),Py(r,null,i,s),new G(s)}function Ly(e,t,n){let r=[];return Py(null,e,n,r),e.depth>n&&Ny(Fy(My(e,t,n+1),Ly(e,t,n+1)),r),Py(t,null,n,r),new G(r)}function Ry(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(G.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var zy=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Ty.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Uy(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Hy.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Hy.set(t,r=new By);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Vy,i}},By=class{constructor(){this.elts=[],this.i=0}},Vy=12,Hy=new WeakMap,Uy=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Wy=Object.create(null),Gy=class e{constructor(e,t,n,r=Ty.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||G.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&wy(this.attrs,t||e.defaultAttrs||Wy)&&Ty.sameSet(this.marks,n||Ty.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return K.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new K(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return ky(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return zy.resolveCached(this,e)}resolveNoCache(e){return zy.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),qy(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=G.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),Jy(this.type.attrs,this.attrs,`node`,this.type.name);let e=Ty.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];Jy(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!Ty.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=G.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};Gy.prototype.text=void 0;var Ky=class e extends Gy{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function qy(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Jy(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var Yy=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Xy(t,n);if(r.next==null)return e.empty;let i=Zy(r);r.next&&r.err(`Unexpected trailing text`);let a=sb(ib(i));return cb(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return G.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
||
`)}};Yy.empty=new Yy(!0);var Xy=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Zy(e){let t=[];do t.push(Qy(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Qy(e){let t=[];do t.push($y(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function $y(e){let t=rb(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=tb(e,t);else break;return t}function eb(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function tb(e,t){let n=eb(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:eb(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function nb(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function rb(e){if(e.eat(`(`)){let t=Zy(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=nb(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function ib(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function ab(e,t){return t-e}function ob(e,t){let n=[];return r(t),n.sort(ab);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function sb(e){let t=Object.create(null);return n(ob(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);ob(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Yy(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(ab);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function cb(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function lb(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function ub(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function db(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new mb(e,r,t[r]);return n}var fb=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=db(e,n.attrs),this.defaultAttrs=lb(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Yy.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ub(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Gy(this,this.computeAttrs(e),G.from(t),Ty.setFrom(n))}createChecked(e=null,t,n){return t=G.from(t),this.checkContent(t),new Gy(this,this.computeAttrs(e),t,Ty.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=G.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(G.empty,!0);return i?new Gy(this,e,t.append(i),Ty.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Ty.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function pb(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var mb=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?pb(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},hb=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=db(e,r.attrs),this.excluded=null;let i=lb(this.attrs);this.instance=i?new Ty(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ty(this,ub(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}},gb=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=_y.from(e.nodes),t.marks=_y.from(e.marks||{}),this.nodes=fb.compile(this.spec.nodes,this),this.marks=hb.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Yy.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?_b(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:_b(this,n.split(` `))}this.nodeFromJSON=e=>Gy.fromJSON(this,e),this.markFromJSON=e=>Ty.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof fb))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ky(n,n.defaultAttrs,e,Ty.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function _b(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function vb(e){return e.tag!=null}function yb(e){return e.style!=null}var bb=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(vb(e))this.tags.push(e);else if(yb(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new kb(this,t,!1);return n.addAll(e,Ty.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new kb(this,t,!0);return n.addAll(e,Ty.none,t.from,t.to),K.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(jb(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Mb(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Mb(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},xb={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Sb={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Cb={ol:!0,ul:!0},wb=1,Tb=2,Eb=4;function Db(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?wb:0)|(t===`full`?Tb:0)}var Ob=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=Ty.none,this.match=i||(a&Eb?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(G.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&wb)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=G.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(G.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!xb.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},kb=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Db(null,t.preserveWhitespace,0)|(n?Eb:0);i=r?new Ob(r.type,r.attrs,Ty.none,!0,t.topMatch||r.type.contentMatch,a):n?new Ob(null,null,Ty.none,!0,null,a):new Ob(e.schema.topNodeType,null,Ty.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Tb?`full`:this.localPreserveWS||(r.options&wb)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
||
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Cb.hasOwnProperty(a)&&this.parser.normalizeLists&&Ab(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Sb.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(xb.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
||
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=Ty.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Nb(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Db(e,i,a.options);a.options&Eb&&a.content.length==0&&(o|=Eb);let s=Ty.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):Nb(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new Ob(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=wb);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Ab(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Cb.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function jb(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Mb(e){let t={};for(let n in e)t[n]=e[n];return t}function Nb(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Pb=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Ib(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Ib(t).createTextNode(e.text);let{dom:n,contentDOM:r}=Bb(Ib(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Bb(Ib(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:Bb(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Fb(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Fb(e.marks)}};function Fb(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Ib(e){return e.document||window.document}var Lb=new WeakMap;function Rb(e){let t=Lb.get(e);return t===void 0&&Lb.set(e,t=zb(e)),t}function zb(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function Bb(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Rb(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=Bb(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Vb=65535,Hb=2**16;function Ub(e,t){return e+t*Hb}function Wb(e){return e&Vb}function Gb(e){return(e-(e&Vb))/Hb}var Kb=1,qb=2,Jb=4,Yb=8,Xb=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Yb)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Jb)>0}},Zb=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Wb(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Gb(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Ub(o/3,e-s),f=0;return c&&(f|=e==s?qb:e==u?Kb:Jb,(t<0?e!=s:e!=u)&&(f|=Yb)),new Xb(a,f,d)}r+=l-c}return n?e+r:new Xb(e+r,0,null)}touches(e,t){let n=0,r=Wb(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Zb.empty=new Zb([]);var Qb=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Xb(e,r,null)}},$b=Object.create(null),ex=class{getMap(){return Zb.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=$b[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in $b)throw RangeError(`Duplicate use of step JSON ID `+e);return $b[e]=t,t.prototype.jsonID=e,t}},tx=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Ey)return e.fail(t.message);throw t}}};function nx(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(nx(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return G.fromArray(r)}var rx=class e extends ex{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new K(nx(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return tx.fromReplace(e,this.from,this.to,i)}invert(){return new ix(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};ex.jsonID(`addMark`,rx);var ix=class e extends ex{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new K(nx(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return tx.fromReplace(e,this.from,this.to,n)}invert(){return new rx(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};ex.jsonID(`removeMark`,ix);var ax=class e extends ex{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tx.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return tx.fromReplace(e,this.pos,this.pos+1,new K(G.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new ox(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};ex.jsonID(`addNodeMark`,ax);var ox=class e extends ex{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tx.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return tx.fromReplace(e,this.pos,this.pos+1,new K(G.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new ax(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};ex.jsonID(`removeNodeMark`,ox);var sx=class e extends ex{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&lx(e,this.from,this.to)?tx.fail(`Structure replace would overwrite content`):tx.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Zb([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?K.empty:new K(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?K.empty:new K(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,K.fromJSON(t,n.slice),!!n.structure)}};sx.MAP_BIAS=1,ex.jsonID(`replace`,sx);var cx=class e extends ex{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(lx(e,this.from,this.gapFrom)||lx(e,this.gapTo,this.to)))return tx.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return tx.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?tx.fromReplace(e,this.from,this.to,n):tx.fail(`Content does not fit in gap`)}getMap(){return new Zb([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,K.fromJSON(t,n.slice),n.insert,!!n.structure)}};ex.jsonID(`replaceAround`,cx);function lx(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function ux(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new ix(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new rx(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function dx(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof hb){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new ix(t.from,t.to,t.style)))}function fx(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new sx(s,l,K.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new ix(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new K(G.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new sx(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(G.empty,!0);e.replace(s,s,new K(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function px(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function mx(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!px(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function hx(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=G.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=G.from(r.node(e).copy(u)),d++):c--;let f=G.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=G.from(i.node(e).copy(f)),p++):l++;e.step(new cx(c,l,o,s,new K(u.append(f),d,p),u.size-d,!0))}function gx(e,t,n=null,r=e){let i=vx(e,t),a=i&&yx(r,t);return a?i.map(_x).concat({type:t,attrs:n}).concat(a.map(_x)):null}function _x(e){return{type:e,attrs:null}}function vx(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function yx(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function bx(e,t,n){let r=G.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=G.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new cx(i,a,i,a,new K(r,0,0),n.length,!0))}function xx(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&wx(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Cx(e,t,n,a),fx(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new cx(c,l,c+1,l-1,new K(G.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Sx(e,t,n,a),!1}})}function Sx(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Cx(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
||
`))}})}function wx(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Tx(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new cx(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new K(G.from(o),0,0),1,!0))}function Ex(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Dx(e,t,n=1,r){let i=e.doc.resolve(t),a=G.empty,o=G.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=G.from(i.node(e).copy(a));let t=r&&r[s];o=G.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new sx(t,t,new K(a.append(o),n,n),!0))}function Ox(e,t){let n=e.resolve(t),r=n.index();return Ax(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function kx(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Ax(e,t){return!!(e&&t&&!e.isLeaf&&kx(e,t))}function jx(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Ax(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Mx(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Cx(e,r.node(),r.before(),s)}o.inlineContent&&fx(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new sx(l,c.map(t+n,-1),K.empty,!0)),r===!0){let t=e.doc.resolve(l);Sx(e,t.node(),t.before(),e.steps.length)}return e}function Nx(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Px(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Fx(e,t,n=t,r=K.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Ix(i,a,r)?new sx(t,n,r):new Lx(i,a,r).fit()}function Ix(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Lx=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=G.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=G.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new K(i,a,o);return e>-1?new cx(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new sx(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Bx(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(G.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return Gx(e,-1)<=t?!1:(this.unplaced.size>1&&Gx(e,1)>n&&n++,this.unplaced=new K(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Bx(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new K(Rx(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new K(Rx(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Vx(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=zx(this.placed,t,G.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?K.empty:new K(Rx(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new K(Rx(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Hx(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Hx(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Hx(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=zx(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=zx(this.placed,this.depth,G.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(G.empty,!0);e.childCount&&(this.placed=zx(this.placed,this.frontier.length,e))}};function Rx(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Rx(e.firstChild.content,t-1,n)))}function zx(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(zx(e.lastChild.content,t-1,n)))}function Bx(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Vx(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Vx(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(G.empty,!0)))),e.copy(r)}function Hx(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Ux(n,a.content,o)?s:null}function Ux(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Wx(e){return e.spec.defining||e.spec.definingForContent}function Gx(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function Kx(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Ix(i,a,r))return e.step(new sx(t,n,r));let o=Xx(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Wx(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new K(qx(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function qx(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(qx(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(G.empty,!0))}return e}function Jx(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Nx(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new K(G.from(r),0,0))}function Yx(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Xx(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Xx(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Zx=class e extends ex{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return tx.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return tx.fromReplace(e,this.pos,this.pos+1,new K(G.from(r),0,+!t.isLeaf))}getMap(){return Zb.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};ex.jsonID(`attr`,Zx);var Qx=class e extends ex{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return tx.ok(n)}getMap(){return Zb.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};ex.jsonID(`docAttr`,Qx);var $x=class extends Error{};$x=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},$x.prototype=Object.create(Error.prototype),$x.prototype.constructor=$x,$x.prototype.name=`TransformError`;var eS=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Qb}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new $x(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=K.empty){let r=Fx(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new K(G.from(n),0,0))}delete(e,t){return this.replace(e,t,K.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Kx(this,e,t,n),this}replaceRangeWith(e,t,n){return Jx(this,e,t,n),this}deleteRange(e,t){return Yx(this,e,t),this}lift(e,t){return hx(this,e,t),this}join(e,t=1){return Mx(this,e,t),this}wrap(e,t){return bx(this,e,t),this}setBlockType(e,t=e,n,r=null){return xx(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Tx(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Zx(e,t,n)),this}setDocAttribute(e,t){return this.step(new Qx(e,t)),this}addNodeMark(e,t){return this.step(new ax(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Ty)t.isInSet(n.marks)&&this.step(new ox(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new ox(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Dx(this,e,t,n),this}addMark(e,t,n){return ux(this,e,t,n),this}removeMark(e,t,n){return dx(this,e,t,n),this}clearIncompatible(e,t,n){return fx(this,e,t,n),this}},tS=Object.create(null),q=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new nS(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=K.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?K.empty:t),o==0&&uS(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),uS(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new J(e):lS(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?lS(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):lS(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new sS(e.node(0))}static atStart(e){return lS(e,e,0,0,1)||new sS(e)}static atEnd(e){return lS(e,e,e.content.size,e.childCount,-1)||new sS(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=tS[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in tS)throw RangeError(`Duplicate use of selection JSON ID `+e);return tS[e]=t,t.prototype.jsonID=e,t}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}};q.prototype.visible=!0;var nS=class{constructor(e,t){this.$from=e,this.$to=t}},rS=!1;function iS(e){!rS&&!e.parent.inlineContent&&(rS=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var J=class e extends q{constructor(e,t=e){iS(e),iS(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return q.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new aS(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=q.findFrom(n,r,!0)||q.findFrom(n,-r,!0);if(e)n=e.$head;else return q.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(q.findFrom(t,-r,!0)||q.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};q.jsonID(`text`,J);var aS=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return J.between(e.resolve(this.anchor),e.resolve(this.head))}},Y=class e extends q{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?q.near(a):new e(a)}content(){return new K(G.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new oS(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};Y.prototype.visible=!1,q.jsonID(`node`,Y);var oS=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new aS(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Y.isSelectable(n)?new Y(t):q.near(t)}},sS=class e extends q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let t=q.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return cS}};q.jsonID(`all`,sS);var cS={map(){return this},resolve(e){return new sS(e)}};function lS(e,t,n,r,i,a=!1){if(t.inlineContent)return J.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=lS(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&Y.isSelectable(r))return Y.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function uS(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof sx||i instanceof cx))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(q.near(e.doc.resolve(o),n))}var dS=1,fS=2,pS=4,mS=class extends eS{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|dS)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&dS)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=fS,this}ensureMarks(e){return Ty.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&fS)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ty.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(q.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=pS,this}get scrolledIntoView(){return(this.updated&pS)>0}};function hS(e,t){return!t||!e?e:e.bind(t)}var gS=class{constructor(e,t,n){this.name=e,this.init=hS(t.init,n),this.apply=hS(t.apply,n)}},_S=[new gS(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new gS(`selection`,{init(e,t){return e.selection||q.atStart(t.doc)},apply(e){return e.selection}}),new gS(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new gS(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],vS=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=_S.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new gS(e.key,e.spec.state,e))})}},yS=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new mS(this)}static create(t){let n=new vS(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new vS(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new vS(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Gy.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=q.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function bS(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=bS(i,t,{})),n[r]=i}return n}var xS=class{constructor(e){this.spec=e,this.props={},e.props&&bS(e.props,this,this.props),this.key=e.key?e.key.key:CS(`plugin`)}getState(e){return e[this.key]}},SS=Object.create(null);function CS(e){return e in SS?e+`$`+ ++SS[e]:(SS[e]=0,e+`$`)}var wS=class{constructor(e=`key`){this.key=CS(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},TS=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function ES(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var DS=(e,t,n)=>{let r=ES(e,n);if(!r)return!1;let i=NS(r);if(!i){let n=r.blockRange(),i=n&&mx(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(ZS(e,i,t,-1))return!0;if(r.parent.content.size==0&&(jS(a,`end`)||Y.isSelectable(a)))for(let n=r.depth;;n--){let o=Fx(e.doc,r.before(n),r.after(n),K.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(jS(a,`end`)?q.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):Y.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},OS=(e,t,n)=>{let r=ES(e,n);if(!r)return!1;let i=NS(r);return i?AS(e,i,t):!1},kS=(e,t,n)=>{let r=PS(e,n);if(!r)return!1;let i=LS(r);return i?AS(e,i,t):!1};function AS(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Fx(e.doc,i,o,K.empty);if(!s||s.from!=i||s instanceof sx&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(J.create(t.doc,i)),n(t.scrollIntoView())}return!0}function jS(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var MS=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=NS(r)}let o=a&&a.nodeBefore;return!o||!Y.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Y.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function NS(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function PS(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var FS=(e,t,n)=>{let r=PS(e,n);if(!r)return!1;let i=LS(r);if(!i)return!1;let a=i.nodeAfter;if(ZS(e,i,t,1))return!0;if(r.parent.content.size==0&&(jS(a,`start`)||Y.isSelectable(a))){let n=Fx(e.doc,r.before(),r.after(),K.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(jS(a,`start`)?q.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Y.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},IS=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=LS(r)}let o=a&&a.nodeAfter;return!o||!Y.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Y.create(e.doc,a.pos)).scrollIntoView()),!0)};function LS(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var RS=(e,t)=>{let n=e.selection,r=n instanceof Y,i;if(r){if(n.node.isTextblock||!Ox(e.doc,n.from))return!1;i=n.from}else if(i=jx(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(Y.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},zS=(e,t)=>{let n=e.selection,r;if(n instanceof Y){if(n.node.isTextblock||!Ox(e.doc,n.to))return!1;r=n.to}else if(r=jx(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},BS=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&mx(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},VS=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
||
`).scrollIntoView()),!0)};function HS(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var US=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=HS(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(q.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},WS=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof sS||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=HS(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(J.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},GS=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Ex(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&mx(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function KS(e){return(t,n)=>{if(t.selection instanceof Y&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!Ex(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof J||t.selection instanceof sS)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=HS(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=Ex(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,Ex(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var qS=KS(),JS=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(Y.create(e.doc,i))),!0)},YS=(e,t)=>(t&&t(e.tr.setSelection(new sS(e.doc))),!0);function XS(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Ox(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function ZS(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&XS(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=G.empty;for(let e=o.length-1;e>=0;e--)s=G.from(o[e].create(null,s));s=G.from(i.copy(s));let c=e.tr.step(new cx(t.pos-1,r,t.pos,r,new K(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Ox(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:q.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&mx(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&jS(a,`start`,!0)&&jS(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=G.empty;for(let e=o.length-1;e>=0;e--)r=G.from(o[e].copy(r));n(e.tr.step(new cx(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new K(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function QS(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(J.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var $S=QS(-1),eC=QS(1);function tC(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&gx(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function nC(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function rC(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var iC=rC(TS,DS,MS),aC=rC(TS,FS,IS),oC={Enter:rC(VS,WS,GS,qS),"Mod-Enter":US,Backspace:iC,"Mod-Backspace":iC,"Shift-Backspace":iC,Delete:aC,"Mod-Delete":aC,"Mod-a":YS},sC={"Ctrl-h":oC.Backspace,"Alt-Backspace":oC[`Mod-Backspace`],"Ctrl-d":oC.Delete,"Ctrl-Alt-Backspace":oC[`Mod-Delete`],"Alt-Delete":oC[`Mod-Delete`],"Alt-d":oC[`Mod-Delete`],"Ctrl-a":$S,"Ctrl-e":eC};for(let e in oC)sC[e]=oC[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function cC(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return lC(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function lC(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Uy(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Uy(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=gx(a,n,r,t);return s?(e&&uC(e,t,s,i,n),!0):!1}function uC(e,t,n,r,i){let a=G.empty;for(let e=n.length-1;e>=0;e--)a=G.from(n[e].type.create(n[e].attrs,a));e.step(new cx(t.start-(r?2:0),t.end,t.start,t.end,new K(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Ex(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function dC(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?fC(t,n,e,a):pC(t,n,a):!0:!1}}function fC(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new cx(a-1,o,a,o,new K(G.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Uy(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=mx(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Ox(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function pC(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?G.empty:G.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new cx(d-+!!s,f+ +!!c,d+1,f-1,new K((s?G.empty:G.from(i.copy(G.empty))).append(c?G.empty:G.from(i.copy(G.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function mC(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=G.from(r?e.create():null),o=new K(G.from(e.create(null,G.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new cx(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var hC=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},gC=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},_C=null,vC=function(e,t,n){let r=_C||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},yC=function(){_C=null},bC=function(e,t,n,r){return n&&(SC(e,t,n,r,-1)||SC(e,t,n,r,1))},xC=/^(img|br|input|textarea|hr)$/i;function SC(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:CC(e))){let n=e.parentNode;if(!n||!X(n)||kC(e)||xC.test(e.nodeName)||e.contentEditable==`false`)return!1;t=hC(e)+(i<0?0:1),e=n}else if(X(e)){let n=e.childNodes[t+(i<0?-1:0)];if(X(n)&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?CC(e):0}else return!1}}function CC(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function X(e){return e.nodeType==1}function wC(e){return e.nodeType==3}function TC(e,t){return t?e.contains(X(t)?t:t.parentNode):!1}function EC(e,t){for(;;){if(wC(e)&&t)return e;if(X(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=CC(e)}else if(e.parentNode&&!kC(e))t=hC(e),e=e.parentNode;else return null}}function DC(e,t){for(;;){if(wC(e)&&t<e.nodeValue.length)return e;if(X(e)&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!kC(e))t=hC(e)+1,e=e.parentNode;else return null}}function OC(e,t,n){for(let r=t==0,i=t==CC(e);r||i;){if(e==n)return!0;let t=hC(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==CC(e)}}function kC(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var AC=function(e){return e.focusNode&&bC(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function jC(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function MC(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function NC(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(CC(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(CC(r.startContainer),r.startOffset)}}}var PC=typeof navigator<`u`?navigator:null,FC=typeof document<`u`?document:null,IC=PC&&PC.userAgent||``,LC=/Edge\/(\d+)/.exec(IC),RC=/MSIE \d/.exec(IC),zC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(IC),BC=!!(RC||zC||LC),VC=RC?document.documentMode:zC?+zC[1]:LC?+LC[1]:0,HC=!BC&&/gecko\/(\d+)/i.test(IC);HC&&+(/Firefox\/(\d+)/.exec(IC)||[0,0])[1];var UC=!BC&&/Chrome\/(\d+)/.exec(IC),WC=!!UC,GC=UC?+UC[1]:0,KC=!BC&&!!PC&&/Apple Computer/.test(PC.vendor),qC=KC&&(/Mobile\/\w+/.test(IC)||!!PC&&PC.maxTouchPoints>2),JC=qC||(PC?/Mac/.test(PC.platform):!1),YC=PC?/Win/.test(PC.platform):!1,XC=/Android \d/.test(IC),ZC=!!FC&&`webkitFontSmoothing`in FC.documentElement.style,QC=ZC?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function $C(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ew(e,t){return typeof e==`number`?e:e[t]}function tw(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function nw(e,t,n){if(!_w(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!X(o)){o=gC(o);continue}let e=o==a.body,n=e?$C(a):tw(o),s=0,c=0;if(t.top<n.top+ew(r,`top`)?c=-(n.top-t.top+ew(i,`top`)):t.bottom>n.bottom-ew(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+ew(i,`top`)-n.top:t.bottom-n.bottom+ew(i,`bottom`)),t.left<n.left+ew(r,`left`)?s=-(n.left-t.left+ew(i,`left`)):t.right>n.right-ew(r,`right`)&&(s=t.right-n.right+ew(i,`right`)),s||c){if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:gC(o)}}function rw(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:iw(e.dom)}}function iw(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=gC(r));return t}function aw({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ow(n,r==0?0:r-t)}function ow(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var sw=null;function cw(e){if(e.setActive)return e.setActive();if(sw)return e.focus(sw);let t=iw(e);e.focus(sw==null?{get preventScroll(){return sw={preventScroll:!0},!0}}:void 0),sw||(sw=!1,ow(t,0))}function lw(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(X(u))e=u.getClientRects();else if(wC(u))e=vC(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&wC(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,X(u)&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&wC(n)?uw(n,i):!n||r?{node:e,offset:a}:lw(n,i)}function uw(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=vw(r,1);if(n.top!=n.bottom&&dw(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function dw(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function fw(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function pw(e,t,n){let{node:r,offset:i}=lw(t,n),a=-1;if(X(r)&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function mw(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(X(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function hw(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(X(n)){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(dw(t,i))return hw(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function gw(e,t){let n=e.dom.ownerDocument,r,i=0,a=NC(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o)){let n=e.dom.getBoundingClientRect();if(!dw(t,n)||(o=hw(e.dom,t,n),!o))return null}if(KC)for(let e=o;r&&e;e=gC(e))e.draggable&&(r=void 0);if(o=fw(o,t),r){if(HC&&X(r)&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;ZC&&i&&X(r)&&X(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&X(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||!X(r)||r.childNodes[i-1].nodeName!=`BR`)&&(s=mw(e,r,i,t))}s??=pw(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function _w(e){return e.top<e.bottom||e.left<e.right}function vw(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(_w(e))return e}return Array.prototype.find.call(n,_w)||e.getBoundingClientRect()}var yw=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function bw(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=ZC||HC;if(wC(r)){if(o&&(yw.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=vw(vC(r,i,i),n);if(HC&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=vw(vC(r,i-1,i-1),-1);if(t.top==e.top){let n=vw(vC(r,i,i+1),-1);if(n.top!=e.top)return xw(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,xw(vw(vC(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==CC(r))){let e=r.childNodes[i-1];if(X(e))return Sw(e.getBoundingClientRect(),!1)}if(a==null&&i<CC(r)){let e=r.childNodes[i];if(X(e))return Sw(e.getBoundingClientRect(),!0)}return Sw(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==CC(r))){let e=r.childNodes[i-1],t=wC(e)?vC(e,CC(e)-+!o):X(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return xw(vw(t,1),!1)}if(a==null&&i<CC(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?wC(e)?vC(e,0,+!o):X(e)?e:null:null;if(t)return xw(vw(t,-1),!0)}return xw(vw(wC(r)?vC(r):r,-n),n>=0)}function xw(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Sw(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Cw(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function ww(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Cw(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=bw(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(X(e))t=e.getClientRects();else if(wC(e))t=vC(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Tw=/[\u0590-\u08ac]/;function Ew(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Tw.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Cw(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!TC(l,u)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Dw=null,Ow=null,kw=!1;function Aw(e,t,n){return Dw==t&&Ow==n?kw:(Dw=t,Ow=n,kw=n==`up`||n==`down`?ww(e,t,n):Ew(e,t,n))}var jw=0,Mw=1,Nw=2,Pw=3,Fw=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=jw,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&TC(this.contentDOM,e)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>hC(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(X(a)?TC(a,e):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof Hw||e instanceof Iw&&e.side>=0))break}if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?hC(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?hC(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=hC(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=hC(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(!X(t)||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((HC||KC)&&e==t){let{node:e,offset:t}=o;if(wC(e)){if(u=!!(t&&e.nodeValue[t-1]==`
|
||
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:hC(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(HC&&l.focusNode&&l.focusNode!=s.node&&X(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&KC)&&bC(o.node,o.offset,l.anchorNode,l.anchorOffset)&&bC(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&HC)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Nw:Mw,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Pw:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Nw:Pw}n=a}this.dirty=Nw}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Nw:Mw;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Iw=class extends Fw{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){let e=X(a)?a:document.createElement(`span`);e!=a&&e.appendChild(a),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==jw&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Lw=class extends Fw{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Rw=class e extends Fw{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=Pb.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Pw||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Pw&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=jw){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=jw}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=aT(a,n,o,r)),t>0&&(a=aT(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},zw=class e extends Fw{constructor(e,t,n,r,i,a,o){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(!wC(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Pb.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Xw(u,r,n),l?c=new Uw(t,n,r,i,u,d||null,f,l):n.isText?new Vw(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>X(t)&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>G.empty}}return t}matchesNode(e,t,n){return this.dirty==jw&&e.eq(this.node)&&Zw(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new $w(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;nT(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?Ty.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(f=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Nw)&&(a&&this.protectLocalComposition(e,a),Ww(this.contentDOM,this.children,e),qC&&rT(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof J)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=iT(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new Lw(this,i,t,r);e.input.compositionNodes.push(a),this.children=aT(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Pw||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=jw}updateOuterDeco(e){if(Zw(e,this.outerDeco))return;let t=!X(this.nodeDOM),n=this.dom;this.dom=Jw(this.dom,this.nodeDOM,qw(this.outerDeco,this.node,t),qw(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){X(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){X(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Bw(e,t,n,r,i){Xw(r,t,e);let a=new zw(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var Vw=class e extends zw{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Pw||this.dirty!=jw&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=jw||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=jw,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Pw)}get domAtom(){return!1}isText(e){return this.node.text==e}},Hw=class extends Fw{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==jw&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Uw=class extends zw{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==Pw)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Ww(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Qw(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Rw){let t=r?r.previousSibling:e.lastChild;Ww(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Qw(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Gw=function(e){e&&(this.nodeName=e)};Gw.prototype=Object.create(null);var Kw=[new Gw];function qw(e,t,n){if(e.length==0)return Kw;let r=n?Kw[0]:new Gw,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new Gw(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Gw(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function Jw(e,t,n,r){if(n==Kw&&r==Kw)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Kw[0],i=t)}Yw(i,o||Kw[0],a)}return i}function Yw(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Xw(e,t,n){return Jw(e,e,Kw,qw(t,n,!X(e)))}function Zw(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Qw(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var $w=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=eT(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=jw,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof Rw&&t.dirty!=Pw&&t.mark.type==e[a].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[a])&&(t.mark=e[a],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Rw.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Pw&&a.dom==a.contentDOM&&(a.dirty=Nw),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof zw){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Pw&&Zw(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Nw,u.updateChildren(r,a+1),u.dirty=jw),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Zw(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=zw.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=zw.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Iw(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Rw;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Vw)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((KC||WC)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new Hw(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||X(e)&&e.contains(this.lock.parentNode))}};function eT(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Rw)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function tT(e,t){return e.type.side-t.type.side}function nT(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u){if(d){d.sort(tT);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c)}let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function rT(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function iT(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function aT(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function oT(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(AC(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&Y.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&OC(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Y(o==e?s:r.resolve(e))}else if(HC&&t==`key`&&o>e.state.selection.to&&X(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=q.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!X(e.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=_T(e,u,s,n)}return l}function sT(e){return e.editable?e.hasFocus():yT(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function cT(e,t=!1){let n=e.state.selection;if(hT(e,n),!sT(e))return;let r=e.input.mouseDown;if(!t&&WC&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&bC(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)mT(e);else{let{anchor:r,head:i}=n,a,o;lT&&!(n instanceof J)&&(n.$from.parent.inlineContent||(a=uT(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=uT(e,n.to))),e.docView.setSelection(r,i,e,t),lT&&(a&&fT(a),o&&fT(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&pT(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var lT=KC||WC&&GC<63;function uT(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(KC&&i&&i.contentEditable==`false`)return dT(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return dT(i);if(a)return dT(a)}}function dT(e){return e.contentEditable=`true`,KC&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function fT(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function pT(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!sT(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function mT(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,hC(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&BC&&VC<=11&&(n.disabled=!0,n.disabled=!1)}function hT(e,t){if(t instanceof Y){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(gT(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else gT(e)}function gT(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function _T(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||J.between(t,n,r)}function vT(e){return e.editable&&!e.hasFocus()?!1:yT(e)}function yT(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return TC(e.dom,t.anchorNode)&&(e.editable||TC(e.dom,t.focusNode))}catch{return!1}}function bT(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return bC(t.node,t.offset,n.anchorNode,n.anchorOffset)}function xT(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&q.findFrom(a,t)}function ST(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function CT(e,t,n){let r=e.state.selection;if(r instanceof J){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return ST(e,new J(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=xT(e.state,t);return n&&n instanceof Y?ST(e,n):!1}if(!(JC&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?Y.isSelectable(i)?ST(e,new Y(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):ST(e,new J(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof Y&&r.node.isInline)return ST(e,new J(t>0?r.$to:r.$from));else{let n=xT(e.state,t);return n?ST(e,n):!1}}function wT(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):X(e)&&e.contentEditable==`false`}function TT(e,t){return t<0?ET(e):DT(e)}function ET(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(HC&&X(n)&&r<CC(n)&&wT(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!X(n))break;let e=n.childNodes[r-1];if(wT(e,-1))i=n,a=--r;else if(wC(e))n=e,r=n.nodeValue.length;else break}else if(OT(n))break;else{let t=n.previousSibling;for(;t&&wT(t,-1);)i=n.parentNode,a=hC(t),t=t.previousSibling;if(t)n=t,r=CC(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?jT(e,n,r):i&&jT(e,i,a)}function DT(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=CC(n),a,o;for(;;)if(r<i){if(!X(n))break;let e=n.childNodes[r];if(wT(e,1))a=n,o=++r;else break}else if(OT(n))break;else{let t=n.nextSibling;for(;t&&wT(t,1);)a=t.parentNode,o=hC(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=CC(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&jT(e,a,o)}function OT(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function kT(e,t){for(;e&&t==e.childNodes.length&&!kC(e);)t=hC(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(wC(n))return n;if(X(n)&&n.contentEditable==`false`)break;e=n,t=0}}function AT(e,t){for(;e&&!t&&!kC(e);)t=hC(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(wC(n))return n;if(X(n)&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function jT(e,t,n){if(!wC(t)){let e,r;(r=kT(t,n))?(t=r,n=0):(e=AT(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(AC(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&cT(e)},50)}function MT(e,t){let n=e.state.doc.resolve(t);if(!(WC||YC)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function NT(e,t,n){let r=e.state.selection;if(r instanceof J&&!r.empty||n.indexOf(`s`)>-1||JC&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=xT(e.state,t);if(n&&n instanceof Y)return ST(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof sS?q.near(n,t):q.findFrom(n,t);return o?ST(e,o):!1}return!1}function PT(e,t){if(!(e.state.selection instanceof J))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function FT(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function IT(e){if(!KC||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&X(t)&&n==0&&t.firstChild&&X(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;FT(e,n,`true`),setTimeout(()=>FT(e,n,`false`),20)}return!1}function LT(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function RT(e,t){let n=t.keyCode,r=LT(t);if(n==8||JC&&n==72&&r==`c`)return PT(e,-1)||TT(e,-1);if(n==46&&!t.shiftKey||JC&&n==68&&r==`c`)return PT(e,1)||TT(e,1);if(n==13||n==27)return!0;if(n==37||JC&&n==66&&r==`c`){let t=n==37?MT(e,e.state.selection.from)==`ltr`?-1:1:-1;return CT(e,t,r)||TT(e,t)}if(n==39||JC&&n==70&&r==`c`){let t=n==39?MT(e,e.state.selection.from)==`ltr`?1:-1:1;return CT(e,t,r)||TT(e,t)}return n==38||JC&&n==80&&r==`c`?NT(e,-1,r)||TT(e,-1):n==40||JC&&n==78&&r==`c`?IT(e)||NT(e,1,r)||TT(e,1):!(r!=(JC?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function zT(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Pb.fromSchema(e.state.schema),s=YT(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&X(l)&&(u=JT[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&X(l)&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
||
|
||
`),slice:t}}function BT(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new K(G.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
||
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Pb.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=QT(n),ZC&&$T(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&!X(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||bb.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!VT.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=eE(qT(s,+u[1],+u[2]),u[4]);else if(s=K.maxOpen(HT(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=qT(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var VT=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function HT(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&WT(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=GT(a[a.length-1],i.length));let n=UT(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return G.from(a)}return e}function UT(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,G.from(e));return e}function WT(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=WT(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(G.from(UT(n,e,i+1))))}}function GT(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,GT(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(G.empty,!0);return e.copy(n.append(r))}function KT(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=KT(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(G.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function qT(e,t,n){return t<e.openStart&&(e=new K(KT(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new K(KT(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var JT={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function YT(){return document.implementation.createHTMLDocument(`title`)}var XT=null;function ZT(e){let t=window.trustedTypes;if(!t)return e;if(!XT){if(XT=t.defaultPolicy)try{return XT.createHTML(e)}catch{}XT=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return XT.createHTML(e)}function QT(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=YT(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&JT[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=ZT(e),a)for(let e=0;e<a.length;e++)r=r.querySelector(a[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}function $T(e){let t=e.querySelectorAll(WC?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function eE(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=G.from(t.create(r[e+1],i))}catch{break}a++,o++}return new K(i,a,o)}var tE={},nE={},rE={touchstart:!0,touchmove:!0},iE=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function aE(e){for(let t in tE){let n=tE[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{uE(e,t)&&!lE(e,t)&&(e.editable||!(t.type in nE))&&n(e,t)},rE[t]?{passive:!0}:void 0)}KC&&e.dom.addEventListener(`input`,()=>null),cE(e)}function oE(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function sE(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function cE(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>lE(e,t))})}function lE(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function uE(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function dE(e,t){!lE(e,t)&&tE[t.type]&&(e.editable||!(t.type in nE))&&tE[t.type](e,t)}nE.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!OE(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(XC&&WC&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),qC&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,jC(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||RT(e,n)?n.preventDefault():oE(e,`key`)}},nE.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},nE.keypress=(e,t)=>{let n=t;if(OE(e)||!n.charCode||n.ctrlKey&&!n.altKey||JC&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof J)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function fE(e){return{left:e.clientX,top:e.clientY}}function pE(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function mE(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function hE(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function gE(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(hE(e,new Y(n)),!0):!1}function _E(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Y&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(Y.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(hE(e,Y.create(e.state.doc,i)),!0)}function vE(e,t,n,r,i){return mE(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?_E(e,n):gE(e,n))}function yE(e,t,n,r){return mE(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function bE(e,t,n,r){return mE(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||xE(e,n,r)}function xE(e,t,n){if(n.button!=0)return!1;let r=SE(e,t,!0),i=e.state.doc;return r?(hE(e,r),r instanceof J&&i.eq(e.state.doc)&&(e.input.mouseDown=new DE(e,r)),!0):!1}function SE(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?J.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return J.create(r,a+1,a+1+t.content.size);if(n&&Y.isSelectable(t))return Y.create(r,a)}return null}function CE(e){return PE(e)}var wE=JC?`metaKey`:`ctrlKey`;tE.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=CE(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&pE(n,e.input.lastClick)&&!n[wE]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(fE(n));o&&(a==`singleClick`?e.input.mouseDown=new EE(e,o,n,!!r):(a==`doubleClick`?yE:bE)(e,o.pos,o.inside,n)?n.preventDefault():oE(e,`pointer`))};var TE=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},EE=class extends TE{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[wE],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&X(s.nodeDOM)?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Y&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&HC&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),oE(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||cT(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(fE(e))),this.updateAllowDefault(e),this.allowDefault||!t?oE(this.view,`pointer`):vE(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||KC&&this.mightDrag&&!this.mightDrag.node.isAtom||WC&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(hE(this.view,q.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):oE(this.view,`pointer`)}move(e){this.updateAllowDefault(e),oE(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},DE=class extends TE{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),oE(this.view,`pointer`);let t=this.view.posAtCoords(fE(e)),n=t&&SE(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];hE(this.view,J.create(r,a,o))}};tE.touchstart=e=>{e.input.lastTouch=Date.now(),CE(e),oE(e,`pointer`)},tE.touchmove=e=>{e.input.lastTouch=Date.now(),oE(e,`pointer`)},tE.contextmenu=e=>CE(e);function OE(e,t){return e.composing?!0:KC&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var kE=XC?5e3:-1;nE.compositionstart=nE.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof J&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||WC&&YC&&AE(e)))e.markCursor=e.state.storedMarks||n.marks(),PE(e,!0),e.markCursor=null;else if(PE(e,!t.selection.empty),HC&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&X(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(wC(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}jE(e,kE)};function AE(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!X(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return X(r)&&r.contentEditable==`false`}nE.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,jE(e,20))};function jE(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>PE(e),t))}function ME(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function NE(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=EC(t.focusNode,t.focusOffset),r=DC(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function PE(e,t=!1){if(!(XC&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ME(e),t||e.docView&&e.docView.dirty){let n=oT(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function FE(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var IE=BC&&VC<15||qC&&QC<604;tE.copy=nE.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=IE?null:n.clipboardData,{dom:o,text:s}=zT(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):FE(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function LE(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function RE(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?zE(e,r.value,null,i,t):zE(e,r.textContent,r.innerHTML,i,t)},50)}function zE(e,t,n,r,i){let a=BT(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||K.empty)))return!0;if(!a)return!1;let o=LE(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function BE(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}nE.paste=(e,t)=>{let n=t;if(e.composing&&!XC)return;let r=IE?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&zE(e,BE(r),r.getData(`text/html`),i,n)?n.preventDefault():RE(e,n)};var VE=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},HE=JC?`altKey`:`ctrlKey`;function UE(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[HE]:!n}tE.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(fE(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)o=Y.create(e.state.doc,r.mightDrag.pos);else if(n.target&&X(n.target)){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Y.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=zT(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!WC||GC>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(IE?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,IE||n.dataTransfer.setData(`text/plain`,c),e.dragging=new VE(l,UE(e,n),o)},tE.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},nE.dragover=nE.dragenter=(e,t)=>t.preventDefault(),nE.drop=(e,t)=>{try{WE(e,t,e.dragging)}finally{e.dragging=null}};function WE(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(fE(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=BT(e,BE(t.dataTransfer),IE?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&UE(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||K.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Px(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&Y.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Y(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(_T(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}tE.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&cT(e)},20))},tE.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},tE.beforeinput=(e,t)=>{if(XC&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,jC(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in nE)tE[e]=nE[e];function GE(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var KE=class e{constructor(e,t){this.toDOM=e,this.spec=t||ZE,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new YE(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&GE(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},qE=class e{constructor(e,t){this.attrs=e,this.spec=t||ZE}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new YE(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&GE(this.attrs,t.attrs)&&GE(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},JE=class e{constructor(e,t){this.attrs=e,this.spec=t||ZE}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new YE(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&GE(this.attrs,t.attrs)&&GE(this.spec,t.spec)}destroy(){}},YE=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new KE(n,r))}static inline(t,n,r,i){return new e(t,n,new qE(r,i))}static node(t,n,r,i){return new e(t,n,new JE(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof qE}get widget(){return this.type instanceof KE}},XE=[],ZE={},QE=class e{constructor(e,t){this.local=e.length?e:XE,this.children=t.length?t:XE}static create(e,t){return t.length?oD(t,e,0,ZE):$E}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==$E||e.maps.length==0?this:this.mapInner(e,t,0,0,n||ZE)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?tD(this.children,o||[],t,n,r,i,a):o?new e(o.sort(sD),XE):$E}add(t,n){return n.length?this==$E?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=iD(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,oD(s,e,o+1,ZE)),a+=3}});let o=nD(a?aD(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(sD):this.local,i||this.children)}remove(e){return e.length==0||this==$E?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==$E?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):$E}forChild(t,n){if(this==$E)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof qE){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(sD),XE);return r?new eD([t,r]):t}return r||$E}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return cD(this.localsInner(e))}localsInner(e){if(this==$E)return XE;if(e.inlineContent||!this.local.some(qE.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof qE||t.push(this.local[e]);return t}forEachSet(e){e(this)}};QE.empty=new QE([],[]),QE.removeOverlap=cD;var $E=QE.empty,eD=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,ZE));return e.from(r)}forChild(t,n){if(n.isLeaf)return QE.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=$E&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}}return t?cD(n?t:t.sort(sD)):XE}static from(t){switch(t.length){case 0:return $E;case 1:return t[0];default:return new e(t.every(e=>e instanceof QE)?t:t.reduce((e,t)=>e.concat(t instanceof QE?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function tD(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==$E?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=oD(rD(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new QE(t.sort(sD),s)}function nD(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new YE(i.from+t,i.to+t,i.type))}return n}function rD(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function iD(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function aD(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function oD(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=iD(e,t,o+n);if(s){a=!0;let e=oD(s,t,n+o+1,r);e!=$E&&i.push(o,o+t.nodeSize,e)}});let o=nD(a?aD(e):e,-n).sort(sD);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new QE(o,i):$E}function sD(e,t){return e.from-t.from||e.to-t.to}function cD(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),lD(t,i+1,a.copy(r.to,a.to)));continue}a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),lD(t,i,r.copy(a.from,r.to)));break}}return t}function lD(e,t,n){for(;t<e.length&&sD(n,e[t])>0;)t++;e.splice(t,0,n)}function uD(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=$E&&t.push(r)}),e.cursorWrapper&&t.push(QE.create(e.state.doc,[e.cursorWrapper.deco])),eD.from(t)}var dD={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},fD=BC&&VC<=11,pD=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},mD=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new pD,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);BC&&VC<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():KC&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),fD&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,dD)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(vT(this.view)){if(this.suppressingSelectionUpdates)return cT(this.view);if(BC&&VC<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&bC(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=gC(n))t.add(n);for(let r=e.anchorNode;r;r=gC(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:wC(n)?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&vT(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||WC&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&X(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(HC&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||bD(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&AC(n)&&(c=oT(e))&&c.eq(q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,cT(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),_D(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,xD(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||cT(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),wC(r)&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(BC&&VC<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?hC(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?hC(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},hD=new WeakMap,gD=!1;function _D(e){if(!hD.has(e)&&(hD.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=HC,gD)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),gD=!0}}function vD(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return bC(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function yD(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return vD(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?vD(e,n):null}function bD(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function xD(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||!X(e)||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function SD(e,t,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&TC(e.dom,d)&&(u=[{node:d,offset:l.anchorOffset}],AC(l)||u.push({node:l.focusNode,offset:l.focusOffset})),WC&&e.input.lastKeyCode===8)for(let e=o;e>a;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||bb.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:CD(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var CD=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(KC&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(t.parentNode.lastChild==t||KC&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},wD=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function TD(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=oT(e,t);if(n&&!e.state.selection.eq(n)){if(WC&&XC&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,jC(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=SD(e,t,n,i),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=jD(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(qC&&e.input.lastIOSEnter>Date.now()-225||XC)&&i.some(e=>X(e)&&!wD.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,jC(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof J&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=ED(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof J&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),BC&&VC<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((qC&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&kD(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,jC(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&OD(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,jC(8,`Backspace`)))){XC&&WC&&e.domObserver.suppressSelectionUpdates();return}WC&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),XC&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,jC(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=ED(e,n.doc,l.sel);t&&!(WC&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||BC&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){BC&&VC<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>cT(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=DD(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x())}else e.dispatch(x())}function ED(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:_T(e,t.resolve(n.anchor),t.resolve(n.head))}function DD(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(G.from(l).eq(e))return{mark:s,type:o}}function OD(e,t,n,r,i){if(n-t<=i.pos-r.pos||AD(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(AD(a,!0,!0));return!o.parent.isTextblock||o.pos>n||AD(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function kD(e,t,n){let r=0,i=0;return e.nodesBetween(t,n,(e,a)=>{e.isTextblock&&a>=t&&a<n?r++:(e.isText?/\S/.test(e.text.slice(Math.max(0,t-a),Math.min(e.nodeSize,n-a))):e.isLeaf)&&i++}),i==0&&r==1}function AD(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function jD(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var MD=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new iE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(zD),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=FD(this),PD(this),this.nodeViews=LD(this),this.docView=Bw(this.state.doc,ND(this),uD(this),this.dom,this),this.domObserver=new mD(this,(e,t,n,r)=>TD(this,e,t,n,r)),this.domObserver.start(),aE(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&cE(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(zD),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(ME(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=LD(this);RD(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&cE(this),this.editable=FD(this),PD(this);let o=uD(this),s=ND(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&rw(this);if(i){this.domObserver.stop();let t=l&&(BC||WC)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&ID(n.selection,e.selection);if(l){let n=WC?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=NE(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Bw(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&bT(this)&&i.delaySelUpdate())?cT(this,t):(hT(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&aw(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&TC(this.dom,e)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof Y){let t=this.docView.domAfterPos(this.state.selection.from);X(t)&&nw(this,t.getBoundingClientRect(),e)}else nw(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new VE(e.slice,e.move,r<0?void 0:Y.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(BC){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&cw(this.dom),cT(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return gw(this,e)}coordsAtPos(e,t=1){return bw(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Aw(this,t||this.state,e)}pasteHTML(e,t){return zE(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return zE(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return zT(this,e)}destroy(){this.docView&&(sE(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],uD(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,yC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return dE(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?KC&&this.root.nodeType===11&&MC(this.dom.ownerDocument)==this.dom&&yD(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};MD.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function ND(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[YE.node(0,e.state.doc.content.size,t)]}function PD(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:YE.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function FD(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function ID(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function LD(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function RD(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function zD(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var BD={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},VD={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},HD=typeof navigator<`u`&&/Mac/.test(navigator.platform),UD=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),WD=0;WD<10;WD++)BD[48+WD]=BD[96+WD]=String(WD);for(var WD=1;WD<=24;WD++)BD[WD+111]=`F`+WD;for(var WD=65;WD<=90;WD++)BD[WD]=String.fromCharCode(WD+32),VD[WD]=String.fromCharCode(WD);for(var GD in BD)VD.hasOwnProperty(GD)||(VD[GD]=BD[GD]);function KD(e){var t=!(HD&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||UD&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?VD:BD)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var qD=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),JD=typeof navigator<`u`&&/Win/.test(navigator.platform);function YD(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))qD?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function XD(e){let t=Object.create(null);for(let n in e)t[YD(n)]=e[n];return t}function ZD(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function QD(e){return new xS({props:{handleKeyDown:$D(e)}})}function $D(e){let t=XD(e);return function(e,n){let r=KD(n),i,a=t[ZD(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[ZD(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(JD&&n.ctrlKey&&n.altKey)&&(i=BD[n.keyCode])&&i!=r){let r=t[ZD(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}function eO(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var tO=class e{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:eO({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},nO=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),rO=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),iO=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=mx(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},aO=e=>t=>e(t),oO=()=>({state:e,dispatch:t})=>WS(e,t),sO=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new J(r.doc.resolve(Math.max(o-1,0)))),!0},cO=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function lO(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var uO=e=>({tr:t,state:n,dispatch:r})=>{let i=lO(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},dO=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},fO=e=>e.content?/^text(\*|\+)/.test(e.content):!1,pO=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return fO(r)?n===`left`?e.start()-1:e.end()+1:e.pos},mO=(e,t,n)=>({from:pO(e,n,`left`),to:pO(t,n,`right`)}),hO=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=mO(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(J.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},gO=()=>({commands:e})=>e.keyboardShortcut(`Enter`),_O=()=>({state:e,dispatch:t})=>US(e,t);function vO(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function yO(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:vO(t[r])?t[r].test(e[r]):t[r]===e[r])}function bO(e,t,n={}){return e.find(e=>e.type===t&&yO(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function xO(e,t,n={}){return!!bO(e,t,n)}function SO(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!bO([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&xO([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&xO([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function CO(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var wO=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=CO(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=SO(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=J.create(o,e.from,e.to);n.setSelection(t)}}return!0},TO=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function EO(e){return e instanceof J}function DO(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function OO(e,t=null){if(!t)return null;let n=q.atStart(e),r=q.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?J.create(e,DO(0,i,a),DO(e.content.size,i,a)):J.create(e,DO(t,i,a),DO(t,i,a))}function kO(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function AO(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function jO(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var MO=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(AO()||kO())&&r.dom.focus(),jO()&&!AO()&&!kO()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!EO(n.state.selection))return o(),!0;let s=OO(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},NO=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),PO=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),FO=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&FO(r)}return e};function IO(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return FO(n)}function LO(e){return typeof e?.nodesBetween==`function`}function RO(e,t,n){if(LO(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return G.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),RO(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new gb({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?bb.fromSchema(a).parseSlice(IO(e),n.parseOptions):bb.fromSchema(a).parse(IO(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=bb.fromSchema(t);return n.slice?r.parseSlice(IO(e),n.parseOptions).content:r.parse(IO(e),n.parseOptions)}return RO(``,t,n)}function zO(e){return!(`type`in e)}function BO(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof sx||i instanceof cx))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(q.near(e.doc.resolve(o),n))}var VO=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{RO(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=RO(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=zO(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):LO(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=G.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&BO(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function HO(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var UO=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=HO(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=RO(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&BO(t,t.steps.length-1,-1)),!0):!1},WO=()=>({state:e,dispatch:t})=>RS(e,t),GO=()=>({state:e,dispatch:t})=>zS(e,t),KO=()=>({state:e,dispatch:t})=>DS(e,t),qO=()=>({state:e,dispatch:t})=>FS(e,t),JO=()=>({state:e,dispatch:t,tr:n})=>{try{let r=jx(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},YO=()=>({state:e,dispatch:t,tr:n})=>{try{let r=jx(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},XO=()=>({state:e,dispatch:t})=>OS(e,t),ZO=()=>({state:e,dispatch:t})=>kS(e,t);function QO(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function $O(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))AO()||QO()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var ek=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=$O(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function tk(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?lO(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>yO(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var nk=(e,t={})=>({state:n,dispatch:r})=>tk(n,lO(e,n.schema),t)?BS(n,r):!1,rk=()=>({state:e,dispatch:t})=>GS(e,t),ik=e=>({state:t,dispatch:n})=>dC(lO(e,t.schema))(t,n),ak=()=>({state:e,dispatch:t})=>VS(e,t);function ok(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function sk(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var ck=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=ok(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=lO(e,r.schema)),s===`mark`&&(o=CO(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,sk(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(sk(a.attrs,t))))})})}),c},lk=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),uk=()=>({tr:e,dispatch:t})=>{if(t){let t=new sS(e.doc);e.setSelection(t)}return!0},dk=()=>({state:e,dispatch:t})=>MS(e,t),fk=()=>({state:e,dispatch:t})=>IS(e,t),pk=()=>({state:e,dispatch:t})=>JS(e,t),mk=()=>({state:e,dispatch:t})=>eC(e,t),hk=()=>({state:e,dispatch:t})=>$S(e,t);function gk(e,t,n={},r={}){return RO(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var _k=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=gk(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=zO(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function vk(e,t){let n=CO(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function yk(e,t){let n=new eS(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function bk(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function xk(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Sk(e){return t=>xk(t.$from,e)}function Z(e,t,n){return e.config[t]===void 0&&e.parent?Z(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?Z(e.parent,t,n):null}):e.config[t]}function Ck(e){return e.map(e=>{let t=Z(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...Ck(t())]:e}).flat(10)}function wk(e,t){let n=Pb.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function Tk(e){return typeof e==`function`}function Ek(e,t=void 0,...n){return Tk(e)?t?e.bind(t)(...n):e(...n):e}function Dk(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Ok(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function kk(e){let t=[],{nodeExtensions:n,markExtensions:r}=Ok(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=Z(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=Z(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Ak(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function jk(e){let t=[],n=Ak(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function Mk(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...jk(n[e]),...jk(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function Nk(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Mk(e,t),{})}function Pk(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function Fk(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Pk(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Ik(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Dk(t)?!1:t!=null))}function Lk(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function Rk(e,t){let n=kk(e),{nodeExtensions:r,markExtensions:i}=Ok(e),a=r.find(e=>Z(e,`topNode`))?.name;return new gb({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Ik({...e.reduce((e,t)=>{let n=Z(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:Ek(Z(r,`content`,a)),marks:Ek(Z(r,`marks`,a)),group:Ek(Z(r,`group`,a)),inline:Ek(Z(r,`inline`,a)),atom:Ek(Z(r,`atom`,a)),selectable:Ek(Z(r,`selectable`,a)),draggable:Ek(Z(r,`draggable`,a)),code:Ek(Z(r,`code`,a)),whitespace:Ek(Z(r,`whitespace`,a)),linebreakReplacement:Ek(Z(r,`linebreakReplacement`,a)),defining:Ek(Z(r,`defining`,a)),isolating:Ek(Z(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Lk))}),s=Ek(Z(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Fk(e,i)));let c=Z(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:Nk(e,i)}));let l=Z(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Ik({...e.reduce((e,t)=>{let n=Z(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:Ek(Z(r,`inclusive`,a)),excludes:Ek(Z(r,`excludes`,a)),group:Ek(Z(r,`group`,a)),spanning:Ek(Z(r,`spanning`,a)),code:Ek(Z(r,`code`,a)),attrs:Object.fromEntries(i.map(Lk))}),s=Ek(Z(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Fk(e,i)));let c=Z(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:Nk(e,i)})),[r.name,o]}))})}function zk(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Bk(e){return e.sort((e,t)=>{let n=Z(e,`priority`)||100,r=Z(t,`priority`)||100;return n>r?-1:+(n<r)})}function Vk(e){let t=Bk(Ck(e)),n=zk(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Hk(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
||
|
||
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function Uk(e,t){return Hk(e,{from:0,to:e.content.size},t)}function Wk(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Gk(e,t){let n=lO(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Kk(e,t){let n=ok(typeof t==`string`?t:t.name,e.schema);return n===`node`?Gk(e,t):n===`mark`?vk(e,t):{}}function qk(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Jk(e){let t=qk(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Yk(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Jk(r)}function Xk(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=SO(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&e?.nodeSize!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Zk=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},Qk=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function $k(e,t){return t.nodes[e]||t.marks[e]||null}function eA(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var tA=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function nA(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?CO(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>yO(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>yO(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function rA(e,t,n={}){if(!t)return tk(e,null,n)||nA(e,null,n);let r=ok(t,e.schema);return r===`node`?tk(e,t,n):r===`mark`&&nA(e,t,n)}var iA=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=Sk(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},aA=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function oA(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function sA(e,t){let{nodeExtensions:n}=Ok(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=Ek(Z(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function cA(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(cA(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function lA(e){return e instanceof Y}var uA=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function dA(e,t){let n=t.mapping.mapResult(e.position);return{position:new uA(n.pos),mapResult:n}}function fA(e){return new uA(e)}function pA(e,t,n){let{selection:r}=t,i=null;if(EO(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var mA=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=CO(e,r.schema);if(i){if(o){let e=vk(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return pA(r,n,c)},hA=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),gA=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=lO(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>nC(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>nC(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},_A=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=DO(e,0,n.content.size),i=Y.create(n,r);t.setSelection(i)}return!0},vA=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},yA=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=J.atStart(n).from,o=J.atEnd(n).to,s=DO(r,a,o),c=DO(i,a,o),l=J.create(n,s,c);t.setSelection(l)}return!0},bA=e=>({state:t,dispatch:n})=>mC(lO(e,t.schema))(t,n);function xA(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var SA=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=eA(l,s.node().type.name,s.node().attrs);if(a instanceof Y&&a.node.isBlock)return!s.parentOffset||!Ex(o,s.pos)?!1:(r&&(e&&xA(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:HO(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Ex(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Ex(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof J&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&xA(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},CA=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=lO(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=G.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=G.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...eA(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(G.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new K(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(J.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...eA(d,u.type.name,u.attrs),...t},m={...eA(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!Ex(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function wA(e){return!e||e===`1`?null:e}function TA(e,t){return wA(e)===wA(t)}var EA=(e,t)=>{let n=Sk(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&Ox(e.doc,n.pos))||!TA(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},DA=(e,t)=>{let n=Sk(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&Ox(e.doc,r))||!TA(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function OA(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return J.between(r,i)}var kA=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=lO(e,o.schema),m=lO(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=Sk(e=>sA(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&sA(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,ee=!!x&&y.depth>=1&&y.depth-x.depth<=1,D=!!T;if((ee||D)&&E){if(E.node.type===p)return S&&D?c().command(({tr:e,dispatch:t})=>{let n=OA(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(sA(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>EA(a,p)).command(()=>DA(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>EA(a,p)).command(()=>DA(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>EA(a,p)).command(()=>DA(a,p)).run()},AA=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=CO(e,r.schema);return nA(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},jA=(e,t,n={})=>({state:r,commands:i})=>{let a=lO(e,r.schema),o=lO(t,r.schema),s=tk(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},MA=(e,t={})=>({state:n,commands:r})=>{let i=lO(e,n.schema);return tk(n,i,t)?r.lift(i):r.wrapIn(i,t)},NA=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},PA=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},FA=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=CO(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=SO(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},IA=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},LA=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=ok(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=lO(e,r.schema)),s===`mark`&&(o=CO(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},RA=new wS(`__tiptap_decorations__`),zA=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(RA,{type:`force`,name:e}),!0),BA=(e,t={})=>({state:n,dispatch:r})=>tC(lO(e,n.schema),t)(n,r),VA=(e,t={})=>({state:n,dispatch:r})=>cC(lO(e,n.schema),t)(n,r),HA=gy({blur:()=>nO,clearContent:()=>rO,clearNodes:()=>iO,command:()=>aO,createParagraphNear:()=>oO,cut:()=>sO,deleteCurrentNode:()=>cO,deleteNode:()=>uO,deleteRange:()=>dO,deleteSelection:()=>hO,enter:()=>gO,exitCode:()=>_O,extendMarkRange:()=>wO,first:()=>TO,focus:()=>MO,forEach:()=>NO,insertContent:()=>PO,insertContentAt:()=>VO,insertDefaultBlock:()=>UO,joinBackward:()=>KO,joinDown:()=>GO,joinForward:()=>qO,joinItemBackward:()=>JO,joinItemForward:()=>YO,joinTextblockBackward:()=>XO,joinTextblockForward:()=>ZO,joinUp:()=>WO,keyboardShortcut:()=>ek,lift:()=>nk,liftEmptyBlock:()=>rk,liftListItem:()=>ik,newlineInCode:()=>ak,resetAttributes:()=>ck,scrollIntoView:()=>lk,selectAll:()=>uk,selectNodeBackward:()=>dk,selectNodeForward:()=>fk,selectParentNode:()=>pk,selectTextblockEnd:()=>mk,selectTextblockStart:()=>hk,setContent:()=>_k,setMark:()=>mA,setMeta:()=>hA,setNode:()=>gA,setNodeSelection:()=>_A,setTextDirection:()=>vA,setTextSelection:()=>yA,sinkListItem:()=>bA,splitBlock:()=>SA,splitListItem:()=>CA,toggleList:()=>kA,toggleMark:()=>AA,toggleNode:()=>jA,toggleWrap:()=>MA,undoInputRule:()=>NA,unsetAllMarks:()=>PA,unsetMark:()=>FA,unsetTextDirection:()=>IA,updateAttributes:()=>LA,updateDecorations:()=>zA,wrapIn:()=>BA,wrapInList:()=>VA}),UA=new WeakMap;function WA(e,t){UA.set(e,(UA.get(e)??0)+1);try{return t()}finally{let t=(UA.get(e)??1)-1;t>0?UA.set(e,t):UA.delete(e)}}function GA(e){return UA.has(e)}var KA=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},qA=typeof process<`u`&&!1;function JA(e){return e.kind===`widget`}function YA(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&JA(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function XA(e,t,n){let{decorations:r,widgetKeys:i}=YA(t,n);return{set:QE.create(e,r),widgetKeys:i}}function ZA({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function QA({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>ZA({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function $A(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function ej(e){let t=new Map,n=new Map;for(let r of e.find()){let e=$A(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function tj(e){return e.jsonID===`attr`}function nj(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||tj(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function rj(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function ij(e,t){if(e.steps.some(e=>!nj(e)))return{type:`full`};let n=Yk(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!tj(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=rj(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function aj(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function oj(e,t,n){let r=t.decorationSetsByExtension[e]??QE.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:aj(r,n.mapping,n.doc,i),widgetKeys:i}}function sj(e,t){let n=Object.values(t).flatMap(e=>e.find());return QE.create(e,n)}function cj(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function lj(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function uj(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var dj=new Set,fj=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=RA.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>lj(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return RA.getState(this.editor.state)?.widgetKeys??dj}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new xS({key:RA,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:cj(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(RA),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return WA(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!uj(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=oj(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:cj(u)}}},props:{decorations(e){return RA.getState(e)?.mergedDecorationSet??QE.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=ij(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??QE.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=aj(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>ZA({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=$A(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=YA(QA({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return XA(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!qA)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=ej(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:sj(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):sj(n.doc,r)}};function pj(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof Y){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function mj(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function hj(e){return typeof e==`number`}function gj(e){return Object.prototype.toString.call(e).slice(8,-1)}function _j(e){return gj(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function vj(e,t,n){let r=e.split(`
|
||
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],u=e.match(t.itemPattern);if(!u){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o<r.length;){var c;let e=r[o];if(e.trim()===``){var l;let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(`
|
||
`);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var yj=4;function bj(e){let t=0;for(let n of e)t=n===` `?t+yj-t%yj:t+1;return t}function xj(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=bj(a);return(bj(n)>=r?n:` `.repeat(r))+e},o=r.split(`
|
||
`).map(e=>n(e||``)).join(`
|
||
`);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function Sj(e,t){let n={...e};return _j(e)&&_j(t)&&Object.keys(t).forEach(r=>{_j(t[r])&&_j(e[r])?n[r]=Sj(e[r],t[r]):n[r]=t[r]}),n}function Cj(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var wj=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Tj=(e,t)=>{if(vO(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function Ej(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=tA(c)+i;return a.forEach(e=>{if(l)return;let a=Tj(u,e.find);if(!a)return;let d=a[0].length-i.length;if(d>0){let e=c.parentOffset-d;if(e<0||c.parent.textBetween(e,c.parentOffset)!==a[0].slice(0,d))return}let f=s.state.tr,p=eO({state:s.state,transaction:f}),m={from:n-(a[0].length-i.length),to:r},{commands:h,chain:g,can:_}=new tO({editor:t,state:p});e.handler({state:p,range:m,match:a,commands:h,chain:g,can:_})!==null&&f.steps.length&&(e.undoable&&f.setMeta(o,{transform:f,from:n,to:r,text:i}),s.dispatch(f),l=!0)}),l}function Dj(e){let{editor:t,rules:n}=e,r=new xS({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:wk(G.from(e),a.schema);let{from:i}=s,o=i+e.length;Ej({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return Ej({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Ej({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?Ej({editor:t,from:a.pos,to:a.pos,text:`
|
||
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Oj=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Ek(Z(this,`addOptions`,{name:this.name}))}}get storage(){return{...Ek(Z(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Sj(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},kj=class e extends Oj{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Aj=class{constructor(e){this.find=e.find,this.handler=e.handler}},jj=(e,t,n)=>{if(vO(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Mj(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new tO({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||jj(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Nj=null,Pj=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Fj(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=eO({state:e,transaction:c});if(Mj({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})&&c.steps.length){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new xS({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Nj=t)},i=()=>{Nj&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Nj;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:wk(G.from(t),r.schema);let{from:n}=d,i=n+t.length,a=Pj(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(hj(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Ij=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=Vk(e),this.schema=Rk(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=Z(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:$k(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=Bk([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:$k(t.name,this.schema)},r=[],i=Z(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&Z(t,`exitable`,n)&&(a.ArrowRight=()=>kj.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=QD(a);r.push(o);let s=Z(t,`addInputRules`,n);if(oA(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Dj({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=Z(t,`addPasteRules`,n);if(oA(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Fj({editor:e,rules:t});r.push(...n)}}let l=Z(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=Z(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:$k(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new fj({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return kk(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=Ok(this.extensions);return Object.fromEntries(t.filter(e=>!!Z(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Z(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:lO(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=Nk(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return Bk([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:$k(n.name,this.schema)},i=Z(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return Bk([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:$k(n.name,this.schema)},i=Z(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=Ok(this.extensions);return Object.fromEntries(t.filter(e=>!!Z(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Z(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:CO(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=Nk(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Cj(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:$k(e.name,this.schema)};e.type===`mark`&&((Ek(Z(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(Ek(Z(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=Z(e,`onBeforeCreate`,t),r=Z(e,`onCreate`,t),i=Z(e,`onUpdate`,t),a=Z(e,`onSelectionUpdate`,t),o=Z(e,`onTransaction`,t),s=Z(e,`onFocus`,t),c=Z(e,`onBlur`,t),l=Z(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Ij.resolve=Vk,Ij.sort=Bk,Ij.flatten=Ck;var Lj=class e extends Oj{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Rj=Lj.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new xS({key:new wS(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=Wk(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>Hk(r,{from:e.pos,to:t.pos},s)).join(o??`
|
||
|
||
`)}}})]}}),zj=Lj.create({name:`commands`,addCommands(){return{...HA}}}),Bj=Lj.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=yk(e.before,[e,...t]);Yk(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof ix){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),Vj=Lj.create({name:`drop`,addProseMirrorPlugins(){return[new xS({key:new wS(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Hj=Lj.create({name:`editable`,addProseMirrorPlugins(){return[new xS({key:new wS(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),Uj=new wS(`focusEvents`),Wj=Lj.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new xS({key:Uj,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Gj=Lj.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:q.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return AO()||QO()?i:r},addProseMirrorPlugins(){return[new xS({key:new wS(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=q.atStart(t.doc).from,l=q.atEnd(t.doc).to;if(a||o!==c||s!==l||!cA(n.doc))return;let u=n.tr,d=eO({state:n,transaction:u}),{commands:f}=new tO({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),Kj=Lj.create({name:`paste`,addProseMirrorPlugins(){return[new xS({key:new wS(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),qj=Lj.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new xS({key:new wS(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),Jj=Lj.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=Ok(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new xS({key:new wS(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),Yj=!1;function Xj(e){if(Yj)return;Yj=!0;let t;try{t=sx.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof G||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var Zj=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Qj=`.ProseMirror {
|
||
position: relative;
|
||
}
|
||
|
||
.ProseMirror {
|
||
word-wrap: break-word;
|
||
white-space: pre-wrap;
|
||
white-space: break-spaces;
|
||
-webkit-font-variant-ligatures: none;
|
||
font-variant-ligatures: none;
|
||
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
||
}
|
||
|
||
.ProseMirror [contenteditable="false"] {
|
||
white-space: normal;
|
||
}
|
||
|
||
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
||
white-space: pre-wrap;
|
||
}
|
||
|
||
.ProseMirror pre {
|
||
white-space: pre-wrap;
|
||
}
|
||
|
||
img.ProseMirror-separator {
|
||
display: inline !important;
|
||
border: none !important;
|
||
margin: 0 !important;
|
||
width: 0 !important;
|
||
height: 0 !important;
|
||
}
|
||
|
||
.ProseMirror-gapcursor {
|
||
display: none;
|
||
pointer-events: none;
|
||
position: absolute;
|
||
margin: 0;
|
||
}
|
||
|
||
.ProseMirror-gapcursor:after {
|
||
content: "";
|
||
display: block;
|
||
position: absolute;
|
||
top: -2px;
|
||
width: 20px;
|
||
border-top: 1px solid black;
|
||
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
||
}
|
||
|
||
@keyframes ProseMirror-cursor-blink {
|
||
to {
|
||
visibility: hidden;
|
||
}
|
||
}
|
||
|
||
.ProseMirror-hideselection *::selection {
|
||
background: transparent;
|
||
}
|
||
|
||
.ProseMirror-hideselection *::-moz-selection {
|
||
background: transparent;
|
||
}
|
||
|
||
.ProseMirror-hideselection * {
|
||
caret-color: transparent;
|
||
}
|
||
|
||
.ProseMirror-focused .ProseMirror-gapcursor {
|
||
display: block;
|
||
}`,$j=class extends KA{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:dA,createMappablePosition:fA},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=OO(t,this.options.autofocus);this.editorState=yS.create({doc:t,schema:this.schema,selection:e||void 0})}Xj(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():tO.createFakeChain()}can(){return this.commandManager?this.commandManager.can():tO.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=mj(Qj,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return qA&&!this.hasWarnedStaleDecorationRead&&GA(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=Tk(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[Hj,Rj.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),zj,Wj,Gj,qj.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),Vj,Kj,Bj,Jj.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new Ij(n,this)}createCommandManager(){this.commandManager=new tO({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=gk(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=gk(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=yS.create({doc:t,schema:this.schema,selection:OO(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new MD(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Kk(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return rA(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return wk(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
||
|
||
`,textSerializers:n={}}=e||{};return Uk(this.state.doc,{blockSeparator:t,textSerializers:{...Wk(this.schema),...n}})}get isEmpty(){return cA(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new Zj(t,this,!1,n)}get $doc(){return this.$pos(0)}};function eM(e){return new wj({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Ek(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Xk(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function tM(e){return new wj({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Ek(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function nM(e){return new wj({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=Ek(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function rM(e){return new wj({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=Ek(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&gx(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Ox(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var iM=e=>`touches`in e,aM=class{constructor(e){var t;this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e!=null&&(t=e.options)!=null&&t.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,iM(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},oM=class e extends Oj{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function sM(e){return new Aj({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=Ek(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Xk(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}function cM(e){return fe((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var lM=class extends $j{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=cM(this.view.state),this.reactiveExtensionStorage=cM(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),oe(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},uM=A({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let t=I(),n=m();return b(()=>{let r=e.editor;r&&r.options.element&&t.value&&me(()=>{if(!t.value||!r.view.dom?.parentNode)return;let e=_(t.value);t.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:e}),r.createNodeViews()})}),ue(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return o(`div`,{ref:e=>{this.rootEl=e}})}});A({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return o(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),A({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return o(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}});var dM=(e={})=>{let t=_e();return ie(()=>{t.value=new lM(e)}),ue(()=>{var e;(e=t.value)==null||e.destroy()}),t};A({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return o(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}});var fM=new WeakSet,pM=new WeakSet;function mM(e){let t=e;return fM.add(t),t}function hM(e){return Array.isArray(e)&&fM.has(e)}function gM(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&pM.has(e)&&!hM(e)?gM(e):[e])}function _M(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!hM(n)&&!pM.has(n)?mM(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(hM(n))return mM([e,r,n]);if(n.length===0)return mM([e,r]);let t=gM(n);return t.length===0?mM([e,r]):mM([e,r,...t])}return mM(n==null?[e,r]:[e,r,n])}var vM=(e,t)=>_M(e,t),yM=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new K(n,0,0);return e.replace(l,i.after(),r),e.setSelection(J.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},bM=/^\s*>\s$/,xM=oM.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return vM(`blockquote`,{...Mk(this.options.HTMLAttributes,e),children:vM(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
|
||
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
||
`))}),n.join(`
|
||
>
|
||
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>yM(this.editor,this.type)}},addInputRules(){return[rM({find:bM,type:this.type})]}}),SM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,CM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,wM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,TM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,EM=kj.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return vM(`strong`,{...Mk(this.options.HTMLAttributes,e),children:vM(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[eM({find:SM,type:this.type}),eM({find:wM,type:this.type})]},addPasteRules(){return[sM({find:CM,type:this.type}),sM({find:TM,type:this.type})]}}),DM=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},OM=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},kM=kj.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,Mk(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[eM({find:DM,type:this.type})]},addPasteRules(){return[sM({find:OM,type:this.type})]}}),AM=4,jM=/^```([a-z]+)?[\s\n]$/,MM=/^~~~([a-z]+)?[\s\n]$/,NM=oM.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:AM,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,Mk(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
|
||
`):`\`\`\`${r}\n\n\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??AM,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
|
||
`,`
|
||
`).split(`
|
||
`).map(e=>o+e).join(`
|
||
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??AM,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
|
||
`,`
|
||
`).split(`
|
||
`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(J.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
|
||
`,`
|
||
`).split(`
|
||
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
|
||
`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
||
|
||
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(q.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[nM({find:jM,type:this.type,getAttributes:e=>({language:e[1]})}),nM({find:MM,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new xS({key:new wS(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
|
||
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(J.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),PM=oM.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
||
|
||
`):``}),FM=oM.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,Mk(this.options.HTMLAttributes,e)]},renderText(){return`
|
||
`},renderMarkdown:()=>`
|
||
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),IM=oM.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Mk(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>nM({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),LM=oM.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,Mk(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!pj(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return lA(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(J.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(Y.create(t.doc,n.pos)):t.setSelection(J.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(J.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[tM({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),RM=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,zM=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,BM=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,VM=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,HM=kj.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,Mk(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[eM({find:RM,type:this.type}),eM({find:BM,type:this.type})]},addPasteRules(){return[sM({find:zM,type:this.type}),sM({find:VM,type:this.type})]}}),UM=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,WM=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,GM=`numeric`,KM=`ascii`,qM=`alpha`,JM=`asciinumeric`,YM=`alphanumeric`,XM=`domain`,ZM=`emoji`,QM=`scheme`,$M=`slashscheme`,eN=`whitespace`;function tN(e,t){return e in t||(t[e]=[]),t[e]}function nN(e,t,n){t[GM]&&(t[JM]=!0,t[YM]=!0),t[KM]&&(t[JM]=!0,t[qM]=!0),t[JM]&&(t[YM]=!0),t[qM]&&(t[YM]=!0),t[YM]&&(t[XM]=!0),t[ZM]&&(t[XM]=!0);for(let r in t){let t=tN(r,n);t.indexOf(e)<0&&t.push(e)}}function rN(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function iN(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}iN.groups={},iN.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=iN.groups;let i;return t&&t.j?i=t:(i=new iN(t),n&&r&&nN(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=iN.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new iN,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new iN,a&&(r&&(o.t&&typeof o.t==`string`?nN(a,Object.assign(rN(o.t,r),n),r):n&&nN(a,n,r)),o.t=a),i.j[e]=o,o}};var Q=(e,t,n,r,i)=>e.ta(t,n,r,i),aN=(e,t,n,r,i)=>e.tr(t,n,r,i),oN=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),sN=`WORD`,cN=`UWORD`,lN=`ASCIINUMERICAL`,uN=`ALPHANUMERICAL`,dN=`LOCALHOST`,fN=`TLD`,pN=`UTLD`,mN=`SCHEME`,hN=`SLASH_SCHEME`,gN=`NUM`,_N=`WS`,vN=`NL`,yN=`OPENBRACE`,bN=`CLOSEBRACE`,xN=`OPENBRACKET`,SN=`CLOSEBRACKET`,CN=`OPENPAREN`,wN=`CLOSEPAREN`,TN=`OPENANGLEBRACKET`,EN=`CLOSEANGLEBRACKET`,DN=`FULLWIDTHLEFTPAREN`,ON=`FULLWIDTHRIGHTPAREN`,kN=`LEFTCORNERBRACKET`,AN=`RIGHTCORNERBRACKET`,jN=`LEFTWHITECORNERBRACKET`,MN=`RIGHTWHITECORNERBRACKET`,NN=`FULLWIDTHLESSTHAN`,PN=`FULLWIDTHGREATERTHAN`,FN=`AMPERSAND`,IN=`APOSTROPHE`,LN=`ASTERISK`,RN=`AT`,zN=`BACKSLASH`,BN=`BACKTICK`,VN=`CARET`,HN=`COLON`,UN=`COMMA`,WN=`DOLLAR`,GN=`DOT`,KN=`EQUALS`,qN=`EXCLAMATION`,JN=`HYPHEN`,YN=`PERCENT`,XN=`PIPE`,ZN=`PLUS`,QN=`POUND`,$N=`QUERY`,eP=`QUOTE`,tP=`FULLWIDTHMIDDLEDOT`,nP=`SEMI`,rP=`SLASH`,iP=`TILDE`,aP=`UNDERSCORE`,oP=`EMOJI`,sP=`SYM`,cP=Object.freeze({__proto__:null,ALPHANUMERICAL:uN,AMPERSAND:FN,APOSTROPHE:IN,ASCIINUMERICAL:lN,ASTERISK:LN,AT:RN,BACKSLASH:zN,BACKTICK:BN,CARET:VN,CLOSEANGLEBRACKET:EN,CLOSEBRACE:bN,CLOSEBRACKET:SN,CLOSEPAREN:wN,COLON:HN,COMMA:UN,DOLLAR:WN,DOT:GN,EMOJI:oP,EQUALS:KN,EXCLAMATION:qN,FULLWIDTHGREATERTHAN:PN,FULLWIDTHLEFTPAREN:DN,FULLWIDTHLESSTHAN:NN,FULLWIDTHMIDDLEDOT:tP,FULLWIDTHRIGHTPAREN:ON,HYPHEN:JN,LEFTCORNERBRACKET:kN,LEFTWHITECORNERBRACKET:jN,LOCALHOST:dN,NL:vN,NUM:gN,OPENANGLEBRACKET:TN,OPENBRACE:yN,OPENBRACKET:xN,OPENPAREN:CN,PERCENT:YN,PIPE:XN,PLUS:ZN,POUND:QN,QUERY:$N,QUOTE:eP,RIGHTCORNERBRACKET:AN,RIGHTWHITECORNERBRACKET:MN,SCHEME:mN,SEMI:nP,SLASH:rP,SLASH_SCHEME:hN,SYM:sP,TILDE:iP,TLD:fN,UNDERSCORE:aP,UTLD:pN,UWORD:cN,WORD:sN,WS:_N}),lP=/[a-z]/,uP=/\p{L}/u,dP=/\p{Emoji}/u,fP=/\d/,pP=/\s/,mP=`\r`,hP=`
|
||
`,gP=`️`,_P=``,vP=``,yP=null,bP=null;function xP(e=[]){let t={};iN.groups=t;let n=new iN;yP??=TP(UM),bP??=TP(WM),$(n,`'`,IN),$(n,`{`,yN),$(n,`}`,bN),$(n,`[`,xN),$(n,`]`,SN),$(n,`(`,CN),$(n,`)`,wN),$(n,`<`,TN),$(n,`>`,EN),$(n,`(`,DN),$(n,`)`,ON),$(n,`「`,kN),$(n,`」`,AN),$(n,`『`,jN),$(n,`』`,MN),$(n,`<`,NN),$(n,`>`,PN),$(n,`&`,FN),$(n,`*`,LN),$(n,`@`,RN),$(n,"`",BN),$(n,`^`,VN),$(n,`:`,HN),$(n,`,`,UN),$(n,`$`,WN),$(n,`.`,GN),$(n,`=`,KN),$(n,`!`,qN),$(n,`-`,JN),$(n,`%`,YN),$(n,`|`,XN),$(n,`+`,ZN),$(n,`#`,QN),$(n,`?`,$N),$(n,`"`,eP),$(n,`/`,rP),$(n,`;`,nP),$(n,`~`,iP),$(n,`_`,aP),$(n,`\\`,zN),$(n,`・`,tP);let r=aN(n,fP,gN,{[GM]:!0});aN(r,fP,r);let i=aN(r,lP,lN,{[JM]:!0}),a=aN(r,uP,uN,{[YM]:!0}),o=aN(n,lP,sN,{[KM]:!0});aN(o,fP,i),aN(o,lP,o),aN(i,fP,i),aN(i,lP,i);let s=aN(n,uP,cN,{[qM]:!0});aN(s,lP),aN(s,fP,a),aN(s,uP,s),aN(a,fP,a),aN(a,lP),aN(a,uP,a);let c=$(n,hP,vN,{[eN]:!0}),l=$(n,mP,_N,{[eN]:!0}),u=aN(n,pP,_N,{[eN]:!0});$(n,vP,u),$(l,hP,c),$(l,vP,u),aN(l,pP,u),$(u,mP),$(u,hP),aN(u,pP,u),$(u,vP,u);let d=aN(n,dP,oP,{[ZM]:!0});$(d,`#`),aN(d,dP,d),$(d,gP,d);let f=$(d,_P);$(f,`#`),aN(f,dP,d);let p=[[lP,o],[fP,i]],m=[[lP,null],[uP,s],[fP,a]];for(let e=0;e<yP.length;e++)wP(n,yP[e],fN,sN,p);for(let e=0;e<bP.length;e++)wP(n,bP[e],pN,cN,m);nN(fN,{tld:!0,ascii:!0},t),nN(pN,{utld:!0,alpha:!0},t),wP(n,`file`,mN,sN,p),wP(n,`mailto`,mN,sN,p),wP(n,`http`,hN,sN,p),wP(n,`https`,hN,sN,p),wP(n,`ftp`,hN,sN,p),wP(n,`ftps`,hN,sN,p),nN(mN,{scheme:!0,ascii:!0},t),nN(hN,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[QM]:!0}:{[$M]:!0};r.indexOf(`-`)>=0?i[XM]=!0:lP.test(r)?fP.test(r)?i[JM]=!0:i[KM]=!0:i[GM]=!0,oN(n,r,r,i)}return oN(n,`localhost`,dN,{ascii:!0}),n.jd=new iN(sP),{start:n,tokens:Object.assign({groups:t},cP)}}function SP(e,t){let n=CP(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function CP(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function wP(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new iN(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new iN(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function TP(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var EP={defaultProtocol:`http`,events:null,format:OP,formatHref:OP,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function DP(e,t=null){let n=Object.assign({},EP);e&&(n=Object.assign(n,e instanceof DP?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}DP.prototype={o:EP,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:EP[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function OP(e){return e}function kP(e,t){this.t=`token`,this.v=e,this.tk=t}kP.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=EP.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function AP(e,t){class n extends kP{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var jP=AP(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),MP=AP(`text`),NP=AP(`nl`),PP=AP(`url`,{isLink:!0,toHref(e=EP.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==dN&&e[1].t===HN}}),FP=e=>new iN(e);function IP({groups:e}){let t=e.domain.concat([FN,LN,RN,zN,BN,VN,WN,KN,JN,gN,YN,XN,ZN,QN,rP,sP,iP,aP]),n=[IN,HN,UN,GN,qN,YN,$N,eP,nP,TN,EN,yN,bN,SN,xN,CN,wN,DN,ON,kN,AN,jN,MN,NN,PN],r=[FN,IN,LN,zN,BN,VN,WN,KN,JN,yN,bN,YN,XN,ZN,QN,$N,rP,sP,iP,aP],i=FP(),a=$(i,iP);Q(a,r,a),Q(a,e.domain,a);let o=FP(),s=FP(),c=FP();Q(i,e.domain,o),Q(i,e.scheme,s),Q(i,e.slashscheme,c),Q(o,r,a),Q(o,e.domain,o);let l=$(o,RN);$(a,RN,l),$(s,RN,l),$(c,RN,l);let u=$(a,GN);Q(u,r,a),Q(u,e.domain,a);let d=FP();Q(l,e.domain,d),Q(d,e.domain,d);let f=$(d,GN);Q(f,e.domain,d);let p=FP(jP);Q(f,e.tld,p),Q(f,e.utld,p),$(l,dN,p);let m=$(d,JN);$(m,JN,m),Q(m,e.domain,d),Q(p,e.domain,d),$(p,GN,f),$(p,JN,m);let h=$(o,JN),g=$(o,GN);$(h,JN,h),Q(h,e.domain,o),Q(g,r,a),Q(g,e.domain,o);let _=FP(PP);Q(g,e.tld,_),Q(g,e.utld,_),Q(_,e.domain,o),Q(_,r,a),$(_,GN,g),$(_,JN,h),$(_,RN,l);let v=$(_,HN),y=FP(PP);Q(v,e.numeric,y);let b=FP(PP),x=FP();Q(b,t,b),Q(b,n,x),Q(x,t,b),Q(x,n,x),$(_,rP,b),$(y,rP,b);let S=$(s,HN),C=$($($(c,HN),rP),rP);Q(s,e.domain,o),$(s,GN,g),$(s,JN,h),Q(c,e.domain,o),$(c,GN,g),$(c,JN,h),Q(S,e.domain,b),$(S,rP,b),$(S,$N,b),Q(C,e.domain,b),Q(C,t,b),$(C,rP,b);let w=[[yN,bN],[xN,SN],[CN,wN],[TN,EN],[DN,ON],[kN,AN],[jN,MN],[NN,PN]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=$(b,r);$(x,r,a);let o=FP(PP);Q(a,t,o);let s=FP();Q(a,n,s),$(a,i,b),Q(o,t,o),Q(o,n,s),Q(s,t,o),Q(s,n,s),$(o,i,b),$(s,i,b)}return $(i,dN,_),$(i,vN,NP),{start:i,tokens:cP}}function LP(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(RP(MP,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(RP(e,t,r))}}return o.length>0&&a.push(RP(MP,t,o)),a}function RP(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var zP=typeof console<`u`&&console&&console.warn||(()=>{}),BP=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,VP={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function HP(){return iN.groups={},VP.scanner=null,VP.parser=null,VP.tokenQueue=[],VP.pluginQueue=[],VP.customSchemes=[],VP.initialized=!1,VP}function UP(e,t=!1){if(VP.initialized&&zP(`linkifyjs: already initialized - will not register custom scheme "${e}" ${BP}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
||
1. Must only contain digits, lowercase ASCII letters or "-"
|
||
2. Cannot start or end with "-"
|
||
3. "-" cannot repeat`);VP.customSchemes.push([e,t])}function WP(){VP.scanner=xP(VP.customSchemes);for(let e=0;e<VP.tokenQueue.length;e++)VP.tokenQueue[e][1]({scanner:VP.scanner});VP.parser=IP(VP.scanner.tokens);for(let e=0;e<VP.pluginQueue.length;e++)VP.pluginQueue[e][1]({scanner:VP.scanner,parser:VP.parser});return VP.initialized=!0,VP}function GP(e){return VP.initialized||WP(),LP(VP.parser.start,e,SP(VP.scanner.start,e))}GP.scan=SP;function KP(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new DP(n),i=GP(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var qP=`[\0- \xA0 -\u2029 ]`,JP=new RegExp(qP),YP=RegExp(`${qP}$`),XP=new RegExp(qP,`g`);function ZP(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function QP(e){return new xS({key:new wS(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Yk(yk(n.doc,[...t])).forEach(({newRange:t})=>{let n=bk(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!YP.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(JP).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=GP(n).map(t=>t.toObject(e.defaultProtocol));if(!ZP(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Xk(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function $P(e){return new xS({key:new wS(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Kk(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var eF=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,tF=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function nF(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function rF(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"){r+=1;continue}if(n===0&&nF(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function iF(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||nF(e,t.index??0)||rF(e,t.index??0)?!1:!!r.trim()&&n(i)}function aF(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function oF(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function sF(e){return{href:e.data?.href,title:e.data?.title??null}}function cF(e){let t=eM({find:t=>{let n=eF.exec(t);return!n||!iF(t,n,e.isAllowedHref)?null:aF(n)},type:e.type,getAttributes:sF});return new wj({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function lF(e){let t=sM({find:t=>{let n=[];for(let r of t.matchAll(tF))iF(t,r,e.isAllowedHref)&&n.push(aF(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>oF(t,e)));return[...n,...r]},type:e.type,getAttributes:sF});return new Aj({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function uF(e){return new xS({key:new wS(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=KP(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function dF(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(XP,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var fF=kj.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){UP(e);return}UP(e.scheme,e.optionalSlashes)})},onDestroy(){HP()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!dF(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!dF(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!dF(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,Mk(this.options.HTMLAttributes,e),0]:[`a`,Mk(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!dF(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!dF(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[cF({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!dF(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;KP(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!dF(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[lF({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!dF(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[sM({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(QP({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!dF(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push($P({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(uF({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),pF=`listItem`,mF=`textStyle`,hF=/^\s*([-+*])\s$/,gF=oM.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,Mk(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
||
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pF,this.editor.getAttributes(mF)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=rM({find:hF,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=rM({find:hF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(mF),editor:this.editor})),[e]}}),_F=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},vF=(e,t,n,r)=>{let i=_F(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,G.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},yF=(e,t,n)=>vF(e.state,e.view.dispatch,t,n),bF=(e,t)=>Lj.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>yF(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),xF=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],SF=`abcdefghijklmnopqrstuvwxyz`,CF=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function wF(e){let t=e,n=``;for(let[e,r]of xF)for(;t>=e;)n+=r,t-=e;return n}function TF(e){return wF(e).toUpperCase()}function EF(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of xF)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function DF(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=EF(e);return t<=0?!1:(e===e.toLowerCase()?wF(t):TF(t))===e}function OF(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function kF(e){if(e<=26)return SF[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?SF[n]:SF[t]+SF[n]}function AF(e){if(e&&!/^\d+$/.test(e)){if(DF(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function jF(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=AF(e);if(t===`i`||t===`I`)return EF(e);if(t===`a`||t===`A`){let t=OF(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function MF(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return kF(t);case`A`:return kF(t).toUpperCase();case`i`:return wF(t);case`I`:return TF(t);default:return String(t)}}function NF(e){if(e.length===0)return!1;let t=AF(e[0])??`numeric`,n=jF(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=MF(t,n+r);if(e[r]!==i)return!1}return!0}function PF(e){return{type:AF(e),start:jF(e)}}function FF(e){let{type:t,start:n}=PF(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function IF(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${kF(r)}${n}`;case`A`:return`${kF(r).toUpperCase()}${n}`;case`i`:return`${wF(r)}${n}`;case`I`:return`${TF(r)}${n}`;default:return`${r}${n}`}}function LF(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function RF(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var zF=oM.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Mk(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(LF(e))return{type:`listItem`,content:[{type:`paragraph`,content:RF(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>xj(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){var t,n;let r=((t=e.meta)==null||(t=t.parentAttrs)==null?void 0:t.start)||1;return IF((n=e.meta)==null||(n=n.parentAttrs)==null?void 0:n.type,r-1+(e.index||0),`. `)}return`- `},n,{alignNestedToPrefix:n?.parentType===`orderedList`}),addExtensions(){return[bF(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),BF=(e,t)=>{let{$from:n}=t.selection,r=lO(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},VF=(e,t)=>{let n=BF(e,t);if(!n)return!1;let[,r]=Zk(t,e,n.$pos.pos+4);return r},HF=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},UF=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!tk(e.state,t)&&HF(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!tk(e.state,t)||!aA(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},WF=(e,t)=>{let n=VF(e,t),r=BF(e,t);return!r||!n?!1:n>r.depth},GF=(e,t)=>{let n=VF(e,t),r=BF(e,t);return!r||!n?!1:n<r.depth},KF=(e,t)=>{if(!tk(e.state,t)||!iA(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:WF(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():GF(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},qF=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||tk(r,t))return!1;let o=Qk(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,G.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,G.from(c)),e.setSelection(J.create(e.doc,d+1)),e.scrollIntoView()),!0))},JF=Lj.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&KF(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&KF(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&UF(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&UF(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&qF(e,t,n))return!0;return!1}}}}),YF=RegExp(`^(\\s*)(${CF})([.)])\\s+(.*)$`),XF=/^\s/,ZF={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function QF(e){return YF.test(e.trimStart())}function $F(e){let t=e.trimStart();return ZF.bulletItem.test(t)||QF(t)||ZF.heading.test(t)||ZF.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||ZF.codeFence.test(t)||ZF.blockMath.test(t)}function eI(e){return Object.values(ZF).some(t=>t.test(e))}function tI(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&$F(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function nI(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(YF);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?AF(s):void 0,p=isNaN(d)?jF(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(YF))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(XF)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_||eI(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
|
||
`).trim(),contentLines:m,raw:g.join(`
|
||
`)}),r=h,n=h}return[t,r]}var rI=RegExp(`^(${CF})([.)])\\s+(.+)$`);function iI(e){let t=e.split(`
|
||
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(rI);if(!t)return null;n.push({marker:t[1],content:t[3]})}return NF(n.map(e=>e.marker))?{type:`orderedList`,attrs:FF(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function aI(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=tI(a.contentLines),c=o.join(`
|
||
`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
|
||
`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=aI(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
|
||
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function oI(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var sI=`listItem`,cI=`textStyle`,lI=/^(\d+)\.\s$/;function uI(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var dI=oM.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=uI(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=uI(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=Mk(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?oI(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
||
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(`
|
||
`),[i,a]=nI(r);if(i.length===0)return;let o=aI(i,i[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(`
|
||
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(sI,this.editor.getAttributes(cI)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new xS({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=iI(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=rM({find:lI,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=rM({find:lI,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(cI)}),joinPredicate:e,editor:this.editor})),[t]}}),fI=/^\s*(\[([( |x])?\])\s$/,pI=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,mI=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},hI=oM.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,Mk(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>xj(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[bF(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=pI;let l=e=>{let t=mI(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Nk(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[rM({find:fI,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),gI=oM.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,Mk(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
||
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=vj(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=vj(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Lj.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(gF.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(zF.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(JF.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(dI.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(hI.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(gI.configure(this.options.taskList)),e}});var _I=` `,vI=`\xA0`,yI=oM.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,Mk(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===_I||n[0].text===_I||n[0].raw===vI||n[0].text===vI)&&r.length===1&&r[0].type===`text`&&(r[0].text===_I||r[0].text===vI)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?_I:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),bI=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,xI=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,SI=kj.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,Mk(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[eM({find:bI,type:this.type})]},addPasteRules(){return[sM({find:xI,type:this.type})]}}),CI=oM.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),wI=kj.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,Mk(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function TI(e={}){return new xS({view(t){return new EI(t,e)}})}var EI=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=Px(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},DI=class e extends q{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):q.near(r)}content(){return K.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new OI(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!AI(e)||!jI(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!Y.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};DI.prototype.visible=!1,DI.findFrom=DI.findGapCursorFrom,q.jsonID(`gapcursor`,DI);var OI=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return DI.valid(t)?new DI(t):q.near(t)}};function kI(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function AI(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||kI(e.type))return!0;if(e.inlineContent)return!1}}return!0}function jI(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||kI(e.type))return!0;if(e.inlineContent)return!1}}return!0}function MI(){return new xS({props:{decorations:LI,createSelectionBetween(e,t,n){return t.pos==n.pos&&DI.valid(n)?new DI(n):null},handleClick:FI,handleKeyDown:NI,handleDOMEvents:{beforeinput:II}}})}var NI=$D({ArrowLeft:PI(`horiz`,-1),ArrowRight:PI(`horiz`,1),ArrowUp:PI(`vert`,-1),ArrowDown:PI(`vert`,1)});function PI(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof J){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=DI.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new DI(c))),!0):!1}}function FI(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!DI.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Y.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new DI(r))),!0)}function II(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof DI))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=G.empty;for(let e=r.length-1;e>=0;e--)i=G.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new K(i,0,0));return a.setSelection(J.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function LI(e){if(!(e.selection instanceof DI))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,QE.create(e.doc,[YE.widget(e.selection.head,t,{key:`gapcursor`})])}var RI=200,zI=function(){};zI.prototype.append=function(e){return e.length?(e=zI.from(e),!this.length&&e||e.length<RI&&this.leafAppend(e)||this.length<RI&&e.leafPrepend(this)||this.appendInner(e)):this},zI.prototype.prepend=function(e){return e.length?zI.from(e).append(this):this},zI.prototype.appendInner=function(e){return new VI(this,e)},zI.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?zI.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},zI.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},zI.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},zI.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},zI.from=function(e){return e instanceof zI?e:e&&e.length?new BI(e):zI.empty};var BI=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=RI)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=RI)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(zI);zI.empty=new BI([]);var VI=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(zI),HI=500,UI=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new GI(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new GI(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new GI(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>qI&&(s=WI(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Qb;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new GI(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new GI(i,o,l))}else r.push(new GI(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new GI(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>HI&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new GI(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(zI.from(i.reverse()),a)}};UI.empty=new UI(zI.empty,0);function WI(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var GI=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},KI=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},qI=20;function JI(e,t,n,r){let i=n.getMeta(nL),a;if(i)return i.historyState;n.getMeta(rL)&&(e=new KI(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(nL))return o.getMeta(nL).redo?new KI(e.done.addTransform(n,void 0,r,tL(t)),e.undone,XI(n.mapping.maps),e.prevTime,e.prevComposition):new KI(e.done,e.undone.addTransform(n,void 0,r,tL(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!YI(n,e.prevRanges)),s=o?ZI(e.prevRanges,n.mapping):XI(n.mapping.maps);return new KI(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,tL(t)),UI.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new KI(e.done.rebased(n,a),e.undone.rebased(n,a),ZI(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new KI(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),ZI(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function YI(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function XI(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function ZI(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function QI(e,t,n){let r=tL(t),i=nL.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new KI(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(nL,{redo:n,historyState:c})}var $I=!1,eL=null;function tL(e){let t=e.plugins;if(eL!=t){$I=!1,eL=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){$I=!0;break}}return $I}var nL=new wS(`history`),rL=new wS(`closeHistory`);function iL(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new xS({key:nL,state:{init(){return new KI(UI.empty,UI.empty,null,0,-1)},apply(t,n,r){return JI(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?oL:n==`historyRedo`?sL:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function aL(e,t){return(n,r)=>{let i=nL.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=QI(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var oL=aL(!1,!0),sL=aL(!0,!0);Lj.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new xS({key:new wS(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var cL=Lj.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[TI(this.options)]}});Lj.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new xS({key:new wS(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return QE.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(YE.node(t,t+e.nodeSize,{class:this.options.className}))}),QE.create(e,a)}}})]}});var lL=Lj.create({name:`gapCursor`,addProseMirrorPlugins(){return[MI()]},extendNodeSchema(e){return{allowGapCursor:Ek(Z(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),uL=`placeholder`,dL=new wS(`tiptap__placeholder`);function fL(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),YE.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function pL(e,t){return typeof e==`function`?e(t):e}function mL({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&cA(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(fL({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:pL(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function hL({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&cA(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(fL({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:pL(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...mL({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return QE.create(r,o)}function gL(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function _L(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function vL(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function yL(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function bL(e,t){let n=vL(e,t.from,t.to);return n.push(_L(e,gL(e,t.from))),t.to>t.from?n.push(_L(e,gL(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(_L(e,gL(e,Math.min(t.from+1,e.content.size)))),n}function xL(e,t,n){let r=[];if(e.docChanged){let t=Yk(e);for(let e of t)r.push(...bL(n.doc,e.newRange))}return e.selectionSet&&(r.push(_L(n.doc,gL(n.doc,e.mapping.map(t.selection.anchor)))),r.push(_L(n.doc,gL(n.doc,n.selection.anchor)))),yL(r)}function SL(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function CL({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=SL(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=mL({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function wL({editor:e,options:t,dataAttribute:n}){return{init(r,i){return hL({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??QE.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:CL({decorations:i.map(r.mapping,r.doc),ranges:xL(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function TL(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function EL({editor:e,options:t}){let n=t.dataAttribute?`data-${TL(t.dataAttribute)}`:`data-${uL}`,r=t.showOnlyCurrent&&!t.includeChildren;return new xS({key:dL,...r?{}:{state:wL({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>hL({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?QE.empty:dL.getState(n)??QE.empty}})}var DL=Lj.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:uL,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[EL({editor:this.editor,options:this.options})]}});function OL(e,t){return!e.selection.empty&&!lA(e.selection)&&t.isEditable}function kL(e,t){return OL(e,t)&&!t.isFocused&&!t.view.dragging}function AL(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function jL(e){e.focus()}Lj.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new xS({key:new wS(`selection`),props:{decorations(n){return kL(n,e)?QE.create(n.doc,[YE.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return OL(t.state,e)&&AL(),!1},focus(t){return OL(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&jL(t)}),!1}}}})]}});function ML({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var NL=Lj.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new wS(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new xS({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!ML({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!ML({node:r,types:n})}}})]}}),PL=Lj.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>oL(e,t),redo:()=>({state:e,dispatch:t})=>sL(e,t)}},addProseMirrorPlugins(){return[iL(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),FL=Lj.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(EM.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(xM.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(gF.configure(this.options.bulletList)),this.options.code!==!1&&e.push(kM.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(NM.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(PM.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(cL.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(lL.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(FM.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(IM.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(PL.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(LM.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(HM.configure(this.options.italic)),this.options.listItem!==!1&&e.push(zF.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(JF.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(fF.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(dI.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(yI.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(SI.configure(this.options.strike)),this.options.text!==!1&&e.push(CI.configure(this.options.text)),this.options.underline!==!1&&e.push(wI.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(NL.configure(this.options?.trailingNode)),e}}),IL=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,LL=oM.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,Mk(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=Mk(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{if(typeof e==`string`&&e!==``){l.getAttribute(`src`)!==e&&(l.src=e);return}l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``)};f(s.src);let p=new aM({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=Nk(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[tM({find:IL,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),RL=e({default:()=>HL}),zL=[`disabled`],BL=[`disabled`],VL=[`disabled`],HL={__name:`RichTextEditor`,props:{modelValue:{type:String,default:``},placeholder:{type:String,default:``},headings:{type:Array,default:()=>[2,3]},uploadImage:{type:Function,default:null},pickImage:{type:Function,default:null},minHeight:{type:String,default:``},bordered:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=dM({content:r.modelValue,extensions:[FL.configure({heading:{levels:r.headings},code:!1,codeBlock:!1,link:{openOnClick:!1,autolink:!0,protocols:[`mailto`,`tel`],HTMLAttributes:{rel:`noopener noreferrer`,target:null}}}),LL.configure({HTMLAttributes:{loading:`lazy`}}),DL.configure({placeholder:r.placeholder})],editorProps:{attributes:{class:`prose prose-neutral max-w-none focus:outline-none prose-headings:tracking-tight prose-img:rounded-lg`}},onUpdate:({editor:e})=>i(`update:modelValue`,e.isEmpty?``:e.getHTML())});f(()=>r.modelValue,e=>{a.value&&e!==a.value.getHTML()&&!(e===``&&a.value.isEmpty)&&a.value.commands.setContent(e||``,{emitUpdate:!1})}),ue(()=>a.value?.destroy()),t({focus:()=>a.value?.chain().focus(`end`).run()});let o=I(!1),c=I(``);function l(){c.value=a.value.getAttributes(`link`).href??``,o.value=!0}function u(){let e=c.value.trim();e&&!/^(https?:\/\/|mailto:|tel:|\/|#)/i.test(e)&&(e=`https://${e}`);let t=a.value.chain().focus().extendMarkRange(`link`);(e?t.setLink({href:e}):t.unsetLink()).run(),o.value=!1}let d=I(null),p=I(!1);async function m(e){let t=e.target.files?.[0];if(e.target.value=``,t&&r.uploadImage){p.value=!0;try{let e=await r.uploadImage(t);a.value.chain().focus().setImage({src:e,alt:``}).run()}finally{p.value=!1}}}async function h(){let e=await r.pickImage({multiple:!0});if(!e?.length)return;let t=a.value.chain().focus();e.forEach(e=>t.setImage({src:e.url,alt:e.alt??``})),t.run()}let g=e=>[`grid size-8 place-items-center rounded-md transition-colors disabled:opacity-40`,e?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent hover:text-foreground`];return(t,n)=>_(a)?(j(),D(`div`,{key:0,class:T([`group/rte`,e.bordered?`rounded-md border border-input bg-card shadow-xs focus-within:border-brand-400 focus-within:ring-3 focus-within:ring-ring/30`:``])},[E(`div`,{class:T([`flex flex-wrap items-center gap-0.5`,e.bordered?`border-b px-1.5 py-1`:`sticky top-0 z-10 -mx-1 mb-2 hidden rounded-md border bg-card px-1 py-0.5 shadow-sm group-focus-within/rte:flex`]),role:`toolbar`,"aria-label":`Textformatierung`,onMousedown:n[15]||=we(()=>{},[`prevent`])},[E(`button`,{type:`button`,class:T(g(_(a).isActive(`bold`))),title:`Fett (Strg+B)`,onClick:n[0]||=e=>_(a).chain().focus().toggleBold().run()},[s(_(Oc),{class:`size-4`})],2),E(`button`,{type:`button`,class:T(g(_(a).isActive(`italic`))),title:`Kursiv (Strg+I)`,onClick:n[1]||=e=>_(a).chain().focus().toggleItalic().run()},[s(_(gl),{class:`size-4`})],2),E(`button`,{type:`button`,class:T(g(_(a).isActive(`underline`))),title:`Unterstrichen (Strg+U)`,onClick:n[2]||=e=>_(a).chain().focus().toggleUnderline().run()},[s(_(ru),{class:`size-4`})],2),n[16]||=E(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),e.headings.includes(2)?(j(),D(`button`,{key:0,type:`button`,class:T(g(_(a).isActive(`heading`,{level:2}))),title:`Zwischenüberschrift`,onClick:n[3]||=e=>_(a).chain().focus().toggleHeading({level:2}).run()},[s(_(sl),{class:`size-4`})],2)):R(``,!0),e.headings.includes(3)?(j(),D(`button`,{key:1,type:`button`,class:T(g(_(a).isActive(`heading`,{level:3}))),title:`Kleine Überschrift`,onClick:n[4]||=e=>_(a).chain().focus().toggleHeading({level:3}).run()},[s(_(cl),{class:`size-4`})],2)):R(``,!0),E(`button`,{type:`button`,class:T(g(_(a).isActive(`bulletList`))),title:`Aufzählung`,onClick:n[5]||=e=>_(a).chain().focus().toggleBulletList().run()},[s(_(El),{class:`size-4`})],2),E(`button`,{type:`button`,class:T(g(_(a).isActive(`orderedList`))),title:`Nummerierte Liste`,onClick:n[6]||=e=>_(a).chain().focus().toggleOrderedList().run()},[s(_(Tl),{class:`size-4`})],2),E(`button`,{type:`button`,class:T(g(_(a).isActive(`blockquote`))),title:`Zitat`,onClick:n[7]||=e=>_(a).chain().focus().toggleBlockquote().run()},[s(_(Hl),{class:`size-4`})],2),n[17]||=E(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),E(`button`,{type:`button`,class:T(g(_(a).isActive(`link`))),title:`Link`,onClick:l},[s(_(Cl),{class:`size-4`})],2),_(a).isActive(`link`)?(j(),D(`button`,{key:2,type:`button`,class:T(g(!1)),title:`Link entfernen`,onClick:n[8]||=e=>_(a).chain().focus().unsetLink().run()},[s(_(au),{class:`size-4`})],2)):R(``,!0),e.uploadImage?(j(),D(M,{key:3},[E(`button`,{type:`button`,class:T(g(!1)),title:`Bild einfügen`,disabled:p.value,onClick:n[9]||=e=>d.value?.click()},[p.value?(j(),F(_(Oe),{key:0,class:`size-4 animate-spin`})):(j(),F(_(pl),{key:1,class:`size-4`}))],10,zL),E(`input`,{ref_key:`fileInput`,ref:d,type:`file`,accept:`image/jpeg,image/png,image/webp,image/gif`,class:`hidden`,onChange:m},null,544)],64)):R(``,!0),e.pickImage?(j(),D(`button`,{key:4,type:`button`,class:T(g(!1)),title:`Bild aus der Mediathek`,onClick:h},[s(_(hl),{class:`size-4`})],2)):R(``,!0),n[18]||=E(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),E(`button`,{type:`button`,class:T(g(!1)),title:`Rückgängig`,disabled:!_(a).can().undo(),onClick:n[10]||=e=>_(a).chain().focus().undo().run()},[s(_(iu),{class:`size-4`})],10,BL),E(`button`,{type:`button`,class:T(g(!1)),title:`Wiederholen`,disabled:!_(a).can().redo(),onClick:n[11]||=e=>_(a).chain().focus().redo().run()},[s(_(Wl),{class:`size-4`})],10,VL),o.value?(j(),D(`form`,{key:5,class:`flex w-full items-center gap-1 border-t px-1 pt-1.5 pb-1`,onSubmit:we(u,[`prevent`]),onMousedown:n[14]||=we(()=>{},[`stop`])},[C(E(`input`,{"onUpdate:modelValue":n[12]||=e=>c.value=e,type:`text`,placeholder:`https://… oder /seiten/…`,class:`h-8 min-w-0 flex-1 rounded-md border border-input bg-card px-2 text-sm focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/30`,"aria-label":`Adresse des Links`,autofocus:``},null,512),[[Te,c.value]]),E(`button`,{type:`submit`,class:T(g(!1)),title:`Übernehmen`},[s(_(Rc),{class:`size-4`})],2),E(`button`,{type:`button`,class:T(g(!1)),title:`Abbrechen`,onClick:n[13]||=e=>o.value=!1},[s(_(pu),{class:`size-4`})],2)],32)):R(``,!0)],34),s(_(uM),{editor:_(a),class:T([e.bordered?`px-4 py-3`:``,e.minHeight])},null,8,[`editor`,`class`])],2)):R(``,!0)}},UL=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,WL=Rt,GL=(e,t)=>n=>{if(t?.variants==null)return WL(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=UL(t)||UL(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return WL(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},KL=A({__name:`Button`,props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`button`}},setup(e){let t=e;return(n,r)=>(j(),F(_(Je),{"data-slot":`button`,"data-variant":e.variant,"data-size":e.size,as:e.as,"as-child":e.asChild,class:T(_(H)(_(qL)({variant:e.variant,size:e.size}),t.class))},{default:N(()=>[L(n.$slots,`default`)]),_:3},8,[`data-variant`,`data-size`,`as`,`as-child`,`class`]))}}),qL=GL(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}}),JL=A({__name:`Badge`,props:{asChild:{type:Boolean},as:{},variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(r,i)=>(j(),F(_(Je),O({"data-slot":`badge`,class:_(H)(_(YL)({variant:e.variant}),t.class)},_(n)),{default:N(()=>[L(r.$slots,`default`)]),_:3},16,[`class`]))}}),YL=GL(`inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`}},defaultVariants:{variant:`default`}}),XL=A({__name:`Input`,props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=Ph(n,`modelValue`,t,{passive:!0,defaultValue:n.defaultValue});return(e,t)=>C((j(),D(`input`,{"onUpdate:modelValue":t[0]||=e=>he(r)?r.value=e:null,"data-slot":`input`,class:T(_(H)(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,n.class))},null,2)),[[Te,_(r)]])}}),ZL=A({__name:`Textarea`,props:{class:{type:[Boolean,null,String,Object,Array]},defaultValue:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=Ph(n,`modelValue`,t,{passive:!0,defaultValue:n.defaultValue});return(e,t)=>C((j(),D(`textarea`,{"onUpdate:modelValue":t[0]||=e=>he(r)?r.value=e:null,"data-slot":`textarea`,class:T(_(H)(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,n.class))},null,2)),[[Te,_(r)]])}}),QL=A({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`),o=Qe(i,r);return(e,t)=>(j(),F(_(Kp),O({"data-slot":`checkbox`},_(o),{class:_(H)(`peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,n.class)}),{default:N(t=>[s(_(qp),{"data-slot":`checkbox-indicator`,class:`grid place-content-center text-current transition-none`},{default:N(()=>[L(e.$slots,`default`,a(ve(t)),()=>[s(_(Rc),{class:`size-3.5`})])]),_:2},1024)]),_:3},16,[`class`]))}}),$L=A({__name:`Switch`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},id:{},value:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`),o=Qe(i,r);return(e,t)=>(j(),F(_(Ym),O({"data-slot":`switch`},_(o),{class:_(H)(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,n.class)}),{default:N(t=>[s(_(Xm),{"data-slot":`switch-thumb`,class:T(_(H)(`bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0`))},{default:N(()=>[L(e.$slots,`thumb`,a(ve(t)))]),_:2},1032,[`class`])]),_:3},16,[`class`]))}}),eR={__name:`Skeleton`,props:{class:{type:[String,Array,Object],default:``}},setup(e){let t=e;return(e,n)=>(j(),D(`div`,{class:T(_(H)(`animate-pulse rounded-md bg-muted`,t.class)),"aria-hidden":`true`},null,2))}},tR=A({__name:`Separator`,props:{orientation:{default:`horizontal`},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(Km),O({"data-slot":`separator`},_(n),{class:_(H)(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,t.class)}),null,16,[`class`]))}}),nR=A({__name:`Dialog`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean},unmountOnHide:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Qe(e,t);return(e,t)=>(j(),F(_(at),O({"data-slot":`dialog`},_(n)),{default:N(t=>[L(e.$slots,`default`,a(ve(t)))]),_:3},16))}}),rR=A({__name:`DialogClose`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(j(),F(_(ot),O({"data-slot":`dialog-close`},t),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),iR=A({__name:`DialogOverlay`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(pt),O({"data-slot":`dialog-overlay`},_(n),{class:_(H)(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80`,t.class)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),aR=A({inheritAttrs:!1,__name:`DialogContent`,props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`),a=Qe(i,r);return(t,r)=>(j(),F(_(ut),null,{default:N(()=>[s(iR),s(_(st),O({"data-slot":`dialog-content`},{...t.$attrs,..._(a)},{class:_(H)(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] overflow-y-auto overscroll-contain translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`,n.class)}),{default:N(()=>[L(t.$slots,`default`),e.showCloseButton?(j(),F(_(ot),{key:0,"data-slot":`dialog-close`,class:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`},{default:N(()=>[s(_(pu)),r[0]||=E(`span`,{class:`sr-only`},`Schließen`,-1)]),_:1})):R(``,!0)]),_:3},16,[`class`])]),_:3}))}}),oR=A({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`),r=Xe(n);return(e,n)=>(j(),F(_(ad),O({"data-slot":`dialog-description`},_(r),{class:_(H)(`text-muted-foreground text-sm`,t.class)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),sR=A({__name:`DialogFooter`,props:{class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!1}},setup(e){let t=e;return(n,r)=>(j(),D(`div`,{"data-slot":`dialog-footer`,class:T(_(H)(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,t.class))},[L(n.$slots,`default`),e.showCloseButton?(j(),F(_(ot),{key:0,"as-child":``},{default:N(()=>[s(_(KL),{variant:`outline`},{default:N(()=>[...r[0]||=[c(` Close `,-1)]]),_:1})]),_:1})):R(``,!0)],2))}}),cR=A({__name:`DialogHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(j(),D(`div`,{"data-slot":`dialog-header`,class:T(_(H)(`flex flex-col gap-2 text-center sm:text-left`,t.class))},[L(e.$slots,`default`)],2))}}),lR=A({__name:`DialogTitle`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`),r=Xe(n);return(e,n)=>(j(),F(_(ht),O({"data-slot":`dialog-title`},_(r),{class:_(H)(`text-lg leading-none font-semibold`,t.class)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),uR=A({__name:`DialogTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(j(),F(_(od),O({"data-slot":`dialog-trigger`},t),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),dR=A({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`),o=Qe(i,r);return(e,t)=>(j(),F(_($m),O({"data-slot":`tabs`},_(o),{class:_(H)(`flex flex-col gap-2`,n.class)}),{default:N(t=>[L(e.$slots,`default`,a(ve(t)))]),_:3},16,[`class`]))}}),fR=A({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(nh),O({"data-slot":`tabs-content`,class:_(H)(`flex-1 outline-none`,t.class)},_(n)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),pR=A({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(rh),O({"data-slot":`tabs-list`},_(n),{class:_(H)(`bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-0.75`,t.class)}),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),mR=A({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`),r=Xe(n);return(e,n)=>(j(),F(_(ih),O({"data-slot":`tabs-trigger`,class:_(H)(`data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-3 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t.class)},_(r)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16,[`class`]))}}),hR=A({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=Qe(e,t);return(e,t)=>(j(),F(_(fh),O({"data-slot":`tooltip`},_(n)),{default:N(t=>[L(e.$slots,`default`,a(ve(t)))]),_:3},16))}}),gR=A({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=kt(n,`class`),a=Qe(i,r);return(e,t)=>(j(),F(_(gh),null,{default:N(()=>[s(_(hh),O({"data-slot":`tooltip-content`},{..._(a),...e.$attrs},{class:_(H)(`bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance`,n.class)}),{default:N(()=>[L(e.$slots,`default`),s(_(ah),{class:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-xs`})]),_:3},16,[`class`])]),_:3}))}}),_R=A({__name:`TooltipProvider`,props:{delayDuration:{default:0},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(e){let t=e;return(e,n)=>(j(),F(_(ch),a(ve(t)),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),vR=A({__name:`TooltipTrigger`,props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(j(),F(_(_h),O({"data-slot":`tooltip-trigger`},t),{default:N(()=>[L(e.$slots,`default`)]),_:3},16))}}),yR=A({__name:`Accordion`,props:{collapsible:{type:Boolean},disabled:{type:Boolean},dir:{},orientation:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},type:{},modelValue:{},defaultValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=Qe(e,t);return(e,t)=>(j(),F(_(Zu),O({"data-slot":`accordion`},_(n)),{default:N(t=>[L(e.$slots,`default`,a(ve(t)))]),_:3},16))}}),bR=A({__name:`AccordionContent`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(nd),O({"data-slot":`accordion-content`},_(n),{class:`data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm`}),{default:N(()=>[E(`div`,{class:T(_(H)(`pt-0 pb-4`,t.class))},[L(e.$slots,`default`)],2)]),_:3},16))}}),xR=A({__name:`AccordionItem`,props:{disabled:{type:Boolean},value:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`),r=Xe(n);return(e,n)=>(j(),F(_(td),O({"data-slot":`accordion-item`},_(r),{class:_(H)(`border-b last:border-b-0`,t.class)}),{default:N(t=>[L(e.$slots,`default`,a(ve(t)))]),_:3},16,[`class`]))}}),SR=A({__name:`AccordionTrigger`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=kt(t,`class`);return(e,r)=>(j(),F(_(rd),{class:`flex`},{default:N(()=>[s(_(id),O({"data-slot":`accordion-trigger`},_(n),{class:_(H)(`focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,t.class)}),{default:N(()=>[L(e.$slots,`default`),L(e.$slots,`icon`,{},()=>[s(_(zc),{class:`text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200`})])]),_:3},16,[`class`])]),_:3}))}}),CR=e({Accordion:()=>yR,AccordionContent:()=>bR,AccordionItem:()=>xR,AccordionTrigger:()=>SR,AppIcon:()=>Y_,AppLayout:()=>Uv,Badge:()=>JL,Button:()=>KL,Checkbox:()=>QL,Dialog:()=>nR,DialogClose:()=>rR,DialogContent:()=>aR,DialogDescription:()=>oR,DialogFooter:()=>sR,DialogHeader:()=>cR,DialogTitle:()=>lR,DialogTrigger:()=>uR,DropdownMenu:()=>Vh,DropdownMenuContent:()=>Hh,DropdownMenuItem:()=>Uh,DropdownMenuLabel:()=>Wh,DropdownMenuSeparator:()=>Jh,DropdownMenuTrigger:()=>Yh,EmptyState:()=>ay,FileIcon:()=>Q_,FormField:()=>uy,HttpError:()=>a_,Input:()=>XL,Label:()=>oy,NativeSelect:()=>my,PageHeader:()=>Zv,Panel:()=>ty,PersonAvatar:()=>B_,RichTextEditor:()=>HL,Separator:()=>tR,Skeleton:()=>eR,Switch:()=>$L,Tabs:()=>dR,TabsContent:()=>fR,TabsList:()=>pR,TabsTrigger:()=>mR,Textarea:()=>ZL,Tooltip:()=>hR,TooltipContent:()=>gR,TooltipProvider:()=>_R,TooltipTrigger:()=>vR,colorFor:()=>z_,formatDate:()=>m_,formatMonthYear:()=>__,formatRelative:()=>v_,formatShortDate:()=>h_,formatTime:()=>g_,http:()=>s_,toast:()=>eg}),wR=()=>window.__inhausPlugins??{};function TR(e,t){if(!e?.includes(`::`))return null;let[n,r]=e.split(`::`),i=wR()[n],a=i?.components?.[`${t}/${r}`];return a?i.base+a:null}function ER(e){let t=TR(e,`pages`);return t?z(()=>import(t),[]):null}var DR={};function OR(e,t){let n=TR(e,t);return n?DR[n]??=g({loader:()=>z(()=>import(n).then(e=>e.default??e),[]),onError:(n,r,i)=>{console.error(`Plugin-Komponente ${e} (${t}) konnte nicht geladen werden:`,n),i()}}):null}var{createApp:kR,h:AR}=t,{createInertiaApp:jR}=ws;window.__inhaus={modules:{vue:t,"@inertiajs/vue3":ws,"@inhaus/ui":CR}},jR({title:(e,t)=>{let n=t.props.branding.portal_name;return e?`${e} – ${n}`:n},resolve:e=>{let t={...Object.assign({"./pages/Appearance/Sample.vue":()=>z(()=>import(`./Sample-BVyIfRvs.js`),__vite__mapDeps([0,1,2,3,4])),"./pages/Auth/DirectoryLogin.vue":()=>z(()=>import(`./DirectoryLogin-DuQybgJj.js`),__vite__mapDeps([5,1,6,7,8,9,10,11,12])),"./pages/Auth/ForgotPassword.vue":()=>z(()=>import(`./ForgotPassword-CodQAGms.js`),__vite__mapDeps([13,1,6,7,8,11,12])),"./pages/Auth/Login.vue":()=>z(()=>import(`./Login-fjC2XdrT.js`),__vite__mapDeps([14,1,6,9,8,10,11,12])),"./pages/Auth/ResetPassword.vue":()=>z(()=>import(`./ResetPassword-CRM3s-q2.js`),__vite__mapDeps([15,1,6,11,8,12])),"./pages/Dashboard.vue":()=>z(()=>import(`./Dashboard-Cd3vEBP_.js`),__vite__mapDeps([16,1,17,4])),"./pages/Editorial/Index.vue":()=>z(()=>import(`./Index-BkEHcS67.js`),__vite__mapDeps([18,1,4])),"./pages/Media/Index.vue":()=>z(()=>import(`./Index-Bl5Izsbf.js`),__vite__mapDeps([19,1,6,8,20,21,22,23,24,25,11,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41])),"./pages/People/Index.vue":()=>z(()=>import(`./Index-CeqrPBop.js`),__vite__mapDeps([42,1,6,43,8,30,26])),"./pages/People/Organigram.vue":()=>z(()=>import(`./Organigram-C_DgaEG6.js`),__vite__mapDeps([44,1,8,45,11,46,47,48,49,50])),"./pages/Profile/Edit.vue":()=>z(()=>import(`./Edit-SHtMKq99.js`),__vite__mapDeps([51,1,6,4,8,11,31])),"./pages/Profile/Show.vue":()=>z(()=>import(`./Show-BzXirZNm.js`),__vite__mapDeps([52,1,4,48,8])),"./pages/Search/Index.vue":()=>z(()=>import(`./Index--v_e-KvJ.js`),__vite__mapDeps([53,1,6,30,8,26]))}),...Object.assign({"../../plugins-core/birthdays/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-BfGAF0a4.js`),__vite__mapDeps([54,1,55])),"../../plugins-core/downloads/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-BmyznyT3.js`),__vite__mapDeps([56,1,6,4,8,57,28,29,58,59,60,11,61,62,31,63,49])),"../../plugins-core/events/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-CWwV6mxe.js`),__vite__mapDeps([64,1,65,17,4])),"../../plugins-core/events/resources/js/pages/Show.vue":()=>z(()=>import(`./Show-DcqIy7Qn.js`),__vite__mapDeps([66,1,8,7,65])),"../../plugins-core/forms/resources/js/pages/Builder.vue":()=>z(()=>import(`./Builder-DjY3Sbso.js`),__vite__mapDeps([67,1,6,8,57,7,22,27,10,68,60,11,69,70,61,47,71,72,73,31,74,9,75])),"../../plugins-core/forms/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-DlQTmlxi.js`),__vite__mapDeps([76,1])),"../../plugins-core/forms/resources/js/pages/Show.vue":()=>z(()=>import(`./Show-jc1aTCk_.js`),__vite__mapDeps([77,1,7,8,78,74,6,22,9,11,69,70,75])),"../../plugins-core/gemeinsam/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-CFxKWBzg.js`),__vite__mapDeps([79,1,6,8,43,29,11,61,47,31])),"../../plugins-core/it-service/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-CTf0z9Rh.js`),__vite__mapDeps([80,1,8,78,21,81,82,83])),"../../plugins-core/it-service/resources/js/pages/Loans.vue":()=>z(()=>import(`./Loans-BxT71Dej.js`),__vite__mapDeps([84,1,6,8,7,78,43,21,11,75,83])),"../../plugins-core/it-service/resources/js/pages/Ticket.vue":()=>z(()=>import(`./Ticket-DmEA5-IK.js`),__vite__mapDeps([85,1,6,8,7,11,70,75,82,83])),"../../plugins-core/it-service/resources/js/pages/TicketCreate.vue":()=>z(()=>import(`./TicketCreate-Bwbme5_V.js`),__vite__mapDeps([86,1,6,7,8,21,11,70,75])),"../../plugins-core/news/resources/js/pages/Editor.vue":()=>z(()=>import(`./Editor-BmVEWWo0.js`),__vite__mapDeps([87,1,6,7,8,88,57,45,20,21,22,23,24,25,11,26,27,9,59,68,89,46,90,47,30,31,63,3,4,91,78,29,10,71,75,48])),"../../plugins-core/news/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-Ci1ncmvT.js`),__vite__mapDeps([92,1,43,8,93,94,95])),"../../plugins-core/news/resources/js/pages/Show.vue":()=>z(()=>import(`./Show-CCzdl3Yp.js`),__vite__mapDeps([96,1,6,8,7,97,25,11,93,75,31,2,3,4])),"../../plugins-core/pages/resources/js/pages/Editor.vue":()=>z(()=>import(`./Editor-p521_XuN.js`),__vite__mapDeps([98,1,6,8,7,88,57,45,20,21,22,23,24,25,11,26,27,9,59,68,89,46,90,47,30,31,63,3,4,91,78,29,10,58,69,62,75,72,48,2,99])),"../../plugins-core/pages/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-BBA1xg--.js`),__vite__mapDeps([100,1,47,8,99,6])),"../../plugins-core/pages/resources/js/pages/Show.vue":()=>z(()=>import(`./Show-lMsU0jMK.js`),__vite__mapDeps([101,1,78,8,61,2,3,4])),"../../plugins-core/qm/resources/js/pages/Folder.vue":()=>z(()=>import(`./Folder-3kIxb0j1.js`),__vite__mapDeps([102,1,6,8,28,29,23,58,103,48,104,25,11,70,61,31,105,106])),"../../plugins-core/qm/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-Ca3LVA6C.js`),__vite__mapDeps([107,1,103,8,48,104,106,6])),"../../plugins-core/qm/resources/js/pages/Search.vue":()=>z(()=>import(`./Search-DB5hNAVL.js`),__vite__mapDeps([108,1,8,23,30,104,105,106,6,109])),"../../plugins-core/qm/resources/js/pages/Viewer.vue":()=>z(()=>import(`./Viewer-j00_0TXn.js`),__vite__mapDeps([110,1,4,7,8,28,23,11,46,47,104,105])),"../../plugins-core/speiseplan/resources/js/pages/Index.vue":()=>z(()=>import(`./Index-DqIP0n--.js`),__vite__mapDeps([111,1,6,4,8,11,31,63])),"../../plugins-core/speiseplan/resources/js/pages/Print.vue":()=>z(()=>import(`./Print-B8elfoj2.js`),__vite__mapDeps([112,1,113]))})},[n,r]=e.includes(`::`)?e.split(`::`):[null,e],i=n?t[`../../plugins-core/${n}/resources/js/pages/${r}.vue`]:t[`./pages/${e}.vue`];if(!i&&n){let t=ER(e);if(t)return t}if(!i)throw Error(`Seite nicht gefunden: ${e}`);return i()},setup({el:e,App:t,props:n,plugin:r}){kR({render:()=>AR(t,n)}).use(r).mount(e)},progress:{color:`var(--brand)`}});export{Lh as $,Wc as $t,z_ as A,Rl as At,r_ as B,Sl as Bt,Uv as C,Xl as Ct,W_ as D,Wl as Dt,Y_ as E,Kl as Et,v_ as F,kl as Ft,eg as G,ml as Gt,t_ as H,yl as Ht,h_ as I,Ol as It,Uh as J,nl as Jt,Yh as K,pl as Kt,g_ as L,Dl as Lt,m_ as M,Fl as Mt,b_ as N,Nl as Nt,K_ as O,Hl as Ot,__ as P,Al as Pt,Rh as Q,Gc as Qt,a_ as R,El as Rt,Zv as S,Zl as St,Q_ as T,ql as Tt,e_ as U,_l as Ut,n_ as V,bl as Vt,Kg as W,hl as Wt,Vh as X,$c as Xt,Hh as Y,tl as Yt,zh as Z,Xc as Zt,my as _,lu as _t,oR as a,Nc as an,ih as at,ay as b,iu as bt,eR as c,wc as cn,$m as ct,ZL as d,gc as dn,rd as dt,Hc as en,xh as et,XL as f,Ps as fn,nd as ft,HL as g,du as gt,RL as h,pu as ht,sR as i,Pc as in,vh as it,y_ as j,Il as jt,B_ as k,Vl as kt,$L as l,qs as ln,ad as lt,KL as m,W as mn,Zu as mt,lR as n,zc as nn,jh as nt,aR as o,jc as on,rh as ot,qL as p,Gs as pn,td as pt,Jh as q,ll as qt,cR as r,Rc as rn,Fh as rt,nR as s,Ec as sn,nh as st,OR as t,Bc as tn,kh as tt,QL as u,fc as un,id as ut,uy as v,cu as vt,ev as w,Jl as wt,ty as x,eu as xt,oy as y,su as yt,s_ as z,wl as zt}; |