@romainbx/wpic-components 0.0.53 → 0.0.55

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.
@@ -1,20 +1,20 @@
1
- (function(Dn,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(Dn=typeof globalThis<"u"?globalThis:Dn||self,c(Dn.WpicComponents={},Dn.Vue))})(this,function(Dn,c){"use strict";function Rg(){return cd().__VUE_DEVTOOLS_GLOBAL_HOOK__}function cd(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Lg=typeof Proxy=="function",Fg="devtools-plugin:setup",zg="plugin:settings:set";let Dr,ma;function jg(){var t;return Dr!==void 0||(typeof window<"u"&&window.performance?(Dr=!0,ma=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(Dr=!0,ma=globalThis.perf_hooks.performance):Dr=!1),Dr}function Hg(){return jg()?ma.now():Date.now()}class Wg{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const s in e.settings){const a=e.settings[s];r[s]=a.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},r);try{const s=localStorage.getItem(i),a=JSON.parse(s);Object.assign(o,a)}catch{}this.fallbacks={getSettings(){return o},setSettings(s){try{localStorage.setItem(i,JSON.stringify(s))}catch{}o=s},now(){return Hg()}},n&&n.on(zg,(s,a)=>{s===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(s,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(s,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(d=>{this.targetQueue.push({method:a,args:l,resolve:d})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function Yg(t,e){const n=t,r=cd(),i=Rg(),o=Lg&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))i.emit(Fg,t,e);else{const s=o?new Wg(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:s}),s&&e(s.proxiedTarget)}}/**
1
+ (function(Gt,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(Gt=typeof globalThis<"u"?globalThis:Gt||self,c(Gt.WpicComponents={},Gt.Vue))})(this,function(Gt,c){"use strict";function jh(){return na().__VUE_DEVTOOLS_GLOBAL_HOOK__}function na(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Hh=typeof Proxy=="function",Wh="devtools-plugin:setup",qh="plugin:settings:set";let Hn,Po;function Uh(){var t;return Hn!==void 0||(typeof window<"u"&&window.performance?(Hn=!0,Po=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(Hn=!0,Po=globalThis.perf_hooks.performance):Hn=!1),Hn}function Kh(){return Uh()?Po.now():Date.now()}class Jh{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const s in e.settings){const l=e.settings[s];r[s]=l.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},r);try{const s=localStorage.getItem(i),l=JSON.parse(s);Object.assign(o,l)}catch{}this.fallbacks={getSettings(){return o},setSettings(s){try{localStorage.setItem(i,JSON.stringify(s))}catch{}o=s},now(){return Kh()}},n&&n.on(qh,(s,l)=>{s===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(s,l)=>this.target?this.target.on[l]:(...a)=>{this.onQueue.push({method:l,args:a})}}),this.proxiedTarget=new Proxy({},{get:(s,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...a)=>(this.targetQueue.push({method:l,args:a,resolve:()=>{}}),this.fallbacks[l](...a)):(...a)=>new Promise(d=>{this.targetQueue.push({method:l,args:a,resolve:d})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function Gh(t,e){const n=t,r=na(),i=jh(),o=Hh&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))i.emit(Wh,t,e);else{const s=o?new Jh(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:s}),s&&e(s.proxiedTarget)}}/**
2
2
  * vee-validate v4.12.8
3
3
  * (c) 2024 Abdelrahman Awad
4
4
  * @license MIT
5
- */function $e(t){return typeof t=="function"}function dd(t){return t==null}const An=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function ga(t){return Number(t)>=0}function Ug(t){const e=parseFloat(t);return isNaN(e)?t:e}function qg(t){return typeof t=="object"&&t!==null}function Gg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ud(t){if(!qg(t)||Gg(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ni(t,e){return Object.keys(e).forEach(n=>{if(ud(e[n])&&ud(t[n])){t[n]||(t[n]={}),Ni(t[n],e[n]);return}t[n]=e[n]}),t}function Di(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(ga(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const fd={};function At(t,e){Jg(t,e),fd[t]=e}function Kg(t){return fd[t]}function Jg(t,e){if(!$e(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function hd(t,e,n){typeof n.value=="object"&&(n.value=ye(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function ye(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(ye(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,a){i.set(ye(a),ye(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(ye(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)hd(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||hd(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Ai=Symbol("vee-validate-form"),pd=Symbol("vee-validate-field-instance"),Bo=Symbol("Default empty value"),Zg=typeof window<"u";function ya(t){return $e(t)&&!!t.__locatorRef}function $t(t){return!!t&&$e(t.parse)&&t.__type==="VVTypedSchema"}function Vo(t){return!!t&&$e(t.validate)}function $i(t){return t==="checkbox"||t==="radio"}function Xg(t){return An(t)||Array.isArray(t)}function Qg(t){return Array.isArray(t)?t.length===0:An(t)&&Object.keys(t).length===0}function Po(t){return/^\[.+\]$/i.test(t)}function e0(t){return md(t)&&t.multiple}function md(t){return t.tagName==="SELECT"}function t0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function n0(t,e){return!t0(t,e)&&e.type!=="file"&&!$i(e.type)}function gd(t){return ba(t)&&t.target&&"submit"in t.target}function ba(t){return t?!!(typeof Event<"u"&&$e(Event)&&t instanceof Event||t&&t.srcElement):!1}function yd(t,e){return e in t&&t[e]!==Bo}function Je(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!Je(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!Je(r[1],e.get(r[0])))return!1;return!0}if(bd(t)&&bd(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!Je(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function bd(t){return Zg?t instanceof File:!1}function ka(t){return Po(t)?t.replace(/\[|\]/gi,""):t}function it(t,e,n){return t?Po(e)?t[ka(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>Xg(i)&&o in i?i[o]:n,t):n}function fn(t,e,n){if(Po(e)){t[ka(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||dd(i[r[o]]))&&(i[r[o]]=ga(r[o+1])?[]:{}),i=i[r[o]]}}function wa(t,e){if(Array.isArray(t)&&ga(e)){t.splice(Number(e),1);return}An(t)&&delete t[e]}function kd(t,e){if(Po(e)){delete t[ka(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){wa(r,n[o]);break}if(!(n[o]in r)||dd(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>it(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Qg(i[o])){if(o===0){wa(t,n[0]);continue}wa(i[o-1],n[o-1])}}function ot(t){return Object.keys(t)}function va(t,e=void 0){const n=c.getCurrentInstance();return(n==null?void 0:n.provides[t])||c.inject(t,e)}function wd(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>Je(o,e));return i>=0?r.splice(i,1):r.push(e),r}return Je(t,e)?n:e}function r0(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function vd(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function i0(t,e){return An(e)&&e.number?Ug(t):t}function xa(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function Sa(t){return Array.isArray(t)?t:t?[t]:[]}function Io(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function o0(t){let e=null,n=[];return function(...r){const i=c.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function Ca(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function Ma(t){if(xd(t))return t._value}function xd(t){return"_value"in t}function s0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Ro(t){if(!ba(t))return t;const e=t.target;if($i(e.type)&&xd(e))return Ma(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(e0(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Ma);if(md(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Ma(n):e.value}return s0(e)}function Sd(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?An(t)&&t._$$isNormalized?t:An(t)?Object.keys(t).reduce((n,r)=>{const i=a0(t[r]);return t[r]!==!1&&(n[r]=Cd(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=l0(r);return i.name&&(n[i.name]=Cd(i.params)),n},e):e}function a0(t){return t===!0?[]:Array.isArray(t)||An(t)?t:[t]}function Cd(t){const e=n=>typeof n=="string"&&n[0]==="@"?c0(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const l0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function c0(t){const e=n=>it(n,t)||n[t];return e.__locatorRef=t,e}function d0(t){return Array.isArray(t)?t.filter(ya):ot(t).filter(e=>ya(t[e])).map(e=>t[e])}let u0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const ir=()=>u0;async function Md(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await f0(i,t)).errors;return{errors:s,valid:!s.length}}async function f0(t,e){if($t(t.rules)||Vo(t.rules))return p0(e,t.rules);if($e(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},a=Array.isArray(t.rules)?t.rules:[t.rules],l=a.length,d=[];for(let u=0;u<l;u++){const f=a[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:Td(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Sd(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const a=i[s],l=await m0(n,e,{name:a,params:n.rules[a]});if(l.error&&(r.push(l.error),t.bails))return{errors:r}}return{errors:r}}function h0(t){return!!t&&t.name==="ValidationError"}function Od(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!h0(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,a)=>{const l=a.path||"";return s[l]||(s[l]={errors:[],path:l}),s[l].errors.push(...a.errors),s},{});return{errors:Object.values(o)}}}}}async function p0(t,e){const r=await($t(e)?e:Od(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function m0(t,e,n){const r=Kg(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=g0(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:Td(o)}}function Td(t){const e=ir().generateMessage;return e?e(t):"Field is invalid"}function g0(t,e){const n=r=>ya(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function y0(t,e){const r=await($t(t)?t:Od(t)).parse(ye(e)),i={},o={};for(const s of r.errors){const a=s.errors,l=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[l]={valid:!a.length,errors:a},a.length&&(o[l]=a[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function b0(t,e,n){const i=ot(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Md(it(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),a={},l={};for(const d of s)a[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,l[d.path]=d.errors[0]);return{valid:o,results:a,errors:l}}let Ed=0;function k0(t,e){const{value:n,initialValue:r,setInitialValue:i}=w0(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:l,setErrors:d}=S0(),u=Ed>=Number.MAX_SAFE_INTEGER?0:++Ed,f=x0(n,r,l,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:l,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=c.computed(()=>o.errors);function a(l){var d,u,f;"value"in l&&(n.value=l.value),"errors"in l&&((d=e.form)===null||d===void 0||d.setFieldError(c.unref(t),l.errors)),"touched"in l&&((u=e.form)===null||u===void 0||u.setFieldTouched(c.unref(t),(f=l.touched)!==null&&f!==void 0?f:!1)),"initialValue"in l&&i(l.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:a}}function w0(t,e,n){const r=c.ref(c.unref(e));function i(){return n?it(n.initialValues.value,c.unref(t),c.unref(r)):c.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(c.unref(t),d,!0)}const s=c.computed(i);if(!n)return{value:c.ref(i()),initialValue:s,setInitialValue:o};const a=v0(e,n,s,t);return n.stageInitialValue(c.unref(t),a,!0),{value:c.computed({get(){return it(n.values,c.unref(t))},set(d){n.setFieldValue(c.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function v0(t,e,n,r){return c.isRef(t)?c.unref(t):t!==void 0?t:it(e.values,c.unref(r),c.unref(n))}function x0(t,e,n,r){const i=c.computed(()=>{var s,a,l;return(l=(a=(s=c.toValue(r))===null||s===void 0?void 0:s.describe)===null||a===void 0?void 0:a.call(s).required)!==null&&l!==void 0?l:!1}),o=c.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!c.unref(n).length,initialValue:c.computed(()=>c.unref(e)),dirty:c.computed(()=>!Je(c.unref(t),c.unref(e)))});return c.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function S0(){const t=c.ref([]);return{errors:t,setErrors:e=>{t.value=Sa(e)}}}function _d(t){process.env.NODE_ENV!=="production"&&Yg({id:"vee-validate-devtools-plugin",label:"VeeValidate Plugin",packageName:"vee-validate",homepage:"https://vee-validate.logaretm.com/v4",app:t,logo:"https://vee-validate.logaretm.com/v4/logo.png"},O0)}const Bi={},Vi={};let hn;const Ar=r0(()=>{setTimeout(async()=>{await c.nextTick(),hn==null||hn.sendInspectorState($r),hn==null||hn.sendInspectorTree($r)},100)},100);function C0(t){const e=c.getCurrentInstance();if(!hn){const n=e==null?void 0:e.appContext.app;if(!n)return;_d(n)}Bi[t.formId]=Object.assign({},t),Bi[t.formId]._vm=e,c.onUnmounted(()=>{delete Bi[t.formId],Ar()}),Ar()}function M0(t){const e=c.getCurrentInstance();if(!hn){const n=e==null?void 0:e.appContext.app;if(!n)return;_d(n)}Vi[t.id]=Object.assign({},t),Vi[t.id]._vm=e,c.onUnmounted(()=>{delete Vi[t.id],Ar()}),Ar()}const $r="vee-validate-inspector",st={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let Ee=null;function O0(t){hn=t,t.addInspector({id:$r,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!Ee){console.error("There is not a valid selected vee-validate node or component");return}if(Ee.type==="field"){await Ee.field.validate();return}if(Ee.type==="form"){await Ee.form.validate();return}Ee.type==="pathState"&&await Ee.form.validateField(Ee.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!Ee){console.error("There is not a valid selected vee-validate node or component");return}if(Ee.type==="field"){Ee.field.resetField();return}Ee.type==="form"&&Ee.form.resetForm(),Ee.type==="pathState"&&Ee.form.resetField(Ee.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==$r)return;const n=Object.values(Bi),r=Object.values(Vi);e.rootNodes=[...n.map(T0),...r.map(i=>_0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==$r||n.currentTab!==`custom-inspector:${$r}`)return;const{form:r,field:i,state:o,type:s}=N0(e.nodeId);if(r&&s==="form"){e.state=D0(r),Ee={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Dd(o),Ee={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Dd({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),Ee={field:i,type:"field"};return}Ee=null})}function T0(t){const{textColor:e,bgColor:n}=Ad(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{fn(r,c.unref(s.path),E0(s,t))});function i(s,a=[]){const l=[...a].pop();return"id"in s?Object.assign(Object.assign({},s),{label:l||s.label}):An(s)?{id:`${a.join(".")}`,label:l||"",children:Object.keys(s).map(d=>i(s[d],[...a,d]))}:Array.isArray(s)?{id:`${a.join(".")}`,label:`${l}[]`,children:s.map((d,u)=>i(d,[...a,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:Oa(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:st.white,backgroundColor:st.unknown}]}}function E0(t,e){return{id:Oa(e,t),label:c.unref(t.path),tags:Nd(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function _0(t,e){return{id:Oa(e,t),label:c.unref(t.name),tags:Nd(!1,1,t.type,t.meta.valid,e)}}function Nd(t,e,n,r,i){const{textColor:o,bgColor:s}=Ad(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:st.black,backgroundColor:st.gray},n==="checkbox"?{label:"Checkbox",textColor:st.white,backgroundColor:st.blue}:void 0,n==="radio"?{label:"Radio",textColor:st.white,backgroundColor:st.purple}:void 0,t?{label:"Multiple",textColor:st.black,backgroundColor:st.orange}:void 0].filter(Boolean)}function Oa(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:c.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function N0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Bi[e.f];if(!n&&e.ff){const i=Vi[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function Dd(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function D0(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:ot(e.value).reduce((a,l)=>{var d;const u=(d=e.value[l])===null||d===void 0?void 0:d[0];return u&&(a[l]=u),a},{})}]}}function Ad(t){return{bgColor:t?st.success:st.error,textColor:t?st.black:st.white}}function A0(t,e,n){return $i(n==null?void 0:n.type)?B0(t,e,n):$d(t,e,n)}function $d(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:a,label:l,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=$0(n),g=f?va(Ai):void 0,y=m||g,w=c.computed(()=>Di(c.toValue(t))),v=c.computed(()=>{if(c.toValue(y==null?void 0:y.schema))return;const ne=c.unref(e);return Vo(ne)||$t(ne)||$e(ne)||Array.isArray(ne)?ne:Sd(ne)}),T=!$e(v.value)&&$t(c.toValue(e)),{id:b,value:S,initialValue:k,meta:C,setState:_,errors:N,flags:L}=k0(w,{modelValue:r,form:y,bails:o,label:l,type:s,validate:v.value?R:void 0,schema:T?e:void 0}),Z=c.computed(()=>N.value[0]);p&&V0({value:S,prop:p,handleChange:D,shouldValidate:()=>d&&!L.pendingReset});const j=(z,ne=!1)=>{C.touched=!0,ne&&I()};async function A(z){var ne,me;if(y!=null&&y.validateSchema){const{results:ce}=await y.validateSchema(z);return(ne=ce[c.toValue(w)])!==null&&ne!==void 0?ne:{valid:!0,errors:[]}}return v.value?Md(S.value,v.value,{name:c.toValue(w),label:c.toValue(l),values:(me=y==null?void 0:y.values)!==null&&me!==void 0?me:{},bails:o}):{valid:!0,errors:[]}}const I=xa(async()=>(C.pending=!0,C.validated=!0,A("validated-only")),z=>(L.pendingUnmount[Se.id]||(_({errors:z.errors}),C.pending=!1,C.valid=z.valid),z)),F=xa(async()=>A("silent"),z=>(C.valid=z.valid,z));function R(z){return(z==null?void 0:z.mode)==="silent"?F():I()}function D(z,ne=!0){const me=Ro(z);Ke(me,ne)}c.onMounted(()=>{if(i)return I();(!y||!y.validateSchema)&&F()});function J(z){C.touched=z}function pe(z){var ne;const me=z&&"value"in z?z.value:k.value;_({value:ye(me),initialValue:ye(me),touched:(ne=z==null?void 0:z.touched)!==null&&ne!==void 0?ne:!1,errors:(z==null?void 0:z.errors)||[]}),C.pending=!1,C.validated=!1,F()}const We=c.getCurrentInstance();function Ke(z,ne=!0){S.value=We&&p?i0(z,We.props.modelModifiers):z,(ne?I:F)()}function kt(z){_({errors:Array.isArray(z)?z:[z]})}const wt=c.computed({get(){return S.value},set(z){Ke(z,d)}}),Se={id:b,name:w,label:l,value:wt,meta:C,errors:N,errorMessage:Z,type:s,checkedValue:a,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:pe,handleReset:()=>pe(),validate:R,handleChange:D,handleBlur:j,setState:_,setTouched:J,setErrors:kt,setValue:Ke};if(c.provide(pd,Se),c.isRef(e)&&typeof c.unref(e)!="function"&&c.watch(e,(z,ne)=>{Je(z,ne)||(C.validated?I():F())},{deep:!0}),process.env.NODE_ENV!=="production"&&(Se._vm=c.getCurrentInstance(),c.watch(()=>Object.assign(Object.assign({errors:N.value},C),{value:S.value}),Ar,{deep:!0}),y||M0(Se)),!y)return Se;const nt=c.computed(()=>{const z=v.value;return!z||$e(z)||Vo(z)||$t(z)||Array.isArray(z)?{}:Object.keys(z).reduce((ne,me)=>{const ce=d0(z[me]).map(Re=>Re.__locatorRef).reduce((Re,Le)=>{const ut=it(y.values,Le)||y.values[Le];return ut!==void 0&&(Re[Le]=ut),Re},{});return Object.assign(ne,ce),ne},{})});return c.watch(nt,(z,ne)=>{if(!Object.keys(z).length)return;!Je(z,ne)&&(C.validated?I():F())}),c.onBeforeUnmount(()=>{var z;const ne=(z=c.toValue(Se.keepValueOnUnmount))!==null&&z!==void 0?z:c.toValue(y.keepValuesOnUnmount),me=c.toValue(w);if(ne||!y||L.pendingUnmount[Se.id]){y==null||y.removePathState(me,b);return}L.pendingUnmount[Se.id]=!0;const ce=y.getPathState(me);if(Array.isArray(ce==null?void 0:ce.id)&&(ce!=null&&ce.multiple)?ce!=null&&ce.id.includes(Se.id):(ce==null?void 0:ce.id)===Se.id){if(ce!=null&&ce.multiple&&Array.isArray(ce.value)){const Le=ce.value.findIndex(ut=>Je(ut,c.toValue(Se.checkedValue)));if(Le>-1){const ut=[...ce.value];ut.splice(Le,1),y.setFieldValue(me,ut)}Array.isArray(ce.id)&&ce.id.splice(ce.id.indexOf(Se.id),1)}else y.unsetPathValue(c.toValue(w));y.removePathState(me,b)}}),Se}function $0(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?Ta(c.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,a=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:a})}function B0(t,e,n){const r=n!=null&&n.standalone?void 0:va(Ai),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(a){const l=a.handleChange,d=c.computed(()=>{const f=c.toValue(a.value),h=c.toValue(i);return Array.isArray(f)?f.findIndex(p=>Je(p,h))>=0:Je(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&a.validate();return}const g=c.toValue(t),y=r==null?void 0:r.getPathState(g),w=Ro(f);let v=(m=c.toValue(i))!==null&&m!==void 0?m:w;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?v=wd(it(r.values,g)||[],v,void 0):(n==null?void 0:n.type)==="checkbox"&&(v=wd(c.toValue(a.value),v,c.toValue(o))),l(v,h)}return Object.assign(Object.assign({},a),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s($d(t,e,n))}function V0({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=c.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(c.watch(e,a=>{Je(a,Ta(i,o))||i.emit(s,a)}),c.watch(()=>Ta(i,o),a=>{if(a===Bo&&e.value===void 0)return;const l=a===Bo?void 0:a;Je(l,e.value)||n(l,r())}))}function Ta(t,e){if(t)return t.props[e]}const P0=c.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>ir().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Bo},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=c.toRef(t,"rules"),r=c.toRef(t,"name"),i=c.toRef(t,"label"),o=c.toRef(t,"uncheckedValue"),s=c.toRef(t,"keepValue"),{errors:a,value:l,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:w,setErrors:v}=A0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:R0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),T=function(N,L=!0){f(N,L)},b=c.computed(()=>{const{validateOnInput:_,validateOnChange:N,validateOnBlur:L,validateOnModelUpdate:Z}=I0(t);function j(R){h(R,L),$e(e.attrs.onBlur)&&e.attrs.onBlur(R)}function A(R){T(R,_),$e(e.attrs.onInput)&&e.attrs.onInput(R)}function I(R){T(R,N),$e(e.attrs.onChange)&&e.attrs.onChange(R)}const F={name:t.name,onBlur:j,onInput:A,onChange:I};return F["onUpdate:modelValue"]=R=>T(R,Z),F}),S=c.computed(()=>{const _=Object.assign({},b.value);$i(e.attrs.type)&&w&&(_.checked=w.value);const N=Bd(t,e);return n0(N,e.attrs)&&(_.value=l.value),_}),k=c.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:l.value}));function C(){return{field:S.value,componentField:k.value,value:l.value,meta:y,errors:a.value,errorMessage:d.value,validate:u,resetField:m,handleChange:T,handleInput:_=>T(_,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:v}}return e.expose({value:l,meta:y,errors:a,errorMessage:d,setErrors:v,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const _=c.resolveDynamicComponent(Bd(t,e)),N=Ca(_,e,C);return _?c.h(_,Object.assign(Object.assign({},e.attrs),S.value),N):N}}});function Bd(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function I0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:a,validateOnModelUpdate:l}=ir();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:a,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:l}}function R0(t,e){return $i(e.attrs.type)?yd(t,"modelValue")?t.modelValue:void 0:yd(t,"modelValue")?t.modelValue:e.attrs.value}const Pi=P0;let L0=0;const Lo=["bails","fieldsCount","id","multiple","type","validate"];function Vd(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},c.toValue(e)),r=c.unref(t==null?void 0:t.validationSchema);return r&&$t(r)&&$e(r.cast)?ye(r.cast(n)||{}):ye(n)}function F0(t){var e;const n=L0++;let r=0;const i=c.ref(!1),o=c.ref(!1),s=c.ref(0),a=[],l=c.reactive(Vd(t)),d=c.ref([]),u=c.ref({}),f=c.ref({}),h=o0(()=>{f.value=d.value.reduce((O,M)=>(O[Di(c.toValue(M.path))]=M,O),{})});function p(O,M){const $=R(O);if(!$){typeof O=="string"&&(u.value[Di(O)]=Sa(M));return}if(typeof O=="string"){const W=Di(O);u.value[W]&&delete u.value[W]}$.errors=Sa(M),$.valid=!$.errors.length}function m(O){ot(O).forEach(M=>{p(M,O[M])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=c.computed(()=>{const O=d.value.reduce((M,$)=>($.errors.length&&(M[$.path]=$.errors),M),{});return Object.assign(Object.assign({},u.value),O)}),y=c.computed(()=>ot(g.value).reduce((O,M)=>{const $=g.value[M];return $!=null&&$.length&&(O[M]=$[0]),O},{})),w=c.computed(()=>d.value.reduce((O,M)=>(O[M.path]={name:M.path||"",label:M.label||""},O),{})),v=c.computed(()=>d.value.reduce((O,M)=>{var $;return O[M.path]=($=M.bails)!==null&&$!==void 0?$:!0,O},{})),T=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:S,originalInitialValues:k,setInitialValues:C}=j0(d,l,t),_=z0(d,l,k,y),N=c.computed(()=>d.value.reduce((O,M)=>{const $=it(l,M.path);return fn(O,M.path,$),O},{})),L=t==null?void 0:t.validationSchema;function Z(O,M){var $,W;const ee=c.computed(()=>it(S.value,c.toValue(O))),x=f.value[c.toValue(O)],V=(M==null?void 0:M.type)==="checkbox"||(M==null?void 0:M.type)==="radio";if(x&&V){x.multiple=!0;const rt=r++;return Array.isArray(x.id)?x.id.push(rt):x.id=[x.id,rt],x.fieldsCount++,x.__flags.pendingUnmount[rt]=!1,x}const Y=c.computed(()=>it(l,c.toValue(O))),X=c.toValue(O),te=J.findIndex(rt=>rt===X);te!==-1&&J.splice(te,1);const oe=c.computed(()=>{var rt,vt,Nr,rr;const un=c.toValue(L);if($t(un))return(vt=(rt=un.describe)===null||rt===void 0?void 0:rt.call(un,c.toValue(O)).required)!==null&&vt!==void 0?vt:!1;const $o=c.toValue(M==null?void 0:M.schema);return $t($o)&&(rr=(Nr=$o.describe)===null||Nr===void 0?void 0:Nr.call($o).required)!==null&&rr!==void 0?rr:!1}),ge=r++,Te=c.reactive({id:ge,path:O,touched:!1,pending:!1,valid:!0,validated:!!(!(($=T[X])===null||$===void 0)&&$.length),required:oe,initialValue:ee,errors:c.shallowRef([]),bails:(W=M==null?void 0:M.bails)!==null&&W!==void 0?W:!1,label:M==null?void 0:M.label,type:(M==null?void 0:M.type)||"default",value:Y,multiple:!1,__flags:{pendingUnmount:{[ge]:!1},pendingReset:!1},fieldsCount:1,validate:M==null?void 0:M.validate,dirty:c.computed(()=>!Je(c.unref(Y),c.unref(ee)))});return d.value.push(Te),f.value[X]=Te,h(),y.value[X]&&!T[X]&&c.nextTick(()=>{Nt(X,{mode:"silent"})}),c.isRef(O)&&c.watch(O,rt=>{h();const vt=ye(Y.value);f.value[rt]=Te,c.nextTick(()=>{fn(l,rt,vt)})}),Te}const j=vd(dn,5),A=vd(dn,5),I=xa(async O=>await(O==="silent"?j():A()),(O,[M])=>{const $=ot(z.errorBag.value),ee=[...new Set([...ot(O.results),...d.value.map(x=>x.path),...$])].sort().reduce((x,V)=>{var Y;const X=V,te=R(X)||D(X),oe=((Y=O.results[X])===null||Y===void 0?void 0:Y.errors)||[],ge=c.toValue(te==null?void 0:te.path)||X,Te=H0({errors:oe,valid:!oe.length},x.results[ge]);return x.results[ge]=Te,Te.valid||(x.errors[ge]=Te.errors[0]),te&&u.value[ge]&&delete u.value[ge],te?(te.valid=Te.valid,M==="silent"||M==="validated-only"&&!te.validated||p(te,Te.errors),x):(p(ge,oe),x)},{valid:O.valid,results:{},errors:{}});return O.values&&(ee.values=O.values),ot(ee.results).forEach(x=>{var V;const Y=R(x);Y&&M!=="silent"&&(M==="validated-only"&&!Y.validated||p(Y,(V=ee.results[x])===null||V===void 0?void 0:V.errors))}),ee});function F(O){d.value.forEach(O)}function R(O){const M=typeof O=="string"?Di(O):O;return typeof M=="string"?f.value[M]:M}function D(O){return d.value.filter($=>O.startsWith($.path)).reduce(($,W)=>$?W.path.length>$.path.length?W:$:W,void 0)}let J=[],pe;function We(O){return J.push(O),pe||(pe=c.nextTick(()=>{[...J].sort().reverse().forEach($=>{kd(l,$)}),J=[],pe=null})),pe}function Ke(O){return function($,W){return function(x){return x instanceof Event&&(x.preventDefault(),x.stopPropagation()),F(V=>V.touched=!0),i.value=!0,s.value++,Wt().then(V=>{const Y=ye(l);if(V.valid&&typeof $=="function"){const X=ye(N.value);let te=O?X:Y;return V.values&&(te=V.values),$(te,{evt:x,controlledValues:X,setErrors:m,setFieldError:p,setTouched:er,setFieldTouched:Le,setValues:ce,setFieldValue:ne,resetForm:_n,resetField:tr})}!V.valid&&typeof W=="function"&&W({values:Y,evt:x,errors:V.errors,results:V.results})}).then(V=>(i.value=!1,V),V=>{throw i.value=!1,V})}}}const wt=Ke(!1);wt.withControlled=Ke(!0);function Se(O,M){const $=d.value.findIndex(ee=>ee.path===O&&(Array.isArray(ee.id)?ee.id.includes(M):ee.id===M)),W=d.value[$];if(!($===-1||!W)){if(c.nextTick(()=>{Nt(O,{mode:"silent",warn:!1})}),W.multiple&&W.fieldsCount&&W.fieldsCount--,Array.isArray(W.id)){const ee=W.id.indexOf(M);ee>=0&&W.id.splice(ee,1),delete W.__flags.pendingUnmount[M]}(!W.multiple||W.fieldsCount<=0)&&(d.value.splice($,1),Dt(O),h(),delete f.value[O])}}function nt(O){ot(f.value).forEach(M=>{M.startsWith(O)&&delete f.value[M]}),d.value=d.value.filter(M=>!M.path.startsWith(O)),c.nextTick(()=>{h()})}const z={formId:n,values:l,controlledValues:N,errorBag:g,errors:y,schema:L,submitCount:s,meta:_,isSubmitting:i,isValidating:o,fieldArrays:a,keepValuesOnUnmount:b,validateSchema:c.unref(L)?I:void 0,validate:Wt,setFieldError:p,validateField:Nt,setFieldValue:ne,setValues:ce,setErrors:m,setFieldTouched:Le,setTouched:er,resetForm:_n,resetField:tr,handleSubmit:wt,useFieldModel:Ti,defineInputBinds:Ei,defineComponentBinds:_i,defineField:nr,stageInitialValue:cn,unsetInitialValue:Dt,setFieldInitialValue:Nn,createPathState:Z,getPathState:R,unsetPathValue:We,removePathState:Se,initialValues:S,getAllPathStates:()=>d.value,destroyPath:nt,isFieldTouched:ut,isFieldDirty:Er,isFieldValid:Oi};function ne(O,M,$=!0){const W=ye(M),ee=typeof O=="string"?O:O.path;R(ee)||Z(ee),fn(l,ee,W),$&&Nt(ee)}function me(O,M=!0){ot(l).forEach($=>{delete l[$]}),ot(O).forEach($=>{ne($,O[$],!1)}),M&&Wt()}function ce(O,M=!0){Ni(l,O),a.forEach($=>$&&$.reset()),M&&Wt()}function Re(O,M){const $=R(c.toValue(O))||Z(O);return c.computed({get(){return $.value},set(W){var ee;const x=c.toValue(O);ne(x,W,(ee=c.toValue(M))!==null&&ee!==void 0?ee:!1)}})}function Le(O,M){const $=R(O);$&&($.touched=M)}function ut(O){const M=R(O);return M?M.touched:d.value.filter($=>$.path.startsWith(O)).some($=>$.touched)}function Er(O){const M=R(O);return M?M.dirty:d.value.filter($=>$.path.startsWith(O)).some($=>$.dirty)}function Oi(O){const M=R(O);return M?M.valid:d.value.filter($=>$.path.startsWith(O)).every($=>$.valid)}function er(O){if(typeof O=="boolean"){F(M=>{M.touched=O});return}ot(O).forEach(M=>{Le(M,!!O[M])})}function tr(O,M){var $;const W=M&&"value"in M?M.value:it(S.value,O),ee=R(O);ee&&(ee.__flags.pendingReset=!0),Nn(O,ye(W),!0),ne(O,W,!1),Le(O,($=M==null?void 0:M.touched)!==null&&$!==void 0?$:!1),p(O,(M==null?void 0:M.errors)||[]),c.nextTick(()=>{ee&&(ee.__flags.pendingReset=!1)})}function _n(O,M){let $=ye(O!=null&&O.values?O.values:k.value);$=M!=null&&M.force?$:Ni(k.value,$),$=$t(L)&&$e(L.cast)?L.cast($):$,C($),F(W=>{var ee;W.__flags.pendingReset=!0,W.validated=!1,W.touched=((ee=O==null?void 0:O.touched)===null||ee===void 0?void 0:ee[W.path])||!1,ne(W.path,it($,W.path),!1),p(W.path,void 0)}),M!=null&&M.force?me($,!1):ce($,!1),m((O==null?void 0:O.errors)||{}),s.value=(O==null?void 0:O.submitCount)||0,c.nextTick(()=>{Wt({mode:"silent"}),F(W=>{W.__flags.pendingReset=!1})})}async function Wt(O){const M=(O==null?void 0:O.mode)||"force";if(M==="force"&&F(x=>x.validated=!0),z.validateSchema)return z.validateSchema(M);o.value=!0;const $=await Promise.all(d.value.map(x=>x.validate?x.validate(O).then(V=>({key:x.path,valid:V.valid,errors:V.errors})):Promise.resolve({key:x.path,valid:!0,errors:[]})));o.value=!1;const W={},ee={};for(const x of $)W[x.key]={valid:x.valid,errors:x.errors},x.errors.length&&(ee[x.key]=x.errors[0]);return{valid:$.every(x=>x.valid),results:W,errors:ee}}async function Nt(O,M){var $;const W=R(O);if(W&&(M==null?void 0:M.mode)!=="silent"&&(W.validated=!0),L){const{results:x}=await I((M==null?void 0:M.mode)||"validated-only");return x[O]||{errors:[],valid:!0}}return W!=null&&W.validate?W.validate(M):(!W&&(($=M==null?void 0:M.warn)!==null&&$!==void 0?$:!0)&&process.env.NODE_ENV!=="production"&&c.warn(`field with path ${O} was not found`),Promise.resolve({errors:[],valid:!0}))}function Dt(O){kd(S.value,O)}function cn(O,M,$=!1){Nn(O,M),fn(l,O,M),$&&!(t!=null&&t.initialValues)&&fn(k.value,O,ye(M))}function Nn(O,M,$=!1){fn(S.value,O,ye(M)),$&&fn(k.value,O,ye(M))}async function dn(){const O=c.unref(L);if(!O)return{valid:!0,results:{},errors:{}};o.value=!0;const M=Vo(O)||$t(O)?await y0(O,l):await b0(O,l,{names:w.value,bailsMap:v.value});return o.value=!1,M}const _r=wt((O,{evt:M})=>{gd(M)&&M.target.submit()});c.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&er(t.initialTouched),t!=null&&t.validateOnMount){Wt();return}z.validateSchema&&z.validateSchema("silent")}),c.isRef(L)&&c.watch(L,()=>{var O;(O=z.validateSchema)===null||O===void 0||O.call(z,"validated-only")}),c.provide(Ai,z),process.env.NODE_ENV!=="production"&&(C0(z),c.watch(()=>Object.assign(Object.assign({errors:g.value},_.value),{values:l,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Ar,{deep:!0}));function nr(O,M){const $=$e(M)||M==null?void 0:M.label,W=R(c.toValue(O))||Z(O,{label:$}),ee=()=>$e(M)?M(Io(W,Lo)):M||{};function x(){var oe;W.touched=!0,((oe=ee().validateOnBlur)!==null&&oe!==void 0?oe:ir().validateOnBlur)&&Nt(W.path)}function V(){var oe;((oe=ee().validateOnInput)!==null&&oe!==void 0?oe:ir().validateOnInput)&&c.nextTick(()=>{Nt(W.path)})}function Y(){var oe;((oe=ee().validateOnChange)!==null&&oe!==void 0?oe:ir().validateOnChange)&&c.nextTick(()=>{Nt(W.path)})}const X=c.computed(()=>{const oe={onChange:Y,onInput:V,onBlur:x};return $e(M)?Object.assign(Object.assign({},oe),M(Io(W,Lo)).props||{}):M!=null&&M.props?Object.assign(Object.assign({},oe),M.props(Io(W,Lo))):oe});return[Re(O,()=>{var oe,ge,Te;return(Te=(oe=ee().validateOnModelUpdate)!==null&&oe!==void 0?oe:(ge=ir())===null||ge===void 0?void 0:ge.validateOnModelUpdate)!==null&&Te!==void 0?Te:!0}),X]}function Ti(O){return Array.isArray(O)?O.map(M=>Re(M,!0)):Re(O)}function Ei(O,M){const[$,W]=nr(O,M);function ee(){W.value.onBlur()}function x(Y){const X=Ro(Y);ne(c.toValue(O),X,!1),W.value.onInput()}function V(Y){const X=Ro(Y);ne(c.toValue(O),X,!1),W.value.onChange()}return c.computed(()=>Object.assign(Object.assign({},W.value),{onBlur:ee,onInput:x,onChange:V,value:$.value}))}function _i(O,M){const[$,W]=nr(O,M),ee=R(c.toValue(O));function x(V){$.value=V}return c.computed(()=>{const V=$e(M)?M(Io(ee,Lo)):M||{};return Object.assign({[V.model||"modelValue"]:$.value,[`onUpdate:${V.model||"modelValue"}`]:x},W.value)})}return Object.assign(Object.assign({},z),{values:c.readonly(l),handleReset:()=>_n(),submitForm:_r})}function z0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=c.computed(()=>!Je(e,c.unref(n)));function s(){const l=t.value;return ot(i).reduce((d,u)=>{const f=i[u];return d[u]=l[f](h=>h[u]),d},{})}const a=c.reactive(s());return c.watchEffect(()=>{const l=s();a.touched=l.touched,a.valid=l.valid,a.pending=l.pending}),c.computed(()=>Object.assign(Object.assign({initialValues:c.unref(n)},a),{valid:a.valid&&!ot(r.value).length,dirty:o.value}))}function j0(t,e,n){const r=Vd(n),i=c.ref(r),o=c.ref(ye(r));function s(a,l=!1){i.value=Ni(ye(i.value)||{},ye(a)),o.value=Ni(ye(o.value)||{},ye(a)),l&&t.value.forEach(d=>{if(d.touched)return;const f=it(i.value,d.path);fn(e,d.path,ye(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function H0(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const W0=c.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=c.toRef(t,"validationSchema"),r=c.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:a,isSubmitting:l,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:w,setFieldError:v,setFieldValue:T,setValues:b,setFieldTouched:S,setTouched:k,resetField:C}=F0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),_=y((R,{evt:D})=>{gd(D)&&D.target.submit()},t.onInvalidSubmit),N=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):_;function L(R){ba(R)&&R.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function Z(R,D){return y(typeof R=="function"&&!D?R:D,t.onInvalidSubmit)(R)}function j(){return ye(s)}function A(){return ye(a.value)}function I(){return ye(i.value)}function F(){return{meta:a.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:l.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:Z,handleReset:m,submitForm:_,setErrors:w,setFieldError:v,setFieldValue:T,setValues:b,setFieldTouched:S,setTouched:k,resetForm:g,resetField:C,getValues:j,getMeta:A,getErrors:I}}return e.expose({setFieldError:v,setErrors:w,setFieldValue:T,setValues:b,setFieldTouched:S,setTouched:k,resetForm:g,validate:h,validateField:p,resetField:C,getValues:j,getMeta:A,getErrors:I,values:s,meta:a,errors:i}),function(){const D=t.as==="form"?t.as:t.as?c.resolveDynamicComponent(t.as):null,J=Ca(D,e,F);if(!D)return J;const pe=D==="form"?{novalidate:!0}:{};return c.h(D,Object.assign(Object.assign(Object.assign({},pe),e.attrs),{onSubmit:N,onReset:L}),J)}}}),Y0=c.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=c.inject(Ai,void 0),r=c.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?c.resolveDynamicComponent(t.as):t.as,s=Ca(o,e,i),a=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?c.h(o||"span",a,r.value):c.h(o,a,s)}}});function U0(t){const e=va(Ai),n=t?void 0:c.inject(pd);return c.computed(()=>t?e==null?void 0:e.errors.value[c.toValue(t)]:n==null?void 0:n.errorMessage.value)}At("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),At("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),At("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),At("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),At("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),At("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),At("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),At("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),At("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),At("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),At("number",t=>parseFloat(t)?!0:"This field must be a number");const de=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},q0={},G0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},K0=[c.createElementVNode("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"},null,-1)];function J0(t,e){return c.openBlock(),c.createElementBlock("svg",G0,K0)}const Z0=de(q0,[["render",J0]]),X0={},Q0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},ey=[c.createElementVNode("path",{d:"M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"},null,-1)];function ty(t,e){return c.openBlock(),c.createElementBlock("svg",Q0,ey)}const ny=de(X0,[["render",ty]]),ry={class:"relative"},Br=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",ry,[c.createVNode(Z0,{class:"absolute opacity-25"}),c.createVNode(ny,{class:c.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let Q={theme:"wpic-tools",popoverTarget:"body"};const iy=["is","type","disabled"],oy={key:0,class:"absolute inset-0 flex justify-center items-center"},sy={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},ay=["onClick"],Fo=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=c.ref(null),r=c.ref(null),i=c.ref(!1),o=c.computed(()=>e.to?"router-link":"div"),s=w=>{r.value&&!r.value.contains(w.target)&&n.value&&!n.value.contains(w.target)&&(i.value=!1)};c.onMounted(()=>{document.addEventListener("click",s)}),c.onUnmounted(()=>{document.removeEventListener("click",s)});const a={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},l={pmi:"","wpic-tools":"bg-transparent text-gray-700 disabled:text-gray-700/50 enabled:hover:bg-gray-900/5 enabled:active:bg-gray-200 enabled:active:shadow-inner dark:enabled:border-gray-900 dark:text-gray-400 dark:enabled:hover:bg-gray-900 dark:enabled:active:bg-gray-930 dark:disabled:text-gray-400/50"},d={pmi:"","wpic-tools":"bg-transparent text-red-600 disabled:text-red-600/50 enabled:hover:bg-red-500/5 enabled:active:bg-red-100 enabled:active:shadow-inner dark:text-red-400 dark:enabled:hover:bg-red-500/10 dark:enabled:active:bg-red-500/25 dark:disabled:text-red-500/50"},u={pmi:"bg-violet-800 border border-violet-800 focus:bg-violet-800 text-white disabled:bg-zinc-100 disabled:text-zinc-400 disabled:border-zinc-100 enabled:hover:bg-violet-900 enabled:hover:border-violet-900 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b from-lime-500 to-lime-500 text-white disabled:text-white/50 border-none shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:from-lime-400 enabled:hover:to-lime-400 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:from-lime-700 dark:to-lime-700 dark:enabled:active:shadow-inner dark:enabled:hover:from-lime-600 dark:enabled:hover:to-lime-600"},f={pmi:"bg-white text-violet-800 border-zinc-400 dark:border-zinc-700 dark:text-zinc-200 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:hover:border-zinc-600 disabled:text-zinc-400 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b from-gray-500 to-gray-600 text-white disabled:text-white/50 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:from-gray-400 enabled:hover:to-gray-500 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:from-gray-700 dark:to-gray-700 dark:enabled:active:shadow-inner dark:enabled:hover:from-gray-600 dark:enabled:hover:to-gray-600"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b from-red-500 to-red-600 disabled:text-red-600/50 border-red-500 enabled:hover:to-red-500 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:hover:border-red-600 enabled:active:shadow-inner enabled:active:text-white/80 enabled:active:bg-red-700 enabled:active:border-red-700 dark:bg-red-400/70 dark:border-red-400/70"},p={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":"bg-linear-to-b from-white text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/5 shadow-xs enabled:hover:to-gray-50 enabled:active:text-gray-950/60 dark:bg-gray-900 dark:from-gray-900 dark:text-white dark:disabled:text-white/50 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] enabled:active:shadow-inner dark:hover:from-gray-800 dark:hover:to-gray-800 dark:enabled:active:text-white/80"},m={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},g={pmi:"text-red-600 hover:text-red-500 hover:underline","wpic-tools":"text-red-600 disabled:text-red-600/50 hover:text-red-500 dark:text-red-400 dark:hover:text-red-500 hover:underline"},y={pmi:"hover:text-violet-800 hover:underline","wpic-tools":"dark:text-gray-200 hover:text-lime-800 hover:underline"};return(w,v)=>{var T;return c.openBlock(),c.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:v[0]||(v[0]=b=>{var S;return(S=t.actions)!=null&&S.length?i.value=!i.value:null}),class:c.normalizeClass([{"cursor-pointer":!t.disabled&&!t.loading,"active:outline active:outline-2 active:outline-offset-4":!t.disabled&&!t.loading&&t.outlining,"cursor-not-allowed":t.disabled,border:t.outline&&!t.plain,[`${a[c.unref(Q).theme]}`]:!0,[`${u[c.unref(Q).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[c.unref(Q).theme]}`]:t.secondary,[`${p[c.unref(Q).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[c.unref(Q).theme]}`]:t.primary&&t.plain,[`${y[c.unref(Q).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${l[c.unref(Q).theme]}`]:t.colorless,[`${h[c.unref(Q).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[c.unref(Q).theme]}`]:t.destructive&&t.plain,[`${d[c.unref(Q).theme]}`]:t.destructive&&t.colorless,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(c.openBlock(),c.createElementBlock("div",oy,[c.createVNode(Br,{class:"w-6 h-6"})])):c.createCommentVNode("",!0),(c.openBlock(),c.createBlock(c.resolveDynamicComponent(o.value),{to:t.to,class:c.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:c.withCtx(()=>[c.renderSlot(w.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(T=t.actions)!=null&&T.length&&i.value?(c.openBlock(),c.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[c.createElementVNode("div",sy,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.actions,b=>(c.openBlock(),c.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},c.toDisplayString(b.label),9,ay))),256))])],512)):c.createCommentVNode("",!0)],10,iy)}}}),ly=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[c.unref(Q).theme]]])},[c.renderSlot(n.$slots,"default")],2))}}),cy={name:"WpicInputGroup"},dy={class:"wpic-input-group flex w-full"};function uy(t,e,n,r,i,o){return c.openBlock(),c.createElementBlock("div",dy,[c.renderSlot(t.$slots,"default")])}const fy=de(cy,[["render",uy]]),hy=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=c.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(a,l)=>(c.openBlock(),c.createBlock(c.unref(W0),{ref_key:"myForm",ref:n},{default:c.withCtx(({values:d,meta:u,errors:f})=>[c.renderSlot(a.$slots,"default")]),_:3},512))}}),Ii=Math.min,Vr=Math.max,zo=Math.round,$n=t=>({x:t,y:t}),py={left:"right",right:"left",bottom:"top",top:"bottom"},my={start:"end",end:"start"};function Ea(t,e,n){return Vr(t,Ii(e,n))}function Ri(t,e){return typeof t=="function"?t(e):t}function or(t){return t.split("-")[0]}function Li(t){return t.split("-")[1]}function Pd(t){return t==="x"?"y":"x"}function _a(t){return t==="y"?"height":"width"}function jo(t){return["top","bottom"].includes(or(t))?"y":"x"}function Na(t){return Pd(jo(t))}function gy(t,e,n){n===void 0&&(n=!1);const r=Li(t),i=Na(t),o=_a(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Ho(s)),[s,Ho(s)]}function yy(t){const e=Ho(t);return[Da(t),e,Da(e)]}function Da(t){return t.replace(/start|end/g,e=>my[e])}function by(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function ky(t,e,n,r){const i=Li(t);let o=by(or(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Da)))),o}function Ho(t){return t.replace(/left|right|bottom|top/g,e=>py[e])}function wy(t){return{top:0,right:0,bottom:0,left:0,...t}}function Id(t){return typeof t!="number"?wy(t):{top:t,right:t,bottom:t,left:t}}function Wo(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Rd(t,e,n){let{reference:r,floating:i}=t;const o=jo(e),s=Na(e),a=_a(s),l=or(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Li(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const vy=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Rd(d,r,l),h=r,p={},m=0;for(let g=0;g<a.length;g++){const{name:y,fn:w}=a[g],{x:v,y:T,data:b,reset:S}=await w({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=v??u,f=T??f,p={...p,[y]:{...p[y],...b}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(d=S.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:u,y:f}=Rd(d,h,l)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function Ld(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ri(e,t),m=Id(p),y=a[h?f==="floating"?"reference":"floating":f],w=Wo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:l})),v=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),b=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},S=Wo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:T,strategy:l}):v);return{top:(w.top-S.top+m.top)/b.y,bottom:(S.bottom-w.bottom+m.bottom)/b.y,left:(w.left-S.left+m.left)/b.x,right:(S.right-w.right+m.right)/b.x}}const xy=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:d,padding:u=0}=Ri(t,e)||{};if(d==null)return{};const f=Id(u),h={x:n,y:r},p=Na(i),m=_a(p),g=await s.getDimensions(d),y=p==="y",w=y?"top":"left",v=y?"bottom":"right",T=y?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],S=h[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let C=k?k[T]:0;(!C||!await(s.isElement==null?void 0:s.isElement(k)))&&(C=a.floating[T]||o.floating[m]);const _=b/2-S/2,N=C/2-g[m]/2-1,L=Ii(f[w],N),Z=Ii(f[v],N),j=L,A=C-g[m]-Z,I=C/2-g[m]/2+_,F=Ea(j,I,A),R=!l.arrow&&Li(i)!=null&&I!==F&&o.reference[m]/2-(I<j?L:Z)-g[m]/2<0,D=R?I<j?I-j:I-A:0;return{[p]:h[p]+D,data:{[p]:F,centerOffset:I-F-D,...R&&{alignmentOffset:D}},reset:R}}}),Sy=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Ri(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=or(i),v=or(a)===a,T=await(l.isRTL==null?void 0:l.isRTL(d.floating)),b=h||(v||!g?[Ho(a)]:yy(a));!h&&m!=="none"&&b.push(...ky(a,g,m,T));const S=[a,...b],k=await Ld(e,y),C=[];let _=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&C.push(k[w]),f){const j=gy(i,s,T);C.push(k[j[0]],k[j[1]])}if(_=[..._,{placement:i,overflows:C}],!C.every(j=>j<=0)){var N,L;const j=(((N=o.flip)==null?void 0:N.index)||0)+1,A=S[j];if(A)return{data:{index:j,overflows:_},reset:{placement:A}};let I=(L=_.filter(F=>F.overflows[0]<=0).sort((F,R)=>F.overflows[1]-R.overflows[1])[0])==null?void 0:L.placement;if(!I)switch(p){case"bestFit":{var Z;const F=(Z=_.map(R=>[R.placement,R.overflows.filter(D=>D>0).reduce((D,J)=>D+J,0)]).sort((R,D)=>R[1]-D[1])[0])==null?void 0:Z[0];F&&(I=F);break}case"initialPlacement":I=a;break}if(i!==I)return{reset:{placement:I}}}return{}}}};async function Cy(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=or(n),a=Li(n),l=jo(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,f=Ri(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const My=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await Cy(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},Oy=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:w,y:v}=y;return{x:w,y:v}}},...l}=Ri(t,e),d={x:n,y:r},u=await Ld(e,l),f=jo(or(i)),h=Pd(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",v=p+u[y],T=p-u[w];p=Ea(v,p,T)}if(s){const y=f==="y"?"top":"left",w=f==="y"?"bottom":"right",v=m+u[y],T=m-u[w];m=Ea(v,m,T)}const g=a.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function sr(t){return Aa(t)?(t.nodeName||"").toLowerCase():"#document"}function ft(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bn(t){var e;return(e=(Aa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Aa(t){return t instanceof Node||t instanceof ft(t).Node}function Yt(t){return t instanceof Element||t instanceof ft(t).Element}function Ut(t){return t instanceof HTMLElement||t instanceof ft(t).HTMLElement}function Fd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ft(t).ShadowRoot}function Fi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Bt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Ty(t){return["table","td","th"].includes(sr(t))}function $a(t){const e=Ba(),n=Bt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ey(t){let e=Vn(t);for(;Ut(e)&&!Pr(e);){if($a(e))return e;e=Vn(e)}return null}function Ba(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pr(t){return["html","body","#document"].includes(sr(t))}function Bt(t){return ft(t).getComputedStyle(t)}function Yo(t){return Yt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Vn(t){if(sr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fd(t)&&t.host||Bn(t);return Fd(e)?e.host:e}function zd(t){const e=Vn(t);return Pr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ut(e)&&Fi(e)?e:zd(e)}function Va(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=zd(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=ft(i);return o?e.concat(s,s.visualViewport||[],Fi(i)?i:[],s.frameElement&&n?Va(s.frameElement):[]):e.concat(i,Va(i,[],n))}function jd(t){const e=Bt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Ut(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=zo(n)!==o||zo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Hd(t){return Yt(t)?t:t.contextElement}function Ir(t){const e=Hd(t);if(!Ut(e))return $n(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=jd(e);let s=(o?zo(n.width):n.width)/r,a=(o?zo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const _y=$n(0);function Wd(t){const e=ft(t);return!Ba()||!e.visualViewport?_y:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ny(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ft(t)?!1:e}function zi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Hd(t);let s=$n(1);e&&(r?Yt(r)&&(s=Ir(r)):s=Ir(t));const a=Ny(o,n,r)?Wd(o):$n(0);let l=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=ft(o),p=r&&Yt(r)?ft(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Ir(g),w=g.getBoundingClientRect(),v=Bt(g),T=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,b=w.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,d*=y.y,u*=y.x,f*=y.y,l+=T,d+=b,m=ft(g),g=m.frameElement}}return Wo({width:u,height:f,x:l,y:d})}const Dy=[":popover-open",":modal"];function Pa(t){return Dy.some(e=>{try{return t.matches(e)}catch{return!1}})}function Ay(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Bn(r),a=e?Pa(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},d=$n(1);const u=$n(0),f=Ut(r);if((f||!f&&!o)&&((sr(r)!=="body"||Fi(s))&&(l=Yo(r)),Ut(r))){const h=zi(r);d=Ir(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x,y:n.y*d.y-l.scrollTop*d.y+u.y}}function $y(t){return Array.from(t.getClientRects())}function Yd(t){return zi(Bn(t)).left+Yo(t).scrollLeft}function By(t){const e=Bn(t),n=Yo(t),r=t.ownerDocument.body,i=Vr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Vr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Yd(t);const a=-n.scrollTop;return Bt(r).direction==="rtl"&&(s+=Vr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Vy(t,e){const n=ft(t),r=Bn(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const d=Ba();(!d||d&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function Py(t,e){const n=zi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ut(t)?Ir(t):$n(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,d=r*o.y;return{width:s,height:a,x:l,y:d}}function Ud(t,e,n){let r;if(e==="viewport")r=Vy(t,n);else if(e==="document")r=By(Bn(t));else if(Yt(e))r=Py(e,n);else{const i=Wd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Wo(r)}function qd(t,e){const n=Vn(t);return n===e||!Yt(n)||Pr(n)?!1:Bt(n).position==="fixed"||qd(n,e)}function Iy(t,e){const n=e.get(t);if(n)return n;let r=Va(t,[],!1).filter(a=>Yt(a)&&sr(a)!=="body"),i=null;const o=Bt(t).position==="fixed";let s=o?Vn(t):t;for(;Yt(s)&&!Pr(s);){const a=Bt(s),l=$a(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fi(s)&&!l&&qd(t,s))?r=r.filter(u=>u!==s):i=a,s=Vn(s)}return e.set(t,r),r}function Ry(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Pa(e)?[]:Iy(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((d,u)=>{const f=Ud(e,u,i);return d.top=Vr(f.top,d.top),d.right=Ii(f.right,d.right),d.bottom=Ii(f.bottom,d.bottom),d.left=Vr(f.left,d.left),d},Ud(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ly(t){const{width:e,height:n}=jd(t);return{width:e,height:n}}function Fy(t,e,n){const r=Ut(e),i=Bn(e),o=n==="fixed",s=zi(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=$n(0);if(r||!r&&!o)if((sr(e)!=="body"||Fi(i))&&(a=Yo(e)),r){const f=zi(e,!0,o,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=Yd(i));const d=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:d,y:u,width:s.width,height:s.height}}function Ia(t){return Bt(t).position==="static"}function Gd(t,e){return!Ut(t)||Bt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Kd(t,e){const n=ft(t);if(Pa(t))return n;if(!Ut(t)){let i=Vn(t);for(;i&&!Pr(i);){if(Yt(i)&&!Ia(i))return i;i=Vn(i)}return n}let r=Gd(t,e);for(;r&&Ty(r)&&Ia(r);)r=Gd(r,e);return r&&Pr(r)&&Ia(r)&&!$a(r)?n:r||Ey(t)||n}const zy=async function(t){const e=this.getOffsetParent||Kd,n=this.getDimensions,r=await n(t.floating);return{reference:Fy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jy(t){return Bt(t).direction==="rtl"}const Hy={convertOffsetParentRelativeRectToViewportRelativeRect:Ay,getDocumentElement:Bn,getClippingRect:Ry,getOffsetParent:Kd,getElementRects:zy,getClientRects:$y,getDimensions:Ly,getScale:Ir,isElement:Yt,isRTL:jy},Jd=My,Zd=Oy,Xd=Sy,Wy=xy,Qd=(t,e,n)=>{const r=new Map,i={platform:Hy,...n},o={...i.platform,_c:r};return vy(t,e,{...i,platform:o})};function Yy(t){return t!=null&&typeof t=="object"&&"$el"in t}function Uy(t){if(Yy(t)){const e=t.$el;return Aa(e)&&sr(e)==="#comment"?null:e}return t}function qy(t){return{name:"arrow",options:t,fn(e){const n=Uy(c.unref(t.element));return n==null?{}:Wy({element:n,padding:t.padding}).fn(e)}}}const Gy={},Ky={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Jy=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function Zy(t,e){return c.openBlock(),c.createElementBlock("svg",Ky,Jy)}const Rr=de(Gy,[["render",Zy]]);let Uo;const Xy=new Uint8Array(16);function Qy(){if(!Uo&&(Uo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Uo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Uo(Xy)}const Fe=[];for(let t=0;t<256;++t)Fe.push((t+256).toString(16).slice(1));function eb(t,e=0){return Fe[t[e+0]]+Fe[t[e+1]]+Fe[t[e+2]]+Fe[t[e+3]]+"-"+Fe[t[e+4]]+Fe[t[e+5]]+"-"+Fe[t[e+6]]+Fe[t[e+7]]+"-"+Fe[t[e+8]]+Fe[t[e+9]]+"-"+Fe[t[e+10]]+Fe[t[e+11]]+Fe[t[e+12]]+Fe[t[e+13]]+Fe[t[e+14]]+Fe[t[e+15]]}const eu={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ra(t,e,n){if(eu.randomUUID&&!e&&!t)return eu.randomUUID();t=t||{};const r=t.random||(t.rng||Qy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,eb(r)}let tu={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""}};const tb={class:"bg-white dark:bg-gray-700 rounded-t-lg w-full"},nb={class:"flex justify-between items-center border-b dark:border-gray-700 px-4 py-3"},Lr=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},expand:Boolean},setup(t,{expose:e}){const n=Ra(),r=t,i={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"hidden md:block md:absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},o={pmi:"md:hidden","wpic-tools":"md:hidden"},s=c.ref(null),a=c.ref(null),l=c.ref(!0);function d(){tu.isMobile()&&(document.documentElement.style.overflow="hidden",document.querySelector("#app").style.overflow="hidden"),r.disabled||(l.value=!1,f()),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:n}}))}function u(){document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,l.value=!0}async function f(){const g=await Qd(s.value,a.value,{placement:r.placement,middleware:[Xd(),Zd(),Jd(r.offset)]});a.value.style.left=`${g.x}px`,a.value.style.top=`${g.y}px`}const h=g=>{a.value&&!a.value.contains(g.target)&&s.value&&!s.value.contains(g.target)&&u()};c.onMounted(()=>{document.addEventListener("click",h),document.addEventListener("submenu-open",g=>{g.detail.uuid!==n&&u()})}),c.onUnmounted(()=>{document.removeEventListener("click",h),document.removeEventListener("submenu-open",u)});function p(){r.hover&&d()}function m(){r.hover&&u()}return e({hide:u}),(g,y)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[(c.openBlock(),c.createElementBlock("div",{class:"flex-1",key:`reference_${c.unref(n)}`,ref_key:"reference",ref:s,onMouseenter:p,onMouseleave:m,onClick:y[0]||(y[0]=c.withModifiers(w=>l.value?d():u(),["stop"]))},[c.renderSlot(g.$slots,"default",{isHidden:l.value})],32)),(c.openBlock(),c.createBlock(c.Teleport,{to:c.unref(Q).popoverTarget},[(c.openBlock(),c.createElementBlock("div",{key:`floating_${c.unref(n)}`,ref_key:"floating",ref:a,style:c.normalizeStyle({maxWidth:t.maxWidth}),class:c.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:l.value,[`${i[c.unref(Q).theme]}`]:!l.value,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[c.renderSlot(g.$slots,"content")],6)),c.createElementVNode("div",{onClick:y[1]||(y[1]=w=>u()),class:c.normalizeClass(["fixed z-30 flex items-end w-screen h-screen top-0 bg-black/20",{hidden:l.value,[`${o[c.unref(Q).theme]}`]:!0}])},[c.createElementVNode("div",tb,[c.createElementVNode("div",nb,[c.createElementVNode("span",null,c.toDisplayString(t.label),1),c.createVNode(Rr,{onClick:u,class:"w-4 h-4"})]),c.renderSlot(g.$slots,"content")])],2)],8,["to"]))],64))}}),rb={},ib={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},ob=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function sb(t,e){return c.openBlock(),c.createElementBlock("svg",ib,ob)}const nu=de(rb,[["render",sb]]),ab={},lb={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},cb=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)];function db(t,e){return c.openBlock(),c.createElementBlock("svg",lb,cb)}const ub=de(ab,[["render",db]]),fb={},hb={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},pb=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"},null,-1)];function mb(t,e){return c.openBlock(),c.createElementBlock("svg",hb,pb)}const La=de(fb,[["render",mb]]),gb={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-gray-500 flex items-center"},yb={key:0},bb={class:""},kb={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},wb={class:"opacity-50 w-4 h-4 leading-none"},vb={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},Fa=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-gray-930 dark:border-gray-920 dark:hover:bg-gray-920 dark:text-gray-400"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! bg-gray-50!"},i=e;function o(){i("onClear")}return(s,a)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[t.label?(c.openBlock(),c.createElementBlock("div",gb,[c.createTextVNode(c.toDisplayString(t.label)+" ",1),t.required&&!t.hideRequired?(c.openBlock(),c.createElementBlock("span",yb,"*")):c.createCommentVNode("",!0),c.createElementVNode("div",bb,[t.info?(c.openBlock(),c.createBlock(Lr,{key:0,hover:""},{content:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(t.info),1)]),default:c.withCtx(()=>[c.createVNode(La,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(["wpic-input overflow-auto leading-none rounded-sm flex relative border pr-4 items-center",{"pl-4":!s.$slots.prepend,"pl-10":s.$slots.prepend,[`${n[c.unref(Q).theme]}`]:!0,"h-8":t.small,"h-10":!t.large,"h-12":t.large,[`${r[c.unref(Q).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(c.openBlock(),c.createElementBlock("div",kb,[c.createElementVNode("div",wb,[c.renderSlot(s.$slots,"prepend")])])):c.createCommentVNode("",!0),c.renderSlot(s.$slots,"default"),t.loading?(c.openBlock(),c.createElementBlock("div",vb,[c.createVNode(Br,{class:"w-6 h-6 opacity-50"})])):t.clearable?(c.openBlock(),c.createElementBlock("div",{key:2,onClick:c.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Rr,{class:"w-5 h-5 opacity-50"})])):c.createCommentVNode("",!0)],2)],64))}});var qo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ru(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function xb(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Go=xb,Sb=typeof qo=="object"&&qo&&qo.Object===Object&&qo,iu=Sb,Cb=iu,Mb=typeof self=="object"&&self&&self.Object===Object&&self,Ob=Cb||Mb||Function("return this")(),qt=Ob,Tb=qt,Eb=function(){return Tb.Date.now()},_b=Eb,Nb=/\s/;function Db(t){for(var e=t.length;e--&&Nb.test(t.charAt(e)););return e}var Ab=Db,$b=Ab,Bb=/^\s+/;function Vb(t){return t&&t.slice(0,$b(t)+1).replace(Bb,"")}var Pb=Vb,Ib=qt,Rb=Ib.Symbol,za=Rb,ou=za,su=Object.prototype,Lb=su.hasOwnProperty,Fb=su.toString,ji=ou?ou.toStringTag:void 0;function zb(t){var e=Lb.call(t,ji),n=t[ji];try{t[ji]=void 0;var r=!0}catch{}var i=Fb.call(t);return r&&(e?t[ji]=n:delete t[ji]),i}var jb=zb,Hb=Object.prototype,Wb=Hb.toString;function Yb(t){return Wb.call(t)}var Ub=Yb,au=za,qb=jb,Gb=Ub,Kb="[object Null]",Jb="[object Undefined]",lu=au?au.toStringTag:void 0;function Zb(t){return t==null?t===void 0?Jb:Kb:lu&&lu in Object(t)?qb(t):Gb(t)}var Hi=Zb;function Xb(t){return t!=null&&typeof t=="object"}var Wi=Xb,Qb=Hi,e1=Wi,t1="[object Symbol]";function n1(t){return typeof t=="symbol"||e1(t)&&Qb(t)==t1}var r1=n1,i1=Pb,cu=Go,o1=r1,du=NaN,s1=/^[-+]0x[0-9a-f]+$/i,a1=/^0b[01]+$/i,l1=/^0o[0-7]+$/i,c1=parseInt;function d1(t){if(typeof t=="number")return t;if(o1(t))return du;if(cu(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cu(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=i1(t);var n=a1.test(t);return n||l1.test(t)?c1(t.slice(2),n?2:8):s1.test(t)?du:+t}var u1=d1,f1=Go,ja=_b,uu=u1,h1="Expected a function",p1=Math.max,m1=Math.min;function g1(t,e,n){var r,i,o,s,a,l,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(h1);e=uu(e)||0,f1(n)&&(u=!!n.leading,f="maxWait"in n,o=f?p1(uu(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(k){var C=r,_=i;return r=i=void 0,d=k,s=t.apply(_,C),s}function m(k){return d=k,a=setTimeout(w,e),u?p(k):s}function g(k){var C=k-l,_=k-d,N=e-C;return f?m1(N,o-_):N}function y(k){var C=k-l,_=k-d;return l===void 0||C>=e||C<0||f&&_>=o}function w(){var k=ja();if(y(k))return v(k);a=setTimeout(w,g(k))}function v(k){return a=void 0,h&&r?p(k):(r=i=void 0,s)}function T(){a!==void 0&&clearTimeout(a),d=0,r=l=i=a=void 0}function b(){return a===void 0?s:v(ja())}function S(){var k=ja(),C=y(k);if(r=arguments,i=this,l=k,C){if(a===void 0)return m(l);if(f)return clearTimeout(a),a=setTimeout(w,e),p(l)}return a===void 0&&(a=setTimeout(w,e)),s}return S.cancel=T,S.flush=b,S}var y1=g1;const fu=ru(y1);function b1(){this.__data__=[],this.size=0}var k1=b1;function w1(t,e){return t===e||t!==t&&e!==e}var hu=w1,v1=hu;function x1(t,e){for(var n=t.length;n--;)if(v1(t[n][0],e))return n;return-1}var Ko=x1,S1=Ko,C1=Array.prototype,M1=C1.splice;function O1(t){var e=this.__data__,n=S1(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():M1.call(e,n,1),--this.size,!0}var T1=O1,E1=Ko;function _1(t){var e=this.__data__,n=E1(e,t);return n<0?void 0:e[n][1]}var N1=_1,D1=Ko;function A1(t){return D1(this.__data__,t)>-1}var $1=A1,B1=Ko;function V1(t,e){var n=this.__data__,r=B1(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var P1=V1,I1=k1,R1=T1,L1=N1,F1=$1,z1=P1;function Fr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Fr.prototype.clear=I1,Fr.prototype.delete=R1,Fr.prototype.get=L1,Fr.prototype.has=F1,Fr.prototype.set=z1;var Jo=Fr,j1=Jo;function H1(){this.__data__=new j1,this.size=0}var W1=H1;function Y1(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var U1=Y1;function q1(t){return this.__data__.get(t)}var G1=q1;function K1(t){return this.__data__.has(t)}var J1=K1,Z1=Hi,X1=Go,Q1="[object AsyncFunction]",ek="[object Function]",tk="[object GeneratorFunction]",nk="[object Proxy]";function rk(t){if(!X1(t))return!1;var e=Z1(t);return e==ek||e==tk||e==Q1||e==nk}var pu=rk,ik=qt,ok=ik["__core-js_shared__"],sk=ok,Ha=sk,mu=function(){var t=/[^.]+$/.exec(Ha&&Ha.keys&&Ha.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function ak(t){return!!mu&&mu in t}var lk=ak,ck=Function.prototype,dk=ck.toString;function uk(t){if(t!=null){try{return dk.call(t)}catch{}try{return t+""}catch{}}return""}var gu=uk,fk=pu,hk=lk,pk=Go,mk=gu,gk=/[\\^$.*+?()[\]{}|]/g,yk=/^\[object .+?Constructor\]$/,bk=Function.prototype,kk=Object.prototype,wk=bk.toString,vk=kk.hasOwnProperty,xk=RegExp("^"+wk.call(vk).replace(gk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sk(t){if(!pk(t)||hk(t))return!1;var e=fk(t)?xk:yk;return e.test(mk(t))}var Ck=Sk;function Mk(t,e){return t==null?void 0:t[e]}var Ok=Mk,Tk=Ck,Ek=Ok;function _k(t,e){var n=Ek(t,e);return Tk(n)?n:void 0}var zr=_k,Nk=zr,Dk=qt,Ak=Nk(Dk,"Map"),Wa=Ak,$k=zr,Bk=$k(Object,"create"),Zo=Bk,yu=Zo;function Vk(){this.__data__=yu?yu(null):{},this.size=0}var Pk=Vk;function Ik(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Rk=Ik,Lk=Zo,Fk="__lodash_hash_undefined__",zk=Object.prototype,jk=zk.hasOwnProperty;function Hk(t){var e=this.__data__;if(Lk){var n=e[t];return n===Fk?void 0:n}return jk.call(e,t)?e[t]:void 0}var Wk=Hk,Yk=Zo,Uk=Object.prototype,qk=Uk.hasOwnProperty;function Gk(t){var e=this.__data__;return Yk?e[t]!==void 0:qk.call(e,t)}var Kk=Gk,Jk=Zo,Zk="__lodash_hash_undefined__";function Xk(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Jk&&e===void 0?Zk:e,this}var Qk=Xk,ew=Pk,tw=Rk,nw=Wk,rw=Kk,iw=Qk;function jr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jr.prototype.clear=ew,jr.prototype.delete=tw,jr.prototype.get=nw,jr.prototype.has=rw,jr.prototype.set=iw;var ow=jr,bu=ow,sw=Jo,aw=Wa;function lw(){this.size=0,this.__data__={hash:new bu,map:new(aw||sw),string:new bu}}var cw=lw;function dw(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var uw=dw,fw=uw;function hw(t,e){var n=t.__data__;return fw(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Xo=hw,pw=Xo;function mw(t){var e=pw(this,t).delete(t);return this.size-=e?1:0,e}var gw=mw,yw=Xo;function bw(t){return yw(this,t).get(t)}var kw=bw,ww=Xo;function vw(t){return ww(this,t).has(t)}var xw=vw,Sw=Xo;function Cw(t,e){var n=Sw(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Mw=Cw,Ow=cw,Tw=gw,Ew=kw,_w=xw,Nw=Mw;function Hr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Hr.prototype.clear=Ow,Hr.prototype.delete=Tw,Hr.prototype.get=Ew,Hr.prototype.has=_w,Hr.prototype.set=Nw;var ku=Hr,Dw=Jo,Aw=Wa,$w=ku,Bw=200;function Vw(t,e){var n=this.__data__;if(n instanceof Dw){var r=n.__data__;if(!Aw||r.length<Bw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new $w(r)}return n.set(t,e),this.size=n.size,this}var Pw=Vw,Iw=Jo,Rw=W1,Lw=U1,Fw=G1,zw=J1,jw=Pw;function Wr(t){var e=this.__data__=new Iw(t);this.size=e.size}Wr.prototype.clear=Rw,Wr.prototype.delete=Lw,Wr.prototype.get=Fw,Wr.prototype.has=zw,Wr.prototype.set=jw;var Hw=Wr,Ww="__lodash_hash_undefined__";function Yw(t){return this.__data__.set(t,Ww),this}var Uw=Yw;function qw(t){return this.__data__.has(t)}var Gw=qw,Kw=ku,Jw=Uw,Zw=Gw;function Qo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Kw;++e<n;)this.add(t[e])}Qo.prototype.add=Qo.prototype.push=Jw,Qo.prototype.has=Zw;var Xw=Qo;function Qw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var ev=Qw;function tv(t,e){return t.has(e)}var nv=tv,rv=Xw,iv=ev,ov=nv,sv=1,av=2;function lv(t,e,n,r,i,o){var s=n&sv,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&av?new rv:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!iv(e,function(w,v){if(!ov(p,v)&&(m===w||i(m,w,n,r,o)))return p.push(v)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var wu=lv,cv=qt,dv=cv.Uint8Array,uv=dv;function fv(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var hv=fv;function pv(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var mv=pv,vu=za,xu=uv,gv=hu,yv=wu,bv=hv,kv=mv,wv=1,vv=2,xv="[object Boolean]",Sv="[object Date]",Cv="[object Error]",Mv="[object Map]",Ov="[object Number]",Tv="[object RegExp]",Ev="[object Set]",_v="[object String]",Nv="[object Symbol]",Dv="[object ArrayBuffer]",Av="[object DataView]",Su=vu?vu.prototype:void 0,Ya=Su?Su.valueOf:void 0;function $v(t,e,n,r,i,o,s){switch(n){case Av:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Dv:return!(t.byteLength!=e.byteLength||!o(new xu(t),new xu(e)));case xv:case Sv:case Ov:return gv(+t,+e);case Cv:return t.name==e.name&&t.message==e.message;case Tv:case _v:return t==e+"";case Mv:var a=bv;case Ev:var l=r&wv;if(a||(a=kv),t.size!=e.size&&!l)return!1;var d=s.get(t);if(d)return d==e;r|=vv,s.set(t,e);var u=yv(a(t),a(e),r,i,o,s);return s.delete(t),u;case Nv:if(Ya)return Ya.call(t)==Ya.call(e)}return!1}var Bv=$v;function Vv(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Pv=Vv,Iv=Array.isArray,Ua=Iv,Rv=Pv,Lv=Ua;function Fv(t,e,n){var r=e(t);return Lv(t)?r:Rv(r,n(t))}var zv=Fv;function jv(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var Hv=jv;function Wv(){return[]}var Yv=Wv,Uv=Hv,qv=Yv,Gv=Object.prototype,Kv=Gv.propertyIsEnumerable,Cu=Object.getOwnPropertySymbols,Jv=Cu?function(t){return t==null?[]:(t=Object(t),Uv(Cu(t),function(e){return Kv.call(t,e)}))}:qv,Zv=Jv;function Xv(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Qv=Xv,ex=Hi,tx=Wi,nx="[object Arguments]";function rx(t){return tx(t)&&ex(t)==nx}var ix=rx,Mu=ix,ox=Wi,Ou=Object.prototype,sx=Ou.hasOwnProperty,ax=Ou.propertyIsEnumerable,lx=Mu(function(){return arguments}())?Mu:function(t){return ox(t)&&sx.call(t,"callee")&&!ax.call(t,"callee")},cx=lx,es={exports:{}};function dx(){return!1}var ux=dx;es.exports,function(t,e){var n=qt,r=ux,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,d=l||r;t.exports=d}(es,es.exports);var Tu=es.exports,fx=9007199254740991,hx=/^(?:0|[1-9]\d*)$/;function px(t,e){var n=typeof t;return e=e??fx,!!e&&(n=="number"||n!="symbol"&&hx.test(t))&&t>-1&&t%1==0&&t<e}var mx=px,gx=9007199254740991;function yx(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=gx}var Eu=yx,bx=Hi,kx=Eu,wx=Wi,vx="[object Arguments]",xx="[object Array]",Sx="[object Boolean]",Cx="[object Date]",Mx="[object Error]",Ox="[object Function]",Tx="[object Map]",Ex="[object Number]",_x="[object Object]",Nx="[object RegExp]",Dx="[object Set]",Ax="[object String]",$x="[object WeakMap]",Bx="[object ArrayBuffer]",Vx="[object DataView]",Px="[object Float32Array]",Ix="[object Float64Array]",Rx="[object Int8Array]",Lx="[object Int16Array]",Fx="[object Int32Array]",zx="[object Uint8Array]",jx="[object Uint8ClampedArray]",Hx="[object Uint16Array]",Wx="[object Uint32Array]",we={};we[Px]=we[Ix]=we[Rx]=we[Lx]=we[Fx]=we[zx]=we[jx]=we[Hx]=we[Wx]=!0,we[vx]=we[xx]=we[Bx]=we[Sx]=we[Vx]=we[Cx]=we[Mx]=we[Ox]=we[Tx]=we[Ex]=we[_x]=we[Nx]=we[Dx]=we[Ax]=we[$x]=!1;function Yx(t){return wx(t)&&kx(t.length)&&!!we[bx(t)]}var Ux=Yx;function qx(t){return function(e){return t(e)}}var Gx=qx,ts={exports:{}};ts.exports,function(t,e){var n=iu,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a}(ts,ts.exports);var Kx=ts.exports,Jx=Ux,Zx=Gx,_u=Kx,Nu=_u&&_u.isTypedArray,Xx=Nu?Zx(Nu):Jx,Du=Xx,Qx=Qv,eS=cx,tS=Ua,nS=Tu,rS=mx,iS=Du,oS=Object.prototype,sS=oS.hasOwnProperty;function aS(t,e){var n=tS(t),r=!n&&eS(t),i=!n&&!r&&nS(t),o=!n&&!r&&!i&&iS(t),s=n||r||i||o,a=s?Qx(t.length,String):[],l=a.length;for(var d in t)(e||sS.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||rS(d,l)))&&a.push(d);return a}var lS=aS,cS=Object.prototype;function dS(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||cS;return t===n}var uS=dS;function fS(t,e){return function(n){return t(e(n))}}var hS=fS,pS=hS,mS=pS(Object.keys,Object),gS=mS,yS=uS,bS=gS,kS=Object.prototype,wS=kS.hasOwnProperty;function vS(t){if(!yS(t))return bS(t);var e=[];for(var n in Object(t))wS.call(t,n)&&n!="constructor"&&e.push(n);return e}var xS=vS,SS=pu,CS=Eu;function MS(t){return t!=null&&CS(t.length)&&!SS(t)}var OS=MS,TS=lS,ES=xS,_S=OS;function NS(t){return _S(t)?TS(t):ES(t)}var DS=NS,AS=zv,$S=Zv,BS=DS;function VS(t){return AS(t,BS,$S)}var PS=VS,Au=PS,IS=1,RS=Object.prototype,LS=RS.hasOwnProperty;function FS(t,e,n,r,i,o){var s=n&IS,a=Au(t),l=a.length,d=Au(e),u=d.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var h=a[f];if(!(s?h in e:LS.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<l;){h=a[f];var w=t[h],v=e[h];if(r)var T=s?r(v,w,h,e,t,o):r(w,v,h,t,e,o);if(!(T===void 0?w===v||i(w,v,n,r,o):T)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var b=t.constructor,S=e.constructor;b!=S&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(g=!1)}return o.delete(t),o.delete(e),g}var zS=FS,jS=zr,HS=qt,WS=jS(HS,"DataView"),YS=WS,US=zr,qS=qt,GS=US(qS,"Promise"),KS=GS,JS=zr,ZS=qt,XS=JS(ZS,"Set"),QS=XS,eC=zr,tC=qt,nC=eC(tC,"WeakMap"),rC=nC,qa=YS,Ga=Wa,Ka=KS,Ja=QS,Za=rC,$u=Hi,Yr=gu,Bu="[object Map]",iC="[object Object]",Vu="[object Promise]",Pu="[object Set]",Iu="[object WeakMap]",Ru="[object DataView]",oC=Yr(qa),sC=Yr(Ga),aC=Yr(Ka),lC=Yr(Ja),cC=Yr(Za),ar=$u;(qa&&ar(new qa(new ArrayBuffer(1)))!=Ru||Ga&&ar(new Ga)!=Bu||Ka&&ar(Ka.resolve())!=Vu||Ja&&ar(new Ja)!=Pu||Za&&ar(new Za)!=Iu)&&(ar=function(t){var e=$u(t),n=e==iC?t.constructor:void 0,r=n?Yr(n):"";if(r)switch(r){case oC:return Ru;case sC:return Bu;case aC:return Vu;case lC:return Pu;case cC:return Iu}return e});var dC=ar,Xa=Hw,uC=wu,fC=Bv,hC=zS,Lu=dC,Fu=Ua,zu=Tu,pC=Du,mC=1,ju="[object Arguments]",Hu="[object Array]",ns="[object Object]",gC=Object.prototype,Wu=gC.hasOwnProperty;function yC(t,e,n,r,i,o){var s=Fu(t),a=Fu(e),l=s?Hu:Lu(t),d=a?Hu:Lu(e);l=l==ju?ns:l,d=d==ju?ns:d;var u=l==ns,f=d==ns,h=l==d;if(h&&zu(t)){if(!zu(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Xa),s||pC(t)?uC(t,e,n,r,i,o):fC(t,e,l,n,r,i,o);if(!(n&mC)){var p=u&&Wu.call(t,"__wrapped__"),m=f&&Wu.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Xa),i(g,y,n,r,o)}}return h?(o||(o=new Xa),hC(t,e,n,r,i,o)):!1}var bC=yC,kC=bC,Yu=Wi;function Uu(t,e,n,r,i){return t===e?!0:t==null||e==null||!Yu(t)&&!Yu(e)?t!==t&&e!==e:kC(t,e,n,r,Uu,i)}var wC=Uu,vC=wC;function xC(t,e){return vC(t,e)}var SC=xC;const qu=ru(SC),CC={key:0,class:"leading-none"},MC={class:"flex flex-col max-h-80 overflow-y-auto"},OC={key:0,class:"p-3"},TC={key:1},EC={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},_C=["onClick"],NC={class:"select-none flex w-full items-center justify-between"},Gu=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=c.ref(r.options);c.watch(()=>r.options,()=>{var v;(v=r.options)!=null&&v.length&&(i.value=[...r.options])},{immediate:!0,deep:!0});const o=n,s=c.ref(),a=c.ref();function l(v){if(r.multiple){if(v){let T=r.modelValue||[];T.indexOf(v)>=0?T.splice(T.indexOf(v),1):T.push(v),o("update:modelValue",T),f(T)}}else o("update:modelValue",v),f(v),s.value=null,a.value.hide()}function d(v){o("update:modelValue",v),f(v)}function u(){r.multiple?(o("update:modelValue",[]),f([])):(o("update:modelValue",null),f(null))}const f=fu(function(v){o("change",v)},r.debounce),h=c.computed(()=>{var v,T,b,S;if(r.multiple)if(r.maxDisplay){let k=(T=i.value)==null?void 0:T.filter(_=>{var N;return((N=r.modelValue)==null?void 0:N.indexOf(_.value))>=0}).map(_=>_.label),C=k==null?void 0:k.slice(0,r.maxDisplay);return(k==null?void 0:k.length)-(C==null?void 0:C.length)>0?(C==null?void 0:C.join(", "))+` (+${(k==null?void 0:k.length)-C.length})`:C==null?void 0:C.join(", ")}else return(v=i.value)==null?void 0:v.filter(k=>{var C;return((C=r.modelValue)==null?void 0:C.indexOf(k.value))>=0}).map(k=>k.label).join(", ");else return((S=(b=i.value)==null?void 0:b.find(k=>k.value===r.modelValue))==null?void 0:S.label)||r.modelValue});function p(v){try{return r.multiple?r.modelValue!==null&&r.modelValue.some(T=>qu(T,v)):r.modelValue!==null&&qu(v,r.modelValue)}catch(T){return console.log(T),!1}}const m={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-lime-500 group-[.is-selected]:font-medium text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-lime-700"},g=c.computed(()=>{var v,T;return((v=r.modelValue)==null?void 0:v.length)===((T=r.options)==null?void 0:T.length)}),y=c.computed(()=>{var v;if(r.filterable&&!r.remoteMethod&&((v=s.value)!=null&&v.trim().length)){const T=s.value.trim().toLowerCase();return r.options.filter(b=>{var S;return(S=b.label)==null?void 0:S.toLowerCase().includes(T)})}return r.options});function w(){r.remoteMethod&&r.remoteMethod(s.value)}return e({isAllSelected:g}),(v,T)=>(c.openBlock(),c.createBlock(Lr,{custom:"",ref_key:"myPopover",ref:a,label:t.label,disabled:t.disabled},{default:c.withCtx(({isHidden:b})=>[c.createVNode(Fa,{disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:c.withCtx(()=>{var S,k,C;return[c.createElementVNode("span",{class:c.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((S=t.modelValue)==null?void 0:S.length)>0)&&!t.hideSelect?(c.openBlock(),c.createElementBlock("span",CC,[g.value&&((k=t.allSelectedText)!=null&&k.length)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createTextVNode(c.toDisplayString(t.allSelectedText)+" ("+c.toDisplayString((C=t.options)==null?void 0:C.length)+")",1)],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createTextVNode(c.toDisplayString(h.value),1)],64))])):c.renderSlot(v.$slots,"default",{key:1},()=>[c.createTextVNode(c.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(c.openBlock(),c.createElementBlock("div",{key:0,onClick:c.withModifiers(u,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Rr,{class:"w-4 h-4"})])):c.createCommentVNode("",!0),c.createVNode(ub,{class:c.normalizeClass(["h-4 w-4 transition-all transform",{"rotate-180":!b}])},null,8,["class"])]}),_:2},1032,["disabled","small","invalid","loading"])]),content:c.withCtx(()=>{var b;return[c.createElementVNode("div",MC,[t.filterable?(c.openBlock(),c.createElementBlock("div",OC,[c.createVNode(Ju,{slim:"",placeholder:"Search...",clearable:"",modelValue:s.value,"onUpdate:modelValue":[T[0]||(T[0]=S=>s.value=S),w]},null,8,["modelValue"])])):c.createCommentVNode("",!0),!t.options&&((b=t.options)==null?void 0:b.length)==0?(c.openBlock(),c.createElementBlock("span",TC,"No data.")):(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[t.multiple&&t.batchSelect?(c.openBlock(),c.createElementBlock("div",EC,[c.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:T[1]||(T[1]=S=>{var k;return d((k=t.options)==null?void 0:k.filter(C=>C.value).map(C=>C.value))})},"Select all"),c.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:T[2]||(T[2]=S=>d([]))},"Select none")])):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(y.value,S=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["group",{"is-selected":!!p(S.value)}])},[c.createElementVNode("div",{class:c.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||S.value,[`${m[c.unref(Q).theme]}`]:!0}]),onClick:k=>S.disabled?null:l(S.value)},[c.createElementVNode("div",NC,[c.createElementVNode("span",{class:c.normalizeClass(["",{"opacity-25":S.disabled}])},c.toDisplayString(S.label||S.value),3),t.multiple&&p(S.value)?(c.openBlock(),c.createBlock(nu,{key:0,class:"w-4 h-4"})):c.createCommentVNode("",!0)])],10,_C)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),DC={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},AC={class:""},$C=["value","disabled","rows","placeholder"],Ku=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=c.ref(null),o=c.ref(!1);c.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&c.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function a(d){s("update:modelValue",d==null?void 0:d.target.value)}function l(){i.value.focus()}return e({focus:l}),(d,u)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[t.label?(c.openBlock(),c.createElementBlock("div",DC,[c.createTextVNode(c.toDisplayString(t.label)+" ",1),c.createElementVNode("div",AC,[d.info?(c.openBlock(),c.createBlock(Lr,{key:0,hover:""},{content:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.info),1)]),default:c.withCtx(()=>[c.createVNode(La,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),c.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:c.normalizeClass(["relative appearance-none outline-hidden flex w-full h-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.noResize,"overflow-hidden":t.autoResize&&!o.value,"overflow-auto":t.autoResize||o.value}]),style:c.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:a,placeholder:t.placeholder},null,46,$C)],64))}}),BC={},VC={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},PC=[c.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),c.createElementVNode("path",{"fill-rule":"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z","clip-rule":"evenodd"},null,-1)];function IC(t,e){return c.openBlock(),c.createElementBlock("svg",VC,PC)}const RC=de(BC,[["render",IC]]),LC={},FC={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},zC=[c.createElementVNode("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"},null,-1),c.createElementVNode("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"},null,-1),c.createElementVNode("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"},null,-1)];function jC(t,e){return c.openBlock(),c.createElementBlock("svg",FC,zC)}const HC=de(LC,[["render",jC]]),WC={},YC={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},UC=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function qC(t,e){return c.openBlock(),c.createElementBlock("svg",YC,UC)}const GC=de(WC,[["render",qC]]),KC={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-gray-500 flex items-center"},JC={key:0},ZC={class:""},XC=["innerHTML"],QC=["name","value","checked"],eM={key:0,class:"absolute dark:text-gray-400 left-0 ml-3 h-full flex items-center justify-center text-center"},tM={class:"opacity-50 w-4 h-4 leading-none"},nM={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},rM={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},iM={key:5,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Ju=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=c.computed(()=>o.name?o.name:Ra()),a=U0(s.value),l=c.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=c.ref(!0),u=c.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=c.computed(()=>{var C;if(o.rules&&typeof o.rules=="string"){let _=(C=o.rules)==null?void 0:C.split("|");return o.required&&_.push("required"),o.email&&_.push("email"),_.join("|")}else if(!o.rules){let _=[];return o.required&&_.push("required"),o.email&&_.push("email"),_.join("|")}return"required"});function p(C){let _=C&&C.target?C.target.value:C;v(_)}const m=n;function g(C){C===!0||C===!1?m("update:modelValue",!C):m("update:modelValue",C)}function y(C){let _=C&&C.target?C.target.value:C;m("update:modelValue",_),m("onChange",_)}function w(){m("update:modelValue",null),m("onChange",null),m("onClear")}const v=fu(function(C){m("update:modelValue",C),m("onChange",C)},o.debounce),T=c.ref(null),b=c.ref();function S(){var C,_;o.textarea?(C=b.value)==null||C.focus():(_=T.value)==null||_.$el.focus()}function k(){return T.value.meta.valid}return e({focus:S,isValid:k}),(C,_)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[l.value&&!t.checkbox&&!t.radio?(c.openBlock(),c.createElementBlock("div",KC,[c.createTextVNode(c.toDisplayString(l.value)+" ",1),t.required&&!t.hideRequired?(c.openBlock(),c.createElementBlock("span",JC,"*")):c.createCommentVNode("",!0),c.createElementVNode("div",ZC,[t.info?(c.openBlock(),c.createBlock(Lr,{key:0,hover:""},{content:c.withCtx(()=>[c.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,XC)]),default:c.withCtx(()=>[c.createVNode(La,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),t.checkbox?(c.openBlock(),c.createBlock(c.unref(Pi),{key:1,ref_key:"myInput",ref:T,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:c.withCtx(({field:N})=>[c.createElementVNode("div",{class:c.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:_[0]||(_[0]=L=>t.disabled?void 0:g(t.modelValue))},[c.createElementVNode("div",{class:c.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[c.unref(Q).theme]}`]:!0}])},[t.modelValue===!0?(c.openBlock(),c.createBlock(nu,{key:0})):c.createCommentVNode("",!0)],2),c.createElementVNode("span",{class:c.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[c.renderSlot(C.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(l.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(c.openBlock(),c.createBlock(c.unref(Pi),{key:2,ref_key:"myInput",ref:T,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:c.withCtx(({field:N})=>[c.createElementVNode("div",{onClick:_[2]||(_[2]=()=>{t.disabled||y(t.radioValue)}),class:c.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[c.createElementVNode("span",{class:c.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):c.createCommentVNode("",!0)],2),c.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:_[1]||(_[1]=(...L)=>C.onChange&&C.onChange(...L)),checked:t.radioValue==t.modelValue},null,40,QC),l.value?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["text-base",{"opacity-50":t.disabled}])},c.toDisplayString(l.value),3)):c.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(c.openBlock(),c.createBlock(c.unref(Pi),{key:3,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:c.withCtx(({field:N})=>{var L;return[c.createVNode(Gu,{modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&c.unref(a)),required:t.required||((L=h.value)==null?void 0:L.indexOf("required"))>=0,label:l.value,placeholder:t.placeholder,loading:t.loading},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading"])]}),_:1},8,["modelValue","rules","name"])):(c.openBlock(),c.createElementBlock("div",{key:4,class:c.normalizeClass(["wpic-input rounded-sm flex relative border",{[`${r[c.unref(Q).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-opacity-50 border-zinc-300 text-zinc-400":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":c.unref(a)}])},[C.$slots.prepend?(c.openBlock(),c.createElementBlock("div",eM,[c.createElementVNode("div",tM,[c.renderSlot(C.$slots,"prepend")])])):c.createCommentVNode("",!0),t.textarea?(c.openBlock(),c.createBlock(c.unref(Pi),{key:1,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:c.withCtx(()=>{var N;return[c.createVNode(Ku,{ref_key:"myTextarea",ref:b,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&c.unref(a)),required:t.required||((N=h.value)==null?void 0:N.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(c.openBlock(),c.createBlock(c.unref(Pi),{key:2,ref_key:"myInput",ref:T,autocomplete:"off",style:{"z-index":"1"},class:c.normalizeClass(["flex w-full h-full rounded-sm pr-4 bg-transparent outline-hidden appearance-none dark:text-gray-400 dark:placeholder:text-gray-700",{"pl-4":!C.$slots.prepend,"pl-12":C.$slots.prepend,"py-2":t.textarea,"cursor-not-allowed":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!c.unref(a),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(c.openBlock(),c.createElementBlock("div",{key:3,onClick:c.withModifiers(w,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Br,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(c.openBlock(),c.createElementBlock("div",{key:4,onClick:c.withModifiers(w,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Rr,{class:"w-5 h-5 opacity-50"})])):c.createCommentVNode("",!0),C.$slots.append||t.password||t.type=="password"?(c.openBlock(),c.createElementBlock("div",nM,[c.createElementVNode("div",rM,[c.renderSlot(C.$slots,"append",{},()=>[c.withDirectives(c.createVNode(RC,{class:"text-zinc-600 select-none",onClick:f},null,512),[[c.vShow,d.value]]),c.withDirectives(c.createVNode(HC,{class:"text-zinc-600 select-none",onClick:f},null,512),[[c.vShow,!d.value]])])])])):c.createCommentVNode("",!0)],2)),t.error&&c.unref(a)?(c.openBlock(),c.createElementBlock("div",iM,[c.createVNode(c.unref(Y0),{name:s.value},{default:c.withCtx(N=>[c.createTextVNode(c.toDisplayString(N.message),1)]),_:1},8,["name"])])):c.createCommentVNode("",!0),C.$slots.help||t.help?(c.openBlock(),c.createElementBlock("div",{key:6,class:c.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[c.renderSlot(C.$slots,"help",{},()=>[c.createTextVNode(c.toDisplayString(t.help),1)])],2)):c.createCommentVNode("",!0)],2))}}),oM=["innerHTML"],Zu=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=c.ref(),n=c.ref(),r=c.ref();Ra();const i=t;function o(){i.text&&(n.value.style.display="block",a())}function s(){n.value.style.display=""}async function a(){var h,p;await c.nextTick();const l=await Qd(e.value,n.value,{placement:i.placement,middleware:[Xd(),Zd(),Jd(i.offset),qy({element:r.value})]});n.value.style.left=`${l.x}px`,n.value.style.top=`${l.y}px`;const{x:d,y:u}=l.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(l,d)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("span",{ref_key:"button",ref:e,class:c.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[c.renderSlot(l.$slots,"default")],34),c.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 dark:border-gray-900 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[c.createElementVNode("span",{innerHTML:t.text},null,8,oM),c.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),sM={key:1,class:"flex justify-between items-baseline pt-4 px-6"},aM={class:""},lM={key:2,class:"flex items-center justify-end py-4 px-6"},cM=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=c.resolveComponent("wpic-loading-panel");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["rounded-lg wpic-card relative",{[e[c.unref(Q).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions}])},[t.loading?(c.openBlock(),c.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):c.createCommentVNode("",!0),t.title||r.$slots.actions?(c.openBlock(),c.createElementBlock("div",sM,[t.title||r.$slots.actions?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["text-lg 2xl:text-xl",[n[c.unref(Q).theme]]])},c.toDisplayString(t.title),3)):c.createCommentVNode("",!0),c.createElementVNode("div",aM,[c.renderSlot(r.$slots,"actions")])])):c.createCommentVNode("",!0),c.renderSlot(r.$slots,"default"),r.$slots.buttons?(c.openBlock(),c.createElementBlock("div",lM,[c.renderSlot(r.$slots,"buttons")])):c.createCommentVNode("",!0)],2)}}}),dM={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},uM={class:"flex-1 text-lg dark:text-gray-300 font-semibold"},fM=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[c.unref(Q).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions),"pt-6":!t.title&&!n.$slots.actions,"bg-gray-50 dark:bg-gray-930":t.sub}])},[t.title||n.$slots.actions?(c.openBlock(),c.createElementBlock("div",dM,[c.createElementVNode("div",uM,c.toDisplayString(t.title),1),c.renderSlot(n.$slots,"actions")])):c.createCommentVNode("",!0),c.renderSlot(n.$slots,"default")],2))}}),hM=c.createElementVNode("div",{class:""},null,-1),pM=c.createStaticVNode('<div class="-mt-2"><div class="absolute left-1/4 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-1/2 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-3/4 h-8 border-r border-gray-100 dark:border-gray-900"></div></div><div class="mt-7 text-gray-500 dark:text-gray-600"><div class="absolute left-0 text-xs">0%</div><div class="absolute left-1/4 -translate-x-1/4 text-xs">25%</div><div class="absolute left-1/2 -translate-x-1/2 text-xs">50%</div><div class="absolute right-1/4 translate-x-3/4 text-xs">75%</div><div class="absolute right-0 text-xs">100%</div></div>',2),mM=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=c.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[c.createElementVNode("div",{class:c.normalizeClass(["flex w-full relative",r[c.unref(Q).theme]]),style:{"z-index":"1"}},[n.value>0?(c.openBlock(),c.createElementBlock("div",{key:0,style:c.normalizeStyle({width:`${n.value}%`}),class:c.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[c.unref(Q).theme]}`]:!0}])},[c.createVNode(Zu,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:c.withCtx(()=>[hM]),_:1},8,["text"])],6)):c.createCommentVNode("",!0)],2),t.indicators?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[pM],64)):c.createCommentVNode("",!0)],2))}}),gM={class:"leading-none"},yM=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[c.unref(Q).theme]]:!0}])},[c.createElementVNode("span",gM,[c.renderSlot(o.$slots,"default")]),t.clearable?(c.openBlock(),c.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Rr,{class:"w-4 h-4"})])):c.createCommentVNode("",!0)],2))}}),bM=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"w-full":t.full})},[c.createElementVNode("div",{class:c.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[c.renderSlot(e.$slots,"default")],2)],2))}}),kM=t=>(c.pushScopeId("data-v-947735f2"),t=t(),c.popScopeId(),t),wM={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},vM=[kM(()=>c.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],xM=de(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(c.openBlock(),c.createElementBlock("div",wM,vM)):(c.openBlock(),c.createBlock(Br,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),SM={class:"text-base font-medium select-none"},Yi=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[c.unref(Q).theme]]:!t.active&&!t.disabled,[n[c.unref(Q).theme]]:t.active&&!t.disabled,[r[c.unref(Q).theme]]:t.disabled}])},[c.createElementVNode("span",SM,[c.renderSlot(i.$slots,"default")])],2))}}),CM={},MM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},OM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function TM(t,e){return c.openBlock(),c.createElementBlock("svg",MM,OM)}const Xu=de(CM,[["render",TM]]),EM={},_M={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},NM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z","clip-rule":"evenodd"},null,-1)];function DM(t,e){return c.openBlock(),c.createElementBlock("svg",_M,NM)}const Qu=de(EM,[["render",DM]]),AM={},$M={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},BM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function VM(t,e){return c.openBlock(),c.createElementBlock("svg",$M,BM)}const ef=de(AM,[["render",VM]]),PM={},IM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},RM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function LM(t,e){return c.openBlock(),c.createElementBlock("svg",IM,RM)}const tf=de(PM,[["render",LM]]),FM={class:"wpic-pagination flex justify-between"},zM={key:0,class:"flex items-center"},jM={key:0},HM={key:1,class:"flex flex-wrap gap-2"},WM=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:Boolean,total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1}},emits:["update:perPage","update:currentPage"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=c.computed(()=>Math.ceil(r.total/r.perPage)),s=c.computed(()=>{const u=o.value;if(!u||u===1)return[1];const f=r.currentPage,h=1;let p=Math.max(2,f-h),m=Math.min(u-1,f+h);f<=h+2&&(p=2,m=Math.min(2*h+2,u-1)),f>=u-h-1&&(p=Math.max(2,u-2*h-1),m=u-1);const g=[];for(let y=p;y<=m;y++)g.push(y);return p>2&&g.unshift("..."),m<u-1&&g.push("..."),[1,...g,u]});function a(u){u>=1&&u<=o.value&&i("update:currentPage",u)}function l(){return r.perPage*(r.currentPage-1)+1}function d(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}return e({getStart:l,getEnd:d}),(u,f)=>(c.openBlock(),c.createElementBlock("div",FM,[t.info?(c.openBlock(),c.createElementBlock("div",zM,[t.total>0?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createTextVNode(c.toDisplayString(l())+" - "+c.toDisplayString(d()),1),t.total?(c.openBlock(),c.createElementBlock("span",jM," / "+c.toDisplayString(t.total),1)):c.createCommentVNode("",!0)],64)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),t.pages?(c.openBlock(),c.createElementBlock("div",HM,[c.createVNode(Yi,{onClick:f[0]||(f[0]=h=>a(1)),disabled:t.currentPage===1||o.value==0||!o.value},{default:c.withCtx(()=>[c.createVNode(Xu,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),c.createVNode(Yi,{onClick:f[1]||(f[1]=h=>a(t.currentPage-1)),disabled:t.currentPage===1||o.value==0||!o.value},{default:c.withCtx(()=>[c.createVNode(Qu,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,h=>(c.openBlock(),c.createBlock(Yi,{key:`page_${h}`,onClick:p=>a(h),active:h===t.currentPage,disabled:o.value==0||!o.value},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(h),1)]),_:2},1032,["onClick","active","disabled"]))),128)),c.createVNode(Yi,{onClick:f[2]||(f[2]=h=>a(t.currentPage+1)),disabled:t.currentPage===o.value||o.value==0||!o.value},{default:c.withCtx(()=>[c.createVNode(tf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),c.createVNode(Yi,{onClick:f[3]||(f[3]=h=>a(o.value)),disabled:t.currentPage===o.value||o.value==0||!o.value},{default:c.withCtx(()=>[c.createVNode(ef,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"])])):c.createCommentVNode("",!0),c.createCommentVNode("",!0)]))}}),nf=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return c.h("td",e.attrs,n)};nf.props=["column","item","rowIndex"];const Qa=nf,YM={},UM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},qM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function GM(t,e){return c.openBlock(),c.createElementBlock("svg",UM,qM)}const KM=de(YM,[["render",GM]]),JM={class:"font-semibold"},rf={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:border-gray-900 dark:bg-gray-800"};return(n,r)=>(c.openBlock(),c.createElementBlock("tr",JM,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.columns,(i,o)=>(c.openBlock(),c.createBlock(Qa,{class:c.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[c.unref(Q).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":!0,"first:rounded-bl-lg":!0,"text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},ZM={},XM={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},QM=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function eO(t,e){return c.openBlock(),c.createElementBlock("svg",XM,QM)}const tO=de(ZM,[["render",eO]]),nO={class:"overflow-auto"},rO={class:"w-full rounded-lg"},iO=["width"],oO=["width"],sO={key:0,class:"rounded-t-lg"},aO=["onClick"],lO={class:"rounded-b-lg relative"},cO={key:0},dO=[c.createElementVNode("td",{class:"text-center py-3"},"   ",-1)],uO={key:1},fO={key:0,class:"text-center text-gray-400 py-3"},hO=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean},emits:["changeSort","expandRow"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-400 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},a={pmi:"","wpic-tools":""},l={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-300"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10"},f=n;c.onMounted(()=>{g()});const h=c.getCurrentInstance();c.provide("wtable",h==null?void 0:h.proxy);const p=c.useSlots(),m=c.ref([]);function g(){const T=(k,C)=>{let _={};for(let N in k){if(typeof k[N].default=="boolean"&&C[N]!==void 0){_[N]=C[N]!==!1;continue}if(C[N]!==void 0){_[N]=C[N];continue}if(typeof k[N].default=="function"){_[N]=k[N].default();continue}_[N]=k[N].default}return _};let b=[];(p.default&&p.default()||[]).forEach(k=>{var C,_;((C=k.type)==null?void 0:C.name)==="WpicTableColumn"?b.push(k):(_=k.children)!=null&&_.length&&k.children.forEach(N=>{var L;((L=N.type)==null?void 0:L.name)==="WpicTableColumn"&&b.push(N)})}),m.value=b.map(k=>{let C=k.children,_=k.props||{},{field:N,label:L,help:Z,width:j,minWidth:A,maxWidth:I,sortable:F,selectable:R,render:D,type:J,align:pe,visible:We,noPadding:Ke}=T(k.type.props,_);return{label:L,help:Z,width:j,minWidth:A,maxWidth:I,type:J,align:pe,sortable:F,selectable:R,field:N,render:D,children:C,visible:We,noPadding:Ke}}).filter(k=>k.visible||k.selectable)}function y(T){var S,k;let b=(S=r.sortOptions)==null?void 0:S.sortDirection;((k=r.sortOptions)==null?void 0:k.sortBy)===T&&(b=b==="asc"?"desc":"asc"),f("changeSort",{sortDirection:b,sortBy:T})}c.watch(()=>p.default,T=>{g()},{deep:!0}),e({buildColumns:g});const w=c.reactive({});function v({index:T,item:b}){w[T]?w[T]=null:(w[T]=!0,f("expandRow",{index:T,item:b}))}return(T,b)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-table relative w-full rounded-lg overflow-hidden",{"no-radius rounded-none":t.noRadius,border:t.border,[`${i[c.unref(Q).theme]}`]:!0}])},[c.createElementVNode("div",nO,[c.createElementVNode("table",rO,[c.createElementVNode("colgroup",null,[m.value.find(S=>S.type=="expand")?(c.openBlock(),c.createElementBlock("col",{key:0,style:c.normalizeStyle({minWidth:`${m.value.find(S=>S.type=="expand").minWidth}px`}),width:m.value.find(S=>S.type=="expand").width,class:"w-16"},null,12,iO)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(S=>S.type!="expand"),(S,k)=>(c.openBlock(),c.createElementBlock("col",{style:c.normalizeStyle({minWidth:`${S.minWidth}px`,maxWidth:`${S.maxWidth}px`}),width:S.width,key:k},null,12,oO))),128))]),t.hideHeaders?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("thead",sO,[c.createElementVNode("tr",null,[m.value.find(S=>S.type=="expand")?(c.openBlock(),c.createElementBlock("th",{key:0,class:c.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[c.unref(Q).theme]}`]])},null,2)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(S=>S.type!="expand"),(S,k)=>{var C,_;return c.openBlock(),c.createElementBlock("th",{class:c.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[c.unref(Q).theme]}`]:!0,"sticky left-0":k===0}]),style:c.normalizeStyle({maxWidth:`${S.maxWidth}px`})},[c.createElementVNode("div",{onClick:()=>{S.sortable&&y(S.field)},class:c.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":S.sortable&&S.field,"justify-center":S.align=="center","justify-end":S.align=="right"}])},[c.createElementVNode("span",{class:c.normalizeClass(["select-none font-medium",{"text-right":S.align=="right"}])},c.toDisplayString(S.label),3),S.sortable&&S.field?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["ml-1",{"opacity-25":S.field!=((C=t.sortOptions)==null?void 0:C.sortBy)}])},[c.createVNode(KM,{class:c.normalizeClass(["w-4 h-4",{"rotate-180":((_=t.sortOptions)==null?void 0:_.sortDirection)==="asc"}])},null,8,["class"])],2)):c.createCommentVNode("",!0)],10,aO)],6)}),256))])])),c.createElementVNode("tbody",lO,[t.loading?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("div",{class:c.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[c.unref(Q).theme]]])},[c.createVNode(Br,{class:"w-6 h-6"})],2),t.data.length?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("tr",cO,dO))],64)):c.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(c.openBlock(),c.createBlock(rf,{key:1,position:"header",columns:m.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.data,(S,k)=>{var C,_,N,L,Z;return c.openBlock(),c.createElementBlock(c.Fragment,{key:`tr_${k}`},[c.createElementVNode("tr",{class:c.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":k%2==0,"is-even":k%2!=0,[s[c.unref(Q).theme]]:!0}])},[m.value.find(j=>j.type=="expand")?(c.openBlock(),c.createElementBlock("td",{key:0,class:c.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top"}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[c.createVNode(Fo,{small:"",square:"",onClick:j=>v({item:S,index:k})},{default:c.withCtx(()=>[w[k]?(c.openBlock(),c.createBlock(GC,{key:0,class:"w-4 h-4"})):(c.openBlock(),c.createBlock(tO,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(j=>j.type!="expand"),(j,A)=>{var I,F;return c.openBlock(),c.createBlock(Qa,{class:c.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":A===0,[`${l[c.unref(Q).theme]}`]:!0,[`${d[c.unref(Q).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!j.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":k===((I=t.data)==null?void 0:I.length)-1&&!t.totalItem&&!m.value.find(R=>R.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":k===((F=t.data)==null?void 0:F.length)-1&&!t.totalItem&&!m.value.find(R=>R.type=="expand")&&!t.noRadius,"text-center justify-center":j.align=="center","text-right justify-end":j.align=="right","align-top py-5":t.valign=="top"}]),style:c.normalizeStyle({maxWidth:`${j.maxWidth}px`}),id:`${k}_${A}`,column:j,item:S,rowIndex:k,key:A},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),m.value.find(j=>j.type=="expand")?c.withDirectives((c.openBlock(),c.createElementBlock("tr",{key:0,class:c.normalizeClass([{[s[c.unref(Q).theme]]:!t.stripe,[a[c.unref(Q).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[c.createVNode(Qa,{class:c.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${l[c.unref(Q).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((C=m.value.find(j=>j.type=="expand"))!=null&&C.noPadding),"p-0":(_=m.value.find(j=>j.type=="expand"))==null?void 0:_.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":k===((N=t.data)==null?void 0:N.length)-1&&!t.totalItem,"first:rounded-bl-lg":k===((L=t.data)==null?void 0:L.length)-1&&!t.totalItem,"text-center":m.value.find(j=>j.type=="expand").align=="center","text-right":m.value.find(j=>j.type=="expand").align=="right"}]),column:m.value.find(j=>j.type=="expand"),rowIndex:k,colspan:(Z=m.value)==null?void 0:Z.length,item:S},null,8,["class","column","rowIndex","colspan","item"])],2)),[[c.vShow,w[k]]]):c.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(c.openBlock(),c.createElementBlock("tfoot",uO,[c.createVNode(rf,{position:"footer",columns:m.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])])):c.createCommentVNode("",!0)])]),!t.loading&&!t.data.length?(c.openBlock(),c.createElementBlock("div",fO," No Data ")):c.createCommentVNode("",!0)],2))}}),pO={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function ze(t){this.content=t}ze.prototype={constructor:ze,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,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new ze(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ze(n)},addToStart:function(t,e){return new ze([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ze(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new ze(i)},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=ze.from(t),t.size?new ze(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ze.from(t),t.size?new ze(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ze.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}},ze.from=function(t){if(t instanceof ze)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ze(e)};function of(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=of(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function sf(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let d=0,u=Math.min(s.text.length,a.text.length);for(;d<u&&s.text[s.text.length-d-1]==a.text[a.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let d=sf(s.content,a.content,n-1,r-1);if(d)return d}n-=l,r-=l}}class B{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,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],d=a+l.nodeSize;if(d>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let d=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new B(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new B(r,i)}cutByIndex(e,n){return e==n?B.empty:e==0&&n==this.content.length?this:new B(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new B(i,o)}addToStart(e){return new B([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new B(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 i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return of(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return sf(this,e,n,r)}findIndex(e,n=-1){if(e==0)return rs(0,e);if(e==this.size)return rs(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?rs(r+1,s):rs(r,i);i=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 B.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return B.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new B(n||e,r)}static from(e){if(!e)return B.empty;if(e instanceof B)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new B([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const el={index:0,offset:0};function rs(t,e){return el.index=t,el.offset=e,el}function is(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(!is(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!is(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let be=class sd{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}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&&is(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`);return r.create(n.attrs)}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 sd.none;if(e instanceof sd)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};be.none=[];class ss extends Error{}class H{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=lf(this.content,e+this.openStart,n);return r&&new H(r,this.openStart,this.openEnd)}removeBetween(e,n){return new H(af(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 H.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new H(B.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new H(e,r,i)}}H.empty=new H(B.empty,0,0);function af(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(af(o.content,e-i-1,n-i-1)))}function lf(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=lf(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function mO(t,e,n){if(n.openStart>t.depth)throw new ss("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ss("Inconsistent open depths");return cf(t,e,n,0)}function cf(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=cf(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return cr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=gO(n,t);return cr(o,uf(t,s,a,e,r))}else return cr(o,as(t,e,r))}function df(t,e){if(!e.type.compatibleContent(t.type))throw new ss("Cannot join "+e.type.name+" onto "+t.type.name)}function tl(t,e,n){let r=t.node(n);return df(r,e.node(n)),r}function lr(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 Ui(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(lr(t.nodeAfter,r),o++));for(let a=o;a<s;a++)lr(i.child(a),r);e&&e.depth==n&&e.textOffset&&lr(e.nodeBefore,r)}function cr(t,e){return t.type.checkContent(e),t.copy(e)}function uf(t,e,n,r,i){let o=t.depth>i&&tl(t,e,i+1),s=r.depth>i&&tl(n,r,i+1),a=[];return Ui(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(df(o,s),lr(cr(o,uf(t,e,n,r,i+1)),a)):(o&&lr(cr(o,as(t,e,i+1)),a),Ui(e,n,i,a),s&&lr(cr(s,as(n,r,i+1)),a)),Ui(r,null,i,a),new B(a)}function as(t,e,n){let r=[];if(Ui(null,t,n,r),t.depth>n){let i=tl(t,e,n+1);lr(cr(i,as(t,e,n+1)),r)}return Ui(e,null,n,r),new B(r)}function gO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(B.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class qi{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],i=e.child(n);return r?e.child(n).cut(r):i}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],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return be.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].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 ls(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=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),d=o-l;if(r.push(s,a,i+l),!d||(s=s.child(a),s.isText))break;o=d-1,i+=l+1}return new qi(n,r,o)}static resolveCached(e,n){for(let i=0;i<nl.length;i++){let o=nl[i];if(o.pos==n&&o.doc==e)return o}let r=nl[rl]=qi.resolve(e,n);return rl=(rl+1)%yO,r}}let nl=[],rl=0,yO=12;class ls{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 bO=Object.create(null);let dr=class ad{constructor(e,n,r,i=be.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||B.empty}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,i=0){this.content.nodesBetween(e,n,r,i,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,i){return this.content.textBetween(e,n,r,i)}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&&is(this.attrs,n||e.defaultAttrs||bO)&&be.sameSet(this.marks,r||be.none)}copy(e=null){return e==this.content?this:new ad(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ad(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 H.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),d=i.node(s).content.cut(i.pos-a,o.pos-a);return new H(d,i.depth-s,o.depth-s)}replace(e,n,r){return mO(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+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 i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return qi.resolveCached(this,e)}resolveNoCache(e){return qi.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),ff(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=B.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.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);let e=be.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!be.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=null;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 i=B.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};dr.prototype.text=void 0;class cs extends dr{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ff(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 cs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new cs(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 ff(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ur{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kO(e,n);if(r.next==null)return ur.empty;let i=hf(r);r.next&&r.err("Unexpected trailing text");let o=OO(MO(i));return TO(o,r),o}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 i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}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 i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return B.from(a.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,a.concat(u));if(h)return h}}return null}return o(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 i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.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 i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
6
- `)}}ur.empty=new ur(!0);class kO{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 hf(t){let e=[];do e.push(wO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function wO(t){let e=[];do e.push(vO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function vO(t){let e=CO(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=xO(t,e);else break;return e}function pf(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function xO(t,e){let n=pf(t),r=n;return t.eat(",")&&(t.next!="}"?r=pf(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function SO(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function CO(t){if(t.eat("(")){let e=hf(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=SO(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 MO(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let d={term:l,to:a};return e[s].push(d),d}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,d)=>l.concat(o(d,a)),[]);if(s.type=="seq")for(let l=0;;l++){let d=o(s.exprs[l],a);if(l==s.exprs.length-1)return d;i(d,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let d=0;d<s.min;d++){let u=n();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let d=s.min;d<s.max;d++){let u=n();r(l,u),i(o(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function mf(t,e){return e-t}function gf(t,e){let n=[];return r(e),n.sort(mf);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function OO(t){let e=Object.create(null);return n(gf(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let d;for(let u=0;u<i.length;u++)i[u][0]==a&&(d=i[u][1]);gf(t,l).forEach(u=>{d||i.push([a,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new ur(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(mf);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function TO(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:d}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function yf(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 bf(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function kf(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new EO(t[n]);return e}let wf=class Ig{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=kf(r.attrs),this.defaultAttrs=yf(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==ur.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:bf(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new dr(this,this.computeAttrs(e),B.from(n),be.setFrom(r))}createChecked(e=null,n,r){return n=B.from(n),this.checkContent(n),new dr(this,this.computeAttrs(e),n,be.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=B.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(B.empty,!0);return o?new dr(this,e,n.append(o),be.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)}`)}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:be.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Ig(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class EO{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ds{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=kf(i.attrs),this.excluded=null;let o=yf(this.attrs);this.instance=o?new be(this,o):null}create(e=null){return!e&&this.instance?this.instance:new be(this,bf(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new ds(o,i++,n,s)),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]}excludes(e){return this.excluded.indexOf(e)>-1}}class _O{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=ze.from(e.nodes),n.marks=ze.from(e.marks||{}),this.nodes=wf.compile(this.spec.nodes,this),this.marks=ds.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=ur.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?vf(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:vf(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof wf){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,i)}text(e,n){let r=this.nodes.text;return new cs(r,r.defaultAttrs,e,be.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return dr.fromJSON(this,e)}markFromJSON(e){return be.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function vf(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function NO(t){return t.tag!=null}function DO(t){return t.style!=null}class Ur{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{NO(r)?this.tags.push(r):DO(r)&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Mf(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Mf(this,n,!0);return r.addAll(e,n.from,n.to),H.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(BO(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Of(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Of(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ur(e,Ur.schemaRules(e)))}}const xf={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},AO={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Sf={ol:!0,ul:!0},us=1,fs=2,Gi=4;function Cf(t,e,n){return e!=null?(e?us:0)|(e==="full"?fs:0):t&&t.whitespace=="pre"?us|fs:n&~Gi}class hs{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=be.none,this.stashMarks=[],this.match=s||(a&Gi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(B.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&us)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=B.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(B.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):VO(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!xf.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Mf{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=Cf(null,n.preserveWhitespace,0)|(r?Gi:0);i?o=new hs(i.type,i.attrs,be.none,be.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new hs(null,null,be.none,be.none,!0,null,s):o=new hs(e.schema.topNodeType,null,be.none,be.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.style;if(!r||!r.length)return n();let i=this.readStyles(e.style);if(!i)return;let[o,s]=i,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l]);n();for(let l=0;l<o.length;l++)this.removePendingMark(o[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&fs||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&us)r.options&fs?n=n.replace(/\r\n?/g,`
7
- `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),i;Sf.hasOwnProperty(r)&&this.parser.normalizeLists&&$O(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));if(o?o.ignore:AO.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,a=this.top,l=this.needsBlock;if(xf.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
8
- `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=be.none,r=be.none;for(let i=0,o=e.length;i<o;i++){let s=e.item(i);for(let a=void 0;;){let l=this.parser.matchStyle(s,e.getPropertyValue(s),this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(d=>{l.clearMark(d)&&(r=d.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let i=0;i<e.marks.length;i++)(!n.type||n.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let i=this.findPlace(e.create(n));return i&&this.enterInner(e,n,!0,r),i}enterInner(e,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=Cf(e,i,o.options);o.options&Gi&&o.content.length==0&&(s|=Gi),this.nodes.push(new hs(e,n,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}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;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 i=r.length-1;i>=0;i--)e+=r[i].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 i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].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,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=d&&u.groups.indexOf(d)==-1)return!1;l--}}return!0};return s(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}}addPendingMark(e){let n=PO(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function $O(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Sf.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function BO(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Of(t){let e={};for(let n in t)e[n]=t[n];return e}function VO(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:d,next:u}=a.edge(l);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}function PO(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class Gt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=il(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let d=s.marks[l];if(!this.marks[d.type.name]){l++;continue}if(!d.eq(o[a][0])||d.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let d=s.marks[l++],u=this.serializeMark(d,s.isInline,n);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Gt.renderSpec(il(n),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Gt.renderSpec(il(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,a=r?e.createElementNS(r,i):e.createElement(i),l=n[1],d=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){d=2;for(let u in l)if(l[u]!=null){let f=u.indexOf(" ");f>0?a.setAttributeNS(u.slice(0,f),u.slice(f+1),l[u]):a.setAttribute(u,l[u])}}for(let u=d;u<n.length;u++){let f=n[u];if(f===0){if(u<n.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Gt.renderSpec(e,f,r);if(a.appendChild(h),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Gt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Tf(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Tf(e.marks)}}function Tf(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function il(t){return t.document||window.document}const Ef=65535,_f=Math.pow(2,16);function IO(t,e){return t+e*_f}function Nf(t){return t&Ef}function RO(t){return(t-(t&Ef))/_f}const Df=1,Af=2,ps=4,$f=8;class ol{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&$f)>0}get deletedBefore(){return(this.delInfo&(Df|ps))>0}get deletedAfter(){return(this.delInfo&(Af|ps))>0}get deletedAcross(){return(this.delInfo&ps)>0}}class ht{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ht.empty)return ht.empty}recover(e){let n=0,r=Nf(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+RO(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 i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let d=this.ranges[a+o],u=this.ranges[a+s],f=l+d;if(e<=f){let h=d?e==l?-1:e==f?1:n:n,p=l+i+(h<0?0:u);if(r)return p;let m=e==(n<0?l:f)?null:IO(a/3,e-l),g=e==l?Af:e==f?Df:ps;return(n<0?e!=l:e!=f)&&(g|=$f),new ol(p,g,m)}i+=u-d}return r?e+i:new ol(e+i,0,null)}touches(e,n){let r=0,i=Nf(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let d=this.ranges[a+o],u=l+d;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(a,a+d,l,l+u),o+=u-d}}invert(){return new ht(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ht.empty:new ht(e<0?[0,-e,0]:[0,0,e])}}ht.empty=new ht([]);class qr{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new qr(this.maps,this.mirror,e,n)}copy(){return new qr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){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 i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i: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 i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new qr;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 i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new ol(e,i,null)}}const sl=Object.create(null);class Ye{getMap(){return ht.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=sl[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 sl)throw new RangeError("Duplicate use of step JSON ID "+e);return sl[e]=n,n.prototype.jsonID=e,n}}class _e{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new _e(e,null)}static fail(e){return new _e(null,e)}static fromReplace(e,n,r,i){try{return _e.ok(e.replace(n,r,i))}catch(o){if(o instanceof ss)return _e.fail(o.message);throw o}}}function al(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(al(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return B.fromArray(r)}class Pn extends Ye{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),i=r.node(r.sharedDepth(this.to)),o=new H(al(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return _e.fromReplace(e,this.from,this.to,o)}invert(){return new Kt(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 Pn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Pn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Pn(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 Pn(n.from,n.to,e.markFromJSON(n.mark))}}Ye.jsonID("addMark",Pn);class Kt extends Ye{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 H(al(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return _e.fromReplace(e,this.from,this.to,r)}invert(){return new Pn(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 Kt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Kt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Kt(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 Kt(n.from,n.to,e.markFromJSON(n.mark))}}Ye.jsonID("removeMark",Kt);class In extends Ye{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return _e.fromReplace(e,this.pos,this.pos+1,new H(B.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 i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new In(this.pos,n.marks[i]);return new In(this.pos,this.mark)}}return new Gr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new In(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 In(n.pos,e.markFromJSON(n.mark))}}Ye.jsonID("addNodeMark",In);class Gr extends Ye{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return _e.fromReplace(e,this.pos,this.pos+1,new H(B.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new In(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Gr(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 Gr(n.pos,e.markFromJSON(n.mark))}}Ye.jsonID("removeNodeMark",Gr);class Be extends Ye{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&ll(e,this.from,this.to)?_e.fail("Structure replace would overwrite content"):_e.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ht([this.from,this.to-this.from,this.slice.size])}invert(e){return new Be(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 Be(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Be)||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?H.empty:new H(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Be(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?H.empty:new H(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Be(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 Be(n.from,n.to,H.fromJSON(e,n.slice),!!n.structure)}}Ye.jsonID("replace",Be);class Ve extends Ye{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(ll(e,this.from,this.gapFrom)||ll(e,this.gapTo,this.to)))return _e.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return _e.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?_e.fromReplace(e,this.from,this.to,r):_e.fail("Content does not fit in gap")}getMap(){return new ht([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 Ve(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),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ve(n.pos,r.pos,i,o,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 Ve(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ye.jsonID("replaceAround",Ve);function ll(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function LO(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,d,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+l.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[g])?s.to=p:i.push(s=new Kt(h,p,f[g])));a&&a.to==h?a.to=p:o.push(a=new Pn(h,p,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function FO(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof ds){let d=s.marks,u;for(;u=r.isInSet(d);)(l||(l=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let d=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(a,e),to:d,step:o})}}}),i.forEach(s=>t.step(new Kt(s.from,s.to,s.style)))}function Bf(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let d=o.child(l),u=a+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Be(a,u,H.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Kt(a,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new H(B.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Be(a+h.index,a+h.index+h[0].length,m))}}a=u}if(!r.validEnd){let l=r.fillBefore(B.empty,!0);t.replace(a,a,new H(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function zO(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Kr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!zO(i,o,s))break}return null}function jO(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,d=a,u=B.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=B.from(r.node(m).copy(u)),f++):l--;let h=B.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=B.from(i.node(m).copy(h)),p++):d++;t.step(new Ve(l,d,s,a,new H(u.append(h),f,p),u.size-f,!0))}function cl(t,e,n=null,r=t){let i=HO(t,e),o=i&&WO(r,e);return o?i.map(Vf).concat({type:e,attrs:n}).concat(o.map(Vf)):null}function Vf(t){return{type:t,attrs:null}}function HO(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function WO(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;l&&d<i;d++)l=l.matchType(n.child(d).type);return!l||!l.validEnd?null:s}function YO(t,e,n){let r=B.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=B.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ve(i,o,i,o,new H(r,0,0),n.length,!0))}function UO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&KO(t.doc,t.mapping.slice(o).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?l=!1:!h&&p&&(l=!0)}l===!1&&GO(t,s,a,o),Bf(t,t.mapping.slice(o).map(a,1),r,void 0,l===null);let d=t.mapping.slice(o),u=d.map(a,1),f=d.map(a+s.nodeSize,1);return t.step(new Ve(u,f,u+1,f-1,new H(B.from(r.create(i,null,s.marks)),0,0),1,!0)),l===!0&&qO(t,s,a,o),!1}})}function qO(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function GO(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
9
- `))}})}function KO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function JO(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ve(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new H(B.from(s),0,0),1,!0))}function Jr(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function ZO(t,e,n=1,r){let i=t.doc.resolve(e),o=B.empty,s=B.empty;for(let a=i.depth,l=i.depth-n,d=n-1;a>l;a--,d--){o=B.from(i.node(a).copy(o));let u=r&&r[d];s=B.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new Be(e,e,new H(o.append(s),n,n),!0))}function Rn(t,e){let n=t.resolve(e),r=n.index();return Pf(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Pf(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function ms(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&Pf(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function XO(t,e,n){let r=new Be(e-n,e+n,H.empty,!0);t.step(r)}function QO(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 i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function If(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),d=r.node(s),u=!1;if(o==1)u=d.canReplace(l,l,i);else{let f=d.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function gs(t,e,n=e,r=H.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Rf(i,o,r)?new Be(e,n,r):new eT(i,o,r).fit()}function Rf(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class eT{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=B.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=B.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new H(o,s,a);return e>-1?new Ve(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Be(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=dl(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:d}=this.frontier[a],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(B.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=dl(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new H(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=dl(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new H(Ki(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new H(Ki(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,d=0,u=[],{match:f,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),y=f.matchType(g.type);if(!y)break;d++,(d>1||l==0||g.content.size)&&(f=y,u.push(Lf(g.mark(h.allowedMarks(g.marks)),d==1?l:0,d==a.childCount?p:-1)))}let m=d==a.childCount;m||(p=-1),this.placed=Ji(this.placed,n,B.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<p;g++){let w=y.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),y=w.content}this.unplaced=m?e==0?H.empty:new H(Ki(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new H(Ki(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!ul(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,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=ul(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:d}=this.frontier[a],u=ul(e,a,d,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?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=Ji(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ji(this.placed,this.depth,B.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(B.empty,!0);n.childCount&&(this.placed=Ji(this.placed,this.frontier.length,n))}}function Ki(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ki(t.firstChild.content,e-1,n)))}function Ji(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ji(t.lastChild.content,e-1,n)))}function dl(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Lf(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Lf(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(B.empty,!0)))),t.copy(r)}function ul(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!tT(n,o.content,s)?a:null}function tT(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function nT(t){return t.spec.defining||t.spec.definingForContent}function rT(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Rf(i,o,r))return t.step(new Be(e,n,r));let s=zf(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==p&&s.splice(1,0,-h)}let l=s.indexOf(a),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=nT(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+l)%s.length],w=!0;y<0&&(w=!1,y=-y);let v=i.node(y-1),T=i.index(y-1);if(v.canReplaceWith(T,T,m.type,m.marks))return t.replace(i.before(y),w?o.after(y):n,new H(Ff(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function Ff(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Ff(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(B.empty,!0))}return t}function iT(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=QO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new H(B.from(r),0,0))}function oT(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=zf(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function zf(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class Zr extends Ye{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 _e.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return _e.fromReplace(e,this.pos,this.pos+1,new H(B.from(i),0,n.isLeaf?0:1))}getMap(){return ht.empty}invert(e){return new Zr(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 Zr(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 Zr(n.pos,n.attr,n.value)}}Ye.jsonID("attr",Zr);class Zi extends Ye{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return _e.ok(r)}getMap(){return ht.empty}invert(e){return new Zi(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 Zi(n.attr,n.value)}}Ye.jsonID("docAttr",Zi);let Xr=class extends Error{};Xr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Xr.prototype=Object.create(Error.prototype),Xr.prototype.constructor=Xr,Xr.prototype.name="TransformError";class sT{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Xr(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=H.empty){let i=gs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new H(B.from(r),0,0))}delete(e,n){return this.replace(e,n,H.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return rT(this,e,n,r),this}replaceRangeWith(e,n,r){return iT(this,e,n,r),this}deleteRange(e,n){return oT(this,e,n),this}lift(e,n){return jO(this,e,n),this}join(e,n=1){return XO(this,e,n),this}wrap(e,n){return YO(this,e,n),this}setBlockType(e,n=e,r,i=null){return UO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return JO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Zr(e,n,r)),this}setDocAttribute(e,n){return this.step(new Zi(e,n)),this}addNodeMark(e,n){return this.step(new In(e,n)),this}removeNodeMark(e,n){if(!(n instanceof be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Gr(e,n)),this}split(e,n=1,r){return ZO(this,e,n,r),this}addMark(e,n,r){return LO(this,e,n,r),this}removeMark(e,n,r){return FO(this,e,n,r),this}clearIncompatible(e,n,r){return Bf(this,e,n,r),this}}const fl=Object.create(null);class se{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new aT(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=H.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:d}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(l.pos),u.map(d.pos),a?H.empty:n),a==0&&Wf(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),d=l.map(s.pos),u=l.map(a.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Wf(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new re(e):Qr(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Qr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Qr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Vt(e.node(0))}static atStart(e){return Qr(e,e,0,0,1)||new Vt(e)}static atEnd(e){return Qr(e,e,e.content.size,e.childCount,-1)||new Vt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=fl[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 fl)throw new RangeError("Duplicate use of selection JSON ID "+e);return fl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return re.between(this.$anchor,this.$head).getBookmark()}}se.prototype.visible=!0;class aT{constructor(e,n){this.$from=e,this.$to=n}}let jf=!1;function Hf(t){!jf&&!t.parent.inlineContent&&(jf=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class re extends se{constructor(e,n=e){Hf(e),Hf(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 se.near(r);let i=e.resolve(n.map(this.anchor));return new re(i.parent.inlineContent?i:r,r)}replace(e,n=H.empty){if(super.replace(e,n),n==H.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof re&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ys(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 re(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=se.findFrom(n,r,!0)||se.findFrom(n,-r,!0);if(o)n=o.$head;else return se.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(se.findFrom(e,-r,!0)||se.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new re(e,n)}}se.jsonID("text",re);class ys{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ys(e.map(this.anchor),e.map(this.head))}resolve(e){return re.between(e.resolve(this.anchor),e.resolve(this.head))}}class K extends se{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:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?se.near(o):new K(o)}content(){return new H(B.from(this.node),0,0)}eq(e){return e instanceof K&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new hl(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new K(e.resolve(n.anchor))}static create(e,n){return new K(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}K.prototype.visible=!1,se.jsonID("node",K);class hl{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ys(r,r):new hl(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&K.isSelectable(r)?new K(n):se.near(n)}}class Vt extends se{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=H.empty){if(n==H.empty){e.delete(0,e.doc.content.size);let r=se.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Vt(e)}map(e){return new Vt(e)}eq(e){return e instanceof Vt}getBookmark(){return lT}}se.jsonID("all",Vt);const lT={map(){return this},resolve(t){return new Vt(t)}};function Qr(t,e,n,r,i,o=!1){if(e.inlineContent)return re.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&K.isSelectable(a))return K.create(t,n-(i<0?a.nodeSize:0))}else{let l=Qr(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function Wf(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Be||i instanceof Ve))return;let o=t.mapping.maps[r],s;o.forEach((a,l,d,u)=>{s==null&&(s=u)}),t.setSelection(se.near(t.doc.resolve(s),n))}const Yf=1,bs=2,Uf=4;class cT extends sT{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|Yf)&~bs,this.storedMarks=null,this}get selectionSet(){return(this.updated&Yf)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=bs,this}ensureMarks(e){return be.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&bs)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~bs,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)||be.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(se.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|=Uf,this}get scrolledIntoView(){return(this.updated&Uf)>0}}function qf(t,e){return!e||!t?t:t.bind(e)}class Xi{constructor(e,n,r){this.name=e,this.init=qf(n.init,r),this.apply=qf(n.apply,r)}}const dT=[new Xi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Xi("selection",{init(t,e){return t.selection||se.atStart(e.doc)},apply(t){return t.selection}}),new Xi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Xi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class pl{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=dT.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 Xi(r.key,r.spec.state,r))})}}class ei{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 i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,d=i?i[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ei(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new cT(this)}static create(e){let n=new pl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ei(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new pl(this.schema,e.plugins),r=n.fields,i=new ei(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}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 i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.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 i=new pl(e.schema,e.plugins),o=new ei(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=dr.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=se.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],d=l.spec.state;if(l.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=d.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function Gf(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Gf(i,e,{})),n[r]=i}return n}class Ze{constructor(e){this.spec=e,this.props={},e.props&&Gf(e.props,this,this.props),this.key=e.key?e.key.key:Kf("plugin")}getState(e){return e[this.key]}}const ml=Object.create(null);function Kf(t){return t in ml?t+"$"+ ++ml[t]:(ml[t]=0,t+"$")}class Pt{constructor(e="key"){this.key=Kf(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const je=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Qi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let gl=null;const pn=function(t,e,n){let r=gl||(gl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},uT=function(){gl=null},fr=function(t,e,n,r){return n&&(Jf(t,e,n,r,-1)||Jf(t,e,n,r,1))},fT=/^(img|br|input|textarea|hr)$/i;function Jf(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Jt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||eo(t)||fT.test(t.nodeName)||t.contentEditable=="false")return!1;e=je(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Jt(t):0}else return!1}}function Jt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function hT(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=Jt(t)}else if(t.parentNode&&!eo(t))e=je(t),t=t.parentNode;else return null}}function pT(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&&!eo(t))e=je(t)+1,t=t.parentNode;else return null}}function mT(t,e,n){for(let r=e==0,i=e==Jt(t);r||i;){if(t==n)return!0;let o=je(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Jt(t)}}function eo(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 ks=function(t){return t.focusNode&&fr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function hr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function gT(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function yT(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Zt=typeof navigator<"u"?navigator:null,Zf=typeof document<"u"?document:null,Ln=Zt&&Zt.userAgent||"",yl=/Edge\/(\d+)/.exec(Ln),Xf=/MSIE \d/.exec(Ln),bl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ln),at=!!(Xf||bl||yl),Fn=Xf?document.documentMode:bl?+bl[1]:yl?+yl[1]:0,It=!at&&/gecko\/(\d+)/i.test(Ln);It&&+(/Firefox\/(\d+)/.exec(Ln)||[0,0])[1];const kl=!at&&/Chrome\/(\d+)/.exec(Ln),Xe=!!kl,bT=kl?+kl[1]:0,Qe=!at&&!!Zt&&/Apple Computer/.test(Zt.vendor),ti=Qe&&(/Mobile\/\w+/.test(Ln)||!!Zt&&Zt.maxTouchPoints>2),xt=ti||(Zt?/Mac/.test(Zt.platform):!1),kT=Zt?/Win/.test(Zt.platform):!1,Rt=/Android \d/.test(Ln),to=!!Zf&&"webkitFontSmoothing"in Zf.documentElement.style,wT=to?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function vT(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 mn(t,e){return typeof t=="number"?t:t[e]}function xT(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 Qf(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Qi(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,d=l?vT(o):xT(a),u=0,f=0;if(e.top<d.top+mn(r,"top")?f=-(d.top-e.top+mn(i,"top")):e.bottom>d.bottom-mn(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+mn(i,"top")-d.top:e.bottom-d.bottom+mn(i,"bottom")),e.left<d.left+mn(r,"left")?u=-(d.left-e.left+mn(i,"left")):e.right>d.right-mn(r,"right")&&(u=e.right-d.right+mn(i,"right")),u||f)if(l)o.defaultView.scrollBy(u,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let m=a.scrollLeft-h,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function ST(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:eh(t.dom)}}function eh(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Qi(r));return e}function CT({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;th(n,r==0?0:r-e)}function th(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ni=null;function MT(t){if(t.setActive)return t.setActive();if(ni)return t.focus(ni);let e=eh(t);t.focus(ni==null?{get preventScroll(){return ni={preventScroll:!0},!0}}:void 0),ni||(ni=!1,th(e,0))}function nh(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,d;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=pn(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=d,r=0),n&&n.nodeType==3?OT(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:nh(n,i)}function OT(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=zn(r,1);if(o.top!=o.bottom&&wl(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function wl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function TT(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function ET(t,e,n){let{node:r,offset:i}=nh(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function _T(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function rh(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let d=a[l];if(wl(e,d))return rh(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function NT(t,e){let n=t.dom.ownerDocument,r,i=0,o=yT(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!wl(e,d)||(s=rh(t.dom,e,d),!s))return null}if(Qe)for(let d=s;r&&d;d=Qi(d))d.draggable&&(r=void 0);if(s=TT(s,e),r){if(It&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;to&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=_T(t,r,i,e))}a==null&&(a=ET(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function ih(t){return t.top<t.bottom||t.left<t.right}function zn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(ih(r))return r}return Array.prototype.find.call(n,ih)||t.getBoundingClientRect()}const DT=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function oh(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=to||It;if(r.nodeType==3)if(s&&(DT.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=zn(pn(r,i,i),n);if(It&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=zn(pn(r,i-1,i-1),-1);if(d.top==l.top){let u=zn(pn(r,i,i+1),-1);if(u.top!=l.top)return no(u,u.left<d.left)}}return l}else{let l=i,d=i,u=n<0?1:-1;return n<0&&!i?(d++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:d++,no(zn(pn(r,l,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Jt(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return vl(l.getBoundingClientRect(),!1)}if(o==null&&i<Jt(r)){let l=r.childNodes[i];if(l.nodeType==1)return vl(l.getBoundingClientRect(),!0)}return vl(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Jt(r))){let l=r.childNodes[i-1],d=l.nodeType==3?pn(l,Jt(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(d)return no(zn(d,1),!1)}if(o==null&&i<Jt(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let d=l?l.nodeType==3?pn(l,0,s?0:1):l.nodeType==1?l:null:null;if(d)return no(zn(d,-1),!0)}return no(zn(r.nodeType==3?pn(r):r,-n),n>=0)}function no(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 vl(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 sh(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function AT(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return sh(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=oh(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=pn(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<l.length;d++){let u=l[d];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const $T=/[\u0590-\u08ac]/;function BT(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return!$T.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:sh(t,e,()=>{let{focusNode:l,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&d==g;try{a.collapse(u,f),l&&(l!=u||d!=f)&&a.extend&&a.extend(l,d)}catch{}return h!=null&&(a.caretBidiLevel=h),y})}let ah=null,lh=null,ch=!1;function VT(t,e,n){return ah==e&&lh==n?ch:(ah=e,lh=n,ch=n=="up"||n=="down"?AT(t,e,n):BT(t,e,n))}const St=0,dh=1,pr=2,Xt=3;class ro{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=St,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 i=this.children[n];if(i==e)return r;r+=i.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 o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>je(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}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 i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof hh){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof uh&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?je(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?je(o.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 i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],d=s+l.size;if(i==-1&&e<=d){let u=s+l.border;if(e>=u&&n<=d-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let f=a;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=je(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||a==this.children.length-1)){n=d;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=je(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}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,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let h=0,p=0;h<this.children.length;h++){let m=this.children[h],g=p+m.size;if(o>p&&s<g)return m.setSelection(e-p-m.border,n-p-m.border,r,i);p=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),d=r.getSelection(),u=!1;if((It||Qe)&&e==n){let{node:h,offset:p}=a;if(h.nodeType==3){if(u=!!(p&&h.nodeValue[p-1]==`
10
- `),u&&p==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:je(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=h.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(It&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||u&&Qe)&&fr(a.node,a.offset,d.anchorNode,d.anchorOffset)&&fr(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((d.extend||e==n)&&!u){d.collapse(a.node,a.offset);try{e!=n&&d.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(h)}}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,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?pr:dh,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Xt:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?pr:Xt}r=s}this.dirty=pr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?pr:dh;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class uh extends ro{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==St&&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 side(){return this.widget.type.side}}class PT extends ro{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}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 mr extends ro{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Gt.renderSpec(document,n.type.spec.toDOM(n,r))),new mr(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Xt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Xt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=St){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=St}}slice(e,n,r){let i=mr.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Cl(o,n,s,r)),e>0&&(o=Cl(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}class jn extends ro{constructor(e,n,r,i,o,s,a,l,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,d=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=d&&d.dom,f=d&&d.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:f}=Gt.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=gh(u,r,n),d?l=new IT(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new ws(e,n,r,i,u,h,o):new jn(e,n,r,i,u,f||null,h,o,s+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=()=>B.empty)}return e}matchesNode(e,n,r){return this.dirty==St&&e.eq(this.node)&&Sl(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,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new LT(this,s&&s.node,e);jT(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?l.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?be.none:this.node.child(u).marks,r,e),l.placeWidget(d,e,i)},(d,u,f,h)=>{l.syncToMarks(d.marks,r,e);let p;l.findNodeMatch(d,u,f,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(d,u,f,p,e)||l.updateNextNode(d,u,f,e,h,i)||l.addNode(d,u,f,e,i),i+=d.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==pr)&&(s&&this.protectLocalComposition(e,s),ph(this.contentDOM,this.children,e),ti&&HT(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof re)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=WT(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new PT(this,o,n,i);e.input.compositionNodes.push(s),this.children=Cl(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Xt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=St}updateOuterDeco(e){if(Sl(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=mh(this.dom,this.nodeDOM,xl(this.outerDeco,this.node,n),xl(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.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function fh(t,e,n,r,i){gh(r,e,t);let o=new jn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ws extends jn{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,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,i){return this.dirty==Xt||this.dirty!=St&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=St||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=St,!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 i=this.node.cut(e,n),o=document.createTextNode(i.text);return new ws(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Xt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class hh extends ro{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==St&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class IT extends jn{constructor(e,n,r,i,o,s,a,l,d,u){super(e,n,r,i,o,s,a,d,u),this.spec=l}update(e,n,r,i){if(this.dirty==Xt)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}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 ph(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=yh(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof mr){let l=r?r.previousSibling:t.lastChild;ph(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=yh(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const io=function(t){t&&(this.nodeName=t)};io.prototype=Object.create(null);const gr=[new io];function xl(t,e,n){if(t.length==0)return gr;let r=n?gr[0]:new io,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new io(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new io(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function mh(t,e,n,r){if(n==gr&&r==gr)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=gr[0]),i=l}RT(i,a||gr[0],s)}return i}function RT(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):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function gh(t,e,n){return mh(t,t,gr,xl(e,n,t.nodeType!=1))}function Sl(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 yh(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class LT{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=FT(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 i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=St,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let d=this.top.children[l];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=mr.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let d=this.top.children[a];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==Xt&&s.dom==s.contentDOM&&(s.dirty=pr),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),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 i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof jn){let d=this.preMatch.matched.get(l);if(d!=null&&d!=o)return!1;let u=l.dom,f,h=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Xt&&Sl(n,l.outerDeco));if(!h&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(l,e,n,r,i,s)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=pr,f.updateChildren(i,s+1),f.dirty=St),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let a=jn.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=jn.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new uh(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof mr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ws)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Qe||Xe)&&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 i=new hh(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function FT(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof mr)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function zT(t,e){return t.type.side-e.type.side}function jT(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let s=0,a=[],l=null;for(let d=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let y=i[s++];y.widget&&(u?(f||(f=[u])).push(y):u=y)}if(u)if(f){f.sort(zT);for(let y=0;y<f.length;y++)n(f[y],d,!!l)}else n(u,d,!!l);let h,p;if(l)p=-1,h=l,l=null;else if(d<t.childCount)p=d,h=t.child(d++);else break;for(let y=0;y<a.length;y++)a[y].to<=o&&a.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let y=m;s<i.length&&i[s].from<y&&(y=i[s].from);for(let w=0;w<a.length;w++)a[w].to<y&&(y=a[w].to);y<m&&(l=h.cut(y-o),h=h.cut(0,y-o),m=y,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let g=h.isInline&&!h.isLeaf?a.filter(y=>!y.inline):a.slice();r(h,g,e.forChild(o,h),p),o=m}}function HT(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 WT(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;l+=d.text}if(o>=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let d=a<r?l.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=n)return a+d;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Cl(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],d=a,u=a+=l.size;d>=n||u<=e?o.push(l):(d<e&&o.push(l.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-d,l.size,r)))}return o}function Ml(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,d;if(ks(n)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&K.isSelectable(u)&&i.parent&&!(u.isInline&&mT(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;d=new K(s==f?a:r.resolve(f))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!d){let u=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;d=Tl(t,l,a,u)}return d}function bh(t){return t.editable?t.hasFocus():Mh(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function gn(t,e=!1){let n=t.state.selection;if(xh(t,n),!!bh(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Xe){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&fr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)UT(t);else{let{anchor:r,head:i}=n,o,s;kh&&!(n instanceof re)&&(n.$from.parent.inlineContent||(o=wh(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=wh(t,n.to))),t.docView.setSelection(r,i,t.root,e),kh&&(o&&vh(o),s&&vh(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&YT(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const kh=Qe||Xe&&bT<63;function wh(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Qe&&i&&i.contentEditable=="false")return Ol(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Ol(i);if(o)return Ol(o)}}function Ol(t){return t.contentEditable="true",Qe&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function vh(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function YT(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!bh(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function UT(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,je(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&at&&Fn<=11&&(r.disabled=!0,r.disabled=!1)}function xh(t,e){if(e instanceof K){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Sh(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Sh(t)}function Sh(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Tl(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||re.between(e,n,r)}function Ch(t){return t.editable&&!t.hasFocus()?!1:Mh(t)}function Mh(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 qT(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return fr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function El(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&se.findFrom(o,e)}function Hn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Oh(t,e,n){let r=t.state.selection;if(r instanceof re)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Hn(t,new re(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=El(t.state,e);return i&&i instanceof K?Hn(t,i):!1}else if(!(xt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?K.isSelectable(o)?Hn(t,new K(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):to?Hn(t,new re(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof K&&r.node.isInline)return Hn(t,new re(e>0?r.$to:r.$from));{let i=El(t.state,e);return i?Hn(t,i):!1}}}function vs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function oo(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ri(t,e){return e<0?GT(t):KT(t)}function GT(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(It&&n.nodeType==1&&r<vs(n)&&oo(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(oo(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Th(n))break;{let a=n.previousSibling;for(;a&&oo(a,-1);)i=n.parentNode,o=je(a),a=a.previousSibling;if(a)n=a,r=vs(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?_l(t,n,r):i&&_l(t,i,o)}function KT(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=vs(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(oo(a,1))o=n,s=++r;else break}else{if(Th(n))break;{let a=n.nextSibling;for(;a&&oo(a,1);)o=a.parentNode,s=je(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=vs(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&_l(t,o,s)}function Th(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function JT(t,e){for(;t&&e==t.childNodes.length&&!eo(t);)e=je(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 ZT(t,e){for(;t&&!e&&!eo(t);)e=je(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 _l(t,e,n){if(e.nodeType!=3){let o,s;(s=JT(e,n))?(e=s,n=0):(o=ZT(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(ks(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&gn(t)},50)}function Eh(t,e){let n=t.state.doc.resolve(e);if(!(Xe||kT)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function _h(t,e,n){let r=t.state.selection;if(r instanceof re&&!r.empty||n.indexOf("s")>-1||xt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=El(t.state,e);if(s&&s instanceof K)return Hn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Vt?se.near(s,e):se.findFrom(s,e);return a?Hn(t,a):!1}return!1}function Nh(t,e){if(!(t.state.selection instanceof re))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function Dh(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function XT(t){if(!Qe||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;Dh(t,r,"true"),setTimeout(()=>Dh(t,r,"false"),20)}return!1}function QT(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function e2(t,e){let n=e.keyCode,r=QT(e);if(n==8||xt&&n==72&&r=="c")return Nh(t,-1)||ri(t,-1);if(n==46&&!e.shiftKey||xt&&n==68&&r=="c")return Nh(t,1)||ri(t,1);if(n==13||n==27)return!0;if(n==37||xt&&n==66&&r=="c"){let i=n==37?Eh(t,t.state.selection.from)=="ltr"?-1:1:-1;return Oh(t,i,r)||ri(t,i)}else if(n==39||xt&&n==70&&r=="c"){let i=n==39?Eh(t,t.state.selection.from)=="ltr"?1:-1:1;return Oh(t,i,r)||ri(t,i)}else{if(n==38||xt&&n==80&&r=="c")return _h(t,-1,r)||ri(t,-1);if(n==40||xt&&n==78&&r=="c")return XT(t)||_h(t,1,r)||ri(t,1);if(r==(xt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ah(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Gt.fromSchema(t.state.schema),a=Fh(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let d=l.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Rh[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.createElement(u[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),f++}d=l.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
11
-
12
- `);return{dom:l,text:h,slice:e}}function $h(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return e?new H(B.from(t.state.schema.text(e.replace(/\r\n?/g,`
13
- `))),0,0):H.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)a=f;else{let h=i.marks(),{schema:p}=t.state,m=Gt.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=r2(n),to&&i2(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Ur.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!t2.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=o2(Ih(a,+u[1],+u[2]),u[4]);else if(a=H.maxOpen(n2(a.content,i),!0),a.openStart||a.openEnd){let f=0,h=0;for(let p=a.content.firstChild;f<a.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=a.content.lastChild;h<a.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);a=Ih(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const t2=/^(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 n2(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),d;if(!l)return s=null;if(d=s.length&&o.length&&Vh(l,o,a,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Ph(s[s.length-1],o.length));let u=Bh(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return B.from(s)}return t}function Bh(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,B.from(t));return t}function Vh(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Vh(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(B.from(Bh(n,t,i+1))))}}function Ph(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Ph(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(B.empty,!0);return t.copy(n.append(r))}function Nl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=Nl(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(B.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Ih(t,e,n){return e<t.openStart&&(t=new H(Nl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new H(Nl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Rh={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 Lh=null;function Fh(){return Lh||(Lh=document.implementation.createHTMLDocument("title"))}function r2(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Fh().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Rh[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=t,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function i2(t){let e=t.querySelectorAll(Xe?"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 o2(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:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=B.from(l.create(r[a+1],i)),o++,s++}return new H(i,o,s)}const et={},tt={},s2={touchstart:!0,touchmove:!0};class a2{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=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 l2(t){for(let e in et){let n=et[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{d2(t,r)&&!Al(t,r)&&(t.editable||!(r.type in tt))&&n(t,r)},s2[e]?{passive:!0}:void 0)}Qe&&t.dom.addEventListener("input",()=>null),Dl(t)}function Wn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function c2(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 Dl(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Al(t,r))})}function Al(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function d2(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 u2(t,e){!Al(t,e)&&et[e.type]&&(t.editable||!(e.type in tt))&&et[e.type](t,e)}tt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!jh(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Rt&&Xe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ti&&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",i=>i(t,hr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||e2(t,n)?n.preventDefault():Wn(t,"key")},tt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},tt.keypress=(t,e)=>{let n=e;if(jh(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||xt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof re)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function xs(t){return{left:t.clientX,top:t.clientY}}function f2(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function $l(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ii(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function h2(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&K.isSelectable(r)?(ii(t,new K(n)),!0):!1}function p2(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof K&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(K.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(ii(t,K.create(t.state.doc,i)),!0):!1}function m2(t,e,n,r,i){return $l(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?p2(t,n):h2(t,n))}function g2(t,e,n,r){return $l(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function y2(t,e,n,r){return $l(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||b2(t,n,r)}function b2(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ii(t,re.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)ii(t,re.create(r,a+1,a+1+s.content.size));else if(K.isSelectable(s))ii(t,K.create(r,a));else continue;return!0}}function Bl(t){return Ss(t)}const zh=xt?"metaKey":"ctrlKey";et.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Bl(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&f2(n,t.input.lastClick)&&!n[zh]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(xs(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new k2(t,s,n,!!r)):(o=="doubleClick"?g2:y2)(t,s.pos,s.inside,n)?n.preventDefault():Wn(t,"pointer"))};class k2{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[zh],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof K&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&It&&!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)),Wn(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(()=>gn(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(xs(e))),this.updateAllowDefault(e),this.allowDefault||!n?Wn(this.view,"pointer"):m2(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Qe&&this.mightDrag&&!this.mightDrag.node.isAtom||Xe&&!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)?(ii(this.view,se.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Wn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Wn(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)}}et.touchstart=t=>{t.input.lastTouch=Date.now(),Bl(t),Wn(t,"pointer")},et.touchmove=t=>{t.input.lastTouch=Date.now(),Wn(t,"pointer")},et.contextmenu=t=>Bl(t);function jh(t,e){return t.composing?!0:Qe&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const w2=Rt?5e3:-1;tt.compositionstart=tt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ss(t,!0),t.markCursor=null;else if(Ss(t),It&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Hh(t,w2)},tt.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++,Hh(t,20))};function Hh(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ss(t),e))}function Wh(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=x2());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function v2(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=hT(e.focusNode,e.focusOffset),r=pT(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function x2(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ss(t,e=!1){if(!(Rt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Wh(t),e||t.docView&&t.docView.dirty){let n=Ml(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function S2(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(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const so=at&&Fn<15||ti&&wT<604;et.copy=tt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=so?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ah(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):S2(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function C2(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function M2(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 i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ao(t,r.value,null,i,e):ao(t,r.textContent,r.innerHTML,i,e)},50)}function ao(t,e,n,r,i){let o=$h(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||H.empty)))return!0;if(!o)return!1;let s=C2(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Yh(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," "):""}tt.paste=(t,e)=>{let n=e;if(t.composing&&!Rt)return;let r=so?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ao(t,Yh(r),r.getData("text/html"),i,n)?n.preventDefault():M2(t,n)};class Uh{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const qh=xt?"altKey":"ctrlKey";et.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(xs(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof K?i.to-1:i.to))){if(r&&r.mightDrag)s=K.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=K.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:d,slice:u}=Ah(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(so?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",so||n.dataTransfer.setData("text/plain",d),t.dragging=new Uh(u,!n[qh],s)},et.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},tt.dragover=tt.dragenter=(t,e)=>e.preventDefault(),tt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(xs(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=$h(t,Yh(n.dataTransfer),so?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[qh]);if(t.someProp("handleDrop",m=>m(t,n,s||H.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?If(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let d=t.state.tr;if(a){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=d.doc;if(f?d.replaceRangeWith(u,u,s.content.firstChild):d.replaceRange(u,u,s),d.doc.eq(h))return;let p=d.doc.resolve(u);if(f&&K.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new K(p));else{let m=d.mapping.map(l);d.mapping.maps[d.mapping.maps.length-1].forEach((g,y,w,v)=>m=v),d.setSelection(Tl(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},et.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())&&gn(t)},20))},et.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)},et.beforeinput=(t,e)=>{if(Xe&&Rt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,hr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in tt)et[t]=tt[t];function lo(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 Cs{constructor(e,n){this.toDOM=e,this.spec=n||yr,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new pt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Cs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&lo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Yn{constructor(e,n){this.attrs=e,this.spec=n||yr}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new pt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Yn&&lo(this.attrs,e.attrs)&&lo(this.spec,e.spec)}static is(e){return e.type instanceof Yn}destroy(){}}class Vl{constructor(e,n){this.attrs=e,this.spec=n||yr}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new pt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof Vl&&lo(this.attrs,e.attrs)&&lo(this.spec,e.spec)}destroy(){}}class pt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new pt(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 pt(e,e,new Cs(n,r))}static inline(e,n,r,i){return new pt(e,n,new Yn(r,i))}static node(e,n,r,i){return new pt(e,n,new Vl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Yn}get widget(){return this.type instanceof Cs}}const oi=[],yr={};class Ne{constructor(e,n){this.local=e.length?e:oi,this.children=n.length?n:oi}static create(e,n){return n.length?Ms(n,e,0,yr):Ue}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==Ue||e.maps.length==0?this:this.mapInner(e,n,0,0,r||yr)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?O2(this.children,s||[],e,n,r,i,o):s?new Ne(s.sort(br),oi):Ue}add(e,n){return n.length?this==Ue?Ne.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let d=l+r,u;if(u=Kh(n,a,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,d+1):i.splice(o,0,l,l+a.nodeSize,Ms(u,a,d+1,yr)),o+=3}});let s=Gh(o?Jh(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ne(s.length?this.local.concat(s).sort(br):this.local,i||this.children)}remove(e){return e.length==0||this==Ue?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,a+1);d!=Ue?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ne(i,r):Ue}forChild(e,n){if(this==Ue)return this;if(n.isLeaf)return Ne.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Yn){let d=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;d<u&&(i||(i=[])).push(l.copy(d,u))}}if(i){let a=new Ne(i.sort(br),oi);return r?new Un([a,r]):a}return r||Ue}eq(e){if(this==e)return!0;if(!(e instanceof Ne)||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 Pl(this.localsInner(e))}localsInner(e){if(this==Ue)return oi;if(e.inlineContent||!this.local.some(Yn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Yn||n.push(this.local[r]);return n}}Ne.empty=new Ne([],[]),Ne.removeOverlap=Pl;const Ue=Ne.empty;class Un{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,yr));return Un.from(r)}forChild(e,n){if(n.isLeaf)return Ne.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=Ue&&(o instanceof Un?r=r.concat(o.members):r.push(o))}return Un.from(r)}eq(e){if(!(e instanceof Un)||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 i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Pl(r?n:n.sort(br)):oi}static from(e){switch(e.length){case 0:return Ue;case 1:return e[0];default:return new Un(e.every(n=>n instanceof Ne)?e:e.reduce((n,r)=>n.concat(r instanceof Ne?r:r.members),[]))}}}function O2(t,e,n,r,i,o,s){let a=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let w=0;w<a.length;w+=3){let v=a[w+1];if(v<0||h>v+u-f)continue;let T=a[w]+u-f;p>=T?a[w+1]=h<=T?-2:-1:h>=u&&y&&(a[w]+=y,a[w+1]+=y)}f+=y}),u=n.maps[d].map(u,-1)}let l=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){l=!0,a[d+1]=-1;continue}let u=n.map(t[d]+o),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let h=n.map(t[d+1]+o,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let w=a[d+2].mapInner(n,y,u+1,t[d]+o+1,s);w!=Ue?(a[d]=f,a[d+1]=p,a[d+2]=w):(a[d+1]=-2,l=!0)}else l=!0}if(l){let d=T2(a,t,e,n,i,o,s),u=Ms(d,r,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<a.length&&a[h]<p;)h+=3;a.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ne(e.sort(br),a)}function Gh(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new pt(i.from+e,i.to+e,i.type))}return n}function T2(t,e,n,r,i,o,s){function a(l,d){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+d+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function Kh(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function Jh(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ms(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let d=Kh(t,a,l+n);if(d){o=!0;let u=Ms(d,a,n+l+1,r);u!=Ue&&i.push(l,l+a.nodeSize,u)}});let s=Gh(o?Jh(t):t,-n).sort(br);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ne(s,i):Ue}function br(t,e){return t.from-e.from||t.to-e.to}function Pl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Zh(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Zh(e,i,r.copy(o.from,r.to)));break}}}return e}function Zh(t,e,n){for(;e<t.length&&br(n,t[e])>0;)e++;t.splice(e,0,n)}function Il(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ue&&e.push(r)}),t.cursorWrapper&&e.push(Ne.create(t.state.doc,[t.cursorWrapper.deco])),Un.from(e)}const E2={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_2=at&&Fn<=11;class N2{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 D2{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new N2,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);at&&Fn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),_2&&(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,E2)),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(Ch(this.view)){if(this.suppressingSelectionUpdates)return gn(this.view);if(at&&Fn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&fr(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 o=e.focusNode;o;o=Qi(o))n.add(o);for(let o=e.anchorNode;o;o=Qi(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.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(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ch(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(It&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,h]=u;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of u){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||B2(e,f)!=p)&&h.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ks(r)&&(d=Ml(e))&&d.eq(se.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,gn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),A2(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||gn(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 f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(at&&Fn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?je(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?je(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,l,1);return{from:a,to:d}}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 Xh=new WeakMap,Qh=!1;function A2(t){if(!Xh.has(t)&&(Xh.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=It,Qh)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."),Qh=!0}}function ep(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return fr(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function $2(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return ep(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?ep(t,n):null}function B2(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 V2(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),d,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:l.anchorOffset}],ks(l)||d.push({node:l.focusNode,offset:l.focusOffset})),Xe&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let w=r.childNodes[y-1],v=w.pmViewDesc;if(w.nodeName=="BR"&&!v){o=y;break}if(!v||v.size)break}let f=t.state.doc,h=t.someProp("domParser")||Ur.fromSchema(t.state.schema),p=f.resolve(s),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:P2,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,w=d[1]&&d[1].pos;w==null&&(w=y),m={anchor:y+s,head:w+s}}return{doc:g,sel:m,from:s,to:a}}function P2(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Qe&&/^(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||Qe&&/^(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 I2=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function R2(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let N=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,L=Ml(t,N);if(L&&!t.state.selection.eq(L)){if(Xe&&Rt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",j=>j(t,hr(13,"Enter"))))return;let Z=t.state.tr.setSelection(L);N=="pointer"?Z.setMeta("pointer",!0):N=="key"&&Z.scrollIntoView(),o&&Z.setMeta("composition",o),t.dispatch(Z)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,d=V2(t,e,n),u=t.state.doc,f=u.slice(d.from,d.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=z2(f.content,d.doc.content,d.from,h,p);if((ti&&t.input.lastIOSEnter>Date.now()-225||Rt)&&i.some(N=>N.nodeType==1&&!I2.test(N.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",N=>N(t,hr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof re&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(d.sel){let N=tp(t,t.state.doc,d.sel);if(N&&!N.eq(t.state.selection)){let L=t.state.tr.setSelection(N);o&&L.setMeta("composition",o),t.dispatch(L)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof re&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),at&&Fn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),y=d.doc.resolveNoCache(m.endB-d.from),w=u.resolve(m.start),v=g.sameParent(y)&&g.parent.inlineContent&&w.end()>=m.endA,T;if((ti&&t.input.lastIOSEnter>Date.now()-225&&(!v||i.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!v&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(T=se.findFrom(d.doc.resolve(g.pos+1),1,!0))&&T.head==y.pos)&&t.someProp("handleKeyDown",N=>N(t,hr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&F2(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",N=>N(t,hr(8,"Backspace")))){Rt&&Xe&&t.domObserver.suppressSelectionUpdates();return}Xe&&Rt&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),Rt&&!v&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(N){return N(t,hr(13,"Enter"))})},20));let b=m.start,S=m.endA,k,C,_;if(v){if(g.pos==y.pos)at&&Fn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>gn(t),20)),k=t.state.tr.delete(b,S),C=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(_=L2(g.parent.content.cut(g.parentOffset,y.parentOffset),w.parent.content.cut(w.parentOffset,m.endA-w.start()))))k=t.state.tr,_.type=="add"?k.addMark(b,S,_.mark):k.removeMark(b,S,_.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let N=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",L=>L(t,b,S,N)))return;k=t.state.tr.insertText(N,b,S)}}if(k||(k=t.state.tr.replace(b,S,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let N=tp(t,k.doc,d.sel);N&&!(Xe&&Rt&&t.composing&&N.empty&&(m.start!=m.endB||t.input.lastAndroidDelete<Date.now()-100)&&(N.head==b||N.head==k.mapping.map(S)-1)||at&&N.empty&&N.head==b)&&k.setSelection(N)}C&&k.ensureMarks(C),o&&k.setMeta("composition",o),t.dispatch(k.scrollIntoView())}function tp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Tl(t,e.resolve(n.anchor),e.resolve(n.head))}function L2(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(l(e.child(u)));if(B.from(d).eq(t))return{mark:a,type:s}}function F2(t,e,n,r,i){if(n-e<=i.pos-r.pos||Rl(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Rl(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Rl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Rl(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function z2(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<e.size&&np(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=r<=o&&r>=a?o-r:0;o-=l,o&&o<t.size&&np(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function np(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 j2{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 a2,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(ap),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=op(this),ip(this),this.nodeViews=sp(this),this.docView=fh(this.state.doc,rp(this),Il(this),this.dom,this),this.domObserver=new D2(this,(r,i,o,s)=>R2(this,r,i,o,s)),this.domObserver.start(),l2(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&&Dl(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ap),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 i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Wh(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=sp(this);W2(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Dl(this),this.editable=op(this),ip(this);let l=Il(this),d=rp(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,d,l);(f||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&ST(this);if(s){this.domObserver.stop();let p=f&&(at||Xe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&H2(i.selection,e.selection);if(f){let m=Xe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=v2(this)),(o||!this.docView.update(e.doc,d,l,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=fh(e.doc,d,l,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&qT(this))?gn(this,p):(xh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&CT(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof K){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Qf(this,n.getBoundingClientRect(),e)}else Qf(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,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Uh(e.slice,e.move,i<0?void 0:K.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(at){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&&MT(this.dom),gn(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 NT(this,e)}coordsAtPos(e,n=1){return oh(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 i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return VT(this,n||this.state,e)}pasteHTML(e,n){return ao(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ao(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(c2(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Il(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,uT())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return u2(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return Qe&&this.root.nodeType===11&&gT(this.dom.ownerDocument)==this.dom&&$2(this,e)||e}domSelection(){return this.root.getSelection()}}function rp(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"),[pt.node(0,t.state.doc.content.size,e)]}function ip(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:pt.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function op(t){return!t.someProp("editable",e=>e(t.state)===!1)}function H2(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 sp(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function W2(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function ap(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")}for(var qn={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:"'"},Os={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Y2=typeof navigator<"u"&&/Mac/.test(navigator.platform),U2=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),He=0;He<10;He++)qn[48+He]=qn[96+He]=String(He);for(var He=1;He<=24;He++)qn[He+111]="F"+He;for(var He=65;He<=90;He++)qn[He]=String.fromCharCode(He+32),Os[He]=String.fromCharCode(He);for(var Ll in qn)Os.hasOwnProperty(Ll)||(Os[Ll]=qn[Ll]);function q2(t){var e=Y2&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||U2&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Os:qn)[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 G2=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function K2(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))G2?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function J2(t){let e=Object.create(null);for(let n in t)e[K2(n)]=t[n];return e}function Fl(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 Z2(t){return new Ze({props:{handleKeyDown:lp(t)}})}function lp(t){let e=J2(t);return function(n,r){let i=q2(r),o,s=e[Fl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Fl(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=qn[r.keyCode])&&o!=i){let a=e[Fl(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const X2=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function cp(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Q2=(t,e,n)=>{let r=cp(t,n);if(!r)return!1;let i=zl(r);if(!i){let s=r.blockRange(),a=s&&Kr(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&hp(t,i,e))return!0;if(r.parent.content.size==0&&(si(o,"end")||K.isSelectable(o))){let s=gs(t.doc,r.before(),r.after(),H.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(si(o,"end")?se.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):K.create(a.doc,i.pos-o.nodeSize)),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},eE=(t,e,n)=>{let r=cp(t,n);if(!r)return!1;let i=zl(r);return i?dp(t,i,e):!1},tE=(t,e,n)=>{let r=up(t,n);if(!r)return!1;let i=jl(r);return i?dp(t,i,e):!1};function dp(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let d=gs(t.doc,o,l,H.empty);if(!d||d.from!=o||d instanceof Be&&d.slice.size>=l-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(re.create(u.doc,o)),n(u.scrollIntoView())}return!0}function si(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 nE=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=zl(r)}let s=o&&o.nodeBefore;return!s||!K.isSelectable(s)?!1:(e&&e(t.tr.setSelection(K.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function zl(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 up(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const rE=(t,e,n)=>{let r=up(t,n);if(!r)return!1;let i=jl(r);if(!i)return!1;let o=i.nodeAfter;if(hp(t,i,e))return!0;if(r.parent.content.size==0&&(si(o,"start")||K.isSelectable(o))){let s=gs(t.doc,r.before(),r.after(),H.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(si(o,"start")?se.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):K.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},iE=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=jl(r)}let s=o&&o.nodeAfter;return!s||!K.isSelectable(s)?!1:(e&&e(t.tr.setSelection(K.create(t.doc,o.pos)).scrollIntoView()),!0)};function jl(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 oE=(t,e)=>{let n=t.selection,r=n instanceof K,i;if(r){if(n.node.isTextblock||!Rn(t.doc,n.from))return!1;i=n.from}else if(i=ms(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(K.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},sE=(t,e)=>{let n=t.selection,r;if(n instanceof K){if(n.node.isTextblock||!Rn(t.doc,n.to))return!1;r=n.to}else if(r=ms(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},aE=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Kr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},lE=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
14
- `).scrollIntoView()),!0)};function fp(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 cE=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=fp(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(se.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},dE=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Vt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=fp(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(re.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},uE=(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 o=n.before();if(Jr(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Kr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},fE=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(K.create(t.doc,i))),!0)};function hE(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Rn(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function hp(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(hE(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,h=B.empty;for(let g=o.length-1;g>=0;g--)h=B.from(o[g].create(null,h));h=B.from(r.copy(h));let p=t.tr.step(new Ve(e.pos-1,f,e.pos,f,new H(h,1,0),o.length,!0)),m=f+2*o.length;Rn(p.doc,m)&&p.join(m),n(p.scrollIntoView())}return!0}let l=se.findFrom(e,1),d=l&&l.$from.blockRange(l.$to),u=d&&Kr(d);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(d,u).scrollIntoView()),!0;if(a&&si(i,"start",!0)&&si(r,"end")){let f=r,h=[];for(;h.push(f),!f.isTextblock;)f=f.lastChild;let p=i,m=1;for(;!p.isTextblock;p=p.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let g=B.empty;for(let w=h.length-1;w>=0;w--)g=B.from(h[w].copy(g));let y=t.tr.step(new Ve(e.pos-h.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new H(g,h.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function pp(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(re.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const pE=pp(-1),mE=pp(1);function gE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&cl(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function mp(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,d)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function yE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new ls(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new ls(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let d=cl(l,t,e,s);return d?(r&&r(bE(n.tr,s,d,a,t).scrollIntoView()),!0):!1}}function bE(t,e,n,r,i){let o=B.empty;for(let u=n.length-1;u>=0;u--)o=B.from(n[u].type.create(n[u].attrs,o));t.step(new Ve(e.start-(r?2:0),e.end,e.start,e.end,new H(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,h=!0;u<f;u++,h=!1)!h&&Jr(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=d.child(u).nodeSize;return t}function kE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?wE(e,n,t,o):vE(e,n,o):!0:!1}}function wE(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Ve(o-1,s,o,s,new H(B.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ls(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Kr(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;return Rn(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function vE(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(a?0:1),u+1,s.content.append(l?B.empty:B.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Ve(f-(a?1:0),h+(l?1:0),f+1,h-1,new H((a?B.empty:B.from(i.copy(B.empty))).append(l?B.empty:B.from(i.copy(B.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function xE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let d=l.lastChild&&l.lastChild.type==a.type,u=B.from(d?t.create():null),f=new H(B.from(t.create(null,B.from(a.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Ve(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function Ts(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=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 o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Es{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const f=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,d=e||o.tr,u=()=>(!l&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),a.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...g)=>{const y=this.buildProps(d,n),w=p(...g)(y);return a.push(w),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,d])=>[l,(...u)=>d(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:Ts({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,d])=>[l,(...u)=>d(...u)(a)]))}};return a}}class SE{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function q(t,e,n){return t.config[e]===void 0&&t.parent?q(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?q(t.parent,e,n):null}):t.config[e]}function _s(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function gp(t){const e=[],{nodeExtensions:n,markExtensions:r}=_s(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=q(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([h,p])=>{e.push({type:f,name:h,attribute:{...o,...p}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=q(s,"addAttributes",a);if(!l)return;const d=l();Object.entries(d).forEach(([u,f])=>{const h={...o,...f};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function Pe(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 De(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],d=a.filter(u=>!l.includes(u));r[i]=[...l,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Hl(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>De(n,r),{})}function yp(t){return typeof t=="function"}function ae(t,e=void 0,...n){return yp(t)?e?t.bind(e)(...n):t(...n):t}function CE(t={}){return Object.keys(t).length===0&&t.constructor===Object}function ME(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function bp(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):ME(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function kp(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&CE(n)?!1:n!=null))}function OE(t,e){var n;const r=gp(t),{nodeExtensions:i,markExtensions:o}=_s(t),s=(n=i.find(d=>q(d,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(d=>{const u=r.filter(w=>w.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((w,v)=>{const T=q(v,"extendNodeSchema",f);return{...w,...T?T(d):{}}},{}),p=kp({...h,content:ae(q(d,"content",f)),marks:ae(q(d,"marks",f)),group:ae(q(d,"group",f)),inline:ae(q(d,"inline",f)),atom:ae(q(d,"atom",f)),selectable:ae(q(d,"selectable",f)),draggable:ae(q(d,"draggable",f)),code:ae(q(d,"code",f)),defining:ae(q(d,"defining",f)),isolating:ae(q(d,"isolating",f)),attrs:Object.fromEntries(u.map(w=>{var v;return[w.name,{default:(v=w==null?void 0:w.attribute)===null||v===void 0?void 0:v.default}]}))}),m=ae(q(d,"parseHTML",f));m&&(p.parseDOM=m.map(w=>bp(w,u)));const g=q(d,"renderHTML",f);g&&(p.toDOM=w=>g({node:w,HTMLAttributes:Hl(w,u)}));const y=q(d,"renderText",f);return y&&(p.toText=y),[d.name,p]})),l=Object.fromEntries(o.map(d=>{const u=r.filter(y=>y.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((y,w)=>{const v=q(w,"extendMarkSchema",f);return{...y,...v?v(d):{}}},{}),p=kp({...h,inclusive:ae(q(d,"inclusive",f)),excludes:ae(q(d,"excludes",f)),group:ae(q(d,"group",f)),spanning:ae(q(d,"spanning",f)),code:ae(q(d,"code",f)),attrs:Object.fromEntries(u.map(y=>{var w;return[y.name,{default:(w=y==null?void 0:y.attribute)===null||w===void 0?void 0:w.default}]}))}),m=ae(q(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>bp(y,u)));const g=q(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:Hl(y,u)})),[d.name,p]}));return new _O({topNode:s,nodes:a,marks:l})}function Wl(t,e){return e.nodes[t]||e.marks[t]||null}function wp(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const TE=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,d;const u=((d=(l=i.type.spec).toText)===null||d===void 0?void 0:d.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-o))}),n};function Yl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ns{constructor(e){this.find=e.find,this.handler=e.handler}}const EE=(t,e)=>{if(Yl(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 Ds(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const d=l.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=TE(d)+o;return s.forEach(h=>{if(u)return;const p=EE(f,h.find);if(!p)return;const m=l.state.tr,g=Ts({state:l.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:w,chain:v,can:T}=new Es({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:w,chain:v,can:T})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:o}),l.dispatch(m),u=!0)}),u}function _E(t){const{editor:e,rules:n}=t,r=new Ze({state:{init(){return null},apply(i,o){const s=i.getMeta(r);if(s)return s;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:d,text:u}=a,f=d+u.length;Ds({editor:e,from:d,to:f,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return Ds({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ds({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Ds({editor:e,from:s.pos,to:s.pos,text:`
15
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function NE(t){return typeof t=="number"}class DE{constructor(e){this.find=e.find,this.handler=e.handler}}const AE=(t,e,n)=>{if(Yl(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function $E(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:d,can:u}=new Es({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(p,m)=>{if(!p.isTextblock||p.type.spec.code)return;const g=Math.max(r,m),y=Math.min(i,m+p.content.size),w=p.textBetween(g-m,y-m,void 0,"");AE(w,o.find,s).forEach(T=>{if(T.index===void 0)return;const b=g+T.index+1,S=b+T[0].length,k={from:n.tr.mapping.map(b),to:n.tr.mapping.map(S)},C=o.handler({state:n,range:k,match:T,commands:l,chain:d,can:u,pasteEvent:s,dropEvent:a});f.push(C)})}),f.every(p=>p!==null)}const BE=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function VE(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const g=u.tr,y=Ts({state:u,transaction:g});if(!(!$E({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:a})||!g.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g};return n.map(u=>new Ze({view(f){const h=p=>{var m;r=!((m=f.dom.parentElement)===null||m===void 0)&&m.contains(p.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",h),{destroy(){window.removeEventListener("dragstart",h)}}},props:{handleDOMEvents:{drop:(f,h)=>(o=r===f.dom.parentElement,a=h,!1),paste:(f,h)=>{var p;const m=(p=h.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=h,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,w=m.getMeta("applyPasteRules"),v=!!w;if(!g&&!y&&!v)return;if(v){const{from:S,text:k}=w,C=S+k.length,_=BE(k);return l({rule:u,state:p,from:S,to:{b:C},pasteEvt:_})}const T=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!NE(T)||!b||T===b.b))return l({rule:u,state:p,from:T,to:b,pasteEvt:s})}}))}function PE(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class ai{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=ai.resolve(e),this.schema=OE(this.extensions,n),this.setupExtensions()}static resolve(e){const n=ai.sort(ai.flatten(e)),r=PE(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=q(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=q(r,"priority")||100,s=q(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Wl(n.name,this.schema)},i=q(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=ai.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Wl(s.name,this.schema)},l=[],d=q(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>Qt.handleExit({editor:e,mark:s})),d){const g=Object.fromEntries(Object.entries(d()).map(([y,w])=>[y,()=>w({editor:e})]));u={...u,...g}}const f=Z2(u);l.push(f);const h=q(s,"addInputRules",a);wp(s,e.options.enableInputRules)&&h&&r.push(...h());const p=q(s,"addPasteRules",a);wp(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=q(s,"addProseMirrorPlugins",a);if(m){const g=m();l.push(...g)}return l}).flat();return[_E({editor:e,rules:r}),...VE({editor:e,rules:i}),...o]}get attributes(){return gp(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=_s(this.extensions);return Object.fromEntries(n.filter(r=>!!q(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Pe(r.name,this.schema)},s=q(r,"addNodeView",o);if(!s)return[];const a=(l,d,u,f)=>{const h=Hl(l,i);return s()({editor:e,node:l,getPos:u,decorations:f,HTMLAttributes:h,extension:r})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Wl(e.name,this.schema)};e.type==="mark"&&(!((n=ae(q(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=q(e,"onBeforeCreate",r),o=q(e,"onCreate",r),s=q(e,"onUpdate",r),a=q(e,"onSelectionUpdate",r),l=q(e,"onTransaction",r),d=q(e,"onFocus",r),u=q(e,"onBlur",r),f=q(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}function IE(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ul(t){return IE(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function As(t,e){const n={...t};return Ul(t)&&Ul(e)&&Object.keys(e).forEach(r=>{Ul(e[r])?r in t?n[r]=As(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class qe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(q(this,"addOptions",{name:this.name}))),this.storage=ae(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qe(e)}configure(e={}){const n=this.extend();return n.parent=this.parent,n.options=As(this.options,e),n.storage=ae(q(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new qe({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(q(n,"addOptions",{name:n.name})),n.storage=ae(q(n,"addStorage",{name:n.name,options:n.options})),n}}function vp(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
16
-
17
- `,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,d,u,f)=>{var h;l.isBlock&&d>r&&(a+=o);const p=s==null?void 0:s[l.type.name];if(p)return u&&(a+=p({node:l,pos:d,parent:u,index:f,range:e})),!1;l.isText&&(a+=(h=l==null?void 0:l.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),a}function xp(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const RE=qe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ze({key:new Pt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=xp(n);return vp(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),LE=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),FE=(t=!1)=>({commands:e})=>e.setContent("",t),zE=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(l)),h=d.resolve(u.map(l+a.nodeSize)),p=f.blockRange(h);if(!p)return;const m=Kr(p);if(a.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},jE=t=>e=>t(e),HE=()=>({state:t,dispatch:e})=>dE(t,e),WE=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new re(r.doc.resolve(s-1))),!0},YE=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},UE=t=>({tr:e,state:n,dispatch:r})=>{const i=Pe(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),d=o.after(s);e.delete(l,d).scrollIntoView()}return!0}return!1},qE=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},GE=()=>({state:t,dispatch:e})=>X2(t,e),KE=()=>({commands:t})=>t.keyboardShortcut("Enter"),JE=()=>({state:t,dispatch:e})=>cE(t,e);function $s(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Yl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function ql(t,e,n={}){return t.find(r=>r.type===e&&$s(r.attrs,n))}function ZE(t,e,n={}){return!!ql(t,e,n)}function Gl(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=ql([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(ql([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&ZE([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Gn(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}const XE=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=Gn(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:d,to:u}=a;if(i){const f=Gl(l,o,e);if(f&&f.from<=d&&f.to>=u){const h=re.create(s,f.from,f.to);n.setSelection(h)}}return!0},QE=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 Kl(t){return t instanceof re}function yn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Sp(t,e=null){if(!e)return null;const n=se.atStart(t),r=se.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?re.create(t,yn(0,i,o),yn(t.content.size,i,o)):re.create(t,yn(e,i,o),yn(e,i,o))}function Jl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const e_=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Jl()&&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(o&&t===null&&!Kl(n.state.selection))return s(),!0;const a=Sp(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},t_=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),n_=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Cp=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&&Cp(r)}return t};function Mp(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Cp(n)}function Bs(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?B.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Bs("",e,n)}if(i){const o=Ur.fromSchema(e);return n.slice?o.parseSlice(Mp(t),n.parseOptions).content:o.parse(Mp(t),n.parseOptions)}return Bs("",e,n)}function r_(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Be||i instanceof Ve))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,l,d,u)=>{s===0&&(s=u)}),t.setSelection(se.near(t.doc.resolve(s),n))}const i_=t=>t.toString().startsWith("<"),o_=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const s=Bs(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,u=!0;if((i_(s)?s:[s]).forEach(p=>{p.check(),d=d?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),a===l&&u){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,l+=1)}let h;d?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,a,l)):(h=s,r.replaceWith(a,l,h)),n.updateSelection&&r_(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:h})}return!0},s_=()=>({state:t,dispatch:e})=>oE(t,e),a_=()=>({state:t,dispatch:e})=>sE(t,e),l_=()=>({state:t,dispatch:e})=>Q2(t,e),c_=()=>({state:t,dispatch:e})=>rE(t,e),d_=()=>({tr:t,state:e,dispatch:n})=>{try{const r=ms(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},u_=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ms(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},f_=()=>({state:t,dispatch:e})=>eE(t,e),h_=()=>({state:t,dispatch:e})=>tE(t,e);function Op(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function p_(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Jl()||Op()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const m_=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=p_(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return l==null||l.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function co(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Pe(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);a.push({node:f,from:p,to:m})});const l=i-r,d=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>$s(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=l}const g_=(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return co(n,i,e)?aE(n,r):!1},y_=()=>({state:t,dispatch:e})=>uE(t,e),b_=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return kE(r)(e,n)},k_=()=>({state:t,dispatch:e})=>lE(t,e);function Vs(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Tp(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const w_=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Vs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Pe(t,r.schema)),a==="mark"&&(s=Gn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(d,u)=>{o&&o===d.type&&n.setNodeMarkup(u,void 0,Tp(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Tp(f.attrs,e)))})})}),!0):!1},v_=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),x_=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),S_=()=>({state:t,dispatch:e})=>nE(t,e),C_=()=>({state:t,dispatch:e})=>iE(t,e),M_=()=>({state:t,dispatch:e})=>fE(t,e),O_=()=>({state:t,dispatch:e})=>mE(t,e),T_=()=>({state:t,dispatch:e})=>pE(t,e);function Ep(t,e,n={}){return Bs(t,e,{slice:!1,parseOptions:n})}const E_=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Ep(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0};function Ps(t,e){const n=Gn(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function __(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 N_(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 Zl(t){return e=>N_(e.$from,t)}function D_(t,e){const n=Gt.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function A_(t,e){const n={from:0,to:t.content.size};return vp(t,n,e)}function $_(t,e){const n=Pe(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function B_(t,e){const n=Vs(typeof e=="string"?e:e.name,t.schema);return n==="node"?$_(t,e):n==="mark"?Ps(t,e):{}}function _p(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=Gl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Is(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Xl(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Gn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>$s(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const w=Math.max(p,y),v=Math.min(m,y+g.nodeSize),T=v-w;s+=T,a.push(...g.marks.map(b=>({mark:b,from:w,to:v})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>$s(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(l>0?l+d:l)>=s}function V_(t,e,n={}){if(!e)return co(t,null,n)||Xl(t,null,n);const r=Vs(e,t.schema);return r==="node"?co(t,e,n):r==="mark"?Xl(t,e,n):!1}function Np(t,e){const{nodeExtensions:n}=_s(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ae(q(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function P_(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function I_(t){return t instanceof K}function Dp(t,e,n){const i=t.state.doc.content.size,o=yn(e,0,i),s=yn(n,0,i),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),d=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),h=Math.max(a.right,l.right),p=h-f,m=u-d,w={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...w,toJSON:()=>w}}function R_(t,e,n){var r;const{selection:i}=e;let o=null;if(Kl(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let d=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,f,h)=>{if(d)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));d=p&&m}return!d}),d})}const L_=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Gn(t,r.schema);if(i)if(s){const d=Ps(r,l);n.addStoredMark(l.create({...d,...e}))}else a.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),g=Math.min(p+h.nodeSize,f);h.marks.find(w=>w.type===l)?h.marks.forEach(w=>{l===w.type&&n.addMark(m,g,l.create({...w.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return R_(r,n,l)},F_=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),z_=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Pe(t,n.schema);return o.isTextblock?i().command(({commands:s})=>mp(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>mp(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},j_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=yn(t,0,r.content.size),o=K.create(r,i);e.setSelection(o)}return!0},H_=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=re.atStart(r).from,a=re.atEnd(r).to,l=yn(i,s,a),d=yn(o,s,a),u=re.create(r,l,d);e.setSelection(u)}return!0},W_=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return xE(r)(e,n)};function Ap(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const Y_=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,d=i.extensionManager.attributes,u=Is(d,a.node().type.name,a.node().attrs);if(o instanceof K&&o.node.isBlock)return!a.parentOffset||!Jr(s,a.pos)?!1:(r&&(t&&Ap(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof re&&e.deleteSelection();const h=a.depth===0?void 0:__(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Jr(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&Jr(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),m&&(e.split(e.mapping.map(a.pos),1,p),h&&!f&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Ap(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},U_=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Pe(t,n.schema),{$from:a,$to:l}=n.selection,d=n.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let y=B.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let C=a.depth-w;C>=a.depth-3;C-=1)y=B.from(a.node(C).copy(y));const v=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,T=Is(f,a.node().type.name,a.node().attrs),b=((o=s.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(T))||void 0;y=y.append(B.from(s.createAndFill(null,b)||void 0));const S=a.before(a.depth-(w-1));e.replace(S,a.after(-v),new H(y,4-w,0));let k=-1;e.doc.nodesBetween(S,e.doc.content.size,(C,_)=>{if(k>-1)return!1;C.isTextblock&&C.content.size===0&&(k=_+1)}),k>-1&&e.setSelection(re.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const h=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,p=Is(f,u.type.name,u.attrs),m=Is(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const g=h?[{type:s,attrs:p},{type:h,attrs:m}]:[{type:s,attrs:p}];if(!Jr(e.doc,a.pos,2))return!1;if(r){const{selection:y,storedMarks:w}=n,{splittableMarks:v}=i.extensionManager,T=w||y.$to.parentOffset&&y.$from.marks();if(e.split(a.pos,2,g).scrollIntoView(),!T||!r)return!0;const b=T.filter(S=>v.includes(S.type.name));e.ensureMarks(b)}return!0},Ql=(t,e)=>{const n=Zl(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 i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Rn(t.doc,n.pos)&&t.join(n.pos),!0},ec=(t,e)=>{const n=Zl(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 i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Rn(t.doc,r)&&t.join(r),!0};var q_=Object.freeze({__proto__:null,blur:LE,clearContent:FE,clearNodes:zE,command:jE,createParagraphNear:HE,cut:WE,deleteCurrentNode:YE,deleteNode:UE,deleteRange:qE,deleteSelection:GE,enter:KE,exitCode:JE,extendMarkRange:XE,first:QE,focus:e_,forEach:t_,insertContent:n_,insertContentAt:o_,joinUp:s_,joinDown:a_,joinBackward:l_,joinForward:c_,joinItemBackward:d_,joinItemForward:u_,joinTextblockBackward:f_,joinTextblockForward:h_,keyboardShortcut:m_,lift:g_,liftEmptyBlock:y_,liftListItem:b_,newlineInCode:k_,resetAttributes:w_,scrollIntoView:v_,selectAll:x_,selectNodeBackward:S_,selectNodeForward:C_,selectParentNode:M_,selectTextblockEnd:O_,selectTextblockStart:T_,setContent:E_,setMark:L_,setMeta:F_,setNode:z_,setNodeSelection:j_,setTextSelection:H_,sinkListItem:W_,splitBlock:Y_,splitListItem:U_,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Pe(t,s.schema),m=Pe(e,s.schema),{selection:g,storedMarks:y}=s,{$from:w,$to:v}=g,T=w.blockRange(v),b=y||g.$to.parentOffset&&g.$from.marks();if(!T)return!1;const S=Zl(k=>Np(k.type.name,f))(g);if(T.depth>=1&&S&&T.depth-S.depth<=1){if(S.node.type===p)return d.liftListItem(m);if(Np(S.node.type.name,f)&&p.validContent(S.node.content)&&a)return l().command(()=>(o.setNodeMarkup(S.pos,p),!0)).command(()=>Ql(o,p)).command(()=>ec(o,p)).run()}return!n||!b||!a?l().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>Ql(o,p)).command(()=>ec(o,p)).run():l().command(()=>{const k=u().wrapInList(p,r),C=b.filter(_=>h.includes(_.type.name));return o.ensureMarks(C),k?!0:d.clearNodes()}).wrapInList(p,r).command(()=>Ql(o,p)).command(()=>ec(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Gn(t,r.schema);return Xl(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Pe(t,r.schema),s=Pe(e,r.schema);return co(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Pe(t,n.schema);return co(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Gn(t,r.schema),{$from:d,empty:u,ranges:f}=a;if(!i)return!0;if(u&&s){let{from:h,to:p}=a;const m=(o=d.marks().find(y=>y.type===l))===null||o===void 0?void 0:o.attrs,g=Gl(d,l,m);g&&(h=g.from,p=g.to),n.removeMark(h,p,l)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Vs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Pe(t,r.schema)),a==="mark"&&(s=Gn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const d=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(d,u,(f,h)=>{o&&o===f.type&&n.setNodeMarkup(h,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(p=>{if(s===p.type){const m=Math.max(h,d),g=Math.min(h+f.nodeSize,u);n.addMark(m,g,s.create({...p.attrs,...e}))}})})}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return gE(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return yE(i,e)(n,r)}});const G_=qe.create({name:"commands",addCommands(){return{...q_}}}),K_=qe.create({name:"editable",addProseMirrorPlugins(){return[new Ze({key:new Pt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),J_=qe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ze({key:new Pt("focusEvents"),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}}}})]}}),Z_=qe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:d}=a,{empty:u,$anchor:f}=l,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?a.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,w=g&&m.parent.childCount===1?y===f.pos:se.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!w||w&&f.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()]),r={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()},i={...r},o={...r,"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 Jl()||Op()?o:i},addProseMirrorPlugins(){return[new Ze({key:new Pt("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(m=>m.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=se.atStart(e.doc).from,l=se.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,h=Ts({state:n,transaction:f}),{commands:p}=new Es({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),X_=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new Ze({key:new Pt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class kr{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}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!==void 0?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 kr(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 kr(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 kr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const a=new kr(s,this.editor,i,i?n:null);i&&(a.actualDepth=this.depth+1),e.push(new kr(s,this.editor,i,i?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,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const Q_=`.ProseMirror {
5
+ */function Me(t){return typeof t=="function"}function ra(t){return t==null}const Yt=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Ro(t){return Number(t)>=0}function Yh(t){const e=parseFloat(t);return isNaN(e)?t:e}function Zh(t){return typeof t=="object"&&t!==null}function Xh(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ia(t){if(!Zh(t)||Xh(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Br(t,e){return Object.keys(e).forEach(n=>{if(ia(e[n])&&ia(t[n])){t[n]||(t[n]={}),Br(t[n],e[n]);return}t[n]=e[n]}),t}function Ar(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Ro(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const oa={};function pt(t,e){ep(t,e),oa[t]=e}function Qh(t){return oa[t]}function ep(t,e){if(!Me(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function sa(t,e,n){typeof n.value=="object"&&(n.value=me(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function me(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(me(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(me(l),me(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(me(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)sa(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||sa(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Dr=Symbol("vee-validate-form"),la=Symbol("vee-validate-field-instance"),Ci=Symbol("Default empty value"),tp=typeof window<"u";function Lo(t){return Me(t)&&!!t.__locatorRef}function mt(t){return!!t&&Me(t.parse)&&t.__type==="VVTypedSchema"}function Oi(t){return!!t&&Me(t.validate)}function Vr(t){return t==="checkbox"||t==="radio"}function np(t){return Yt(t)||Array.isArray(t)}function rp(t){return Array.isArray(t)?t.length===0:Yt(t)&&Object.keys(t).length===0}function Ei(t){return/^\[.+\]$/i.test(t)}function ip(t){return aa(t)&&t.multiple}function aa(t){return t.tagName==="SELECT"}function op(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function sp(t,e){return!op(t,e)&&e.type!=="file"&&!Vr(e.type)}function ca(t){return zo(t)&&t.target&&"submit"in t.target}function zo(t){return t?!!(typeof Event<"u"&&Me(Event)&&t instanceof Event||t&&t.srcElement):!1}function da(t,e){return e in t&&t[e]!==Ci}function Le(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!Le(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!Le(r[1],e.get(r[0])))return!1;return!0}if(ua(t)&&ua(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!Le(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function ua(t){return tp?t instanceof File:!1}function Fo(t){return Ei(t)?t.replace(/\[|\]/gi,""):t}function Ue(t,e,n){return t?Ei(e)?t[Fo(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>np(i)&&o in i?i[o]:n,t):n}function Rt(t,e,n){if(Ei(e)){t[Fo(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||ra(i[r[o]]))&&(i[r[o]]=Ro(r[o+1])?[]:{}),i=i[r[o]]}}function jo(t,e){if(Array.isArray(t)&&Ro(e)){t.splice(Number(e),1);return}Yt(t)&&delete t[e]}function fa(t,e){if(Ei(e)){delete t[Fo(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){jo(r,n[o]);break}if(!(n[o]in r)||ra(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>Ue(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(rp(i[o])){if(o===0){jo(t,n[0]);continue}jo(i[o-1],n[o-1])}}function Ke(t){return Object.keys(t)}function Ho(t,e=void 0){const n=c.getCurrentInstance();return(n==null?void 0:n.provides[t])||c.inject(t,e)}function ha(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>Le(o,e));return i>=0?r.splice(i,1):r.push(e),r}return Le(t,e)?n:e}function lp(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function pa(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function ap(t,e){return Yt(e)&&e.number?Yh(t):t}function Wo(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function qo(t){return Array.isArray(t)?t:t?[t]:[]}function Mi(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function cp(t){let e=null,n=[];return function(...r){const i=c.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function Uo(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function Ko(t){if(ma(t))return t._value}function ma(t){return"_value"in t}function dp(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Ti(t){if(!zo(t))return t;const e=t.target;if(Vr(e.type)&&ma(e))return Ko(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(ip(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Ko);if(aa(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Ko(n):e.value}return dp(e)}function ga(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Yt(t)&&t._$$isNormalized?t:Yt(t)?Object.keys(t).reduce((n,r)=>{const i=up(t[r]);return t[r]!==!1&&(n[r]=ya(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=fp(r);return i.name&&(n[i.name]=ya(i.params)),n},e):e}function up(t){return t===!0?[]:Array.isArray(t)||Yt(t)?t:[t]}function ya(t){const e=n=>typeof n=="string"&&n[0]==="@"?hp(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const fp=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function hp(t){const e=n=>Ue(n,t)||n[t];return e.__locatorRef=t,e}function pp(t){return Array.isArray(t)?t.filter(Lo):Ke(t).filter(e=>Lo(t[e])).map(e=>t[e])}let mp=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const vn=()=>mp;async function ba(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await gp(i,t)).errors;return{errors:s,valid:!s.length}}async function gp(t,e){if(mt(t.rules)||Oi(t.rules))return bp(e,t.rules);if(Me(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},l=Array.isArray(t.rules)?t.rules:[t.rules],a=l.length,d=[];for(let u=0;u<a;u++){const f=l[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:va(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:ga(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],a=await kp(n,e,{name:l,params:n.rules[l]});if(a.error&&(r.push(a.error),t.bails))return{errors:r}}return{errors:r}}function yp(t){return!!t&&t.name==="ValidationError"}function ka(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!yp(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,l)=>{const a=l.path||"";return s[a]||(s[a]={errors:[],path:a}),s[a].errors.push(...l.errors),s},{});return{errors:Object.values(o)}}}}}async function bp(t,e){const r=await(mt(e)?e:ka(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function kp(t,e,n){const r=Qh(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=vp(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:va(o)}}function va(t){const e=vn().generateMessage;return e?e(t):"Field is invalid"}function vp(t,e){const n=r=>Lo(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function xp(t,e){const r=await(mt(t)?t:ka(t)).parse(me(e)),i={},o={};for(const s of r.errors){const l=s.errors,a=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[a]={valid:!l.length,errors:l},l.length&&(o[a]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function wp(t,e,n){const i=Ke(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await ba(Ue(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),l={},a={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,a[d.path]=d.errors[0]);return{valid:o,results:l,errors:a}}let xa=0;function Sp(t,e){const{value:n,initialValue:r,setInitialValue:i}=Cp(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:a,setErrors:d}=Mp(),u=xa>=Number.MAX_SAFE_INTEGER?0:++xa,f=Ep(n,r,a,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:a,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=c.computed(()=>o.errors);function l(a){var d,u,f;"value"in a&&(n.value=a.value),"errors"in a&&((d=e.form)===null||d===void 0||d.setFieldError(c.unref(t),a.errors)),"touched"in a&&((u=e.form)===null||u===void 0||u.setFieldTouched(c.unref(t),(f=a.touched)!==null&&f!==void 0?f:!1)),"initialValue"in a&&i(a.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:l}}function Cp(t,e,n){const r=c.ref(c.unref(e));function i(){return n?Ue(n.initialValues.value,c.unref(t),c.unref(r)):c.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(c.unref(t),d,!0)}const s=c.computed(i);if(!n)return{value:c.ref(i()),initialValue:s,setInitialValue:o};const l=Op(e,n,s,t);return n.stageInitialValue(c.unref(t),l,!0),{value:c.computed({get(){return Ue(n.values,c.unref(t))},set(d){n.setFieldValue(c.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function Op(t,e,n,r){return c.isRef(t)?c.unref(t):t!==void 0?t:Ue(e.values,c.unref(r),c.unref(n))}function Ep(t,e,n,r){const i=c.computed(()=>{var s,l,a;return(a=(l=(s=c.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&a!==void 0?a:!1}),o=c.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!c.unref(n).length,initialValue:c.computed(()=>c.unref(e)),dirty:c.computed(()=>!Le(c.unref(t),c.unref(e)))});return c.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function Mp(){const t=c.ref([]);return{errors:t,setErrors:e=>{t.value=qo(e)}}}function wa(t){process.env.NODE_ENV!=="production"&&Gh({id:"vee-validate-devtools-plugin",label:"VeeValidate Plugin",packageName:"vee-validate",homepage:"https://vee-validate.logaretm.com/v4",app:t,logo:"https://vee-validate.logaretm.com/v4/logo.png"},Np)}const _r={},Ir={};let Lt;const Wn=lp(()=>{setTimeout(async()=>{await c.nextTick(),Lt==null||Lt.sendInspectorState(qn),Lt==null||Lt.sendInspectorTree(qn)},100)},100);function Tp(t){const e=c.getCurrentInstance();if(!Lt){const n=e==null?void 0:e.appContext.app;if(!n)return;wa(n)}_r[t.formId]=Object.assign({},t),_r[t.formId]._vm=e,c.onUnmounted(()=>{delete _r[t.formId],Wn()}),Wn()}function $p(t){const e=c.getCurrentInstance();if(!Lt){const n=e==null?void 0:e.appContext.app;if(!n)return;wa(n)}Ir[t.id]=Object.assign({},t),Ir[t.id]._vm=e,c.onUnmounted(()=>{delete Ir[t.id],Wn()}),Wn()}const qn="vee-validate-inspector",Je={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let we=null;function Np(t){Lt=t,t.addInspector({id:qn,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!we){console.error("There is not a valid selected vee-validate node or component");return}if(we.type==="field"){await we.field.validate();return}if(we.type==="form"){await we.form.validate();return}we.type==="pathState"&&await we.form.validateField(we.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!we){console.error("There is not a valid selected vee-validate node or component");return}if(we.type==="field"){we.field.resetField();return}we.type==="form"&&we.form.resetForm(),we.type==="pathState"&&we.form.resetField(we.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==qn)return;const n=Object.values(_r),r=Object.values(Ir);e.rootNodes=[...n.map(Bp),...r.map(i=>Dp(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==qn||n.currentTab!==`custom-inspector:${qn}`)return;const{form:r,field:i,state:o,type:s}=Vp(e.nodeId);if(r&&s==="form"){e.state=_p(r),we={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Ca(o),we={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Ca({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),we={field:i,type:"field"};return}we=null})}function Bp(t){const{textColor:e,bgColor:n}=Oa(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{Rt(r,c.unref(s.path),Ap(s,t))});function i(s,l=[]){const a=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:a||s.label}):Yt(s)?{id:`${l.join(".")}`,label:a||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${a}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:Jo(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Je.white,backgroundColor:Je.unknown}]}}function Ap(t,e){return{id:Jo(e,t),label:c.unref(t.path),tags:Sa(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Dp(t,e){return{id:Jo(e,t),label:c.unref(t.name),tags:Sa(!1,1,t.type,t.meta.valid,e)}}function Sa(t,e,n,r,i){const{textColor:o,bgColor:s}=Oa(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Je.black,backgroundColor:Je.gray},n==="checkbox"?{label:"Checkbox",textColor:Je.white,backgroundColor:Je.blue}:void 0,n==="radio"?{label:"Radio",textColor:Je.white,backgroundColor:Je.purple}:void 0,t?{label:"Multiple",textColor:Je.black,backgroundColor:Je.orange}:void 0].filter(Boolean)}function Jo(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:c.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function Vp(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=_r[e.f];if(!n&&e.ff){const i=Ir[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function Ca(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function _p(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:Ke(e.value).reduce((l,a)=>{var d;const u=(d=e.value[a])===null||d===void 0?void 0:d[0];return u&&(l[a]=u),l},{})}]}}function Oa(t){return{bgColor:t?Je.success:Je.error,textColor:t?Je.black:Je.white}}function Ip(t,e,n){return Vr(n==null?void 0:n.type)?Rp(t,e,n):Ea(t,e,n)}function Ea(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:a,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=Pp(n),y=f?Ho(Dr):void 0,g=m||y,v=c.computed(()=>Ar(c.toValue(t))),x=c.computed(()=>{if(c.toValue(g==null?void 0:g.schema))return;const Z=c.unref(e);return Oi(Z)||mt(Z)||Me(Z)||Array.isArray(Z)?Z:ga(Z)}),T=!Me(x.value)&&mt(c.toValue(e)),{id:b,value:S,initialValue:k,meta:C,setState:D,errors:A,flags:R}=Sp(v,{modelValue:r,form:g,bails:o,label:a,type:s,validate:x.value?$:void 0,schema:T?e:void 0}),F=c.computed(()=>A.value[0]);p&&Lp({value:S,prop:p,handleChange:O,shouldValidate:()=>d&&!R.pendingReset});const j=(z,Z=!1)=>{C.touched=!0,Z&&B()};async function _(z){var Z,ue;if(g!=null&&g.validateSchema){const{results:re}=await g.validateSchema(z);return(Z=re[c.toValue(v)])!==null&&Z!==void 0?Z:{valid:!0,errors:[]}}return x.value?ba(S.value,x.value,{name:c.toValue(v),label:c.toValue(a),values:(ue=g==null?void 0:g.values)!==null&&ue!==void 0?ue:{},bails:o}):{valid:!0,errors:[]}}const B=Wo(async()=>(C.pending=!0,C.validated=!0,_("validated-only")),z=>(R.pendingUnmount[oe.id]||(D({errors:z.errors}),C.pending=!1,C.valid=z.valid),z)),N=Wo(async()=>_("silent"),z=>(C.valid=z.valid,z));function $(z){return(z==null?void 0:z.mode)==="silent"?N():B()}function O(z,Z=!0){const ue=Ti(z);ie(ue,Z)}c.onMounted(()=>{if(i)return B();(!g||!g.validateSchema)&&N()});function V(z){C.touched=z}function H(z){var Z;const ue=z&&"value"in z?z.value:k.value;D({value:me(ue),initialValue:me(ue),touched:(Z=z==null?void 0:z.touched)!==null&&Z!==void 0?Z:!1,errors:(z==null?void 0:z.errors)||[]}),C.pending=!1,C.validated=!1,N()}const G=c.getCurrentInstance();function ie(z,Z=!0){S.value=G&&p?ap(z,G.props.modelModifiers):z,(Z?B:N)()}function de(z){D({errors:Array.isArray(z)?z:[z]})}const he=c.computed({get(){return S.value},set(z){ie(z,d)}}),oe={id:b,name:v,label:a,value:he,meta:C,errors:A,errorMessage:F,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:H,handleReset:()=>H(),validate:$,handleChange:O,handleBlur:j,setState:D,setTouched:V,setErrors:de,setValue:ie};if(c.provide(la,oe),c.isRef(e)&&typeof c.unref(e)!="function"&&c.watch(e,(z,Z)=>{Le(z,Z)||(C.validated?B():N())},{deep:!0}),process.env.NODE_ENV!=="production"&&(oe._vm=c.getCurrentInstance(),c.watch(()=>Object.assign(Object.assign({errors:A.value},C),{value:S.value}),Wn,{deep:!0}),g||$p(oe)),!g)return oe;const ye=c.computed(()=>{const z=x.value;return!z||Me(z)||Oi(z)||mt(z)||Array.isArray(z)?{}:Object.keys(z).reduce((Z,ue)=>{const re=pp(z[ue]).map(fe=>fe.__locatorRef).reduce((fe,be)=>{const Oe=Ue(g.values,be)||g.values[be];return Oe!==void 0&&(fe[be]=Oe),fe},{});return Object.assign(Z,re),Z},{})});return c.watch(ye,(z,Z)=>{if(!Object.keys(z).length)return;!Le(z,Z)&&(C.validated?B():N())}),c.onBeforeUnmount(()=>{var z;const Z=(z=c.toValue(oe.keepValueOnUnmount))!==null&&z!==void 0?z:c.toValue(g.keepValuesOnUnmount),ue=c.toValue(v);if(Z||!g||R.pendingUnmount[oe.id]){g==null||g.removePathState(ue,b);return}R.pendingUnmount[oe.id]=!0;const re=g.getPathState(ue);if(Array.isArray(re==null?void 0:re.id)&&(re!=null&&re.multiple)?re!=null&&re.id.includes(oe.id):(re==null?void 0:re.id)===oe.id){if(re!=null&&re.multiple&&Array.isArray(re.value)){const be=re.value.findIndex(Oe=>Le(Oe,c.toValue(oe.checkedValue)));if(be>-1){const Oe=[...re.value];Oe.splice(be,1),g.setFieldValue(ue,Oe)}Array.isArray(re.id)&&re.id.splice(re.id.indexOf(oe.id),1)}else g.unsetPathValue(c.toValue(v));g.removePathState(ue,b)}}),oe}function Pp(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?Go(c.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,l=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:l})}function Rp(t,e,n){const r=n!=null&&n.standalone?void 0:Ho(Dr),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const a=l.handleChange,d=c.computed(()=>{const f=c.toValue(l.value),h=c.toValue(i);return Array.isArray(f)?f.findIndex(p=>Le(p,h))>=0:Le(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&l.validate();return}const y=c.toValue(t),g=r==null?void 0:r.getPathState(y),v=Ti(f);let x=(m=c.toValue(i))!==null&&m!==void 0?m:v;r&&(g!=null&&g.multiple)&&g.type==="checkbox"?x=ha(Ue(r.values,y)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=ha(c.toValue(l.value),x,c.toValue(o))),a(x,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(Ea(t,e,n))}function Lp({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=c.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(c.watch(e,l=>{Le(l,Go(i,o))||i.emit(s,l)}),c.watch(()=>Go(i,o),l=>{if(l===Ci&&e.value===void 0)return;const a=l===Ci?void 0:l;Le(a,e.value)||n(a,r())}))}function Go(t,e){if(t)return t.props[e]}const zp=c.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>vn().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Ci},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=c.toRef(t,"rules"),r=c.toRef(t,"name"),i=c.toRef(t,"label"),o=c.toRef(t,"uncheckedValue"),s=c.toRef(t,"keepValue"),{errors:l,value:a,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:y,meta:g,checked:v,setErrors:x}=Ip(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:jp(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),T=function(A,R=!0){f(A,R)},b=c.computed(()=>{const{validateOnInput:D,validateOnChange:A,validateOnBlur:R,validateOnModelUpdate:F}=Fp(t);function j($){h($,R),Me(e.attrs.onBlur)&&e.attrs.onBlur($)}function _($){T($,D),Me(e.attrs.onInput)&&e.attrs.onInput($)}function B($){T($,A),Me(e.attrs.onChange)&&e.attrs.onChange($)}const N={name:t.name,onBlur:j,onInput:_,onChange:B};return N["onUpdate:modelValue"]=$=>T($,F),N}),S=c.computed(()=>{const D=Object.assign({},b.value);Vr(e.attrs.type)&&v&&(D.checked=v.value);const A=Ma(t,e);return sp(A,e.attrs)&&(D.value=a.value),D}),k=c.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:a.value}));function C(){return{field:S.value,componentField:k.value,value:a.value,meta:g,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:T,handleInput:D=>T(D,!1),handleReset:y,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:a,meta:g,errors:l,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const D=c.resolveDynamicComponent(Ma(t,e)),A=Uo(D,e,C);return D?c.h(D,Object.assign(Object.assign({},e.attrs),S.value),A):A}}});function Ma(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function Fp(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:a}=vn();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:l,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:a}}function jp(t,e){return Vr(e.attrs.type)?da(t,"modelValue")?t.modelValue:void 0:da(t,"modelValue")?t.modelValue:e.attrs.value}const Pr=zp;let Hp=0;const $i=["bails","fieldsCount","id","multiple","type","validate"];function Ta(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},c.toValue(e)),r=c.unref(t==null?void 0:t.validationSchema);return r&&mt(r)&&Me(r.cast)?me(r.cast(n)||{}):me(n)}function Wp(t){var e;const n=Hp++;let r=0;const i=c.ref(!1),o=c.ref(!1),s=c.ref(0),l=[],a=c.reactive(Ta(t)),d=c.ref([]),u=c.ref({}),f=c.ref({}),h=cp(()=>{f.value=d.value.reduce((M,E)=>(M[Ar(c.toValue(E.path))]=E,M),{})});function p(M,E){const I=$(M);if(!I){typeof M=="string"&&(u.value[Ar(M)]=qo(E));return}if(typeof M=="string"){const q=Ar(M);u.value[q]&&delete u.value[q]}I.errors=qo(E),I.valid=!I.errors.length}function m(M){Ke(M).forEach(E=>{p(E,M[E])})}t!=null&&t.initialErrors&&m(t.initialErrors);const y=c.computed(()=>{const M=d.value.reduce((E,I)=>(I.errors.length&&(E[I.path]=I.errors),E),{});return Object.assign(Object.assign({},u.value),M)}),g=c.computed(()=>Ke(y.value).reduce((M,E)=>{const I=y.value[E];return I!=null&&I.length&&(M[E]=I[0]),M},{})),v=c.computed(()=>d.value.reduce((M,E)=>(M[E.path]={name:E.path||"",label:E.label||""},M),{})),x=c.computed(()=>d.value.reduce((M,E)=>{var I;return M[E.path]=(I=E.bails)!==null&&I!==void 0?I:!0,M},{})),T=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:S,originalInitialValues:k,setInitialValues:C}=Up(d,a,t),D=qp(d,a,k,g),A=c.computed(()=>d.value.reduce((M,E)=>{const I=Ue(a,E.path);return Rt(M,E.path,I),M},{})),R=t==null?void 0:t.validationSchema;function F(M,E){var I,q;const Q=c.computed(()=>Ue(S.value,c.toValue(M))),w=f.value[c.toValue(M)],L=(E==null?void 0:E.type)==="checkbox"||(E==null?void 0:E.type)==="radio";if(w&&L){w.multiple=!0;const qe=r++;return Array.isArray(w.id)?w.id.push(qe):w.id=[w.id,qe],w.fieldsCount++,w.__flags.pendingUnmount[qe]=!1,w}const U=c.computed(()=>Ue(a,c.toValue(M))),X=c.toValue(M),ee=V.findIndex(qe=>qe===X);ee!==-1&&V.splice(ee,1);const se=c.computed(()=>{var qe,it,jn,kn;const Pt=c.toValue(R);if(mt(Pt))return(it=(qe=Pt.describe)===null||qe===void 0?void 0:qe.call(Pt,c.toValue(M)).required)!==null&&it!==void 0?it:!1;const Si=c.toValue(E==null?void 0:E.schema);return mt(Si)&&(kn=(jn=Si.describe)===null||jn===void 0?void 0:jn.call(Si).required)!==null&&kn!==void 0?kn:!1}),pe=r++,xe=c.reactive({id:pe,path:M,touched:!1,pending:!1,valid:!0,validated:!!(!((I=T[X])===null||I===void 0)&&I.length),required:se,initialValue:Q,errors:c.shallowRef([]),bails:(q=E==null?void 0:E.bails)!==null&&q!==void 0?q:!1,label:E==null?void 0:E.label,type:(E==null?void 0:E.type)||"default",value:U,multiple:!1,__flags:{pendingUnmount:{[pe]:!1},pendingReset:!1},fieldsCount:1,validate:E==null?void 0:E.validate,dirty:c.computed(()=>!Le(c.unref(U),c.unref(Q)))});return d.value.push(xe),f.value[X]=xe,h(),g.value[X]&&!T[X]&&c.nextTick(()=>{ft(X,{mode:"silent"})}),c.isRef(M)&&c.watch(M,qe=>{h();const it=me(U.value);f.value[qe]=xe,c.nextTick(()=>{Rt(a,qe,it)})}),xe}const j=pa(It,5),_=pa(It,5),B=Wo(async M=>await(M==="silent"?j():_()),(M,[E])=>{const I=Ke(z.errorBag.value),Q=[...new Set([...Ke(M.results),...d.value.map(w=>w.path),...I])].sort().reduce((w,L)=>{var U;const X=L,ee=$(X)||O(X),se=((U=M.results[X])===null||U===void 0?void 0:U.errors)||[],pe=c.toValue(ee==null?void 0:ee.path)||X,xe=Kp({errors:se,valid:!se.length},w.results[pe]);return w.results[pe]=xe,xe.valid||(w.errors[pe]=xe.errors[0]),ee&&u.value[pe]&&delete u.value[pe],ee?(ee.valid=xe.valid,E==="silent"||E==="validated-only"&&!ee.validated||p(ee,xe.errors),w):(p(pe,se),w)},{valid:M.valid,results:{},errors:{}});return M.values&&(Q.values=M.values),Ke(Q.results).forEach(w=>{var L;const U=$(w);U&&E!=="silent"&&(E==="validated-only"&&!U.validated||p(U,(L=Q.results[w])===null||L===void 0?void 0:L.errors))}),Q});function N(M){d.value.forEach(M)}function $(M){const E=typeof M=="string"?Ar(M):M;return typeof E=="string"?f.value[E]:E}function O(M){return d.value.filter(I=>M.startsWith(I.path)).reduce((I,q)=>I?q.path.length>I.path.length?q:I:q,void 0)}let V=[],H;function G(M){return V.push(M),H||(H=c.nextTick(()=>{[...V].sort().reverse().forEach(I=>{fa(a,I)}),V=[],H=null})),H}function ie(M){return function(I,q){return function(w){return w instanceof Event&&(w.preventDefault(),w.stopPropagation()),N(L=>L.touched=!0),i.value=!0,s.value++,xt().then(L=>{const U=me(a);if(L.valid&&typeof I=="function"){const X=me(A.value);let ee=M?X:U;return L.values&&(ee=L.values),I(ee,{evt:w,controlledValues:X,setErrors:m,setFieldError:p,setTouched:gn,setFieldTouched:be,setValues:re,setFieldValue:Z,resetForm:Kt,resetField:yn})}!L.valid&&typeof q=="function"&&q({values:U,evt:w,errors:L.errors,results:L.results})}).then(L=>(i.value=!1,L),L=>{throw i.value=!1,L})}}}const he=ie(!1);he.withControlled=ie(!0);function oe(M,E){const I=d.value.findIndex(Q=>Q.path===M&&(Array.isArray(Q.id)?Q.id.includes(E):Q.id===E)),q=d.value[I];if(!(I===-1||!q)){if(c.nextTick(()=>{ft(M,{mode:"silent",warn:!1})}),q.multiple&&q.fieldsCount&&q.fieldsCount--,Array.isArray(q.id)){const Q=q.id.indexOf(E);Q>=0&&q.id.splice(Q,1),delete q.__flags.pendingUnmount[E]}(!q.multiple||q.fieldsCount<=0)&&(d.value.splice(I,1),ht(M),h(),delete f.value[M])}}function ye(M){Ke(f.value).forEach(E=>{E.startsWith(M)&&delete f.value[E]}),d.value=d.value.filter(E=>!E.path.startsWith(M)),c.nextTick(()=>{h()})}const z={formId:n,values:a,controlledValues:A,errorBag:y,errors:g,schema:R,submitCount:s,meta:D,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:b,validateSchema:c.unref(R)?B:void 0,validate:xt,setFieldError:p,validateField:ft,setFieldValue:Z,setValues:re,setErrors:m,setFieldTouched:be,setTouched:gn,resetForm:Kt,resetField:yn,handleSubmit:he,useFieldModel:Tr,defineInputBinds:$r,defineComponentBinds:Nr,defineField:bn,stageInitialValue:_t,unsetInitialValue:ht,setFieldInitialValue:Jt,createPathState:F,getPathState:$,unsetPathValue:G,removePathState:oe,initialValues:S,getAllPathStates:()=>d.value,destroyPath:ye,isFieldTouched:Oe,isFieldDirty:ut,isFieldValid:Mr};function Z(M,E,I=!0){const q=me(E),Q=typeof M=="string"?M:M.path;$(Q)||F(Q),Rt(a,Q,q),I&&ft(Q)}function ue(M,E=!0){Ke(a).forEach(I=>{delete a[I]}),Ke(M).forEach(I=>{Z(I,M[I],!1)}),E&&xt()}function re(M,E=!0){Br(a,M),l.forEach(I=>I&&I.reset()),E&&xt()}function fe(M,E){const I=$(c.toValue(M))||F(M);return c.computed({get(){return I.value},set(q){var Q;const w=c.toValue(M);Z(w,q,(Q=c.toValue(E))!==null&&Q!==void 0?Q:!1)}})}function be(M,E){const I=$(M);I&&(I.touched=E)}function Oe(M){const E=$(M);return E?E.touched:d.value.filter(I=>I.path.startsWith(M)).some(I=>I.touched)}function ut(M){const E=$(M);return E?E.dirty:d.value.filter(I=>I.path.startsWith(M)).some(I=>I.dirty)}function Mr(M){const E=$(M);return E?E.valid:d.value.filter(I=>I.path.startsWith(M)).every(I=>I.valid)}function gn(M){if(typeof M=="boolean"){N(E=>{E.touched=M});return}Ke(M).forEach(E=>{be(E,!!M[E])})}function yn(M,E){var I;const q=E&&"value"in E?E.value:Ue(S.value,M),Q=$(M);Q&&(Q.__flags.pendingReset=!0),Jt(M,me(q),!0),Z(M,q,!1),be(M,(I=E==null?void 0:E.touched)!==null&&I!==void 0?I:!1),p(M,(E==null?void 0:E.errors)||[]),c.nextTick(()=>{Q&&(Q.__flags.pendingReset=!1)})}function Kt(M,E){let I=me(M!=null&&M.values?M.values:k.value);I=E!=null&&E.force?I:Br(k.value,I),I=mt(R)&&Me(R.cast)?R.cast(I):I,C(I),N(q=>{var Q;q.__flags.pendingReset=!0,q.validated=!1,q.touched=((Q=M==null?void 0:M.touched)===null||Q===void 0?void 0:Q[q.path])||!1,Z(q.path,Ue(I,q.path),!1),p(q.path,void 0)}),E!=null&&E.force?ue(I,!1):re(I,!1),m((M==null?void 0:M.errors)||{}),s.value=(M==null?void 0:M.submitCount)||0,c.nextTick(()=>{xt({mode:"silent"}),N(q=>{q.__flags.pendingReset=!1})})}async function xt(M){const E=(M==null?void 0:M.mode)||"force";if(E==="force"&&N(w=>w.validated=!0),z.validateSchema)return z.validateSchema(E);o.value=!0;const I=await Promise.all(d.value.map(w=>w.validate?w.validate(M).then(L=>({key:w.path,valid:L.valid,errors:L.errors})):Promise.resolve({key:w.path,valid:!0,errors:[]})));o.value=!1;const q={},Q={};for(const w of I)q[w.key]={valid:w.valid,errors:w.errors},w.errors.length&&(Q[w.key]=w.errors[0]);return{valid:I.every(w=>w.valid),results:q,errors:Q}}async function ft(M,E){var I;const q=$(M);if(q&&(E==null?void 0:E.mode)!=="silent"&&(q.validated=!0),R){const{results:w}=await B((E==null?void 0:E.mode)||"validated-only");return w[M]||{errors:[],valid:!0}}return q!=null&&q.validate?q.validate(E):(!q&&((I=E==null?void 0:E.warn)!==null&&I!==void 0?I:!0)&&process.env.NODE_ENV!=="production"&&c.warn(`field with path ${M} was not found`),Promise.resolve({errors:[],valid:!0}))}function ht(M){fa(S.value,M)}function _t(M,E,I=!1){Jt(M,E),Rt(a,M,E),I&&!(t!=null&&t.initialValues)&&Rt(k.value,M,me(E))}function Jt(M,E,I=!1){Rt(S.value,M,me(E)),I&&Rt(k.value,M,me(E))}async function It(){const M=c.unref(R);if(!M)return{valid:!0,results:{},errors:{}};o.value=!0;const E=Oi(M)||mt(M)?await xp(M,a):await wp(M,a,{names:v.value,bailsMap:x.value});return o.value=!1,E}const Fn=he((M,{evt:E})=>{ca(E)&&E.target.submit()});c.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&gn(t.initialTouched),t!=null&&t.validateOnMount){xt();return}z.validateSchema&&z.validateSchema("silent")}),c.isRef(R)&&c.watch(R,()=>{var M;(M=z.validateSchema)===null||M===void 0||M.call(z,"validated-only")}),c.provide(Dr,z),process.env.NODE_ENV!=="production"&&(Tp(z),c.watch(()=>Object.assign(Object.assign({errors:y.value},D.value),{values:a,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Wn,{deep:!0}));function bn(M,E){const I=Me(E)||E==null?void 0:E.label,q=$(c.toValue(M))||F(M,{label:I}),Q=()=>Me(E)?E(Mi(q,$i)):E||{};function w(){var se;q.touched=!0,((se=Q().validateOnBlur)!==null&&se!==void 0?se:vn().validateOnBlur)&&ft(q.path)}function L(){var se;((se=Q().validateOnInput)!==null&&se!==void 0?se:vn().validateOnInput)&&c.nextTick(()=>{ft(q.path)})}function U(){var se;((se=Q().validateOnChange)!==null&&se!==void 0?se:vn().validateOnChange)&&c.nextTick(()=>{ft(q.path)})}const X=c.computed(()=>{const se={onChange:U,onInput:L,onBlur:w};return Me(E)?Object.assign(Object.assign({},se),E(Mi(q,$i)).props||{}):E!=null&&E.props?Object.assign(Object.assign({},se),E.props(Mi(q,$i))):se});return[fe(M,()=>{var se,pe,xe;return(xe=(se=Q().validateOnModelUpdate)!==null&&se!==void 0?se:(pe=vn())===null||pe===void 0?void 0:pe.validateOnModelUpdate)!==null&&xe!==void 0?xe:!0}),X]}function Tr(M){return Array.isArray(M)?M.map(E=>fe(E,!0)):fe(M)}function $r(M,E){const[I,q]=bn(M,E);function Q(){q.value.onBlur()}function w(U){const X=Ti(U);Z(c.toValue(M),X,!1),q.value.onInput()}function L(U){const X=Ti(U);Z(c.toValue(M),X,!1),q.value.onChange()}return c.computed(()=>Object.assign(Object.assign({},q.value),{onBlur:Q,onInput:w,onChange:L,value:I.value}))}function Nr(M,E){const[I,q]=bn(M,E),Q=$(c.toValue(M));function w(L){I.value=L}return c.computed(()=>{const L=Me(E)?E(Mi(Q,$i)):E||{};return Object.assign({[L.model||"modelValue"]:I.value,[`onUpdate:${L.model||"modelValue"}`]:w},q.value)})}return Object.assign(Object.assign({},z),{values:c.readonly(a),handleReset:()=>Kt(),submitForm:Fn})}function qp(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=c.computed(()=>!Le(e,c.unref(n)));function s(){const a=t.value;return Ke(i).reduce((d,u)=>{const f=i[u];return d[u]=a[f](h=>h[u]),d},{})}const l=c.reactive(s());return c.watchEffect(()=>{const a=s();l.touched=a.touched,l.valid=a.valid,l.pending=a.pending}),c.computed(()=>Object.assign(Object.assign({initialValues:c.unref(n)},l),{valid:l.valid&&!Ke(r.value).length,dirty:o.value}))}function Up(t,e,n){const r=Ta(n),i=c.ref(r),o=c.ref(me(r));function s(l,a=!1){i.value=Br(me(i.value)||{},me(l)),o.value=Br(me(o.value)||{},me(l)),a&&t.value.forEach(d=>{if(d.touched)return;const f=Ue(i.value,d.path);Rt(e,d.path,me(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function Kp(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const Jp=c.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=c.toRef(t,"validationSchema"),r=c.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:a,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:y,handleSubmit:g,setErrors:v,setFieldError:x,setFieldValue:T,setValues:b,setFieldTouched:S,setTouched:k,resetField:C}=Wp({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),D=g(($,{evt:O})=>{ca(O)&&O.target.submit()},t.onInvalidSubmit),A=t.onSubmit?g(t.onSubmit,t.onInvalidSubmit):D;function R($){zo($)&&$.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function F($,O){return g(typeof $=="function"&&!O?$:O,t.onInvalidSubmit)($)}function j(){return me(s)}function _(){return me(l.value)}function B(){return me(i.value)}function N(){return{meta:l.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:a.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:F,handleReset:m,submitForm:D,setErrors:v,setFieldError:x,setFieldValue:T,setValues:b,setFieldTouched:S,setTouched:k,resetForm:y,resetField:C,getValues:j,getMeta:_,getErrors:B}}return e.expose({setFieldError:x,setErrors:v,setFieldValue:T,setValues:b,setFieldTouched:S,setTouched:k,resetForm:y,validate:h,validateField:p,resetField:C,getValues:j,getMeta:_,getErrors:B,values:s,meta:l,errors:i}),function(){const O=t.as==="form"?t.as:t.as?c.resolveDynamicComponent(t.as):null,V=Uo(O,e,N);if(!O)return V;const H=O==="form"?{novalidate:!0}:{};return c.h(O,Object.assign(Object.assign(Object.assign({},H),e.attrs),{onSubmit:A,onReset:R}),V)}}}),Gp=c.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=c.inject(Dr,void 0),r=c.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?c.resolveDynamicComponent(t.as):t.as,s=Uo(o,e,i),l=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?c.h(o||"span",l,r.value):c.h(o,l,s)}}});function Yp(t){const e=Ho(Dr),n=t?void 0:c.inject(la);return c.computed(()=>t?e==null?void 0:e.errors.value[c.toValue(t)]:n==null?void 0:n.errorMessage.value)}pt("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),pt("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),pt("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),pt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),pt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),pt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),pt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),pt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),pt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),pt("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),pt("number",t=>parseFloat(t)?!0:"This field must be a number");const ce=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},Zp={},Xp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},Qp=[c.createElementVNode("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"},null,-1)];function em(t,e){return c.openBlock(),c.createElementBlock("svg",Xp,Qp)}const tm=ce(Zp,[["render",em]]),nm={},rm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},im=[c.createElementVNode("path",{d:"M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"},null,-1)];function om(t,e){return c.openBlock(),c.createElementBlock("svg",rm,im)}const sm=ce(nm,[["render",om]]),lm={class:"relative"},Un=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",lm,[c.createVNode(tm,{class:"absolute opacity-25"}),c.createVNode(sm,{class:c.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let te={theme:"wpic-tools",popoverTarget:"body"};const am=["is","type","disabled"],cm={key:0,class:"absolute inset-0 flex justify-center items-center"},dm={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},um=["onClick"],Ni=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=c.ref(null),r=c.ref(null),i=c.ref(!1),o=c.computed(()=>e.to?"router-link":"div"),s=v=>{r.value&&!r.value.contains(v.target)&&n.value&&!n.value.contains(v.target)&&(i.value=!1)};c.onMounted(()=>{document.addEventListener("click",s)}),c.onUnmounted(()=>{document.removeEventListener("click",s)});const l={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},a={pmi:"","wpic-tools":"bg-transparent text-gray-700 disabled:text-gray-700/50 enabled:hover:bg-gray-900/5 enabled:active:bg-gray-200 enabled:active:shadow-inner dark:enabled:border-gray-900 dark:text-gray-400 dark:enabled:hover:bg-gray-900 dark:enabled:active:bg-gray-930 dark:disabled:text-gray-400/50"},d={pmi:"","wpic-tools":"bg-transparent text-red-600 disabled:text-red-600/50 enabled:hover:bg-red-500/5 enabled:active:bg-red-100 enabled:active:shadow-inner dark:text-red-400 dark:enabled:hover:bg-red-500/10 dark:enabled:active:bg-red-500/25 dark:disabled:text-red-500/50"},u={pmi:"bg-violet-800 border border-violet-800 focus:bg-violet-800 text-white disabled:bg-zinc-100 disabled:text-zinc-400 disabled:border-zinc-100 enabled:hover:bg-violet-900 enabled:hover:border-violet-900 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b from-lime-500 to-lime-500 text-white disabled:text-white/50 border-none shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:from-lime-400 enabled:hover:to-lime-400 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:from-lime-700 dark:to-lime-700 dark:enabled:active:shadow-inner dark:enabled:hover:from-lime-600 dark:enabled:hover:to-lime-600"},f={pmi:"bg-white text-violet-800 border-zinc-400 dark:border-zinc-700 dark:text-zinc-200 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:hover:border-zinc-600 disabled:text-zinc-400 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b from-gray-500 to-gray-600 text-white disabled:text-white/50 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:from-gray-400 enabled:hover:to-gray-500 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:from-gray-700 dark:to-gray-700 dark:enabled:active:shadow-inner dark:enabled:hover:from-gray-600 dark:enabled:hover:to-gray-600"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b from-red-500 to-red-600 disabled:text-red-600/50 border-red-500 enabled:hover:to-red-500 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:hover:border-red-600 enabled:active:shadow-inner enabled:active:text-white/80 enabled:active:bg-red-700 enabled:active:border-red-700 dark:bg-red-400/70 dark:border-red-400/70"},p={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":"bg-linear-to-b from-white text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/5 shadow-xs enabled:hover:to-gray-50 enabled:active:text-gray-950/60 dark:bg-gray-900 dark:from-gray-900 dark:text-white dark:disabled:text-white/50 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] enabled:active:shadow-inner dark:hover:from-gray-800 dark:hover:to-gray-800 dark:enabled:active:text-white/80"},m={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},y={pmi:"text-red-600 hover:text-red-500 hover:underline","wpic-tools":"text-red-600 disabled:text-red-600/50 hover:text-red-500 dark:text-red-400 dark:hover:text-red-500 hover:underline"},g={pmi:"hover:text-violet-800 hover:underline","wpic-tools":"dark:text-gray-200 hover:text-lime-800 hover:underline"};return(v,x)=>{var T;return c.openBlock(),c.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:x[0]||(x[0]=b=>{var S;return(S=t.actions)!=null&&S.length?i.value=!i.value:null}),class:c.normalizeClass([{"cursor-pointer":!t.disabled&&!t.loading,"active:outline active:outline-2 active:outline-offset-4":!t.disabled&&!t.loading&&t.outlining,"cursor-not-allowed":t.disabled,border:t.outline&&!t.plain,[`${l[c.unref(te).theme]}`]:!0,[`${u[c.unref(te).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[c.unref(te).theme]}`]:t.secondary,[`${p[c.unref(te).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[c.unref(te).theme]}`]:t.primary&&t.plain,[`${g[c.unref(te).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${a[c.unref(te).theme]}`]:t.colorless,[`${h[c.unref(te).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${y[c.unref(te).theme]}`]:t.destructive&&t.plain,[`${d[c.unref(te).theme]}`]:t.destructive&&t.colorless,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(c.openBlock(),c.createElementBlock("div",cm,[c.createVNode(Un,{class:"w-6 h-6"})])):c.createCommentVNode("",!0),(c.openBlock(),c.createBlock(c.resolveDynamicComponent(o.value),{to:t.to,class:c.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:c.withCtx(()=>[c.renderSlot(v.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(T=t.actions)!=null&&T.length&&i.value?(c.openBlock(),c.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[c.createElementVNode("div",dm,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.actions,b=>(c.openBlock(),c.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},c.toDisplayString(b.label),9,um))),256))])],512)):c.createCommentVNode("",!0)],10,am)}}}),fm=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[c.unref(te).theme]]])},[c.renderSlot(n.$slots,"default")],2))}}),hm={name:"WpicInputGroup"},pm={class:"wpic-input-group flex w-full"};function mm(t,e,n,r,i,o){return c.openBlock(),c.createElementBlock("div",pm,[c.renderSlot(t.$slots,"default")])}const gm=ce(hm,[["render",mm]]),ym=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=c.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(l,a)=>(c.openBlock(),c.createBlock(c.unref(Jp),{ref_key:"myForm",ref:n},{default:c.withCtx(({values:d,meta:u,errors:f})=>[c.renderSlot(l.$slots,"default")]),_:3},512))}}),Rr=Math.min,Kn=Math.max,Bi=Math.round,Zt=t=>({x:t,y:t}),bm={left:"right",right:"left",bottom:"top",top:"bottom"},km={start:"end",end:"start"};function Yo(t,e,n){return Kn(t,Rr(e,n))}function Lr(t,e){return typeof t=="function"?t(e):t}function xn(t){return t.split("-")[0]}function zr(t){return t.split("-")[1]}function $a(t){return t==="x"?"y":"x"}function Zo(t){return t==="y"?"height":"width"}function Ai(t){return["top","bottom"].includes(xn(t))?"y":"x"}function Xo(t){return $a(Ai(t))}function vm(t,e,n){n===void 0&&(n=!1);const r=zr(t),i=Xo(t),o=Zo(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Di(s)),[s,Di(s)]}function xm(t){const e=Di(t);return[Qo(t),e,Qo(e)]}function Qo(t){return t.replace(/start|end/g,e=>km[e])}function wm(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function Sm(t,e,n,r){const i=zr(t);let o=wm(xn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Qo)))),o}function Di(t){return t.replace(/left|right|bottom|top/g,e=>bm[e])}function Cm(t){return{top:0,right:0,bottom:0,left:0,...t}}function Na(t){return typeof t!="number"?Cm(t):{top:t,right:t,bottom:t,left:t}}function Vi(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Ba(t,e,n){let{reference:r,floating:i}=t;const o=Ai(e),s=Xo(e),l=Zo(s),a=xn(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(a){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(zr(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const Om=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Ba(d,r,a),h=r,p={},m=0;for(let y=0;y<l.length;y++){const{name:g,fn:v}=l[y],{x,y:T,data:b,reset:S}=await v({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=x??u,f=T??f,p={...p,[g]:{...p[g],...b}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(d=S.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:u,y:f}=Ba(d,h,a)),y=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function Aa(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:a}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Lr(e,t),m=Na(p),g=l[h?f==="floating"?"reference":"floating":f],v=Vi(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:a})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),b=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},S=Vi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:T,strategy:a}):x);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}const Em=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:a}=e,{element:d,padding:u=0}=Lr(t,e)||{};if(d==null)return{};const f=Na(u),h={x:n,y:r},p=Xo(i),m=Zo(p),y=await s.getDimensions(d),g=p==="y",v=g?"top":"left",x=g?"bottom":"right",T=g?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],S=h[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let C=k?k[T]:0;(!C||!await(s.isElement==null?void 0:s.isElement(k)))&&(C=l.floating[T]||o.floating[m]);const D=b/2-S/2,A=C/2-y[m]/2-1,R=Rr(f[v],A),F=Rr(f[x],A),j=R,_=C-y[m]-F,B=C/2-y[m]/2+D,N=Yo(j,B,_),$=!a.arrow&&zr(i)!=null&&B!==N&&o.reference[m]/2-(B<j?R:F)-y[m]/2<0,O=$?B<j?B-j:B-_:0;return{[p]:h[p]+O,data:{[p]:N,centerOffset:B-N-O,...$&&{alignmentOffset:O}},reset:$}}}),Mm=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:a,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...g}=Lr(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=xn(i),x=xn(l)===l,T=await(a.isRTL==null?void 0:a.isRTL(d.floating)),b=h||(x||!y?[Di(l)]:xm(l));!h&&m!=="none"&&b.push(...Sm(l,y,m,T));const S=[l,...b],k=await Aa(e,g),C=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&C.push(k[v]),f){const j=vm(i,s,T);C.push(k[j[0]],k[j[1]])}if(D=[...D,{placement:i,overflows:C}],!C.every(j=>j<=0)){var A,R;const j=(((A=o.flip)==null?void 0:A.index)||0)+1,_=S[j];if(_)return{data:{index:j,overflows:D},reset:{placement:_}};let B=(R=D.filter(N=>N.overflows[0]<=0).sort((N,$)=>N.overflows[1]-$.overflows[1])[0])==null?void 0:R.placement;if(!B)switch(p){case"bestFit":{var F;const N=(F=D.map($=>[$.placement,$.overflows.filter(O=>O>0).reduce((O,V)=>O+V,0)]).sort(($,O)=>$[1]-O[1])[0])==null?void 0:F[0];N&&(B=N);break}case"initialPlacement":B=l;break}if(i!==B)return{reset:{placement:B}}}return{}}}};async function Tm(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=xn(n),l=zr(n),a=Ai(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&a?-1:1,f=Lr(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),a?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const $m=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,a=await Tm(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:s}}}}},Nm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:v,y:x}=g;return{x:v,y:x}}},...a}=Lr(t,e),d={x:n,y:r},u=await Aa(e,a),f=Ai(xn(i)),h=$a(f);let p=d[h],m=d[f];if(o){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=p+u[g],T=p-u[v];p=Yo(x,p,T)}if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=m+u[g],T=m-u[v];m=Yo(x,m,T)}const y=l.fn({...e,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r}}}}};function wn(t){return es(t)?(t.nodeName||"").toLowerCase():"#document"}function Xe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Xt(t){var e;return(e=(es(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function es(t){return t instanceof Node||t instanceof Xe(t).Node}function wt(t){return t instanceof Element||t instanceof Xe(t).Element}function St(t){return t instanceof HTMLElement||t instanceof Xe(t).HTMLElement}function Da(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xe(t).ShadowRoot}function Fr(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=gt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Bm(t){return["table","td","th"].includes(wn(t))}function ts(t){const e=ns(),n=gt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Am(t){let e=Qt(t);for(;St(e)&&!Jn(e);){if(ts(e))return e;e=Qt(e)}return null}function ns(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Jn(t){return["html","body","#document"].includes(wn(t))}function gt(t){return Xe(t).getComputedStyle(t)}function _i(t){return wt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Qt(t){if(wn(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Da(t)&&t.host||Xt(t);return Da(e)?e.host:e}function Va(t){const e=Qt(t);return Jn(e)?t.ownerDocument?t.ownerDocument.body:t.body:St(e)&&Fr(e)?e:Va(e)}function rs(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Va(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Xe(i);return o?e.concat(s,s.visualViewport||[],Fr(i)?i:[],s.frameElement&&n?rs(s.frameElement):[]):e.concat(i,rs(i,[],n))}function _a(t){const e=gt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=St(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Bi(n)!==o||Bi(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ia(t){return wt(t)?t:t.contextElement}function Gn(t){const e=Ia(t);if(!St(e))return Zt(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=_a(e);let s=(o?Bi(n.width):n.width)/r,l=(o?Bi(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Dm=Zt(0);function Pa(t){const e=Xe(t);return!ns()||!e.visualViewport?Dm:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Vm(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Xe(t)?!1:e}function jr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ia(t);let s=Zt(1);e&&(r?wt(r)&&(s=Gn(r)):s=Gn(t));const l=Vm(o,n,r)?Pa(o):Zt(0);let a=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=Xe(o),p=r&&wt(r)?Xe(r):r;let m=h,y=m.frameElement;for(;y&&r&&p!==m;){const g=Gn(y),v=y.getBoundingClientRect(),x=gt(y),T=v.left+(y.clientLeft+parseFloat(x.paddingLeft))*g.x,b=v.top+(y.clientTop+parseFloat(x.paddingTop))*g.y;a*=g.x,d*=g.y,u*=g.x,f*=g.y,a+=T,d+=b,m=Xe(y),y=m.frameElement}}return Vi({width:u,height:f,x:a,y:d})}const _m=[":popover-open",":modal"];function is(t){return _m.some(e=>{try{return t.matches(e)}catch{return!1}})}function Im(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Xt(r),l=e?is(e.floating):!1;if(r===s||l&&o)return n;let a={scrollLeft:0,scrollTop:0},d=Zt(1);const u=Zt(0),f=St(r);if((f||!f&&!o)&&((wn(r)!=="body"||Fr(s))&&(a=_i(r)),St(r))){const h=jr(r);d=Gn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+u.x,y:n.y*d.y-a.scrollTop*d.y+u.y}}function Pm(t){return Array.from(t.getClientRects())}function Ra(t){return jr(Xt(t)).left+_i(t).scrollLeft}function Rm(t){const e=Xt(t),n=_i(t),r=t.ownerDocument.body,i=Kn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Kn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ra(t);const l=-n.scrollTop;return gt(r).direction==="rtl"&&(s+=Kn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function Lm(t,e){const n=Xe(t),r=Xt(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;const d=ns();(!d||d&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l,y:a}}function zm(t,e){const n=jr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=St(t)?Gn(t):Zt(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,a=i*o.x,d=r*o.y;return{width:s,height:l,x:a,y:d}}function La(t,e,n){let r;if(e==="viewport")r=Lm(t,n);else if(e==="document")r=Rm(Xt(t));else if(wt(e))r=zm(e,n);else{const i=Pa(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Vi(r)}function za(t,e){const n=Qt(t);return n===e||!wt(n)||Jn(n)?!1:gt(n).position==="fixed"||za(n,e)}function Fm(t,e){const n=e.get(t);if(n)return n;let r=rs(t,[],!1).filter(l=>wt(l)&&wn(l)!=="body"),i=null;const o=gt(t).position==="fixed";let s=o?Qt(t):t;for(;wt(s)&&!Jn(s);){const l=gt(s),a=ts(s);!a&&l.position==="fixed"&&(i=null),(o?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fr(s)&&!a&&za(t,s))?r=r.filter(u=>u!==s):i=l,s=Qt(s)}return e.set(t,r),r}function jm(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?is(e)?[]:Fm(e,this._c):[].concat(n),r],l=s[0],a=s.reduce((d,u)=>{const f=La(e,u,i);return d.top=Kn(f.top,d.top),d.right=Rr(f.right,d.right),d.bottom=Rr(f.bottom,d.bottom),d.left=Kn(f.left,d.left),d},La(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Hm(t){const{width:e,height:n}=_a(t);return{width:e,height:n}}function Wm(t,e,n){const r=St(e),i=Xt(e),o=n==="fixed",s=jr(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const a=Zt(0);if(r||!r&&!o)if((wn(e)!=="body"||Fr(i))&&(l=_i(e)),r){const f=jr(e,!0,o,e);a.x=f.x+e.clientLeft,a.y=f.y+e.clientTop}else i&&(a.x=Ra(i));const d=s.left+l.scrollLeft-a.x,u=s.top+l.scrollTop-a.y;return{x:d,y:u,width:s.width,height:s.height}}function ss(t){return gt(t).position==="static"}function Fa(t,e){return!St(t)||gt(t).position==="fixed"?null:e?e(t):t.offsetParent}function ja(t,e){const n=Xe(t);if(is(t))return n;if(!St(t)){let i=Qt(t);for(;i&&!Jn(i);){if(wt(i)&&!ss(i))return i;i=Qt(i)}return n}let r=Fa(t,e);for(;r&&Bm(r)&&ss(r);)r=Fa(r,e);return r&&Jn(r)&&ss(r)&&!ts(r)?n:r||Am(t)||n}const qm=async function(t){const e=this.getOffsetParent||ja,n=this.getDimensions,r=await n(t.floating);return{reference:Wm(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Um(t){return gt(t).direction==="rtl"}const Km={convertOffsetParentRelativeRectToViewportRelativeRect:Im,getDocumentElement:Xt,getClippingRect:jm,getOffsetParent:ja,getElementRects:qm,getClientRects:Pm,getDimensions:Hm,getScale:Gn,isElement:wt,isRTL:Um},Ha=$m,Wa=Nm,qa=Mm,Jm=Em,Ua=(t,e,n)=>{const r=new Map,i={platform:Km,...n},o={...i.platform,_c:r};return Om(t,e,{...i,platform:o})};function Gm(t){return t!=null&&typeof t=="object"&&"$el"in t}function Ym(t){if(Gm(t)){const e=t.$el;return es(e)&&wn(e)==="#comment"?null:e}return t}function Zm(t){return{name:"arrow",options:t,fn(e){const n=Ym(c.unref(t.element));return n==null?{}:Jm({element:n,padding:t.padding}).fn(e)}}}const Xm={},Qm={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},eg=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function tg(t,e){return c.openBlock(),c.createElementBlock("svg",Qm,eg)}const Hr=ce(Xm,[["render",tg]]);let Ii;const ng=new Uint8Array(16);function rg(){if(!Ii&&(Ii=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ii))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ii(ng)}const Ae=[];for(let t=0;t<256;++t)Ae.push((t+256).toString(16).slice(1));function ig(t,e=0){return Ae[t[e+0]]+Ae[t[e+1]]+Ae[t[e+2]]+Ae[t[e+3]]+"-"+Ae[t[e+4]]+Ae[t[e+5]]+"-"+Ae[t[e+6]]+Ae[t[e+7]]+"-"+Ae[t[e+8]]+Ae[t[e+9]]+"-"+Ae[t[e+10]]+Ae[t[e+11]]+Ae[t[e+12]]+Ae[t[e+13]]+Ae[t[e+14]]+Ae[t[e+15]]}const Ka={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ls(t,e,n){if(Ka.randomUUID&&!t)return Ka.randomUUID();t=t||{};const r=t.random||(t.rng||rg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ig(r)}let og={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""}};const Yn=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},expand:Boolean},setup(t,{expose:e}){const n=ls(),r=t,i={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"block absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},o=c.ref(null),s=c.ref(null),l=c.ref(!0);function a(){r.disabled||(l.value=!1,u()),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:n}}))}function d(){document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,l.value=!0}async function u(){const m=await Ua(o.value,s.value,{placement:r.placement,middleware:[qa(),Wa(),Ha(r.offset)]});s.value.style.left=`${m.x}px`,s.value.style.top=`${m.y}px`}const f=m=>{s.value&&!s.value.contains(m.target)&&o.value&&!o.value.contains(m.target)&&d()};c.onMounted(()=>{document.addEventListener("click",f),document.addEventListener("submenu-open",m=>{m.detail.uuid!==n&&d()})}),c.onUnmounted(()=>{document.removeEventListener("click",f),document.removeEventListener("submenu-open",d)});function h(){r.hover&&a()}function p(){r.hover&&d()}return e({hide:d}),(m,y)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[(c.openBlock(),c.createElementBlock("div",{class:"flex-1",key:`reference_${c.unref(n)}`,ref_key:"reference",ref:o,onMouseenter:h,onMouseleave:p,onClick:y[0]||(y[0]=c.withModifiers(g=>l.value?a():d(),["stop"]))},[c.renderSlot(m.$slots,"default",{isHidden:l.value})],32)),(c.openBlock(),c.createBlock(c.Teleport,{to:c.unref(te).popoverTarget},[(c.openBlock(),c.createElementBlock("div",{key:`floating_${c.unref(n)}`,ref_key:"floating",ref:s,style:c.normalizeStyle({maxWidth:t.maxWidth}),class:c.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:l.value,[`${i[c.unref(te).theme]}`]:!l.value,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[c.renderSlot(m.$slots,"content")],6))],8,["to"]))],64))}}),sg={},lg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},ag=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function cg(t,e){return c.openBlock(),c.createElementBlock("svg",lg,ag)}const Ja=ce(sg,[["render",cg]]),dg={},ug={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},fg=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)];function hg(t,e){return c.openBlock(),c.createElementBlock("svg",ug,fg)}const pg=ce(dg,[["render",hg]]),mg={},gg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},yg=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"},null,-1)];function bg(t,e){return c.openBlock(),c.createElementBlock("svg",gg,yg)}const as=ce(mg,[["render",bg]]),kg={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-gray-500 flex items-center"},vg={key:0},xg={class:""},wg={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},Sg={class:"opacity-50 w-4 h-4 leading-none"},Cg={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},cs=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-gray-930 dark:border-gray-920 dark:hover:bg-gray-920 dark:text-gray-400"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! bg-gray-50!"},i=e;function o(){i("onClear")}return(s,l)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[t.label?(c.openBlock(),c.createElementBlock("div",kg,[c.createTextVNode(c.toDisplayString(t.label)+" ",1),t.required&&!t.hideRequired?(c.openBlock(),c.createElementBlock("span",vg,"*")):c.createCommentVNode("",!0),c.createElementVNode("div",xg,[t.info?(c.openBlock(),c.createBlock(Yn,{key:0,hover:""},{content:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(t.info),1)]),default:c.withCtx(()=>[c.createVNode(as,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(["wpic-input overflow-auto leading-none rounded-sm flex relative border pr-4 items-center",{"pl-4":!s.$slots.prepend,"pl-10":s.$slots.prepend,[`${n[c.unref(te).theme]}`]:!0,"h-8":t.small,"h-10":!t.large,"h-12":t.large,[`${r[c.unref(te).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(c.openBlock(),c.createElementBlock("div",wg,[c.createElementVNode("div",Sg,[c.renderSlot(s.$slots,"prepend")])])):c.createCommentVNode("",!0),c.renderSlot(s.$slots,"default"),t.loading?(c.openBlock(),c.createElementBlock("div",Cg,[c.createVNode(Un,{class:"w-6 h-6 opacity-50"})])):t.clearable?(c.openBlock(),c.createElementBlock("div",{key:2,onClick:c.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Hr,{class:"w-5 h-5 opacity-50"})])):c.createCommentVNode("",!0)],2)],64))}});var Sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Og(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Pi=Og,Eg=typeof Sn=="object"&&Sn&&Sn.Object===Object&&Sn,Ga=Eg,Mg=Ga,Tg=typeof self=="object"&&self&&self.Object===Object&&self,$g=Mg||Tg||Function("return this")(),Ct=$g,Ng=Ct,Bg=function(){return Ng.Date.now()},Ag=Bg,Dg=/\s/;function Vg(t){for(var e=t.length;e--&&Dg.test(t.charAt(e)););return e}var _g=Vg,Ig=_g,Pg=/^\s+/;function Rg(t){return t&&t.slice(0,Ig(t)+1).replace(Pg,"")}var Lg=Rg,zg=Ct,Fg=zg.Symbol,ds=Fg,Ya=ds,Za=Object.prototype,jg=Za.hasOwnProperty,Hg=Za.toString,qr=Ya?Ya.toStringTag:void 0;function Wg(t){var e=jg.call(t,qr),n=t[qr];try{t[qr]=void 0;var r=!0}catch{}var i=Hg.call(t);return r&&(e?t[qr]=n:delete t[qr]),i}var qg=Wg,Ug=Object.prototype,Kg=Ug.toString;function Jg(t){return Kg.call(t)}var Gg=Jg,Xa=ds,Yg=qg,Zg=Gg,Xg="[object Null]",Qg="[object Undefined]",Qa=Xa?Xa.toStringTag:void 0;function e0(t){return t==null?t===void 0?Qg:Xg:Qa&&Qa in Object(t)?Yg(t):Zg(t)}var Ur=e0;function t0(t){return t!=null&&typeof t=="object"}var Kr=t0,n0=Ur,r0=Kr,i0="[object Symbol]";function o0(t){return typeof t=="symbol"||r0(t)&&n0(t)==i0}var s0=o0,l0=Lg,ec=Pi,a0=s0,tc=NaN,c0=/^[-+]0x[0-9a-f]+$/i,d0=/^0b[01]+$/i,u0=/^0o[0-7]+$/i,f0=parseInt;function h0(t){if(typeof t=="number")return t;if(a0(t))return tc;if(ec(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=ec(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=l0(t);var n=d0.test(t);return n||u0.test(t)?f0(t.slice(2),n?2:8):c0.test(t)?tc:+t}var p0=h0,m0=Pi,us=Ag,nc=p0,g0="Expected a function",y0=Math.max,b0=Math.min;function k0(t,e,n){var r,i,o,s,l,a,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(g0);e=nc(e)||0,m0(n)&&(u=!!n.leading,f="maxWait"in n,o=f?y0(nc(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(k){var C=r,D=i;return r=i=void 0,d=k,s=t.apply(D,C),s}function m(k){return d=k,l=setTimeout(v,e),u?p(k):s}function y(k){var C=k-a,D=k-d,A=e-C;return f?b0(A,o-D):A}function g(k){var C=k-a,D=k-d;return a===void 0||C>=e||C<0||f&&D>=o}function v(){var k=us();if(g(k))return x(k);l=setTimeout(v,y(k))}function x(k){return l=void 0,h&&r?p(k):(r=i=void 0,s)}function T(){l!==void 0&&clearTimeout(l),d=0,r=a=i=l=void 0}function b(){return l===void 0?s:x(us())}function S(){var k=us(),C=g(k);if(r=arguments,i=this,a=k,C){if(l===void 0)return m(a);if(f)return clearTimeout(l),l=setTimeout(v,e),p(a)}return l===void 0&&(l=setTimeout(v,e)),s}return S.cancel=T,S.flush=b,S}var v0=k0;const rc=Wr(v0);function x0(){this.__data__=[],this.size=0}var w0=x0;function S0(t,e){return t===e||t!==t&&e!==e}var ic=S0,C0=ic;function O0(t,e){for(var n=t.length;n--;)if(C0(t[n][0],e))return n;return-1}var Ri=O0,E0=Ri,M0=Array.prototype,T0=M0.splice;function $0(t){var e=this.__data__,n=E0(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():T0.call(e,n,1),--this.size,!0}var N0=$0,B0=Ri;function A0(t){var e=this.__data__,n=B0(e,t);return n<0?void 0:e[n][1]}var D0=A0,V0=Ri;function _0(t){return V0(this.__data__,t)>-1}var I0=_0,P0=Ri;function R0(t,e){var n=this.__data__,r=P0(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var L0=R0,z0=w0,F0=N0,j0=D0,H0=I0,W0=L0;function Zn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Zn.prototype.clear=z0,Zn.prototype.delete=F0,Zn.prototype.get=j0,Zn.prototype.has=H0,Zn.prototype.set=W0;var Li=Zn,q0=Li;function U0(){this.__data__=new q0,this.size=0}var K0=U0;function J0(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var G0=J0;function Y0(t){return this.__data__.get(t)}var Z0=Y0;function X0(t){return this.__data__.has(t)}var Q0=X0,ey=Ur,ty=Pi,ny="[object AsyncFunction]",ry="[object Function]",iy="[object GeneratorFunction]",oy="[object Proxy]";function sy(t){if(!ty(t))return!1;var e=ey(t);return e==ry||e==iy||e==ny||e==oy}var oc=sy,ly=Ct,ay=ly["__core-js_shared__"],cy=ay,fs=cy,sc=function(){var t=/[^.]+$/.exec(fs&&fs.keys&&fs.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function dy(t){return!!sc&&sc in t}var uy=dy,fy=Function.prototype,hy=fy.toString;function py(t){if(t!=null){try{return hy.call(t)}catch{}try{return t+""}catch{}}return""}var lc=py,my=oc,gy=uy,yy=Pi,by=lc,ky=/[\\^$.*+?()[\]{}|]/g,vy=/^\[object .+?Constructor\]$/,xy=Function.prototype,wy=Object.prototype,Sy=xy.toString,Cy=wy.hasOwnProperty,Oy=RegExp("^"+Sy.call(Cy).replace(ky,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ey(t){if(!yy(t)||gy(t))return!1;var e=my(t)?Oy:vy;return e.test(by(t))}var My=Ey;function Ty(t,e){return t==null?void 0:t[e]}var $y=Ty,Ny=My,By=$y;function Ay(t,e){var n=By(t,e);return Ny(n)?n:void 0}var Xn=Ay,Dy=Xn,Vy=Ct,_y=Dy(Vy,"Map"),hs=_y,Iy=Xn,Py=Iy(Object,"create"),zi=Py,ac=zi;function Ry(){this.__data__=ac?ac(null):{},this.size=0}var Ly=Ry;function zy(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Fy=zy,jy=zi,Hy="__lodash_hash_undefined__",Wy=Object.prototype,qy=Wy.hasOwnProperty;function Uy(t){var e=this.__data__;if(jy){var n=e[t];return n===Hy?void 0:n}return qy.call(e,t)?e[t]:void 0}var Ky=Uy,Jy=zi,Gy=Object.prototype,Yy=Gy.hasOwnProperty;function Zy(t){var e=this.__data__;return Jy?e[t]!==void 0:Yy.call(e,t)}var Xy=Zy,Qy=zi,eb="__lodash_hash_undefined__";function tb(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Qy&&e===void 0?eb:e,this}var nb=tb,rb=Ly,ib=Fy,ob=Ky,sb=Xy,lb=nb;function Qn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qn.prototype.clear=rb,Qn.prototype.delete=ib,Qn.prototype.get=ob,Qn.prototype.has=sb,Qn.prototype.set=lb;var ab=Qn,cc=ab,cb=Li,db=hs;function ub(){this.size=0,this.__data__={hash:new cc,map:new(db||cb),string:new cc}}var fb=ub;function hb(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var pb=hb,mb=pb;function gb(t,e){var n=t.__data__;return mb(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Fi=gb,yb=Fi;function bb(t){var e=yb(this,t).delete(t);return this.size-=e?1:0,e}var kb=bb,vb=Fi;function xb(t){return vb(this,t).get(t)}var wb=xb,Sb=Fi;function Cb(t){return Sb(this,t).has(t)}var Ob=Cb,Eb=Fi;function Mb(t,e){var n=Eb(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Tb=Mb,$b=fb,Nb=kb,Bb=wb,Ab=Ob,Db=Tb;function er(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}er.prototype.clear=$b,er.prototype.delete=Nb,er.prototype.get=Bb,er.prototype.has=Ab,er.prototype.set=Db;var dc=er,Vb=Li,_b=hs,Ib=dc,Pb=200;function Rb(t,e){var n=this.__data__;if(n instanceof Vb){var r=n.__data__;if(!_b||r.length<Pb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ib(r)}return n.set(t,e),this.size=n.size,this}var Lb=Rb,zb=Li,Fb=K0,jb=G0,Hb=Z0,Wb=Q0,qb=Lb;function tr(t){var e=this.__data__=new zb(t);this.size=e.size}tr.prototype.clear=Fb,tr.prototype.delete=jb,tr.prototype.get=Hb,tr.prototype.has=Wb,tr.prototype.set=qb;var Ub=tr,Kb="__lodash_hash_undefined__";function Jb(t){return this.__data__.set(t,Kb),this}var Gb=Jb;function Yb(t){return this.__data__.has(t)}var Zb=Yb,Xb=dc,Qb=Gb,e1=Zb;function ji(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Xb;++e<n;)this.add(t[e])}ji.prototype.add=ji.prototype.push=Qb,ji.prototype.has=e1;var t1=ji;function n1(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var r1=n1;function i1(t,e){return t.has(e)}var o1=i1,s1=t1,l1=r1,a1=o1,c1=1,d1=2;function u1(t,e,n,r,i,o){var s=n&c1,l=t.length,a=e.length;if(l!=a&&!(s&&a>l))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&d1?new s1:void 0;for(o.set(t,e),o.set(e,t);++f<l;){var m=t[f],y=e[f];if(r)var g=s?r(y,m,f,e,t,o):r(m,y,f,t,e,o);if(g!==void 0){if(g)continue;h=!1;break}if(p){if(!l1(e,function(v,x){if(!a1(p,x)&&(m===v||i(m,v,n,r,o)))return p.push(x)})){h=!1;break}}else if(!(m===y||i(m,y,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var uc=u1,f1=Ct,h1=f1.Uint8Array,p1=h1;function m1(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var g1=m1;function y1(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var b1=y1,fc=ds,hc=p1,k1=ic,v1=uc,x1=g1,w1=b1,S1=1,C1=2,O1="[object Boolean]",E1="[object Date]",M1="[object Error]",T1="[object Map]",$1="[object Number]",N1="[object RegExp]",B1="[object Set]",A1="[object String]",D1="[object Symbol]",V1="[object ArrayBuffer]",_1="[object DataView]",pc=fc?fc.prototype:void 0,ps=pc?pc.valueOf:void 0;function I1(t,e,n,r,i,o,s){switch(n){case _1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case V1:return!(t.byteLength!=e.byteLength||!o(new hc(t),new hc(e)));case O1:case E1:case $1:return k1(+t,+e);case M1:return t.name==e.name&&t.message==e.message;case N1:case A1:return t==e+"";case T1:var l=x1;case B1:var a=r&S1;if(l||(l=w1),t.size!=e.size&&!a)return!1;var d=s.get(t);if(d)return d==e;r|=C1,s.set(t,e);var u=v1(l(t),l(e),r,i,o,s);return s.delete(t),u;case D1:if(ps)return ps.call(t)==ps.call(e)}return!1}var P1=I1;function R1(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var L1=R1,z1=Array.isArray,ms=z1,F1=L1,j1=ms;function H1(t,e,n){var r=e(t);return j1(t)?r:F1(r,n(t))}var W1=H1;function q1(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var U1=q1;function K1(){return[]}var J1=K1,G1=U1,Y1=J1,Z1=Object.prototype,X1=Z1.propertyIsEnumerable,mc=Object.getOwnPropertySymbols,Q1=mc?function(t){return t==null?[]:(t=Object(t),G1(mc(t),function(e){return X1.call(t,e)}))}:Y1,ek=Q1;function tk(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var nk=tk,rk=Ur,ik=Kr,ok="[object Arguments]";function sk(t){return ik(t)&&rk(t)==ok}var lk=sk,gc=lk,ak=Kr,yc=Object.prototype,ck=yc.hasOwnProperty,dk=yc.propertyIsEnumerable,uk=gc(function(){return arguments}())?gc:function(t){return ak(t)&&ck.call(t,"callee")&&!dk.call(t,"callee")},fk=uk,Hi={exports:{}};function hk(){return!1}var pk=hk;Hi.exports,function(t,e){var n=Ct,r=pk,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,a=l?l.isBuffer:void 0,d=a||r;t.exports=d}(Hi,Hi.exports);var bc=Hi.exports,mk=9007199254740991,gk=/^(?:0|[1-9]\d*)$/;function yk(t,e){var n=typeof t;return e=e??mk,!!e&&(n=="number"||n!="symbol"&&gk.test(t))&&t>-1&&t%1==0&&t<e}var bk=yk,kk=9007199254740991;function vk(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=kk}var kc=vk,xk=Ur,wk=kc,Sk=Kr,Ck="[object Arguments]",Ok="[object Array]",Ek="[object Boolean]",Mk="[object Date]",Tk="[object Error]",$k="[object Function]",Nk="[object Map]",Bk="[object Number]",Ak="[object Object]",Dk="[object RegExp]",Vk="[object Set]",_k="[object String]",Ik="[object WeakMap]",Pk="[object ArrayBuffer]",Rk="[object DataView]",Lk="[object Float32Array]",zk="[object Float64Array]",Fk="[object Int8Array]",jk="[object Int16Array]",Hk="[object Int32Array]",Wk="[object Uint8Array]",qk="[object Uint8ClampedArray]",Uk="[object Uint16Array]",Kk="[object Uint32Array]",ke={};ke[Lk]=ke[zk]=ke[Fk]=ke[jk]=ke[Hk]=ke[Wk]=ke[qk]=ke[Uk]=ke[Kk]=!0,ke[Ck]=ke[Ok]=ke[Pk]=ke[Ek]=ke[Rk]=ke[Mk]=ke[Tk]=ke[$k]=ke[Nk]=ke[Bk]=ke[Ak]=ke[Dk]=ke[Vk]=ke[_k]=ke[Ik]=!1;function Jk(t){return Sk(t)&&wk(t.length)&&!!ke[xk(t)]}var Gk=Jk;function Yk(t){return function(e){return t(e)}}var Zk=Yk,Wi={exports:{}};Wi.exports,function(t,e){var n=Ga,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var a=i&&i.require&&i.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l}(Wi,Wi.exports);var Xk=Wi.exports,Qk=Gk,ev=Zk,vc=Xk,xc=vc&&vc.isTypedArray,tv=xc?ev(xc):Qk,wc=tv,nv=nk,rv=fk,iv=ms,ov=bc,sv=bk,lv=wc,av=Object.prototype,cv=av.hasOwnProperty;function dv(t,e){var n=iv(t),r=!n&&rv(t),i=!n&&!r&&ov(t),o=!n&&!r&&!i&&lv(t),s=n||r||i||o,l=s?nv(t.length,String):[],a=l.length;for(var d in t)(e||cv.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||sv(d,a)))&&l.push(d);return l}var uv=dv,fv=Object.prototype;function hv(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||fv;return t===n}var pv=hv;function mv(t,e){return function(n){return t(e(n))}}var gv=mv,yv=gv,bv=yv(Object.keys,Object),kv=bv,vv=pv,xv=kv,wv=Object.prototype,Sv=wv.hasOwnProperty;function Cv(t){if(!vv(t))return xv(t);var e=[];for(var n in Object(t))Sv.call(t,n)&&n!="constructor"&&e.push(n);return e}var Ov=Cv,Ev=oc,Mv=kc;function Tv(t){return t!=null&&Mv(t.length)&&!Ev(t)}var $v=Tv,Nv=uv,Bv=Ov,Av=$v;function Dv(t){return Av(t)?Nv(t):Bv(t)}var Vv=Dv,_v=W1,Iv=ek,Pv=Vv;function Rv(t){return _v(t,Pv,Iv)}var Lv=Rv,Sc=Lv,zv=1,Fv=Object.prototype,jv=Fv.hasOwnProperty;function Hv(t,e,n,r,i,o){var s=n&zv,l=Sc(t),a=l.length,d=Sc(e),u=d.length;if(a!=u&&!s)return!1;for(var f=a;f--;){var h=l[f];if(!(s?h in e:jv.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var g=s;++f<a;){h=l[f];var v=t[h],x=e[h];if(r)var T=s?r(x,v,h,e,t,o):r(v,x,h,t,e,o);if(!(T===void 0?v===x||i(v,x,n,r,o):T)){y=!1;break}g||(g=h=="constructor")}if(y&&!g){var b=t.constructor,S=e.constructor;b!=S&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(y=!1)}return o.delete(t),o.delete(e),y}var Wv=Hv,qv=Xn,Uv=Ct,Kv=qv(Uv,"DataView"),Jv=Kv,Gv=Xn,Yv=Ct,Zv=Gv(Yv,"Promise"),Xv=Zv,Qv=Xn,ex=Ct,tx=Qv(ex,"Set"),nx=tx,rx=Xn,ix=Ct,ox=rx(ix,"WeakMap"),sx=ox,gs=Jv,ys=hs,bs=Xv,ks=nx,vs=sx,Cc=Ur,nr=lc,Oc="[object Map]",lx="[object Object]",Ec="[object Promise]",Mc="[object Set]",Tc="[object WeakMap]",$c="[object DataView]",ax=nr(gs),cx=nr(ys),dx=nr(bs),ux=nr(ks),fx=nr(vs),Cn=Cc;(gs&&Cn(new gs(new ArrayBuffer(1)))!=$c||ys&&Cn(new ys)!=Oc||bs&&Cn(bs.resolve())!=Ec||ks&&Cn(new ks)!=Mc||vs&&Cn(new vs)!=Tc)&&(Cn=function(t){var e=Cc(t),n=e==lx?t.constructor:void 0,r=n?nr(n):"";if(r)switch(r){case ax:return $c;case cx:return Oc;case dx:return Ec;case ux:return Mc;case fx:return Tc}return e});var hx=Cn,xs=Ub,px=uc,mx=P1,gx=Wv,Nc=hx,Bc=ms,Ac=bc,yx=wc,bx=1,Dc="[object Arguments]",Vc="[object Array]",qi="[object Object]",kx=Object.prototype,_c=kx.hasOwnProperty;function vx(t,e,n,r,i,o){var s=Bc(t),l=Bc(e),a=s?Vc:Nc(t),d=l?Vc:Nc(e);a=a==Dc?qi:a,d=d==Dc?qi:d;var u=a==qi,f=d==qi,h=a==d;if(h&&Ac(t)){if(!Ac(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new xs),s||yx(t)?px(t,e,n,r,i,o):mx(t,e,a,n,r,i,o);if(!(n&bx)){var p=u&&_c.call(t,"__wrapped__"),m=f&&_c.call(e,"__wrapped__");if(p||m){var y=p?t.value():t,g=m?e.value():e;return o||(o=new xs),i(y,g,n,r,o)}}return h?(o||(o=new xs),gx(t,e,n,r,i,o)):!1}var xx=vx,wx=xx,Ic=Kr;function Pc(t,e,n,r,i){return t===e?!0:t==null||e==null||!Ic(t)&&!Ic(e)?t!==t&&e!==e:wx(t,e,n,r,Pc,i)}var Sx=Pc,Cx=Sx;function Ox(t,e){return Cx(t,e)}var Ex=Ox;const Rc=Wr(Ex),Mx={key:0,class:"leading-none"},Tx={class:"flex flex-col max-h-80 overflow-y-auto"},$x={key:0,class:"p-3"},Nx={key:1},Bx={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},Ax=["onClick"],Dx={class:"select-none flex w-full items-center justify-between"},Lc=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=c.ref(r.options);c.watch(()=>r.options,()=>{var x;(x=r.options)!=null&&x.length&&(i.value=[...r.options])},{immediate:!0,deep:!0});const o=n,s=c.ref(),l=c.ref();function a(x){if(r.multiple){if(x){let T=r.modelValue||[];T.indexOf(x)>=0?T.splice(T.indexOf(x),1):T.push(x),o("update:modelValue",T),f(T)}}else o("update:modelValue",x),f(x),s.value=null,l.value.hide()}function d(x){o("update:modelValue",x),f(x)}function u(){r.multiple?(o("update:modelValue",[]),f([])):(o("update:modelValue",null),f(null))}const f=rc(function(x){o("change",x)},r.debounce),h=c.computed(()=>{var x,T,b,S;if(r.multiple)if(r.maxDisplay){let k=(T=i.value)==null?void 0:T.filter(D=>{var A;return((A=r.modelValue)==null?void 0:A.indexOf(D.value))>=0}).map(D=>D.label),C=k==null?void 0:k.slice(0,r.maxDisplay);return(k==null?void 0:k.length)-(C==null?void 0:C.length)>0?(C==null?void 0:C.join(", "))+` (+${(k==null?void 0:k.length)-C.length})`:C==null?void 0:C.join(", ")}else return(x=i.value)==null?void 0:x.filter(k=>{var C;return((C=r.modelValue)==null?void 0:C.indexOf(k.value))>=0}).map(k=>k.label).join(", ");else return((S=(b=i.value)==null?void 0:b.find(k=>k.value===r.modelValue))==null?void 0:S.label)||r.modelValue});function p(x){try{return r.multiple?r.modelValue!==null&&r.modelValue.some(T=>Rc(T,x)):r.modelValue!==null&&Rc(x,r.modelValue)}catch(T){return console.log(T),!1}}const m={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-lime-500 group-[.is-selected]:font-medium text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-lime-700"},y=c.computed(()=>{var x,T;return((x=r.modelValue)==null?void 0:x.length)===((T=r.options)==null?void 0:T.length)}),g=c.computed(()=>{var x;if(r.filterable&&!r.remoteMethod&&((x=s.value)!=null&&x.trim().length)){const T=s.value.trim().toLowerCase();return r.options.filter(b=>{var S;return(S=b.label)==null?void 0:S.toLowerCase().includes(T)})}return r.options});function v(){r.remoteMethod&&r.remoteMethod(s.value)}return e({isAllSelected:y}),(x,T)=>(c.openBlock(),c.createBlock(Yn,{custom:"",ref_key:"myPopover",ref:l,label:t.label,disabled:t.disabled},{default:c.withCtx(({isHidden:b})=>[c.createVNode(cs,{disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:c.withCtx(()=>{var S,k,C;return[c.createElementVNode("span",{class:c.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((S=t.modelValue)==null?void 0:S.length)>0)&&!t.hideSelect?(c.openBlock(),c.createElementBlock("span",Mx,[y.value&&((k=t.allSelectedText)!=null&&k.length)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createTextVNode(c.toDisplayString(t.allSelectedText)+" ("+c.toDisplayString((C=t.options)==null?void 0:C.length)+")",1)],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createTextVNode(c.toDisplayString(h.value),1)],64))])):c.renderSlot(x.$slots,"default",{key:1},()=>[c.createTextVNode(c.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(c.openBlock(),c.createElementBlock("div",{key:0,onClick:c.withModifiers(u,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Hr,{class:"w-4 h-4"})])):c.createCommentVNode("",!0),c.createVNode(pg,{class:c.normalizeClass(["h-4 w-4 transition-all transform",{"rotate-180":!b}])},null,8,["class"])]}),_:2},1032,["disabled","small","invalid","loading"])]),content:c.withCtx(()=>{var b;return[c.createElementVNode("div",Tx,[t.filterable?(c.openBlock(),c.createElementBlock("div",$x,[c.createVNode(Fc,{slim:"",placeholder:"Search...",clearable:"",modelValue:s.value,"onUpdate:modelValue":[T[0]||(T[0]=S=>s.value=S),v]},null,8,["modelValue"])])):c.createCommentVNode("",!0),!t.options&&((b=t.options)==null?void 0:b.length)==0?(c.openBlock(),c.createElementBlock("span",Nx,"No data.")):(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[t.multiple&&t.batchSelect?(c.openBlock(),c.createElementBlock("div",Bx,[c.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:T[1]||(T[1]=S=>{var k;return d((k=t.options)==null?void 0:k.filter(C=>C.value).map(C=>C.value))})},"Select all"),c.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:T[2]||(T[2]=S=>d([]))},"Select none")])):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g.value,S=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["group",{"is-selected":!!p(S.value)}])},[c.createElementVNode("div",{class:c.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||S.value,[`${m[c.unref(te).theme]}`]:!0}]),onClick:k=>S.disabled?null:a(S.value)},[c.createElementVNode("div",Dx,[c.createElementVNode("span",{class:c.normalizeClass(["",{"opacity-25":S.disabled}])},c.toDisplayString(S.label||S.value),3),t.multiple&&p(S.value)?(c.openBlock(),c.createBlock(Ja,{key:0,class:"w-4 h-4"})):c.createCommentVNode("",!0)])],10,Ax)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Vx={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},_x={class:""},Ix=["value","disabled","rows","placeholder"],zc=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=c.ref(null),o=c.ref(!1);c.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&c.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function l(d){s("update:modelValue",d==null?void 0:d.target.value)}function a(){i.value.focus()}return e({focus:a}),(d,u)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[t.label?(c.openBlock(),c.createElementBlock("div",Vx,[c.createTextVNode(c.toDisplayString(t.label)+" ",1),c.createElementVNode("div",_x,[d.info?(c.openBlock(),c.createBlock(Yn,{key:0,hover:""},{content:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.info),1)]),default:c.withCtx(()=>[c.createVNode(as,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),c.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:c.normalizeClass(["relative appearance-none outline-hidden flex w-full h-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.noResize,"overflow-hidden":t.autoResize&&!o.value,"overflow-auto":t.autoResize||o.value}]),style:c.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:l,placeholder:t.placeholder},null,46,Ix)],64))}}),Px={},Rx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Lx=[c.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),c.createElementVNode("path",{"fill-rule":"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z","clip-rule":"evenodd"},null,-1)];function zx(t,e){return c.openBlock(),c.createElementBlock("svg",Rx,Lx)}const Fx=ce(Px,[["render",zx]]),jx={},Hx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Wx=[c.createElementVNode("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"},null,-1),c.createElementVNode("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"},null,-1),c.createElementVNode("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"},null,-1)];function qx(t,e){return c.openBlock(),c.createElementBlock("svg",Hx,Wx)}const Ux=ce(jx,[["render",qx]]),Kx={},Jx={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Gx=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function Yx(t,e){return c.openBlock(),c.createElementBlock("svg",Jx,Gx)}const Zx=ce(Kx,[["render",Yx]]),Xx={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-gray-500 flex items-center"},Qx={key:0},ew={class:""},tw=["innerHTML"],nw=["name","value","checked"],rw={key:0,class:"absolute dark:text-gray-400 left-0 ml-3 h-full flex items-center justify-center text-center"},iw={class:"opacity-50 w-4 h-4 leading-none"},ow={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},sw={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},lw={key:5,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Fc=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=c.computed(()=>o.name?o.name:ls()),l=Yp(s.value),a=c.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=c.ref(!0),u=c.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=c.computed(()=>{var C;if(o.rules&&typeof o.rules=="string"){let D=(C=o.rules)==null?void 0:C.split("|");return o.required&&D.push("required"),o.email&&D.push("email"),D.join("|")}else if(!o.rules){let D=[];return o.required&&D.push("required"),o.email&&D.push("email"),D.join("|")}return"required"});function p(C){let D=C&&C.target?C.target.value:C;x(D)}const m=n;function y(C){C===!0||C===!1?m("update:modelValue",!C):m("update:modelValue",C)}function g(C){let D=C&&C.target?C.target.value:C;m("update:modelValue",D),m("onChange",D)}function v(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=rc(function(C){m("update:modelValue",C),m("onChange",C)},o.debounce),T=c.ref(null),b=c.ref();function S(){var C,D;o.textarea?(C=b.value)==null||C.focus():(D=T.value)==null||D.$el.focus()}function k(){return T.value.meta.valid}return e({focus:S,isValid:k}),(C,D)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[a.value&&!t.checkbox&&!t.radio?(c.openBlock(),c.createElementBlock("div",Xx,[c.createTextVNode(c.toDisplayString(a.value)+" ",1),t.required&&!t.hideRequired?(c.openBlock(),c.createElementBlock("span",Qx,"*")):c.createCommentVNode("",!0),c.createElementVNode("div",ew,[t.info?(c.openBlock(),c.createBlock(Yn,{key:0,hover:""},{content:c.withCtx(()=>[c.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,tw)]),default:c.withCtx(()=>[c.createVNode(as,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),t.checkbox?(c.openBlock(),c.createBlock(c.unref(Pr),{key:1,ref_key:"myInput",ref:T,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:c.withCtx(({field:A})=>[c.createElementVNode("div",{class:c.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:D[0]||(D[0]=R=>t.disabled?void 0:y(t.modelValue))},[c.createElementVNode("div",{class:c.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[c.unref(te).theme]}`]:!0}])},[t.modelValue===!0?(c.openBlock(),c.createBlock(Ja,{key:0})):c.createCommentVNode("",!0)],2),c.createElementVNode("span",{class:c.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[c.renderSlot(C.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(a.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(c.openBlock(),c.createBlock(c.unref(Pr),{key:2,ref_key:"myInput",ref:T,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:c.withCtx(({field:A})=>[c.createElementVNode("div",{onClick:D[2]||(D[2]=()=>{t.disabled||g(t.radioValue)}),class:c.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[c.createElementVNode("span",{class:c.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):c.createCommentVNode("",!0)],2),c.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:D[1]||(D[1]=(...R)=>C.onChange&&C.onChange(...R)),checked:t.radioValue==t.modelValue},null,40,nw),a.value?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["text-base",{"opacity-50":t.disabled}])},c.toDisplayString(a.value),3)):c.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(c.openBlock(),c.createBlock(c.unref(Pr),{key:3,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:c.withCtx(({field:A})=>{var R;return[c.createVNode(Lc,{modelValue:t.modelValue,"onUpdate:modelValue":g,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&c.unref(l)),required:t.required||((R=h.value)==null?void 0:R.indexOf("required"))>=0,label:a.value,placeholder:t.placeholder,loading:t.loading},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading"])]}),_:1},8,["modelValue","rules","name"])):(c.openBlock(),c.createElementBlock("div",{key:4,class:c.normalizeClass(["wpic-input rounded-sm flex relative border",{[`${r[c.unref(te).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-opacity-50 border-zinc-300 text-zinc-400":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":c.unref(l)}])},[C.$slots.prepend?(c.openBlock(),c.createElementBlock("div",rw,[c.createElementVNode("div",iw,[c.renderSlot(C.$slots,"prepend")])])):c.createCommentVNode("",!0),t.textarea?(c.openBlock(),c.createBlock(c.unref(Pr),{key:1,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:c.withCtx(()=>{var A;return[c.createVNode(zc,{ref_key:"myTextarea",ref:b,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&c.unref(l)),required:t.required||((A=h.value)==null?void 0:A.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(c.openBlock(),c.createBlock(c.unref(Pr),{key:2,ref_key:"myInput",ref:T,autocomplete:"off",style:{"z-index":"1"},class:c.normalizeClass(["flex w-full h-full rounded-sm pr-4 bg-transparent outline-hidden appearance-none dark:text-gray-400 dark:placeholder:text-gray-700",{"pl-4":!C.$slots.prepend,"pl-12":C.$slots.prepend,"py-2":t.textarea,"cursor-not-allowed":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!c.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(c.openBlock(),c.createElementBlock("div",{key:3,onClick:c.withModifiers(v,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Un,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(c.openBlock(),c.createElementBlock("div",{key:4,onClick:c.withModifiers(v,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Hr,{class:"w-5 h-5 opacity-50"})])):c.createCommentVNode("",!0),C.$slots.append||t.password||t.type=="password"?(c.openBlock(),c.createElementBlock("div",ow,[c.createElementVNode("div",sw,[c.renderSlot(C.$slots,"append",{},()=>[c.withDirectives(c.createVNode(Fx,{class:"text-zinc-600 select-none",onClick:f},null,512),[[c.vShow,d.value]]),c.withDirectives(c.createVNode(Ux,{class:"text-zinc-600 select-none",onClick:f},null,512),[[c.vShow,!d.value]])])])])):c.createCommentVNode("",!0)],2)),t.error&&c.unref(l)?(c.openBlock(),c.createElementBlock("div",lw,[c.createVNode(c.unref(Gp),{name:s.value},{default:c.withCtx(A=>[c.createTextVNode(c.toDisplayString(A.message),1)]),_:1},8,["name"])])):c.createCommentVNode("",!0),C.$slots.help||t.help?(c.openBlock(),c.createElementBlock("div",{key:6,class:c.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[c.renderSlot(C.$slots,"help",{},()=>[c.createTextVNode(c.toDisplayString(t.help),1)])],2)):c.createCommentVNode("",!0)],2))}}),aw=["innerHTML"],jc=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=c.ref(),n=c.ref(),r=c.ref();ls();const i=t;function o(){i.text&&(n.value.style.display="block",l())}function s(){n.value.style.display=""}async function l(){var h,p;await c.nextTick();const a=await Ua(e.value,n.value,{placement:i.placement,middleware:[qa(),Wa(),Ha(i.offset),Zm({element:r.value})]});n.value.style.left=`${a.x}px`,n.value.style.top=`${a.y}px`;const{x:d,y:u}=a.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(a,d)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("span",{ref_key:"button",ref:e,class:c.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[c.renderSlot(a.$slots,"default")],34),c.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 dark:border-gray-900 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[c.createElementVNode("span",{innerHTML:t.text},null,8,aw),c.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),cw={key:1,class:"flex justify-between items-baseline pt-4 px-6"},dw={class:""},uw={key:2,class:"flex items-center justify-end py-4 px-6"},fw=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=c.resolveComponent("wpic-loading-panel");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["rounded-lg wpic-card relative",{[e[c.unref(te).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions}])},[t.loading?(c.openBlock(),c.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):c.createCommentVNode("",!0),t.title||r.$slots.actions?(c.openBlock(),c.createElementBlock("div",cw,[t.title||r.$slots.actions?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["text-lg 2xl:text-xl",[n[c.unref(te).theme]]])},c.toDisplayString(t.title),3)):c.createCommentVNode("",!0),c.createElementVNode("div",dw,[c.renderSlot(r.$slots,"actions")])])):c.createCommentVNode("",!0),c.renderSlot(r.$slots,"default"),r.$slots.buttons?(c.openBlock(),c.createElementBlock("div",uw,[c.renderSlot(r.$slots,"buttons")])):c.createCommentVNode("",!0)],2)}}}),hw={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},pw={class:"flex-1 text-lg dark:text-gray-300 font-semibold"},mw=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[c.unref(te).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions),"pt-6":!t.title&&!n.$slots.actions,"bg-gray-50 dark:bg-gray-930":t.sub}])},[t.title||n.$slots.actions?(c.openBlock(),c.createElementBlock("div",hw,[c.createElementVNode("div",pw,c.toDisplayString(t.title),1),c.renderSlot(n.$slots,"actions")])):c.createCommentVNode("",!0),c.renderSlot(n.$slots,"default")],2))}}),gw=c.createElementVNode("div",{class:""},null,-1),yw=c.createStaticVNode('<div class="-mt-2"><div class="absolute left-1/4 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-1/2 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-3/4 h-8 border-r border-gray-100 dark:border-gray-900"></div></div><div class="mt-7 text-gray-500 dark:text-gray-600"><div class="absolute left-0 text-xs">0%</div><div class="absolute left-1/4 -translate-x-1/4 text-xs">25%</div><div class="absolute left-1/2 -translate-x-1/2 text-xs">50%</div><div class="absolute right-1/4 translate-x-3/4 text-xs">75%</div><div class="absolute right-0 text-xs">100%</div></div>',2),bw=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=c.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[c.createElementVNode("div",{class:c.normalizeClass(["flex w-full relative",r[c.unref(te).theme]]),style:{"z-index":"1"}},[n.value>0?(c.openBlock(),c.createElementBlock("div",{key:0,style:c.normalizeStyle({width:`${n.value}%`}),class:c.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[c.unref(te).theme]}`]:!0}])},[c.createVNode(jc,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:c.withCtx(()=>[gw]),_:1},8,["text"])],6)):c.createCommentVNode("",!0)],2),t.indicators?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[yw],64)):c.createCommentVNode("",!0)],2))}}),kw={class:"leading-none"},vw=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[c.unref(te).theme]]:!0}])},[c.createElementVNode("span",kw,[c.renderSlot(o.$slots,"default")]),t.clearable?(c.openBlock(),c.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Hr,{class:"w-4 h-4"})])):c.createCommentVNode("",!0)],2))}}),xw=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"w-full":t.full})},[c.createElementVNode("div",{class:c.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[c.renderSlot(e.$slots,"default")],2)],2))}}),ww=t=>(c.pushScopeId("data-v-947735f2"),t=t(),c.popScopeId(),t),Sw={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Cw=[ww(()=>c.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Ow=ce(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(c.openBlock(),c.createElementBlock("div",Sw,Cw)):(c.openBlock(),c.createBlock(Un,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Ew={class:"text-base font-medium select-none"},Jr=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[c.unref(te).theme]]:!t.active&&!t.disabled,[n[c.unref(te).theme]]:t.active&&!t.disabled,[r[c.unref(te).theme]]:t.disabled}])},[c.createElementVNode("span",Ew,[c.renderSlot(i.$slots,"default")])],2))}}),Mw={},Tw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},$w=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function Nw(t,e){return c.openBlock(),c.createElementBlock("svg",Tw,$w)}const Hc=ce(Mw,[["render",Nw]]),Bw={},Aw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Dw=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z","clip-rule":"evenodd"},null,-1)];function Vw(t,e){return c.openBlock(),c.createElementBlock("svg",Aw,Dw)}const Wc=ce(Bw,[["render",Vw]]),_w={},Iw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Pw=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function Rw(t,e){return c.openBlock(),c.createElementBlock("svg",Iw,Pw)}const qc=ce(_w,[["render",Rw]]),Lw={},zw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Fw=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function jw(t,e){return c.openBlock(),c.createElementBlock("svg",zw,Fw)}const Uc=ce(Lw,[["render",jw]]),Hw={class:"wpic-pagination flex justify-between"},Ww={key:0,class:"flex items-center"},qw={key:0},Uw={key:1,class:"flex flex-wrap gap-2"},Kw=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:Boolean,total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1}},emits:["update:perPage","update:currentPage"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=c.computed(()=>Math.ceil(r.total/r.perPage)),s=c.computed(()=>{const u=o.value;if(!u||u===1)return[1];const f=r.currentPage,h=1;let p=Math.max(2,f-h),m=Math.min(u-1,f+h);f<=h+2&&(p=2,m=Math.min(2*h+2,u-1)),f>=u-h-1&&(p=Math.max(2,u-2*h-1),m=u-1);const y=[];for(let g=p;g<=m;g++)y.push(g);return p>2&&y.unshift("..."),m<u-1&&y.push("..."),[1,...y,u]});function l(u){u>=1&&u<=o.value&&i("update:currentPage",u)}function a(){return r.perPage*(r.currentPage-1)+1}function d(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}return e({getStart:a,getEnd:d}),(u,f)=>(c.openBlock(),c.createElementBlock("div",Hw,[t.info?(c.openBlock(),c.createElementBlock("div",Ww,[t.total>0?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createTextVNode(c.toDisplayString(a())+" - "+c.toDisplayString(d()),1),t.total?(c.openBlock(),c.createElementBlock("span",qw," / "+c.toDisplayString(t.total),1)):c.createCommentVNode("",!0)],64)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),t.pages?(c.openBlock(),c.createElementBlock("div",Uw,[c.createVNode(Jr,{onClick:f[0]||(f[0]=h=>l(1)),disabled:t.currentPage===1||o.value==0||!o.value},{default:c.withCtx(()=>[c.createVNode(Hc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),c.createVNode(Jr,{onClick:f[1]||(f[1]=h=>l(t.currentPage-1)),disabled:t.currentPage===1||o.value==0||!o.value},{default:c.withCtx(()=>[c.createVNode(Wc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,h=>(c.openBlock(),c.createBlock(Jr,{key:`page_${h}`,onClick:p=>l(h),active:h===t.currentPage,disabled:o.value==0||!o.value},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(h),1)]),_:2},1032,["onClick","active","disabled"]))),128)),c.createVNode(Jr,{onClick:f[2]||(f[2]=h=>l(t.currentPage+1)),disabled:t.currentPage===o.value||o.value==0||!o.value},{default:c.withCtx(()=>[c.createVNode(Uc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),c.createVNode(Jr,{onClick:f[3]||(f[3]=h=>l(o.value)),disabled:t.currentPage===o.value||o.value==0||!o.value},{default:c.withCtx(()=>[c.createVNode(qc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"])])):c.createCommentVNode("",!0),c.createCommentVNode("",!0)]))}}),Kc=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return c.h("td",e.attrs,n)};Kc.props=["column","item","rowIndex"];const ws=Kc,Jw={},Gw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Yw=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function Zw(t,e){return c.openBlock(),c.createElementBlock("svg",Gw,Yw)}const Xw=ce(Jw,[["render",Zw]]),Qw={class:"font-semibold"},Jc={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:border-gray-900 dark:bg-gray-800"};return(n,r)=>(c.openBlock(),c.createElementBlock("tr",Qw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.columns,(i,o)=>(c.openBlock(),c.createBlock(ws,{class:c.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[c.unref(te).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":!0,"first:rounded-bl-lg":!0,"text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},eS={},tS={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},nS=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function rS(t,e){return c.openBlock(),c.createElementBlock("svg",tS,nS)}const iS=ce(eS,[["render",rS]]),oS={class:"overflow-auto"},sS={class:"w-full rounded-lg"},lS=["width"],aS=["width"],cS={key:0,class:"rounded-t-lg"},dS=["onClick"],uS={class:"rounded-b-lg relative"},fS={key:0},hS=[c.createElementVNode("td",{class:"text-center py-3"},"   ",-1)],pS={key:1},mS={key:0,class:"text-center text-gray-400 py-3"},gS=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean},emits:["changeSort","expandRow"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-400 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},l={pmi:"","wpic-tools":""},a={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-300"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10"},f=n;c.onMounted(()=>{y()});const h=c.getCurrentInstance();c.provide("wtable",h==null?void 0:h.proxy);const p=c.useSlots(),m=c.ref([]);function y(){const T=(k,C)=>{let D={};for(let A in k){if(typeof k[A].default=="boolean"&&C[A]!==void 0){D[A]=C[A]!==!1;continue}if(C[A]!==void 0){D[A]=C[A];continue}if(typeof k[A].default=="function"){D[A]=k[A].default();continue}D[A]=k[A].default}return D};let b=[];(p.default&&p.default()||[]).forEach(k=>{var C,D;((C=k.type)==null?void 0:C.name)==="WpicTableColumn"?b.push(k):(D=k.children)!=null&&D.length&&k.children.forEach(A=>{var R;((R=A.type)==null?void 0:R.name)==="WpicTableColumn"&&b.push(A)})}),m.value=b.map(k=>{let C=k.children,D=k.props||{},{field:A,label:R,help:F,width:j,minWidth:_,maxWidth:B,sortable:N,selectable:$,render:O,type:V,align:H,visible:G,noPadding:ie}=T(k.type.props,D);return{label:R,help:F,width:j,minWidth:_,maxWidth:B,type:V,align:H,sortable:N,selectable:$,field:A,render:O,children:C,visible:G,noPadding:ie}}).filter(k=>k.visible||k.selectable)}function g(T){var S,k;let b=(S=r.sortOptions)==null?void 0:S.sortDirection;((k=r.sortOptions)==null?void 0:k.sortBy)===T&&(b=b==="asc"?"desc":"asc"),f("changeSort",{sortDirection:b,sortBy:T})}c.watch(()=>p.default,T=>{y()},{deep:!0}),e({buildColumns:y});const v=c.reactive({});function x({index:T,item:b}){v[T]?v[T]=null:(v[T]=!0,f("expandRow",{index:T,item:b}))}return(T,b)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-table relative w-full rounded-lg overflow-hidden",{"no-radius rounded-none":t.noRadius,border:t.border,[`${i[c.unref(te).theme]}`]:!0}])},[c.createElementVNode("div",oS,[c.createElementVNode("table",sS,[c.createElementVNode("colgroup",null,[m.value.find(S=>S.type=="expand")?(c.openBlock(),c.createElementBlock("col",{key:0,style:c.normalizeStyle({minWidth:`${m.value.find(S=>S.type=="expand").minWidth}px`}),width:m.value.find(S=>S.type=="expand").width,class:"w-16"},null,12,lS)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(S=>S.type!="expand"),(S,k)=>(c.openBlock(),c.createElementBlock("col",{style:c.normalizeStyle({minWidth:`${S.minWidth}px`,maxWidth:`${S.maxWidth}px`}),width:S.width,key:k},null,12,aS))),128))]),t.hideHeaders?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("thead",cS,[c.createElementVNode("tr",null,[m.value.find(S=>S.type=="expand")?(c.openBlock(),c.createElementBlock("th",{key:0,class:c.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[c.unref(te).theme]}`]])},null,2)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(S=>S.type!="expand"),(S,k)=>{var C,D;return c.openBlock(),c.createElementBlock("th",{class:c.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[c.unref(te).theme]}`]:!0,"sticky left-0":k===0}]),style:c.normalizeStyle({maxWidth:`${S.maxWidth}px`})},[c.createElementVNode("div",{onClick:()=>{S.sortable&&g(S.field)},class:c.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":S.sortable&&S.field,"justify-center":S.align=="center","justify-end":S.align=="right"}])},[c.createElementVNode("span",{class:c.normalizeClass(["select-none font-medium",{"text-right":S.align=="right"}])},c.toDisplayString(S.label),3),S.sortable&&S.field?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["ml-1",{"opacity-25":S.field!=((C=t.sortOptions)==null?void 0:C.sortBy)}])},[c.createVNode(Xw,{class:c.normalizeClass(["w-4 h-4",{"rotate-180":((D=t.sortOptions)==null?void 0:D.sortDirection)==="asc"}])},null,8,["class"])],2)):c.createCommentVNode("",!0)],10,dS)],6)}),256))])])),c.createElementVNode("tbody",uS,[t.loading?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("div",{class:c.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[c.unref(te).theme]]])},[c.createVNode(Un,{class:"w-6 h-6"})],2),t.data.length?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("tr",fS,hS))],64)):c.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(c.openBlock(),c.createBlock(Jc,{key:1,position:"header",columns:m.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.data,(S,k)=>{var C,D,A,R,F;return c.openBlock(),c.createElementBlock(c.Fragment,{key:`tr_${k}`},[c.createElementVNode("tr",{class:c.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":k%2==0,"is-even":k%2!=0,[s[c.unref(te).theme]]:!0}])},[m.value.find(j=>j.type=="expand")?(c.openBlock(),c.createElementBlock("td",{key:0,class:c.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top"}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[c.createVNode(Ni,{small:"",square:"",onClick:j=>x({item:S,index:k})},{default:c.withCtx(()=>[v[k]?(c.openBlock(),c.createBlock(Zx,{key:0,class:"w-4 h-4"})):(c.openBlock(),c.createBlock(iS,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(j=>j.type!="expand"),(j,_)=>{var B,N;return c.openBlock(),c.createBlock(ws,{class:c.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":_===0,[`${a[c.unref(te).theme]}`]:!0,[`${d[c.unref(te).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!j.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":k===((B=t.data)==null?void 0:B.length)-1&&!t.totalItem&&!m.value.find($=>$.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":k===((N=t.data)==null?void 0:N.length)-1&&!t.totalItem&&!m.value.find($=>$.type=="expand")&&!t.noRadius,"text-center justify-center":j.align=="center","text-right justify-end":j.align=="right","align-top py-5":t.valign=="top"}]),style:c.normalizeStyle({maxWidth:`${j.maxWidth}px`}),id:`${k}_${_}`,column:j,item:S,rowIndex:k,key:_},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),m.value.find(j=>j.type=="expand")?c.withDirectives((c.openBlock(),c.createElementBlock("tr",{key:0,class:c.normalizeClass([{[s[c.unref(te).theme]]:!t.stripe,[l[c.unref(te).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[c.createVNode(ws,{class:c.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${a[c.unref(te).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((C=m.value.find(j=>j.type=="expand"))!=null&&C.noPadding),"p-0":(D=m.value.find(j=>j.type=="expand"))==null?void 0:D.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":k===((A=t.data)==null?void 0:A.length)-1&&!t.totalItem,"first:rounded-bl-lg":k===((R=t.data)==null?void 0:R.length)-1&&!t.totalItem,"text-center":m.value.find(j=>j.type=="expand").align=="center","text-right":m.value.find(j=>j.type=="expand").align=="right"}]),column:m.value.find(j=>j.type=="expand"),rowIndex:k,colspan:(F=m.value)==null?void 0:F.length,item:S},null,8,["class","column","rowIndex","colspan","item"])],2)),[[c.vShow,v[k]]]):c.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(c.openBlock(),c.createElementBlock("tfoot",pS,[c.createVNode(Jc,{position:"footer",columns:m.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])])):c.createCommentVNode("",!0)])]),!t.loading&&!t.data.length?(c.openBlock(),c.createElementBlock("div",mS," No Data ")):c.createCommentVNode("",!0)],2))}}),yS={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function De(t){this.content=t}De.prototype={constructor:De,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,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new De(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new De(n)},addToStart:function(t,e){return new De([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new De(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new De(i)},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=De.from(t),t.size?new De(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=De.from(t),t.size?new De(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=De.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}},De.from=function(t){if(t instanceof De)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new De(e)};function Gc(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=Gc(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Yc(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){n-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=Yc(s.content,l.content,n-1,r-1);if(d)return d}n-=a,r-=a}}class P{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,i=0,o){for(let s=0,l=0;l<n;s++){let a=this.content[s],d=l+a.nodeSize;if(d>e&&r(a,i+l,o||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,a)=>{let d=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new P(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],a=s+l.nodeSize;a>e&&((s<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=a}return new P(r,i)}cutByIndex(e,n){return e==n?P.empty:e==0&&n==this.content.length?this:new P(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new P(i,o)}addToStart(e){return new P([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new P(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 i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Gc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Yc(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ui(0,e);if(e==this.size)return Ui(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Ui(r+1,s):Ui(r,i);i=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 P.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new P(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return P.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new P(n||e,r)}static from(e){if(!e)return P.empty;if(e instanceof P)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new P([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}P.empty=new P([],0);const Ss={index:0,offset:0};function Ui(t,e){return Ss.index=t,Ss.offset=e,Ss}function Ki(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(!Ki(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ki(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ge=class Ql{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}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&&Ki(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`);return r.create(n.attrs)}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 Ql.none;if(e instanceof Ql)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ge.none=[];class Ji extends Error{}class W{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=Xc(this.content,e+this.openStart,n);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,n){return new W(Zc(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 W.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(P.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new W(e,r,i)}}W.empty=new W(P.empty,0,0);function Zc(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Zc(o.content,e-i-1,n-i-1)))}function Xc(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=Xc(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function bS(t,e,n){if(n.openStart>t.depth)throw new Ji("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Ji("Inconsistent open depths");return Qc(t,e,n,0)}function Qc(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=Qc(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return En(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=kS(n,t);return En(o,td(t,s,l,e,r))}else return En(o,Gi(t,e,r))}function ed(t,e){if(!e.type.compatibleContent(t.type))throw new Ji("Cannot join "+e.type.name+" onto "+t.type.name)}function Cs(t,e,n){let r=t.node(n);return ed(r,e.node(n)),r}function On(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 Gr(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(On(t.nodeAfter,r),o++));for(let l=o;l<s;l++)On(i.child(l),r);e&&e.depth==n&&e.textOffset&&On(e.nodeBefore,r)}function En(t,e){return t.type.checkContent(e),t.copy(e)}function td(t,e,n,r,i){let o=t.depth>i&&Cs(t,e,i+1),s=r.depth>i&&Cs(n,r,i+1),l=[];return Gr(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(ed(o,s),On(En(o,td(t,e,n,r,i+1)),l)):(o&&On(En(o,Gi(t,e,i+1)),l),Gr(e,n,i,l),s&&On(En(s,Gi(n,r,i+1)),l)),Gr(r,null,i,l),new P(l)}function Gi(t,e,n){let r=[];if(Gr(null,t,n,r),t.depth>n){let i=Cs(t,e,n+1);On(En(i,Gi(t,e,n+1)),r)}return Gr(e,null,n,r),new P(r)}function kS(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(P.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Yr{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],i=e.child(n);return r?e.child(n).cut(r):i}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],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ge.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].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 Yi(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=[],i=0,o=n;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),d=o-a;if(r.push(s,l,i+a),!d||(s=s.child(l),s.isText))break;o=d-1,i+=a+1}return new Yr(n,r,o)}static resolveCached(e,n){for(let i=0;i<Os.length;i++){let o=Os[i];if(o.pos==n&&o.doc==e)return o}let r=Os[Es]=Yr.resolve(e,n);return Es=(Es+1)%vS,r}}let Os=[],Es=0,vS=12;class Yi{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 xS=Object.create(null);let Mn=class ea{constructor(e,n,r,i=ge.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||P.empty}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,i=0){this.content.nodesBetween(e,n,r,i,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,i){return this.content.textBetween(e,n,r,i)}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&&Ki(this.attrs,n||e.defaultAttrs||xS)&&ge.sameSet(this.marks,r||ge.none)}copy(e=null){return e==this.content?this:new ea(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ea(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 W.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new W(d,i.depth-s,o.depth-s)}replace(e,n,r){return bS(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+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 i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Yr.resolveCached(this,e)}resolveNoCache(e){return Yr.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),nd(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=P.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;a<o;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.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);let e=ge.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!ge.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=null;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 i=P.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};Mn.prototype.text=void 0;class Zi extends Mn{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nd(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 Zi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zi(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 nd(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Tn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new wS(e,n);if(r.next==null)return Tn.empty;let i=rd(r);r.next&&r.err("Unexpected trailing text");let o=$S(TS(i));return NS(o,r),o}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 i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}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 i=[this];function o(s,l){let a=s.matchFragment(e,r);if(a&&(!n||a.validEnd))return P.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}return null}return o(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 i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:a}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),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 i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
6
+ `)}}Tn.empty=new Tn(!0);class wS{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 rd(t){let e=[];do e.push(SS(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function SS(t){let e=[];do e.push(CS(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function CS(t){let e=MS(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=OS(t,e);else break;return e}function id(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function OS(t,e){let n=id(t),r=n;return t.eat(",")&&(t.next!="}"?r=id(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function ES(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function MS(t){if(t.eat("(")){let e=rd(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=ES(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 TS(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let d={term:a,to:l};return e[s].push(d),d}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,d)=>a.concat(o(d,l)),[]);if(s.type=="seq")for(let a=0;;a++){let d=o(s.exprs[a],l);if(a==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let a=n();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let d=0;d<s.min;d++){let u=n();i(o(s.expr,a),u),a=u}if(s.max==-1)i(o(s.expr,a),a);else for(let d=s.min;d<s.max;d++){let u=n();r(a,u),i(o(s.expr,a),u),a=u}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function od(t,e){return e-t}function sd(t,e){let n=[];return r(e),n.sort(od);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:a}=o[s];!l&&n.indexOf(a)==-1&&r(a)}}}function $S(t){let e=Object.create(null);return n(sd(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let d;for(let u=0;u<i.length;u++)i[u][0]==l&&(d=i[u][1]);sd(t,a).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new Tn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(od);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function NS(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:a,next:d}=i.next[l];s.push(a.name),o&&!(a.isText||a.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ld(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 ad(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function cd(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new BS(t[n]);return e}let dd=class Fh{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=cd(r.attrs),this.defaultAttrs=ld(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==Tn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:ad(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mn(this,this.computeAttrs(e),P.from(n),ge.setFrom(r))}createChecked(e=null,n,r){return n=P.from(n),this.checkContent(n),new Mn(this,this.computeAttrs(e),n,ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=P.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(P.empty,!0);return o?new Mn(this,e,n.append(o),ge.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)}`)}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:ge.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Fh(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class BS{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Xi{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=cd(i.attrs),this.excluded=null;let o=ld(this.attrs);this.instance=o?new ge(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ge(this,ad(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Xi(o,i++,n,s)),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]}excludes(e){return this.excluded.indexOf(e)>-1}}class AS{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=De.from(e.nodes),n.marks=De.from(e.marks||{}),this.nodes=dd.compile(this.spec.nodes,this),this.marks=Xi.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Tn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?ud(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ud(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof dd){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,i)}text(e,n){let r=this.nodes.text;return new Zi(r,r.defaultAttrs,e,ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Mn.fromJSON(this,e)}markFromJSON(e){return ge.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function ud(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let l in t.marks){let a=t.marks[l];(i=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function DS(t){return t.tag!=null}function VS(t){return t.style!=null}class rr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{DS(r)?this.tags.push(r):VS(r)&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new md(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new md(this,n,!0);return r.addAll(e,n.from,n.to),W.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(PS(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=gd(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=gd(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new rr(e,rr.schemaRules(e)))}}const fd={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},_S={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hd={ol:!0,ul:!0},Qi=1,eo=2,to=4;function pd(t,e,n){return e!=null?(e?Qi:0)|(e==="full"?eo:0):t&&t.whitespace=="pre"?Qi|eo:n&-5}class no{constructor(e,n,r,i,o,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=ge.none,this.stashMarks=[],this.match=s||(l&to?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(P.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qi)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=P.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(P.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):RS(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!fd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class md{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=pd(null,n.preserveWhitespace,0)|(r?to:0);i?o=new no(i.type,i.attrs,ge.none,ge.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new no(null,null,ge.none,ge.none,!0,null,s):o=new no(e.schema.topNodeType,null,ge.none,ge.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.style;if(!r||!r.length)return n();let i=this.readStyles(e.style);if(!i)return;let[o,s]=i,l=this.top;for(let a=0;a<s.length;a++)this.removePendingMark(s[a],l);for(let a=0;a<o.length;a++)this.addPendingMark(o[a]);n();for(let a=0;a<o.length;a++)this.removePendingMark(o[a],l);for(let a=0;a<s.length;a++)this.addPendingMark(s[a])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&eo||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Qi)r.options&eo?n=n.replace(/\r\n?/g,`
7
+ `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),i;hd.hasOwnProperty(r)&&this.parser.normalizeLists&&IS(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));if(o?o.ignore:_S.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,l=this.top,a=this.needsBlock;if(fd.hasOwnProperty(r))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),s=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
8
+ `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=ge.none,r=ge.none;for(let i=0,o=e.length;i<o;i++){let s=e.item(i);for(let l=void 0;;){let a=this.parser.matchStyle(s,e.getPropertyValue(s),this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(d=>{a.clearMark(d)&&(r=d.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)l=a;else break}}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));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)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let i=0;i<e.marks.length;i++)(!n.type||n.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let i=this.findPlace(e.create(n));return i&&this.enterInner(e,n,!0,r),i}enterInner(e,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=pd(e,i,o.options);o.options&to&&o.content.length==0&&(s|=to),this.nodes.push(new no(e,n,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}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;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 i=r.length-1;i>=0;i--)e+=r[i].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 i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].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,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=d&&u.groups.indexOf(d)==-1)return!1;a--}}return!0};return s(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}}addPendingMark(e){let n=LS(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function IS(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&hd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function PS(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function gd(t){let e={};for(let n in t)e[n]=t[n];return e}function RS(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let a=0;a<l.edgeCount;a++){let{type:d,next:u}=l.edge(a);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}function LS(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class Ot{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ms(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,a=0;for(;l<o.length&&a<s.marks.length;){let d=s.marks[a];if(!this.marks[d.type.name]){a++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,a++}for(;l<o.length;)i=o.pop()[1];for(;a<s.marks.length;){let d=s.marks[a++],u=this.serializeMark(d,s.isInline,n);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Ot.renderSpec(Ms(n),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Ot.renderSpec(Ms(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),a=n[1],d=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){d=2;for(let u in a)if(a[u]!=null){let f=u.indexOf(" ");f>0?l.setAttributeNS(u.slice(0,f),u.slice(f+1),a[u]):l.setAttribute(u,a[u])}}for(let u=d;u<n.length;u++){let f=n[u];if(f===0){if(u<n.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=Ot.renderSpec(e,f,r);if(l.appendChild(h),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ot(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=yd(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return yd(e.marks)}}function yd(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ms(t){return t.document||window.document}const bd=65535,kd=Math.pow(2,16);function zS(t,e){return t+e*kd}function vd(t){return t&bd}function FS(t){return(t-(t&bd))/kd}const xd=1,wd=2,ro=4,Sd=8;class Ts{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Sd)>0}get deletedBefore(){return(this.delInfo&(xd|ro))>0}get deletedAfter(){return(this.delInfo&(wd|ro))>0}get deletedAcross(){return(this.delInfo&ro)>0}}class Qe{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Qe.empty)return Qe.empty}recover(e){let n=0,r=vd(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+FS(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 i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let d=this.ranges[l+o],u=this.ranges[l+s],f=a+d;if(e<=f){let h=d?e==a?-1:e==f?1:n:n,p=a+i+(h<0?0:u);if(r)return p;let m=e==(n<0?a:f)?null:zS(l/3,e-a),y=e==a?wd:e==f?xd:ro;return(n<0?e!=a:e!=f)&&(y|=Sd),new Ts(p,y,m)}i+=u-d}return r?e+i:new Ts(e+i,0,null)}touches(e,n){let r=0,i=vd(n),o=this.inverted?2:1,s=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 d=this.ranges[l+o],u=a+d;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),a=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(l,l+d,a,a+u),o+=u-d}}invert(){return new Qe(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Qe.empty:new Qe(e<0?[0,-e,0]:[0,0,e])}}Qe.empty=new Qe([]);class ir{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new ir(this.maps,this.mirror,e,n)}copy(){return new ir(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){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 i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i: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 i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new ir;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 i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],l=s.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Ts(e,i,null)}}const $s=Object.create(null);class Ie{getMap(){return Qe.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=$s[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 $s)throw new RangeError("Duplicate use of step JSON ID "+e);return $s[e]=n,n.prototype.jsonID=e,n}}class Se{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Se(e,null)}static fail(e){return new Se(null,e)}static fromReplace(e,n,r,i){try{return Se.ok(e.replace(n,r,i))}catch(o){if(o instanceof Ji)return Se.fail(o.message);throw o}}}function Ns(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Ns(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return P.fromArray(r)}class en extends Ie{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),i=r.node(r.sharedDepth(this.to)),o=new W(Ns(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,o)}invert(){return new Et(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 en(n.pos,r.pos,this.mark)}merge(e){return e instanceof en&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new en(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 en(n.from,n.to,e.markFromJSON(n.mark))}}Ie.jsonID("addMark",en);class Et extends Ie{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 W(Ns(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,r)}invert(){return new en(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 Et(n.pos,r.pos,this.mark)}merge(e){return e instanceof Et&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Et(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 Et(n.from,n.to,e.markFromJSON(n.mark))}}Ie.jsonID("removeMark",Et);class tn extends Ie{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new W(P.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 i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new tn(this.pos,n.marks[i]);return new tn(this.pos,this.mark)}}return new or(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new tn(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 tn(n.pos,e.markFromJSON(n.mark))}}Ie.jsonID("addNodeMark",tn);class or extends Ie{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new W(P.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new tn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new or(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 or(n.pos,e.markFromJSON(n.mark))}}Ie.jsonID("removeNodeMark",or);class Te extends Ie{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Bs(e,this.from,this.to)?Se.fail("Structure replace would overwrite content"):Se.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Qe([this.from,this.to-this.from,this.slice.size])}invert(e){return new Te(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 Te(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Te)||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?W.empty:new W(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Te(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?W.empty:new W(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Te(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 Te(n.from,n.to,W.fromJSON(e,n.slice),!!n.structure)}}Ie.jsonID("replace",Te);class $e extends Ie{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Bs(e,this.from,this.gapFrom)||Bs(e,this.gapTo,this.to)))return Se.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Se.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Se.fromReplace(e,this.from,this.to,r):Se.fail("Content does not fit in gap")}getMap(){return new Qe([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 $e(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),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new $e(n.pos,r.pos,i,o,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 $e(n.from,n.to,n.gapFrom,n.gapTo,W.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ie.jsonID("replaceAround",$e);function Bs(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function jS(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(a,d,u)=>{if(!a.isInline)return;let f=a.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+a.nodeSize,n),m=r.addToSet(f);for(let y=0;y<f.length;y++)f[y].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[y])?s.to=p:i.push(s=new Et(h,p,f[y])));l&&l.to==h?l.to=p:o.push(l=new en(h,p,r))}}),i.forEach(a=>t.step(a)),o.forEach(a=>t.step(a))}function HS(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof Xi){let d=s.marks,u;for(;u=r.isInSet(d);)(a||(a=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let d=Math.min(l+s.nodeSize,n);for(let u=0;u<a.length;u++){let f=a[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(l,e),to:d,step:o})}}}),i.forEach(s=>t.step(new Et(s.from,s.to,s.style)))}function Cd(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a<o.childCount;a++){let d=o.child(a),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Te(l,u,W.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Et(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new W(P.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Te(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let a=r.fillBefore(P.empty,!0);t.replace(l,l,new W(a,0,0))}for(let a=s.length-1;a>=0;a--)t.step(s[a])}function WS(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function sr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!WS(i,o,s))break}return null}function qS(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),a=s,d=l,u=P.empty,f=0;for(let m=o,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,u=P.from(r.node(m).copy(u)),f++):a--;let h=P.empty,p=0;for(let m=o,y=!1;m>n;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=P.from(i.node(m).copy(h)),p++):d++;t.step(new $e(a,d,s,l,new W(u.append(h),f,p),u.size-f,!0))}function As(t,e,n=null,r=t){let i=US(t,e),o=i&&KS(r,e);return o?i.map(Od).concat({type:e,attrs:n}).concat(o.map(Od)):null}function Od(t){return{type:t,attrs:null}}function US(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function KS(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;a&&d<i;d++)a=a.matchType(n.child(d).type);return!a||!a.validEnd?null:s}function JS(t,e,n){let r=P.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].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=P.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new $e(i,o,i,o,new W(r,0,0),n.length,!0))}function GS(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&XS(t.doc,t.mapping.slice(o).map(l),r)){let a=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?a=!1:!h&&p&&(a=!0)}a===!1&&ZS(t,s,l,o),Cd(t,t.mapping.slice(o).map(l,1),r,void 0,a===null);let d=t.mapping.slice(o),u=d.map(l,1),f=d.map(l+s.nodeSize,1);return t.step(new $e(u,f,u+1,f-1,new W(P.from(r.create(i,null,s.marks)),0,0),1,!0)),a===!0&&YS(t,s,l,o),!1}})}function YS(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let a=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function ZS(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
9
+ `))}})}function XS(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function QS(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new $e(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new W(P.from(s),0,0),1,!0))}function zt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let y=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!y.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function eC(t,e,n=1,r){let i=t.doc.resolve(e),o=P.empty,s=P.empty;for(let l=i.depth,a=i.depth-n,d=n-1;l>a;l--,d--){o=P.from(i.node(l).copy(o));let u=r&&r[d];s=P.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}t.step(new Te(e,e,new W(o.append(s),n,n),!0))}function nn(t,e){let n=t.resolve(e),r=n.index();return Ed(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Ed(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function io(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Ed(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function tC(t,e,n){let r=new Te(e-n,e+n,W.empty,!0);t.step(r)}function nC(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 i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Md(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),d=r.node(s),u=!1;if(o==1)u=d.canReplace(a,a,i);else{let f=d.contentMatchAt(a).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(a,a,f[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function oo(t,e,n=e,r=W.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Td(i,o,r)?new Te(e,n,r):new rC(i,o,r).fit()}function Td(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class rC{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=P.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=P.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new W(o,s,l);return e>-1?new $e(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new Te(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Ds(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:d}=this.frontier[l],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(P.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Ds(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new W(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Ds(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new W(Zr(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new W(Zr(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let y=0;y<o.length;y++)this.openFrontierNode(o[y]);let s=this.unplaced,l=r?r.content:s.content,a=s.openStart-e,d=0,u=[],{match:f,type:h}=this.frontier[n];if(i){for(let y=0;y<i.childCount;y++)u.push(i.child(y));f=f.matchFragment(i)}let p=l.size+e-(s.content.size-s.openEnd);for(;d<l.childCount;){let y=l.child(d),g=f.matchType(y.type);if(!g)break;d++,(d>1||a==0||y.content.size)&&(f=g,u.push($d(y.mark(h.allowedMarks(y.marks)),d==1?a:0,d==l.childCount?p:-1)))}let m=d==l.childCount;m||(p=-1),this.placed=Xr(this.placed,n,P.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,g=l;y<p;y++){let v=g.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),g=v.content}this.unplaced=m?e==0?W.empty:new W(Zr(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new W(Zr(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Vs(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,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Vs(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:a,type:d}=this.frontier[l],u=Vs(e,l,d,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?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=Xr(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Xr(this.placed,this.depth,P.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(P.empty,!0);n.childCount&&(this.placed=Xr(this.placed,this.frontier.length,n))}}function Zr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Zr(t.firstChild.content,e-1,n)))}function Xr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Xr(t.lastChild.content,e-1,n)))}function Ds(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function $d(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,$d(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(P.empty,!0)))),t.copy(r)}function Vs(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!iC(n,o.content,s)?l:null}function iC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function oC(t){return t.spec.defining||t.spec.definingForContent}function sC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Td(i,o,r))return t.step(new Te(e,n,r));let s=Bd(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?l=h:i.before(h)==p&&s.splice(1,0,-h)}let a=s.indexOf(l),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=oC(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let y=0;y<s.length;y++){let g=s[(y+a)%s.length],v=!0;g<0&&(v=!1,g=-g);let x=i.node(g-1),T=i.index(g-1);if(x.canReplaceWith(T,T,m.type,m.marks))return t.replace(i.before(g),v?o.after(g):n,new W(Nd(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function Nd(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Nd(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(P.empty,!0))}return t}function lC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=nC(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new W(P.from(r),0,0))}function aC(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Bd(r,i);for(let s=0;s<o.length;s++){let l=o[s],a=s==o.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function Bd(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class lr extends Ie{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 Se.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Se.fromReplace(e,this.pos,this.pos+1,new W(P.from(i),0,n.isLeaf?0:1))}getMap(){return Qe.empty}invert(e){return new lr(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 lr(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 lr(n.pos,n.attr,n.value)}}Ie.jsonID("attr",lr);class Qr extends Ie{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Se.ok(r)}getMap(){return Qe.empty}invert(e){return new Qr(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 Qr(n.attr,n.value)}}Ie.jsonID("docAttr",Qr);let ar=class extends Error{};ar=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},ar.prototype=Object.create(Error.prototype),ar.prototype.constructor=ar,ar.prototype.name="TransformError";class cC{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ir}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ar(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=W.empty){let i=oo(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new W(P.from(r),0,0))}delete(e,n){return this.replace(e,n,W.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return sC(this,e,n,r),this}replaceRangeWith(e,n,r){return lC(this,e,n,r),this}deleteRange(e,n){return aC(this,e,n),this}lift(e,n){return qS(this,e,n),this}join(e,n=1){return tC(this,e,n),this}wrap(e,n){return JS(this,e,n),this}setBlockType(e,n=e,r,i=null){return GS(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return QS(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new lr(e,n,r)),this}setDocAttribute(e,n){return this.step(new Qr(e,n)),this}addNodeMark(e,n){return this.step(new tn(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new or(e,n)),this}split(e,n=1,r){return eC(this,e,n,r),this}addMark(e,n,r){return jS(this,e,n,r),this}removeMark(e,n,r){return HS(this,e,n,r),this}clearIncompatible(e,n,r){return Cd(this,e,n,r),this}}const _s=Object.create(null);class le{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new dC(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=W.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:d}=s[l],u=e.mapping.slice(o);e.replaceRange(u.map(a.pos),u.map(d.pos),l?W.empty:n),l==0&&Vd(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:l}=i[o],a=e.mapping.slice(r),d=a.map(s.pos),u=a.map(l.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Vd(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ne(e):cr(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?cr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):cr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new ot(e.node(0))}static atStart(e){return cr(e,e,0,0,1)||new ot(e)}static atEnd(e){return cr(e,e,e.content.size,e.childCount,-1)||new ot(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=_s[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 _s)throw new RangeError("Duplicate use of selection JSON ID "+e);return _s[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ne.between(this.$anchor,this.$head).getBookmark()}}le.prototype.visible=!0;class dC{constructor(e,n){this.$from=e,this.$to=n}}let Ad=!1;function Dd(t){!Ad&&!t.parent.inlineContent&&(Ad=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ne extends le{constructor(e,n=e){Dd(e),Dd(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 le.near(r);let i=e.resolve(n.map(this.anchor));return new ne(i.parent.inlineContent?i:r,r)}replace(e,n=W.empty){if(super.replace(e,n),n==W.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ne&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new so(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 ne(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=le.findFrom(n,r,!0)||le.findFrom(n,-r,!0);if(o)n=o.$head;else return le.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(le.findFrom(e,-r,!0)||le.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ne(e,n)}}le.jsonID("text",ne);class so{constructor(e,n){this.anchor=e,this.head=n}map(e){return new so(e.map(this.anchor),e.map(this.head))}resolve(e){return ne.between(e.resolve(this.anchor),e.resolve(this.head))}}class Y extends le{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:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?le.near(o):new Y(o)}content(){return new W(P.from(this.node),0,0)}eq(e){return e instanceof Y&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Is(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Y(e.resolve(n.anchor))}static create(e,n){return new Y(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Y.prototype.visible=!1,le.jsonID("node",Y);class Is{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new so(r,r):new Is(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Y.isSelectable(r)?new Y(n):le.near(n)}}class ot extends le{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=W.empty){if(n==W.empty){e.delete(0,e.doc.content.size);let r=le.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new ot(e)}map(e){return new ot(e)}eq(e){return e instanceof ot}getBookmark(){return uC}}le.jsonID("all",ot);const uC={map(){return this},resolve(t){return new ot(t)}};function cr(t,e,n,r,i,o=!1){if(e.inlineContent)return ne.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&Y.isSelectable(l))return Y.create(t,n-(i<0?l.nodeSize:0))}else{let a=cr(t,l,n+i,i<0?l.childCount:0,i,o);if(a)return a}n+=l.nodeSize*i}return null}function Vd(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Te||i instanceof $e))return;let o=t.mapping.maps[r],s;o.forEach((l,a,d,u)=>{s==null&&(s=u)}),t.setSelection(le.near(t.doc.resolve(s),n))}const _d=1,Id=2,Pd=4;class fC extends cC{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|_d)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&_d)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Id,this}ensureMarks(e){return ge.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&Id)>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)||ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(le.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|=Pd,this}get scrolledIntoView(){return(this.updated&Pd)>0}}function Rd(t,e){return!e||!t?t:t.bind(e)}class ei{constructor(e,n,r){this.name=e,this.init=Rd(n.init,r),this.apply=Rd(n.apply,r)}}const hC=[new ei("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ei("selection",{init(t,e){return t.selection||le.atStart(e.doc)},apply(t){return t.selection}}),new ei("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new ei("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Ps{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=hC.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 ei(r.key,r.spec.state,r))})}}class dr{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 i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let a=i?i[s].n:0,d=i?i[s].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new dr(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new fC(this)}static create(e){let n=new Ps(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new dr(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Ps(this.schema,e.plugins),r=n.fields,i=new dr(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}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 i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.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 i=new Ps(e.schema,e.plugins),o=new dr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Mn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=le.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],d=a.spec.state;if(a.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(a,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function Ld(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Ld(i,e,{})),n[r]=i}return n}class ze{constructor(e){this.spec=e,this.props={},e.props&&Ld(e.props,this,this.props),this.key=e.key?e.key.key:zd("plugin")}getState(e){return e[this.key]}}const Rs=Object.create(null);function zd(t){return t in Rs?t+"$"+ ++Rs[t]:(Rs[t]=0,t+"$")}class yt{constructor(e="key"){this.key=zd(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ve=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ti=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Ls=null;const Ft=function(t,e,n){let r=Ls||(Ls=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},pC=function(){Ls=null},$n=function(t,e,n,r){return n&&(Fd(t,e,n,r,-1)||Fd(t,e,n,r,1))},mC=/^(img|br|input|textarea|hr)$/i;function Fd(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Mt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ni(t)||mC.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ve(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Mt(t):0}else return!1}}function Mt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function gC(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=Mt(t)}else if(t.parentNode&&!ni(t))e=Ve(t),t=t.parentNode;else return null}}function yC(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&&!ni(t))e=Ve(t)+1,t=t.parentNode;else return null}}function bC(t,e,n){for(let r=e==0,i=e==Mt(t);r||i;){if(t==n)return!0;let o=Ve(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Mt(t)}}function ni(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 lo=function(t){return t.focusNode&&$n(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Nn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function kC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function vC(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Tt=typeof navigator<"u"?navigator:null,jd=typeof document<"u"?document:null,rn=Tt&&Tt.userAgent||"",zs=/Edge\/(\d+)/.exec(rn),Hd=/MSIE \d/.exec(rn),Fs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rn),Ge=!!(Hd||Fs||zs),on=Hd?document.documentMode:Fs?+Fs[1]:zs?+zs[1]:0,bt=!Ge&&/gecko\/(\d+)/i.test(rn);bt&&+(/Firefox\/(\d+)/.exec(rn)||[0,0])[1];const js=!Ge&&/Chrome\/(\d+)/.exec(rn),Fe=!!js,xC=js?+js[1]:0,je=!Ge&&!!Tt&&/Apple Computer/.test(Tt.vendor),ur=je&&(/Mobile\/\w+/.test(rn)||!!Tt&&Tt.maxTouchPoints>2),st=ur||(Tt?/Mac/.test(Tt.platform):!1),wC=Tt?/Win/.test(Tt.platform):!1,kt=/Android \d/.test(rn),ri=!!jd&&"webkitFontSmoothing"in jd.documentElement.style,SC=ri?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function CC(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 jt(t,e){return typeof t=="number"?t:t[e]}function OC(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 Wd(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=ti(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,d=a?CC(o):OC(l),u=0,f=0;if(e.top<d.top+jt(r,"top")?f=-(d.top-e.top+jt(i,"top")):e.bottom>d.bottom-jt(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+jt(i,"top")-d.top:e.bottom-d.bottom+jt(i,"bottom")),e.left<d.left+jt(r,"left")?u=-(d.left-e.left+jt(i,"left")):e.right>d.right-jt(r,"right")&&(u=e.right-d.right+jt(i,"right")),u||f)if(a)o.defaultView.scrollBy(u,f);else{let h=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),u&&(l.scrollLeft+=u);let m=l.scrollLeft-h,y=l.scrollTop-p;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function EC(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(o,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:qd(t.dom)}}function qd(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ti(r));return e}function MC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Ud(n,r==0?0:r-e)}function Ud(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let fr=null;function TC(t){if(t.setActive)return t.setActive();if(fr)return t.focus(fr);let e=qd(t);t.focus(fr==null?{get preventScroll(){return fr={preventScroll:!0},!0}}:void 0),fr||(fr=!1,Ud(e,0))}function Kd(t,e){let n,r=2e8,i,o=0,s=e.top,l=e.top,a,d;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=Ft(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=l){s=Math.max(m.bottom,s),l=Math.min(m.top,l);let y=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(y<r){n=u,r=y,i=y&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&y&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!a&&m.left<=e.left&&m.right>=e.left&&(a=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!n&&a&&(n=a,i=d,r=0),n&&n.nodeType==3?$C(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:Kd(n,i)}function $C(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=sn(r,1);if(o.top!=o.bottom&&Hs(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Hs(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function NC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function BC(t,e,n){let{node:r,offset:i}=Kd(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function AC(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?i=l.posBefore:(!s&&a.right<r.left||a.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<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}o=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Jd(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let l=s.getClientRects();for(let a=0;a<l.length;a++){let d=l[a];if(Hs(e,d))return Jd(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function DC(t,e){let n=t.dom.ownerDocument,r,i=0,o=vC(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!Hs(e,d)||(s=Jd(t.dom,e,d),!s))return null}if(je)for(let d=s;r&&d;d=ti(d))d.draggable&&(r=void 0);if(s=NC(s,e),r){if(bt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;ri&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=AC(t,r,i,e))}l==null&&(l=BC(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Gd(t){return t.top<t.bottom||t.left<t.right}function sn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Gd(r))return r}return Array.prototype.find.call(n,Gd)||t.getBoundingClientRect()}const VC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Yd(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=ri||bt;if(r.nodeType==3)if(s&&(VC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=sn(Ft(r,i,i),n);if(bt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=sn(Ft(r,i-1,i-1),-1);if(d.top==a.top){let u=sn(Ft(r,i,i+1),-1);if(u.top!=a.top)return ii(u,u.left<d.left)}}return a}else{let a=i,d=i,u=n<0?1:-1;return n<0&&!i?(d++,u=-1):n>=0&&i==r.nodeValue.length?(a--,u=1):n<0?a--:d++,ii(sn(Ft(r,a,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Mt(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Ws(a.getBoundingClientRect(),!1)}if(o==null&&i<Mt(r)){let a=r.childNodes[i];if(a.nodeType==1)return Ws(a.getBoundingClientRect(),!0)}return Ws(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Mt(r))){let a=r.childNodes[i-1],d=a.nodeType==3?Ft(a,Mt(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(d)return ii(sn(d,1),!1)}if(o==null&&i<Mt(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let d=a?a.nodeType==3?Ft(a,0,s?0:1):a.nodeType==1?a:null:null;if(d)return ii(sn(d,-1),!0)}return ii(sn(r.nodeType==3?Ft(r):r,-n),n>=0)}function ii(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 Ws(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 Zd(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function _C(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Zd(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Yd(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Ft(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<a.length;d++){let u=a[d];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const IC=/[\u0590-\u08ac]/;function PC(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return!IC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:Zd(t,e,()=>{let{focusNode:a,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:y}=t.domSelectionRange(),g=m&&!p.contains(m.nodeType==1?m:m.parentNode)||a==m&&d==y;try{l.collapse(u,f),a&&(a!=u||d!=f)&&l.extend&&l.extend(a,d)}catch{}return h!=null&&(l.caretBidiLevel=h),g})}let Xd=null,Qd=null,eu=!1;function RC(t,e,n){return Xd==e&&Qd==n?eu:(Xd=e,Qd=n,eu=n=="up"||n=="down"?_C(t,e,n):PC(t,e,n))}const lt=0,tu=1,Bn=2,$t=3;class oi{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=lt,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 i=this.children[n];if(i==e)return r;r+=i.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 o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Ve(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}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 i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],l=o+s.size;if(l>e||s instanceof iu){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof nu&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Ve(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Ve(o.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 i=-1,o=-1;for(let s=r,l=0;;l++){let a=this.children[l],d=s+a.size;if(i==-1&&e<=d){let u=s+a.border;if(e>=u&&n<=d-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=s;for(let f=l;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=Ve(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let u=l+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Ve(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}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,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let h=0,p=0;h<this.children.length;h++){let m=this.children[h],y=p+m.size;if(o>p&&s<y)return m.setSelection(e-p-m.border,n-p-m.border,r,i);p=y}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),d=r.getSelection(),u=!1;if((bt||je)&&e==n){let{node:h,offset:p}=l;if(h.nodeType==3){if(u=!!(p&&h.nodeValue[p-1]==`
10
+ `),u&&p==h.nodeValue.length)for(let m=h,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(l=a={node:y.parentNode,offset:Ve(y)+1});break}let g=m.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let m=h.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(bt&&d.focusNode&&d.focusNode!=a.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||u&&je)&&$n(l.node,l.offset,d.anchorNode,d.anchorOffset)&&$n(a.node,a.offset,d.focusNode,d.focusOffset))return;let f=!1;if((d.extend||e==n)&&!u){d.collapse(l.node,l.offset);try{e!=n&&d.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(h)}}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,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+o.border,a=s-o.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?Bn:tu,e==l&&n==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=$t:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Bn:$t}r=s}this.dirty=Bn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Bn:tu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class nu extends oi{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==lt&&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 side(){return this.widget.type.side}}class LC extends oi{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}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 An extends oi{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ot.renderSpec(document,n.type.spec.toDOM(n,r))),new An(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&$t||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=$t&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=lt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=lt}}slice(e,n,r){let i=An.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Ks(o,n,s,r)),e>0&&(o=Ks(o,0,e,r));for(let l=0;l<o.length;l++)o[l].parent=i;return i.children=o,i}}class ln extends oi{constructor(e,n,r,i,o,s,l,a,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(e,n,r,i,o,s){let l=o.nodeViews[n.type.name],a,d=l&&l(n,o,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=d&&d.dom,f=d&&d.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:f}=Ot.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=lu(u,r,n),d?a=new zC(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new ao(e,n,r,i,u,h,o):new ln(e,n,r,i,u,f||null,h,o,s+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=()=>P.empty)}return e}matchesNode(e,n,r){return this.dirty==lt&&e.eq(this.node)&&Us(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,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new jC(this,s&&s.node,e);qC(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?a.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&a.syncToMarks(u==this.node.childCount?ge.none:this.node.child(u).marks,r,e),a.placeWidget(d,e,i)},(d,u,f,h)=>{a.syncToMarks(d.marks,r,e);let p;a.findNodeMatch(d,u,f,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(p=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(d,u,f,p,e)||a.updateNextNode(d,u,f,e,h,i)||a.addNode(d,u,f,e,i),i+=d.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Bn)&&(s&&this.protectLocalComposition(e,s),ou(this.contentDOM,this.children,e),ur&&UC(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ne)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=KC(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new LC(this,o,n,i);e.input.compositionNodes.push(s),this.children=Ks(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==$t||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=lt}updateOuterDeco(e){if(Us(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=su(this.dom,this.nodeDOM,qs(this.outerDeco,this.node,n),qs(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.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ru(t,e,n,r,i){lu(r,e,t);let o=new ln(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ao extends ln{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,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,i){return this.dirty==$t||this.dirty!=lt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=lt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=lt,!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 i=this.node.cut(e,n),o=document.createTextNode(i.text);return new ao(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=$t)}get domAtom(){return!1}isText(e){return this.node.text==e}}class iu extends oi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==lt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class zC extends ln{constructor(e,n,r,i,o,s,l,a,d,u){super(e,n,r,i,o,s,l,d,u),this.spec=a}update(e,n,r,i){if(this.dirty==$t)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}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 ou(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=au(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof An){let a=r?r.previousSibling:t.lastChild;ou(s.contentDOM,s.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=au(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const si=function(t){t&&(this.nodeName=t)};si.prototype=Object.create(null);const Dn=[new si];function qs(t,e,n){if(t.length==0)return Dn;let r=n?Dn[0]:new si,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new si(s.nodeName));for(let l in s){let a=s[l];a!=null&&(n&&i.length==1&&i.push(r=new si(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 i}function su(t,e,n,r){if(n==Dn&&r==Dn)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let a;l&&l.nodeName==s.nodeName&&i!=t&&(a=i.parentNode)&&a.nodeName.toLowerCase()==s.nodeName||(a=document.createElement(s.nodeName),a.pmIsDeco=!0,a.appendChild(i),l=Dn[0]),i=a}FC(i,l||Dn[0],s)}return i}function FC(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):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function lu(t,e,n){return su(t,t,Dn,qs(e,n,t.nodeType!=1))}function Us(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 au(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class jC{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=HC(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 i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=lt,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<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 d=this.top.children[a];if(d.matchesMark(e[o])&&!this.isLocked(d.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=An.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=l;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==$t&&s.dom==s.contentDOM&&(s.dirty=Bn),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),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 i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof ln){let d=this.preMatch.matched.get(a);if(d!=null&&d!=o)return!1;let u=a.dom,f,h=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=$t&&Us(n,a.outerDeco));if(!h&&a.update(e,n,r,i))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(a,e,n,r,i,s)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Bn,f.updateChildren(i,s+1),f.dirty=lt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let l=ln.create(this.top,n,r,i,o,s);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,i,o){let s=ln.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new nu(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof An;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ao)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((je||Fe)&&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 i=new iu(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function HC(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof An)n=d,r=d.children.length;else{l=d,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(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function WC(t,e){return t.type.side-e.type.side}function qC(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let s=0,l=[],a=null;for(let d=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let g=i[s++];g.widget&&(u?(f||(f=[u])).push(g):u=g)}if(u)if(f){f.sort(WC);for(let g=0;g<f.length;g++)n(f[g],d,!!a)}else n(u,d,!!a);let h,p;if(a)p=-1,h=a,a=null;else if(d<t.childCount)p=d,h=t.child(d++);else break;for(let g=0;g<l.length;g++)l[g].to<=o&&l.splice(g--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let g=m;s<i.length&&i[s].from<g&&(g=i[s].from);for(let v=0;v<l.length;v++)l[v].to<g&&(g=l[v].to);g<m&&(a=h.cut(g-o),h=h.cut(0,g-o),m=g,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let y=h.isInline&&!h.isLeaf?l.filter(g=>!g.inline):l.slice();r(h,y,e.forChild(o,h),p),o=m}}function UC(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 KC(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;a+=d.text}if(o>=n){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?a.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Ks(t,e,n,r,i){let o=[];for(let s=0,l=0;s<t.length;s++){let a=t[s],d=l,u=l+=a.size;d>=n||u<=e?o.push(a):(d<e&&o.push(a.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>n&&o.push(a.slice(n-d,a.size,r)))}return o}function Js(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,d;if(lo(n)){for(a=l;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&Y.isSelectable(u)&&i.parent&&!(u.isInline&&bC(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;d=new Y(s==f?l:r.resolve(f))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;a=r.resolve(u)}if(!d){let u=e=="pointer"||t.state.selection.head<l.pos&&!o?1:-1;d=Ys(t,a,l,u)}return d}function cu(t){return t.editable?t.hasFocus():gu(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ht(t,e=!1){let n=t.state.selection;if(hu(t,n),!!cu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Fe){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&$n(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)GC(t);else{let{anchor:r,head:i}=n,o,s;du&&!(n instanceof ne)&&(n.$from.parent.inlineContent||(o=uu(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=uu(t,n.to))),t.docView.setSelection(r,i,t.root,e),du&&(o&&fu(o),s&&fu(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&JC(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const du=je||Fe&&xC<63;function uu(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(je&&i&&i.contentEditable=="false")return Gs(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Gs(i);if(o)return Gs(o)}}function Gs(t){return t.contentEditable="true",je&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function fu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function JC(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!cu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function GC(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Ve(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Ge&&on<=11&&(r.disabled=!0,r.disabled=!1)}function hu(t,e){if(e instanceof Y){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(pu(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else pu(t)}function pu(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ys(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ne.between(e,n,r)}function mu(t){return t.editable&&!t.hasFocus()?!1:gu(t)}function gu(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 YC(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return $n(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Zs(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&le.findFrom(o,e)}function an(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function yu(t,e,n){let r=t.state.selection;if(r instanceof ne)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return an(t,new ne(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Zs(t.state,e);return i&&i instanceof Y?an(t,i):!1}else if(!(st&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?Y.isSelectable(o)?an(t,new Y(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):ri?an(t,new ne(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Y&&r.node.isInline)return an(t,new ne(e>0?r.$to:r.$from));{let i=Zs(t.state,e);return i?an(t,i):!1}}}function co(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function li(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function hr(t,e){return e<0?ZC(t):XC(t)}function ZC(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(bt&&n.nodeType==1&&r<co(n)&&li(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(li(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(bu(n))break;{let l=n.previousSibling;for(;l&&li(l,-1);)i=n.parentNode,o=Ve(l),l=l.previousSibling;if(l)n=l,r=co(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Xs(t,n,r):i&&Xs(t,i,o)}function XC(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=co(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(li(l,1))o=n,s=++r;else break}else{if(bu(n))break;{let l=n.nextSibling;for(;l&&li(l,1);)o=l.parentNode,s=Ve(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=co(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Xs(t,o,s)}function bu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function QC(t,e){for(;t&&e==t.childNodes.length&&!ni(t);)e=Ve(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 eO(t,e){for(;t&&!e&&!ni(t);)e=Ve(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 Xs(t,e,n){if(e.nodeType!=3){let o,s;(s=QC(e,n))?(e=s,n=0):(o=eO(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(lo(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Ht(t)},50)}function ku(t,e){let n=t.state.doc.resolve(e);if(!(Fe||wC)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function vu(t,e,n){let r=t.state.selection;if(r instanceof ne&&!r.empty||n.indexOf("s")>-1||st&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Zs(t.state,e);if(s&&s instanceof Y)return an(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof ot?le.near(s,e):le.findFrom(s,e);return l?an(t,l):!1}return!1}function xu(t,e){if(!(t.state.selection instanceof ne))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function wu(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function tO(t){if(!je||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;wu(t,r,"true"),setTimeout(()=>wu(t,r,"false"),20)}return!1}function nO(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function rO(t,e){let n=e.keyCode,r=nO(e);if(n==8||st&&n==72&&r=="c")return xu(t,-1)||hr(t,-1);if(n==46&&!e.shiftKey||st&&n==68&&r=="c")return xu(t,1)||hr(t,1);if(n==13||n==27)return!0;if(n==37||st&&n==66&&r=="c"){let i=n==37?ku(t,t.state.selection.from)=="ltr"?-1:1:-1;return yu(t,i,r)||hr(t,i)}else if(n==39||st&&n==70&&r=="c"){let i=n==39?ku(t,t.state.selection.from)=="ltr"?1:-1:1;return yu(t,i,r)||hr(t,i)}else{if(n==38||st&&n==80&&r=="c")return vu(t,-1,r)||hr(t,-1);if(n==40||st&&n==78&&r=="c")return tO(t)||vu(t,1,r)||hr(t,1);if(r==(st?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Su(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Ot.fromSchema(t.state.schema),l=Bu(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let d=a.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=$u[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=l.createElement(u[p]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),f++}d=a.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
11
+
12
+ `);return{dom:a,text:h,slice:e}}function Cu(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=e&&(r||o||!n);if(a){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return e?new W(P.from(t.state.schema.text(e.replace(/\r\n?/g,`
13
+ `))),0,0):W.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)l=f;else{let h=i.marks(),{schema:p}=t.state,m=Ot.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let g=s.appendChild(document.createElement("p"));y&&g.appendChild(m.serializeNode(p.text(y,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=sO(n),ri&&lO(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||rr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!iO.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=aO(Tu(l,+u[1],+u[2]),u[4]);else if(l=W.maxOpen(oO(l.content,i),!0),l.openStart||l.openEnd){let f=0,h=0;for(let p=l.content.firstChild;f<l.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=l.content.lastChild;h<l.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);l=Tu(l,f,h)}return t.someProp("transformPasted",f=>{l=f(l,t)}),l}const iO=/^(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 oO(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),d;if(!a)return s=null;if(d=s.length&&o.length&&Eu(a,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Mu(s[s.length-1],o.length));let u=Ou(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return P.from(s)}return t}function Ou(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,P.from(t));return t}function Eu(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Eu(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(P.from(Ou(n,t,i+1))))}}function Mu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Mu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(P.empty,!0);return t.copy(n.append(r))}function Qs(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(o=0),i<r-1&&(l=Qs(l,e,n,r,i+1,o)),i>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(P.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Tu(t,e,n){return e<t.openStart&&(t=new W(Qs(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new W(Qs(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const $u={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 Nu=null;function Bu(){return Nu||(Nu=document.implementation.createHTMLDocument("title"))}function sO(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Bu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&$u[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=t,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function lO(t){let e=t.querySelectorAll(Fe?"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 aO(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:i,openStart:o,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=P.from(a.create(r[l+1],i)),o++,s++}return new W(i,o,s)}const He={},We={},cO={touchstart:!0,touchmove:!0};class dO{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=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 uO(t){for(let e in He){let n=He[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{hO(t,r)&&!tl(t,r)&&(t.editable||!(r.type in We))&&n(t,r)},cO[e]?{passive:!0}:void 0)}je&&t.dom.addEventListener("input",()=>null),el(t)}function cn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function fO(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 el(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>tl(t,r))})}function tl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function hO(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 pO(t,e){!tl(t,e)&&He[e.type]&&(t.editable||!(e.type in We))&&He[e.type](t,e)}We.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Du(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(kt&&Fe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ur&&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",i=>i(t,Nn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||rO(t,n)?n.preventDefault():cn(t,"key")},We.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},We.keypress=(t,e)=>{let n=e;if(Du(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||st&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ne)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function uo(t){return{left:t.clientX,top:t.clientY}}function mO(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function nl(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function pr(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function gO(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(pr(t,new Y(n)),!0):!1}function yO(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof Y&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(Y.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(pr(t,Y.create(t.state.doc,i)),!0):!1}function bO(t,e,n,r,i){return nl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?yO(t,n):gO(t,n))}function kO(t,e,n,r){return nl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function vO(t,e,n,r){return nl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||xO(t,n,r)}function xO(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(pr(t,ne.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)pr(t,ne.create(r,l+1,l+1+s.content.size));else if(Y.isSelectable(s))pr(t,Y.create(r,l));else continue;return!0}}function rl(t){return fo(t)}const Au=st?"metaKey":"ctrlKey";He.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=rl(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&mO(n,t.input.lastClick)&&!n[Au]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(uo(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new wO(t,s,n,!!r)):(o=="doubleClick"?kO:vO)(t,s.pos,s.inside,n)?n.preventDefault():cn(t,"pointer"))};class wO{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Au],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof Y&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&bt&&!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)),cn(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(()=>Ht(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(uo(e))),this.updateAllowDefault(e),this.allowDefault||!n?cn(this.view,"pointer"):bO(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||je&&this.mightDrag&&!this.mightDrag.node.isAtom||Fe&&!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)?(pr(this.view,le.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):cn(this.view,"pointer")}move(e){this.updateAllowDefault(e),cn(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)}}He.touchstart=t=>{t.input.lastTouch=Date.now(),rl(t),cn(t,"pointer")},He.touchmove=t=>{t.input.lastTouch=Date.now(),cn(t,"pointer")},He.contextmenu=t=>rl(t);function Du(t,e){return t.composing?!0:je&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const SO=kt?5e3:-1;We.compositionstart=We.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),fo(t,!0),t.markCursor=null;else if(fo(t),bt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Vu(t,SO)},We.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++,Vu(t,20))};function Vu(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>fo(t),e))}function _u(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=OO());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function CO(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=gC(e.focusNode,e.focusOffset),r=yC(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function OO(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function fo(t,e=!1){if(!(kt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),_u(t),e||t.docView&&t.docView.dirty){let n=Js(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function EO(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(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ai=Ge&&on<15||ur&&SC<604;He.copy=We.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ai?null:n.clipboardData,s=r.content(),{dom:l,text:a}=Su(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):EO(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function MO(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function TO(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 i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ci(t,r.value,null,i,e):ci(t,r.textContent,r.innerHTML,i,e)},50)}function ci(t,e,n,r,i){let o=Cu(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,i,o||W.empty)))return!0;if(!o)return!1;let s=MO(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Iu(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," "):""}We.paste=(t,e)=>{let n=e;if(t.composing&&!kt)return;let r=ai?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ci(t,Iu(r),r.getData("text/html"),i,n)?n.preventDefault():TO(t,n)};class Pu{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Ru=st?"altKey":"ctrlKey";He.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(uo(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)s=Y.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=Y.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:a,text:d,slice:u}=Su(t,l);n.dataTransfer.clearData(),n.dataTransfer.setData(ai?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",ai||n.dataTransfer.setData("text/plain",d),t.dragging=new Pu(u,!n[Ru],s)},He.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},We.dragover=We.dragenter=(t,e)=>e.preventDefault(),We.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(uo(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=Cu(t,Iu(n.dataTransfer),ai?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[Ru]);if(t.someProp("handleDrop",m=>m(t,n,s||W.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?Md(t.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let d=t.state.tr;if(l){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(a),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=d.doc;if(f?d.replaceRangeWith(u,u,s.content.firstChild):d.replaceRange(u,u,s),d.doc.eq(h))return;let p=d.doc.resolve(u);if(f&&Y.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new Y(p));else{let m=d.mapping.map(a);d.mapping.maps[d.mapping.maps.length-1].forEach((y,g,v,x)=>m=x),d.setSelection(Ys(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},He.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())&&Ht(t)},20))},He.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)},He.beforeinput=(t,e)=>{if(Fe&&kt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Nn(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in We)He[t]=We[t];function di(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 ho{constructor(e,n){this.toDOM=e,this.spec=n||Vn,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new et(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ho&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&di(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class dn{constructor(e,n){this.attrs=e,this.spec=n||Vn}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new et(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof dn&&di(this.attrs,e.attrs)&&di(this.spec,e.spec)}static is(e){return e.type instanceof dn}destroy(){}}class il{constructor(e,n){this.attrs=e,this.spec=n||Vn}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new et(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof il&&di(this.attrs,e.attrs)&&di(this.spec,e.spec)}destroy(){}}class et{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new et(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 et(e,e,new ho(n,r))}static inline(e,n,r,i){return new et(e,n,new dn(r,i))}static node(e,n,r,i){return new et(e,n,new il(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof dn}get widget(){return this.type instanceof ho}}const mr=[],Vn={};class Ce{constructor(e,n){this.local=e.length?e:mr,this.children=n.length?n:mr}static create(e,n){return n.length?po(n,e,0,Vn):Pe}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==Pe||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Vn)}mapInner(e,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,i);a&&a.type.valid(n,a)?(s||(s=[])).push(a):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?$O(this.children,s||[],e,n,r,i,o):s?new Ce(s.sort(_n),mr):Pe}add(e,n){return n.length?this==Pe?Ce.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((l,a)=>{let d=a+r,u;if(u=zu(n,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(l,u,d+1):i.splice(o,0,a,a+l.nodeSize,po(u,l,d+1,Vn)),o+=3}});let s=Lu(o?Fu(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new Ce(s.length?this.local.concat(s).sort(_n):this.local,i||this.children)}remove(e){return e.length==0||this==Pe?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,l=r[o]+n,a=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>l&&f.to<a&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,l+1);d!=Pe?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ce(i,r):Pe}forChild(e,n){if(this==Pe)return this;if(n.isLeaf)return Ce.empty;let r,i;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 o=e+1,s=o+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<s&&a.to>o&&a.type instanceof dn){let d=Math.max(o,a.from)-o,u=Math.min(s,a.to)-o;d<u&&(i||(i=[])).push(a.copy(d,u))}}if(i){let l=new Ce(i.sort(_n),mr);return r?new un([l,r]):l}return r||Pe}eq(e){if(this==e)return!0;if(!(e instanceof Ce)||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 ol(this.localsInner(e))}localsInner(e){if(this==Pe)return mr;if(e.inlineContent||!this.local.some(dn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof dn||n.push(this.local[r]);return n}}Ce.empty=new Ce([],[]),Ce.removeOverlap=ol;const Pe=Ce.empty;class un{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Vn));return un.from(r)}forChild(e,n){if(n.isLeaf)return Ce.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=Pe&&(o instanceof un?r=r.concat(o.members):r.push(o))}return un.from(r)}eq(e){if(!(e instanceof un)||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 i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?ol(r?n:n.sort(_n)):mr}static from(e){switch(e.length){case 0:return Pe;case 1:return e[0];default:return new un(e.every(n=>n instanceof Ce)?e:e.reduce((n,r)=>n.concat(r instanceof Ce?r:r.members),[]))}}}function $O(t,e,n,r,i,o,s){let l=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,y)=>{let g=y-m-(p-h);for(let v=0;v<l.length;v+=3){let x=l[v+1];if(x<0||h>x+u-f)continue;let T=l[v]+u-f;p>=T?l[v+1]=h<=T?-2:-1:h>=u&&g&&(l[v]+=g,l[v+1]+=g)}f+=g}),u=n.maps[d].map(u,-1)}let a=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){a=!0,l[d+1]=-1;continue}let u=n.map(t[d]+o),f=u-i;if(f<0||f>=r.content.size){a=!0;continue}let h=n.map(t[d+1]+o,-1),p=h-i,{index:m,offset:y}=r.content.findIndex(f),g=r.maybeChild(m);if(g&&y==f&&y+g.nodeSize==p){let v=l[d+2].mapInner(n,g,u+1,t[d]+o+1,s);v!=Pe?(l[d]=f,l[d+1]=p,l[d+2]=v):(l[d+1]=-2,a=!0)}else a=!0}if(a){let d=NO(l,t,e,n,i,o,s),u=po(d,r,0,s);e=u.local;for(let f=0;f<l.length;f+=3)l[f+1]<0&&(l.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<l.length&&l[h]<p;)h+=3;l.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ce(e.sort(_n),l)}function Lu(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new et(i.from+e,i.to+e,i.type))}return n}function NO(t,e,n,r,i,o,s){function l(a,d){for(let u=0;u<a.local.length;u++){let f=a.local[u].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+d+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+o+1);return n}function zu(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function Fu(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function po(t,e,n,r){let i=[],o=!1;e.forEach((l,a)=>{let d=zu(t,l,a+n);if(d){o=!0;let u=po(d,l,n+a+1,r);u!=Pe&&i.push(a,a+l.nodeSize,u)}});let s=Lu(o?Fu(t):t,-n).sort(_n);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||i.length?new Ce(s,i):Pe}function _n(t,e){return t.from-e.from||t.to-e.to}function ol(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),ju(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),ju(e,i,r.copy(o.from,r.to)));break}}}return e}function ju(t,e,n){for(;e<t.length&&_n(n,t[e])>0;)e++;t.splice(e,0,n)}function sl(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Pe&&e.push(r)}),t.cursorWrapper&&e.push(Ce.create(t.state.doc,[t.cursorWrapper.deco])),un.from(e)}const BO={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},AO=Ge&&on<=11;class DO{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 VO{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new DO,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Ge&&on<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),AO&&(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,BO)),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(mu(this.view)){if(this.suppressingSelectionUpdates)return Ht(this.view);if(Ge&&on<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&$n(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 o=e.focusNode;o;o=ti(o))n.add(o);for(let o=e.anchorNode;o;o=ti(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.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(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&mu(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],a);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(l=!0))}if(bt&&a.length){let u=a.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,h]=u;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of u){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||PO(e,f)!=p)&&h.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&lo(r)&&(d=Js(e))&&d.eq(le.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ht(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),_O(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ht(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 f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Ge&&on<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?Ve(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),a=o&&o.parentNode==e.target?Ve(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,a,1);return{from:l,to:d}}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 Hu=new WeakMap,Wu=!1;function _O(t){if(!Hu.has(t)&&(Hu.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=bt,Wu)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."),Wu=!0}}function qu(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return $n(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function IO(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return qu(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?qu(t,n):null}function PO(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 RO(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),d,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:a.anchorOffset}],lo(a)||d.push({node:a.focusNode,offset:a.focusOffset})),Fe&&t.input.lastKeyCode===8)for(let g=o;g>i;g--){let v=r.childNodes[g-1],x=v.pmViewDesc;if(v.nodeName=="BR"&&!x){o=g;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||rr.fromSchema(t.state.schema),p=f.resolve(s),m=null,y=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:LO,context:p});if(d&&d[0].pos!=null){let g=d[0].pos,v=d[1]&&d[1].pos;v==null&&(v=g),m={anchor:g+s,head:v+s}}return{doc:y,sel:m,from:s,to:l}}function LO(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(je&&/^(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||je&&/^(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 zO=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function FO(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,R=Js(t,A);if(R&&!t.state.selection.eq(R)){if(Fe&&kt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",j=>j(t,Nn(13,"Enter"))))return;let F=t.state.tr.setSelection(R);A=="pointer"?F.setMeta("pointer",!0):A=="key"&&F.scrollIntoView(),o&&F.setMeta("composition",o),t.dispatch(F)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,d=RO(t,e,n),u=t.state.doc,f=u.slice(d.from,d.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=WO(f.content,d.doc.content,d.from,h,p);if((ur&&t.input.lastIOSEnter>Date.now()-225||kt)&&i.some(A=>A.nodeType==1&&!zO.test(A.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",A=>A(t,Nn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&a instanceof ne&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:a.from,endA:a.to,endB:a.to};else{if(d.sel){let A=Uu(t,t.state.doc,d.sel);if(A&&!A.eq(t.state.selection)){let R=t.state.tr.setSelection(A);o&&R.setMeta("composition",o),t.dispatch(R)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ne&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Ge&&on<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let y=d.doc.resolveNoCache(m.start-d.from),g=d.doc.resolveNoCache(m.endB-d.from),v=u.resolve(m.start),x=y.sameParent(g)&&y.parent.inlineContent&&v.end()>=m.endA,T;if((ur&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!x&&y.pos<d.doc.content.size&&!y.sameParent(g)&&(T=le.findFrom(d.doc.resolve(y.pos+1),1,!0))&&T.head==g.pos)&&t.someProp("handleKeyDown",A=>A(t,Nn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&HO(u,m.start,m.endA,y,g)&&t.someProp("handleKeyDown",A=>A(t,Nn(8,"Backspace")))){kt&&Fe&&t.domObserver.suppressSelectionUpdates();return}Fe&&kt&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),kt&&!x&&y.start()!=g.start()&&g.parentOffset==0&&y.depth==g.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,g=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(A){return A(t,Nn(13,"Enter"))})},20));let b=m.start,S=m.endA,k,C,D;if(x){if(y.pos==g.pos)Ge&&on<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ht(t),20)),k=t.state.tr.delete(b,S),C=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(D=jO(y.parent.content.cut(y.parentOffset,g.parentOffset),v.parent.content.cut(v.parentOffset,m.endA-v.start()))))k=t.state.tr,D.type=="add"?k.addMark(b,S,D.mark):k.removeMark(b,S,D.mark);else if(y.parent.child(y.index()).isText&&y.index()==g.index()-(g.textOffset?0:1)){let A=y.parent.textBetween(y.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",R=>R(t,b,S,A)))return;k=t.state.tr.insertText(A,b,S)}}if(k||(k=t.state.tr.replace(b,S,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let A=Uu(t,k.doc,d.sel);A&&!(Fe&&kt&&t.composing&&A.empty&&(m.start!=m.endB||t.input.lastAndroidDelete<Date.now()-100)&&(A.head==b||A.head==k.mapping.map(S)-1)||Ge&&A.empty&&A.head==b)&&k.setSelection(A)}C&&k.ensureMarks(C),o&&k.setMeta("composition",o),t.dispatch(k.scrollIntoView())}function Uu(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ys(t,e.resolve(n.anchor),e.resolve(n.head))}function jO(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,a;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)l=i[0],s="add",a=u=>u.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(a(e.child(u)));if(P.from(d).eq(t))return{mark:l,type:s}}function HO(t,e,n,r,i){if(n-e<=i.pos-r.pos||ll(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&n==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(ll(o,!0,!0));return!s.parent.isTextblock||s.pos>n||ll(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function ll(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function WO(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s<o&&t.size<e.size){let a=r<=o&&r>=s?o-r:0;o-=a,o&&o<e.size&&Ku(e.textBetween(o-1,o+1))&&(o+=a?1:-1),l=o+(l-s),s=o}else if(l<o){let a=r<=o&&r>=l?o-r:0;o-=a,o&&o<t.size&&Ku(t.textBetween(o-1,o+1))&&(o+=a?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function Ku(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 qO{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 dO,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Xu),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=Yu(this),Gu(this),this.nodeViews=Zu(this),this.docView=ru(this.state.doc,Ju(this),sl(this),this.dom,this),this.domObserver=new VO(this,(r,i,o,s)=>FO(this,r,i,o,s)),this.domObserver.start(),uO(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&&el(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Xu),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 i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(_u(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=Zu(this);KO(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&el(this),this.editable=Yu(this),Gu(this);let a=sl(this),d=Ju(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,d,a);(f||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&EC(this);if(s){this.domObserver.stop();let p=f&&(Ge||Fe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&UO(i.selection,e.selection);if(f){let m=Fe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=CO(this)),(o||!this.docView.update(e.doc,d,a,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=ru(e.doc,d,a,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&YC(this))?Ht(this,p):(hu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&MC(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Y){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Wd(this,n.getBoundingClientRect(),e)}else Wd(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,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Pu(e.slice,e.move,i<0?void 0:Y.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(i=n?n(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[e];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(Ge){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&&TC(this.dom),Ht(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 DC(this,e)}coordsAtPos(e,n=1){return Yd(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 i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return RC(this,n||this.state,e)}pasteHTML(e,n){return ci(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ci(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(fO(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],sl(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,pC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return pO(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return je&&this.root.nodeType===11&&kC(this.dom.ownerDocument)==this.dom&&IO(this,e)||e}domSelection(){return this.root.getSelection()}}function Ju(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"),[et.node(0,t.state.doc.content.size,e)]}function Gu(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:et.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Yu(t){return!t.someProp("editable",e=>e(t.state)===!1)}function UO(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 Zu(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function KO(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Xu(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")}for(var fn={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:"'"},mo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},JO=typeof navigator<"u"&&/Mac/.test(navigator.platform),GO=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_e=0;_e<10;_e++)fn[48+_e]=fn[96+_e]=String(_e);for(var _e=1;_e<=24;_e++)fn[_e+111]="F"+_e;for(var _e=65;_e<=90;_e++)fn[_e]=String.fromCharCode(_e+32),mo[_e]=String.fromCharCode(_e);for(var al in fn)mo.hasOwnProperty(al)||(mo[al]=fn[al]);function YO(t){var e=JO&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||GO&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?mo:fn)[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 ZO=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function XO(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))ZO?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function QO(t){let e=Object.create(null);for(let n in t)e[XO(n)]=t[n];return e}function cl(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 e2(t){return new ze({props:{handleKeyDown:Qu(t)}})}function Qu(t){let e=QO(t);return function(n,r){let i=YO(r),o,s=e[cl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[cl(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=fn[r.keyCode])&&o!=i){let l=e[cl(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const dl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function ef(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const tf=(t,e,n)=>{let r=ef(t,n);if(!r)return!1;let i=ul(r);if(!i){let s=r.blockRange(),l=s&&sr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&uf(t,i,e))return!0;if(r.parent.content.size==0&&(gr(o,"end")||Y.isSelectable(o))){let s=oo(t.doc,r.before(),r.after(),W.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(gr(o,"end")?le.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):Y.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},t2=(t,e,n)=>{let r=ef(t,n);if(!r)return!1;let i=ul(r);return i?nf(t,i,e):!1},n2=(t,e,n)=>{let r=of(t,n);if(!r)return!1;let i=fl(r);return i?nf(t,i,e):!1};function nf(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,l=s,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 d=oo(t.doc,o,a,W.empty);if(!d||d.from!=o||d instanceof Te&&d.slice.size>=a-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(ne.create(u.doc,o)),n(u.scrollIntoView())}return!0}function gr(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 rf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=ul(r)}let s=o&&o.nodeBefore;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function ul(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 of(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const sf=(t,e,n)=>{let r=of(t,n);if(!r)return!1;let i=fl(r);if(!i)return!1;let o=i.nodeAfter;if(uf(t,i,e))return!0;if(r.parent.content.size==0&&(gr(o,"start")||Y.isSelectable(o))){let s=oo(t.doc,r.before(),r.after(),W.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(gr(o,"start")?le.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):Y.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},lf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=fl(r)}let s=o&&o.nodeAfter;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos)).scrollIntoView()),!0)};function fl(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 r2=(t,e)=>{let n=t.selection,r=n instanceof Y,i;if(r){if(n.node.isTextblock||!nn(t.doc,n.from))return!1;i=n.from}else if(i=io(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(Y.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},i2=(t,e)=>{let n=t.selection,r;if(n instanceof Y){if(n.node.isTextblock||!nn(t.doc,n.to))return!1;r=n.to}else if(r=io(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},o2=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&sr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},af=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
14
+ `).scrollIntoView()),!0)};function hl(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 s2=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=hl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(le.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},cf=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof ot||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=hl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(s,o.createAndFill());l.setSelection(ne.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},df=(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 o=n.before();if(zt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&sr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function l2(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Y&&e.selection.node.isBlock)return!r.parentOffset||!zt(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let o=i.parentOffset==i.parent.content.size,s=e.tr;(e.selection instanceof ne||e.selection instanceof ot)&&s.deleteSelection();let l=r.depth==0?null:hl(r.node(-1).contentMatchAt(r.indexAfter(-1))),a=o&&l?[{type:l}]:void 0,d=zt(s.doc,s.mapping.map(r.pos),1,a);if(!a&&!d&&zt(s.doc,s.mapping.map(r.pos),1,l?[{type:l}]:void 0)&&(l&&(a=[{type:l}]),d=!0),d&&(s.split(s.mapping.map(r.pos),1,a),!o&&!r.parentOffset&&r.parent.type!=l)){let u=s.mapping.map(r.before()),f=s.doc.resolve(u);l&&r.node(-1).canReplaceWith(f.index(),f.index()+1,l)&&s.setNodeMarkup(s.mapping.map(r.before()),l)}n(s.scrollIntoView())}return!0}}const a2=l2(),c2=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(Y.create(t.doc,i))),!0)};function d2(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||nn(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function uf(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(d2(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,h=P.empty;for(let y=o.length-1;y>=0;y--)h=P.from(o[y].create(null,h));h=P.from(r.copy(h));let p=t.tr.step(new $e(e.pos-1,f,e.pos,f,new W(h,1,0),o.length,!0)),m=f+2*o.length;nn(p.doc,m)&&p.join(m),n(p.scrollIntoView())}return!0}let a=le.findFrom(e,1),d=a&&a.$from.blockRange(a.$to),u=d&&sr(d);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(d,u).scrollIntoView()),!0;if(l&&gr(i,"start",!0)&&gr(r,"end")){let f=r,h=[];for(;h.push(f),!f.isTextblock;)f=f.lastChild;let p=i,m=1;for(;!p.isTextblock;p=p.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let y=P.empty;for(let v=h.length-1;v>=0;v--)y=P.from(h[v].copy(y));let g=t.tr.step(new $e(e.pos-h.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new W(y,h.length,0),0,!0));n(g.scrollIntoView())}return!0}}return!1}function ff(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(ne.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const u2=ff(-1),f2=ff(1);function h2(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&As(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function hf(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[o];n.doc.nodesBetween(s,l,(a,d)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)i=!0;else{let u=n.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];o.setBlockType(l,a,t,e)}r(o.scrollIntoView())}return!0}}function pl(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}pl(dl,tf,rf),pl(dl,sf,lf),pl(af,cf,df,a2),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function p2(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);a=new Yi(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Yi(i,n.doc.resolve(o.end(s.depth)),s.depth)),l=!0}let d=As(a,t,e,s);return d?(r&&r(m2(n.tr,s,d,l,t).scrollIntoView()),!0):!1}}function m2(t,e,n,r,i){let o=P.empty;for(let u=n.length-1;u>=0;u--)o=P.from(n[u].type.create(n[u].attrs,o));t.step(new $e(e.start-(r?2:0),e.end,e.start,e.end,new W(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let l=n.length-s,a=e.start+n.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,h=!0;u<f;u++,h=!1)!h&&zt(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=d.child(u).nodeSize;return t}function g2(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?y2(e,n,t,o):b2(e,n,o):!0:!1}}function y2(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new $e(o-1,s,o,s,new W(P.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Yi(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const l=sr(r);if(l==null)return!1;i.lift(r,l);let a=i.mapping.map(o,-1)-1;return nn(i.doc,a)&&i.join(a),e(i.scrollIntoView()),!0}function b2(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,y=n.startIndex;m>y;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(l?0:1),u+1,s.content.append(a?P.empty:P.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new $e(f-(l?1:0),h+(a?1:0),f+1,h-1,new W((l?P.empty:P.from(i.copy(P.empty))).append(a?P.empty:P.from(i.copy(P.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function k2(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=t)return!1;if(n){let d=a.lastChild&&a.lastChild.type==l.type,u=P.from(d?t.create():null),f=new W(P.from(t.create(null,P.from(l.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new $e(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function go(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=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 o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class yo{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...u)=>{const f=a(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],a=!!e,d=e||o.tr,u=()=>(!a&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...y)=>{const g=this.buildProps(d,n),v=p(...y)(g);return l.push(v),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([a,d])=>[a,(...u)=>d(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:go({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,d])=>[a,(...u)=>d(...u)(l)]))}};return l}}class v2{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function J(t,e,n){return t.config[e]===void 0&&t.parent?J(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?J(t.parent,e,n):null}):t.config[e]}function bo(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function pf(t){const e=[],{nodeExtensions:n,markExtensions:r}=bo(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=J(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([h,p])=>{e.push({type:f,name:h,attribute:{...o,...p}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=J(s,"addAttributes",l);if(!a)return;const d=a();Object.entries(d).forEach(([u,f])=>{const h={...o,...f};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function Ne(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 Ee(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?o.split(" "):[],a=r[i]?r[i].split(" "):[],d=l.filter(u=>!a.includes(u));r[i]=[...a,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function ml(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Ee(n,r),{})}function mf(t){return typeof t=="function"}function ae(t,e=void 0,...n){return mf(t)?e?t.bind(e)(...n):t(...n):t}function x2(t={}){return Object.keys(t).length===0&&t.constructor===Object}function w2(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function gf(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):w2(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function yf(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&x2(n)?!1:n!=null))}function S2(t,e){var n;const r=pf(t),{nodeExtensions:i,markExtensions:o}=bo(t),s=(n=i.find(d=>J(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{const u=r.filter(v=>v.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((v,x)=>{const T=J(x,"extendNodeSchema",f);return{...v,...T?T(d):{}}},{}),p=yf({...h,content:ae(J(d,"content",f)),marks:ae(J(d,"marks",f)),group:ae(J(d,"group",f)),inline:ae(J(d,"inline",f)),atom:ae(J(d,"atom",f)),selectable:ae(J(d,"selectable",f)),draggable:ae(J(d,"draggable",f)),code:ae(J(d,"code",f)),defining:ae(J(d,"defining",f)),isolating:ae(J(d,"isolating",f)),attrs:Object.fromEntries(u.map(v=>{var x;return[v.name,{default:(x=v==null?void 0:v.attribute)===null||x===void 0?void 0:x.default}]}))}),m=ae(J(d,"parseHTML",f));m&&(p.parseDOM=m.map(v=>gf(v,u)));const y=J(d,"renderHTML",f);y&&(p.toDOM=v=>y({node:v,HTMLAttributes:ml(v,u)}));const g=J(d,"renderText",f);return g&&(p.toText=g),[d.name,p]})),a=Object.fromEntries(o.map(d=>{const u=r.filter(g=>g.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((g,v)=>{const x=J(v,"extendMarkSchema",f);return{...g,...x?x(d):{}}},{}),p=yf({...h,inclusive:ae(J(d,"inclusive",f)),excludes:ae(J(d,"excludes",f)),group:ae(J(d,"group",f)),spanning:ae(J(d,"spanning",f)),code:ae(J(d,"code",f)),attrs:Object.fromEntries(u.map(g=>{var v;return[g.name,{default:(v=g==null?void 0:g.attribute)===null||v===void 0?void 0:v.default}]}))}),m=ae(J(d,"parseHTML",f));m&&(p.parseDOM=m.map(g=>gf(g,u)));const y=J(d,"renderHTML",f);return y&&(p.toDOM=g=>y({mark:g,HTMLAttributes:ml(g,u)})),[d.name,p]}));return new AS({topNode:s,nodes:l,marks:a})}function gl(t,e){return e.nodes[t]||e.marks[t]||null}function bf(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const C2=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var a,d;const u=((d=(a=i.type.spec).toText)===null||d===void 0?void 0:d.call(a,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-o))}),n};function yl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class ko{constructor(e){this.find=e.find,this.handler=e.handler}}const O2=(t,e)=>{if(yl(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 vo(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const d=a.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=C2(d)+o;return s.forEach(h=>{if(u)return;const p=O2(f,h.find);if(!p)return;const m=a.state.tr,y=go({state:a.state,transaction:m}),g={from:r-(p[0].length-o.length),to:i},{commands:v,chain:x,can:T}=new yo({editor:n,state:y});h.handler({state:y,range:g,match:p,commands:v,chain:x,can:T})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:r,to:i,text:o}),a.dispatch(m),u=!0)}),u}function E2(t){const{editor:e,rules:n}=t,r=new ze({state:{init(){return null},apply(i,o){const s=i.getMeta(r);if(s)return s;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{const{from:d,text:u}=l,f=d+u.length;vo({editor:e,from:d,to:f,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return vo({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&vo({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?vo({editor:e,from:s.pos,to:s.pos,text:`
15
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function M2(t){return typeof t=="number"}class T2{constructor(e){this.find=e.find,this.handler=e.handler}}const $2=(t,e,n)=>{if(yl(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function N2(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:a,chain:d,can:u}=new yo({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(p,m)=>{if(!p.isTextblock||p.type.spec.code)return;const y=Math.max(r,m),g=Math.min(i,m+p.content.size),v=p.textBetween(y-m,g-m,void 0,"");$2(v,o.find,s).forEach(T=>{if(T.index===void 0)return;const b=y+T.index+1,S=b+T[0].length,k={from:n.tr.mapping.map(b),to:n.tr.mapping.map(S)},C=o.handler({state:n,range:k,match:T,commands:a,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(C)})}),f.every(p=>p!==null)}const B2=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function A2(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l=typeof DragEvent<"u"?new DragEvent("drop"):null;const a=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const y=u.tr,g=go({state:u,transaction:y});if(!(!N2({editor:e,state:g,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:l})||!y.steps.length))return l=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,y};return n.map(u=>new ze({view(f){const h=p=>{var m;r=!((m=f.dom.parentElement)===null||m===void 0)&&m.contains(p.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",h),{destroy(){window.removeEventListener("dragstart",h)}}},props:{handleDOMEvents:{drop:(f,h)=>(o=r===f.dom.parentElement,l=h,!1),paste:(f,h)=>{var p;const m=(p=h.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=h,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],y=m.getMeta("uiEvent")==="paste"&&!i,g=m.getMeta("uiEvent")==="drop"&&!o,v=m.getMeta("applyPasteRules"),x=!!v;if(!y&&!g&&!x)return;if(x){const{from:S,text:k}=v,C=S+k.length,D=B2(k);return a({rule:u,state:p,from:S,to:{b:C},pasteEvt:D})}const T=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!M2(T)||!b||T===b.b))return a({rule:u,state:p,from:T,to:b,pasteEvt:s})}}))}function D2(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class yr{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=yr.resolve(e),this.schema=S2(this.extensions,n),this.setupExtensions()}static resolve(e){const n=yr.sort(yr.flatten(e)),r=D2(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=J(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=J(r,"priority")||100,s=J(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:gl(n.name,this.schema)},i=J(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=yr.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:gl(s.name,this.schema)},a=[],d=J(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>Nt.handleExit({editor:e,mark:s})),d){const y=Object.fromEntries(Object.entries(d()).map(([g,v])=>[g,()=>v({editor:e})]));u={...u,...y}}const f=e2(u);a.push(f);const h=J(s,"addInputRules",l);bf(s,e.options.enableInputRules)&&h&&r.push(...h());const p=J(s,"addPasteRules",l);bf(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=J(s,"addProseMirrorPlugins",l);if(m){const y=m();a.push(...y)}return a}).flat();return[E2({editor:e,rules:r}),...A2({editor:e,rules:i}),...o]}get attributes(){return pf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=bo(this.extensions);return Object.fromEntries(n.filter(r=>!!J(r,"addNodeView")).map(r=>{const i=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ne(r.name,this.schema)},s=J(r,"addNodeView",o);if(!s)return[];const l=(a,d,u,f)=>{const h=ml(a,i);return s()({editor:e,node:a,getPos:u,decorations:f,HTMLAttributes:h,extension:r})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:gl(e.name,this.schema)};e.type==="mark"&&(!((n=ae(J(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=J(e,"onBeforeCreate",r),o=J(e,"onCreate",r),s=J(e,"onUpdate",r),l=J(e,"onSelectionUpdate",r),a=J(e,"onTransaction",r),d=J(e,"onFocus",r),u=J(e,"onBlur",r),f=J(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}function V2(t){return Object.prototype.toString.call(t).slice(8,-1)}function bl(t){return V2(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function xo(t,e){const n={...t};return bl(t)&&bl(e)&&Object.keys(e).forEach(r=>{bl(e[r])?r in t?n[r]=xo(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class Re{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(J(this,"addOptions",{name:this.name}))),this.storage=ae(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Re(e)}configure(e={}){const n=this.extend();return n.parent=this.parent,n.options=xo(this.options,e),n.storage=ae(J(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Re({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(J(n,"addOptions",{name:n.name})),n.storage=ae(J(n,"addStorage",{name:n.name,options:n.options})),n}}function kf(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
16
+
17
+ `,textSerializers:s={}}=n||{};let l="";return t.nodesBetween(r,i,(a,d,u,f)=>{var h;a.isBlock&&d>r&&(l+=o);const p=s==null?void 0:s[a.type.name];if(p)return u&&(l+=p({node:a,pos:d,parent:u,index:f,range:e})),!1;a.isText&&(l+=(h=a==null?void 0:a.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),l}function vf(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const _2=Re.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ze({key:new yt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),a=vf(n);return kf(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),I2=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),P2=(t=!1)=>({commands:e})=>e.setContent("",t),R2=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,a)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(a)),h=d.resolve(u.map(a+l.nodeSize)),p=f.blockRange(h);if(!p)return;const m=sr(p);if(l.type.isTextblock){const{defaultType:y}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,y)}(m||m===0)&&e.lift(p,m)})}),!0},L2=t=>e=>t(e),z2=()=>({state:t,dispatch:e})=>cf(t,e),F2=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new ne(r.doc.resolve(s-1))),!0},j2=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),a=i.after(o);t.delete(l,a).scrollIntoView()}return!0}return!1},H2=t=>({tr:e,state:n,dispatch:r})=>{const i=Ne(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const a=o.before(s),d=o.after(s);e.delete(a,d).scrollIntoView()}return!0}return!1},W2=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},q2=()=>({state:t,dispatch:e})=>dl(t,e),U2=()=>({commands:t})=>t.keyboardShortcut("Enter"),K2=()=>({state:t,dispatch:e})=>s2(t,e);function wo(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:yl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function kl(t,e,n={}){return t.find(r=>r.type===e&&wo(r.attrs,n))}function J2(t,e,n={}){return!!kl(t,e,n)}function vl(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=kl([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,l=o+1,a=s+r.node.nodeSize;for(kl([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&J2([...t.parent.child(l).marks],e,n);)a+=t.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function hn(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}const G2=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=hn(t,r.schema),{doc:s,selection:l}=n,{$from:a,from:d,to:u}=l;if(i){const f=vl(a,o,e);if(f&&f.from<=d&&f.to>=u){const h=ne.create(s,f.from,f.to);n.setSelection(h)}}return!0},Y2=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 xl(t){return t instanceof ne}function Wt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function xf(t,e=null){if(!e)return null;const n=le.atStart(t),r=le.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?ne.create(t,Wt(0,i,o),Wt(t.content.size,i,o)):ne.create(t,Wt(e,i,o),Wt(e,i,o))}function wl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const Z2=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{wl()&&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(o&&t===null&&!xl(n.state.selection))return s(),!0;const l=xf(i.doc,t)||n.state.selection,a=n.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},X2=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),Q2=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),wf=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&&wf(r)}return t};function Sf(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return wf(n)}function So(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?P.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),So("",e,n)}if(i){const o=rr.fromSchema(e);return n.slice?o.parseSlice(Sf(t),n.parseOptions).content:o.parse(Sf(t),n.parseOptions)}return So("",e,n)}function eE(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Te||i instanceof $e))return;const o=t.mapping.maps[r];let s=0;o.forEach((l,a,d,u)=>{s===0&&(s=u)}),t.setSelection(le.near(t.doc.resolve(s),n))}const tE=t=>t.toString().startsWith("<"),nE=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const s=So(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:l,to:a}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,u=!0;if((tE(s)?s:[s]).forEach(p=>{p.check(),d=d?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),l===a&&u){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,a+=1)}let h;d?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,l,a)):(h=s,r.replaceWith(l,a,h)),n.updateSelection&&eE(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:h})}return!0},rE=()=>({state:t,dispatch:e})=>r2(t,e),iE=()=>({state:t,dispatch:e})=>i2(t,e),oE=()=>({state:t,dispatch:e})=>tf(t,e),sE=()=>({state:t,dispatch:e})=>sf(t,e),lE=()=>({tr:t,state:e,dispatch:n})=>{try{const r=io(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},aE=()=>({state:t,dispatch:e,tr:n})=>{try{const r=io(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},cE=()=>({state:t,dispatch:e})=>t2(t,e),dE=()=>({state:t,dispatch:e})=>n2(t,e);function Cf(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function uE(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))wl()||Cf()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const fE=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=uE(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return a==null||a.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ui(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Ne(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);l.push({node:f,from:p,to:m})});const a=i-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>wo(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=a}const hE=(t,e={})=>({state:n,dispatch:r})=>{const i=Ne(t,n.schema);return ui(n,i,e)?o2(n,r):!1},pE=()=>({state:t,dispatch:e})=>df(t,e),mE=t=>({state:e,dispatch:n})=>{const r=Ne(t,e.schema);return g2(r)(e,n)},gE=()=>({state:t,dispatch:e})=>af(t,e);function Co(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Of(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const yE=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Co(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ne(t,r.schema)),l==="mark"&&(s=hn(t,r.schema)),i&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(d,u)=>{o&&o===d.type&&n.setNodeMarkup(u,void 0,Of(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Of(f.attrs,e)))})})}),!0):!1},bE=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),kE=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),vE=()=>({state:t,dispatch:e})=>rf(t,e),xE=()=>({state:t,dispatch:e})=>lf(t,e),wE=()=>({state:t,dispatch:e})=>c2(t,e),SE=()=>({state:t,dispatch:e})=>f2(t,e),CE=()=>({state:t,dispatch:e})=>u2(t,e);function Ef(t,e,n={}){return So(t,e,{slice:!1,parseOptions:n})}const OE=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,l=Ef(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!e),!0};function Oo(t,e){const n=hn(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,a=>{s.push(...a.marks)});const l=s.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function EE(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 ME(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 Sl(t){return e=>ME(e.$from,t)}function TE(t,e){const n=Ot.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function $E(t,e){const n={from:0,to:t.content.size};return kf(t,n,e)}function NE(t,e){const n=Ne(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function BE(t,e){const n=Co(typeof e=="string"?e:e.name,t.schema);return n==="node"?NE(t,e):n==="mark"?Oo(t,e):{}}function Mf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=vl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Eo(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Cl(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?hn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>wo(f.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(y,g)=>{if(!y.isText&&!y.marks.length)return;const v=Math.max(p,g),x=Math.min(m,g+y.nodeSize),T=x-v;s+=T,l.push(...y.marks.map(b=>({mark:b,from:v,to:x})))})}),s===0)return!1;const a=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>wo(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=l.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(a>0?a+d:a)>=s}function AE(t,e,n={}){if(!e)return ui(t,null,n)||Cl(t,null,n);const r=Co(e,t.schema);return r==="node"?ui(t,e,n):r==="mark"?Cl(t,e,n):!1}function Tf(t,e){const{nodeExtensions:n}=bo(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ae(J(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function DE(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function VE(t){return t instanceof Y}function $f(t,e,n){const i=t.state.doc.content.size,o=Wt(e,0,i),s=Wt(n,0,i),l=t.coordsAtPos(o),a=t.coordsAtPos(s,-1),d=Math.min(l.top,a.top),u=Math.max(l.bottom,a.bottom),f=Math.min(l.left,a.left),h=Math.max(l.right,a.right),p=h-f,m=u-d,v={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...v,toJSON:()=>v}}function _E(t,e,n){var r;const{selection:i}=e;let o=null;if(xl(i)&&(o=i.$cursor),o){const l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(a=>a.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:l,$to:a})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,f,h)=>{if(d)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(y=>y.type.excludes(n));d=p&&m}return!d}),d})}const IE=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,a=hn(t,r.schema);if(i)if(s){const d=Oo(r,a);n.addStoredMark(a.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),y=Math.min(p+h.nodeSize,f);h.marks.find(v=>v.type===a)?h.marks.forEach(v=>{a===v.type&&n.addMark(m,y,a.create({...v.attrs,...e}))}):n.addMark(m,y,a.create(e))})});return _E(r,n,a)},PE=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),RE=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Ne(t,n.schema);return o.isTextblock?i().command(({commands:s})=>hf(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>hf(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},LE=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Wt(t,0,r.content.size),o=Y.create(r,i);e.setSelection(o)}return!0},zE=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ne.atStart(r).from,l=ne.atEnd(r).to,a=Wt(i,s,l),d=Wt(o,s,l),u=ne.create(r,a,d);e.setSelection(u)}return!0},FE=t=>({state:e,dispatch:n})=>{const r=Ne(t,e.schema);return k2(r)(e,n)};function Nf(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const jE=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:a}=o,d=i.extensionManager.attributes,u=Eo(d,l.node().type.name,l.node().attrs);if(o instanceof Y&&o.node.isBlock)return!l.parentOffset||!zt(s,l.pos)?!1:(r&&(t&&Nf(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const f=a.parentOffset===a.parent.content.size;o instanceof ne&&e.deleteSelection();const h=l.depth===0?void 0:EE(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=zt(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&zt(e.doc,e.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),m&&(e.split(e.mapping.map(l.pos),1,p),h&&!f&&!l.parentOffset&&l.parent.type!==h)){const y=e.mapping.map(l.before()),g=e.doc.resolve(y);l.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}t&&Nf(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},HE=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Ne(t,n.schema),{$from:l,$to:a}=n.selection,d=n.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(a))return!1;const u=l.node(-1);if(u.type!==s)return!1;const f=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let g=P.empty;const v=l.index(-1)?1:l.index(-2)?2:3;for(let C=l.depth-v;C>=l.depth-3;C-=1)g=P.from(l.node(C).copy(g));const x=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,T=Eo(f,l.node().type.name,l.node().attrs),b=((o=s.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(T))||void 0;g=g.append(P.from(s.createAndFill(null,b)||void 0));const S=l.before(l.depth-(v-1));e.replace(S,l.after(-x),new W(g,4-v,0));let k=-1;e.doc.nodesBetween(S,e.doc.content.size,(C,D)=>{if(k>-1)return!1;C.isTextblock&&C.content.size===0&&(k=D+1)}),k>-1&&e.setSelection(ne.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const h=a.pos===l.end()?u.contentMatchAt(0).defaultType:null,p=Eo(f,u.type.name,u.attrs),m=Eo(f,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const y=h?[{type:s,attrs:p},{type:h,attrs:m}]:[{type:s,attrs:p}];if(!zt(e.doc,l.pos,2))return!1;if(r){const{selection:g,storedMarks:v}=n,{splittableMarks:x}=i.extensionManager,T=v||g.$to.parentOffset&&g.$from.marks();if(e.split(l.pos,2,y).scrollIntoView(),!T||!r)return!0;const b=T.filter(S=>x.includes(S.type.name));e.ensureMarks(b)}return!0},Ol=(t,e)=>{const n=Sl(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 i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&nn(t.doc,n.pos)&&t.join(n.pos),!0},El=(t,e)=>{const n=Sl(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 i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&nn(t.doc,r)&&t.join(r),!0};var WE=Object.freeze({__proto__:null,blur:I2,clearContent:P2,clearNodes:R2,command:L2,createParagraphNear:z2,cut:F2,deleteCurrentNode:j2,deleteNode:H2,deleteRange:W2,deleteSelection:q2,enter:U2,exitCode:K2,extendMarkRange:G2,first:Y2,focus:Z2,forEach:X2,insertContent:Q2,insertContentAt:nE,joinUp:rE,joinDown:iE,joinBackward:oE,joinForward:sE,joinItemBackward:lE,joinItemForward:aE,joinTextblockBackward:cE,joinTextblockForward:dE,keyboardShortcut:fE,lift:hE,liftEmptyBlock:pE,liftListItem:mE,newlineInCode:gE,resetAttributes:yE,scrollIntoView:bE,selectAll:kE,selectNodeBackward:vE,selectNodeForward:xE,selectParentNode:wE,selectTextblockEnd:SE,selectTextblockStart:CE,setContent:OE,setMark:IE,setMeta:PE,setNode:RE,setNodeSelection:LE,setTextSelection:zE,sinkListItem:FE,splitBlock:jE,splitListItem:HE,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Ne(t,s.schema),m=Ne(e,s.schema),{selection:y,storedMarks:g}=s,{$from:v,$to:x}=y,T=v.blockRange(x),b=g||y.$to.parentOffset&&y.$from.marks();if(!T)return!1;const S=Sl(k=>Tf(k.type.name,f))(y);if(T.depth>=1&&S&&T.depth-S.depth<=1){if(S.node.type===p)return d.liftListItem(m);if(Tf(S.node.type.name,f)&&p.validContent(S.node.content)&&l)return a().command(()=>(o.setNodeMarkup(S.pos,p),!0)).command(()=>Ol(o,p)).command(()=>El(o,p)).run()}return!n||!b||!l?a().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>Ol(o,p)).command(()=>El(o,p)).run():a().command(()=>{const k=u().wrapInList(p,r),C=b.filter(D=>h.includes(D.type.name));return o.ensureMarks(C),k?!0:d.clearNodes()}).wrapInList(p,r).command(()=>Ol(o,p)).command(()=>El(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=hn(t,r.schema);return Cl(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Ne(t,r.schema),s=Ne(e,r.schema);return ui(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Ne(t,n.schema);return ui(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,l=o.transform;for(let a=l.steps.length-1;a>=0;a-=1)s.step(l.steps[a].invert(l.docs[a]));if(o.text){const a=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,a))}else s.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,a=hn(t,r.schema),{$from:d,empty:u,ranges:f}=l;if(!i)return!0;if(u&&s){let{from:h,to:p}=l;const m=(o=d.marks().find(g=>g.type===a))===null||o===void 0?void 0:o.attrs,y=vl(d,a,m);y&&(h=y.from,p=y.to),n.removeMark(h,p,a)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,a)});return n.removeStoredMark(a),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Co(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ne(t,r.schema)),l==="mark"&&(s=hn(t,r.schema)),i&&n.selection.ranges.forEach(a=>{const d=a.$from.pos,u=a.$to.pos;r.doc.nodesBetween(d,u,(f,h)=>{o&&o===f.type&&n.setNodeMarkup(h,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(p=>{if(s===p.type){const m=Math.max(h,d),y=Math.min(h+f.nodeSize,u);n.addMark(m,y,s.create({...p.attrs,...e}))}})})}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Ne(t,n.schema);return h2(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Ne(t,n.schema);return p2(i,e)(n,r)}});const qE=Re.create({name:"commands",addCommands(){return{...WE}}}),UE=Re.create({name:"editable",addProseMirrorPlugins(){return[new ze({key:new yt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),KE=Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ze({key:new yt("focusEvents"),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}}}})]}}),JE=Re.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:a,doc:d}=l,{empty:u,$anchor:f}=a,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?l.doc.resolve(h-1):f,y=m.parent.type.spec.isolating,g=f.pos-f.parentOffset,v=y&&m.parent.childCount===1?g===f.pos:le.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!v||v&&f.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()]),r={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()},i={...r},o={...r,"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 wl()||Cf()?o:i},addProseMirrorPlugins(){return[new ze({key:new yt("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(m=>m.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,l=le.atStart(e.doc).from,a=le.atEnd(e.doc).to;if(i||!(o===l&&s===a)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,h=go({state:n,transaction:f}),{commands:p}=new yo({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),GE=Re.create({name:"tabindex",addProseMirrorPlugins(){return[new ze({key:new yt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class In{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}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!==void 0?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 In(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 In(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 In(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const l=new In(s,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new In(s,this.editor,i,i?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,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let l=0;l<s.length;l+=1){const a=s[l];if(o[a]!==n[a])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(a=>n[a]===s.node.attrs[a])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const YE=`.ProseMirror {
18
18
  position: relative;
19
19
  }
20
20
 
@@ -88,42 +88,33 @@ img.ProseMirror-separator {
88
88
 
89
89
  .tippy-box[data-animation=fade][data-state=hidden] {
90
90
  opacity: 0
91
- }`;function eN(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let tN=class extends SE{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),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),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}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&&document&&(this.css=eN(Q_,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=yp(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[K_,RE.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),G_,J_,Z_,X_]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new ai(i,this)}createCommandManager(){this.commandManager=new Es({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Ep(this.options.content,this.schema,this.options.parseOptions),n=Sp(e,this.options.autofocus);this.view=new j2(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ei.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return B_(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return V_(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return D_(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
91
+ }`;function ZE(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let XE=class extends v2{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),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),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}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&&document&&(this.css=ZE(YE,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=mf(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[UE,_2.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),qE,KE,JE,GE]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new yr(i,this)}createCommandManager(){this.commandManager=new yo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Ef(this.options.content,this.schema,this.options.parseOptions),n=xf(e,this.options.autofocus);this.view=new qO(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:dr.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return BE(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return AE(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return TE(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
92
92
 
93
- `,textSerializers:r={}}=e||{};return A_(this.state.doc,{blockSeparator:n,textSerializers:{...xp(this.schema),...r}})}get isEmpty(){return P_(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new kr(n,this)}get $doc(){return this.$pos(0)}};function li(t){return new Ns({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ae(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),d=n.from+a.indexOf(s),u=d+s.length;if(_p(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;u<n.to&&o.delete(u,n.to),d>n.from&&o.delete(n.from+l,d);const h=n.from+l+s.length;o.addMark(n.from+l,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function nN(t){return new Ns({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ae(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,a,l)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a));o.scrollIntoView()}})}function tc(t){return new Ns({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=ae(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function uo(t){return new Ns({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=ae(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),d=l&&cl(l,t.type,o);if(!d)return null;if(s.wrap(l,d),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(y=>p.includes(y.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Rn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class Qt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(q(this,"addOptions",{name:this.name}))),this.storage=ae(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Qt(e)}configure(e={}){const n=this.extend();return n.options=As(this.options,e),n.storage=ae(q(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Qt({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(q(n,"addOptions",{name:n.name})),n.storage=ae(q(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const l=s.find(d=>(d==null?void 0:d.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let mt=class ld{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(q(this,"addOptions",{name:this.name}))),this.storage=ae(q(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ld(e)}configure(e={}){const n=this.extend();return n.options=As(this.options,e),n.storage=ae(q(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new ld({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(q(n,"addOptions",{name:n.name})),n.storage=ae(q(n,"addStorage",{name:n.name,options:n.options})),n}};function ci(t){return new DE({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=ae(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let d=n.to;if(a){const u=l.search(/\S/),f=n.from+l.indexOf(a),h=f+a.length;if(_p(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+a.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var lt="top",Ct="bottom",Mt="right",ct="left",nc="auto",fo=[lt,Ct,Mt,ct],di="start",ho="end",rN="clippingParents",$p="viewport",po="popper",iN="reference",Bp=fo.reduce(function(t,e){return t.concat([e+"-"+di,e+"-"+ho])},[]),Vp=[].concat(fo,[nc]).reduce(function(t,e){return t.concat([e,e+"-"+di,e+"-"+ho])},[]),oN="beforeRead",sN="read",aN="afterRead",lN="beforeMain",cN="main",dN="afterMain",uN="beforeWrite",fN="write",hN="afterWrite",pN=[oN,sN,aN,lN,cN,dN,uN,fN,hN];function en(t){return t?(t.nodeName||"").toLowerCase():null}function gt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function wr(t){var e=gt(t).Element;return t instanceof e||t instanceof Element}function Ot(t){var e=gt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function rc(t){if(typeof ShadowRoot>"u")return!1;var e=gt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function mN(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Ot(o)||!en(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function gN(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,d){return l[d]="",l},{});!Ot(i)||!en(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Pp={name:"applyStyles",enabled:!0,phase:"write",fn:mN,effect:gN,requires:["computeStyles"]};function tn(t){return t.split("-")[0]}var vr=Math.max,Rs=Math.min,ui=Math.round;function ic(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ip(){return!/^((?!chrome|android).)*safari/i.test(ic())}function fi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Ot(t)&&(i=t.offsetWidth>0&&ui(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&ui(r.height)/t.offsetHeight||1);var s=wr(t)?gt(t):window,a=s.visualViewport,l=!Ip()&&n,d=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function oc(t){var e=fi(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Rp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&rc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function bn(t){return gt(t).getComputedStyle(t)}function yN(t){return["table","td","th"].indexOf(en(t))>=0}function Kn(t){return((wr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ls(t){return en(t)==="html"?t:t.assignedSlot||t.parentNode||(rc(t)?t.host:null)||Kn(t)}function Lp(t){return!Ot(t)||bn(t).position==="fixed"?null:t.offsetParent}function bN(t){var e=/firefox/i.test(ic()),n=/Trident/i.test(ic());if(n&&Ot(t)){var r=bn(t);if(r.position==="fixed")return null}var i=Ls(t);for(rc(i)&&(i=i.host);Ot(i)&&["html","body"].indexOf(en(i))<0;){var o=bn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function mo(t){for(var e=gt(t),n=Lp(t);n&&yN(n)&&bn(n).position==="static";)n=Lp(n);return n&&(en(n)==="html"||en(n)==="body"&&bn(n).position==="static")?e:n||bN(t)||e}function sc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function go(t,e,n){return vr(t,Rs(e,n))}function kN(t,e,n){var r=go(t,e,n);return r>n?n:r}function Fp(){return{top:0,right:0,bottom:0,left:0}}function zp(t){return Object.assign({},Fp(),t)}function jp(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var wN=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,zp(typeof e!="number"?e:jp(e,fo))};function vN(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=tn(n.placement),l=sc(a),d=[ct,Mt].indexOf(a)>=0,u=d?"height":"width";if(!(!o||!s)){var f=wN(i.padding,n),h=oc(o),p=l==="y"?lt:ct,m=l==="y"?Ct:Mt,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],y=s[l]-n.rects.reference[l],w=mo(o),v=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,T=g/2-y/2,b=f[p],S=v-h[u]-f[m],k=v/2-h[u]/2+T,C=go(b,k,S),_=l;n.modifiersData[r]=(e={},e[_]=C,e.centerOffset=C-k,e)}}function xN(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Rp(e.elements.popper,i)&&(e.elements.arrow=i))}const SN={name:"arrow",enabled:!0,phase:"main",fn:vN,effect:xN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function hi(t){return t.split("-")[1]}var CN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function MN(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:ui(n*i)/i||0,y:ui(r*i)/i||0}}function Hp(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,f=t.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,g=m===void 0?0:m,y=typeof u=="function"?u({x:p,y:g}):{x:p,y:g};p=y.x,g=y.y;var w=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),T=ct,b=lt,S=window;if(d){var k=mo(n),C="clientHeight",_="clientWidth";if(k===gt(n)&&(k=Kn(n),bn(k).position!=="static"&&a==="absolute"&&(C="scrollHeight",_="scrollWidth")),k=k,i===lt||(i===ct||i===Mt)&&o===ho){b=Ct;var N=f&&k===S&&S.visualViewport?S.visualViewport.height:k[C];g-=N-r.height,g*=l?1:-1}if(i===ct||(i===lt||i===Ct)&&o===ho){T=Mt;var L=f&&k===S&&S.visualViewport?S.visualViewport.width:k[_];p-=L-r.width,p*=l?1:-1}}var Z=Object.assign({position:a},d&&CN),j=u===!0?MN({x:p,y:g},gt(n)):{x:p,y:g};if(p=j.x,g=j.y,l){var A;return Object.assign({},Z,(A={},A[b]=v?"0":"",A[T]=w?"0":"",A.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",A))}return Object.assign({},Z,(e={},e[b]=v?g+"px":"",e[T]=w?p+"px":"",e.transform="",e))}function ON(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,d={placement:tn(e.placement),variation:hi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Hp(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Hp(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const TN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ON,data:{}};var Fs={passive:!0};function EN(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=gt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,Fs)}),a&&l.addEventListener("resize",n.update,Fs),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Fs)}),a&&l.removeEventListener("resize",n.update,Fs)}}const _N={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:EN,data:{}};var NN={left:"right",right:"left",bottom:"top",top:"bottom"};function zs(t){return t.replace(/left|right|bottom|top/g,function(e){return NN[e]})}var DN={start:"end",end:"start"};function Wp(t){return t.replace(/start|end/g,function(e){return DN[e]})}function ac(t){var e=gt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function lc(t){return fi(Kn(t)).left+ac(t).scrollLeft}function AN(t,e){var n=gt(t),r=Kn(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var d=Ip();(d||!d&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+lc(t),y:l}}function $N(t){var e,n=Kn(t),r=ac(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=vr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=vr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+lc(t),l=-r.scrollTop;return bn(i||n).direction==="rtl"&&(a+=vr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function cc(t){var e=bn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Yp(t){return["html","body","#document"].indexOf(en(t))>=0?t.ownerDocument.body:Ot(t)&&cc(t)?t:Yp(Ls(t))}function yo(t,e){var n;e===void 0&&(e=[]);var r=Yp(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=gt(r),s=i?[o].concat(o.visualViewport||[],cc(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(yo(Ls(s)))}function dc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function BN(t,e){var n=fi(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Up(t,e,n){return e===$p?dc(AN(t,n)):wr(e)?BN(e,n):dc($N(Kn(t)))}function VN(t){var e=yo(Ls(t)),n=["absolute","fixed"].indexOf(bn(t).position)>=0,r=n&&Ot(t)?mo(t):t;return wr(r)?e.filter(function(i){return wr(i)&&Rp(i,r)&&en(i)!=="body"}):[]}function PN(t,e,n,r){var i=e==="clippingParents"?VN(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,d){var u=Up(t,d,r);return l.top=vr(u.top,l.top),l.right=Rs(u.right,l.right),l.bottom=Rs(u.bottom,l.bottom),l.left=vr(u.left,l.left),l},Up(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function qp(t){var e=t.reference,n=t.element,r=t.placement,i=r?tn(r):null,o=r?hi(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case lt:l={x:s,y:e.y-n.height};break;case Ct:l={x:s,y:e.y+e.height};break;case Mt:l={x:e.x+e.width,y:a};break;case ct:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var d=i?sc(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case di:l[d]=l[d]-(e[u]/2-n[u]/2);break;case ho:l[d]=l[d]+(e[u]/2-n[u]/2);break}}return l}function bo(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?rN:a,d=n.rootBoundary,u=d===void 0?$p:d,f=n.elementContext,h=f===void 0?po:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,w=zp(typeof y!="number"?y:jp(y,fo)),v=h===po?iN:po,T=t.rects.popper,b=t.elements[m?v:h],S=PN(wr(b)?b:b.contextElement||Kn(t.elements.popper),l,u,s),k=fi(t.elements.reference),C=qp({reference:k,element:T,strategy:"absolute",placement:i}),_=dc(Object.assign({},T,C)),N=h===po?_:k,L={top:S.top-N.top+w.top,bottom:N.bottom-S.bottom+w.bottom,left:S.left-N.left+w.left,right:N.right-S.right+w.right},Z=t.modifiersData.offset;if(h===po&&Z){var j=Z[i];Object.keys(L).forEach(function(A){var I=[Mt,Ct].indexOf(A)>=0?1:-1,F=[lt,Ct].indexOf(A)>=0?"y":"x";L[A]+=j[F]*I})}return L}function IN(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,d=l===void 0?Vp:l,u=hi(r),f=u?a?Bp:Bp.filter(function(m){return hi(m)===u}):fo,h=f.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,g){return m[g]=bo(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[tn(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function RN(t){if(tn(t)===nc)return[];var e=zs(t);return[Wp(t),e,Wp(e)]}function LN(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,d=n.padding,u=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,g=n.allowedAutoPlacements,y=e.options.placement,w=tn(y),v=w===y,T=l||(v||!m?[zs(y)]:RN(y)),b=[y].concat(T).reduce(function(Se,nt){return Se.concat(tn(nt)===nc?IN(e,{placement:nt,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):nt)},[]),S=e.rects.reference,k=e.rects.popper,C=new Map,_=!0,N=b[0],L=0;L<b.length;L++){var Z=b[L],j=tn(Z),A=hi(Z)===di,I=[lt,Ct].indexOf(j)>=0,F=I?"width":"height",R=bo(e,{placement:Z,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),D=I?A?Mt:ct:A?Ct:lt;S[F]>k[F]&&(D=zs(D));var J=zs(D),pe=[];if(o&&pe.push(R[j]<=0),a&&pe.push(R[D]<=0,R[J]<=0),pe.every(function(Se){return Se})){N=Z,_=!1;break}C.set(Z,pe)}if(_)for(var We=m?3:1,Ke=function(nt){var z=b.find(function(ne){var me=C.get(ne);if(me)return me.slice(0,nt).every(function(ce){return ce})});if(z)return N=z,"break"},kt=We;kt>0;kt--){var wt=Ke(kt);if(wt==="break")break}e.placement!==N&&(e.modifiersData[r]._skip=!0,e.placement=N,e.reset=!0)}}const FN={name:"flip",enabled:!0,phase:"main",fn:LN,requiresIfExists:["offset"],data:{_skip:!1}};function Gp(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Kp(t){return[lt,Mt,Ct,ct].some(function(e){return t[e]>=0})}function zN(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=bo(e,{elementContext:"reference"}),a=bo(e,{altBoundary:!0}),l=Gp(s,r),d=Gp(a,i,o),u=Kp(l),f=Kp(d);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const jN={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zN};function HN(t,e,n){var r=tn(t),i=[ct,lt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[ct,Mt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function WN(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Vp.reduce(function(u,f){return u[f]=HN(f,e.rects,o),u},{}),a=s[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const YN={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:WN};function UN(t){var e=t.state,n=t.name;e.modifiersData[n]=qp({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const qN={name:"popperOffsets",enabled:!0,phase:"read",fn:UN,data:{}};function GN(t){return t==="x"?"y":"x"}function KN(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,d=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,g=m===void 0?0:m,y=bo(e,{boundary:l,rootBoundary:d,padding:f,altBoundary:u}),w=tn(e.placement),v=hi(e.placement),T=!v,b=sc(w),S=GN(b),k=e.modifiersData.popperOffsets,C=e.rects.reference,_=e.rects.popper,N=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,L=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),Z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(k){if(o){var A,I=b==="y"?lt:ct,F=b==="y"?Ct:Mt,R=b==="y"?"height":"width",D=k[b],J=D+y[I],pe=D-y[F],We=p?-_[R]/2:0,Ke=v===di?C[R]:_[R],kt=v===di?-_[R]:-C[R],wt=e.elements.arrow,Se=p&&wt?oc(wt):{width:0,height:0},nt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Fp(),z=nt[I],ne=nt[F],me=go(0,C[R],Se[R]),ce=T?C[R]/2-We-me-z-L.mainAxis:Ke-me-z-L.mainAxis,Re=T?-C[R]/2+We+me+ne+L.mainAxis:kt+me+ne+L.mainAxis,Le=e.elements.arrow&&mo(e.elements.arrow),ut=Le?b==="y"?Le.clientTop||0:Le.clientLeft||0:0,Er=(A=Z==null?void 0:Z[b])!=null?A:0,Oi=D+ce-Er-ut,er=D+Re-Er,tr=go(p?Rs(J,Oi):J,D,p?vr(pe,er):pe);k[b]=tr,j[b]=tr-D}if(a){var _n,Wt=b==="x"?lt:ct,Nt=b==="x"?Ct:Mt,Dt=k[S],cn=S==="y"?"height":"width",Nn=Dt+y[Wt],dn=Dt-y[Nt],_r=[lt,ct].indexOf(w)!==-1,nr=(_n=Z==null?void 0:Z[S])!=null?_n:0,Ti=_r?Nn:Dt-C[cn]-_[cn]-nr+L.altAxis,Ei=_r?Dt+C[cn]+_[cn]-nr-L.altAxis:dn,_i=p&&_r?kN(Ti,Dt,Ei):go(p?Ti:Nn,Dt,p?Ei:dn);k[S]=_i,j[S]=_i-Dt}e.modifiersData[r]=j}}const JN={name:"preventOverflow",enabled:!0,phase:"main",fn:KN,requiresIfExists:["offset"]};function ZN(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function XN(t){return t===gt(t)||!Ot(t)?ac(t):ZN(t)}function QN(t){var e=t.getBoundingClientRect(),n=ui(e.width)/t.offsetWidth||1,r=ui(e.height)/t.offsetHeight||1;return n!==1||r!==1}function eD(t,e,n){n===void 0&&(n=!1);var r=Ot(e),i=Ot(e)&&QN(e),o=Kn(e),s=fi(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((en(e)!=="body"||cc(o))&&(a=XN(e)),Ot(e)?(l=fi(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=lc(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function tD(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function nD(t){var e=tD(t);return pN.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function rD(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function iD(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Jp={placement:"bottom",modifiers:[],strategy:"absolute"};function Zp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function oD(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Jp:i;return function(a,l,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jp,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(w){var v=typeof w=="function"?w(u.options):w;g(),u.options=Object.assign({},o,u.options,v),u.scrollParents={reference:wr(a)?yo(a):a.contextElement?yo(a.contextElement):[],popper:yo(l)};var T=nD(iD([].concat(r,u.options.modifiers)));return u.orderedModifiers=T.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var w=u.elements,v=w.reference,T=w.popper;if(Zp(v,T)){u.rects={reference:eD(v,mo(T),u.options.strategy==="fixed"),popper:oc(T)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(L){return u.modifiersData[L.name]=Object.assign({},L.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var S=u.orderedModifiers[b],k=S.fn,C=S.options,_=C===void 0?{}:C,N=S.name;typeof k=="function"&&(u=k({state:u,options:_,name:N,instance:p})||u)}}}},update:rD(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!Zp(a,l))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var w=y.name,v=y.options,T=v===void 0?{}:v,b=y.effect;if(typeof b=="function"){var S=b({state:u,name:w,instance:p,options:T}),k=function(){};f.push(S||k)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var sD=[_N,qN,TN,Pp,YN,FN,JN,SN,jN],aD=oD({defaultModifiers:sD}),lD="tippy-box",Xp="tippy-content",cD="tippy-backdrop",Qp="tippy-arrow",em="tippy-svg-arrow",xr={passive:!0,capture:!0},tm=function(){return document.body};function dD(t,e){return{}.hasOwnProperty.call(t,e)}function uc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function fc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function nm(t,e){return typeof t=="function"?t.apply(void 0,e):t}function rm(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function uD(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function fD(t){return t.split(/\s+/).filter(Boolean)}function pi(t){return[].concat(t)}function im(t,e){t.indexOf(e)===-1&&t.push(e)}function hD(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function pD(t){return t.split("-")[0]}function js(t){return[].slice.call(t)}function om(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ko(){return document.createElement("div")}function wo(t){return["Element","Fragment"].some(function(e){return fc(t,e)})}function mD(t){return fc(t,"NodeList")}function gD(t){return fc(t,"MouseEvent")}function yD(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function bD(t){return wo(t)?[t]:mD(t)?js(t):Array.isArray(t)?t:js(document.querySelectorAll(t))}function hc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function sm(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function kD(t){var e,n=pi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function wD(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,d=pD(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,h=d==="top"?u.bottom.y:0,p=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,g=o.top-r+f>l,y=r-o.bottom-h>l,w=o.left-n+p>l,v=n-o.right-m>l;return g||y||w||v})}function pc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function am(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var nn={isTouch:!1},lm=0;function vD(){nn.isTouch||(nn.isTouch=!0,window.performance&&document.addEventListener("mousemove",cm))}function cm(){var t=performance.now();t-lm<20&&(nn.isTouch=!1,document.removeEventListener("mousemove",cm)),lm=t}function xD(){var t=document.activeElement;if(yD(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function SD(){document.addEventListener("touchstart",vD,xr),window.addEventListener("blur",xD)}var CD=typeof window<"u"&&typeof document<"u",MD=CD?!!window.msCrypto:!1;function mi(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function dm(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function OD(t){return dm(`
93
+ `,textSerializers:r={}}=e||{};return $E(this.state.doc,{blockSeparator:n,textSerializers:{...vf(this.schema),...r}})}get isEmpty(){return DE(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new In(n,this)}get $doc(){return this.$pos(0)}};function br(t){return new ko({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ae(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const a=l.search(/\S/),d=n.from+l.indexOf(s),u=d+s.length;if(Mf(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(y=>y===t.type&&y!==p.mark.type)).filter(p=>p.to>d).length)return null;u<n.to&&o.delete(u,n.to),d>n.from&&o.delete(n.from+a,d);const h=n.from+a+s.length;o.addMark(n.from+a,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function QE(t){return new ko({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ae(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let l=n.to;const a=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>l?u=l:l=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,l,a)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l));o.scrollIntoView()}})}function Ml(t){return new ko({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=ae(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function fi(t){return new ko({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=ae(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),d=a&&As(a,t.type,o);if(!d)return null;if(s.wrap(a,d),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const y=m.filter(g=>p.includes(g.type.name));s.ensureMarks(y)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&nn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class Nt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(J(this,"addOptions",{name:this.name}))),this.storage=ae(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Nt(e)}configure(e={}){const n=this.extend();return n.options=xo(this.options,e),n.storage=ae(J(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Nt({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(J(n,"addOptions",{name:n.name})),n.storage=ae(J(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const a=s.find(d=>(d==null?void 0:d.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let tt=class ta{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(J(this,"addOptions",{name:this.name}))),this.storage=ae(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ta(e)}configure(e={}){const n=this.extend();return n.options=xo(this.options,e),n.storage=ae(J(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new ta({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(J(n,"addOptions",{name:n.name})),n.storage=ae(J(n,"addStorage",{name:n.name,options:n.options})),n}};function kr(t){return new T2({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=ae(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],a=r[0];let d=n.to;if(l){const u=a.search(/\S/),f=n.from+a.indexOf(l),h=f+l.length;if(Mf(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===t.type&&g!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+l.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var Ye="top",at="bottom",ct="right",Ze="left",Tl="auto",hi=[Ye,at,ct,Ze],vr="start",pi="end",eM="clippingParents",Bf="viewport",mi="popper",tM="reference",Af=hi.reduce(function(t,e){return t.concat([e+"-"+vr,e+"-"+pi])},[]),Df=[].concat(hi,[Tl]).reduce(function(t,e){return t.concat([e,e+"-"+vr,e+"-"+pi])},[]),nM="beforeRead",rM="read",iM="afterRead",oM="beforeMain",sM="main",lM="afterMain",aM="beforeWrite",cM="write",dM="afterWrite",uM=[nM,rM,iM,oM,sM,lM,aM,cM,dM];function Bt(t){return t?(t.nodeName||"").toLowerCase():null}function nt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Pn(t){var e=nt(t).Element;return t instanceof e||t instanceof Element}function dt(t){var e=nt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function $l(t){if(typeof ShadowRoot>"u")return!1;var e=nt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function fM(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!dt(o)||!Bt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function hM(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(a,d){return a[d]="",a},{});!dt(i)||!Bt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}const Vf={name:"applyStyles",enabled:!0,phase:"write",fn:fM,effect:hM,requires:["computeStyles"]};function At(t){return t.split("-")[0]}var Rn=Math.max,Mo=Math.min,xr=Math.round;function Nl(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _f(){return!/^((?!chrome|android).)*safari/i.test(Nl())}function wr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&dt(t)&&(i=t.offsetWidth>0&&xr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&xr(r.height)/t.offsetHeight||1);var s=Pn(t)?nt(t):window,l=s.visualViewport,a=!_f()&&n,d=(r.left+(a&&l?l.offsetLeft:0))/i,u=(r.top+(a&&l?l.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function Bl(t){var e=wr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function If(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&$l(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function qt(t){return nt(t).getComputedStyle(t)}function pM(t){return["table","td","th"].indexOf(Bt(t))>=0}function pn(t){return((Pn(t)?t.ownerDocument:t.document)||window.document).documentElement}function To(t){return Bt(t)==="html"?t:t.assignedSlot||t.parentNode||($l(t)?t.host:null)||pn(t)}function Pf(t){return!dt(t)||qt(t).position==="fixed"?null:t.offsetParent}function mM(t){var e=/firefox/i.test(Nl()),n=/Trident/i.test(Nl());if(n&&dt(t)){var r=qt(t);if(r.position==="fixed")return null}var i=To(t);for($l(i)&&(i=i.host);dt(i)&&["html","body"].indexOf(Bt(i))<0;){var o=qt(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function gi(t){for(var e=nt(t),n=Pf(t);n&&pM(n)&&qt(n).position==="static";)n=Pf(n);return n&&(Bt(n)==="html"||Bt(n)==="body"&&qt(n).position==="static")?e:n||mM(t)||e}function Al(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function yi(t,e,n){return Rn(t,Mo(e,n))}function gM(t,e,n){var r=yi(t,e,n);return r>n?n:r}function Rf(){return{top:0,right:0,bottom:0,left:0}}function Lf(t){return Object.assign({},Rf(),t)}function zf(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var yM=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Lf(typeof e!="number"?e:zf(e,hi))};function bM(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=At(n.placement),a=Al(l),d=[Ze,ct].indexOf(l)>=0,u=d?"height":"width";if(!(!o||!s)){var f=yM(i.padding,n),h=Bl(o),p=a==="y"?Ye:Ze,m=a==="y"?at:ct,y=n.rects.reference[u]+n.rects.reference[a]-s[a]-n.rects.popper[u],g=s[a]-n.rects.reference[a],v=gi(o),x=v?a==="y"?v.clientHeight||0:v.clientWidth||0:0,T=y/2-g/2,b=f[p],S=x-h[u]-f[m],k=x/2-h[u]/2+T,C=yi(b,k,S),D=a;n.modifiersData[r]=(e={},e[D]=C,e.centerOffset=C-k,e)}}function kM(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||If(e.elements.popper,i)&&(e.elements.arrow=i))}const vM={name:"arrow",enabled:!0,phase:"main",fn:bM,effect:kM,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(t){return t.split("-")[1]}var xM={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wM(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:xr(n*i)/i||0,y:xr(r*i)/i||0}}function Ff(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,a=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,f=t.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,y=m===void 0?0:m,g=typeof u=="function"?u({x:p,y}):{x:p,y};p=g.x,y=g.y;var v=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),T=Ze,b=Ye,S=window;if(d){var k=gi(n),C="clientHeight",D="clientWidth";if(k===nt(n)&&(k=pn(n),qt(k).position!=="static"&&l==="absolute"&&(C="scrollHeight",D="scrollWidth")),k=k,i===Ye||(i===Ze||i===ct)&&o===pi){b=at;var A=f&&k===S&&S.visualViewport?S.visualViewport.height:k[C];y-=A-r.height,y*=a?1:-1}if(i===Ze||(i===Ye||i===at)&&o===pi){T=ct;var R=f&&k===S&&S.visualViewport?S.visualViewport.width:k[D];p-=R-r.width,p*=a?1:-1}}var F=Object.assign({position:l},d&&xM),j=u===!0?wM({x:p,y},nt(n)):{x:p,y};if(p=j.x,y=j.y,a){var _;return Object.assign({},F,(_={},_[b]=x?"0":"",_[T]=v?"0":"",_.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+y+"px)":"translate3d("+p+"px, "+y+"px, 0)",_))}return Object.assign({},F,(e={},e[b]=x?y+"px":"",e[T]=v?p+"px":"",e.transform="",e))}function SM(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,a=l===void 0?!0:l,d={placement:At(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ff(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ff(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const CM={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:SM,data:{}};var $o={passive:!0};function OM(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,a=nt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,$o)}),l&&a.addEventListener("resize",n.update,$o),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,$o)}),l&&a.removeEventListener("resize",n.update,$o)}}const EM={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:OM,data:{}};var MM={left:"right",right:"left",bottom:"top",top:"bottom"};function No(t){return t.replace(/left|right|bottom|top/g,function(e){return MM[e]})}var TM={start:"end",end:"start"};function jf(t){return t.replace(/start|end/g,function(e){return TM[e]})}function Dl(t){var e=nt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Vl(t){return wr(pn(t)).left+Dl(t).scrollLeft}function $M(t,e){var n=nt(t),r=pn(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;var d=_f();(d||!d&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l+Vl(t),y:a}}function NM(t){var e,n=pn(t),r=Dl(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Rn(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Rn(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Vl(t),a=-r.scrollTop;return qt(i||n).direction==="rtl"&&(l+=Rn(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:a}}function _l(t){var e=qt(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Hf(t){return["html","body","#document"].indexOf(Bt(t))>=0?t.ownerDocument.body:dt(t)&&_l(t)?t:Hf(To(t))}function bi(t,e){var n;e===void 0&&(e=[]);var r=Hf(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=nt(r),s=i?[o].concat(o.visualViewport||[],_l(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(bi(To(s)))}function Il(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function BM(t,e){var n=wr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Wf(t,e,n){return e===Bf?Il($M(t,n)):Pn(e)?BM(e,n):Il(NM(pn(t)))}function AM(t){var e=bi(To(t)),n=["absolute","fixed"].indexOf(qt(t).position)>=0,r=n&&dt(t)?gi(t):t;return Pn(r)?e.filter(function(i){return Pn(i)&&If(i,r)&&Bt(i)!=="body"}):[]}function DM(t,e,n,r){var i=e==="clippingParents"?AM(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(a,d){var u=Wf(t,d,r);return a.top=Rn(u.top,a.top),a.right=Mo(u.right,a.right),a.bottom=Mo(u.bottom,a.bottom),a.left=Rn(u.left,a.left),a},Wf(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function qf(t){var e=t.reference,n=t.element,r=t.placement,i=r?At(r):null,o=r?Sr(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,a;switch(i){case Ye:a={x:s,y:e.y-n.height};break;case at:a={x:s,y:e.y+e.height};break;case ct:a={x:e.x+e.width,y:l};break;case Ze:a={x:e.x-n.width,y:l};break;default:a={x:e.x,y:e.y}}var d=i?Al(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case vr:a[d]=a[d]-(e[u]/2-n[u]/2);break;case pi:a[d]=a[d]+(e[u]/2-n[u]/2);break}}return a}function ki(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,a=l===void 0?eM:l,d=n.rootBoundary,u=d===void 0?Bf:d,f=n.elementContext,h=f===void 0?mi:f,p=n.altBoundary,m=p===void 0?!1:p,y=n.padding,g=y===void 0?0:y,v=Lf(typeof g!="number"?g:zf(g,hi)),x=h===mi?tM:mi,T=t.rects.popper,b=t.elements[m?x:h],S=DM(Pn(b)?b:b.contextElement||pn(t.elements.popper),a,u,s),k=wr(t.elements.reference),C=qf({reference:k,element:T,placement:i}),D=Il(Object.assign({},T,C)),A=h===mi?D:k,R={top:S.top-A.top+v.top,bottom:A.bottom-S.bottom+v.bottom,left:S.left-A.left+v.left,right:A.right-S.right+v.right},F=t.modifiersData.offset;if(h===mi&&F){var j=F[i];Object.keys(R).forEach(function(_){var B=[ct,at].indexOf(_)>=0?1:-1,N=[Ye,at].indexOf(_)>=0?"y":"x";R[_]+=j[N]*B})}return R}function VM(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,a=n.allowedAutoPlacements,d=a===void 0?Df:a,u=Sr(r),f=u?l?Af:Af.filter(function(m){return Sr(m)===u}):hi,h=f.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,y){return m[y]=ki(t,{placement:y,boundary:i,rootBoundary:o,padding:s})[At(y)],m},{});return Object.keys(p).sort(function(m,y){return p[m]-p[y]})}function _M(t){if(At(t)===Tl)return[];var e=No(t);return[jf(t),e,jf(e)]}function IM(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,a=n.fallbackPlacements,d=n.padding,u=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,y=n.allowedAutoPlacements,g=e.options.placement,v=At(g),x=v===g,T=a||(x||!m?[No(g)]:_M(g)),b=[g].concat(T).reduce(function(oe,ye){return oe.concat(At(ye)===Tl?VM(e,{placement:ye,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:y}):ye)},[]),S=e.rects.reference,k=e.rects.popper,C=new Map,D=!0,A=b[0],R=0;R<b.length;R++){var F=b[R],j=At(F),_=Sr(F)===vr,B=[Ye,at].indexOf(j)>=0,N=B?"width":"height",$=ki(e,{placement:F,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),O=B?_?ct:Ze:_?at:Ye;S[N]>k[N]&&(O=No(O));var V=No(O),H=[];if(o&&H.push($[j]<=0),l&&H.push($[O]<=0,$[V]<=0),H.every(function(oe){return oe})){A=F,D=!1;break}C.set(F,H)}if(D)for(var G=m?3:1,ie=function(ye){var z=b.find(function(Z){var ue=C.get(Z);if(ue)return ue.slice(0,ye).every(function(re){return re})});if(z)return A=z,"break"},de=G;de>0;de--){var he=ie(de);if(he==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const PM={name:"flip",enabled:!0,phase:"main",fn:IM,requiresIfExists:["offset"],data:{_skip:!1}};function Uf(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Kf(t){return[Ye,ct,at,Ze].some(function(e){return t[e]>=0})}function RM(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ki(e,{elementContext:"reference"}),l=ki(e,{altBoundary:!0}),a=Uf(s,r),d=Uf(l,i,o),u=Kf(a),f=Kf(d);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const LM={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:RM};function zM(t,e,n){var r=At(t),i=[Ze,Ye].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[Ze,ct].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function FM(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Df.reduce(function(u,f){return u[f]=zM(f,e.rects,o),u},{}),l=s[e.placement],a=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const jM={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:FM};function HM(t){var e=t.state,n=t.name;e.modifiersData[n]=qf({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const WM={name:"popperOffsets",enabled:!0,phase:"read",fn:HM,data:{}};function qM(t){return t==="x"?"y":"x"}function UM(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,a=n.boundary,d=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,y=m===void 0?0:m,g=ki(e,{boundary:a,rootBoundary:d,padding:f,altBoundary:u}),v=At(e.placement),x=Sr(e.placement),T=!x,b=Al(v),S=qM(b),k=e.modifiersData.popperOffsets,C=e.rects.reference,D=e.rects.popper,A=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,R=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,j={x:0,y:0};if(k){if(o){var _,B=b==="y"?Ye:Ze,N=b==="y"?at:ct,$=b==="y"?"height":"width",O=k[b],V=O+g[B],H=O-g[N],G=p?-D[$]/2:0,ie=x===vr?C[$]:D[$],de=x===vr?-D[$]:-C[$],he=e.elements.arrow,oe=p&&he?Bl(he):{width:0,height:0},ye=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Rf(),z=ye[B],Z=ye[N],ue=yi(0,C[$],oe[$]),re=T?C[$]/2-G-ue-z-R.mainAxis:ie-ue-z-R.mainAxis,fe=T?-C[$]/2+G+ue+Z+R.mainAxis:de+ue+Z+R.mainAxis,be=e.elements.arrow&&gi(e.elements.arrow),Oe=be?b==="y"?be.clientTop||0:be.clientLeft||0:0,ut=(_=F==null?void 0:F[b])!=null?_:0,Mr=O+re-ut-Oe,gn=O+fe-ut,yn=yi(p?Mo(V,Mr):V,O,p?Rn(H,gn):H);k[b]=yn,j[b]=yn-O}if(l){var Kt,xt=b==="x"?Ye:Ze,ft=b==="x"?at:ct,ht=k[S],_t=S==="y"?"height":"width",Jt=ht+g[xt],It=ht-g[ft],Fn=[Ye,Ze].indexOf(v)!==-1,bn=(Kt=F==null?void 0:F[S])!=null?Kt:0,Tr=Fn?Jt:ht-C[_t]-D[_t]-bn+R.altAxis,$r=Fn?ht+C[_t]+D[_t]-bn-R.altAxis:It,Nr=p&&Fn?gM(Tr,ht,$r):yi(p?Tr:Jt,ht,p?$r:It);k[S]=Nr,j[S]=Nr-ht}e.modifiersData[r]=j}}const KM={name:"preventOverflow",enabled:!0,phase:"main",fn:UM,requiresIfExists:["offset"]};function JM(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function GM(t){return t===nt(t)||!dt(t)?Dl(t):JM(t)}function YM(t){var e=t.getBoundingClientRect(),n=xr(e.width)/t.offsetWidth||1,r=xr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function ZM(t,e,n){n===void 0&&(n=!1);var r=dt(e),i=dt(e)&&YM(e),o=pn(e),s=wr(t,i,n),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((Bt(e)!=="body"||_l(o))&&(l=GM(e)),dt(e)?(a=wr(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=Vl(o))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function XM(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var a=e.get(l);a&&i(a)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function QM(t){var e=XM(t);return uM.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function eT(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function tT(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Jf={placement:"bottom",modifiers:[],strategy:"absolute"};function Gf(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function nT(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Jf:i;return function(l,a,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jf,o),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(v){var x=typeof v=="function"?v(u.options):v;y(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:Pn(l)?bi(l):l.contextElement?bi(l.contextElement):[],popper:bi(a)};var T=QM(tT([].concat(r,u.options.modifiers)));return u.orderedModifiers=T.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var v=u.elements,x=v.reference,T=v.popper;if(Gf(x,T)){u.rects={reference:ZM(x,gi(T),u.options.strategy==="fixed"),popper:Bl(T)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(R){return u.modifiersData[R.name]=Object.assign({},R.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var S=u.orderedModifiers[b],k=S.fn,C=S.options,D=C===void 0?{}:C,A=S.name;typeof k=="function"&&(u=k({state:u,options:D,name:A,instance:p})||u)}}}},update:eT(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){y(),h=!0}};if(!Gf(l,a))return p;p.setOptions(d).then(function(g){!h&&d.onFirstUpdate&&d.onFirstUpdate(g)});function m(){u.orderedModifiers.forEach(function(g){var v=g.name,x=g.options,T=x===void 0?{}:x,b=g.effect;if(typeof b=="function"){var S=b({state:u,name:v,instance:p,options:T}),k=function(){};f.push(S||k)}})}function y(){f.forEach(function(g){return g()}),f=[]}return p}}var rT=[EM,WM,CM,Vf,jM,PM,KM,vM,LM],iT=nT({defaultModifiers:rT}),oT="tippy-box",Yf="tippy-content",sT="tippy-backdrop",Zf="tippy-arrow",Xf="tippy-svg-arrow",Ln={passive:!0,capture:!0},Qf=function(){return document.body};function lT(t,e){return{}.hasOwnProperty.call(t,e)}function Pl(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Rl(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function eh(t,e){return typeof t=="function"?t.apply(void 0,e):t}function th(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function aT(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function cT(t){return t.split(/\s+/).filter(Boolean)}function Cr(t){return[].concat(t)}function nh(t,e){t.indexOf(e)===-1&&t.push(e)}function dT(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function uT(t){return t.split("-")[0]}function Bo(t){return[].slice.call(t)}function rh(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function vi(){return document.createElement("div")}function xi(t){return["Element","Fragment"].some(function(e){return Rl(t,e)})}function fT(t){return Rl(t,"NodeList")}function hT(t){return Rl(t,"MouseEvent")}function pT(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function mT(t){return xi(t)?[t]:fT(t)?Bo(t):Array.isArray(t)?t:Bo(document.querySelectorAll(t))}function Ll(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function ih(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function gT(t){var e,n=Cr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function yT(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,a=l.interactiveBorder,d=uT(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,h=d==="top"?u.bottom.y:0,p=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,y=o.top-r+f>a,g=r-o.bottom-h>a,v=o.left-n+p>a,x=n-o.right-m>a;return y||g||v||x})}function zl(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function oh(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Dt={isTouch:!1},sh=0;function bT(){Dt.isTouch||(Dt.isTouch=!0,window.performance&&document.addEventListener("mousemove",lh))}function lh(){var t=performance.now();t-sh<20&&(Dt.isTouch=!1,document.removeEventListener("mousemove",lh)),sh=t}function kT(){var t=document.activeElement;if(pT(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function vT(){document.addEventListener("touchstart",bT,Ln),window.addEventListener("blur",kT)}var xT=typeof window<"u"&&typeof document<"u",wT=xT?!!window.msCrypto:!1;function Or(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function ah(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function ST(t){return ah(`
94
94
  %ctippy.js
95
95
 
96
- %c`+dm(t)+`
96
+ %c`+ah(t)+`
97
97
 
98
98
  %c👷‍ This is a development-only message. It will be removed in production.
99
- `)}function um(t){return[OD(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var vo;process.env.NODE_ENV!=="production"&&TD();function TD(){vo=new Set}function kn(t,e){if(t&&!vo.has(e)){var n;vo.add(e),(n=console).warn.apply(n,um(e))}}function mc(t,e){if(t&&!vo.has(e)){var n;vo.add(e),(n=console).error.apply(n,um(e))}}function ED(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;mc(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),mc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var fm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},_D={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},yt=Object.assign({appendTo:tm,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},fm,_D),ND=Object.keys(yt),DD=function(e){process.env.NODE_ENV!=="production"&&mm(e,[]);var n=Object.keys(e);n.forEach(function(r){yt[r]=e[r]})};function hm(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=yt[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function AD(t,e){var n=e?Object.keys(hm(Object.assign({},yt,{plugins:e}))):ND,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function pm(t,e){var n=Object.assign({},e,{content:nm(e.content,[t])},e.ignoreAttributes?{}:AD(t,e.plugins));return n.aria=Object.assign({},yt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function mm(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=uD(yt,Object.keys(fm)),o=!dD(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),kn(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
99
+ `)}function ch(t){return[ST(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var wi;process.env.NODE_ENV!=="production"&&CT();function CT(){wi=new Set}function Ut(t,e){if(t&&!wi.has(e)){var n;wi.add(e),(n=console).warn.apply(n,ch(e))}}function Fl(t,e){if(t&&!wi.has(e)){var n;wi.add(e),(n=console).error.apply(n,ch(e))}}function OT(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Fl(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Fl(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var dh={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},ET={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},rt=Object.assign({appendTo:Qf,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},dh,ET),MT=Object.keys(rt),TT=function(e){process.env.NODE_ENV!=="production"&&hh(e,[]);var n=Object.keys(e);n.forEach(function(r){rt[r]=e[r]})};function uh(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=rt[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function $T(t,e){var n=e?Object.keys(uh(Object.assign({},rt,{plugins:e}))):MT,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function fh(t,e){var n=Object.assign({},e,{content:eh(e.content,[t])},e.ignoreAttributes?{}:$T(t,e.plugins));return n.aria=Object.assign({},rt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function hh(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=aT(rt,Object.keys(dh)),o=!lT(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),Ut(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
100
100
 
101
101
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
102
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var $D=function(){return"innerHTML"};function gc(t,e){t[$D()]=e}function gm(t){var e=ko();return t===!0?e.className=Qp:(e.className=em,wo(t)?e.appendChild(t):gc(e,t)),e}function ym(t,e){wo(e.content)?(gc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?gc(t,e.content):t.textContent=e.content)}function yc(t){var e=t.firstElementChild,n=js(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Xp)}),arrow:n.find(function(r){return r.classList.contains(Qp)||r.classList.contains(em)}),backdrop:n.find(function(r){return r.classList.contains(cD)})}}function bm(t){var e=ko(),n=ko();n.className=lD,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ko();r.className=Xp,r.setAttribute("data-state","hidden"),ym(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=yc(e),l=a.box,d=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&ym(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(gm(s.arrow))):l.appendChild(gm(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:i}}bm.$$tippy=!0;var BD=1,Hs=[],bc=[];function VD(t,e){var n=pm(t,Object.assign({},yt,hm(om(e)))),r,i,o,s=!1,a=!1,l=!1,d=!1,u,f,h,p=[],m=rm(Oi,n.interactiveDebounce),g,y=BD++,w=null,v=hD(n.plugins),T={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:y,reference:t,popper:ko(),popperInstance:w,props:n,state:T,plugins:v,clearDelayTimeouts:Ti,setProps:Ei,setContent:_i,show:O,hide:M,hideWithInteractivity:$,enable:_r,disable:nr,unmount:W,destroy:ee};if(!n.render)return process.env.NODE_ENV!=="production"&&mc(!0,"render() function has not been supplied."),b;var S=n.render(b),k=S.popper,C=S.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+b.id,b.popper=k,t._tippy=b,k._tippy=b;var _=v.map(function(x){return x.fn(b)}),N=t.hasAttribute("aria-expanded");return Le(),We(),D(),J("onCreate",[b]),n.showOnCreate&&Nn(),k.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&I().addEventListener("mousemove",m)}),b;function L(){var x=b.props.touch;return Array.isArray(x)?x:[x,0]}function Z(){return L()[0]==="hold"}function j(){var x;return!!((x=b.props.render)!=null&&x.$$tippy)}function A(){return g||t}function I(){var x=A().parentNode;return x?kD(x):document}function F(){return yc(k)}function R(x){return b.state.isMounted&&!b.state.isVisible||nn.isTouch||u&&u.type==="focus"?0:uc(b.props.delay,x?0:1,yt.delay)}function D(x){x===void 0&&(x=!1),k.style.pointerEvents=b.props.interactive&&!x?"":"none",k.style.zIndex=""+b.props.zIndex}function J(x,V,Y){if(Y===void 0&&(Y=!0),_.forEach(function(te){te[x]&&te[x].apply(te,V)}),Y){var X;(X=b.props)[x].apply(X,V)}}function pe(){var x=b.props.aria;if(x.content){var V="aria-"+x.content,Y=k.id,X=pi(b.props.triggerTarget||t);X.forEach(function(te){var oe=te.getAttribute(V);if(b.state.isVisible)te.setAttribute(V,oe?oe+" "+Y:Y);else{var ge=oe&&oe.replace(Y,"").trim();ge?te.setAttribute(V,ge):te.removeAttribute(V)}})}}function We(){if(!(N||!b.props.aria.expanded)){var x=pi(b.props.triggerTarget||t);x.forEach(function(V){b.props.interactive?V.setAttribute("aria-expanded",b.state.isVisible&&V===A()?"true":"false"):V.removeAttribute("aria-expanded")})}}function Ke(){I().removeEventListener("mousemove",m),Hs=Hs.filter(function(x){return x!==m})}function kt(x){if(!(nn.isTouch&&(l||x.type==="mousedown"))){var V=x.composedPath&&x.composedPath()[0]||x.target;if(!(b.props.interactive&&am(k,V))){if(pi(b.props.triggerTarget||t).some(function(Y){return am(Y,V)})){if(nn.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else J("onClickOutside",[b,x]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||z())}}}function wt(){l=!0}function Se(){l=!1}function nt(){var x=I();x.addEventListener("mousedown",kt,!0),x.addEventListener("touchend",kt,xr),x.addEventListener("touchstart",Se,xr),x.addEventListener("touchmove",wt,xr)}function z(){var x=I();x.removeEventListener("mousedown",kt,!0),x.removeEventListener("touchend",kt,xr),x.removeEventListener("touchstart",Se,xr),x.removeEventListener("touchmove",wt,xr)}function ne(x,V){ce(x,function(){!b.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&V()})}function me(x,V){ce(x,V)}function ce(x,V){var Y=F().box;function X(te){te.target===Y&&(pc(Y,"remove",X),V())}if(x===0)return V();pc(Y,"remove",f),pc(Y,"add",X),f=X}function Re(x,V,Y){Y===void 0&&(Y=!1);var X=pi(b.props.triggerTarget||t);X.forEach(function(te){te.addEventListener(x,V,Y),p.push({node:te,eventType:x,handler:V,options:Y})})}function Le(){Z()&&(Re("touchstart",Er,{passive:!0}),Re("touchend",er,{passive:!0})),fD(b.props.trigger).forEach(function(x){if(x!=="manual")switch(Re(x,Er),x){case"mouseenter":Re("mouseleave",er);break;case"focus":Re(MD?"focusout":"blur",tr);break;case"focusin":Re("focusout",tr);break}})}function ut(){p.forEach(function(x){var V=x.node,Y=x.eventType,X=x.handler,te=x.options;V.removeEventListener(Y,X,te)}),p=[]}function Er(x){var V,Y=!1;if(!(!b.state.isEnabled||_n(x)||a)){var X=((V=u)==null?void 0:V.type)==="focus";u=x,g=x.currentTarget,We(),!b.state.isVisible&&gD(x)&&Hs.forEach(function(te){return te(x)}),x.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?Y=!0:Nn(x),x.type==="click"&&(s=!Y),Y&&!X&&dn(x)}}function Oi(x){var V=x.target,Y=A().contains(V)||k.contains(V);if(!(x.type==="mousemove"&&Y)){var X=cn().concat(k).map(function(te){var oe,ge=te._tippy,Te=(oe=ge.popperInstance)==null?void 0:oe.state;return Te?{popperRect:te.getBoundingClientRect(),popperState:Te,props:n}:null}).filter(Boolean);wD(X,x)&&(Ke(),dn(x))}}function er(x){var V=_n(x)||b.props.trigger.indexOf("click")>=0&&s;if(!V){if(b.props.interactive){b.hideWithInteractivity(x);return}dn(x)}}function tr(x){b.props.trigger.indexOf("focusin")<0&&x.target!==A()||b.props.interactive&&x.relatedTarget&&k.contains(x.relatedTarget)||dn(x)}function _n(x){return nn.isTouch?Z()!==x.type.indexOf("touch")>=0:!1}function Wt(){Nt();var x=b.props,V=x.popperOptions,Y=x.placement,X=x.offset,te=x.getReferenceClientRect,oe=x.moveTransition,ge=j()?yc(k).arrow:null,Te=te?{getBoundingClientRect:te,contextElement:te.contextElement||A()}:t,rt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(rr){var un=rr.state;if(j()){var $o=F(),od=$o.box;["placement","reference-hidden","escaped"].forEach(function(pa){pa==="placement"?od.setAttribute("data-placement",un.placement):un.attributes.popper["data-popper-"+pa]?od.setAttribute("data-"+pa,""):od.removeAttribute("data-"+pa)}),un.attributes.popper={}}}},vt=[{name:"offset",options:{offset:X}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!oe}},rt];j()&&ge&&vt.push({name:"arrow",options:{element:ge,padding:3}}),vt.push.apply(vt,(V==null?void 0:V.modifiers)||[]),b.popperInstance=aD(Te,k,Object.assign({},V,{placement:Y,onFirstUpdate:h,modifiers:vt}))}function Nt(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Dt(){var x=b.props.appendTo,V,Y=A();b.props.interactive&&x===tm||x==="parent"?V=Y.parentNode:V=nm(x,[Y]),V.contains(k)||V.appendChild(k),b.state.isMounted=!0,Wt(),process.env.NODE_ENV!=="production"&&kn(b.props.interactive&&x===yt.appendTo&&Y.nextElementSibling!==k,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
102
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var NT=function(){return"innerHTML"};function jl(t,e){t[NT()]=e}function ph(t){var e=vi();return t===!0?e.className=Zf:(e.className=Xf,xi(t)?e.appendChild(t):jl(e,t)),e}function mh(t,e){xi(e.content)?(jl(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?jl(t,e.content):t.textContent=e.content)}function Hl(t){var e=t.firstElementChild,n=Bo(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Yf)}),arrow:n.find(function(r){return r.classList.contains(Zf)||r.classList.contains(Xf)}),backdrop:n.find(function(r){return r.classList.contains(sT)})}}function gh(t){var e=vi(),n=vi();n.className=oT,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=vi();r.className=Yf,r.setAttribute("data-state","hidden"),mh(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Hl(e),a=l.box,d=l.content,u=l.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&mh(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(a.removeChild(u),a.appendChild(ph(s.arrow))):a.appendChild(ph(s.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:i}}gh.$$tippy=!0;var BT=1,Ao=[],Wl=[];function AT(t,e){var n=fh(t,Object.assign({},rt,uh(rh(e)))),r,i,o,s=!1,l=!1,a=!1,d=!1,u,f,h,p=[],m=th(Mr,n.interactiveDebounce),y,g=BT++,v=null,x=dT(n.plugins),T={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:g,reference:t,popper:vi(),popperInstance:v,props:n,state:T,plugins:x,clearDelayTimeouts:Tr,setProps:$r,setContent:Nr,show:M,hide:E,hideWithInteractivity:I,enable:Fn,disable:bn,unmount:q,destroy:Q};if(!n.render)return process.env.NODE_ENV!=="production"&&Fl(!0,"render() function has not been supplied."),b;var S=n.render(b),k=S.popper,C=S.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+b.id,b.popper=k,t._tippy=b,k._tippy=b;var D=x.map(function(w){return w.fn(b)}),A=t.hasAttribute("aria-expanded");return be(),G(),O(),V("onCreate",[b]),n.showOnCreate&&Jt(),k.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&B().addEventListener("mousemove",m)}),b;function R(){var w=b.props.touch;return Array.isArray(w)?w:[w,0]}function F(){return R()[0]==="hold"}function j(){var w;return!!((w=b.props.render)!=null&&w.$$tippy)}function _(){return y||t}function B(){var w=_().parentNode;return w?gT(w):document}function N(){return Hl(k)}function $(w){return b.state.isMounted&&!b.state.isVisible||Dt.isTouch||u&&u.type==="focus"?0:Pl(b.props.delay,w?0:1,rt.delay)}function O(w){w===void 0&&(w=!1),k.style.pointerEvents=b.props.interactive&&!w?"":"none",k.style.zIndex=""+b.props.zIndex}function V(w,L,U){if(U===void 0&&(U=!0),D.forEach(function(ee){ee[w]&&ee[w].apply(ee,L)}),U){var X;(X=b.props)[w].apply(X,L)}}function H(){var w=b.props.aria;if(w.content){var L="aria-"+w.content,U=k.id,X=Cr(b.props.triggerTarget||t);X.forEach(function(ee){var se=ee.getAttribute(L);if(b.state.isVisible)ee.setAttribute(L,se?se+" "+U:U);else{var pe=se&&se.replace(U,"").trim();pe?ee.setAttribute(L,pe):ee.removeAttribute(L)}})}}function G(){if(!(A||!b.props.aria.expanded)){var w=Cr(b.props.triggerTarget||t);w.forEach(function(L){b.props.interactive?L.setAttribute("aria-expanded",b.state.isVisible&&L===_()?"true":"false"):L.removeAttribute("aria-expanded")})}}function ie(){B().removeEventListener("mousemove",m),Ao=Ao.filter(function(w){return w!==m})}function de(w){if(!(Dt.isTouch&&(a||w.type==="mousedown"))){var L=w.composedPath&&w.composedPath()[0]||w.target;if(!(b.props.interactive&&oh(k,L))){if(Cr(b.props.triggerTarget||t).some(function(U){return oh(U,L)})){if(Dt.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else V("onClickOutside",[b,w]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout(function(){l=!1}),b.state.isMounted||z())}}}function he(){a=!0}function oe(){a=!1}function ye(){var w=B();w.addEventListener("mousedown",de,!0),w.addEventListener("touchend",de,Ln),w.addEventListener("touchstart",oe,Ln),w.addEventListener("touchmove",he,Ln)}function z(){var w=B();w.removeEventListener("mousedown",de,!0),w.removeEventListener("touchend",de,Ln),w.removeEventListener("touchstart",oe,Ln),w.removeEventListener("touchmove",he,Ln)}function Z(w,L){re(w,function(){!b.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&L()})}function ue(w,L){re(w,L)}function re(w,L){var U=N().box;function X(ee){ee.target===U&&(zl(U,"remove",X),L())}if(w===0)return L();zl(U,"remove",f),zl(U,"add",X),f=X}function fe(w,L,U){U===void 0&&(U=!1);var X=Cr(b.props.triggerTarget||t);X.forEach(function(ee){ee.addEventListener(w,L,U),p.push({node:ee,eventType:w,handler:L,options:U})})}function be(){F()&&(fe("touchstart",ut,{passive:!0}),fe("touchend",gn,{passive:!0})),cT(b.props.trigger).forEach(function(w){if(w!=="manual")switch(fe(w,ut),w){case"mouseenter":fe("mouseleave",gn);break;case"focus":fe(wT?"focusout":"blur",yn);break;case"focusin":fe("focusout",yn);break}})}function Oe(){p.forEach(function(w){var L=w.node,U=w.eventType,X=w.handler,ee=w.options;L.removeEventListener(U,X,ee)}),p=[]}function ut(w){var L,U=!1;if(!(!b.state.isEnabled||Kt(w)||l)){var X=((L=u)==null?void 0:L.type)==="focus";u=w,y=w.currentTarget,G(),!b.state.isVisible&&hT(w)&&Ao.forEach(function(ee){return ee(w)}),w.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?U=!0:Jt(w),w.type==="click"&&(s=!U),U&&!X&&It(w)}}function Mr(w){var L=w.target,U=_().contains(L)||k.contains(L);if(!(w.type==="mousemove"&&U)){var X=_t().concat(k).map(function(ee){var se,pe=ee._tippy,xe=(se=pe.popperInstance)==null?void 0:se.state;return xe?{popperRect:ee.getBoundingClientRect(),popperState:xe,props:n}:null}).filter(Boolean);yT(X,w)&&(ie(),It(w))}}function gn(w){var L=Kt(w)||b.props.trigger.indexOf("click")>=0&&s;if(!L){if(b.props.interactive){b.hideWithInteractivity(w);return}It(w)}}function yn(w){b.props.trigger.indexOf("focusin")<0&&w.target!==_()||b.props.interactive&&w.relatedTarget&&k.contains(w.relatedTarget)||It(w)}function Kt(w){return Dt.isTouch?F()!==w.type.indexOf("touch")>=0:!1}function xt(){ft();var w=b.props,L=w.popperOptions,U=w.placement,X=w.offset,ee=w.getReferenceClientRect,se=w.moveTransition,pe=j()?Hl(k).arrow:null,xe=ee?{getBoundingClientRect:ee,contextElement:ee.contextElement||_()}:t,qe={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(kn){var Pt=kn.state;if(j()){var Si=N(),Xl=Si.box;["placement","reference-hidden","escaped"].forEach(function(Io){Io==="placement"?Xl.setAttribute("data-placement",Pt.placement):Pt.attributes.popper["data-popper-"+Io]?Xl.setAttribute("data-"+Io,""):Xl.removeAttribute("data-"+Io)}),Pt.attributes.popper={}}}},it=[{name:"offset",options:{offset:X}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!se}},qe];j()&&pe&&it.push({name:"arrow",options:{element:pe,padding:3}}),it.push.apply(it,(L==null?void 0:L.modifiers)||[]),b.popperInstance=iT(xe,k,Object.assign({},L,{placement:U,onFirstUpdate:h,modifiers:it}))}function ft(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function ht(){var w=b.props.appendTo,L,U=_();b.props.interactive&&w===Qf||w==="parent"?L=U.parentNode:L=eh(w,[U]),L.contains(k)||L.appendChild(k),b.state.isMounted=!0,xt(),process.env.NODE_ENV!=="production"&&Ut(b.props.interactive&&w===rt.appendTo&&U.nextElementSibling!==k,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
103
103
 
104
104
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
105
105
 
106
106
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
107
107
 
108
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function cn(){return js(k.querySelectorAll("[data-tippy-root]"))}function Nn(x){b.clearDelayTimeouts(),x&&J("onTrigger",[b,x]),nt();var V=R(!0),Y=L(),X=Y[0],te=Y[1];nn.isTouch&&X==="hold"&&te&&(V=te),V?r=setTimeout(function(){b.show()},V):b.show()}function dn(x){if(b.clearDelayTimeouts(),J("onUntrigger",[b,x]),!b.state.isVisible){z();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(x.type)>=0&&s)){var V=R(!1);V?i=setTimeout(function(){b.state.isVisible&&b.hide()},V):o=requestAnimationFrame(function(){b.hide()})}}function _r(){b.state.isEnabled=!0}function nr(){b.hide(),b.state.isEnabled=!1}function Ti(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Ei(x){if(process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("setProps")),!b.state.isDestroyed){J("onBeforeUpdate",[b,x]),ut();var V=b.props,Y=pm(t,Object.assign({},V,om(x),{ignoreAttributes:!0}));b.props=Y,Le(),V.interactiveDebounce!==Y.interactiveDebounce&&(Ke(),m=rm(Oi,Y.interactiveDebounce)),V.triggerTarget&&!Y.triggerTarget?pi(V.triggerTarget).forEach(function(X){X.removeAttribute("aria-expanded")}):Y.triggerTarget&&t.removeAttribute("aria-expanded"),We(),D(),C&&C(V,Y),b.popperInstance&&(Wt(),cn().forEach(function(X){requestAnimationFrame(X._tippy.popperInstance.forceUpdate)})),J("onAfterUpdate",[b,x])}}function _i(x){b.setProps({content:x})}function O(){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("show"));var x=b.state.isVisible,V=b.state.isDestroyed,Y=!b.state.isEnabled,X=nn.isTouch&&!b.props.touch,te=uc(b.props.duration,0,yt.duration);if(!(x||V||Y||X)&&!A().hasAttribute("disabled")&&(J("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,j()&&(k.style.visibility="visible"),D(),nt(),b.state.isMounted||(k.style.transition="none"),j()){var oe=F(),ge=oe.box,Te=oe.content;hc([ge,Te],0)}h=function(){var vt;if(!(!b.state.isVisible||d)){if(d=!0,k.offsetHeight,k.style.transition=b.props.moveTransition,j()&&b.props.animation){var Nr=F(),rr=Nr.box,un=Nr.content;hc([rr,un],te),sm([rr,un],"visible")}pe(),We(),im(bc,b),(vt=b.popperInstance)==null||vt.forceUpdate(),J("onMount",[b]),b.props.animation&&j()&&me(te,function(){b.state.isShown=!0,J("onShown",[b])})}},Dt()}}function M(){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("hide"));var x=!b.state.isVisible,V=b.state.isDestroyed,Y=!b.state.isEnabled,X=uc(b.props.duration,1,yt.duration);if(!(x||V||Y)&&(J("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,j()&&(k.style.visibility="hidden"),Ke(),z(),D(!0),j()){var te=F(),oe=te.box,ge=te.content;b.props.animation&&(hc([oe,ge],X),sm([oe,ge],"hidden"))}pe(),We(),b.props.animation?j()&&ne(X,b.unmount):b.unmount()}}function $(x){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("hideWithInteractivity")),I().addEventListener("mousemove",m),im(Hs,m),m(x)}function W(){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(Nt(),cn().forEach(function(x){x._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),bc=bc.filter(function(x){return x!==b}),b.state.isMounted=!1,J("onHidden",[b]))}function ee(){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),ut(),delete t._tippy,b.state.isDestroyed=!0,J("onDestroy",[b]))}}function gi(t,e){e===void 0&&(e={});var n=yt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(ED(t),mm(e,n)),SD();var r=Object.assign({},e,{plugins:n}),i=bD(t);if(process.env.NODE_ENV!=="production"){var o=wo(r.content),s=i.length>1;kn(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
108
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function _t(){return Bo(k.querySelectorAll("[data-tippy-root]"))}function Jt(w){b.clearDelayTimeouts(),w&&V("onTrigger",[b,w]),ye();var L=$(!0),U=R(),X=U[0],ee=U[1];Dt.isTouch&&X==="hold"&&ee&&(L=ee),L?r=setTimeout(function(){b.show()},L):b.show()}function It(w){if(b.clearDelayTimeouts(),V("onUntrigger",[b,w]),!b.state.isVisible){z();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(w.type)>=0&&s)){var L=$(!1);L?i=setTimeout(function(){b.state.isVisible&&b.hide()},L):o=requestAnimationFrame(function(){b.hide()})}}function Fn(){b.state.isEnabled=!0}function bn(){b.hide(),b.state.isEnabled=!1}function Tr(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function $r(w){if(process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("setProps")),!b.state.isDestroyed){V("onBeforeUpdate",[b,w]),Oe();var L=b.props,U=fh(t,Object.assign({},L,rh(w),{ignoreAttributes:!0}));b.props=U,be(),L.interactiveDebounce!==U.interactiveDebounce&&(ie(),m=th(Mr,U.interactiveDebounce)),L.triggerTarget&&!U.triggerTarget?Cr(L.triggerTarget).forEach(function(X){X.removeAttribute("aria-expanded")}):U.triggerTarget&&t.removeAttribute("aria-expanded"),G(),O(),C&&C(L,U),b.popperInstance&&(xt(),_t().forEach(function(X){requestAnimationFrame(X._tippy.popperInstance.forceUpdate)})),V("onAfterUpdate",[b,w])}}function Nr(w){b.setProps({content:w})}function M(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("show"));var w=b.state.isVisible,L=b.state.isDestroyed,U=!b.state.isEnabled,X=Dt.isTouch&&!b.props.touch,ee=Pl(b.props.duration,0,rt.duration);if(!(w||L||U||X)&&!_().hasAttribute("disabled")&&(V("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,j()&&(k.style.visibility="visible"),O(),ye(),b.state.isMounted||(k.style.transition="none"),j()){var se=N(),pe=se.box,xe=se.content;Ll([pe,xe],0)}h=function(){var it;if(!(!b.state.isVisible||d)){if(d=!0,k.offsetHeight,k.style.transition=b.props.moveTransition,j()&&b.props.animation){var jn=N(),kn=jn.box,Pt=jn.content;Ll([kn,Pt],ee),ih([kn,Pt],"visible")}H(),G(),nh(Wl,b),(it=b.popperInstance)==null||it.forceUpdate(),V("onMount",[b]),b.props.animation&&j()&&ue(ee,function(){b.state.isShown=!0,V("onShown",[b])})}},ht()}}function E(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("hide"));var w=!b.state.isVisible,L=b.state.isDestroyed,U=!b.state.isEnabled,X=Pl(b.props.duration,1,rt.duration);if(!(w||L||U)&&(V("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,j()&&(k.style.visibility="hidden"),ie(),z(),O(!0),j()){var ee=N(),se=ee.box,pe=ee.content;b.props.animation&&(Ll([se,pe],X),ih([se,pe],"hidden"))}H(),G(),b.props.animation?j()&&Z(X,b.unmount):b.unmount()}}function I(w){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("hideWithInteractivity")),B().addEventListener("mousemove",m),nh(Ao,m),m(w)}function q(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(ft(),_t().forEach(function(w){w._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Wl=Wl.filter(function(w){return w!==b}),b.state.isMounted=!1,V("onHidden",[b]))}function Q(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),Oe(),delete t._tippy,b.state.isDestroyed=!0,V("onDestroy",[b]))}}function Er(t,e){e===void 0&&(e={});var n=rt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(OT(t),hh(e,n)),vT();var r=Object.assign({},e,{plugins:n}),i=mT(t);if(process.env.NODE_ENV!=="production"){var o=xi(r.content),s=i.length>1;Ut(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
109
109
 
110
110
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
111
111
 
112
112
  `,`1) content: element.innerHTML
113
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,d){var u=d&&VD(d,r);return u&&l.push(u),l},[]);return wo(t)?a[0]:a}gi.defaultProps=yt,gi.setDefaultProps=DD,gi.currentInput=nn,Object.assign({},Pp,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),gi.setDefaultProps({render:bm});class PD{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:d,to:u})=>{const{doc:f,selection:h}=l,{empty:p}=h,m=!f.textBetween(d,u).length&&Kl(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const d=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,d,u,l)},this.updateDelay))},this.updateHandler=(a,l,d,u)=>{var f,h,p;const{state:m,composing:g}=a,{selection:y}=m;if(g||!l&&!d)return;this.createTooltip();const{ranges:v}=y,T=Math.min(...v.map(k=>k.$from.pos)),b=Math.max(...v.map(k=>k.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:a,state:m,oldState:u,from:T,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(I_(m.selection)){let k=a.nodeDOM(T);const C=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(C&&(k=C.firstChild),k)return k.getBoundingClientRect()}return Dp(a,T,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=gi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const km=t=>new Ze({key:typeof t.pluginKey=="string"?new Pt(t.pluginKey):t.pluginKey,view:e=>new PD({view:e,...t})});qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[km({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class ID{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:l}=a,{$anchor:d,empty:u}=l,f=d.depth===1,h=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!s.hasFocus()||!u||!f||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=gi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:a,selection:l}=s,{from:d,to:u}=l;if(n&&n.doc.eq(a)&&n.selection.eq(l))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>Dp(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const wm=t=>new Ze({key:typeof t.pluginKey=="string"?new Pt(t.pluginKey):t.pluginKey,view:e=>new ID({view:e,...t})});qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[wm({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),c.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=c.ref(null);return c.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:a}=t;i.registerPlugin(km({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),c.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return c.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function vm(t){return c.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class RD extends tN{constructor(e={}){return super(e),this.vueRenderers=c.reactive(new Map),this.contentComponent=null,this.reactiveState=vm(this.view.state),this.reactiveExtensionStorage=vm(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),c.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const LD=c.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=c.ref(),n=c.getCurrentInstance();return c.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&c.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=c.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),c.onBeforeUnmount(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=c.h(c.Teleport,{to:e.teleportElement,key:e.id},c.h(e.component,{ref:e.id,...e.props}));t.push(n)}),c.h("div",{ref:e=>{this.rootEl=e}},...t)}});c.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=c.ref(null);return c.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(wm({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),c.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return c.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),c.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return c.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),c.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return c.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const FD=(t={})=>{const e=c.shallowRef();return c.onMounted(()=>{e.value=new RD(t)}),c.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},zD=/^\s*>\s$/,jD=mt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",De(this.options.HTMLAttributes,t),0]},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[uo({find:zD,type:this.type})]}}),HD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,WD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,YD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,UD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,qD=Qt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",De(this.options.HTMLAttributes,t),0]},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[li({find:HD,type:this.type}),li({find:YD,type:this.type})]},addPasteRules(){return[ci({find:WD,type:this.type}),ci({find:UD,type:this.type})]}}),GD=mt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",De(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)}}}),xm=Qt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",De(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ps(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Sm=/^\s*([-+*])\s$/,KD=mt.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",De(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(GD.name,this.editor.getAttributes(xm.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=uo({find:Sm,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=uo({find:Sm,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(xm.name),editor:this.editor})),[t]}}),JD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,ZD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,XD=Qt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",De(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[li({find:JD,type:this.type})]},addPasteRules(){return[ci({find:ZD,type:this.type})]}}),QD=/^```([a-z]+)?[\s\n]$/,eA=/^~~~([a-z]+)?[\s\n]$/,tA=mt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",De(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},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
113
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(a,d){var u=d&&AT(d,r);return u&&a.push(u),a},[]);return xi(t)?l[0]:l}Er.defaultProps=rt,Er.setDefaultProps=TT,Er.currentInput=Dt,Object.assign({},Vf,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Er.setDefaultProps({render:gh});class DT{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:d,to:u})=>{const{doc:f,selection:h}=a,{empty:p}=h,m=!f.textBetween(d,u).length&&xl(a.selection),y=this.element.contains(document.activeElement);return!(!(l.hasFocus()||y)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const d=!(a!=null&&a.selection.eq(l.state.selection)),u=!(a!=null&&a.doc.eq(l.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,u,a)},this.updateDelay))},this.updateHandler=(l,a,d,u)=>{var f,h,p;const{state:m,composing:y}=l,{selection:g}=m;if(y||!a&&!d)return;this.createTooltip();const{ranges:x}=g,T=Math.min(...x.map(k=>k.$from.pos)),b=Math.max(...x.map(k=>k.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:l,state:m,oldState:u,from:T,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(VE(m.selection)){let k=l.nodeDOM(T);const C=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(C&&(k=C.firstChild),k)return k.getBoundingClientRect()}return $f(l,T,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Er(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const yh=t=>new ze({key:typeof t.pluginKey=="string"?new yt(t.pluginKey):t.pluginKey,view:e=>new DT({view:e,...t})});Re.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[yh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class VT{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{const{selection:a}=l,{$anchor:d,empty:u}=a,f=d.depth===1,h=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!s.hasFocus()||!u||!f||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Er(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:l,selection:a}=s,{from:d,to:u}=a;if(n&&n.doc.eq(l)&&n.selection.eq(a))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>$f(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const bh=t=>new ze({key:typeof t.pluginKey=="string"?new yt(t.pluginKey):t.pluginKey,view:e=>new VT({view:e,...t})});Re.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[bh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),c.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=c.ref(null);return c.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:l}=t;i.registerPlugin(yh({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:l}))}),c.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return c.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function kh(t){return c.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class _T extends XE{constructor(e={}){return super(e),this.vueRenderers=c.reactive(new Map),this.contentComponent=null,this.reactiveState=kh(this.view.state),this.reactiveExtensionStorage=kh(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),c.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const IT=c.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=c.ref(),n=c.getCurrentInstance();return c.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&c.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=c.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),c.onBeforeUnmount(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=c.h(c.Teleport,{to:e.teleportElement,key:e.id},c.h(e.component,{ref:e.id,...e.props}));t.push(n)}),c.h("div",{ref:e=>{this.rootEl=e}},...t)}});c.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=c.ref(null);return c.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(bh({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),c.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return c.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),c.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return c.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),c.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return c.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const PT=(t={})=>{const e=c.shallowRef();return c.onMounted(()=>{e.value=new _T(t)}),c.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},RT=/^\s*>\s$/,LT=tt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Ee(this.options.HTMLAttributes,t),0]},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[fi({find:RT,type:this.type})]}}),zT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,FT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,jT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,HT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,WT=Nt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Ee(this.options.HTMLAttributes,t),0]},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[br({find:zT,type:this.type}),br({find:jT,type:this.type})]},addPasteRules(){return[kr({find:FT,type:this.type}),kr({find:HT,type:this.type})]}}),qT=tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ee(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)}}}),vh=Nt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Ee(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Oo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),xh=/^\s*([-+*])\s$/,UT=tt.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",Ee(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(qT.name,this.editor.getAttributes(vh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=fi({find:xh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=fi({find:xh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(vh.name),editor:this.editor})),[t]}}),KT=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,JT=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,GT=Nt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Ee(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[br({find:KT,type:this.type})]},addPasteRules(){return[kr({find:JT,type:this.type})]}}),YT=/^```([a-z]+)?[\s\n]$/,ZT=/^~~~([a-z]+)?[\s\n]$/,XT=tt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Ee(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},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
114
114
 
115
- `);return!o||!s?!1:t.chain().command(({tr:a})=>(a.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:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:t.commands.exitCode()}}},addInputRules(){return[tc({find:QD,type:this.type,getAttributes:t=>({language:t[1]})}),tc({find:eA,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ze({key:new Pt("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"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=t.state;return t.state.selection.from===t.state.doc.nodeSize-(1+t.state.selection.$to.depth*2)?s.insert(t.state.selection.from-1,this.type.create({language:o})):s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(re.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,`
116
- `)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),nA=mt.create({name:"doc",topNode:!0,content:"block+"});function rA(t={}){return new Ze({view(e){return new iA(e,t)}})}class iA{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(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}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;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let d=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=a?u.bottom:u.top;a&&l&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.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 o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"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),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=If(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const oA=qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[rA(this.options)]}});class Me extends se{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Me.valid(r)?new Me(r):se.near(r)}content(){return H.empty}eq(e){return e instanceof Me&&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 Me(e.resolve(n.pos))}getBookmark(){return new kc(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!sA(e)||!aA(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Me.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(Me.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!K.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(Me.valid(a))return a}return null}}}Me.prototype.visible=!1,Me.findFrom=Me.findGapCursorFrom,se.jsonID("gapcursor",Me);class kc{constructor(e){this.pos=e}map(e){return new kc(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Me.valid(n)?new Me(n):se.near(n)}}function sA(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 i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function aA(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 i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function lA(){return new Ze({props:{decorations:fA,createSelectionBetween(t,e,n){return e.pos==n.pos&&Me.valid(n)?new Me(n):null},handleClick:dA,handleKeyDown:cA,handleDOMEvents:{beforeinput:uA}}})}const cA=lp({ArrowLeft:Ws("horiz",-1),ArrowRight:Ws("horiz",1),ArrowUp:Ws("vert",-1),ArrowDown:Ws("vert",1)});function Ws(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof re){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let d=Me.findGapCursorFrom(a,e,l);return d?(i&&i(r.tr.setSelection(new Me(d))),!0):!1}}function dA(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Me.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&K.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Me(r))),!0)}function uA(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Me))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 i=B.empty;for(let s=r.length-1;s>=0;s--)i=B.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new H(i,0,0));return o.setSelection(re.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function fA(t){if(!(t.selection instanceof Me))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ne.create(t.doc,[pt.widget(t.selection.head,e,{key:"gapcursor"})])}const hA=qe.create({name:"gapCursor",addProseMirrorPlugins(){return[lA()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ae(q(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),pA=mt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",De(this.options.HTMLAttributes,t)]},renderText(){return`
117
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&l&&s){const f=l.filter(h=>a.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),mA=mt.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]}`,De(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=>tc({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Ys=200,Ie=function(){};Ie.prototype.append=function(e){return e.length?(e=Ie.from(e),!this.length&&e||e.length<Ys&&this.leafAppend(e)||this.length<Ys&&e.leafPrepend(this)||this.appendInner(e)):this},Ie.prototype.prepend=function(e){return e.length?Ie.from(e).append(this):this},Ie.prototype.appendInner=function(e){return new gA(this,e)},Ie.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ie.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ie.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ie.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Ie.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i},Ie.from=function(e){return e instanceof Ie?e:e&&e.length?new Cm(e):Ie.empty};var Cm=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&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(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ys)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ys)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ie);Ie.empty=new Cm([]);var gA=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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ie);const yA=500;class Lt{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 i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,d=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new rn(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new rn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new Lt(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new rn(e.mapping.maps[u],f,n),p;(p=l&&l.merge(h))&&(h=p,u?o.pop():a=a.slice(0,a.length-1)),o.push(h),n&&(s++,n=void 0),i||(l=h)}let d=s-r.depth;return d>kA&&(a=bA(a,d),s-=d),new Lt(a.append(o),s)}remapping(e,n){let r=new qr;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Lt(this.items.append(e.map(n=>new rn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=n;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(l+1,p));y&&a++,r.push(new rn(m,g,y))}else r.push(new rn(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new rn(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new Lt(u,a);return f.emptyItemCount()>yA&&(f=f.compress(this.items.length-r.length)),f}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,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),d=l&&l.getMap();if(r--,d&&n.appendMap(d,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new rn(d.invert(),l,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new Lt(Ie.from(i.reverse()),o)}}Lt.empty=new Lt(Ie.empty,0);function bA(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class rn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new rn(n.getMap().invert(),n,this.selection)}}}class Jn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const kA=20;function wA(t,e,n,r){let i=n.getMeta(Sr),o;if(i)return i.historyState;n.getMeta(SA)&&(t=new Jn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Sr))return s.getMeta(Sr).redo?new Jn(t.done.addTransform(n,void 0,r,Us(e)),t.undone,Mm(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new Jn(t.done,t.undone.addTransform(n,void 0,r,Us(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!vA(n,t.prevRanges)),d=s?wc(t.prevRanges,n.mapping):Mm(n.mapping.maps[n.steps.length-1]);return new Jn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Us(e)),Lt.empty,d,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Jn(t.done.rebased(n,o),t.undone.rebased(n,o),wc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Jn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),wc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function vA(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Mm(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function wc(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function xA(t,e,n){let r=Us(e),i=Sr.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new Jn(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Sr,{redo:n,historyState:l})}let vc=!1,Om=null;function Us(t){let e=t.plugins;if(Om!=e){vc=!1,Om=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){vc=!0;break}}return vc}const Sr=new Pt("history"),SA=new Pt("closeHistory");function CA(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ze({key:Sr,state:{init(){return new Jn(Lt.empty,Lt.empty,null,0,-1)},apply(e,n,r){return wA(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Em:r=="historyRedo"?_m:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Tm(t,e){return(n,r)=>{let i=Sr.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=xA(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Em=Tm(!1,!0),_m=Tm(!0,!0),MA=qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Em(t,e),redo:()=>({state:t,dispatch:e})=>_m(t,e)}},addProseMirrorPlugins(){return[CA(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()}}}),OA=mt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",De(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:a}=i.selection,l=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(re.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(K.create(i.doc,a.pos)):i.setSelection(re.create(i.doc,a.pos));else{const d=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(l,d),i.setSelection(re.create(i.doc,l+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[nN({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),TA=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,EA=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,_A=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,NA=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,DA=Qt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",De(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[li({find:TA,type:this.type}),li({find:_A,type:this.type})]},addPasteRules(){return[ci({find:EA,type:this.type}),ci({find:NA,type:this.type})]}}),AA=mt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",De(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)}}}),$A=mt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",De(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)}}}),Nm=Qt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",De(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ps(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Dm=/^(\d+)\.\s$/,BA=mt.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}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",De(this.options.HTMLAttributes,n),0]:["ol",De(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($A.name,this.editor.getAttributes(Nm.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=uo({find:Dm,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=uo({find:Dm,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Nm.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),VA=mt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",De(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),PA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,IA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,RA=Qt.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",De(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[li({find:PA,type:this.type})]},addPasteRules(){return[ci({find:IA,type:this.type})]}}),LA=mt.create({name:"text",group:"inline"}),FA=qe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,l,d,u,f,h,p,m,g,y,w;const v=[];return this.options.blockquote!==!1&&v.push(jD.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&v.push(qD.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&v.push(KD.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&v.push(XD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&v.push(tA.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&v.push(nA.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&v.push(oA.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&v.push(hA.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&v.push(pA.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&v.push(mA.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&v.push(MA.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&v.push(OA.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&v.push(DA.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&v.push(AA.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&v.push(BA.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&v.push(VA.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&v.push(RA.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&v.push(LA.configure((w=this.options)===null||w===void 0?void 0:w.text)),v}}),zA=qe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ze({key:new Pt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,a=s&&s.type.isLeaf,l=s&&s.isAtom,d=this.options.considerAnyAsEmpty?!0:s&&s.type.name===((n=t.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),u=t.content.childCount<=1&&s&&d&&s.nodeSize<=2&&(!a||!l);return t.descendants((f,h)=>{const p=i>=h&&i<=h+f.nodeSize,m=!f.isLeaf&&!f.childCount;if((p||!this.options.showOnlyCurrent)&&m){const g=[this.options.emptyNodeClass];u&&g.push(this.options.emptyEditorClass);const y=pt.node(h,h+f.nodeSize,{class:g.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:f,pos:h,hasAnchor:p}):this.options.placeholder});o.push(y)}return this.options.includeChildren}),Ne.create(t,o)}}})]}}),jA={},HA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},WA=[c.createElementVNode("path",{d:"M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"},null,-1)];function YA(t,e){return c.openBlock(),c.createElementBlock("svg",HA,WA)}const UA=de(jA,[["render",YA]]),qA={},GA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},KA=[c.createElementVNode("path",{d:"M2.995 1a.625.625 0 1 0 0 1.25h.38v2.125a.625.625 0 1 0 1.25 0v-2.75A.625.625 0 0 0 4 1H2.995ZM3.208 7.385a2.37 2.37 0 0 1 1.027-.124L2.573 8.923a.625.625 0 0 0 .439 1.067l1.987.011a.625.625 0 0 0 .006-1.25l-.49-.003.777-.776c.215-.215.335-.506.335-.809 0-.465-.297-.957-.842-1.078a3.636 3.636 0 0 0-1.993.121.625.625 0 1 0 .416 1.179ZM2.625 11a.625.625 0 1 0 0 1.25H4.25a.125.125 0 0 1 0 .25H3.5a.625.625 0 1 0 0 1.25h.75a.125.125 0 0 1 0 .25H2.625a.625.625 0 1 0 0 1.25H4.25a1.375 1.375 0 0 0 1.153-2.125A1.375 1.375 0 0 0 4.25 11H2.625ZM7.25 2a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM7.25 7.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM6.5 13.25a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 0 1.5h-6a.75.75 0 0 1-.75-.75Z"},null,-1)];function JA(t,e){return c.openBlock(),c.createElementBlock("svg",GA,KA)}const ZA=de(qA,[["render",JA]]),XA={},QA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},e$=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.5 9.75A2.75 2.75 0 0 0 9.75 7H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 1.06L4.56 5.5h5.19a4.25 4.25 0 0 1 0 8.5h-1a.75.75 0 0 1 0-1.5h1a2.75 2.75 0 0 0 2.75-2.75Z","clip-rule":"evenodd"},null,-1)];function t$(t,e){return c.openBlock(),c.createElementBlock("svg",QA,e$)}const n$=de(XA,[["render",t$]]),r$={},i$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},o$=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M3.5 9.75A2.75 2.75 0 0 1 6.25 7h5.19L9.22 9.22a.75.75 0 1 0 1.06 1.06l3.5-3.5a.75.75 0 0 0 0-1.06l-3.5-3.5a.75.75 0 1 0-1.06 1.06l2.22 2.22H6.25a4.25 4.25 0 0 0 0 8.5h1a.75.75 0 0 0 0-1.5h-1A2.75 2.75 0 0 1 3.5 9.75Z","clip-rule":"evenodd"},null,-1)];function s$(t,e){return c.openBlock(),c.createElementBlock("svg",i$,o$)}const a$=de(r$,[["render",s$]]),l$={},c$={fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},d$=[c.createElementVNode("path",{d:"M754.429 0v274.423h235.885L647.457 1645.85H343V1920h822.994v-274.149H930.11l342.857-1371.428h304.32V0z","fill-rule":"evenodd"},null,-1)];function u$(t,e){return c.openBlock(),c.createElementBlock("svg",c$,d$)}const f$=de(l$,[["render",u$]]),h$={},p$={fill:"#000000",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},m$=[c.createElementVNode("path",{d:"M480.286 822.857h548.571c151.269 0 274.286-123.017 274.286-274.286 0-151.268-123.017-274.285-274.286-274.285H480.286v548.571Zm0 822.857H1166c151.269 0 274.286-123.017 274.286-274.285 0-151.269-123.017-274.286-274.286-274.286H480.286v548.571ZM1166 1920H206V0h822.857c302.537 0 548.572 246.034 548.572 548.571 0 134.263-48.549 257.418-128.778 352.732 159.223 96.137 265.92 270.994 265.92 470.126 0 302.537-246.034 548.571-548.571 548.571Z","fill-rule":"evenodd"},null,-1)];function g$(t,e){return c.openBlock(),c.createElementBlock("svg",p$,m$)}const y$=de(h$,[["render",g$]]),b$={},k$={fill:"#000000",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"800px",height:"800px",viewBox:"0 0 96.639 96.639","xml:space":"preserve"},w$=[c.createElementVNode("g",null,[c.createElementVNode("g",null,[c.createElementVNode("path",{d:`M95.263,12.29V2.277C95.263,1.019,94.245,0,92.987,0H36.921C25.539,0,17.05,2.442,10.969,7.47\r
115
+ `);return!o||!s?!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:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||r.nodeAt(l)?!1:t.commands.exitCode()}}},addInputRules(){return[Ml({find:YT,type:this.type,getAttributes:t=>({language:t[1]})}),Ml({find:ZT,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ze({key:new yt("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"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=t.state;return t.state.selection.from===t.state.doc.nodeSize-(1+t.state.selection.$to.depth*2)?s.insert(t.state.selection.from-1,this.type.create({language:o})):s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(ne.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,`
116
+ `)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),QT=tt.create({name:"doc",topNode:!0,content:"block+"});function e$(t={}){return new ze({view(e){return new t$(e,t)}})}class t${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(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}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;if(n){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=l?u.bottom:u.top;l&&a&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.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 o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"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),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Md(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const n$=Re.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[e$(this.options)]}});class ve extends le{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ve.valid(r)?new ve(r):le.near(r)}content(){return W.empty}eq(e){return e instanceof ve&&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 ve(e.resolve(n.pos))}getBookmark(){return new ql(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!r$(e)||!i$(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&ve.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)<l.childCount:e.index(s)>0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let a=e.doc.resolve(i);if(ve.valid(a))return a}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!Y.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(ve.valid(l))return l}return null}}}ve.prototype.visible=!1,ve.findFrom=ve.findGapCursorFrom,le.jsonID("gapcursor",ve);class ql{constructor(e){this.pos=e}map(e){return new ql(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ve.valid(n)?new ve(n):le.near(n)}}function r$(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 i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function i$(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 i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function o$(){return new ze({props:{decorations:c$,createSelectionBetween(t,e,n){return e.pos==n.pos&&ve.valid(n)?new ve(n):null},handleClick:l$,handleKeyDown:s$,handleDOMEvents:{beforeinput:a$}}})}const s$=Qu({ArrowLeft:Do("horiz",-1),ArrowRight:Do("horiz",1),ArrowUp:Do("vert",-1),ArrowDown:Do("vert",1)});function Do(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof ne){if(!o.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=ve.findGapCursorFrom(l,e,a);return d?(i&&i(r.tr.setSelection(new ve(d))),!0):!1}}function l$(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ve.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Y.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ve(r))),!0)}function a$(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ve))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 i=P.empty;for(let s=r.length-1;s>=0;s--)i=P.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new W(i,0,0));return o.setSelection(ne.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function c$(t){if(!(t.selection instanceof ve))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ce.create(t.doc,[et.widget(t.selection.head,e,{key:"gapcursor"})])}const d$=Re.create({name:"gapCursor",addProseMirrorPlugins(){return[o$()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ae(J(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),u$=tt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ee(this.options.HTMLAttributes,t)]},renderText(){return`
117
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&a&&s){const f=a.filter(h=>l.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),f$=tt.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]}`,Ee(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=>Ml({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Vo=200,Be=function(){};Be.prototype.append=function(e){return e.length?(e=Be.from(e),!this.length&&e||e.length<Vo&&this.leafAppend(e)||this.length<Vo&&e.leafPrepend(this)||this.appendInner(e)):this},Be.prototype.prepend=function(e){return e.length?Be.from(e).append(this):this},Be.prototype.appendInner=function(e){return new h$(this,e)},Be.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Be.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Be.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Be.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Be.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i},Be.from=function(e){return e instanceof Be?e:e&&e.length?new wh(e):Be.empty};var wh=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&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(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a<s;a++)if(i(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var a=o-1;a>=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Vo)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Vo)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Be);Be.empty=new wh([]);var h$=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 t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Be);const p$=500;class vt{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 i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,d=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new Vt(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new Vt(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,a=new vt(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new Vt(e.mapping.maps[u],f,n),p;(p=a&&a.merge(h))&&(h=p,u?o.pop():l=l.slice(0,l.length-1)),o.push(h),n&&(s++,n=void 0),i||(a=h)}let d=s-r.depth;return d>g$&&(l=m$(l,d),s-=d),new vt(l.append(o),s)}remapping(e,n){let r=new ir;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new vt(this.items.append(e.map(n=>new Vt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let a=n;this.items.forEach(h=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let y=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(o.slice(a+1,p));g&&l++,r.push(new Vt(m,y,g))}else r.push(new Vt(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new Vt(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new vt(u,l);return f.emptyItemCount()>p$&&(f=f.compress(this.items.length-r.length)),f}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,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(n.slice(r)),d=a&&a.getMap();if(r--,d&&n.appendMap(d,r),a){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new Vt(d.invert(),a,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new vt(Be.from(i.reverse()),o)}}vt.empty=new vt(Be.empty,0);function m$(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Vt{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Vt(n.getMap().invert(),n,this.selection)}}}class mn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const g$=20;function y$(t,e,n,r){let i=n.getMeta(zn),o;if(i)return i.historyState;n.getMeta(v$)&&(t=new mn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(zn))return s.getMeta(zn).redo?new mn(t.done.addTransform(n,void 0,r,_o(e)),t.undone,Sh(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new mn(t.done,t.undone.addTransform(n,void 0,r,_o(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!b$(n,t.prevRanges)),d=s?Ul(t.prevRanges,n.mapping):Sh(n.mapping.maps[n.steps.length-1]);return new mn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,_o(e)),vt.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new mn(t.done.rebased(n,o),t.undone.rebased(n,o),Ul(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new mn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ul(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function b$(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Sh(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Ul(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function k$(t,e,n){let r=_o(e),i=zn.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),a=new mn(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(zn,{redo:n,historyState:a})}let Kl=!1,Ch=null;function _o(t){let e=t.plugins;if(Ch!=e){Kl=!1,Ch=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Kl=!0;break}}return Kl}const zn=new yt("history"),v$=new yt("closeHistory");function x$(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ze({key:zn,state:{init(){return new mn(vt.empty,vt.empty,null,0,-1)},apply(e,n,r){return y$(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Eh:r=="historyRedo"?Mh:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Oh(t,e){return(n,r)=>{let i=zn.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=k$(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Eh=Oh(!1,!0),Mh=Oh(!0,!0),w$=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Eh(t,e),redo:()=>({state:t,dispatch:e})=>Mh(t,e)}},addProseMirrorPlugins(){return[x$(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()}}}),S$=tt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Ee(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,a=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(ne.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(Y.create(i.doc,l.pos)):i.setSelection(ne.create(i.doc,l.pos));else{const d=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(a,d),i.setSelection(ne.create(i.doc,a+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[QE({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),C$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,O$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,E$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,M$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,T$=Nt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ee(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[br({find:C$,type:this.type}),br({find:E$,type:this.type})]},addPasteRules(){return[kr({find:O$,type:this.type}),kr({find:M$,type:this.type})]}}),$$=tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ee(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)}}}),N$=tt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ee(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)}}}),Th=Nt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Ee(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Oo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),$h=/^(\d+)\.\s$/,B$=tt.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}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Ee(this.options.HTMLAttributes,n),0]:["ol",Ee(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(N$.name,this.editor.getAttributes(Th.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=fi({find:$h,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=fi({find:$h,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Th.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),A$=tt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),D$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,V$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_$=Nt.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",Ee(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[br({find:D$,type:this.type})]},addPasteRules(){return[kr({find:V$,type:this.type})]}}),I$=tt.create({name:"text",group:"inline"}),P$=Re.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,l,a,d,u,f,h,p,m,y,g,v;const x=[];return this.options.blockquote!==!1&&x.push(LT.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(WT.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(UT.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(GT.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(XT.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(QT.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(n$.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(d$.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&x.push(u$.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&x.push(f$.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(w$.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(S$.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(T$.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push($$.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(B$.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(A$.configure((y=this.options)===null||y===void 0?void 0:y.paragraph)),this.options.strike!==!1&&x.push(_$.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&x.push(I$.configure((v=this.options)===null||v===void 0?void 0:v.text)),x}}),R$=Re.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ze({key:new yt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,l=s&&s.type.isLeaf,a=s&&s.isAtom,d=this.options.considerAnyAsEmpty?!0:s&&s.type.name===((n=t.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),u=t.content.childCount<=1&&s&&d&&s.nodeSize<=2&&(!l||!a);return t.descendants((f,h)=>{const p=i>=h&&i<=h+f.nodeSize,m=!f.isLeaf&&!f.childCount;if((p||!this.options.showOnlyCurrent)&&m){const y=[this.options.emptyNodeClass];u&&y.push(this.options.emptyEditorClass);const g=et.node(h,h+f.nodeSize,{class:y.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:f,pos:h,hasAnchor:p}):this.options.placeholder});o.push(g)}return this.options.includeChildren}),Ce.create(t,o)}}})]}}),L$={},z$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},F$=[c.createElementVNode("path",{d:"M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"},null,-1)];function j$(t,e){return c.openBlock(),c.createElementBlock("svg",z$,F$)}const H$=ce(L$,[["render",j$]]),W$={},q$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},U$=[c.createElementVNode("path",{d:"M2.995 1a.625.625 0 1 0 0 1.25h.38v2.125a.625.625 0 1 0 1.25 0v-2.75A.625.625 0 0 0 4 1H2.995ZM3.208 7.385a2.37 2.37 0 0 1 1.027-.124L2.573 8.923a.625.625 0 0 0 .439 1.067l1.987.011a.625.625 0 0 0 .006-1.25l-.49-.003.777-.776c.215-.215.335-.506.335-.809 0-.465-.297-.957-.842-1.078a3.636 3.636 0 0 0-1.993.121.625.625 0 1 0 .416 1.179ZM2.625 11a.625.625 0 1 0 0 1.25H4.25a.125.125 0 0 1 0 .25H3.5a.625.625 0 1 0 0 1.25h.75a.125.125 0 0 1 0 .25H2.625a.625.625 0 1 0 0 1.25H4.25a1.375 1.375 0 0 0 1.153-2.125A1.375 1.375 0 0 0 4.25 11H2.625ZM7.25 2a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM7.25 7.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM6.5 13.25a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 0 1.5h-6a.75.75 0 0 1-.75-.75Z"},null,-1)];function K$(t,e){return c.openBlock(),c.createElementBlock("svg",q$,U$)}const J$=ce(W$,[["render",K$]]),G$={},Y$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Z$=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.5 9.75A2.75 2.75 0 0 0 9.75 7H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 1.06L4.56 5.5h5.19a4.25 4.25 0 0 1 0 8.5h-1a.75.75 0 0 1 0-1.5h1a2.75 2.75 0 0 0 2.75-2.75Z","clip-rule":"evenodd"},null,-1)];function X$(t,e){return c.openBlock(),c.createElementBlock("svg",Y$,Z$)}const Q$=ce(G$,[["render",X$]]),eN={},tN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},nN=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M3.5 9.75A2.75 2.75 0 0 1 6.25 7h5.19L9.22 9.22a.75.75 0 1 0 1.06 1.06l3.5-3.5a.75.75 0 0 0 0-1.06l-3.5-3.5a.75.75 0 1 0-1.06 1.06l2.22 2.22H6.25a4.25 4.25 0 0 0 0 8.5h1a.75.75 0 0 0 0-1.5h-1A2.75 2.75 0 0 1 3.5 9.75Z","clip-rule":"evenodd"},null,-1)];function rN(t,e){return c.openBlock(),c.createElementBlock("svg",tN,nN)}const iN=ce(eN,[["render",rN]]),oN={},sN={fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},lN=[c.createElementVNode("path",{d:"M754.429 0v274.423h235.885L647.457 1645.85H343V1920h822.994v-274.149H930.11l342.857-1371.428h304.32V0z","fill-rule":"evenodd"},null,-1)];function aN(t,e){return c.openBlock(),c.createElementBlock("svg",sN,lN)}const cN=ce(oN,[["render",aN]]),dN={},uN={fill:"#000000",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},fN=[c.createElementVNode("path",{d:"M480.286 822.857h548.571c151.269 0 274.286-123.017 274.286-274.286 0-151.268-123.017-274.285-274.286-274.285H480.286v548.571Zm0 822.857H1166c151.269 0 274.286-123.017 274.286-274.285 0-151.269-123.017-274.286-274.286-274.286H480.286v548.571ZM1166 1920H206V0h822.857c302.537 0 548.572 246.034 548.572 548.571 0 134.263-48.549 257.418-128.778 352.732 159.223 96.137 265.92 270.994 265.92 470.126 0 302.537-246.034 548.571-548.571 548.571Z","fill-rule":"evenodd"},null,-1)];function hN(t,e){return c.openBlock(),c.createElementBlock("svg",uN,fN)}const pN=ce(dN,[["render",hN]]),mN={},gN={fill:"#000000",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"800px",height:"800px",viewBox:"0 0 96.639 96.639","xml:space":"preserve"},yN=[c.createElementVNode("g",null,[c.createElementVNode("g",null,[c.createElementVNode("path",{d:`M95.263,12.29V2.277C95.263,1.019,94.245,0,92.987,0H36.921C25.539,0,17.05,2.442,10.969,7.47\r
118
118
  c-6.364,5.265-9.594,12.724-9.594,22.167c0,10.367,3.124,18.054,9.547,23.499c6.399,5.423,15.696,8.175,27.63,8.175h10.38v33.051\r
119
119
  c0,1.258,1.02,2.277,2.278,2.277h7.096c1.257,0,2.276-1.02,2.276-2.277V14.566h9.146v79.795c0,1.258,1.021,2.276,2.277,2.276\r
120
- h6.873c1.257,0,2.277-1.021,2.277-2.276V14.566h11.83C94.247,14.566,95.263,13.547,95.263,12.29z`})])],-1)];function v$(t,e){return c.openBlock(),c.createElementBlock("svg",k$,w$)}const x$=de(b$,[["render",v$]]),S$={},C$={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},M$=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"},null,-1)];function O$(t,e){return c.openBlock(),c.createElementBlock("svg",C$,M$)}const T$=de(S$,[["render",O$]]),E$={class:"py-1 px-1 border-b"},_$={class:"flex gap-px"},N$=["onClick"],D$={key:1,class:"text-sm"},A$={class:"max-h-72 w-full overflow-auto px-4 py-3"},$$=Object.assign({name:"WpicTextEditor"},{props:{modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r={pmi:"shadow-inner border-zinc-400 dark:border-zinc-700/50 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 dark:text-zinc-300 bg-zinc-100 dark:bg-zinc-700/25","wpic-tools":"bg-white border border-gray-300"},i=[{method:"toggleBold",type:"chain",label:"bold",icon:y$,smallIcon:!0,disableCheck:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:f$,smallIcon:!0,disableCheck:!0},{method:"setParagraph",type:"chain",label:"paragraph",icon:x$,smallIcon:!0,disableCheck:!1},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:UA,disableCheck:!1},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:ZA,disableCheck:!1},{method:"undo",type:"chain",label:"undo",icon:n$,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:a$,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:T$,disableCheck:!0}],o=e,s=FD({content:n.modelValue,extensions:[FA,zA.configure({placeholder:"..."})],onUpdate:()=>{o("update:modelValue",s.value.getHTML())}});c.onBeforeUnmount(()=>{s.value.destroy()}),c.watch(()=>n.modelValue,d=>{d!==s.value.getHTML()&&s.value.commands.setContent(d,!1)});function a(d,u,f){u==="chain"?f?s.value.chain().focus()[d](f).run():s.value.chain().focus()[d]().run():this.editor[d]()()}function l(d,u,f,h){return h?u==="chain"?f?!s.value.can().chain().focus()[d](f).run():!s.value.can().chain().focus()[d]().run():!s.value.can()[d]().run():!1}return(d,u)=>c.unref(s)?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["pt-px relative flex flex-col rounded-sm border",r[c.unref(Q).theme]])},[c.createElementVNode("div",E$,[c.createElementVNode("div",_$,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(i,f=>c.createElementVNode("div",{key:f.method,class:c.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded-sm",{"cursor-pointer":!l(f.method,f.type,f.params,f.disableCheck),"is-active text-white bg-zinc-200!":c.unref(s).isActive(f.label)}]),onClick:h=>a(f.method,f.type,f.params)},[f.icon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(f.icon),{key:0,class:c.normalizeClass(["",{"w-3 h-3":f.smallIcon,"w-4 h-4":!f.smallIcon}])},null,8,["class"])):(c.openBlock(),c.createElementBlock("span",D$,c.toDisplayString(c.unref(tu).capitalize(f.label)),1))],10,N$)),64))])]),c.createElementVNode("div",A$,[c.createVNode(c.unref(LD),{editor:c.unref(s)},null,8,["editor"])])],2)):c.createCommentVNode("",!0)}}),B$={},V$={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P$=[c.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function I$(t,e){return c.openBlock(),c.createElementBlock("svg",V$,P$)}const R$=de(B$,[["render",I$]]),L$={},F$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},z$=[c.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function j$(t,e){return c.openBlock(),c.createElementBlock("svg",F$,z$)}const H$=de(L$,[["render",j$]]),W$={},Y$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},U$=[c.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1),c.createElementVNode("line",{x1:"7.5",y1:"2",x2:"22",y2:"16",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1),c.createElementVNode("line",{x1:"2",y1:"7.5",x2:"16",y2:"22",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1)];function q$(t,e){return c.openBlock(),c.createElementBlock("svg",Y$,U$)}const G$=de(W$,[["render",q$]]),K$=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("span",{class:c.normalizeClass(["inline-flex items-center justify-center border-0 font-normal rounded-md min-h-6 gap-1 leading-none text-sm px-2",{"bg-green-100 border-green-200 text-green-700 dark:border-green-600/30 dark:bg-green-800/15 dark:text-green-500/85":t.success,"bg-yellow-100 border-yellow-200 text-yellow-700 dark:border-yellow-600/30 dark:bg-yellow-800/15 dark:text-yellow-500/85":t.warning,"bg-red-100 border-red-200 text-red-700 dark:border-red-600/30 dark:bg-red-800/15 dark:text-red-500/85":t.error,"bg-gray-100 border-gray-200 text-gray-700 dark:border-gray-600/30 dark:bg-white/5 dark:text-gray-400/85":!t.success&&!t.warning&&!t.error}])},[t.complete?(c.openBlock(),c.createBlock(R$,{key:0,class:"w-2.5 h-2.5"})):c.createCommentVNode("",!0),t.incomplete?(c.openBlock(),c.createBlock(H$,{key:1,class:"w-2.5 h-2.5 opacity-80"})):c.createCommentVNode("",!0),t.partially?(c.openBlock(),c.createBlock(G$,{key:2,class:"w-2.5 h-2.5 opacity-80"})):c.createCommentVNode("",!0),c.renderSlot(e.$slots,"default")],2))}});//! moment.js
121
- //! version : 2.30.1
122
- //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
123
- //! license : MIT
124
- //! momentjs.com
125
- var Am;function E(){return Am.apply(null,arguments)}function J$(t){Am=t}function Ft(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Cr(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function fe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xc(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(fe(t,e))return!1;return!0}function dt(t){return t===void 0}function wn(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function xo(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function $m(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Zn(t,e){for(var n in e)fe(e,n)&&(t[n]=e[n]);return fe(e,"toString")&&(t.toString=e.toString),fe(e,"valueOf")&&(t.valueOf=e.valueOf),t}function on(t,e,n,r){return sg(t,e,n,r,!0).utc()}function Z$(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function ie(t){return t._pf==null&&(t._pf=Z$()),t._pf}var Sc;Array.prototype.some?Sc=Array.prototype.some:Sc=function(t){var e=Object(this),n=e.length>>>0,r;for(r=0;r<n;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};function Cc(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=ie(t),n=Sc.call(e.parsedDateParts,function(i){return i!=null}),r=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(r=r&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=r;else return r;return t._isValid}function qs(t){var e=on(NaN);return t!=null?Zn(ie(e),t):ie(e).userInvalidated=!0,e}var Bm=E.momentProperties=[],Mc=!1;function Oc(t,e){var n,r,i,o=Bm.length;if(dt(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),dt(e._i)||(t._i=e._i),dt(e._f)||(t._f=e._f),dt(e._l)||(t._l=e._l),dt(e._strict)||(t._strict=e._strict),dt(e._tzm)||(t._tzm=e._tzm),dt(e._isUTC)||(t._isUTC=e._isUTC),dt(e._offset)||(t._offset=e._offset),dt(e._pf)||(t._pf=ie(e)),dt(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=Bm[n],i=e[r],dt(i)||(t[r]=i);return t}function So(t){Oc(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Mc===!1&&(Mc=!0,E.updateOffset(this),Mc=!1)}function zt(t){return t instanceof So||t!=null&&t._isAMomentObject!=null}function Vm(t){E.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Tt(t,e){var n=!0;return Zn(function(){if(E.deprecationHandler!=null&&E.deprecationHandler(null,t),n){var r=[],i,o,s,a=arguments.length;for(o=0;o<a;o++){if(i="",typeof arguments[o]=="object"){i+=`
126
- [`+o+"] ";for(s in arguments[0])fe(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}Vm(t+`
127
- Arguments: `+Array.prototype.slice.call(r).join("")+`
128
- `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var Pm={};function Im(t,e){E.deprecationHandler!=null&&E.deprecationHandler(t,e),Pm[t]||(Vm(e),Pm[t]=!0)}E.suppressDeprecationWarnings=!1,E.deprecationHandler=null;function sn(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function X$(t){var e,n;for(n in t)fe(t,n)&&(e=t[n],sn(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Tc(t,e){var n=Zn({},t),r;for(r in e)fe(e,r)&&(Cr(t[r])&&Cr(e[r])?(n[r]={},Zn(n[r],t[r]),Zn(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)fe(t,r)&&!fe(e,r)&&Cr(t[r])&&(n[r]=Zn({},n[r]));return n}function Ec(t){t!=null&&this.set(t)}var _c;Object.keys?_c=Object.keys:_c=function(t){var e,n=[];for(e in t)fe(t,e)&&n.push(e);return n};var Q$={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function eB(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return sn(r)?r.call(e,n):r}function an(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Nc=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Gs=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Dc={},yi={};function G(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(yi[t]=i),e&&(yi[e[0]]=function(){return an(i.apply(this,arguments),e[1],e[2])}),n&&(yi[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function tB(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function nB(t){var e=t.match(Nc),n,r;for(n=0,r=e.length;n<r;n++)yi[e[n]]?e[n]=yi[e[n]]:e[n]=tB(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=sn(e[s])?e[s].call(i,t):e[s];return o}}function Ks(t,e){return t.isValid()?(e=Rm(e,t.localeData()),Dc[e]=Dc[e]||nB(e),Dc[e](t)):t.localeData().invalidDate()}function Rm(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Gs.lastIndex=0;n>=0&&Gs.test(t);)t=t.replace(Gs,r),Gs.lastIndex=0,n-=1;return t}var rB={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function iB(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Nc).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var oB="Invalid date";function sB(){return this._invalidDate}var aB="%d",lB=/\d{1,2}/;function cB(t){return this._ordinal.replace("%d",t)}var dB={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function uB(t,e,n,r){var i=this._relativeTime[n];return sn(i)?i(t,e,n,r):i.replace(/%d/i,t)}function fB(t,e){var n=this._relativeTime[t>0?"future":"past"];return sn(n)?n(e):n.replace(/%s/i,e)}var Lm={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Et(t){return typeof t=="string"?Lm[t]||Lm[t.toLowerCase()]:void 0}function Ac(t){var e={},n,r;for(r in t)fe(t,r)&&(n=Et(r),n&&(e[n]=t[r]));return e}var hB={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function pB(t){var e=[],n;for(n in t)fe(t,n)&&e.push({unit:n,priority:hB[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var Fm=/\d/,bt=/\d\d/,zm=/\d{3}/,$c=/\d{4}/,Js=/[+-]?\d{6}/,ve=/\d\d?/,jm=/\d\d\d\d?/,Hm=/\d\d\d\d\d\d?/,Zs=/\d{1,3}/,Bc=/\d{1,4}/,Xs=/[+-]?\d{1,6}/,bi=/\d+/,Qs=/[+-]?\d+/,mB=/Z|[+-]\d\d:?\d\d/gi,ea=/Z|[+-]\d\d(?::?\d\d)?/gi,gB=/[+-]?\d+(\.\d{1,3})?/,Co=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ki=/^[1-9]\d?/,Vc=/^([1-9]\d|\d)/,ta;ta={};function U(t,e,n){ta[t]=sn(e)?e:function(r,i){return r&&n?n:e}}function yB(t,e){return fe(ta,t)?ta[t](e._strict,e._locale):new RegExp(bB(t))}function bB(t){return vn(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function vn(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function _t(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function le(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=_t(e)),n}var Pc={};function ke(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),wn(e)&&(r=function(o,s){s[e]=le(o)}),i=t.length,n=0;n<i;n++)Pc[t[n]]=r}function Mo(t,e){ke(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function kB(t,e,n){e!=null&&fe(Pc,t)&&Pc[t](e,n._a,n,t)}function na(t){return t%4===0&&t%100!==0||t%400===0}var Ge=0,xn=1,ln=2,Ae=3,jt=4,Sn=5,Mr=6,wB=7,vB=8;G("Y",0,0,function(){var t=this.year();return t<=9999?an(t,4):"+"+t}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),U("Y",Qs),U("YY",ve,bt),U("YYYY",Bc,$c),U("YYYYY",Xs,Js),U("YYYYYY",Xs,Js),ke(["YYYYY","YYYYYY"],Ge),ke("YYYY",function(t,e){e[Ge]=t.length===2?E.parseTwoDigitYear(t):le(t)}),ke("YY",function(t,e){e[Ge]=E.parseTwoDigitYear(t)}),ke("Y",function(t,e){e[Ge]=parseInt(t,10)});function Oo(t){return na(t)?366:365}E.parseTwoDigitYear=function(t){return le(t)+(le(t)>68?1900:2e3)};var Wm=wi("FullYear",!0);function xB(){return na(this.year())}function wi(t,e){return function(n){return n!=null?(Ym(this,t,n),E.updateOffset(this,e),this):To(this,t)}}function To(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ym(t,e,n){var r,i,o,s,a;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,s=t.month(),a=t.date(),a=a===29&&s===1&&!na(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function SB(t){return t=Et(t),sn(this[t])?this[t]():this}function CB(t,e){if(typeof t=="object"){t=Ac(t);var n=pB(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=Et(t),sn(this[t]))return this[t](e);return this}function MB(t,e){return(t%e+e)%e}var Oe;Array.prototype.indexOf?Oe=Array.prototype.indexOf:Oe=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function Ic(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=MB(e,12);return t+=(e-n)/12,n===1?na(t)?29:28:31-n%7%2}G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),G("MMMM",0,0,function(t){return this.localeData().months(this,t)}),U("M",ve,ki),U("MM",ve,bt),U("MMM",function(t,e){return e.monthsShortRegex(t)}),U("MMMM",function(t,e){return e.monthsRegex(t)}),ke(["M","MM"],function(t,e){e[xn]=le(t)-1}),ke(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[xn]=i:ie(n).invalidMonth=t});var OB="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Um="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),qm=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,TB=Co,EB=Co;function _B(t,e){return t?Ft(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||qm).test(e)?"format":"standalone"][t.month()]:Ft(this._months)?this._months:this._months.standalone}function NB(t,e){return t?Ft(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[qm.test(e)?"format":"standalone"][t.month()]:Ft(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function DB(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=on([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=Oe.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Oe.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Oe.call(this._shortMonthsParse,s),i!==-1?i:(i=Oe.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Oe.call(this._longMonthsParse,s),i!==-1?i:(i=Oe.call(this._shortMonthsParse,s),i!==-1?i:null))}function AB(t,e,n){var r,i,o;if(this._monthsParseExact)return DB.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=on([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function Gm(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=le(e);else if(e=t.localeData().monthsParse(e),!wn(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,Ic(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function Km(t){return t!=null?(Gm(this,t),E.updateOffset(this,!0),this):To(this,"Month")}function $B(){return Ic(this.year(),this.month())}function BB(t){return this._monthsParseExact?(fe(this,"_monthsRegex")||Jm.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(fe(this,"_monthsShortRegex")||(this._monthsShortRegex=TB),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function VB(t){return this._monthsParseExact?(fe(this,"_monthsRegex")||Jm.call(this),t?this._monthsStrictRegex:this._monthsRegex):(fe(this,"_monthsRegex")||(this._monthsRegex=EB),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function Jm(){function t(l,d){return d.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=on([2e3,i]),s=vn(this.monthsShort(o,"")),a=vn(this.months(o,"")),e.push(s),n.push(a),r.push(a),r.push(s);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function PB(t,e,n,r,i,o,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,n,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,r,i,o,s),a}function Eo(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function ra(t,e,n){var r=7+e-n,i=(7+Eo(t,0,r).getUTCDay()-e)%7;return-i+r-1}function Zm(t,e,n,r,i){var o=(7+n-r)%7,s=ra(t,r,i),a=1+7*(e-1)+o+s,l,d;return a<=0?(l=t-1,d=Oo(l)+a):a>Oo(t)?(l=t+1,d=a-Oo(t)):(l=t,d=a),{year:l,dayOfYear:d}}function _o(t,e,n){var r=ra(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+Cn(s,e,n)):i>Cn(t.year(),e,n)?(o=i-Cn(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function Cn(t,e,n){var r=ra(t,e,n),i=ra(t+1,e,n);return(Oo(t)-r+i)/7}G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),U("w",ve,ki),U("ww",ve,bt),U("W",ve,ki),U("WW",ve,bt),Mo(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=le(t)});function IB(t){return _o(t,this._week.dow,this._week.doy).week}var RB={dow:0,doy:6};function LB(){return this._week.dow}function FB(){return this._week.doy}function zB(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function jB(t){var e=_o(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}G("d",0,"do","day"),G("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),G("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),G("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),U("d",ve),U("e",ve),U("E",ve),U("dd",function(t,e){return e.weekdaysMinRegex(t)}),U("ddd",function(t,e){return e.weekdaysShortRegex(t)}),U("dddd",function(t,e){return e.weekdaysRegex(t)}),Mo(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:ie(n).invalidWeekday=t}),Mo(["d","e","E"],function(t,e,n,r){e[r]=le(t)});function HB(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function WB(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Rc(t,e){return t.slice(e,7).concat(t.slice(0,e))}var YB="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Xm="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),UB="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qB=Co,GB=Co,KB=Co;function JB(t,e){var n=Ft(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?Rc(n,this._week.dow):t?n[t.day()]:n}function ZB(t){return t===!0?Rc(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function XB(t){return t===!0?Rc(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function QB(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=on([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?e==="dddd"?(i=Oe.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Oe.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Oe.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Oe.call(this._weekdaysParse,s),i!==-1||(i=Oe.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Oe.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Oe.call(this._shortWeekdaysParse,s),i!==-1||(i=Oe.call(this._weekdaysParse,s),i!==-1)?i:(i=Oe.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Oe.call(this._minWeekdaysParse,s),i!==-1||(i=Oe.call(this._weekdaysParse,s),i!==-1)?i:(i=Oe.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function eV(t,e,n){var r,i,o;if(this._weekdaysParseExact)return QB.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=on([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function tV(t){if(!this.isValid())return t!=null?this:NaN;var e=To(this,"Day");return t!=null?(t=HB(t,this.localeData()),this.add(t-e,"d")):e}function nV(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function rV(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=WB(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function iV(t){return this._weekdaysParseExact?(fe(this,"_weekdaysRegex")||Lc.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(fe(this,"_weekdaysRegex")||(this._weekdaysRegex=qB),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function oV(t){return this._weekdaysParseExact?(fe(this,"_weekdaysRegex")||Lc.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(fe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=GB),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function sV(t){return this._weekdaysParseExact?(fe(this,"_weekdaysRegex")||Lc.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(fe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=KB),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Lc(){function t(u,f){return f.length-u.length}var e=[],n=[],r=[],i=[],o,s,a,l,d;for(o=0;o<7;o++)s=on([2e3,1]).day(o),a=vn(this.weekdaysMin(s,"")),l=vn(this.weekdaysShort(s,"")),d=vn(this.weekdays(s,"")),e.push(a),n.push(l),r.push(d),i.push(a),i.push(l),i.push(d);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Fc(){return this.hours()%12||12}function aV(){return this.hours()||24}G("H",["HH",2],0,"hour"),G("h",["hh",2],0,Fc),G("k",["kk",2],0,aV),G("hmm",0,0,function(){return""+Fc.apply(this)+an(this.minutes(),2)}),G("hmmss",0,0,function(){return""+Fc.apply(this)+an(this.minutes(),2)+an(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+an(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+an(this.minutes(),2)+an(this.seconds(),2)});function Qm(t,e){G(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Qm("a",!0),Qm("A",!1);function eg(t,e){return e._meridiemParse}U("a",eg),U("A",eg),U("H",ve,Vc),U("h",ve,ki),U("k",ve,ki),U("HH",ve,bt),U("hh",ve,bt),U("kk",ve,bt),U("hmm",jm),U("hmmss",Hm),U("Hmm",jm),U("Hmmss",Hm),ke(["H","HH"],Ae),ke(["k","kk"],function(t,e,n){var r=le(t);e[Ae]=r===24?0:r}),ke(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ke(["h","hh"],function(t,e,n){e[Ae]=le(t),ie(n).bigHour=!0}),ke("hmm",function(t,e,n){var r=t.length-2;e[Ae]=le(t.substr(0,r)),e[jt]=le(t.substr(r)),ie(n).bigHour=!0}),ke("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Ae]=le(t.substr(0,r)),e[jt]=le(t.substr(r,2)),e[Sn]=le(t.substr(i)),ie(n).bigHour=!0}),ke("Hmm",function(t,e,n){var r=t.length-2;e[Ae]=le(t.substr(0,r)),e[jt]=le(t.substr(r))}),ke("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Ae]=le(t.substr(0,r)),e[jt]=le(t.substr(r,2)),e[Sn]=le(t.substr(i))});function lV(t){return(t+"").toLowerCase().charAt(0)==="p"}var cV=/[ap]\.?m?\.?/i,dV=wi("Hours",!0);function uV(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var tg={calendar:Q$,longDateFormat:rB,invalidDate:oB,ordinal:aB,dayOfMonthOrdinalParse:lB,relativeTime:dB,months:OB,monthsShort:Um,week:RB,weekdays:YB,weekdaysMin:UB,weekdaysShort:Xm,meridiemParse:cV},Ce={},No={},Do;function fV(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function ng(t){return t&&t.toLowerCase().replace("_","-")}function hV(t){for(var e=0,n,r,i,o;e<t.length;){for(o=ng(t[e]).split("-"),n=o.length,r=ng(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=ia(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&fV(o,r)>=n-1)break;n--}e++}return Do}function pV(t){return!!(t&&t.match("^[^/\\\\]*$"))}function ia(t){var e=null,n;if(Ce[t]===void 0&&typeof module<"u"&&module&&module.exports&&pV(t))try{e=Do._abbr,n=require,n("./locale/"+t),Xn(e)}catch{Ce[t]=null}return Ce[t]}function Xn(t,e){var n;return t&&(dt(e)?n=Mn(t):n=zc(t,e),n?Do=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Do._abbr}function zc(t,e){if(e!==null){var n,r=tg;if(e.abbr=t,Ce[t]!=null)Im("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Ce[t]._config;else if(e.parentLocale!=null)if(Ce[e.parentLocale]!=null)r=Ce[e.parentLocale]._config;else if(n=ia(e.parentLocale),n!=null)r=n._config;else return No[e.parentLocale]||(No[e.parentLocale]=[]),No[e.parentLocale].push({name:t,config:e}),null;return Ce[t]=new Ec(Tc(r,e)),No[t]&&No[t].forEach(function(i){zc(i.name,i.config)}),Xn(t),Ce[t]}else return delete Ce[t],null}function mV(t,e){if(e!=null){var n,r,i=tg;Ce[t]!=null&&Ce[t].parentLocale!=null?Ce[t].set(Tc(Ce[t]._config,e)):(r=ia(t),r!=null&&(i=r._config),e=Tc(i,e),r==null&&(e.abbr=t),n=new Ec(e),n.parentLocale=Ce[t],Ce[t]=n),Xn(t)}else Ce[t]!=null&&(Ce[t].parentLocale!=null?(Ce[t]=Ce[t].parentLocale,t===Xn()&&Xn(t)):Ce[t]!=null&&delete Ce[t]);return Ce[t]}function Mn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Do;if(!Ft(t)){if(e=ia(t),e)return e;t=[t]}return hV(t)}function gV(){return _c(Ce)}function jc(t){var e,n=t._a;return n&&ie(t).overflow===-2&&(e=n[xn]<0||n[xn]>11?xn:n[ln]<1||n[ln]>Ic(n[Ge],n[xn])?ln:n[Ae]<0||n[Ae]>24||n[Ae]===24&&(n[jt]!==0||n[Sn]!==0||n[Mr]!==0)?Ae:n[jt]<0||n[jt]>59?jt:n[Sn]<0||n[Sn]>59?Sn:n[Mr]<0||n[Mr]>999?Mr:-1,ie(t)._overflowDayOfYear&&(e<Ge||e>ln)&&(e=ln),ie(t)._overflowWeeks&&e===-1&&(e=wB),ie(t)._overflowWeekday&&e===-1&&(e=vB),ie(t).overflow=e),t}var yV=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,bV=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kV=/Z|[+-]\d\d(?::?\d\d)?/,oa=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Hc=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],wV=/^\/?Date\((-?\d+)/i,vV=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,xV={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function rg(t){var e,n,r=t._i,i=yV.exec(r)||bV.exec(r),o,s,a,l,d=oa.length,u=Hc.length;if(i){for(ie(t).iso=!0,e=0,n=d;e<n;e++)if(oa[e][1].exec(i[1])){s=oa[e][0],o=oa[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=u;e<n;e++)if(Hc[e][1].exec(i[3])){a=(i[2]||" ")+Hc[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(kV.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),Yc(t)}else t._isValid=!1}function SV(t,e,n,r,i,o){var s=[CV(t),Um.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function CV(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function MV(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function OV(t,e,n){if(t){var r=Xm.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return ie(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function TV(t,e,n){if(t)return xV[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function ig(t){var e=vV.exec(MV(t._i)),n;if(e){if(n=SV(e[4],e[3],e[2],e[5],e[6],e[7]),!OV(e[1],n,t))return;t._a=n,t._tzm=TV(e[8],e[9],e[10]),t._d=Eo.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),ie(t).rfc2822=!0}else t._isValid=!1}function EV(t){var e=wV.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(rg(t),t._isValid===!1)delete t._isValid;else return;if(ig(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:E.createFromInputFallback(t)}E.createFromInputFallback=Tt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function vi(t,e,n){return t??e??n}function _V(t){var e=new Date(E.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Wc(t){var e,n,r=[],i,o,s;if(!t._d){for(i=_V(t),t._w&&t._a[ln]==null&&t._a[xn]==null&&NV(t),t._dayOfYear!=null&&(s=vi(t._a[Ge],i[Ge]),(t._dayOfYear>Oo(s)||t._dayOfYear===0)&&(ie(t)._overflowDayOfYear=!0),n=Eo(s,0,t._dayOfYear),t._a[xn]=n.getUTCMonth(),t._a[ln]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[Ae]===24&&t._a[jt]===0&&t._a[Sn]===0&&t._a[Mr]===0&&(t._nextDay=!0,t._a[Ae]=0),t._d=(t._useUTC?Eo:PB).apply(null,r),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Ae]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(ie(t).weekdayMismatch=!0)}}function NV(t){var e,n,r,i,o,s,a,l,d;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(o=1,s=4,n=vi(e.GG,t._a[Ge],_o(xe(),1,4).year),r=vi(e.W,1),i=vi(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,d=_o(xe(),o,s),n=vi(e.gg,t._a[Ge],d.year),r=vi(e.w,d.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>Cn(n,o,s)?ie(t)._overflowWeeks=!0:l!=null?ie(t)._overflowWeekday=!0:(a=Zm(n,r,i,o,s),t._a[Ge]=a.year,t._dayOfYear=a.dayOfYear)}E.ISO_8601=function(){},E.RFC_2822=function(){};function Yc(t){if(t._f===E.ISO_8601){rg(t);return}if(t._f===E.RFC_2822){ig(t);return}t._a=[],ie(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,d,u;for(i=Rm(t._f,t._locale).match(Nc)||[],u=i.length,n=0;n<u;n++)o=i[n],r=(e.match(yB(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&ie(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),yi[o]?(r?ie(t).empty=!1:ie(t).unusedTokens.push(o),kB(o,r,t)):t._strict&&!r&&ie(t).unusedTokens.push(o);ie(t).charsLeftOver=a-l,e.length>0&&ie(t).unusedInput.push(e),t._a[Ae]<=12&&ie(t).bigHour===!0&&t._a[Ae]>0&&(ie(t).bigHour=void 0),ie(t).parsedDateParts=t._a.slice(0),ie(t).meridiem=t._meridiem,t._a[Ae]=DV(t._locale,t._a[Ae],t._meridiem),d=ie(t).era,d!==null&&(t._a[Ge]=t._locale.erasConvertYear(d,t._a[Ge])),Wc(t),jc(t)}function DV(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function AV(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){ie(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=Oc({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],Yc(e),Cc(e)&&(s=!0),o+=ie(e).charsLeftOver,o+=ie(e).unusedTokens.length*10,ie(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));Zn(t,n||e)}function $V(t){if(!t._d){var e=Ac(t._i),n=e.day===void 0?e.date:e.day;t._a=$m([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),Wc(t)}}function BV(t){var e=new So(jc(og(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function og(t){var e=t._i,n=t._f;return t._locale=t._locale||Mn(t._l),e===null||n===void 0&&e===""?qs({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),zt(e)?new So(jc(e)):(xo(e)?t._d=e:Ft(n)?AV(t):n?Yc(t):VV(t),Cc(t)||(t._d=null),t))}function VV(t){var e=t._i;dt(e)?t._d=new Date(E.now()):xo(e)?t._d=new Date(e.valueOf()):typeof e=="string"?EV(t):Ft(e)?(t._a=$m(e.slice(0),function(n){return parseInt(n,10)}),Wc(t)):Cr(e)?$V(t):wn(e)?t._d=new Date(e):E.createFromInputFallback(t)}function sg(t,e,n,r,i){var o={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Cr(t)&&xc(t)||Ft(t)&&t.length===0)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,BV(o)}function xe(t,e,n,r){return sg(t,e,n,r,!1)}var PV=Tt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=xe.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:qs()}),IV=Tt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=xe.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:qs()});function ag(t,e){var n,r;if(e.length===1&&Ft(e[0])&&(e=e[0]),!e.length)return xe();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function RV(){var t=[].slice.call(arguments,0);return ag("isBefore",t)}function LV(){var t=[].slice.call(arguments,0);return ag("isAfter",t)}var FV=function(){return Date.now?Date.now():+new Date},Ao=["year","quarter","month","week","day","hour","minute","second","millisecond"];function zV(t){var e,n=!1,r,i=Ao.length;for(e in t)if(fe(t,e)&&!(Oe.call(Ao,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[Ao[r]]){if(n)return!1;parseFloat(t[Ao[r]])!==le(t[Ao[r]])&&(n=!0)}return!0}function jV(){return this._isValid}function HV(){return Ht(NaN)}function sa(t){var e=Ac(t),n=e.year||0,r=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,l=e.minute||0,d=e.second||0,u=e.millisecond||0;this._isValid=zV(e),this._milliseconds=+u+d*1e3+l*6e4+a*1e3*60*60,this._days=+s+o*7,this._months=+i+r*3+n*12,this._data={},this._locale=Mn(),this._bubble()}function aa(t){return t instanceof sa}function Uc(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function WV(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0,s;for(s=0;s<r;s++)le(t[s])!==le(e[s])&&o++;return o+i}function lg(t,e){G(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+an(~~(n/60),2)+e+an(~~n%60,2)})}lg("Z",":"),lg("ZZ",""),U("Z",ea),U("ZZ",ea),ke(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=qc(ea,t)});var YV=/([\+\-]|\d\d)/gi;function qc(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(YV)||["-",0,0],o=+(i[1]*60)+le(i[2]),o===0?0:i[0]==="+"?o:-o)}function Gc(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(zt(t)||xo(t)?t.valueOf():xe(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),E.updateOffset(n,!1),n):xe(t).local()}function Kc(t){return-Math.round(t._d.getTimezoneOffset())}E.updateOffset=function(){};function UV(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=qc(ea,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=Kc(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?fg(this,Ht(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,E.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Kc(this)}function qV(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function GV(t){return this.utcOffset(0,t)}function KV(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Kc(this),"m")),this}function JV(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=qc(mB,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function ZV(t){return this.isValid()?(t=t?xe(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function XV(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function QV(){if(!dt(this._isDSTShifted))return this._isDSTShifted;var t={},e;return Oc(t,this),t=og(t),t._a?(e=t._isUTC?on(t._a):xe(t._a),this._isDSTShifted=this.isValid()&&WV(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function e5(){return this.isValid()?!this._isUTC:!1}function t5(){return this.isValid()?this._isUTC:!1}function cg(){return this.isValid()?this._isUTC&&this._offset===0:!1}var n5=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,r5=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ht(t,e){var n=t,r=null,i,o,s;return aa(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:wn(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=n5.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:le(r[ln])*i,h:le(r[Ae])*i,m:le(r[jt])*i,s:le(r[Sn])*i,ms:le(Uc(r[Mr]*1e3))*i}):(r=r5.exec(t))?(i=r[1]==="-"?-1:1,n={y:Or(r[2],i),M:Or(r[3],i),w:Or(r[4],i),d:Or(r[5],i),h:Or(r[6],i),m:Or(r[7],i),s:Or(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=i5(xe(n.from),xe(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new sa(n),aa(t)&&fe(t,"_locale")&&(o._locale=t._locale),aa(t)&&fe(t,"_isValid")&&(o._isValid=t._isValid),o}Ht.fn=sa.prototype,Ht.invalid=HV;function Or(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function dg(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function i5(t,e){var n;return t.isValid()&&e.isValid()?(e=Gc(e,t),t.isBefore(e)?n=dg(t,e):(n=dg(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ug(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(Im(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),i=Ht(n,r),fg(this,i,t),this}}function fg(t,e,n,r){var i=e._milliseconds,o=Uc(e._days),s=Uc(e._months);t.isValid()&&(r=r??!0,s&&Gm(t,To(t,"Month")+s*n),o&&Ym(t,"Date",To(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&E.updateOffset(t,o||s))}var o5=ug(1,"add"),s5=ug(-1,"subtract");function hg(t){return typeof t=="string"||t instanceof String}function a5(t){return zt(t)||xo(t)||hg(t)||wn(t)||c5(t)||l5(t)||t===null||t===void 0}function l5(t){var e=Cr(t)&&!xc(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=r.length;for(i=0;i<s;i+=1)o=r[i],n=n||fe(t,o);return e&&n}function c5(t){var e=Ft(t),n=!1;return e&&(n=t.filter(function(r){return!wn(r)&&hg(t)}).length===0),e&&n}function d5(t){var e=Cr(t)&&!xc(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<r.length;i+=1)o=r[i],n=n||fe(t,o);return e&&n}function u5(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function f5(t,e){arguments.length===1&&(arguments[0]?a5(arguments[0])?(t=arguments[0],e=void 0):d5(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||xe(),r=Gc(n,this).startOf("day"),i=E.calendarFormat(this,r)||"sameElse",o=e&&(sn(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,xe(n)))}function h5(){return new So(this)}function p5(t,e){var n=zt(t)?t:xe(t);return this.isValid()&&n.isValid()?(e=Et(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function m5(t,e){var n=zt(t)?t:xe(t);return this.isValid()&&n.isValid()?(e=Et(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function g5(t,e,n,r){var i=zt(t)?t:xe(t),o=zt(e)?e:xe(e);return this.isValid()&&i.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function y5(t,e){var n=zt(t)?t:xe(t),r;return this.isValid()&&n.isValid()?(e=Et(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function b5(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function k5(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function w5(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=Gc(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Et(e),e){case"year":o=la(this,r)/12;break;case"month":o=la(this,r);break;case"quarter":o=la(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:_t(o)}function la(t,e){if(t.date()<e.date())return-la(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,o;return e-r<0?(i=t.clone().add(n-1,"months"),o=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),o=(e-r)/(i-r)),-(n+o)||0}E.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",E.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function v5(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function x5(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Ks(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):sn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ks(n,"Z")):Ks(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function S5(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,o;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",o=e+'[")]',this.format(n+r+i+o)}function C5(t){t||(t=this.isUtc()?E.defaultFormatUtc:E.defaultFormat);var e=Ks(this,t);return this.localeData().postformat(e)}function M5(t,e){return this.isValid()&&(zt(t)&&t.isValid()||xe(t).isValid())?Ht({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function O5(t){return this.from(xe(),t)}function T5(t,e){return this.isValid()&&(zt(t)&&t.isValid()||xe(t).isValid())?Ht({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function E5(t){return this.to(xe(),t)}function pg(t){var e;return t===void 0?this._locale._abbr:(e=Mn(t),e!=null&&(this._locale=e),this)}var mg=Tt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function gg(){return this._locale}var ca=1e3,xi=60*ca,da=60*xi,yg=(365*400+97)*24*da;function Si(t,e){return(t%e+e)%e}function bg(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-yg:new Date(t,e,n).valueOf()}function kg(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-yg:Date.UTC(t,e,n)}function _5(t){var e,n;if(t=Et(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?kg:bg,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Si(e+(this._isUTC?0:this.utcOffset()*xi),da);break;case"minute":e=this._d.valueOf(),e-=Si(e,xi);break;case"second":e=this._d.valueOf(),e-=Si(e,ca);break}return this._d.setTime(e),E.updateOffset(this,!0),this}function N5(t){var e,n;if(t=Et(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?kg:bg,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=da-Si(e+(this._isUTC?0:this.utcOffset()*xi),da)-1;break;case"minute":e=this._d.valueOf(),e+=xi-Si(e,xi)-1;break;case"second":e=this._d.valueOf(),e+=ca-Si(e,ca)-1;break}return this._d.setTime(e),E.updateOffset(this,!0),this}function D5(){return this._d.valueOf()-(this._offset||0)*6e4}function A5(){return Math.floor(this.valueOf()/1e3)}function $5(){return new Date(this.valueOf())}function B5(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function V5(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function P5(){return this.isValid()?this.toISOString():null}function I5(){return Cc(this)}function R5(){return Zn({},ie(this))}function L5(){return ie(this).overflow}function F5(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}G("N",0,0,"eraAbbr"),G("NN",0,0,"eraAbbr"),G("NNN",0,0,"eraAbbr"),G("NNNN",0,0,"eraName"),G("NNNNN",0,0,"eraNarrow"),G("y",["y",1],"yo","eraYear"),G("y",["yy",2],0,"eraYear"),G("y",["yyy",3],0,"eraYear"),G("y",["yyyy",4],0,"eraYear"),U("N",Jc),U("NN",Jc),U("NNN",Jc),U("NNNN",Z5),U("NNNNN",X5),ke(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?ie(n).era=i:ie(n).invalidEra=t}),U("y",bi),U("yy",bi),U("yyy",bi),U("yyyy",bi),U("yo",Q5),ke(["y","yy","yyy","yyyy"],Ge),ke(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Ge]=n._locale.eraYearOrdinalParse(t,i):e[Ge]=parseInt(t,10)});function z5(t,e){var n,r,i,o=this._eras||Mn("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":i=E(o[n].since).startOf("day"),o[n].since=i.valueOf();break}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":i=E(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf();break}}return o}function j5(t,e,n){var r,i,o=this.eras(),s,a,l;for(t=t.toUpperCase(),r=0,i=o.length;r<i;++r)if(s=o[r].name.toUpperCase(),a=o[r].abbr.toUpperCase(),l=o[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(a===t)return o[r];break;case"NNNN":if(s===t)return o[r];break;case"NNNNN":if(l===t)return o[r];break}else if([s,a,l].indexOf(t)>=0)return o[r]}function H5(t,e){var n=t.since<=t.until?1:-1;return e===void 0?E(t.since).year():E(t.since).year()+(e-t.offset)*n}function W5(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function Y5(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function U5(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function q5(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-E(i[t].since).year())*n+i[t].offset;return this.year()}function G5(t){return fe(this,"_erasNameRegex")||Zc.call(this),t?this._erasNameRegex:this._erasRegex}function K5(t){return fe(this,"_erasAbbrRegex")||Zc.call(this),t?this._erasAbbrRegex:this._erasRegex}function J5(t){return fe(this,"_erasNarrowRegex")||Zc.call(this),t?this._erasNarrowRegex:this._erasRegex}function Jc(t,e){return e.erasAbbrRegex(t)}function Z5(t,e){return e.erasNameRegex(t)}function X5(t,e){return e.erasNarrowRegex(t)}function Q5(t,e){return e._eraYearOrdinalRegex||bi}function Zc(){var t=[],e=[],n=[],r=[],i,o,s,a,l,d=this.eras();for(i=0,o=d.length;i<o;++i)s=vn(d[i].name),a=vn(d[i].abbr),l=vn(d[i].narrow),e.push(s),t.push(a),n.push(l),r.push(s),r.push(a),r.push(l);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100});function ua(t,e){G(0,[t,t.length],0,e)}ua("gggg","weekYear"),ua("ggggg","weekYear"),ua("GGGG","isoWeekYear"),ua("GGGGG","isoWeekYear"),U("G",Qs),U("g",Qs),U("GG",ve,bt),U("gg",ve,bt),U("GGGG",Bc,$c),U("gggg",Bc,$c),U("GGGGG",Xs,Js),U("ggggg",Xs,Js),Mo(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=le(t)}),Mo(["gg","GG"],function(t,e,n,r){e[r]=E.parseTwoDigitYear(t)});function eP(t){return wg.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function tP(t){return wg.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function nP(){return Cn(this.year(),1,4)}function rP(){return Cn(this.isoWeekYear(),1,4)}function iP(){var t=this.localeData()._week;return Cn(this.year(),t.dow,t.doy)}function oP(){var t=this.localeData()._week;return Cn(this.weekYear(),t.dow,t.doy)}function wg(t,e,n,r,i){var o;return t==null?_o(this,r,i).year:(o=Cn(t,r,i),e>o&&(e=o),sP.call(this,t,e,n,r,i))}function sP(t,e,n,r,i){var o=Zm(t,e,n,r,i),s=Eo(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}G("Q",0,"Qo","quarter"),U("Q",Fm),ke("Q",function(t,e){e[xn]=(le(t)-1)*3});function aP(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}G("D",["DD",2],"Do","date"),U("D",ve,ki),U("DD",ve,bt),U("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),ke(["D","DD"],ln),ke("Do",function(t,e){e[ln]=le(t.match(ve)[0])});var vg=wi("Date",!0);G("DDD",["DDDD",3],"DDDo","dayOfYear"),U("DDD",Zs),U("DDDD",zm),ke(["DDD","DDDD"],function(t,e,n){n._dayOfYear=le(t)});function lP(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}G("m",["mm",2],0,"minute"),U("m",ve,Vc),U("mm",ve,bt),ke(["m","mm"],jt);var cP=wi("Minutes",!1);G("s",["ss",2],0,"second"),U("s",ve,Vc),U("ss",ve,bt),ke(["s","ss"],Sn);var dP=wi("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return this.millisecond()*10}),G(0,["SSSSS",5],0,function(){return this.millisecond()*100}),G(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),G(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),G(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),G(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),U("S",Zs,Fm),U("SS",Zs,bt),U("SSS",Zs,zm);var Qn,xg;for(Qn="SSSS";Qn.length<=9;Qn+="S")U(Qn,bi);function uP(t,e){e[Mr]=le(("0."+t)*1e3)}for(Qn="S";Qn.length<=9;Qn+="S")ke(Qn,uP);xg=wi("Milliseconds",!1),G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");function fP(){return this._isUTC?"UTC":""}function hP(){return this._isUTC?"Coordinated Universal Time":""}var P=So.prototype;P.add=o5,P.calendar=f5,P.clone=h5,P.diff=w5,P.endOf=N5,P.format=C5,P.from=M5,P.fromNow=O5,P.to=T5,P.toNow=E5,P.get=SB,P.invalidAt=L5,P.isAfter=p5,P.isBefore=m5,P.isBetween=g5,P.isSame=y5,P.isSameOrAfter=b5,P.isSameOrBefore=k5,P.isValid=I5,P.lang=mg,P.locale=pg,P.localeData=gg,P.max=IV,P.min=PV,P.parsingFlags=R5,P.set=CB,P.startOf=_5,P.subtract=s5,P.toArray=B5,P.toObject=V5,P.toDate=$5,P.toISOString=x5,P.inspect=S5,typeof Symbol<"u"&&Symbol.for!=null&&(P[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),P.toJSON=P5,P.toString=v5,P.unix=A5,P.valueOf=D5,P.creationData=F5,P.eraName=W5,P.eraNarrow=Y5,P.eraAbbr=U5,P.eraYear=q5,P.year=Wm,P.isLeapYear=xB,P.weekYear=eP,P.isoWeekYear=tP,P.quarter=P.quarters=aP,P.month=Km,P.daysInMonth=$B,P.week=P.weeks=zB,P.isoWeek=P.isoWeeks=jB,P.weeksInYear=iP,P.weeksInWeekYear=oP,P.isoWeeksInYear=nP,P.isoWeeksInISOWeekYear=rP,P.date=vg,P.day=P.days=tV,P.weekday=nV,P.isoWeekday=rV,P.dayOfYear=lP,P.hour=P.hours=dV,P.minute=P.minutes=cP,P.second=P.seconds=dP,P.millisecond=P.milliseconds=xg,P.utcOffset=UV,P.utc=GV,P.local=KV,P.parseZone=JV,P.hasAlignedHourOffset=ZV,P.isDST=XV,P.isLocal=e5,P.isUtcOffset=t5,P.isUtc=cg,P.isUTC=cg,P.zoneAbbr=fP,P.zoneName=hP,P.dates=Tt("dates accessor is deprecated. Use date instead.",vg),P.months=Tt("months accessor is deprecated. Use month instead",Km),P.years=Tt("years accessor is deprecated. Use year instead",Wm),P.zone=Tt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",qV),P.isDSTShifted=Tt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",QV);function pP(t){return xe(t*1e3)}function mP(){return xe.apply(null,arguments).parseZone()}function Sg(t){return t}var he=Ec.prototype;he.calendar=eB,he.longDateFormat=iB,he.invalidDate=sB,he.ordinal=cB,he.preparse=Sg,he.postformat=Sg,he.relativeTime=uB,he.pastFuture=fB,he.set=X$,he.eras=z5,he.erasParse=j5,he.erasConvertYear=H5,he.erasAbbrRegex=K5,he.erasNameRegex=G5,he.erasNarrowRegex=J5,he.months=_B,he.monthsShort=NB,he.monthsParse=AB,he.monthsRegex=VB,he.monthsShortRegex=BB,he.week=IB,he.firstDayOfYear=FB,he.firstDayOfWeek=LB,he.weekdays=JB,he.weekdaysMin=XB,he.weekdaysShort=ZB,he.weekdaysParse=eV,he.weekdaysRegex=iV,he.weekdaysShortRegex=oV,he.weekdaysMinRegex=sV,he.isPM=lV,he.meridiem=uV;function fa(t,e,n,r){var i=Mn(),o=on().set(r,e);return i[n](o,t)}function Cg(t,e,n){if(wn(t)&&(e=t,t=void 0),t=t||"",e!=null)return fa(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=fa(t,r,n,"month");return i}function Xc(t,e,n,r){typeof t=="boolean"?(wn(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,wn(e)&&(n=e,e=void 0),e=e||"");var i=Mn(),o=t?i._week.dow:0,s,a=[];if(n!=null)return fa(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=fa(e,(s+o)%7,r,"day");return a}function gP(t,e){return Cg(t,e,"months")}function yP(t,e){return Cg(t,e,"monthsShort")}function bP(t,e,n){return Xc(t,e,n,"weekdays")}function kP(t,e,n){return Xc(t,e,n,"weekdaysShort")}function wP(t,e,n){return Xc(t,e,n,"weekdaysMin")}Xn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=le(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),E.lang=Tt("moment.lang is deprecated. Use moment.locale instead.",Xn),E.langData=Tt("moment.langData is deprecated. Use moment.localeData instead.",Mn);var On=Math.abs;function vP(){var t=this._data;return this._milliseconds=On(this._milliseconds),this._days=On(this._days),this._months=On(this._months),t.milliseconds=On(t.milliseconds),t.seconds=On(t.seconds),t.minutes=On(t.minutes),t.hours=On(t.hours),t.months=On(t.months),t.years=On(t.years),this}function Mg(t,e,n,r){var i=Ht(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function xP(t,e){return Mg(this,t,e,1)}function SP(t,e){return Mg(this,t,e,-1)}function Og(t){return t<0?Math.floor(t):Math.ceil(t)}function CP(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,o,s,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=Og(Qc(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=_t(t/1e3),r.seconds=i%60,o=_t(i/60),r.minutes=o%60,s=_t(o/60),r.hours=s%24,e+=_t(s/24),l=_t(Tg(e)),n+=l,e-=Og(Qc(l)),a=_t(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function Tg(t){return t*4800/146097}function Qc(t){return t*146097/4800}function MP(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=Et(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+Tg(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Qc(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function Tn(t){return function(){return this.as(t)}}var Eg=Tn("ms"),OP=Tn("s"),TP=Tn("m"),EP=Tn("h"),_P=Tn("d"),NP=Tn("w"),DP=Tn("M"),AP=Tn("Q"),$P=Tn("y"),BP=Eg;function VP(){return Ht(this)}function PP(t){return t=Et(t),this.isValid()?this[t+"s"]():NaN}function Tr(t){return function(){return this.isValid()?this._data[t]:NaN}}var IP=Tr("milliseconds"),RP=Tr("seconds"),LP=Tr("minutes"),FP=Tr("hours"),zP=Tr("days"),jP=Tr("months"),HP=Tr("years");function WP(){return _t(this.days()/7)}var En=Math.round,Ci={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function YP(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function UP(t,e,n,r){var i=Ht(t).abs(),o=En(i.as("s")),s=En(i.as("m")),a=En(i.as("h")),l=En(i.as("d")),d=En(i.as("M")),u=En(i.as("w")),f=En(i.as("y")),h=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||s<=1&&["m"]||s<n.m&&["mm",s]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return n.w!=null&&(h=h||u<=1&&["w"]||u<n.w&&["ww",u]),h=h||d<=1&&["M"]||d<n.M&&["MM",d]||f<=1&&["y"]||["yy",f],h[2]=e,h[3]=+t>0,h[4]=r,YP.apply(null,h)}function qP(t){return t===void 0?En:typeof t=="function"?(En=t,!0):!1}function GP(t,e){return Ci[t]===void 0?!1:e===void 0?Ci[t]:(Ci[t]=e,t==="s"&&(Ci.ss=e-1),!0)}function KP(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Ci,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},Ci,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=UP(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var ed=Math.abs;function Mi(t){return(t>0)-(t<0)||+t}function ha(){if(!this.isValid())return this.localeData().invalidDate();var t=ed(this._milliseconds)/1e3,e=ed(this._days),n=ed(this._months),r,i,o,s,a=this.asSeconds(),l,d,u,f;return a?(r=_t(t/60),i=_t(r/60),t%=60,r%=60,o=_t(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",d=Mi(this._months)!==Mi(a)?"-":"",u=Mi(this._days)!==Mi(a)?"-":"",f=Mi(this._milliseconds)!==Mi(a)?"-":"",l+"P"+(o?d+o+"Y":"")+(n?d+n+"M":"")+(e?u+e+"D":"")+(i||r||t?"T":"")+(i?f+i+"H":"")+(r?f+r+"M":"")+(t?f+s+"S":"")):"P0D"}var ue=sa.prototype;ue.isValid=jV,ue.abs=vP,ue.add=xP,ue.subtract=SP,ue.as=MP,ue.asMilliseconds=Eg,ue.asSeconds=OP,ue.asMinutes=TP,ue.asHours=EP,ue.asDays=_P,ue.asWeeks=NP,ue.asMonths=DP,ue.asQuarters=AP,ue.asYears=$P,ue.valueOf=BP,ue._bubble=CP,ue.clone=VP,ue.get=PP,ue.milliseconds=IP,ue.seconds=RP,ue.minutes=LP,ue.hours=FP,ue.days=zP,ue.weeks=WP,ue.months=jP,ue.years=HP,ue.humanize=KP,ue.toISOString=ha,ue.toString=ha,ue.toJSON=ha,ue.locale=pg,ue.localeData=gg,ue.toIsoString=Tt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ha),ue.lang=mg,G("X",0,0,"unix"),G("x",0,0,"valueOf"),U("x",Qs),U("X",gB),ke("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),ke("x",function(t,e,n){n._d=new Date(le(t))});//! moment.js
129
- E.version="2.30.1",J$(xe),E.fn=P,E.min=RV,E.max=LV,E.now=FV,E.utc=on,E.unix=pP,E.months=gP,E.isDate=xo,E.locale=Xn,E.invalid=qs,E.duration=Ht,E.isMoment=zt,E.weekdays=bP,E.parseZone=mP,E.localeData=Mn,E.isDuration=aa,E.monthsShort=yP,E.weekdaysMin=wP,E.defineLocale=zc,E.updateLocale=mV,E.locales=gV,E.weekdaysShort=kP,E.normalizeUnits=Et,E.relativeTimeRounding=qP,E.relativeTimeThreshold=GP,E.calendarFormat=u5,E.prototype=P,E.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const td={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,off:Boolean,disabled:Boolean,highlight:Boolean},setup(t){const e={pmi:"","wpic-tools":"hover:text-lime-500 group-[.is-off]:text-gray-400 dark:group-[.is-off]:text-gray-700 group-[.is-today]:text-lime-500 group-[.is-today]:font-medium group-[.is-selected]:bg-lime-500 dark:group-[.is-selected]:bg-lime-600 group-[.is-selected]:!text-white rounded-full"},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-gray-200"},r={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800"},i={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-l-0"},o={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-r-0"},s={pmi:"","wpic-tools":"bg-gray-200"};return(a,l)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[c.createElementVNode("div",{class:c.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[c.unref(Q).theme]}`]:t.between,[`${i[c.unref(Q).theme]}`]:t.firstDay,[`${o[c.unref(Q).theme]}`]:t.lastDay,[`${s[c.unref(Q).theme]}`]:t.highlight}]),style:c.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[c.createElementVNode("span",{class:c.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[c.unref(Q).theme]}`]:!0,[`${n[c.unref(Q).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[c.renderSlot(a.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.day),1)])],2)],6)],2))}},JP={class:"w-full dark:text-gray-400"},ZP={class:"flex justify-between items-center mb-3"},XP={class:"flex"},QP={class:"font-medium"},eI={class:"flex"},tI={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},nI={class:"flex justify-center text-sm"},_g=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,maxDate:{},minDate:{},week:Boolean,initDates:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=c.ref([E(new Date).subtract(1,"month"),E(new Date)]);c.watch(()=>n.initDates,()=>{var A;!n.range&&n.initDates?r.value[0]=E(n.initDates):!n.range&&!n.initDates?r.value[0]=E(new Date):n.range&&((A=n.initDates)==null?void 0:A.length)==2&&(r.value[0]=E(n.initDates[0]),r.value[1]=E(n.initDates[1]),r.value[0].isSame(r.value[1],"month")&&(r.value[1]=E(n.initDates[0]).add(1,"month")))},{immediate:!0,once:!0});const i=e,o=c.computed(()=>n.doubleMonths||n.range?[0,1]:[0]);function s(A){var I,F,R;if(n.week)i("update:modelValue",[E(A).startOf("week"),E(A).endOf("week")]);else if(n.range){if(((I=n.modelValue)==null?void 0:I.length)==0)i("update:modelValue",[A]);else if(((F=n.modelValue)==null?void 0:F.length)==2)i("update:modelValue",[A]);else if(((R=n.modelValue)==null?void 0:R.length)==1){let D=[E(n.modelValue[0]),E(A)];D=D.sort((J,pe)=>J-pe),i("update:modelValue",D)}}else i("update:modelValue",E(A))}function a(A){const I=E(A).daysInMonth(),F=[],R=E(A).startOf("month");for(let D=1;D<=I;D++){let J=R.clone().date(D);F.push(J)}return F}function l(A){return E(A).startOf("month").day()}function d(A,I){const F=E(`${A}-${I}-01`,"YYYY-MM-DD"),D=F.day(),J=[];for(let pe=0;pe<D;pe++)J.push(F.clone().subtract(D-pe,"days"));return J}function u(A,I){const F=E(`${A}-${I}`,"YYYY-MM").endOf("month"),D=6-F.day(),J=[];for(let pe=1;pe<=D;pe++)J.push(F.clone().add(pe,"days"));return J}function f(A){const I=E();return E(A).isSame(I,"day")}function h(A){var I,F;if(n.range){if(((I=n.modelValue)==null?void 0:I.length)==1)return E(A).isSame(E(n.modelValue[0]),"day");if(((F=n.modelValue)==null?void 0:F.length)==2)return E(A).isSame(E(n.modelValue[0]),"day")||E(A).isSame(E(n.modelValue[1]),"day")}else if(n.modelValue)return E(A).isSame(E(n.modelValue),"day")}function p(A){var I;if(n.range&&((I=n.modelValue)==null?void 0:I.length)==2)return E(A).isBetween(E(n.modelValue[0]),E(n.modelValue[1]))}function m(A){var I;if(n.range&&((I=n.modelValue)==null?void 0:I.length)==2)return E(A).isSame(E(n.modelValue[0]),"day")}function g(A){var I;if(n.range&&((I=n.modelValue)==null?void 0:I.length)==2)return E(A).isSame(E(n.modelValue[1]),"day")}function y(A){try{return n.minDate?E(A).isBefore(E(n.minDate)):!1}catch(I){return console.log(I),!1}}function w(A){try{return n.maxDate?E(A).isAfter(E(n.maxDate)):!1}catch(I){return console.log(I),!1}}function v(A){k(A,r.value[A].subtract(1,"month"))}function T(A){k(A,r.value[A].add(1,"month"))}function b(A){k(A,r.value[A].subtract(1,"year"))}function S(A){k(A,r.value[A].add(1,"year"))}function k(A,I){A==0?r.value=[I,r.value[1]]:r.value=[r.value[0],I]}const C=c.ref();function _(A){n.week&&(C.value=E(A).week())}function N(A){return E(A).week()===C.value}function L(A){return E(A).week()===C.value?E(A).format("YYYY-MM-DD")===E().week(C.value).startOf("week").format("YYYY-MM-DD"):!1}function Z(A){return E(A).week()===C.value?E(A).format("YYYY-MM-DD")===E().week(C.value).endOf("week").format("YYYY-MM-DD"):!1}function j(){C.value=null}return(A,I)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":o.value.length===1,"min-w-192":o.value.length===2}])},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,F=>{var R;return c.openBlock(),c.createElementBlock("div",JP,[c.createElementVNode("div",ZP,[c.createElementVNode("div",XP,[c.createVNode(Xu,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>b(F)},null,8,["onClick"]),c.createVNode(Qu,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>v(F)},null,8,["onClick"])]),c.createElementVNode("div",QP,c.toDisplayString(r.value[F].format("YYYY MMMM")),1),c.createElementVNode("div",eI,[c.createVNode(tf,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>T(F)},null,8,["onClick"]),c.createVNode(ef,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>S(F)},null,8,["onClick"])])]),c.createElementVNode("div",tI,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(7,D=>{var J;return c.createElementVNode("div",nI,c.toDisplayString((J=r.value[F])==null?void 0:J.clone().startOf("week").subtract(1,"days").add(D,"days").format("ddd")),1)}),64))]),c.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:j},[l(r.value[F])>0?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(d(c.unref(E)(r.value[F]).year(),c.unref(E)(r.value[F]).month()+1),D=>(c.openBlock(),c.createBlock(td,{onClick:J=>!w(D)&&!y(D)?s(D):null,onMouseover:J=>_(D),today:f(D),selected:h(D),firstDay:m(D)||L(D),lastDay:g(D)||Z(D),between:p(D),highlight:N(D),off:""},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(E)(D).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(a(r.value[F].clone()),D=>(c.openBlock(),c.createBlock(td,{onMouseover:J=>_(D),onClick:J=>!w(D)&&!y(D)?s(D):null,today:f(D),selected:h(D),firstDay:m(D)||L(D),lastDay:g(D)||Z(D),between:p(D),disabled:w(D)||y(D),off:w(D)||y(D),highlight:N(D)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(E)(D).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((R=u(c.unref(E)(r.value[F]).year(),c.unref(E)(r.value[F]).month()+1))==null?void 0:R.length)>0?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:1},c.renderList(u(c.unref(E)(r.value[F]).year(),c.unref(E)(r.value[F]).month()+1),D=>(c.openBlock(),c.createBlock(td,{onClick:J=>!w(D)||!y(D)?s(D):null,onMouseover:J=>_(D),today:f(D),selected:h(D),firstDay:m(D)||L(D),lastDay:g(D)||Z(D),between:p(D),highlight:N(D),off:""},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(E)(D).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):c.createCommentVNode("",!0)],32)])}),256))],2))}}),rI={},iI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},oI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 2.994v2.25m10.5-2.25v2.25m-14.252 13.5V7.491a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v11.251m-18 0a2.25 2.25 0 0 0 2.25 2.25h13.5a2.25 2.25 0 0 0 2.25-2.25m-18 0v-7.5a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v7.5m-6.75-6h2.25m-9 2.25h4.5m.002-2.25h.005v.006H12v-.006Zm-.001 4.5h.006v.006h-.006v-.005Zm-2.25.001h.005v.006H9.75v-.006Zm-2.25 0h.005v.005h-.006v-.005Zm6.75-2.247h.005v.005h-.005v-.005Zm0 2.247h.006v.006h-.006v-.006Zm2.25-2.248h.006V15H16.5v-.005Z"},null,-1)];function sI(t,e){return c.openBlock(),c.createElementBlock("svg",iI,oI)}const aI=de(rI,[["render",sI]]),lI={},cI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},dI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"},null,-1)];function uI(t,e){return c.openBlock(),c.createElementBlock("svg",cI,dI)}const fI=de(lI,[["render",uI]]),hI={class:"flex gap-3"},pI={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},mI=["onClick"],gI=Object.assign({name:"WpicDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,minDate:{},maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(a){r("update:modelValue",a)}const o=c.computed(()=>{var a;if(n.range)return(a=n.modelValue)==null?void 0:a.map(l=>E(l).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return E(n.modelValue).format("YYYY-MM-DD")}),s=c.reactive([{text:"Month to Date",onClick(a){const l=E().subtract(1,"day"),d=E().startOf("month");r("update:modelValue",[d,l])}},{text:"Last Month",onClick(a){const l=E().startOf("month").subtract(1,"month"),d=E(l).endOf("month");r("update:modelValue",[l,d])}},{text:"Year to Date",onClick(a){const l=E().subtract(1,"day"),d=E().startOf("year");r("update:modelValue",[d,l])}}]);return(a,l)=>(c.openBlock(),c.createBlock(Lr,{disabled:t.disabled,maxWidth:"1280px"},{content:c.withCtx(()=>[c.createElementVNode("div",hI,[t.shortcuts?(c.openBlock(),c.createElementBlock("div",pI,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s,d=>(c.openBlock(),c.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:u=>d.onClick()},c.toDisplayString(d.text),9,mI))),256))])):c.createCommentVNode("",!0),c.createVNode(_g,{shortcuts:"",doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:c.withCtx(()=>{var d;return[c.createVNode(Fa,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((d=o.value)!=null&&d.length)),onOnClear:l[0]||(l[0]=u=>i(null))},{prepend:c.withCtx(()=>[t.range?(c.openBlock(),c.createBlock(aI,{key:0,class:"dark:text-gray-400"})):(c.openBlock(),c.createBlock(fI,{key:1,class:"dark:text-gray-400"}))]),default:c.withCtx(()=>[c.createTextVNode(" "+c.toDisplayString(o.value||t.placeholder),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),yI=Object.assign({name:"WpicSlidePanel"},{props:{visible:{type:Boolean,default:!1},backgroundColor:{type:String,default:"bg-white"},options:{type:Object,default:()=>({width:"w-96",mr:"mr-0",zIndex:"z-15"})},expand:Boolean,island:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r={pmi:"dark:bg-zinc-800","wpic-tools":"dark:bg-gray-940"},i=n;function o(){i("close")}e({goBottom:l,goTop:a});const s=c.ref(null);function a(){s.value.scrollTop=0}function l(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fixed inset-0 h-full flex justify-end bg-black/50 backdrop-blur-xs transition-opacity",{"p-4":t.island,"opacity-0 pointer-events-none":!t.visible,"opacity-100":t.visible,[t.options.mr]:!0,[t.options.zIndex]:!0}]),onClick:c.withModifiers(o,["self"])},[c.createElementVNode("div",{class:c.normalizeClass(["h-full transform-gpu transition-transform",{"rounded-lg":t.island,"translate-x-0":t.visible,"translate-x-full":!t.visible,[t.backgroundColor]:!0,[t.options.width]:!0,[r[c.unref(Q).theme]]:!0}])},[c.createElementVNode("div",{ref_key:"panel",ref:s,class:c.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[c.renderSlot(d.$slots,"default")],2)],2)],2))}}),bI={class:"absolute inset-0 flex items-center justify-center py-12"},kI={class:"text-lg font-medium dark:text-gray-300"},wI={key:0,class:"flex justify-end px-6 pb-4"},vI=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,i=n;function o(){i("close")}const s=c.ref(null),a=c.ref(!1);function l(){s.value.scrollTop=0}function d(){s.value.scrollTop=s.value.scrollHeight}function u(){s.value&&r.visible&&(a.value=s.value.scrollTop+s.value.clientHeight>=s.value.scrollHeight-20)}return c.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),c.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:l,isScrolledToBottom:a}),(f,h)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[c.createElementVNode("div",bI,[c.createElementVNode("div",{class:"absolute inset-0 bg-black/10 dark:bg-black/75 z-10",onClick:o}),c.createElementVNode("div",{class:c.normalizeClass(["relative flex flex-col justify-between bg-white dark:border dark:border-gray-900 dark:bg-gray-940 rounded-lg z-20 max-h-full",{"w-4/5":t.large,"w-192":!t.large,"h-full":t.high,"overflow-hidden":!t.overflow}])},[c.createElementVNode("div",{class:c.normalizeClass(["px-6 pt-4 flex justify-between",{"border-b pb-3 dark:border-gray-900":t.border}])},[c.createElementVNode("span",kI,c.toDisplayString(t.title),1),c.createElementVNode("span",{class:"cursor-pointer",onClick:o},[c.createVNode(Rr,{class:"w-6 h-6"})])],2),c.createElementVNode("div",{ref_key:"panel",ref:s,class:c.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[c.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(c.openBlock(),c.createElementBlock("div",wI,[c.renderSlot(f.$slots,"buttons")])):c.createCommentVNode("",!0)],2)])],2))}}),xI={class:"wpic-tabs flex border-b-2 dark:border-gray-930 overflow-x-auto overflow-y-hidden"},SI=["onClick"],CI=Object.assign({name:"WpicTabs"},{props:{modelValue:{type:String,required:!0},nowrap:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=c.ref([]),o=l=>{r("update:modelValue",l)},s=l=>{i.value.push(l)},a=c.computed(()=>n.modelValue);return c.provide("addTab",s),c.provide("modelValue",a),(l,d)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",xI,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,u=>(c.openBlock(),c.createElementBlock("div",{key:u.name,class:c.normalizeClass(["border-b items-center flex leading-snug cursor-pointer py-3 px-6 -mb-[2px] font-medium",{"dark:border-gray-930":u.name!=t.modelValue,"border-b-2 text-lime-500 border-b-lime-500 dark:text-lime-600 dark:border-b-lime-600":u.name===t.modelValue,"text-gray-500 dark:text-gray-500":!u.disabled,"text-gray-300 dark:text-gray-700":u.disabled}]),onClick:f=>u.disabled?null:o(u.name)},[c.renderSlot(l.$slots,"label",{},()=>[c.createElementVNode("span",{class:c.normalizeClass({"whitespace-nowrap text-ellipsis overflow-hidden":t.nowrap})},c.toDisplayString(u.label),3)])],10,SI))),128))]),c.createElementVNode("div",null,[c.renderSlot(l.$slots,"default")])],64))}}),MI=Object.assign({name:"WpicTabPane"},{props:{label:{type:String,required:!0},name:{type:String,required:!0},noStyle:Boolean,disabled:Boolean},setup(t){const e=t,n=c.ref(!1),r=c.inject("addTab"),i=c.inject("modelValue");return c.onMounted(()=>{r({label:e.label,name:e.name,disabled:e.disabled})}),c.watch(()=>i.value,o=>{n.value=o===e.name},{immediate:!0,deep:!0}),(o,s)=>n.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["wpic-tab-pane",{"py-3 px-6":!t.noStyle}])},[c.renderSlot(o.$slots,"default")],2)):c.createCommentVNode("",!0)}}),OI={},TI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},EI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"},null,-1)];function _I(t,e){return c.openBlock(),c.createElementBlock("svg",TI,EI)}const NI=de(OI,[["render",_I]]),DI={},AI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},$I=[c.createElementVNode("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)];function BI(t,e){return c.openBlock(),c.createElementBlock("svg",AI,$I)}const VI=de(DI,[["render",BI]]),PI={},II={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},RI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function LI(t,e){return c.openBlock(),c.createElementBlock("svg",II,RI)}const FI=de(PI,[["render",LI]]),zI={},jI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},HI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function WI(t,e){return c.openBlock(),c.createElementBlock("svg",jI,HI)}const YI=de(zI,[["render",WI]]),UI={class:"w-6"},qI={class:"flex-1"},GI={key:0,class:"mb-2"},KI=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["px-4 py-3 rounded-sm text-base flex gap-4",{"bg-gray-50 text-gray-900 dark:text-gray-200 dark:bg-gray-950 text-opacity-75":!t.warning&&!t.info&&!t.error&&!t.success,"bg-amber-50 text-yellow-950 dark:text-yellow-100 dark:bg-yellow-950 text-opacity-75":t.warning,"bg-blue-50 text-blue-950 dark:text-blue-200 dark:bg-blue-950 text-opacity-75":t.info,"bg-red-100 text-red-950 dark:text-red-200 dark:bg-red-950 text-opacity-75":t.error,"bg-green-50 text-green-950 dark:text-green-200 dark:bg-green-950 text-opacity-75":t.success}])},[c.createElementVNode("div",UI,[t.warning?(c.openBlock(),c.createBlock(NI,{key:0,class:"w-full aspect-square"})):t.info?(c.openBlock(),c.createBlock(VI,{key:1,class:"w-full aspect-square"})):t.success?(c.openBlock(),c.createBlock(FI,{key:2,class:"w-full aspect-square"})):t.error?(c.openBlock(),c.createBlock(YI,{key:3,class:"w-full aspect-square"})):c.createCommentVNode("",!0)]),c.createElementVNode("div",qI,[t.title?(c.openBlock(),c.createElementBlock("div",GI,c.toDisplayString(t.title),1)):c.createCommentVNode("",!0),c.createElementVNode("span",{class:c.normalizeClass(["",{"text-gray-950 dark:text-gray-200 text-opacity-75":!t.warning&&!t.info&&!t.error&&!t.success,"text-yellow-950 dark:text-yellow-100 text-opacity-75":t.warning,"text-blue-950 dark:text-blue-200 text-opacity-75":t.info,"text-red-950 dark:text-red-200 text-opacity-75":t.error,"text-green-950 dark:text-green-200 text-opacity-75":t.success}])},[c.renderSlot(e.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.text),1)])],2)])],2))}}),nd=c.ref(!1),Ng=c.ref(""),Dg=c.ref(""),Ag=c.ref(!1),$g=c.ref(!1);let Bg=()=>{},Vg=()=>{};function rd(){const t=({title:i,text:o,positive:s=!1,negative:a=!1,onConfirm:l,onCancel:d})=>{Ng.value=i,Dg.value=o,Ag.value=s,$g.value=a,Bg=l||(()=>{}),Vg=d||(()=>{}),nd.value=!0},e=()=>{nd.value=!1};return{visible:nd,title:Ng,text:Dg,positive:Ag,negative:$g,show:t,onConfirm:()=>{Bg(),e()},onCancel:()=>{Vg(),e()}}}const JI={key:0,class:"confirm-modal-overlay z-40"},ZI={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},XI={class:"text-lg font-semibold mb-6"},QI={class:"mb-12"},eR={class:"flex justify-end"},id={WpicAlert:KI,WpicCalendar:_g,WpicTextarea:Ku,WpicDialog:vI,WpicSlidePanel:yI,WpicDateField:gI,WpicFormInput:Fa,WpicButton:Fo,WpicBadge:K$,WpicTextEditor:$$,WpicInputGroup:fy,WpicButtonGroup:ly,WpicForm:hy,WpicFormField:Ju,WpicSpinner:Br,WpicTooltip:Zu,WpicPopover:Lr,WpicChoiceList:Gu,WpicCard:cM,WpicCardSection:fM,WpicProgressBar:mM,WpicTag:yM,WpicTagGroup:bM,WpicPagination:WM,WpicLoadingPanel:xM,WpicTable:hO,WpicTableColumn:pO,WpicTabs:CI,WpicTabPane:MI,WpicConfirm:de(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:a}=rd();return(l,d)=>c.unref(e)?(c.openBlock(),c.createElementBlock("div",JI,[c.createElementVNode("div",ZI,[c.createElementVNode("div",XI,c.toDisplayString(c.unref(n)),1),c.createElementVNode("div",QI,c.toDisplayString(c.unref(r)),1),c.createElementVNode("div",eR,[c.createVNode(Fo,{onClick:c.unref(a)},{default:c.withCtx(()=>[c.createTextVNode("Cancel")]),_:1},8,["onClick"]),c.createVNode(Fo,{primary:c.unref(i),destructive:c.unref(o),onClick:c.unref(s)},{default:c.withCtx(()=>[c.createTextVNode("Confirm")]),_:1},8,["primary","destructive","onClick"])])])])):c.createCommentVNode("",!0)}}),[["__scopeId","data-v-613542ab"]])};function Pg(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?Pg(t[n],e[n]):t[n]=e[n])}const tR={useConfirm:rd};function nR(t,e){Pg(Q,e);for(const n in id)if(id.hasOwnProperty(n)){const r=id[n];t.component(r.name,r)}}const rR={install:nR,composables:tR,options:Q};Dn.default=rR,Dn.useConfirm=rd,Object.defineProperties(Dn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
120
+ h6.873c1.257,0,2.277-1.021,2.277-2.276V14.566h11.83C94.247,14.566,95.263,13.547,95.263,12.29z`})])],-1)];function bN(t,e){return c.openBlock(),c.createElementBlock("svg",gN,yN)}const kN=ce(mN,[["render",bN]]),vN={},xN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},wN=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"},null,-1)];function SN(t,e){return c.openBlock(),c.createElementBlock("svg",xN,wN)}const CN=ce(vN,[["render",SN]]),ON={class:"py-1 px-1 border-b"},EN={class:"flex gap-px"},MN=["onClick"],TN={key:1,class:"text-sm"},$N={class:"max-h-72 w-full overflow-auto px-4 py-3"},NN=Object.assign({name:"WpicTextEditor"},{props:{modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r={pmi:"shadow-inner border-zinc-400 dark:border-zinc-700/50 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 dark:text-zinc-300 bg-zinc-100 dark:bg-zinc-700/25","wpic-tools":"bg-white border border-gray-300"},i=[{method:"toggleBold",type:"chain",label:"bold",icon:pN,smallIcon:!0,disableCheck:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:cN,smallIcon:!0,disableCheck:!0},{method:"setParagraph",type:"chain",label:"paragraph",icon:kN,smallIcon:!0,disableCheck:!1},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:H$,disableCheck:!1},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:J$,disableCheck:!1},{method:"undo",type:"chain",label:"undo",icon:Q$,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:iN,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:CN,disableCheck:!0}],o=e,s=PT({content:n.modelValue,extensions:[P$,R$.configure({placeholder:"..."})],onUpdate:()=>{o("update:modelValue",s.value.getHTML())}});c.onBeforeUnmount(()=>{s.value.destroy()}),c.watch(()=>n.modelValue,d=>{d!==s.value.getHTML()&&s.value.commands.setContent(d,!1)});function l(d,u,f){u==="chain"?f?s.value.chain().focus()[d](f).run():s.value.chain().focus()[d]().run():this.editor[d]()()}function a(d,u,f,h){return h?u==="chain"?f?!s.value.can().chain().focus()[d](f).run():!s.value.can().chain().focus()[d]().run():!s.value.can()[d]().run():!1}return(d,u)=>c.unref(s)?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["pt-px relative flex flex-col rounded-sm border",r[c.unref(te).theme]])},[c.createElementVNode("div",ON,[c.createElementVNode("div",EN,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(i,f=>c.createElementVNode("div",{key:f.method,class:c.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded-sm",{"cursor-pointer":!a(f.method,f.type,f.params,f.disableCheck),"is-active text-white bg-zinc-200!":c.unref(s).isActive(f.label)}]),onClick:h=>l(f.method,f.type,f.params)},[f.icon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(f.icon),{key:0,class:c.normalizeClass(["",{"w-3 h-3":f.smallIcon,"w-4 h-4":!f.smallIcon}])},null,8,["class"])):(c.openBlock(),c.createElementBlock("span",TN,c.toDisplayString(c.unref(og).capitalize(f.label)),1))],10,MN)),64))])]),c.createElementVNode("div",$N,[c.createVNode(c.unref(IT),{editor:c.unref(s)},null,8,["editor"])])],2)):c.createCommentVNode("",!0)}}),BN={},AN={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DN=[c.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function VN(t,e){return c.openBlock(),c.createElementBlock("svg",AN,DN)}const _N=ce(BN,[["render",VN]]),IN={},PN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},RN=[c.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function LN(t,e){return c.openBlock(),c.createElementBlock("svg",PN,RN)}const zN=ce(IN,[["render",LN]]),FN={},jN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},HN=[c.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1),c.createElementVNode("line",{x1:"7.5",y1:"2",x2:"22",y2:"16",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1),c.createElementVNode("line",{x1:"2",y1:"7.5",x2:"16",y2:"22",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1)];function WN(t,e){return c.openBlock(),c.createElementBlock("svg",jN,HN)}const qN=ce(FN,[["render",WN]]),UN=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("span",{class:c.normalizeClass(["inline-flex items-center justify-center border-0 font-normal rounded-md min-h-6 gap-1 leading-none text-sm px-2",{"bg-green-100 border-green-200 text-green-700 dark:border-green-600/30 dark:bg-green-800/15 dark:text-green-500/85":t.success,"bg-yellow-100 border-yellow-200 text-yellow-700 dark:border-yellow-600/30 dark:bg-yellow-800/15 dark:text-yellow-500/85":t.warning,"bg-red-100 border-red-200 text-red-700 dark:border-red-600/30 dark:bg-red-800/15 dark:text-red-500/85":t.error,"bg-gray-100 border-gray-200 text-gray-700 dark:border-gray-600/30 dark:bg-white/5 dark:text-gray-400/85":!t.success&&!t.warning&&!t.error}])},[t.complete?(c.openBlock(),c.createBlock(_N,{key:0,class:"w-2.5 h-2.5"})):c.createCommentVNode("",!0),t.incomplete?(c.openBlock(),c.createBlock(zN,{key:1,class:"w-2.5 h-2.5 opacity-80"})):c.createCommentVNode("",!0),t.partially?(c.openBlock(),c.createBlock(qN,{key:2,class:"w-2.5 h-2.5 opacity-80"})):c.createCommentVNode("",!0),c.renderSlot(e.$slots,"default")],2))}}),Jl={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,off:Boolean,disabled:Boolean,highlight:Boolean},setup(t){const e={pmi:"","wpic-tools":"hover:text-lime-500 group-[.is-off]:text-gray-400 dark:group-[.is-off]:text-gray-700 group-[.is-today]:text-lime-500 group-[.is-today]:font-medium group-[.is-selected]:bg-lime-500 dark:group-[.is-selected]:bg-lime-600 group-[.is-selected]:!text-white rounded-full"},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-gray-200"},r={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800"},i={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-l-0"},o={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-r-0"},s={pmi:"","wpic-tools":"bg-gray-200"};return(l,a)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[c.createElementVNode("div",{class:c.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[c.unref(te).theme]}`]:t.between,[`${i[c.unref(te).theme]}`]:t.firstDay,[`${o[c.unref(te).theme]}`]:t.lastDay,[`${s[c.unref(te).theme]}`]:t.highlight}]),style:c.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[c.createElementVNode("span",{class:c.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[c.unref(te).theme]}`]:!0,[`${n[c.unref(te).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[c.renderSlot(l.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.day),1)])],2)],6)],2))}};var Nh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Sn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",l="minute",a="hour",d="day",u="week",f="month",h="quarter",p="year",m="date",y="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var N=["th","st","nd","rd"],$=B%100;return"["+B+(N[($-20)%10]||N[$]||N[0])+"]"}},T=function(B,N,$){var O=String(B);return!O||O.length>=N?B:""+Array(N+1-O.length).join($)+B},b={s:T,z:function(B){var N=-B.utcOffset(),$=Math.abs(N),O=Math.floor($/60),V=$%60;return(N<=0?"+":"-")+T(O,2,"0")+":"+T(V,2,"0")},m:function B(N,$){if(N.date()<$.date())return-B($,N);var O=12*($.year()-N.year())+($.month()-N.month()),V=N.clone().add(O,f),H=$-V<0,G=N.clone().add(O+(H?-1:1),f);return+(-(O+($-V)/(H?V-G:G-V))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:f,y:p,w:u,d,D:m,h:a,m:l,s,ms:o,Q:h}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},S="en",k={};k[S]=x;var C="$isDayjsObject",D=function(B){return B instanceof j||!(!B||!B[C])},A=function B(N,$,O){var V;if(!N)return S;if(typeof N=="string"){var H=N.toLowerCase();k[H]&&(V=H),$&&(k[H]=$,V=H);var G=N.split("-");if(!V&&G.length>1)return B(G[0])}else{var ie=N.name;k[ie]=N,V=ie}return!O&&V&&(S=V),V||!O&&S},R=function(B,N){if(D(B))return B.clone();var $=typeof N=="object"?N:{};return $.date=B,$.args=arguments,new j($)},F=b;F.l=A,F.i=D,F.w=function(B,N){return R(B,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var j=function(){function B($){this.$L=A($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[C]=!0}var N=B.prototype;return N.parse=function($){this.$d=function(O){var V=O.date,H=O.utc;if(V===null)return new Date(NaN);if(F.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var G=V.match(g);if(G){var ie=G[2]-1||0,de=(G[7]||"0").substring(0,3);return H?new Date(Date.UTC(G[1],ie,G[3]||1,G[4]||0,G[5]||0,G[6]||0,de)):new Date(G[1],ie,G[3]||1,G[4]||0,G[5]||0,G[6]||0,de)}}return new Date(V)}($),this.init()},N.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},N.$utils=function(){return F},N.isValid=function(){return this.$d.toString()!==y},N.isSame=function($,O){var V=R($);return this.startOf(O)<=V&&V<=this.endOf(O)},N.isAfter=function($,O){return R($)<this.startOf(O)},N.isBefore=function($,O){return this.endOf(O)<R($)},N.$g=function($,O,V){return F.u($)?this[O]:this.set(V,$)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function($,O){var V=this,H=!!F.u(O)||O,G=F.p($),ie=function(re,fe){var be=F.w(V.$u?Date.UTC(V.$y,fe,re):new Date(V.$y,fe,re),V);return H?be:be.endOf(d)},de=function(re,fe){return F.w(V.toDate()[re].apply(V.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(fe)),V)},he=this.$W,oe=this.$M,ye=this.$D,z="set"+(this.$u?"UTC":"");switch(G){case p:return H?ie(1,0):ie(31,11);case f:return H?ie(1,oe):ie(0,oe+1);case u:var Z=this.$locale().weekStart||0,ue=(he<Z?he+7:he)-Z;return ie(H?ye-ue:ye+(6-ue),oe);case d:case m:return de(z+"Hours",0);case a:return de(z+"Minutes",1);case l:return de(z+"Seconds",2);case s:return de(z+"Milliseconds",3);default:return this.clone()}},N.endOf=function($){return this.startOf($,!1)},N.$set=function($,O){var V,H=F.p($),G="set"+(this.$u?"UTC":""),ie=(V={},V[d]=G+"Date",V[m]=G+"Date",V[f]=G+"Month",V[p]=G+"FullYear",V[a]=G+"Hours",V[l]=G+"Minutes",V[s]=G+"Seconds",V[o]=G+"Milliseconds",V)[H],de=H===d?this.$D+(O-this.$W):O;if(H===f||H===p){var he=this.clone().set(m,1);he.$d[ie](de),he.init(),this.$d=he.set(m,Math.min(this.$D,he.daysInMonth())).$d}else ie&&this.$d[ie](de);return this.init(),this},N.set=function($,O){return this.clone().$set($,O)},N.get=function($){return this[F.p($)]()},N.add=function($,O){var V,H=this;$=Number($);var G=F.p(O),ie=function(oe){var ye=R(H);return F.w(ye.date(ye.date()+Math.round(oe*$)),H)};if(G===f)return this.set(f,this.$M+$);if(G===p)return this.set(p,this.$y+$);if(G===d)return ie(1);if(G===u)return ie(7);var de=(V={},V[l]=r,V[a]=i,V[s]=n,V)[G]||1,he=this.$d.getTime()+$*de;return F.w(he,this)},N.subtract=function($,O){return this.add(-1*$,O)},N.format=function($){var O=this,V=this.$locale();if(!this.isValid())return V.invalidDate||y;var H=$||"YYYY-MM-DDTHH:mm:ssZ",G=F.z(this),ie=this.$H,de=this.$m,he=this.$M,oe=V.weekdays,ye=V.months,z=V.meridiem,Z=function(fe,be,Oe,ut){return fe&&(fe[be]||fe(O,H))||Oe[be].slice(0,ut)},ue=function(fe){return F.s(ie%12||12,fe,"0")},re=z||function(fe,be,Oe){var ut=fe<12?"AM":"PM";return Oe?ut.toLowerCase():ut};return H.replace(v,function(fe,be){return be||function(Oe){switch(Oe){case"YY":return String(O.$y).slice(-2);case"YYYY":return F.s(O.$y,4,"0");case"M":return he+1;case"MM":return F.s(he+1,2,"0");case"MMM":return Z(V.monthsShort,he,ye,3);case"MMMM":return Z(ye,he);case"D":return O.$D;case"DD":return F.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return Z(V.weekdaysMin,O.$W,oe,2);case"ddd":return Z(V.weekdaysShort,O.$W,oe,3);case"dddd":return oe[O.$W];case"H":return String(ie);case"HH":return F.s(ie,2,"0");case"h":return ue(1);case"hh":return ue(2);case"a":return re(ie,de,!0);case"A":return re(ie,de,!1);case"m":return String(de);case"mm":return F.s(de,2,"0");case"s":return String(O.$s);case"ss":return F.s(O.$s,2,"0");case"SSS":return F.s(O.$ms,3,"0");case"Z":return G}return null}(fe)||G.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function($,O,V){var H,G=this,ie=F.p(O),de=R($),he=(de.utcOffset()-this.utcOffset())*r,oe=this-de,ye=function(){return F.m(G,de)};switch(ie){case p:H=ye()/12;break;case f:H=ye();break;case h:H=ye()/3;break;case u:H=(oe-he)/6048e5;break;case d:H=(oe-he)/864e5;break;case a:H=oe/i;break;case l:H=oe/r;break;case s:H=oe/n;break;default:H=oe}return V?H:F.a(H)},N.daysInMonth=function(){return this.endOf(f).$D},N.$locale=function(){return k[this.$L]},N.locale=function($,O){if(!$)return this.$L;var V=this.clone(),H=A($,O,!0);return H&&(V.$L=H),V},N.clone=function(){return F.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},B}(),_=j.prototype;return R.prototype=_,[["$ms",o],["$s",s],["$m",l],["$H",a],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(B){_[B[1]]=function(N){return this.$g(N,B[0],B[1])}}),R.extend=function(B,N){return B.$i||(B(N,j,R),B.$i=!0),R},R.locale=A,R.isDayjs=D,R.unix=function(B){return R(1e3*B)},R.en=k[S],R.Ls=k,R.p={},R})})(Nh);var KN=Nh.exports;const K=Wr(KN);var Bh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Sn,function(){var n="week",r="year";return function(i,o,s){var l=o.prototype;l.week=function(a){if(a===void 0&&(a=null),a!==null)return this.add(7*(a-this.week()),"day");var d=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=s(this).startOf(r).add(1,r).date(d),f=s(this).endOf(n);if(u.isBefore(f))return 1}var h=s(this).startOf(r).date(d).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?s(this).startOf("week").week():Math.ceil(p)},l.weeks=function(a){return a===void 0&&(a=null),this.week(a)}}})})(Bh);var JN=Bh.exports;const GN=Wr(JN);var Ah={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Sn,function(){return function(n,r,i){r.prototype.isBetween=function(o,s,l,a){var d=i(o),u=i(s),f=(a=a||"()")[0]==="(",h=a[1]===")";return(f?this.isAfter(d,l):!this.isBefore(d,l))&&(h?this.isBefore(u,l):!this.isAfter(u,l))||(f?this.isBefore(d,l):!this.isAfter(d,l))&&(h?this.isAfter(u,l):!this.isBefore(u,l))}}})})(Ah);var YN=Ah.exports;const ZN=Wr(YN),XN={class:"w-full dark:text-gray-400"},QN={class:"flex justify-between items-center mb-3"},eB={class:"flex"},tB={class:"font-medium"},nB={class:"flex"},rB={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},iB={class:"flex justify-center text-sm"},Dh=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,maxDate:{},minDate:{},week:Boolean,initDates:{}},emits:["update:modelValue"],setup(t,{emit:e}){K.extend(ZN),K.extend(GN);const n=t,r=c.ref([K(new Date).subtract(1,"month"),K(new Date)]);c.watch(()=>n.initDates,()=>{var _;!n.range&&n.initDates?r.value[0]=K(n.initDates):!n.range&&!n.initDates?r.value[0]=K(new Date):n.range&&((_=n.initDates)==null?void 0:_.length)==2&&(r.value[0]=K(n.initDates[0]),r.value[1]=K(n.initDates[1]),r.value[0].isSame(r.value[1],"month")&&(r.value[1]=K(n.initDates[0]).add(1,"month")))},{immediate:!0,once:!0});const i=e,o=c.computed(()=>n.doubleMonths||n.range?[0,1]:[0]);function s(_){var B,N,$;if(n.week)i("update:modelValue",[K(_).startOf("week"),K(_).endOf("week")]);else if(n.range){if(((B=n.modelValue)==null?void 0:B.length)==0)i("update:modelValue",[_]);else if(((N=n.modelValue)==null?void 0:N.length)==2)i("update:modelValue",[_]);else if((($=n.modelValue)==null?void 0:$.length)==1){let O=[K(n.modelValue[0]),K(_)];O=O.sort((V,H)=>V-H),i("update:modelValue",O)}}else i("update:modelValue",K(_))}function l(_){const B=K(_).daysInMonth(),N=[],$=K(_).startOf("month");for(let O=1;O<=B;O++){let V=$.clone().date(O);N.push(V)}return N}function a(_){return K(_).startOf("month").day()}function d(_,B){const N=K(`${_}-${B}-01`,"YYYY-MM-DD"),O=N.day(),V=[];for(let H=0;H<O;H++)V.push(N.clone().subtract(O-H,"days"));return V}function u(_,B){const N=K(`${_}-${B}`,"YYYY-MM").endOf("month"),O=6-N.day(),V=[];for(let H=1;H<=O;H++)V.push(N.clone().add(H,"days"));return V}function f(_){const B=K();return K(_).isSame(B,"day")}function h(_){var B,N;if(n.range){if(((B=n.modelValue)==null?void 0:B.length)==1)return K(_).isSame(K(n.modelValue[0]),"day");if(((N=n.modelValue)==null?void 0:N.length)==2)return K(_).isSame(K(n.modelValue[0]),"day")||K(_).isSame(K(n.modelValue[1]),"day")}else if(n.modelValue)return K(_).isSame(K(n.modelValue),"day")}function p(_){var B;if(n.range&&((B=n.modelValue)==null?void 0:B.length)==2)return K(_).isBetween(K(n.modelValue[0]),K(n.modelValue[1]))}function m(_){var B;if(n.range&&((B=n.modelValue)==null?void 0:B.length)==2)return K(_).isSame(K(n.modelValue[0]),"day")}function y(_){var B;if(n.range&&((B=n.modelValue)==null?void 0:B.length)==2)return K(_).isSame(K(n.modelValue[1]),"day")}function g(_){try{return n.minDate?K(_).isBefore(K(n.minDate)):!1}catch(B){return console.log(B),!1}}function v(_){try{return n.maxDate?K(_).isAfter(K(n.maxDate)):!1}catch(B){return console.log(B),!1}}function x(_){k(_,r.value[_].subtract(1,"month"))}function T(_){k(_,r.value[_].add(1,"month"))}function b(_){k(_,r.value[_].subtract(1,"year"))}function S(_){k(_,r.value[_].add(1,"year"))}function k(_,B){_==0?r.value=[B,r.value[1]]:r.value=[r.value[0],B]}const C=c.ref();function D(_){n.week&&(C.value=K(_).week())}function A(_){return K(_).week()===C.value}function R(_){return K(_).week()===C.value?K(_).format("YYYY-MM-DD")===K().week(C.value).startOf("week").format("YYYY-MM-DD"):!1}function F(_){return K(_).week()===C.value?K(_).format("YYYY-MM-DD")===K().week(C.value).endOf("week").format("YYYY-MM-DD"):!1}function j(){C.value=null}return(_,B)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":o.value.length===1,"min-w-192":o.value.length===2}])},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,N=>{var $;return c.openBlock(),c.createElementBlock("div",XN,[c.createElementVNode("div",QN,[c.createElementVNode("div",eB,[c.createVNode(Hc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:O=>b(N)},null,8,["onClick"]),c.createVNode(Wc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:O=>x(N)},null,8,["onClick"])]),c.createElementVNode("div",tB,c.toDisplayString(r.value[N].format("YYYY MMMM")),1),c.createElementVNode("div",nB,[c.createVNode(Uc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:O=>T(N)},null,8,["onClick"]),c.createVNode(qc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:O=>S(N)},null,8,["onClick"])])]),c.createElementVNode("div",rB,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(7,O=>{var V;return c.createElementVNode("div",iB,c.toDisplayString((V=r.value[N])==null?void 0:V.clone().startOf("week").subtract(1,"days").add(O,"days").format("ddd")),1)}),64))]),c.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:j},[a(r.value[N])>0?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(d(c.unref(K)(r.value[N]).year(),c.unref(K)(r.value[N]).month()+1),O=>(c.openBlock(),c.createBlock(Jl,{onClick:V=>!v(O)&&!g(O)?s(O):null,onMouseover:V=>D(O),today:f(O),selected:h(O),firstDay:m(O)||R(O),lastDay:y(O)||F(O),between:p(O),highlight:A(O),off:""},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(K)(O).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l(r.value[N].clone()),O=>(c.openBlock(),c.createBlock(Jl,{onMouseover:V=>D(O),onClick:V=>!v(O)&&!g(O)?s(O):null,today:f(O),selected:h(O),firstDay:m(O)||R(O),lastDay:y(O)||F(O),between:p(O),disabled:v(O)||g(O),off:v(O)||g(O),highlight:A(O)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(K)(O).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),(($=u(c.unref(K)(r.value[N]).year(),c.unref(K)(r.value[N]).month()+1))==null?void 0:$.length)>0?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:1},c.renderList(u(c.unref(K)(r.value[N]).year(),c.unref(K)(r.value[N]).month()+1),O=>(c.openBlock(),c.createBlock(Jl,{onClick:V=>!v(O)||!g(O)?s(O):null,onMouseover:V=>D(O),today:f(O),selected:h(O),firstDay:m(O)||R(O),lastDay:y(O)||F(O),between:p(O),highlight:A(O),off:""},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(K)(O).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):c.createCommentVNode("",!0)],32)])}),256))],2))}}),oB={},sB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},lB=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 2.994v2.25m10.5-2.25v2.25m-14.252 13.5V7.491a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v11.251m-18 0a2.25 2.25 0 0 0 2.25 2.25h13.5a2.25 2.25 0 0 0 2.25-2.25m-18 0v-7.5a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v7.5m-6.75-6h2.25m-9 2.25h4.5m.002-2.25h.005v.006H12v-.006Zm-.001 4.5h.006v.006h-.006v-.005Zm-2.25.001h.005v.006H9.75v-.006Zm-2.25 0h.005v.005h-.006v-.005Zm6.75-2.247h.005v.005h-.005v-.005Zm0 2.247h.006v.006h-.006v-.006Zm2.25-2.248h.006V15H16.5v-.005Z"},null,-1)];function aB(t,e){return c.openBlock(),c.createElementBlock("svg",sB,lB)}const cB=ce(oB,[["render",aB]]),dB={},uB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},fB=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"},null,-1)];function hB(t,e){return c.openBlock(),c.createElementBlock("svg",uB,fB)}const pB=ce(dB,[["render",hB]]),mB={class:"flex gap-3"},gB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},yB=["onClick"],bB=Object.assign({name:"WpicDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,minDate:{},maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(l){r("update:modelValue",l)}const o=c.computed(()=>{var l;if(n.range)return(l=n.modelValue)==null?void 0:l.map(a=>K(a).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return K(n.modelValue).format("YYYY-MM-DD")}),s=c.reactive([{text:"Month to Date",onClick(l){const a=K().subtract(1,"day"),d=K().startOf("month");r("update:modelValue",[d,a])}},{text:"Last Month",onClick(l){const a=K().startOf("month").subtract(1,"month"),d=K(a).endOf("month");r("update:modelValue",[a,d])}},{text:"Year to Date",onClick(l){const a=K().subtract(1,"day"),d=K().startOf("year");r("update:modelValue",[d,a])}}]);return(l,a)=>(c.openBlock(),c.createBlock(Yn,{disabled:t.disabled,maxWidth:"1280px"},{content:c.withCtx(()=>[c.createElementVNode("div",mB,[t.shortcuts?(c.openBlock(),c.createElementBlock("div",gB,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s,d=>(c.openBlock(),c.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:u=>d.onClick()},c.toDisplayString(d.text),9,yB))),256))])):c.createCommentVNode("",!0),c.createVNode(Dh,{shortcuts:"",doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:c.withCtx(()=>{var d;return[c.createVNode(cs,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((d=o.value)!=null&&d.length)),onOnClear:a[0]||(a[0]=u=>i(null))},{prepend:c.withCtx(()=>[t.range?(c.openBlock(),c.createBlock(cB,{key:0,class:"dark:text-gray-400"})):(c.openBlock(),c.createBlock(pB,{key:1,class:"dark:text-gray-400"}))]),default:c.withCtx(()=>[c.createTextVNode(" "+c.toDisplayString(o.value||t.placeholder),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),kB=Object.assign({name:"WpicSlidePanel"},{props:{visible:{type:Boolean,default:!1},backgroundColor:{type:String,default:"bg-white"},options:{type:Object,default:()=>({width:"w-96",mr:"mr-0",zIndex:"z-15"})},expand:Boolean,island:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r={pmi:"dark:bg-zinc-800","wpic-tools":"dark:bg-gray-940"},i=n;function o(){i("close")}e({goBottom:a,goTop:l});const s=c.ref(null);function l(){s.value.scrollTop=0}function a(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fixed inset-0 h-full flex justify-end bg-black/50 backdrop-blur-xs transition-opacity",{"p-4":t.island,"opacity-0 pointer-events-none":!t.visible,"opacity-100":t.visible,[t.options.mr]:!0,[t.options.zIndex]:!0}]),onClick:c.withModifiers(o,["self"])},[c.createElementVNode("div",{class:c.normalizeClass(["h-full transform-gpu transition-transform",{"rounded-lg":t.island,"translate-x-0":t.visible,"translate-x-full":!t.visible,[t.backgroundColor]:!0,[t.options.width]:!0,[r[c.unref(te).theme]]:!0}])},[c.createElementVNode("div",{ref_key:"panel",ref:s,class:c.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[c.renderSlot(d.$slots,"default")],2)],2)],2))}}),vB={class:"absolute inset-0 flex items-center justify-center py-12"},xB={class:"text-lg font-medium dark:text-gray-300"},wB={key:0,class:"flex justify-end px-6 pb-4"},SB=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,i=n;function o(){i("close")}const s=c.ref(null),l=c.ref(!1);function a(){s.value.scrollTop=0}function d(){s.value.scrollTop=s.value.scrollHeight}function u(){s.value&&r.visible&&(l.value=s.value.scrollTop+s.value.clientHeight>=s.value.scrollHeight-20)}return c.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),c.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:a,isScrolledToBottom:l}),(f,h)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[c.createElementVNode("div",vB,[c.createElementVNode("div",{class:"absolute inset-0 bg-black/10 dark:bg-black/75 z-10",onClick:o}),c.createElementVNode("div",{class:c.normalizeClass(["relative flex flex-col justify-between bg-white dark:border dark:border-gray-900 dark:bg-gray-940 rounded-lg z-20 max-h-full",{"w-4/5":t.large,"w-192":!t.large,"h-full":t.high,"overflow-hidden":!t.overflow}])},[c.createElementVNode("div",{class:c.normalizeClass(["px-6 pt-4 flex justify-between",{"border-b pb-3 dark:border-gray-900":t.border}])},[c.createElementVNode("span",xB,c.toDisplayString(t.title),1),c.createElementVNode("span",{class:"cursor-pointer",onClick:o},[c.createVNode(Hr,{class:"w-6 h-6"})])],2),c.createElementVNode("div",{ref_key:"panel",ref:s,class:c.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[c.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(c.openBlock(),c.createElementBlock("div",wB,[c.renderSlot(f.$slots,"buttons")])):c.createCommentVNode("",!0)],2)])],2))}}),CB={class:"wpic-tabs flex border-b-2 dark:border-gray-930 overflow-x-auto overflow-y-hidden"},OB=["onClick"],EB=Object.assign({name:"WpicTabs"},{props:{modelValue:{type:String,required:!0},nowrap:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=c.ref([]),o=a=>{r("update:modelValue",a)},s=a=>{i.value.push(a)},l=c.computed(()=>n.modelValue);return c.provide("addTab",s),c.provide("modelValue",l),(a,d)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",CB,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,u=>(c.openBlock(),c.createElementBlock("div",{key:u.name,class:c.normalizeClass(["border-b items-center flex leading-snug cursor-pointer py-3 px-6 -mb-[2px] font-medium",{"dark:border-gray-930":u.name!=t.modelValue,"border-b-2 text-lime-500 border-b-lime-500 dark:text-lime-600 dark:border-b-lime-600":u.name===t.modelValue,"text-gray-500 dark:text-gray-500":!u.disabled,"text-gray-300 dark:text-gray-700":u.disabled}]),onClick:f=>u.disabled?null:o(u.name)},[c.renderSlot(a.$slots,"label",{},()=>[c.createElementVNode("span",{class:c.normalizeClass({"whitespace-nowrap text-ellipsis overflow-hidden":t.nowrap})},c.toDisplayString(u.label),3)])],10,OB))),128))]),c.createElementVNode("div",null,[c.renderSlot(a.$slots,"default")])],64))}}),MB=Object.assign({name:"WpicTabPane"},{props:{label:{type:String,required:!0},name:{type:String,required:!0},noStyle:Boolean,disabled:Boolean},setup(t){const e=t,n=c.ref(!1),r=c.inject("addTab"),i=c.inject("modelValue");return c.onMounted(()=>{r({label:e.label,name:e.name,disabled:e.disabled})}),c.watch(()=>i.value,o=>{n.value=o===e.name},{immediate:!0,deep:!0}),(o,s)=>n.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["wpic-tab-pane",{"py-3 px-6":!t.noStyle}])},[c.renderSlot(o.$slots,"default")],2)):c.createCommentVNode("",!0)}}),TB={},$B={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},NB=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"},null,-1)];function BB(t,e){return c.openBlock(),c.createElementBlock("svg",$B,NB)}const AB=ce(TB,[["render",BB]]),DB={},VB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},_B=[c.createElementVNode("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)];function IB(t,e){return c.openBlock(),c.createElementBlock("svg",VB,_B)}const PB=ce(DB,[["render",IB]]),RB={},LB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},zB=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function FB(t,e){return c.openBlock(),c.createElementBlock("svg",LB,zB)}const jB=ce(RB,[["render",FB]]),HB={},WB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},qB=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function UB(t,e){return c.openBlock(),c.createElementBlock("svg",WB,qB)}const KB=ce(HB,[["render",UB]]),JB={class:"w-6"},GB={class:"flex-1"},YB={key:0,class:"mb-2"},ZB=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["px-4 py-3 rounded-sm text-base flex gap-4",{"bg-gray-50 text-gray-900 dark:text-gray-200 dark:bg-gray-950 text-opacity-75":!t.warning&&!t.info&&!t.error&&!t.success,"bg-amber-50 text-yellow-950 dark:text-yellow-100 dark:bg-yellow-950 text-opacity-75":t.warning,"bg-blue-50 text-blue-950 dark:text-blue-200 dark:bg-blue-950 text-opacity-75":t.info,"bg-red-100 text-red-950 dark:text-red-200 dark:bg-red-950 text-opacity-75":t.error,"bg-green-50 text-green-950 dark:text-green-200 dark:bg-green-950 text-opacity-75":t.success}])},[c.createElementVNode("div",JB,[t.warning?(c.openBlock(),c.createBlock(AB,{key:0,class:"w-full aspect-square"})):t.info?(c.openBlock(),c.createBlock(PB,{key:1,class:"w-full aspect-square"})):t.success?(c.openBlock(),c.createBlock(jB,{key:2,class:"w-full aspect-square"})):t.error?(c.openBlock(),c.createBlock(KB,{key:3,class:"w-full aspect-square"})):c.createCommentVNode("",!0)]),c.createElementVNode("div",GB,[t.title?(c.openBlock(),c.createElementBlock("div",YB,c.toDisplayString(t.title),1)):c.createCommentVNode("",!0),c.createElementVNode("span",{class:c.normalizeClass(["",{"text-gray-950 dark:text-gray-200 text-opacity-75":!t.warning&&!t.info&&!t.error&&!t.success,"text-yellow-950 dark:text-yellow-100 text-opacity-75":t.warning,"text-blue-950 dark:text-blue-200 text-opacity-75":t.info,"text-red-950 dark:text-red-200 text-opacity-75":t.error,"text-green-950 dark:text-green-200 text-opacity-75":t.success}])},[c.renderSlot(e.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.text),1)])],2)])],2))}}),Gl=c.ref(!1),Vh=c.ref(""),_h=c.ref(""),Ih=c.ref(!1),Ph=c.ref(!1);let Rh=()=>{},Lh=()=>{};function Yl(){const t=({title:i,text:o,positive:s=!1,negative:l=!1,onConfirm:a,onCancel:d})=>{Vh.value=i,_h.value=o,Ih.value=s,Ph.value=l,Rh=a||(()=>{}),Lh=d||(()=>{}),Gl.value=!0},e=()=>{Gl.value=!1};return{visible:Gl,title:Vh,text:_h,positive:Ih,negative:Ph,show:t,onConfirm:()=>{Rh(),e()},onCancel:()=>{Lh(),e()}}}const XB={key:0,class:"confirm-modal-overlay z-40"},QB={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},eA={class:"text-lg font-semibold mb-6"},tA={class:"mb-12"},nA={class:"flex justify-end"},Zl={WpicAlert:ZB,WpicCalendar:Dh,WpicTextarea:zc,WpicDialog:SB,WpicSlidePanel:kB,WpicDateField:bB,WpicFormInput:cs,WpicButton:Ni,WpicBadge:UN,WpicTextEditor:NN,WpicInputGroup:gm,WpicButtonGroup:fm,WpicForm:ym,WpicFormField:Fc,WpicSpinner:Un,WpicTooltip:jc,WpicPopover:Yn,WpicChoiceList:Lc,WpicCard:fw,WpicCardSection:mw,WpicProgressBar:bw,WpicTag:vw,WpicTagGroup:xw,WpicPagination:Kw,WpicLoadingPanel:Ow,WpicTable:gS,WpicTableColumn:yS,WpicTabs:EB,WpicTabPane:MB,WpicConfirm:ce(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:l}=Yl();return(a,d)=>c.unref(e)?(c.openBlock(),c.createElementBlock("div",XB,[c.createElementVNode("div",QB,[c.createElementVNode("div",eA,c.toDisplayString(c.unref(n)),1),c.createElementVNode("div",tA,c.toDisplayString(c.unref(r)),1),c.createElementVNode("div",nA,[c.createVNode(Ni,{onClick:c.unref(l)},{default:c.withCtx(()=>[c.createTextVNode("Cancel")]),_:1},8,["onClick"]),c.createVNode(Ni,{primary:c.unref(i),destructive:c.unref(o),onClick:c.unref(s)},{default:c.withCtx(()=>[c.createTextVNode("Confirm")]),_:1},8,["primary","destructive","onClick"])])])])):c.createCommentVNode("",!0)}}),[["__scopeId","data-v-613542ab"]])};function zh(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?zh(t[n],e[n]):t[n]=e[n])}const rA={useConfirm:Yl};function iA(t,e){zh(te,e);for(const n in Zl)if(Zl.hasOwnProperty(n)){const r=Zl[n];t.component(r.name,r)}}const oA={install:iA,composables:rA,options:te};Gt.default=oA,Gt.useConfirm=Yl,Object.defineProperties(Gt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});