@opengis/cms 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/index-W-qQIppj-DRzFSjU1.js +2452 -0
  2. package/dist/index.html +28 -34
  3. package/dist/index.js +13915 -0
  4. package/dist/index.umd.cjs +153 -0
  5. package/package.json +4 -3
  6. package/dist/assets/AddUser-CX-McfRW.js +0 -1
  7. package/dist/assets/ApiKeys-DSv1exYv.js +0 -16
  8. package/dist/assets/Appearance-DDtOUvCV.js +0 -6
  9. package/dist/assets/ArticlesPage-D6B3cZsl.js +0 -6
  10. package/dist/assets/BuilderPage-CCeSMVWe.js +0 -1
  11. package/dist/assets/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-DVYVfYF4.js +0 -1
  12. package/dist/assets/CollectionsPage-CHk8Cn5k.js +0 -1
  13. package/dist/assets/Dashboard-Bs7sXO6h.js +0 -11
  14. package/dist/assets/EditCollectionPage-gPuLJrN8.js +0 -41
  15. package/dist/assets/EmailPage-DhlWsPxk.js +0 -1
  16. package/dist/assets/EmptyData-Ct-xQv_N.js +0 -1
  17. package/dist/assets/FeedbackPage-DtaOncVv.js +0 -1
  18. package/dist/assets/Logs-CZ5klHNK.js +0 -1
  19. package/dist/assets/MediaBreadcrumb-BpOxt5PK.js +0 -11
  20. package/dist/assets/MediaPage-DqRcZFlO.js +0 -16
  21. package/dist/assets/MenuAddPage-BLcoVgrS.js +0 -1
  22. package/dist/assets/MenuItemPage-B2otXqkz.js +0 -20
  23. package/dist/assets/MenuPage-C00m4Fc_.js +0 -1
  24. package/dist/assets/MonacoEditor.vue_vue_type_script_setup_true_lang-CjoEsC67.js +0 -3
  25. package/dist/assets/PermissionsPage-LtqcCJ14.js +0 -1
  26. package/dist/assets/Settings-BHH6RoBP.js +0 -1
  27. package/dist/assets/SettingsTable-CY5pZx1z.js +0 -1
  28. package/dist/assets/SettingsTitle-t4WJBFxZ.js +0 -1
  29. package/dist/assets/SingletonsPage-Bn2Ypjhs.js +0 -6
  30. package/dist/assets/TagsPage-DAiakEth.js +0 -1
  31. package/dist/assets/UniversalTable.vue_vue_type_script_setup_true_lang-BQ5m4aZd.js +0 -11
  32. package/dist/assets/UniversalTablePagination.vue_vue_type_script_setup_true_lang-DppVBws0.js +0 -1
  33. package/dist/assets/Users-CMH5j0db.js +0 -1
  34. package/dist/assets/UsersPage-CDGreEib.js +0 -1
  35. package/dist/assets/arrow-up-DCe0WsrM.js +0 -16
  36. package/dist/assets/calendar-o9t4MkD2.js +0 -6
  37. package/dist/assets/chevron-left-WFftVS9c.js +0 -6
  38. package/dist/assets/chevron-right-BiiSb3Be.js +0 -6
  39. package/dist/assets/contentForm-unZQhjCu.js +0 -6
  40. package/dist/assets/en-BDx3Svx8.js +0 -1
  41. package/dist/assets/eye-Dijywc6g.js +0 -6
  42. package/dist/assets/file-B_duymIT.js +0 -6
  43. package/dist/assets/general-CkN_0qIV.js +0 -1
  44. package/dist/assets/index-BIp7eSXk.js +0 -1
  45. package/dist/assets/index-DCW2e4Az.js +0 -9
  46. package/dist/assets/index-DGweaj24.js +0 -1
  47. package/dist/assets/index-W-qQIppj-BDlsxaGB.js +0 -1
  48. package/dist/assets/index-W-qQIppj-BsopI3Hz-BIZR-dhy.js +0 -1
  49. package/dist/assets/index-oQz9FOqL.css +0 -1
  50. package/dist/assets/index-yMJAVBXk.js +0 -290
  51. package/dist/assets/list-CXRbSNky.js +0 -6
  52. package/dist/assets/logo-Cct5WB26.png +0 -0
  53. package/dist/assets/pencil-CwnPP4IJ.js +0 -6
  54. package/dist/assets/plus-DLR44m6p.js +0 -6
  55. package/dist/assets/save-FeDrOUOd.js +0 -6
  56. package/dist/assets/search-C4-fHihx.js +0 -6
  57. package/dist/assets/square-pen-xVs4e8Yb.js +0 -6
  58. package/dist/assets/trash-2-BGXMNU3d.js +0 -6
  59. package/dist/assets/uk-BA7DIKEL.js +0 -1
  60. package/dist/assets/useDebounce-DFq3rxAW.js +0 -1
  61. package/dist/assets/vs-form-reletion-link-C-xrdHDl.js +0 -20
  62. package/dist/assets/vs-form-reletion-link-bk-9ZkDH.css +0 -1
  63. package/dist/assets/vue.-sixQ7xP-CUPNuJcq.js +0 -1
  64. package/dist/assets/vuedraggable.umd-W_2WTF6i.js +0 -14
  65. package/dist/assets/x-D2t-wfBe.js +0 -6
  66. package/src/index.js +0 -23
@@ -1,290 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();/**
2
- * @vue/shared v3.5.21
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/function ou(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Xe={},Xs=[],rr=()=>{},Zy=()=>!1,Bl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),mp=t=>t.startsWith("onUpdate:"),xt=Object.assign,gp=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Gk=Object.prototype.hasOwnProperty,st=(t,e)=>Gk.call(t,e),Te=Array.isArray,Zs=t=>Ci(t)==="[object Map]",Os=t=>Ci(t)==="[object Set]",Wh=t=>Ci(t)==="[object Date]",qk=t=>Ci(t)==="[object RegExp]",Pe=t=>typeof t=="function",Et=t=>typeof t=="string",br=t=>typeof t=="symbol",gt=t=>t!==null&&typeof t=="object",yp=t=>(gt(t)||Pe(t))&&Pe(t.then)&&Pe(t.catch),Qy=Object.prototype.toString,Ci=t=>Qy.call(t),Jk=t=>Ci(t).slice(8,-1),su=t=>Ci(t)==="[object Object]",bp=t=>Et(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Qs=ou(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),iu=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Yk=/-\w/g,_n=iu(t=>t.replace(Yk,e=>e.slice(1).toUpperCase())),Xk=/\B([A-Z])/g,Fn=iu(t=>t.replace(Xk,"-$1").toLowerCase()),lu=iu(t=>t.charAt(0).toUpperCase()+t.slice(1)),Na=iu(t=>t?`on${lu(t)}`:""),Ln=(t,e)=>!Object.is(t,e),ei=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},eb=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},Ga=t=>{const e=parseFloat(t);return isNaN(e)?t:e},qa=t=>{const e=Et(t)?Number(t):NaN;return isNaN(e)?t:e};let Kh;const au=()=>Kh||(Kh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Zk="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",Qk=ou(Zk);function pt(t){if(Te(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],o=Et(r)?r2(r):pt(r);if(o)for(const s in o)e[s]=o[s]}return e}else if(Et(t)||gt(t))return t}const e2=/;(?![^(]*\))/g,t2=/:([^]+)/,n2=/\/\*[^]*?\*\//g;function r2(t){const e={};return t.replace(n2,"").split(e2).forEach(n=>{if(n){const r=n.split(t2);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function ae(t){let e="";if(Et(t))e=t;else if(Te(t))for(let n=0;n<t.length;n++){const r=ae(t[n]);r&&(e+=r+" ")}else if(gt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function vp(t){if(!t)return null;let{class:e,style:n}=t;return e&&!Et(e)&&(t.class=ae(e)),n&&(t.style=pt(n)),t}const o2="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",s2=ou(o2);function tb(t){return!!t||t===""}function i2(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=Fo(t[r],e[r]);return n}function Fo(t,e){if(t===e)return!0;let n=Wh(t),r=Wh(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=br(t),r=br(e),n||r)return t===e;if(n=Te(t),r=Te(e),n||r)return n&&r?i2(t,e):!1;if(n=gt(t),r=gt(e),n||r){if(!n||!r)return!1;const o=Object.keys(t).length,s=Object.keys(e).length;if(o!==s)return!1;for(const i in t){const l=t.hasOwnProperty(i),a=e.hasOwnProperty(i);if(l&&!a||!l&&a||!Fo(t[i],e[i]))return!1}}return String(t)===String(e)}function cu(t,e){return t.findIndex(n=>Fo(n,e))}const nb=t=>!!(t&&t.__v_isRef===!0),we=t=>Et(t)?t:t==null?"":Te(t)||gt(t)&&(t.toString===Qy||!Pe(t.toString))?nb(t)?we(t.value):JSON.stringify(t,rb,2):String(t),rb=(t,e)=>nb(e)?rb(t,e.value):Zs(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,o],s)=>(n[Gu(r,s)+" =>"]=o,n),{})}:Os(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Gu(n))}:br(e)?Gu(e):gt(e)&&!Te(e)&&!su(e)?String(e):e,Gu=(t,e="")=>{var n;return br(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};function l2(t){return t==null?"initial":typeof t=="string"?t===""?" ":t:String(t)}/**
6
- * @vue/reactivity v3.5.21
7
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
- * @license MIT
9
- **/let yn;class ob{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=yn,!e&&yn&&(this.index=(yn.scopes||(yn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=yn;try{return yn=this,e()}finally{yn=n}}}on(){++this._on===1&&(this.prevScope=yn,yn=this)}off(){this._on>0&&--this._on===0&&(yn=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function sb(t){return new ob(t)}function a2(){return yn}function RU(t,e=!1){yn&&yn.cleanups.push(t)}let kt;const qu=new WeakSet;class Ja{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,yn&&yn.active&&yn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,qu.has(this)&&(qu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||lb(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Gh(this),ab(this);const e=kt,n=gr;kt=this,gr=!0;try{return this.fn()}finally{cb(this),kt=e,gr=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)kp(e);this.deps=this.depsTail=void 0,Gh(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?qu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){zd(this)&&this.run()}get dirty(){return zd(this)}}let ib=0,Ui,Wi;function lb(t,e=!1){if(t.flags|=8,e){t.next=Wi,Wi=t;return}t.next=Ui,Ui=t}function wp(){ib++}function xp(){if(--ib>0)return;if(Wi){let e=Wi;for(Wi=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Ui;){let e=Ui;for(Ui=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function ab(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function cb(t){let e,n=t.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),kp(r),c2(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}t.deps=e,t.depsTail=n}function zd(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(ub(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function ub(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===cl)||(t.globalVersion=cl,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!zd(t))))return;t.flags|=2;const e=t.dep,n=kt,r=gr;kt=t,gr=!0;try{ab(t);const o=t.fn(t._value);(e.version===0||Ln(o,t._value))&&(t.flags|=128,t._value=o,e.version++)}catch(o){throw e.version++,o}finally{kt=n,gr=r,cb(t),t.flags&=-3}}function kp(t,e=!1){const{dep:n,prevSub:r,nextSub:o}=t;if(r&&(r.nextSub=o,t.prevSub=void 0),o&&(o.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)kp(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function c2(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}function PU(t,e){t.effect instanceof Ja&&(t=t.effect.fn);const n=new Ja(t);e&&xt(n,e);try{n.run()}catch(o){throw n.stop(),o}const r=n.run.bind(n);return r.effect=n,r}function DU(t){t.effect.stop()}let gr=!0;const db=[];function so(){db.push(gr),gr=!1}function io(){const t=db.pop();gr=t===void 0?!0:t}function Gh(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=kt;kt=void 0;try{e()}finally{kt=n}}}let cl=0;class u2{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class uu{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!kt||!gr||kt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==kt)n=this.activeLink=new u2(kt,this),kt.deps?(n.prevDep=kt.depsTail,kt.depsTail.nextDep=n,kt.depsTail=n):kt.deps=kt.depsTail=n,fb(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=kt.depsTail,n.nextDep=void 0,kt.depsTail.nextDep=n,kt.depsTail=n,kt.deps===n&&(kt.deps=r)}return n}trigger(e){this.version++,cl++,this.notify(e)}notify(e){wp();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{xp()}}}function fb(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)fb(r)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Ya=new WeakMap,ms=Symbol(""),Ud=Symbol(""),ul=Symbol("");function vn(t,e,n){if(gr&&kt){let r=Ya.get(t);r||Ya.set(t,r=new Map);let o=r.get(n);o||(r.set(n,o=new uu),o.map=r,o.key=n),o.track()}}function Jr(t,e,n,r,o,s){const i=Ya.get(t);if(!i){cl++;return}const l=a=>{a&&a.trigger()};if(wp(),e==="clear")i.forEach(l);else{const a=Te(t),c=a&&bp(n);if(a&&n==="length"){const u=Number(r);i.forEach((d,f)=>{(f==="length"||f===ul||!br(f)&&f>=u)&&l(d)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),c&&l(i.get(ul)),e){case"add":a?c&&l(i.get("length")):(l(i.get(ms)),Zs(t)&&l(i.get(Ud)));break;case"delete":a||(l(i.get(ms)),Zs(t)&&l(i.get(Ud)));break;case"set":Zs(t)&&l(i.get(ms));break}}xp()}function d2(t,e){const n=Ya.get(t);return n&&n.get(e)}function Ds(t){const e=Qe(t);return e===t?e:(vn(e,"iterate",ul),or(t)?e:e.map(un))}function du(t){return vn(t=Qe(t),"iterate",ul),t}const f2={__proto__:null,[Symbol.iterator](){return Ju(this,Symbol.iterator,un)},concat(...t){return Ds(this).concat(...t.map(e=>Te(e)?Ds(e):e))},entries(){return Ju(this,"entries",t=>(t[1]=un(t[1]),t))},every(t,e){return $r(this,"every",t,e,void 0,arguments)},filter(t,e){return $r(this,"filter",t,e,n=>n.map(un),arguments)},find(t,e){return $r(this,"find",t,e,un,arguments)},findIndex(t,e){return $r(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return $r(this,"findLast",t,e,un,arguments)},findLastIndex(t,e){return $r(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return $r(this,"forEach",t,e,void 0,arguments)},includes(...t){return Yu(this,"includes",t)},indexOf(...t){return Yu(this,"indexOf",t)},join(t){return Ds(this).join(t)},lastIndexOf(...t){return Yu(this,"lastIndexOf",t)},map(t,e){return $r(this,"map",t,e,void 0,arguments)},pop(){return Ai(this,"pop")},push(...t){return Ai(this,"push",t)},reduce(t,...e){return qh(this,"reduce",t,e)},reduceRight(t,...e){return qh(this,"reduceRight",t,e)},shift(){return Ai(this,"shift")},some(t,e){return $r(this,"some",t,e,void 0,arguments)},splice(...t){return Ai(this,"splice",t)},toReversed(){return Ds(this).toReversed()},toSorted(t){return Ds(this).toSorted(t)},toSpliced(...t){return Ds(this).toSpliced(...t)},unshift(...t){return Ai(this,"unshift",t)},values(){return Ju(this,"values",un)}};function Ju(t,e,n){const r=du(t),o=r[e]();return r!==t&&!or(t)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.value&&(s.value=n(s.value)),s}),o}const p2=Array.prototype;function $r(t,e,n,r,o,s){const i=du(t),l=i!==t&&!or(t),a=i[e];if(a!==p2[e]){const d=a.apply(t,s);return l?un(d):d}let c=n;i!==t&&(l?c=function(d,f){return n.call(this,un(d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=a.call(i,c,r);return l&&o?o(u):u}function qh(t,e,n,r){const o=du(t);let s=n;return o!==t&&(or(t)?n.length>3&&(s=function(i,l,a){return n.call(this,i,l,a,t)}):s=function(i,l,a){return n.call(this,i,un(l),a,t)}),o[e](s,...r)}function Yu(t,e,n){const r=Qe(t);vn(r,"iterate",ul);const o=r[e](...n);return(o===-1||o===!1)&&_p(n[0])?(n[0]=Qe(n[0]),r[e](...n)):o}function Ai(t,e,n=[]){so(),wp();const r=Qe(t)[e].apply(t,n);return xp(),io(),r}const h2=ou("__proto__,__v_isRef,__isVue"),pb=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(br));function m2(t){br(t)||(t=String(t));const e=Qe(this);return vn(e,"has",t),e.hasOwnProperty(t)}class hb{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?wb:vb:s?bb:yb).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const i=Te(e);if(!o){let a;if(i&&(a=f2[n]))return a;if(n==="hasOwnProperty")return m2}const l=Reflect.get(e,n,Ut(e)?e:r);return(br(n)?pb.has(n):h2(n))||(o||vn(e,"get",n),s)?l:Ut(l)?i&&bp(n)?l:l.value:gt(l)?o?kb(l):Ns(l):l}}class mb extends hb{constructor(e=!1){super(!1,e)}set(e,n,r,o){let s=e[n];if(!this._isShallow){const a=Vo(s);if(!or(r)&&!Vo(r)&&(s=Qe(s),r=Qe(r)),!Te(e)&&Ut(s)&&!Ut(r))return a||(s.value=r),!0}const i=Te(e)&&bp(n)?Number(n)<e.length:st(e,n),l=Reflect.set(e,n,r,Ut(e)?e:o);return e===Qe(o)&&(i?Ln(r,s)&&Jr(e,"set",n,r):Jr(e,"add",n,r)),l}deleteProperty(e,n){const r=st(e,n);e[n];const o=Reflect.deleteProperty(e,n);return o&&r&&Jr(e,"delete",n,void 0),o}has(e,n){const r=Reflect.has(e,n);return(!br(n)||!pb.has(n))&&vn(e,"has",n),r}ownKeys(e){return vn(e,"iterate",Te(e)?"length":ms),Reflect.ownKeys(e)}}class gb extends hb{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const g2=new mb,y2=new gb,b2=new mb(!0),v2=new gb(!0),Wd=t=>t,Ql=t=>Reflect.getPrototypeOf(t);function w2(t,e,n){return function(...r){const o=this.__v_raw,s=Qe(o),i=Zs(s),l=t==="entries"||t===Symbol.iterator&&i,a=t==="keys"&&i,c=o[t](...r),u=n?Wd:e?Xa:un;return!e&&vn(s,"iterate",a?Ud:ms),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}},[Symbol.iterator](){return this}}}}function ea(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function x2(t,e){const n={get(o){const s=this.__v_raw,i=Qe(s),l=Qe(o);t||(Ln(o,l)&&vn(i,"get",o),vn(i,"get",l));const{has:a}=Ql(i),c=e?Wd:t?Xa:un;if(a.call(i,o))return c(s.get(o));if(a.call(i,l))return c(s.get(l));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!t&&vn(Qe(o),"iterate",ms),o.size},has(o){const s=this.__v_raw,i=Qe(s),l=Qe(o);return t||(Ln(o,l)&&vn(i,"has",o),vn(i,"has",l)),o===l?s.has(o):s.has(o)||s.has(l)},forEach(o,s){const i=this,l=i.__v_raw,a=Qe(l),c=e?Wd:t?Xa:un;return!t&&vn(a,"iterate",ms),l.forEach((u,d)=>o.call(s,c(u),c(d),i))}};return xt(n,t?{add:ea("add"),set:ea("set"),delete:ea("delete"),clear:ea("clear")}:{add(o){!e&&!or(o)&&!Vo(o)&&(o=Qe(o));const s=Qe(this);return Ql(s).has.call(s,o)||(s.add(o),Jr(s,"add",o,o)),this},set(o,s){!e&&!or(s)&&!Vo(s)&&(s=Qe(s));const i=Qe(this),{has:l,get:a}=Ql(i);let c=l.call(i,o);c||(o=Qe(o),c=l.call(i,o));const u=a.call(i,o);return i.set(o,s),c?Ln(s,u)&&Jr(i,"set",o,s):Jr(i,"add",o,s),this},delete(o){const s=Qe(this),{has:i,get:l}=Ql(s);let a=i.call(s,o);a||(o=Qe(o),a=i.call(s,o)),l&&l.call(s,o);const c=s.delete(o);return a&&Jr(s,"delete",o,void 0),c},clear(){const o=Qe(this),s=o.size!==0,i=o.clear();return s&&Jr(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=w2(o,t,e)}),n}function fu(t,e){const n=x2(t,e);return(r,o,s)=>o==="__v_isReactive"?!t:o==="__v_isReadonly"?t:o==="__v_raw"?r:Reflect.get(st(n,o)&&o in r?n:r,o,s)}const k2={get:fu(!1,!1)},_2={get:fu(!1,!0)},C2={get:fu(!0,!1)},E2={get:fu(!0,!0)},yb=new WeakMap,bb=new WeakMap,vb=new WeakMap,wb=new WeakMap;function S2(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function M2(t){return t.__v_skip||!Object.isExtensible(t)?0:S2(Jk(t))}function Ns(t){return Vo(t)?t:pu(t,!1,g2,k2,yb)}function xb(t){return pu(t,!1,b2,_2,bb)}function kb(t){return pu(t,!0,y2,C2,vb)}function $U(t){return pu(t,!0,v2,E2,wb)}function pu(t,e,n,r,o){if(!gt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=M2(t);if(s===0)return t;const i=o.get(t);if(i)return i;const l=new Proxy(t,s===2?r:n);return o.set(t,l),l}function gs(t){return Vo(t)?gs(t.__v_raw):!!(t&&t.__v_isReactive)}function Vo(t){return!!(t&&t.__v_isReadonly)}function or(t){return!!(t&&t.__v_isShallow)}function _p(t){return t?!!t.__v_raw:!1}function Qe(t){const e=t&&t.__v_raw;return e?Qe(e):t}function _b(t){return!st(t,"__v_skip")&&Object.isExtensible(t)&&eb(t,"__v_skip",!0),t}const un=t=>gt(t)?Ns(t):t,Xa=t=>gt(t)?kb(t):t;function Ut(t){return t?t.__v_isRef===!0:!1}function Q(t){return Cb(t,!1)}function Hl(t){return Cb(t,!0)}function Cb(t,e){return Ut(t)?t:new T2(t,e)}class T2{constructor(e,n){this.dep=new uu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Qe(e),this._value=n?e:un(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,r=this.__v_isShallow||or(e)||Vo(e);e=r?e:Qe(e),Ln(e,n)&&(this._rawValue=e,this._value=r?e:un(e),this.dep.trigger())}}function FU(t){t.dep&&t.dep.trigger()}function me(t){return Ut(t)?t.value:t}function VU(t){return Pe(t)?t():me(t)}const A2={get:(t,e,n)=>e==="__v_raw"?t:me(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const o=t[e];return Ut(o)&&!Ut(n)?(o.value=n,!0):Reflect.set(t,e,n,r)}};function Eb(t){return gs(t)?t:new Proxy(t,A2)}class L2{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new uu,{get:r,set:o}=e(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=o}get value(){return this._value=this._get()}set value(e){this._set(e)}}function Sb(t){return new L2(t)}function BU(t){const e=Te(t)?new Array(t.length):{};for(const n in t)e[n]=Mb(t,n);return e}class O2{constructor(e,n,r){this._object=e,this._key=n,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return d2(Qe(this._object),this._key)}}class N2{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function I2(t,e,n){return Ut(t)?t:Pe(t)?new N2(t):gt(t)&&arguments.length>1?Mb(t,e,n):Q(t)}function Mb(t,e,n){const r=t[e];return Ut(r)?r:new O2(t,e,n)}class R2{constructor(e,n,r){this.fn=e,this.setter=n,this._value=void 0,this.dep=new uu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=cl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&kt!==this)return lb(this,!0),!0}get value(){const e=this.dep.track();return ub(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function P2(t,e,n=!1){let r,o;return Pe(t)?r=t:(r=t.get,o=t.set),new R2(r,o,n)}const HU={GET:"get",HAS:"has",ITERATE:"iterate"},jU={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},ta={},Za=new WeakMap;let vo;function zU(){return vo}function D2(t,e=!1,n=vo){if(n){let r=Za.get(n);r||Za.set(n,r=[]),r.push(t)}}function $2(t,e,n=Xe){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:l,call:a}=n,c=b=>o?b:or(b)||o===!1||o===0?Yr(b,1):Yr(b);let u,d,f,p,h=!1,m=!1;if(Ut(t)?(d=()=>t.value,h=or(t)):gs(t)?(d=()=>c(t),h=!0):Te(t)?(m=!0,h=t.some(b=>gs(b)||or(b)),d=()=>t.map(b=>{if(Ut(b))return b.value;if(gs(b))return c(b);if(Pe(b))return a?a(b,2):b()})):Pe(t)?e?d=a?()=>a(t,2):t:d=()=>{if(f){so();try{f()}finally{io()}}const b=vo;vo=u;try{return a?a(t,3,[p]):t(p)}finally{vo=b}}:d=rr,e&&o){const b=d,_=o===!0?1/0:o;d=()=>Yr(b(),_)}const y=a2(),g=()=>{u.stop(),y&&y.active&&gp(y.effects,u)};if(s&&e){const b=e;e=(..._)=>{b(..._),g()}}let k=m?new Array(t.length).fill(ta):ta;const w=b=>{if(!(!(u.flags&1)||!u.dirty&&!b))if(e){const _=u.run();if(o||h||(m?_.some((M,E)=>Ln(M,k[E])):Ln(_,k))){f&&f();const M=vo;vo=u;try{const E=[_,k===ta?void 0:m&&k[0]===ta?[]:k,p];k=_,a?a(e,3,E):e(...E)}finally{vo=M}}}else u.run()};return l&&l(w),u=new Ja(d),u.scheduler=i?()=>i(w,!1):w,p=b=>D2(b,!1,u),f=u.onStop=()=>{const b=Za.get(u);if(b){if(a)a(b,4);else for(const _ of b)_();Za.delete(u)}},e?r?w(!0):k=u.run():i?i(w.bind(null,!0),!0):u.run(),g.pause=u.pause.bind(u),g.resume=u.resume.bind(u),g.stop=g,g}function Yr(t,e=1/0,n){if(e<=0||!gt(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Ut(t))Yr(t.value,e,n);else if(Te(t))for(let r=0;r<t.length;r++)Yr(t[r],e,n);else if(Os(t)||Zs(t))t.forEach(r=>{Yr(r,e,n)});else if(su(t)){for(const r in t)Yr(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&Yr(t[r],e,n)}return t}/**
10
- * @vue/runtime-core v3.5.21
11
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
- * @license MIT
13
- **/const Tb=[];function F2(t){Tb.push(t)}function V2(){Tb.pop()}function UU(t,e){}const WU={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},B2={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function jl(t,e,n,r){try{return r?t(...r):t()}catch(o){Ei(o,e,n)}}function vr(t,e,n,r){if(Pe(t)){const o=jl(t,e,n,r);return o&&yp(o)&&o.catch(s=>{Ei(s,e,n)}),o}if(Te(t)){const o=[];for(let s=0;s<t.length;s++)o.push(vr(t[s],e,n,r));return o}}function Ei(t,e,n,r=!0){const o=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=e&&e.appContext.config||Xe;if(e){let l=e.parent;const a=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](t,a,c)===!1)return}l=l.parent}if(s){so(),jl(s,null,10,[t,a,c]),io();return}}H2(t,n,o,r,i)}function H2(t,e,n,r=!0,o=!1){if(o)throw t;console.error(t)}const On=[];let Mr=-1;const ti=[];let wo=null,Bs=0;const Ab=Promise.resolve();let Qa=null;function zt(t){const e=Qa||Ab;return t?e.then(this?t.bind(this):t):e}function j2(t){let e=Mr+1,n=On.length;for(;e<n;){const r=e+n>>>1,o=On[r],s=dl(o);s<t||s===t&&o.flags&2?e=r+1:n=r}return e}function Cp(t){if(!(t.flags&1)){const e=dl(t),n=On[On.length-1];!n||!(t.flags&2)&&e>=dl(n)?On.push(t):On.splice(j2(e),0,t),t.flags|=1,Lb()}}function Lb(){Qa||(Qa=Ab.then(Ob))}function ec(t){Te(t)?ti.push(...t):wo&&t.id===-1?wo.splice(Bs+1,0,t):t.flags&1||(ti.push(t),t.flags|=1),Lb()}function Jh(t,e,n=Mr+1){for(;n<On.length;n++){const r=On[n];if(r&&r.flags&2){if(t&&r.id!==t.uid)continue;On.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function tc(t){if(ti.length){const e=[...new Set(ti)].sort((n,r)=>dl(n)-dl(r));if(ti.length=0,wo){wo.push(...e);return}for(wo=e,Bs=0;Bs<wo.length;Bs++){const n=wo[Bs];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}wo=null,Bs=0}}const dl=t=>t.id==null?t.flags&2?-1:1/0:t.id;function Ob(t){try{for(Mr=0;Mr<On.length;Mr++){const e=On[Mr];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),jl(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Mr<On.length;Mr++){const e=On[Mr];e&&(e.flags&=-2)}Mr=-1,On.length=0,tc(),Qa=null,(On.length||ti.length)&&Ob()}}let Hs,na=[];function Nb(t,e){var n,r;Hs=t,Hs?(Hs.enabled=!0,na.forEach(({event:o,args:s})=>Hs.emit(o,...s)),na=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{Nb(s,e)}),setTimeout(()=>{Hs||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,na=[])},3e3)):na=[]}let hn=null,hu=null;function fl(t){const e=hn;return hn=t,hu=t&&t.type.__scopeId||null,e}function KU(t){hu=t}function GU(){hu=null}const qU=t=>Ke;function Ke(t,e=hn,n){if(!e||t._n)return t;const r=(...o)=>{r._d&&ic(-1);const s=fl(e);let i;try{i=t(...o)}finally{fl(s),r._d&&ic(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function nt(t,e){if(hn===null)return t;const n=Wl(hn),r=t.dirs||(t.dirs=[]);for(let o=0;o<e.length;o++){let[s,i,l,a=Xe]=e[o];s&&(Pe(s)&&(s={mounted:s,updated:s}),s.deep&&Yr(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:l,modifiers:a}))}return t}function Or(t,e,n,r){const o=t.dirs,s=e&&e.dirs;for(let i=0;i<o.length;i++){const l=o[i];s&&(l.oldValue=s[i].value);let a=l.dir[r];a&&(so(),vr(a,n,8,[t.el,l,t,e]),io())}}const Ib=Symbol("_vte"),Rb=t=>t.__isTeleport,Ki=t=>t&&(t.disabled||t.disabled===""),Yh=t=>t&&(t.defer||t.defer===""),Xh=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Zh=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Kd=(t,e)=>{const n=t&&t.to;return Et(n)?e?e(n):null:n},Pb={name:"Teleport",__isTeleport:!0,process(t,e,n,r,o,s,i,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:h,createText:m,createComment:y}}=c,g=Ki(e.props);let{shapeFlag:k,children:w,dynamicChildren:b}=e;if(t==null){const _=e.el=m(""),M=e.anchor=m("");p(_,n,r),p(M,n,r);const E=(F,R)=>{k&16&&(o&&o.isCE&&(o.ce._teleportTarget=F),u(w,F,R,o,s,i,l,a))},I=()=>{const F=e.target=Kd(e.props,h),R=Db(F,e,m,p);F&&(i!=="svg"&&Xh(F)?i="svg":i!=="mathml"&&Zh(F)&&(i="mathml"),g||(E(F,R),Ia(e,!1)))};g&&(E(n,M),Ia(e,!0)),Yh(e.props)?(e.el.__isMounted=!1,Zt(()=>{I(),delete e.el.__isMounted},s)):I()}else{if(Yh(e.props)&&t.el.__isMounted===!1){Zt(()=>{Pb.process(t,e,n,r,o,s,i,l,a,c)},s);return}e.el=t.el,e.targetStart=t.targetStart;const _=e.anchor=t.anchor,M=e.target=t.target,E=e.targetAnchor=t.targetAnchor,I=Ki(t.props),F=I?n:M,R=I?_:E;if(i==="svg"||Xh(M)?i="svg":(i==="mathml"||Zh(M))&&(i="mathml"),b?(f(t.dynamicChildren,b,F,o,s,i,l),Rp(t,e,!0)):a||d(t,e,F,R,o,s,i,l,!1),g)I?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):ra(e,n,_,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const $=e.target=Kd(e.props,h);$&&ra(e,$,null,c,0)}else I&&ra(e,M,E,c,1);Ia(e,g)}},remove(t,e,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=t;if(d&&(o(c),o(u)),s&&o(a),i&16){const p=s||!Ki(f);for(let h=0;h<l.length;h++){const m=l[h];r(m,e,n,p,!!m.dynamicChildren)}}},move:ra,hydrate:z2};function ra(t,e,n,{o:{insert:r},m:o},s=2){s===0&&r(t.targetAnchor,e,n);const{el:i,anchor:l,shapeFlag:a,children:c,props:u}=t,d=s===2;if(d&&r(i,e,n),(!d||Ki(u))&&a&16)for(let f=0;f<c.length;f++)o(c[f],e,n,2);d&&r(l,e,n)}function z2(t,e,n,r,o,s,{o:{nextSibling:i,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(m,y,g,k){y.anchor=d(i(m),y,l(m),n,r,o,s),y.targetStart=g,y.targetAnchor=k}const p=e.target=Kd(e.props,a),h=Ki(e.props);if(p){const m=p._lpa||p.firstChild;if(e.shapeFlag&16)if(h)f(t,e,m,m&&i(m));else{e.anchor=i(t);let y=m;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")e.targetStart=y;else if(y.data==="teleport anchor"){e.targetAnchor=y,p._lpa=e.targetAnchor&&i(e.targetAnchor);break}}y=i(y)}e.targetAnchor||Db(p,e,u,c),d(m&&i(m),e,p,n,r,o,s)}Ia(e,h)}else h&&e.shapeFlag&16&&f(t,e,t,i(t));return e.anchor&&i(e.anchor)}const Is=Pb;function Ia(t,e){const n=t.ctx;if(n&&n.ut){let r,o;for(e?(r=t.el,o=t.anchor):(r=t.targetStart,o=t.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Db(t,e,n,r){const o=e.targetStart=n(""),s=e.targetAnchor=n("");return o[Ib]=s,t&&(r(o,t),r(s,t)),s}const qr=Symbol("_leaveCb"),oa=Symbol("_enterCb");function $b(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return rt(()=>{t.isMounted=!0}),uo(()=>{t.isUnmounting=!0}),t}const Yn=[Function,Array],Fb={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Yn,onEnter:Yn,onAfterEnter:Yn,onEnterCancelled:Yn,onBeforeLeave:Yn,onLeave:Yn,onAfterLeave:Yn,onLeaveCancelled:Yn,onBeforeAppear:Yn,onAppear:Yn,onAfterAppear:Yn,onAppearCancelled:Yn},Vb=t=>{const e=t.subTree;return e.component?Vb(e.component):e},U2={name:"BaseTransition",props:Fb,setup(t,{slots:e}){const n=St(),r=$b();return()=>{const o=e.default&&Ep(e.default(),!0);if(!o||!o.length)return;const s=Bb(o),i=Qe(t),{mode:l}=i;if(r.isLeaving)return Xu(s);const a=Qh(s);if(!a)return Xu(s);let c=pl(a,i,r,n,d=>c=d);a.type!==Gt&&Bo(a,c);let u=n.subTree&&Qh(n.subTree);if(u&&u.type!==Gt&&!dr(u,a)&&Vb(n).type!==Gt){let d=pl(u,i,r,n);if(Bo(u,d),l==="out-in"&&a.type!==Gt)return r.isLeaving=!0,d.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Xu(s);l==="in-out"&&a.type!==Gt?d.delayLeave=(f,p,h)=>{const m=Hb(r,u);m[String(u.key)]=u,f[qr]=()=>{p(),f[qr]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{h(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return s}}};function Bb(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==Gt){e=n;break}}return e}const W2=U2;function Hb(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function pl(t,e,n,r,o){const{appear:s,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:y,onAppear:g,onAfterAppear:k,onAppearCancelled:w}=e,b=String(t.key),_=Hb(n,t),M=(F,R)=>{F&&vr(F,r,9,R)},E=(F,R)=>{const $=R[1];M(F,R),Te(F)?F.every(A=>A.length<=1)&&$():F.length<=1&&$()},I={mode:i,persisted:l,beforeEnter(F){let R=a;if(!n.isMounted)if(s)R=y||a;else return;F[qr]&&F[qr](!0);const $=_[b];$&&dr(t,$)&&$.el[qr]&&$.el[qr](),M(R,[F])},enter(F){let R=c,$=u,A=d;if(!n.isMounted)if(s)R=g||c,$=k||u,A=w||d;else return;let q=!1;const Y=F[oa]=Z=>{q||(q=!0,Z?M(A,[F]):M($,[F]),I.delayedLeave&&I.delayedLeave(),F[oa]=void 0)};R?E(R,[F,Y]):Y()},leave(F,R){const $=String(t.key);if(F[oa]&&F[oa](!0),n.isUnmounting)return R();M(f,[F]);let A=!1;const q=F[qr]=Y=>{A||(A=!0,R(),Y?M(m,[F]):M(h,[F]),F[qr]=void 0,_[$]===t&&delete _[$])};_[$]=t,p?E(p,[F,q]):q()},clone(F){const R=pl(F,e,n,r,o);return o&&o(R),R}};return I}function Xu(t){if(zl(t))return t=lo(t),t.children=null,t}function Qh(t){if(!zl(t))return Rb(t.type)&&t.children?Bb(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&Pe(n.default))return n.default()}}function Bo(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Bo(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Ep(t,e=!1,n){let r=[],o=0;for(let s=0;s<t.length;s++){let i=t[s];const l=n==null?i.key:String(n)+String(i.key!=null?i.key:s);i.type===Me?(i.patchFlag&128&&o++,r=r.concat(Ep(i.children,e,l))):(e||i.type!==Gt)&&r.push(l!=null?lo(i,{key:l}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function _e(t,e){return Pe(t)?xt({name:t.name},e,{setup:t}):t}function JU(){const t=St();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function Sp(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function YU(t){const e=St(),n=Hl(null);if(e){const o=e.refs===Xe?e.refs={}:e.refs;Object.defineProperty(o,t,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}return n}const nc=new WeakMap;function ni(t,e,n,r,o=!1){if(Te(t)){t.forEach((h,m)=>ni(h,e&&(Te(e)?e[m]:e),n,r,o));return}if(No(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ni(t,e,n,r.component.subTree);return}const s=r.shapeFlag&4?Wl(r.component):r.el,i=o?null:s,{i:l,r:a}=t,c=e&&e.r,u=l.refs===Xe?l.refs={}:l.refs,d=l.setupState,f=Qe(d),p=d===Xe?Zy:h=>st(f,h);if(c!=null&&c!==a){if(em(e),Et(c))u[c]=null,p(c)&&(d[c]=null);else if(Ut(c)){c.value=null;const h=e;h.k&&(u[h.k]=null)}}if(Pe(a))jl(a,l,12,[i,u]);else{const h=Et(a),m=Ut(a);if(h||m){const y=()=>{if(t.f){const g=h?p(a)?d[a]:u[a]:a.value;if(o)Te(g)&&gp(g,s);else if(Te(g))g.includes(s)||g.push(s);else if(h)u[a]=[s],p(a)&&(d[a]=u[a]);else{const k=[s];a.value=k,t.k&&(u[t.k]=k)}}else h?(u[a]=i,p(a)&&(d[a]=i)):m&&(a.value=i,t.k&&(u[t.k]=i))};if(i){const g=()=>{y(),nc.delete(t)};g.id=-1,nc.set(t,g),Zt(g,n)}else em(t),y()}}}function em(t){const e=nc.get(t);e&&(e.flags|=8,nc.delete(t))}let tm=!1;const $s=()=>{tm||(console.error("Hydration completed but contains mismatches."),tm=!0)},K2=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",G2=t=>t.namespaceURI.includes("MathML"),sa=t=>{if(t.nodeType===1){if(K2(t))return"svg";if(G2(t))return"mathml"}},Js=t=>t.nodeType===8;function q2(t){const{mt:e,p:n,o:{patchProp:r,createText:o,nextSibling:s,parentNode:i,remove:l,insert:a,createComment:c}}=t,u=(w,b)=>{if(!b.hasChildNodes()){n(null,w,b),tc(),b._vnode=w;return}d(b.firstChild,w,null,null,null),tc(),b._vnode=w},d=(w,b,_,M,E,I=!1)=>{I=I||!!b.dynamicChildren;const F=Js(w)&&w.data==="[",R=()=>m(w,b,_,M,E,F),{type:$,ref:A,shapeFlag:q,patchFlag:Y}=b;let Z=w.nodeType;b.el=w,Y===-2&&(I=!1,b.dynamicChildren=null);let K=null;switch($){case ro:Z!==3?b.children===""?(a(b.el=o(""),i(w),w),K=w):K=R():(w.data!==b.children&&($s(),w.data=b.children),K=s(w));break;case Gt:k(w)?(K=s(w),g(b.el=w.content.firstChild,w,_)):Z!==8||F?K=R():K=s(w);break;case oi:if(F&&(w=s(w),Z=w.nodeType),Z===1||Z===3){K=w;const X=!b.children.length;for(let G=0;G<b.staticCount;G++)X&&(b.children+=K.nodeType===1?K.outerHTML:K.data),G===b.staticCount-1&&(b.anchor=K),K=s(K);return F?s(K):K}else R();break;case Me:F?K=h(w,b,_,M,E,I):K=R();break;default:if(q&1)(Z!==1||b.type.toLowerCase()!==w.tagName.toLowerCase())&&!k(w)?K=R():K=f(w,b,_,M,E,I);else if(q&6){b.slotScopeIds=E;const X=i(w);if(F?K=y(w):Js(w)&&w.data==="teleport start"?K=y(w,w.data,"teleport end"):K=s(w),e(b,X,null,_,M,sa(X),I),No(b)&&!b.type.__asyncResolved){let G;F?(G=ce(Me),G.anchor=K?K.previousSibling:X.lastChild):G=w.nodeType===3?xn(""):ce("div"),G.el=w,b.component.subTree=G}}else q&64?Z!==8?K=R():K=b.type.hydrate(w,b,_,M,E,I,t,p):q&128&&(K=b.type.hydrate(w,b,_,M,sa(i(w)),E,I,t,d))}return A!=null&&ni(A,null,M,b),K},f=(w,b,_,M,E,I)=>{I=I||!!b.dynamicChildren;const{type:F,props:R,patchFlag:$,shapeFlag:A,dirs:q,transition:Y}=b,Z=F==="input"||F==="option";if(Z||$!==-1){q&&Or(b,null,_,"created");let K=!1;if(k(w)){K=rv(null,Y)&&_&&_.vnode.props&&_.vnode.props.appear;const G=w.content.firstChild;if(K){const ne=G.getAttribute("class");ne&&(G.$cls=ne),Y.beforeEnter(G)}g(G,w,_),b.el=w=G}if(A&16&&!(R&&(R.innerHTML||R.textContent))){let G=p(w.firstChild,b,w,_,M,E,I);for(;G;){ia(w,1)||$s();const ne=G;G=G.nextSibling,l(ne)}}else if(A&8){let G=b.children;G[0]===`
14
- `&&(w.tagName==="PRE"||w.tagName==="TEXTAREA")&&(G=G.slice(1)),w.textContent!==G&&(ia(w,0)||$s(),w.textContent=b.children)}if(R){if(Z||!I||$&48){const G=w.tagName.includes("-");for(const ne in R)(Z&&(ne.endsWith("value")||ne==="indeterminate")||Bl(ne)&&!Qs(ne)||ne[0]==="."||G)&&r(w,ne,null,R[ne],void 0,_)}else if(R.onClick)r(w,"onClick",null,R.onClick,void 0,_);else if($&4&&gs(R.style))for(const G in R.style)R.style[G]}let X;(X=R&&R.onVnodeBeforeMount)&&Pn(X,_,b),q&&Or(b,null,_,"beforeMount"),((X=R&&R.onVnodeMounted)||q||K)&&uv(()=>{X&&Pn(X,_,b),K&&Y.enter(w),q&&Or(b,null,_,"mounted")},M)}return w.nextSibling},p=(w,b,_,M,E,I,F)=>{F=F||!!b.dynamicChildren;const R=b.children,$=R.length;for(let A=0;A<$;A++){const q=F?R[A]:R[A]=Dn(R[A]),Y=q.type===ro;w?(Y&&!F&&A+1<$&&Dn(R[A+1]).type===ro&&(a(o(w.data.slice(q.children.length)),_,s(w)),w.data=q.children),w=d(w,q,M,E,I,F)):Y&&!q.children?a(q.el=o(""),_):(ia(_,1)||$s(),n(null,q,_,null,M,E,sa(_),I))}return w},h=(w,b,_,M,E,I)=>{const{slotScopeIds:F}=b;F&&(E=E?E.concat(F):F);const R=i(w),$=p(s(w),b,R,_,M,E,I);return $&&Js($)&&$.data==="]"?s(b.anchor=$):($s(),a(b.anchor=c("]"),R,$),$)},m=(w,b,_,M,E,I)=>{if(ia(w.parentElement,1)||$s(),b.el=null,I){const $=y(w);for(;;){const A=s(w);if(A&&A!==$)l(A);else break}}const F=s(w),R=i(w);return l(w),n(null,b,R,F,_,M,sa(R),E),_&&(_.vnode.el=b.el,yu(_,b.el)),F},y=(w,b="[",_="]")=>{let M=0;for(;w;)if(w=s(w),w&&Js(w)&&(w.data===b&&M++,w.data===_)){if(M===0)return s(w);M--}return w},g=(w,b,_)=>{const M=b.parentNode;M&&M.replaceChild(w,b);let E=_;for(;E;)E.vnode.el===b&&(E.vnode.el=E.subTree.el=w),E=E.parent},k=w=>w.nodeType===1&&w.tagName==="TEMPLATE";return[u,d]}const nm="data-allow-mismatch",J2={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function ia(t,e){if(e===0||e===1)for(;t&&!t.hasAttribute(nm);)t=t.parentElement;const n=t&&t.getAttribute(nm);if(n==null)return!1;if(n==="")return!0;{const r=n.split(",");return e===0&&r.includes("children")?!0:r.includes(J2[e])}}const Y2=au().requestIdleCallback||(t=>setTimeout(t,1)),X2=au().cancelIdleCallback||(t=>clearTimeout(t)),XU=(t=1e4)=>e=>{const n=Y2(e,{timeout:t});return()=>X2(n)};function Z2(t){const{top:e,left:n,bottom:r,right:o}=t.getBoundingClientRect(),{innerHeight:s,innerWidth:i}=window;return(e>0&&e<s||r>0&&r<s)&&(n>0&&n<i||o>0&&o<i)}const ZU=t=>(e,n)=>{const r=new IntersectionObserver(o=>{for(const s of o)if(s.isIntersecting){r.disconnect(),e();break}},t);return n(o=>{if(o instanceof Element){if(Z2(o))return e(),r.disconnect(),!1;r.observe(o)}}),()=>r.disconnect()},QU=t=>e=>{if(t){const n=matchMedia(t);if(n.matches)e();else return n.addEventListener("change",e,{once:!0}),()=>n.removeEventListener("change",e)}},eW=(t=[])=>(e,n)=>{Et(t)&&(t=[t]);let r=!1;const o=i=>{r||(r=!0,s(),e(),i.target.dispatchEvent(new i.constructor(i.type,i)))},s=()=>{n(i=>{for(const l of t)i.removeEventListener(l,o)})};return n(i=>{for(const l of t)i.addEventListener(l,o,{once:!0})}),s};function Q2(t,e){if(Js(t)&&t.data==="["){let n=1,r=t.nextSibling;for(;r;){if(r.nodeType===1){if(e(r)===!1)break}else if(Js(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else e(t)}const No=t=>!!t.type.__asyncLoader;function tW(t){Pe(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:l=!0,onError:a}=t;let c=null,u,d=0;const f=()=>(d++,c=null,p()),p=()=>{let h;return c||(h=c=e().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((y,g)=>{a(m,()=>y(f()),()=>g(m),d+1)});throw m}).then(m=>h!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return _e({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(h,m,y){let g=!1;(m.bu||(m.bu=[])).push(()=>g=!0);const k=()=>{g||y()},w=s?()=>{const b=s(k,_=>Q2(h,_));b&&(m.bum||(m.bum=[])).push(b)}:k;u?w():p().then(()=>!m.isUnmounted&&w())},get __asyncResolved(){return u},setup(){const h=pn;if(Sp(h),u)return()=>Zu(u,h);const m=w=>{c=null,Ei(w,h,13,!r)};if(l&&h.suspense||ci)return p().then(w=>()=>Zu(w,h)).catch(w=>(m(w),()=>r?ce(r,{error:w}):null));const y=Q(!1),g=Q(),k=Q(!!o);return o&&setTimeout(()=>{k.value=!1},o),i!=null&&setTimeout(()=>{if(!y.value&&!g.value){const w=new Error(`Async component timed out after ${i}ms.`);m(w),g.value=w}},i),p().then(()=>{y.value=!0,h.parent&&zl(h.parent.vnode)&&h.parent.update()}).catch(w=>{m(w),g.value=w}),()=>{if(y.value&&u)return Zu(u,h);if(g.value&&r)return ce(r,{error:g.value});if(n&&!k.value)return ce(n)}}})}function Zu(t,e){const{ref:n,props:r,children:o,ce:s}=e.vnode,i=ce(t,r,o);return i.ref=n,i.ce=s,delete e.vnode.ce,i}const zl=t=>t.type.__isKeepAlive,e_={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const n=St(),r=n.ctx;if(!r.renderer)return()=>{const k=e.default&&e.default();return k&&k.length===1?k[0]:k};const o=new Map,s=new Set;let i=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=r,f=d("div");r.activate=(k,w,b,_,M)=>{const E=k.component;c(k,w,b,0,l),a(E.vnode,k,w,b,E,l,_,k.slotScopeIds,M),Zt(()=>{E.isDeactivated=!1,E.a&&ei(E.a);const I=k.props&&k.props.onVnodeMounted;I&&Pn(I,E.parent,k)},l)},r.deactivate=k=>{const w=k.component;oc(w.m),oc(w.a),c(k,f,null,1,l),Zt(()=>{w.da&&ei(w.da);const b=k.props&&k.props.onVnodeUnmounted;b&&Pn(b,w.parent,k),w.isDeactivated=!0},l)};function p(k){Qu(k),u(k,n,l,!0)}function h(k){o.forEach((w,b)=>{const _=rf(w.type);_&&!k(_)&&m(b)})}function m(k){const w=o.get(k);w&&(!i||!dr(w,i))?p(w):i&&Qu(i),o.delete(k),s.delete(k)}Re(()=>[t.include,t.exclude],([k,w])=>{k&&h(b=>Fi(k,b)),w&&h(b=>!Fi(w,b))},{flush:"post",deep:!0});let y=null;const g=()=>{y!=null&&(sc(n.subTree.type)?Zt(()=>{o.set(y,la(n.subTree))},n.subTree.suspense):o.set(y,la(n.subTree)))};return rt(g),Mp(g),uo(()=>{o.forEach(k=>{const{subTree:w,suspense:b}=n,_=la(w);if(k.type===_.type&&k.key===_.key){Qu(_);const M=_.component.da;M&&Zt(M,b);return}p(k)})}),()=>{if(y=null,!e.default)return i=null;const k=e.default(),w=k[0];if(k.length>1)return i=null,k;if(!Ho(w)||!(w.shapeFlag&4)&&!(w.shapeFlag&128))return i=null,w;let b=la(w);if(b.type===Gt)return i=null,b;const _=b.type,M=rf(No(b)?b.type.__asyncResolved||{}:_),{include:E,exclude:I,max:F}=t;if(E&&(!M||!Fi(E,M))||I&&M&&Fi(I,M))return b.shapeFlag&=-257,i=b,w;const R=b.key==null?_:b.key,$=o.get(R);return b.el&&(b=lo(b),w.shapeFlag&128&&(w.ssContent=b)),y=R,$?(b.el=$.el,b.component=$.component,b.transition&&Bo(b,b.transition),b.shapeFlag|=512,s.delete(R),s.add(R)):(s.add(R),F&&s.size>parseInt(F,10)&&m(s.values().next().value)),b.shapeFlag|=256,i=b,sc(w.type)?w:b}}},nW=e_;function Fi(t,e){return Te(t)?t.some(n=>Fi(n,e)):Et(t)?t.split(",").includes(e):qk(t)?(t.lastIndex=0,t.test(e)):!1}function t_(t,e){jb(t,"a",e)}function n_(t,e){jb(t,"da",e)}function jb(t,e,n=pn){const r=t.__wdc||(t.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return t()});if(mu(e,r,n),n){let o=n.parent;for(;o&&o.parent;)zl(o.parent.vnode)&&r_(r,e,n,o),o=o.parent}}function r_(t,e,n,r){const o=mu(e,t,r,!0);gn(()=>{gp(r[e],o)},n)}function Qu(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function la(t){return t.shapeFlag&128?t.ssContent:t}function mu(t,e,n=pn,r=!1){if(n){const o=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...i)=>{so();const l=Cs(n),a=vr(e,n,t,i);return l(),io(),a});return r?o.unshift(s):o.push(s),s}}const co=t=>(e,n=pn)=>{(!ci||t==="sp")&&mu(t,(...r)=>e(...r),n)},o_=co("bm"),rt=co("m"),zb=co("bu"),Mp=co("u"),uo=co("bum"),gn=co("um"),s_=co("sp"),i_=co("rtg"),l_=co("rtc");function a_(t,e=pn){mu("ec",t,e)}const Tp="components",c_="directives";function yr(t,e){return Ap(Tp,t,!0,e)||t}const Ub=Symbol.for("v-ndc");function Cn(t){return Et(t)?Ap(Tp,t,!1)||t:t||Ub}function rW(t){return Ap(c_,t)}function Ap(t,e,n=!0,r=!1){const o=hn||pn;if(o){const s=o.type;if(t===Tp){const l=rf(s,!1);if(l&&(l===e||l===_n(e)||l===lu(_n(e))))return s}const i=rm(o[t]||s[t],e)||rm(o.appContext[t],e);return!i&&r?s:i}}function rm(t,e){return t&&(t[e]||t[_n(e)]||t[lu(_n(e))])}function Je(t,e,n,r){let o;const s=n&&n[r],i=Te(t);if(i||Et(t)){const l=i&&gs(t);let a=!1,c=!1;l&&(a=!or(t),c=Vo(t),t=du(t)),o=new Array(t.length);for(let u=0,d=t.length;u<d;u++)o[u]=e(a?c?Xa(un(t[u])):un(t[u]):t[u],u,void 0,s&&s[u])}else if(typeof t=="number"){o=new Array(t);for(let l=0;l<t;l++)o[l]=e(l+1,l,void 0,s&&s[l])}else if(gt(t))if(t[Symbol.iterator])o=Array.from(t,(l,a)=>e(l,a,void 0,s&&s[a]));else{const l=Object.keys(t);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=e(t[u],u,a,s&&s[a])}}else o=[];return n&&(n[r]=o),o}function oW(t,e){for(let n=0;n<e.length;n++){const r=e[n];if(Te(r))for(let o=0;o<r.length;o++)t[r[o].name]=r[o].fn;else r&&(t[r.name]=r.key?(...o)=>{const s=r.fn(...o);return s&&(s.key=r.key),s}:r.fn)}return t}function mn(t,e,n={},r,o){if(hn.ce||hn.parent&&No(hn.parent)&&hn.parent.ce)return e!=="default"&&(n.name=e),S(),Ae(Me,null,[ce("slot",n,r&&r())],64);let s=t[e];s&&s._c&&(s._d=!1),S();const i=s&&Lp(s(n)),l=n.key||i&&i.key,a=Ae(Me,{key:(l&&!br(l)?l:`_${e}`)+(!i&&r?"_fb":"")},i||(r?r():[]),i&&t._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),s&&s._c&&(s._d=!0),a}function Lp(t){return t.some(e=>Ho(e)?!(e.type===Gt||e.type===Me&&!Lp(e.children)):!0)?t:null}function sW(t,e){const n={};for(const r in t)n[e&&/[A-Z]/.test(r)?`on:${r}`:Na(r)]=t[r];return n}const Gd=t=>t?mv(t)?Wl(t):Gd(t.parent):null,Gi=xt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Gd(t.parent),$root:t=>Gd(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Op(t),$forceUpdate:t=>t.f||(t.f=()=>{Cp(t.update)}),$nextTick:t=>t.n||(t.n=zt.bind(t.proxy)),$watch:t=>O_.bind(t)}),ed=(t,e)=>t!==Xe&&!t.__isScriptSetup&&st(t,e),qd={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:s,accessCache:i,type:l,appContext:a}=t;let c;if(e[0]!=="$"){const p=i[e];if(p!==void 0)switch(p){case 1:return r[e];case 2:return o[e];case 4:return n[e];case 3:return s[e]}else{if(ed(r,e))return i[e]=1,r[e];if(o!==Xe&&st(o,e))return i[e]=2,o[e];if((c=t.propsOptions[0])&&st(c,e))return i[e]=3,s[e];if(n!==Xe&&st(n,e))return i[e]=4,n[e];Jd&&(i[e]=0)}}const u=Gi[e];let d,f;if(u)return e==="$attrs"&&vn(t.attrs,"get",""),u(t);if((d=l.__cssModules)&&(d=d[e]))return d;if(n!==Xe&&st(n,e))return i[e]=4,n[e];if(f=a.config.globalProperties,st(f,e))return f[e]},set({_:t},e,n){const{data:r,setupState:o,ctx:s}=t;return ed(o,e)?(o[e]=n,!0):r!==Xe&&st(r,e)?(r[e]=n,!0):st(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:o,propsOptions:s,type:i}},l){let a,c;return!!(n[l]||t!==Xe&&l[0]!=="$"&&st(t,l)||ed(e,l)||(a=s[0])&&st(a,l)||st(r,l)||st(Gi,l)||st(o.config.globalProperties,l)||(c=i.__cssModules)&&c[l])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:st(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}},u_=xt({},qd,{get(t,e){if(e!==Symbol.unscopables)return qd.get(t,e,t)},has(t,e){return e[0]!=="_"&&!Qk(e)}});function iW(){return null}function lW(){return null}function aW(t){}function cW(t){}function uW(){return null}function dW(){}function fW(t,e){return null}function pW(){return Wb().slots}function d_(){return Wb().attrs}function Wb(t){const e=St();return e.setupContext||(e.setupContext=bv(e))}function hl(t){return Te(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function hW(t,e){const n=hl(t);for(const r in e){if(r.startsWith("__skip"))continue;let o=n[r];o?Te(o)||Pe(o)?o=n[r]={type:o,default:e[r]}:o.default=e[r]:o===null&&(o=n[r]={default:e[r]}),o&&e[`__skip_${r}`]&&(o.skipFactory=!0)}return n}function yt(t,e){return!t||!e?t||e:Te(t)&&Te(e)?t.concat(e):xt({},hl(t),hl(e))}function mW(t,e){const n={};for(const r in t)e.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>t[r]});return n}function gW(t){const e=St();let n=t();return ef(),yp(n)&&(n=n.catch(r=>{throw Cs(e),r})),[n,()=>Cs(e)]}let Jd=!0;function f_(t){const e=Op(t),n=t.proxy,r=t.ctx;Jd=!1,e.beforeCreate&&om(e.beforeCreate,t,"bc");const{data:o,computed:s,methods:i,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:h,activated:m,deactivated:y,beforeDestroy:g,beforeUnmount:k,destroyed:w,unmounted:b,render:_,renderTracked:M,renderTriggered:E,errorCaptured:I,serverPrefetch:F,expose:R,inheritAttrs:$,components:A,directives:q,filters:Y}=e;if(c&&p_(c,r,null),i)for(const X in i){const G=i[X];Pe(G)&&(r[X]=G.bind(n))}if(o){const X=o.call(n,n);gt(X)&&(t.data=Ns(X))}if(Jd=!0,s)for(const X in s){const G=s[X],ne=Pe(G)?G.bind(n,n):Pe(G.get)?G.get.bind(n,n):rr,Le=!Pe(G)&&Pe(G.set)?G.set.bind(n):rr,je=te({get:ne,set:Le});Object.defineProperty(r,X,{enumerable:!0,configurable:!0,get:()=>je.value,set:Be=>je.value=Be})}if(l)for(const X in l)Kb(l[X],r,n,X);if(a){const X=Pe(a)?a.call(n):a;Reflect.ownKeys(X).forEach(G=>{Io(G,X[G])})}u&&om(u,t,"c");function K(X,G){Te(G)?G.forEach(ne=>X(ne.bind(n))):G&&X(G.bind(n))}if(K(o_,d),K(rt,f),K(zb,p),K(Mp,h),K(t_,m),K(n_,y),K(a_,I),K(l_,M),K(i_,E),K(uo,k),K(gn,b),K(s_,F),Te(R))if(R.length){const X=t.exposed||(t.exposed={});R.forEach(G=>{Object.defineProperty(X,G,{get:()=>n[G],set:ne=>n[G]=ne,enumerable:!0})})}else t.exposed||(t.exposed={});_&&t.render===rr&&(t.render=_),$!=null&&(t.inheritAttrs=$),A&&(t.components=A),q&&(t.directives=q),F&&Sp(t)}function p_(t,e,n=rr){Te(t)&&(t=Yd(t));for(const r in t){const o=t[r];let s;gt(o)?"default"in o?s=Wt(o.from||r,o.default,!0):s=Wt(o.from||r):s=Wt(o),Ut(s)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:i=>s.value=i}):e[r]=s}}function om(t,e,n){vr(Te(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function Kb(t,e,n,r){let o=r.includes(".")?iv(n,r):()=>n[r];if(Et(t)){const s=e[t];Pe(s)&&Re(o,s)}else if(Pe(t))Re(o,t.bind(n));else if(gt(t))if(Te(t))t.forEach(s=>Kb(s,e,n,r));else{const s=Pe(t.handler)?t.handler.bind(n):e[t.handler];Pe(s)&&Re(o,s,t)}}function Op(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=t.appContext,l=s.get(e);let a;return l?a=l:!o.length&&!n&&!r?a=e:(a={},o.length&&o.forEach(c=>rc(a,c,i,!0)),rc(a,e,i)),gt(e)&&s.set(e,a),a}function rc(t,e,n,r=!1){const{mixins:o,extends:s}=e;s&&rc(t,s,n,!0),o&&o.forEach(i=>rc(t,i,n,!0));for(const i in e)if(!(r&&i==="expose")){const l=h_[i]||n&&n[i];t[i]=l?l(t[i],e[i]):e[i]}return t}const h_={data:sm,props:im,emits:im,methods:Vi,computed:Vi,beforeCreate:Mn,created:Mn,beforeMount:Mn,mounted:Mn,beforeUpdate:Mn,updated:Mn,beforeDestroy:Mn,beforeUnmount:Mn,destroyed:Mn,unmounted:Mn,activated:Mn,deactivated:Mn,errorCaptured:Mn,serverPrefetch:Mn,components:Vi,directives:Vi,watch:g_,provide:sm,inject:m_};function sm(t,e){return e?t?function(){return xt(Pe(t)?t.call(this,this):t,Pe(e)?e.call(this,this):e)}:e:t}function m_(t,e){return Vi(Yd(t),Yd(e))}function Yd(t){if(Te(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Mn(t,e){return t?[...new Set([].concat(t,e))]:e}function Vi(t,e){return t?xt(Object.create(null),t,e):e}function im(t,e){return t?Te(t)&&Te(e)?[...new Set([...t,...e])]:xt(Object.create(null),hl(t),hl(e??{})):e}function g_(t,e){if(!t)return e;if(!e)return t;const n=xt(Object.create(null),t);for(const r in e)n[r]=Mn(t[r],e[r]);return n}function Gb(){return{app:null,config:{isNativeTag:Zy,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let y_=0;function b_(t,e){return function(r,o=null){Pe(r)||(r=xt({},r)),o!=null&&!gt(o)&&(o=null);const s=Gb(),i=new WeakSet,l=[];let a=!1;const c=s.app={_uid:y_++,_component:r,_props:o,_container:null,_context:s,_instance:null,version:X_,get config(){return s.config},set config(u){},use(u,...d){return i.has(u)||(u&&Pe(u.install)?(i.add(u),u.install(c,...d)):Pe(u)&&(i.add(u),u(c,...d))),c},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),c},component(u,d){return d?(s.components[u]=d,c):s.components[u]},directive(u,d){return d?(s.directives[u]=d,c):s.directives[u]},mount(u,d,f){if(!a){const p=c._ceVNode||ce(r,o);return p.appContext=s,f===!0?f="svg":f===!1&&(f=void 0),d&&e?e(p,u):t(p,u,f),a=!0,c._container=u,u.__vue_app__=c,Wl(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(vr(l,c._instance,16),t(null,c._container),delete c._container.__vue_app__)},provide(u,d){return s.provides[u]=d,c},runWithContext(u){const d=ys;ys=c;try{return u()}finally{ys=d}}};return c}}let ys=null;function Io(t,e){if(pn){let n=pn.provides;const r=pn.parent&&pn.parent.provides;r===n&&(n=pn.provides=Object.create(r)),n[t]=e}}function Wt(t,e,n=!1){const r=St();if(r||ys){let o=ys?ys._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&t in o)return o[t];if(arguments.length>1)return n&&Pe(e)?e.call(r&&r.proxy):e}}function yW(){return!!(St()||ys)}const qb={},Jb=()=>Object.create(qb),Yb=t=>Object.getPrototypeOf(t)===qb;function v_(t,e,n,r=!1){const o={},s=Jb();t.propsDefaults=Object.create(null),Xb(t,e,o,s);for(const i in t.propsOptions[0])i in o||(o[i]=void 0);n?t.props=r?o:xb(o):t.type.props?t.props=o:t.props=s,t.attrs=s}function w_(t,e,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=t,l=Qe(o),[a]=t.propsOptions;let c=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=t.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(gu(t.emitsOptions,f))continue;const p=e[f];if(a)if(st(s,f))p!==s[f]&&(s[f]=p,c=!0);else{const h=_n(f);o[h]=Xd(a,l,h,p,t,!1)}else p!==s[f]&&(s[f]=p,c=!0)}}}else{Xb(t,e,o,s)&&(c=!0);let u;for(const d in l)(!e||!st(e,d)&&((u=Fn(d))===d||!st(e,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=Xd(a,l,d,void 0,t,!0)):delete o[d]);if(s!==l)for(const d in s)(!e||!st(e,d))&&(delete s[d],c=!0)}c&&Jr(t.attrs,"set","")}function Xb(t,e,n,r){const[o,s]=t.propsOptions;let i=!1,l;if(e)for(let a in e){if(Qs(a))continue;const c=e[a];let u;o&&st(o,u=_n(a))?!s||!s.includes(u)?n[u]=c:(l||(l={}))[u]=c:gu(t.emitsOptions,a)||(!(a in r)||c!==r[a])&&(r[a]=c,i=!0)}if(s){const a=Qe(n),c=l||Xe;for(let u=0;u<s.length;u++){const d=s[u];n[d]=Xd(o,a,d,c[d],t,!st(c,d))}}return i}function Xd(t,e,n,r,o,s){const i=t[n];if(i!=null){const l=st(i,"default");if(l&&r===void 0){const a=i.default;if(i.type!==Function&&!i.skipFactory&&Pe(a)){const{propsDefaults:c}=o;if(n in c)r=c[n];else{const u=Cs(o);r=c[n]=a.call(null,e),u()}}else r=a;o.ce&&o.ce._setProp(n,r)}i[0]&&(s&&!l?r=!1:i[1]&&(r===""||r===Fn(n))&&(r=!0))}return r}const x_=new WeakMap;function Zb(t,e,n=!1){const r=n?x_:e.propsCache,o=r.get(t);if(o)return o;const s=t.props,i={},l=[];let a=!1;if(!Pe(t)){const u=d=>{a=!0;const[f,p]=Zb(d,e,!0);xt(i,f),p&&l.push(...p)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!s&&!a)return gt(t)&&r.set(t,Xs),Xs;if(Te(s))for(let u=0;u<s.length;u++){const d=_n(s[u]);lm(d)&&(i[d]=Xe)}else if(s)for(const u in s){const d=_n(u);if(lm(d)){const f=s[u],p=i[d]=Te(f)||Pe(f)?{type:f}:xt({},f),h=p.type;let m=!1,y=!0;if(Te(h))for(let g=0;g<h.length;++g){const k=h[g],w=Pe(k)&&k.name;if(w==="Boolean"){m=!0;break}else w==="String"&&(y=!1)}else m=Pe(h)&&h.name==="Boolean";p[0]=m,p[1]=y,(m||st(p,"default"))&&l.push(d)}}const c=[i,l];return gt(t)&&r.set(t,c),c}function lm(t){return t[0]!=="$"&&!Qs(t)}const Np=t=>t==="_"||t==="_ctx"||t==="$stable",Ip=t=>Te(t)?t.map(Dn):[Dn(t)],k_=(t,e,n)=>{if(e._n)return e;const r=Ke((...o)=>Ip(e(...o)),n);return r._c=!1,r},Qb=(t,e,n)=>{const r=t._ctx;for(const o in t){if(Np(o))continue;const s=t[o];if(Pe(s))e[o]=k_(o,s,r);else if(s!=null){const i=Ip(s);e[o]=()=>i}}},ev=(t,e)=>{const n=Ip(e);t.slots.default=()=>n},tv=(t,e,n)=>{for(const r in e)(n||!Np(r))&&(t[r]=e[r])},__=(t,e,n)=>{const r=t.slots=Jb();if(t.vnode.shapeFlag&32){const o=e._;o?(tv(r,e,n),n&&eb(r,"_",o,!0)):Qb(e,r)}else e&&ev(t,e)},C_=(t,e,n)=>{const{vnode:r,slots:o}=t;let s=!0,i=Xe;if(r.shapeFlag&32){const l=e._;l?n&&l===1?s=!1:tv(o,e,n):(s=!e.$stable,Qb(e,o)),i=e}else e&&(ev(t,e),i={default:1});if(s)for(const l in o)!Np(l)&&i[l]==null&&delete o[l]},Zt=uv;function E_(t){return nv(t)}function S_(t){return nv(t,q2)}function nv(t,e){const n=au();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:i,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=rr,insertStaticContent:h}=t,m=(O,B,J,ie=null,re=null,x=null,C=void 0,N=null,H=!!B.dynamicChildren)=>{if(O===B)return;O&&!dr(O,B)&&(ie=oe(O),Be(O,re,x,!0),O=null),B.patchFlag===-2&&(H=!1,B.dynamicChildren=null);const{type:D,ref:z,shapeFlag:V}=B;switch(D){case ro:y(O,B,J,ie);break;case Gt:g(O,B,J,ie);break;case oi:O==null&&k(B,J,ie,C);break;case Me:A(O,B,J,ie,re,x,C,N,H);break;default:V&1?_(O,B,J,ie,re,x,C,N,H):V&6?q(O,B,J,ie,re,x,C,N,H):(V&64||V&128)&&D.process(O,B,J,ie,re,x,C,N,H,xe)}z!=null&&re?ni(z,O&&O.ref,x,B||O,!B):z==null&&O&&O.ref!=null&&ni(O.ref,null,x,O,!0)},y=(O,B,J,ie)=>{if(O==null)r(B.el=l(B.children),J,ie);else{const re=B.el=O.el;B.children!==O.children&&c(re,B.children)}},g=(O,B,J,ie)=>{O==null?r(B.el=a(B.children||""),J,ie):B.el=O.el},k=(O,B,J,ie)=>{[O.el,O.anchor]=h(O.children,B,J,ie,O.el,O.anchor)},w=({el:O,anchor:B},J,ie)=>{let re;for(;O&&O!==B;)re=f(O),r(O,J,ie),O=re;r(B,J,ie)},b=({el:O,anchor:B})=>{let J;for(;O&&O!==B;)J=f(O),o(O),O=J;o(B)},_=(O,B,J,ie,re,x,C,N,H)=>{B.type==="svg"?C="svg":B.type==="math"&&(C="mathml"),O==null?M(B,J,ie,re,x,C,N,H):F(O,B,re,x,C,N,H)},M=(O,B,J,ie,re,x,C,N)=>{let H,D;const{props:z,shapeFlag:V,transition:W,dirs:he}=O;if(H=O.el=i(O.type,x,z&&z.is,z),V&8?u(H,O.children):V&16&&I(O.children,H,null,ie,re,td(O,x),C,N),he&&Or(O,null,ie,"created"),E(H,O,O.scopeId,C,ie),z){for(const De in z)De!=="value"&&!Qs(De)&&s(H,De,null,z[De],x,ie);"value"in z&&s(H,"value",null,z.value,x),(D=z.onVnodeBeforeMount)&&Pn(D,ie,O)}he&&Or(O,null,ie,"beforeMount");const Ce=rv(re,W);Ce&&W.beforeEnter(H),r(H,B,J),((D=z&&z.onVnodeMounted)||Ce||he)&&Zt(()=>{D&&Pn(D,ie,O),Ce&&W.enter(H),he&&Or(O,null,ie,"mounted")},re)},E=(O,B,J,ie,re)=>{if(J&&p(O,J),ie)for(let x=0;x<ie.length;x++)p(O,ie[x]);if(re){let x=re.subTree;if(B===x||sc(x.type)&&(x.ssContent===B||x.ssFallback===B)){const C=re.vnode;E(O,C,C.scopeId,C.slotScopeIds,re.parent)}}},I=(O,B,J,ie,re,x,C,N,H=0)=>{for(let D=H;D<O.length;D++){const z=O[D]=N?xo(O[D]):Dn(O[D]);m(null,z,B,J,ie,re,x,C,N)}},F=(O,B,J,ie,re,x,C)=>{const N=B.el=O.el;let{patchFlag:H,dynamicChildren:D,dirs:z}=B;H|=O.patchFlag&16;const V=O.props||Xe,W=B.props||Xe;let he;if(J&&ss(J,!1),(he=W.onVnodeBeforeUpdate)&&Pn(he,J,B,O),z&&Or(B,O,J,"beforeUpdate"),J&&ss(J,!0),(V.innerHTML&&W.innerHTML==null||V.textContent&&W.textContent==null)&&u(N,""),D?R(O.dynamicChildren,D,N,J,ie,td(B,re),x):C||G(O,B,N,null,J,ie,td(B,re),x,!1),H>0){if(H&16)$(N,V,W,J,re);else if(H&2&&V.class!==W.class&&s(N,"class",null,W.class,re),H&4&&s(N,"style",V.style,W.style,re),H&8){const Ce=B.dynamicProps;for(let De=0;De<Ce.length;De++){const P=Ce[De],j=V[P],se=W[P];(se!==j||P==="value")&&s(N,P,j,se,re,J)}}H&1&&O.children!==B.children&&u(N,B.children)}else!C&&D==null&&$(N,V,W,J,re);((he=W.onVnodeUpdated)||z)&&Zt(()=>{he&&Pn(he,J,B,O),z&&Or(B,O,J,"updated")},ie)},R=(O,B,J,ie,re,x,C)=>{for(let N=0;N<B.length;N++){const H=O[N],D=B[N],z=H.el&&(H.type===Me||!dr(H,D)||H.shapeFlag&198)?d(H.el):J;m(H,D,z,null,ie,re,x,C,!0)}},$=(O,B,J,ie,re)=>{if(B!==J){if(B!==Xe)for(const x in B)!Qs(x)&&!(x in J)&&s(O,x,B[x],null,re,ie);for(const x in J){if(Qs(x))continue;const C=J[x],N=B[x];C!==N&&x!=="value"&&s(O,x,N,C,re,ie)}"value"in J&&s(O,"value",B.value,J.value,re)}},A=(O,B,J,ie,re,x,C,N,H)=>{const D=B.el=O?O.el:l(""),z=B.anchor=O?O.anchor:l("");let{patchFlag:V,dynamicChildren:W,slotScopeIds:he}=B;he&&(N=N?N.concat(he):he),O==null?(r(D,J,ie),r(z,J,ie),I(B.children||[],J,z,re,x,C,N,H)):V>0&&V&64&&W&&O.dynamicChildren?(R(O.dynamicChildren,W,J,re,x,C,N),(B.key!=null||re&&B===re.subTree)&&Rp(O,B,!0)):G(O,B,J,z,re,x,C,N,H)},q=(O,B,J,ie,re,x,C,N,H)=>{B.slotScopeIds=N,O==null?B.shapeFlag&512?re.ctx.activate(B,J,ie,C,H):Y(B,J,ie,re,x,C,H):Z(O,B,H)},Y=(O,B,J,ie,re,x,C)=>{const N=O.component=hv(O,ie,re);if(zl(O)&&(N.ctx.renderer=xe),gv(N,!1,C),N.asyncDep){if(re&&re.registerDep(N,K,C),!O.el){const H=N.subTree=ce(Gt);g(null,H,B,J),O.placeholder=H.el}}else K(N,O,B,J,re,x,C)},Z=(O,B,J)=>{const ie=B.component=O.component;if($_(O,B,J))if(ie.asyncDep&&!ie.asyncResolved){X(ie,B,J);return}else ie.next=B,ie.update();else B.el=O.el,ie.vnode=B},K=(O,B,J,ie,re,x,C)=>{const N=()=>{if(O.isMounted){let{next:V,bu:W,u:he,parent:Ce,vnode:De}=O;{const ge=ov(O);if(ge){V&&(V.el=De.el,X(O,V,C)),ge.asyncDep.then(()=>{O.isUnmounted||N()});return}}let P=V,j;ss(O,!1),V?(V.el=De.el,X(O,V,C)):V=De,W&&ei(W),(j=V.props&&V.props.onVnodeBeforeUpdate)&&Pn(j,Ce,V,De),ss(O,!0);const se=Ra(O),de=O.subTree;O.subTree=se,m(de,se,d(de.el),oe(de),O,re,x),V.el=se.el,P===null&&yu(O,se.el),he&&Zt(he,re),(j=V.props&&V.props.onVnodeUpdated)&&Zt(()=>Pn(j,Ce,V,De),re)}else{let V;const{el:W,props:he}=B,{bm:Ce,m:De,parent:P,root:j,type:se}=O,de=No(B);if(ss(O,!1),Ce&&ei(Ce),!de&&(V=he&&he.onVnodeBeforeMount)&&Pn(V,P,B),ss(O,!0),W&&Ue){const ge=()=>{O.subTree=Ra(O),Ue(W,O.subTree,O,re,null)};de&&se.__asyncHydrate?se.__asyncHydrate(W,O,ge):ge()}else{j.ce&&j.ce._def.shadowRoot!==!1&&j.ce._injectChildStyle(se);const ge=O.subTree=Ra(O);m(null,ge,J,ie,O,re,x),B.el=ge.el}if(De&&Zt(De,re),!de&&(V=he&&he.onVnodeMounted)){const ge=B;Zt(()=>Pn(V,P,ge),re)}(B.shapeFlag&256||P&&No(P.vnode)&&P.vnode.shapeFlag&256)&&O.a&&Zt(O.a,re),O.isMounted=!0,B=J=ie=null}};O.scope.on();const H=O.effect=new Ja(N);O.scope.off();const D=O.update=H.run.bind(H),z=O.job=H.runIfDirty.bind(H);z.i=O,z.id=O.uid,H.scheduler=()=>Cp(z),ss(O,!0),D()},X=(O,B,J)=>{B.component=O;const ie=O.vnode.props;O.vnode=B,O.next=null,w_(O,B.props,ie,J),C_(O,B.children,J),so(),Jh(O),io()},G=(O,B,J,ie,re,x,C,N,H=!1)=>{const D=O&&O.children,z=O?O.shapeFlag:0,V=B.children,{patchFlag:W,shapeFlag:he}=B;if(W>0){if(W&128){Le(D,V,J,ie,re,x,C,N,H);return}else if(W&256){ne(D,V,J,ie,re,x,C,N,H);return}}he&8?(z&16&&vt(D,re,x),V!==D&&u(J,V)):z&16?he&16?Le(D,V,J,ie,re,x,C,N,H):vt(D,re,x,!0):(z&8&&u(J,""),he&16&&I(V,J,ie,re,x,C,N,H))},ne=(O,B,J,ie,re,x,C,N,H)=>{O=O||Xs,B=B||Xs;const D=O.length,z=B.length,V=Math.min(D,z);let W;for(W=0;W<V;W++){const he=B[W]=H?xo(B[W]):Dn(B[W]);m(O[W],he,J,null,re,x,C,N,H)}D>z?vt(O,re,x,!0,!1,V):I(B,J,ie,re,x,C,N,H,V)},Le=(O,B,J,ie,re,x,C,N,H)=>{let D=0;const z=B.length;let V=O.length-1,W=z-1;for(;D<=V&&D<=W;){const he=O[D],Ce=B[D]=H?xo(B[D]):Dn(B[D]);if(dr(he,Ce))m(he,Ce,J,null,re,x,C,N,H);else break;D++}for(;D<=V&&D<=W;){const he=O[V],Ce=B[W]=H?xo(B[W]):Dn(B[W]);if(dr(he,Ce))m(he,Ce,J,null,re,x,C,N,H);else break;V--,W--}if(D>V){if(D<=W){const he=W+1,Ce=he<z?B[he].el:ie;for(;D<=W;)m(null,B[D]=H?xo(B[D]):Dn(B[D]),J,Ce,re,x,C,N,H),D++}}else if(D>W)for(;D<=V;)Be(O[D],re,x,!0),D++;else{const he=D,Ce=D,De=new Map;for(D=Ce;D<=W;D++){const ue=B[D]=H?xo(B[D]):Dn(B[D]);ue.key!=null&&De.set(ue.key,D)}let P,j=0;const se=W-Ce+1;let de=!1,ge=0;const U=new Array(se);for(D=0;D<se;D++)U[D]=0;for(D=he;D<=V;D++){const ue=O[D];if(j>=se){Be(ue,re,x,!0);continue}let ve;if(ue.key!=null)ve=De.get(ue.key);else for(P=Ce;P<=W;P++)if(U[P-Ce]===0&&dr(ue,B[P])){ve=P;break}ve===void 0?Be(ue,re,x,!0):(U[ve-Ce]=D+1,ve>=ge?ge=ve:de=!0,m(ue,B[ve],J,null,re,x,C,N,H),j++)}const ee=de?M_(U):Xs;for(P=ee.length-1,D=se-1;D>=0;D--){const ue=Ce+D,ve=B[ue],He=B[ue+1],ze=ue+1<z?He.el||He.placeholder:ie;U[D]===0?m(null,ve,J,ze,re,x,C,N,H):de&&(P<0||D!==ee[P]?je(ve,J,ze,2):P--)}}},je=(O,B,J,ie,re=null)=>{const{el:x,type:C,transition:N,children:H,shapeFlag:D}=O;if(D&6){je(O.component.subTree,B,J,ie);return}if(D&128){O.suspense.move(B,J,ie);return}if(D&64){C.move(O,B,J,xe);return}if(C===Me){r(x,B,J);for(let V=0;V<H.length;V++)je(H[V],B,J,ie);r(O.anchor,B,J);return}if(C===oi){w(O,B,J);return}if(ie!==2&&D&1&&N)if(ie===0)N.beforeEnter(x),r(x,B,J),Zt(()=>N.enter(x),re);else{const{leave:V,delayLeave:W,afterLeave:he}=N,Ce=()=>{O.ctx.isUnmounted?o(x):r(x,B,J)},De=()=>{x._isLeaving&&x[qr](!0),V(x,()=>{Ce(),he&&he()})};W?W(x,Ce,De):De()}else r(x,B,J)},Be=(O,B,J,ie=!1,re=!1)=>{const{type:x,props:C,ref:N,children:H,dynamicChildren:D,shapeFlag:z,patchFlag:V,dirs:W,cacheIndex:he}=O;if(V===-2&&(re=!1),N!=null&&(so(),ni(N,null,J,O,!0),io()),he!=null&&(B.renderCache[he]=void 0),z&256){B.ctx.deactivate(O);return}const Ce=z&1&&W,De=!No(O);let P;if(De&&(P=C&&C.onVnodeBeforeUnmount)&&Pn(P,B,O),z&6)Pt(O.component,J,ie);else{if(z&128){O.suspense.unmount(J,ie);return}Ce&&Or(O,null,B,"beforeUnmount"),z&64?O.type.remove(O,B,J,xe,ie):D&&!D.hasOnce&&(x!==Me||V>0&&V&64)?vt(D,B,J,!1,!0):(x===Me&&V&384||!re&&z&16)&&vt(H,B,J),ie&&Dt(O)}(De&&(P=C&&C.onVnodeUnmounted)||Ce)&&Zt(()=>{P&&Pn(P,B,O),Ce&&Or(O,null,B,"unmounted")},J)},Dt=O=>{const{type:B,el:J,anchor:ie,transition:re}=O;if(B===Me){Ze(J,ie);return}if(B===oi){b(O);return}const x=()=>{o(J),re&&!re.persisted&&re.afterLeave&&re.afterLeave()};if(O.shapeFlag&1&&re&&!re.persisted){const{leave:C,delayLeave:N}=re,H=()=>C(J,x);N?N(O.el,x,H):H()}else x()},Ze=(O,B)=>{let J;for(;O!==B;)J=f(O),o(O),O=J;o(B)},Pt=(O,B,J)=>{const{bum:ie,scope:re,job:x,subTree:C,um:N,m:H,a:D}=O;oc(H),oc(D),ie&&ei(ie),re.stop(),x&&(x.flags|=8,Be(C,O,B,J)),N&&Zt(N,B),Zt(()=>{O.isUnmounted=!0},B)},vt=(O,B,J,ie=!1,re=!1,x=0)=>{for(let C=x;C<O.length;C++)Be(O[C],B,J,ie,re)},oe=O=>{if(O.shapeFlag&6)return oe(O.component.subTree);if(O.shapeFlag&128)return O.suspense.next();const B=f(O.anchor||O.el),J=B&&B[Ib];return J?f(J):B};let be=!1;const ye=(O,B,J)=>{O==null?B._vnode&&Be(B._vnode,null,null,!0):m(B._vnode||null,O,B,null,null,null,J),B._vnode=O,be||(be=!0,Jh(),tc(),be=!1)},xe={p:m,um:Be,m:je,r:Dt,mt:Y,mc:I,pc:G,pbc:R,n:oe,o:t};let Ve,Ue;return e&&([Ve,Ue]=e(xe)),{render:ye,hydrate:Ve,createApp:b_(ye,Ve)}}function td({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function ss({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function rv(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Rp(t,e,n=!1){const r=t.children,o=e.children;if(Te(r)&&Te(o))for(let s=0;s<r.length;s++){const i=r[s];let l=o[s];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[s]=xo(o[s]),l.el=i.el),!n&&l.patchFlag!==-2&&Rp(i,l)),l.type===ro&&l.patchFlag!==-1&&(l.el=i.el),l.type===Gt&&!l.el&&(l.el=i.el)}}function M_(t){const e=t.slice(),n=[0];let r,o,s,i,l;const a=t.length;for(r=0;r<a;r++){const c=t[r];if(c!==0){if(o=n[n.length-1],t[o]<c){e[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)l=s+i>>1,t[n[l]]<c?s=l+1:i=l;c<t[n[s]]&&(s>0&&(e[r]=n[s-1]),n[s]=r)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=e[i];return n}function ov(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:ov(e)}function oc(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}const T_=Symbol.for("v-scx"),A_=()=>Wt(T_);function sv(t,e){return Ul(t,null,e)}function bW(t,e){return Ul(t,null,{flush:"post"})}function L_(t,e){return Ul(t,null,{flush:"sync"})}function Re(t,e,n){return Ul(t,e,n)}function Ul(t,e,n=Xe){const{immediate:r,deep:o,flush:s,once:i}=n,l=xt({},n),a=e&&r||!e&&s!=="post";let c;if(ci){if(s==="sync"){const p=A_();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=rr,p.resume=rr,p.pause=rr,p}}const u=pn;l.call=(p,h,m)=>vr(p,u,h,m);let d=!1;s==="post"?l.scheduler=p=>{Zt(p,u&&u.suspense)}:s!=="sync"&&(d=!0,l.scheduler=(p,h)=>{h?p():Cp(p)}),l.augmentJob=p=>{e&&(p.flags|=4),d&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const f=$2(t,e,l);return ci&&(c?c.push(f):a&&f()),f}function O_(t,e,n){const r=this.proxy,o=Et(t)?t.includes(".")?iv(r,t):()=>r[t]:t.bind(r,r);let s;Pe(e)?s=e:(s=e.handler,n=e);const i=Cs(this),l=Ul(o,s.bind(r),n);return i(),l}function iv(t,e){const n=e.split(".");return()=>{let r=t;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}function It(t,e,n=Xe){const r=St(),o=_n(e),s=Fn(e),i=lv(t,o),l=Sb((a,c)=>{let u,d=Xe,f;return L_(()=>{const p=t[o];Ln(u,p)&&(u=p,c())}),{get(){return a(),n.get?n.get(u):u},set(p){const h=n.set?n.set(p):p;if(!Ln(h,u)&&!(d!==Xe&&Ln(p,d)))return;const m=r.vnode.props;m&&(e in m||o in m||s in m)&&(`onUpdate:${e}`in m||`onUpdate:${o}`in m||`onUpdate:${s}`in m)||(u=p,c()),r.emit(`update:${e}`,h),Ln(p,h)&&Ln(p,d)&&!Ln(h,f)&&c(),d=p,f=h}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?i||Xe:l,done:!1}:{done:!0}}}},l}const lv=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${_n(e)}Modifiers`]||t[`${Fn(e)}Modifiers`];function N_(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||Xe;let o=n;const s=e.startsWith("update:"),i=s&&lv(r,e.slice(7));i&&(i.trim&&(o=n.map(u=>Et(u)?u.trim():u)),i.number&&(o=n.map(Ga)));let l,a=r[l=Na(e)]||r[l=Na(_n(e))];!a&&s&&(a=r[l=Na(Fn(e))]),a&&vr(a,t,6,o);const c=r[l+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,vr(c,t,6,o)}}const I_=new WeakMap;function av(t,e,n=!1){const r=n?I_:e.emitsCache,o=r.get(t);if(o!==void 0)return o;const s=t.emits;let i={},l=!1;if(!Pe(t)){const a=c=>{const u=av(c,e,!0);u&&(l=!0,xt(i,u))};!n&&e.mixins.length&&e.mixins.forEach(a),t.extends&&a(t.extends),t.mixins&&t.mixins.forEach(a)}return!s&&!l?(gt(t)&&r.set(t,null),null):(Te(s)?s.forEach(a=>i[a]=null):xt(i,s),gt(t)&&r.set(t,i),i)}function gu(t,e){return!t||!Bl(e)?!1:(e=e.slice(2).replace(/Once$/,""),st(t,e[0].toLowerCase()+e.slice(1))||st(t,Fn(e))||st(t,e))}function Ra(t){const{type:e,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:p,ctx:h,inheritAttrs:m}=t,y=fl(t);let g,k;try{if(n.shapeFlag&4){const b=o||r,_=b;g=Dn(c.call(_,b,u,d,p,f,h)),k=l}else{const b=e;g=Dn(b.length>1?b(d,{attrs:l,slots:i,emit:a}):b(d,null)),k=e.props?l:P_(l)}}catch(b){qi.length=0,Ei(b,t,1),g=ce(Gt)}let w=g;if(k&&m!==!1){const b=Object.keys(k),{shapeFlag:_}=w;b.length&&_&7&&(s&&b.some(mp)&&(k=D_(k,s)),w=lo(w,k,!1,!0))}return n.dirs&&(w=lo(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition&&Bo(w,n.transition),g=w,fl(y),g}function R_(t,e=!0){let n;for(let r=0;r<t.length;r++){const o=t[r];if(Ho(o)){if(o.type!==Gt||o.children==="v-if"){if(n)return;n=o}}else return}return n}const P_=t=>{let e;for(const n in t)(n==="class"||n==="style"||Bl(n))&&((e||(e={}))[n]=t[n]);return e},D_=(t,e)=>{const n={};for(const r in t)(!mp(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function $_(t,e,n){const{props:r,children:o,component:s}=t,{props:i,children:l,patchFlag:a}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return r?am(r,i,c):!!i;if(a&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(i[f]!==r[f]&&!gu(c,f))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:r===i?!1:r?i?am(r,i,c):!0:!!i;return!1}function am(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(e[s]!==t[s]&&!gu(n,s))return!0}return!1}function yu({vnode:t,parent:e},n){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===t&&(r.el=t.el),r===t)(t=e.vnode).el=n,e=e.parent;else break}}const sc=t=>t.__isSuspense;let Zd=0;const F_={name:"Suspense",__isSuspense:!0,process(t,e,n,r,o,s,i,l,a,c){if(t==null)V_(e,n,r,o,s,i,l,a,c);else{if(s&&s.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}B_(t,e,n,r,o,i,l,a,c)}},hydrate:H_,normalize:j_},vW=F_;function ml(t,e){const n=t.props&&t.props[e];Pe(n)&&n()}function V_(t,e,n,r,o,s,i,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=t.suspense=cv(t,o,r,e,d,n,s,i,l,a);c(null,f.pendingBranch=t.ssContent,d,null,r,f,s,i),f.deps>0?(ml(t,"onPending"),ml(t,"onFallback"),c(null,t.ssFallback,e,n,r,null,s,i),ri(f,t.ssFallback)):f.resolve(!1,!0)}function B_(t,e,n,r,o,s,i,l,{p:a,um:c,o:{createElement:u}}){const d=e.suspense=t.suspense;d.vnode=e,e.el=t.el;const f=e.ssContent,p=e.ssFallback,{activeBranch:h,pendingBranch:m,isInFallback:y,isHydrating:g}=d;if(m)d.pendingBranch=f,dr(m,f)?(a(m,f,d.hiddenContainer,null,o,d,s,i,l),d.deps<=0?d.resolve():y&&(g||(a(h,p,n,r,o,null,s,i,l),ri(d,p)))):(d.pendingId=Zd++,g?(d.isHydrating=!1,d.activeBranch=m):c(m,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),y?(a(null,f,d.hiddenContainer,null,o,d,s,i,l),d.deps<=0?d.resolve():(a(h,p,n,r,o,null,s,i,l),ri(d,p))):h&&dr(h,f)?(a(h,f,n,r,o,d,s,i,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,o,d,s,i,l),d.deps<=0&&d.resolve()));else if(h&&dr(h,f))a(h,f,n,r,o,d,s,i,l),ri(d,f);else if(ml(e,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Zd++,a(null,f,d.hiddenContainer,null,o,d,s,i,l),d.deps<=0)d.resolve();else{const{timeout:k,pendingId:w}=d;k>0?setTimeout(()=>{d.pendingId===w&&d.fallback(p)},k):k===0&&d.fallback(p)}}function cv(t,e,n,r,o,s,i,l,a,c,u=!1){const{p:d,m:f,um:p,n:h,o:{parentNode:m,remove:y}}=c;let g;const k=z_(t);k&&e&&e.pendingBranch&&(g=e.pendingId,e.deps++);const w=t.props?qa(t.props.timeout):void 0,b=s,_={vnode:t,parent:e,parentComponent:n,namespace:i,container:r,hiddenContainer:o,deps:0,pendingId:Zd++,timeout:typeof w=="number"?w:-1,activeBranch:null,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(M=!1,E=!1){const{vnode:I,activeBranch:F,pendingBranch:R,pendingId:$,effects:A,parentComponent:q,container:Y}=_;let Z=!1;_.isHydrating?_.isHydrating=!1:M||(Z=F&&R.transition&&R.transition.mode==="out-in",Z&&(F.transition.afterLeave=()=>{$===_.pendingId&&(f(R,Y,s===b?h(F):s,0),ec(A))}),F&&(m(F.el)===Y&&(s=h(F)),p(F,q,_,!0)),Z||f(R,Y,s,0)),ri(_,R),_.pendingBranch=null,_.isInFallback=!1;let K=_.parent,X=!1;for(;K;){if(K.pendingBranch){K.effects.push(...A),X=!0;break}K=K.parent}!X&&!Z&&ec(A),_.effects=[],k&&e&&e.pendingBranch&&g===e.pendingId&&(e.deps--,e.deps===0&&!E&&e.resolve()),ml(I,"onResolve")},fallback(M){if(!_.pendingBranch)return;const{vnode:E,activeBranch:I,parentComponent:F,container:R,namespace:$}=_;ml(E,"onFallback");const A=h(I),q=()=>{_.isInFallback&&(d(null,M,R,A,F,null,$,l,a),ri(_,M))},Y=M.transition&&M.transition.mode==="out-in";Y&&(I.transition.afterLeave=q),_.isInFallback=!0,p(I,F,null,!0),Y||q()},move(M,E,I){_.activeBranch&&f(_.activeBranch,M,E,I),_.container=M},next(){return _.activeBranch&&h(_.activeBranch)},registerDep(M,E,I){const F=!!_.pendingBranch;F&&_.deps++;const R=M.vnode.el;M.asyncDep.catch($=>{Ei($,M,0)}).then($=>{if(M.isUnmounted||_.isUnmounted||_.pendingId!==M.suspenseId)return;M.asyncResolved=!0;const{vnode:A}=M;tf(M,$,!1),R&&(A.el=R);const q=!R&&M.subTree.el;E(M,A,m(R||M.subTree.el),R?null:h(M.subTree),_,i,I),q&&y(q),yu(M,A.el),F&&--_.deps===0&&_.resolve()})},unmount(M,E){_.isUnmounted=!0,_.activeBranch&&p(_.activeBranch,n,M,E),_.pendingBranch&&p(_.pendingBranch,n,M,E)}};return _}function H_(t,e,n,r,o,s,i,l,a){const c=e.suspense=cv(e,r,n,t.parentNode,document.createElement("div"),null,o,s,i,l,!0),u=a(t,c.pendingBranch=e.ssContent,n,c,s,i);return c.deps===0&&c.resolve(!1,!0),u}function j_(t){const{shapeFlag:e,children:n}=t,r=e&32;t.ssContent=cm(r?n.default:n),t.ssFallback=r?cm(n.fallback):ce(Gt)}function cm(t){let e;if(Pe(t)){const n=_s&&t._c;n&&(t._d=!1,S()),t=t(),n&&(t._d=!0,e=wn,dv())}return Te(t)&&(t=R_(t)),t=Dn(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function uv(t,e){e&&e.pendingBranch?Te(t)?e.effects.push(...t):e.effects.push(t):ec(t)}function ri(t,e){t.activeBranch=e;const{vnode:n,parentComponent:r}=t;let o=e.el;for(;!o&&e.component;)e=e.component.subTree,o=e.el;n.el=o,r&&r.subTree===n&&(r.vnode.el=o,yu(r,o))}function z_(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}const Me=Symbol.for("v-fgt"),ro=Symbol.for("v-txt"),Gt=Symbol.for("v-cmt"),oi=Symbol.for("v-stc"),qi=[];let wn=null;function S(t=!1){qi.push(wn=t?null:[])}function dv(){qi.pop(),wn=qi[qi.length-1]||null}let _s=1;function ic(t,e=!1){_s+=t,t<0&&wn&&e&&(wn.hasOnce=!0)}function fv(t){return t.dynamicChildren=_s>0?wn||Xs:null,dv(),_s>0&&wn&&wn.push(t),t}function T(t,e,n,r,o,s){return fv(v(t,e,n,r,o,s,!0))}function Ae(t,e,n,r,o){return fv(ce(t,e,n,r,o,!0))}function Ho(t){return t?t.__v_isVNode===!0:!1}function dr(t,e){return t.type===e.type&&t.key===e.key}function wW(t){}const pv=({key:t})=>t??null,Pa=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Et(t)||Ut(t)||Pe(t)?{i:hn,r:t,k:e,f:!!n}:t:null);function v(t,e=null,n=null,r=0,o=null,s=t===Me?0:1,i=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&pv(e),ref:e&&Pa(e),scopeId:hu,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:hn};return l?(Pp(a,n),s&128&&t.normalize(a)):n&&(a.shapeFlag|=Et(n)?8:16),_s>0&&!i&&wn&&(a.patchFlag>0||s&6)&&a.patchFlag!==32&&wn.push(a),a}const ce=U_;function U_(t,e=null,n=null,r=0,o=null,s=!1){if((!t||t===Ub)&&(t=Gt),Ho(t)){const l=lo(t,e,!0);return n&&Pp(l,n),_s>0&&!s&&wn&&(l.shapeFlag&6?wn[wn.indexOf(t)]=l:wn.push(l)),l.patchFlag=-2,l}if(J_(t)&&(t=t.__vccOpts),e){e=bu(e);let{class:l,style:a}=e;l&&!Et(l)&&(e.class=ae(l)),gt(a)&&(_p(a)&&!Te(a)&&(a=xt({},a)),e.style=pt(a))}const i=Et(t)?1:sc(t)?128:Rb(t)?64:gt(t)?4:Pe(t)?2:0;return v(t,e,n,r,o,i,s,!0)}function bu(t){return t?_p(t)||Yb(t)?xt({},t):t:null}function lo(t,e,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:l,transition:a}=t,c=e?ao(o||{},e):o,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&pv(c),ref:e&&e.ref?n&&s?Te(s)?s.concat(Pa(e)):[s,Pa(e)]:Pa(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Me?i===-1?16:i|16:i,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:a,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&lo(t.ssContent),ssFallback:t.ssFallback&&lo(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return a&&r&&Bo(u,a.clone(u)),u}function xn(t=" ",e=0){return ce(ro,null,t,e)}function tn(t,e){const n=ce(oi,null,t);return n.staticCount=e,n}function pe(t="",e=!1){return e?(S(),Ae(Gt,null,t)):ce(Gt,null,t)}function Dn(t){return t==null||typeof t=="boolean"?ce(Gt):Te(t)?ce(Me,null,t.slice()):Ho(t)?xo(t):ce(ro,null,String(t))}function xo(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:lo(t)}function Pp(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(Te(e))n=16;else if(typeof e=="object")if(r&65){const o=e.default;o&&(o._c&&(o._d=!1),Pp(t,o()),o._c&&(o._d=!0));return}else{n=32;const o=e._;!o&&!Yb(e)?e._ctx=hn:o===3&&hn&&(hn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Pe(e)?(e={default:e,_ctx:hn},n=32):(e=String(e),r&64?(n=16,e=[xn(e)]):n=8);t.children=e,t.shapeFlag|=n}function ao(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const o in r)if(o==="class")e.class!==r.class&&(e.class=ae([e.class,r.class]));else if(o==="style")e.style=pt([e.style,r.style]);else if(Bl(o)){const s=e[o],i=r[o];i&&s!==i&&!(Te(s)&&s.includes(i))&&(e[o]=s?[].concat(s,i):i)}else o!==""&&(e[o]=r[o])}return e}function Pn(t,e,n,r=null){vr(t,e,7,[n,r])}const W_=Gb();let K_=0;function hv(t,e,n){const r=t.type,o=(e?e.appContext:t.appContext)||W_,s={uid:K_++,vnode:t,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ob(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Zb(r,o),emitsOptions:av(r,o),emit:null,emitted:null,propsDefaults:Xe,inheritAttrs:r.inheritAttrs,ctx:Xe,data:Xe,props:Xe,attrs:Xe,slots:Xe,refs:Xe,setupState:Xe,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=N_.bind(null,s),t.ce&&t.ce(s),s}let pn=null;const St=()=>pn||hn;let lc,Qd;{const t=au(),e=(n,r)=>{let o;return(o=t[n])||(o=t[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};lc=e("__VUE_INSTANCE_SETTERS__",n=>pn=n),Qd=e("__VUE_SSR_SETTERS__",n=>ci=n)}const Cs=t=>{const e=pn;return lc(t),t.scope.on(),()=>{t.scope.off(),lc(e)}},ef=()=>{pn&&pn.scope.off(),lc(null)};function mv(t){return t.vnode.shapeFlag&4}let ci=!1;function gv(t,e=!1,n=!1){e&&Qd(e);const{props:r,children:o}=t.vnode,s=mv(t);v_(t,r,s,e),__(t,o,n||e);const i=s?G_(t,e):void 0;return e&&Qd(!1),i}function G_(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,qd);const{setup:r}=n;if(r){so();const o=t.setupContext=r.length>1?bv(t):null,s=Cs(t),i=jl(r,t,0,[t.props,o]),l=yp(i);if(io(),s(),(l||t.sp)&&!No(t)&&Sp(t),l){if(i.then(ef,ef),e)return i.then(a=>{tf(t,a,e)}).catch(a=>{Ei(a,t,0)});t.asyncDep=i}else tf(t,i,e)}else yv(t,e)}function tf(t,e,n){Pe(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:gt(e)&&(t.setupState=Eb(e)),yv(t,n)}let ac,nf;function xW(t){ac=t,nf=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,u_))}}const kW=()=>!ac;function yv(t,e,n){const r=t.type;if(!t.render){if(!e&&ac&&!r.render){const o=r.template||Op(t).template;if(o){const{isCustomElement:s,compilerOptions:i}=t.appContext.config,{delimiters:l,compilerOptions:a}=r,c=xt(xt({isCustomElement:s,delimiters:l},i),a);r.render=ac(o,c)}}t.render=r.render||rr,nf&&nf(t)}{const o=Cs(t);so();try{f_(t)}finally{io(),o()}}}const q_={get(t,e){return vn(t,"get",""),t[e]}};function bv(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,q_),slots:t.slots,emit:t.emit,expose:e}}function Wl(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Eb(_b(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Gi)return Gi[n](t)},has(e,n){return n in e||n in Gi}})):t.proxy}function rf(t,e=!0){return Pe(t)?t.displayName||t.name:t.name||e&&t.__name}function J_(t){return Pe(t)&&"__vccOpts"in t}const te=(t,e)=>P2(t,e,ci);function Bn(t,e,n){const r=(s,i,l)=>{ic(-1);try{return ce(s,i,l)}finally{ic(1)}},o=arguments.length;return o===2?gt(e)&&!Te(e)?Ho(e)?r(t,null,[e]):r(t,e):r(t,null,e):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Ho(n)&&(n=[n]),r(t,e,n))}function _W(){}function CW(t,e,n,r){const o=n[r];if(o&&Y_(o,t))return o;const s=e();return s.memo=t.slice(),s.cacheIndex=r,n[r]=s}function Y_(t,e){const n=t.memo;if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(Ln(n[r],e[r]))return!1;return _s>0&&wn&&wn.push(t),!0}const X_="3.5.21",EW=rr,SW=B2,MW=Hs,TW=Nb,Z_={createComponentInstance:hv,setupComponent:gv,renderComponentRoot:Ra,setCurrentRenderingInstance:fl,isVNode:Ho,normalizeVNode:Dn,getComponentPublicInstance:Wl,ensureValidVNode:Lp,pushWarningContext:F2,popWarningContext:V2},AW=Z_,LW=null,OW=null,NW=null;/**
15
- * @vue/runtime-dom v3.5.21
16
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
17
- * @license MIT
18
- **/let of;const um=typeof window<"u"&&window.trustedTypes;if(um)try{of=um.createPolicy("vue",{createHTML:t=>t})}catch{}const vv=of?t=>of.createHTML(t):t=>t,Q_="http://www.w3.org/2000/svg",eC="http://www.w3.org/1998/Math/MathML",Kr=typeof document<"u"?document:null,dm=Kr&&Kr.createElement("template"),tC={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const o=e==="svg"?Kr.createElementNS(Q_,t):e==="mathml"?Kr.createElementNS(eC,t):n?Kr.createElement(t,{is:n}):Kr.createElement(t);return t==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:t=>Kr.createTextNode(t),createComment:t=>Kr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Kr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,o,s){const i=n?n.previousSibling:e.lastChild;if(o&&(o===s||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{dm.innerHTML=vv(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const l=dm.content;if(r==="svg"||r==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}e.insertBefore(l,n)}return[i?i.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},po="transition",Li="animation",ui=Symbol("_vtc"),wv={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},xv=xt({},Fb,wv),nC=t=>(t.displayName="Transition",t.props=xv,t),Rs=nC((t,{slots:e})=>Bn(W2,kv(t),e)),is=(t,e=[])=>{Te(t)?t.forEach(n=>n(...e)):t&&t(...e)},fm=t=>t?Te(t)?t.some(e=>e.length>1):t.length>1:!1;function kv(t){const e={};for(const A in t)A in wv||(e[A]=t[A]);if(t.css===!1)return e;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=s,appearActiveClass:c=i,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=t,h=rC(o),m=h&&h[0],y=h&&h[1],{onBeforeEnter:g,onEnter:k,onEnterCancelled:w,onLeave:b,onLeaveCancelled:_,onBeforeAppear:M=g,onAppear:E=k,onAppearCancelled:I=w}=e,F=(A,q,Y,Z)=>{A._enterCancelled=Z,yo(A,q?u:l),yo(A,q?c:i),Y&&Y()},R=(A,q)=>{A._isLeaving=!1,yo(A,d),yo(A,p),yo(A,f),q&&q()},$=A=>(q,Y)=>{const Z=A?E:k,K=()=>F(q,A,Y);is(Z,[q,K]),pm(()=>{yo(q,A?a:s),Sr(q,A?u:l),fm(Z)||hm(q,r,m,K)})};return xt(e,{onBeforeEnter(A){is(g,[A]),Sr(A,s),Sr(A,i)},onBeforeAppear(A){is(M,[A]),Sr(A,a),Sr(A,c)},onEnter:$(!1),onAppear:$(!0),onLeave(A,q){A._isLeaving=!0;const Y=()=>R(A,q);Sr(A,d),A._enterCancelled?(Sr(A,f),sf()):(sf(),Sr(A,f)),pm(()=>{A._isLeaving&&(yo(A,d),Sr(A,p),fm(b)||hm(A,r,y,Y))}),is(b,[A,Y])},onEnterCancelled(A){F(A,!1,void 0,!0),is(w,[A])},onAppearCancelled(A){F(A,!0,void 0,!0),is(I,[A])},onLeaveCancelled(A){R(A),is(_,[A])}})}function rC(t){if(t==null)return null;if(gt(t))return[nd(t.enter),nd(t.leave)];{const e=nd(t);return[e,e]}}function nd(t){return qa(t)}function Sr(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[ui]||(t[ui]=new Set)).add(e)}function yo(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[ui];n&&(n.delete(e),n.size||(t[ui]=void 0))}function pm(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let oC=0;function hm(t,e,n,r){const o=t._endId=++oC,s=()=>{o===t._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:l,propCount:a}=_v(t,e);if(!i)return r();const c=i+"end";let u=0;const d=()=>{t.removeEventListener(c,f),s()},f=p=>{p.target===t&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),t.addEventListener(c,f)}function _v(t,e){const n=window.getComputedStyle(t),r=h=>(n[h]||"").split(", "),o=r(`${po}Delay`),s=r(`${po}Duration`),i=mm(o,s),l=r(`${Li}Delay`),a=r(`${Li}Duration`),c=mm(l,a);let u=null,d=0,f=0;e===po?i>0&&(u=po,d=i,f=s.length):e===Li?c>0&&(u=Li,d=c,f=a.length):(d=Math.max(i,c),u=d>0?i>c?po:Li:null,f=u?u===po?s.length:a.length:0);const p=u===po&&/\b(?:transform|all)(?:,|$)/.test(r(`${po}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function mm(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,r)=>gm(n)+gm(t[r])))}function gm(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function sf(){return document.body.offsetHeight}function sC(t,e,n){const r=t[ui];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const cc=Symbol("_vod"),Cv=Symbol("_vsh"),jo={name:"show",beforeMount(t,{value:e},{transition:n}){t[cc]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Oi(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),Oi(t,!0),r.enter(t)):r.leave(t,()=>{Oi(t,!1)}):Oi(t,e))},beforeUnmount(t,{value:e}){Oi(t,e)}};function Oi(t,e){t.style.display=e?t[cc]:"none",t[Cv]=!e}function iC(){jo.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const Ev=Symbol("");function IW(t){const e=St();if(!e)return;const n=e.ut=(o=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(s=>uc(s,o))},r=()=>{const o=t(e.proxy);e.ce?uc(e.ce,o):lf(e.subTree,o),n(o)};zb(()=>{ec(r)}),rt(()=>{Re(r,rr,{flush:"post"});const o=new MutationObserver(r);o.observe(e.subTree.el.parentNode,{childList:!0}),gn(()=>o.disconnect())})}function lf(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{lf(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)uc(t.el,e);else if(t.type===Me)t.children.forEach(n=>lf(n,e));else if(t.type===oi){let{el:n,anchor:r}=t;for(;n&&(uc(n,e),n!==r);)n=n.nextSibling}}function uc(t,e){if(t.nodeType===1){const n=t.style;let r="";for(const o in e){const s=l2(e[o]);n.setProperty(`--${o}`,s),r+=`--${o}: ${s};`}n[Ev]=r}}const lC=/(?:^|;)\s*display\s*:/;function aC(t,e,n){const r=t.style,o=Et(n);let s=!1;if(n&&!o){if(e)if(Et(e))for(const i of e.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&Da(r,l,"")}else for(const i in e)n[i]==null&&Da(r,i,"");for(const i in n)i==="display"&&(s=!0),Da(r,i,n[i])}else if(o){if(e!==n){const i=r[Ev];i&&(n+=";"+i),r.cssText=n,s=lC.test(n)}}else e&&t.removeAttribute("style");cc in t&&(t[cc]=s?r.display:"",t[Cv]&&(r.display="none"))}const ym=/\s*!important$/;function Da(t,e,n){if(Te(n))n.forEach(r=>Da(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=cC(t,e);ym.test(n)?t.setProperty(Fn(r),n.replace(ym,""),"important"):t[r]=n}}const bm=["Webkit","Moz","ms"],rd={};function cC(t,e){const n=rd[e];if(n)return n;let r=_n(e);if(r!=="filter"&&r in t)return rd[e]=r;r=lu(r);for(let o=0;o<bm.length;o++){const s=bm[o]+r;if(s in t)return rd[e]=s}return e}const vm="http://www.w3.org/1999/xlink";function wm(t,e,n,r,o,s=s2(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(vm,e.slice(6,e.length)):t.setAttributeNS(vm,e,n):n==null||s&&!tb(n)?t.removeAttribute(e):t.setAttribute(e,s?"":br(n)?String(n):n)}function xm(t,e,n,r,o){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?vv(n):n);return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const l=s==="OPTION"?t.getAttribute("value")||"":t.value,a=n==null?t.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in t))&&(t.value=a),n==null&&t.removeAttribute(e),t._value=n;return}let i=!1;if(n===""||n==null){const l=typeof t[e];l==="boolean"?n=tb(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{t[e]=n}catch{}i&&t.removeAttribute(o||e)}function Xr(t,e,n,r){t.addEventListener(e,n,r)}function uC(t,e,n,r){t.removeEventListener(e,n,r)}const km=Symbol("_vei");function dC(t,e,n,r,o=null){const s=t[km]||(t[km]={}),i=s[e];if(r&&i)i.value=r;else{const[l,a]=fC(e);if(r){const c=s[e]=mC(r,o);Xr(t,l,c,a)}else i&&(uC(t,l,i,a),s[e]=void 0)}}const _m=/(?:Once|Passive|Capture)$/;function fC(t){let e;if(_m.test(t)){e={};let r;for(;r=t.match(_m);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Fn(t.slice(2)),e]}let od=0;const pC=Promise.resolve(),hC=()=>od||(pC.then(()=>od=0),od=Date.now());function mC(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;vr(gC(r,n.value),e,5,[r])};return n.value=t,n.attached=hC(),n}function gC(t,e){if(Te(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>o=>!o._stopped&&r&&r(o))}else return e}const Cm=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,yC=(t,e,n,r,o,s)=>{const i=o==="svg";e==="class"?sC(t,r,i):e==="style"?aC(t,n,r):Bl(e)?mp(e)||dC(t,e,n,r,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):bC(t,e,r,i))?(xm(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&wm(t,e,r,i,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Et(r))?xm(t,_n(e),r,s,e):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),wm(t,e,r,i))};function bC(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&Cm(e)&&Pe(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const o=t.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Cm(e)&&Et(n)?!1:e in t}const Em={};function vC(t,e,n){let r=_e(t,e);su(r)&&(r=xt({},r,e));class o extends Dp{constructor(i){super(r,i,n)}}return o.def=r,o}const RW=(t,e)=>vC(t,e,DC),wC=typeof HTMLElement<"u"?HTMLElement:class{};class Dp extends wC{constructor(e,n={},r=gl){super(),this._def=e,this._props=n,this._createApp=r,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&r!==gl?this._root=this.shadowRoot:e.shadowRoot!==!1?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof Dp){this._parent=e;break}this._instance||(this._resolved?this._mount(this._def):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,zt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let r=0;r<this.attributes.length;r++)this._setAttr(this.attributes[r].name);this._ob=new MutationObserver(r=>{for(const o of r)this._setAttr(o.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(r,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:s,styles:i}=r;let l;if(s&&!Te(s))for(const a in s){const c=s[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=qa(this._props[a])),(l||(l=Object.create(null)))[_n(a)]=!0)}this._numberProps=l,this._resolveProps(r),this.shadowRoot&&this._applyStyles(i),this._mount(r)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(r=>{r.configureApp=this._def.configureApp,e(this._def=r,!0)}):e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const r in n)st(this,r)||Object.defineProperty(this,r,{get:()=>me(n[r])})}_resolveProps(e){const{props:n}=e,r=Te(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&r.includes(o)&&this._setProp(o,this[o]);for(const o of r.map(_n))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(s){this._setProp(o,s,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;const n=this.hasAttribute(e);let r=n?this.getAttribute(e):Em;const o=_n(e);n&&this._numberProps&&this._numberProps[o]&&(r=qa(r)),this._setProp(o,r,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,n,r=!0,o=!1){if(n!==this._props[e]&&(n===Em?delete this._props[e]:(this._props[e]=n,e==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),r)){const s=this._ob;s&&s.disconnect(),n===!0?this.setAttribute(Fn(e),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Fn(e),n+""):n||this.removeAttribute(Fn(e)),s&&s.observe(this,{attributes:!0})}}_update(){const e=this._createVNode();this._app&&(e.appContext=this._app._context),PC(e,this._root)}_createVNode(){const e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));const n=ce(this._def,xt(e,this._props));return this._instance||(n.ce=r=>{this._instance=r,r.ce=this,r.isCE=!0;const o=(s,i)=>{this.dispatchEvent(new CustomEvent(s,su(i[0])?xt({detail:i},i[0]):{detail:i}))};r.emit=(s,...i)=>{o(s,i),Fn(s)!==s&&o(Fn(s),i)},this._setParent()}),n}_applyStyles(e,n){if(!e)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const r=this._nonce;for(let o=e.length-1;o>=0;o--){const s=document.createElement("style");r&&s.setAttribute("nonce",r),s.textContent=e[o],this.shadowRoot.prepend(s)}}_parseSlots(){const e=this._slots={};let n;for(;n=this.firstChild;){const r=n.nodeType===1&&n.getAttribute("slot")||"default";(e[r]||(e[r]=[])).push(n),this.removeChild(n)}}_renderSlots(){const e=(this._teleportTarget||this).querySelectorAll("slot"),n=this._instance.type.__scopeId;for(let r=0;r<e.length;r++){const o=e[r],s=o.getAttribute("name")||"default",i=this._slots[s],l=o.parentNode;if(i)for(const a of i){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_injectChildStyle(e){this._applyStyles(e.styles,e)}_removeChildStyle(e){}}function xC(t){const e=St(),n=e&&e.ce;return n||null}function PW(){const t=xC();return t&&t.shadowRoot}function DW(t="$style"){{const e=St();if(!e)return Xe;const n=e.type.__cssModules;if(!n)return Xe;const r=n[t];return r||Xe}}const Sv=new WeakMap,Mv=new WeakMap,dc=Symbol("_moveCb"),Sm=Symbol("_enterCb"),kC=t=>(delete t.props.mode,t),_C=kC({name:"TransitionGroup",props:xt({},xv,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=St(),r=$b();let o,s;return Mp(()=>{if(!o.length)return;const i=t.moveClass||`${t.name||"v"}-move`;if(!MC(o[0].el,n.vnode.el,i)){o=[];return}o.forEach(CC),o.forEach(EC);const l=o.filter(SC);sf(),l.forEach(a=>{const c=a.el,u=c.style;Sr(c,i),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[dc]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[dc]=null,yo(c,i))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const i=Qe(t),l=kv(i);let a=i.tag||Me;if(o=[],s)for(let c=0;c<s.length;c++){const u=s[c];u.el&&u.el instanceof Element&&(o.push(u),Bo(u,pl(u,l,r,n)),Sv.set(u,u.el.getBoundingClientRect()))}s=e.default?Ep(e.default()):[];for(let c=0;c<s.length;c++){const u=s[c];u.key!=null&&Bo(u,pl(u,l,r,n))}return ce(a,null,s)}}}),$W=_C;function CC(t){const e=t.el;e[dc]&&e[dc](),e[Sm]&&e[Sm]()}function EC(t){Mv.set(t,t.el.getBoundingClientRect())}function SC(t){const e=Sv.get(t),n=Mv.get(t),r=e.left-n.left,o=e.top-n.top;if(r||o){const s=t.el.style;return s.transform=s.webkitTransform=`translate(${r}px,${o}px)`,s.transitionDuration="0s",t}}function MC(t,e,n){const r=t.cloneNode(),o=t[ui];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&r.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(r);const{hasTransform:i}=_v(r);return s.removeChild(r),i}const zo=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Te(e)?n=>ei(e,n):e};function TC(t){t.target.composing=!0}function Mm(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const sr=Symbol("_assign"),jt={created(t,{modifiers:{lazy:e,trim:n,number:r}},o){t[sr]=zo(o);const s=r||o.props&&o.props.type==="number";Xr(t,e?"change":"input",i=>{if(i.target.composing)return;let l=t.value;n&&(l=l.trim()),s&&(l=Ga(l)),t[sr](l)}),n&&Xr(t,"change",()=>{t.value=t.value.trim()}),e||(Xr(t,"compositionstart",TC),Xr(t,"compositionend",Mm),Xr(t,"change",Mm))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(t[sr]=zo(i),t.composing)return;const l=(s||t.type==="number")&&!/^0\d/.test(t.value)?Ga(t.value):t.value,a=e??"";l!==a&&(document.activeElement===t&&t.type!=="range"&&(r&&e===n||o&&t.value.trim()===a)||(t.value=a))}},vu={deep:!0,created(t,e,n){t[sr]=zo(n),Xr(t,"change",()=>{const r=t._modelValue,o=di(t),s=t.checked,i=t[sr];if(Te(r)){const l=cu(r,o),a=l!==-1;if(s&&!a)i(r.concat(o));else if(!s&&a){const c=[...r];c.splice(l,1),i(c)}}else if(Os(r)){const l=new Set(r);s?l.add(o):l.delete(o),i(l)}else i(Tv(t,s))})},mounted:Tm,beforeUpdate(t,e,n){t[sr]=zo(n),Tm(t,e,n)}};function Tm(t,{value:e,oldValue:n},r){t._modelValue=e;let o;if(Te(e))o=cu(e,r.props.value)>-1;else if(Os(e))o=e.has(r.props.value);else{if(e===n)return;o=Fo(e,Tv(t,!0))}t.checked!==o&&(t.checked=o)}const wu={created(t,{value:e},n){t.checked=Fo(e,n.props.value),t[sr]=zo(n),Xr(t,"change",()=>{t[sr](di(t))})},beforeUpdate(t,{value:e,oldValue:n},r){t[sr]=zo(r),e!==n&&(t.checked=Fo(e,r.props.value))}},AC={deep:!0,created(t,{value:e,modifiers:{number:n}},r){const o=Os(e);Xr(t,"change",()=>{const s=Array.prototype.filter.call(t.options,i=>i.selected).map(i=>n?Ga(di(i)):di(i));t[sr](t.multiple?o?new Set(s):s:s[0]),t._assigning=!0,zt(()=>{t._assigning=!1})}),t[sr]=zo(r)},mounted(t,{value:e}){Am(t,e)},beforeUpdate(t,e,n){t[sr]=zo(n)},updated(t,{value:e}){t._assigning||Am(t,e)}};function Am(t,e){const n=t.multiple,r=Te(e);if(!(n&&!r&&!Os(e))){for(let o=0,s=t.options.length;o<s;o++){const i=t.options[o],l=di(i);if(n)if(r){const a=typeof l;a==="string"||a==="number"?i.selected=e.some(c=>String(c)===String(l)):i.selected=cu(e,l)>-1}else i.selected=e.has(l);else if(Fo(di(i),e)){t.selectedIndex!==o&&(t.selectedIndex=o);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function di(t){return"_value"in t?t._value:t.value}function Tv(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const $p={created(t,e,n){aa(t,e,n,null,"created")},mounted(t,e,n){aa(t,e,n,null,"mounted")},beforeUpdate(t,e,n,r){aa(t,e,n,r,"beforeUpdate")},updated(t,e,n,r){aa(t,e,n,r,"updated")}};function Av(t,e){switch(t){case"SELECT":return AC;case"TEXTAREA":return jt;default:switch(e){case"checkbox":return vu;case"radio":return wu;default:return jt}}}function aa(t,e,n,r,o){const i=Av(t.tagName,n.props&&n.props.type)[o];i&&i(t,e,n,r)}function LC(){jt.getSSRProps=({value:t})=>({value:t}),wu.getSSRProps=({value:t},e)=>{if(e.props&&Fo(e.props.value,t))return{checked:!0}},vu.getSSRProps=({value:t},e)=>{if(Te(t)){if(e.props&&cu(t,e.props.value)>-1)return{checked:!0}}else if(Os(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},$p.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const n=Av(e.type.toUpperCase(),e.props&&e.props.type);if(n.getSSRProps)return n.getSSRProps(t,e)}}const OC=["ctrl","shift","alt","meta"],NC={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>OC.some(n=>t[`${n}Key`]&&!e.includes(n))},Vn=(t,e)=>{const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=(o,...s)=>{for(let i=0;i<e.length;i++){const l=NC[e[i]];if(l&&l(o,e))return}return t(o,...s)})},IC={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},RC=(t,e)=>{const n=t._withKeys||(t._withKeys={}),r=e.join(".");return n[r]||(n[r]=o=>{if(!("key"in o))return;const s=Fn(o.key);if(e.some(i=>i===s||IC[i]===s))return t(o)})},Lv=xt({patchProp:yC},tC);let Ji,Lm=!1;function Ov(){return Ji||(Ji=E_(Lv))}function Nv(){return Ji=Lm?Ji:S_(Lv),Lm=!0,Ji}const PC=(...t)=>{Ov().render(...t)},FW=(...t)=>{Nv().hydrate(...t)},gl=(...t)=>{const e=Ov().createApp(...t),{mount:n}=e;return e.mount=r=>{const o=Rv(r);if(!o)return;const s=e._component;!Pe(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,Iv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},e},DC=(...t)=>{const e=Nv().createApp(...t),{mount:n}=e;return e.mount=r=>{const o=Rv(r);if(o)return n(o,!0,Iv(o))},e};function Iv(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Rv(t){return Et(t)?document.querySelector(t):t}let Om=!1;const VW=()=>{Om||(Om=!0,LC(),iC())};function Pv(){const t=Q(localStorage.getItem("theme")==="light"?"light":"dark"),e=Q(localStorage.getItem("color")||"blue");return Re(t,o=>{document.documentElement.classList.toggle("dark"),localStorage.setItem("theme",o)}),Re(e,o=>{document.documentElement.classList.remove("theme-green","theme-purple","theme-blue"),document.documentElement.classList.add(`theme-${o}`),localStorage.setItem("color",o)}),{theme:t,toggleTheme:()=>{t.value=t.value==="light"?"dark":"light"},color:e,toggleColor:o=>{e.value=o}}}/**
19
- * @license lucide-vue-next v0.344.0 - ISC
20
- *
21
- * This source code is licensed under the ISC license.
22
- * See the LICENSE file in the root directory of this source tree.
23
- */var ca={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
24
- * @license lucide-vue-next v0.344.0 - ISC
25
- *
26
- * This source code is licensed under the ISC license.
27
- * See the LICENSE file in the root directory of this source tree.
28
- */const $C=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),an=(t,e)=>({size:n,strokeWidth:r=2,absoluteStrokeWidth:o,color:s,class:i,...l},{attrs:a,slots:c})=>Bn("svg",{...ca,width:n||ca.width,height:n||ca.height,stroke:s||ca.stroke,"stroke-width":o?Number(r)*24/Number(n):r,...a,class:["lucide",`lucide-${$C(t)}`],...l},[...e.map(u=>Bn(...u)),...c.default?[c.default()]:[]]);/**
29
- * @license lucide-vue-next v0.344.0 - ISC
30
- *
31
- * This source code is licensed under the ISC license.
32
- * See the LICENSE file in the root directory of this source tree.
33
- */const FC=an("ArrowLeftIcon",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
34
- * @license lucide-vue-next v0.344.0 - ISC
35
- *
36
- * This source code is licensed under the ISC license.
37
- * See the LICENSE file in the root directory of this source tree.
38
- */const VC=an("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
39
- * @license lucide-vue-next v0.344.0 - ISC
40
- *
41
- * This source code is licensed under the ISC license.
42
- * See the LICENSE file in the root directory of this source tree.
43
- */const BC=an("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
44
- * @license lucide-vue-next v0.344.0 - ISC
45
- *
46
- * This source code is licensed under the ISC license.
47
- * See the LICENSE file in the root directory of this source tree.
48
- */const HC=an("ChevronUpIcon",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
49
- * @license lucide-vue-next v0.344.0 - ISC
50
- *
51
- * This source code is licensed under the ISC license.
52
- * See the LICENSE file in the root directory of this source tree.
53
- */const jC=an("FileTextIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
54
- * @license lucide-vue-next v0.344.0 - ISC
55
- *
56
- * This source code is licensed under the ISC license.
57
- * See the LICENSE file in the root directory of this source tree.
58
- */const zC=an("HelpCircleIcon",[["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"}]]);/**
59
- * @license lucide-vue-next v0.344.0 - ISC
60
- *
61
- * This source code is licensed under the ISC license.
62
- * See the LICENSE file in the root directory of this source tree.
63
- */const UC=an("HomeIcon",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
64
- * @license lucide-vue-next v0.344.0 - ISC
65
- *
66
- * This source code is licensed under the ISC license.
67
- * See the LICENSE file in the root directory of this source tree.
68
- */const WC=an("ImageIcon",[["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"}]]);/**
69
- * @license lucide-vue-next v0.344.0 - ISC
70
- *
71
- * This source code is licensed under the ISC license.
72
- * See the LICENSE file in the root directory of this source tree.
73
- */const KC=an("LayersIcon",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
74
- * @license lucide-vue-next v0.344.0 - ISC
75
- *
76
- * This source code is licensed under the ISC license.
77
- * See the LICENSE file in the root directory of this source tree.
78
- */const GC=an("LogOutIcon",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
79
- * @license lucide-vue-next v0.344.0 - ISC
80
- *
81
- * This source code is licensed under the ISC license.
82
- * See the LICENSE file in the root directory of this source tree.
83
- */const qC=an("MenuIcon",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
84
- * @license lucide-vue-next v0.344.0 - ISC
85
- *
86
- * This source code is licensed under the ISC license.
87
- * See the LICENSE file in the root directory of this source tree.
88
- */const JC=an("MoonIcon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
89
- * @license lucide-vue-next v0.344.0 - ISC
90
- *
91
- * This source code is licensed under the ISC license.
92
- * See the LICENSE file in the root directory of this source tree.
93
- */const Dv=an("SettingsIcon",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
94
- * @license lucide-vue-next v0.344.0 - ISC
95
- *
96
- * This source code is licensed under the ISC license.
97
- * See the LICENSE file in the root directory of this source tree.
98
- */const YC=an("SunIcon",[["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"}]]);/**
99
- * @license lucide-vue-next v0.344.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */const XC=an("TableCellsMergeIcon",[["path",{d:"M12 21v-6",key:"lihzve"}],["path",{d:"M12 9V3",key:"da5inc"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
104
- * @license lucide-vue-next v0.344.0 - ISC
105
- *
106
- * This source code is licensed under the ISC license.
107
- * See the LICENSE file in the root directory of this source tree.
108
- */const ZC=an("TagIcon",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
109
- * @license lucide-vue-next v0.344.0 - ISC
110
- *
111
- * This source code is licensed under the ISC license.
112
- * See the LICENSE file in the root directory of this source tree.
113
- */const QC=an("UserIcon",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
114
- * @license lucide-vue-next v0.344.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */const eE=an("UsersIcon",[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/*!
119
- * vue-router v4.4.3
120
- * (c) 2024 Eduardo San Martin Morote
121
- * @license MIT
122
- */const js=typeof document<"u";function tE(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const ut=Object.assign;function sd(t,e){const n={};for(const r in e){const o=e[r];n[r]=wr(o)?o.map(t):t(o)}return n}const Yi=()=>{},wr=Array.isArray,$v=/#/g,nE=/&/g,rE=/\//g,oE=/=/g,sE=/\?/g,Fv=/\+/g,iE=/%5B/g,lE=/%5D/g,Vv=/%5E/g,aE=/%60/g,Bv=/%7B/g,cE=/%7C/g,Hv=/%7D/g,uE=/%20/g;function Fp(t){return encodeURI(""+t).replace(cE,"|").replace(iE,"[").replace(lE,"]")}function dE(t){return Fp(t).replace(Bv,"{").replace(Hv,"}").replace(Vv,"^")}function af(t){return Fp(t).replace(Fv,"%2B").replace(uE,"+").replace($v,"%23").replace(nE,"%26").replace(aE,"`").replace(Bv,"{").replace(Hv,"}").replace(Vv,"^")}function fE(t){return af(t).replace(oE,"%3D")}function pE(t){return Fp(t).replace($v,"%23").replace(sE,"%3F")}function hE(t){return t==null?"":pE(t).replace(rE,"%2F")}function yl(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const mE=/\/$/,gE=t=>t.replace(mE,"");function id(t,e,n="/"){let r,o={},s="",i="";const l=e.indexOf("#");let a=e.indexOf("?");return l<a&&l>=0&&(a=-1),a>-1&&(r=e.slice(0,a),s=e.slice(a+1,l>-1?l:e.length),o=t(s)),l>-1&&(r=r||e.slice(0,l),i=e.slice(l,e.length)),r=wE(r??e,n),{fullPath:r+(s&&"?")+s+i,path:r,query:o,hash:yl(i)}}function yE(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function Nm(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function bE(t,e,n){const r=e.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&fi(e.matched[r],n.matched[o])&&jv(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function fi(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function jv(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!vE(t[n],e[n]))return!1;return!0}function vE(t,e){return wr(t)?Im(t,e):wr(e)?Im(e,t):t===e}function Im(t,e){return wr(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t.length===1&&t[0]===e}function wE(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),r=t.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,i,l;for(i=0;i<r.length;i++)if(l=r[i],l!==".")if(l==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(i).join("/")}const ho={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var bl;(function(t){t.pop="pop",t.push="push"})(bl||(bl={}));var Xi;(function(t){t.back="back",t.forward="forward",t.unknown=""})(Xi||(Xi={}));function xE(t){if(!t)if(js){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),gE(t)}const kE=/^[^#]+#/;function _E(t,e){return t.replace(kE,"#")+e}function CE(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const xu=()=>({left:window.scrollX,top:window.scrollY});function EE(t){let e;if("el"in t){const n=t.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;e=CE(o,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Rm(t,e){return(history.state?history.state.position-e:-1)+t}const cf=new Map;function SE(t,e){cf.set(t,e)}function ME(t){const e=cf.get(t);return cf.delete(t),e}let TE=()=>location.protocol+"//"+location.host;function zv(t,e){const{pathname:n,search:r,hash:o}=e,s=t.indexOf("#");if(s>-1){let l=o.includes(t.slice(s))?t.slice(s).length:1,a=o.slice(l);return a[0]!=="/"&&(a="/"+a),Nm(a,"")}return Nm(n,t)+r+o}function AE(t,e,n,r){let o=[],s=[],i=null;const l=({state:f})=>{const p=zv(t,location),h=n.value,m=e.value;let y=0;if(f){if(n.value=p,e.value=f,i&&i===h){i=null;return}y=m?f.position-m.position:0}else r(p);o.forEach(g=>{g(n.value,h,{delta:y,type:bl.pop,direction:y?y>0?Xi.forward:Xi.back:Xi.unknown})})};function a(){i=n.value}function c(f){o.push(f);const p=()=>{const h=o.indexOf(f);h>-1&&o.splice(h,1)};return s.push(p),p}function u(){const{history:f}=window;f.state&&f.replaceState(ut({},f.state,{scroll:xu()}),"")}function d(){for(const f of s)f();s=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:a,listen:c,destroy:d}}function Pm(t,e,n,r=!1,o=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:o?xu():null}}function LE(t){const{history:e,location:n}=window,r={value:zv(t,n)},o={value:e.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(a,c,u){const d=t.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+a:TE()+t+a;try{e[u?"replaceState":"pushState"](c,"",f),o.value=c}catch(p){console.error(p),n[u?"replace":"assign"](f)}}function i(a,c){const u=ut({},e.state,Pm(o.value.back,a,o.value.forward,!0),c,{position:o.value.position});s(a,u,!0),r.value=a}function l(a,c){const u=ut({},o.value,e.state,{forward:a,scroll:xu()});s(u.current,u,!0);const d=ut({},Pm(r.value,a,null),{position:u.position+1},c);s(a,d,!1),r.value=a}return{location:r,state:o,push:l,replace:i}}function OE(t){t=xE(t);const e=LE(t),n=AE(t,e.state,e.location,e.replace);function r(s,i=!0){i||n.pauseListeners(),history.go(s)}const o=ut({location:"",base:t,go:r,createHref:_E.bind(null,t)},e,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>e.state.value}),o}function NE(t){return typeof t=="string"||t&&typeof t=="object"}function Uv(t){return typeof t=="string"||typeof t=="symbol"}const Wv=Symbol("");var Dm;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(Dm||(Dm={}));function pi(t,e){return ut(new Error,{type:t,[Wv]:!0},e)}function Fr(t,e){return t instanceof Error&&Wv in t&&(e==null||!!(t.type&e))}const $m="[^/]+?",IE={sensitive:!1,strict:!1,start:!0,end:!0},RE=/[.+*?^${}()[\]/\\]/g;function PE(t,e){const n=ut({},IE,e),r=[];let o=n.start?"^":"";const s=[];for(const c of t){const u=c.length?[]:[90];n.strict&&!c.length&&(o+="/");for(let d=0;d<c.length;d++){const f=c[d];let p=40+(n.sensitive?.25:0);if(f.type===0)d||(o+="/"),o+=f.value.replace(RE,"\\$&"),p+=40;else if(f.type===1){const{value:h,repeatable:m,optional:y,regexp:g}=f;s.push({name:h,repeatable:m,optional:y});const k=g||$m;if(k!==$m){p+=10;try{new RegExp(`(${k})`)}catch(b){throw new Error(`Invalid custom RegExp for param "${h}" (${k}): `+b.message)}}let w=m?`((?:${k})(?:/(?:${k}))*)`:`(${k})`;d||(w=y&&c.length<2?`(?:/${w})`:"/"+w),y&&(w+="?"),o+=w,p+=20,y&&(p+=-8),m&&(p+=-20),k===".*"&&(p+=-50)}u.push(p)}r.push(u)}if(n.strict&&n.end){const c=r.length-1;r[c][r[c].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function l(c){const u=c.match(i),d={};if(!u)return null;for(let f=1;f<u.length;f++){const p=u[f]||"",h=s[f-1];d[h.name]=p&&h.repeatable?p.split("/"):p}return d}function a(c){let u="",d=!1;for(const f of t){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const p of f)if(p.type===0)u+=p.value;else if(p.type===1){const{value:h,repeatable:m,optional:y}=p,g=h in c?c[h]:"";if(wr(g)&&!m)throw new Error(`Provided param "${h}" is an array but it is not repeatable (* or + modifiers)`);const k=wr(g)?g.join("/"):g;if(!k)if(y)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${h}"`);u+=k}}return u||"/"}return{re:i,score:r,keys:s,parse:l,stringify:a}}function DE(t,e){let n=0;for(;n<t.length&&n<e.length;){const r=e[n]-t[n];if(r)return r;n++}return t.length<e.length?t.length===1&&t[0]===80?-1:1:t.length>e.length?e.length===1&&e[0]===80?1:-1:0}function Kv(t,e){let n=0;const r=t.score,o=e.score;for(;n<r.length&&n<o.length;){const s=DE(r[n],o[n]);if(s)return s;n++}if(Math.abs(o.length-r.length)===1){if(Fm(r))return 1;if(Fm(o))return-1}return o.length-r.length}function Fm(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const $E={type:0,value:""},FE=/[a-zA-Z0-9_]/;function VE(t){if(!t)return[[]];if(t==="/")return[[$E]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(p){throw new Error(`ERR (${n})/"${c}": ${p}`)}let n=0,r=n;const o=[];let s;function i(){s&&o.push(s),s=[]}let l=0,a,c="",u="";function d(){c&&(n===0?s.push({type:0,value:c}):n===1||n===2||n===3?(s.length>1&&(a==="*"||a==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:c,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):e("Invalid state to consume buffer"),c="")}function f(){c+=a}for(;l<t.length;){if(a=t[l++],a==="\\"&&n!==2){r=n,n=4;continue}switch(n){case 0:a==="/"?(c&&d(),i()):a===":"?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:a==="("?n=2:FE.test(a)?f():(d(),n=0,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case 2:a===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+a:n=3:u+=a;break;case 3:d(),n=0,a!=="*"&&a!=="?"&&a!=="+"&&l--,u="";break;default:e("Unknown state");break}}return n===2&&e(`Unfinished custom RegExp for param "${c}"`),d(),i(),o}function BE(t,e,n){const r=PE(VE(t.path),n),o=ut(r,{record:t,parent:e,children:[],alias:[]});return e&&!o.record.aliasOf==!e.record.aliasOf&&e.children.push(o),o}function HE(t,e){const n=[],r=new Map;e=Hm({strict:!1,end:!0,sensitive:!1},e);function o(d){return r.get(d)}function s(d,f,p){const h=!p,m=jE(d);m.aliasOf=p&&p.record;const y=Hm(e,d),g=[m];if("alias"in d){const b=typeof d.alias=="string"?[d.alias]:d.alias;for(const _ of b)g.push(ut({},m,{components:p?p.record.components:m.components,path:_,aliasOf:p?p.record:m}))}let k,w;for(const b of g){const{path:_}=b;if(f&&_[0]!=="/"){const M=f.record.path,E=M[M.length-1]==="/"?"":"/";b.path=f.record.path+(_&&E+_)}if(k=BE(b,f,y),p?p.alias.push(k):(w=w||k,w!==k&&w.alias.push(k),h&&d.name&&!Bm(k)&&i(d.name)),Gv(k)&&a(k),m.children){const M=m.children;for(let E=0;E<M.length;E++)s(M[E],k,p&&p.children[E])}p=p||k}return w?()=>{i(w)}:Yi}function i(d){if(Uv(d)){const f=r.get(d);f&&(r.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(i),f.alias.forEach(i))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&r.delete(d.record.name),d.children.forEach(i),d.alias.forEach(i))}}function l(){return n}function a(d){const f=WE(d,n);n.splice(f,0,d),d.record.name&&!Bm(d)&&r.set(d.record.name,d)}function c(d,f){let p,h={},m,y;if("name"in d&&d.name){if(p=r.get(d.name),!p)throw pi(1,{location:d});y=p.record.name,h=ut(Vm(f.params,p.keys.filter(w=>!w.optional).concat(p.parent?p.parent.keys.filter(w=>w.optional):[]).map(w=>w.name)),d.params&&Vm(d.params,p.keys.map(w=>w.name))),m=p.stringify(h)}else if(d.path!=null)m=d.path,p=n.find(w=>w.re.test(m)),p&&(h=p.parse(m),y=p.record.name);else{if(p=f.name?r.get(f.name):n.find(w=>w.re.test(f.path)),!p)throw pi(1,{location:d,currentLocation:f});y=p.record.name,h=ut({},f.params,d.params),m=p.stringify(h)}const g=[];let k=p;for(;k;)g.unshift(k.record),k=k.parent;return{name:y,path:m,params:h,matched:g,meta:UE(g)}}t.forEach(d=>s(d));function u(){n.length=0,r.clear()}return{addRoute:s,resolve:c,removeRoute:i,clearRoutes:u,getRoutes:l,getRecordMatcher:o}}function Vm(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function jE(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:zE(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function zE(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const r in t.components)e[r]=typeof n=="object"?n[r]:n;return e}function Bm(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function UE(t){return t.reduce((e,n)=>ut(e,n.meta),{})}function Hm(t,e){const n={};for(const r in t)n[r]=r in e?e[r]:t[r];return n}function WE(t,e){let n=0,r=e.length;for(;n!==r;){const s=n+r>>1;Kv(t,e[s])<0?r=s:n=s+1}const o=KE(t);return o&&(r=e.lastIndexOf(o,r-1)),r}function KE(t){let e=t;for(;e=e.parent;)if(Gv(e)&&Kv(t,e)===0)return e}function Gv({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function GE(t){const e={};if(t===""||t==="?")return e;const r=(t[0]==="?"?t.slice(1):t).split("&");for(let o=0;o<r.length;++o){const s=r[o].replace(Fv," "),i=s.indexOf("="),l=yl(i<0?s:s.slice(0,i)),a=i<0?null:yl(s.slice(i+1));if(l in e){let c=e[l];wr(c)||(c=e[l]=[c]),c.push(a)}else e[l]=a}return e}function jm(t){let e="";for(let n in t){const r=t[n];if(n=fE(n),r==null){r!==void 0&&(e+=(e.length?"&":"")+n);continue}(wr(r)?r.map(s=>s&&af(s)):[r&&af(r)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+n,s!=null&&(e+="="+s))})}return e}function qE(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=wr(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return e}const JE=Symbol(""),zm=Symbol(""),ku=Symbol(""),Vp=Symbol(""),uf=Symbol("");function Ni(){let t=[];function e(r){return t.push(r),()=>{const o=t.indexOf(r);o>-1&&t.splice(o,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function ko(t,e,n,r,o,s=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((l,a)=>{const c=f=>{f===!1?a(pi(4,{from:n,to:e})):f instanceof Error?a(f):NE(f)?a(pi(2,{from:e,to:f})):(i&&r.enterCallbacks[o]===i&&typeof f=="function"&&i.push(f),l())},u=s(()=>t.call(r&&r.instances[o],e,n,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(f=>a(f))})}function ld(t,e,n,r,o=s=>s()){const s=[];for(const i of t)for(const l in i.components){let a=i.components[l];if(!(e!=="beforeRouteEnter"&&!i.instances[l]))if(YE(a)){const u=(a.__vccOpts||a)[e];u&&s.push(ko(u,n,r,i,l,o))}else{let c=a();s.push(()=>c.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${l}" at "${i.path}"`));const d=tE(u)?u.default:u;i.components[l]=d;const p=(d.__vccOpts||d)[e];return p&&ko(p,n,r,i,l,o)()}))}}return s}function YE(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function Um(t){const e=Wt(ku),n=Wt(Vp),r=te(()=>{const a=me(t.to);return e.resolve(a)}),o=te(()=>{const{matched:a}=r.value,{length:c}=a,u=a[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(fi.bind(null,u));if(f>-1)return f;const p=Wm(a[c-2]);return c>1&&Wm(u)===p&&d[d.length-1].path!==p?d.findIndex(fi.bind(null,a[c-2])):f}),s=te(()=>o.value>-1&&eS(n.params,r.value.params)),i=te(()=>o.value>-1&&o.value===n.matched.length-1&&jv(n.params,r.value.params));function l(a={}){return QE(a)?e[me(t.replace)?"replace":"push"](me(t.to)).catch(Yi):Promise.resolve()}return{route:r,href:te(()=>r.value.href),isActive:s,isExactActive:i,navigate:l}}const XE=_e({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Um,setup(t,{slots:e}){const n=Ns(Um(t)),{options:r}=Wt(ku),o=te(()=>({[Km(t.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Km(t.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=e.default&&e.default(n);return t.custom?s:Bn("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),ZE=XE;function QE(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function eS(t,e){for(const n in e){const r=e[n],o=t[n];if(typeof r=="string"){if(r!==o)return!1}else if(!wr(o)||o.length!==r.length||r.some((s,i)=>s!==o[i]))return!1}return!0}function Wm(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const Km=(t,e,n)=>t??e??n,tS=_e({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const r=Wt(uf),o=te(()=>t.route||r.value),s=Wt(zm,0),i=te(()=>{let c=me(s);const{matched:u}=o.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),l=te(()=>o.value.matched[i.value]);Io(zm,te(()=>i.value+1)),Io(JE,l),Io(uf,o);const a=Q();return Re(()=>[a.value,l.value,t.name],([c,u,d],[f,p,h])=>{u&&(u.instances[d]=c,p&&p!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=p.leaveGuards),u.updateGuards.size||(u.updateGuards=p.updateGuards))),c&&u&&(!p||!fi(u,p)||!f)&&(u.enterCallbacks[d]||[]).forEach(m=>m(c))},{flush:"post"}),()=>{const c=o.value,u=t.name,d=l.value,f=d&&d.components[u];if(!f)return Gm(n.default,{Component:f,route:c});const p=d.props[u],h=p?p===!0?c.params:typeof p=="function"?p(c):p:null,y=Bn(f,ut({},h,e,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(d.instances[u]=null)},ref:a}));return Gm(n.default,{Component:y,route:c})||y}}});function Gm(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const nS=tS;function rS(t){const e=HE(t.routes,t),n=t.parseQuery||GE,r=t.stringifyQuery||jm,o=t.history,s=Ni(),i=Ni(),l=Ni(),a=Hl(ho);let c=ho;js&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=sd.bind(null,oe=>""+oe),d=sd.bind(null,hE),f=sd.bind(null,yl);function p(oe,be){let ye,xe;return Uv(oe)?(ye=e.getRecordMatcher(oe),xe=be):xe=oe,e.addRoute(xe,ye)}function h(oe){const be=e.getRecordMatcher(oe);be&&e.removeRoute(be)}function m(){return e.getRoutes().map(oe=>oe.record)}function y(oe){return!!e.getRecordMatcher(oe)}function g(oe,be){if(be=ut({},be||a.value),typeof oe=="string"){const B=id(n,oe,be.path),J=e.resolve({path:B.path},be),ie=o.createHref(B.fullPath);return ut(B,J,{params:f(J.params),hash:yl(B.hash),redirectedFrom:void 0,href:ie})}let ye;if(oe.path!=null)ye=ut({},oe,{path:id(n,oe.path,be.path).path});else{const B=ut({},oe.params);for(const J in B)B[J]==null&&delete B[J];ye=ut({},oe,{params:d(B)}),be.params=d(be.params)}const xe=e.resolve(ye,be),Ve=oe.hash||"";xe.params=u(f(xe.params));const Ue=yE(r,ut({},oe,{hash:dE(Ve),path:xe.path})),O=o.createHref(Ue);return ut({fullPath:Ue,hash:Ve,query:r===jm?qE(oe.query):oe.query||{}},xe,{redirectedFrom:void 0,href:O})}function k(oe){return typeof oe=="string"?id(n,oe,a.value.path):ut({},oe)}function w(oe,be){if(c!==oe)return pi(8,{from:be,to:oe})}function b(oe){return E(oe)}function _(oe){return b(ut(k(oe),{replace:!0}))}function M(oe){const be=oe.matched[oe.matched.length-1];if(be&&be.redirect){const{redirect:ye}=be;let xe=typeof ye=="function"?ye(oe):ye;return typeof xe=="string"&&(xe=xe.includes("?")||xe.includes("#")?xe=k(xe):{path:xe},xe.params={}),ut({query:oe.query,hash:oe.hash,params:xe.path!=null?{}:oe.params},xe)}}function E(oe,be){const ye=c=g(oe),xe=a.value,Ve=oe.state,Ue=oe.force,O=oe.replace===!0,B=M(ye);if(B)return E(ut(k(B),{state:typeof B=="object"?ut({},Ve,B.state):Ve,force:Ue,replace:O}),be||ye);const J=ye;J.redirectedFrom=be;let ie;return!Ue&&bE(r,xe,ye)&&(ie=pi(16,{to:J,from:xe}),je(xe,xe,!0,!1)),(ie?Promise.resolve(ie):R(J,xe)).catch(re=>Fr(re)?Fr(re,2)?re:Le(re):G(re,J,xe)).then(re=>{if(re){if(Fr(re,2))return E(ut({replace:O},k(re.to),{state:typeof re.to=="object"?ut({},Ve,re.to.state):Ve,force:Ue}),be||J)}else re=A(J,xe,!0,O,Ve);return $(J,xe,re),re})}function I(oe,be){const ye=w(oe,be);return ye?Promise.reject(ye):Promise.resolve()}function F(oe){const be=Ze.values().next().value;return be&&typeof be.runWithContext=="function"?be.runWithContext(oe):oe()}function R(oe,be){let ye;const[xe,Ve,Ue]=oS(oe,be);ye=ld(xe.reverse(),"beforeRouteLeave",oe,be);for(const B of xe)B.leaveGuards.forEach(J=>{ye.push(ko(J,oe,be))});const O=I.bind(null,oe,be);return ye.push(O),vt(ye).then(()=>{ye=[];for(const B of s.list())ye.push(ko(B,oe,be));return ye.push(O),vt(ye)}).then(()=>{ye=ld(Ve,"beforeRouteUpdate",oe,be);for(const B of Ve)B.updateGuards.forEach(J=>{ye.push(ko(J,oe,be))});return ye.push(O),vt(ye)}).then(()=>{ye=[];for(const B of Ue)if(B.beforeEnter)if(wr(B.beforeEnter))for(const J of B.beforeEnter)ye.push(ko(J,oe,be));else ye.push(ko(B.beforeEnter,oe,be));return ye.push(O),vt(ye)}).then(()=>(oe.matched.forEach(B=>B.enterCallbacks={}),ye=ld(Ue,"beforeRouteEnter",oe,be,F),ye.push(O),vt(ye))).then(()=>{ye=[];for(const B of i.list())ye.push(ko(B,oe,be));return ye.push(O),vt(ye)}).catch(B=>Fr(B,8)?B:Promise.reject(B))}function $(oe,be,ye){l.list().forEach(xe=>F(()=>xe(oe,be,ye)))}function A(oe,be,ye,xe,Ve){const Ue=w(oe,be);if(Ue)return Ue;const O=be===ho,B=js?history.state:{};ye&&(xe||O?o.replace(oe.fullPath,ut({scroll:O&&B&&B.scroll},Ve)):o.push(oe.fullPath,Ve)),a.value=oe,je(oe,be,ye,O),Le()}let q;function Y(){q||(q=o.listen((oe,be,ye)=>{if(!Pt.listening)return;const xe=g(oe),Ve=M(xe);if(Ve){E(ut(Ve,{replace:!0}),xe).catch(Yi);return}c=xe;const Ue=a.value;js&&SE(Rm(Ue.fullPath,ye.delta),xu()),R(xe,Ue).catch(O=>Fr(O,12)?O:Fr(O,2)?(E(O.to,xe).then(B=>{Fr(B,20)&&!ye.delta&&ye.type===bl.pop&&o.go(-1,!1)}).catch(Yi),Promise.reject()):(ye.delta&&o.go(-ye.delta,!1),G(O,xe,Ue))).then(O=>{O=O||A(xe,Ue,!1),O&&(ye.delta&&!Fr(O,8)?o.go(-ye.delta,!1):ye.type===bl.pop&&Fr(O,20)&&o.go(-1,!1)),$(xe,Ue,O)}).catch(Yi)}))}let Z=Ni(),K=Ni(),X;function G(oe,be,ye){Le(oe);const xe=K.list();return xe.length?xe.forEach(Ve=>Ve(oe,be,ye)):console.error(oe),Promise.reject(oe)}function ne(){return X&&a.value!==ho?Promise.resolve():new Promise((oe,be)=>{Z.add([oe,be])})}function Le(oe){return X||(X=!oe,Y(),Z.list().forEach(([be,ye])=>oe?ye(oe):be()),Z.reset()),oe}function je(oe,be,ye,xe){const{scrollBehavior:Ve}=t;if(!js||!Ve)return Promise.resolve();const Ue=!ye&&ME(Rm(oe.fullPath,0))||(xe||!ye)&&history.state&&history.state.scroll||null;return zt().then(()=>Ve(oe,be,Ue)).then(O=>O&&EE(O)).catch(O=>G(O,oe,be))}const Be=oe=>o.go(oe);let Dt;const Ze=new Set,Pt={currentRoute:a,listening:!0,addRoute:p,removeRoute:h,clearRoutes:e.clearRoutes,hasRoute:y,getRoutes:m,resolve:g,options:t,push:b,replace:_,go:Be,back:()=>Be(-1),forward:()=>Be(1),beforeEach:s.add,beforeResolve:i.add,afterEach:l.add,onError:K.add,isReady:ne,install(oe){const be=this;oe.component("RouterLink",ZE),oe.component("RouterView",nS),oe.config.globalProperties.$router=be,Object.defineProperty(oe.config.globalProperties,"$route",{enumerable:!0,get:()=>me(a)}),js&&!Dt&&a.value===ho&&(Dt=!0,b(o.location).catch(Ve=>{}));const ye={};for(const Ve in ho)Object.defineProperty(ye,Ve,{get:()=>a.value[Ve],enumerable:!0});oe.provide(ku,be),oe.provide(Vp,xb(ye)),oe.provide(uf,a);const xe=oe.unmount;Ze.add(oe),oe.unmount=function(){Ze.delete(oe),Ze.size<1&&(c=ho,q&&q(),q=null,a.value=ho,Dt=!1,X=!1),xe()}}};function vt(oe){return oe.reduce((be,ye)=>be.then(()=>F(ye)),Promise.resolve())}return Pt}function oS(t,e){const n=[],r=[],o=[],s=Math.max(e.matched.length,t.matched.length);for(let i=0;i<s;i++){const l=e.matched[i];l&&(t.matched.find(c=>fi(c,l))?r.push(l):n.push(l));const a=t.matched[i];a&&(e.matched.find(c=>fi(c,a))||o.push(a))}return[n,r,o]}function BW(){return Wt(ku)}function _u(t){return Wt(Vp)}const sS={class:"ml-2 border-l border-slate-200 dark:border-slate-600"},iS={key:0,class:"font-medium flex-1"},lS={key:1,class:"font-medium flex-1"},aS={class:"rounded-md border font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 text-xs px-2 py-0.5 min-w-[20px] h-5 flex items-center justify-center bg-blue-100 text-blue-700 border-blue-200 dark:bg-slate-600 dark:text-slate-200 dark:border-slate-500"},cS=_e({__name:"DropdownMenu",props:{navigationItems:{}},setup(t){const e=_u(),n=te(()=>e.path);return(r,o)=>{const s=yr("router-link");return S(),T("div",sS,[(S(!0),T(Me,null,Je(r.navigationItems,i=>(S(),T("div",{key:i.id},[ce(s,{class:ae(["w-full flex items-center space-x-3 px-6 py-2.5 mb-1 rounded-lg text-left transition-all duration-200 group border-0 text-sm",[n.value===i.path?"bg-blue-50 text-blue-700 border border-blue-200 dark:bg-slate-700 dark:text-slate-100":"bg-white text-slate-600 hover:bg-slate-50 hover:text-slate-800 dark:bg-transparent dark:text-slate-300 dark:hover:bg-slate-700 dark:hover:text-slate-100"]]),to:i.path},{default:Ke(()=>[(S(),Ae(Cn(i.icon),{class:"w-5 h-5 shrink-0"})),i.label?(S(),T("span",iS,we(r.$t(i.label)),1)):(S(),T("span",lS,we(i.title),1)),v("div",aS,we(i.entries),1)]),_:2},1032,["class","to"])]))),128))])}}}),uS={key:0,class:"font-medium flex-1"},dS={key:1,class:"font-medium flex-1"},fS=["onClick"],pS={key:0,class:"font-medium flex-1"},hS={key:1,class:"font-medium flex-1"},mS=_e({__name:"SidebarMenu",props:{navigationItems:{}},setup(t){const e=_u(),n=Q([]),r=te(()=>e.path),o=i=>i.path==="/collections"?e.path==="/collections"||e.path.startsWith("/collections/"):r.value===i.path,s=i=>{const l=n.value.indexOf(i);l>-1?n.value.splice(l,1):n.value.push(i)};return(i,l)=>{const a=yr("router-link");return S(!0),T(Me,null,Je(i.navigationItems,c=>(S(),T(Me,{key:c.id},[c.children?(S(),T("button",{key:1,onClick:u=>s(c.id),class:ae(["w-full flex items-center space-x-3 px-3 py-2.5 mb-1 rounded-lg text-left transition-all duration-200 group border-0",[o(c)?"bg-blue-50 text-blue-700 border border-blue-200 dark:bg-slate-700 dark:text-slate-100":"bg-white text-slate-600 hover:bg-slate-50 hover:text-slate-800 dark:bg-transparent dark:text-slate-300 dark:hover:bg-slate-700 dark:hover:text-slate-100"]])},[(S(),Ae(Cn(c.icon),{class:"w-5 h-5"})),c.label?(S(),T("span",pS,we(i.$t(c.label)),1)):(S(),T("span",hS,we(c.title),1)),(S(),Ae(Cn(n.value.includes(c.id)?me(HC):me(BC)),{class:"w-4 h-4 text-slate-400 dark:text-slate-500"}))],10,fS)):(S(),Ae(a,{key:0,to:c.path,class:ae(["w-full flex items-center space-x-3 px-3 py-2.5 mb-1 rounded-lg text-left transition-all duration-200 group border-0",[o(c)?"bg-blue-50 text-blue-700 border border-blue-200 dark:bg-slate-700 dark:text-slate-100":"bg-white text-slate-600 hover:bg-slate-50 hover:text-slate-800 dark:bg-transparent dark:text-slate-300 dark:hover:bg-slate-700 dark:hover:text-slate-100"]])},{default:Ke(()=>[(S(),Ae(Cn(c.icon),{class:"w-5 h-5"})),c.label?(S(),T("span",uS,we(i.$t(c.label)),1)):(S(),T("span",dS,we(c.title),1))]),_:2},1032,["to","class"])),ce(Rs,{name:"slide-fade"},{default:Ke(()=>[c.children?nt((S(),Ae(cS,{key:0,"navigation-items":c.children||[]},null,8,["navigation-items"])),[[jo,n.value.includes(c.id)]]):pe("",!0)]),_:2},1024)],64))),128)}}}),gS={class:"border-t border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 flex-shrink-0"},yS={class:"p-3 bg-white dark:bg-slate-800"},bS={class:"w-full flex items-center space-x-3 p-2 rounded-lg bg-white hover:bg-slate-50 transition-colors group text-slate-700 hover:text-slate-900 border-0 dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-slate-200 dark:hover:text-slate-100",type:"button",id:"radix-:r0:","aria-haspopup":"menu","aria-expanded":"false","data-state":"closed"},vS={class:"relative"},wS={class:"relative flex shrink-0 overflow-hidden rounded-full w-9 h-9 border-2 border-white dark:border-slate-600 shadow-sm"},xS={class:"flex items-center justify-center w-8 h-8 text-white rounded-full bg-sky-500"},kS={class:"flex items-center space-x-2 ml-auto"},_S={href:"/logout",class:"relative p-2 text-gray-500 transition-colors rounded-full hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700"},qv=_e({__name:"SidebarFooter",setup(t){const{toggleTheme:e,theme:n}=Pv();return(r,o)=>(S(),T("div",gS,[v("div",yS,[v("div",bS,[v("div",vS,[v("span",wS,[v("div",xS,[ce(me(QC),{class:"w-4 h-4"})])]),o[1]||(o[1]=v("div",{class:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full border-2 border-white dark:border-slate-600 bg-green-500"},null,-1))]),o[2]||(o[2]=v("div",{class:"flex-1 text-left"},[v("p",{class:"font-semibold whitespace-nowrap text-slate-800 dark:text-slate-100 text-sm group-hover:text-slate-900 dark:group-hover:text-slate-50"}," Softpro User "),v("p",{class:"text-xs text-slate-500 dark:text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-300"}," Admin ")],-1)),v("button",{class:"inline-flex items-center justify-center whitespace-nowrap font-medium rounded-md text-xs h-8 w-8 p-0 ml-auto bg-transparent text-slate-600 transition-all duration-200 border-0 hover:bg-slate-100 hover:text-slate-800 dark:hover:bg-slate-600 dark:text-slate-300 dark:hover:text-white",onClick:o[0]||(o[0]=(...s)=>me(e)&&me(e)(...s))},[me(n)!=="dark"?(S(),Ae(me(JC),{key:0,class:"w-5 h-5"})):(S(),Ae(me(YC),{key:1,class:"w-5 h-5"}))]),v("div",kS,[v("a",_S,[ce(me(GC),{class:"w-5 h-5"})])])])])]))}}),CS="/assets/logo-Cct5WB26.png",ES="modulepreload",SS=function(t){return"/"+t},qm={},ot=function(e,n,r){let o=Promise.resolve();return n&&n.length>0&&(document.getElementsByTagName("link"),o=Promise.all(n.map(s=>{if(s=SS(s),s in qm)return;qm[s]=!0;const i=s.endsWith(".css"),l=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${l}`))return;const a=document.createElement("link");if(a.rel=i?"stylesheet":ES,i||(a.as="script",a.crossOrigin=""),a.href=s,document.head.appendChild(a),i)return new Promise((c,u)=>{a.addEventListener("load",c),a.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${s}`)))})}))),o.then(()=>e()).catch(s=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s})},MS=(t,e)=>{const n=t[e];return n?typeof n=="function"?n():Promise.resolve(n):new Promise((r,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+e)))})};/*!
123
- * shared v11.1.5
124
- * (c) 2025 kazuya kawaguchi
125
- * Released under the MIT License.
126
- */const fc=typeof window<"u",qo=(t,e=!1)=>e?Symbol.for(t):Symbol(t),TS=(t,e,n)=>AS({l:t,k:e,s:n}),AS=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),qt=t=>typeof t=="number"&&isFinite(t),LS=t=>Bp(t)==="[object Date]",hi=t=>Bp(t)==="[object RegExp]",Cu=t=>Ge(t)&&Object.keys(t).length===0,Qt=Object.assign,OS=Object.create,ht=(t=null)=>OS(t);let Jm;const cs=()=>Jm||(Jm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:ht());function Ym(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const NS=Object.prototype.hasOwnProperty;function pr(t,e){return NS.call(t,e)}const Vt=Array.isArray,Tt=t=>typeof t=="function",Se=t=>typeof t=="string",et=t=>typeof t=="boolean",it=t=>t!==null&&typeof t=="object",IS=t=>it(t)&&Tt(t.then)&&Tt(t.catch),Jv=Object.prototype.toString,Bp=t=>Jv.call(t),Ge=t=>Bp(t)==="[object Object]",RS=t=>t==null?"":Vt(t)||Ge(t)&&t.toString===Jv?JSON.stringify(t,null,2):String(t);function Hp(t,e=""){return t.reduce((n,r,o)=>o===0?n+r:n+e+r,"")}function PS(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const ua=t=>!it(t)||Vt(t);function $a(t,e){if(ua(t)||ua(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:o}=n.pop();Object.keys(r).forEach(s=>{s!=="__proto__"&&(it(r[s])&&!it(o[s])&&(o[s]=Array.isArray(r[s])?[]:ht()),ua(o[s])||ua(r[s])?o[s]=r[s]:n.push({src:r[s],des:o[s]}))})}}/*!
127
- * message-compiler v11.1.5
128
- * (c) 2025 kazuya kawaguchi
129
- * Released under the MIT License.
130
- */function DS(t,e,n){return{line:t,column:e,offset:n}}function df(t,e,n){return{start:t,end:e}}const dt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},$S=17;function Eu(t,e,n={}){const{domain:r,messages:o,args:s}=n,i=t,l=new SyntaxError(String(i));return l.code=t,e&&(l.location=e),l.domain=r,l}function FS(t){throw t}const Vr=" ",VS="\r",Tn=`
131
- `,BS="\u2028",HS="\u2029";function jS(t){const e=t;let n=0,r=1,o=1,s=0;const i=E=>e[E]===VS&&e[E+1]===Tn,l=E=>e[E]===Tn,a=E=>e[E]===HS,c=E=>e[E]===BS,u=E=>i(E)||l(E)||a(E)||c(E),d=()=>n,f=()=>r,p=()=>o,h=()=>s,m=E=>i(E)||a(E)||c(E)?Tn:e[E],y=()=>m(n),g=()=>m(n+s);function k(){return s=0,u(n)&&(r++,o=0),i(n)&&n++,n++,o++,e[n]}function w(){return i(n+s)&&s++,s++,e[n+s]}function b(){n=0,r=1,o=1,s=0}function _(E=0){s=E}function M(){const E=n+s;for(;E!==n;)k();s=0}return{index:d,line:f,column:p,peekOffset:h,charAt:m,currentChar:y,currentPeek:g,next:k,peek:w,reset:b,resetPeek:_,skipToPeek:M}}const mo=void 0,zS=".",Xm="'",US="tokenizer";function WS(t,e={}){const n=e.location!==!1,r=jS(t),o=()=>r.index(),s=()=>DS(r.line(),r.column(),r.index()),i=s(),l=o(),a={currentType:13,offset:l,startLoc:i,endLoc:i,lastType:13,lastOffset:l,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=e;function d(x,C,N,...H){const D=c();if(C.column+=N,C.offset+=N,u){const z=n?df(D.startLoc,C):null,V=Eu(x,z,{domain:US,args:H});u(V)}}function f(x,C,N){x.endLoc=s(),x.currentType=C;const H={type:C};return n&&(H.loc=df(x.startLoc,x.endLoc)),N!=null&&(H.value=N),H}const p=x=>f(x,13);function h(x,C){return x.currentChar()===C?(x.next(),C):(d(dt.EXPECTED_TOKEN,s(),0,C),"")}function m(x){let C="";for(;x.currentPeek()===Vr||x.currentPeek()===Tn;)C+=x.currentPeek(),x.peek();return C}function y(x){const C=m(x);return x.skipToPeek(),C}function g(x){if(x===mo)return!1;const C=x.charCodeAt(0);return C>=97&&C<=122||C>=65&&C<=90||C===95}function k(x){if(x===mo)return!1;const C=x.charCodeAt(0);return C>=48&&C<=57}function w(x,C){const{currentType:N}=C;if(N!==2)return!1;m(x);const H=g(x.currentPeek());return x.resetPeek(),H}function b(x,C){const{currentType:N}=C;if(N!==2)return!1;m(x);const H=x.currentPeek()==="-"?x.peek():x.currentPeek(),D=k(H);return x.resetPeek(),D}function _(x,C){const{currentType:N}=C;if(N!==2)return!1;m(x);const H=x.currentPeek()===Xm;return x.resetPeek(),H}function M(x,C){const{currentType:N}=C;if(N!==7)return!1;m(x);const H=x.currentPeek()===".";return x.resetPeek(),H}function E(x,C){const{currentType:N}=C;if(N!==8)return!1;m(x);const H=g(x.currentPeek());return x.resetPeek(),H}function I(x,C){const{currentType:N}=C;if(!(N===7||N===11))return!1;m(x);const H=x.currentPeek()===":";return x.resetPeek(),H}function F(x,C){const{currentType:N}=C;if(N!==9)return!1;const H=()=>{const z=x.currentPeek();return z==="{"?g(x.peek()):z==="@"||z==="|"||z===":"||z==="."||z===Vr||!z?!1:z===Tn?(x.peek(),H()):$(x,!1)},D=H();return x.resetPeek(),D}function R(x){m(x);const C=x.currentPeek()==="|";return x.resetPeek(),C}function $(x,C=!0){const N=(D=!1,z="")=>{const V=x.currentPeek();return V==="{"||V==="@"||!V?D:V==="|"?!(z===Vr||z===Tn):V===Vr?(x.peek(),N(!0,Vr)):V===Tn?(x.peek(),N(!0,Tn)):!0},H=N();return C&&x.resetPeek(),H}function A(x,C){const N=x.currentChar();return N===mo?mo:C(N)?(x.next(),N):null}function q(x){const C=x.charCodeAt(0);return C>=97&&C<=122||C>=65&&C<=90||C>=48&&C<=57||C===95||C===36}function Y(x){return A(x,q)}function Z(x){const C=x.charCodeAt(0);return C>=97&&C<=122||C>=65&&C<=90||C>=48&&C<=57||C===95||C===36||C===45}function K(x){return A(x,Z)}function X(x){const C=x.charCodeAt(0);return C>=48&&C<=57}function G(x){return A(x,X)}function ne(x){const C=x.charCodeAt(0);return C>=48&&C<=57||C>=65&&C<=70||C>=97&&C<=102}function Le(x){return A(x,ne)}function je(x){let C="",N="";for(;C=G(x);)N+=C;return N}function Be(x){let C="";for(;;){const N=x.currentChar();if(N==="{"||N==="}"||N==="@"||N==="|"||!N)break;if(N===Vr||N===Tn)if($(x))C+=N,x.next();else{if(R(x))break;C+=N,x.next()}else C+=N,x.next()}return C}function Dt(x){y(x);let C="",N="";for(;C=K(x);)N+=C;return x.currentChar()===mo&&d(dt.UNTERMINATED_CLOSING_BRACE,s(),0),N}function Ze(x){y(x);let C="";return x.currentChar()==="-"?(x.next(),C+=`-${je(x)}`):C+=je(x),x.currentChar()===mo&&d(dt.UNTERMINATED_CLOSING_BRACE,s(),0),C}function Pt(x){return x!==Xm&&x!==Tn}function vt(x){y(x),h(x,"'");let C="",N="";for(;C=A(x,Pt);)C==="\\"?N+=oe(x):N+=C;const H=x.currentChar();return H===Tn||H===mo?(d(dt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),H===Tn&&(x.next(),h(x,"'")),N):(h(x,"'"),N)}function oe(x){const C=x.currentChar();switch(C){case"\\":case"'":return x.next(),`\\${C}`;case"u":return be(x,C,4);case"U":return be(x,C,6);default:return d(dt.UNKNOWN_ESCAPE_SEQUENCE,s(),0,C),""}}function be(x,C,N){h(x,C);let H="";for(let D=0;D<N;D++){const z=Le(x);if(!z){d(dt.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),0,`\\${C}${H}${x.currentChar()}`);break}H+=z}return`\\${C}${H}`}function ye(x){return x!=="{"&&x!=="}"&&x!==Vr&&x!==Tn}function xe(x){y(x);let C="",N="";for(;C=A(x,ye);)N+=C;return N}function Ve(x){let C="",N="";for(;C=Y(x);)N+=C;return N}function Ue(x){const C=N=>{const H=x.currentChar();return H==="{"||H==="@"||H==="|"||H==="("||H===")"||!H||H===Vr?N:(N+=H,x.next(),C(N))};return C("")}function O(x){y(x);const C=h(x,"|");return y(x),C}function B(x,C){let N=null;switch(x.currentChar()){case"{":return C.braceNest>=1&&d(dt.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),x.next(),N=f(C,2,"{"),y(x),C.braceNest++,N;case"}":return C.braceNest>0&&C.currentType===2&&d(dt.EMPTY_PLACEHOLDER,s(),0),x.next(),N=f(C,3,"}"),C.braceNest--,C.braceNest>0&&y(x),C.inLinked&&C.braceNest===0&&(C.inLinked=!1),N;case"@":return C.braceNest>0&&d(dt.UNTERMINATED_CLOSING_BRACE,s(),0),N=J(x,C)||p(C),C.braceNest=0,N;default:{let D=!0,z=!0,V=!0;if(R(x))return C.braceNest>0&&d(dt.UNTERMINATED_CLOSING_BRACE,s(),0),N=f(C,1,O(x)),C.braceNest=0,C.inLinked=!1,N;if(C.braceNest>0&&(C.currentType===4||C.currentType===5||C.currentType===6))return d(dt.UNTERMINATED_CLOSING_BRACE,s(),0),C.braceNest=0,ie(x,C);if(D=w(x,C))return N=f(C,4,Dt(x)),y(x),N;if(z=b(x,C))return N=f(C,5,Ze(x)),y(x),N;if(V=_(x,C))return N=f(C,6,vt(x)),y(x),N;if(!D&&!z&&!V)return N=f(C,12,xe(x)),d(dt.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,N.value),y(x),N;break}}return N}function J(x,C){const{currentType:N}=C;let H=null;const D=x.currentChar();switch((N===7||N===8||N===11||N===9)&&(D===Tn||D===Vr)&&d(dt.INVALID_LINKED_FORMAT,s(),0),D){case"@":return x.next(),H=f(C,7,"@"),C.inLinked=!0,H;case".":return y(x),x.next(),f(C,8,".");case":":return y(x),x.next(),f(C,9,":");default:return R(x)?(H=f(C,1,O(x)),C.braceNest=0,C.inLinked=!1,H):M(x,C)||I(x,C)?(y(x),J(x,C)):E(x,C)?(y(x),f(C,11,Ve(x))):F(x,C)?(y(x),D==="{"?B(x,C)||H:f(C,10,Ue(x))):(N===7&&d(dt.INVALID_LINKED_FORMAT,s(),0),C.braceNest=0,C.inLinked=!1,ie(x,C))}}function ie(x,C){let N={type:13};if(C.braceNest>0)return B(x,C)||p(C);if(C.inLinked)return J(x,C)||p(C);switch(x.currentChar()){case"{":return B(x,C)||p(C);case"}":return d(dt.UNBALANCED_CLOSING_BRACE,s(),0),x.next(),f(C,3,"}");case"@":return J(x,C)||p(C);default:{if(R(x))return N=f(C,1,O(x)),C.braceNest=0,C.inLinked=!1,N;if($(x))return f(C,0,Be(x));break}}return N}function re(){const{currentType:x,offset:C,startLoc:N,endLoc:H}=a;return a.lastType=x,a.lastOffset=C,a.lastStartLoc=N,a.lastEndLoc=H,a.offset=o(),a.startLoc=s(),r.currentChar()===mo?f(a,13):ie(r,a)}return{nextToken:re,currentOffset:o,currentPosition:s,context:c}}const KS="parser",GS=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function qS(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function JS(t={}){const e=t.location!==!1,{onError:n}=t;function r(g,k,w,b,..._){const M=g.currentPosition();if(M.offset+=b,M.column+=b,n){const E=e?df(w,M):null,I=Eu(k,E,{domain:KS,args:_});n(I)}}function o(g,k,w){const b={type:g};return e&&(b.start=k,b.end=k,b.loc={start:w,end:w}),b}function s(g,k,w,b){e&&(g.end=k,g.loc&&(g.loc.end=w))}function i(g,k){const w=g.context(),b=o(3,w.offset,w.startLoc);return b.value=k,s(b,g.currentOffset(),g.currentPosition()),b}function l(g,k){const w=g.context(),{lastOffset:b,lastStartLoc:_}=w,M=o(5,b,_);return M.index=parseInt(k,10),g.nextToken(),s(M,g.currentOffset(),g.currentPosition()),M}function a(g,k){const w=g.context(),{lastOffset:b,lastStartLoc:_}=w,M=o(4,b,_);return M.key=k,g.nextToken(),s(M,g.currentOffset(),g.currentPosition()),M}function c(g,k){const w=g.context(),{lastOffset:b,lastStartLoc:_}=w,M=o(9,b,_);return M.value=k.replace(GS,qS),g.nextToken(),s(M,g.currentOffset(),g.currentPosition()),M}function u(g){const k=g.nextToken(),w=g.context(),{lastOffset:b,lastStartLoc:_}=w,M=o(8,b,_);return k.type!==11?(r(g,dt.UNEXPECTED_EMPTY_LINKED_MODIFIER,w.lastStartLoc,0),M.value="",s(M,b,_),{nextConsumeToken:k,node:M}):(k.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,_r(k)),M.value=k.value||"",s(M,g.currentOffset(),g.currentPosition()),{node:M})}function d(g,k){const w=g.context(),b=o(7,w.offset,w.startLoc);return b.value=k,s(b,g.currentOffset(),g.currentPosition()),b}function f(g){const k=g.context(),w=o(6,k.offset,k.startLoc);let b=g.nextToken();if(b.type===8){const _=u(g);w.modifier=_.node,b=_.nextConsumeToken||g.nextToken()}switch(b.type!==9&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(b)),b=g.nextToken(),b.type===2&&(b=g.nextToken()),b.type){case 10:b.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(b)),w.key=d(g,b.value||"");break;case 4:b.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(b)),w.key=a(g,b.value||"");break;case 5:b.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(b)),w.key=l(g,b.value||"");break;case 6:b.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(b)),w.key=c(g,b.value||"");break;default:{r(g,dt.UNEXPECTED_EMPTY_LINKED_KEY,k.lastStartLoc,0);const _=g.context(),M=o(7,_.offset,_.startLoc);return M.value="",s(M,_.offset,_.startLoc),w.key=M,s(w,_.offset,_.startLoc),{nextConsumeToken:b,node:w}}}return s(w,g.currentOffset(),g.currentPosition()),{node:w}}function p(g){const k=g.context(),w=k.currentType===1?g.currentOffset():k.offset,b=k.currentType===1?k.endLoc:k.startLoc,_=o(2,w,b);_.items=[];let M=null;do{const F=M||g.nextToken();switch(M=null,F.type){case 0:F.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(F)),_.items.push(i(g,F.value||""));break;case 5:F.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(F)),_.items.push(l(g,F.value||""));break;case 4:F.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(F)),_.items.push(a(g,F.value||""));break;case 6:F.value==null&&r(g,dt.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,_r(F)),_.items.push(c(g,F.value||""));break;case 7:{const R=f(g);_.items.push(R.node),M=R.nextConsumeToken||null;break}}}while(k.currentType!==13&&k.currentType!==1);const E=k.currentType===1?k.lastOffset:g.currentOffset(),I=k.currentType===1?k.lastEndLoc:g.currentPosition();return s(_,E,I),_}function h(g,k,w,b){const _=g.context();let M=b.items.length===0;const E=o(1,k,w);E.cases=[],E.cases.push(b);do{const I=p(g);M||(M=I.items.length===0),E.cases.push(I)}while(_.currentType!==13);return M&&r(g,dt.MUST_HAVE_MESSAGES_IN_PLURAL,w,0),s(E,g.currentOffset(),g.currentPosition()),E}function m(g){const k=g.context(),{offset:w,startLoc:b}=k,_=p(g);return k.currentType===13?_:h(g,w,b,_)}function y(g){const k=WS(g,Qt({},t)),w=k.context(),b=o(0,w.offset,w.startLoc);return e&&b.loc&&(b.loc.source=g),b.body=m(k),t.onCacheKey&&(b.cacheKey=t.onCacheKey(g)),w.currentType!==13&&r(k,dt.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,g[w.offset]||""),s(b,k.currentOffset(),k.currentPosition()),b}return{parse:y}}function _r(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function YS(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function Zm(t,e){for(let n=0;n<t.length;n++)jp(t[n],e)}function jp(t,e){switch(t.type){case 1:Zm(t.cases,e),e.helper("plural");break;case 2:Zm(t.items,e);break;case 6:{jp(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function XS(t,e={}){const n=YS(t);n.helper("normalize"),t.body&&jp(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function ZS(t){const e=t.body;return e.type===2?Qm(e):e.cases.forEach(n=>Qm(n)),t}function Qm(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Hp(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}function zs(t){switch(t.t=t.type,t.type){case 0:{const e=t;zs(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)zs(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)zs(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;zs(e.key),e.k=e.key,delete e.key,e.modifier&&(zs(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}}delete t.type}function QS(t,e){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:s}=e,i=e.location!==!1,l={filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&t.loc&&(l.source=t.loc.source);const a=()=>l;function c(y,g){l.code+=y}function u(y,g=!0){const k=g?o:"";c(s?k+" ".repeat(y):k)}function d(y=!0){const g=++l.indentLevel;y&&u(g)}function f(y=!0){const g=--l.indentLevel;y&&u(g)}function p(){u(l.indentLevel)}return{context:a,push:c,indent:d,deindent:f,newline:p,helper:y=>`_${y}`,needIndent:()=>l.needIndent}}function eM(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),mi(t,e.key),e.modifier?(t.push(", "),mi(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function tM(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const o=e.items.length;for(let s=0;s<o&&(mi(t,e.items[s]),s!==o-1);s++)t.push(", ");t.deindent(r()),t.push("])")}function nM(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const o=e.cases.length;for(let s=0;s<o&&(mi(t,e.cases[s]),s!==o-1);s++)t.push(", ");t.deindent(r()),t.push("])")}}function rM(t,e){e.body?mi(t,e.body):t.push("null")}function mi(t,e){const{helper:n}=t;switch(e.type){case 0:rM(t,e);break;case 1:nM(t,e);break;case 2:tM(t,e);break;case 6:eM(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break}}const oM=(t,e={})=>{const n=Se(e.mode)?e.mode:"normal",r=Se(e.filename)?e.filename:"message.intl",o=!!e.sourceMap,s=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
132
- `,i=e.needIndent?e.needIndent:n!=="arrow",l=t.helpers||[],a=QS(t,{mode:n,filename:r,sourceMap:o,breakLineCode:s,needIndent:i});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(i),l.length>0&&(a.push(`const { ${Hp(l.map(d=>`${d}: _${d}`),", ")} } = ctx`),a.newline()),a.push("return "),mi(a,t),a.deindent(i),a.push("}"),delete t.helpers;const{code:c,map:u}=a.context();return{ast:t,code:c,map:u?u.toJSON():void 0}};function sM(t,e={}){const n=Qt({},e),r=!!n.jit,o=!!n.minify,s=n.optimize==null?!0:n.optimize,l=JS(n).parse(t);return r?(s&&ZS(l),o&&zs(l),{ast:l,code:""}):(XS(l,n),oM(l,n))}/*!
133
- * core-base v11.1.5
134
- * (c) 2025 kazuya kawaguchi
135
- * Released under the MIT License.
136
- */function iM(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(cs().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(cs().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Nr(t){return it(t)&&zp(t)===0&&(pr(t,"b")||pr(t,"body"))}const Yv=["b","body"];function lM(t){return Jo(t,Yv)}const Xv=["c","cases"];function aM(t){return Jo(t,Xv,[])}const Zv=["s","static"];function cM(t){return Jo(t,Zv)}const Qv=["i","items"];function uM(t){return Jo(t,Qv,[])}const e1=["t","type"];function zp(t){return Jo(t,e1)}const t1=["v","value"];function da(t,e){const n=Jo(t,t1);if(n!=null)return n;throw vl(e)}const n1=["m","modifier"];function dM(t){return Jo(t,n1)}const r1=["k","key"];function fM(t){const e=Jo(t,r1);if(e)return e;throw vl(6)}function Jo(t,e,n){for(let r=0;r<e.length;r++){const o=e[r];if(pr(t,o)&&t[o]!=null)return t[o]}return n}const o1=[...Yv,...Xv,...Zv,...Qv,...r1,...n1,...t1,...e1];function vl(t){return new Error(`unhandled node type: ${t}`)}function ad(t){return n=>pM(n,t)}function pM(t,e){const n=lM(e);if(n==null)throw vl(0);if(zp(n)===1){const s=aM(n);return t.plural(s.reduce((i,l)=>[...i,eg(t,l)],[]))}else return eg(t,n)}function eg(t,e){const n=cM(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=uM(e).reduce((o,s)=>[...o,ff(t,s)],[]);return t.normalize(r)}}function ff(t,e){const n=zp(e);switch(n){case 3:return da(e,n);case 9:return da(e,n);case 4:{const r=e;if(pr(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(pr(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw vl(n)}case 5:{const r=e;if(pr(r,"i")&&qt(r.i))return t.interpolate(t.list(r.i));if(pr(r,"index")&&qt(r.index))return t.interpolate(t.list(r.index));throw vl(n)}case 6:{const r=e,o=dM(r),s=fM(r);return t.linked(ff(t,s),o?ff(t,o):void 0,t.type)}case 7:return da(e,n);case 8:return da(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const hM=t=>t;let fa=ht();function mM(t,e={}){let n=!1;const r=e.onError||FS;return e.onError=o=>{n=!0,r(o)},{...sM(t,e),detectError:n}}function gM(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Se(t)){et(e.warnHtmlMessage)&&e.warnHtmlMessage;const r=(e.onCacheKey||hM)(t),o=fa[r];if(o)return o;const{ast:s,detectError:i}=mM(t,{...e,location:!1,jit:!0}),l=ad(s);return i?l:fa[r]=l}else{const n=t.cacheKey;if(n){const r=fa[n];return r||(fa[n]=ad(t))}else return ad(t)}}let wl=null;function yM(t){wl=t}function bM(t,e,n){wl&&wl.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const vM=wM("function:translate");function wM(t){return e=>wl&&wl.emit(t,e)}const Zr={INVALID_ARGUMENT:$S,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},xM=24;function Qr(t){return Eu(t,null,void 0)}function Up(t,e){return e.locale!=null?tg(e.locale):tg(t.locale)}let cd;function tg(t){if(Se(t))return t;if(Tt(t)){if(t.resolvedOnce&&cd!=null)return cd;if(t.constructor.name==="Function"){const e=t();if(IS(e))throw Qr(Zr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return cd=e}else throw Qr(Zr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Qr(Zr.NOT_SUPPORT_LOCALE_TYPE)}function kM(t,e,n){return[...new Set([n,...Vt(e)?e:it(e)?Object.keys(e):Se(e)?[e]:[n]])]}function s1(t,e,n){const r=Se(n)?n:xl,o=t;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(r);if(!s){s=[];let i=[n];for(;Vt(i);)i=ng(s,i,e);const l=Vt(e)||!Ge(e)?e:e.default?e.default:null;i=Se(l)?[l]:l,Vt(i)&&ng(s,i,!1),o.__localeChainCache.set(r,s)}return s}function ng(t,e,n){let r=!0;for(let o=0;o<e.length&&et(r);o++){const s=e[o];Se(s)&&(r=_M(t,e[o],n))}return r}function _M(t,e,n){let r;const o=e.split("-");do{const s=o.join("-");r=CM(t,s,n),o.splice(-1,1)}while(o.length&&r===!0);return r}function CM(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const o=e.replace(/!/g,"");t.push(o),(Vt(n)||Ge(n))&&n[o]&&(r=n[o])}return r}const Yo=[];Yo[0]={w:[0],i:[3,0],"[":[4],o:[7]};Yo[1]={w:[1],".":[2],"[":[4],o:[7]};Yo[2]={w:[2],i:[3,0],0:[3,0]};Yo[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Yo[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Yo[5]={"'":[4,0],o:8,l:[5,0]};Yo[6]={'"':[4,0],o:8,l:[6,0]};const EM=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function SM(t){return EM.test(t)}function MM(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function TM(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function AM(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:SM(e)?MM(e):"*"+e}function LM(t){const e=[];let n=-1,r=0,o=0,s,i,l,a,c,u,d;const f=[];f[0]=()=>{i===void 0?i=l:i+=l},f[1]=()=>{i!==void 0&&(e.push(i),i=void 0)},f[2]=()=>{f[0](),o++},f[3]=()=>{if(o>0)o--,r=4,f[0]();else{if(o=0,i===void 0||(i=AM(i),i===!1))return!1;f[1]()}};function p(){const h=t[n+1];if(r===5&&h==="'"||r===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;r!==null;)if(n++,s=t[n],!(s==="\\"&&p())){if(a=TM(s),d=Yo[r],c=d[a]||d.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=s,u()===!1))))return;if(r===7)return e}}const rg=new Map;function OM(t,e){return it(t)?t[e]:null}function NM(t,e){if(!it(t))return null;let n=rg.get(e);if(n||(n=LM(e),n&&rg.set(e,n)),!n)return null;const r=n.length;let o=t,s=0;for(;s<r;){const i=n[s];if(o1.includes(i)&&Nr(o))return null;const l=o[i];if(l===void 0||Tt(o))return null;o=l,s++}return o}const IM="11.1.5",Su=-1,xl="en-US",og="",sg=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function RM(){return{upper:(t,e)=>e==="text"&&Se(t)?t.toUpperCase():e==="vnode"&&it(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&Se(t)?t.toLowerCase():e==="vnode"&&it(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&Se(t)?sg(t):e==="vnode"&&it(t)&&"__v_isVNode"in t?sg(t.children):t}}let i1;function PM(t){i1=t}let l1;function DM(t){l1=t}let a1;function $M(t){a1=t}let c1=null;const FM=t=>{c1=t},VM=()=>c1;let u1=null;const ig=t=>{u1=t},BM=()=>u1;let lg=0;function HM(t={}){const e=Tt(t.onWarn)?t.onWarn:PS,n=Se(t.version)?t.version:IM,r=Se(t.locale)||Tt(t.locale)?t.locale:xl,o=Tt(r)?xl:r,s=Vt(t.fallbackLocale)||Ge(t.fallbackLocale)||Se(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:o,i=Ge(t.messages)?t.messages:ud(o),l=Ge(t.datetimeFormats)?t.datetimeFormats:ud(o),a=Ge(t.numberFormats)?t.numberFormats:ud(o),c=Qt(ht(),t.modifiers,RM()),u=t.pluralRules||ht(),d=Tt(t.missing)?t.missing:null,f=et(t.missingWarn)||hi(t.missingWarn)?t.missingWarn:!0,p=et(t.fallbackWarn)||hi(t.fallbackWarn)?t.fallbackWarn:!0,h=!!t.fallbackFormat,m=!!t.unresolving,y=Tt(t.postTranslation)?t.postTranslation:null,g=Ge(t.processor)?t.processor:null,k=et(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter,b=Tt(t.messageCompiler)?t.messageCompiler:i1,_=Tt(t.messageResolver)?t.messageResolver:l1||OM,M=Tt(t.localeFallbacker)?t.localeFallbacker:a1||kM,E=it(t.fallbackContext)?t.fallbackContext:void 0,I=t,F=it(I.__datetimeFormatters)?I.__datetimeFormatters:new Map,R=it(I.__numberFormatters)?I.__numberFormatters:new Map,$=it(I.__meta)?I.__meta:{};lg++;const A={version:n,cid:lg,locale:r,fallbackLocale:s,messages:i,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:m,postTranslation:y,processor:g,warnHtmlMessage:k,escapeParameter:w,messageCompiler:b,messageResolver:_,localeFallbacker:M,fallbackContext:E,onWarn:e,__meta:$};return A.datetimeFormats=l,A.numberFormats=a,A.__datetimeFormatters=F,A.__numberFormatters=R,__INTLIFY_PROD_DEVTOOLS__&&bM(A,n,$),A}const ud=t=>({[t]:ht()});function Wp(t,e,n,r,o){const{missing:s,onWarn:i}=t;if(s!==null){const l=s(t,n,e,o);return Se(l)?l:e}else return e}function Ii(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function jM(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function zM(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(jM(t,e[r]))return!0;return!1}function ag(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:i}=t,{__datetimeFormatters:l}=t,[a,c,u,d]=pf(...e),f=et(u.missingWarn)?u.missingWarn:t.missingWarn;et(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn;const p=!!u.part,h=Up(t,u),m=i(t,o,h);if(!Se(a)||a==="")return new Intl.DateTimeFormat(h,d).format(c);let y={},g,k=null;const w="datetime format";for(let M=0;M<m.length&&(g=m[M],y=n[g]||{},k=y[a],!Ge(k));M++)Wp(t,a,g,f,w);if(!Ge(k)||!Se(g))return r?Su:a;let b=`${g}__${a}`;Cu(d)||(b=`${b}__${JSON.stringify(d)}`);let _=l.get(b);return _||(_=new Intl.DateTimeFormat(g,Qt({},k,d)),l.set(b,_)),p?_.formatToParts(c):_.format(c)}const d1=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function pf(...t){const[e,n,r,o]=t,s=ht();let i=ht(),l;if(Se(e)){const a=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Qr(Zr.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw Qr(Zr.INVALID_ISO_DATE_ARGUMENT)}}else if(LS(e)){if(isNaN(e.getTime()))throw Qr(Zr.INVALID_DATE_ARGUMENT);l=e}else if(qt(e))l=e;else throw Qr(Zr.INVALID_ARGUMENT);return Se(n)?s.key=n:Ge(n)&&Object.keys(n).forEach(a=>{d1.includes(a)?i[a]=n[a]:s[a]=n[a]}),Se(r)?s.locale=r:Ge(r)&&(i=r),Ge(o)&&(i=o),[s.key||"",l,s,i]}function cg(t,e,n){const r=t;for(const o in n){const s=`${e}__${o}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function ug(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:i}=t,{__numberFormatters:l}=t,[a,c,u,d]=hf(...e),f=et(u.missingWarn)?u.missingWarn:t.missingWarn;et(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn;const p=!!u.part,h=Up(t,u),m=i(t,o,h);if(!Se(a)||a==="")return new Intl.NumberFormat(h,d).format(c);let y={},g,k=null;const w="number format";for(let M=0;M<m.length&&(g=m[M],y=n[g]||{},k=y[a],!Ge(k));M++)Wp(t,a,g,f,w);if(!Ge(k)||!Se(g))return r?Su:a;let b=`${g}__${a}`;Cu(d)||(b=`${b}__${JSON.stringify(d)}`);let _=l.get(b);return _||(_=new Intl.NumberFormat(g,Qt({},k,d)),l.set(b,_)),p?_.formatToParts(c):_.format(c)}const f1=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function hf(...t){const[e,n,r,o]=t,s=ht();let i=ht();if(!qt(e))throw Qr(Zr.INVALID_ARGUMENT);const l=e;return Se(n)?s.key=n:Ge(n)&&Object.keys(n).forEach(a=>{f1.includes(a)?i[a]=n[a]:s[a]=n[a]}),Se(r)?s.locale=r:Ge(r)&&(i=r),Ge(o)&&(i=o),[s.key||"",l,s,i]}function dg(t,e,n){const r=t;for(const o in n){const s=`${e}__${o}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}const UM=t=>t,WM=t=>"",KM="text",GM=t=>t.length===0?"":Hp(t),qM=RS;function fg(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function JM(t){const e=qt(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(qt(t.named.count)||qt(t.named.n))?qt(t.named.count)?t.named.count:qt(t.named.n)?t.named.n:e:e}function YM(t,e){e.count||(e.count=t),e.n||(e.n=t)}function XM(t={}){const e=t.locale,n=JM(t),r=it(t.pluralRules)&&Se(e)&&Tt(t.pluralRules[e])?t.pluralRules[e]:fg,o=it(t.pluralRules)&&Se(e)&&Tt(t.pluralRules[e])?fg:void 0,s=g=>g[r(n,g.length,o)],i=t.list||[],l=g=>i[g],a=t.named||ht();qt(t.pluralIndex)&&YM(n,a);const c=g=>a[g];function u(g,k){const w=Tt(t.messages)?t.messages(g,!!k):it(t.messages)?t.messages[g]:!1;return w||(t.parent?t.parent.message(g):WM)}const d=g=>t.modifiers?t.modifiers[g]:UM,f=Ge(t.processor)&&Tt(t.processor.normalize)?t.processor.normalize:GM,p=Ge(t.processor)&&Tt(t.processor.interpolate)?t.processor.interpolate:qM,h=Ge(t.processor)&&Se(t.processor.type)?t.processor.type:KM,y={list:l,named:c,plural:s,linked:(g,...k)=>{const[w,b]=k;let _="text",M="";k.length===1?it(w)?(M=w.modifier||M,_=w.type||_):Se(w)&&(M=w||M):k.length===2&&(Se(w)&&(M=w||M),Se(b)&&(_=b||_));const E=u(g,!0)(y),I=_==="vnode"&&Vt(E)&&M?E[0]:E;return M?d(M)(I,_):I},message:u,type:h,interpolate:p,normalize:f,values:Qt(ht(),i,a)};return y}const pg=()=>"",tr=t=>Tt(t);function hg(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:s,fallbackLocale:i,messages:l}=t,[a,c]=mf(...e),u=et(c.missingWarn)?c.missingWarn:t.missingWarn,d=et(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,f=et(c.escapeParameter)?c.escapeParameter:t.escapeParameter,p=!!c.resolvedMessage,h=Se(c.default)||et(c.default)?et(c.default)?s?a:()=>a:c.default:n?s?a:()=>a:null,m=n||h!=null&&(Se(h)||Tt(h)),y=Up(t,c);f&&ZM(c);let[g,k,w]=p?[a,y,l[y]||ht()]:p1(t,a,y,i,d,u),b=g,_=a;if(!p&&!(Se(b)||Nr(b)||tr(b))&&m&&(b=h,_=b),!p&&(!(Se(b)||Nr(b)||tr(b))||!Se(k)))return o?Su:a;let M=!1;const E=()=>{M=!0},I=tr(b)?b:h1(t,a,k,b,_,E);if(M)return b;const F=tT(t,k,w,c),R=XM(F),$=QM(t,I,R),A=r?r($,a):$;if(__INTLIFY_PROD_DEVTOOLS__){const q={timestamp:Date.now(),key:Se(a)?a:tr(b)?b.key:"",locale:k||(tr(b)?b.locale:""),format:Se(b)?b:tr(b)?b.source:"",message:A};q.meta=Qt({},t.__meta,VM()||{}),vM(q)}return A}function ZM(t){Vt(t.list)?t.list=t.list.map(e=>Se(e)?Ym(e):e):it(t.named)&&Object.keys(t.named).forEach(e=>{Se(t.named[e])&&(t.named[e]=Ym(t.named[e]))})}function p1(t,e,n,r,o,s){const{messages:i,onWarn:l,messageResolver:a,localeFallbacker:c}=t,u=c(t,r,n);let d=ht(),f,p=null;const h="translate";for(let m=0;m<u.length&&(f=u[m],d=i[f]||ht(),(p=a(d,e))===null&&(p=d[e]),!(Se(p)||Nr(p)||tr(p)));m++)if(!zM(f,u)){const y=Wp(t,e,f,s,h);y!==e&&(p=y)}return[p,f,d]}function h1(t,e,n,r,o,s){const{messageCompiler:i,warnHtmlMessage:l}=t;if(tr(r)){const c=r;return c.locale=c.locale||n,c.key=c.key||e,c}if(i==null){const c=()=>r;return c.locale=n,c.key=e,c}const a=i(r,eT(t,n,o,r,l,s));return a.locale=n,a.key=e,a.source=r,a}function QM(t,e,n){return e(n)}function mf(...t){const[e,n,r]=t,o=ht();if(!Se(e)&&!qt(e)&&!tr(e)&&!Nr(e))throw Qr(Zr.INVALID_ARGUMENT);const s=qt(e)?String(e):(tr(e),e);return qt(n)?o.plural=n:Se(n)?o.default=n:Ge(n)&&!Cu(n)?o.named=n:Vt(n)&&(o.list=n),qt(r)?o.plural=r:Se(r)?o.default=r:Ge(r)&&Qt(o,r),[s,o]}function eT(t,e,n,r,o,s){return{locale:e,key:n,warnHtmlMessage:o,onError:i=>{throw s&&s(i),i},onCacheKey:i=>TS(e,n,i)}}function tT(t,e,n,r){const{modifiers:o,pluralRules:s,messageResolver:i,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=t,f={locale:e,modifiers:o,pluralRules:s,messages:(p,h)=>{let m=i(n,p);if(m==null&&(u||h)){const[,,y]=p1(u||t,p,e,l,a,c);m=i(y,p)}if(Se(m)||Nr(m)){let y=!1;const k=h1(t,p,e,m,p,()=>{y=!0});return y?pg:k}else return tr(m)?m:pg}};return t.processor&&(f.processor=t.processor),r.list&&(f.list=r.list),r.named&&(f.named=r.named),qt(r.plural)&&(f.pluralIndex=r.plural),f}iM();/*!
137
- * vue-i18n v11.1.5
138
- * (c) 2025 kazuya kawaguchi
139
- * Released under the MIT License.
140
- */const nT="11.1.5";function rT(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(cs().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(cs().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(cs().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(cs().__INTLIFY_PROD_DEVTOOLS__=!1)}const jn={UNEXPECTED_RETURN_TYPE:xM,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Gn(t,...e){return Eu(t,null,void 0)}const gf=qo("__translateVNode"),yf=qo("__datetimeParts"),bf=qo("__numberParts"),m1=qo("__setPluralRules"),g1=qo("__injectWithOption"),vf=qo("__dispose");function kl(t){if(!it(t)||Nr(t))return t;for(const e in t)if(pr(t,e))if(!e.includes("."))it(t[e])&&kl(t[e]);else{const n=e.split("."),r=n.length-1;let o=t,s=!1;for(let i=0;i<r;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in o||(o[n[i]]=ht()),!it(o[n[i]])){s=!0;break}o=o[n[i]]}if(s||(Nr(o)?o1.includes(n[r])||delete t[e]:(o[n[r]]=t[e],delete t[e])),!Nr(o)){const i=o[n[r]];it(i)&&kl(i)}}return t}function Kp(t,e){const{messages:n,__i18n:r,messageResolver:o,flatJson:s}=e,i=Ge(n)?n:Vt(r)?ht():{[t]:ht()};if(Vt(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(i[a]=i[a]||ht(),$a(c,i[a])):$a(c,i)}else Se(l)&&$a(JSON.parse(l),i)}),o==null&&s)for(const l in i)pr(i,l)&&kl(i[l]);return i}function y1(t){return t.type}function b1(t,e,n){let r=it(e.messages)?e.messages:ht();"__i18nGlobal"in n&&(r=Kp(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(it(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(i=>{t.mergeDateTimeFormat(i,e.datetimeFormats[i])})}if(it(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(i=>{t.mergeNumberFormat(i,e.numberFormats[i])})}}}function mg(t){return ce(ro,null,t,0)}const gg="__INTLIFY_META__",yg=()=>[],oT=()=>!1;let bg=0;function vg(t){return(e,n,r,o)=>t(n,r,St()||void 0,o)}const sT=()=>{const t=St();let e=null;return t&&(e=y1(t)[gg])?{[gg]:e}:null};function Gp(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,o=t.flatJson,s=fc?Q:Hl;let i=et(t.inheritLocale)?t.inheritLocale:!0;const l=s(e&&i?e.locale.value:Se(t.locale)?t.locale:xl),a=s(e&&i?e.fallbackLocale.value:Se(t.fallbackLocale)||Vt(t.fallbackLocale)||Ge(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:l.value),c=s(Kp(l.value,t)),u=s(Ge(t.datetimeFormats)?t.datetimeFormats:{[l.value]:{}}),d=s(Ge(t.numberFormats)?t.numberFormats:{[l.value]:{}});let f=e?e.missingWarn:et(t.missingWarn)||hi(t.missingWarn)?t.missingWarn:!0,p=e?e.fallbackWarn:et(t.fallbackWarn)||hi(t.fallbackWarn)?t.fallbackWarn:!0,h=e?e.fallbackRoot:et(t.fallbackRoot)?t.fallbackRoot:!0,m=!!t.fallbackFormat,y=Tt(t.missing)?t.missing:null,g=Tt(t.missing)?vg(t.missing):null,k=Tt(t.postTranslation)?t.postTranslation:null,w=e?e.warnHtmlMessage:et(t.warnHtmlMessage)?t.warnHtmlMessage:!0,b=!!t.escapeParameter;const _=e?e.modifiers:Ge(t.modifiers)?t.modifiers:{};let M=t.pluralRules||e&&e.pluralRules,E;E=(()=>{r&&ig(null);const V={version:nT,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:_,pluralRules:M,missing:g===null?void 0:g,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:!0,postTranslation:k===null?void 0:k,warnHtmlMessage:w,escapeParameter:b,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};V.datetimeFormats=u.value,V.numberFormats=d.value,V.__datetimeFormatters=Ge(E)?E.__datetimeFormatters:void 0,V.__numberFormatters=Ge(E)?E.__numberFormatters:void 0;const W=HM(V);return r&&ig(W),W})(),Ii(E,l.value,a.value);function F(){return[l.value,a.value,c.value,u.value,d.value]}const R=te({get:()=>l.value,set:V=>{E.locale=V,l.value=V}}),$=te({get:()=>a.value,set:V=>{E.fallbackLocale=V,a.value=V,Ii(E,l.value,V)}}),A=te(()=>c.value),q=te(()=>u.value),Y=te(()=>d.value);function Z(){return Tt(k)?k:null}function K(V){k=V,E.postTranslation=V}function X(){return y}function G(V){V!==null&&(g=vg(V)),y=V,E.missing=g}const ne=(V,W,he,Ce,De,P)=>{F();let j;try{__INTLIFY_PROD_DEVTOOLS__,r||(E.fallbackContext=e?BM():void 0),j=V(E)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(E.fallbackContext=void 0)}if(he!=="translate exists"&&qt(j)&&j===Su||he==="translate exists"&&!j){const[se,de]=W();return e&&h?Ce(e):De(se)}else{if(P(j))return j;throw Gn(jn.UNEXPECTED_RETURN_TYPE)}};function Le(...V){return ne(W=>Reflect.apply(hg,null,[W,...V]),()=>mf(...V),"translate",W=>Reflect.apply(W.t,W,[...V]),W=>W,W=>Se(W))}function je(...V){const[W,he,Ce]=V;if(Ce&&!it(Ce))throw Gn(jn.INVALID_ARGUMENT);return Le(W,he,Qt({resolvedMessage:!0},Ce||{}))}function Be(...V){return ne(W=>Reflect.apply(ag,null,[W,...V]),()=>pf(...V),"datetime format",W=>Reflect.apply(W.d,W,[...V]),()=>og,W=>Se(W)||Vt(W))}function Dt(...V){return ne(W=>Reflect.apply(ug,null,[W,...V]),()=>hf(...V),"number format",W=>Reflect.apply(W.n,W,[...V]),()=>og,W=>Se(W)||Vt(W))}function Ze(V){return V.map(W=>Se(W)||qt(W)||et(W)?mg(String(W)):W)}const vt={normalize:Ze,interpolate:V=>V,type:"vnode"};function oe(...V){return ne(W=>{let he;const Ce=W;try{Ce.processor=vt,he=Reflect.apply(hg,null,[Ce,...V])}finally{Ce.processor=null}return he},()=>mf(...V),"translate",W=>W[gf](...V),W=>[mg(W)],W=>Vt(W))}function be(...V){return ne(W=>Reflect.apply(ug,null,[W,...V]),()=>hf(...V),"number format",W=>W[bf](...V),yg,W=>Se(W)||Vt(W))}function ye(...V){return ne(W=>Reflect.apply(ag,null,[W,...V]),()=>pf(...V),"datetime format",W=>W[yf](...V),yg,W=>Se(W)||Vt(W))}function xe(V){M=V,E.pluralRules=M}function Ve(V,W){return ne(()=>{if(!V)return!1;const he=Se(W)?W:l.value,Ce=B(he),De=E.messageResolver(Ce,V);return Nr(De)||tr(De)||Se(De)},()=>[V],"translate exists",he=>Reflect.apply(he.te,he,[V,W]),oT,he=>et(he))}function Ue(V){let W=null;const he=s1(E,a.value,l.value);for(let Ce=0;Ce<he.length;Ce++){const De=c.value[he[Ce]]||{},P=E.messageResolver(De,V);if(P!=null){W=P;break}}return W}function O(V){const W=Ue(V);return W??(e?e.tm(V)||{}:{})}function B(V){return c.value[V]||{}}function J(V,W){if(o){const he={[V]:W};for(const Ce in he)pr(he,Ce)&&kl(he[Ce]);W=he[V]}c.value[V]=W,E.messages=c.value}function ie(V,W){c.value[V]=c.value[V]||{};const he={[V]:W};if(o)for(const Ce in he)pr(he,Ce)&&kl(he[Ce]);W=he[V],$a(W,c.value[V]),E.messages=c.value}function re(V){return u.value[V]||{}}function x(V,W){u.value[V]=W,E.datetimeFormats=u.value,cg(E,V,W)}function C(V,W){u.value[V]=Qt(u.value[V]||{},W),E.datetimeFormats=u.value,cg(E,V,W)}function N(V){return d.value[V]||{}}function H(V,W){d.value[V]=W,E.numberFormats=d.value,dg(E,V,W)}function D(V,W){d.value[V]=Qt(d.value[V]||{},W),E.numberFormats=d.value,dg(E,V,W)}bg++,e&&fc&&(Re(e.locale,V=>{i&&(l.value=V,E.locale=V,Ii(E,l.value,a.value))}),Re(e.fallbackLocale,V=>{i&&(a.value=V,E.fallbackLocale=V,Ii(E,l.value,a.value))}));const z={id:bg,locale:R,fallbackLocale:$,get inheritLocale(){return i},set inheritLocale(V){i=V,V&&e&&(l.value=e.locale.value,a.value=e.fallbackLocale.value,Ii(E,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:A,get modifiers(){return _},get pluralRules(){return M||{}},get isGlobal(){return r},get missingWarn(){return f},set missingWarn(V){f=V,E.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(V){p=V,E.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(V){h=V},get fallbackFormat(){return m},set fallbackFormat(V){m=V,E.fallbackFormat=m},get warnHtmlMessage(){return w},set warnHtmlMessage(V){w=V,E.warnHtmlMessage=V},get escapeParameter(){return b},set escapeParameter(V){b=V,E.escapeParameter=V},t:Le,getLocaleMessage:B,setLocaleMessage:J,mergeLocaleMessage:ie,getPostTranslationHandler:Z,setPostTranslationHandler:K,getMissingHandler:X,setMissingHandler:G,[m1]:xe};return z.datetimeFormats=q,z.numberFormats=Y,z.rt=je,z.te=Ve,z.tm=O,z.d=Be,z.n=Dt,z.getDateTimeFormat=re,z.setDateTimeFormat=x,z.mergeDateTimeFormat=C,z.getNumberFormat=N,z.setNumberFormat=H,z.mergeNumberFormat=D,z[g1]=n,z[gf]=oe,z[yf]=ye,z[bf]=be,z}function iT(t){const e=Se(t.locale)?t.locale:xl,n=Se(t.fallbackLocale)||Vt(t.fallbackLocale)||Ge(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=Tt(t.missing)?t.missing:void 0,o=et(t.silentTranslationWarn)||hi(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=et(t.silentFallbackWarn)||hi(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,i=et(t.fallbackRoot)?t.fallbackRoot:!0,l=!!t.formatFallbackMessages,a=Ge(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,u=Tt(t.postTranslation)?t.postTranslation:void 0,d=Se(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,f=!!t.escapeParameterHtml,p=et(t.sync)?t.sync:!0;let h=t.messages;if(Ge(t.sharedMessages)){const _=t.sharedMessages;h=Object.keys(_).reduce((E,I)=>{const F=E[I]||(E[I]={});return Qt(F,_[I]),E},h||{})}const{__i18n:m,__root:y,__injectWithOption:g}=t,k=t.datetimeFormats,w=t.numberFormats,b=t.flatJson;return{locale:e,fallbackLocale:n,messages:h,flatJson:b,datetimeFormats:k,numberFormats:w,missing:r,missingWarn:o,fallbackWarn:s,fallbackRoot:i,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:t.messageResolver,inheritLocale:p,__i18n:m,__root:y,__injectWithOption:g}}function wf(t={}){const e=Gp(iT(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(o){e.locale.value=o},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(o){e.fallbackLocale.value=o},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(o){e.setMissingHandler(o)},get silentTranslationWarn(){return et(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(o){e.missingWarn=et(o)?!o:o},get silentFallbackWarn(){return et(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(o){e.fallbackWarn=et(o)?!o:o},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(o){e.fallbackFormat=o},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(o){e.setPostTranslationHandler(o)},get sync(){return e.inheritLocale},set sync(o){e.inheritLocale=o},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){e.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(o){e.escapeParameter=o},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...o){return Reflect.apply(e.t,e,[...o])},rt(...o){return Reflect.apply(e.rt,e,[...o])},te(o,s){return e.te(o,s)},tm(o){return e.tm(o)},getLocaleMessage(o){return e.getLocaleMessage(o)},setLocaleMessage(o,s){e.setLocaleMessage(o,s)},mergeLocaleMessage(o,s){e.mergeLocaleMessage(o,s)},d(...o){return Reflect.apply(e.d,e,[...o])},getDateTimeFormat(o){return e.getDateTimeFormat(o)},setDateTimeFormat(o,s){e.setDateTimeFormat(o,s)},mergeDateTimeFormat(o,s){e.mergeDateTimeFormat(o,s)},n(...o){return Reflect.apply(e.n,e,[...o])},getNumberFormat(o){return e.getNumberFormat(o)},setNumberFormat(o,s){e.setNumberFormat(o,s)},mergeNumberFormat(o,s){e.mergeNumberFormat(o,s)}};return r.__extender=n,r}function lT(t,e,n){return{beforeCreate(){const r=St();if(!r)throw Gn(jn.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=e,this===this.$root)this.$i18n=wg(t,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=wf(s);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=wg(t,o);else{this.$i18n=wf({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;o.__i18nGlobal&&b1(e,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,i)=>this.$i18n.te(s,i),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=St();if(!r)throw Gn(jn.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(r),delete this.$i18n}}}function wg(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[m1](e.pluralizationRules||t.pluralizationRules);const n=Kp(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const qp={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function aT({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,o)=>[...r,...o.type===Me?o.children:[o]],[]):e.reduce((n,r)=>{const o=t[r];return o&&(n[r]=o()),n},ht())}function v1(){return Me}const cT=_e({name:"i18n-t",props:Qt({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>qt(t)||!isNaN(t)}},qp),setup(t,e){const{slots:n,attrs:r}=e,o=t.i18n||Kl({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(d=>d[0]!=="_"),i=ht();t.locale&&(i.locale=t.locale),t.plural!==void 0&&(i.plural=Se(t.plural)?+t.plural:t.plural);const l=aT(e,s),a=o[gf](t.keypath,l,i),c=Qt(ht(),r),u=Se(t.tag)||it(t.tag)?t.tag:v1();return Bn(u,c,a)}}}),xg=cT;function uT(t){return Vt(t)&&!Se(t[0])}function w1(t,e,n,r){const{slots:o,attrs:s}=e;return()=>{const i={part:!0};let l=ht();t.locale&&(i.locale=t.locale),Se(t.format)?i.key=t.format:it(t.format)&&(Se(t.format.key)&&(i.key=t.format.key),l=Object.keys(t.format).reduce((f,p)=>n.includes(p)?Qt(ht(),f,{[p]:t.format[p]}):f,ht()));const a=r(t.value,i,l);let c=[i.key];Vt(a)?c=a.map((f,p)=>{const h=o[f.type],m=h?h({[f.type]:f.value,index:p,parts:a}):[f.value];return uT(m)&&(m[0].key=`${f.type}-${p}`),m}):Se(a)&&(c=[a]);const u=Qt(ht(),s),d=Se(t.tag)||it(t.tag)?t.tag:v1();return Bn(d,u,c)}}const dT=_e({name:"i18n-n",props:Qt({value:{type:Number,required:!0},format:{type:[String,Object]}},qp),setup(t,e){const n=t.i18n||Kl({useScope:t.scope,__useComponent:!0});return w1(t,e,f1,(...r)=>n[bf](...r))}}),kg=dT;function fT(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function pT(t){const e=i=>{const{instance:l,value:a}=i;if(!l||!l.$)throw Gn(jn.UNEXPECTED_ERROR);const c=fT(t,l.$),u=_g(a);return[Reflect.apply(c.t,c,[...Cg(u)]),c]};return{created:(i,l)=>{const[a,c]=e(l);fc&&t.global===c&&(i.__i18nWatcher=Re(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),i.__composer=c,i.textContent=a},unmounted:i=>{fc&&i.__i18nWatcher&&(i.__i18nWatcher(),i.__i18nWatcher=void 0,delete i.__i18nWatcher),i.__composer&&(i.__composer=void 0,delete i.__composer)},beforeUpdate:(i,{value:l})=>{if(i.__composer){const a=i.__composer,c=_g(l);i.textContent=Reflect.apply(a.t,a,[...Cg(c)])}},getSSRProps:i=>{const[l]=e(i);return{textContent:l}}}}function _g(t){if(Se(t))return{path:t};if(Ge(t)){if(!("path"in t))throw Gn(jn.REQUIRED_VALUE,"path");return t}else throw Gn(jn.INVALID_VALUE)}function Cg(t){const{path:e,locale:n,args:r,choice:o,plural:s}=t,i={},l=r||{};return Se(n)&&(i.locale=n),qt(o)&&(i.plural=o),qt(s)&&(i.plural=s),[e,l,i]}function hT(t,e,...n){const r=Ge(n[0])?n[0]:{};(et(r.globalInstall)?r.globalInstall:!0)&&([xg.name,"I18nT"].forEach(s=>t.component(s,xg)),[kg.name,"I18nN"].forEach(s=>t.component(s,kg)),[Sg.name,"I18nD"].forEach(s=>t.component(s,Sg))),t.directive("t",pT(e))}const mT=qo("global-vue-i18n");function gT(t={}){const e=__VUE_I18N_LEGACY_API__&&et(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,n=et(t.globalInjection)?t.globalInjection:!0,r=new Map,[o,s]=yT(t,e),i=qo("");function l(d){return r.get(d)||null}function a(d,f){r.set(d,f)}function c(d){r.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=i,d.provide(d.__VUE_I18N_SYMBOL__,u),Ge(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let p=null;!e&&n&&(p=ET(d,u.global)),__VUE_I18N_FULL_INSTALL__&&hT(d,u,...f),__VUE_I18N_LEGACY_API__&&e&&d.mixin(lT(s,s.__composer,u));const h=d.unmount;d.unmount=()=>{p&&p(),u.dispose(),h()}},get global(){return s},dispose(){o.stop()},__instances:r,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Kl(t={}){const e=St();if(e==null)throw Gn(jn.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Gn(jn.NOT_INSTALLED);const n=bT(e),r=wT(n),o=y1(e),s=vT(t,o);if(s==="global")return b1(r,t,o),r;if(s==="parent"){let a=xT(n,e,t.__useComponent);return a==null&&(a=r),a}const i=n;let l=i.__getInstance(e);if(l==null){const a=Qt({},t);"__i18n"in o&&(a.__i18n=o.__i18n),r&&(a.__root=r),l=Gp(a),i.__composerExtend&&(l[vf]=i.__composerExtend(l)),_T(i,e,l),i.__setInstance(e,l)}return l}function yT(t,e){const n=sb(),r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>wf(t)):n.run(()=>Gp(t));if(r==null)throw Gn(jn.UNEXPECTED_ERROR);return[n,r]}function bT(t){const e=Wt(t.isCE?mT:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Gn(t.isCE?jn.NOT_INSTALLED_WITH_PROVIDE:jn.UNEXPECTED_ERROR);return e}function vT(t,e){return Cu(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function wT(t){return t.mode==="composition"?t.global:t.global.__composer}function xT(t,e,n=!1){let r=null;const o=e.root;let s=kT(e,n);for(;s!=null;){const i=t;if(t.mode==="composition")r=i.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const l=i.__getInstance(s);l!=null&&(r=l.__composer,n&&r&&!r[g1]&&(r=null))}if(r!=null||o===s)break;s=s.parent}return r}function kT(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function _T(t,e,n){rt(()=>{},e),gn(()=>{const r=n;t.__deleteInstance(e);const o=r[vf];o&&(o(),delete r[vf])},e)}const CT=["locale","fallbackLocale","availableLocales"],Eg=["t","rt","d","n","tm","te"];function ET(t,e){const n=Object.create(null);return CT.forEach(o=>{const s=Object.getOwnPropertyDescriptor(e,o);if(!s)throw Gn(jn.UNEXPECTED_ERROR);const i=Ut(s.value)?{get(){return s.value.value},set(l){s.value.value=l}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,o,i)}),t.config.globalProperties.$i18n=n,Eg.forEach(o=>{const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!s.value)throw Gn(jn.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${o}`,s)}),()=>{delete t.config.globalProperties.$i18n,Eg.forEach(o=>{delete t.config.globalProperties[`$${o}`]})}}const ST=_e({name:"i18n-d",props:Qt({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},qp),setup(t,e){const n=t.i18n||Kl({useScope:t.scope,__useComponent:!0});return w1(t,e,d1,(...r)=>n[yf](...r))}}),Sg=ST;rT();PM(gM);DM(NM);$M(s1);if(__INTLIFY_PROD_DEVTOOLS__){const t=cs();t.__INTLIFY__=!0,yM(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const MT=localStorage.locale||navigator.language.split("-")[0]||"uk",Uo=gT({legacy:!1,locale:MT,fallbackLocale:"en",datetimeFormats:{en:{short:{year:"numeric",month:"short",day:"numeric"},long:{dateStyle:"full",timeStyle:"short"},time:{hour:"2-digit",minute:"2-digit"}},uk:{short:{year:"numeric",month:"short",day:"numeric"},long:{dateStyle:"full",timeStyle:"short"},time:{hour:"2-digit",minute:"2-digit"}}},numberFormats:{en:{currency:{style:"currency",currency:"USD"},percent:{style:"percent",minimumFractionDigits:0},compact:{notation:"compact"}},uk:{currency:{style:"currency",currency:"UAH"},percent:{style:"percent",minimumFractionDigits:0},compact:{notation:"compact"}}},messages:{}});async function x1(t){try{const e=await MS(Object.assign({"./locales/en.json":()=>ot(()=>import("./en-BDx3Svx8.js"),__vite__mapDeps([])),"./locales/uk.json":()=>ot(()=>import("./uk-BA7DIKEL.js"),__vite__mapDeps([]))}),`./locales/${t}.json`);Uo.global.setLocaleMessage(t,e.default),console.log(`Messages loaded for locale: ${t}`)}catch(e){if(console.error(`Failed to load locale ${t}:`,e),t!=="uk")try{const n=await ot(()=>import("./uk-BA7DIKEL.js"),__vite__mapDeps([]));Uo.global.setLocaleMessage(t,n.default),console.log(`Fallback to English for locale: ${t}`)}catch(n){console.error("Failed to load fallback locale en:",n)}}}async function TT(t){await x1(t),Uo.global.locale.value=t,localStorage.setItem("locale",t),document.documentElement.lang=t,window.dispatchEvent(new CustomEvent("storage",{detail:{key:"locale",oldValue:null,newValue:t}}))}async function AT(){const t=Uo.global.locale.value;await x1(t),Uo.global.locale.value=t,localStorage.setItem("locale",t),document.documentElement.lang=t}const LT={class:"text-xl"},OT={key:0,class:"absolute right-0 mt-2 w-48 rounded-md shadow-lg bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5"},NT={class:"py-1",role:"menu","aria-orientation":"vertical"},IT=["onClick"],RT={class:"flex items-baseline space-x-2"},k1=_e({__name:"LanguageSwitcher",setup(t){const{locale:e}=Kl(),n=St(),r=n==null?void 0:n.appContext.config.globalProperties.$settings.locales,o=Q(!1),s=Q(null),i=te(()=>e.value),l=te(()=>r==null?void 0:r.find(u=>u===i.value)),a=async u=>{console.log("Changing language to:",u),await TT(u),console.log("Language changed to:",e.value),o.value=!1},c=u=>{s.value&&!s.value.contains(u.target)&&(o.value=!1)};return rt(()=>{document.addEventListener("mousedown",c)}),gn(()=>{document.removeEventListener("mousedown",c)}),(u,d)=>(S(),T("div",{class:"relative shrink-0",ref_key:"dropdownRef",ref:s},[v("button",{onClick:d[0]||(d[0]=f=>o.value=!o.value),class:"rounded-md text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white focus:outline-none flex items-center space-x-2","aria-label":"Select language"},[v("span",LT,we(l.value),1)]),o.value?(S(),T("div",OT,[v("div",NT,[(S(!0),T(Me,null,Je(me(r),(f,p)=>(S(),T("button",{key:p,onClick:h=>a(f),class:"w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center justify-between",role:"menuitem"},[v("div",RT,[v("span",null,we(f),1)]),i.value===f?(S(),Ae(me(VC),{key:0,class:"h-4 w-4 text-sky-500"})):pe("",!0)],8,IT))),128))])])):pe("",!0)],512))}}),PT={class:"flex items-center h-16 px-6 border-b gap-2 border-gray-200 dark:border-gray-700"},DT=["src","alt"],$T={key:1,src:CS,alt:"Keystatic",class:"w-auto h-10 mr-2 text-sky-500"},FT=["href","title"],VT={class:"flex items-center space-x-2 ml-auto"},BT=_e({__name:"SidebarHeader",setup(t){const{locale:e}=Kl(),n=Q(""),r=Q(""),o=async()=>{var s;try{const l=await(await fetch("/api/settings")).json(),a=((s=l==null?void 0:l.settings)==null?void 0:s.site_info)||{};n.value=a.name||"",r.value=a["logo-cms"]||""}catch(i){console.error("Error fetching settings:",i)}};return rt(()=>{o()}),(s,i)=>{const l=yr("router-link");return S(),T("div",PT,[ce(l,{to:"/",class:"flex items-center text-xl font-semibold text-gray-900 dark:text-white"},{default:Ke(()=>[r.value?(S(),T("img",{key:0,src:r.value,alt:n.value||"CMS",class:"w-auto h-10 mr-2 text-sky-500"},null,8,DT)):(S(),T("img",$T))]),_:1}),v("a",{href:`https://cms.opengis.info/${me(e)}/`,target:"_blank",title:s.$t("guide.help")},[ce(me(zC),{class:"w-5 h-5"})],8,FT),v("div",VT,[ce(k1)])])}}}),HT={class:"flex-col hidden w-64 transition-colors duration-200 bg-white border-r border-gray-200 md:flex dark:border-gray-700 dark:bg-gray-800"},jT={class:"sidebar-menu flex-1 p-2 overflow-y-auto bg-white dark:bg-slate-800"},zT=_e({__name:"Sidebar",setup(t){const e=Q(null),n=async()=>{var o;try{const i=await(await fetch("/user")).json();e.value=((o=i==null?void 0:i.user)==null?void 0:o.user_type)||null}catch(s){console.error("Error fetching user data:",s)}};rt(()=>{n()});const r=te(()=>{const o=[{id:"dashboard",path:"/",label:"navigation.dashboard",icon:UC},{id:"content",path:"/collections",label:"common.content",icon:jC},{id:"menu",path:"/menu",label:"navigation.singletonsMenu",icon:qC},{id:"tags",path:"/tags",label:"navigation.tags",icon:ZC},{id:"users",path:"/users",label:"navigation.users",icon:eE},{id:"media",path:"/media",label:"navigation.media",icon:WC},{id:"settings",path:"/settings",label:"navigation.settings",icon:Dv}];return e.value!=="admin"?o.filter(s=>s.id!=="users"&&s.id!=="settings"):o});return(o,s)=>(S(),T("aside",HT,[ce(BT),v("nav",jT,[ce(mS,{"navigation-items":r.value},null,8,["navigation-items"])]),ce(qv)]))}}),UT=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},WT=UT(zT,[["__scopeId","data-v-95c31110"]]),KT={class:"flex-col hidden w-64 transition-colors duration-200 bg-white border-r border-gray-200 md:flex dark:border-gray-700 dark:bg-gray-800"},GT={class:"p-3 border-b border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 flex-shrink-0"},qT={class:"flex items-center justify-between"},JT={class:"w-full flex items-center justify-between"},YT={class:"ml-auto"},XT={class:"text-lg font-semibold text-slate-800 dark:text-slate-100"},ZT={class:"text-sm text-slate-500 dark:text-slate-400"},QT={class:"flex-1 p-2 space-y-1 overflow-y-auto"},eA={class:"font-medium flex-1"},tA=_e({__name:"SettingsSidebar",setup(t){const e=_u(),n=te(()=>e.path),r=[{id:"settings",path:"/settings/general",label:"navigation.general",icon:Dv},{id:"collections",path:"/settings/collections",label:"navigation.builder",icon:KC},{id:"logs",path:"/settings/logs",label:"navigation.logs",icon:XC}];return(o,s)=>{const i=yr("router-link");return S(),T("aside",KT,[v("div",GT,[v("div",qT,[v("div",JT,[ce(i,{to:"/",class:"inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md h-8 px-2 bg-white text-slate-600 border-0 text-sm font-medium hover:bg-slate-50 hover:text-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-slate-300 dark:hover:text-slate-100"},{default:Ke(()=>[ce(me(FC),{class:"w-4 h-4 mr-2"}),v("span",null,we(o.$t("navigation.back")),1)]),_:1}),v("div",YT,[ce(k1)])])])]),ce(i,{to:"/settings",class:"p-3 border-b border-slate-100 dark:border-slate-700 bg-white dark:bg-slate-800 flex-shrink-0"},{default:Ke(()=>[v("h2",XT,we(o.$t("navigation.settings")),1),v("p",ZT,we(o.$t("navigation.settingsDescription")),1)]),_:1}),v("nav",QT,[(S(),T(Me,null,Je(r,l=>(S(),T(Me,{key:l.id},[l.children?pe("",!0):(S(),Ae(i,{key:0,to:l.path,class:ae(["w-full flex items-center space-x-3 px-3 py-2.5 mb-1 rounded-lg text-left transition-all duration-200 group border-0",[n.value===l.path?"bg-blue-50 text-blue-700 border border-blue-200 dark:bg-slate-700 dark:text-slate-100":"bg-white text-slate-600 hover:bg-slate-50 hover:text-slate-800 dark:bg-transparent dark:text-slate-300 dark:hover:bg-slate-700 dark:hover:text-slate-100"]])},{default:Ke(()=>[(S(),Ae(Cn(l.icon),{class:"w-5 h-5 mr-3"})),v("span",eA,we(o.$t(l.label)),1)]),_:2},1032,["to","class"]))],64))),64))]),ce(qv)])}}}),nA={class:"flex-1 min-h-screen overflow-y-auto bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-50 dark:from-slate-900 dark:via-slate-800 dark:to-slate-900"},rA={class:"flex h-screen transition-colors"},oA={class:"flex-1 p-4 overflow-y-auto md:p-6"},sA=_e({__name:"Layout",setup(t){Pv();const e=_u(),n=Q([]),r=Q([]),o=St();async function s(){try{const l=await fetch("/api/cms-type?type=collection");if(!l.ok)throw new Error("Failed to fetch content types");const c=(await l.json()).rows.sort((u,d)=>u.id==="pages"?-1:d.id==="pages"?1:0);r.value=c,n.value=c}catch(l){console.error("Error fetching content types:",l)}}async function i(){const a=await(await fetch("/api/settings")).json();o&&o.appContext.config.globalProperties.$settings&&(o.appContext.config.globalProperties.$settings.locales=a.settings.locales,o.appContext.config.globalProperties.$settings.locale=a.settings.locale)}return Io("menu",r),Io("fetchContentTypes",s),rt(()=>{s(),i()}),(l,a)=>{const c=yr("router-view");return S(),T("div",nA,[v("div",rA,[me(e).path.includes("/settings")?(S(),Ae(tA,{key:0})):(S(),Ae(WT,{key:1})),v("main",oA,[ce(c)])])])}}}),iA=_e({__name:"App",setup(t){return(e,n)=>(S(),Ae(sA))}});function cn(t){this.content=t}cn.prototype={constructor:cn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new cn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new cn(n)},addToStart:function(t,e){return new cn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new cn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new cn(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=cn.from(t),t.size?new cn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=cn.from(t),t.size?new cn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=cn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};cn.from=function(t){if(t instanceof cn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new cn(e)};function _1(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let i=0;o.text[i]==s.text[i];i++)n++;return n}if(o.content.size||s.content.size){let i=_1(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function C1(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let i=t.child(--o),l=e.child(--s),a=i.nodeSize;if(i==l){n-=a,r-=a;continue}if(!i.sameMarkup(l))return{a:n,b:r};if(i.isText&&i.text!=l.text){let c=0,u=Math.min(i.text.length,l.text.length);for(;c<u&&i.text[i.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(i.content.size||l.content.size){let c=C1(i.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class le{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,s){for(let i=0,l=0;l<n;i++){let a=this.content[i],c=l+a.nodeSize;if(c>e&&r(a,o+l,s||null,i)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,o+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(i?i=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new le(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let s=0,i=0;i<n;s++){let l=this.content[s],a=i+l.nodeSize;a>e&&((i<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-i),Math.min(l.text.length,n-i)):l=l.cut(Math.max(0,e-i-1),Math.min(l.content.size,n-i-1))),r.push(l),o+=l.nodeSize),i=a}return new le(r,o)}cutByIndex(e,n){return e==n?le.empty:e==0&&n==this.content.length?this:new le(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new le(o,s)}addToStart(e){return new le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return _1(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return C1(this,e,n,r)}findIndex(e){if(e==0)return pa(0,e);if(e==this.size)return pa(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),s=r+o.nodeSize;if(s>=e)return s==e?pa(n+1,s):pa(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return le.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new le(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return le.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new le(n||e,r)}static from(e){if(!e)return le.empty;if(e instanceof le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}le.empty=new le([],0);const dd={index:0,offset:0};function pa(t,e){return dd.index=t,dd.offset=e,dd}function pc(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!pc(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!pc(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let wt=class xf{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&pc(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return xf.none;if(e instanceof xf)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};wt.none=[];class hc extends Error{}class ke{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=S1(this.content,e+this.openStart,n);return r&&new ke(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ke(E1(this.content,e+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(e,n){if(!n)return ke.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ke(le.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new ke(e,r,o)}}ke.empty=new ke(le.empty,0,0);function E1(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:l}=t.findIndex(n);if(o==e||s.isText){if(l!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(E1(s.content,e-o-1,n-o-1)))}function S1(t,e,n,r){let{index:o,offset:s}=t.findIndex(e),i=t.maybeChild(o);if(s==e||i.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=S1(i.content,e-s-1,n,i);return l&&t.replaceChild(o,i.copy(l))}function lA(t,e,n){if(n.openStart>t.depth)throw new hc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hc("Inconsistent open depths");return M1(t,e,n,0)}function M1(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let i=M1(t,e,n,r+1);return s.copy(s.content.replaceChild(o,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,l=i.content;return vs(i,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:i,end:l}=aA(n,t);return vs(s,A1(t,i,l,e,r))}else return vs(s,mc(t,e,r))}function T1(t,e){if(!e.type.compatibleContent(t.type))throw new hc("Cannot join "+e.type.name+" onto "+t.type.name)}function kf(t,e,n){let r=t.node(n);return T1(r,e.node(n)),r}function bs(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Zi(t,e,n,r){let o=(e||t).node(n),s=0,i=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(bs(t.nodeAfter,r),s++));for(let l=s;l<i;l++)bs(o.child(l),r);e&&e.depth==n&&e.textOffset&&bs(e.nodeBefore,r)}function vs(t,e){return t.type.checkContent(e),t.copy(e)}function A1(t,e,n,r,o){let s=t.depth>o&&kf(t,e,o+1),i=r.depth>o&&kf(n,r,o+1),l=[];return Zi(null,t,o,l),s&&i&&e.index(o)==n.index(o)?(T1(s,i),bs(vs(s,A1(t,e,n,r,o+1)),l)):(s&&bs(vs(s,mc(t,e,o+1)),l),Zi(e,n,o,l),i&&bs(vs(i,mc(n,r,o+1)),l)),Zi(r,null,o,l),new le(l)}function mc(t,e,n){let r=[];if(Zi(null,t,n,r),t.depth>n){let o=kf(t,e,n+1);bs(vs(o,mc(t,e,n+1)),r)}return Zi(e,null,n,r),new le(r)}function aA(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(le.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class _l{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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 new 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 new 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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return wt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let s=r.marks;for(var i=0;i<s.length;i++)s[i].type.spec.inclusive===!1&&(!o||!s[i].isInSet(o.marks))&&(s=s[i--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new gc(this,e,r);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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,s=n;for(let i=e;;){let{index:l,offset:a}=i.content.findIndex(s),c=s-a;if(r.push(i,l,o+a),!c||(i=i.child(l),i.isText))break;s=c-1,o+=a+1}return new _l(n,r,s)}static resolveCached(e,n){let r=Mg.get(e);if(r)for(let s=0;s<r.elts.length;s++){let i=r.elts[s];if(i.pos==n)return i}else Mg.set(e,r=new cA);let o=r.elts[r.i]=_l.resolve(e,n);return r.i=(r.i+1)%uA,o}}class cA{constructor(){this.elts=[],this.i=0}}const uA=12,Mg=new WeakMap;class gc{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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)}}const dA=Object.create(null);let Ro=class _f{constructor(e,n,r,o=wt.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||le.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,n,r,o=0){this.content.nodesBetween(e,n,r,o,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,n,r,o){return this.content.textBetween(e,n,r,o)}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,n,r){return this.type==e&&pc(this.attrs,n||e.defaultAttrs||dA)&&wt.sameSet(this.marks,r||wt.none)}copy(e=null){return e==this.content?this:new _f(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new _f(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ke.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),l=o.start(i),a=o.node(i).content.cut(o.pos-l,s.pos-l);return new ke(a,o.depth-i,s.depth-i)}replace(e,n,r){return lA(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return _l.resolveCached(this,e)}resolveNoCache(e){return _l.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(o=!0),!o)),o}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()+")"),L1(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=le.empty,o=0,s=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,o,s),l=i&&i.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),i=s&&s.matchFragment(this.content,n);return i?i.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),this.type.checkAttrs(this.attrs);let e=wt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!wt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=le.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,o,r);return s.type.checkAttrs(s.attrs),s}};Ro.prototype.text=void 0;class yc extends Ro{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):L1(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new yc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new yc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function L1(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Es{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new fA(e,n);if(r.next==null)return Es.empty;let o=O1(r);r.next&&r.err("Unexpected trailing text");let s=vA(bA(o));return wA(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let s=n;o&&s<r;s++)o=o.matchType(e.child(s).type);return o}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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function s(i,l){let a=i.matchFragment(e,r);if(a&&(!n||a.validEnd))return le.from(l.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),s=o.match;if(s.matchType(e)){let i=[];for(let l=o;l.type;l=l.via)i.push(l.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:l,next:a}=s.next[i];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let s=o+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)s+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return s}).join(`
141
- `)}}Es.empty=new Es(!0);class fA{constructor(e,n){this.string=e,this.nodeTypes=n,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 new SyntaxError(e+" (in content expression '"+this.string+"')")}}function O1(t){let e=[];do e.push(pA(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function pA(t){let e=[];do e.push(hA(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function hA(t){let e=yA(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=mA(t,e);else break;return e}function Tg(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function mA(t,e){let n=Tg(t),r=n;return t.eat(",")&&(t.next!="}"?r=Tg(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function gA(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let i=n[s];i.isInGroup(e)&&o.push(i)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function yA(t){if(t.eat("(")){let e=O1(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=gA(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function bA(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,l,a){let c={term:a,to:l};return e[i].push(c),c}function o(i,l){i.forEach(a=>a.to=l)}function s(i,l){if(i.type=="choice")return i.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(i.type=="seq")for(let a=0;;a++){let c=s(i.exprs[a],l);if(a==i.exprs.length-1)return c;o(c,l=n())}else if(i.type=="star"){let a=n();return r(l,a),o(s(i.expr,a),a),[r(a)]}else if(i.type=="plus"){let a=n();return o(s(i.expr,l),a),o(s(i.expr,a),a),[r(a)]}else{if(i.type=="opt")return[r(l)].concat(s(i.expr,l));if(i.type=="range"){let a=l;for(let c=0;c<i.min;c++){let u=n();o(s(i.expr,a),u),a=u}if(i.max==-1)o(s(i.expr,a),a);else for(let c=i.min;c<i.max;c++){let u=n();r(a,u),o(s(i.expr,a),u),a=u}return[r(a)]}else{if(i.type=="name")return[r(l,void 0,i.value)];throw new Error("Unknown expr type")}}}}function N1(t,e){return e-t}function Ag(t,e){let n=[];return r(e),n.sort(N1);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let i=0;i<s.length;i++){let{term:l,to:a}=s[i];!l&&n.indexOf(a)==-1&&r(a)}}}function vA(t){let e=Object.create(null);return n(Ag(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<o.length;u++)o[u][0]==l&&(c=o[u][1]);Ag(t,a).forEach(u=>{c||o.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new Es(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let l=o[i][1].sort(N1);s.next.push({type:o[i][0],next:e[l.join(",")]||n(l)})}return s}}function wA(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];i.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function I1(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function R1(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function P1(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let s=t[o];s.validate&&s.validate(e[o])}}function D1(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new kA(t,r,e[r]);return n}let Lg=class $1{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=D1(e,r.attrs),this.defaultAttrs=I1(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Es.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:R1(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ro(this,this.computeAttrs(e),le.from(n),wt.setFrom(r))}createChecked(e=null,n,r){return n=le.from(n),this.checkContent(n),new Ro(this,this.computeAttrs(e),n,wt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=le.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(le.empty,!0);return s?new Ro(this,e,n.append(s),wt.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){P1(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:wt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,i)=>r[s]=new $1(s,n,i));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function xA(t,e,n){let r=n.split("|");return o=>{let s=o===null?"null":typeof o;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class kA{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?xA(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Mu{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=D1(e,o.attrs),this.excluded=null;let s=I1(this.attrs);this.instance=s?new wt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new wt(this,R1(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new Mu(s,o++,n,i)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){P1(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class F1{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=cn.from(e.nodes),n.marks=cn.from(e.marks||{}),this.nodes=Lg.compile(this.spec.nodes,this),this.marks=Mu.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],i=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[i]||(r[i]=Es.parse(i,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?Og(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:Og(this,i.split(" "))}this.nodeFromJSON=o=>Ro.fromJSON(this,o),this.markFromJSON=o=>wt.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Lg){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new yc(r,r.defaultAttrs,e,wt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Og(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],i=s;if(s)n.push(s);else for(let l in t.marks){let a=t.marks[l];(o=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(o)>-1)&&n.push(i=a)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function _A(t){return t.tag!=null}function CA(t){return t.style!=null}let si=class Cf{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(_A(o))this.tags.push(o);else if(CA(o)){let s=/[^=]*/.exec(o.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=e.nodes[o.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Ig(this,n,!1);return r.addAll(e,wt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Ig(this,n,!0);return r.addAll(e,wt.none,n.from,n.to),ke.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(MA(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let i=s.getAttrs(e);if(i===!1)continue;s.attrs=i||void 0}return s}}}matchStyle(e,n,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let i=this.styles[s],l=i.style;if(!(l.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(i.getAttrs){let a=i.getAttrs(n);if(a===!1)continue;i.attrs=a||void 0}return i}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.priority,i=0;for(;i<n.length;i++){let l=n[i];if((l.priority==null?50:l.priority)<s)break}n.splice(i,0,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(i=>{r(i=Rg(i)),i.mark||i.ignore||i.clearMark||(i.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(i=>{r(i=Rg(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Cf(e,Cf.schemaRules(e)))}};const V1={address:!0,article:!0,aside:!0,blockquote:!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},EA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},B1={ol:!0,ul:!0},Cl=1,Ef=2,Fa=4;function Ng(t,e,n){return e!=null?(e?Cl:0)|(e==="full"?Ef:0):t&&t.whitespace=="pre"?Cl|Ef:n&-5}class ha{constructor(e,n,r,o,s,i){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=i,this.content=[],this.activeMarks=wt.none,this.match=s||(i&Fa?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(le.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Cl)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=le.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(le.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!V1.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ig{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,i=Ng(null,n.preserveWhitespace,0)|(r?Fa:0);o?s=new ha(o.type,o.attrs,wt.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new ha(null,null,wt.none,!0,null,i):s=new ha(e.schema.topNodeType,null,wt.none,!0,null,i),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,s=o.options&Ef?"full":this.localPreserveWS||(o.options&Cl)>0;if(s==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
142
- `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=o.content[o.content.length-1],l=e.previousSibling;(!i||l&&l.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),l;B1.hasOwnProperty(i)&&this.parser.normalizeLists&&SA(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:EA.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(V1.hasOwnProperty(i))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=a&&a.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
143
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let s=this.parser.matchedStyles[o],i=r.getPropertyValue(s);if(i)for(let l=void 0;;){let a=this.parser.matchStyle(s,i,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,o){let s,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(i,n.attrs||null,r,n.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let i=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];i!=l;i=i.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(i,n);this.findAtPoint(e,s)}findPlace(e,n,r){let o,s;for(let i=this.open,l=0;i>=0;i--){let a=this.nodes[i],c=a.findWrapping(e);if(c&&(!o||o.length>c.length+l)&&(o=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!o)return null;this.sync(s);for(let i=0;i<o.length;i++)n=this.enterInner(o[i],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let i=wt.none;for(let l of o.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):Pg(l.type,e.type))&&(i=l.addToSet(i));return s.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,o)),s}enterInner(e,n,r,o=!1,s){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let l=Ng(e,s,i.options);i.options&Fa&&i.content.length==0&&(l|=Fa);let a=wt.none;return r=r.filter(c=>(i.type?i.type.allowsMarkType(c.type):Pg(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new ha(e,n,a,o,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Cl)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(o?0:1),i=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(i(l-1,a))return!0;return!1}else{let u=a>0||a==0&&o?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function SA(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&B1.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function MA(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Rg(t){let e={};for(let n in t)e[n]=t[n];return e}function Pg(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||s.indexOf(u)<0&&i(u))return!0}};if(i(o.contentMatch))return!0}}class Ps{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=fd(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let l=0,a=0;for(;l<s.length&&a<i.marks.length;){let c=i.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)o=s.pop()[1];for(;a<i.marks.length;){let c=i.marks[a++],u=this.serializeMark(c,i.isInline,n);u&&(s.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Va(fd(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Va(fd(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Va(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ps(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Dg(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Dg(e.marks)}}function Dg(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function fd(t){return t.document||window.document}const $g=new WeakMap;function TA(t){let e=$g.get(t);return e===void 0&&$g.set(t,e=AA(t)),e}function AA(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Va(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],s;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=TA(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let l,a=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:p,contentDOM:h}=Va(t,f,n,r);if(a.appendChild(p),h){if(l)throw new RangeError("Multiple content holes");l=h}}}return{dom:a,contentDOM:l}}const H1=65535,j1=Math.pow(2,16);function LA(t,e){return t+e*j1}function Fg(t){return t&H1}function OA(t){return(t-(t&H1))/j1}const z1=1,U1=2,Ba=4,W1=8;class Sf{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&W1)>0}get deletedBefore(){return(this.delInfo&(z1|Ba))>0}get deletedAfter(){return(this.delInfo&(U1|Ba))>0}get deletedAcross(){return(this.delInfo&Ba)>0}}class Wn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Wn.empty)return Wn.empty}recover(e){let n=0,r=Fg(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+OA(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,s=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?o:0);if(a>e)break;let c=this.ranges[l+s],u=this.ranges[l+i],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,p=a+o+(f<0?0:u);if(r)return p;let h=e==(n<0?a:d)?null:LA(l/3,e-a),m=e==a?U1:e==d?z1:Ba;return(n<0?e!=a:e!=d)&&(m|=W1),new Sf(p,m,h)}o+=u-c}return r?e+o:new Sf(e+o,0,null)}touches(e,n){let r=0,o=Fg(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==o*3)return!0;r+=this.ranges[l+i]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let i=this.ranges[o],l=i-(this.inverted?s:0),a=i+(this.inverted?0:s),c=this.ranges[o+n],u=this.ranges[o+r];e(l,l+c,a,a+u),s+=u-c}}invert(){return new Wn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Wn.empty:new Wn(e<0?[0,-e,0]:[0,0,e])}}Wn.empty=new Wn([]);class El{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new El(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new El;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let s=this.from;s<this.to;s++){let i=this._maps[s],l=i.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new Sf(e,o,null)}}const pd=Object.create(null);class Sn{getMap(){return Wn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=pd[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in pd)throw new RangeError("Duplicate use of step JSON ID "+e);return pd[e]=n,n.prototype.jsonID=e,n}}class Yt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Yt(e,null)}static fail(e){return new Yt(null,e)}static fromReplace(e,n,r,o){try{return Yt.ok(e.replace(n,r,o))}catch(s){if(s instanceof hc)return Yt.fail(s.message);throw s}}}function Jp(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(Jp(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return le.fromArray(r)}class Ao extends Sn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new ke(Jp(n.content,(i,l)=>!i.isAtom||!l.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return Yt.fromReplace(e,this.from,this.to,s)}invert(){return new hr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ao(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ao&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ao(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ao(n.from,n.to,e.markFromJSON(n.mark))}}Sn.jsonID("addMark",Ao);class hr extends Sn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ke(Jp(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Yt.fromReplace(e,this.from,this.to,r)}invert(){return new Ao(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new hr(n.pos,r.pos,this.mark)}merge(e){return e instanceof hr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new hr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new hr(n.from,n.to,e.markFromJSON(n.mark))}}Sn.jsonID("removeMark",hr);class Lo extends Sn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Yt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Yt.fromReplace(e,this.pos,this.pos+1,new ke(le.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Lo(this.pos,n.marks[o]);return new Lo(this.pos,this.mark)}}return new Ss(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Lo(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Lo(n.pos,e.markFromJSON(n.mark))}}Sn.jsonID("addNodeMark",Lo);class Ss extends Sn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Yt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Yt.fromReplace(e,this.pos,this.pos+1,new ke(le.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Lo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ss(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ss(n.pos,e.markFromJSON(n.mark))}}Sn.jsonID("removeNodeMark",Ss);class rn extends Sn{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Mf(e,this.from,this.to)?Yt.fail("Structure replace would overwrite content"):Yt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Wn([this.from,this.to-this.from,this.slice.size])}invert(e){return new rn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new rn(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof rn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ke.empty:new ke(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new rn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ke.empty:new ke(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new rn(e.from,this.to,n,this.structure)}else 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(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new rn(n.from,n.to,ke.fromJSON(e,n.slice),!!n.structure)}}Sn.jsonID("replace",rn);class sn extends Sn{constructor(e,n,r,o,s,i,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=l}apply(e){if(this.structure&&(Mf(e,this.from,this.gapFrom)||Mf(e,this.gapTo,this.to)))return Yt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Yt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Yt.fromReplace(e,this.from,this.to,r):Yt.fail("Content does not fit in gap")}getMap(){return new Wn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new sn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new sn(n.pos,r.pos,o,s,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(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new sn(n.from,n.to,n.gapFrom,n.gapTo,ke.fromJSON(e,n.slice),n.insert,!!n.structure)}}Sn.jsonID("replaceAround",sn);function Mf(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let i=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,o--}}return!1}function NA(t,e,n,r){let o=[],s=[],i,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,n),h=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(h)||(i&&i.to==f&&i.mark.eq(d[m])?i.to=p:o.push(i=new hr(f,p,d[m])));l&&l.to==f?l.to=p:s.push(l=new Ao(f,p,r))}}),o.forEach(a=>t.step(a)),s.forEach(a=>t.step(a))}function IA(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,l)=>{if(!i.isInline)return;s++;let a=null;if(r instanceof Mu){let c=i.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let c=Math.min(l+i.nodeSize,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let p=0;p<o.length;p++){let h=o[p];h.step==s-1&&d.eq(o[p].style)&&(f=h)}f?(f.to=c,f.step=s):o.push({style:d,from:Math.max(l,e),to:c,step:s})}}}),o.forEach(i=>t.step(new hr(i.from,i.to,i.style)))}function Yp(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),i=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)i.push(new rn(l,u,ke.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new hr(l,u,c.marks[f]));if(o&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new ke(le.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),i.push(new rn(l+f.index,l+f.index+f[0].length,h))}}l=u}if(!r.validEnd){let a=r.fillBefore(le.empty,!0);t.replace(l,l,new ke(a,0,0))}for(let a=i.length-1;a>=0;a--)t.step(i[a])}function RA(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Si(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,s,e))return n;if(n==0||r.type.spec.isolating||!RA(r,o,s))break}return null}function PA(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),l=o.after(s+1),a=i,c=l,u=le.empty,d=0;for(let h=s,m=!1;h>n;h--)m||r.index(h)>0?(m=!0,u=le.from(r.node(h).copy(u)),d++):a--;let f=le.empty,p=0;for(let h=s,m=!1;h>n;h--)m||o.after(h+1)<o.end(h)?(m=!0,f=le.from(o.node(h).copy(f)),p++):c++;t.step(new sn(a,c,i,l,new ke(u.append(f),d,p),u.size-d,!0))}function Xp(t,e,n=null,r=t){let o=DA(t,e),s=o&&$A(r,e);return s?o.map(Vg).concat({type:e,attrs:n}).concat(s.map(Vg)):null}function Vg(t){return{type:t,attrs:null}}function DA(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let i=s.length?s[0]:e;return n.canReplaceWith(r,o,i)?s:null}function $A(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),i=e.contentMatch.findWrapping(s.type);if(!i)return null;let l=(i.length?i[i.length-1]:e).contentMatch;for(let a=r;l&&a<o;a++)l=l.matchType(n.child(a).type);return!l||!l.validEnd?null:i}function FA(t,e,n){let r=le.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let l=n[i].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=le.from(n[i].type.create(n[i].attrs,r))}let o=e.start,s=e.end;t.step(new sn(o,s,o,s,new ke(r,0,0),n.length,!0))}function VA(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(i,l)=>{let a=typeof o=="function"?o(i):o;if(i.isTextblock&&!i.hasMarkup(r,a)&&BA(t.doc,t.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0)}c===!1&&G1(t,i,l,s),Yp(t,t.mapping.slice(s).map(l,1),r,void 0,c===null);let u=t.mapping.slice(s),d=u.map(l,1),f=u.map(l+i.nodeSize,1);return t.step(new sn(d,f,d+1,f-1,new ke(le.from(r.create(a,null,i.marks)),0,0),1,!0)),c===!0&&K1(t,i,l,s),!1}})}function K1(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let i,l=/\r?\n|\r/g;for(;i=l.exec(o.text);){let a=t.mapping.slice(r).map(n+1+s+i.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function G1(t,e,n,r){e.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+s);t.replaceWith(i,i+1,e.type.schema.text(`
144
- `))}})}function BA(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function HA(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let i=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,i);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new sn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new ke(le.from(i),0,0),1,!0))}function ii(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,i=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!i.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>s;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let l=o.indexAfter(s),a=r&&r[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function jA(t,e,n=1,r){let o=t.doc.resolve(e),s=le.empty,i=le.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){s=le.from(o.node(l).copy(s));let u=r&&r[c];i=le.from(u?u.type.create(u.attrs,i):o.node(l).copy(i))}t.step(new rn(e,e,new ke(s.append(i),n,n),!0))}function Xo(t,e){let n=t.resolve(e),r=n.index();return q1(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function zA(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let s=e.child(o),i=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(i),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function q1(t,e){return!!(t&&e&&!t.isLeaf&&zA(t,e))}function Tu(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,l=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),l++,i=r.node(o).maybeChild(l)):(s=r.node(o).maybeChild(l-1),i=r.node(o+1)),s&&!s.isTextblock&&q1(s,i)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function UA(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),i=s.node().type;if(o&&i.inlineContent){let u=i.whitespace=="pre",d=!!i.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);G1(t,u.node(),u.before(),l)}i.inlineContent&&Yp(t,e+n-1,i,s.node().contentMatchAt(s.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new rn(c,a.map(e+n,-1),ke.empty,!0)),r===!0){let u=t.doc.resolve(c);K1(t,u.node(),u.before(),t.steps.length)}return t}function WA(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function J1(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let i=r.depth;i>=0;i--){let l=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,a=r.index(i)+(l>0?1:0),c=r.node(i),u=!1;if(s==1)u=c.canReplace(a,a,o);else{let d=c.contentMatchAt(a).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(i+1):r.after(i+1)}return null}function Au(t,e,n=e,r=ke.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return Y1(o,s,r)?new rn(e,n,r):new KA(o,s,r).fit()}function Y1(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class KA{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=le.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=le.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let s=this.placed,i=r.depth,l=o.depth;for(;i&&l&&s.childCount==1;)s=s.firstChild.content,i--,l--;let a=new ke(s,i,l);return e>-1?new sn(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new rn(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=hd(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(n==1&&(i?c.matchType(i.type)||(d=c.fillBefore(le.from(i),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:d};if(n==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=hd(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ke(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=hd(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new ke(Bi(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new ke(Bi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let i=this.unplaced,l=r?r.content:i.content,a=i.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let m=0;m<o.childCount;m++)u.push(o.child(m));d=d.matchFragment(o)}let p=l.size+e-(i.content.size-i.openEnd);for(;c<l.childCount;){let m=l.child(c),y=d.matchType(m.type);if(!y)break;c++,(c>1||a==0||m.content.size)&&(d=y,u.push(X1(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?p:-1)))}let h=c==l.childCount;h||(p=-1),this.placed=Hi(this.placed,n,le.from(u)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=l;m<p;m++){let g=y.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),y=g.content}this.unplaced=h?e==0?ke.empty:new ke(Bi(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new ke(Bi(i.content,e,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!md(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),i=md(e,n,o,r,s);if(i){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=md(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:i,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Hi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Hi(this.placed,this.depth,le.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(le.empty,!0);e.childCount&&(this.placed=Hi(this.placed,this.frontier.length,e))}}function Bi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Bi(t.firstChild.content,e-1,n)))}function Hi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Hi(t.lastChild.content,e-1,n)))}function hd(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function X1(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,X1(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(le.empty,!0)))),t.copy(r)}function md(t,e,n,r,o){let s=t.node(e),i=o?t.indexAfter(e):t.index(e);if(i==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,i);return l&&!GA(n,s.content,i)?l:null}function GA(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function qA(t){return t.spec.defining||t.spec.definingForContent}function JA(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(Y1(o,s,r))return t.step(new rn(e,n,r));let i=Q1(o,t.doc.resolve(n));i[i.length-1]==0&&i.pop();let l=-(o.depth+1);i.unshift(l);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;i.indexOf(f)>-1?l=f:o.before(f)==p&&i.splice(1,0,-f)}let a=i.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=qA(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(l)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m<i.length;m++){let y=i[(m+a)%i.length],g=!0;y<0&&(g=!1,y=-y);let k=o.node(y-1),w=o.index(y-1);if(k.canReplaceWith(w,w,h.type,h.marks))return t.replace(o.before(y),g?s.after(y):n,new ke(Z1(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let f=i.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=i[f];p<0||(e=o.before(p),n=s.after(p))}}function Z1(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Z1(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),i=s.fillBefore(t).append(t);t=i.append(s.matchFragment(i).fillBefore(le.empty,!0))}return t}function YA(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=WA(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new ke(le.from(r),0,0))}function XA(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),s=Q1(r,o);for(let i=0;i<s.length;i++){let l=s[i],a=i==s.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return t.delete(r.before(i),n);t.delete(e,n)}function Q1(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class li extends Sn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Yt.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Yt.fromReplace(e,this.pos,this.pos+1,new ke(le.from(o),0,n.isLeaf?0:1))}getMap(){return Wn.empty}invert(e){return new li(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new li(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new li(n.pos,n.attr,n.value)}}Sn.jsonID("attr",li);class Sl extends Sn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Yt.ok(r)}getMap(){return Wn.empty}invert(e){return new Sl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Sl(n.attr,n.value)}}Sn.jsonID("docAttr",Sl);let gi=class extends Error{};gi=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};gi.prototype=Object.create(Error.prototype);gi.prototype.constructor=gi;gi.prototype.name="TransformError";class Zp{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new El}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new gi(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ke.empty){let o=Au(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new ke(le.from(r),0,0))}delete(e,n){return this.replace(e,n,ke.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return JA(this,e,n,r),this}replaceRangeWith(e,n,r){return YA(this,e,n,r),this}deleteRange(e,n){return XA(this,e,n),this}lift(e,n){return PA(this,e,n),this}join(e,n=1){return UA(this,e,n),this}wrap(e,n){return FA(this,e,n),this}setBlockType(e,n=e,r,o=null){return VA(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return HA(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new li(e,n,r)),this}setDocAttribute(e,n){return this.step(new Sl(e,n)),this}addNodeMark(e,n){return this.step(new Lo(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof wt)n.isInSet(r.marks)&&this.step(new Ss(e,n));else{let o=r.marks,s,i=[];for(;s=n.isInSet(o);)i.push(new Ss(e,s)),o=s.removeFromSet(o);for(let l=i.length-1;l>=0;l--)this.step(i[l])}return this}split(e,n=1,r){return jA(this,e,n,r),this}addMark(e,n,r){return NA(this,e,n,r),this}removeMark(e,n,r){return IA(this,e,n,r),this}clearIncompatible(e,n,r){return Yp(this,e,n,r),this}}const gd=Object.create(null);class Fe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new ew(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ke.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){let{$from:a,$to:c}=i[l],u=e.mapping.slice(s);e.replaceRange(u.map(a.pos),u.map(c.pos),l?ke.empty:n),l==0&&jg(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:i,$to:l}=o[s],a=e.mapping.slice(r),c=a.map(i.pos),u=a.map(l.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),jg(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Ie(e):Us(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let i=n<0?Us(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Us(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(i)return i}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new ir(e.node(0))}static atStart(e){return Us(e,e,0,0,1)||new ir(e)}static atEnd(e){return Us(e,e,e.content.size,e.childCount,-1)||new ir(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=gd[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in gd)throw new RangeError("Duplicate use of selection JSON ID "+e);return gd[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ie.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class ew{constructor(e,n){this.$from=e,this.$to=n}}let Bg=!1;function Hg(t){!Bg&&!t.parent.inlineContent&&(Bg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ie extends Fe{constructor(e,n=e){Hg(e),Hg(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Fe.near(r);let o=e.resolve(n.map(this.anchor));return new Ie(o.parent.inlineContent?o:r,r)}replace(e,n=ke.empty){if(super.replace(e,n),n==ke.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ie&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Lu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ie(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let s=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(s)n=s.$head;else return Fe.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Fe.findFrom(e,-r,!0)||Fe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Ie(e,n)}}Fe.jsonID("text",Ie);class Lu{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Lu(e.map(this.anchor),e.map(this.head))}resolve(e){return Ie.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ne extends Fe{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=e.resolve(o);return r?Fe.near(s):new Ne(s)}content(){return new ke(le.from(this.node),0,0)}eq(e){return e instanceof Ne&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Qp(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ne(e.resolve(n.anchor))}static create(e,n){return new Ne(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Ne.prototype.visible=!1;Fe.jsonID("node",Ne);class Qp{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Lu(r,r):new Qp(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ne.isSelectable(r)?new Ne(n):Fe.near(n)}}class ir extends Fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ke.empty){if(n==ke.empty){e.delete(0,e.doc.content.size);let r=Fe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new ir(e)}map(e){return new ir(e)}eq(e){return e instanceof ir}getBookmark(){return ZA}}Fe.jsonID("all",ir);const ZA={map(){return this},resolve(t){return new ir(t)}};function Us(t,e,n,r,o,s=!1){if(e.inlineContent)return Ie.create(t,n);for(let i=r-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let l=e.child(i);if(l.isAtom){if(!s&&Ne.isSelectable(l))return Ne.create(t,n-(o<0?l.nodeSize:0))}else{let a=Us(t,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function jg(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof rn||o instanceof sn))return;let s=t.mapping.maps[r],i;s.forEach((l,a,c,u)=>{i==null&&(i=u)}),t.setSelection(Fe.near(t.doc.resolve(i),n))}const zg=1,Ug=2,Wg=4;class QA extends Zp{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 new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|zg)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&zg)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ug,this}ensureMarks(e){return wt.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&Ug)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||wt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let i=this.doc.resolve(n);s=r==n?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),this.selection.empty||this.setSelection(Fe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,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|=Wg,this}get scrolledIntoView(){return(this.updated&Wg)>0}}function Kg(t,e){return!e||!t?t:t.bind(e)}class ji{constructor(e,n,r){this.name=e,this.init=Kg(n.init,r),this.apply=Kg(n.apply,r)}}const eL=[new ji("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ji("selection",{init(t,e){return t.selection||Fe.atStart(e.doc)},apply(t){return t.selection}}),new ji("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ji("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class yd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eL.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new ji(r.key,r.spec.state,r))})}}class Ys{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,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let s=!1;for(let i=0;i<this.config.plugins.length;i++){let l=this.config.plugins[i];if(l.spec.appendTransaction){let a=o?o[i].n:0,c=o?o[i].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,i)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<i?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),s=!0}o&&(o[i]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ys(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new QA(this)}static create(e){let n=new yd(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ys(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new yd(this.schema,e.plugins),r=n.fields,o=new Ys(n);for(let s=0;s<r.length;s++){let i=r[s].name;o[i]=this.hasOwnProperty(i)?this[i]:r[s].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],s=o.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new yd(e.schema,e.plugins),s=new Ys(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=Ro.fromJSON(e.schema,n.doc);else if(i.name=="selection")s.selection=Fe.fromJSON(s.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==i.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[i.name]=c.fromJSON.call(a,e,n[l],s);return}}s[i.name]=i.init(e,s)}}),s}}function tw(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=tw(o,e,{})),n[r]=o}return n}class Rt{constructor(e){this.spec=e,this.props={},e.props&&tw(e.props,this,this.props),this.key=e.key?e.key.key:nw("plugin")}getState(e){return e[this.key]}}const bd=Object.create(null);function nw(t){return t in bd?t+"$"+ ++bd[t]:(bd[t]=0,t+"$")}class Kt{constructor(e="key"){this.key=nw(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const dn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},yi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Tf=null;const Gr=function(t,e,n){let r=Tf||(Tf=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},tL=function(){Tf=null},Ms=function(t,e,n,r){return n&&(Gg(t,e,n,r,-1)||Gg(t,e,n,r,1))},nL=/^(img|br|input|textarea|hr)$/i;function Gg(t,e,n,r,o){for(var s;;){if(t==n&&e==r)return!0;if(e==(o<0?0:nr(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Gl(t)||nL.test(t.nodeName)||t.contentEditable=="false")return!1;e=dn(t)+(o<0?0:1),t=i}else if(t.nodeType==1){let i=t.childNodes[e+(o<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((s=i.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=o;else return!1;else t=i,e=o<0?nr(t):0}else return!1}}function nr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function rL(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=nr(t)}else if(t.parentNode&&!Gl(t))e=dn(t),t=t.parentNode;else return null}}function oL(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Gl(t))e=dn(t)+1,t=t.parentNode;else return null}}function sL(t,e,n){for(let r=e==0,o=e==nr(t);r||o;){if(t==n)return!0;let s=dn(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==nr(t)}}function Gl(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Ou=function(t){return t.focusNode&&Ms(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function as(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function iL(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function lL(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(nr(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(nr(r.startContainer),r.startOffset)}}}const Rr=typeof navigator<"u"?navigator:null,qg=typeof document<"u"?document:null,Zo=Rr&&Rr.userAgent||"",Af=/Edge\/(\d+)/.exec(Zo),rw=/MSIE \d/.exec(Zo),Lf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Zo),Hn=!!(rw||Lf||Af),Po=rw?document.documentMode:Lf?+Lf[1]:Af?+Af[1]:0,lr=!Hn&&/gecko\/(\d+)/i.test(Zo);lr&&+(/Firefox\/(\d+)/.exec(Zo)||[0,0])[1];const Of=!Hn&&/Chrome\/(\d+)/.exec(Zo),kn=!!Of,ow=Of?+Of[1]:0,Nn=!Hn&&!!Rr&&/Apple Computer/.test(Rr.vendor),bi=Nn&&(/Mobile\/\w+/.test(Zo)||!!Rr&&Rr.maxTouchPoints>2),er=bi||(Rr?/Mac/.test(Rr.platform):!1),aL=Rr?/Win/.test(Rr.platform):!1,eo=/Android \d/.test(Zo),ql=!!qg&&"webkitFontSmoothing"in qg.documentElement.style,cL=ql?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function uL(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Br(t,e){return typeof t=="number"?t:t[e]}function dL(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Jg(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let i=n||t.dom;i;){if(i.nodeType!=1){i=yi(i);continue}let l=i,a=l==s.body,c=a?uL(s):dL(l),u=0,d=0;if(e.top<c.top+Br(r,"top")?d=-(c.top-e.top+Br(o,"top")):e.bottom>c.bottom-Br(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Br(o,"top")-c.top:e.bottom-c.bottom+Br(o,"bottom")),e.left<c.left+Br(r,"left")?u=-(c.left-e.left+Br(o,"left")):e.right>c.right-Br(r,"right")&&(u=e.right-c.right+Br(o,"right")),u||d)if(a)s.defaultView.scrollBy(u,d);else{let p=l.scrollLeft,h=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let m=l.scrollLeft-p,y=l.scrollTop-h;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}let f=a?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(f))break;i=f=="absolute"?i.offsetParent:yi(i)}}function fL(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,i=n+1;i<Math.min(innerHeight,e.bottom);i+=5){let l=t.root.elementFromPoint(s,i);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,o=a.top;break}}return{refDOM:r,refTop:o,stack:sw(t.dom)}}function sw(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=yi(r));return e}function pL({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;iw(n,r==0?0:r-e)}function iw(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Fs=null;function hL(t){if(t.setActive)return t.setActive();if(Fs)return t.focus(Fs);let e=sw(t);t.focus(Fs==null?{get preventScroll(){return Fs={preventScroll:!0},!0}}:void 0),Fs||(Fs=!1,iw(e,0))}function lw(t,e){let n,r=2e8,o,s=0,i=e.top,l=e.top,a,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Gr(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=i&&h.bottom>=l){i=Math.max(h.bottom,i),l=Math.min(h.top,l);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<r){n=u,r=m,o=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,u.nodeType==1&&m&&(s=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(s=d+1)}}return!n&&a&&(n=a,o=c,r=0),n&&n.nodeType==3?mL(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:lw(n,o)}function mL(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=bo(r,1);if(s.top!=s.bottom&&eh(e,s))return{node:t,offset:o+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function eh(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function gL(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function yL(t,e,n){let{node:r,offset:o}=lw(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();s=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function bL(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!i&&a.left>r.left||a.top>r.top?o=l.posBefore:(!i&&a.right<r.left||a.bottom<r.top)&&(o=l.posAfter),i=!0),!l.contentDOM&&o<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function aw(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let i=t.childNodes[s];if(i.nodeType==1){let l=i.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(eh(e,c))return aw(i,e,c)}}if((s=(s+1)%r)==o)break}return t}function vL(t,e){let n=t.dom.ownerDocument,r,o=0,s=lL(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let c=t.dom.getBoundingClientRect();if(!eh(e,c)||(i=aw(t.dom,e,c),!i))return null}if(Nn)for(let c=i;r&&c;c=yi(c))c.draggable&&(r=void 0);if(i=gL(i,e),r){if(lr&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;ql&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=bL(t,r,o,e))}l==null&&(l=yL(t,i,e));let a=t.docView.nearestDesc(i,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Yg(t){return t.top<t.bottom||t.left<t.right}function bo(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Yg(r))return r}return Array.prototype.find.call(n,Yg)||t.getBoundingClientRect()}const wL=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function cw(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=ql||lr;if(r.nodeType==3)if(i&&(wL.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=bo(Gr(r,o,o),n);if(lr&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let a=bo(Gr(r,o-1,o-1),-1);if(a.top==l.top){let c=bo(Gr(r,o,o+1),-1);if(c.top!=l.top)return Ri(c,c.left<a.left)}}return l}else{let l=o,a=o,c=n<0?1:-1;return n<0&&!o?(a++,c=-1):n>=0&&o==r.nodeValue.length?(l--,c=1):n<0?l--:a++,Ri(bo(Gr(r,l,a),c),c<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==nr(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return vd(l.getBoundingClientRect(),!1)}if(s==null&&o<nr(r)){let l=r.childNodes[o];if(l.nodeType==1)return vd(l.getBoundingClientRect(),!0)}return vd(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==nr(r))){let l=r.childNodes[o-1],a=l.nodeType==3?Gr(l,nr(l)-(i?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(a)return Ri(bo(a,1),!1)}if(s==null&&o<nr(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let a=l?l.nodeType==3?Gr(l,0,i?0:1):l.nodeType==1?l:null:null;if(a)return Ri(bo(a,-1),!0)}return Ri(bo(r.nodeType==3?Gr(r):r,-n),n>=0)}function Ri(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function vd(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function uw(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function xL(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return uw(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let i=cw(t,o.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Gr(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?i.top-u.top>(u.bottom-i.top)*2:u.bottom-i.bottom>(i.bottom-u.top)*2))return!1}}return!0})}const kL=/[\u0590-\u08ac]/;function _L(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,l=t.domSelection();return l?!kL.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:i:uw(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),y=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let Xg=null,Zg=null,Qg=!1;function CL(t,e,n){return Xg==e&&Zg==n?Qg:(Xg=e,Zg=n,Qg=n=="up"||n=="down"?xL(t,e,n):_L(t,e,n))}const ar=0,e0=1,us=2,Pr=3;class Jl{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=ar,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].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 n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.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,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,i;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(i)+i.size:this.posAtStart}else{let s,i;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(i):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>dn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let s=this.getDesc(o),i;if(s&&(!n||s.node))if(r&&(i=s.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)for(let i=0;i<o.children.length;i++){let l=o.children[i];if(l.size){o=l;break}}return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let i=this.children[r],l=s+i.size;if(l>e||i instanceof fw){o=e-s;break}s=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof dw&&s.side>=0;r--);if(n<=0){let s,i=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,i=!1);return s&&n&&i&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?dn(s.dom)+1:0}}else{let s,i=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,i=!1);return s&&i&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?dn(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let i=r,l=0;;l++){let a=this.children[l],c=i+a.size;if(o==-1&&e<=c){let u=i+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=i;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=dn(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=dn(d.dom);break}n+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let s=Math.min(e,n),i=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],y=h+m.size;if(s>h&&i<y)return m.setSelection(e-h-m.border,n-h-m.border,r,o);h=y}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((lr||Nn)&&e==n){let{node:p,offset:h}=l;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==`
145
- `),d&&h==p.nodeValue.length)for(let m=p,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(l=a={node:y.parentNode,offset:dn(y)+1});break}let g=m.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let m=p.childNodes[h-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(lr&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(o=!0)}if(!(o||d&&Nn)&&Ms(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Ms(a.node,a.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(d&&lr)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let h=l;l=a,a=h}let p=document.createRange();p.setEnd(a.node,a.offset),p.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let s=this.children[o],i=r+s.size;if(r==i?e<=i&&n>=r:e<i&&n>r){let l=r+s.border,a=i-s.border;if(e>=l&&n<=a){this.dirty=e==r||n==i?us:e0,e==l&&n==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Pr:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?us:Pr}r=i}this.dirty=us}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?us:e0;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class dw extends Jl{constructor(e,n,r,o){let s,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(i.nodeType!=1){let l=document.createElement("span");l.appendChild(i),i=l}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==ar&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(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}}class EL extends Jl{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Ts extends Jl{constructor(e,n,r,o,s){super(e,[],r,o),this.mark=n,this.spec=s}static create(e,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return(!i||!i.dom)&&(i=Ps.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Ts(e,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&Pr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Pr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ar){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ar}}slice(e,n,r){let o=Ts.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=If(s,n,i,r)),e>0&&(s=If(s,0,e,r));for(let l=0;l<s.length;l++)s[l].parent=o;return o.children=s,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Do extends Jl{constructor(e,n,r,o,s,i,l,a,c){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,s,i){let l=s.nodeViews[n.type.name],a,c=l&&l(n,s,()=>{if(!a)return i;if(a.parent)return a.parent.posBeforeChild(a)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Ps.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=mw(u,r,n),c?a=new SL(e,n,r,o,u,d||null,f,c,s,i+1):n.isText?new Nu(e,n,r,o,u,f,s):new Do(e,n,r,o,u,d||null,f,s,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>le.empty)}return e}matchesNode(e,n,r){return this.dirty==ar&&e.eq(this.node)&&bc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,s=e.composing?this.localCompositionInfo(e,n):null,i=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new TL(this,i&&i.node,e);OL(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?wt.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,o)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let p;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(p=a.findIndexWithChild(s.node))>-1&&a.updateNodeAt(c,u,d,p,e)||a.updateNextNode(c,u,d,e,f,o)||a.addNode(c,u,d,e,o),o+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==us)&&(i&&this.protectLocalComposition(e,i),pw(this.contentDOM,this.children,e),bi&&NL(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Ie)||r<n||o>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let i=s.nodeValue,l=IL(this.node.content,i,r-n,o-n);return l<0?null:{node:s,pos:l,text:i}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new EL(this,s,n,o);e.input.compositionNodes.push(i),this.children=If(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==Pr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=ar}updateOuterDeco(e){if(bc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=hw(this.dom,this.nodeDOM,Nf(this.outerDeco,this.node,n),Nf(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function t0(t,e,n,r,o){mw(r,e,t);let s=new Do(void 0,t,e,n,r,r,r,o,0);return s.contentDOM&&s.updateChildren(o,0),s}class Nu extends Do{constructor(e,n,r,o,s,i,l){super(e,n,r,o,s,null,i,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==Pr||this.dirty!=ar&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ar||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=ar,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),s=document.createTextNode(o.text);return new Nu(this.parent,o,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Pr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class fw extends Jl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ar&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class SL extends Do{constructor(e,n,r,o,s,i,l,a,c,u){super(e,n,r,o,s,i,l,c,u),this.spec=a}update(e,n,r,o){if(this.dirty==Pr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}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 pw(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],l=i.dom;if(l.parentNode==t){for(;l!=r;)r=n0(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(l,r);if(i instanceof Ts){let a=r?r.previousSibling:t.lastChild;pw(i.contentDOM,i.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=n0(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Qi=function(t){t&&(this.nodeName=t)};Qi.prototype=Object.create(null);const ds=[new Qi];function Nf(t,e,n){if(t.length==0)return ds;let r=n?ds[0]:new Qi,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new Qi(i.nodeName));for(let l in i){let a=i[l];a!=null&&(n&&o.length==1&&o.push(r=new Qi(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return o}function hw(t,e,n,r){if(n==ds&&r==ds)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],l=n[s];if(s){let a;l&&l.nodeName==i.nodeName&&o!=t&&(a=o.parentNode)&&a.nodeName.toLowerCase()==i.nodeName||(a=document.createElement(i.nodeName),a.pmIsDeco=!0,a.appendChild(o),l=ds[0]),o=a}ML(o,l||ds[0],i)}return o}function ML(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function mw(t,e,n){return hw(t,t,ds,Nf(e,n,t.nodeType!=1))}function bc(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function n0(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class TL{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=AL(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,s=this.stack.length>>1,i=Math.min(s,e.length);for(;o<i&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=ar,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let c=this.top.children[a];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Ts.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,o){let s=-1,i;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,n,r))s=this.top.children.indexOf(i,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let i=this.top.children[o];return i.dirty==Pr&&i.dom==i.contentDOM&&(i.dirty=us),i.update(e,n,r,s)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,s,i){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof Do){let c=this.preMatch.matched.get(a);if(c!=null&&c!=s)return!1;let u=a.dom,d,f=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=Pr&&bc(n,a.outerDeco));if(!f&&a.update(e,n,r,o))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,n,r,o,i)))return this.destroyBetween(this.index,l),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=us,d.updateChildren(o,i+1),d.dirty=ar),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,i){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!bc(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let l=Do.create(this.top,n,r,o,s,i);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,o,s){let i=Do.create(this.top,e,n,r,o,s);i.contentDOM&&i.updateChildren(o,s+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let s=new dw(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Ts;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Nu)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Nn||kn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new fw(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function AL(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Ts)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(o-1))break;--o,s.set(l,o),i.push(l)}}return{index:o,matched:s,matches:i.reverse()}}function LL(t,e){return t.type.side-e.type.side}function OL(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(s,u),c),s+=u.nodeSize}return}let i=0,l=[],a=null;for(let c=0;;){let u,d;for(;i<o.length&&o[i].to==s;){let y=o[i++];y.widget&&(u?(d||(d=[u])).push(y):u=y)}if(u)if(d){d.sort(LL);for(let y=0;y<d.length;y++)n(d[y],c,!!a)}else n(u,c,!!a);let f,p;if(a)p=-1,f=a,a=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let y=0;y<l.length;y++)l[y].to<=s&&l.splice(y--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)l.push(o[i++]);let h=s+f.nodeSize;if(f.isText){let y=h;i<o.length&&o[i].from<y&&(y=o[i].from);for(let g=0;g<l.length;g++)l[g].to<y&&(y=l[g].to);y<h&&(a=f.cut(y-s),f=f.cut(0,y-s),h=y,p=-1)}else for(;i<o.length&&o[i].to<h;)i++;let m=f.isInline&&!f.isLeaf?l.filter(y=>!y.inline):l.slice();r(f,m,e.forChild(s,f),p),s=h}}function NL(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function IL(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),l=s;if(s+=i.nodeSize,!i.isText)continue;let a=i.text;for(;o<t.childCount;){let c=t.child(o++);if(s+=c.nodeSize,!c.isText)break;a+=c.text}if(s>=n){if(s>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function If(t,e,n,r,o){let s=[];for(let i=0,l=0;i<t.length;i++){let a=t[i],c=l,u=l+=a.size;c>=n||u<=e?s.push(a):(c<e&&s.push(a.slice(0,e-c,r)),o&&(s.push(o),o=void 0),u>n&&s.push(a.slice(n-c,a.size,r)))}return s}function th(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,i=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let l=r.resolve(i),a,c;if(Ou(n)){for(a=i;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Ne.isSelectable(d)&&o.parent&&!(d.isInline&&sL(n.focusNode,n.focusOffset,o.dom))){let f=o.posBefore;c=new Ne(i==f?l:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=i,f=i;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[a,i]=f==t.state.selection.anchor?[f,d]:[d,f],l=r.resolve(i)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let d=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;c=nh(t,u,l,d)}return c}function gw(t){return t.editable?t.hasFocus():bw(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function oo(t,e=!1){let n=t.state.selection;if(yw(t,n),!!gw(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&kn){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Ms(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)PL(t);else{let{anchor:r,head:o}=n,s,i;r0&&!(n instanceof Ie)&&(n.$from.parent.inlineContent||(s=o0(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=o0(t,n.to))),t.docView.setSelection(r,o,t,e),r0&&(s&&s0(s),i&&s0(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&RL(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const r0=Nn||kn&&ow<63;function o0(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Nn&&o&&o.contentEditable=="false")return wd(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return wd(o);if(s)return wd(s)}}function wd(t){return t.contentEditable="true",Nn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function s0(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function RL(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!gw(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function PL(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,dn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Hn&&Po<=11&&(n.disabled=!0,n.disabled=!1)}function yw(t,e){if(e instanceof Ne){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(i0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else i0(t)}function i0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function nh(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Ie.between(e,n,r)}function l0(t){return t.editable&&!t.hasFocus()?!1:bw(t)}function bw(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function DL(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Ms(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Rf(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&Fe.findFrom(s,e)}function _o(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function a0(t,e,n){let r=t.state.selection;if(r instanceof Ie)if(n.indexOf("s")>-1){let{$head:o}=r,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let i=t.state.doc.resolve(o.pos+s.nodeSize*(e<0?-1:1));return _o(t,new Ie(r.$anchor,i))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Rf(t.state,e);return o&&o instanceof Ne?_o(t,o):!1}else if(!(er&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,i;if(!s||s.isText)return!1;let l=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(l))&&!i.contentDOM?Ne.isSelectable(s)?_o(t,new Ne(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):ql?_o(t,new Ie(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ne&&r.node.isInline)return _o(t,new Ie(e>0?r.$to:r.$from));{let o=Rf(t.state,e);return o?_o(t,o):!1}}}function vc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function el(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Vs(t,e){return e<0?$L(t):FL(t)}function $L(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(lr&&n.nodeType==1&&r<vc(n)&&el(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(el(l,-1))o=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(vw(n))break;{let l=n.previousSibling;for(;l&&el(l,-1);)o=n.parentNode,s=dn(l),l=l.previousSibling;if(l)n=l,r=vc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?Pf(t,n,r):o&&Pf(t,o,s)}function FL(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=vc(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(el(l,1))s=n,i=++r;else break}else{if(vw(n))break;{let l=n.nextSibling;for(;l&&el(l,1);)s=l.parentNode,i=dn(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=vc(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&Pf(t,s,i)}function vw(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function VL(t,e){for(;t&&e==t.childNodes.length&&!Gl(t);)e=dn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function BL(t,e){for(;t&&!e&&!Gl(t);)e=dn(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Pf(t,e,n){if(e.nodeType!=3){let s,i;(i=VL(e,n))?(e=i,n=0):(s=BL(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Ou(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&oo(t)},50)}function c0(t,e){let n=t.state.doc.resolve(e);if(!(kn||aL)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function u0(t,e,n){let r=t.state.selection;if(r instanceof Ie&&!r.empty||n.indexOf("s")>-1||er&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=Rf(t.state,e);if(i&&i instanceof Ne)return _o(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,l=r instanceof ir?Fe.near(i,e):Fe.findFrom(i,e);return l?_o(t,l):!1}return!1}function d0(t,e){if(!(t.state.selection instanceof Ie))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let i=t.state.tr;return e<0?i.delete(n.pos-s.nodeSize,n.pos):i.delete(n.pos,n.pos+s.nodeSize),t.dispatch(i),!0}return!1}function f0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function HL(t){if(!Nn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;f0(t,r,"true"),setTimeout(()=>f0(t,r,"false"),20)}return!1}function jL(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function zL(t,e){let n=e.keyCode,r=jL(e);if(n==8||er&&n==72&&r=="c")return d0(t,-1)||Vs(t,-1);if(n==46&&!e.shiftKey||er&&n==68&&r=="c")return d0(t,1)||Vs(t,1);if(n==13||n==27)return!0;if(n==37||er&&n==66&&r=="c"){let o=n==37?c0(t,t.state.selection.from)=="ltr"?-1:1:-1;return a0(t,o,r)||Vs(t,o)}else if(n==39||er&&n==70&&r=="c"){let o=n==39?c0(t,t.state.selection.from)=="ltr"?1:-1:1;return a0(t,o,r)||Vs(t,o)}else{if(n==38||er&&n==80&&r=="c")return u0(t,-1,r)||Vs(t,-1);if(n==40||er&&n==78&&r=="c")return HL(t)||u0(t,1,r)||Vs(t,1);if(r==(er?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function rh(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let i=t.someProp("clipboardSerializer")||Ps.fromSchema(t.state.schema),l=Ew(),a=l.createElement("div");a.appendChild(i.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Cw[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=l.createElement(u[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
146
-
147
- `);return{dom:a,text:f,slice:e}}function ww(t,e,n,r,o){let s=o.parent.type.spec.code,i,l;if(!n&&!e)return null;let a=!!e&&(r||s||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,s||r,t)}),s)return l=new ke(le.from(t.state.schema.text(e.replace(/\r\n?/g,`
148
- `))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)l=d;else{let f=o.marks(),{schema:p}=t.state,h=Ps.fromSchema(p);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=i.appendChild(document.createElement("p"));m&&y.appendChild(h.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),i=GL(n),ql&&qL(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=i.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;i=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||si.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(a||u),context:o,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!UL.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)l=JL(p0(l,+u[1],+u[2]),u[4]);else if(l=ke.maxOpen(WL(l.content,o),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d<l.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=l.content.lastChild;f<l.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);l=p0(l,d,f)}return t.someProp("transformPasted",d=>{l=d(l,t,a)}),l}const UL=/^(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 WL(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(i=>{if(!s)return;let l=r.findWrapping(i.type),a;if(!l)return s=null;if(a=s.length&&o.length&&kw(l,o,i,s[s.length-1],0))s[s.length-1]=a;else{s.length&&(s[s.length-1]=_w(s[s.length-1],o.length));let c=xw(i,l);s.push(c),r=r.matchType(c.type),o=l}}),s)return le.from(s)}return t}function xw(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,le.from(t));return t}function kw(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=kw(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(le.from(xw(n,t,o+1))))}}function _w(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,_w(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(le.empty,!0);return t.copy(n.append(r))}function Df(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,l=i.content;return t.childCount>1&&(s=0),o<r-1&&(l=Df(l,e,n,r,o+1,s)),o>=n&&(l=e<0?i.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(i.contentMatchAt(i.childCount).fillBefore(le.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(l))}function p0(t,e,n){return e<t.openStart&&(t=new ke(Df(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ke(Df(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Cw={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let h0=null;function Ew(){return h0||(h0=document.implementation.createHTMLDocument("title"))}let xd=null;function KL(t){let e=window.trustedTypes;return e?(xd||(xd=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),xd.createHTML(t)):t}function GL(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Ew().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Cw[r[1].toLowerCase()])&&(t=o.map(s=>"<"+s+">").join("")+t+o.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=KL(t),o)for(let s=0;s<o.length;s++)n=n.querySelector(o[s])||n;return n}function qL(t){let e=t.querySelectorAll(kn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function JL(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:s,openEnd:i}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;o=le.from(a.create(r[l+1],o)),s++,i++}return new ke(o,s,i)}const In={},Rn={},YL={touchstart:!0,touchmove:!0};class XL{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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function ZL(t){for(let e in In){let n=In[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{eO(t,r)&&!oh(t,r)&&(t.editable||!(r.type in Rn))&&n(t,r)},YL[e]?{passive:!0}:void 0)}Nn&&t.dom.addEventListener("input",()=>null),$f(t)}function Oo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function QL(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function $f(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>oh(t,r))})}function oh(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function eO(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function tO(t,e){!oh(t,e)&&In[e.type]&&(t.editable||!(e.type in Rn))&&In[e.type](t,e)}Rn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Mw(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(eo&&kn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),bi&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,as(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||zL(t,n)?n.preventDefault():Oo(t,"key")};Rn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Rn.keypress=(t,e)=>{let n=e;if(Mw(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||er&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ie)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o,s))&&t.dispatch(s()),n.preventDefault()}};function Iu(t){return{left:t.clientX,top:t.clientY}}function nO(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function sh(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(t.someProp(e,l=>i>s.depth?l(t,n,s.nodeAfter,s.before(i),o,!0):l(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function ai(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function rO(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ne.isSelectable(r)?(ai(t,new Ne(n)),!0):!1}function oO(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Ne&&(r=n.node);let s=t.state.doc.resolve(e);for(let i=s.depth+1;i>0;i--){let l=i>s.depth?s.nodeAfter:s.node(i);if(Ne.isSelectable(l)){r&&n.$from.depth>0&&i>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(i);break}}return o!=null?(ai(t,Ne.create(t.state.doc,o)),!0):!1}function sO(t,e,n,r,o){return sh(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?oO(t,n):rO(t,n))}function iO(t,e,n,r){return sh(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function lO(t,e,n,r){return sh(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||aO(t,n,r)}function aO(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ai(t,Ie.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let i=s>o.depth?o.nodeAfter:o.node(s),l=o.before(s);if(i.inlineContent)ai(t,Ie.create(r,l+1,l+1+i.content.size));else if(Ne.isSelectable(i))ai(t,Ne.create(r,l));else continue;return!0}}function ih(t){return wc(t)}const Sw=er?"metaKey":"ctrlKey";In.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=ih(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&nO(n,t.input.lastClick)&&!n[Sw]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button};let i=t.posAtCoords(Iu(n));i&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new cO(t,i,n,!!r)):(s=="doubleClick"?iO:lO)(t,i.pos,i.inside,n)?n.preventDefault():Oo(t,"pointer"))};class cO{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Sw],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,i=u.depth?u.before():0}const l=o?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof Ne&&c.from<=i&&c.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&lr&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Oo(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),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(()=>oo(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Iu(e))),this.updateAllowDefault(e),this.allowDefault||!n?Oo(this.view,"pointer"):sO(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Nn&&this.mightDrag&&!this.mightDrag.node.isAtom||kn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ai(this.view,Fe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Oo(this.view,"pointer")}move(e){this.updateAllowDefault(e),Oo(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}In.touchstart=t=>{t.input.lastTouch=Date.now(),ih(t),Oo(t,"pointer")};In.touchmove=t=>{t.input.lastTouch=Date.now(),Oo(t,"pointer")};In.contextmenu=t=>ih(t);function Mw(t,e){return t.composing?!0:Nn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const uO=eo?5e3:-1;Rn.compositionstart=Rn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ie&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),wc(t,!0),t.markCursor=null;else if(wc(t,!e.selection.empty),lr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let i=s<0?o.lastChild:o.childNodes[s-1];if(!i)break;if(i.nodeType==3){let l=t.domSelection();l&&l.collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}Tw(t,uO)};Rn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Tw(t,20))};function Tw(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>wc(t),e))}function Aw(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=fO());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function dO(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=rL(e.focusNode,e.focusOffset),r=oL(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return r}}return n||r}function fO(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function wc(t,e=!1){if(!(eo&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Aw(t),e||t.docView&&t.docView.dirty){let n=th(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function pO(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Ml=Hn&&Po<15||bi&&cL<604;In.copy=Rn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=Ml?null:n.clipboardData,i=r.content(),{dom:l,text:a}=rh(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):pO(t,l),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function hO(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function mO(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Tl(t,r.value,null,o,e):Tl(t,r.textContent,r.innerHTML,o,e)},50)}function Tl(t,e,n,r,o){let s=ww(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,o,s||ke.empty)))return!0;if(!s)return!1;let i=hO(s),l=i?t.state.tr.replaceSelectionWith(i,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Lw(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Rn.paste=(t,e)=>{let n=e;if(t.composing&&!eo)return;let r=Ml?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Tl(t,Lw(r),r.getData("text/html"),o,n)?n.preventDefault():mO(t,n)};class Ow{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const gO=er?"altKey":"ctrlKey";function Nw(t,e){return t.someProp("dragCopies",r=>!r(e))??!e[gO]}In.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(Iu(n)),i;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Ne?o.to-1:o.to))){if(r&&r.mightDrag)i=Ne.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(i=Ne.create(t.state.doc,d.posBefore))}}let l=(i||t.state.selection).content(),{dom:a,text:c,slice:u}=rh(t,l);(!n.dataTransfer.files.length||!kn||ow>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ml?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ml||n.dataTransfer.setData("text/plain",c),t.dragging=new Ow(u,Nw(t,n),i)};In.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Rn.dragover=Rn.dragenter=(t,e)=>e.preventDefault();Rn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Iu(n));if(!o)return;let s=t.state.doc.resolve(o.pos),i=r&&r.slice;i?t.someProp("transformPasted",h=>{i=h(i,t,!1)}):i=ww(t,Lw(n.dataTransfer),Ml?null:n.dataTransfer.getData("text/html"),!1,s);let l=!!(r&&Nw(t,n));if(t.someProp("handleDrop",h=>h(t,n,i||ke.empty,l))){n.preventDefault();return}if(!i)return;n.preventDefault();let a=i?J1(t.state.doc,s.pos,i):s.pos;a==null&&(a=s.pos);let c=t.state.tr;if(l){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&Ne.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new Ne(p));else{let h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,y,g,k)=>h=k),c.setSelection(nh(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};In.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&oo(t)},20))};In.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};In.beforeinput=(t,e)=>{if(kn&&eo&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,as(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in Rn)In[t]=Rn[t];function Al(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class xc{constructor(e,n){this.toDOM=e,this.spec=n||ws,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:i}=e.mapResult(n.from+o,this.side<0?-1:1);return i?null:new on(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof xc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Al(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $o{constructor(e,n){this.attrs=e,this.spec=n||ws}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,i=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=i?null:new on(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof $o&&Al(this.attrs,e.attrs)&&Al(this.spec,e.spec)}static is(e){return e.type instanceof $o}destroy(){}}class lh{constructor(e,n){this.attrs=e,this.spec=n||ws}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let i=e.mapResult(n.to+o,-1);return i.deleted||i.pos<=s.pos?null:new on(s.pos-r,i.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof lh&&Al(this.attrs,e.attrs)&&Al(this.spec,e.spec)}destroy(){}}class on{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new on(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new on(e,e,new xc(n,r))}static inline(e,n,r,o){return new on(e,n,new $o(r,o))}static node(e,n,r,o){return new on(e,n,new lh(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof $o}get widget(){return this.type instanceof xc}}const Ws=[],ws={};class _t{constructor(e,n){this.local=e.length?e:Ws,this.children=n.length?n:Ws}static create(e,n){return n.length?kc(n,e,0,ws):bn}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,s){for(let i=0;i<this.local.length;i++){let l=this.local[i];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let l=this.children[i]+1;this.children[i+2].findInner(e-l,n-l,r,o+l,s)}}map(e,n,r){return this==bn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ws)}mapInner(e,n,r,o,s){let i;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,o);a&&a.type.valid(n,a)?(i||(i=[])).push(a):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?yO(this.children,i||[],e,n,r,o,s):i?new _t(i.sort(xs),Ws):bn}add(e,n){return n.length?this==bn?_t.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Rw(n,l,c)){for(o||(o=this.children.slice());s<o.length&&o[s]<a;)s+=3;o[s]==a?o[s+2]=o[s+2].addInner(l,u,c+1):o.splice(s,0,a,a+l.nodeSize,kc(u,l,c+1,ws)),s+=3}});let i=Iw(s?Pw(n):n,-r);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||i.splice(l--,1);return new _t(i.length?this.local.concat(i).sort(xs):this.local,o||this.children)}remove(e){return e.length==0||this==bn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let i,l=r[s]+n,a=r[s+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(i||(i=[])).push(d));if(!i)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(i,l+1);c!=bn?r[s+2]=c:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,i;s<e.length;s++)if(i=e[s])for(let l=0;l<o.length;l++)o[l].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new _t(o,r):bn}forChild(e,n){if(this==bn)return this;if(n.isLeaf)return _t.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,i=s+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<i&&a.to>s&&a.type instanceof $o){let c=Math.max(s,a.from)-s,u=Math.min(i,a.to)-s;c<u&&(o||(o=[])).push(a.copy(c,u))}}if(o){let l=new _t(o.sort(xs),Ws);return r?new So([l,r]):l}return r||bn}eq(e){if(this==e)return!0;if(!(e instanceof _t)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return ah(this.localsInner(e))}localsInner(e){if(this==bn)return Ws;if(e.inlineContent||!this.local.some($o.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof $o||n.push(this.local[r]);return n}forEachSet(e){e(this)}}_t.empty=new _t([],[]);_t.removeOverlap=ah;const bn=_t.empty;class So{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,ws));return So.from(r)}forChild(e,n){if(n.isLeaf)return _t.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=bn&&(s instanceof So?r=r.concat(s.members):r.push(s))}return So.from(r)}eq(e){if(!(e instanceof So)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let i=0;i<s.length;i++)n.push(s[i])}}return n?ah(r?n:n.sort(xs)):Ws}static from(e){switch(e.length){case 0:return bn;case 1:return e[0];default:return new So(e.every(n=>n instanceof _t)?e:e.reduce((n,r)=>n.concat(r instanceof _t?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function yO(t,e,n,r,o,s,i){let l=t.slice();for(let c=0,u=s;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,p,h,m)=>{let y=m-h-(p-f);for(let g=0;g<l.length;g+=3){let k=l[g+1];if(k<0||f>k+u-d)continue;let w=l[g]+u-d;p>=w?l[g+1]=f<=w?-2:-1:f>=u&&y&&(l[g]+=y,l[g+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+s),d=u-o;if(d<0||d>=r.content.size){a=!0;continue}let f=n.map(t[c+1]+s,-1),p=f-o,{index:h,offset:m}=r.content.findIndex(d),y=r.maybeChild(h);if(y&&m==d&&m+y.nodeSize==p){let g=l[c+2].mapInner(n,y,u+1,t[c]+s+1,i);g!=bn?(l[c]=d,l[c+1]=p,l[c+2]=g):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=bO(l,t,e,n,o,s,i),u=kc(c,r,0,i);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<l.length&&l[f]<p;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new _t(e.sort(xs),l)}function Iw(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new on(o.from+e,o.to+e,o.type))}return n}function bO(t,e,n,r,o,s,i){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,o,c);d?n.push(d):i.onRemove&&i.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+s+1);return n}function Rw(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,i;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function Pw(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function kc(t,e,n,r){let o=[],s=!1;e.forEach((l,a)=>{let c=Rw(t,l,a+n);if(c){s=!0;let u=kc(c,l,n+a+1,r);u!=bn&&o.push(a,a+l.nodeSize,u)}});let i=Iw(s?Pw(t):t,-n).sort(xs);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||(r.onRemove&&r.onRemove(i[l].spec),i.splice(l--,1));return i.length||o.length?new _t(i,o):bn}function xs(t,e){return t.from-e.from||t.to-e.to}function ah(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),m0(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),m0(e,o,r.copy(s.from,r.to)));break}}}return e}function m0(t,e,n){for(;e<t.length&&xs(n,t[e])>0;)e++;t.splice(e,0,n)}function kd(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=bn&&e.push(r)}),t.cursorWrapper&&e.push(_t.create(t.state.doc,[t.cursorWrapper.deco])),So.from(e)}const vO={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},wO=Hn&&Po<=11;class xO{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}}class kO{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new xO,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Hn&&Po<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),wO&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,vO)),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 n=0;n<e.length;n++)this.queue.push(e[n]);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(l0(this.view)){if(this.suppressingSelectionUpdates)return oo(this.view);if(Hn&&Po<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ms(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 n=new Set,r;for(let s=e.focusNode;s;s=yi(s))n.add(s);for(let s=e.anchorNode;s;s=yi(s))if(n.has(s)){r=s;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&l0(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],a);d&&(s=s<0?d.from:Math.min(d.from,s),i=i<0?d.to:Math.max(d.to,i),d.typeOver&&(l=!0))}if(lr&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||EO(e,d)!=p)&&f.remove()}}}let c=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Ou(r)&&(c=th(e))&&c.eq(Fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,oo(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),_O(e)),this.handleDOMChange(s,i,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||oo(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(Hn&&Po<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let i=o&&o.parentNode==e.target?dn(o)+1:0,l=r.localPosFromDOM(e.target,i,-1),a=s&&s.parentNode==e.target?dn(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let g0=new WeakMap,y0=!1;function _O(t){if(!g0.has(t)&&(g0.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=lr,y0)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."),y0=!0}}function b0(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return Ms(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function CO(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return b0(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?b0(t,n):null}function EO(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function SO(t,e,n){let{node:r,fromOffset:o,toOffset:s,from:i,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],Ou(a)||c.push({node:a.focusNode,offset:a.focusOffset})),kn&&t.input.lastKeyCode===8)for(let y=s;y>o;y--){let g=r.childNodes[y-1],k=g.pmViewDesc;if(g.nodeName=="BR"&&!k){s=y;break}if(!k||k.size)break}let d=t.state.doc,f=t.someProp("domParser")||si.fromSchema(t.state.schema),p=d.resolve(i),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:MO,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,g=c[1]&&c[1].pos;g==null&&(g=y),h={anchor:y+i,head:g+i}}return{doc:m,sel:h,from:i,to:l}}function MO(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Nn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Nn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const TO=/^(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 AO(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let E=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,I=th(t,E);if(I&&!t.state.selection.eq(I)){if(kn&&eo&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",R=>R(t,as(13,"Enter"))))return;let F=t.state.tr.setSelection(I);E=="pointer"?F.setMeta("pointer",!0):E=="key"&&F.scrollIntoView(),s&&F.setMeta("composition",s),t.dispatch(F)}return}let i=t.state.doc.resolve(e),l=i.sharedDepth(n);e=i.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=SO(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=NO(d.content,c.doc.content,c.from,f,p);if(h&&t.input.domChangeCount++,(bi&&t.input.lastIOSEnter>Date.now()-225||eo)&&o.some(E=>E.nodeType==1&&!TO.test(E.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",E=>E(t,as(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof Ie&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let E=v0(t,t.state.doc,c.sel);if(E&&!E.eq(t.state.selection)){let I=t.state.tr.setSelection(E);s&&I.setMeta("composition",s),t.dispatch(I)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof Ie&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Hn&&Po<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),y=c.doc.resolveNoCache(h.endB-c.from),g=u.resolve(h.start),k=m.sameParent(y)&&m.parent.inlineContent&&g.end()>=h.endA;if((bi&&t.input.lastIOSEnter>Date.now()-225&&(!k||o.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!k&&m.pos<c.doc.content.size&&(!m.sameParent(y)||!m.parent.inlineContent)&&m.pos<y.pos&&!/\S/.test(c.doc.textBetween(m.pos,y.pos,"","")))&&t.someProp("handleKeyDown",E=>E(t,as(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&OO(u,h.start,h.endA,m,y)&&t.someProp("handleKeyDown",E=>E(t,as(8,"Backspace")))){eo&&kn&&t.domObserver.suppressSelectionUpdates();return}kn&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),eo&&!k&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,y=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(E){return E(t,as(13,"Enter"))})},20));let w=h.start,b=h.endA,_=E=>{let I=E||t.state.tr.replace(w,b,c.doc.slice(h.start-c.from,h.endB-c.from));if(c.sel){let F=v0(t,I.doc,c.sel);F&&!(kn&&t.composing&&F.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(F.head==w||F.head==I.mapping.map(b)-1)||Hn&&F.empty&&F.head==w)&&I.setSelection(F)}return s&&I.setMeta("composition",s),I.scrollIntoView()},M;if(k){if(m.pos==y.pos){Hn&&Po<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>oo(t),20));let E=_(t.state.tr.delete(w,b)),I=u.resolve(h.start).marksAcross(u.resolve(h.endA));I&&E.ensureMarks(I),t.dispatch(E)}else if(h.endA==h.endB&&(M=LO(m.parent.content.cut(m.parentOffset,y.parentOffset),g.parent.content.cut(g.parentOffset,h.endA-g.start())))){let E=_(t.state.tr);M.type=="add"?E.addMark(w,b,M.mark):E.removeMark(w,b,M.mark),t.dispatch(E)}else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let E=m.parent.textBetween(m.parentOffset,y.parentOffset),I=()=>_(t.state.tr.insertText(E,w,b));t.someProp("handleTextInput",F=>F(t,w,b,E,I))||t.dispatch(I())}}else t.dispatch(_())}function v0(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:nh(t,e.resolve(n.anchor),e.resolve(n.head))}function LO(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,l,a;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)s=n[u].removeFromSet(s);if(o.length==1&&s.length==0)l=o[0],i="add",a=u=>u.mark(l.addToSet(u.marks));else if(o.length==0&&s.length==1)l=s[0],i="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(le.from(c).eq(t))return{mark:l,type:i}}function OO(t,e,n,r,o){if(n-e<=o.pos-r.pos||_d(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(_d(s,!0,!0));return!i.parent.isTextblock||i.pos>n||_d(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function _d(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function NO(t,e,n,r,o){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:i,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let a=Math.max(0,s-Math.min(i,l));r-=i+a-s}if(i<s&&t.size<e.size){let a=r<=s&&r>=i?s-r:0;s-=a,s&&s<e.size&&w0(e.textBetween(s-1,s+1))&&(s+=a?1:-1),l=s+(l-i),i=s}else if(l<s){let a=r<=s&&r>=l?s-r:0;s-=a,s&&s<t.size&&w0(t.textBetween(s-1,s+1))&&(s+=a?1:-1),i=s+(i-l),l=s}return{start:s,endA:i,endB:l}}function w0(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Dw{constructor(e,n){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 XL,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(E0),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=_0(this),k0(this),this.nodeViews=C0(this),this.docView=t0(this.state.doc,x0(this),kd(this),this.dom,this),this.domObserver=new kO(this,(r,o,s,i)=>AO(this,r,o,s,i)),this.domObserver.start(),ZL(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$f(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(E0),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,s=!1,i=!1;e.storedMarks&&this.composing&&(Aw(this),i=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=C0(this);RO(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&$f(this),this.editable=_0(this),k0(this);let a=kd(this),c=x0(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(o.selection))&&(i=!0);let f=u=="preserve"&&i&&this.dom.style.overflowAnchor==null&&fL(this);if(i){this.domObserver.stop();let p=d&&(Hn||kn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&IO(o.selection,e.selection);if(d){let h=kn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=dO(this)),(s||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=t0(e.doc,c,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&DL(this))?oo(this,p):(yw(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&pL(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ne){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Jg(this,n.getBoundingClientRect(),e)}else Jg(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 n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(o=s)}this.dragging=new Ow(e.slice,e.move,o<0?void 0:Ne.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let i=0;i<this.directPlugins.length;i++){let l=this.directPlugins[i].props[e];if(l!=null&&(o=n?n(l):l))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let l=s[i].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(Hn){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&&hL(this.dom),oo(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return vL(this,e)}coordsAtPos(e,n=1){return cw(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return CL(this,n||this.state,e)}pasteHTML(e,n){return Tl(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Tl(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return rh(this,e)}destroy(){this.docView&&(QL(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],kd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,tL())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return tO(this,e)}domSelectionRange(){let e=this.domSelection();return e?Nn&&this.root.nodeType===11&&iL(this.dom.ownerDocument)==this.dom&&CO(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Dw.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function x0(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[on.node(0,t.state.doc.content.size,e)]}function k0(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:on.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function _0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function IO(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function C0(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function RO(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function E0(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Wo={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:"'"},_c={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},PO=typeof navigator<"u"&&/Mac/.test(navigator.platform),DO=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var fn=0;fn<10;fn++)Wo[48+fn]=Wo[96+fn]=String(fn);for(var fn=1;fn<=24;fn++)Wo[fn+111]="F"+fn;for(var fn=65;fn<=90;fn++)Wo[fn]=String.fromCharCode(fn+32),_c[fn]=String.fromCharCode(fn);for(var Cd in Wo)_c.hasOwnProperty(Cd)||(_c[Cd]=Wo[Cd]);function $O(t){var e=PO&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||DO&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?_c:Wo)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const FO=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),VO=typeof navigator<"u"&&/Win/.test(navigator.platform);function BO(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))FO?i=!0:o=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),i&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function HO(t){let e=Object.create(null);for(let n in t)e[BO(n)]=t[n];return e}function Ed(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function jO(t){return new Rt({props:{handleKeyDown:ch(t)}})}function ch(t){let e=HO(t);return function(n,r){let o=$O(r),s,i=e[Ed(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[Ed(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(VO&&r.ctrlKey&&r.altKey)&&(s=Wo[r.keyCode])&&s!=o){let l=e[Ed(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const zO=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function $w(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const UO=(t,e,n)=>{let r=$w(t,n);if(!r)return!1;let o=uh(r);if(!o){let i=r.blockRange(),l=i&&Si(i);return l==null?!1:(e&&e(t.tr.lift(i,l).scrollIntoView()),!0)}let s=o.nodeBefore;if(Hw(t,o,e,-1))return!0;if(r.parent.content.size==0&&(vi(s,"end")||Ne.isSelectable(s)))for(let i=r.depth;;i--){let l=Au(t.doc,r.before(i),r.after(i),ke.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(vi(s,"end")?Fe.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):Ne.create(a.doc,o.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}if(i==1||r.node(i-1).childCount>1)break}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},WO=(t,e,n)=>{let r=$w(t,n);if(!r)return!1;let o=uh(r);return o?Fw(t,o,e):!1},KO=(t,e,n)=>{let r=Vw(t,n);if(!r)return!1;let o=dh(r);return o?Fw(t,o,e):!1};function Fw(t,e,n){let r=e.nodeBefore,o=r,s=e.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let i=e.nodeAfter,l=i,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Au(t.doc,s,a,ke.empty);if(!c||c.from!=s||c instanceof rn&&c.slice.size>=a-s)return!1;if(n){let u=t.tr.step(c);u.setSelection(Ie.create(u.doc,s)),n(u.scrollIntoView())}return!0}function vi(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const GO=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=uh(r)}let i=s&&s.nodeBefore;return!i||!Ne.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Ne.create(t.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function uh(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Vw(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const qO=(t,e,n)=>{let r=Vw(t,n);if(!r)return!1;let o=dh(r);if(!o)return!1;let s=o.nodeAfter;if(Hw(t,o,e,1))return!0;if(r.parent.content.size==0&&(vi(s,"start")||Ne.isSelectable(s))){let i=Au(t.doc,r.before(),r.after(),ke.empty);if(i&&i.slice.size<i.to-i.from){if(e){let l=t.tr.step(i);l.setSelection(vi(s,"start")?Fe.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):Ne.create(l.doc,l.mapping.map(o.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},JO=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=dh(r)}let i=s&&s.nodeAfter;return!i||!Ne.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Ne.create(t.doc,s.pos)).scrollIntoView()),!0)};function dh(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const YO=(t,e)=>{let n=t.selection,r=n instanceof Ne,o;if(r){if(n.node.isTextblock||!Xo(t.doc,n.from))return!1;o=n.from}else if(o=Tu(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(Ne.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},XO=(t,e)=>{let n=t.selection,r;if(n instanceof Ne){if(n.node.isTextblock||!Xo(t.doc,n.to))return!1;r=n.to}else if(r=Tu(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},ZO=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&Si(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},QO=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
149
- `).scrollIntoView()),!0)};function Bw(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const eN=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),i=Bw(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,i.createAndFill());a.setSelection(Fe.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},tN=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof ir||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=Bw(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let i=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(i,s.createAndFill());l.setSelection(Ie.create(l.doc,i+1)),e(l.scrollIntoView())}return!0},nN=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(ii(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Si(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},rN=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(Ne.create(t.doc,o))),!0)};function oN(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||Xo(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Hw(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,i,l,a=o.type.spec.isolating||s.type.spec.isolating;if(!a&&oN(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(i=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(i[0]||s.type).validEnd){if(n){let p=e.pos+s.nodeSize,h=le.empty;for(let g=i.length-1;g>=0;g--)h=le.from(i[g].create(null,h));h=le.from(o.copy(h));let m=t.tr.step(new sn(e.pos-1,p,e.pos,p,new ke(h,1,0),i.length,!0)),y=m.doc.resolve(p+2*i.length);y.nodeAfter&&y.nodeAfter.type==o.type&&Xo(m.doc,y.pos)&&m.join(y.pos),n(m.scrollIntoView())}return!0}let u=s.type.spec.isolating||r>0&&a?null:Fe.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Si(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&vi(s,"start",!0)&&vi(o,"end")){let p=o,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=s,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let g=le.empty;for(let w=h.length-1;w>=0;w--)g=le.from(h[w].copy(g));let k=t.tr.step(new sn(e.pos-h.length,e.pos+s.nodeSize,e.pos+y,e.pos+s.nodeSize-y,new ke(g,h.length,0),0,!0));n(k.scrollIntoView())}return!0}}return!1}function jw(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(Ie.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const sN=jw(-1),iN=jw(1);function lN(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),l=i&&Xp(i,t,e);return l?(r&&r(n.tr.wrap(i,l).scrollIntoView()),!0):!1}}function S0(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:i},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(i,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[i];s.setBlockType(l,a,t,e)}r(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function aN(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let l=r?n.tr:null;return cN(l,i,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function cN(t,e,n,r=null){let o=!1,s=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=i.resolve(e.start-2);s=new gc(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new gc(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let l=Xp(s,n,r,e);return l?(t&&uN(t,e,l,o,n),!0):!1}function uN(t,e,n,r,o){let s=le.empty;for(let u=n.length-1;u>=0;u--)s=le.from(n[u].type.create(n[u].attrs,s));t.step(new sn(e.start-(r?2:0),e.end,e.start,e.end,new ke(s,0,0),n.length,!0));let i=0;for(let u=0;u<n.length;u++)n[u].type==o&&(i=u+1);let l=n.length-i,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&ii(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function dN(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,i=>i.childCount>0&&i.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?fN(e,n,t,s):pN(e,n,s):!0:!1}}function fN(t,e,n,r){let o=t.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new sn(s-1,i,s,i,new ke(le.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new gc(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const l=Si(r);if(l==null)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(s,-1)-1);return Xo(o.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&o.join(a.pos),e(o.scrollIntoView()),!0}function pN(t,e,n){let r=t.tr,o=n.parent;for(let p=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)p-=o.child(h).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==o.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,i.content.append(a?le.empty:le.from(o))))return!1;let d=s.pos,f=d+i.nodeSize;return r.step(new sn(d-(l?1:0),f+(a?1:0),d+1,f-1,new ke((l?le.empty:le.from(o.copy(le.empty))).append(a?le.empty:le.from(o.copy(le.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function hN(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let i=s.startIndex;if(i==0)return!1;let l=s.parent,a=l.child(i-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=le.from(c?t.create():null),d=new ke(le.from(t.create(null,le.from(l.type.create(null,u)))),c?3:1,0),f=s.start,p=s.end;n(e.tr.step(new sn(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}var mN=Object.defineProperty,zw=(t,e)=>{for(var n in e)mN(t,n,{get:e[n],enumerable:!0})};function Ru(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}var Pu=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,s=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([i,l])=>[i,(...a)=>{const c=l(...a)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i=[],l=!!t,a=t||o.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(a),i.every(d=>d===!0)),u={...Object.fromEntries(Object.entries(n).map(([d,f])=>[d,(...p)=>{const h=this.buildProps(a,e),m=f(...p)(h);return i.push(m),u}])),run:c};return u}createCan(t){const{rawCommands:e,state:n}=this,r=!1,o=t||n.tr,s=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map(([i,l])=>[i,(...a)=>l(...a)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i={tr:t,editor:r,view:s,state:Ru({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,a])=>[l,(...c)=>a(...c)(i)]))}};return i}},gN=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function Uw(t,e){const n=new Zp(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}var Ww=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Ww(r)}return t};function ma(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Ww(n)}function Ll(t,e,n){if(t instanceof Ro||t instanceof le)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return le.fromArray(t.map(i=>e.nodeFromJSON(i)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),Ll("",e,n)}if(o){if(n.errorOnInvalidContent){let i=!1,l="";const a=new F1({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(i=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?si.fromSchema(a).parseSlice(ma(t),n.parseOptions):si.fromSchema(a).parse(ma(t),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=si.fromSchema(e);return n.slice?s.parseSlice(ma(t),n.parseOptions).content:s.parse(ma(t),n.parseOptions)}return Ll("",e,n)}function Ff(t,e,n={},r={}){return Ll(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function yN(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function bN(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function Kw(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Du(t){return e=>Kw(e.$from,t)}function Oe(t,e,n){return t.config[e]===void 0&&t.parent?Oe(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Oe(t.parent,e,n):null}):t.config[e]}function fh(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Oe(e,"addExtensions",n);return r?[e,...fh(r())]:e}).flat(10)}function ph(t,e){const n=Ps.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Gw(t){return typeof t=="function"}function at(t,e=void 0,...n){return Gw(t)?e?t.bind(e)(...n):t(...n):t}function vN(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Ol(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function qw(t){const e=[],{nodeExtensions:n,markExtensions:r}=Ol(t),o=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(i=>{const l={name:i.name,options:i.options,storage:i.storage,extensions:o},a=Oe(i,"addGlobalAttributes",l);a&&a().forEach(c=>{c.types.forEach(u=>{Object.entries(c.attributes).forEach(([d,f])=>{e.push({type:u,name:d,attribute:{...s,...f}})})})})}),o.forEach(i=>{const l={name:i.name,options:i.options,storage:i.storage},a=Oe(i,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...s,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:i.name,name:u,attribute:f})})}),e}function ft(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}if(o==="class"){const i=s?String(s).split(" "):[],l=r[o]?r[o].split(" "):[],a=i.filter(c=>!l.includes(c));r[o]=[...l,...a].join(" ")}else if(o==="style"){const i=s?s.split(";").map(c=>c.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(c=>c.trim()).filter(Boolean):[],a=new Map;l.forEach(c=>{const[u,d]=c.split(":").map(f=>f.trim());a.set(u,d)}),i.forEach(c=>{const[u,d]=c.split(":").map(f=>f.trim());a.set(u,d)}),r[o]=Array.from(a.entries()).map(([c,u])=>`${c}: ${u}`).join("; ")}else r[o]=s}),r},{})}function Cc(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ft(n,r),{})}function wN(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function M0(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,i)=>{const l=i.attribute.parseHTML?i.attribute.parseHTML(n):wN(n.getAttribute(i.name));return l==null?s:{...s,[i.name]:l}},{});return{...r,...o}}}}function T0(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&vN(n)?!1:n!=null))}function xN(t,e){var n;const r=qw(t),{nodeExtensions:o,markExtensions:s}=Ol(t),i=(n=o.find(c=>Oe(c,"topNode")))==null?void 0:n.name,l=Object.fromEntries(o.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((g,k)=>{const w=Oe(k,"extendNodeSchema",d);return{...g,...w?w(c):{}}},{}),p=T0({...f,content:at(Oe(c,"content",d)),marks:at(Oe(c,"marks",d)),group:at(Oe(c,"group",d)),inline:at(Oe(c,"inline",d)),atom:at(Oe(c,"atom",d)),selectable:at(Oe(c,"selectable",d)),draggable:at(Oe(c,"draggable",d)),code:at(Oe(c,"code",d)),whitespace:at(Oe(c,"whitespace",d)),linebreakReplacement:at(Oe(c,"linebreakReplacement",d)),defining:at(Oe(c,"defining",d)),isolating:at(Oe(c,"isolating",d)),attrs:Object.fromEntries(u.map(g=>{var k,w;return[g.name,{default:(k=g==null?void 0:g.attribute)==null?void 0:k.default,validate:(w=g==null?void 0:g.attribute)==null?void 0:w.validate}]}))}),h=at(Oe(c,"parseHTML",d));h&&(p.parseDOM=h.map(g=>M0(g,u)));const m=Oe(c,"renderHTML",d);m&&(p.toDOM=g=>m({node:g,HTMLAttributes:Cc(g,u)}));const y=Oe(c,"renderText",d);return y&&(p.toText=y),[c.name,p]})),a=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,g)=>{const k=Oe(g,"extendMarkSchema",d);return{...y,...k?k(c):{}}},{}),p=T0({...f,inclusive:at(Oe(c,"inclusive",d)),excludes:at(Oe(c,"excludes",d)),group:at(Oe(c,"group",d)),spanning:at(Oe(c,"spanning",d)),code:at(Oe(c,"code",d)),attrs:Object.fromEntries(u.map(y=>{var g,k;return[y.name,{default:(g=y==null?void 0:y.attribute)==null?void 0:g.default,validate:(k=y==null?void 0:y.attribute)==null?void 0:k.validate}]}))}),h=at(Oe(c,"parseHTML",d));h&&(p.parseDOM=h.map(y=>M0(y,u)));const m=Oe(c,"renderHTML",d);return m&&(p.toDOM=y=>m({mark:y,HTMLAttributes:Cc(y,u)})),[c.name,p]}));return new F1({topNode:i,nodes:l,marks:a})}function kN(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function hh(t){return t.sort((e,n)=>{const r=Oe(e,"priority")||100,o=Oe(n,"priority")||100;return r>o?-1:r<o?1:0})}function Jw(t){const e=hh(fh(t)),n=kN(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function Yw(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
150
-
151
- `,textSerializers:i={}}=n||{};let l="";return t.nodesBetween(r,o,(a,c,u,d)=>{var f;a.isBlock&&c>r&&(l+=s);const p=i==null?void 0:i[a.type.name];if(p)return u&&(l+=p({node:a,pos:c,parent:u,index:d,range:e})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)==null?void 0:f.slice(Math.max(r,c)-c,o-c))}),l}function _N(t,e){const n={from:0,to:t.content.size};return Yw(t,n,e)}function Xw(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function fo(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Zw(t,e){const n=fo(e,t.schema),{from:r,to:o,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,a=>{i.push(...a.marks)});const l=i.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function Xt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function CN(t,e){const n=Xt(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,l=>{s.push(l)});const i=s.reverse().find(l=>l.type.name===n.name);return i?{...i.attrs}:{}}function $u(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Qw(t,e){const n=$u(typeof e=="string"?e:e.name,t.schema);return n==="node"?CN(t,e):n==="mark"?Zw(t,e):{}}function EN(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function SN(t){const e=EN(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function ex(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const i=[];if(o.ranges.length)o.forEach((l,a)=>{i.push({from:l,to:a})});else{const{from:l,to:a}=n[s];if(l===void 0||a===void 0)return;i.push({from:l,to:a})}i.forEach(({from:l,to:a})=>{const c=e.slice(s).map(l,-1),u=e.slice(s).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),SN(r)}function mh(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Ec(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:mh(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function tx(t,e,n={}){return t.find(r=>r.type===e&&Ec(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function A0(t,e,n={}){return!!tx(t,e,n)}function gh(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(c=>c.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(c=>c.type===e)||(n=n||((r=o.node.marks[0])==null?void 0:r.attrs),!tx([...o.node.marks],e,n)))return;let s=o.index,i=t.start()+o.offset,l=s+1,a=i+o.node.nodeSize;for(;s>0&&A0([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&A0([...t.parent.child(l).marks],e,n);)a+=t.parent.child(l).nodeSize,l+=1;return{from:i,to:a}}function yh(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),i=gh(s,o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,s)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(i=>({from:s,to:s+o.nodeSize,mark:i})))}),r}var MN=(t,e,n,r=20)=>{const o=t.doc.resolve(n);let s=r,i=null;for(;s>0&&i===null;){const l=o.node(s);(l==null?void 0:l.type.name)===e?i=l:s-=1}return[i,s]};function Sd(t,e){return e.nodes[t]||e.marks[t]||null}function Ha(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}var TN=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,l)=>{var a,c;const u=((c=(a=o.type.spec).toText)==null?void 0:c.call(a,{node:o,pos:s,parent:i,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-s))}),n};function Vf(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?fo(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>Ec(u.attrs,n,{strict:!1}));let i=0;const l=[];if(o.forEach(({$from:u,$to:d})=>{const f=u.pos,p=d.pos;t.doc.nodesBetween(f,p,(h,m)=>{if(!h.isText&&!h.marks.length)return;const y=Math.max(f,m),g=Math.min(p,m+h.nodeSize),k=g-y;i+=k,l.push(...h.marks.map(w=>({mark:w,from:y,to:g})))})}),i===0)return!1;const a=l.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>Ec(u.mark.attrs,n,{strict:!1})).reduce((u,d)=>u+d.to-d.from,0),c=l.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,d)=>u+d.to-d.from,0);return(a>0?a+c:a)>=i}function Ko(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?Xt(e,t.schema):null,l=[];t.doc.nodesBetween(r,o,(u,d)=>{if(u.isText)return;const f=Math.max(r,d),p=Math.min(o,d+u.nodeSize);l.push({node:u,from:f,to:p})});const a=o-r,c=l.filter(u=>i?i.name===u.node.type.name:!0).filter(u=>Ec(u.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((u,d)=>u+d.to-d.from,0)>=a}function AN(t,e,n={}){if(!e)return Ko(t,null,n)||Vf(t,null,n);const r=$u(e,t.schema);return r==="node"?Ko(t,e,n):r==="mark"?Vf(t,e,n):!1}var LN=(t,e)=>{const{$from:n,$to:r,$anchor:o}=t.selection;if(e){const s=Du(l=>l.type.name===e)(t.selection);if(!s)return!1;const i=t.doc.resolve(s.pos+1);return o.pos+1===i.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},ON=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function L0(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function O0(t,e){const{nodeExtensions:n}=Ol(e),r=n.find(i=>i.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=at(Oe(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function Fu(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(Fu(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function nx(t){return t instanceof Ne}function rx(t){return t instanceof Ie}function fs(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function ox(t,e=null){if(!e)return null;const n=Fe.atStart(t),r=Fe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?Ie.create(t,fs(0,o,s),fs(t.content.size,o,s)):Ie.create(t,fs(e,o,s),fs(e,o,s))}function NN(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof rn||o instanceof sn))return;const s=t.mapping.maps[r];let i=0;s.forEach((l,a,c,u)=>{i===0&&(i=u)}),t.setSelection(Fe.near(t.doc.resolve(i),n))}var Vu=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},IN=(t,e)=>{if(mh(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,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 ga(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=TN(c)+s;return i.forEach(f=>{if(u)return;const p=IN(d,f.find);if(!p)return;const h=a.state.tr,m=Ru({state:a.state,transaction:h}),y={from:r-(p[0].length-s.length),to:o},{commands:g,chain:k,can:w}=new Pu({editor:n,state:m});f.handler({state:m,range:y,match:p,commands:g,chain:k,can:w})===null||!h.steps.length||(f.undoable&&h.setMeta(l,{transform:h,from:r,to:o,text:s}),a.dispatch(h),u=!0)}),u}function RN(t){const{editor:e,rules:n}=t,r=new Rt({state:{init(){return null},apply(o,s,i){const l=o.getMeta(r);if(l)return l;const a=o.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=ph(le.from(c),i.schema);const{from:u}=a,d=u+c.length;ga({editor:e,from:u,to:d,text:c,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,i,l){return ga({editor:e,from:s,to:i,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&ga({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:i}=o.state.selection;return i?ga({editor:e,from:i.pos,to:i.pos,text:`
152
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function PN(t){return Object.prototype.toString.call(t).slice(8,-1)}function ya(t){return PN(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function sx(t,e){const n={...t};return ya(t)&&ya(e)&&Object.keys(e).forEach(r=>{ya(e[r])&&ya(t[r])?n[r]=sx(t[r],e[r]):n[r]=e[r]}),n}var bh=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...at(Oe(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...at(Oe(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>sx(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},xr=class ix extends bh{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new ix(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!s.find(l=>(l==null?void 0:l.type.name)===n.name))return!1;const i=s.find(l=>(l==null?void 0:l.type.name)===n.name);return i&&r.removeStoredMark(i),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function DN(t){return typeof t=="number"}var $N=class{constructor(t){this.find=t.find,this.handler=t.handler}},FN=(t,e,n)=>{if(mh(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const s=[o.text];return s.index=o.index,s.input=t,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(o.replaceWith)),s}):[]};function VN(t){const{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:l}=t,{commands:a,chain:c,can:u}=new Pu({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(f,p)=>{var h,m,y,g,k;if((m=(h=f.type)==null?void 0:h.spec)!=null&&m.code||!(f.isText||f.isTextblock||f.isInline))return;const w=(k=(g=(y=f.content)==null?void 0:y.size)!=null?g:f.nodeSize)!=null?k:0,b=Math.max(r,p),_=Math.min(o,p+w);if(b>=_)return;const M=f.isText?f.text||"":f.textBetween(b-p,_-p,void 0,"");FN(M,s.find,i).forEach(E=>{if(E.index===void 0)return;const I=b+E.index+1,F=I+E[0].length,R={from:n.tr.mapping.map(I),to:n.tr.mapping.map(F)},$=s.handler({state:n,range:R,match:E,commands:a,chain:c,can:u,pasteEvent:i,dropEvent:l});d.push($)})}),d.every(f=>f!==null)}var ba=null,BN=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function HN(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:c,from:u,to:d,rule:f,pasteEvt:p})=>{const h=c.tr,m=Ru({state:c,transaction:h});if(!(!VN({editor:e,state:m,from:Math.max(u-1,0),to:d.b-1,rule:f,pasteEvent:p,dropEvent:l})||!h.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,h}};return n.map(c=>new Rt({view(u){const d=p=>{var h;r=(h=u.dom.parentElement)!=null&&h.contains(p.target)?u.dom.parentElement:null,r&&(ba=e)},f=()=>{ba&&(ba=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(u,d)=>{if(s=r===u.dom.parentElement,l=d,!s){const f=ba;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(u,d)=>{var f;const p=(f=d.clipboardData)==null?void 0:f.getData("text/html");return i=d,o=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(u,d,f)=>{const p=u[0],h=p.getMeta("uiEvent")==="paste"&&!o,m=p.getMeta("uiEvent")==="drop"&&!s,y=p.getMeta("applyPasteRules"),g=!!y;if(!h&&!m&&!g)return;if(g){let{text:b}=y;typeof b=="string"?b=b:b=ph(le.from(b),f.schema);const{from:_}=y,M=_+b.length,E=BN(b);return a({rule:c,state:f,from:_,to:{b:M},pasteEvt:E})}const k=d.doc.content.findDiffStart(f.doc.content),w=d.doc.content.findDiffEnd(f.doc.content);if(!(!DN(k)||!w||k===w.b))return a({rule:c,state:f,from:k,to:w,pasteEvt:i})}}))}var Bu=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Jw(t),this.schema=xN(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Sd(e.name,this.schema)},r=Oe(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return hh([...this.extensions].reverse()).flatMap(e=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:Sd(e.name,this.schema)},r=[],o=Oe(e,"addKeyboardShortcuts",n);let s={};if(e.type==="mark"&&Oe(e,"exitable",n)&&(s.ArrowRight=()=>xr.handleExit({editor:t,mark:e})),o){const u=Object.fromEntries(Object.entries(o()).map(([d,f])=>[d,()=>f({editor:t})]));s={...s,...u}}const i=jO(s);r.push(i);const l=Oe(e,"addInputRules",n);if(L0(e,t.options.enableInputRules)&&l){const u=l();if(u&&u.length){const d=RN({editor:t,rules:u}),f=Array.isArray(d)?d:[d];r.push(...f)}}const a=Oe(e,"addPasteRules",n);if(L0(e,t.options.enablePasteRules)&&a){const u=a();if(u&&u.length){const d=HN({editor:t,rules:u});r.push(...d)}}const c=Oe(e,"addProseMirrorPlugins",n);if(c){const u=c();r.push(...u)}return r})}get attributes(){return qw(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Ol(this.extensions);return Object.fromEntries(e.filter(n=>!!Oe(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Xt(n.name,this.schema)},s=Oe(n,"addNodeView",o);if(!s)return[];const i=(l,a,c,u,d)=>{const f=Cc(l,r);return s()({node:l,view:a,getPos:c,decorations:u,innerDecorations:d,editor:t,extension:n,HTMLAttributes:f})};return[n.name,i]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Ol(this.extensions);return Object.fromEntries(e.filter(n=>!!Oe(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:fo(n.name,this.schema)},s=Oe(n,"addMarkView",o);if(!s)return[];const i=(l,a,c)=>{const u=Cc(l,r);return s()({mark:l,view:a,inline:c,editor:t,extension:n,HTMLAttributes:u,updateAttributes:d=>{nI(l,t,d)}})};return[n.name,i]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Sd(e.name,this.schema)};e.type==="mark"&&((n=at(Oe(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const o=Oe(e,"onBeforeCreate",r),s=Oe(e,"onCreate",r),i=Oe(e,"onUpdate",r),l=Oe(e,"onSelectionUpdate",r),a=Oe(e,"onTransaction",r),c=Oe(e,"onFocus",r),u=Oe(e,"onBlur",r),d=Oe(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),i&&this.editor.on("update",i),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}};Bu.resolve=Jw;Bu.sort=hh;Bu.flatten=fh;var jN={};zw(jN,{ClipboardTextSerializer:()=>ax,Commands:()=>dx,Delete:()=>fx,Drop:()=>px,Editable:()=>hx,FocusEvents:()=>gx,Keymap:()=>yx,Paste:()=>bx,Tabindex:()=>vx,focusEventsPluginKey:()=>mx});var bt=class lx extends bh{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new lx(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},ax=bt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Rt({key:new Kt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:s}=o,i=Math.min(...s.map(c=>c.$from.pos)),l=Math.max(...s.map(c=>c.$to.pos)),a=Xw(n);return Yw(r,{from:i,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),cx={};zw(cx,{blur:()=>zN,clearContent:()=>UN,clearNodes:()=>WN,command:()=>KN,createParagraphNear:()=>GN,cut:()=>qN,deleteCurrentNode:()=>JN,deleteNode:()=>YN,deleteRange:()=>XN,deleteSelection:()=>ZN,enter:()=>QN,exitCode:()=>e4,extendMarkRange:()=>t4,first:()=>n4,focus:()=>o4,forEach:()=>s4,insertContent:()=>i4,insertContentAt:()=>a4,joinBackward:()=>d4,joinDown:()=>u4,joinForward:()=>f4,joinItemBackward:()=>p4,joinItemForward:()=>h4,joinTextblockBackward:()=>m4,joinTextblockForward:()=>g4,joinUp:()=>c4,keyboardShortcut:()=>b4,lift:()=>v4,liftEmptyBlock:()=>w4,liftListItem:()=>x4,newlineInCode:()=>k4,resetAttributes:()=>_4,scrollIntoView:()=>C4,selectAll:()=>E4,selectNodeBackward:()=>S4,selectNodeForward:()=>M4,selectParentNode:()=>T4,selectTextblockEnd:()=>A4,selectTextblockStart:()=>L4,setContent:()=>O4,setMark:()=>I4,setMeta:()=>R4,setNode:()=>P4,setNodeSelection:()=>D4,setTextSelection:()=>$4,sinkListItem:()=>F4,splitBlock:()=>V4,splitListItem:()=>B4,toggleList:()=>H4,toggleMark:()=>j4,toggleNode:()=>z4,toggleWrap:()=>U4,undoInputRule:()=>W4,unsetAllMarks:()=>K4,unsetMark:()=>G4,updateAttributes:()=>q4,wrapIn:()=>J4,wrapInList:()=>Y4});var zN=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),UN=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),WN=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:i})=>{t.doc.nodesBetween(s.pos,i.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),p=d.blockRange(f);if(!p)return;const h=Si(p);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},KN=t=>e=>t(e),GN=()=>({state:t,dispatch:e})=>tN(t,e),qN=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const i=r.mapping.map(e);return r.insert(i,s.content),r.setSelection(new Ie(r.doc.resolve(Math.max(i-1,0)))),!0},JN=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const i=o.before(s),l=o.after(s);t.delete(i,l).scrollIntoView()}return!0}return!1},YN=t=>({tr:e,state:n,dispatch:r})=>{const o=Xt(t,n.schema),s=e.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o){if(r){const l=s.before(i),a=s.after(i);e.delete(l,a).scrollIntoView()}return!0}return!1},XN=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},ZN=()=>({state:t,dispatch:e})=>zO(t,e),QN=()=>({commands:t})=>t.keyboardShortcut("Enter"),e4=()=>({state:t,dispatch:e})=>eN(t,e),t4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const s=fo(t,r.schema),{doc:i,selection:l}=n,{$from:a,from:c,to:u}=l;if(o){const d=gh(a,s,e);if(d&&d.from<=c&&d.to>=u){const f=Ie.create(i,d.from,d.to);n.setSelection(f)}}return!0},n4=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function r4(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function vh(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var o4=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(vh()||r4())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!rx(n.state.selection))return i(),!0;const l=ox(o.doc,t)||n.state.selection,a=n.state.selection.eq(l);return s&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},s4=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),i4=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),l4=t=>!("type"in t),a4=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{var i;if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const a=m=>{s.emit("contentError",{editor:s,error:m,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Ll(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(m){a(m)}try{l=Ll(e,s.schema,{parseOptions:c,errorOnInvalidContent:(i=n.errorOnInvalidContent)!=null?i:s.options.enableContentCheck})}catch(m){return a(m),!1}let{from:u,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;if((l4(l)?l:[l]).forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,p=p?m.isBlock:!1}),u===d&&p){const{parent:m}=r.doc.resolve(u);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,d+=1)}let h;if(f){if(Array.isArray(e))h=e.map(m=>m.text||"").join("");else if(e instanceof le){let m="";e.forEach(y=>{y.text&&(m+=y.text)}),h=m}else typeof e=="object"&&e&&e.text?h=e.text:h=e;r.insertText(h,u,d)}else{h=l;const m=r.doc.resolve(u),y=m.node(),g=m.parentOffset===0,k=y.isText||y.isTextblock,w=y.content.size>0;g&&k&&w&&(u=Math.max(0,u-1)),r.replaceWith(u,d,h)}n.updateSelection&&NN(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:h})}return!0},c4=()=>({state:t,dispatch:e})=>YO(t,e),u4=()=>({state:t,dispatch:e})=>XO(t,e),d4=()=>({state:t,dispatch:e})=>UO(t,e),f4=()=>({state:t,dispatch:e})=>qO(t,e),p4=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Tu(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},h4=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Tu(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},m4=()=>({state:t,dispatch:e})=>WO(t,e),g4=()=>({state:t,dispatch:e})=>KO(t,e);function ux(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function y4(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))vh()||ux()?i=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var b4=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=y4(t).split(/-(?!$)/),i=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0},v4=(t,e={})=>({state:n,dispatch:r})=>{const o=Xt(t,n.schema);return Ko(n,o,e)?ZO(n,r):!1},w4=()=>({state:t,dispatch:e})=>nN(t,e),x4=t=>({state:e,dispatch:n})=>{const r=Xt(t,e.schema);return dN(r)(e,n)},k4=()=>({state:t,dispatch:e})=>QO(t,e);function N0(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var _4=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=$u(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=Xt(t,r.schema)),l==="mark"&&(i=fo(t,r.schema)),o&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{s&&s===c.type&&n.setNodeMarkup(u,void 0,N0(c.attrs,e)),i&&c.marks.length&&c.marks.forEach(d=>{i===d.type&&n.addMark(u,u+c.nodeSize,i.create(N0(d.attrs,e)))})})}),!0):!1},C4=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),E4=()=>({tr:t,dispatch:e})=>{if(e){const n=new ir(t.doc);t.setSelection(n)}return!0},S4=()=>({state:t,dispatch:e})=>GO(t,e),M4=()=>({state:t,dispatch:e})=>JO(t,e),T4=()=>({state:t,dispatch:e})=>rN(t,e),A4=()=>({state:t,dispatch:e})=>iN(t,e),L4=()=>({state:t,dispatch:e})=>sN(t,e),O4=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:i,commands:l})=>{const{doc:a}=s;if(r.preserveWhitespace!=="full"){const c=Ff(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return i&&s.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!n),!0}return i&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function N4(t,e,n){var r;const{selection:o}=e;let s=null;if(rx(o)&&(s=o.$cursor),s){const l=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(a=>a.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:l,$to:a})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(n));c=p&&h}return!c}),c})}var I4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:l}=s,a=fo(t,r.schema);if(o)if(i){const c=Zw(r,a);n.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{const h=Math.max(p,u),m=Math.min(p+f.nodeSize,d);f.marks.find(y=>y.type===a)?f.marks.forEach(y=>{a===y.type&&n.addMark(h,m,a.create({...y.attrs,...e}))}):n.addMark(h,m,a.create(e))})});return N4(r,n,a)},R4=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),P4=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=Xt(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:l})=>S0(s,{...i,...e})(n)?!0:l.clearNodes()).command(({state:l})=>S0(s,{...i,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},D4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=fs(t,0,r.content.size),s=Ne.create(r,o);e.setSelection(s)}return!0},$4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,i=Ie.atStart(r).from,l=Ie.atEnd(r).to,a=fs(o,i,l),c=fs(s,i,l),u=Ie.create(r,a,c);e.setSelection(u)}return!0},F4=t=>({state:e,dispatch:n})=>{const r=Xt(t,e.schema);return hN(r)(e,n)};function I0(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}var V4=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:l,$to:a}=s,c=o.extensionManager.attributes,u=Ha(c,l.node().type.name,l.node().attrs);if(s instanceof Ne&&s.node.isBlock)return!l.parentOffset||!ii(i,l.pos)?!1:(r&&(t&&I0(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:yN(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=d&&f?[{type:f,attrs:u}]:void 0,h=ii(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!h&&ii(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(h&&(s instanceof Ie&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const m=e.mapping.map(l.before()),y=e.doc.resolve(m);l.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}t&&I0(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return h},B4=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const l=Xt(t,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const d=a.node(-1);if(d.type!==l)return!1;const f=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let g=le.empty;const k=a.index(-1)?1:a.index(-2)?2:3;for(let I=a.depth-k;I>=a.depth-3;I-=1)g=le.from(a.node(I).copy(g));const w=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,b={...Ha(f,a.node().type.name,a.node().attrs),...e},_=((i=l.contentMatch.defaultType)==null?void 0:i.createAndFill(b))||void 0;g=g.append(le.from(l.createAndFill(null,_)||void 0));const M=a.before(a.depth-(k-1));n.replace(M,a.after(-w),new ke(g,4-k,0));let E=-1;n.doc.nodesBetween(M,n.doc.content.size,(I,F)=>{if(E>-1)return!1;I.isTextblock&&I.content.size===0&&(E=F+1)}),E>-1&&n.setSelection(Ie.near(n.doc.resolve(E))),n.scrollIntoView()}return!0}const p=c.pos===a.end()?d.contentMatchAt(0).defaultType:null,h={...Ha(f,d.type.name,d.attrs),...e},m={...Ha(f,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,c.pos);const y=p?[{type:l,attrs:h},{type:p,attrs:m}]:[{type:l,attrs:h}];if(!ii(n.doc,a.pos,2))return!1;if(o){const{selection:g,storedMarks:k}=r,{splittableMarks:w}=s.extensionManager,b=k||g.$to.parentOffset&&g.$from.marks();if(n.split(a.pos,2,y).scrollIntoView(),!b||!o)return!0;const _=b.filter(M=>w.includes(M.type.name));n.ensureMarks(_)}return!0},Md=(t,e)=>{const n=Du(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Xo(t.doc,n.pos)&&t.join(n.pos),!0},Td=(t,e)=>{const n=Du(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Xo(t.doc,r)&&t.join(r),!0},H4=(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=o.extensionManager,p=Xt(t,i.schema),h=Xt(e,i.schema),{selection:m,storedMarks:y}=i,{$from:g,$to:k}=m,w=g.blockRange(k),b=y||m.$to.parentOffset&&m.$from.marks();if(!w)return!1;const _=Du(M=>O0(M.type.name,d))(m);if(w.depth>=1&&_&&w.depth-_.depth<=1){if(_.node.type===p)return c.liftListItem(h);if(O0(_.node.type.name,d)&&p.validContent(_.node.content)&&l)return a().command(()=>(s.setNodeMarkup(_.pos,p),!0)).command(()=>Md(s,p)).command(()=>Td(s,p)).run()}return!n||!b||!l?a().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>Md(s,p)).command(()=>Td(s,p)).run():a().command(()=>{const M=u().wrapInList(p,r),E=b.filter(I=>f.includes(I.type.name));return s.ensureMarks(E),M?!0:c.clearNodes()}).wrapInList(p,r).command(()=>Md(s,p)).command(()=>Td(s,p)).run()},j4=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=fo(t,r.schema);return Vf(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},z4=(t,e,n={})=>({state:r,commands:o})=>{const s=Xt(t,r.schema),i=Xt(e,r.schema),l=Ko(r,s,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?o.setNode(i,a):o.setNode(s,{...a,...n})},U4=(t,e={})=>({state:n,commands:r})=>{const o=Xt(t,n.schema);return Ko(n,o,e)?r.lift(o):r.wrapIn(o,e)},W4=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const i=t.tr,l=s.transform;for(let a=l.steps.length-1;a>=0;a-=1)i.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=i.doc.resolve(s.from).marks();i.replaceWith(s.from,s.to,t.schema.text(s.text,a))}else i.delete(s.from,s.to)}return!0}}return!1},K4=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},G4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:l}=n,a=fo(t,r.schema),{$from:c,empty:u,ranges:d}=l;if(!o)return!0;if(u&&i){let{from:f,to:p}=l;const h=(s=c.marks().find(y=>y.type===a))==null?void 0:s.attrs,m=gh(c,a,h);m&&(f=m.from,p=m.to),n.removeMark(f,p,a)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},q4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=$u(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=Xt(t,r.schema)),l==="mark"&&(i=fo(t,r.schema)),o&&n.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;let d,f,p,h;n.selection.empty?r.doc.nodesBetween(c,u,(m,y)=>{s&&s===m.type&&(p=Math.max(y,c),h=Math.min(y+m.nodeSize,u),d=y,f=m)}):r.doc.nodesBetween(c,u,(m,y)=>{y<c&&s&&s===m.type&&(p=Math.max(y,c),h=Math.min(y+m.nodeSize,u),d=y,f=m),y>=c&&y<=u&&(s&&s===m.type&&n.setNodeMarkup(y,void 0,{...m.attrs,...e}),i&&m.marks.length&&m.marks.forEach(g=>{if(i===g.type){const k=Math.max(y,c),w=Math.min(y+m.nodeSize,u);n.addMark(k,w,i.create({...g.attrs,...e}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),i&&f.marks.length&&f.marks.forEach(m=>{i===m.type&&n.addMark(p,h,i.create({...m.attrs,...e}))}))}),!0):!1},J4=(t,e={})=>({state:n,dispatch:r})=>{const o=Xt(t,n.schema);return lN(o,e)(n,r)},Y4=(t,e={})=>({state:n,dispatch:r})=>{const o=Xt(t,n.schema);return aN(o,e)(n,r)},dx=bt.create({name:"commands",addCommands(){return{...cx}}}),fx=bt.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const s=()=>{var i,l,a,c;if((c=(a=(l=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,t))!=null?c:t.getMeta("y-sync$"))return;const u=Uw(t.before,[t,...e]);ex(u).forEach(f=>{u.mapping.mapResult(f.oldRange.from).deletedAfter&&u.mapping.mapResult(f.oldRange.to).deletedBefore&&u.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,h)=>{const m=h+p.nodeSize-2,y=f.oldRange.from<=h&&m<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:h,to:m,newFrom:u.mapping.map(h),newTo:u.mapping.map(m),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:t,combinedTransform:u})})});const d=u.mapping;u.steps.forEach((f,p)=>{var h,m;if(f instanceof hr){const y=d.slice(p).map(f.from,-1),g=d.slice(p).map(f.to),k=d.invert().map(y,-1),w=d.invert().map(g),b=(h=u.doc.nodeAt(y-1))==null?void 0:h.marks.some(M=>M.eq(f.mark)),_=(m=u.doc.nodeAt(g))==null?void 0:m.marks.some(M=>M.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:k,to:w},newRange:{from:y,to:g},partial:!!(_||b),editor:this.editor,transaction:t,combinedTransform:u})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(s,0):s()}}),px=bt.create({name:"drop",addProseMirrorPlugins(){return[new Rt({key:new Kt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),hx=bt.create({name:"editable",addProseMirrorPlugins(){return[new Rt({key:new Kt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),mx=new Kt("focusEvents"),gx=bt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Rt({key:mx,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),yx=bt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:i})=>{const{selection:l,doc:a}=i,{empty:c,$anchor:u}=l,{pos:d,parent:f}=u,p=u.parent.isTextblock&&d>0?i.doc.resolve(d-1):u,h=p.parent.type.spec.isolating,m=u.pos-u.parentOffset,y=h&&p.parent.childCount===1?m===u.pos:Fe.atStart(a).from===d;return!c||!f.type.isTextblock||f.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return vh()||ux()?o:r},addProseMirrorPlugins(){return[new Rt({key:new Kt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(p=>p.getMeta("composition")))return;const r=t.some(p=>p.docChanged)&&!e.doc.eq(n.doc),o=t.some(p=>p.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:i,to:l}=e.selection,a=Fe.atStart(e.doc).from,c=Fe.atEnd(e.doc).to;if(s||!(i===a&&l===c)||!Fu(n.doc))return;const u=n.tr,d=Ru({state:n,transaction:u}),{commands:f}=new Pu({editor:this.editor,state:d});if(f.clearNodes(),!!u.steps.length)return u}})]}}),bx=bt.create({name:"paste",addProseMirrorPlugins(){return[new Rt({key:new Kt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),vx=bt.create({name:"tabindex",addProseMirrorPlugins(){return[new Rt({key:new Kt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),X4=class Ks{constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=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}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},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?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Ks(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Ks(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Ks(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,i=this.pos+r+(s?0:1);if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(i);if(!o&&l.depth<=this.depth)return;const a=new Ks(l,this.editor,o,o?n:null);o&&(a.actualDepth=this.depth+1),e.push(new Ks(l,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const s=o.node.attrs,i=Object.keys(n);for(let l=0;l<i.length;l+=1){const a=i[l];if(s[a]!==n[a])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const s=Object.keys(n);return this.children.forEach(i=>{r&&o.length>0||(i.node.type.name===e&&s.every(l=>n[l]===i.node.attrs[l])&&o.push(i),!(r&&o.length>0)&&(o=o.concat(i.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},Z4=`.ProseMirror {
153
- position: relative;
154
- }
155
-
156
- .ProseMirror {
157
- word-wrap: break-word;
158
- white-space: pre-wrap;
159
- white-space: break-spaces;
160
- -webkit-font-variant-ligatures: none;
161
- font-variant-ligatures: none;
162
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
163
- }
164
-
165
- .ProseMirror [contenteditable="false"] {
166
- white-space: normal;
167
- }
168
-
169
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
170
- white-space: pre-wrap;
171
- }
172
-
173
- .ProseMirror pre {
174
- white-space: pre-wrap;
175
- }
176
-
177
- img.ProseMirror-separator {
178
- display: inline !important;
179
- border: none !important;
180
- margin: 0 !important;
181
- width: 0 !important;
182
- height: 0 !important;
183
- }
184
-
185
- .ProseMirror-gapcursor {
186
- display: none;
187
- pointer-events: none;
188
- position: absolute;
189
- margin: 0;
190
- }
191
-
192
- .ProseMirror-gapcursor:after {
193
- content: "";
194
- display: block;
195
- position: absolute;
196
- top: -2px;
197
- width: 20px;
198
- border-top: 1px solid black;
199
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
200
- }
201
-
202
- @keyframes ProseMirror-cursor-blink {
203
- to {
204
- visibility: hidden;
205
- }
206
- }
207
-
208
- .ProseMirror-hideselection *::selection {
209
- background: transparent;
210
- }
211
-
212
- .ProseMirror-hideselection *::-moz-selection {
213
- background: transparent;
214
- }
215
-
216
- .ProseMirror-hideselection * {
217
- caret-color: transparent;
218
- }
219
-
220
- .ProseMirror-focused .ProseMirror-gapcursor {
221
- display: block;
222
- }`;function Q4(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}var eI=class extends gN{constructor(t={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!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:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),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:r,slice:o,moved:s})=>this.options.onDrop(r,o,s)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=ox(e,this.options.autofocus);this.editorState=Ys.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Q4(Z4,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&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:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=Gw(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;n=n.filter(i=>!i.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[hx,ax.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),dx,gx,yx,vx,px,bx,fx].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Bu(n,this)}createCommandManager(){this.commandManager=new Pu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Ff(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;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(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Ff(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new Dw(t,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),o=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=i==null?void 0:i.getMeta("focus"),a=i==null?void 0:i.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:i}),a&&this.emit("blur",{editor:this,event:a.event,transaction:i}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return Qw(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return AN(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ph(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
223
-
224
- `,textSerializers:n={}}=t||{};return _N(this.state.doc,{blockSeparator:e,textSerializers:{...Xw(this.schema),...n}})}get isEmpty(){return Fu(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new X4(e,this)}get $doc(){return this.$pos(0)}};function As(t){return new Vu({find:t.find,handler:({state:e,range:n,match:r})=>{const o=at(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],l=r[0];if(i){const a=l.search(/\S/),c=n.from+l.indexOf(i),u=c+i.length;if(yh(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(p=>p===t.type&&p!==f.mark.type)).filter(f=>f.to>c).length)return null;u<n.to&&s.delete(u,n.to),c>n.from&&s.delete(n.from+a,c);const d=n.from+a+i.length;s.addMark(n.from+a,d,t.type.create(o||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function wx(t){return new Vu({find:t.find,handler:({state:e,range:n,match:r})=>{const o=at(t.getAttributes,void 0,r)||{},{tr:s}=e,i=n.from;let l=n.to;const a=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=i+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];s.insertText(d,i+r[0].length-1),s.replaceWith(u,l,a)}else if(r[0]){const c=t.type.isInline?i:i-1;s.insert(c,t.type.create(o)).delete(s.mapping.map(i),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function Bf(t){return new Vu({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=at(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function wi(t){return new Vu({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const s=at(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),l=i.doc.resolve(n.from).blockRange(),a=l&&Xp(l,t.type,s);if(!a)return null;if(i.wrap(l,a),t.keepMarks&&t.editor){const{selection:u,storedMarks:d}=e,{splittableMarks:f}=t.editor.extensionManager,p=d||u.$to.parentOffset&&u.$from.marks();if(p){const h=p.filter(m=>f.includes(m.type.name));i.ensureMarks(h)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(u,s).run()}const c=i.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&Xo(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&i.join(n.from-1)},undoable:t.undoable})}function tI(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof Ne){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let o=r.depth;for(;o>=0;){const s=r.index(o);if(r.node(o).contentMatchAt(s).matchType(e))return!0;o-=1}return!1}function nI(t,e,n={}){const{state:r}=e,{doc:o,tr:s}=r,i=t;o.descendants((l,a)=>{const c=s.mapping.map(a),u=s.mapping.map(a)+l.nodeSize;let d=null;if(l.marks.forEach(p=>{if(p!==i)return!1;d=p}),!d)return;let f=!1;if(Object.keys(n).forEach(p=>{n[p]!==d.attrs[p]&&(f=!0)}),f){const p=t.type.create({...t.attrs,...n});s.removeMark(c,u,t.type),s.addMark(c,u,p)}}),s.docChanged&&e.view.dispatch(s)}var nn=class xx extends bh{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new xx(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Go(t){return new $N({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const s=at(t.getAttributes,void 0,r,o);if(s===!1||s===null)return null;const{tr:i}=e,l=r[r.length-1],a=r[0];let c=n.to;if(l){const u=a.search(/\S/),d=n.from+a.indexOf(l),f=d+l.length;if(yh(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(h=>h===t.type&&h!==p.mark.type)).filter(p=>p.to>d).length)return null;f<n.to&&i.delete(f,n.to),d>n.from&&i.delete(n.from+u,d),c=n.from+u+l.length,i.addMark(n.from+u,c,t.type.create(s||{})),i.removeStoredMark(t.type)}}})}function R0(t){return Sb((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var rI=class extends eI{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=R0(this.view.state),this.reactiveExtensionStorage=R0(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),_b(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){const n=super.registerPlugin(t,e);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(t){const e=super.unregisterPlugin(t);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},kx=_e({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=Q(),n=St();return sv(()=>{const r=t.editor;r&&r.options.element&&e.value&&zt(()=>{var o;if(!e.value||!((o=r.view.dom)!=null&&o.firstChild))return;const s=me(e.value);e.value.append(r.view.dom),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:s}),r.createNodeViews()})}),uo(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return Bn("div",{ref:t=>{this.rootEl=t}})}}),oI=(t={})=>{const e=Hl();return rt(()=>{e.value=new rI(t)}),uo(()=>{var n,r,o;const s=(n=e.value)==null?void 0:n.view.dom,i=s==null?void 0:s.cloneNode(!0);(r=s==null?void 0:s.parentNode)==null||r.replaceChild(i,s),(o=e.value)==null||o.destroy()}),e},sI=20,_x=(t,e=0)=>{const n=[];return!t.children.length||e>sI||Array.from(t.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(..._x(r,e+1))}),n},iI=t=>{if(!t.children.length)return;_x(t).forEach(n=>{var r,o;const s=n.getAttribute("style"),i=(o=(r=n.parentElement)==null?void 0:r.closest("span"))==null?void 0:o.getAttribute("style");n.setAttribute("style",`${i};${s}`)})},wh=xr.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&iI(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(s=>!!s))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),lI=bt.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const r=n.split(";").map(o=>o.trim()).filter(Boolean);for(let o=r.length-1;o>=0;o-=1){const s=r[o].split(":");if(s.length>=2){const i=s[0].trim().toLowerCase(),l=s.slice(1).join(":").trim();if(i==="background-color")return l.replace(/['"]+/g,"")}}}return(e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),aI=bt.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const n=t.getAttribute("style");if(n){const r=n.split(";").map(o=>o.trim()).filter(Boolean);for(let o=r.length-1;o>=0;o-=1){const s=r[o].split(":");if(s.length>=2){const i=s[0].trim().toLowerCase(),l=s.slice(1).join(":").trim();if(i==="color")return l.replace(/['"]+/g,"")}}}return(e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),cI=bt.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),uI=bt.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),dI=bt.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}}),fI=bt.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(lI.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(aI.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(cI.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(uI.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(dI.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(wh.configure(this.options.textStyle)),t}}),Hf,jf;if(typeof WeakMap<"u"){let t=new WeakMap;Hf=e=>t.get(e),jf=(e,n)=>(t.set(e,n),n)}else{const t=[];let e=0;Hf=n=>{for(let r=0;r<t.length;r+=2)if(t[r]==n)return t[r+1]},jf=(n,r)=>(e==10&&(e=0),t[e++]=n,t[e++]=r)}var Bt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let s=r+1,i=o+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;i<this.height&&this.map[e+this.width*l]==n;l++)i++;return{left:r,top:o,right:s,bottom:i}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:s,bottom:i}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(n<0?s==0:i==this.height)?null:this.map[r+this.width*(n<0?s-1:i)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:s}=this.findCell(t),{left:i,right:l,top:a,bottom:c}=this.findCell(e);return{left:Math.min(n,i),top:Math.min(o,a),right:Math.max(r,l),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const s=r*this.width+o,i=this.map[s];n[i]||(n[i]=!0,!(o==t.left&&o&&this.map[s-1]==i||r==t.top&&r&&this.map[s-this.width]==i)&&e.push(i))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const s=o+n.child(r).nodeSize;if(r==t){let i=e+t*this.width;const l=(t+1)*this.width;for(;i<l&&this.map[i]<o;)i++;return i==l?s-1:this.map[i]}o=s}}static get(t){return Hf(t)||jf(t,pI(t))}};function pI(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=hI(t),n=t.childCount,r=[];let o=0,s=null;const i=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let h=0;;h++){for(;o<r.length&&r[o]!=0;)o++;if(h==d.childCount)break;const m=d.child(h),{colspan:y,rowspan:g,colwidth:k}=m.attrs;for(let w=0;w<g;w++){if(w+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:g-w});break}const b=o+w*e;for(let _=0;_<y;_++){r[b+_]==0?r[b+_]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:y-_});const M=k&&k[_];if(M){const E=(b+_)%e*2,I=i[E];I==null||I!=M&&i[E+1]==1?(i[E]=M,i[E+1]=1):I==M&&i[E+1]++}}}o+=y,u+=m.nodeSize}const f=(c+1)*e;let p=0;for(;o<f;)r[o++]==0&&p++;p&&(s||(s=[])).push({type:"missing",row:c,n:p}),u++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new Bt(e,n,r,s);let a=!1;for(let c=0;!a&&c<i.length;c+=2)i[c]!=null&&i[c+1]<n&&(a=!0);return a&&mI(l,i,t),l}function hI(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let s=0;if(n)for(let i=0;i<r;i++){const l=t.child(i);for(let a=0;a<l.childCount;a++){const c=l.child(a);i+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let i=0;i<o.childCount;i++){const l=o.child(i);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function mI(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];if(r[s])continue;r[s]=!0;const i=n.nodeAt(s);if(!i)throw new RangeError(`No cell with offset ${s} found`);let l=null;const a=i.attrs;for(let c=0;c<a.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!a.colwidth||a.colwidth[c]!=d)&&((l||(l=gI(a)))[c]=d)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function gI(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function En(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var Mo=new Kt("selectingCells");function Mi(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function yI(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function kr(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Hu(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Mi(e.$head)||bI(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function bI(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function zf(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function vI(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function xh(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Cx(t,e,n){const r=t.node(-1),o=Bt.get(r),s=t.start(-1),i=o.nextCell(t.pos-s,e,n);return i==null?null:t.node(0).resolve(s+i)}function Ls(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function Ex(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function wI(t,e,n){const r=En(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Ct=class Ur extends Fe{constructor(e,n=e){const r=e.node(-1),o=Bt.get(r),s=e.start(-1),i=o.rectBetween(e.pos-s,n.pos-s),l=e.node(0),a=o.cellsInRect(i).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=s+u+1;return new ew(l.resolve(f),l.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(zf(r)&&zf(o)&&xh(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Ur.rowSelection(r,o):s&&this.isColSelection()?Ur.colSelection(r,o):new Ur(r,o)}return Ie.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=Bt.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},i=[];for(let a=o.top;a<o.bottom;a++){const c=[];for(let u=a*n.width+o.left,d=o.left;d<o.right;d++,u++){const f=n.map[u];if(s[f])continue;s[f]=!0;const p=n.findCell(f);let h=e.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);const m=o.left-p.left,y=p.right-o.right;if(m>0||y>0){let g=h.attrs;if(m>0&&(g=Ls(g,0,m)),y>0&&(g=Ls(g,g.colspan-y,y)),p.left<o.left){if(h=h.type.createAndFill(g),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else h=h.type.create(g,h.content)}if(p.top<o.top||p.bottom>o.bottom){const g={...h.attrs,rowspan:Math.min(p.bottom,o.bottom)-Math.max(p.top,o.top)};p.top<o.top?h=h.type.createAndFill(g):h=h.type.create(g,h.content)}c.push(h)}i.push(e.child(a).copy(le.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:i;return new ke(le.from(l),1,1)}replace(e,n=ke.empty){const r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){const{$from:l,$to:a}=o[i],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(a.pos),i?ke.empty:n)}const s=Fe.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new ke(le.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Bt.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let i=0;i<s.length;i++)e(n.nodeAt(s[i]),o+s[i])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=Bt.get(r),s=e.start(-1),i=o.findCell(e.pos-s),l=o.findCell(n.pos-s),a=e.node(0);return i.top<=l.top?(i.top>0&&(e=a.resolve(s+o.map[i.left])),l.bottom<o.height&&(n=a.resolve(s+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(s+o.map[l.left])),i.bottom<o.height&&(e=a.resolve(s+o.map[o.width*(o.height-1)+i.right-1]))),new Ur(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Bt.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const i=o+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,l)==n.width}eq(e){return e instanceof Ur&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=Bt.get(r),s=e.start(-1),i=o.findCell(e.pos-s),l=o.findCell(n.pos-s),a=e.node(0);return i.left<=l.left?(i.left>0&&(e=a.resolve(s+o.map[i.top*o.width])),l.right<o.width&&(n=a.resolve(s+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(s+o.map[l.top*o.width])),i.right<o.width&&(e=a.resolve(s+o.map[o.width*(i.top+1)-1]))),new Ur(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Ur(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Ur(e.resolve(n),e.resolve(r))}getBookmark(){return new xI(this.$anchorCell.pos,this.$headCell.pos)}};Ct.prototype.visible=!1;Fe.jsonID("cell",Ct);var xI=class Sx{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Sx(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&xh(n,r)?new Ct(n,r):Fe.near(r,1)}};function kI(t){if(!(t.selection instanceof Ct))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(on.node(r,r+n.nodeSize,{class:"selectedCell"}))}),_t.create(t.doc,e)}function _I({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function CI({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function EI(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,i;if(r instanceof Ne&&(i=r.node.type.spec.tableRole)){if(i=="cell"||i=="header_cell")s=Ct.create(o,r.from);else if(i=="row"){const l=o.resolve(r.from+1);s=Ct.rowSelection(l,l)}else if(!n){const l=Bt.get(r.node),a=r.from+1,c=a+l.map[l.width*l.height-1];s=Ct.create(o,a+1,c)}}else r instanceof Ie&&_I(r)?s=Ie.create(o,r.from):r instanceof Ie&&CI(r)&&(s=Ie.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var SI=new Kt("fix-tables");function Mx(t,e,n,r){const o=t.childCount,s=e.childCount;e:for(let i=0,l=0;i<s;i++){const a=e.child(i);for(let c=l,u=Math.min(o,i+3);c<u;c++)if(t.child(c)==a){l=c+1,n+=a.nodeSize;continue e}r(a,n),l<o&&t.child(l).sameMarkup(a)?Mx(t.child(l),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Tx(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=MI(t,o,s,n))};return e?e.doc!=t.doc&&Mx(e.doc,t.doc,0,r):t.doc.descendants(r),n}function MI(t,e,n,r){const o=Bt.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let a=0;a<o.height;a++)s.push(0);for(let a=0;a<o.problems.length;a++){const c=o.problems[a];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)s[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Ls(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+e.nodeSize)}}let i,l;for(let a=0;a<s.length;a++)s[a]&&(i==null&&(i=a),l=a);for(let a=0,c=n+1;a<o.height;a++){const u=e.child(a),d=c+u.nodeSize,f=s[a];if(f>0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);const h=[];for(let y=0;y<f;y++){const g=En(t.schema)[p].createAndFill();g&&h.push(g)}const m=(a==0||i==a-1)&&l==a?c+1:d-1;r.insert(r.mapping.map(m),h)}c=d}return r.setMeta(SI,{fixTables:!0})}function Dr(t){const e=t.selection,n=Hu(t),r=n.node(-1),o=n.start(-1),s=Bt.get(r);return{...e instanceof Ct?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function Ax(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;wI(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let i=0;i<e.height;i++){const l=i*e.width+o;if(o>0&&o<e.width&&e.map[l-1]==e.map[l]){const a=e.map[l],c=r.nodeAt(a);t.setNodeMarkup(t.mapping.map(n+a),null,Ex(c.attrs,o-e.colCount(a))),i+=c.attrs.rowspan-1}else{const a=s==null?En(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(i,o,r);t.insert(t.mapping.map(n+c),a.createAndFill())}}return t}function TI(t,e){if(!kr(t))return!1;if(e){const n=Dr(t);e(Ax(t.tr,n,n.left))}return!0}function AI(t,e){if(!kr(t))return!1;if(e){const n=Dr(t);e(Ax(t.tr,n,n.right))}return!0}function LI(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let i=0;i<e.height;){const l=i*e.width+o,a=e.map[l],c=n.nodeAt(a),u=c.attrs;if(o>0&&e.map[l-1]==a||o<e.width-1&&e.map[l+1]==a)t.setNodeMarkup(t.mapping.slice(s).map(r+a),null,Ls(u,o-e.colCount(a)));else{const d=t.mapping.slice(s).map(r+a);t.delete(d,d+c.nodeSize)}i+=u.rowspan}}function OI(t,e){if(!kr(t))return!1;if(e){const n=Dr(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;LI(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=Bt.get(s)}e(r)}return!0}function NI(t,e,n){var r;const o=En(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function Lx(t,{map:e,tableStart:n,table:r},o){var s;let i=n;for(let c=0;c<o;c++)i+=r.child(c).nodeSize;const l=[];let a=o>0?-1:0;NI(e,r,o+a)&&(a=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],f=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{const d=a==null?En(r.type.schema).cell:(s=r.nodeAt(e.map[u+a*e.width]))==null?void 0:s.type,f=d==null?void 0:d.createAndFill();f&&l.push(f)}return t.insert(i,En(r.type.schema).row.create(null,l)),t}function II(t,e){if(!kr(t))return!1;if(e){const n=Dr(t);e(Lx(t.tr,n,n.top))}return!0}function RI(t,e){if(!kr(t))return!1;if(e){const n=Dr(t);e(Lx(t.tr,n,n.bottom))}return!0}function PI(t,{map:e,table:n,tableStart:r},o){let s=0;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;const i=s+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(s+r,i+r);const a=new Set;for(let c=0,u=o*e.width;c<e.width;c++,u++){const d=e.map[u];if(!a.has(d)){if(a.add(d),o>0&&d==e.map[u-e.width]){const f=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1}else if(o<e.height&&d==e.map[u+e.width]){const f=n.nodeAt(d),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(l).map(r+m),h),c+=p.colspan-1}}}}function DI(t,e){if(!kr(t))return!1;if(e){const n=Dr(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;PI(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=Bt.get(n.table)}e(r)}return!0}function P0(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function $I({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,i=(r.bottom-1)*t+r.left,l=o+(r.right-r.left-1);for(let a=r.top;a<r.bottom;a++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[l]==n[l+1])return!0;s+=t,l+=t}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[i]==n[i+t])return!0;o++,i++}return!1}function D0(t,e){const n=t.selection;if(!(n instanceof Ct)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Dr(t),{map:o}=r;if($I(o,r))return!1;if(e){const s=t.tr,i={};let l=le.empty,a,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=o.map[u*o.width+d],p=r.table.nodeAt(f);if(!(i[f]||!p))if(i[f]=!0,a==null)a=f,c=p;else{P0(p)||(l=l.append(p.content));const h=s.mapping.map(f+r.tableStart);s.delete(h,h+p.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+r.tableStart,null,{...Ex(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const u=a+1+c.content.size,d=P0(c)?a+1:u;s.replaceWith(d+r.tableStart,u+r.tableStart,l)}s.setSelection(new Ct(s.doc.resolve(a+r.tableStart))),e(s)}return!0}function $0(t,e){const n=En(t.schema);return FI(({node:r})=>n[r.type.spec.tableRole])(t,e)}function FI(t){return(e,n)=>{var r;const o=e.selection;let s,i;if(o instanceof Ct){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{if(s=yI(o.$from),!s)return!1;i=(r=Mi(o.$from))==null?void 0:r.pos}if(s==null||i==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let l=s.attrs;const a=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const u=Dr(e),d=e.tr;for(let p=0;p<u.right-u.left;p++)a.push(c?{...l,colwidth:c&&c[p]?[c[p]]:null}:l);let f;for(let p=u.top;p<u.bottom;p++){let h=u.map.positionAt(p,u.left,u.table);p==u.top&&(h+=s.nodeSize);for(let m=u.left,y=0;m<u.right;m++,y++)m==u.left&&p==u.top||d.insert(f=d.mapping.map(h+u.tableStart,1),t({node:s,row:p,col:m}).createAndFill(a[y]))}d.setNodeMarkup(i,t({node:s,row:u.top,col:u.left}),a[0]),o instanceof Ct&&d.setSelection(new Ct(d.doc.resolve(o.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function VI(t,e){return function(n,r){if(!kr(n))return!1;const o=Hu(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof Ct?n.selection.forEachCell((i,l)=>{i.attrs[t]!==e&&s.setNodeMarkup(l,null,{...i.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function BI(t){return function(e,n){if(!kr(e))return!1;if(n){const r=En(e.schema),o=Dr(e),s=e.tr,i=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=i.map(a=>o.table.nodeAt(a));for(let a=0;a<i.length;a++)l[a].type==r.header_cell&&s.setNodeMarkup(o.tableStart+i[a],r.cell,l[a].attrs);if(s.steps.length==0)for(let a=0;a<i.length;a++)s.setNodeMarkup(o.tableStart+i[a],r.header_cell,l[a].attrs);n(s)}return!0}}function F0(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function Nl(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?BI(t):function(n,r){if(!kr(n))return!1;if(r){const o=En(n.schema),s=Dr(n),i=n.tr,l=F0("row",s,o),a=F0("column",s,o),c=(t==="column"?l:t==="row"&&a)?1:0,u=t=="column"?{left:0,top:c,right:1,bottom:s.map.height}:t=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=t=="column"?a?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.cell;s.map.cellsInRect(u).forEach(f=>{const p=f+s.tableStart,h=i.doc.nodeAt(p);h&&i.setNodeMarkup(p,d,h.attrs)}),r(i)}return!0}}Nl("row",{useDeprecatedLogic:!0});Nl("column",{useDeprecatedLogic:!0});var HI=Nl("cell",{useDeprecatedLogic:!0});function jI(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),i=s.lastChild;if(i)return o-1-i.nodeSize;o-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function V0(t){return function(e,n){if(!kr(e))return!1;const r=jI(Hu(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Ie.between(o,vI(o))).scrollIntoView())}return!0}}function zI(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function va(t,e){const n=t.selection;if(!(n instanceof Ct))return!1;if(e){const r=t.tr,o=En(t.schema).cell.createAndFill().content;n.forEachCell((s,i)=>{s.content.eq(o)||r.replace(r.mapping.map(i+1),r.mapping.map(i+s.nodeSize-1),new ke(o,0,0))}),r.docChanged&&e(r)}return!0}function UI(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),s=o.type.spec.tableRole,i=o.type.schema,l=[];if(s=="row")for(let a=0;a<e.childCount;a++){let c=e.child(a).content;const u=a?0:Math.max(0,n-1),d=a<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=Uf(En(i).row,new ke(c,u,d)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?Uf(En(i).row,new ke(e,n,r)).content:e);else return null;return WI(i,l)}function WI(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let i=s.childCount-1;i>=0;i--){const{rowspan:l,colspan:a}=s.child(i).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+a}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(le.empty),n[o]<r){const s=En(t).cell.createAndFill(),i=[];for(let l=n[o];l<r;l++)i.push(s);e[o]=e[o].append(le.from(i))}return{height:e.length,width:r,rows:e}}function Uf(t,e){const n=t.createAndFill();return new Zp(n).replace(0,n.content.size,e).doc}function KI({width:t,height:e,rows:n},r,o){if(t!=r){const s=[],i=[];for(let l=0;l<n.length;l++){const a=n[l],c=[];for(let u=s[l]||0,d=0;u<r;d++){let f=a.child(d%a.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(Ls(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)s[l+p]=(s[l+p]||0)+f.attrs.colspan}i.push(le.from(c))}n=i,t=r}if(e!=o){const s=[];for(let i=0,l=0;i<o;i++,l++){const a=[],c=n[l%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);i+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),a.push(d)}s.push(le.from(a))}n=s,e=o}return{width:t,height:e,rows:n}}function GI(t,e,n,r,o,s,i){const l=t.doc.type.schema,a=En(l);let c,u;if(o>e.width)for(let d=0,f=0;d<e.height;d++){const p=n.child(d);f+=p.nodeSize;const h=[];let m;p.lastChild==null||p.lastChild.type==a.cell?m=c||(c=a.cell.createAndFill()):m=u||(u=a.header_cell.createAndFill());for(let y=e.width;y<o;y++)h.push(m);t.insert(t.mapping.slice(i).map(f-1+r),h)}if(s>e.height){const d=[];for(let h=0,m=(e.height-1)*e.width;h<Math.max(e.width,o);h++){const y=h>=e.width?!1:n.nodeAt(e.map[m+h]).type==a.header_cell;d.push(y?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const f=a.row.create(null,le.from(d)),p=[];for(let h=e.height;h<s;h++)p.push(f);t.insert(t.mapping.slice(i).map(r+n.nodeSize-2),p)}return!!(c||u)}function B0(t,e,n,r,o,s,i,l){if(i==0||i==e.height)return!1;let a=!1;for(let c=o;c<s;c++){const u=i*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){a=!0;const f=n.nodeAt(d),{top:p,left:h}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f.attrs,rowspan:i-p}),t.insert(t.mapping.slice(l).map(e.positionAt(i,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-i})),c+=f.attrs.colspan-1}}return a}function H0(t,e,n,r,o,s,i,l){if(i==0||i==e.width)return!1;let a=!1;for(let c=o;c<s;c++){const u=c*e.width+i,d=e.map[u];if(e.map[u-1]==d){a=!0;const f=n.nodeAt(d),p=e.colCount(d),h=t.mapping.slice(l).map(d+r);t.setNodeMarkup(h,null,Ls(f.attrs,i-p,f.attrs.colspan-(i-p))),t.insert(h+f.nodeSize,f.type.createAndFill(Ls(f.attrs,0,i-p))),c+=f.attrs.rowspan-1}}return a}function j0(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let i=Bt.get(s);const{top:l,left:a}=r,c=a+o.width,u=l+o.height,d=t.tr;let f=0;function p(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");i=Bt.get(s),f=d.mapping.maps.length}GI(d,i,s,n,c,u,f)&&p(),B0(d,i,s,n,a,c,l,f)&&p(),B0(d,i,s,n,a,c,u,f)&&p(),H0(d,i,s,n,l,u,a,f)&&p(),H0(d,i,s,n,l,u,c,f)&&p();for(let h=l;h<u;h++){const m=i.positionAt(h,a,s),y=i.positionAt(h,c,s);d.replace(d.mapping.slice(f).map(m+n),d.mapping.slice(f).map(y+n),new ke(o.rows[h-l],0,0))}p(),d.setSelection(new Ct(d.doc.resolve(n+i.positionAt(l,a,s)),d.doc.resolve(n+i.positionAt(u-1,c-1,s)))),e(d)}var qI=ch({ArrowLeft:wa("horiz",-1),ArrowRight:wa("horiz",1),ArrowUp:wa("vert",-1),ArrowDown:wa("vert",1),"Shift-ArrowLeft":xa("horiz",-1),"Shift-ArrowRight":xa("horiz",1),"Shift-ArrowUp":xa("vert",-1),"Shift-ArrowDown":xa("vert",1),Backspace:va,"Mod-Backspace":va,Delete:va,"Mod-Delete":va});function ja(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function wa(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof Ct)return ja(n,r,Fe.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const i=Ox(o,t,e);if(i==null)return!1;if(t=="horiz")return ja(n,r,Fe.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(i),a=Cx(l,t,e);let c;return a?c=Fe.near(a,1):e<0?c=Fe.near(n.doc.resolve(l.before(-1)),-1):c=Fe.near(n.doc.resolve(l.after(-1)),1),ja(n,r,c)}}}function xa(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let i;if(s instanceof Ct)i=s;else{const a=Ox(o,t,e);if(a==null)return!1;i=new Ct(n.doc.resolve(a))}const l=Cx(i.$headCell,t,e);return l?ja(n,r,new Ct(i.$anchorCell,l)):!1}}function JI(t,e){const n=t.state.doc,r=Mi(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Ct(r))),!0):!1}function YI(t,e,n){if(!kr(t.state))return!1;let r=UI(n);const o=t.state.selection;if(o instanceof Ct){r||(r={width:1,height:1,rows:[le.from(Uf(En(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),l=Bt.get(s).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=KI(r,l.right-l.left,l.bottom-l.top),j0(t.state,t.dispatch,i,l,r),!0}else if(r){const s=Hu(t.state),i=s.start(-1);return j0(t.state,t.dispatch,i,Bt.get(s.node(-1)).findCell(s.pos-i),r),!0}else return!1}function XI(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=z0(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Ct)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Mi(t.state.selection.$anchor))!=null&&((n=Ad(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(a,c){let u=Ad(t,c);const d=Mo.getState(t.state)==null;if(!u||!xh(a,u))if(d)u=a;else return;const f=new Ct(a,u);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(Mo,a.pos),t.dispatch(p)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",l),Mo.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Mo,-1))}function l(a){const c=a,u=Mo.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(z0(t,c.target)!=r&&(d=Ad(t,e),!d))return i();d&&s(d,c)}t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",l)}function Ox(t,e,n){if(!(t.state.selection instanceof Ie))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const i=r.before(o),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?i:null}}return null}function z0(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Ad(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Mi(t.state.doc.resolve(n.pos)):null}var ZI=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Wf(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Wf(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Wf(t,e,n,r,o,s){var i;let l=0,a=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:p,colwidth:h}=u.child(d).attrs;for(let m=0;m<p;m++,f++){const y=o==f?s:h&&h[m],g=y?y+"px":"";if(l+=y||r,y||(a=!1),c)c.style.width!=g&&(c.style.width=g),c=c.nextSibling;else{const k=document.createElement("col");k.style.width=g,e.appendChild(k)}}}for(;c;){const d=c.nextSibling;(i=c.parentNode)==null||i.removeChild(c),c=d}a?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var Kn=new Kt("tableColumnResizing");function QI({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=ZI,lastColumnResizable:o=!0}={}){const s=new Rt({key:Kn,state:{init(i,l){var a,c;const u=(c=(a=s.spec)==null?void 0:a.props)==null?void 0:c.nodeViews,d=En(l.schema).table.name;return r&&u&&(u[d]=(f,p)=>new r(f,n,p)),new e3(-1,!1)},apply(i,l){return l.apply(i)}},props:{attributes:i=>{const l=Kn.getState(i);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(i,l)=>{t3(i,l,t,o)},mouseleave:i=>{n3(i)},mousedown:(i,l)=>{r3(i,l,e,n)}},decorations:i=>{const l=Kn.getState(i);if(l&&l.activeHandle>-1)return a3(i,l.activeHandle)},nodeViews:{}}});return s}var e3=class za{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Kn);if(r&&r.setHandle!=null)return new za(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new za(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return zf(e.doc.resolve(o))||(o=-1),new za(o,n.dragging)}return n}};function t3(t,e,n,r){if(!t.editable)return;const o=Kn.getState(t.state);if(o&&!o.dragging){const s=s3(e.target);let i=-1;if(s){const{left:l,right:a}=s.getBoundingClientRect();e.clientX-l<=n?i=U0(t,e,"left",n):a-e.clientX<=n&&(i=U0(t,e,"right",n))}if(i!=o.activeHandle){if(!r&&i!==-1){const l=t.state.doc.resolve(i),a=l.node(-1),c=Bt.get(a),u=l.start(-1);if(c.colCount(l.pos-u)+l.nodeAfter.attrs.colspan-1==c.width-1)return}Nx(t,i)}}}function n3(t){if(!t.editable)return;const e=Kn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Nx(t,-1)}function r3(t,e,n,r){var o;if(!t.editable)return!1;const s=(o=t.dom.ownerDocument.defaultView)!=null?o:window,i=Kn.getState(t.state);if(!i||i.activeHandle==-1||i.dragging)return!1;const l=t.state.doc.nodeAt(i.activeHandle),a=o3(t,i.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(Kn,{setDragging:{startX:e.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const f=Kn.getState(t.state);f!=null&&f.dragging&&(i3(t,f.activeHandle,W0(f.dragging,d,n)),t.dispatch(t.state.tr.setMeta(Kn,{setDragging:null})))}function u(d){if(!d.which)return c(d);const f=Kn.getState(t.state);if(f&&f.dragging){const p=W0(f.dragging,d,n);K0(t,f.activeHandle,p,r)}}return K0(t,i.activeHandle,a,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),e.preventDefault(),!0}function o3(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const s=t.domAtPos(e);let i=s.node.childNodes[s.offset].offsetWidth,l=n;if(r)for(let a=0;a<n;a++)r[a]&&(i-=r[a],l--);return i/l}function s3(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function U0(t,e,n,r){const o=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!s)return-1;const{pos:i}=s,l=Mi(t.state.doc.resolve(i));if(!l)return-1;if(n=="right")return l.pos;const a=Bt.get(l.node(-1)),c=l.start(-1),u=a.map.indexOf(l.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function W0(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Nx(t,e){t.dispatch(t.state.tr.setMeta(Kn,{setHandle:e}))}function i3(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=Bt.get(o),i=r.start(-1),l=s.colCount(r.pos-i)+r.nodeAfter.attrs.colspan-1,a=t.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+l;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],f=o.nodeAt(d).attrs,p=f.colspan==1?0:l-s.colCount(d);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():l3(f.colspan);h[p]=n,a.setNodeMarkup(i+d,null,{...f,colwidth:h})}a.docChanged&&t.dispatch(a)}function K0(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),i=o.start(-1),l=Bt.get(s).colCount(o.pos-i)+o.nodeAfter.attrs.colspan-1;let a=t.domAtPos(o.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&Wf(s,a.firstChild,a,r,l,n)}function l3(t){return Array(t).fill(0)}function a3(t,e){var n;const r=[],o=t.doc.resolve(e),s=o.node(-1);if(!s)return _t.empty;const i=Bt.get(s),l=o.start(-1),a=i.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){const u=a+c*i.width;if((a==i.width-1||i.map[u]!=i.map[u+1])&&(c==0||i.map[u]!=i.map[u-i.width])){const d=i.map[u],f=l+d+s.nodeAt(d).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",(n=Kn.getState(t))!=null&&n.dragging&&r.push(on.node(l+d,l+d+s.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),r.push(on.widget(f,p))}}return _t.create(t.doc,r)}function c3({allowTableNodeSelection:t=!1}={}){return new Rt({key:Mo,state:{init(){return null},apply(e,n){const r=e.getMeta(Mo);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:kI,handleDOMEvents:{mousedown:XI},createSelectionBetween(e){return Mo.getState(e.state)!=null?e.state.selection:null},handleTripleClick:JI,handleKeyDown:qI,handlePaste:YI},appendTransaction(e,n,r){return EI(r,Tx(r,n),t)}})}var Ix=nn.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var e,n;const r=t.getAttribute("colwidth"),o=r?r.split(",").map(s=>parseInt(s,10)):null;if(!o){const s=(e=t.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),i=Array.from(((n=t.parentElement)==null?void 0:n.children)||[]).indexOf(t);if(i&&i>-1&&s&&s[i]){const l=s[i].getAttribute("width");return l?[parseInt(l,10)]:null}}return o}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",ft(this.options.HTMLAttributes,t),0]}}),Rx=nn.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",ft(this.options.HTMLAttributes,t),0]}}),Px=nn.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",ft(this.options.HTMLAttributes,t),0]}});function Kf(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function G0(t,e,n,r,o,s){var i;let l=0,a=!0,c=e.firstChild;const u=t.firstChild;if(u!==null)for(let d=0,f=0;d<u.childCount;d+=1){const{colspan:p,colwidth:h}=u.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const y=o===f?s:h&&h[m],g=y?`${y}px`:"";if(l+=y||r,y||(a=!1),c){if(c.style.width!==g){const[k,w]=Kf(r,y);c.style.setProperty(k,w)}c=c.nextSibling}else{const k=document.createElement("col"),[w,b]=Kf(r,y);k.style.setProperty(w,b),e.appendChild(k)}}}for(;c;){const d=c.nextSibling;(i=c.parentNode)==null||i.removeChild(c),c=d}a?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}var u3=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),G0(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,G0(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function d3(t,e,n,r){let o=0,s=!0;const i=[],l=t.firstChild;if(!l)return{};for(let u=0,d=0;u<l.childCount;u+=1){const{colspan:f,colwidth:p}=l.child(u).attrs;for(let h=0;h<f;h+=1,d+=1){const m=n===d?r:p&&p[h];o+=m||e,m||(s=!1);const[y,g]=Kf(e,m);i.push(["col",{style:`${y}: ${g}`}])}}const a=s?`${o}px`:"",c=s?"":`${o}px`;return{colgroup:["colgroup",{},...i],tableWidth:a,tableMinWidth:c}}function q0(t,e){return t.createAndFill()}function f3(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function p3(t,e,n,r,o){const s=f3(t),i=[],l=[];for(let c=0;c<n;c+=1){const u=q0(s.cell);if(u&&l.push(u),r){const d=q0(s.header_cell);d&&i.push(d)}}const a=[];for(let c=0;c<e;c+=1)a.push(s.row.createChecked(null,r&&c===0?i:l));return s.table.createChecked(null,a)}function h3(t){return t instanceof Ct}var ka=({editor:t})=>{const{selection:e}=t.state;if(!h3(e))return!1;let n=0;const r=Kw(e.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},Dx=nn.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:u3,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=d3(t,this.options.cellMinWidth);return["table",ft(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const i=p3(s.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(i).scrollIntoView().setSelection(Ie.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>TI(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>AI(t,e),deleteColumn:()=>({state:t,dispatch:e})=>OI(t,e),addRowBefore:()=>({state:t,dispatch:e})=>II(t,e),addRowAfter:()=>({state:t,dispatch:e})=>RI(t,e),deleteRow:()=>({state:t,dispatch:e})=>DI(t,e),deleteTable:()=>({state:t,dispatch:e})=>zI(t,e),mergeCells:()=>({state:t,dispatch:e})=>D0(t,e),splitCell:()=>({state:t,dispatch:e})=>$0(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Nl("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Nl("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>HI(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>D0(t,e)?!0:$0(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>VI(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>V0(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>V0(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Tx(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Ct.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:ka,"Mod-Backspace":ka,Delete:ka,"Mod-Delete":ka}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[QI({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],c3({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:at(Oe(t,"tableRole",e))}}}),m3=bt.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(Dx.configure(this.options.table)),this.options.tableCell!==!1&&t.push(Ix.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(Rx.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(Px.configure(this.options.tableRow)),t}});const g3=Dx.extend({renderHTML({HTMLAttributes:t}){return["div",{style:"overflow-x: auto;"},["table",t,0]]},parseHTML(){return[{tag:"div.table-wrapper table",priority:100},{tag:"table"}]}}),y3=m3.extend({addExtensions(){return[g3.configure({HTMLAttributes:{class:"editor-content"},resizable:!0}),Px,Ix,Rx]}});var b3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,v3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,w3=xr.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[As({find:b3,type:this.type})]},addPasteRules(){return[Go({find:v3,type:this.type})]}}),x3=xr.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),k3=xr.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),Sc=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},_3=/^\s*>\s$/,C3=nn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Sc("blockquote",{...ft(this.options.HTMLAttributes,t),children:Sc("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[wi({find:_3,type:this.type})]}}),E3=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,S3=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,M3=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,T3=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,A3=xr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Sc("strong",{...ft(this.options.HTMLAttributes,t),children:Sc("slot",{})})},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[As({find:E3,type:this.type}),As({find:M3,type:this.type})]},addPasteRules(){return[Go({find:S3,type:this.type}),Go({find:T3,type:this.type})]}}),L3=/(^|[^`])`([^`]+)`(?!`)$/,O3=/(^|[^`])`([^`]+)`(?!`)/g,N3=xr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[As({find:L3,type:this.type})]},addPasteRules(){return[Go({find:O3,type:this.type})]}}),I3=/^```([a-z]+)?[\s\n]$/,R3=/^~~~([a-z]+)?[\s\n]$/,P3=nn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0]||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ft(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{if(!this.options.enableTabIndentation)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(r.parent.type!==this.type)return!1;const s=" ".repeat(this.options.tabSize);return o?t.commands.insertContent(s):t.commands.command(({tr:i})=>{const{from:l,to:a}=n,c=e.doc.textBetween(l,a,`
225
- `,`
226
- `).split(`
227
- `).map(u=>s+u).join(`
228
- `);return i.replaceWith(l,a,e.schema.text(c)),!0})},"Shift-Tab":({editor:t})=>{if(!this.options.enableTabIndentation)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;return r.parent.type!==this.type?!1:o?t.commands.command(({tr:s})=>{var i;const{pos:l}=r,a=r.start(),c=r.end(),u=e.doc.textBetween(a,c,`
229
- `,`
230
- `).split(`
231
- `);let d=0,f=0;const p=l-a;for(let g=0;g<u.length;g+=1){if(f+u[g].length>=p){d=g;break}f+=u[g].length+1}const h=((i=u[d].match(/^ */))==null?void 0:i[0])||"",m=Math.min(h.length,this.options.tabSize);if(m===0)return!0;let y=a;for(let g=0;g<d;g+=1)y+=u[g].length+1;return s.delete(y,y+m),l-y<=m&&s.setSelection(Ie.create(s.doc,y)),!0}):t.commands.command(({tr:s})=>{const{from:i,to:l}=n,a=e.doc.textBetween(i,l,`
232
- `,`
233
- `).split(`
234
- `).map(c=>{var u;const d=((u=c.match(/^ */))==null?void 0:u[0])||"",f=Math.min(d.length,this.options.tabSize);return c.slice(f)}).join(`
235
- `);return s.replaceWith(i,l,e.schema.text(a)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
236
-
237
- `);return!s||!i?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;const i=o.after();return i===void 0?!1:r.nodeAt(i)?t.commands.command(({tr:l})=>(l.setSelection(Fe.near(r.resolve(i))),!0)):t.commands.exitCode()}}},addInputRules(){return[Bf({find:I3,type:this.type,getAttributes:t=>({language:t[1]})}),Bf({find:R3,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Rt({key:new Kt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o==null?void 0:o.mode;if(!n||!s)return!1;const{tr:i,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
238
- `));return i.replaceSelectionWith(this.type.create({language:s},a)),i.selection.$from.parent.type!==this.type&&i.setSelection(Ie.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),D3=nn.create({name:"doc",topNode:!0,content:"block+"}),$3=nn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ft(this.options.HTMLAttributes,t)]},renderText(){return`
239
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:l}=r.extensionManager,a=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&i){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),$x=nn.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ft(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Bf({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),F3=nn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ft(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!tI(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,o=t();return nx(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:i})=>{var l;if(i){const{$to:a}=s.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?s.setSelection(Ie.create(s.doc,a.pos+1)):a.nodeAfter.isBlock?s.setSelection(Ne.create(s.doc,a.pos)):s.setSelection(Ie.create(s.doc,a.pos));else{const u=(l=a.parent.type.contentMatch.defaultType)==null?void 0:l.create();u&&(s.insert(c,u),s.setSelection(Ie.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[wx({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),V3=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,B3=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,H3=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,j3=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,z3=xr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[As({find:V3,type:this.type}),As({find:H3,type:this.type})]},addPasteRules(){return[Go({find:B3,type:this.type}),Go({find:j3,type:this.type})]}});const U3="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",W3="ελ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",Gf="numeric",qf="ascii",Jf="alpha",tl="asciinumeric",zi="alphanumeric",Yf="domain",Fx="emoji",K3="scheme",G3="slashscheme",Ld="whitespace";function q3(t,e){return t in e||(e[t]=[]),e[t]}function ps(t,e,n){e[Gf]&&(e[tl]=!0,e[zi]=!0),e[qf]&&(e[tl]=!0,e[Jf]=!0),e[tl]&&(e[zi]=!0),e[Jf]&&(e[zi]=!0),e[zi]&&(e[Yf]=!0),e[Fx]&&(e[Yf]=!0);for(const r in e){const o=q3(r,n);o.indexOf(t)<0&&o.push(t)}}function J3(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function $n(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}$n.groups={};$n.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],s=e.jr[r][1];if(s&&o.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||$n.groups;let o;return e&&e.j?o=e:(o=new $n(e),n&&r&&ps(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const s=t.length;if(!s)return o;for(let i=0;i<s-1;i++)o=o.tt(t[i]);return o.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||$n.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const s=e;let i,l=o.go(t);if(l?(i=new $n,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new $n,s){if(r)if(i.t&&typeof i.t=="string"){const a=Object.assign(J3(i.t,r),n);ps(s,a,r)}else n&&ps(s,n,r);i.t=s}return o.j[t]=i,i}};const We=(t,e,n,r,o)=>t.ta(e,n,r,o),$t=(t,e,n,r,o)=>t.tr(e,n,r,o),J0=(t,e,n,r,o)=>t.ts(e,n,r,o),fe=(t,e,n,r,o)=>t.tt(e,n,r,o),Wr="WORD",Xf="UWORD",Vx="ASCIINUMERICAL",Bx="ALPHANUMERICAL",Il="LOCALHOST",Zf="TLD",Qf="UTLD",Ua="SCHEME",Gs="SLASH_SCHEME",kh="NUM",ep="WS",_h="NL",nl="OPENBRACE",rl="CLOSEBRACE",Mc="OPENBRACKET",Tc="CLOSEBRACKET",Ac="OPENPAREN",Lc="CLOSEPAREN",Oc="OPENANGLEBRACKET",Nc="CLOSEANGLEBRACKET",Ic="FULLWIDTHLEFTPAREN",Rc="FULLWIDTHRIGHTPAREN",Pc="LEFTCORNERBRACKET",Dc="RIGHTCORNERBRACKET",$c="LEFTWHITECORNERBRACKET",Fc="RIGHTWHITECORNERBRACKET",Vc="FULLWIDTHLESSTHAN",Bc="FULLWIDTHGREATERTHAN",Hc="AMPERSAND",jc="APOSTROPHE",zc="ASTERISK",Co="AT",Uc="BACKSLASH",Wc="BACKTICK",Kc="CARET",To="COLON",Ch="COMMA",Gc="DOLLAR",Tr="DOT",qc="EQUALS",Eh="EXCLAMATION",Qn="HYPHEN",ol="PERCENT",Jc="PIPE",Yc="PLUS",Xc="POUND",sl="QUERY",Sh="QUOTE",Hx="FULLWIDTHMIDDLEDOT",Mh="SEMI",Ar="SLASH",il="TILDE",Zc="UNDERSCORE",jx="EMOJI",Qc="SYM";var zx=Object.freeze({__proto__:null,ALPHANUMERICAL:Bx,AMPERSAND:Hc,APOSTROPHE:jc,ASCIINUMERICAL:Vx,ASTERISK:zc,AT:Co,BACKSLASH:Uc,BACKTICK:Wc,CARET:Kc,CLOSEANGLEBRACKET:Nc,CLOSEBRACE:rl,CLOSEBRACKET:Tc,CLOSEPAREN:Lc,COLON:To,COMMA:Ch,DOLLAR:Gc,DOT:Tr,EMOJI:jx,EQUALS:qc,EXCLAMATION:Eh,FULLWIDTHGREATERTHAN:Bc,FULLWIDTHLEFTPAREN:Ic,FULLWIDTHLESSTHAN:Vc,FULLWIDTHMIDDLEDOT:Hx,FULLWIDTHRIGHTPAREN:Rc,HYPHEN:Qn,LEFTCORNERBRACKET:Pc,LEFTWHITECORNERBRACKET:$c,LOCALHOST:Il,NL:_h,NUM:kh,OPENANGLEBRACKET:Oc,OPENBRACE:nl,OPENBRACKET:Mc,OPENPAREN:Ac,PERCENT:ol,PIPE:Jc,PLUS:Yc,POUND:Xc,QUERY:sl,QUOTE:Sh,RIGHTCORNERBRACKET:Dc,RIGHTWHITECORNERBRACKET:Fc,SCHEME:Ua,SEMI:Mh,SLASH:Ar,SLASH_SCHEME:Gs,SYM:Qc,TILDE:il,TLD:Zf,UNDERSCORE:Zc,UTLD:Qf,UWORD:Xf,WORD:Wr,WS:ep});const Hr=/[a-z]/,Pi=new RegExp("\\p{L}","u"),Od=new RegExp("\\p{Emoji}","u"),jr=/\d/,Nd=/\s/,Y0="\r",Id=`
240
- `,Y3="️",X3="‍",Rd="";let _a=null,Ca=null;function Z3(t=[]){const e={};$n.groups=e;const n=new $n;_a==null&&(_a=X0(U3)),Ca==null&&(Ca=X0(W3)),fe(n,"'",jc),fe(n,"{",nl),fe(n,"}",rl),fe(n,"[",Mc),fe(n,"]",Tc),fe(n,"(",Ac),fe(n,")",Lc),fe(n,"<",Oc),fe(n,">",Nc),fe(n,"(",Ic),fe(n,")",Rc),fe(n,"「",Pc),fe(n,"」",Dc),fe(n,"『",$c),fe(n,"』",Fc),fe(n,"<",Vc),fe(n,">",Bc),fe(n,"&",Hc),fe(n,"*",zc),fe(n,"@",Co),fe(n,"`",Wc),fe(n,"^",Kc),fe(n,":",To),fe(n,",",Ch),fe(n,"$",Gc),fe(n,".",Tr),fe(n,"=",qc),fe(n,"!",Eh),fe(n,"-",Qn),fe(n,"%",ol),fe(n,"|",Jc),fe(n,"+",Yc),fe(n,"#",Xc),fe(n,"?",sl),fe(n,'"',Sh),fe(n,"/",Ar),fe(n,";",Mh),fe(n,"~",il),fe(n,"_",Zc),fe(n,"\\",Uc),fe(n,"・",Hx);const r=$t(n,jr,kh,{[Gf]:!0});$t(r,jr,r);const o=$t(r,Hr,Vx,{[tl]:!0}),s=$t(r,Pi,Bx,{[zi]:!0}),i=$t(n,Hr,Wr,{[qf]:!0});$t(i,jr,o),$t(i,Hr,i),$t(o,jr,o),$t(o,Hr,o);const l=$t(n,Pi,Xf,{[Jf]:!0});$t(l,Hr),$t(l,jr,s),$t(l,Pi,l),$t(s,jr,s),$t(s,Hr),$t(s,Pi,s);const a=fe(n,Id,_h,{[Ld]:!0}),c=fe(n,Y0,ep,{[Ld]:!0}),u=$t(n,Nd,ep,{[Ld]:!0});fe(n,Rd,u),fe(c,Id,a),fe(c,Rd,u),$t(c,Nd,u),fe(u,Y0),fe(u,Id),$t(u,Nd,u),fe(u,Rd,u);const d=$t(n,Od,jx,{[Fx]:!0});fe(d,"#"),$t(d,Od,d),fe(d,Y3,d);const f=fe(d,X3);fe(f,"#"),$t(f,Od,d);const p=[[Hr,i],[jr,o]],h=[[Hr,null],[Pi,l],[jr,s]];for(let m=0;m<_a.length;m++)go(n,_a[m],Zf,Wr,p);for(let m=0;m<Ca.length;m++)go(n,Ca[m],Qf,Xf,h);ps(Zf,{tld:!0,ascii:!0},e),ps(Qf,{utld:!0,alpha:!0},e),go(n,"file",Ua,Wr,p),go(n,"mailto",Ua,Wr,p),go(n,"http",Gs,Wr,p),go(n,"https",Gs,Wr,p),go(n,"ftp",Gs,Wr,p),go(n,"ftps",Gs,Wr,p),ps(Ua,{scheme:!0,ascii:!0},e),ps(Gs,{slashscheme:!0,ascii:!0},e),t=t.sort((m,y)=>m[0]>y[0]?1:-1);for(let m=0;m<t.length;m++){const y=t[m][0],g=t[m][1]?{[K3]:!0}:{[G3]:!0};y.indexOf("-")>=0?g[Yf]=!0:Hr.test(y)?jr.test(y)?g[tl]=!0:g[qf]=!0:g[Gf]=!0,J0(n,y,y,g)}return J0(n,"localhost",Il,{ascii:!0}),n.jd=new $n(Qc),{start:n,tokens:Object.assign({groups:e},zx)}}function Ux(t,e){const n=Q3(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let l=t,a=null,c=0,u=null,d=-1,f=-1;for(;i<r&&(a=l.go(n[i]));)l=a,l.accepts()?(d=0,f=0,u=l):d>=0&&(d+=n[i].length,f++),c+=n[i].length,s+=n[i].length,i++;s-=d,i-=f,c-=d,o.push({t:u.t,v:e.slice(s-c,s),s:s-c,e:s})}return o}function Q3(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),s,i=o<55296||o>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(i),r+=i.length}return e}function go(t,e,n,r,o){let s;const i=e.length;for(let l=0;l<i-1;l++){const a=e[l];t.j[a]?s=t.j[a]:(s=new $n(r),s.jr=o.slice(),t.j[a]=s),t=s}return s=new $n(n),s.jr=o.slice(),t.j[e[i-1]]=s,s}function X0(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let s=0;for(;o.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let i=parseInt(t.substring(r,r+s),10);i>0;i--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Rl={defaultProtocol:"http",events:null,format:Z0,formatHref:Z0,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Th(t,e=null){let n=Object.assign({},Rl);t&&(n=Object.assign(n,t instanceof Th?t.o:t));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Th.prototype={o:Rl,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Rl[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Z0(t){return t}function Wx(t,e){this.t="token",this.v=t,this.tk=e}Wx.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Rl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),s=this.toFormattedString(t),i={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return i.href=r,l&&(i.class=l),a&&(i.target=a),c&&(i.rel=c),u&&Object.assign(i,u),{tagName:o,attributes:i,content:s,eventListeners:d}}};function ju(t,e){class n extends Wx{constructor(o,s){super(o,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Q0=ju("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ey=ju("text"),eR=ju("nl"),Ea=ju("url",{isLink:!0,toHref(t=Rl.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Il&&t[1].t===To}}),Xn=t=>new $n(t);function tR({groups:t}){const e=t.domain.concat([Hc,zc,Co,Uc,Wc,Kc,Gc,qc,Qn,kh,ol,Jc,Yc,Xc,Ar,Qc,il,Zc]),n=[jc,To,Ch,Tr,Eh,ol,sl,Sh,Mh,Oc,Nc,nl,rl,Tc,Mc,Ac,Lc,Ic,Rc,Pc,Dc,$c,Fc,Vc,Bc],r=[Hc,jc,zc,Uc,Wc,Kc,Gc,qc,Qn,nl,rl,ol,Jc,Yc,Xc,sl,Ar,Qc,il,Zc],o=Xn(),s=fe(o,il);We(s,r,s),We(s,t.domain,s);const i=Xn(),l=Xn(),a=Xn();We(o,t.domain,i),We(o,t.scheme,l),We(o,t.slashscheme,a),We(i,r,s),We(i,t.domain,i);const c=fe(i,Co);fe(s,Co,c),fe(l,Co,c),fe(a,Co,c);const u=fe(s,Tr);We(u,r,s),We(u,t.domain,s);const d=Xn();We(c,t.domain,d),We(d,t.domain,d);const f=fe(d,Tr);We(f,t.domain,d);const p=Xn(Q0);We(f,t.tld,p),We(f,t.utld,p),fe(c,Il,p);const h=fe(d,Qn);fe(h,Qn,h),We(h,t.domain,d),We(p,t.domain,d),fe(p,Tr,f),fe(p,Qn,h);const m=fe(p,To);We(m,t.numeric,Q0);const y=fe(i,Qn),g=fe(i,Tr);fe(y,Qn,y),We(y,t.domain,i),We(g,r,s),We(g,t.domain,i);const k=Xn(Ea);We(g,t.tld,k),We(g,t.utld,k),We(k,t.domain,i),We(k,r,s),fe(k,Tr,g),fe(k,Qn,y),fe(k,Co,c);const w=fe(k,To),b=Xn(Ea);We(w,t.numeric,b);const _=Xn(Ea),M=Xn();We(_,e,_),We(_,n,M),We(M,e,_),We(M,n,M),fe(k,Ar,_),fe(b,Ar,_);const E=fe(l,To),I=fe(a,To),F=fe(I,Ar),R=fe(F,Ar);We(l,t.domain,i),fe(l,Tr,g),fe(l,Qn,y),We(a,t.domain,i),fe(a,Tr,g),fe(a,Qn,y),We(E,t.domain,_),fe(E,Ar,_),fe(E,sl,_),We(R,t.domain,_),We(R,e,_),fe(R,Ar,_);const $=[[nl,rl],[Mc,Tc],[Ac,Lc],[Oc,Nc],[Ic,Rc],[Pc,Dc],[$c,Fc],[Vc,Bc]];for(let A=0;A<$.length;A++){const[q,Y]=$[A],Z=fe(_,q);fe(M,q,Z),fe(Z,Y,_);const K=Xn(Ea);We(Z,e,K);const X=Xn();We(Z,n),We(K,e,K),We(K,n,X),We(X,e,K),We(X,n,X),fe(K,Y,_),fe(X,Y,_)}return fe(o,Il,k),fe(o,_h,eR),{start:o,tokens:zx}}function nR(t,e,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let l=t,a=null,c=null,u=0,d=null,f=-1;for(;o<r&&!(a=l.go(n[o].t));)i.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,o++,u++;if(f<0)o-=u,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(Pd(ey,e,i)),i=[]),o-=f,u-=f;const p=d.t,h=n.slice(o-u,o);s.push(Pd(p,e,h))}}return i.length>0&&s.push(Pd(ey,e,i)),s}function Pd(t,e,n){const r=n[0].s,o=n[n.length-1].e,s=e.slice(r,o);return new t(s,n)}const rR=typeof console<"u"&&console&&console.warn||(()=>{}),oR="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Mt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function sR(){return $n.groups={},Mt.scanner=null,Mt.parser=null,Mt.tokenQueue=[],Mt.pluginQueue=[],Mt.customSchemes=[],Mt.initialized=!1,Mt}function ty(t,e=!1){if(Mt.initialized&&rR(`linkifyjs: already initialized - will not register custom scheme "${t}" ${oR}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
241
- 1. Must only contain digits, lowercase ASCII letters or "-"
242
- 2. Cannot start or end with "-"
243
- 3. "-" cannot repeat`);Mt.customSchemes.push([t,e])}function iR(){Mt.scanner=Z3(Mt.customSchemes);for(let t=0;t<Mt.tokenQueue.length;t++)Mt.tokenQueue[t][1]({scanner:Mt.scanner});Mt.parser=tR(Mt.scanner.tokens);for(let t=0;t<Mt.pluginQueue.length;t++)Mt.pluginQueue[t][1]({scanner:Mt.scanner,parser:Mt.parser});return Mt.initialized=!0,Mt}function Ah(t){return Mt.initialized||iR(),nR(Mt.parser.start,t,Ux(Mt.scanner.start,t))}Ah.scan=Ux;function Kx(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Th(n),o=Ah(t),s=[];for(let i=0;i<o.length;i++){const l=o[i];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}var Lh="[\0-   ᠎ -\u2029  ]",lR=new RegExp(Lh),aR=new RegExp(`${Lh}$`),cR=new RegExp(Lh,"g");function uR(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function dR(t){return new Rt({key:new Kt("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(a=>a.docChanged)&&!n.doc.eq(r.doc),s=e.some(a=>a.getMeta("preventAutolink"));if(!o||s)return;const{tr:i}=r,l=Uw(n.doc,[...e]);if(ex(l).forEach(({newRange:a})=>{const c=bN(r.doc,a,f=>f.isTextblock);let u,d;if(c.length>1)u=c[0],d=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(c.length){const f=r.doc.textBetween(a.from,a.to," "," ");if(!aR.test(f))return;u=c[0],d=r.doc.textBetween(u.pos,a.to,void 0," ")}if(u&&d){const f=d.split(lR).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],h=u.pos+d.lastIndexOf(p);if(!p)return!1;const m=Ah(p).map(y=>y.toObject(t.defaultProtocol));if(!uR(m))return!1;m.filter(y=>y.isLink).map(y=>({...y,from:h+y.start+1,to:h+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{yh(y.from,y.to,r.doc).some(g=>g.mark.type===t.type)||i.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!i.steps.length)return i}})}function fR(t){return new Rt({key:new Kt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,s;if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let u=r.target;const d=[];for(;u.nodeName!=="DIV";)d.push(u),u=u.parentNode;i=d.find(f=>f.nodeName==="A")}if(!i)return!1;const l=Qw(e.state,t.type.name),a=(o=i==null?void 0:i.href)!=null?o:l.href,c=(s=i==null?void 0:i.target)!=null?s:l.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),i&&a?(window.open(a,c),!0):!1}}})}function pR(t){return new Rt({key:new Kt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:s}=o,{empty:i}=s;if(i)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=Kx(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!a?!1:t.editor.commands.setMark(t.type,{href:a.href})}}})}function ls(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(cR,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Gx=xr.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(t=>{if(typeof t=="string"){ty(t);return}ty(t.scheme,t.optionalSlashes)})},onDestroy(){sR()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!ls(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!ls(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ls(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ft(this.options.HTMLAttributes,t),0]:["a",ft(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ls(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!ls(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Go({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=Kx(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:i=>!!ls(i,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(dR({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!ls(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(fR({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(pR({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),hR=Object.defineProperty,mR=(t,e)=>{for(var n in e)hR(t,n,{get:e[n],enumerable:!0})},gR="listItem",ny="textStyle",ry=/^\s*([-+*])\s$/,qx=nn.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:t}){return["ul",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(gR,this.editor.getAttributes(ny)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=wi({find:ry,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=wi({find:ry,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ny),editor:this.editor})),[t]}}),Jx=nn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ft(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),yR={};mR(yR,{findListItemPos:()=>Yl,getNextListDepth:()=>Oh,handleBackspace:()=>tp,handleDelete:()=>np,hasListBefore:()=>Yx,hasListItemAfter:()=>bR,hasListItemBefore:()=>Xx,listItemHasSubList:()=>Zx,nextListIsDeeper:()=>Qx,nextListIsHigher:()=>ek});var Yl=(t,e)=>{const{$from:n}=e.selection,r=Xt(t,e.schema);let o=null,s=n.depth,i=n.pos,l=null;for(;s>0&&l===null;)o=n.node(s),o.type===r?l=s:(s-=1,i-=1);return l===null?null:{$pos:e.doc.resolve(i),depth:l}},Oh=(t,e)=>{const n=Yl(t,e);if(!n)return!1;const[,r]=MN(e,t,n.$pos.pos+4);return r},Yx=(t,e,n)=>{const{$anchor:r}=t.selection,o=Math.max(0,r.pos-2),s=t.doc.resolve(o).node();return!(!s||!n.includes(s.type.name))},Xx=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-2);return!(o.index()===0||((n=o.nodeBefore)==null?void 0:n.type.name)!==t)},Zx=(t,e,n)=>{if(!n)return!1;const r=Xt(t,e.schema);let o=!1;return n.descendants(s=>{s.type===r&&(o=!0)}),o},tp=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ko(t.state,e)&&Yx(t.state,e,n)){const{$anchor:i}=t.state.selection,l=t.state.doc.resolve(i.before()-1),a=[];l.node().descendants((d,f)=>{d.type.name===e&&a.push({node:d,pos:f})});const c=a.at(-1);if(!c)return!1;const u=t.state.doc.resolve(l.start()+c.pos+1);return t.chain().cut({from:i.start()-1,to:i.end()+1},u.end()).joinForward().run()}if(!Ko(t.state,e)||!ON(t.state))return!1;const r=Yl(e,t.state);if(!r)return!1;const o=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=Zx(e,t.state,o);return Xx(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},Qx=(t,e)=>{const n=Oh(t,e),r=Yl(t,e);return!r||!n?!1:n>r.depth},ek=(t,e)=>{const n=Oh(t,e),r=Yl(t,e);return!r||!n?!1:n<r.depth},np=(t,e)=>{if(!Ko(t.state,e)||!LN(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:Qx(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():ek(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},bR=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-r.parentOffset-2);return!(o.index()===o.parent.childCount-1||((n=o.nodeAfter)==null?void 0:n.type.name)!==t)},tk=bt.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&np(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&np(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&tp(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&tp(t,n,r)&&(e=!0)}),e}}}}),vR="listItem",oy="textStyle",sy=/^(\d+)\.\s$/,nk=nn.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:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ft(this.options.HTMLAttributes,n),0]:["ol",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(vR,this.editor.getAttributes(oy)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=wi({find:sy,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=wi({find:sy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(oy)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),wR=/^\s*(\[([( |x])?\])\s$/,xR=nn.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:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ft(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),s=document.createElement("label"),i=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=u=>{var d,f;l.ariaLabel=((f=(d=this.options.a11y)==null?void 0:d.checkboxLabel)==null?void 0:f.call(d,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return c(t),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:d}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=n();if(typeof p!="number")return!1;const h=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...h==null?void 0:h.attrs,checked:d}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,d)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,d])=>{o.setAttribute(u,d)}),o.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,i),o.append(s,a),Object.entries(e).forEach(([u,d])=>{o.setAttribute(u,d)}),{dom:o,contentDOM:a,update:u=>u.type!==this.type?!1:(o.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,c(u),!0)}}},addInputRules(){return[wi({find:wR,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),kR=nn.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:t}){return["ul",ft(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});bt.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(qx.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Jx.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(tk.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(nk.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(xR.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(kR.configure(this.options.taskList)),t}});var rk=nn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),_R=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,CR=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ER=xr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[As({find:_R,type:this.type})]},addPasteRules(){return[Go({find:CR,type:this.type})]}}),SR=nn.create({name:"text",group:"inline"}),MR=xr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ft(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function TR(t={}){return new Rt({view(e){return new AR(e,t)}})}class AR{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=i=>{this[o](i)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):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),n=!e.parent.inlineContent,r,o=this.editorView.dom,s=o.getBoundingClientRect(),i=s.width/o.offsetWidth,l=s.height/o.offsetHeight;if(n){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let h=p.getBoundingClientRect(),m=d?h.bottom:h.top;d&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*l;r={left:h.left,right:h.right,top:m-y,bottom:m+y}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*i;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,p=d.height/a.offsetHeight;c=d.left-a.scrollLeft*f,u=d.top-a.scrollTop*p}this.element.style.left=(r.left-c)/i+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!s){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=J1(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ft extends Fe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ft.valid(r)?new Ft(r):Fe.near(r)}content(){return ke.empty}eq(e){return e instanceof Ft&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ft(e.resolve(n.pos))}getBookmark(){return new Nh(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!LR(e)||!OR(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ft.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let l=e.node(i);if(n>0?e.indexAfter(i)<l.childCount:e.index(i)>0){s=l.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=n;let a=e.doc.resolve(o);if(Ft.valid(a))return a}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!Ne.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let l=e.doc.resolve(o);if(Ft.valid(l))return l}return null}}}Ft.prototype.visible=!1;Ft.findFrom=Ft.findGapCursorFrom;Fe.jsonID("gapcursor",Ft);class Nh{constructor(e){this.pos=e}map(e){return new Nh(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ft.valid(n)?new Ft(n):Fe.near(n)}}function LR(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function OR(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function NR(){return new Rt({props:{decorations:DR,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ft.valid(n)?new Ft(n):null},handleClick:RR,handleKeyDown:IR,handleDOMEvents:{beforeinput:PR}}})}const IR=ch({ArrowLeft:Sa("horiz",-1),ArrowRight:Sa("horiz",1),ArrowUp:Sa("vert",-1),ArrowDown:Sa("vert",1)});function Sa(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,l=e>0?i.$to:i.$from,a=i.empty;if(i instanceof Ie){if(!s.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Ft.findGapCursorFrom(l,e,a);return c?(o&&o(r.tr.setSelection(new Ft(c))),!0):!1}}function RR(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ft.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Ne.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ft(r))),!0)}function PR(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ft))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=le.empty;for(let i=r.length-1;i>=0;i--)o=le.from(r[i].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new ke(o,0,0));return s.setSelection(Ie.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function DR(t){if(!(t.selection instanceof Ft))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",_t.create(t.doc,[on.widget(t.selection.head,e,{key:"gapcursor"})])}var eu=200,ln=function(){};ln.prototype.append=function(t){return t.length?(t=ln.from(t),!this.length&&t||t.length<eu&&this.leafAppend(t)||this.length<eu&&t.leafPrepend(this)||this.appendInner(t)):this};ln.prototype.prepend=function(t){return t.length?ln.from(t).append(this):this};ln.prototype.appendInner=function(t){return new $R(this,t)};ln.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?ln.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};ln.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};ln.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)};ln.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(o,s){return r.push(t(o,s))},e,n),r};ln.from=function(t){return t instanceof ln?t:t&&t.length?new ok(t):ln.empty};var ok=function(t){function e(r){t.call(this),this.values=r}e.__proto__=t,e.prototype=Object.create(t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,s,i){for(var l=o;l<s;l++)if(r(this.values[l],i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){for(var l=o-1;l>=s;l--)if(r(this.values[l],i+l)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=eu)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=eu)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(ln);ln.empty=new ok([]);var $R=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e.__proto__=t,e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,o,s){var i=this.left.length;if(r<i&&this.left.forEachInner(n,r,Math.min(o,i),s)===!1||o>i&&this.right.forEachInner(n,Math.max(r-i,0),Math.min(this.length,o)-i,s+i)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,o,s){var i=this.left.length;if(r>i&&this.right.forEachInvertedInner(n,r-i,Math.max(o,i)-i,s+i)===!1||o<i&&this.left.forEachInvertedInner(n,Math.min(r,i),o,s)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(n,r):n>=o?this.right.slice(n-o,r-o):this.left.slice(n,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(ln);const FR=500;class fr{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),s=o.maps.length),s--,u.push(d);return}if(o){u.push(new Lr(d.map));let p=d.step.map(o.slice(s)),h;p&&i.maybeStep(p).doc&&(h=i.mapping.maps[i.mapping.maps.length-1],c.push(new Lr(h,void 0,void 0,c.length+u.length))),s--,h&&o.appendMap(h,s)}else i.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(s)):d.selection,a=new fr(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:i,selection:l}}addTransform(e,n,r,o){let s=[],i=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Lr(e.mapping.maps[u],d,n),p;(p=a&&a.merge(f))&&(f=p,u?s.pop():l=l.slice(0,l.length-1)),s.push(f),n&&(i++,n=void 0),o||(a=f)}let c=i-r.depth;return c>BR&&(l=VR(l,c),i-=c),new fr(l.append(s),i)}remapping(e,n){let r=new El;return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,n),r}addMaps(e){return this.eventCount==0?this:new fr(this.items.append(e.map(n=>new Lr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let p=s.getMirror(--a);if(p==null)return;i=Math.min(i,p);let h=s.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(s.slice(a+1,p));y&&l++,r.push(new Lr(h,m,y))}else r.push(new Lr(h))},o);let c=[];for(let f=n;f<i;f++)c.push(new Lr(s.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new fr(u,l);return d.emptyItemCount()>FR&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((i,l)=>{if(l>=e)o.push(i),i.selection&&s++;else if(i.step){let a=i.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=i.selection&&i.selection.map(n.slice(r));u&&s++;let d=new Lr(c.invert(),a,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else i.map&&r--},this.items.length,0),new fr(ln.from(o.reverse()),s)}}fr.empty=new fr(ln.empty,0);function VR(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Lr{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Lr(n.getMap().invert(),n,this.selection)}}}class Eo{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const BR=20;function HR(t,e,n,r){let o=n.getMeta(ks),s;if(o)return o.historyState;n.getMeta(UR)&&(t=new Eo(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(ks))return i.getMeta(ks).redo?new Eo(t.done.addTransform(n,void 0,r,Wa(e)),t.undone,iy(n.mapping.maps),t.prevTime,t.prevComposition):new Eo(t.done,t.undone.addTransform(n,void 0,r,Wa(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!i&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!jR(n,t.prevRanges)),c=i?Dd(t.prevRanges,n.mapping):iy(n.mapping.maps);return new Eo(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,Wa(e)),fr.empty,c,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Eo(t.done.rebased(n,s),t.undone.rebased(n,s),Dd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Eo(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Dd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function jR(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function iy(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,i)=>e.push(s,i));return e}function Dd(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function zR(t,e,n){let r=Wa(e),o=ks.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let i=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),a=new Eo(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(i).setMeta(ks,{redo:n,historyState:a})}let $d=!1,ly=null;function Wa(t){let e=t.plugins;if(ly!=e){$d=!1,ly=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){$d=!0;break}}return $d}const ks=new Kt("history"),UR=new Kt("closeHistory");function WR(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Rt({key:ks,state:{init(){return new Eo(fr.empty,fr.empty,null,0,-1)},apply(e,n,r){return HR(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?ik:r=="historyRedo"?lk:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function sk(t,e){return(n,r)=>{let o=ks.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=zR(o,n,t);s&&r(s.scrollIntoView())}return!0}}const ik=sk(!1),lk=sk(!0);bt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Rt({key:new Kt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const i=s-o,l=0,a=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,a);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,l=s-r,a=i-l,c=i;return e.deleteRange(a,c),!(this.storage.characters({node:e.doc})>r)}})]}});var KR=bt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[TR(this.options)]}});bt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Rt({key:new Kt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return _t.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((a,c)=>{if(!a.isText){if(!(o>=c&&o<=c+a.nodeSize-1))return!1;i+=1}});let l=0;return t.descendants((a,c)=>{if(a.isText||!(o>=c&&o<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(on.node(c,c+a.nodeSize,{class:this.options.className}))}),_t.create(t,s)}}})]}});var GR=bt.create({name:"gapCursor",addProseMirrorPlugins(){return[NR()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=at(Oe(t,"allowGapCursor",n)))!=null?e:null}}});bt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Rt({key:new Kt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((i,l)=>{const a=r>=l&&r<=l+i.nodeSize,c=!i.isLeaf&&Fu(i);if((a||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const d=on.node(l,l+i.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:l,hasAnchor:a}):this.options.placeholder});o.push(d)}return this.options.includeChildren}),_t.create(t,o)}}})]}});bt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Rt({key:new Kt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||nx(n.selection)||t.view.dragging?null:_t.create(n.doc,[on.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function ay({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var qR=bt.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const t=new Kt(this.name),e=Object.entries(this.editor.schema.nodes).map(([,n])=>n).filter(n=>(this.options.notAfter||[]).concat(this.options.node).includes(n.name));return[new Rt({key:t,appendTransaction:(n,r,o)=>{const{doc:s,tr:i,schema:l}=o,a=t.getState(o),c=s.content.size,u=l.nodes[this.options.node];if(a)return i.insert(c,u.create())},state:{init:(n,r)=>{const o=r.tr.doc.lastChild;return!ay({node:o,types:e})},apply:(n,r)=>{if(!n.docChanged)return r;const o=n.doc.lastChild;return!ay({node:o,types:e})}}})]}}),JR=bt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>ik(t,e),redo:()=>({state:t,dispatch:e})=>lk(t,e)}},addProseMirrorPlugins(){return[WR(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()}}}),YR=bt.create({name:"starterKit",addExtensions(){var t,e,n,r;const o=[];return this.options.bold!==!1&&o.push(A3.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(C3.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(qx.configure(this.options.bulletList)),this.options.code!==!1&&o.push(N3.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(P3.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(D3.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(KR.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(GR.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push($3.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push($x.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(JR.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(F3.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(z3.configure(this.options.italic)),this.options.listItem!==!1&&o.push(Jx.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(tk.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&o.push(Gx.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(nk.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(rk.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(ER.configure(this.options.strike)),this.options.text!==!1&&o.push(SR.configure(this.options.text)),this.options.underline!==!1&&o.push(MR.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(qR.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),XR=YR,ZR=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,QR=nn.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},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:t}){return["img",ft(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[wx({find:ZR,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),eP=bt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const tP=async t=>{var e;try{const n=new FormData;return n.append("unique","true"),n.append("file",t),(e=await(await fetch("/file/upload/uploads?id=&form=&table=",{method:"POST",body:n})).json())==null?void 0:e.result}catch(n){console.error(n)}},nP=async(t,e)=>{var r,o,s;const n=(r=e.clipboardData)==null?void 0:r.items;if(n){const i=(o=e.clipboardData)==null?void 0:o.getData("text/html"),l=(s=e.clipboardData)==null?void 0:s.getData("text/plain");if(i){const{state:a,dispatch:c}=t,{tr:u}=a,d=si.fromSchema(t.state.schema),f=new DOMParser().parseFromString(i,"text/html").body,p=d.parse(f),h=u.replaceSelectionWith(p);return c(h),e.preventDefault(),!0}if(l){const{state:a,dispatch:c}=t,{tr:u}=a,d=u.insertText(l,a.selection.from,a.selection.to);return c(d),e.preventDefault(),!0}for(let a=0;a<n.length;a++){const c=n[a];if(c.type.startsWith("image/")){const u=c.getAsFile();if(u){const d=await tP(u),{schema:f}=t.state,p=f.nodes.image.create({src:d==null?void 0:d.file_path}),h=t.state.tr.replaceSelectionWith(p);return t.dispatch(h),e.preventDefault(),!0}}}}return!1},rP={1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"},oP=$x.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),level:{default:1,renderHTML:e=>{const n=e.level||1;return{class:`heading-level-${n}`,style:rP[n-1]}}}}}}),sP=rk.configure({HTMLAttributes:{style:"min-height: 1rem;"}}),iP=wh.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),fontFamily:{default:null,parseHTML:e=>{var n;return(n=e.style.fontFamily)==null?void 0:n.replace(/['"]/g,"")},renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),lP=wh.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),fontSize:{default:null,parseHTML:e=>{var n;return(n=e.style.fontSize)==null?void 0:n.replace(/['"]/g,"")},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),aP=nn.create({name:"iframe",group:"block",inline:!1,atom:!0,selectable:!0,addAttributes(){return{src:{default:null},width:{default:"100%"},height:{default:"280"},frameborder:{default:"0"},allow:{default:null},allowfullscreen:{default:null},referrerpolicy:{default:null},loading:{default:null},class:{default:null},title:{default:null},style:{default:null}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){return["iframe",t]}});function ak(t){let e=!1;const n=oI({content:t.modelValue,extensions:[XR.configure({history:{depth:100,newGroupDelay:500},code:{HTMLAttributes:{class:"editor-code"}},codeBlock:{HTMLAttributes:{class:"editor-codeblock"}},paragraph:!1,heading:!1,link:!1}),k3,x3,fI,iP,lP,sP,oP,w3,QR.configure({inline:!0,allowBase64:!0,HTMLAttributes:{class:"editor-image"}}),eP.configure({types:["heading","paragraph"]}),Gx.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0}),y3,aP],editorProps:{handlePaste:nP,handleKeyDown:(o,s)=>{if(s.key==="Tab"){const i=o.state,{selection:l}=i,{$anchor:a}=l;let c=!1;for(let u=a.depth;u>0;u--){const d=a.node(u);if(d&&(d.type.name==="bulletList"||d.type.name==="orderedList")){c=!0;break}}return c?!1:(s.preventDefault(),!0)}return!1}}}),r=te(()=>n.value||null);return Re(n,o=>{o&&n.value.on("update",s=>{e||(e=!0,s.editor.getHTML(),t.modelValue,setTimeout(()=>{e=!1},10))})}),{editor:n,editorInstance:r,focusEditor:()=>{n.value&&!n.value.isFocused&&n.value.commands.focus()}}}function ck(t,e){const n=Q(!1),r=Q(""),o=Q(null);return{isHtmlMode:n,htmlContent:r,htmlTextarea:o,toggleHtmlMode:s=>{n.value=s,s?(t.value&&(r.value=t.value.getHTML()),zt(()=>{o.value&&(o.value.focus(),setTimeout(()=>{o.value.formatCode()},100))})):t.value&&r.value&&t.value.commands.setContent(r.value,!0)},onHtmlInput:s=>{r.value=s,e&&e("update:modelValue",s)}}}function uk(){const t=Q(!1);return{isFullscreen:t,toggleFullscreen:()=>{t.value=!t.value}}}const Lt=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},cP={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function uP(t,e,n,r,o,s){var i;return S(),T("button",{title:"Blockquote",onClick:e[0]||(e[0]=(...l)=>s.toggleBlockquote&&s.toggleBlockquote(...l)),class:ae(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none",{"bg-gray-100 text-gray-900":(i=n.editor)==null?void 0:i.isActive("blockquote")}])},[...e[1]||(e[1]=[v("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[v("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)])],2)}const dP=Lt(cP,[["render",uP]]),fP={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function pP(t,e,n,r,o,s){var i;return S(),T("button",{title:"Bullet List",onClick:e[0]||(e[0]=(...l)=>s.toggleBulletList&&s.toggleBulletList(...l)),class:ae(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":(i=n.editor)==null?void 0:i.isActive("bulletList")}])},[...e[1]||(e[1]=[v("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[v("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)])],2)}const hP=Lt(fP,[["render",pP]]),mP={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function gP(t,e,n,r,o,s){var i;return S(),T("button",{title:"Ordered List",onClick:e[0]||(e[0]=(...l)=>s.toggleOrderedList&&s.toggleOrderedList(...l)),class:ae(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":(i=n.editor)==null?void 0:i.isActive("orderedList")}])},[...e[1]||(e[1]=[v("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[v("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)])],2)}const yP=Lt(mP,[["render",gP]]),bP={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function vP(t,e,n,r,o,s){var i;return S(),T("button",{title:"Code Block",onClick:e[0]||(e[0]=(...l)=>s.toggleCodeBlock&&s.toggleCodeBlock(...l)),class:ae(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":(i=n.editor)==null?void 0:i.isActive("codeBlock")}])},[...e[1]||(e[1]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[v("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)])],2)}const wP=Lt(bP,[["render",vP]]),xP={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.commands.toggleBold()}}};function kP(t,e,n,r,o,s){var i;return S(),T("button",{title:"Bold Text",onClick:e[0]||(e[0]=(...l)=>s.toggleBold&&s.toggleBold(...l)),class:ae(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":(i=n.editor)==null?void 0:i.isActive("bold")}])},[...e[1]||(e[1]=[v("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[v("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),v("span",{class:"sr-only"},"Bold",-1)])],2)}const _P=Lt(xP,[["render",kP]]),CP={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function EP(t,e,n,r,o,s){var i;return S(),T("button",{title:"Italic Text",onClick:e[0]||(e[0]=(...l)=>s.toggleItalic&&s.toggleItalic(...l)),class:ae(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":(i=n.editor)==null?void 0:i.isActive("italic")}])},[...e[1]||(e[1]=[v("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[v("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),v("span",{class:"sr-only"},"Italic",-1)])],2)}const SP=Lt(CP,[["render",EP]]),MP={__name:"vs-editor-underline",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(r,o)=>{var s;return S(),T("button",{title:"Underline",onClick:n,class:ae(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[(s=t.editor)!=null&&s.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...o[0]||(o[0]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),v("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)])],2)}}},TP={__name:"vs-editor-strike",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(r,o)=>{var s;return S(),T("button",{title:"Strikethrough",onClick:n,class:ae(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[(s=t.editor)!=null&&s.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...o[0]||(o[0]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),v("path",{d:"M5 12l14 0"}),v("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)])],2)}}},AP={props:{visible:{type:Boolean,default:()=>!1},modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","update:modelValue","onClose","confirm","cancel"],inheritAttrs:!1,name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){var t;return!!((t=this.$slots)!=null&&t.footer)},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:t}){t==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("update:modelValue",!1),this.$emit("onClose")},handleConfirm(){this.$emit("confirm"),this.handleClose()},handleCancel(){this.$emit("cancel"),this.handleClose()},closeByClickBack(t,e){e&&t.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},LP={key:0,class:"vsTailwind ui-dialog__wrapper"},OP={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},NP={class:"font-medium text-gray-800 dark:text-[#ffffff]"},IP={class:"ui-dialog__content p-4"},RP={key:0,class:"flex justify-end gap-x-2"};function PP(t,e,n,r,o,s){return S(),Ae(Is,{to:"body"},[n.visible||n.modelValue?(S(),T("div",LP,[v("div",{onMousedown:e[1]||(e[1]=i=>s.closeByClickBack(i,n.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[100001] bg-black bg-opacity-50"},[ce(Rs,{name:"content",appear:""},{default:Ke(()=>[v("div",{class:ae(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[s.checkSize]])},[v("div",OP,[v("h3",NP,we(n.title),1),v("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...i)=>s.handleClose&&s.handleClose(...i))},[...e[2]||(e[2]=[v("span",{class:"sr-only"},"Close",-1),v("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"M18 6 6 18"}),v("path",{d:"m6 6 12 12"})],-1)])])]),v("div",IP,[mn(t.$slots,"default",{},void 0,!0)]),s.hasSlot?(S(),T("div",RP,[mn(t.$slots,"footer",{handleClose:s.handleClose,handleConfirm:s.handleConfirm,handleCancel:s.handleCancel},void 0,!0)])):pe("",!0)],2)]),_:3})],32)])):pe("",!0)])}const dk=Lt(AP,[["render",PP],["__scopeId","data-v-6d0970a6"]]),DP={},$P={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function FP(t,e,n,r,o,s){return S(),T("svg",$P,[...e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M18 6l-12 12"},null,-1),v("path",{d:"M6 6l12 12"},null,-1)])])}const VP=Lt(DP,[["render",FP]]),BP={},HP={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function jP(t,e,n,r,o,s){return S(),T("svg",HP,[...e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),v("path",{d:"M21 21l-6 -6"},null,-1)])])}const zP=Lt(BP,[["render",jP]]),UP={},WP={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function KP(t,e,n,r,o,s){return S(),T("svg",WP,[...e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),v("path",{d:"M3 7l9 6l9 -6"},null,-1)])])}const GP=Lt(UP,[["render",KP]]),qP=_e({components:{IconClose:VP,IconSearch:zP,IconEmail:GP},inheritAttrs:!1,props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){var t,e,n;if((((t=this.style)==null?void 0:t.size)||this.size)==="xs")return"h-[32px] text-sm";if((((e=this.style)==null?void 0:e.size)||this.size)==="md")return"h-[38px] text-sm";(n=this.style)!=null&&n.size||this.size},value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:t}=await this.$refs;await t.focus()}}}),JP={class:"vs-form-text relative bg-white rounded-lg"},YP={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},XP=["disabled","type","placeholder"];function ZP(t,e,n,r,o,s){var c;const i=yr("IconClose"),l=yr("IconSearch"),a=yr("IconEmail");return S(),T("div",JP,[t.clearable&&t.value?(S(),T("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...u)=>t.clearInput&&t.clearInput(...u))},[ce(i,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):pe("",!0),t.icon&&t.icon==="search"?(S(),T("div",{key:1,class:ae(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",t.iconStylePosition])},[ce(l,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):t.icon&&t.icon==="email"?(S(),T("div",YP,[ce(a,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(S(),T("i",{key:3,class:ae(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+t.icon,t.iconStylePosition]])},null,2)),t.clearable&&t.value?(S(),T("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...u)=>t.clearInput&&t.clearInput(...u))},[ce(i,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):pe("",!0),nt(v("input",ao({ref:"vsText",disabled:t.disabled,type:t.type,onInput:e[2]||(e[2]=(...u)=>t.handleInput&&t.handleInput(...u)),placeholder:t.placeholder,"onUpdate:modelValue":e[3]||(e[3]=u=>t.value=u)},((c=t.style)==null?void 0:c.attrs)||t.attrs||{},{onFocus:e[4]||(e[4]=(...u)=>t.handleFocus&&t.handleFocus(...u)),onBlur:e[5]||(e[5]=(...u)=>t.handleBlur&&t.handleBlur(...u)),class:[[t.inputStyle,t.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,XP),[[$p,t.value]])])}const fk=Lt(qP,[["render",ZP],["__scopeId","data-v-749b581f"]]);function Ih(){const t=Q("en");return{t:e=>{var n;return((n={en:{type_tag:"Type Tag",heading_1:"Heading 1",heading_2:"Heading 2",heading_3:"Heading 3",paragraph:"Paragraph",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",mergeCells:"Merge Cells",splitCells:"Split Cells",linkTitle:"Enter Link"},uk:{type_tag:"Тип тегу",heading_1:"Заголовок 1",heading_2:"Заголовок 2",heading_3:"Заголовок 3",paragraph:"Параграф",createTable:"Створити Таблицю",addColumn:"Додати Колону",addRow:"Додати Рядок",deleteColumn:"Вилучити Колону",deleteRow:"Вилучити Рядок",deleteTable:"Вилучити Таблицю",mergeCells:"Об'єднати Клітинки",splitCells:"Розділити Клітинки",linkTitle:"Введіть Посилання"}}[t.value])==null?void 0:n[e])||e},locale:t}}const QP={class:"flex flex-col gap-3 p-[20px]"},eD={class:"relative flex items-center gap-2"},tD={class:"flex-1"},nD={key:0,class:"flex items-center gap-2 flex-shrink-0"},rD={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},oD=Object.assign({inheritAttrs:!1},{__name:"vs-editor-link",props:{editor:Object},setup(t){const{t:e}=Ih(),n=t,r=Q(!1),o=Q(""),s=Q(!1),i=()=>{if(!n.editor)return;n.editor.chain().focus().extendMarkRange("link").run();const d=n.editor.getAttributes("link");d.href?(s.value=!0,o.value=d.href):(s.value=!1,o.value=""),r.value=!0},l=()=>{r.value=!1,o.value="",s.value=!1},a=()=>{if(!n.editor||!o.value.trim())return;let d=o.value.trim();d.match(/^https?:\/\//i)||(d="https://"+d),n.editor.chain().focus().setLink({href:d}).run(),l()},c=()=>{n.editor&&(n.editor.chain().focus().unsetLink().run(),l())},u=()=>{if(!o.value)return;let d=o.value.trim();d.match(/^https?:\/\//i)||(d="https://"+d),window.open(d,"_blank","noopener,noreferrer")};return(d,f)=>{var p;return S(),T(Me,null,[v("button",{title:"Link",onClick:i,class:ae(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none",{"bg-gray-100 text-gray-900":(p=t.editor)==null?void 0:p.isActive("link")}])},[...f[2]||(f[2]=[v("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[v("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])],2),ce(dk,{title:s.value?me(e)("editLink")||"Edit Link":me(e)("linkTitle")||"Add Link",visible:r.value,"onUpdate:visible":f[1]||(f[1]=h=>r.value=h),size:"small"},{footer:Ke(()=>[v("div",rD,[v("button",{style:{border:"1px solid #000"},onClick:l,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},we(me(e)("cancel")||"Cancel"),1),v("button",{onClick:a,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},we(s.value?me(e)("update")||"Update":me(e)("create")||"Create"),1)])]),default:Ke(()=>[v("div",QP,[v("div",eD,[v("div",tD,[ce(fk,{modelValue:o.value,"onUpdate:modelValue":f[0]||(f[0]=h=>o.value=h),placeholder:me(e)("linkUrl")||"Enter URL",class:"w-full"},null,8,["modelValue","placeholder"])]),s.value?(S(),T("div",nD,[v("button",{onClick:u,class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none transition-colors",title:"Open link"},[...f[3]||(f[3]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[v("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])]),v("button",{onClick:c,class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-red-600 hover:bg-red-50 focus:outline-none transition-colors",title:"Remove link"},[...f[4]||(f[4]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[v("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])])])):pe("",!0)])])]),_:1},8,["title","visible"])],64)}}}),Di=async(t,e,n,r=10)=>{var m,y,g,k;if(!e||!n)return;await zt();const o=await(n==null?void 0:n.getBoundingClientRect()),s=await(e==null?void 0:e.getBoundingClientRect());if(!s||!o)return;const i=await parseInt((m=e==null?void 0:e.getBoundingClientRect())==null?void 0:m.height),l=await parseInt((y=e==null?void 0:e.getBoundingClientRect())==null?void 0:y.width),a=await parseInt((g=n==null?void 0:n.getBoundingClientRect())==null?void 0:g.height),c=await parseInt((k=n==null?void 0:n.getBoundingClientRect())==null?void 0:k.width),u=await window.innerHeight,d=await window.innerWidth;let f=0,p=0;const h=s.bottom+r+a;switch(t){case"top":s.top-o.height-r<0?f=s.top-o.height+r+a+i:f=s.top-o.height-r,d>c+s.right+30?p=s.left-o.width/2+s.width/2:p=d-30-c;break;case"bottom":u>h?f=s.bottom+r:f=s.bottom-r-a-i,p=s.left-o.width/2+s.width/2;break;case"left":f=s.top-o.height/2+s.height/2,s.left-o.width-r>0?p=s.left-o.width-r:p=10;break;case"right":f=s.top-o.height/2+s.height/2,d-l>c?p=s.right+r:p=d-30-c;break;case"top-right":s.top-o.height-r<0?f=s.top-o.height+r+a+i:f=s.top-o.height-r,d-l>c?p=s.right+r:p=d-30-c;break;case"top-left":s.top-o.height-r<0?f=s.top-o.height+r+a+i:f=s.top-o.height-r,s.left-o.width-r>0?p=s.left-o.width-r:p=10;break;case"top-start":s.top-o.height-r<0?f=s.top-o.height+r+a+i:f=s.top-o.height-r,s.left>0?p=s.left:p=10;break;case"bottom-right":u>h?f=s.bottom+r:f=s.bottom-r-a-i,d-l>c?p=s.left:p=d-30-c;break;case"bottom-left":u>h?f=s.bottom+r:f=s.bottom-r-a-i,s.left>0?p=s.right-c:p=10;break;case"bottom-start":u>h?f=s.bottom+r:f=s.bottom-r-a-i,s.left>0?p=s.left:p=10;break}f+a>u?f=u-a-r:f<0&&(f=r),p+c>d?p=d-c-r:p<0&&(p=r),n instanceof HTMLElement&&(n.style.top=`${f}px`,n.style.left=`${p}px`,n.style.position="fixed")},sD={class:"text-center"},iD={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Qo=Object.assign({inheritAttrs:!1},{__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"body"}},emits:["isvisible"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=Q(!1),i=Q([]),l=Q(null),a=Q(null),c=Q(null);Re(s,w=>{w?(u(),window.addEventListener("resize",()=>Di(r.placement,a.value,c.value)),Di(r.placement,a.value,c.value)):window.removeEventListener("resize",()=>Di(r.placement,a.value,c.value)),o("isvisible",w)}),rt(()=>{window.addEventListener("click",y),window.addEventListener("popstate",g),window.addEventListener("scroll",k,!0),u()}),uo(()=>{window.removeEventListener("click",y),window.removeEventListener("popstate",g),d()});const u=()=>{let w=l.value;for(;w&&w!==document.body;)(w.scrollHeight>w.clientHeight||w.scrollWidth>w.clientWidth)&&(w.addEventListener("scroll",m),i.value.push(w)),w=w.parentElement;document.body&&(document.body.addEventListener("scroll",m),i.value.push(document.body))},d=()=>{i.value.forEach(w=>{w.removeEventListener("scroll",m)}),i.value=[]},f=()=>{s.value=!0,Di(r.placement,a.value,c.value)},p=()=>{s.value=!1},h=async()=>{await Di(r.placement,a.value,c.value),s.value=!s.value},m=()=>{s.value=!1},y=w=>{var b,_;if(!w){s.value=!1;return}(b=a.value)!=null&&b.contains(w.target)||(_=c.value)!=null&&_.contains(w.target)||(s.value=!1)},g=()=>{s.value&&(s.value=!1)},k=w=>{s.value&&c.value&&!c.value.contains(w.target)&&(s.value=!1)};return e({togglePopover:h}),(w,b)=>(S(),T("div",{ref_key:"popover",ref:l,class:"vs-popover inline-block"},[v("div",sD,[t.trigger==="click"?(S(),T("div",{key:0,ref_key:"popoverRef",ref:a,onClick:h,class:ae({"pointer-events-none":t.disabled})},[mn(w.$slots,"reference",{},()=>[b[0]||(b[0]=v("button",null,"Click me!",-1))])],2)):pe("",!0),t.trigger==="hover"?(S(),T("div",{key:1,ref_key:"popoverRef",ref:a,onMouseover:f,onMouseleave:p,class:ae({"pointer-events-none":t.disabled})},[mn(w.$slots,"reference",{},()=>[b[1]||(b[1]=v("button",null,"Click me!",-1))])],34)):pe("",!0),(S(),Ae(Is,{to:t.teleport},[ce(Rs,{name:"fade"},{default:Ke(()=>[nt(v("div",{class:ae(["vsTailwind vs-popover__content",t.placement]),ref_key:"contentPop",ref:c,style:pt({width:t.width?t.width+"px":"fit-content",zIndex:100001})},[v("div",iD,[mn(w.$slots,"default",{},()=>[b[2]||(b[2]=v("span",null,"Popover content",-1))])])],6),[[jo,s.value]])]),_:3})],8,["to"]))])],512))}}),lD={class:"flex flex-col gap-[2px] p-[2px]"},aD=["onClick"],cD={__name:"vs-editor-table",props:{editor:Object},setup(t){const{t:e}=Ih(),n=t,r=Q(!1),o=Q("popover"),s=()=>{n.editor&&(n.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),o.value.togglePopover())},i=()=>{n.editor&&(n.editor.chain().focus().addColumnAfter().run(),o.value.togglePopover())},l=()=>{n.editor&&(n.editor.chain().focus().addRowAfter().run(),o.value.togglePopover())},a=()=>{n.editor&&(n.editor.chain().focus().deleteColumn().run(),o.value.togglePopover())},c=()=>{n.editor&&(n.editor.chain().focus().deleteRow().run(),o.value.togglePopover())},u=()=>{n.editor&&(n.editor.chain().focus().deleteTable().run(),o.value.togglePopover())},d=()=>{n.editor&&(n.editor.chain().focus().mergeCells().run(),o.value.togglePopover())},f=()=>{n.editor&&(n.editor.chain().focus().splitCell().run(),o.value.togglePopover())},p=te(()=>[{text:e("createTable"),function:s},{text:e("addColumn"),function:i},{text:e("addRow"),function:l},{text:e("deleteColumn"),function:a},{text:e("deleteRow"),function:c},{text:e("deleteTable"),function:u},{text:e("mergeCells"),function:d},{text:e("splitCells"),function:f}]);return(h,m)=>(S(),Ae(Qo,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:m[0]||(m[0]=y=>r.value=y)},{reference:Ke(()=>[v("button",{title:"Table",class:ae(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...m[1]||(m[1]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),v("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),v("path",{d:"M3 10h18"}),v("path",{d:"M10 3v18"})],-1)])],2)]),default:Ke(()=>[v("div",lD,[(S(!0),T(Me,null,Je(p.value,(y,g)=>(S(),T("button",{key:g,onClick:y==null?void 0:y.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},we(y.text),9,aD))),128))])]),_:1},512))}},uD={},dD={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function fD(t,e,n,r,o,s){return S(),T("svg",dD,[...e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M4 6l16 0"},null,-1),v("path",{d:"M8 12l8 0"},null,-1),v("path",{d:"M6 18l12 0"},null,-1)])])}const pD=Lt(uD,[["render",fD]]),hD={},mD={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function gD(t,e,n,r,o,s){return S(),T("svg",mD,[...e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M4 6l16 0"},null,-1),v("path",{d:"M10 12l10 0"},null,-1),v("path",{d:"M6 18l14 0"},null,-1)])])}const yD=Lt(hD,[["render",gD]]),bD={},vD={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function wD(t,e,n,r,o,s){return S(),T("svg",vD,[...e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M4 6l16 0"},null,-1),v("path",{d:"M4 12l10 0"},null,-1),v("path",{d:"M4 18l14 0"},null,-1)])])}const xD=Lt(bD,[["render",wD]]),kD={},_D={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-justify"};function CD(t,e,n,r,o,s){return S(),T("svg",_D,[...e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M4 6h16"},null,-1),v("path",{d:"M4 12h16"},null,-1),v("path",{d:"M4 18h16"},null,-1)])])}const ED=Lt(kD,[["render",CD]]),cy={left:xD,center:pD,right:yD,justify:ED},SD={class:"flex gap-[4px] p-1"},MD=["title","onClick"],TD={__name:"vs-editor-align",props:{editor:Object},setup(t){const e=t,n=Q(!1),r=Q("popover"),o=Q("left"),s=te(()=>e.editor?e.editor.isActive("paragraph",{textAlign:"left"})||e.editor.isActive("heading",{textAlign:"left"}):!1),i=te(()=>e.editor?e.editor.isActive("paragraph",{textAlign:"right"})||e.editor.isActive("heading",{textAlign:"right"}):!1),l=te(()=>e.editor?e.editor.isActive("paragraph",{textAlign:"center"})||e.editor.isActive("heading",{textAlign:"center"}):!1),a=te(()=>e.editor?e.editor.isActive("paragraph",{textAlign:"justify"})||e.editor.isActive("heading",{textAlign:"justify"}):!1),c=te(()=>s.value||i.value||l.value||a.value),u=()=>{i.value?o.value="right":l.value?o.value="center":a.value?o.value="justify":o.value="left"};Re([s,i,l,a],()=>{u()},{immediate:!0}),rt(()=>{e.editor&&(e.editor.on("selectionUpdate",u),e.editor.on("update",u))}),gn(()=>{e.editor&&(e.editor.off("selectionUpdate",u),e.editor.off("update",u))});const d=p=>{e.editor&&(e.editor.chain().focus().setTextAlign(p).run(),o.value=p)},f=Q([{id:"left",isActive:s},{id:"center",isActive:l},{id:"right",isActive:i},{id:"justify",isActive:a}]);return(p,h)=>(S(),Ae(Qo,{ref_key:"popover",ref:r,placement:"bottom",onIsvisible:h[0]||(h[0]=m=>n.value=m)},{reference:Ke(()=>[v("button",{title:"Text Align",class:ae(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[c.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(S(),Ae(Cn(me(cy)[o.value]),{height:"16",width:"16"}))],2)]),default:Ke(()=>[v("div",SD,[(S(!0),T(Me,null,Je(f.value,m=>(S(),T("button",{title:"Text align "+(m==null?void 0:m.id),class:ae(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":m==null?void 0:m.isActive}]),key:m==null?void 0:m.id,onClick:y=>d(m==null?void 0:m.id)},[(S(),Ae(Cn(me(cy)[m==null?void 0:m.id]),{height:"16",width:"16"}))],10,MD))),128))])]),_:1},512))}},AD={class:"flex flex-col gap-[2px] p-[2px]"},LD=["onClick"],OD={__name:"vs-editor-type-tag",props:{editor:Object},setup(t){const{t:e}=Ih(),n=t,r=Q(!1),o=Q("popover"),s=()=>{var a;n.editor&&((a=n.editor)==null||a.chain().focus().setParagraph().run(),o.value.togglePopover())},i=a=>{var c;n.editor&&((c=n.editor)==null||c.chain().focus().toggleHeading({level:a}).run(),o.value.togglePopover())},l=te(()=>[{text:e("richtext.heading1"),id:1,style:"font-[700] text-[30px]"},{text:e("richtext.heading2"),id:2,style:"font-[700] text-[26px]"},{text:e("richtext.heading3"),id:3,style:"font-[700] text-[22px]"},{text:e("richtext.heading4"),id:4,style:"font-[700] text-[18px]"},{text:e("richtext.heading5"),id:5,style:"font-[500] text-[16px]"},{text:e("richtext.heading6"),id:6,style:"font-[400] text-[14px]"}]);return(a,c)=>(S(),Ae(Qo,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:c[0]||(c[0]=u=>r.value=u)},{reference:Ke(()=>[v("button",{title:"Type Tag",class:ae(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...c[1]||(c[1]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),v("path",{d:"M3 7v-2h13v2"}),v("path",{d:"M10 5v14"}),v("path",{d:"M12 19h-4"}),v("path",{d:"M15 13v-1h6v1"}),v("path",{d:"M18 12v7"}),v("path",{d:"M17 19h2"})],-1)])],2)]),default:Ke(()=>{var u;return[v("div",AD,[v("button",{onClick:s,class:ae(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[(u=t.editor)!=null&&u.isActive("paragraph")?"bg-gray-100":""]])},we(me(e)("richtext.paragraph")),3),(S(!0),T(Me,null,Je(l.value,(d,f)=>{var p;return S(),T("button",{key:f,onClick:h=>i(d==null?void 0:d.id),class:ae(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[d==null?void 0:d.style,(p=t.editor)!=null&&p.isActive("heading",{level:d==null?void 0:d.id})?"bg-gray-100":""]])},we(me(e)(`richtext.heading${d==null?void 0:d.id}`)),11,LD)}),128))])]}),_:1},512))}},ND={},ID={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function RD(t,e,n,r,o,s){return S(),T("svg",ID,[...e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const ll=Lt(ND,[["render",RD]]),PD={components:{VsText:fk},inheritAttrs:!1,events:["update:modelValue"],props:{modelValue:{type:String},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}}},DD={class:"flex items-center w-full max-w-[182px]"},$D=["disabled"];function FD(t,e,n,r,o,s){const i=yr("vs-text");return S(),T("div",DD,[nt(v("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>s.value=l),type:"color",class:ae(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",n.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:n.disabled},null,10,$D),[[jt,s.value]]),n.isTextInputShown?(S(),Ae(i,{key:0,modelValue:s.value,"onUpdate:modelValue":e[1]||(e[1]=l=>s.value=l),class:"ml-2 w-full",disabled:n.disabled,clearable:n.clearable},null,8,["modelValue","disabled","clearable"])):pe("",!0)])}const pk=Lt(PD,[["render",FD]]),VD={class:"flex gap-[4px] mb-[8px]"},BD={class:"grid grid-rows-3 grid-cols-7"},HD={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},jD=["onClick","title"],zD={__name:"vs-editor-color",props:{editor:Object},setup(t){const e=t,n=Q("popover"),r=Q("#000000"),o=te(()=>e.editor&&e.editor.getAttributes("textStyle").color||"#000000"),s=te(()=>o.value!=="#000000"),i=()=>{e.editor&&(r.value=o.value)};rt(()=>{e.editor&&(e.editor.on("selectionUpdate",i),e.editor.on("update",i),i())}),gn(()=>{e.editor&&(e.editor.off("selectionUpdate",i),e.editor.off("update",i))});const l=Q(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),a=d=>{e.editor&&(e.editor.chain().focus().setColor(d).run(),r.value=d,n.value&&n.value.togglePopover())},c=()=>{a(r.value)},u=d=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple","#FFFFFF":"White","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[d]||d;return(d,f)=>(S(),Ae(Qo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:Ke(()=>[v("button",{title:"Text Color",class:ae(["flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex",{"bg-gray-100":s.value}])},[f[1]||(f[1]=v("span",{class:"leading-none"},"A",-1)),v("span",{class:"block h-1 w-5",style:pt({backgroundColor:r.value})},null,4)],2)]),default:Ke(()=>[v("div",null,[v("div",VD,[ce(pk,{modelValue:r.value,"onUpdate:modelValue":f[0]||(f[0]=p=>r.value=p)},null,8,["modelValue"]),v("button",{onClick:c,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[ce(ll,{class:"h-[24px] w-[24px] text-white"})])]),v("div",BD,[(S(!0),T(Me,null,Je(l.value,p=>(S(),T("div",{key:p,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[v("div",HD,[v("button",{class:"flex items-center justify-center w-full h-full",style:pt({backgroundColor:p}),onClick:h=>a(p),title:u(p)},[r.value===p?(S(),Ae(ll,{key:0,class:"h-5 w-5 text-gray-500"})):pe("",!0)],12,jD)])]))),128))])])]),_:1},512))}},UD={class:"flex gap-[4px] mb-[8px]"},WD={class:"grid grid-rows-3 grid-cols-7"},KD={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},GD=["onClick","title"],qD=["onClick","title"],JD={__name:"vs-editor-background-color",props:{editor:Object},setup(t){const e=t,n=Q("popover"),r=Q("transparent"),o=te(()=>e.editor&&e.editor.getAttributes("textStyle").backgroundColor||"transparent"),s=te(()=>o.value!=="transparent"&&o.value!==""),i=()=>{e.editor&&(r.value=o.value)};rt(()=>{e.editor&&(e.editor.on("selectionUpdate",i),e.editor.on("update",i),i())}),gn(()=>{e.editor&&(e.editor.off("selectionUpdate",i),e.editor.off("update",i))});const l=Q(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),a=d=>{e.editor&&(e.editor.chain().focus().setBackgroundColor(d).run(),r.value=d,n.value&&n.value.togglePopover())},c=()=>{a(r.value)},u=d=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple",transparent:"Transparent","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[d]||d;return(d,f)=>(S(),Ae(Qo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:Ke(()=>[v("button",{title:"Background Color",class:ae(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex",{"bg-gray-100":s.value}])},[f[2]||(f[2]=v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"}),v("path",{d:"m5 2 5 5"}),v("path",{d:"M2 13h15"}),v("path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"})],-1)),v("span",{class:"block h-1 w-5",style:pt({backgroundColor:r.value})},null,4)],2)]),default:Ke(()=>[v("div",null,[v("div",UD,[ce(pk,{modelValue:r.value,"onUpdate:modelValue":f[0]||(f[0]=p=>r.value=p)},null,8,["modelValue"]),v("button",{onClick:c,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[ce(ll,{class:"h-[24px] w-[24px] text-white"})])]),v("div",WD,[v("button",{onClick:f[1]||(f[1]=p=>a("transparent")),class:"col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"},[...f[3]||(f[3]=[v("svg",{fill:"#000000",width:"16",height:"16",viewBox:"0 0 52 52","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg"},[v("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),v("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),v("g",{id:"SVGRepo_iconCarrier"},[v("path",{d:"M48.5,5.6,46.4,3.5a1.67,1.67,0,0,0-2.4.3L32.59,15.21c-.77-1.3-1.51-2.61-2.21-4a36.5,36.5,0,0,1-3.15-8.36c-.13-.53-.39-.91-1-.89s-.86.4-1,.93c-.06.26-.11.51-.17.76A48.3,48.3,0,0,1,21,13.7,97.47,97.47,0,0,1,14.13,25a16,16,0,0,0-3,11.12c0,.14,0,.29.06.43L3.8,44a1.87,1.87,0,0,0-.3,2.4l2.1,2.1A1.67,1.67,0,0,0,8,48.2L48.2,8A1.67,1.67,0,0,0,48.5,5.6Z"}),v("path",{d:"M38.42,23.79l-22,22.31A14.47,14.47,0,0,0,26.22,50a15.48,15.48,0,0,0,7-1.44c4.94-2.51,8.11-6.4,8.94-12A15.22,15.22,0,0,0,39,24.66C38.87,24.44,38.58,24,38.42,23.79Z"})])],-1),v("p",null,"no color",-1)])]),(S(!0),T(Me,null,Je(l.value,p=>(S(),T("div",{key:p,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[v("div",KD,[p!=="transparent"?(S(),T("button",{key:0,class:"flex items-center justify-center w-full h-full",style:pt({backgroundColor:p}),onClick:h=>a(p),title:u(p)},[r.value===p?(S(),Ae(ll,{key:0,class:"h-5 w-5 text-gray-500"})):pe("",!0)],12,GD)):pe("",!0),p==="transparent"?(S(),T("button",{key:1,class:"flex items-center justify-center w-full h-full",onClick:h=>a(p),title:u(p)},[r.value===p?(S(),Ae(ll,{key:0,class:"h-5 w-5 text-gray-500"})):pe("",!0)],8,qD)):pe("",!0)])]))),128))])])]),_:1},512))}},YD={__name:"vs-editor-highlight",props:{editor:Object},setup(t){const e=t,n=te(()=>{var o;return(o=e.editor)==null?void 0:o.isActive("highlight")}),r=()=>{e.editor&&e.editor.chain().focus().toggleHighlight().run()};return(o,s)=>(S(),T("button",{title:"Highlight",onClick:r,class:ae(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex",{"bg-gray-200":n.value}])},[...s[0]||(s[0]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"m9 11-6 6v3h9l3-3"}),v("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})],-1)])],2))}},XD={class:"truncate"},ZD={class:"w-[200px]"},QD={class:"max-h-[200px] overflow-y-auto"},e$=["onClick"],t$={__name:"vs-editor-font-family",props:{editor:Object},setup(t){const e=t,n=Q("popover"),r=Q(!1),o=Q([{label:"Arial",value:"Arial, sans-serif"},{label:"Helvetica",value:"Helvetica, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Comic Sans MS",value:"Comic Sans MS, cursive"},{label:"Impact",value:"Impact, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Palatino",value:"Palatino, serif"}]),s=te(()=>{if(!e.editor)return"Arial, sans-serif";for(const c of o.value)if(e.editor.isActive("textStyle",{fontFamily:c.value}))return c.value;return"Arial, sans-serif"}),i=te(()=>{var c;return((c=o.value.find(u=>u.value===s.value))==null?void 0:c.label)||"Arial"}),l=c=>e.editor?e.editor.isActive("textStyle",{fontFamily:c}):!1,a=c=>{e.editor&&(e.editor.chain().focus().setFontFamily(c).run(),n.value&&n.value.togglePopover())};return(c,u)=>(S(),Ae(Qo,{ref_key:"popover",ref:n,placement:"bottom",onIsvisible:u[0]||(u[0]=d=>r.value=d)},{reference:Ke(()=>[v("button",{title:"Font Family",class:ae(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm",[r.value?"bg-gray-100 text-gray-900":"text-gray-700"]]),style:pt({fontFamily:s.value})},[v("span",XD,we(i.value),1),u[1]||(u[1]=v("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("polyline",{points:"6,9 12,15 18,9"})],-1))],6)]),default:Ke(()=>[v("div",ZD,[v("ul",QD,[(S(!0),T(Me,null,Je(o.value,d=>(S(),T("li",{key:d.value,class:ae(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",{"bg-gray-100":l(d.value)}]),style:pt({fontFamily:d.value}),onClick:f=>a(d.value)},we(d.label),15,e$))),128))])])]),_:1},512))}},n$={class:"w-[120px]"},r$={class:"max-h-[200px] overflow-y-auto"},o$=["onClick"],s$={__name:"vs-editor-font-size",props:{editor:Object},setup(t){const e=t,n=Q("popover"),r=Q("14px"),o=te(()=>e.editor&&e.editor.getAttributes("textStyle").fontSize||"14px"),s=te(()=>o.value!=="14px"),i=()=>{e.editor&&(r.value=o.value)};rt(()=>{e.editor&&(e.editor.on("selectionUpdate",i),e.editor.on("update",i),i())}),gn(()=>{e.editor&&(e.editor.off("selectionUpdate",i),e.editor.off("update",i))});const l=Q([{label:"8px",value:"8px"},{label:"9px",value:"9px"},{label:"10px",value:"10px"},{label:"11px",value:"11px"},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"36px",value:"36px"},{label:"48px",value:"48px"},{label:"72px",value:"72px"}]),a=c=>{e.editor&&(e.editor.chain().focus().setFontSize(c).run(),r.value=c,n.value&&n.value.togglePopover())};return(c,u)=>(S(),Ae(Qo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:Ke(()=>[v("button",{title:"Font Size",class:ae(["h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1",{"bg-gray-100 text-gray-900":s.value}])},[...u[0]||(u[0]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-alarge-small-icon lucide-a-large-small"},[v("path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"}),v("path",{d:"M15.697 14h5.606"}),v("path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"}),v("path",{d:"M3.304 13h6.392"})],-1),v("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("polyline",{points:"6,9 12,15 18,9"})],-1)])],2)]),default:Ke(()=>[v("div",n$,[v("ul",r$,[(S(!0),T(Me,null,Je(l.value,d=>(S(),T("li",{key:d.value,class:"px-3 py-2 hover:bg-gray-100 cursor-pointer",onClick:f=>a(d.value)},we(d.label),9,o$))),128))])])]),_:1},512))}},i$={props:{editor:Object},methods:{toggleSuperscript(){this.editor&&this.editor.commands.toggleSuperscript()}}};function l$(t,e,n,r,o,s){var i;return S(),T("button",{title:"Superscript",onClick:e[0]||(e[0]=(...l)=>s.toggleSuperscript&&s.toggleSuperscript(...l)),class:ae(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":(i=n.editor)==null?void 0:i.isActive("superscript")}])},[...e[1]||(e[1]=[tn('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript-icon lucide-superscript"><path d="m4 19 8-8"></path><path d="m12 19-8-8"></path><path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"></path></svg><span class="sr-only">Superscript</span>',2)])],2)}const a$=Lt(i$,[["render",l$]]),c$={props:{editor:Object},methods:{toggleSubscript(){this.editor&&this.editor.commands.toggleSubscript()}}};function u$(t,e,n,r,o,s){var i;return S(),T("button",{title:"Subscript",onClick:e[0]||(e[0]=(...l)=>s.toggleSubscript&&s.toggleSubscript(...l)),class:ae(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":(i=n.editor)==null?void 0:i.isActive("subscript")}])},[...e[1]||(e[1]=[tn('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-subscript-icon lucide-subscript"><path d="m4 5 8 8"></path><path d="m12 5-8 8"></path><path d="M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07"></path></svg><span class="sr-only">Subscript</span>',2)])],2)}const d$=Lt(c$,[["render",u$]]),f$={title:"Heading",class:"h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"},p$={class:"truncate"},h$={class:"max-h-[200px] overflow-y-auto"},m$=["onClick"],g$={__name:"vs-editor-heading",props:{editor:Object},setup(t){const e=t,n=Q("popover"),r=Q([{label:"Heading 1",value:1},{label:"Heading 2",value:2},{label:"Heading 3",value:3},{label:"Heading 4",value:4},{label:"Heading 5",value:5},{label:"Heading 6",value:6}]),o=te(()=>{if(!e.editor)return"Paragraph";for(let a=1;a<=6;a++)if(e.editor.isActive("heading",{level:a}))return`H ${a}`;return"P"}),s=a=>({1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"})[a]||"",i=a=>{e.editor&&(e.editor.chain().focus().setHeading({level:a}).run(),n.value&&n.value.togglePopover())},l=()=>{e.editor&&(e.editor.chain().focus().setParagraph().run(),n.value&&n.value.togglePopover())};return(a,c)=>(S(),Ae(Qo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:Ke(()=>[v("button",f$,[v("span",p$,we(o.value),1),c[0]||(c[0]=v("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("polyline",{points:"6,9 12,15 18,9"})],-1))])]),default:Ke(()=>[v("div",null,[v("ul",h$,[(S(!0),T(Me,null,Je(r.value,u=>(S(),T("li",{key:u.value,class:ae(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",`heading-level-${u.value}`]),style:pt(s(u.value)),onClick:d=>i(u.value)},we(u.label),15,m$))),128)),v("li",{class:"px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",onClick:l}," Paragraph ")])])]),_:1},512))}},y$=Lt(g$,[["__scopeId","data-v-ef7c378e"]]),b$={props:{editor:Object},methods:{clearFormatting(){this.editor&&this.editor.commands.unsetAllMarks()}}};function v$(t,e,n,r,o,s){return S(),T("button",{title:"Clear Formatting",onClick:e[0]||(e[0]=(...i)=>s.clearFormatting&&s.clearFormatting(...i)),class:"h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[tn('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-remove-formatting-icon lucide-remove-formatting"><path d="M4 7V4h16v3"></path><path d="M5 20h6"></path><path d="M13 4 8 20"></path><path d="m15 15 5 5"></path><path d="m20 15-5 5"></path></svg><span class="sr-only">Clear Formatting</span>',2)])])}const w$=Lt(b$,[["render",v$]]),Xl=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},x$={key:0,class:"vsTailwind ui-dialog__wrapper text-gray-800"},k$={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},_$={class:"font-medium text-gray-800 dark:text-[#ffffff]"},C$={class:"ui-dialog__content p-4"},E$={key:0,class:"flex justify-end gap-x-2"},S$={key:1,class:"flex justify-end items-center gap-x-2 py-3 px-4 border-t border-gray-200 dark:border-neutral-700"},M$=_e({__name:"vs-modal",props:{title:{default:""},template:{},visible:{type:Boolean,default:!1},size:{default:"small"},closeClickBack:{type:Boolean,default:!1},content:{},buttonText:{},contentProps:{},teleport:{default:"body"}},emits:["update:visible","close","done"],setup(t,{emit:e}){const n=t,r=e,o=te(()=>n.size==="small"?"md:w-5/12 w-9/12":n.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"),s=d_();function i(){r("done")}function l(){r("update:visible",!1),r("close")}function a(u){u.key==="Escape"&&l()}function c(u,d){d&&u.target.classList.contains("vs-dialog-overlay")&&l()}return rt(()=>{window.addEventListener("keydown",a)}),gn(()=>{window.removeEventListener("keydown",a)}),(u,d)=>(S(),Ae(Is,{to:u.teleport},[u.visible?(S(),T("div",x$,[v("div",{onMousedown:d[0]||(d[0]=f=>c(f,u.closeClickBack)),class:ae(["vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 bg-black bg-opacity-50",[me(s).class]])},[ce(Rs,{name:"content",appear:""},{default:Ke(()=>[v("div",{class:ae(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",o.value])},[v("div",k$,[v("h3",_$,we(u.title),1),v("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:l},[...d[1]||(d[1]=[v("span",{class:"sr-only"},"Close",-1),v("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"M18 6 6 18"}),v("path",{d:"m6 6 12 12"})],-1)])])]),v("div",C$,[mn(u.$slots,"default",{},void 0,!0)]),u.$slots.footer?(S(),T("div",E$,[mn(u.$slots,"footer",{handleClose:l},void 0,!0)])):pe("",!0),u.buttonText?(S(),T("div",S$,[v("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:l}," Close "),v("button",{type:"button",onClick:i,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-hidden focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none"},we(u.buttonText),1)])):pe("",!0)],2)]),_:3})],34)])):pe("",!0)],8,["to"]))}}),Rh=Xl(M$,[["__scopeId","data-v-a6807cab"]]),T$={},A$={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-green-600"};function L$(t,e){return S(),T("svg",A$,[...e[0]||(e[0]=[v("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const O$=Xl(T$,[["render",L$]]),N$={},I$={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"orange",class:"size-6 text-orange-600"};function R$(t,e){return S(),T("svg",I$,[...e[0]||(e[0]=[v("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])}const P$=Xl(N$,[["render",R$]]),D$={},$$={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-blue-600"};function F$(t,e){return S(),T("svg",$$,[...e[0]||(e[0]=[v("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)])])}const V$=Xl(D$,[["render",F$]]),B$={},H$={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"size-6 text-red-600"};function j$(t,e){return S(),T("svg",H$,[...e[0]||(e[0]=[v("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)])])}const z$=Xl(B$,[["render",j$]]),U$={class:"rounded-md border border-gray-300 bg-white p-4 shadow-sm"},W$={class:"flex items-start gap-4 opacity-100 scale-5 transition-all duration-300"},K$={class:"flex-1"},G$={class:"font-medium text-gray-900"},q$={class:"mt-0.5 text-sm text-gray-700"},J$=_e({__name:"vs-notify",props:{type:{},title:{},message:{}},setup(t){const e={success:O$,warning:P$,error:z$,info:V$};return(n,r)=>(S(),T("div",U$,[v("div",W$,[(S(),Ae(Cn(e[n.type]))),v("div",K$,[v("strong",G$,we(n.title),1),v("p",q$,we(n.message),1)]),r[0]||(r[0]=v("button",{class:"m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",type:"button","aria-label":"Dismiss notify"},[v("span",{class:"sr-only"},"Dismiss popup"),v("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-5"},[v("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})])],-1))])]))}});Ns({visible:!0});const Y$=t=>{const{template:e="",title:n="",content:r,contentProps:o={},size:s="medium"}=t,i=document.querySelector("body");if(!i)return console.error('Modal root element with id "#modal" not found!'),{close:()=>{}};const l=document.createElement("div");i.appendChild(l);const a={title:n,template:e,visible:!0,size:s,closeClickBack:!0,onClose:u},c=gl({render(){return Bn(Rh,a,{default:()=>[r?Bn(r,o):Bn("p",e)]})}});function u(){c.unmount(),l.remove()}return c.mount(l),{close:u}},Ma={top:"top-4 left-1/2 transform -translate-x-1/2","left-bottom":"bottom-4 left-4 transform","right-bottom":"bottom-4 right-4 transform",bottom:"bottom-4 left-1/2 transform -translate-x-1/2"},Nt=t=>{var a;const{type:e="info",title:n,message:r,position:o="right-bottom"}=t||{};let s=document.querySelector("#notify-root");s||(s=document.createElement("div"),s.id="notify-root",s.className=`fixed z-[2000] flex flex-col gap-3 ${Ma[o]} p-6 max-w-md mx-auto font-sans antialiased`,document.body.appendChild(s)),s.className.includes(Ma[o])||(Object.values(Ma).forEach(c=>{s.classList.remove(...c.split(" "))}),s.classList.add(...Ma[o].split(" ")));const i=document.createElement("div");s.appendChild(i);const l=gl({render(){return Bn(J$,{type:e,title:n,message:r,onClose:()=>{l.unmount(),i.remove()}})}});l.mount(i),(a=i.querySelector("button"))==null||a.addEventListener("click",()=>{i.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{l.unmount(),i.remove()},350)}),setTimeout(()=>{i.classList.add("opacity-0","scale-95","transition-all","duration-300"),setTimeout(()=>{l.unmount(),i.remove()},350)},3500)},X$={class:"w-full relative"},Z$={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},Q$={class:"opacity-100"},eF={key:0,class:"text-red-500 text-[14px]"},tF={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},nF=_e({__name:"vs-layout-default",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(t){const e=Q("uk"),n=r=>{r.detail.key==="locale"&&(e.value=r.detail.newValue)};return rt(()=>{e.value=localStorage.locale,window.addEventListener("storage",n)}),gn(()=>{window.removeEventListener("resize",n)}),(r,o)=>{var s,i;return S(),T("div",X$,[r.ua||r.label?(S(),T("div",Z$,[v("span",Q$,we(r.item[e.value]||r.ua||r.label),1),(i=(s=r.item)==null?void 0:s.rules)!=null&&i.includes("required")?(S(),T("span",eF,"*")):pe("",!0)])):pe("",!0),mn(r.$slots,"default",ao(r.$attrs,{class:{"opacity-60":r.item.disabled}})),r.error?(S(),T("span",tF,we(r.error),1)):pe("",!0)])}}}),rF={class:"w-full relative flex flex-row items-center gap-2"},oF={key:0,class:"text-red-500 text-[14px]"},sF={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},iF=_e({__name:"vs-layout-horizontal",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{default:()=>({container:12,label:3})}},setup(t){const e=t,n=te(()=>e.columns??{container:12,label:3}),r=te(()=>{const{container:l,label:a}=n.value;return!l||l<=0?0:Math.min(Math.max(a??0,0),l)/l}),o=te(()=>{var l;return((l=e.item)==null?void 0:l.type)==="html"||r.value<=0?!1:!!(e.ua||e.label)}),s=te(()=>{if(!o.value)return{};const l=`${r.value*100}%`;return{flexBasis:l,maxWidth:l}}),i=te(()=>{var d;const{container:l,label:a}=n.value;if(!l||l<=0)return{};if(((d=e.item)==null?void 0:d.type)==="html")return{flexBasis:"100%",maxWidth:"100%"};if(!o.value)return{flexBasis:"100%",maxWidth:"100%"};const c=Math.max(l-Math.max(a??0,0),0)/l;if(!c)return{};const u=`${c*100}%`;return{flexBasis:u,maxWidth:u}});return(l,a)=>{var c,u;return S(),T("div",rF,[o.value?(S(),T("span",{key:0,class:"text-sm text-gray-900 font-medium flex shrink-0",style:pt(s.value)},[xn(we(l.ua||l.label)+" ",1),(u=(c=l.item)==null?void 0:c.rules)!=null&&u.includes("required")&&(l.ua||l.label)?(S(),T("span",oF,"*")):pe("",!0)],4)):pe("",!0),v("div",{class:"flex-1 min-w-0",style:pt(i.value)},[mn(l.$slots,"default",vp(bu(l.$attrs)))],4),l.error?(S(),T("span",sF,we(l.error),1)):pe("",!0)])}}}),lF={class:"w-full relative"},aF={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},cF=_e({__name:"vs-layout-inline",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(t){return(e,n)=>(S(),T("div",lF,[mn(e.$slots,"default",vp(bu(e.$attrs))),e.error?(S(),T("span",aF,we(e.error),1)):pe("",!0)]))}}),uF={class:"flex-1 min-w-0"},dF={key:0,class:"text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"},fF={class:"truncate"},pF={key:0,class:"text-red-500 text-[14px]"},hF={key:1,class:"text-xs text-slate-500 dark:text-slate-400"},mF={key:0,class:"mt-1 text-xs text-red-500"},gF=_e({__name:"vs-layout-settings",props:{ua:{default:""},uk:{},en:{},de:{},es:{},fr:{},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""},columns:{}},setup(t){const e=t,n=Q("uk");te(()=>{var l;return((l=e.item??{})==null?void 0:l[n.value])??e.ua??e.label??""});const r=te(()=>{var l;return((l=e.item)==null?void 0:l.description)??""}),o=te(()=>{var l;return Array.isArray((l=e.item)==null?void 0:l.rules)&&e.item.rules.includes("required")}),s=te(()=>(typeof e.error=="string"?e.error:"")??""),i=l=>{l.key==="locale"&&(n.value=l.newValue??"uk")};return rt(()=>{try{typeof localStorage<"u"&&localStorage.locale&&(n.value=localStorage.locale)}catch{}window.addEventListener("storage",i)}),gn(()=>{window.removeEventListener("storage",i)}),(l,a)=>{var c;return S(),T("div",{class:ae(["w-full relative",{"opacity-60":(c=l.item)==null?void 0:c.disabled}])},[v("div",{class:ae(["gap-2 md:flex-row md:items-center md:justify-between",[["switcher","native-select"].includes(l.item.type)?"flex flex-col":""]])},[v("div",uF,[l.ua||l.label?(S(),T("p",dF,[v("span",fF,we(l.item[n.value]||l.ua||l.label),1),o.value?(S(),T("span",pF,"*")):pe("",!0)])):pe("",!0),r.value?(S(),T("p",hF,we(r.value),1)):pe("",!0)]),v("div",{class:ae(["w-full",["select","native-select"].includes(l.item.type)?"md:w-[30%]":"md:w-auto"])},[mn(l.$slots,"default",vp(bu(l.$attrs)))],2)],2),s.value?(S(),T("p",mF,we(s.value),1)):pe("",!0)],2)}}}),yF={default:nF,horizontal:iF,inline:cF,settings:gF};function Jn(t){return{inputClass:te(()=>{const e=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${(t==null?void 0:t.primaryColor)||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return(t==null?void 0:t.size)==="sm"?`${e}h-[32px]`:`${e}h-[38px]`})}}const bF=["placeholder","disabled"],vF=_e({__name:"vs-input-password",props:yt({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,{inputClass:n}=Jn(e.style),r=It(t,"modelValue"),o=te(()=>!!e.disabled),s=te(()=>e.placeholder??"");return(i,l)=>nt((S(),T("input",{type:"password","onUpdate:modelValue":l[0]||(l[0]=a=>r.value=a),placeholder:s.value,disabled:o.value,class:ae(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[me(n),{"!border-red-600":i.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,bF)),[[jt,r.value]])}}),wF=["placeholder","disabled"],tu=_e({__name:"vs-input-text",props:yt({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,{inputClass:n}=Jn(e.style),r=It(t,"modelValue"),o=te(()=>!!e.disabled),s=te(()=>e.placeholder??"");return(i,l)=>nt((S(),T("input",{type:"text","onUpdate:modelValue":l[0]||(l[0]=a=>r.value=a),placeholder:s.value,disabled:o.value,class:ae(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[me(n),{"!border-red-600":i.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,wF)),[[jt,r.value]])}}),xF=["placeholder","disabled","min","max"],kF=_e({__name:"vs-input-number",props:yt({min:{},max:{},style:{default:()=>({})},customClass:{},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,{inputClass:n}=Jn(e.style),r=It(t,"modelValue"),o=te(()=>!!e.disabled);return(s,i)=>nt((S(),T("input",{type:"number",step:"any","onUpdate:modelValue":i[0]||(i[0]=l=>r.value=l),placeholder:s.placeholder,disabled:o.value,class:ae(["py-1.5 px-3 block w-full bg-white",[me(n)]]),style:{border:"1px solid #CFD9E0"},min:s.min,max:s.max},null,10,xF)),[[jt,r.value]])}}),Ye=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},_F={},CF={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function EF(t,e){return S(),T("svg",CF,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const SF=Ye(_F,[["render",EF]]),MF={class:"flex items-center gap-[4px]"},TF=["value","id","disabled"],AF=["for"],LF={class:"text-[14px] text-gray-700 flex items-center dark:text-neutral-400"},OF=_e({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,r=t,o=te({get:()=>r.modelValue,set:i=>n("update:modelValue",i)}),s=te(()=>!!r.disabled);return(i,l)=>(S(),T("div",MF,[nt(v("input",{type:"checkbox",value:i.value,"onUpdate:modelValue":l[0]||(l[0]=a=>o.value=a),class:ae(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer",{"!cursor-not-allowed":s.value}]),id:i.id,disabled:s.value},null,10,TF),[[vu,o.value]]),v("label",{for:i.id,class:ae(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300",{"!cursor-not-allowed":s.value}])},[v("div",{class:ae(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[o.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",i.error?"border-red-600":""]])},[ce(SF,{height:"12",width:"12"})],2),v("span",LF,[mn(i.$slots,"default",{},()=>[xn(we(i.label),1)])])],10,AF)]))}}),NF=["name","value","disabled"],IF={class:"flex items-center gap-[6px] text-[14px]"},RF={key:0,class:"text-[16px]"},PF=["src"],DF=_e({__name:"vs-checkbox-buttons",props:{value:{type:[String,Number,Boolean],default:""},label:{default:""},modelValue:{default:""},disabled:{type:Boolean},id:{},icon:{},imgUrl:{},style:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=te({get:()=>n.modelValue,set:l=>{r("update:modelValue",l)}}),s=te(()=>Array.isArray(o.value)?o.value.includes(n.value):o.value===!0||o.value===n.value),i=te(()=>{var l,a;return((l=n.style)==null?void 0:l.size)==="xs"?"p-1.5 text-xs":((a=n.style)==null?void 0:a.size)==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs"});return(l,a)=>(S(),T("label",{class:ae(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg",[i.value,s.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[nt(v("input",{type:"checkbox",class:"hidden",name:l.id,value:l.value,"onUpdate:modelValue":a[0]||(a[0]=c=>o.value=c),disabled:l.disabled},null,8,NF),[[vu,o.value]]),v("span",IF,[l.icon||l.imgUrl?(S(),T("span",RF,[l.icon?(S(),T("i",{key:0,class:ae(l.icon)},null,2)):pe("",!0),l.imgUrl?(S(),T("img",{key:1,src:l.imgUrl,width:"16",height:"16",alt:"icon"},null,8,PF)):pe("",!0)])):pe("",!0),mn(l.$slots,"default",{},()=>[xn(we(l.label),1)])])],2))}}),$F={class:"flex items-center"},rp=_e({__name:"vs-input-checkbox-item",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},view:{default:"default"},modelValue:{type:[Boolean,Array],default:!1},icon:{},imgUrl:{},slots:{},option:{},style:{},error:{default:""}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=`radio-${Math.floor(Math.random()*1e4)}`,s=te({get:()=>Array.isArray(n.modelValue)?Array.isArray(n.modelValue)&&n.modelValue.includes(n.value):n.modelValue,set:l=>{if(Array.isArray(n.modelValue)){let a=[...n.modelValue];l?a.includes(n.value)||a.push(n.value):a=a.filter(c=>c!==n.value),r("update:modelValue",a)}else r("update:modelValue",l)}}),i=Q(`vs-checkbox-${n.view||"default"}`);return(l,a)=>{var c;return S(),T("div",$F,[(S(),Ae(Cn(i.value==="vs-checkbox-buttons"?me(DF):me(OF)),{value:l.value,label:l.label,info:(c=l.option)==null?void 0:c.info,disabled:l.disabled,modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=u=>s.value=u),id:o,icon:l.icon,imgUrl:l.imgUrl,style:pt(l.style),error:l.error},{default:Ke(()=>[xn(we(l.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))])}}}),FF={},VF={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"};function BF(t,e){return S(),T("svg",VF,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const HF=Ye(FF,[["render",BF]]),jF={},zF={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function UF(t,e){return S(),T("svg",zF,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M18 6l-12 12"},null,-1),v("path",{d:"M6 6l12 12"},null,-1)]))}const WF=Ye(jF,[["render",UF]]),KF={},GF={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function qF(t,e){return S(),T("svg",GF,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M12 9h.01"},null,-1),v("path",{d:"M11 12h1v4h1"},null,-1),v("path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"},null,-1)]))}const JF=Ye(KF,[["render",qF]]),YF={key:0,class:"flex items-start gap-x-1"},XF={key:0,class:"text-red-500 text-[14px]"},ZF=["title"],QF=["disabled"],hk=_e({__name:"vs-input-switcher",props:yt({rules:{default:()=>[]},view:{default:"checkbox"},label:{default:""},i:{default:""},text:{default:""},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=It(t,"modelValue");return(r,o)=>{var s,i;return e.view==="checkbox"?(S(),T("div",YF,[ce(rp,{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),label:r.text,error:r.error||""},null,8,["modelValue","label","error"]),(s=r.rules)!=null&&s.includes("required")?(S(),T("span",XF,"*")):pe("",!0),r.i?(S(),T("button",{key:1,class:"cursor-pointer",title:r.i,onClick:o[1]||(o[1]=Vn(()=>{},["prevent"]))},[ce(me(JF),{class:"text-gray-500 w-[14px] h-[14px]"})],8,ZF)):pe("",!0)])):(S(),T("button",{key:1,type:"button",class:ae(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50",[n.value?`bg-${((i=r.style)==null?void 0:i.primaryColor)||"blue"}-500`:"bg-stone-200",r.customClass]]),disabled:r.disabled,onClick:o[2]||(o[2]=l=>n.value=!n.value)},[v("span",{"data-state":"checked",class:ae(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[n.value?"translate-x-4":"translate-x-0"]])},null,2)],10,QF))}}}),e6=["id","innerHTML"],uy=_e({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},setup(t){return(e,n)=>(S(),T("div",{id:e.name,class:ae(["text-gray-900",e.customClass]),innerHTML:e.html?e.html:e.text},null,10,e6))}}),t6=["placeholder","disabled","name"],n6=_e({__name:"vs-input-mask",props:yt({name:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholder:{default:"_"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,{inputClass:n}=Jn(e.style),r=It(t,"modelValue"),o=Q(null);let s=null;return rt(async()=>{if(o.value){const{default:i}=await ot(()=>import("./index-W-qQIppj-BsopI3Hz-BIZR-dhy.js"),__vite__mapDeps([]));s=i(o.value,{mask:e.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1}),s.on("accept",()=>{r.value=e.unmask?s.unmaskedValue:s.value}),s.on("complete",()=>{r.value=e.unmask?s.unmaskedValue:s.value}),s.value=r.value??""}}),uo(()=>{s==null||s.destroy()}),Re(()=>e.mask,i=>{s&&s.updateOptions({mask:i,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),Re(r,i=>{s&&s.unmaskedValue!==i&&(s.value=i||"")}),(i,l)=>(S(),T("input",{type:"text",ref_key:"inputEl",ref:o,placeholder:i.placeholder,disabled:i.disabled,name:i.name,class:ae(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[me(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,t6))}}),r6={class:"relative w-full bg-white rounded-lg"},o6=["placeholder","disabled"],s6=_e({__name:"vs-input-email",props:yt({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:null},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,{inputClass:n}=Jn(e.style),r=It(t,"modelValue");return(o,s)=>(S(),T("div",r6,[s[1]||(s[1]=tn('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>',1)),nt(v("input",{type:"email","onUpdate:modelValue":s[0]||(s[0]=i=>r.value=i),placeholder:o.placeholder,disabled:o.disabled,class:ae(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[me(n),{"!border-red-600":o.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,o6),[[jt,r.value]])]))}}),i6=["value","disabled"],l6={class:"text-[13px] text-gray-700"},a6=_e({__name:"vs-input-radio-default",props:yt({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=It(t,"modelValue"),r=te(()=>!!e.disabled);return(o,s)=>{var i,l;return S(),T("label",{class:ae(["flex items-center gap-0",[e.customClass,r.value?"cursor-not-allowed opacity-60":""]])},[nt(v("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>n.value=a),type:"radio",value:e.value,disabled:r.value,class:"hidden"},null,8,i6),[[wu,n.value]]),v("span",{class:ae(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${((i=e.style)==null?void 0:i.primaryColor)||"blue"}-500`,r.value?"opacity-50 cursor-not-allowed":""]])},[n.value==e.value?(S(),T("span",{key:0,class:ae(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${((l=e.style)==null?void 0:l.primaryColor)||"blue"}-500`]])},null,2)):pe("",!0)],2),v("span",l6,we(e.text),1)],2)}}}),c6=["value","disabled"],u6={class:"text-[13px] text-gray-700"},d6=_e({__name:"vs-input-radio-buttons",props:yt({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=It(t,"modelValue"),r=te(()=>!!e.disabled);return(o,s)=>{var i;return S(),T("label",{class:ae(["flex items-center border rounded-lg px-2 py-1",[n.value==e.value?`ring-2 ring-ring ring-${((i=e.style)==null?void 0:i.primaryColor)||"blue"}-500`:"",e.customClass,r.value?"cursor-not-allowed opacity-60":""]])},[nt(v("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l),type:"radio",value:e.value,disabled:r.value,class:"hidden"},null,8,c6),[[wu,n.value]]),v("span",u6,we(e.text),1)],2)}}}),f6={"vs-input-radio-default":a6,"vs-input-radio-buttons":d6},dy=_e({__name:"vs-input-radio",props:yt({options:{},position:{default:"vertical"},view:{default:"default"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=It(t,"modelValue"),r=te(()=>f6[`vs-input-radio-${e.view}`]);return(o,s)=>(S(),T("div",{class:ae([o.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(S(!0),T(Me,null,Je(o.options,i=>(S(),Ae(Cn(r.value),ao({key:i==null?void 0:i.id,text:i.text,value:i.id.toString(),checked:n.value===i.id,modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=l=>n.value=l)},{ref_for:!0},o.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),p6={key:1,class:"w-full flex flex-col gap-4"},h6={key:0,class:"text-sm font-medium text-muted-foreground my-2"},m6="Без категорії",g6=_e({__name:"vs-input-checkbox",props:{options:{default:()=>[]},position:{default:"vertical"},slots:{default:null},colSpan:{default:0},data:{},view:{},group:{default:void 0},values:{default:()=>[]},style:{},customClass:{},disabled:{type:Boolean},modelValue:{default:!1},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=Q([]),s=Ns({}),i=p=>(p==null?void 0:p.value)||(p==null?void 0:p.id)||(p==null?void 0:p.text)||p,l=p=>p.text||String(p),a=p=>`lg:col-span-${p||12}`,c=te(()=>[n.position==="vertical"?"flex flex-col":"",n.colSpan?"grid":"flex justify-start"]),u=p=>p==null||p===""?null:typeof p=="string"||typeof p=="number"?p:String(p),d=te(()=>{var k;if(!n.group)return[];const p=new Map;o.value.forEach(w=>{var M;const b=w[n.group],_=u(b);p.has(_)||p.set(_,[]),(M=p.get(_))==null||M.push(w)});const h=[];(k=n.values)!=null&&k.length&&n.values.forEach(w=>{const b=u(w);h.push(b)});const m=new Set,y=w=>{const b=p.get(w)||[];if(!b.length)return null;const _=w===null?"group-null":`group-${String(w)}`,M=w===null?m6:String(w);return m.add(w),{key:_,label:M,options:b}},g=[];return h.forEach(w=>{const b=y(w);b&&g.push(b)}),p.forEach((w,b)=>{if(m.has(b))return;const _=y(b);_&&g.push(_)}),g}),f=async()=>{try{const p=await fetch(`/api/suggest/${n.data}`).then(h=>h.json());o.value=(p==null?void 0:p.data)||p}catch(p){console.error(p)}};return Re(()=>n.modelValue,p=>{if(typeof p=="boolean"&&o.value.length===1){const h=i(o.value[0]);s[h]=p}else if(Array.isArray(p)){const h=new Set(p);o.value.forEach(m=>{if(!m.disabled){const y=i(m);s[y]=h.has(y)}})}},{immediate:!0}),Re(s,()=>{if(!o.value.length){r("update:modelValue",null);return}const p=Object.entries(s).filter(([,h])=>h).map(([h])=>h);r("update:modelValue",p.length===0?[]:p)},{deep:!0}),rt(()=>{if(n.data)f().then(()=>{if(typeof n.modelValue=="boolean"&&o.value.length===1){const p=i(o.value[0]);s[p]=n.modelValue}else if(Array.isArray(n.modelValue)){const p=new Set(n.modelValue);o.value.forEach(h=>{if(!h.disabled){const m=i(h);s[m]=p.has(m)}})}});else if(o.value=n.options,typeof n.modelValue=="boolean"&&o.value.length===1){const p=i(o.value[0]);s[p]=n.modelValue}else if(Array.isArray(n.modelValue)){const p=new Set(n.modelValue);o.value.forEach(h=>{if(!h.disabled){const m=i(h);s[m]=p.has(m)}})}}),(p,h)=>n.group?(S(),T("div",p6,[(S(!0),T(Me,null,Je(d.value,m=>(S(),T("div",{key:m.key,class:"flex flex-col gap-2"},[m.label?(S(),T("span",h6,we(m.label),1)):pe("",!0),v("div",{class:ae(["p-0 w-full gap-[12px]",c.value])},[(S(!0),T(Me,null,Je(m.options,y=>(S(),Ae(rp,{modelValue:s[i(y)],"onUpdate:modelValue":g=>s[i(y)]=g,value:i(y),class:ae(a(p.colSpan)),disabled:n.disabled||y.disabled,label:l(y),key:`${m.key}-${i(y)}`,icon:y==null?void 0:y.icon,imgUrl:y==null?void 0:y.imgUrl,option:y,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2)]))),128))])):(S(),T("div",{key:0,class:ae(["p-0 w-full gap-[10px]",c.value])},[(S(!0),T(Me,null,Je(o.value,m=>(S(),Ae(rp,{modelValue:s[i(m)],"onUpdate:modelValue":y=>s[i(m)]=y,value:i(m),class:ae(a(p.colSpan)),disabled:n.disabled||m.disabled,label:l(m),key:i(m),icon:m==null?void 0:m.icon,imgUrl:m==null?void 0:m.imgUrl,option:m,view:p.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),y6=Ye(g6,[["__scopeId","data-v-8e66207e"]]),b6=["type","placeholder","disabled"],v6=_e({__name:"vs-input-date1",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},mode:{default:"date"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t;function r(u){return u?n.mode==="datetime"?(u.includes("T")?u:null)||u+(u.includes(" ")?"":"T00:00"):u==null?void 0:u.split(" ")[0]:null}const{inputClass:o}=Jn(n.style),s=e,i=te({get:()=>r(n.modelValue),set:u=>s("update:modelValue",u)}),l=te(()=>n.mode==="datetime"?"datetime-local":n.mode),a=te(()=>!!n.disabled),c=te(()=>n.placeholder??"");return(u,d)=>nt((S(),T("input",{type:l.value,"onUpdate:modelValue":d[0]||(d[0]=f=>i.value=f),placeholder:c.value,disabled:a.value,ref:"date",class:ae(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[u.modelValue?"":"text-opacity-50",me(o)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,b6)),[[$p,i.value]])}}),fy=async(t,e,n,r)=>{var o;try{const s=new FormData;return s.append("unique","true"),s.append("file",t),(o=await fetch(`/file/upload/uploads?id=${e||""}&form=${n||""}&table=${r||""}`,{method:"POST",body:s}).then(i=>i.json()))==null?void 0:o.result}catch(s){return Nt({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",s),null}},w6=async t=>{try{return await fetch(`file/delete${t}`),!0}catch(e){return console.error(e),!1}},py=async t=>{try{const e=await fetch(`file/download/files/uploads${t}`),n=await e.arrayBuffer(),r=e.headers["content-type"],o=new TextDecoder("utf-8").decode(n),s=new Blob([o],{type:r}),i=document.createElement("a");i.setAttribute("download",t),i.href=window.URL.createObjectURL(s),i.click()}catch(e){console.error(e.message)}},x6={},k6={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _6(t,e){return S(),T("svg",k6,e[0]||(e[0]=[v("path",{d:"M5 12h14"},null,-1),v("path",{d:"M12 5v14"},null,-1)]))}const Pl=Ye(x6,[["render",_6]]),C6={},E6={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-text",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function S6(t,e,n,r,o,s){return S(),T("svg",E6,e[0]||(e[0]=[tn('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>',6)]))}const M6=Ye(C6,[["render",S6]]),T6={},A6={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-table",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function L6(t,e,n,r,o,s){return S(),T("svg",A6,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),v("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),v("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const O6=Ye(T6,[["render",L6]]),N6={},I6={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function R6(t,e){return S(),T("svg",I6,e[0]||(e[0]=[tn('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>',6)]))}const mk=Ye(N6,[["render",R6]]),P6={},D6={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-zip",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function $6(t,e,n,r,o,s){return S(),T("svg",D6,e[0]||(e[0]=[tn('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>',9)]))}const F6=Ye(P6,[["render",$6]]),V6={},B6={xmlns:"http://www.w3.org/2000/svg",class:"icon icon-tabler icon-tabler-file-code",width:"44",height:"44",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"};function H6(t,e,n,r,o,s){return S(),T("svg",B6,e[0]||(e[0]=[tn('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>',5)]))}const j6=Ye(V6,[["render",H6]]),z6=t=>{if(!t)return"";const e=t==null?void 0:t.split(".");return e[e.length-1]},U6=t=>{const e=z6(t),n={imageFormat:["tiff","jpg","jpeg","png","svg","ico","webp"],sheetsFormat:["xls","csv","xlsx"],archivesFormat:["zip","rar"],textsFormat:["json","geojson","txt","yml","yaml","shp"],documentsFormat:["pdf"]};return n.imageFormat.includes(e)?"img":n.sheetsFormat.includes(e)?O6:n.textsFormat.includes(e)?j6:n.documentsFormat.includes(e)?M6:n.archivesFormat.includes(e)?F6:mk},W6={},K6={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function G6(t,e){return S(),T("svg",K6,e[0]||(e[0]=[tn('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>',6)]))}const zu=Ye(W6,[["render",G6]]),q6={},J6={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function Y6(t,e){return S(),T("svg",J6,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),v("path",{d:"M7 11l5 5l5 -5"},null,-1),v("path",{d:"M12 4l0 12"},null,-1)]))}const gk=Ye(q6,[["render",Y6]]),X6=["title"],Z6={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},Q6=_e({__name:"vs-input-file-list-item",props:yt({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(t){const e=It(t,"value"),n=It(t,"item"),r=t;return(o,s)=>(S(),T("div",{title:n.value,class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},[(S(),Ae(Cn(me(U6)(n.value)),{src:n.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:s[0]||(s[0]=i=>me(py)(n.value))},null,8,["src"])),v("div",Z6,[v("button",{type:"button",onClick:s[1]||(s[1]=i=>{var l;me(w6)(n.value),e.value=r.multiple?(l=e.value)==null?void 0:l.filter(a=>a!==n.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[ce(zu,{class:"w-4 h-4"})]),v("button",{type:"button",onClick:s[2]||(s[2]=i=>me(py)(n.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[ce(gk,{class:"w-4 h-4"})])])],8,X6))}}),hy=Ye(Q6,[["__scopeId","data-v-286cdbc0"]]),e8={class:"flex items-center gap-x-2"},t8=["multiple","disabled"],n8={key:1,class:"flex items-center flex-wrap gap-2"},r8={key:1,class:"loader"},o8={key:1,class:"loader"},s8=_e({__name:"vs-input-file",props:yt({format:{},multiple:{type:Boolean},max_size:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:yt(["change"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=It(t,"modelValue"),o=e,s=Q(null),i=Q(!1),l=u=>Array.isArray(r.value)&&r.value[u]||"",a=u=>{if(n.max_size&&u.size>n.max_size*1024*1024){const d=(u.size/1048576).toFixed(2);return Nt({type:"error",title:"Помилка!",message:`Файл "${u.name}" занадто великий. Максимальний розмір: ${n.max_size} МБ, розмір файлу: ${d} МБ`,position:"right-bottom"}),!1}return!0},c=async u=>{const{files:d}=u.target;if(!d||d.length===0)return;const f=Array.from(d);if(n.max_size&&f.filter(p=>!a(p)).length>0){s.value&&(s.value.value="");return}i.value=!0;try{if(n.multiple){const p=Array.from(d).map(async m=>n.format&&!m.name.endsWith(n.format)?null:await fy(m,"1","form","table")),h=(await Promise.all(p)).filter(m=>m!==null).map(m=>m==null?void 0:m.file_path).filter(Boolean);r.value=[...r.value||[],...h],o("change",r.value)}else{const p=d[0];if(n.format&&!p.name.endsWith(n.format))return;const h=await fy(p,"1","form","table");r.value=h==null?void 0:h.file_path,o("change",r.value||"")}}finally{i.value=!1,s.value&&(s.value.value="")}};return(u,d)=>(S(),T("div",e8,[v("input",{class:"hidden",ref_key:"fileInput",ref:s,type:"file",multiple:u.multiple,onChange:c,disabled:i.value||u.disabled},null,40,t8),!u.multiple&&r.value?(S(),Ae(hy,{key:0,item:r.value,"onUpdate:item":d[0]||(d[0]=f=>r.value=f),value:r.value,"onUpdate:value":d[1]||(d[1]=f=>r.value=f)},null,8,["item","value"])):u.multiple?(S(),T("div",n8,[(S(!0),T(Me,null,Je(r.value,(f,p)=>(S(),Ae(hy,{multiple:u.multiple,key:p,value:r.value,"onUpdate:value":d[2]||(d[2]=h=>r.value=h),item:l(p)},null,8,["multiple","value","item"]))),128)),v("div",{onClick:d[3]||(d[3]=f=>{var p;return!u.disabled&&!i.value&&((p=s.value)==null?void 0:p.click())}),class:ae(["relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",u.disabled||i.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[i.value?(S(),T("div",r8)):(S(),Ae(Pl,{key:0,class:"w-6 h-6"}))],2)])):pe("",!0),u.multiple?pe("",!0):(S(),T("div",{key:2,onClick:d[4]||(d[4]=f=>{var p;return(p=s.value)==null?void 0:p.click()}),class:ae([u.disabled||i.value?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500","relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])},[i.value?(S(),T("div",o8)):(S(),Ae(Pl,{key:0,class:"w-6 h-6"}))],2))]))}}),i8=Ye(s8,[["__scopeId","data-v-e613a523"]]),l8={class:"max-w-[55vw]"},a8={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},c8={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},u8={class:"px-[5px]"},d8={class:""},Ta=_e({__name:"vs-widget-file-info",props:{item:{default:null}},setup(t){const e=t,n=te(()=>{try{return new Date(e.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function r(o){if(o<1024)return`${o} B`;const s=o/1024;return s<1024?`${s.toFixed(2)} KB`:`${(s/1024).toFixed(2)} MB`}return(o,s)=>{var i,l,a,c;return S(),T(Me,null,[s[1]||(s[1]=tn('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>',1)),v("div",l8,[v("p",a8,we((i=o.item)==null?void 0:i.uploaded_name),1),v("p",c8,[v("span",null,we((l=o.item)==null?void 0:l.username),1),nt(v("span",u8,"|",512),[[jo,(a=o.item)==null?void 0:a.username]]),v("span",null,we(n.value),1),s[0]||(s[0]=v("span",{class:"px-[5px]"},"|",-1)),v("span",d8,we(r((c=o.item)==null?void 0:c.size)),1)])])],64)}}}),f8={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},p8={key:0,class:"flex w-full gap-x-3 items-center"},h8={key:1,class:"flex gap-x-3 w-full items-center"},m8={key:2,class:"flex gap-x-3 w-full items-center"},g8=["href"],y8={key:3,class:"flex gap-x-3 w-full items-center"},b8={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},v8={class:"p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700"},w8={class:"inline-block"},x8={class:"inline-block"},k8=_e({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(t,{emit:e}){const n=t,r=e;function o(u){return["pdf","json"].includes(u.ext)}function s(u){return["ppt","pptx","doc","docx","xls","xlsx"].includes(u.ext)}function i(u){const d=document.createElement("a");d.setAttribute("download",u==null?void 0:u.uploaded_name),d.href=u==null?void 0:u.file_path,d.click()}async function l(){try{await fetch(`${n.prefix}/widget/file/${n.item.entity_id}/${n.item.file_id}`),r("update")}catch(u){console.error(u)}}function a(){r("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:l,updateListOnConfirm:!0})}function c(u){(n.item.ext==="jpg"||n.item.ext==="png")&&r("openLightbox",{item:n.item,index:u})}return(u,d)=>(S(),T("div",f8,[u.item.ext==="jpg"||u.item.ext==="png"?(S(),T("div",p8,[v("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:d[0]||(d[0]=f=>c(u.index))},[ce(Ta,{item:u.item},null,8,["item"])])])):o(u.item)?(S(),T("div",h8,[ce(Ta,{item:u.item},null,8,["item"])])):s(u.item)?(S(),T("div",m8,[v("a",{href:`/api/file-preview?id=${u.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[ce(Ta,{item:u.item},null,8,["item"])],8,g8)])):(S(),T("div",y8,[ce(Ta,{item:u.item},null,8,["item"])])),v("div",b8,[v("div",v8,[v("div",w8,[v("button",{class:"inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:d[1]||(d[1]=f=>i(u.item))},[ce(gk,{height:"14",width:"14"})])]),d[3]||(d[3]=v("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),v("div",x8,[v("button",{type:"button",class:"size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",onClick:d[2]||(d[2]=f=>a())},[ce(zu,{height:"14",width:"14"})])])])])]))}}),_8={},C8={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function E8(t,e){return S(),T("svg",C8,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),v("path",{d:"M7 11l5 5l5 -5"},null,-1),v("path",{d:"M12 4l0 12"},null,-1)]))}const S8=Ye(_8,[["render",E8]]),M8={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},T8={class:"flex w-full mb-[12px] items-center gap-x-2"},A8={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},L8={class1:"ml-auto"},O8={class:"py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"},N8={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},I8={class:"relative"},R8={key:1,class:"space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},P8={key:0},D8=_e({__name:"vs-input-file-list",props:{id:{default:""},prefix:{default:"/api"},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update"],setup(t,{emit:e}){const n=t,r=Wt("form"),o=te(()=>r.value.formId),s=Q(!1),i=Q(0),l=e,a=Q(!1),c=Q({}),u=Q([]),d=Q(""),f=te(()=>Array.isArray(u.value)?u.value.filter(w=>w.ext==="jpg"||w.ext==="png").map(w=>w==null?void 0:w.file_path):[]),p=te(()=>d.value===""?u.value:u.value.filter(w=>{var b;return(b=w==null?void 0:w.uploaded_name)==null?void 0:b.includes(d.value)})),h=w=>{const b=f.value.findIndex(_=>_===w.item.file_path);b!==-1&&(s.value=!0,i.value=b)},m=async()=>{try{const w=await fetch(`${n.prefix}/widget/file/${o.value}`).then(b=>b.json());u.value=w==null?void 0:w.rows}catch(w){console.error(w)}},y=async w=>{await Promise.all(Array.from(w.target.files).map(async b=>{const _=new FormData;_.append("file",b);try{const M=`${n.prefix}/widget/file/${o.value}`,E=await fetch(M,{method:"POST",body:_});return E.ok?(l("update","file-list"),b):(Nt({type:E.status>=400&&E.status<500?"warning":"error",title:"Error",message:`Error code: ${E.status}`}),null)}catch(M){return Nt({type:"error",title:"Error",message:M.message||"Unknown error"}),console.error(M),null}})),await m()},g=w=>{const b={...w};return w.cancel||(b.cancel=()=>{a.value=!1}),w.updateListOnConfirm&&(b.confirm=async()=>{await w.confirm(),a.value=!1,m()}),b},k=w=>{c.value=g(w),a.value=!0};return Re(o,w=>{w&&m()}),rt(()=>{o.value&&m()}),(w,b)=>{var E,I,F;const _=yr("Lightbox"),M=yr("MessageBox");return S(),T("div",M8,[v("div",T8,[v("h2",A8," Файлів: "+we((E=u.value)==null?void 0:E.length),1),v("div",L8,[v("label",null,[v("input",{type:"file",class:"hidden",onChange:b[0]||(b[0]=R=>y(R))},null,32),v("div",O8,[ce(S8,{height:"16",width:"16"})])])])]),((I=u.value)==null?void 0:I.length)>4?(S(),T("div",N8,[v("div",null,[v("div",I8,[b[8]||(b[8]=v("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[v("svg",{class:"flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("circle",{cx:"11",cy:"11",r:"8"}),v("path",{d:"m21 21-4.3-4.3"})])],-1)),nt(v("input",{type:"text","onUpdate:modelValue":b[1]||(b[1]=R=>d.value=R),class:"py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Введіть назву файлу"},null,512),[[jt,d.value,void 0,{trim:!0}]])])])])):pe("",!0),(F=u.value)!=null&&F.length?(S(),T("div",R8,[(S(!0),T(Me,null,Je(p.value,(R,$)=>(S(),Ae(k8,{key:$,prefix:w.prefix,item:R,index:$,onUpdate:b[2]||(b[2]=A=>w.$emit("update","file-list")),onOpenModal:b[3]||(b[3]=A=>k(A)),onOpenLightbox:b[4]||(b[4]=A=>h(A))},null,8,["prefix","item","index"]))),128)),p.value.length?pe("",!0):(S(),T("div",P8,b[9]||(b[9]=[v("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):pe("",!0),ce(_,{modelValue:s.value,"onUpdate:modelValue":b[5]||(b[5]=R=>s.value=R),startIndex:i.value,"onUpdate:index":b[6]||(b[6]=R=>i.value=R),images:f.value},null,8,["modelValue","startIndex","images"]),ce(M,ao({modelValue:a.value,"onUpdate:modelValue":b[7]||(b[7]=R=>a.value=R),onConfirm:c.value.confirm},c.value),null,16,["modelValue","onConfirm"])])}}}),$8={class:"flex items-center justify-between"},F8={class:"text-[16px] text-gray-900 font-medium"},V8={class:"grid gap-3"},B8=_e({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(t){const e=t,n=Q(e.isOpen);return Re(()=>e.isOpen,r=>{n.value=r}),(r,o)=>(S(),T("div",null,[v("div",$8,[v("p",F8,we(t.title),1),ce(hk,{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=s=>n.value=s),style:pt(t.style)},null,8,["modelValue","style"])]),ce(Rs,{name:"slide-fade"},{default:Ke(()=>[nt(v("div",V8,[mn(r.$slots,"default",{},void 0,!0)],512),[[jo,n.value]])]),_:3})]))}}),H8=Ye(B8,[["__scopeId","data-v-90320b87"]]),j8={class:"text-[16px] text-gray-900 font-medium"},z8={class:"grid gap-3"},U8=_e({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(t){const e=t,n=Q(e.isOpen);return Re(()=>e.isOpen,r=>{n.value=r}),(r,o)=>(S(),T("div",null,[v("button",{type:"button",onClick:o[0]||(o[0]=s=>n.value=!n.value),class:"flex items-center gap-2"},[ce(me(HF),{class:ae(["h-4 w-4 duration-300",[n.value?"-rotate-180":""]])},null,8,["class"]),v("span",j8,we(t.title),1)]),ce(Rs,{name:"slide-fade"},{default:Ke(()=>[nt(v("div",z8,[mn(r.$slots,"default",{},void 0,!0)],512),[[jo,n.value]])]),_:3})]))}}),W8=Ye(U8,[["__scopeId","data-v-590eff11"]]),K8={class:"flex items-center justify-between"},G8=_e({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(t){return(e,n)=>(S(),T("div",null,[v("div",K8,[v("p",null,we(t.title),1)]),mn(e.$slots,"default")]))}}),q8={switcher:H8,accordion:W8,default:G8},Zn={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},J8=(t,e)=>String(t)===String(e),Y8=(t,e)=>String(t)!==String(e),X8=(t,e)=>t>e,Z8=(t,e)=>t>=e,Q8=(t,e)=>t<e,eV=(t,e)=>t<=e,tV=(t,e)=>Array.isArray(e)&&e.length===2?t>=e[0]&&t<=e[1]:!1,nV=(t,e)=>String(t).startsWith(String(e)),rV=(t,e)=>String(t).endsWith(String(e)),oV=(t,e)=>String(t).includes(String(e)),sV=(t,e)=>Array.isArray(e)?e.includes(t):!1,iV=(t,e)=>Array.isArray(e)?!e.includes(t):!0,yk=(t,e)=>{if(!e)return!0;switch(e==null?void 0:e[1]){case Zn.Equal:return J8(t,e==null?void 0:e[2]);case Zn.Inequal:return Y8(t,e==null?void 0:e[2]);case Zn.Higer:return X8(t,e==null?void 0:e[2]);case Zn.HigerOrEqual:return Z8(t,e==null?void 0:e[2]);case Zn.Lower:return Q8(t,e==null?void 0:e[2]);case Zn.LowerOrEqual:return eV(t,e==null?void 0:e[2]);case Zn.Between:return tV(t,e==null?void 0:e[2]);case Zn.StartWith:return nV(t,e==null?void 0:e[2]);case Zn.EndWith:return rV(t,e==null?void 0:e[2]);case Zn.Contain:return oV(t,e==null?void 0:e[2]);case Zn.In:return sV(t,e==null?void 0:e[2]);case Zn.NotIn:return iV(t,e==null?void 0:e[2]);default:return!0}},lV=_e({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},name:{type:String,default:""},schema:{type:Array,default:()=>[]}},setup(t){const e=t,n=Wt("values",Q({})),r=Wt("form"),o=te(()=>{var l;return(l=e.schema)==null?void 0:l.filter(a=>{var f,p,h,m;const c=a==null?void 0:a.conditions;if(!c)return!0;const u=Array.isArray(c)?c[0]:c,d=e.name?((p=(f=n.value)==null?void 0:f[e.name])==null?void 0:p[u])??((h=n.value)==null?void 0:h[u]):(m=n.value)==null?void 0:m[u];return yk(d,c)})}),s=te(()=>q8[e.view]),i=te(()=>{if(n.value||(n.value={}),!e.name)return n.value;const l=n.value[e.name];if(l)return l;const a={};return n.value={...n.value,[e.name]:a},a});return(l,a)=>{var c;return(c=t.schema)!=null&&c.length?(S(),Ae(Cn(s.value),{key:0,title:t.title,style:pt(t.style)},{default:Ke(()=>[(S(!0),T(Me,null,Je(o.value,u=>{var d,f;return S(),Ae(bk,ao({key:u.name},{ref_for:!0},u,{item:u,modelValue:i.value[u.name],"onUpdate:modelValue":p=>i.value[u.name]=p,style:t.style,error:(f=(d=me(r))==null?void 0:d.errors)==null?void 0:f[u.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"])}),128))]),_:1},8,["title","style"])):pe("",!0)}}}),aV=["aria-expanded","data-focus"],cV={key:0,class:"flex flex-wrap items-center gap-1 overflow-y-auto min-w-0 flex-1"},uV={class:"flex items-center min-w-0"},dV=["title"],fV=["innerHTML"],pV=["onClick"],hV={class:"flex-1 min-w-[2px]"},mV=["placeholder"],gV=["title"],yV=["innerHTML"],bV={key:2,class:"flex-1 min-w-[2px]"},vV=["placeholder"],wV={class:"flex items-center shrink-0"},xV=["disabled"],kV=["disabled","title"],_V=["aria-disabled","onClick"],CV=["innerHTML"],EV={key:1,class:"px-3 py-2 text-center text-gray-500"},SV=["disabled"],my=_e({__name:"vs-input-select",props:{multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},defaultValue:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{default:""},options:{default:()=>[]},api:{default:null},maxHeight:{default:400},parent:{},set:{},slot:{},add:{},teleport:{default:"body"},auto:{default:0},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{}},emits:["change","update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=te(()=>n.multiple),s=te(()=>n.disabled);Jn(n.style);const i=te({get:()=>n.modelValue,set:U=>r("update:modelValue",U)});!i.value&&n.defaultValue&&(i.value=n.defaultValue);const l=Q(null),a=Q(null),c=Q(null),u=Q(null),d=Q(!1),f=Q(!1),p=Q(null),h=Q([]),m=Q(-1),y=Q([]),g=Q(""),k=Q(null),w=Q("bottom"),b=Q({}),_=Q([]),M=te(()=>{if(!_.value.length)return[];const U=h.value,ee=new Map(U.map(ue=>{var ve;return[(ve=ue.id)==null?void 0:ve.toString(),ue]}));return _.value.map(ue=>ee.get(ue==null?void 0:ue.toString())).filter(ue=>!!ue)}),E=te(()=>n.placeholder||"Select..."),I=te(()=>X(p.value));te(()=>o.value?!_.value.length&&g.value==="":!I.value&&g.value==="");const F=te(()=>s.value?!1:o.value?_.value.length>0:!!i.value),R=U=>{var ee;return o.value?_.value.some(ue=>(ue==null?void 0:ue.toString())===(U==null?void 0:U.toString())):((ee=i.value)==null?void 0:ee.toString())===(U==null?void 0:U.toString())},$=te(()=>{let U=h.value??[];if(!n.data&&g.value.trim()!==""){const ee=g.value.toLowerCase();U=U.filter(ue=>{var ze,Ot;const ve=X(ue).toLowerCase(),He=((Ot=(ze=ue.text)==null?void 0:ze.toLowerCase)==null?void 0:Ot.call(ze))||"";return ve.includes(ee)||He.includes(ee)})}if(o.value&&_.value.length){const ee=new Set(_.value.map(ue=>ue==null?void 0:ue.toString()));U=U.filter(ue=>{var ve;return!ee.has((ve=ue.id)==null?void 0:ve.toString())})}return U}),A=Wt("values"),q=/\{\{\s*([^}]+?)\s*\}\}/g,Y=U=>(U?String(U):"").replace(/<[^>]*>/g,"").trim(),Z=te(()=>n.slot??(n==null?void 0:n.optionTemplate)??""),K=U=>{if(!U)return"";const ee=Z.value;return ee?ee.replace(q,(ue,ve)=>{const He=ve.trim(),ze=U[He];return ze!=null?String(ze):""}):U.text??""},X=U=>{if(!U)return"";if(!Z.value)return U.text??"";const ee=K(U);return Y(ee)||U.text||""},G=U=>{n.set&&(A!=null&&A.value)&&Object.entries(n.set).forEach(([ee,ue])=>{if(!ee)return;const ve=U?U[ue]:null;A.value[ee]=ve??null})},ne=te(()=>{var U,ee;return n.parent?((ee=(U=A==null?void 0:A.value)==null?void 0:U[n.parent])==null?void 0:ee.toString())??null:null}),Le=async U=>{var ee;if(!n.data){let ue=n.options??[];if(U!=null&&U.trim()){const ve=U.toLowerCase();ue=ue.filter(He=>{var $e,Un;const ze=X(He).toLowerCase(),Ot=((Un=($e=He.text)==null?void 0:$e.toLowerCase)==null?void 0:Un.call($e))||"";return ze.includes(ve)||Ot.includes(ve)})}return ue}try{const ue=n.host??"",ve=n.prefix??"api",He=n.api??`/${ve}/suggest/${n.data}`,ze=`${ue}${He}`,Ot=new URLSearchParams;return Ot.set("json","1"),U&&Ot.set("key",U),ne.value!==void 0&&ne.value!==null&&ne.value!==""&&Ot.set("parent",ne.value),((ee=await fetch(`${ze}?${Ot.toString()}`).then($e=>$e.json()))==null?void 0:ee.data)??[]}catch{return[]}},je=async()=>{n.data?h.value=await Le(g.value):h.value=n.options?[...n.options]:[]},Be=async U=>{var ue,ve,He;if(U==null)return null;const ee=(ue=h.value)==null?void 0:ue.find(ze=>{var Ot;return((Ot=ze==null?void 0:ze.id)==null?void 0:Ot.toString())===String(U)});if(ee)return ee;if(n.data)try{const ze=n.host??"",Ot=n.prefix??"api",$e=n.api??`/${Ot}/suggest/${n.data}`,Un=`${ze}${$e}`,cr=new URLSearchParams;return cr.set("json","1"),cr.set("val",String(U)),ne.value!==void 0&&ne.value!==null&&ne.value!==""&&cr.set("parent",ne.value),((He=((ve=await fetch(`${Un}?${cr.toString()}`).then(rs=>rs.json()))==null?void 0:ve.data)??[])==null?void 0:He[0])??null}catch{return null}return null},Dt=async U=>{const ee=new Set(h.value.map(ve=>{var He;return(He=ve.id)==null?void 0:He.toString()})),ue=U.filter(ve=>!ee.has(ve==null?void 0:ve.toString()));ue.length&&await ue.reduce(async(ve,He)=>{await ve;const ze=await Be(He);ze&&h.value.push(ze)},Promise.resolve())},Ze=async()=>{s.value||(d.value=!0,await je(),await zt(()=>{var U;B(),(U=k.value)==null||U.focus(),$.value.length?m.value=0:m.value=-1}))},Pt=()=>{d.value=!1,m.value=-1},vt=async U=>{s.value||(d.value?Pt():await Ze())},oe=async()=>{var U;d.value?(U=k.value)==null||U.focus():await Ze()},be=()=>{o.value?(_.value=[],i.value=[],r("change",[])):(p.value=null,i.value=null,r("change",null)),G(null),g.value="",zt(()=>{var U;return(U=k.value)==null?void 0:U.focus()})},ye=U=>{o.value&&(_.value=_.value.filter(ee=>(ee==null?void 0:ee.toString())!==(U==null?void 0:U.toString())),i.value=[..._.value],r("change",i.value),zt(()=>{var ee;return(ee=k.value)==null?void 0:ee.focus()}))},xe=U=>{o.value?(R(U.id)||(_.value=[..._.value,U.id],i.value=[..._.value],r("change",i.value)),g.value="",zt(()=>{var ee;(ee=k.value)==null||ee.focus(),m.value=Math.min(m.value,$.value.length-1)}),G(null)):(p.value=U,i.value=U.id,r("change",i.value),g.value="",Pt(),G(U))},Ve=U=>{R(U.id)||xe(U)},Ue=(U,ee)=>{if(!U||!ee)return;const ue=U.offsetTop,ve=ue+U.offsetHeight,He=ee.scrollTop,ze=He+ee.clientHeight;let Ot=ee.scrollTop;ue<He?Ot=ue-80:ve>ze&&(Ot=ve-ee.clientHeight+4);const $e=ee;$e.scrollTop=Ot},O=U=>{let ee=U.parentElement;for(;ee;){if(ee.classList.contains("ui-dialog__content"))return ee;const ue=window.getComputedStyle(ee),ve=ue.overflow+ue.overflowY+ue.overflowX;if(ve.includes("auto")||ve.includes("scroll")||ee===document.body||ee===document.documentElement)return ee;ee=ee.parentElement}return document.body},B=()=>{if(!a.value)return;const U=a.value.getBoundingClientRect(),ee=window.innerHeight||document.documentElement.clientHeight,ue=window.innerWidth||document.documentElement.clientWidth,ve=8,He=8,ze=n.maxHeight||300,Ot=ee-U.bottom-He-ve,$e=U.top-He-ve,Un=Ot>=$e,cr=Math.max(ue-ve*2,0);let{width:rs}=U;cr>0&&rs>cr&&(rs=cr);let{left:Ti}=U;Ti+rs+ve>ue&&(Ti=ue-rs-ve),Ti=Math.max(Ti,ve);const Kk=Math.min(ze,Math.max(Un?Ot:$e,50));w.value=Un?"bottom":"top",b.value={position:"fixed",left:`${Ti}px`,width:`${rs}px`,minWidth:"300px",maxHeight:`${Kk}px`,transform:Un?"none":"translateY(-100%)",top:Un?`${U.bottom+He}px`:`${U.top-He}px`}},J=async U=>{s.value||!d.value&&(U.key==="ArrowDown"||U.key==="ArrowUp")&&(U.preventDefault(),await Ze())},ie=U=>{var ue;if(!d.value)return;const{key:ee}=U;if(ee==="ArrowDown")U.preventDefault(),m.value+1<$.value.length&&(m.value+=1,Ue(y.value[m.value],c.value));else if(ee==="ArrowUp")U.preventDefault(),m.value>0&&(m.value-=1,Ue(y.value[m.value],c.value));else if(ee==="Enter"){U.preventDefault();const ve=$.value[m.value];ve&&xe(ve),(ue=k.value)==null||ue.blur()}else ee==="Escape"?(U.preventDefault(),Pt()):ee==="Backspace"?o.value&&g.value===""&&_.value.length&&(_.value=_.value.slice(0,-1),i.value=[..._.value],r("change",i.value)):ee==="Home"?(m.value=0,Ue(y.value[0],c.value)):ee==="End"?(m.value=$.value.length-1,Ue(y.value[m.value],c.value)):ee==="Tab"&&Pt()},re=()=>{s.value||(f.value=!0)},x=()=>{f.value=!1,g.value=""},C=U=>{U.key==="Escape"&&d.value&&Pt()},N=U=>{var ue,ve;const ee=U.target;(ue=l.value)!=null&&ue.contains(ee)||(ve=u.value)!=null&&ve.contains(ee)||Pt()},H=U=>{d.value&&c.value&&!c.value.contains(U.target)&&B()},D=()=>{d.value&&B()},z=()=>{d.value&&B()};Re(()=>n.options,U=>{U!=null&&U.length&&(h.value=[...U],V())},{immediate:!0});async function V(){if(o.value)Array.isArray(i.value)?_.value=[...i.value]:(_.value=i.value==null?[]:[i.value],i.value=[..._.value]),n.data&&_.value.length&&(await Dt(_.value),await zt());else{if(Array.isArray(i.value)){const U=i.value[0]??null;i.value=U??null}i.value!=null&&(p.value=await Be(i.value)),G(p.value??null)}}Re(i,()=>{V()}),rt(async()=>{var U;addEventListener("keydown",C),addEventListener("scroll",H,!0),addEventListener("resize",D),document.addEventListener("click",N,!0),a.value&&O(a.value).addEventListener("scroll",z,!0),(U=n.options)!=null&&U.length&&!n.data?h.value=[...n.options]:n.data&&(h.value=await Le("")),await V(),ge.value=!1}),gn(()=>{removeEventListener("keydown",C),removeEventListener("scroll",H,!0),removeEventListener("resize",D),document.removeEventListener("click",N,!0),a.value&&O(a.value).removeEventListener("scroll",z,!0)});const W=Q(!1),he=Q({}),Ce=Q([]),De=Q(null);async function P(){var ue,ve;if(!((ue=n.add)!=null&&ue.token)||De!=null&&De.value.validate())return;const U=n.add.api??`/api/table/${n.add.token}`,{id:ee}=await fetch(U,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(he.value)}).then(He=>He.json());if(!((ve=n.options)!=null&&ve.length)&&n.data){const{data:He}=await fetch(`${n.api??`/api/suggest/${n.data}`}?val=${ee}`).then(ze=>ze.json());p.value=He[0],h.value.push(He[0]),i.value=ee}W.value=!1,Nt({title:"Success!",message:"Object created."})}async function j(){if(!n.add)return null;const U=await fetch(`/api/template/form/${n.add.form}`).then(ee=>ee.json());return Ce.value=U.schema,W.value=!0,null}function se(U,ee=200){let ue;return(...ve)=>{ue&&clearTimeout(ue),ue=window.setTimeout(()=>U(...ve),ee)}}const de=se(async U=>{h.value=await Le(U)},200);Re(g,U=>{n.data&&de(U.trim())}),Re(()=>n.options,U=>{!n.data&&(U!=null&&U.length)&&(h.value=[...U],V())},{immediate:!0}),Re(()=>n.parent??n.parentValue,()=>{n.data&&je()});const ge=Q(!0);return Re(ne,async()=>{if(n.data&&(ge.value||(o.value?(_.value=[],i.value=[],r("change",[])):(p.value=null,i.value=null,r("change",null))),await je(),n.auto===1&&ne.value&&h.value.length>0)){const U=h.value[0];U&&xe(U)}}),(U,ee)=>{var ue,ve,He,ze,Ot;return S(),T(Me,null,[ce(me(Rh),{visible:W.value,"onUpdate:visible":ee[1]||(ee[1]=$e=>W.value=$e),title:"Додати",buttonText:"Додати",onDone:P,teleport:U.teleport},{default:Ke(()=>[ce(xi,{schema:Ce.value,modelValue:he.value,"onUpdate:modelValue":ee[0]||(ee[0]=$e=>he.value=$e),ref_key:"addForm",ref:De},null,8,["schema","modelValue"])]),_:1},8,["visible","teleport"]),v("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:l,onClick:ee[5]||(ee[5]=Vn(()=>{},["stop"]))},[v("div",{class:ae(["relative w-full font-sans",n.customClass])},[ee[10]||(ee[10]=v("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),ee[11]||(ee[11]=v("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),v("div",{class:ae(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",d.value||f.value?"border-blue-500 ring-1 ring-blue-500":"",s.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":d.value,"aria-haspopup":"listbox",onKeydown:J,onClick:oe,"data-focus":d.value||f.value?"true":"false"},[v("div",{class:"flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden h-full",ref_key:"triggerRef",ref:a},[o.value?(S(),T("div",cV,[(S(!0),T(Me,null,Je(M.value,$e=>(S(),T("div",{class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border max-w-full",key:$e.id},[v("div",uV,[$e!=null&&$e.color?(S(),T("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",style:pt({backgroundColor:$e==null?void 0:$e.color})},null,4)):pe("",!0),v("div",{class:"truncate text-gray-900 overflow-hidden max-w-[200px] px-0.5 py-[2px] pl-1.5",title:X($e)},[Z.value?(S(),T("span",{key:0,innerHTML:K($e)},null,8,fV)):(S(),T(Me,{key:1},[xn(we($e.text),1)],64))],8,dV)]),v("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b] flex-shrink-0",onClick:Vn(Un=>ye($e.id),["stop"])},ee[6]||(ee[6]=[v("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[v("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,pV)]))),128)),v("div",hV,[!s.value&&U.search?nt((S(),T("input",{key:0,ref_key:"inputRef",ref:k,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:_.value.length?" ":E.value,"onUpdate:modelValue":ee[2]||(ee[2]=$e=>g.value=$e),onFocus:re,onBlur:x,onKeydown:ie},null,40,mV)),[[jt,g.value]]):pe("",!0)])])):!o.value&&!f.value&&I.value&&g.value===""?(S(),T("div",{key:1,class:ae(["truncate text-gray-900"]),title:I.value},[(ue=p.value)!=null&&ue.color?(S(),T("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",style:pt({backgroundColor:(ve=p.value)==null?void 0:ve.color})},null,4)):pe("",!0),Z.value?(S(),T("span",{key:1,class:ae({"pl-5":(He=p.value)==null?void 0:He.color}),innerHTML:K(p.value)},null,10,yV)):(S(),T("span",{key:2,class:ae({"pl-5":(ze=p.value)==null?void 0:ze.color})},we((Ot=p.value)==null?void 0:Ot.text),3))],8,gV)):pe("",!0),o.value?pe("",!0):(S(),T("div",bV,[!s.value&&U.search?nt((S(),T("input",{key:0,ref_key:"inputRef",ref:k,class:"w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",placeholder:I.value?" ":E.value,"onUpdate:modelValue":ee[3]||(ee[3]=$e=>g.value=$e),onFocus:re,onBlur:x,onKeydown:ie},null,40,vV)),[[jt,g.value]]):pe("",!0)]))],512),v("div",wV,[F.value?(S(),T("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:s.value,onClick:Vn(be,["stop"])},ee[7]||(ee[7]=[v("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[v("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,xV)):pe("",!0),ee[9]||(ee[9]=v("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),v("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:s.value,onClick:ee[4]||(ee[4]=Vn($e=>vt(),["stop"])),title:d.value?"Закрити список":"Відкрити список"},ee[8]||(ee[8]=[v("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[v("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})],-1)]),8,kV)])],42,aV),(S(),Ae(Is,{to:"body"},[d.value?(S(),T("div",{key:0,ref_key:"dropdownRef",ref:u,class:ae(["fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"]),style:pt(b.value),role:"listbox"},[v("div",{class:"overflow-y-auto py-1",style:pt({maxHeight:b.value.maxHeight||"300px"}),ref_key:"listRef",ref:c},[$.value.length?(S(!0),T(Me,{key:0},Je($.value,($e,Un)=>(S(),T("div",{key:$e.id,ref_for:!0,ref:cr=>y.value[Un]=cr,class:ae(["flex px-3 py-2 cursor-default select-none text-gray-900 ",R($e.id)?"bg-blue-500 text-white":"bg-white hover:bg-blue-100",m.value===Un&&!R($e.id)?"bg-blue-100":""]),"aria-disabled":R($e.id)?"true":"false",role:"option",tabindex:"-1",onClick:cr=>Ve($e)},[$e!=null&&$e.color?(S(),T("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:pt({backgroundColor:$e==null?void 0:$e.color})},null,4)):pe("",!0),v("div",{class:ae(["leading-[19px]",m.value===$e.id?"text-white":"",(m.value,"")])},[Z.value?(S(),T("span",{key:0,innerHTML:K($e)},null,8,CV)):(S(),T(Me,{key:1},[xn(we($e.text),1)],64))],2)],10,_V))),128)):(S(),T("div",EV," No options "))],4)],4)):pe("",!0)]))],2),n.add?(S(),T("button",{key:0,onClick:j,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",disabled:s.value,type:"button"},[ce(Pl,{width:"16",height:"16"}),ee[12]||(ee[12]=v("span",null,"Додати",-1))],8,SV)):pe("",!0)],512)],64)}}}),MV=["placeholder","disabled"],TV=_e({__name:"vs-input-textarea",props:yt({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,{inputClass:n}=Jn(e.style),r=It(t,"modelValue"),o=te(()=>!!e.disabled),s=te(()=>e.placeholder??"");return(i,l)=>nt((S(),T("textarea",{"onUpdate:modelValue":l[0]||(l[0]=a=>r.value=a),placeholder:s.value,disabled:o.value,row:"2",class:ae(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white",[me(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,MV)),[[jt,r.value]])}}),AV={},LV={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function OV(t,e){return S(),T("svg",LV,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),v("path",{d:"M21 21l-6 -6"},null,-1)]))}const NV=Ye(AV,[["render",OV]]),IV={},RV={class:"flex-shrink-0 mt-0.5 size-3.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function PV(t,e){return S(),T("svg",RV,e[0]||(e[0]=[v("path",{d:"m3 16 4 4 4-4"},null,-1),v("path",{d:"M7 20V4"},null,-1),v("path",{d:"m21 8-4-4-4 4"},null,-1),v("path",{d:"M17 4v16"},null,-1)]))}const DV=Ye(IV,[["render",PV]]),$V={},FV={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function VV(t,e){return S(),T("svg",FV,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),v("path",{d:"M7 9l5 -5l5 5"},null,-1),v("path",{d:"M12 4l0 12"},null,-1)]))}const BV=Ye($V,[["render",VV]]),HV={},jV={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function zV(t,e){return S(),T("svg",jV,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),v("path",{d:"M7 11l5 5l5 -5"},null,-1),v("path",{d:"M12 4l0 12"},null,-1)]))}const UV=Ye(HV,[["render",zV]]),WV={},KV={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function GV(t,e){return S(),T("svg",KV,e[0]||(e[0]=[tn('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)]))}const gy=Ye(WV,[["render",GV]]),qV={},JV={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YV(t,e){return S(),T("svg",JV,e[0]||(e[0]=[tn('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>',12)]))}const XV=Ye(qV,[["render",YV]]),ZV={},QV={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function eB(t,e){return S(),T("svg",QV,e[0]||(e[0]=[v("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"},null,-1)]))}const tB=Ye(ZV,[["render",eB]]),nB={class:"vs-datatable border rounded-xl w-full flex-grow"},rB={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},oB={class:"relative w-full"},sB={class:"table-wrapper flex gap-2"},iB={class:"vs-popover inline-block text-slate-700"},lB={class:"text-center"},aB={class:""},cB={class:"py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},uB={class:"flex flex-col p-[1px] gap-[2px] w-[140px]"},dB={class:"text-sm items-center text-gray-800 flex gap-1"},fB={class:"w-full overflow-x-auto"},pB={class:"w-full table-auto caption-bottom text-sm"},hB={class:"[&_tr]:border-b"},mB={class:"border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors"},gB={class:"h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center"},yB={key:0,colspan:"100%",class:"text-center"},bB={class:"w-full"},vB={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},wB=["onDragstart","onDragover","onDrop"],xB={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},kB={class:"flex items-center justify-center"},_B={key:0,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},CB={key:0},EB=["src"],SB={key:1,class:"rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"},MB=["innerHTML"],TB={key:2,class:"line-clamp-2 rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},AB={key:3,class:"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"},LB={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},OB={class:"flex items-center justify-center gap-2"},NB=["onClick"],IB=["onClick"],RB={class:"vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},PB=_e({__name:"vs-input-datatable",props:yt({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=It(t,"modelValue"),r=Q({}),o=Q(""),s=te(()=>{if(!o.value)return n.value??[];const Z=o.value.toLowerCase();return n.value.filter(K=>{var X;return(X=e.colModel)==null?void 0:X.some(G=>{const ne=K[G.key];return ne?Array.isArray(ne)?ne.join(", ").toLowerCase().includes(Z):String(ne).toLowerCase().includes(Z):!1})})}),i=Q(null),l=Q(null),a=Q(!1),c=Q(null),u=Q({top:0,left:0}),d=Z=>{i.value=Z},f=Z=>{l.value=Z},p=Z=>{if(i.value===null||i.value===Z){i.value=null,l.value=null;return}const K=[...n.value],[X]=K.splice(i.value,1);K.splice(Z,0,X),n.value=K,i.value=null,l.value=null},h=Z=>{const K=Z.currentTarget.getBoundingClientRect();u.value={top:K.bottom+window.scrollY,left:K.left+window.scrollX},a.value=!a.value},m=()=>{c.value&&c.value.click()},y=Z=>{const K=[".jpg",".jpeg",".png",".gif",".bmp",".webp",".svg",".ico",".tiff",".tif"],X=Z.toLowerCase();return K.some(G=>X.endsWith(G))},g=Z=>{var G;const K=(G=Z.target.files)==null?void 0:G[0];if(!K)return;const X=new FileReader;X.onload=ne=>{var Le;try{const je=(Le=ne.target)==null?void 0:Le.result;if(typeof je=="string"){const Be=JSON.parse(je);Array.isArray(Be)&&n.value.push(...Be)}}catch(je){console.error("Error parsing file:",je)}},X.readAsText(K)},k=()=>{const Z=JSON.stringify(n.value,null,2),K=new Blob([Z],{type:"application/json"}),X=URL.createObjectURL(K),G=document.createElement("a");G.href=X,G.download="data.json",G.click(),URL.revokeObjectURL(X)};rt(async()=>{var K;const Z=(K=e.colModel)==null?void 0:K.filter(X=>X.data);Z!=null&&Z.length&&Promise.all(Z.map(async X=>{const G=await(await fetch(`/api/suggest/${X.data}`)).json();r.value[X.key]=G.data}))});const w=Q(""),b=Q(!1);let _="edit",M=0;const E=Q({}),I=Q({});async function F(){w.value="Додати",b.value=!0,_="add",E.value={}}function R(Z,K){var G;const X=K.key||K.name;return r.value[X]&&Z[X]?((G=r.value[X].find(ne=>ne.id.toString()===Z[X].toString()))==null?void 0:G.text)??Z[X]:Z[X]||"-"}async function $(Z,K){w.value="Редагувати",b.value=!0,_="edit",M=K,E.value={...Z}}function A(){const Z=I.value.validate();if(Z){Nt({type:"warning",title:"Помилка валідації",message:Object.entries(Z).map(([K,X])=>`${K}: ${X}`).join(`
244
- `)});return}_==="add"?Array.isArray(n.value)?n.value=[...n.value,E.value]:n.value=[E.value]:n.value=n.value.map((K,X)=>X===M?E.value:K),b.value=!1}function q(Z){n.value=n.value.filter((K,X)=>X!==Z)}function Y(){b.value=!1}return(Z,K)=>(S(),T("div",nB,[v("div",rB,[v("div",oB,[ce(NV,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),nt(v("input",{type:"text","onUpdate:modelValue":K[0]||(K[0]=X=>o.value=X),placeholder:"Пошук",class:"py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"},null,512),[[jt,o.value]])]),v("div",sB,[v("input",{ref_key:"fileInput",ref:c,onChange:g,class:"hidden",accept:".json",type:"file"},null,544),v("div",iB,[v("div",lB,[v("div",aB,[v("button",{onClick:h,class:"bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[ce(DV,{height:"16",width:"16"})])])])])]),(S(),Ae(Is,{to:"body"},[a.value?(S(),T("div",{key:0,class:"text-slate-700 vsTailwind vs-popover__content bottom",style:pt([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:u.value.top+"px",left:u.value.left+"px"}])},[v("div",cB,[v("div",uB,[v("button",{onClick:m,class:"text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[ce(BV,{class:"text-black",width:"14",height:"14"}),K[4]||(K[4]=xn(" Імпортувати ",-1))]),v("button",{onClick:k,class:"text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[v("span",dB,[ce(UV,{class:"text-black",width:"14",height:"14"}),K[5]||(K[5]=xn(" Експортувати ",-1))])])])])],4)):pe("",!0)])),v("button",{onClick:F,class:"text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"},[ce(Pl),K[6]||(K[6]=xn(" Додати ",-1))])]),v("div",fB,[v("table",pB,[v("thead",hB,[v("tr",mB,[v("th",gB,[ce(gy,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(S(!0),T(Me,null,Je(Z.colModel,X=>(S(),T("th",{key:X.key,class:"h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"},we(X.ua||X.label),1))),128)),K[7]||(K[7]=v("th",{class:"h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center"}," Дії ",-1))])]),v("tbody",{class:ae({"[&_tr:last-child]:border-0":!l.value})},[s.value.length===0?(S(),T("td",yB,[v("div",bB,[v("div",vB,[ce(XV,{class:"w-48 mx-auto"}),K[8]||(K[8]=v("div",{class:"max-w-sm mx-auto mt-6"},[v("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),v("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):pe("",!0),(S(!0),T(Me,null,Je(s.value,(X,G)=>(S(),T("tr",{key:X.id,class:ae(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move",{"opacity-50":i.value===G,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":l.value===G}]),draggable:"true",onDragstart:ne=>d(G),onDragover:Vn(ne=>f(G),["prevent"]),onDrop:ne=>p(G)},[v("td",xB,[v("div",kB,[ce(gy,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(S(!0),T(Me,null,Je(Z.colModel,ne=>(S(),T("td",{key:ne.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[ne.type==="file"?(S(),T("div",_B,[y(R(X,ne))?(S(),T("div",CB,[v("img",{src:R(X,ne),alt:"alt",width:"45",class:"rounded-md max-w-[45px] h-[45px] object-cover"},null,8,EB)])):(S(),T("div",SB,[ce(mk,{class:"w-[25px] min-w-[25px] h-[25px]"})]))])):ne.type==="tiptap-editor"?(S(),T("div",{key:1,class:"rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors line-clamp-3",innerHTML:R(X,ne)},null,8,MB)):ne.type==="reference"?(S(),T("div",TB,we(R(X,ne)),1)):(S(),T("div",AB,we(R(X,ne)),1))]))),128)),v("td",LB,[v("div",OB,[v("button",{onClick:ne=>$(X,G),class:"text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[ce(tB,{width:"24",height:"24",class:"w-3 h-3"})],8,NB),v("button",{onClick:ne=>q(G),class:"text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"},[ce(zu,{width:"24",height:"24",class:"w-3 h-3"})],8,IB)])])],42,wB))),128))],2)])]),ce(me(Rh),{teleport:"#modal",visible:b.value,title:w.value,size:"lg",onClose:Y},{default:Ke(()=>[ce(xi,{schema:e.colModel,values:E.value,"onUpdate:values":K[1]||(K[1]=X=>E.value=X),form:I.value,"onUpdate:form":K[2]||(K[2]=X=>I.value=X)},null,8,["schema","values","form"]),v("div",RB,[v("button",{type:"button",onClick:K[3]||(K[3]=X=>b.value=!1),class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),v("button",{onClick:A,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])]),_:1},8,["visible","title"])]))}}),DB={draw:{toolbar:{actions:{title:"Скасувати малювання",text:"Скасувати"},finish:{title:"Завершити малювання",text:"Завершити"},undo:{title:"Видалити останню точку",text:"Видалити останню"},buttons:{polyline:"Намалювати лінію",polygon:"Намалювати полігон",rectangle:"Намалювати прямокутник",circle:"Намалювати коло",marker:"Додати точку",circlemarker:"Додати маркер-коло"}},handlers:{circle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати коло",end:"Відпустіть кнопку миші, щоб завершити"},radius:"Радіус"},circlemarker:{tooltip:{start:"Клацніть на карту, щоб додати маркер-коло"}},marker:{tooltip:{start:"Клацніть на карту, щоб додати точку"}},polygon:{tooltip:{start:"Клацніть, щоб почати малювати полігон",cont:"Клацайте, щоб продовжити малювати полігон",end:"Клацніть першу точку, щоб завершити полігон"}},polyline:{error:"<strong>Помилка:</strong> лінія не може перетинатися сама з собою",tooltip:{start:"Клацніть, щоб почати малювати лінію",cont:"Клацайте, щоб продовжити малювати лінію",end:"Клацніть останню точку, щоб завершити лінію"}},rectangle:{tooltip:{start:"Клацніть і тягніть, щоб намалювати прямокутник",end:"Відпустіть кнопку миші, щоб завершити"}},simpleshape:{tooltip:{end:"Відпустіть кнопку миші, щоб завершити"}}}},edit:{toolbar:{actions:{save:{title:"Зберегти зміни",text:"Зберегти"},cancel:{title:"Скасувати редагування",text:"Скасувати"},clearAll:{title:"Очистити всі шари",text:"Очистити все"}},buttons:{edit:"Редагувати шари",editDisabled:"Немає шарів для редагування",remove:"Видалити шари",removeDisabled:"Немає шарів для видалення"}},handlers:{edit:{tooltip:{text:"Перетягніть маркери, щоб редагувати шари",subtext:"Натисніть 'Скасувати', щоб повернутися"}},remove:{tooltip:{text:"Клацніть на шари, щоб видалити їх"}}}}};function al(t){return t?t.type==="Polygon"?{type:"MultiPolygon",coordinates:[t.coordinates]}:t.type==="Feature"?{...t,geometry:al(t.geometry)}:t.type==="FeatureCollection"?{...t,features:(t.features||[]).map(e=>al(e)).filter(Boolean)}:t:null}function $B(t){return t?t.type==="FeatureCollection"||t.type==="Feature"?al(t):t.geom?{type:"Feature",geometry:al({type:t.geom.type,coordinates:t.geom.coordinates}),properties:{}}:t.type&&t.coordinates?{type:"Feature",geometry:al(t),properties:{}}:null:null}const FB={},VB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map-pin"};function BB(t,e){return S(),T("svg",VB,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),v("path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z"},null,-1)]))}const HB=Ye(FB,[["render",BB]]),jB={},zB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-line"};function UB(t,e){return S(),T("svg",zB,e[0]||(e[0]=[v("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),v("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),v("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),v("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const WB=Ye(jB,[["render",UB]]),KB={},GB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-polygon"};function qB(t,e){return S(),T("svg",GB,e[0]||(e[0]=[tn('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>',9)]))}const JB=Ye(KB,[["render",qB]]),YB={},XB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"};function ZB(t,e){return S(),T("svg",XB,e[0]||(e[0]=[tn('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>',9)]))}const QB=Ye(YB,[["render",ZB]]),eH={},tH={version:"1.1",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg","xmlns:sketch":"http://www.bohemiancoding.com/sketch/ns","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"fullscreen-icon"};function nH(t,e){return S(),T("svg",tH,e[0]||(e[0]=[v("title",null,null,-1),v("desc",null,null,-1),v("defs",null,null,-1),v("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[v("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[v("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[v("path",{d:"M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",id:"Shape"})])])],-1)]))}const rH=Ye(eH,[["render",nH]]),oH={class:"map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"},sH={key:0,class:"vs-select__options absolute z-50 mt-1 w-full bg-white border border-gray-300 shadow-lg rounded-lg text-sm"},iH=["onClick"],lH={class:"relative flex-1 min-w-[140px]"},aH=["placeholder"],cH="https://data.softpro.ua/api-user/gis-url-proxy",uH="https://geo.rv.ua/api-user/dzk.api",dH=_e({__name:"map-search",props:{config:{}},emits:["goToCoordinates"],setup(t,{emit:e}){const n=t,r=e,o=["here","xy","parcel"],s=te(()=>{var _,M;const b=(M=(_=n.config)==null?void 0:_.tools)==null?void 0:M.filter(E=>o.includes(E));return b&&b.length?b:o}),i=te(()=>{var b,_;return((_=(b=n.config)==null?void 0:b.placeholder)==null?void 0:_.trim())||"Пошук…"}),l=Q(s.value[0]??o[0]);Re(s,b=>{b.includes(l.value)||(l.value=b[0])});const a=Q(""),c=Q(!1),u=Q(null);Re(l,()=>{a.value="",c.value=!1});function d(b){l.value=b}function f(b){if(!c.value)return;const _=u.value;_&&!_.contains(b.target)&&(c.value=!1)}rt(()=>{window.addEventListener("click",f,!0)}),uo(()=>{window.removeEventListener("click",f,!0)});function p(b){return b==="xy"?"Координати":b==="parcel"?"Кадастр":"Адреси"}function h(b){const _=b.replace(/[,]+/g," ").trim();if(!_)return null;const M=_.split(/\s+/).filter(Boolean);if(M.length<2)return null;const E=M.slice(0,2).map(Number);if(!E.every(Y=>Number.isFinite(Y)))return null;let[I,F]=E,R=I,$=F;const A=Y=>Math.abs(Y)<=90,q=Y=>Math.abs(Y)<=180;if(!A(R)||!q($))if(A($)&&q(R))R=F,$=I;else return null;return{lat:R,lng:$}}function m(b){return((b==null?void 0:b.items)||[]).map((_,M)=>{var E,I,F;return{id:String((_==null?void 0:_.id)??M),title:(_==null?void 0:_.title)||((E=_==null?void 0:_.address)==null?void 0:E.label)||"Знайдений обʼєкт",lat:Number((I=_==null?void 0:_.position)==null?void 0:I.lat),lng:Number((F=_==null?void 0:_.position)==null?void 0:F.lng)}}).filter(_=>Number.isFinite(_.lat)&&Number.isFinite(_.lng))}function y(b){const _=(b==null?void 0:b.result)||(b==null?void 0:b.data)||b;if(!_)return[];const M=_.geom_centroid;if(!M||!Array.isArray(M.coordinates))return[];const[E,I]=M.coordinates;return!Number.isFinite(I)||!Number.isFinite(E)?[]:[{id:"parcel",title:_.cadnum||_.cad_num||"Земельна ділянка",lat:I,lng:E}]}function g(b){const _=b.replace(/\s+/g,"").split(":");if(_.length!==4)return!1;const M=[10,2,3,4];return _.every((E,I)=>E.length===M[I]&&/^\d+$/.test(E))}function k(b){r("goToCoordinates",[b.lat,b.lng])}async function w(){const b=a.value.trim();if(b){if(l.value==="xy"){const _=h(b);if(!_){Nt({type:"warning",title:"Пошук координат",message:"Не знайдено або невірний формат координат"});return}k(_),a.value="";return}try{const _=new URL(l.value==="here"?cH:uH);if(l.value==="here")_.searchParams.set("searchtext",b);else{if(!g(b)){Nt({type:"warning",title:"Пошук кадастру",message:"Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"});return}_.searchParams.set("cad_num",b)}const M=await fetch(_.toString());if(!M.ok)throw new Error(`HTTP ${M.status}`);const E=await M.json(),I=l.value==="here"?m(E):y(E);if(!I.length)Nt({type:"warning",title:"Пошук",message:"Не знайдено результатів"});else{const F=I[0];k(F),a.value=""}}catch(_){const M=(_==null?void 0:_.message)||"Помилка пошуку";Nt({type:"error",title:"Пошук",message:M})}}}return(b,_)=>(S(),T("div",oH,[v("form",{class:"flex gap-2",onSubmit:Vn(w,["prevent"])},[s.value.length>1?(S(),T("div",{key:0,ref_key:"dropdownRef",ref:u,class:"relative search-type w-[140px]"},[v("button",{type:"button",class:"vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",onClick:_[0]||(_[0]=M=>c.value=!c.value)},[v("span",null,we(p(l.value)),1),(S(),T("svg",{class:ae(["w-4 h-4 text-gray-500 transition-transform",{"rotate-180":c.value}]),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_[2]||(_[2]=[v("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]),2))]),c.value?(S(),T("div",sH,[v("ul",null,[(S(!0),T(Me,null,Je(s.value,M=>(S(),T("li",{key:M,class:"px-3 py-2 cursor-pointer hover:bg-gray-100",onClick:E=>d(M)},we(p(M)),9,iH))),128))])])):pe("",!0)],512)):pe("",!0),v("div",lH,[nt(v("input",{"onUpdate:modelValue":_[1]||(_[1]=M=>a.value=M),placeholder:i.value,type:"text",class:"vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"},null,8,aH),[[jt,a.value,void 0,{trim:!0}]]),_[3]||(_[3]=v("button",{type:"submit",class:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600","aria-label":"Пошук"},[v("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[v("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-4.35-4.35m0 0A7.5 7.5 0 1 0 5 5a7.5 7.5 0 0 0 11.65 11.65Z"})])],-1))])],32)]))}}),fH=Ye(dH,[["__scopeId","data-v-3048520a"]]),pH={class:"bg-white/30 p-1 rounded-md shadow"},hH={class:"flex gap-2"},mH=["onClick","title"],gH=["src"],yH=_e({__name:"map-layers",props:{basemaps:{}},emits:["onLayerChange"],setup(t,{emit:e}){const n=Q(Object.keys(t.basemaps)[0]),r=e;function o(s){r("onLayerChange",s),n.value=s}return(s,i)=>(S(),T("div",pH,[v("div",hH,[(S(!0),T(Me,null,Je(s.basemaps,(l,a)=>(S(),T("div",{key:a,class:ae(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":n.value===a}]),onClick:c=>o(a),title:l.name||a,role:"button",tabindex:"0"},[v("img",{src:l.preview,alt:"",class:"w-10 h-10 object-cover"},null,8,gH)],10,mH))),128))])]))}}),bH={key:0,class:"absolute inset-0 z-[2000] flex items-center justify-center pointer-events-none bg-black/20"},vH={class:"bg-black/50 text-white px-6 py-2 rounded-lg text-center max-w-sm mx-4 backdrop-blur-sm"},wH={class:"text-sm font-medium"},xH={key:0,class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},kH={key:1,class:"form-geom__panel flex gap-1 items-start mt-2"},_H={class:"flex items-center gap-1"},CH=["disabled"],EH=["disabled"],SH=["disabled"],MH={class:"absolute top-4 right-4 z-[1000]"},TH={class:"flex flex-col gap-[2px]"},AH=["disabled"],LH=["disabled"],OH=["disabled"],NH=["disabled"],IH={class:"flex flex-col gap-2"},RH={key:0,class:"bg-white/95 border border-gray-200 rounded-md shadow-sm px-3 py-2 text-xs text-gray-700 min-w-[200px]"},PH={class:"flex flex-col gap-1"},DH=["checked","disabled","onChange"],$H={class:"text-gray-700 text-xs font-medium"},FH={class:"absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1"},VH={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},BH={class:"shrink-0"},HH={class:"font-bold"},jH={class:"flex items-center"},zH={class:"text-xs mr-2"},UH={key:0,class:"text-xs"},WH={key:1,class:"text-xs"},KH=["disabled"],GH=["disabled"],qH=_e({__name:"vs-input-map",props:{tools:{},handleZoom:{type:Boolean,default:!0},geomType:{default:()=>[]},prefix:{default:""},layers:{default:()=>[]},api:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(t,{emit:e}){var De;const n=St(),r=t,o=e,s=te(()=>{const P={search:!1,import:!1,export:!1,point:!1,line:!1,polygon:!1,rectangle:!1};if(!r.tools||!r.tools.length)return P;const j=new Set(r.tools.map(se=>se.toLowerCase()));return{search:j.has("search"),import:j.has("import"),export:j.has("export"),point:j.has("point"),line:j.has("line"),polygon:j.has("polygon"),rectangle:j.has("rectangle")}}),i=te(()=>!!r.disabled),l=Q(!1),a=Q(null),c=Q(null),u=Q(!1),d=Q(""),f=Ns({}),p=Q([]),h=te(()=>p.value.map(P=>f[P]).filter(P=>!!P)),m=te(()=>Array.isArray(r.layers)&&r.layers.some(P=>`${(P==null?void 0:P.service)??""}`.toLowerCase()==="vtile"));let y,g,k;function w(){return navigator.platform.toUpperCase().indexOf("MAC")>=0,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?"Використовуйте два пальці для зуму карти.":"Використовуйте Ctrl + прокрутка для зуму карти."}const b=Q(null),_=Q(null);let M=null;const E=Q(null),I=P=>{P.ctrlKey&&P.preventDefault()};function F(P,j){return P!=null&&P.id?String(P.id):P!=null&&P.url?`${P.url}-${j}`:`layer-${j}`}function R(P){if(!P)return"";if(/^https?:\/\//i.test(P))return P.replace(/\/+$/,"");const j=P.replace(/^\/+/,"").replace(/\/+$/,"");return j?`/${j}`:""}function $(P){var ve;const j=(P==null?void 0:P.url)??"";if(!j||/^https?:\/\//i.test(j))return j;const se=typeof window<"u"&&((ve=window.location)!=null&&ve.origin)?window.location.origin:"";if(j.startsWith("/"))return se?`${se}${j}`:j;const de=R(P==null?void 0:P.prefix),ge=R(r.prefix),U=de||ge,ee=j.replace(/^\/+/,""),ue=U?`${U.replace(/\/$/,"")}/${ee}`:`/${ee}`;return se?`${se}${ue}`:ue}function A(P){const j=(P==null?void 0:P.style)??{};return se=>{const de=j.colorAttr,ge=j.colorSet??{},U=typeof de=="string"?(ge==null?void 0:ge[se==null?void 0:se[de]])??j.color??"#3388ff":j.color??"#3388ff",ee=j.stroke??U;return{weight:j.width??1,color:ee,opacity:j.opacity??1,fill:j.type?j.type!=="polyline":!0,fillColor:U,fillOpacity:j.opacity??.5}}}function q(P){const j=(P==null?void 0:P.colorSet)||(P==null?void 0:P.colors);if(P!=null&&P.colorAttr&&j){const se=Object.entries(j).flat();return["match",["get",P.colorAttr],...se,P.color??"#94a3b8"]}return(P==null?void 0:P.color)??"#3388ff"}function Y(P,j,se){if(!P)return[];const de=[],ge=q(P);return P.icon&&de.push({id:`${j}-icon`,type:"symbol",source:j,"source-layer":se,minzoom:P.iconZoom||0,layout:{"icon-image":P.icon,"icon-size":1,"icon-allow-overlap":!0,"icon-ignore-placement":!0}}),P.pointZoom&&de.push({id:`${j}-point`,type:"circle",source:j,"source-layer":se,maxzoom:P.pointZoom,paint:{"circle-stroke-color":P.stroke||"#fff","circle-opacity":P.opacity??1,"circle-color":ge,"circle-stroke-width":P.width??1,"circle-radius":P.radius??5}}),P.type==="polygon"?de.push({id:`${j}-fill`,type:"fill",source:j,"source-layer":se,minzoom:P.pointZoom||0,paint:{"fill-color":ge,"fill-opacity":P.opacity??.5,"fill-outline-color":P.stroke||ge}}):P.type==="line"?de.push({id:`${j}-line`,type:"line",source:j,"source-layer":se,paint:{"line-color":ge,"line-opacity":P.opacity??1,"line-width":P.width??1.5}}):P.icon||de.push({id:`${j}-circle`,type:"circle",source:j,"source-layer":se,paint:{"circle-stroke-color":P.stroke||"#fff","circle-opacity":P.opacity??1,"circle-color":ge,"circle-stroke-width":P.width??1,"circle-radius":P.radius??5}}),de}function Z(P,j){var U;const se=P.id||`source-${Math.random().toString(36).slice(2,8)}`,de=P.sourceLayer||P.layer||P.service_layer||P.service_key||P.map_key||((U=P.dataset)==null?void 0:U.layer)||P.id||P.table_name||se,ge=Y(P.style||{},se,de||se);return ge.length?{version:8,glyphs:"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",sources:{[se]:{type:"vector",tiles:[j],minzoom:P.minzoom??0,maxzoom:P.maxzoom??19}},layers:ge}:null}function K(P){var ge,U,ee,ue;const j=((P==null?void 0:P.service)??"").toLowerCase(),se=$(P),de=P.sourceLayer||P.layer||P.service_layer||P.service_key||P.map_key||((ge=P.dataset)==null?void 0:ge.layer)||P.id||P.table_name;if(console.info("[vs-input-map] create overlay layer",{id:P.id,service:j,url:se,sourceLayer:de,hasSourceLayer:!!de}),j==="vtile"){if((U=L==null?void 0:L.vectorGrid)!=null&&U.protobuf&&!(L!=null&&L.maplibreGL))return console.info("[vs-input-map] using Leaflet.vectorGrid"),L.vectorGrid.protobuf(se,{interactive:!0,vectorTileLayerStyles:{default:A(P)}});if(L!=null&&L.maplibreGL&&(window!=null&&window.maplibregl)){console.info("[vs-input-map] using maplibre-gl-leaflet");const ve=Z(P,se);return ve?L.maplibreGL({style:ve,interactive:!1,pane:"overlayPane"}):(console.warn("[vs-input-map] maplibre spec is empty",P.id),null)}return null}return j==="tile"||/^https?:\/\//i.test(se)||se.includes("{z}")?L.tileLayer(se,{opacity:((ee=P==null?void 0:P.style)==null?void 0:ee.opacity)??1}):L.tileLayer(se,{opacity:((ue=P==null?void 0:P.style)==null?void 0:ue.opacity)??1})}function X(){y&&p.value.forEach(P=>{const j=f[P];j&&(j.visible?(j.layer||(j.layer=K(j.config)),j.layer&&!y.hasLayer(j.layer)?(console.info("[vs-input-map] add overlay layer to map",j.id),j.layer.addTo(y)):j.layer||console.warn("[vs-input-map] overlay layer is null",j.id)):j.layer&&y.hasLayer(j.layer)&&(console.info("[vs-input-map] remove overlay layer from map",j.id),y.removeLayer(j.layer)))})}function G(P){if(i.value)return;const j=f[P];j&&(j.visible=!j.visible,y&&(console.info("[vs-input-map] toggle overlay",{id:P,nextVisible:j.visible,hasLayerInstance:!!j.layer}),j.visible?(j.layer||(j.layer=K(j.config)),j.layer&&!y.hasLayer(j.layer)&&(console.info("[vs-input-map] add overlay layer to map",j.id),j.layer.addTo(y))):j.layer&&y.hasLayer(j.layer)&&y.removeLayer(j.layer)))}function ne(){if(!r.handleZoom)return null;let P;const j=de=>{const ge=de.ctrlKey||de.metaKey,U=de.shiftKey;if(!ge&&!U){u.value=!0,d.value=w(),clearTimeout(P),P=window.setTimeout(()=>{u.value=!1},1e3);return}u.value=!1,y.scrollWheelZoom.enable(),setTimeout(()=>{y.scrollWheelZoom.disable()},100)},se=de=>{if(de.touches.length===1){u.value=!0,d.value=w(),clearTimeout(P),P=window.setTimeout(()=>{u.value=!1},3e3);return}u.value=!1};return _.value&&(_.value.addEventListener("wheel",j,{passive:!1}),_.value.addEventListener("touchstart",se,{passive:!0})),y&&y.on("wheel",de=>{const ge=de.originalEvent.ctrlKey||de.originalEvent.metaKey,U=de.originalEvent.shiftKey;!ge&&!U&&(de.originalEvent.preventDefault(),de.originalEvent.stopPropagation())}),()=>{_.value&&(_.value.removeEventListener("wheel",j),_.value.removeEventListener("touchstart",se)),y&&y.off("wheel"),clearTimeout(P)}}const Le=Q(null),je=Q(6),Be=Q(0),Dt=Q(((De=n==null?void 0:n.appContext.config.globalProperties.$settings)==null?void 0:De.center)||[50,30]),Ze=Q(null),Pt=he();let vt;const oe=Q("topo100");function be(P){return P?P.type==="Polygon"?{type:"MultiPolygon",coordinates:[P.coordinates]}:(P.type,P):null}function ye(){return new Promise((P,j)=>{window.L&&window.L.Draw&&P(0);const se=U=>{if(Array.from(document.styleSheets).some(ue=>{var ve;return(ve=ue==null?void 0:ue.href)==null?void 0:ve.includes(U)}))return;const ee=document.createElement("link");ee.rel="stylesheet",ee.href=U,document.head.appendChild(ee)},de=U=>new Promise((ee,ue)=>{const ve=Array.from(document.scripts).find(ze=>ze.src===U);if(ve){ve.addEventListener("load",()=>ee()),ve.addEventListener("error",ze=>ue(ze));return}const He=document.createElement("script");He.src=U,He.async=!0,He.onload=()=>ee(),He.onerror=ze=>ue(ze),document.body.appendChild(He)});se("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),se("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),m.value&&se("https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.css");let ge=de("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>de("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"));m.value?ge=ge.then(()=>de("https://unpkg.com/maplibre-gl@4.5.0/dist/maplibre-gl.js")).then(()=>(window.maplibregl&&!window.mapboxgl&&(window.mapboxgl=window.maplibregl),de("https://unpkg.com/@maplibre/maplibre-gl-leaflet@0.0.20/leaflet-maplibre-gl.js"))):ge=ge.then(()=>de("https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js").catch(()=>Promise.resolve())),ge.then(()=>P(0)).catch(j)})}function xe(){const P=g.toGeoJSON(),j=[];let se=null;const de=U=>{if(U)switch(U.type){case"Point":se=U;break;case"Polygon":j.push(U.coordinates);break;case"MultiPolygon":j.push(...U.coordinates);break;case"GeometryCollection":(U.geometries||[]).forEach(de);break}};((P==null?void 0:P.features)||[]).forEach(U=>de(U.geometry));const ge=se||(j.length?{type:"MultiPolygon",coordinates:j}:null);o("update:modelValue",ge?be(ge):null),Be.value=g.getLayers().length}function Ve(P=30){const j=g.getLayers();if(!j.length)return;const se=L.featureGroup(j).getBounds();se&&se.isValid()&&y.fitBounds(se,{padding:[P,P]})}function Ue(){var P;i.value||((P=E.value)==null||P.click())}const O=Q("");Re(s,P=>{O.value&&!Object.entries(P).filter(([j,se])=>se).map(([j])=>j).includes(O.value)&&(k!=null&&k.disable&&k.disable(),O.value="")}),Re(()=>r.layers,P=>{const j=Array.isArray(P)?P:[],se=[],de=new Set;j.forEach((ge,U)=>{if(!ge)return;const ee=F(ge,U);se.push(ee),de.add(ee),console.info("[vs-input-map] overlay register",{id:ee,service:ge==null?void 0:ge.service,url:ge==null?void 0:ge.url});const ue=f[ee];ue?f[ee]={...ue,config:{...ge,id:ee}}:f[ee]={id:ee,config:{...ge,id:ee},visible:(ge==null?void 0:ge.overlay)!==!1,layer:null}}),Object.keys(f).forEach(ge=>{if(de.has(ge))return;const U=f[ge];U!=null&&U.layer&&(y!=null&&y.hasLayer)&&y.hasLayer(U.layer)&&y.removeLayer(U.layer),delete f[ge]}),p.value=se,X()},{immediate:!0,deep:!0}),Re(i,P=>{P&&k&&(k.disable(),O.value=""),g&&g.eachLayer(j=>{var se,de,ge,U,ee;P?(de=(se=j.dragging)==null?void 0:se.disable)==null||de.call(se):(ge=j.dragging)!=null&&ge.enable&&(j.dragging.enable(),(ee=(U=j.dragging).enabled)==null||ee.call(U))})});function B(P){return P instanceof L.Circle?"Circle":P instanceof L.Rectangle?"Rectangle":P instanceof L.Polygon&&!(P instanceof L.Rectangle)?"Polygon":P instanceof L.Polyline&&!(P instanceof L.Polygon)?"Polyline":P instanceof L.Marker?"Point":"Feature"}function J(P){var j;if(P instanceof L.Circle){const se=P.getRadius();return Math.PI*(se*se)/1e6}if(P instanceof L.Polygon||P instanceof L.Rectangle)try{const se=P.getLatLngs(),de=Array.isArray(se[0])?se[0]:se,ge=(j=L.GeometryUtil)!=null&&j.geodesicArea?L.GeometryUtil.geodesicArea(de):0;return ge?ge/1e6:0}catch{return null}return null}function ie(P){return P instanceof L.Circle?P.getLatLng():P.getBounds?P.getBounds().getCenter():P.getLatLng?P.getLatLng():y.getCenter()}async function re(P,j){var ge;if(b.value="",!((ge=r.api)!=null&&ge.length))return;const[se,de]=r.api;try{const U=new URL(se);U.searchParams.set("lat",String(P)),U.searchParams.set("lon",String(j));const ee=await fetch(U.toString());if(!ee.ok)throw new Error("Request failed");const ue=await ee.json();de&&ue[de]!==void 0?b.value=String(ue[de]):b.value=JSON.stringify(ue)}catch(U){console.error("[vs-input-map] reverse geocode failed:",U),b.value=null}}function x(){const P=g.getLayers();if(!P.length){Ze.value=null,Be.value=0;return}const j=P[P.length-1],se=B(j),de=ie(j),ge=J(j);Ze.value={type:se,center:de,areaKm2:ge,layer:j},Be.value=P.length,re(de.lat,de.lng)}function C(){var j;if(i.value)return;const P=(j=Ze.value)==null?void 0:j.layer;P&&(P instanceof L.Circle&&P.getBounds?y.fitBounds(P.getBounds(),{padding:[30,30]}):P.getBounds?y.fitBounds(P.getBounds(),{padding:[30,30]}):P.getLatLng&&y.setView(P.getLatLng(),Math.max(je.value,14)))}function N(){var j;if(i.value)return;const P=(j=Ze.value)==null?void 0:j.layer;P&&(g.removeLayer(P),xe(),x())}rt(async()=>{document.addEventListener("wheel",I,{passive:!1}),await ye(),L.drawLocal=DB;const P=r.handleZoom;y=L.map(_.value,{zoomControl:!1,scrollWheelZoom:!P}).setView(Dt.value,10),setTimeout(()=>{M=ne()},100),L.control.zoom({position:"bottomright"}).addTo(y),oe.value=Object.keys(Pt)[0],vt=L.tileLayer(Pt[oe.value].url,{maxZoom:19,minZoom:6}).addTo(y),g=new L.FeatureGroup().addTo(y),y.on(L.Draw.Event.CREATED,de=>{if(i.value)return;const{layer:ge}=de;g.clearLayers(),g.addLayer(ge),xe(),Ve(),O.value=""}),y.on(L.Draw.Event.EDITED,()=>{i.value||(xe(),x(),Ve())}),y.on(L.Draw.Event.DELETED,()=>{i.value||(xe(),x(),Ve())});let j=!1;y.on("mousemove",de=>{j||(y.invalidateSize(),j=!0),Le.value=de.latlng}),y.on("zoomend",()=>{je.value=y.getZoom()});const se=$B(r.modelValue);if(se){const de=[];L.geoJSON(se).eachLayer(ge=>de.push(ge)),de.length&&g.addLayer(de[0]),xe(),x(),Ve()}X()}),gn(()=>{document.removeEventListener("wheel",I),M&&M(),Object.values(f).forEach(P=>{var j;P!=null&&P.layer&&((j=y==null?void 0:y.hasLayer)!=null&&j.call(y,P.layer)&&y.removeLayer(P.layer),typeof P.layer.remove=="function"&&P.layer.remove())})});function H(P){if(!i.value&&y){switch(k&&k.disable(),P){case"marker":k=new L.Draw.Marker(y);break;case"polyline":k=new L.Draw.Polyline(y);break;case"polygon":k=new L.Draw.Polygon(y);break;case"rectangle":k=new L.Draw.Rectangle(y);break;default:k=new L.Draw.Rectangle(y);break}k&&(k.enable(),O.value=P)}}function D(){if(i.value)return;const P=g.toGeoJSON(),j=new Blob([JSON.stringify(P,null,2)],{type:"application/json"}),se=URL.createObjectURL(j),de=document.createElement("a");de.href=se,de.download="data.geojson",de.click(),URL.revokeObjectURL(se)}function z(P){var ge;if(i.value)return;const j=P.target,se=(ge=j.files)==null?void 0:ge[0];if(!se)return;const de=new FileReader;de.onload=()=>{if(typeof de.result=="string")try{const U=JSON.parse(de.result);g.clearLayers(),U&&L.geoJSON({type:"Feature",geometry:U}).eachLayer(ee=>{g.addLayer(ee)}),xe(),x(),Ve()}finally{j.value=""}},de.readAsText(se)}function V(P){y&&(vt&&y.removeLayer(vt),vt=L.tileLayer(Pt[P].url,{maxZoom:19,minZoom:6}).addTo(y),oe.value=P)}function W(P){const j=L.latLng(P[0],P[1]);y.setView(j,13)}Re(()=>r.modelValue,P=>{const j=be(P);if(P&&j!==P){o("update:modelValue",j);return}g.clearLayers(),j&&L.geoJSON({type:"Feature",geometry:j}).eachLayer(se=>{var de,ge,U,ee,ue,ve;if(g.addLayer(se),i.value){(ge=(de=se.dragging)==null?void 0:de.disable)==null||ge.call(de);return}(ee=(U=se.dragging)==null?void 0:U.enable)==null||ee.call(U),(ve=(ue=se.dragging)==null?void 0:ue.enabled)==null||ve.call(ue),se.on("dragend",He=>{const ze=He.target.getLatLng();o("update:modelValue",{type:"Point",coordinates:[ze.lng,ze.lat]})})}),Be.value=g.getLayers().length,x(),Ve()});function he(){var P,j;return(P=n==null?void 0:n.appContext.config.globalProperties.$settings)!=null&&P.basemaps?(j=n==null?void 0:n.appContext.config.globalProperties.$settings)==null?void 0:j.basemaps.map((se,de)=>Object.assign(se,{key:`b${de}`,preview:se.preview||se.url.replace("{z}/{x}/{y}.png","13/4790/2762.png")})).reduce((se,de)=>({...se,[de.key]:de}),{}):{topo100:{url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"},orto10:{url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",preview:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"},osmb:{url:"https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",preview:"https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"}}}const Ce=Q(!1);return Re(Ce,()=>{setTimeout(()=>{y.invalidateSize()},50)}),Re(l,async P=>{if(!P||!c.value){a.value=null;return}await zt();const j=c.value.getBoundingClientRect();a.value={top:j.bottom+6,left:j.left}}),gn(()=>{l.value=!1,a.value=null}),(P,j)=>(S(),T("div",{class:ae(["leaflet-map-wrapper relative w-full h-[400px]",{fullscreen:Ce.value}])},[v("div",{ref_key:"mapContainer",ref:_,class:"w-full h-full"},null,512),ce(Rs,{name:"zoom-instructions","enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-500 ease-in","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:Ke(()=>[u.value&&r.handleZoom?(S(),T("div",bH,[v("div",vH,[v("p",wH,we(d.value),1)])])):pe("",!0)]),_:1}),s.value.search||s.value.import||s.value.export?(S(),T("div",xH,[s.value.search?(S(),Ae(fH,{key:0,onGoToCoordinates:W})):pe("",!0),s.value.import||s.value.export?(S(),T("div",kH,[v("div",_H,[s.value.import?(S(),T("button",{key:0,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:Ue,disabled:i.value}," Import ",8,CH)):pe("",!0),s.value.export?(S(),T("button",{key:1,type:"button",class:"inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",onClick:D,disabled:i.value||Be.value===0}," Export ",8,EH)):pe("",!0)]),v("input",{ref_key:"importRef",ref:E,type:"file",onChange:z,accept:".json,.geojson",class:"hidden",disabled:i.value},null,40,SH)])):pe("",!0)])):pe("",!0),v("div",MH,[v("div",TH,[s.value.point?(S(),T("button",{key:0,class:ae(["vs-btn",{"vs-active":O.value==="marker"}]),title:"Point",onClick:j[0]||(j[0]=se=>H("marker")),disabled:i.value},[ce(HB)],10,AH)):pe("",!0),s.value.line?(S(),T("button",{key:1,class:ae(["vs-btn",{"vs-active":O.value==="polyline"}]),title:"Line",onClick:j[1]||(j[1]=se=>H("polyline")),disabled:i.value},[ce(WB)],10,LH)):pe("",!0),s.value.polygon?(S(),T("button",{key:2,class:ae(["vs-btn",{"vs-active":O.value==="polygon"}]),title:"Polygon",onClick:j[2]||(j[2]=se=>H("polygon")),disabled:i.value},[ce(JB)],10,OH)):pe("",!0),s.value.rectangle?(S(),T("button",{key:3,class:ae(["vs-btn",{"vs-active":O.value==="rectangle"}]),title:"Rectangle",onClick:j[3]||(j[3]=se=>H("rectangle")),disabled:i.value},[ce(QB)],10,NH)):pe("",!0),v("button",{class:"vs-btn mt-5",onClick:j[4]||(j[4]=se=>Ce.value=!Ce.value),title:"Full Screen"},[ce(rH,{style:{width:"12px",height:"12px"}})])])]),v("div",{class:ae(["absolute left-4 z-[1000]",Ze.value?"bottom-8":"bottom-4"])},[v("div",IH,[ce(yH,{basemaps:me(Pt),onOnLayerChange:V},null,8,["basemaps"]),h.value.length?(S(),T("div",RH,[j[9]||(j[9]=v("p",{class:"font-semibold text-[11px] uppercase tracking-wide text-gray-500 mb-2"},"Layers",-1)),v("div",PH,[(S(!0),T(Me,null,Je(h.value,se=>(S(),T("label",{key:se.id,class:"flex items-center gap-2 cursor-pointer select-none"},[v("input",{type:"checkbox",class:"rounded border-gray-300 text-blue-600 focus:ring-blue-500",checked:se.visible,disabled:i.value,onChange:de=>G(se.id)},null,40,DH),v("span",$H,we(se.config.title||se.config.name||se.id),1)]))),128))])])):pe("",!0)])],2),v("div",FH,[Ze.value?(S(),T("div",VH,[v("div",{class:"mr-auto flex items-center gap-2 min-w-0 relative",onMouseenter:j[5]||(j[5]=se=>l.value=!0),onMouseleave:j[6]||(j[6]=se=>l.value=!1)},[v("div",BH,[j[10]||(j[10]=xn(" Type: ",-1)),v("span",HH,we(Ze.value.type),1)]),b.value?(S(),T("div",{key:0,ref_key:"addressEl",ref:c,class:"text-gray-500 text-xs truncate cursor-help",style:{"max-width":"260px"}}," Address: "+we(b.value),513)):pe("",!0),(S(),Ae(Is,{to:"body"},[l.value&&b.value&&a.value?(S(),T("div",{key:0,class:"fixed z-[99999] pointer-events-none bg-gray-800 text-white text-xs px-2 py-1 rounded shadow whitespace-nowrap",style:pt({top:a.value.top+"px",left:a.value.left+"px"})},we(b.value),5)):pe("",!0)]))],32),v("div",jH,[v("div",zH,[j[11]||(j[11]=xn(" Center: ",-1)),v("b",null,we(Ze.value.center.lat.toFixed(5))+", "+we(Ze.value.center.lng.toFixed(5)),1)]),Ze.value.areaKm2!==null?(S(),T("div",UH,[j[12]||(j[12]=xn(" Area: ",-1)),v("b",null,we(Ze.value.areaKm2.toFixed(1))+" km²",1)])):(S(),T("div",WH,j[13]||(j[13]=[xn("Area: ",-1),v("b",null,"—",-1)]))),v("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Zoom to feature",onClick:j[7]||(j[7]=se=>C()),disabled:i.value},j[14]||(j[14]=[tn('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-150e767b><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-150e767b></path><path d="M7 10l6 0" data-v-150e767b></path><path d="M10 7l0 6" data-v-150e767b></path><path d="M21 21l-6 -6" data-v-150e767b></path></svg>',1)]),8,KH),v("button",{class:"tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",title:"Delete feature",onClick:j[8]||(j[8]=se=>N()),disabled:i.value},[ce(zu,{class:"w-3 h-3"})],8,GH)])])):pe("",!0)])],2))}}),JH=Ye(qH,[["__scopeId","data-v-150e767b"]]),YH=["data-focus"],XH={class:"flex items-center"},ZH={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},QH=["onClick","aria-label"],ej={key:0,class:"absolute text-gray-500 truncate pl-2"},tj={class:"flex-1 min-w-[2px]"},nj=["placeholder"],rj={class:"flex items-center shrink-0"},oj=["disabled"],sj=_e({__name:"vs-input-tag",props:yt({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"}},{modelValue:{default:[]},modelModifiers:{}}),emits:yt(["update:modelValue"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=e;Jn(n.style);const o=Q(null),s=Q(null),i=Q(null),l=Q(!1),a=Q(""),c=It(t,"modelValue"),u=te(()=>n.placeholder||"Add tag…"),d=te(()=>{var M;return((M=c.value)==null?void 0:M.length)===0&&a.value===""}),f=te(()=>{var M;return!n.disabled&&((M=c.value)==null?void 0:M.length)>0}),p=te(()=>n.disabled),h=async()=>{p.value||await zt(()=>{var M;return(M=i.value)==null?void 0:M.focus()})},m=M=>{const E=M.trim();E!==""&&(!c.value||!Array.isArray(c.value)?c.value=[E]:n.unique?c.value.includes(E)||(c.value=[...c.value,E]):c.value=[...c.value,E],a.value="")},y=()=>{const M=a.value;M.trim()!==""&&m(M),a.value=""},g=M=>{const E=c.value.slice();E.splice(M,1),r("update:modelValue",E)},k=()=>{r("update:modelValue",[])},w=()=>{p.value||(l.value=!0)},b=()=>{l.value=!1,!p.value&&y()},_=M=>{const{key:E}=M;E==="Enter"?(M.preventDefault(),y()):E==="Backspace"&&a.value===""&&c.value.length>0&&g(c.value.length-1)};return(M,E)=>(S(),T("div",{class:"flex gap-1 w-full",ref_key:"root",ref:o,onClick:E[1]||(E[1]=Vn(()=>{},["stop"]))},[v("div",{class:ae(["relative w-full font-sans",n.customClass]),role:"group","aria-label":"Tag input"},[v("div",{class:ae(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",l.value?"border-blue-500 ring-1 ring-blue-500":"",p.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),"data-focus":l.value?"true":"false",onClick:h},[v("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"chipsRef",ref:s},[(S(!0),T(Me,null,Je(c.value,(I,F)=>(S(),T("div",{key:F,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[v("div",XH,[v("div",ZH,we(I),1)]),v("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:Vn(R=>g(F),["stop"]),"aria-label":`Remove ${I}`},E[2]||(E[2]=[v("svg",{height:"14",width:"14",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"inline-block fill-current stroke-current leading-none stroke-0"},[v("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,QH)]))),128)),d.value?(S(),T("div",ej,we(u.value),1)):pe("",!0),v("div",tj,[p.value?pe("",!0):nt((S(),T("input",{key:0,ref_key:"inputRef",ref:i,class:"pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-label":"Add tag","onUpdate:modelValue":E[0]||(E[0]=I=>a.value=I),onFocus:w,onBlur:b,onKeydown:_,placeholder:c.value&&c.value.length?"":void 0},null,40,nj)),[[jt,a.value]])])],512),v("div",rj,[f.value?(S(),T("button",{key:0,type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-label":"Clear all tags",disabled:p.value,onClick:Vn(k,["stop"])},E[3]||(E[3]=[v("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[v("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"})],-1)]),8,oj)):pe("",!0)])],10,YH)],2)],512))}}),ij={class:"relative flex gap-1 bg-white w-full"},lj=["disabled","placeholder"],aj=_e({__name:"vs-input-slug",props:yt({disabled:{type:Boolean},placeholder:{},parent:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=Wt("values"),n=t,r=It(t,"modelValue");function o(i){const l={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ы:"y",э:"e",ю:"yu",я:"ya",ь:"",ъ:"",є:"ye",і:"i",ї:"yi",ґ:"g"};return i.toLowerCase().split("").map(a=>l[a]||a).join("").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}const s=()=>{var a,c;const i=(c=(a=e==null?void 0:e.value)==null?void 0:a[n.parent||""])==null?void 0:c.toString(),l=o(i);r.value=l.toString()};return(i,l)=>(S(),T("div",ij,[nt(v("input",{ref:"vsText",disabled:i.disabled,placeholder:i.placeholder,"onUpdate:modelValue":l[0]||(l[0]=a=>r.value=a),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,lj),[[jt,r.value]]),v("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",onClick:s}," Gen ")]))}}),cj=Ye(aj,[["__scopeId","data-v-b0eba370"]]),uj={class:"relative flex gap-1 bg-white w-full"},dj=["disabled","placeholder"],fj=["disabled"],pj={key:0},hj={key:1},mj=_e({__name:"vs-input-codegen",props:yt({table:{},code:{},init:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=It(t,"modelValue"),r=Q(!1),o=te(()=>e.init!==!1),s=te(()=>!!e.table&&!!e.code),i=()=>{if(!s.value)return"";const c=encodeURIComponent(String(e.table)),u=encodeURIComponent(String(e.code));return`/api/code-gen/${c}/${u}`},l=async()=>{if(!s.value||r.value)return;const c=i();if(c){r.value=!0;try{const u=await(await fetch(c)).text();n.value=u}finally{r.value=!1}}},a=()=>{o.value&&(n.value||l())};return rt(()=>{a()}),Re(()=>[e.table,e.code,e.init],()=>{a()}),(c,u)=>(S(),T("div",uj,[nt(v("input",{disabled:c.disabled,placeholder:c.placeholder,"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),class:"block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,8,dj),[[jt,n.value]]),v("button",{class:"px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",disabled:r.value||c.disabled||!s.value,onClick:l},[r.value?(S(),T("span",hj,"...")):(S(),T("span",pj,"Gen"))],8,fj)]))}}),gj=Ye(mj,[["__scopeId","data-v-6ee5237d"]]),yj={class:"w-full"},bj={ref:"sortableContainer",class:"flex flex-col gap-1"},vj=["onDragstart","onDrop"],wj={class:"w-1/3"},xj={class:"w-2/3"},kj=["onClick"],_j={key:0,class:"text-[14px] text-gray-700"},Cj={class:"mt-2 w-full flex items-center"},Ej=["disabled"],Sj=_e({__name:"vs-input-key-value",props:{parent:{},ignore:{},addButtonText:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=m=>`${m}-${Math.random().toString(36).substring(2,15)}`,r=Wt("values"),o=t,s=e,i=o.addButtonText??"Додати",l=o.ignore??[],a=Q([]),c=Q(null);(()=>{var y;const m=o.parent&&((y=r==null?void 0:r.value)==null?void 0:y[o.parent])||o.modelValue||{};a.value=Object.entries(m).filter(([g])=>!l.includes(g)).map(([g,k])=>({id:n("key-value-"),key:g,value:k}))})();function u(m){c.value=m}function d(m){if(c.value===null||c.value===m)return;const y=a.value.splice(c.value,1)[0];a.value.splice(m,0,y),c.value=null}const f=te(()=>a.value.some(m=>m.key&&!m.value||!m.key&&m.value)),p=()=>{a.value.push({id:n("key-value-"),key:"",value:""})},h=m=>{a.value=a.value.filter(y=>y.id!==m)};return Re(a,m=>{const y={};m.forEach(k=>{k.key&&k.value!==void 0&&(y[k.key]=k.value)});const g={};l.length&&l.forEach(k=>{var w,b;g[k]=o.parent?(b=(w=r==null?void 0:r.value)==null?void 0:w[o.parent])==null?void 0:b[k]:void 0}),r!=null&&r.value&&o.parent&&(r.value[o.parent]={...g,...y}),s("update:modelValue",y)},{deep:!0}),(m,y)=>(S(),T("div",yj,[v("div",bj,[(S(!0),T(Me,null,Je(a.value,(g,k)=>(S(),T("div",{key:g.id,class:ae(["flex items-center gap-2 w-full",{"opacity-50":c.value===k}]),draggable:"true",onDragstart:w=>u(k),onDragover:y[0]||(y[0]=Vn(()=>{},["prevent"])),onDrop:w=>d(k)},[y[1]||(y[1]=tn('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>',1)),v("div",wj,[ce(tu,{modelValue:g.key,"onUpdate:modelValue":w=>g.key=w,placeholder:"Ключ"},null,8,["modelValue","onUpdate:modelValue"])]),v("div",xj,[ce(tu,{modelValue:g.value,"onUpdate:modelValue":w=>g.value=w,placeholder:"Значення"},null,8,["modelValue","onUpdate:modelValue"])]),v("button",{onClick:w=>h(g.id),class:"shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"},[ce(me(WF),{height:"16",width:"16"})],8,kj)],42,vj))),128))],512),a.value.length?pe("",!0):(S(),T("span",_j," Дані для відображення відсутні ")),v("div",Cj,[v("button",{type:"button",onClick:p,disabled:f.value,class:"py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[ce(Pl,{height:"14",width:"14"}),xn(" "+we(me(i)),1)],8,Ej)])]))}}),Mj=Ye(Sj,[["__scopeId","data-v-a0f7fbfc"]]),Tj={class:"flex items-center gap-2 w-full"},Aj=["disabled"],Lj=["disabled"],Oj=_e({__name:"vs-input-color",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,{inputClass:r}=Jn(n.style),o=e,s=te({get:()=>n.modelValue||"#000000",set:l=>o("update:modelValue",l)}),i=te(()=>!!n.disabled);return(l,a)=>(S(),T("div",Tj,[nt(v("input",{type:"color","onUpdate:modelValue":a[0]||(a[0]=c=>s.value=c),disabled:i.value,ref:"color",class:ae(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]",[l.modelValue?"":"text-opacity-50",me(r)].join(" ")]),style:{border:"1px solid #CFD9E0"}},null,10,Aj),[[jt,s.value]]),nt(v("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2","onUpdate:modelValue":a[1]||(a[1]=c=>s.value=c),disabled:i.value},null,8,Lj),[[jt,s.value]])]))}}),Nj={class:"flex items-center gap-2 w-full"},Ij=["min","max","step","disabled"],Rj=["disabled"],Pj=_e({__name:"vs-input-range",props:{style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""},min:{default:0},max:{default:100},step:{default:1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,{inputClass:r}=Jn(n.style),o=e,s=te({get:()=>Number(n.modelValue??n.min),set:l=>o("update:modelValue",Number(l))}),i=te(()=>!!n.disabled);return(l,a)=>(S(),T("div",Nj,[nt(v("input",{type:"range","onUpdate:modelValue":a[0]||(a[0]=c=>s.value=c),min:l.min,max:l.max,step:l.step,disabled:i.value,ref:"range",class:ae(["w-full cursor-pointer accent-blue-500",[l.modelValue?"":"text-opacity-50",me(r)].join(" ")])},null,10,Ij),[[jt,s.value]]),nt(v("input",{class:"text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",type:"number","onUpdate:modelValue":a[1]||(a[1]=c=>s.value=c),disabled:i.value},null,8,Rj),[[jt,s.value]])]))}}),Dj=["type","value","onInput","placeholder","disabled"],$j=_e({__name:"vs-input-array",props:yt({count:{default:1},limit:{default:t=>t.count??1},inputType:{default:"text"},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{default:""}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,{inputClass:n}=Jn(e.style),r=It(t,"modelValue"),o=te(()=>!!e.disabled),s=te(()=>e.placeholder??"");sv(()=>{var a;const l=((a=r.value)==null?void 0:a.length)??0;l<e.count&&(r.value=[...r.value??[],...Array(e.count-l)])});function i(l,a){if(o.value)return;const c=l.target.value,u=[...r.value];u[a]=e.inputType==="text"?c:Number(c),r.value=u}return(l,a)=>(S(),T("div",{class:ae(["grid gap-2",`grid-cols-${l.limit}`])},[(S(!0),T(Me,null,Je(l.count,c=>{var u;return S(),T("input",{type:l.inputType,value:((u=r.value)==null?void 0:u[c-1])??"",onInput:d=>i(d,c-1),placeholder:s.value,disabled:o.value,class:ae(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white",[me(n),{"!border-red-600":l.error}]]),style:{border:"1px solid #CFD9E0"}},null,42,Dj)}),256))],2))}}),Fj={class:"flex items-center gap-2 w-full"},Vj={class:"relative flex-1"},Bj=["placeholder","disabled","onKeydown"],Hj=["disabled"],jj={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},zj={key:1,class:"animate-spin h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Uj={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50"},Wj={class:"bg-white text-gray-900 rounded-lg shadow-lg w-[480px] max-h-[80vh] overflow-y-auto"},Kj={class:"p-3 border-b font-semibold text-gray-900 flex justify-between items-center"},Gj=["onClick"],qj={key:0,class:"p-4 text-sm text-gray-500"},Jj=_e({__name:"vs-input-address",props:yt({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{default:""},name:{},placeholder:{},api:{default:""},geom:{default:""},includes:{default:()=>[]}},{modelValue:{default:""},modelModifiers:{}}),emits:yt(["update:modelValue","update:geom"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=e,{inputClass:o}=Jn(n.style),s=It(t,"modelValue"),i=te({get:()=>s.value,set:g=>{s.value=g}}),l=Q(!1),a=Q([]),c=Q(!1),u=te(()=>n.placeholder??""),d=te(()=>!!n.disabled),f=Wt("values");function p(){!d.value&&i.value.trim()&&h()}async function h(){var b;const g=(i.value||"").trim();if(!g)return;let k=g;if((b=n.includes)!=null&&b.length&&(f!=null&&f.value)){const _=n.includes.map(M=>{var E;return(E=f.value)==null?void 0:E[M]}).filter(Boolean);_.length&&(k=`${_.join(", ")}, ${g}`)}const w=n.api.replace("{{value}}",encodeURIComponent(k));l.value=!0;try{const _=await(await fetch(w)).json();a.value=Array.isArray(_)?_:[],c.value=!0}catch(_){console.error("Address search error:",_)}finally{l.value=!1}}function m(){c.value=!c.value}function y(g){if(!g)return;c.value=!1;const k=parseFloat(g.lat),w={type:"Point",coordinates:[parseFloat(g.lon),k]};n.geom&&(f!=null&&f.value)&&(f.value[n.geom]=w),r("update:geom",w)}return(g,k)=>{var w;return S(),T("div",Fj,[v("div",Vj,[nt(v("input",{type:"text","onUpdate:modelValue":k[0]||(k[0]=b=>i.value=b),placeholder:u.value,disabled:d.value,class:ae(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500",[me(o),{"!border-red-600":n.error}]]),style:{border:"1px solid #CFD9E0"},onKeydown:RC(Vn(p,["prevent"]),["enter"])},null,42,Bj),[[jt,i.value]]),a.value.length?(S(),T("button",{key:0,type:"button",class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",onClick:m,title:"Show search results"},k[2]||(k[2]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("circle",{cx:"12",cy:"12",r:"10"}),v("path",{d:"M12 16v-4"}),v("path",{d:"M12 8h.01"})],-1)]))):pe("",!0)]),v("button",{type:"button",onClick:h,class:"flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",disabled:l.value||!((w=i.value)!=null&&w.trim())},[l.value?(S(),T("svg",zj,k[4]||(k[4]=[v("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),v("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)]))):(S(),T("svg",jj,k[3]||(k[3]=[v("circle",{cx:"11",cy:"11",r:"8"},null,-1),v("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])))],8,Hj),(S(),Ae(Is,{to:"body"},[c.value?(S(),T("div",Uj,[v("div",Wj,[v("div",Kj,[k[6]||(k[6]=v("span",null,"Search results",-1)),v("button",{class:"text-gray-500 hover:text-blue-600",onClick:k[1]||(k[1]=b=>c.value=!1),title:"Close"},k[5]||(k[5]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),v("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)]))]),v("ul",null,[(S(!0),T(Me,null,Je(a.value,(b,_)=>(S(),T("li",{key:_,onClick:M=>y(b),class:"px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"},we(b.display_name),9,Gj))),128))]),a.value.length?pe("",!0):(S(),T("div",qj," No results found "))])])):pe("",!0)]))])}}}),Fd={VsInputText:tu,VsInputRadio:dy,"vs-input-text":tu,"vs-input-password":vF,"vs-input-textarea":TV,"vs-input-mask":n6,"vs-input-number":kF,"vs-input-radio":dy,"vs-input-select":my,"vs-input-switcher":hk,"vs-input-static":uy,"vs-input-container":lV,"vs-input-date":v6,"vs-input-checkbox":y6,"vs-input-file":i8,"vs-input-html":uy,"vs-input-email":s6,"vs-input-datatable":PB,"vs-input-map":JH,"vs-input-file-list":D8,"vs-input-tags":sj,"vs-input-slug":cj,"vs-input-codegen":gj,"vs-input-key-value":Mj,"vs-input-range":Pj,"vs-input-color":Oj,"vs-input-native-select":my,"vs-input-array":$j,"vs-input-address":Jj},Yj=_e({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(t){const e=t,n=Wt("values");async function r(){try{if(!e.api)return;const o=e.api.replace("{{value}}",e.value),s=await fetch(o);if(!s.ok){Nt({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const i=await s.json();if(!e.set||!n)return;for(const[l,a]of Object.entries(e.set))n.value[l]=i.result[a]}catch(o){console.error(e.error,o)}}return(o,s)=>(S(),T("button",{onClick:r,class:"vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"},we(o.button),1))}}),Xj={class:"flex flex-col gap-1 w-full"},Zj={key:0,class:"text-sm text-gray-500"},bk=_e({__name:"vs-compact-form-layout",props:yt({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]},columns:{default:()=>({container:12,label:3})}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=It(t,"modelValue"),r=te(()=>yF[`${e.layout}`]),o=te(()=>Fd==null?void 0:Fd[`vs-input-${e.item.type}`]),s=te(()=>{var u;const l=me(o);if(!l)return new Set;const a=l.props??((u=l.__vccOpts)==null?void 0:u.props);if(!a)return new Set;const c=Array.isArray(a)?a:Object.keys(a);return new Set(c)}),i=te(()=>{const l=e.item??{},a=s.value;return a.size?Object.fromEntries(Object.entries(l).filter(([c])=>a.has(c))):{}});return(l,a)=>(S(),Ae(Cn(r.value),{ua:e.item.ua,error:e.error||"",item:l.item,columns:e.columns,label:e.item.label},{default:Ke(()=>{var c,u;return[v("div",{class:ae(["flex w-full",`${e.item.type}-component`])},[v("div",Xj,[(S(),Ae(Cn(o.value),ao(i.value,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=d=>n.value=d)}),null,16,["modelValue"])),l.item.description&&e.layout!=="settings"?(S(),T("p",Zj,we(l.item.description),1)):pe("",!0)]),(c=l.item.behavior)!=null&&c.api&&((u=l.item.behavior)!=null&&u.button)?(S(),Ae(Yj,ao({key:0},l.item.behavior,{value:n.value}),null,16,["value"])):pe("",!0)],2)]}),_:1},8,["ua","error","item","columns","label"]))}}),Qj={class:"text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300"},e7={class:"vs-compact-form-navigation__rail mt-[6px]"},t7=["onClick"],n7=_e({__name:"vs-compact-form-navigation",props:{target:{},scrollContainer:{},title:{default:"Навігація"},enabled:{type:Boolean,default:!0},width:{default:400}},setup(t,{expose:e}){const n=t,r=Q([]),o=Q(""),s=Q(""),i=te(()=>!!n.enabled),l=te(()=>["vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]","sticky top-0 self-start shrink-0","max-h-full min-h-0 overflow-y-auto"]),a=te(()=>{const $=n.width;if($==null)return{};const A=typeof $=="number"?`${$}px`:`${$}`;return{width:A,minWidth:A}});let c=null,u=0,d=0,f=null,p=null,h=null;const m=()=>F(),y=()=>k();Re(()=>n.target,async $=>{if(M(),!$){f=null,r.value=[],o.value="";return}f=$,i.value&&(await zt(),_($),k())},{immediate:!0}),Re(()=>n.scrollContainer,$=>{if(!i.value){p=$??null;return}g($??null),zt(()=>k())},{immediate:!0}),rt(()=>{n.scrollContainer||g(null),k()}),uo(()=>{M(),g(null,!0),f=null,typeof window<"u"&&(u&&window.cancelAnimationFrame(u),d&&window.cancelAnimationFrame(d))});function g($,A=!1){if(h&&(h(),h=null),A){p=null;return}if(p=$??null,typeof window>"u")return;const q=$??window,Y=window;q.addEventListener("scroll",m,{passive:!0}),Y.addEventListener("resize",y),h=()=>{q.removeEventListener("scroll",m),Y.removeEventListener("resize",y)}}function k(){if(!i.value||!f)return;u&&typeof window<"u"&&window.cancelAnimationFrame(u);const $=()=>{w(),u=0};typeof window>"u"?$():u=window.requestAnimationFrame($)}function w(){if(!i.value||!f)return;const $=Array.from(f.querySelectorAll("h1, h2")),A=new Set,q=[];$.forEach((Y,Z)=>{var Le;const K=((Le=Y.textContent)==null?void 0:Le.trim())??"";if(!K)return;let X=(Y.getAttribute("id")??"").trim();X||(X=b(K)||`heading-${Z+1}`);let G=X,ne=1;for(;A.has(G);)G=`${X}-${ne+=1}`;Y.id!==G&&Object.assign(Y,{id:G}),A.add(G),q.push({id:G,text:K,level:Y.tagName.toLowerCase()==="h1"?1:2})}),r.value=q,q.length||(o.value=""),I()}function b($){return $.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function _($){!$||!i.value||typeof MutationObserver>"u"||(M(),c=new MutationObserver(()=>k()),c.observe($,{childList:!0,subtree:!0}))}function M(){c&&(c.disconnect(),c=null)}function E($){const A=p;if(!A)return typeof window>"u"?$.offsetTop:$.getBoundingClientRect().top+window.scrollY;const q=$.getBoundingClientRect(),Y=A.getBoundingClientRect();return q.top-Y.top+A.scrollTop}function I(){if(!i.value||!r.value.length)return;const $=p,A=($?$.scrollTop:null)||(typeof window<"u"?window.scrollY:0),q=($?$.clientHeight:null)||(typeof window<"u"?window.innerHeight:0),Y=A+q;let Z=null;for(let X=0;X<r.value.length;X+=1){const G=r.value[X],ne=document.getElementById(G.id);if(ne){const Le=E(ne);Le+ne.offsetHeight>A&&Le<Y&&(Z=G.id)}}!Z&&s.value&&(Z=s.value),Z&&(s.value=Z);const K=$?$.scrollHeight-$.clientHeight:document.documentElement.scrollHeight-window.innerHeight;A+5>=K&&(Z=r.value[r.value.length-1].id),Z&&(o.value=Z)}function F(){i.value&&(d&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{I(),d=0}))}function R($){if(!i.value)return;const A=document.getElementById($);if(!A)return;const q=p,Y=Math.max(0,E(A));q?q.scrollTo({top:Y,behavior:"smooth"}):typeof window<"u"&&window.scrollTo({top:Y,behavior:"smooth"})}return e({refresh:k}),($,A)=>i.value&&r.value.length?(S(),T("div",{key:0,class:ae(l.value),style:pt(a.value)},[v("h2",Qj,we($.title),1),v("div",e7,[(S(!0),T(Me,null,Je(r.value,q=>(S(),T("div",{key:q.id,class:ae(["vs-compact-form-navigation__item relative",q.level===2?"vs-compact-form-navigation__item--nested":"",q.id===o.value?"vs-compact-form-navigation__item--active":""])},[v("button",{type:"button",onClick:Y=>R(q.id),class:ae(["vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",q.level===2?"pl-[15px]":"pl-[18px]",q.id===o.value?"text-gray-800":"text-gray-500"])},[v("span",null,we(q.text),1)],10,t7)],2))),128))])],6)):pe("",!0)}}),r7=Ye(n7,[["__scopeId","data-v-1584a562"]]),vk={required:"Це поле є обов’язковим",email:"Неправильний email"},o7=t=>t?!1:vk.required,s7=t=>t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?!1:vk.email:!1,i7=(t,e)=>{const n=e.pattern??e.regexp;return!(typeof n=="string"?new RegExp(n):n).test(t)&&t?e.message:!1},l7=(t,e)=>!1,a7=(t,e)=>{switch(typeof e=="string"?e:e.type){case"required":return o7(t);case"email":return s7(t);case"regexp":return i7(t,e);case"custom":return l7();default:return!1}},c7={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",datalist:"datatable",file:"file",dropzone:"file"};function yy(t){const e=t.toLowerCase();return c7[e]||e}function op(t,e=!1){if(Array.isArray(t)){const r=[];return t.forEach(o=>{const s={...o};s.name=(o.name||o.id||o.key||"").toString(),s.type=yy(o.type),s.label=o.label||o.ua,s.rules=o.rules||o.validators,s.type==="email"&&!s.rules&&(s.rules=["email"]),o.data&&(s.api=`/api/suggest/${o.data}`),s.disabled=e||s.disabled,Array.isArray(s.schema)&&(s.schema=op(s.schema,s.disabled)),r.push(s)}),r}const n=[];return Object.entries(t).forEach(r=>{const o={name:r[0],...r[1],type:yy(r[1].type),label:r[1].label||r[1].ua,rules:r[1].rules||r[1].validators,disabled:e};o.type==="email"&&!o.rules&&(o.rules=["email"]),r[1].type.includes("list")&&(o.multiple=!0),!o.api&&r[1].data&&(o.api=`/api/suggest/${r[1].data}`),Array.isArray(o.schema)&&(o.schema=op(o.schema,o.disabled)),n.push(o)}),n}function u7(t,e,n=!1){const r=te(()=>op(e,typeof n=="boolean"?n:n.value)),o=Q({});function s(a){var f;const c=a==null?void 0:a.conditions;if(!c)return!0;const u=Array.isArray(c)?c[0]:c,d=(f=t==null?void 0:t.value)==null?void 0:f[u];return yk(d,c)}const i=(a=r.value,c=!0)=>(a.forEach(u=>{if(u.rules){if(!s(u)){delete o.value[u.name];return}let d=!1,f=null;u.rules.forEach(p=>{const h=a7(t.value[u.name],p);h&&(d=!0,!f&&typeof h=="string"&&(f=h))}),d&&f?o.value[u.name]=f:delete o.value[u.name]}u.schema&&i(u.schema,!1)}),c&&Object.values(o.value).some(Boolean)?o.value:null),l=te(()=>{var a;return(a=r.value)==null?void 0:a.filter(c=>c.hidden!==!0&&s(c))});return{errors:o,validate:i,reset:()=>{t.value={},o.value={}},visibleSchema:l}}const d7={class:"flex w-full h-full min-h-0 gap-6"},f7={key:0,"data-orientation":"horizontal",role:"none",class:"mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"},xi=_e({__name:"vs-compact-form",props:yt({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""},disabled:{type:Boolean,default:!1},navigation:{type:Boolean,default:!1},navWidth:{default:400},columns:{}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:yt(["handle-submit","update:modelValue"],["update:form","update:values"]),setup(t,{expose:e,emit:n}){const r=n,o=t,s=It(t,"form"),i=It(t,"values"),{errors:l,validate:a,reset:c,visibleSchema:u}=u7(i,o.schema,I2(o,"disabled")),d=Q(null),f=Q(null),p=te(()=>o.navigation),h=te(()=>o.navWidth),m=te(()=>{var I;return(I=o.style)==null?void 0:I.columns}),y=Object.freeze({container:12,label:3}),g=te(()=>o.columns??m.value??y),k=te(()=>o.columns!=null||m.value!=null),w=te(()=>k.value?"horizontal":o.layout),b=I=>I!=null&&I.columns?"horizontal":w.value,_=I=>(I==null?void 0:I.columns)??g.value,M=()=>{r("update:modelValue",i.value),a(),r("handle-submit",i.value)};e({validate:a,reset:c,errors:l}),rt(()=>{o.modelValue&&(i.value=o.modelValue),s.value={value:i.value,errors:l.value,reset:c,validate:a,formId:o.formId}});function E(I,F){if(I===F)return!0;if(typeof I!="object"||typeof F!="object"||!I||!F)return!1;const R=Object.keys(I),$=Object.keys(F);return R.length!==$.length?!1:R.every(A=>I[A]===F[A])}return Io("form",s),Io("values",i),(I,F)=>(S(),T("div",d7,[v("div",{class:"flex-1 min-h-0 overflow-y-auto overflow-x-visible",ref_key:"formScrollContainer",ref:f},[v("form",{ref_key:"formRef",ref:d,onSubmit:Vn(M,["prevent"]),class:ae(["grid grid-cols-12 p-1",w.value==="default"?"gap-6":"gap-4"])},[(S(!0),T(Me,null,Je(me(u),(R,$)=>(S(),T("div",{key:R.name,class:ae(b(R)==="horizontal"?"col-span-12":`col-span-${R.col||12}`)},[ce(bk,{style:pt(I.style),item:R,layout:b(R),columns:_(R),"model-value":i.value[R.name],"onUpdate:modelValue":A=>{const q=i.value[R.name];E(q,A)||(i.value[R.name]=A)},error:me(l)[R.name]},null,8,["style","item","layout","columns","model-value","onUpdate:modelValue","error"]),b(R)==="settings"&&$+1!==me(u).length?(S(),T("div",f7)):pe("",!0)],2))),128))],34)],512),ce(r7,{target:d.value,"scroll-container":f.value,enabled:p.value,width:h.value},null,8,["target","scroll-container","enabled","width"])]))}}),p7={class:"relative"},h7={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},m7={class:"m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12"},g7={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},y7={class:"font-medium text-gray-800 dark:text-[#ffffff]"},b7={class:"p-4 mim-h-0 h-full overflow-auto"},v7=_e({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(t,{emit:e}){const n=t,r=e,o=Q(n.schema),s=Q(n.defaultValue?JSON.parse(JSON.stringify(n.defaultValue)):{}),i=Q({}),l=Q(),a=Q(n.mode);async function c(){const d=i.value.validate();if(d){Nt({type:"warning",title:"Помилка валідації",message:Object.entries(d).map(([f,p])=>`${f}: ${p}`).join(`
245
- `)});return}if(l.value)try{const f=await fetch(`/api/table/${l.value}`,{method:a.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s.value)});if(f.ok)await f.json(),Nt({type:"success",title:"Успішно",message:`Дані успішно ${a.value==="add"?"збережено":"оновлено"}`}),r("save",s.value);else if(f.status===400){const p=await f.json().catch(()=>({}));Nt({type:"warning",title:"Помилка валідації",message:p.message||"Некоректні дані (400)"})}else f.status===500?Nt({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):Nt({type:"error",title:"Помилка",message:`Статус: ${f.status}`})}catch(f){Nt({type:"error",title:"Помилка з’єднання",message:f.message||"Не вдалося виконати запит"})}}function u(){r("close")}return rt(async()=>{try{if(n.form){const d=await fetch(`/api/template/form/${n.form}`);if(!d.ok){Nt({type:d.status>=400&&d.status<500?"warning":"error",title:"Error",message:`Error code: ${d.status}`});return}const f=await d.json();o.value=f.schema,l.value=f.token}else if(n.token){l.value=n.token;const d=await fetch(`/api/form/${l.value}`);if(!d.ok){Nt({type:d.status>=400&&d.status<500?"warning":"error",title:"Error",message:`Error code: ${d.status}`});return}const f=await d.json();o.value=f.schema,f.data?s.value=f.data:a.value="add"}}catch(d){Nt({type:"error",title:"Error",message:d.message||"Unexpected error"}),console.error(d)}}),(d,f)=>(S(),T("div",p7,[v("div",h7,[v("div",m7,[v("div",g7,[v("h3",y7,we(a.value==="add"?"Додати":"Змінити"),1),v("button",{onClick:u,type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"},f[2]||(f[2]=[v("span",{class:"sr-only"},"Close",-1),v("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"M18 6 6 18"}),v("path",{d:"m6 6 12 12"})],-1)]))]),v("div",b7,[o.value?(S(),Ae(xi,{key:0,schema:o.value,values:s.value,"onUpdate:values":f[0]||(f[0]=p=>s.value=p),form:i.value,"onUpdate:form":f[1]||(f[1]=p=>i.value=p)},null,8,["schema","values","form"])):pe("",!0)]),v("div",{class:"vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white"},[v("button",{type:"button",onClick:u,class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"}," Скасувати "),v("button",{onClick:c,type:"button",class:"vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"}," Зберегти ")])])])]))}}),by=(t={mode:"edit",schema:null})=>new Promise(e=>{const{close:n}=Y$({title:t.mode==="add"?"Додати":"Редагувати",template:"",size:"medium",content:v7,contentProps:{...t,onClose:()=>{e(null),n()},onSave:r=>{e(r),n()}}})});xi.install=function(t){t.component("VForm",xi),Object.assign(t.config.globalProperties,{$form:by}),t.provide("form",by),window.v3plugin||(window.v3plugin={})};const w7={class:"relative"},x7={key:0,class:"mt-4"},k7=["src","alt","title"],_7={key:0,class:"text-sm text-red-500"},C7={key:1,class:"mt-4"},E7={class:"text-sm text-gray-600 mb-2"},S7={class:"flex flex-wrap gap-2"},M7=["src","alt","onError"],T7=["onClick"],A7={class:"flex justify-end gap-x-2 p-[20px]"},L7=Object.assign({inheritAttrs:!1},{__name:"vs-editor-image",props:{editor:{type:Object,required:!0}},setup(t){const e=t,n=Q(!1),r=Q(!1),o=Q({}),s=Q(!1),i=Q([]),l=Q(null),a=Q({src:"",file:[],alt:"",title:"",width:"",height:"",link:"",openInNewTab:!1}),c=te(()=>{if(Array.isArray(a.value.file)){const I=a.value.file.filter(R=>R instanceof File),F=a.value.file.filter(R=>typeof R=="string"&&R.trim()!=="");return I.length+F.length>1}return a.value.file instanceof FileList?a.value.file.length>1:!1}),u=te(()=>Array.isArray(a.value.file)?a.value.file.filter(I=>I instanceof File).length===1:a.value.file instanceof FileList?a.value.file.length===1:a.value.file instanceof File),d=te(()=>{if(c.value)return"";if(a.value.src)return a.value.src;if(u.value){let I=null;if(Array.isArray(a.value.file)||a.value.file instanceof FileList?I=a.value.file[0]:a.value.file instanceof File&&(I=a.value.file),I instanceof File){const F=i.value.find(R=>R.file===I);return F?F.preview:""}else if(typeof I=="string")return I}return""}),f=te(()=>[{name:"src",label:"URL зображення",type:"text",required:!1,placeholder:"https://example.com/image.png"},{name:"file",label:"Файл (можна вибрати кілька)",type:"file",multiple:!0,required:!1,placeholder:"Шлях до файлу зображення",accept:"image/*"},{name:"width",label:"Ширина",type:"number",required:!1,placeholder:"Ширина зображення",clearable:!0,min:0},{name:"height",label:"Висота",type:"number",required:!1,placeholder:"Висота зображення",clearable:!0,min:0},{name:"alt",label:"Альтернативний текст",type:"text",required:!1,placeholder:"Опис зображення"},{name:"title",label:"Заголовок (необов'язково)",type:"text",required:!1,placeholder:"Заголовок зображення"},{name:"link",label:"Посилання",type:"text",required:!1,placeholder:"https://example.com"},{name:"openInNewTab",label:"Відкривати у новій вкладці?",type:"switcher",required:!1}]),p=()=>{if(e.editor){if(e.editor.isActive("image")){const{state:I}=e.editor,{selection:F}=I,{$from:R}=F;let $=null,A=null;if(R.parent.type.name==="image")$=R.before(R.depth),A=R.parent;else for(let ne=R.depth;ne>0;ne--){const Le=R.node(ne),je=R.before(ne);Le.type.name==="paragraph"&&Le.forEach((Be,Dt)=>{if(Be.type.name==="image"){const Ze=je+Dt+1;($===null||Math.abs(Ze-F.$from.pos)<Math.abs($-F.$from.pos))&&($=Ze,A=Be)}})}if($!==null&&A){try{e.editor.chain().focus().setNodeSelection($).run()}catch{e.editor.chain().focus().setTextSelection($).run()}l.value=$}else{e.editor.chain().focus().selectParentNode().run();const{state:ne}=e.editor;l.value=ne.selection.$from.pos}const q=A?A.attrs:e.editor.getAttributes("image");s.value=!0;let Y="",Z=!1;const K=e.editor.getAttributes("link");K&&K.href&&(Y=K.href,Z=K.target==="_blank");const X=q.src||"",G=X?[X]:[];a.value={src:X,file:G,alt:q.alt||"",title:q.title||"",width:q.width||"",height:q.height||"",link:Y,openInNewTab:Z}}else s.value=!1,a.value={src:"",file:[],alt:"",title:"",width:"",height:"",link:"",openInNewTab:!1};r.value=!1,n.value=!0}},h=()=>{n.value=!1,r.value=!1,s.value=!1,i.value=[],l.value=null,a.value={src:"",file:[],alt:"",title:"",width:"",height:"",link:"",openInNewTab:!1}},m=async I=>{if(!I||I.length===0)return;const F=[];for(const R of I)if(R&&R.type&&R.type.startsWith("image/")&&!i.value.some($=>$.file===R)){const $=new Promise((A,q)=>{const Y=new FileReader;Y.onload=Z=>{i.value.push({file:R,preview:Z.target.result,error:!1}),A()},Y.onerror=q,Y.readAsDataURL(R)});F.push($)}await Promise.all(F)},y=I=>{i.value.splice(I,1),Array.isArray(a.value.file)&&a.value.file.splice(I,1)},g=()=>{const I=a.value.width!==null&&a.value.width!==void 0&&a.value.width!==""&&String(a.value.width).trim()!==""?String(a.value.width).trim():"",F=a.value.height!==null&&a.value.height!==void 0&&a.value.height!==""&&String(a.value.height).trim()!==""?String(a.value.height).trim():"",R={};return I&&F?(R.width=I,R.height=F,R.style=`width: ${I}px; height: ${F}px; object-fit: fill;`):I?(R.width=I,R.height=void 0):F?(R.height=F,R.width=void 0):(R.width=void 0,R.height=void 0),R},k=(I,F=null,R=50)=>{const $=()=>{const{view:Y}=I;!Y||!Y.dom||Y.dom.querySelectorAll("img.editor-image[width][height]").forEach(Z=>{if(Z instanceof HTMLImageElement){const K=Z.getAttribute("width"),X=Z.getAttribute("height");K&&X&&K!=="auto"&&X!=="auto"&&K!==""&&X!==""&&!isNaN(Number(K))&&!isNaN(Number(X))&&(Z.style.cssText=`
246
- width: ${K}px !important;
247
- height: ${X}px !important;
248
- max-width: none !important;
249
- max-height: none !important;
250
- min-width: auto !important;
251
- min-height: auto !important;
252
- object-fit: fill !important;
253
- `.replace(/\s+/g," ").trim())}})},A=a.value.width,q=a.value.height;A&&q&&A!==""&&q!==""?[0,R,R*2,R*3,R*4].forEach(Y=>{setTimeout($,Y)}):($(),setTimeout($,R))},w=async()=>{let I=[],F=[];if(Array.isArray(a.value.file)?(I=a.value.file.filter(Y=>Y instanceof File),F=a.value.file.filter(Y=>typeof Y=="string"&&Y.trim()!=="")):a.value.file instanceof FileList?I=Array.from(a.value.file):a.value.file instanceof File?I=[a.value.file]:typeof a.value.file=="string"&&a.value.file.trim()!==""&&(F=[a.value.file]),I.length===0&&F.length===0&&o.value&&o.value.file){const Y=o.value.file;Array.isArray(Y)?(I=Y.filter(Z=>Z instanceof File),F=Y.filter(Z=>typeof Z=="string"&&Z.trim()!=="")):Y instanceof FileList?I=Array.from(Y):Y instanceof File?I=[Y]:typeof Y=="string"&&Y.trim()!==""&&(F=[Y])}if(F.length>0&&!s.value){for(const Y of F)i.value.some(Z=>Z.url===Y)||i.value.push({url:Y,preview:Y,error:!1});if(I.length===0&&i.value.length>0){await _();return}}const R=I.length,$=R+F.length;if(!(s.value&&R<=1)&&R>0){const Y=I.filter(Z=>!i.value.some(K=>K.file===Z));Y.length>0&&await m(Y)}if(!s.value){if($>1||c.value||i.value.length>1){if(i.value.length>0){await _();return}else if(R>0){if(await m(I),i.value.length>0){await _();return}}else if(F.length>0){await _();return}}else if(i.value.length>1){await _();return}}let A=a.value.src;if(u.value){let Y=null;if(Array.isArray(a.value.file)||a.value.file instanceof FileList?Y=a.value.file[0]:(a.value.file instanceof File||typeof a.value.file=="string")&&(Y=a.value.file),Y instanceof File)try{const Z=new FileReader,K=await new Promise((X,G)=>{Z.onload=ne=>X(ne.target.result),Z.onerror=G,Z.readAsDataURL(Y)});A=K,s.value&&(a.value.src=K)}catch(Z){console.error("Помилка при читанні файлу:",Z),Nt({type:"error",title:"Помилка",message:"Не вдалося прочитати файл"});return}else typeof Y=="string"&&Y.trim()!==""&&(A=Y.trim(),s.value&&Y.trim()!==a.value.src&&(a.value.src=Y.trim(),A=Y.trim()))}else if(Array.isArray(a.value.file)&&a.value.file.length===1){const Y=a.value.file[0];typeof Y=="string"&&Y.trim()!==""&&(A=Y.trim(),(!a.value.src||a.value.src!==Y.trim())&&(a.value.src=Y.trim()))}else typeof a.value.file=="string"&&a.value.file.trim()!==""&&(A=a.value.file.trim(),(!a.value.src||a.value.src!==a.value.file.trim())&&(a.value.src=a.value.file.trim()));const q=A||Array.isArray(a.value.file)&&a.value.file.length>0&&(a.value.file.some(Y=>Y instanceof File)||a.value.file.some(Y=>typeof Y=="string"&&Y.trim()!==""))||a.value.file instanceof FileList&&a.value.file.length>0||typeof a.value.file=="string"&&a.value.file.trim()!=="";if(!A&&!q){Nt({type:"warning",title:"Попередження",message:"Будь ласка, введіть URL зображення або виберіть файл"});return}if(!c.value&&!q&&await o.value.validate()){Nt({type:"warning",title:"Попередження",message:"Будь ласка, заповніть всі обов'язкові поля"});return}if(e.editor&&A)if(s.value&&l.value!==null){e.editor;try{e.editor.chain().focus().setNodeSelection(l.value).run()}catch{e.editor.chain().focus().setTextSelection(l.value).run()}const Y=e.editor.getAttributes("link"),Z=Y&&Y.href,K=g(),X={src:A,alt:a.value.alt||"",title:a.value.title||"",...K};if((!a.value.width||a.value.width==="")&&(X.width=void 0),(!a.value.height||a.value.height==="")&&(X.height=void 0),e.editor.chain().focus().updateAttributes("image",X).run(),setTimeout(()=>{const{view:G}=e.editor;!G||!G.dom||G.dom.querySelectorAll("img.editor-image").forEach(ne=>{if(ne instanceof HTMLImageElement){const Le=ne.getAttribute("src")||ne.src;(Le===A||Le.includes(A.split("/").pop()))&&(a.value.width&&a.value.height?(ne.style.setProperty("width",`${a.value.width}px`,"important"),ne.style.setProperty("height",`${a.value.height}px`,"important"),ne.style.setProperty("object-fit","fill","important"),ne.style.setProperty("max-width","none","important"),ne.style.setProperty("max-height","none","important")):(ne.style.removeProperty("width"),ne.style.removeProperty("height"),ne.style.removeProperty("object-fit"),ne.style.removeProperty("max-width"),ne.style.removeProperty("max-height")))}})},20),a.value.link&&a.value.link.trim()!==""){let G=a.value.link.trim();G.match(/^https?:\/\//i)||(G="https://"+G),Z?e.editor.chain().focus().extendMarkRange("link").setLink({href:G,target:a.value.openInNewTab?"_blank":null}).run():e.editor.chain().focus().selectParentNode().setLink({href:G,target:a.value.openInNewTab?"_blank":null}).run()}else Z&&e.editor.chain().focus().extendMarkRange("link").unsetLink().run()}else{const{state:Y}=e.editor,{selection:Z}=Y,{$anchor:K}=Z;let X=null;for(let G=K.depth;G>0;G--){const ne=K.node(G);if(ne&&ne.type.name==="paragraph"){X=ne;break}}if(X&&X.content.content.some(G=>G.type.name==="image")){const G=b(X,K.before(K.depth));if(G!==null){const ne=g(),Le=Y.schema.nodes.image.create({src:A,alt:a.value.alt||"",title:a.value.title||"",...ne});if(a.value.link&&a.value.link.trim()!==""){let je=a.value.link.trim();je.match(/^https?:\/\//i)||(je="https://"+je);const Be=Y.schema.marks.link.create({href:je,target:a.value.openInNewTab?"_blank":null}),Dt=Le.type.create(Le.attrs,Le.content,[Be]);e.editor.chain().focus().insertContentAt(G+1,Dt).run(),k(e.editor,A)}else e.editor.chain().focus().insertContentAt(G+1,Le).run(),k(e.editor,A)}else if(a.value.link&&a.value.link.trim()!==""){const ne=g();e.editor.chain().focus().setImage({src:A,alt:a.value.alt||"",title:a.value.title||"",...ne}).run(),setTimeout(()=>{let Le=a.value.link.trim();Le.match(/^https?:\/\//i)||(Le="https://"+Le),e.editor.chain().focus().selectParentNode().setLink({href:Le,target:a.value.openInNewTab?"_blank":null}).run(),k(e.editor,A,20)},10)}else{const ne=g();e.editor.chain().focus().setImage({src:A,alt:a.value.alt||"",title:a.value.title||"",...ne}).run(),k(e.editor,A)}}else if(a.value.link&&a.value.link.trim()!==""){const G=g();e.editor.chain().focus().setImage({src:A,alt:a.value.alt||"",title:a.value.title||"",...G}).run(),setTimeout(()=>{let ne=a.value.link.trim();ne.match(/^https?:\/\//i)||(ne="https://"+ne),e.editor.chain().focus().selectParentNode().setLink({href:ne,target:a.value.openInNewTab?"_blank":null}).run(),k(e.editor,A,20)},10)}else{const G=g();e.editor.chain().focus().setImage({src:A,alt:a.value.alt||"",title:a.value.title||"",...G}).run(),k(e.editor,A)}}h()},b=(I,F)=>{let R=null;return I.forEach(($,A)=>{$.type.name==="image"&&(R=F+A+1)}),R},_=async()=>{if(e.editor){if(i.value.length===0)if(Array.isArray(a.value.file)&&a.value.file.length>0){const I=a.value.file.filter(R=>typeof R=="string"&&R.trim()!==""),F=a.value.file.filter(R=>R instanceof File);for(const R of I)i.value.some($=>$.url===R||$.preview===R)||i.value.push({url:R,preview:R,error:!1});F.length>0&&await m(F)}else c.value&&await m(a.value.file);if(i.value.length!==0)try{const I=[],F=g();for(const R of i.value){const $=R.url||R.preview||"";if(!$)continue;const A=e.editor.schema.nodes.image.create({src:$,alt:a.value.alt||"",title:a.value.title||"",...F});I.push(A)}I.length>0&&(e.editor.chain().focus().command(({tr:R,dispatch:$})=>{if($){const{selection:A}=R,{$anchor:q}=A;let Y=A.$anchor.pos,Z=null,K=null;for(let G=q.depth;G>0;G--){const ne=q.node(G);if(ne&&ne.type.name==="paragraph"){Z=ne,K=q.start(G);break}}if(Z){let G=null;Z.forEach((ne,Le)=>{ne.type.name==="image"&&(G=K+Le+1)}),G!==null?Y=G+1:Y=K+Z.content.size}let X=Y;return I.forEach(G=>{R.insert(X,G),X+=G.nodeSize}),!0}return!1}).run(),a.value.width&&a.value.height&&setTimeout(()=>{const{view:R}=e.editor;R&&R.dom&&R.dom.querySelectorAll("img.editor-image").forEach($=>{$ instanceof HTMLImageElement&&Array.from(i.value).some(A=>{const q=A.url||A.preview||"",Y=$.src||$.getAttribute("src")||"";return Y===q||Y.includes(q.split("/").pop())})&&($.style.setProperty("width",`${a.value.width}px`,"important"),$.style.setProperty("height",`${a.value.height}px`,"important"),$.style.setProperty("object-fit","fill","important"),$.style.setProperty("max-width","none","important"),$.style.setProperty("max-height","none","important"))})},50)),h()}catch(I){console.error("Помилка при додаванні зображень:",I),Nt({type:"error",title:"Помилка",message:"Не вдалося додати зображення"})}}},M=async()=>{await w()},E=()=>{h()};return Re(()=>a.value.file,async(I,F)=>{if(r.value=!1,!(s.value&&Array.isArray(I)&&I.length===1&&typeof I[0]=="string"&&!I.some(R=>R instanceof File)))if(Array.isArray(I)&&I.length>0){const R=I.filter(A=>A instanceof File),$=I.filter(A=>typeof A=="string"&&A.trim()!=="");if(R.length>0&&(s.value?s.value&&R.length===1&&$.length===0&&(i.value=[]):i.value=[],(!s.value||R.length>1||$.length>0)&&await m(R),s.value&&R.length===1&&$.length===0)){const A=new FileReader;A.onload=q=>{a.value.src=q.target.result},A.readAsDataURL(R[0])}if($.length>0)if(s.value)s.value&&$.length===1&&R.length===0&&(a.value.src=$[0]);else{R.length===0&&(i.value=[]);for(const A of $)i.value.some(q=>q.url===A||q.preview===A)||i.value.push({url:A,preview:A,error:!1})}}else I&&typeof I=="object"&&I instanceof FileList?(s.value||(i.value=[]),await m(Array.from(I))):I&&typeof I=="object"&&!Array.isArray(I)&&I instanceof File?(s.value||(i.value=[]),await m([I])):s.value||(i.value=[])},{immediate:!1}),Re(()=>a.value.src,()=>{r.value=!1}),(I,F)=>{var R;return S(),T("div",w7,[v("button",{onClick:p,class:ae(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",(R=t.editor)!=null&&R.isActive("image")?"bg-gray-200 text-gray-900":""]),title:"Додати зображення"},[...F[4]||(F[4]=[tn('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"></rect><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path></svg><span class="sr-only">Додати зображення</span>',2)])],2),ce(dk,{modelValue:n.value,"onUpdate:modelValue":F[3]||(F[3]=$=>n.value=$),title:s.value?"Редагувати зображення":"Додати зображення"},{footer:Ke(()=>[v("div",A7,[v("button",{onClick:E,type:"button",class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Скасувати "),v("button",{onClick:M,type:"button",class:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"},we(s.value?"Оновити зображення":"Додати зображення"),1)])]),default:Ke(()=>[ce(me(xi),{modelValue:a.value,"onUpdate:modelValue":F[0]||(F[0]=$=>a.value=$),schema:f.value,form:o.value,"onUpdate:form":F[1]||(F[1]=$=>o.value=$)},null,8,["modelValue","schema","form"]),d.value&&!c.value?(S(),T("div",x7,[F[5]||(F[5]=v("p",{class:"text-sm text-gray-600 mb-2"},"Попередній перегляд:",-1)),nt(v("img",{src:d.value,alt:a.value.alt||"Попередній перегляд зображення",title:a.value.title,class:"max-w-full h-auto max-h-32 rounded border",onError:F[2]||(F[2]=$=>r.value=!0)},null,40,k7),[[jo,!r.value]]),r.value?(S(),T("p",_7," Не вдалося завантажити попередній перегляд зображення ")):pe("",!0)])):pe("",!0),i.value.length>0?(S(),T("div",C7,[v("p",E7,"Попередній перегляд ("+we(i.value.length)+" зображень):",1),F[6]||(F[6]=v("p",{class:"text-xs text-gray-500 mb-2"}," Зображення будуть розміщені в ряд, якщо вони помістяться по ширині ",-1)),v("div",S7,[(S(!0),T(Me,null,Je(i.value,($,A)=>(S(),T("div",{key:A,class:"relative"},[nt(v("img",{src:$.preview,alt:`Попередній перегляд ${A+1}`,class:"max-w-[100px] max-h-[100px] rounded border object-contain",onError:q=>$.error=!0},null,40,M7),[[jo,!$.error]]),v("button",{onClick:q=>y(A),class:"absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",type:"button"}," × ",8,T7)]))),128))])])):pe("",!0)]),_:1},8,["modelValue","title"])])}}}),O7={class:"flex items-center"},N7=["disabled"],I7=["disabled"],R7=Object.assign({inheritAttrs:!1},{__name:"vs-editor-history",props:{editor:Object},setup(t){const e=t,n=()=>{var o;(o=e.editor)!=null&&o.can().undo()&&e.editor.chain().focus().undo().run()},r=()=>{var o;(o=e.editor)!=null&&o.can().redo()&&e.editor.chain().focus().redo().run()};return(o,s)=>{var i,l,a,c;return S(),T("div",O7,[v("button",{onClick:n,class:ae(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200",[(i=t.editor)!=null&&i.can().undo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!((l=t.editor)!=null&&l.can().undo()),title:"Undo (Ctrl+Z)"},[...s[0]||(s[0]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"M3 7v6h6"}),v("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)])],10,N7),v("button",{onClick:r,class:ae(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100",[(a=t.editor)!=null&&a.can().redo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!((c=t.editor)!=null&&c.can().redo()),title:"Redo (Ctrl+Y)"},[...s[1]||(s[1]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"M21 7v6h-6"}),v("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13"})],-1)])],10,I7)])}}}),P7=Lt(R7,[["__scopeId","data-v-b5a7cc5a"]]),D7={class:"relative"},$7=Object.assign({inheritAttrs:!1},{__name:"vs-editor-help",props:{editor:Object},setup(t){const e=Q(!1),n=Q(null),r=()=>{e.value=!e.value},o=()=>{e.value=!1};return(s,i)=>(S(),T("div",D7,[v("button",{ref_key:"helpButton",ref:n,onClick:r,class:ae(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500",[e.value?"bg-gray-100 text-gray-900":"text-gray-500"]]),title:"Markdown Shortcuts Help"},[...i[1]||(i[1]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("circle",{cx:"12",cy:"12",r:"10"}),v("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),v("line",{x1:"12",x2:"12.01",y1:"17",y2:"17"})],-1)])],2),e.value?(S(),T("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100001]",onClick:o},[v("div",{class:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",onClick:i[0]||(i[0]=Vn(()=>{},["stop"]))},[v("div",{class:"p-6"},[v("div",{class:"flex justify-between items-center mb-4"},[i[3]||(i[3]=v("h2",{class:"text-xl font-semibold text-gray-900"},"Common Markdown Syntax & Shortcuts",-1)),v("button",{onClick:o,class:"text-gray-400 hover:text-gray-600 transition-colors"},[...i[2]||(i[2]=[v("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[v("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),i[4]||(i[4]=tn('<div class="space-y-6" data-v-72ce3024><div data-v-72ce3024><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-72ce3024>Markdown Syntax</h3><div class="overflow-x-auto" data-v-72ce3024><table class="w-full border-collapse" data-v-72ce3024><thead data-v-72ce3024><tr class="bg-gray-50" data-v-72ce3024><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Example</th></tr></thead><tbody class="text-sm" data-v-72ce3024><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>_italic text_</code></td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>###### Heading 6</code></td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>1. First item</code>). </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Start with a greater-than sign (&gt;) followed by a space. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>`</code>). </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Images</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>![alt text](url)</code> syntax. </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Links</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-72ce3024><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-72ce3024>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-72ce3024><table class="w-full border-collapse" data-v-72ce3024><thead data-v-72ce3024><tr class="bg-gray-50" data-v-72ce3024><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Action</th></tr></thead><tbody class="text-sm" data-v-72ce3024><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Select all text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Apply bold formatting</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Copy selected text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Apply italic formatting</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Save the current document</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Paste copied text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Cut selected text</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Redo the last action</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Redo the last action</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Undo the last action</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Undo the last action</td></tr></tbody></table></div></div></div>',1))])])])):pe("",!0)]))}}),F7=Lt($7,[["__scopeId","data-v-72ce3024"]]),V7={__name:"vs-editor-horizontal-rule",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().setHorizontalRule().run()};return(r,o)=>(S(),T("button",{title:"Horizontal Rule",onClick:n,class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},[...o[0]||(o[0]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("line",{x1:"3",x2:"21",y1:"12",y2:"12"})],-1)])]))}},B7={__name:"vs-editor-fullscreen",props:{editor:Object},emits:["toggle-fullscreen"],setup(t,{emit:e}){const n=e,r=()=>{n("toggle-fullscreen")};return(o,s)=>(S(),T("button",{title:"Fullscreen",onClick:r,class:"w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"},[...s[0]||(s[0]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})],-1)])]))}},H7=["title"],j7={class:"vs-editor-html-mode__text"},z7={__name:"vs-editor-html-mode",props:{editor:{type:Object,required:!0}},emits:["toggle-html-mode"],setup(t,{emit:e}){const n=e,r=Q(!1),o=()=>{r.value=!r.value,n("toggle-html-mode",r.value)};return(s,i)=>(S(),T("button",{onClick:o,class:ae([{"is-active":r.value},"vs-editor-html-mode"]),type:"button",title:r.value?"Switch to Rich Text Mode":"Switch to HTML Mode"},[i[0]||(i[0]=v("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[v("polyline",{points:"16,18 22,12 16,6"}),v("polyline",{points:"8,6 2,12 8,18"})],-1)),v("span",j7,we((r.value,"HTML")),1)],10,H7))}},U7=Lt(z7,[["__scopeId","data-v-99a48167"]]),W7=Object.assign({inheritAttrs:!1},{__name:"vs-editor-tab",props:{editor:{type:Object,required:!0}},setup(t){const e=t,n=()=>{e.editor&&(e.editor.isActive("bulletList")||e.editor.isActive("orderedList"))&&e.editor.chain().focus().sinkListItem("listItem").run()};return(r,o)=>(S(),T("button",{title:"Tab (Increase List Indent)",onClick:n,class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...o[0]||(o[0]=[tn('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-indent-increase"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M20 6l-11 0"></path><path d="M20 12l-7 0"></path><path d="M20 18l-11 0"></path><path d="M4 8l4 4l-4 4"></path></svg>',1)])]))}}),wk={bold:_P,italic:SP,color:zD,background_color:JD,highlight:YD,bullet_list:hP,ordered_list:yP,blockquote:dP,codeblock:wP,underline:MP,strike:TP,link:oD,table:cD,text_align:TD,type_tag:OD,font_family:t$,font_size:s$,superscript:a$,subscript:d$,heading:y$,clear_formatting:w$,image:L7,history:P7,help:F7,horizontal_rule:V7,fullscreen:B7,html_mode:U7,tab:W7},nu={basic:["history","font_family","font_size","bold","italic","underline","strike","text_align","bullet_list","ordered_list","link","image","clear_formatting","help"],default:["history","heading","font_family","font_size","bold","italic","underline","strike","superscript","subscript","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","horizontal_rule","clear_formatting","fullscreen","help","html_mode"],full:["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","horizontal_rule","superscript","subscript","clear_formatting","fullscreen","help","html_mode"]},K7={__name:"monaco-editor",props:{modelValue:{type:String,default:""},height:{type:String,default:"280px"},language:{type:String,default:"html"},theme:{type:String,default:"vs"}},emits:["update:modelValue","change"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=Q(null);let i=null,l=null,a=!1,c=null;const u=()=>{const $=document.querySelector("link[data-monaco-editor-css]");if(!$)return!1;try{return $.sheet||$.styleSheet||$.href}catch{return!1}},d=()=>u()?new Promise($=>setTimeout($,50)):new Promise(($,A)=>{const q=document.createElement("link");q.rel="stylesheet",q.href="https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs/editor/editor.main.css",q.setAttribute("data-monaco-editor-css","true");const Y=()=>{const G=()=>{u()?setTimeout(()=>$(),100):setTimeout(G,50)};G()};q.addEventListener?(q.addEventListener("load",Y),q.addEventListener("error",()=>A(new Error("Failed to load Monaco Editor CSS")))):(q.onload=Y,q.onerror=()=>A(new Error("Failed to load Monaco Editor CSS"))),document.head.appendChild(q);let Z=0;const K=20,X=setInterval(()=>{Z++,u()?(clearInterval(X),setTimeout(()=>$(),100)):Z>=K&&(clearInterval(X),setTimeout(()=>$(),100))},50)}),f=()=>document.querySelector("script[data-monaco-editor-loader]")?Promise.resolve():new Promise(($,A)=>{const q=document.createElement("script");q.src="https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs/loader.js",q.setAttribute("data-monaco-editor-loader","true"),q.onload=()=>$(),q.onerror=()=>A(new Error("Failed to load Monaco Editor loader")),document.head.appendChild(q)}),p=()=>c||(window.monaco&&window.monaco.editor?(l=window.monaco,Promise.resolve(l)):(c=new Promise(($,A)=>{if(a){const q=setInterval(()=>{window.monaco&&window.monaco.editor&&(clearInterval(q),l=window.monaco,$(l))},50);return}a=!0,d().then(()=>f()).then(()=>{const q=setInterval(()=>{window.require&&(clearInterval(q),window.require.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}}),window.require(["vs/editor/editor.main"],()=>{l=window.monaco,a=!1,$(l)},Y=>{a=!1,console.error("Failed to load Monaco Editor:",Y),A(Y)}))},50);setTimeout(()=>{clearInterval(q),a=!1,A(new Error("Monaco Editor loader not found"))},1e4)}).catch(q=>{a=!1,A(q)})}),c)),h=$=>{try{const A=document.createElement("div");A.innerHTML=$;const q=(Z,K=0)=>{const X=" ".repeat(K);let G="";if(Z.nodeType===Node.TEXT_NODE){const ne=Z.textContent.trim();return ne&&(G+=X+ne+`
254
- `),G}if(Z.nodeType===Node.ELEMENT_NODE){const ne=Z.tagName.toLowerCase(),Le=Array.from(Z.attributes).map(Be=>`${Be.name}="${Be.value}"`).join(" "),je=Z.children.length>0;Z.textContent.trim()&&!je?G+=X+`<${ne}${Le?" "+Le:""}>${Z.textContent}</${ne}>
255
- `:je?(G+=X+`<${ne}${Le?" "+Le:""}>
256
- `,Array.from(Z.childNodes).forEach(Be=>{G+=q(Be,K+1)}),G+=X+`</${ne}>
257
- `):G+=X+`<${ne}${Le?" "+Le:""} />
258
- `}return G};let Y="";return Array.from(A.childNodes).forEach(Z=>{Y+=q(Z)}),Y.trim()}catch(A){return console.warn("HTML formatting error:",A),$}},m=async()=>{if(!s.value)return;if(!l)try{await p();let A=!1,q=0;for(;!A&&q<10;){const Y=document.querySelector("link[data-monaco-editor-css]");if(Y&&(Y.sheet||Y.styleSheet))try{const Z=Y.sheet||Y.styleSheet;Z&&Z.cssRules&&Z.cssRules.length>0&&(A=!0)}catch{A=!0}A||(await new Promise(Z=>setTimeout(Z,50)),q++)}}catch(A){console.error("Failed to load Monaco Editor:",A);return}const $=r.language;if(i=l.editor.create(s.value,{value:r.modelValue,language:$,theme:r.theme,automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",lineNumbers:"on",folding:!0,lineDecorationsWidth:0,lineNumbersMinChars:3,renderLineHighlight:"line",selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,cursorStyle:"line",cursorBlinking:"blink",cursorSmoothCaretAnimation:!0,cursorWidth:1,fontFamily:"'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace",fontSize:13,lineHeight:1.5,tabSize:2,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!0,formatOnPaste:!0,formatOnType:!0,autoClosingBrackets:"always",autoClosingQuotes:"always",autoSurround:"languageDefined",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},fixedOverflowWidgets:!1,overflowWidgetsDomNode:s.value,suggest:{showKeywords:!0,showSnippets:!0,showClasses:!0,showFunctions:!0,showVariables:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showIssues:!0,showUsers:!0,showWords:!0,showCustomcolors:!0,showInterfaces:!0,showText:!0,showEnums:!0,showStructs:!0,showTypeAliases:!0,showConstants:!0,showConstructors:!0,showFields:!0,showMethods:!0,showNamespaces:!0,showPackages:!0,showSymbols:!0,showTypeParameters:!0},quickSuggestions:{other:!0,comments:!1,strings:!0},html:{format:{enable:!0,tabSize:2,insertSpaces:!0,wrapLineLength:120,unformatted:"default",contentUnformatted:"pre,code,textarea",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:2,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},suggest:{html5:!0,angular1:!1,ionic:!1},validate:{scripts:!0,styles:!0}},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,verticalSliderSize:4,horizontalSliderSize:4,arrowSize:0,verticalSliderHasArrows:!1,horizontalSliderHasArrows:!1}}),r.language==="html"){l.languages.register({id:"html"}),l.languages.setMonarchTokensProvider("html",{tokenizer:{root:[[/<!--/,"comment","@comment"],[/<[^>]+>/,"tag"],[/\w+\s*=\s*"[^"]*"/,"attribute"],[/\w+\s*=\s*'[^']*'/,"attribute"],[/"[^"]*"/,"string"],[/'[^']*'/,"string"],[/\b(doctype|html|head|body|title|meta|link|script|style|div|span|p|h1|h2|h3|h4|h5|h6|ul|ol|li|table|tr|td|th|form|input|button|img|a|br|hr)\b/i,"keyword"],[/\d+/,"number"],[/\s+/,"white"],[/./,"text"]],comment:[[/-->/,"comment","@pop"],[/./,"comment"]]}});try{l.languages.setLanguageConfiguration("html",{wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<",">"],["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"<",close:">",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string"]}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}]})}catch(A){console.warn("HTML language configuration failed:",A)}}i.onDidChangeModelContent(()=>{const A=i.getValue();o("update:modelValue",A),o("change",A)})},y=$=>{i&&$!==i.getValue()&&i.setValue($)},g=$=>{if(i&&l)if(r.language==="html"){const A=$==="vs-dark"||$==="hc-black";l.editor.defineTheme("html-custom",{base:A?"vs-dark":"vs",inherit:!0,rules:[{token:"tag",foreground:A?"#4FC1FF":"#0066CC",fontStyle:"bold"},{token:"attribute",foreground:A?"#9CDCFE":"#0000FF"},{token:"string",foreground:A?"#FF6B6B":"#CC0000"},{token:"comment",foreground:A?"#6A9955":"#008000",fontStyle:"italic"},{token:"keyword",foreground:A?"#FFA500":"#FF6600",fontStyle:"bold"},{token:"number",foreground:A?"#B5CEA8":"#098658"},{token:"text",foreground:A?"#D4D4D4":"#000000"},{token:"white",foreground:A?"#D4D4D4":"#000000"}],colors:{"editor.background":A?"#1e1e1e":"#ffffff","editor.foreground":A?"#d4d4d4":"#000000"}}),l.editor.setTheme("html-custom")}else l.editor.setTheme($)},k=$=>{i&&l&&l.editor.setModelLanguage(i.getModel(),$)},w=()=>{i&&i.focus()},b=()=>i?i.getPosition():null,_=$=>{i&&$&&(i.setPosition($),i.revealPosition($))},M=()=>{if(i){const $=i.getSelection();return i.getModel().getValueInRange($)}return""},E=$=>{if(i){const A=i.getSelection();i.executeEdits("replace-selection",[{range:A,text:$,forceMoveMarkers:!0}])}},I=()=>{if(i){const $=i.getValue(),A=h($);A!==$&&(i.setValue(A),i.setPosition({lineNumber:1,column:1}))}},F=()=>{if(r.language==="html"&&l)try{l.languages.registerCompletionItemProvider("html",{provideCompletionItems:($,A)=>({suggestions:[{label:"class",kind:l.languages.CompletionItemKind.Property,insertText:'class="$1"',insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"CSS class attribute"},{label:"id",kind:l.languages.CompletionItemKind.Property,insertText:'id="$1"',insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Unique identifier"},{label:"style",kind:l.languages.CompletionItemKind.Property,insertText:'style="$1"',insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Inline CSS styles"},{label:"data-*",kind:l.languages.CompletionItemKind.Property,insertText:'data-$1="$2"',insertTextRules:l.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"Custom data attribute"}]})})}catch($){console.warn("HTML completion provider failed:",$)}},R=()=>{i&&i.layout()};return rt(async()=>{await zt();try{await p(),await zt(),await m(),F(),window.addEventListener("resize",R)}catch($){console.error("Failed to initialize Monaco Editor:",$)}}),gn(()=>{i&&i.dispose(),window.removeEventListener("resize",R)}),Re(()=>r.modelValue,y),Re(()=>r.theme,g),Re(()=>r.language,k),Re(()=>r.height,()=>{zt(()=>{R()})}),e({editor:i,focus:w,getPosition:b,setPosition:_,getSelectedText:M,replaceSelection:E,formatCode:I}),($,A)=>(S(),T("div",{ref_key:"monacoContainer",ref:s,class:"monaco-editor-container",style:pt({height:t.height})},null,4))}},G7=Lt(K7,[["__scopeId","data-v-b1d773a1"]]),q7={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},J7={key:1,class:"html-source-editor"},vy=Object.assign({inheritAttrs:!1},{__name:"vs-richtext",props:yt({modelValue:{type:String,default:()=>""},height:{type:String,default:()=>"300px"},toolbar:{type:[Array,String],default:()=>"default"}},{modelValue:{},modelModifiers:{}}),emits:yt(["update:modelValue"],["update:modelValue"]),setup(t){const e=t,n=It(t,"modelValue"),{editor:r,editorInstance:o,focusEditor:s}=ak(e),{isHtmlMode:i,htmlContent:l,htmlTextarea:a,toggleHtmlMode:c,onHtmlInput:u}=ck(r,(y,g)=>{y==="update:modelValue"&&(n.value=g)}),{isFullscreen:d,toggleFullscreen:f}=uk(),p=te(()=>typeof e.toolbar=="string"?nu[e.toolbar]||nu.default:e.toolbar),h=te(()=>p.value.map(y=>wk[y]).filter(Boolean));Re(()=>e.modelValue,y=>{if(r.value){const g=y||"",k=r.value.getHTML();g!==k&&g!=="<p></p>"&&r.value.commands.setContent(g,!1)}},{immediate:!0});const m=y=>{!y||!y.view||!y.view.dom||y.view.dom.querySelectorAll("img.editor-image[width][height]").forEach(g=>{if(g instanceof HTMLImageElement){const k=g.getAttribute("width"),w=g.getAttribute("height");k&&w&&k!=="auto"&&w!=="auto"&&k!==""&&w!==""&&!isNaN(Number(k))&&!isNaN(Number(w))&&(g.style.cssText=`
259
- width: ${k}px !important;
260
- height: ${w}px !important;
261
- max-width: none !important;
262
- max-height: none !important;
263
- min-width: auto !important;
264
- min-height: auto !important;
265
- object-fit: fill !important;
266
- `.replace(/\s+/g," ").trim())}})};return Re(r,y=>{y&&(zt(()=>{m(r.value)}),r.value.on("update",g=>{const k=g.editor.getHTML();k!==e.modelValue&&k!=="<p></p>"&&(n.value=k),setTimeout(()=>{m(g.editor)},10)}))}),rt(()=>{zt(()=>{r.value&&setTimeout(()=>{m(r.value)},100)})}),(y,g)=>(S(),T("div",{class:ae(["bg-white border border border-solid border-gray-200 rounded-xl w-full",{"fixed left-0 right-0 top-0 bottom-0 z-[100000]":me(d)}])},[v("div",q7,[(S(!0),T(Me,null,Je(h.value,k=>(S(),T(Me,{key:k},[me(r)?(S(),Ae(Cn(k),{key:0,editor:me(o),onToggleFullscreen:me(f),onToggleHtmlMode:me(c)},null,40,["editor","onToggleFullscreen","onToggleHtmlMode"])):pe("",!0)],64))),128))]),v("div",{onClick:g[2]||(g[2]=(...k)=>me(s)&&me(s)(...k)),class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800",style:pt({height:me(d)?"95vh":t.height})},[me(i)?(S(),T("div",J7,[ce(G7,{ref_key:"htmlTextarea",ref:a,modelValue:me(l),"onUpdate:modelValue":g[0]||(g[0]=k=>Ut(l)?l.value=k:null),height:me(d)?"calc(95vh - 100px)":"100%",language:"html",theme:"vs",onChange:g[1]||(g[1]=k=>me(u)(k))},null,8,["modelValue","height"])])):(S(),Ae(me(kx),{key:0,editor:me(r),class:"relative w-full"},null,8,["editor"]))],4)],2))}}),Y7={class:"bg-white border-b flex-wrap border-b-gray-200 px-[10px] py-3 border-solid border-transparent"},X7={class:"flex flex-col mx-auto max-w-6xl"},Z7={class:"flex justify-center gap-x-2"},Q7=Object.assign({inheritAttrs:!1},{__name:"vs-richtext-page",props:yt({modelValue:{type:String,default:()=>""},height:{type:String,default:()=>"min-h-[800px]"},width:{type:String,default:()=>"max-w-4xl"}},{modelValue:{},modelModifiers:{}}),emits:yt(["update:modelValue"],["update:modelValue"]),setup(t){const e=t,n=It(t,"modelValue"),r=["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table"],{editor:o,editorInstance:s,focusEditor:i}=ak(e),{toggleHtmlMode:l}=ck(o,(d,f)=>{d==="update:modelValue"&&(n.value=f)}),{toggleFullscreen:a}=uk(),c=te(()=>typeof r=="string"?nu[r]||nu.default:r),u=te(()=>c.value.map(d=>wk[d]).filter(Boolean));return Re(()=>e.modelValue,d=>{if(o.value){const f=d||"",p=o.value.getHTML();f!==p&&f!=="<p></p>"&&o.value.commands.setContent(f,!1)}},{immediate:!0}),Re(o,d=>{d&&o.value.on("update",f=>{const p=f.editor.getHTML();p!==e.modelValue&&p!=="<p></p>"&&(n.value=p)})}),(d,f)=>(S(),T("div",ao(d.$attrs,{class:["w-full bg-[#f1f5f9] flex flex-col overflow-hidden",t.height]}),[v("div",Y7,[v("div",X7,[mn(d.$slots,"header"),v("div",Z7,[(S(!0),T(Me,null,Je(u.value,p=>(S(),T(Me,{key:p},[me(o)?(S(),Ae(Cn(p),{key:0,editor:me(s),onToggleFullscreen:me(a),onToggleHtmlMode:me(l)},null,40,["editor","onToggleFullscreen","onToggleHtmlMode"])):pe("",!0)],64))),128))])])]),v("div",{onClick:f[0]||(f[0]=(...p)=>me(i)&&me(i)(...p)),class:"relative w-full h-full px-6 py-8 flex justify-center rounded-b-lg editor-page-content dark:bg-gray-800 max-h-[95vh]"},[ce(me(kx),{editor:me(o),class:ae(["relative w-full bg-white shadow-lg rounded-lg min-h-[800px] h-[fit-content] p-16",[t.width]])},null,8,["editor","class"])])],16))}});/*!
267
- * shared v11.1.12
268
- * (c) 2025 kazuya kawaguchi
269
- * Released under the MIT License.
270
- */function e9(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const ru=typeof window<"u",es=(t,e=!1)=>e?Symbol.for(t):Symbol(t),t9=(t,e,n)=>n9({l:t,k:e,s:n}),n9=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Jt=t=>typeof t=="number"&&isFinite(t),r9=t=>Ph(t)==="[object Date]",ki=t=>Ph(t)==="[object RegExp]",Uu=t=>qe(t)&&Object.keys(t).length===0,en=Object.assign,o9=Object.create,mt=(t=null)=>o9(t);let wy;const hs=()=>wy||(wy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:mt());function xy(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function ky(t){return t.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function s9(t){return t=t.replace(/(\w+)\s*=\s*"([^"]*)"/g,(e,n,r)=>`${n}="${ky(r)}"`),t=t.replace(/(\w+)\s*=\s*'([^']*)'/g,(e,n,r)=>`${n}='${ky(r)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(t)&&(t=t.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(e=>{t=t.replace(e,"$1javascript&#58;")}),t}const i9=Object.prototype.hasOwnProperty;function mr(t,e){return i9.call(t,e)}const Ht=Array.isArray,At=t=>typeof t=="function",Ee=t=>typeof t=="string",tt=t=>typeof t=="boolean",lt=t=>t!==null&&typeof t=="object",l9=t=>lt(t)&&At(t.then)&&At(t.catch),xk=Object.prototype.toString,Ph=t=>xk.call(t),qe=t=>Ph(t)==="[object Object]",a9=t=>t==null?"":Ht(t)||qe(t)&&t.toString===xk?JSON.stringify(t,null,2):String(t);function Dh(t,e=""){return t.reduce((n,r,o)=>o===0?n+r:n+e+r,"")}const Aa=t=>!lt(t)||Ht(t);function Ka(t,e){if(Aa(t)||Aa(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:o}=n.pop();Object.keys(r).forEach(s=>{s!=="__proto__"&&(lt(r[s])&&!lt(o[s])&&(o[s]=Array.isArray(r[s])?[]:mt()),Aa(o[s])||Aa(r[s])?o[s]=r[s]:n.push({src:r[s],des:o[s]}))})}}/*!
271
- * message-compiler v11.1.12
272
- * (c) 2025 kazuya kawaguchi
273
- * Released under the MIT License.
274
- */function c9(t,e,n){return{line:t,column:e,offset:n}}function sp(t,e,n){return{start:t,end:e}}const ct={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},u9=17;function Wu(t,e,n={}){const{domain:r,messages:o,args:s}=n,i=t,l=new SyntaxError(String(i));return l.code=t,e&&(l.location=e),l.domain=r,l}function d9(t){throw t}const Cr=" ",f9="\r",An=`
275
- `,p9="\u2028",h9="\u2029";function m9(t){const e=t;let n=0,r=1,o=1,s=0;const i=E=>e[E]===f9&&e[E+1]===An,l=E=>e[E]===An,a=E=>e[E]===h9,c=E=>e[E]===p9,u=E=>i(E)||l(E)||a(E)||c(E),d=()=>n,f=()=>r,p=()=>o,h=()=>s,m=E=>i(E)||a(E)||c(E)?An:e[E],y=()=>m(n),g=()=>m(n+s);function k(){return s=0,u(n)&&(r++,o=0),i(n)&&n++,n++,o++,e[n]}function w(){return i(n+s)&&s++,s++,e[n+s]}function b(){n=0,r=1,o=1,s=0}function _(E=0){s=E}function M(){const E=n+s;for(;E!==n;)k();s=0}return{index:d,line:f,column:p,peekOffset:h,charAt:m,currentChar:y,currentPeek:g,next:k,peek:w,reset:b,resetPeek:_,skipToPeek:M}}const zr=void 0,_y="'",g9="tokenizer";function y9(t,e={}){const n=e.location!==!1,r=m9(t),o=()=>r.index(),s=()=>c9(r.line(),r.column(),r.index()),i=s(),l=o(),a={currentType:13,offset:l,startLoc:i,endLoc:i,lastType:13,lastOffset:l,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=e;function d(x,C,N,...H){const D=c();if(C.column+=N,C.offset+=N,u){const z=n?sp(D.startLoc,C):null,V=Wu(x,z,{domain:g9,args:H});u(V)}}function f(x,C,N){x.endLoc=s(),x.currentType=C;const H={type:C};return n&&(H.loc=sp(x.startLoc,x.endLoc)),N!=null&&(H.value=N),H}const p=x=>f(x,13);function h(x,C){return x.currentChar()===C?(x.next(),C):(d(ct.EXPECTED_TOKEN,s(),0,C),"")}function m(x){let C="";for(;x.currentPeek()===Cr||x.currentPeek()===An;)C+=x.currentPeek(),x.peek();return C}function y(x){const C=m(x);return x.skipToPeek(),C}function g(x){if(x===zr)return!1;const C=x.charCodeAt(0);return C>=97&&C<=122||C>=65&&C<=90||C===95}function k(x){if(x===zr)return!1;const C=x.charCodeAt(0);return C>=48&&C<=57}function w(x,C){const{currentType:N}=C;if(N!==2)return!1;m(x);const H=g(x.currentPeek());return x.resetPeek(),H}function b(x,C){const{currentType:N}=C;if(N!==2)return!1;m(x);const H=x.currentPeek()==="-"?x.peek():x.currentPeek(),D=k(H);return x.resetPeek(),D}function _(x,C){const{currentType:N}=C;if(N!==2)return!1;m(x);const H=x.currentPeek()===_y;return x.resetPeek(),H}function M(x,C){const{currentType:N}=C;if(N!==7)return!1;m(x);const H=x.currentPeek()===".";return x.resetPeek(),H}function E(x,C){const{currentType:N}=C;if(N!==8)return!1;m(x);const H=g(x.currentPeek());return x.resetPeek(),H}function I(x,C){const{currentType:N}=C;if(!(N===7||N===11))return!1;m(x);const H=x.currentPeek()===":";return x.resetPeek(),H}function F(x,C){const{currentType:N}=C;if(N!==9)return!1;const H=()=>{const z=x.currentPeek();return z==="{"?g(x.peek()):z==="@"||z==="|"||z===":"||z==="."||z===Cr||!z?!1:z===An?(x.peek(),H()):$(x,!1)},D=H();return x.resetPeek(),D}function R(x){m(x);const C=x.currentPeek()==="|";return x.resetPeek(),C}function $(x,C=!0){const N=(D=!1,z="")=>{const V=x.currentPeek();return V==="{"||V==="@"||!V?D:V==="|"?!(z===Cr||z===An):V===Cr?(x.peek(),N(!0,Cr)):V===An?(x.peek(),N(!0,An)):!0},H=N();return C&&x.resetPeek(),H}function A(x,C){const N=x.currentChar();return N===zr?zr:C(N)?(x.next(),N):null}function q(x){const C=x.charCodeAt(0);return C>=97&&C<=122||C>=65&&C<=90||C>=48&&C<=57||C===95||C===36}function Y(x){return A(x,q)}function Z(x){const C=x.charCodeAt(0);return C>=97&&C<=122||C>=65&&C<=90||C>=48&&C<=57||C===95||C===36||C===45}function K(x){return A(x,Z)}function X(x){const C=x.charCodeAt(0);return C>=48&&C<=57}function G(x){return A(x,X)}function ne(x){const C=x.charCodeAt(0);return C>=48&&C<=57||C>=65&&C<=70||C>=97&&C<=102}function Le(x){return A(x,ne)}function je(x){let C="",N="";for(;C=G(x);)N+=C;return N}function Be(x){let C="";for(;;){const N=x.currentChar();if(N==="{"||N==="}"||N==="@"||N==="|"||!N)break;if(N===Cr||N===An)if($(x))C+=N,x.next();else{if(R(x))break;C+=N,x.next()}else C+=N,x.next()}return C}function Dt(x){y(x);let C="",N="";for(;C=K(x);)N+=C;const H=x.currentChar();if(H&&H!=="}"&&H!==zr&&H!==Cr&&H!==An&&H!==" "){const D=xe(x);return d(ct.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,N+D),N+D}return x.currentChar()===zr&&d(ct.UNTERMINATED_CLOSING_BRACE,s(),0),N}function Ze(x){y(x);let C="";return x.currentChar()==="-"?(x.next(),C+=`-${je(x)}`):C+=je(x),x.currentChar()===zr&&d(ct.UNTERMINATED_CLOSING_BRACE,s(),0),C}function Pt(x){return x!==_y&&x!==An}function vt(x){y(x),h(x,"'");let C="",N="";for(;C=A(x,Pt);)C==="\\"?N+=oe(x):N+=C;const H=x.currentChar();return H===An||H===zr?(d(ct.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),H===An&&(x.next(),h(x,"'")),N):(h(x,"'"),N)}function oe(x){const C=x.currentChar();switch(C){case"\\":case"'":return x.next(),`\\${C}`;case"u":return be(x,C,4);case"U":return be(x,C,6);default:return d(ct.UNKNOWN_ESCAPE_SEQUENCE,s(),0,C),""}}function be(x,C,N){h(x,C);let H="";for(let D=0;D<N;D++){const z=Le(x);if(!z){d(ct.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),0,`\\${C}${H}${x.currentChar()}`);break}H+=z}return`\\${C}${H}`}function ye(x){return x!=="{"&&x!=="}"&&x!==Cr&&x!==An}function xe(x){y(x);let C="",N="";for(;C=A(x,ye);)N+=C;return N}function Ve(x){let C="",N="";for(;C=Y(x);)N+=C;return N}function Ue(x){const C=N=>{const H=x.currentChar();return H==="{"||H==="@"||H==="|"||H==="("||H===")"||!H||H===Cr?N:(N+=H,x.next(),C(N))};return C("")}function O(x){y(x);const C=h(x,"|");return y(x),C}function B(x,C){let N=null;switch(x.currentChar()){case"{":return C.braceNest>=1&&d(ct.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),x.next(),N=f(C,2,"{"),y(x),C.braceNest++,N;case"}":return C.braceNest>0&&C.currentType===2&&d(ct.EMPTY_PLACEHOLDER,s(),0),x.next(),N=f(C,3,"}"),C.braceNest--,C.braceNest>0&&y(x),C.inLinked&&C.braceNest===0&&(C.inLinked=!1),N;case"@":return C.braceNest>0&&d(ct.UNTERMINATED_CLOSING_BRACE,s(),0),N=J(x,C)||p(C),C.braceNest=0,N;default:{let H=!0,D=!0,z=!0;if(R(x))return C.braceNest>0&&d(ct.UNTERMINATED_CLOSING_BRACE,s(),0),N=f(C,1,O(x)),C.braceNest=0,C.inLinked=!1,N;if(C.braceNest>0&&(C.currentType===4||C.currentType===5||C.currentType===6))return d(ct.UNTERMINATED_CLOSING_BRACE,s(),0),C.braceNest=0,ie(x,C);if(H=w(x,C))return N=f(C,4,Dt(x)),y(x),N;if(D=b(x,C))return N=f(C,5,Ze(x)),y(x),N;if(z=_(x,C))return N=f(C,6,vt(x)),y(x),N;if(!H&&!D&&!z)return N=f(C,12,xe(x)),d(ct.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,N.value),y(x),N;break}}return N}function J(x,C){const{currentType:N}=C;let H=null;const D=x.currentChar();switch((N===7||N===8||N===11||N===9)&&(D===An||D===Cr)&&d(ct.INVALID_LINKED_FORMAT,s(),0),D){case"@":return x.next(),H=f(C,7,"@"),C.inLinked=!0,H;case".":return y(x),x.next(),f(C,8,".");case":":return y(x),x.next(),f(C,9,":");default:return R(x)?(H=f(C,1,O(x)),C.braceNest=0,C.inLinked=!1,H):M(x,C)||I(x,C)?(y(x),J(x,C)):E(x,C)?(y(x),f(C,11,Ve(x))):F(x,C)?(y(x),D==="{"?B(x,C)||H:f(C,10,Ue(x))):(N===7&&d(ct.INVALID_LINKED_FORMAT,s(),0),C.braceNest=0,C.inLinked=!1,ie(x,C))}}function ie(x,C){let N={type:13};if(C.braceNest>0)return B(x,C)||p(C);if(C.inLinked)return J(x,C)||p(C);switch(x.currentChar()){case"{":return B(x,C)||p(C);case"}":return d(ct.UNBALANCED_CLOSING_BRACE,s(),0),x.next(),f(C,3,"}");case"@":return J(x,C)||p(C);default:{if(R(x))return N=f(C,1,O(x)),C.braceNest=0,C.inLinked=!1,N;if($(x))return f(C,0,Be(x));break}}return N}function re(){const{currentType:x,offset:C,startLoc:N,endLoc:H}=a;return a.lastType=x,a.lastOffset=C,a.lastStartLoc=N,a.lastEndLoc=H,a.offset=o(),a.startLoc=s(),r.currentChar()===zr?f(a,13):ie(r,a)}return{nextToken:re,currentOffset:o,currentPosition:s,context:c}}const b9="parser",v9=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function w9(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function x9(t={}){const e=t.location!==!1,{onError:n}=t;function r(g,k,w,b,..._){const M=g.currentPosition();if(M.offset+=b,M.column+=b,n){const E=e?sp(w,M):null,I=Wu(k,E,{domain:b9,args:_});n(I)}}function o(g,k,w){const b={type:g};return e&&(b.start=k,b.end=k,b.loc={start:w,end:w}),b}function s(g,k,w,b){e&&(g.end=k,g.loc&&(g.loc.end=w))}function i(g,k){const w=g.context(),b=o(3,w.offset,w.startLoc);return b.value=k,s(b,g.currentOffset(),g.currentPosition()),b}function l(g,k){const w=g.context(),{lastOffset:b,lastStartLoc:_}=w,M=o(5,b,_);return M.index=parseInt(k,10),g.nextToken(),s(M,g.currentOffset(),g.currentPosition()),M}function a(g,k){const w=g.context(),{lastOffset:b,lastStartLoc:_}=w,M=o(4,b,_);return M.key=k,g.nextToken(),s(M,g.currentOffset(),g.currentPosition()),M}function c(g,k){const w=g.context(),{lastOffset:b,lastStartLoc:_}=w,M=o(9,b,_);return M.value=k.replace(v9,w9),g.nextToken(),s(M,g.currentOffset(),g.currentPosition()),M}function u(g){const k=g.nextToken(),w=g.context(),{lastOffset:b,lastStartLoc:_}=w,M=o(8,b,_);return k.type!==11?(r(g,ct.UNEXPECTED_EMPTY_LINKED_MODIFIER,w.lastStartLoc,0),M.value="",s(M,b,_),{nextConsumeToken:k,node:M}):(k.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Er(k)),M.value=k.value||"",s(M,g.currentOffset(),g.currentPosition()),{node:M})}function d(g,k){const w=g.context(),b=o(7,w.offset,w.startLoc);return b.value=k,s(b,g.currentOffset(),g.currentPosition()),b}function f(g){const k=g.context(),w=o(6,k.offset,k.startLoc);let b=g.nextToken();if(b.type===8){const _=u(g);w.modifier=_.node,b=_.nextConsumeToken||g.nextToken()}switch(b.type!==9&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(b)),b=g.nextToken(),b.type===2&&(b=g.nextToken()),b.type){case 10:b.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(b)),w.key=d(g,b.value||"");break;case 4:b.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(b)),w.key=a(g,b.value||"");break;case 5:b.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(b)),w.key=l(g,b.value||"");break;case 6:b.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(b)),w.key=c(g,b.value||"");break;default:{r(g,ct.UNEXPECTED_EMPTY_LINKED_KEY,k.lastStartLoc,0);const _=g.context(),M=o(7,_.offset,_.startLoc);return M.value="",s(M,_.offset,_.startLoc),w.key=M,s(w,_.offset,_.startLoc),{nextConsumeToken:b,node:w}}}return s(w,g.currentOffset(),g.currentPosition()),{node:w}}function p(g){const k=g.context(),w=k.currentType===1?g.currentOffset():k.offset,b=k.currentType===1?k.endLoc:k.startLoc,_=o(2,w,b);_.items=[];let M=null;do{const F=M||g.nextToken();switch(M=null,F.type){case 0:F.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(F)),_.items.push(i(g,F.value||""));break;case 5:F.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(F)),_.items.push(l(g,F.value||""));break;case 4:F.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(F)),_.items.push(a(g,F.value||""));break;case 6:F.value==null&&r(g,ct.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,Er(F)),_.items.push(c(g,F.value||""));break;case 7:{const R=f(g);_.items.push(R.node),M=R.nextConsumeToken||null;break}}}while(k.currentType!==13&&k.currentType!==1);const E=k.currentType===1?k.lastOffset:g.currentOffset(),I=k.currentType===1?k.lastEndLoc:g.currentPosition();return s(_,E,I),_}function h(g,k,w,b){const _=g.context();let M=b.items.length===0;const E=o(1,k,w);E.cases=[],E.cases.push(b);do{const I=p(g);M||(M=I.items.length===0),E.cases.push(I)}while(_.currentType!==13);return M&&r(g,ct.MUST_HAVE_MESSAGES_IN_PLURAL,w,0),s(E,g.currentOffset(),g.currentPosition()),E}function m(g){const k=g.context(),{offset:w,startLoc:b}=k,_=p(g);return k.currentType===13?_:h(g,w,b,_)}function y(g){const k=y9(g,en({},t)),w=k.context(),b=o(0,w.offset,w.startLoc);return e&&b.loc&&(b.loc.source=g),b.body=m(k),t.onCacheKey&&(b.cacheKey=t.onCacheKey(g)),w.currentType!==13&&r(k,ct.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,g[w.offset]||""),s(b,k.currentOffset(),k.currentPosition()),b}return{parse:y}}function Er(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function k9(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:r=>(n.helpers.add(r),r)}}function Cy(t,e){for(let n=0;n<t.length;n++)$h(t[n],e)}function $h(t,e){switch(t.type){case 1:Cy(t.cases,e),e.helper("plural");break;case 2:Cy(t.items,e);break;case 6:{$h(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function _9(t,e={}){const n=k9(t);n.helper("normalize"),t.body&&$h(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function C9(t){const e=t.body;return e.type===2?Ey(e):e.cases.forEach(n=>Ey(n)),t}function Ey(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Dh(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}function qs(t){switch(t.t=t.type,t.type){case 0:{const e=t;qs(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)qs(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)qs(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;qs(e.key),e.k=e.key,delete e.key,e.modifier&&(qs(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}}delete t.type}function E9(t,e){const{filename:n,breakLineCode:r,needIndent:o}=e,s=e.location!==!1,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};s&&t.loc&&(i.source=t.loc.source);const l=()=>i;function a(p,h){i.code+=p}function c(p,h=!0){const m=h?r:"";a(o?m+" ".repeat(p):m)}function u(p=!0){const h=++i.indentLevel;p&&c(h)}function d(p=!0){const h=--i.indentLevel;p&&c(h)}function f(){c(i.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:p=>`_${p}`,needIndent:()=>i.needIndent}}function S9(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),_i(t,e.key),e.modifier?(t.push(", "),_i(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function M9(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const o=e.items.length;for(let s=0;s<o&&(_i(t,e.items[s]),s!==o-1);s++)t.push(", ");t.deindent(r()),t.push("])")}function T9(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const o=e.cases.length;for(let s=0;s<o&&(_i(t,e.cases[s]),s!==o-1);s++)t.push(", ");t.deindent(r()),t.push("])")}}function A9(t,e){e.body?_i(t,e.body):t.push("null")}function _i(t,e){const{helper:n}=t;switch(e.type){case 0:A9(t,e);break;case 1:T9(t,e);break;case 2:M9(t,e);break;case 6:S9(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break}}const L9=(t,e={})=>{const n=Ee(e.mode)?e.mode:"normal",r=Ee(e.filename)?e.filename:"message.intl";e.sourceMap;const o=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
276
- `,s=e.needIndent?e.needIndent:n!=="arrow",i=t.helpers||[],l=E9(t,{filename:r,breakLineCode:o,needIndent:s});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),i.length>0&&(l.push(`const { ${Dh(i.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),_i(l,t),l.deindent(s),l.push("}"),delete t.helpers;const{code:a,map:c}=l.context();return{ast:t,code:a,map:c?c.toJSON():void 0}};function O9(t,e={}){const n=en({},e),r=!!n.jit,o=!!n.minify,s=n.optimize==null?!0:n.optimize,i=x9(n).parse(t);return r?(s&&C9(i),o&&qs(i),{ast:i,code:""}):(_9(i,n),L9(i,n))}/*!
277
- * core-base v11.1.12
278
- * (c) 2025 kazuya kawaguchi
279
- * Released under the MIT License.
280
- */function N9(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hs().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hs().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ir(t){return lt(t)&&Fh(t)===0&&(mr(t,"b")||mr(t,"body"))}const kk=["b","body"];function I9(t){return ts(t,kk)}const _k=["c","cases"];function R9(t){return ts(t,_k,[])}const Ck=["s","static"];function P9(t){return ts(t,Ck)}const Ek=["i","items"];function D9(t){return ts(t,Ek,[])}const Sk=["t","type"];function Fh(t){return ts(t,Sk)}const Mk=["v","value"];function La(t,e){const n=ts(t,Mk);if(n!=null)return n;throw Dl(e)}const Tk=["m","modifier"];function $9(t){return ts(t,Tk)}const Ak=["k","key"];function F9(t){const e=ts(t,Ak);if(e)return e;throw Dl(6)}function ts(t,e,n){for(let r=0;r<e.length;r++){const o=e[r];if(mr(t,o)&&t[o]!=null)return t[o]}return n}const Lk=[...kk,..._k,...Ck,...Ek,...Ak,...Tk,...Mk,...Sk];function Dl(t){return new Error(`unhandled node type: ${t}`)}function Vd(t){return e=>V9(e,t)}function V9(t,e){const n=I9(e);if(n==null)throw Dl(0);if(Fh(n)===1){const r=R9(n);return t.plural(r.reduce((o,s)=>[...o,Sy(t,s)],[]))}else return Sy(t,n)}function Sy(t,e){const n=P9(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=D9(e).reduce((o,s)=>[...o,ip(t,s)],[]);return t.normalize(r)}}function ip(t,e){const n=Fh(e);switch(n){case 3:return La(e,n);case 9:return La(e,n);case 4:{const r=e;if(mr(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(mr(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw Dl(n)}case 5:{const r=e;if(mr(r,"i")&&Jt(r.i))return t.interpolate(t.list(r.i));if(mr(r,"index")&&Jt(r.index))return t.interpolate(t.list(r.index));throw Dl(n)}case 6:{const r=e,o=$9(r),s=F9(r);return t.linked(ip(t,s),o?ip(t,o):void 0,t.type)}case 7:return La(e,n);case 8:return La(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const B9=t=>t;let Oa=mt();function H9(t,e={}){let n=!1;const r=e.onError||d9;return e.onError=o=>{n=!0,r(o)},{...O9(t,e),detectError:n}}function j9(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Ee(t)){tt(e.warnHtmlMessage)&&e.warnHtmlMessage;const n=(e.onCacheKey||B9)(t),r=Oa[n];if(r)return r;const{ast:o,detectError:s}=H9(t,{...e,location:!1,jit:!0}),i=Vd(o);return s?i:Oa[n]=i}else{const n=t.cacheKey;return n?Oa[n]||(Oa[n]=Vd(t)):Vd(t)}}let $l=null;function z9(t){$l=t}function U9(t,e,n){$l&&$l.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const W9=K9("function:translate");function K9(t){return e=>$l&&$l.emit(t,e)}const to={INVALID_ARGUMENT:u9,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},G9=24;function no(t){return Wu(t,null,void 0)}function Vh(t,e){return e.locale!=null?My(e.locale):My(t.locale)}let Bd;function My(t){if(Ee(t))return t;if(At(t)){if(t.resolvedOnce&&Bd!=null)return Bd;if(t.constructor.name==="Function"){const e=t();if(l9(e))throw no(to.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Bd=e}else throw no(to.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw no(to.NOT_SUPPORT_LOCALE_TYPE)}function q9(t,e,n){return[...new Set([n,...Ht(e)?e:lt(e)?Object.keys(e):Ee(e)?[e]:[n]])]}function Ok(t,e,n){const r=Ee(n)?n:Fl,o=t;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(r);if(!s){s=[];let i=[n];for(;Ht(i);)i=Ty(s,i,e);const l=Ht(e)||!qe(e)?e:e.default?e.default:null;i=Ee(l)?[l]:l,Ht(i)&&Ty(s,i,!1),o.__localeChainCache.set(r,s)}return s}function Ty(t,e,n){let r=!0;for(let o=0;o<e.length&&tt(r);o++){const s=e[o];Ee(s)&&(r=J9(t,e[o],n))}return r}function J9(t,e,n){let r;const o=e.split("-");do{const s=o.join("-");r=Y9(t,s,n),o.splice(-1,1)}while(o.length&&r===!0);return r}function Y9(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const o=e.replace(/!/g,"");t.push(o),(Ht(n)||qe(n))&&n[o]&&(r=n[o])}return r}const ns=[];ns[0]={w:[0],i:[3,0],"[":[4],o:[7]};ns[1]={w:[1],".":[2],"[":[4],o:[7]};ns[2]={w:[2],i:[3,0],0:[3,0]};ns[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};ns[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};ns[5]={"'":[4,0],o:8,l:[5,0]};ns[6]={'"':[4,0],o:8,l:[6,0]};const X9=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Z9(t){return X9.test(t)}function Q9(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function ez(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function tz(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:Z9(e)?Q9(e):"*"+e}function nz(t){const e=[];let n=-1,r=0,o=0,s,i,l,a,c,u,d;const f=[];f[0]=()=>{i===void 0?i=l:i+=l},f[1]=()=>{i!==void 0&&(e.push(i),i=void 0)},f[2]=()=>{f[0](),o++},f[3]=()=>{if(o>0)o--,r=4,f[0]();else{if(o=0,i===void 0||(i=tz(i),i===!1))return!1;f[1]()}};function p(){const h=t[n+1];if(r===5&&h==="'"||r===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;r!==null;)if(n++,s=t[n],!(s==="\\"&&p())){if(a=ez(s),d=ns[r],c=d[a]||d.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=s,u()===!1))))return;if(r===7)return e}}const Ay=new Map;function rz(t,e){return lt(t)?t[e]:null}function oz(t,e){if(!lt(t))return null;let n=Ay.get(e);if(n||(n=nz(e),n&&Ay.set(e,n)),!n)return null;const r=n.length;let o=t,s=0;for(;s<r;){const i=n[s];if(Lk.includes(i)&&Ir(o))return null;const l=o[i];if(l===void 0||At(o))return null;o=l,s++}return o}const sz="11.1.12",Ku=-1,Fl="en-US",Ly="",Oy=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function iz(){return{upper:(t,e)=>e==="text"&&Ee(t)?t.toUpperCase():e==="vnode"&&lt(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&Ee(t)?t.toLowerCase():e==="vnode"&&lt(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&Ee(t)?Oy(t):e==="vnode"&&lt(t)&&"__v_isVNode"in t?Oy(t.children):t}}let Nk;function lz(t){Nk=t}let Ik;function az(t){Ik=t}let Rk;function cz(t){Rk=t}let Pk=null;const Ny=t=>{Pk=t},uz=()=>Pk;let Iy=0;function dz(t={}){const e=At(t.onWarn)?t.onWarn:e9,n=Ee(t.version)?t.version:sz,r=Ee(t.locale)||At(t.locale)?t.locale:Fl,o=At(r)?Fl:r,s=Ht(t.fallbackLocale)||qe(t.fallbackLocale)||Ee(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:o,i=qe(t.messages)?t.messages:Hd(o),l=qe(t.datetimeFormats)?t.datetimeFormats:Hd(o),a=qe(t.numberFormats)?t.numberFormats:Hd(o),c=en(mt(),t.modifiers,iz()),u=t.pluralRules||mt(),d=At(t.missing)?t.missing:null,f=tt(t.missingWarn)||ki(t.missingWarn)?t.missingWarn:!0,p=tt(t.fallbackWarn)||ki(t.fallbackWarn)?t.fallbackWarn:!0,h=!!t.fallbackFormat,m=!!t.unresolving,y=At(t.postTranslation)?t.postTranslation:null,g=qe(t.processor)?t.processor:null,k=tt(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter,b=At(t.messageCompiler)?t.messageCompiler:Nk,_=At(t.messageResolver)?t.messageResolver:Ik||rz,M=At(t.localeFallbacker)?t.localeFallbacker:Rk||q9,E=lt(t.fallbackContext)?t.fallbackContext:void 0,I=t,F=lt(I.__datetimeFormatters)?I.__datetimeFormatters:new Map,R=lt(I.__numberFormatters)?I.__numberFormatters:new Map,$=lt(I.__meta)?I.__meta:{};Iy++;const A={version:n,cid:Iy,locale:r,fallbackLocale:s,messages:i,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:m,postTranslation:y,processor:g,warnHtmlMessage:k,escapeParameter:w,messageCompiler:b,messageResolver:_,localeFallbacker:M,fallbackContext:E,onWarn:e,__meta:$};return A.datetimeFormats=l,A.numberFormats=a,A.__datetimeFormatters=F,A.__numberFormatters=R,__INTLIFY_PROD_DEVTOOLS__&&U9(A,n,$),A}const Hd=t=>({[t]:mt()});function Bh(t,e,n,r,o){const{missing:s,onWarn:i}=t;if(s!==null){const l=s(t,n,e,o);return Ee(l)?l:e}else return e}function $i(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function fz(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function pz(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(fz(t,e[r]))return!0;return!1}function Ry(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:i}=t,{__datetimeFormatters:l}=t,[a,c,u,d]=lp(...e),f=tt(u.missingWarn)?u.missingWarn:t.missingWarn;tt(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn;const p=!!u.part,h=Vh(t,u),m=i(t,o,h);if(!Ee(a)||a==="")return new Intl.DateTimeFormat(h,d).format(c);let y={},g,k=null;const w="datetime format";for(let M=0;M<m.length&&(g=m[M],y=n[g]||{},k=y[a],!qe(k));M++)Bh(t,a,g,f,w);if(!qe(k)||!Ee(g))return r?Ku:a;let b=`${g}__${a}`;Uu(d)||(b=`${b}__${JSON.stringify(d)}`);let _=l.get(b);return _||(_=new Intl.DateTimeFormat(g,en({},k,d)),l.set(b,_)),p?_.formatToParts(c):_.format(c)}const Dk=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function lp(...t){const[e,n,r,o]=t,s=mt();let i=mt(),l;if(Ee(e)){const a=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw no(to.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw no(to.INVALID_ISO_DATE_ARGUMENT)}}else if(r9(e)){if(isNaN(e.getTime()))throw no(to.INVALID_DATE_ARGUMENT);l=e}else if(Jt(e))l=e;else throw no(to.INVALID_ARGUMENT);return Ee(n)?s.key=n:qe(n)&&Object.keys(n).forEach(a=>{Dk.includes(a)?i[a]=n[a]:s[a]=n[a]}),Ee(r)?s.locale=r:qe(r)&&(i=r),qe(o)&&(i=o),[s.key||"",l,s,i]}function Py(t,e,n){const r=t;for(const o in n){const s=`${e}__${o}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function Dy(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:i}=t,{__numberFormatters:l}=t,[a,c,u,d]=ap(...e),f=tt(u.missingWarn)?u.missingWarn:t.missingWarn;tt(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn;const p=!!u.part,h=Vh(t,u),m=i(t,o,h);if(!Ee(a)||a==="")return new Intl.NumberFormat(h,d).format(c);let y={},g,k=null;const w="number format";for(let M=0;M<m.length&&(g=m[M],y=n[g]||{},k=y[a],!qe(k));M++)Bh(t,a,g,f,w);if(!qe(k)||!Ee(g))return r?Ku:a;let b=`${g}__${a}`;Uu(d)||(b=`${b}__${JSON.stringify(d)}`);let _=l.get(b);return _||(_=new Intl.NumberFormat(g,en({},k,d)),l.set(b,_)),p?_.formatToParts(c):_.format(c)}const $k=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function ap(...t){const[e,n,r,o]=t,s=mt();let i=mt();if(!Jt(e))throw no(to.INVALID_ARGUMENT);const l=e;return Ee(n)?s.key=n:qe(n)&&Object.keys(n).forEach(a=>{$k.includes(a)?i[a]=n[a]:s[a]=n[a]}),Ee(r)?s.locale=r:qe(r)&&(i=r),qe(o)&&(i=o),[s.key||"",l,s,i]}function $y(t,e,n){const r=t;for(const o in n){const s=`${e}__${o}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}const hz=t=>t,mz=t=>"",gz="text",yz=t=>t.length===0?"":Dh(t),bz=a9;function Fy(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function vz(t){const e=Jt(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Jt(t.named.count)||Jt(t.named.n))?Jt(t.named.count)?t.named.count:Jt(t.named.n)?t.named.n:e:e}function wz(t,e){e.count||(e.count=t),e.n||(e.n=t)}function xz(t={}){const e=t.locale,n=vz(t),r=lt(t.pluralRules)&&Ee(e)&&At(t.pluralRules[e])?t.pluralRules[e]:Fy,o=lt(t.pluralRules)&&Ee(e)&&At(t.pluralRules[e])?Fy:void 0,s=y=>y[r(n,y.length,o)],i=t.list||[],l=y=>i[y],a=t.named||mt();Jt(t.pluralIndex)&&wz(n,a);const c=y=>a[y];function u(y,g){return(At(t.messages)?t.messages(y,!!g):lt(t.messages)?t.messages[y]:!1)||(t.parent?t.parent.message(y):mz)}const d=y=>t.modifiers?t.modifiers[y]:hz,f=qe(t.processor)&&At(t.processor.normalize)?t.processor.normalize:yz,p=qe(t.processor)&&At(t.processor.interpolate)?t.processor.interpolate:bz,h=qe(t.processor)&&Ee(t.processor.type)?t.processor.type:gz,m={list:l,named:c,plural:s,linked:(y,...g)=>{const[k,w]=g;let b="text",_="";g.length===1?lt(k)?(_=k.modifier||_,b=k.type||b):Ee(k)&&(_=k||_):g.length===2&&(Ee(k)&&(_=k||_),Ee(w)&&(b=w||b));const M=u(y,!0)(m),E=b==="vnode"&&Ht(M)&&_?M[0]:M;return _?d(_)(E,b):E},message:u,type:h,interpolate:p,normalize:f,values:en(mt(),i,a)};return m}const Vy=()=>"",ur=t=>At(t);function By(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:s,fallbackLocale:i,messages:l}=t,[a,c]=cp(...e),u=tt(c.missingWarn)?c.missingWarn:t.missingWarn,d=tt(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,f=tt(c.escapeParameter)?c.escapeParameter:t.escapeParameter,p=!!c.resolvedMessage,h=Ee(c.default)||tt(c.default)?tt(c.default)?s?a:()=>a:c.default:n?s?a:()=>a:null,m=n||h!=null&&(Ee(h)||At(h)),y=Vh(t,c);f&&kz(c);let[g,k,w]=p?[a,y,l[y]||mt()]:Fk(t,a,y,i,d,u),b=g,_=a;if(!p&&!(Ee(b)||Ir(b)||ur(b))&&m&&(b=h,_=b),!p&&(!(Ee(b)||Ir(b)||ur(b))||!Ee(k)))return o?Ku:a;let M=!1;const E=()=>{M=!0},I=ur(b)?b:Vk(t,a,k,b,_,E);if(M)return b;const F=Ez(t,k,w,c),R=xz(F),$=_z(t,I,R);let A=r?r($,a):$;if(f&&Ee(A)&&(A=s9(A)),__INTLIFY_PROD_DEVTOOLS__){const q={timestamp:Date.now(),key:Ee(a)?a:ur(b)?b.key:"",locale:k||(ur(b)?b.locale:""),format:Ee(b)?b:ur(b)?b.source:"",message:A};q.meta=en({},t.__meta,{}),W9(q)}return A}function kz(t){Ht(t.list)?t.list=t.list.map(e=>Ee(e)?xy(e):e):lt(t.named)&&Object.keys(t.named).forEach(e=>{Ee(t.named[e])&&(t.named[e]=xy(t.named[e]))})}function Fk(t,e,n,r,o,s){const{messages:i,onWarn:l,messageResolver:a,localeFallbacker:c}=t,u=c(t,r,n);let d=mt(),f,p=null;const h="translate";for(let m=0;m<u.length&&(f=u[m],d=i[f]||mt(),(p=a(d,e))===null&&(p=d[e]),!(Ee(p)||Ir(p)||ur(p)));m++)if(!pz(f,u)){const y=Bh(t,e,f,s,h);y!==e&&(p=y)}return[p,f,d]}function Vk(t,e,n,r,o,s){const{messageCompiler:i,warnHtmlMessage:l}=t;if(ur(r)){const c=r;return c.locale=c.locale||n,c.key=c.key||e,c}if(i==null){const c=()=>r;return c.locale=n,c.key=e,c}const a=i(r,Cz(t,n,o,r,l,s));return a.locale=n,a.key=e,a.source=r,a}function _z(t,e,n){return e(n)}function cp(...t){const[e,n,r]=t,o=mt();if(!Ee(e)&&!Jt(e)&&!ur(e)&&!Ir(e))throw no(to.INVALID_ARGUMENT);const s=Jt(e)?String(e):e;return Jt(n)?o.plural=n:Ee(n)?o.default=n:qe(n)&&!Uu(n)?o.named=n:Ht(n)&&(o.list=n),Jt(r)?o.plural=r:Ee(r)?o.default=r:qe(r)&&en(o,r),[s,o]}function Cz(t,e,n,r,o,s){return{locale:e,key:n,warnHtmlMessage:o,onError:i=>{throw s&&s(i),i},onCacheKey:i=>t9(e,n,i)}}function Ez(t,e,n,r){const{modifiers:o,pluralRules:s,messageResolver:i,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=t,d={locale:e,modifiers:o,pluralRules:s,messages:(f,p)=>{let h=i(n,f);if(h==null&&(u||p)){const[,,m]=Fk(u||t,f,e,l,a,c);h=i(m,f)}if(Ee(h)||Ir(h)){let m=!1;const y=Vk(t,f,e,h,f,()=>{m=!0});return m?Vy:y}else return ur(h)?h:Vy}};return t.processor&&(d.processor=t.processor),r.list&&(d.list=r.list),r.named&&(d.named=r.named),Jt(r.plural)&&(d.pluralIndex=r.plural),d}N9();/*!
281
- * vue-i18n v11.1.12
282
- * (c) 2025 kazuya kawaguchi
283
- * Released under the MIT License.
284
- */const Sz="11.1.12";function Mz(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(hs().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(hs().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hs().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hs().__INTLIFY_PROD_DEVTOOLS__=!1)}const zn={UNEXPECTED_RETURN_TYPE:G9,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function qn(t,...e){return Wu(t,null,void 0)}const up=es("__translateVNode"),dp=es("__datetimeParts"),fp=es("__numberParts"),Bk=es("__setPluralRules"),Hk=es("__injectWithOption"),pp=es("__dispose");function Vl(t){if(!lt(t)||Ir(t))return t;for(const e in t)if(mr(t,e))if(!e.includes("."))lt(t[e])&&Vl(t[e]);else{const n=e.split("."),r=n.length-1;let o=t,s=!1;for(let i=0;i<r;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in o||(o[n[i]]=mt()),!lt(o[n[i]])){s=!0;break}o=o[n[i]]}if(s||(Ir(o)?Lk.includes(n[r])||delete t[e]:(o[n[r]]=t[e],delete t[e])),!Ir(o)){const i=o[n[r]];lt(i)&&Vl(i)}}return t}function Hh(t,e){const{messages:n,__i18n:r,messageResolver:o,flatJson:s}=e,i=qe(n)?n:Ht(r)?mt():{[t]:mt()};if(Ht(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(i[a]=i[a]||mt(),Ka(c,i[a])):Ka(c,i)}else Ee(l)&&Ka(JSON.parse(l),i)}),o==null&&s)for(const l in i)mr(i,l)&&Vl(i[l]);return i}function Tz(t){return t.type}function jk(t,e,n){let r=lt(e.messages)?e.messages:mt();"__i18nGlobal"in n&&(r=Hh(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(lt(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(i=>{t.mergeDateTimeFormat(i,e.datetimeFormats[i])})}if(lt(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(i=>{t.mergeNumberFormat(i,e.numberFormats[i])})}}}function Hy(t){return ce(ro,null,t,0)}const jy=()=>[],Az=()=>!1;let zy=0;function Uy(t){return(e,n,r,o)=>t(n,r,St()||void 0,o)}function jh(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,o=t.flatJson,s=ru?Q:Hl;let i=tt(t.inheritLocale)?t.inheritLocale:!0;const l=s(e&&i?e.locale.value:Ee(t.locale)?t.locale:Fl),a=s(e&&i?e.fallbackLocale.value:Ee(t.fallbackLocale)||Ht(t.fallbackLocale)||qe(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:l.value),c=s(Hh(l.value,t)),u=s(qe(t.datetimeFormats)?t.datetimeFormats:{[l.value]:{}}),d=s(qe(t.numberFormats)?t.numberFormats:{[l.value]:{}});let f=e?e.missingWarn:tt(t.missingWarn)||ki(t.missingWarn)?t.missingWarn:!0,p=e?e.fallbackWarn:tt(t.fallbackWarn)||ki(t.fallbackWarn)?t.fallbackWarn:!0,h=e?e.fallbackRoot:tt(t.fallbackRoot)?t.fallbackRoot:!0,m=!!t.fallbackFormat,y=At(t.missing)?t.missing:null,g=At(t.missing)?Uy(t.missing):null,k=At(t.postTranslation)?t.postTranslation:null,w=e?e.warnHtmlMessage:tt(t.warnHtmlMessage)?t.warnHtmlMessage:!0,b=!!t.escapeParameter;const _=e?e.modifiers:qe(t.modifiers)?t.modifiers:{};let M=t.pluralRules||e&&e.pluralRules,E;E=(()=>{r&&Ny(null);const D={version:Sz,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:_,pluralRules:M,missing:g===null?void 0:g,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:!0,postTranslation:k===null?void 0:k,warnHtmlMessage:w,escapeParameter:b,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};D.datetimeFormats=u.value,D.numberFormats=d.value,D.__datetimeFormatters=qe(E)?E.__datetimeFormatters:void 0,D.__numberFormatters=qe(E)?E.__numberFormatters:void 0;const z=dz(D);return r&&Ny(z),z})(),$i(E,l.value,a.value);function I(){return[l.value,a.value,c.value,u.value,d.value]}const F=te({get:()=>l.value,set:D=>{E.locale=D,l.value=D}}),R=te({get:()=>a.value,set:D=>{E.fallbackLocale=D,a.value=D,$i(E,l.value,D)}}),$=te(()=>c.value),A=te(()=>u.value),q=te(()=>d.value);function Y(){return At(k)?k:null}function Z(D){k=D,E.postTranslation=D}function K(){return y}function X(D){D!==null&&(g=Uy(D)),y=D,E.missing=g}const G=(D,z,V,W,he,Ce)=>{I();let De;try{__INTLIFY_PROD_DEVTOOLS__,r||(E.fallbackContext=e?uz():void 0),De=D(E)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(E.fallbackContext=void 0)}if(V!=="translate exists"&&Jt(De)&&De===Ku||V==="translate exists"&&!De){const[P,j]=z();return e&&h?W(e):he(P)}else{if(Ce(De))return De;throw qn(zn.UNEXPECTED_RETURN_TYPE)}};function ne(...D){return G(z=>Reflect.apply(By,null,[z,...D]),()=>cp(...D),"translate",z=>Reflect.apply(z.t,z,[...D]),z=>z,z=>Ee(z))}function Le(...D){const[z,V,W]=D;if(W&&!lt(W))throw qn(zn.INVALID_ARGUMENT);return ne(z,V,en({resolvedMessage:!0},W||{}))}function je(...D){return G(z=>Reflect.apply(Ry,null,[z,...D]),()=>lp(...D),"datetime format",z=>Reflect.apply(z.d,z,[...D]),()=>Ly,z=>Ee(z)||Ht(z))}function Be(...D){return G(z=>Reflect.apply(Dy,null,[z,...D]),()=>ap(...D),"number format",z=>Reflect.apply(z.n,z,[...D]),()=>Ly,z=>Ee(z)||Ht(z))}function Dt(D){return D.map(z=>Ee(z)||Jt(z)||tt(z)?Hy(String(z)):z)}const Ze={normalize:Dt,interpolate:D=>D,type:"vnode"};function Pt(...D){return G(z=>{let V;const W=z;try{W.processor=Ze,V=Reflect.apply(By,null,[W,...D])}finally{W.processor=null}return V},()=>cp(...D),"translate",z=>z[up](...D),z=>[Hy(z)],z=>Ht(z))}function vt(...D){return G(z=>Reflect.apply(Dy,null,[z,...D]),()=>ap(...D),"number format",z=>z[fp](...D),jy,z=>Ee(z)||Ht(z))}function oe(...D){return G(z=>Reflect.apply(Ry,null,[z,...D]),()=>lp(...D),"datetime format",z=>z[dp](...D),jy,z=>Ee(z)||Ht(z))}function be(D){M=D,E.pluralRules=M}function ye(D,z){return G(()=>{if(!D)return!1;const V=Ee(z)?z:l.value,W=Ue(V),he=E.messageResolver(W,D);return Ir(he)||ur(he)||Ee(he)},()=>[D],"translate exists",V=>Reflect.apply(V.te,V,[D,z]),Az,V=>tt(V))}function xe(D){let z=null;const V=Ok(E,a.value,l.value);for(let W=0;W<V.length;W++){const he=c.value[V[W]]||{},Ce=E.messageResolver(he,D);if(Ce!=null){z=Ce;break}}return z}function Ve(D){return xe(D)??(e?e.tm(D)||{}:{})}function Ue(D){return c.value[D]||{}}function O(D,z){if(o){const V={[D]:z};for(const W in V)mr(V,W)&&Vl(V[W]);z=V[D]}c.value[D]=z,E.messages=c.value}function B(D,z){c.value[D]=c.value[D]||{};const V={[D]:z};if(o)for(const W in V)mr(V,W)&&Vl(V[W]);z=V[D],Ka(z,c.value[D]),E.messages=c.value}function J(D){return u.value[D]||{}}function ie(D,z){u.value[D]=z,E.datetimeFormats=u.value,Py(E,D,z)}function re(D,z){u.value[D]=en(u.value[D]||{},z),E.datetimeFormats=u.value,Py(E,D,z)}function x(D){return d.value[D]||{}}function C(D,z){d.value[D]=z,E.numberFormats=d.value,$y(E,D,z)}function N(D,z){d.value[D]=en(d.value[D]||{},z),E.numberFormats=d.value,$y(E,D,z)}zy++,e&&ru&&(Re(e.locale,D=>{i&&(l.value=D,E.locale=D,$i(E,l.value,a.value))}),Re(e.fallbackLocale,D=>{i&&(a.value=D,E.fallbackLocale=D,$i(E,l.value,a.value))}));const H={id:zy,locale:F,fallbackLocale:R,get inheritLocale(){return i},set inheritLocale(D){i=D,D&&e&&(l.value=e.locale.value,a.value=e.fallbackLocale.value,$i(E,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:$,get modifiers(){return _},get pluralRules(){return M||{}},get isGlobal(){return r},get missingWarn(){return f},set missingWarn(D){f=D,E.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(D){p=D,E.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(D){h=D},get fallbackFormat(){return m},set fallbackFormat(D){m=D,E.fallbackFormat=m},get warnHtmlMessage(){return w},set warnHtmlMessage(D){w=D,E.warnHtmlMessage=D},get escapeParameter(){return b},set escapeParameter(D){b=D,E.escapeParameter=D},t:ne,getLocaleMessage:Ue,setLocaleMessage:O,mergeLocaleMessage:B,getPostTranslationHandler:Y,setPostTranslationHandler:Z,getMissingHandler:K,setMissingHandler:X,[Bk]:be};return H.datetimeFormats=A,H.numberFormats=q,H.rt=Le,H.te=ye,H.tm=Ve,H.d=je,H.n=Be,H.getDateTimeFormat=J,H.setDateTimeFormat=ie,H.mergeDateTimeFormat=re,H.getNumberFormat=x,H.setNumberFormat=C,H.mergeNumberFormat=N,H[Hk]=n,H[up]=Pt,H[dp]=oe,H[fp]=vt,H}function Lz(t){const e=Ee(t.locale)?t.locale:Fl,n=Ee(t.fallbackLocale)||Ht(t.fallbackLocale)||qe(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=At(t.missing)?t.missing:void 0,o=tt(t.silentTranslationWarn)||ki(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=tt(t.silentFallbackWarn)||ki(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,i=tt(t.fallbackRoot)?t.fallbackRoot:!0,l=!!t.formatFallbackMessages,a=qe(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,u=At(t.postTranslation)?t.postTranslation:void 0,d=Ee(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,f=!!t.escapeParameterHtml,p=tt(t.sync)?t.sync:!0;let h=t.messages;if(qe(t.sharedMessages)){const _=t.sharedMessages;h=Object.keys(_).reduce((M,E)=>{const I=M[E]||(M[E]={});return en(I,_[E]),M},h||{})}const{__i18n:m,__root:y,__injectWithOption:g}=t,k=t.datetimeFormats,w=t.numberFormats,b=t.flatJson;return{locale:e,fallbackLocale:n,messages:h,flatJson:b,datetimeFormats:k,numberFormats:w,missing:r,missingWarn:o,fallbackWarn:s,fallbackRoot:i,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:t.messageResolver,inheritLocale:p,__i18n:m,__root:y,__injectWithOption:g}}function hp(t={}){const e=jh(Lz(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(o){e.locale.value=o},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(o){e.fallbackLocale.value=o},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(o){e.setMissingHandler(o)},get silentTranslationWarn(){return tt(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(o){e.missingWarn=tt(o)?!o:o},get silentFallbackWarn(){return tt(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(o){e.fallbackWarn=tt(o)?!o:o},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(o){e.fallbackFormat=o},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(o){e.setPostTranslationHandler(o)},get sync(){return e.inheritLocale},set sync(o){e.inheritLocale=o},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){e.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(o){e.escapeParameter=o},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...o){return Reflect.apply(e.t,e,[...o])},rt(...o){return Reflect.apply(e.rt,e,[...o])},te(o,s){return e.te(o,s)},tm(o){return e.tm(o)},getLocaleMessage(o){return e.getLocaleMessage(o)},setLocaleMessage(o,s){e.setLocaleMessage(o,s)},mergeLocaleMessage(o,s){e.mergeLocaleMessage(o,s)},d(...o){return Reflect.apply(e.d,e,[...o])},getDateTimeFormat(o){return e.getDateTimeFormat(o)},setDateTimeFormat(o,s){e.setDateTimeFormat(o,s)},mergeDateTimeFormat(o,s){e.mergeDateTimeFormat(o,s)},n(...o){return Reflect.apply(e.n,e,[...o])},getNumberFormat(o){return e.getNumberFormat(o)},setNumberFormat(o,s){e.setNumberFormat(o,s)},mergeNumberFormat(o,s){e.mergeNumberFormat(o,s)}};return r.__extender=n,r}function Oz(t,e,n){return{beforeCreate(){const r=St();if(!r)throw qn(zn.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=e,this===this.$root)this.$i18n=Wy(t,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=hp(s);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Wy(t,o);else{this.$i18n=hp({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;o.__i18nGlobal&&jk(e,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,i)=>this.$i18n.te(s,i),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=St();if(!r)throw qn(zn.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(r),delete this.$i18n}}}function Wy(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[Bk](e.pluralizationRules||t.pluralizationRules);const n=Hh(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const zh={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function Nz({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((n,r)=>[...n,...r.type===Me?r.children:[r]],[]):e.reduce((n,r)=>{const o=t[r];return o&&(n[r]=o()),n},mt())}function zk(){return Me}const Iz=_e({name:"i18n-t",props:en({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Jt(t)||!isNaN(t)}},zh),setup(t,e){const{slots:n,attrs:r}=e,o=t.i18n||Uh({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(d=>d[0]!=="_"),i=mt();t.locale&&(i.locale=t.locale),t.plural!==void 0&&(i.plural=Ee(t.plural)?+t.plural:t.plural);const l=Nz(e,s),a=o[up](t.keypath,l,i),c=en(mt(),r),u=Ee(t.tag)||lt(t.tag)?t.tag:zk();return Bn(u,c,a)}}}),Ky=Iz;function Rz(t){return Ht(t)&&!Ee(t[0])}function Uk(t,e,n,r){const{slots:o,attrs:s}=e;return()=>{const i={part:!0};let l=mt();t.locale&&(i.locale=t.locale),Ee(t.format)?i.key=t.format:lt(t.format)&&(Ee(t.format.key)&&(i.key=t.format.key),l=Object.keys(t.format).reduce((f,p)=>n.includes(p)?en(mt(),f,{[p]:t.format[p]}):f,mt()));const a=r(t.value,i,l);let c=[i.key];Ht(a)?c=a.map((f,p)=>{const h=o[f.type],m=h?h({[f.type]:f.value,index:p,parts:a}):[f.value];return Rz(m)&&(m[0].key=`${f.type}-${p}`),m}):Ee(a)&&(c=[a]);const u=en(mt(),s),d=Ee(t.tag)||lt(t.tag)?t.tag:zk();return Bn(d,u,c)}}const Pz=_e({name:"i18n-n",props:en({value:{type:Number,required:!0},format:{type:[String,Object]}},zh),setup(t,e){const n=t.i18n||Uh({useScope:t.scope,__useComponent:!0});return Uk(t,e,$k,(...r)=>n[fp](...r))}}),Gy=Pz;function Dz(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function $z(t){const e=n=>{const{instance:r,value:o}=n;if(!r||!r.$)throw qn(zn.UNEXPECTED_ERROR);const s=Dz(t,r.$),i=qy(o);return[Reflect.apply(s.t,s,[...Jy(i)]),s]};return{created:(n,r)=>{const[o,s]=e(r);ru&&t.global===s&&(n.__i18nWatcher=Re(s.locale,()=>{r.instance&&r.instance.$forceUpdate()})),n.__composer=s,n.textContent=o},unmounted:n=>{ru&&n.__i18nWatcher&&(n.__i18nWatcher(),n.__i18nWatcher=void 0,delete n.__i18nWatcher),n.__composer&&(n.__composer=void 0,delete n.__composer)},beforeUpdate:(n,{value:r})=>{if(n.__composer){const o=n.__composer,s=qy(r);n.textContent=Reflect.apply(o.t,o,[...Jy(s)])}},getSSRProps:n=>{const[r]=e(n);return{textContent:r}}}}function qy(t){if(Ee(t))return{path:t};if(qe(t)){if(!("path"in t))throw qn(zn.REQUIRED_VALUE,"path");return t}else throw qn(zn.INVALID_VALUE)}function Jy(t){const{path:e,locale:n,args:r,choice:o,plural:s}=t,i={},l=r||{};return Ee(n)&&(i.locale=n),Jt(o)&&(i.plural=o),Jt(s)&&(i.plural=s),[e,l,i]}function Fz(t,e,...n){const r=qe(n[0])?n[0]:{};(!tt(r.globalInstall)||r.globalInstall)&&([Ky.name,"I18nT"].forEach(o=>t.component(o,Ky)),[Gy.name,"I18nN"].forEach(o=>t.component(o,Gy)),[Xy.name,"I18nD"].forEach(o=>t.component(o,Xy))),t.directive("t",$z(e))}const Vz=es("global-vue-i18n");function Bz(t={}){const e=__VUE_I18N_LEGACY_API__&&tt(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,n=tt(t.globalInjection)?t.globalInjection:!0,r=new Map,[o,s]=Hz(t,e),i=es("");function l(d){return r.get(d)||null}function a(d,f){r.set(d,f)}function c(d){r.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=i,d.provide(d.__VUE_I18N_SYMBOL__,u),qe(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let p=null;!e&&n&&(p=Jz(d,u.global)),__VUE_I18N_FULL_INSTALL__&&Fz(d,u,...f),__VUE_I18N_LEGACY_API__&&e&&d.mixin(Oz(s,s.__composer,u));const h=d.unmount;d.unmount=()=>{p&&p(),u.dispose(),h()}},get global(){return s},dispose(){o.stop()},__instances:r,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Uh(t={}){const e=St();if(e==null)throw qn(zn.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw qn(zn.NOT_INSTALLED);const n=jz(e),r=Uz(n),o=Tz(e),s=zz(t,o);if(s==="global")return jk(r,t,o),r;if(s==="parent"){let a=Wz(n,e,t.__useComponent);return a==null&&(a=r),a}const i=n;let l=i.__getInstance(e);if(l==null){const a=en({},t);"__i18n"in o&&(a.__i18n=o.__i18n),r&&(a.__root=r),l=jh(a),i.__composerExtend&&(l[pp]=i.__composerExtend(l)),Gz(i,e,l),i.__setInstance(e,l)}return l}function Hz(t,e){const n=sb(),r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>hp(t)):n.run(()=>jh(t));if(r==null)throw qn(zn.UNEXPECTED_ERROR);return[n,r]}function jz(t){const e=Wt(t.isCE?Vz:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw qn(t.isCE?zn.NOT_INSTALLED_WITH_PROVIDE:zn.UNEXPECTED_ERROR);return e}function zz(t,e){return Uu(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function Uz(t){return t.mode==="composition"?t.global:t.global.__composer}function Wz(t,e,n=!1){let r=null;const o=e.root;let s=Kz(e,n);for(;s!=null;){const i=t;if(t.mode==="composition")r=i.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const l=i.__getInstance(s);l!=null&&(r=l.__composer,n&&r&&!r[Hk]&&(r=null))}if(r!=null||o===s)break;s=s.parent}return r}function Kz(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function Gz(t,e,n){rt(()=>{},e),gn(()=>{const r=n;t.__deleteInstance(e);const o=r[pp];o&&(o(),delete r[pp])},e)}const qz=["locale","fallbackLocale","availableLocales"],Yy=["t","rt","d","n","tm","te"];function Jz(t,e){const n=Object.create(null);return qz.forEach(r=>{const o=Object.getOwnPropertyDescriptor(e,r);if(!o)throw qn(zn.UNEXPECTED_ERROR);const s=Ut(o.value)?{get(){return o.value.value},set(i){o.value.value=i}}:{get(){return o.get&&o.get()}};Object.defineProperty(n,r,s)}),t.config.globalProperties.$i18n=n,Yy.forEach(r=>{const o=Object.getOwnPropertyDescriptor(e,r);if(!o||!o.value)throw qn(zn.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${r}`,o)}),()=>{delete t.config.globalProperties.$i18n,Yy.forEach(r=>{delete t.config.globalProperties[`$${r}`]})}}const Yz=_e({name:"i18n-d",props:en({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},zh),setup(t,e){const n=t.i18n||Uh({useScope:t.scope,__useComponent:!0});return Uk(t,e,Dk,(...r)=>n[dp](...r))}}),Xy=Yz;Mz();lz(j9);az(oz);cz(Ok);if(__INTLIFY_PROD_DEVTOOLS__){const t=hs();t.__INTLIFY__=!0,z9(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Xz={},Zz={},Qz="Paragraph",eU="Heading 1",tU="Heading 2",nU="Heading 3",rU="Heading 4",oU="Heading 5",sU="Heading 6",iU="Create Table",lU="Add Column",aU="Add Row",cU="Delete Column",uU="Delete Row",dU="Delete Table",fU="Enter Link",pU="Create",hU="Cancel",mU={paragraph:Qz,heading1:eU,heading2:tU,heading3:nU,heading4:rU,heading5:oU,heading6:sU,createTable:iU,addColumn:lU,addRow:aU,deleteColumn:cU,deleteRow:uU,deleteTable:dU,linkTitle:fU,create:pU,cancel:hU},gU="Звичайний текст",yU="Заголовок 1",bU="Заголовок 2",vU="Заголовок 3",wU="Заголовок 4",xU="Заголовок 5",kU="Заголовок 6",_U="Створити таблицю",CU="Додати колонку",EU="Додати рядок",SU="Видалити колонку",MU="Видалити рядок",TU="Видалити таблицю",AU="Введіть посилання",LU="Створити",OU="Скасувати",NU={paragraph:gU,heading1:yU,heading2:bU,heading3:vU,heading4:wU,heading5:xU,heading6:kU,createTable:_U,addColumn:CU,addRow:EU,deleteColumn:SU,deleteRow:MU,deleteTable:TU,linkTitle:AU,create:LU,cancel:OU},jd=Bz({legacy:!1,locale:"uk",fallbackLocale:"en",messages:{en:{...Xz,tiptap:mU},uk:{...Zz,tiptap:NU}}}),IU={install:(t,e={})=>{var n,r,o,s;if(e.i18nConfig){const i=e.i18nConfig,l=((r=(n=jd.global)==null?void 0:n.messages)==null?void 0:r.value)||jd.messages;l&&((s=(o=i.global)==null?void 0:o.messages)!=null&&s.value)&&Object.keys(l).forEach(a=>{i.global.mergeLocaleMessage?i.global.mergeLocaleMessage(a,l[a]):i.global.setLocaleMessage(a,l[a])})}else t.use(jd);t.component("vs-richtext",vy),t.component("vs-richtext-md",vy),t.component("vs-richtext-page",Q7)}},Wk=rS({history:OE(),routes:[{path:"/",name:"dashboard",component:()=>ot(()=>import("./Dashboard-Bs7sXO6h.js"),__vite__mapDeps([0,1,2,3,4])),meta:{title:"dashboard.title"}},{path:"/settings/collections",name:"collections",component:()=>ot(()=>import("./BuilderPage-CCeSMVWe.js"),__vite__mapDeps([5,6,7,1,8,9,2,10,11,12,4,13,14,15,16,17,18])),meta:{title:"builder.collections"}},{path:"/settings/collections/edit/:id",name:"editCollection",component:()=>ot(()=>import("./EditCollectionPage-gPuLJrN8.js"),__vite__mapDeps([19,20,7,6,1,4,21,10,16,3,22,11,12,23,15,18,24])),meta:{title:"builder.editCollection"}},{path:"/collections",name:"collectionsList",component:()=>ot(()=>import("./CollectionsPage-CHk8Cn5k.js"),__vite__mapDeps([25,26,6,18,10,15])),meta:{title:"navigation.collections"}},{path:"/collections/:id",name:"articles",component:()=>ot(()=>import("./ArticlesPage-D6B3cZsl.js"),__vite__mapDeps([27,9,2,10,11,12,4,13,14,15,7,6,28,26,29,1,3])),meta:{title:"articles.title"}},{path:"/collections/:collection/create",name:"createArticle",component:()=>ot(()=>import("./contentForm-unZQhjCu.js"),__vite__mapDeps([30,22,6,7,11,12,1,21,4,23,10,15,18,16,24,29,31])),meta:{title:"articles.createArticle",type:"articles"}},{path:"/collections/:collection/:id",name:"editArticle",component:()=>ot(()=>import("./contentForm-unZQhjCu.js"),__vite__mapDeps([30,22,6,7,11,12,1,21,4,23,10,15,18,16,24,29,31])),meta:{title:"articles.title",type:"articles"}},{path:"/singletons",name:"singletons",component:()=>ot(()=>import("./SingletonsPage-Bn2Ypjhs.js"),__vite__mapDeps([32,9,2,10,11,12,4,13,14,15,18])),meta:{title:"singletons.title"}},{path:"/singletons/create",name:"createSingleton",component:()=>ot(()=>import("./contentForm-unZQhjCu.js"),__vite__mapDeps([30,22,6,7,11,12,1,21,4,23,10,15,18,16,24,29,31])),meta:{title:"singletons.createSingleton",type:"single"}},{path:"/singletons/:id",name:"editSingleton",component:()=>ot(()=>import("./contentForm-unZQhjCu.js"),__vite__mapDeps([30,22,6,7,11,12,1,21,4,23,10,15,18,16,24,29,31])),meta:{title:"singletons.title",type:"single"}},{path:"/menu",name:"singletonsMenu",component:()=>ot(()=>import("./MenuPage-C00m4Fc_.js"),__vite__mapDeps([33,9,2,10,11,12,4,28,6,1])),meta:{title:"menu.title"}},{path:"/menu/:id",name:"editSingletonMenu",component:()=>ot(()=>import("./MenuItemPage-B2otXqkz.js"),__vite__mapDeps([34,21,11,12,35,6,7,20,1,31])),meta:{title:"menu.editMenu",type:"single"}},{path:"/menu/create",name:"createSingletonMenu",component:()=>ot(()=>import("./MenuAddPage-BLcoVgrS.js"),__vite__mapDeps([36,20,6,7,31])),meta:{title:"menu.menuAdd",type:"single"}},{path:"/feedback",name:"feedback",component:()=>ot(()=>import("./FeedbackPage-DtaOncVv.js"),__vite__mapDeps([37,38,28,6,39])),meta:{title:"feedback.title"}},{path:"/email",name:"email",component:()=>ot(()=>import("./EmailPage-DhlWsPxk.js"),__vite__mapDeps([40,38,28,6,39])),meta:{title:"email.title"}},{path:"/tags",name:"tags",component:()=>ot(()=>import("./TagsPage-DAiakEth.js"),__vite__mapDeps([41,9,2,10,11,12,4,13,14,15,26,7,6,1])),meta:{title:"tags.title"}},{path:"/users",name:"users",component:()=>ot(()=>import("./UsersPage-CDGreEib.js"),__vite__mapDeps([42,6,26,9,2,10,11,12,4,1])),meta:{title:"users.title"}},{path:"/users/edit/:id",name:"editUser",component:()=>ot(()=>import("./AddUser-CX-McfRW.js"),__vite__mapDeps([43,7,6])),meta:{title:"users.editUser"}},{path:"/users/create",name:"createUser",component:()=>ot(()=>import("./AddUser-CX-McfRW.js"),__vite__mapDeps([43,7,6])),meta:{title:"users.createUser"}},{path:"/media",name:"media",component:()=>ot(()=>import("./MediaPage-DqRcZFlO.js"),__vite__mapDeps([44,23,6,10,12,15,1,3,7,28,8,18,16])),meta:{title:"media.title"}},{path:"/settings",name:"settings",component:()=>ot(()=>import("./Settings-BHH6RoBP.js"),__vite__mapDeps([])),meta:{title:"settings.title"}},{path:"/settings/users",name:"settingsUsers",component:()=>ot(()=>import("./Users-CMH5j0db.js"),__vite__mapDeps([45,38,46,6])),meta:{title:"settings.users.users"}},{path:"/settings/general",name:"general",component:()=>ot(()=>import("./general-CkN_0qIV.js"),__vite__mapDeps([47,38,46,6,7,31])),meta:{title:"settings.general.general"}},{path:"/settings/api-keys",name:"apiKeys",component:()=>ot(()=>import("./ApiKeys-DSv1exYv.js"),__vite__mapDeps([48,38,46,2])),meta:{title:"settings.api-keys.apiKeys"}},{path:"/settings/appearance",name:"appearance",component:()=>ot(()=>import("./Appearance-DDtOUvCV.js"),__vite__mapDeps([49,38,46])),meta:{title:"settings.appearance.appearance"}},{path:"/settings/logs",name:"logs",component:()=>ot(()=>import("./Logs-CZ5klHNK.js"),__vite__mapDeps([50,38,28,6,39,14,15])),meta:{title:"settings.logs.title"}},{path:"/settings/permissions",name:"permissions",component:()=>ot(()=>import("./PermissionsPage-LtqcCJ14.js"),__vite__mapDeps([51,6,17,1,18,35])),meta:{title:"settings.permissions.title"}}]});Wk.afterEach(t=>{const e=Uo.global.t,n="CMS";document.title=t.meta&&typeof t.meta.title=="string"?e(t.meta.title):n});const Zl=gl(iA);Zl.use(Wk);Zl.use(Uo);Zl.use(IU,{i18nConfig:Uo});Zl.config.globalProperties.$settings={locale:"uk",locales:["en","uk"]};AT().then(()=>{Zl.mount("#app")});export{o_ as $,te as A,nt as B,jt as C,It as D,yt as E,jC as F,uo as G,zC as H,WC as I,_u as J,BC as K,KC as L,QC as M,zt as N,Io as O,FC as P,vu as Q,jo as R,pt as S,Is as T,eE as U,ao as V,vp as W,bu as X,RC as Y,VC as Z,UT as _,T as a,or as a$,W2 as a0,Fb as a1,Gt as a2,NW as a3,ob as a4,WU as a5,SW as a6,nW as a7,Ja as a8,oi as a9,cW as aA,iW as aB,RW as aC,uW as aD,MW as aE,PU as aF,sb as aG,St as aH,a2 as aI,zU as aJ,Ep as aK,Bn as aL,Ei as aM,yW as aN,FW as aO,XU as aP,eW as aQ,QU as aR,ZU as aS,_W as aT,VW as aU,Y_ as aV,_p as aW,gs as aX,Vo as aY,Ut as aZ,kW as a_,vW as aa,ro as ab,HU as ac,Rs as ad,$W as ae,jU as af,Dp as ag,UU as ah,vr as ai,jl as aj,_n as ak,lu as al,lo as am,OW as an,gl as ao,S_ as ap,mW as aq,E_ as ar,DC as as,oW as at,Sb as au,tW as av,vC as aw,lW as ax,aW as ay,dW as az,v as b,qU as b$,Ho as b0,_b as b1,hW as b2,t_ as b3,zb as b4,n_ as b5,a_ as b6,l_ as b7,i_ as b8,RU as b9,Qe as bA,I2 as bB,BU as bC,VU as bD,wW as bE,FU as bF,d_ as bG,DW as bH,IW as bI,xC as bJ,JU as bK,A_ as bL,PW as bM,pW as bN,YU as bO,$b as bP,$p as bQ,wu as bR,AC as bS,X_ as bT,EW as bU,sv as bV,bW,L_ as bX,gW as bY,fW as bZ,CW as b_,s_ as ba,gn as bb,Mp as bc,D2 as bd,GU as be,Eb as bf,KU as bg,ec as bh,Ns as bi,kb as bj,xW as bk,PC as bl,rW as bm,LW as bn,pl as bo,ic as bp,TW as bq,Bo as br,xb as bs,$U as bt,Hl as bu,T_ as bv,AW as bw,DU as bx,Na as by,sW as bz,an as c,XC as c0,Dv as c1,ot as c2,Pv as c3,_e as d,me as e,ce as f,xn as g,Ae as h,Cn as i,Me as j,Je as k,BW as l,Q as m,ae as n,S as o,rt as p,Wt as q,yr as r,tn as s,we as t,Kl as u,pe as v,Ke as w,mn as x,Vn as y,Re as z};
285
- function __vite__mapDeps(indexes) {
286
- if (!__vite__mapDeps.viteFileDeps) {
287
- __vite__mapDeps.viteFileDeps = ["assets/Dashboard-Bs7sXO6h.js","assets/plus-DLR44m6p.js","assets/eye-Dijywc6g.js","assets/calendar-o9t4MkD2.js","assets/square-pen-xVs4e8Yb.js","assets/BuilderPage-CCeSMVWe.js","assets/index-DGweaj24.js","assets/index-DCW2e4Az.js","assets/useDebounce-DFq3rxAW.js","assets/UniversalTable.vue_vue_type_script_setup_true_lang-BQ5m4aZd.js","assets/file-B_duymIT.js","assets/pencil-CwnPP4IJ.js","assets/trash-2-BGXMNU3d.js","assets/UniversalTablePagination.vue_vue_type_script_setup_true_lang-DppVBws0.js","assets/chevron-left-WFftVS9c.js","assets/chevron-right-BiiSb3Be.js","assets/list-CXRbSNky.js","assets/vue.-sixQ7xP-CUPNuJcq.js","assets/search-C4-fHihx.js","assets/EditCollectionPage-gPuLJrN8.js","assets/MonacoEditor.vue_vue_type_script_setup_true_lang-CjoEsC67.js","assets/vuedraggable.umd-W_2WTF6i.js","assets/vs-form-reletion-link-C-xrdHDl.js","assets/MediaBreadcrumb-BpOxt5PK.js","assets/vs-form-reletion-link-bk-9ZkDH.css","assets/CollectionsPage-CHk8Cn5k.js","assets/EmptyData-Ct-xQv_N.js","assets/ArticlesPage-D6B3cZsl.js","assets/index-BIp7eSXk.js","assets/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-DVYVfYF4.js","assets/contentForm-unZQhjCu.js","assets/save-FeDrOUOd.js","assets/SingletonsPage-Bn2Ypjhs.js","assets/MenuPage-C00m4Fc_.js","assets/MenuItemPage-B2otXqkz.js","assets/x-D2t-wfBe.js","assets/MenuAddPage-BLcoVgrS.js","assets/FeedbackPage-DtaOncVv.js","assets/SettingsTitle-t4WJBFxZ.js","assets/arrow-up-DCe0WsrM.js","assets/EmailPage-DhlWsPxk.js","assets/TagsPage-DAiakEth.js","assets/UsersPage-CDGreEib.js","assets/AddUser-CX-McfRW.js","assets/MediaPage-DqRcZFlO.js","assets/Users-CMH5j0db.js","assets/SettingsTable-CY5pZx1z.js","assets/general-CkN_0qIV.js","assets/ApiKeys-DSv1exYv.js","assets/Appearance-DDtOUvCV.js","assets/Logs-CZ5klHNK.js","assets/PermissionsPage-LtqcCJ14.js"]
288
- }
289
- return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
290
- }