@romainbx/wpic-components 0.0.54 → 0.0.56

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(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 Hh(){return na().__VUE_DEVTOOLS_GLOBAL_HOOK__}function na(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Wh=typeof Proxy=="function",qh="devtools-plugin:setup",Uh="plugin:settings:set";let Hn,Po;function Kh(){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 Jh(){return Kh()?Po.now():Date.now()}class Gh{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 Jh()}},n&&n.on(Uh,(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 Yh(t,e){const n=t,r=na(),i=Hh(),o=Wh&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))i.emit(qh,t,e);else{const s=o?new Gh(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:s}),s&&e(s.proxiedTarget)}}/**
1
+ (function(Yt,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(Yt=typeof globalThis<"u"?globalThis:Yt||self,a(Yt.WpicComponents={},Yt.Vue))})(this,function(Yt,a){"use strict";function Uh(){return oa().__VUE_DEVTOOLS_GLOBAL_HOOK__}function oa(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Kh=typeof Proxy=="function",Jh="devtools-plugin:setup",Yh="plugin:settings:set";let Wn,Lo;function Gh(){var t;return Wn!==void 0||(typeof window<"u"&&window.performance?(Wn=!0,Lo=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(Wn=!0,Lo=globalThis.perf_hooks.performance):Wn=!1),Wn}function Zh(){return Gh()?Lo.now():Date.now()}class Xh{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 Zh()}},n&&n.on(Yh,(s,l)=>{s===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(s,l)=>this.target?this.target.on[l]:(...c)=>{this.onQueue.push({method:l,args:c})}}),this.proxiedTarget=new Proxy({},{get:(s,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...c)=>(this.targetQueue.push({method:l,args:c,resolve:()=>{}}),this.fallbacks[l](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:l,args:c,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 Qh(t,e){const n=t,r=oa(),i=Uh(),o=Kh&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))i.emit(Jh,t,e);else{const s=o?new Xh(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 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 Zh(t){const e=parseFloat(t);return isNaN(e)?t:e}function Xh(t){return typeof t=="object"&&t!==null}function Qh(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ia(t){if(!Xh(t)||Qh(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 Ar(t,e){return Object.keys(e).forEach(n=>{if(ia(e[n])&&ia(t[n])){t[n]||(t[n]={}),Ar(t[n],e[n]);return}t[n]=e[n]}),t}function Dr(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){tp(t,e),oa[t]=e}function ep(t){return oa[t]}function tp(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 Vr=Symbol("vee-validate-form"),la=Symbol("vee-validate-field-instance"),Ci=Symbol("Default empty value"),np=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 _r(t){return t==="checkbox"||t==="radio"}function rp(t){return Yt(t)||Array.isArray(t)}function ip(t){return Array.isArray(t)?t.length===0:Yt(t)&&Object.keys(t).length===0}function Ei(t){return/^\[.+\]$/i.test(t)}function op(t){return aa(t)&&t.multiple}function aa(t){return t.tagName==="SELECT"}function sp(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function lp(t,e){return!sp(t,e)&&e.type!=="file"&&!_r(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 np?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)=>rp(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(ip(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 ap(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 cp(t,e){return Yt(e)&&e.number?Zh(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 dp(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 up(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(_r(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(op(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 up(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=fp(t[r]);return t[r]!==!1&&(n[r]=ya(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=hp(r);return i.name&&(n[i.name]=ya(i.params)),n},e):e}function fp(t){return t===!0?[]:Array.isArray(t)||Yt(t)?t:[t]}function ya(t){const e=n=>typeof n=="string"&&n[0]==="@"?pp(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 hp=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function pp(t){const e=n=>Ue(n,t)||n[t];return e.__locatorRef=t,e}function mp(t){return Array.isArray(t)?t.filter(Lo):Ke(t).filter(e=>Lo(t[e])).map(e=>t[e])}let gp=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const vn=()=>gp;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 yp(i,t)).errors;return{errors:s,valid:!s.length}}async function yp(t,e){if(mt(t.rules)||Oi(t.rules))return kp(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 vp(n,e,{name:l,params:n.rules[l]});if(a.error&&(r.push(a.error),t.bails))return{errors:r}}return{errors:r}}function bp(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(!bp(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 kp(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 vp(t,e,n){const r=ep(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=xp(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 xp(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 wp(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 Sp(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 Cp(t,e){const{value:n,initialValue:r,setInitialValue:i}=Op(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}=Tp(),u=xa>=Number.MAX_SAFE_INTEGER?0:++xa,f=Mp(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 Op(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=Ep(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 Ep(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 Mp(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 Tp(){const t=c.ref([]);return{errors:t,setErrors:e=>{t.value=qo(e)}}}function wa(t){process.env.NODE_ENV!=="production"&&Yh({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"},Bp)}const Ir={},Pr={};let Lt;const Wn=ap(()=>{setTimeout(async()=>{await c.nextTick(),Lt==null||Lt.sendInspectorState(qn),Lt==null||Lt.sendInspectorTree(qn)},100)},100);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.formId]=Object.assign({},t),Ir[t.formId]._vm=e,c.onUnmounted(()=>{delete Ir[t.formId],Wn()}),Wn()}function Np(t){const e=c.getCurrentInstance();if(!Lt){const n=e==null?void 0:e.appContext.app;if(!n)return;wa(n)}Pr[t.id]=Object.assign({},t),Pr[t.id]._vm=e,c.onUnmounted(()=>{delete Pr[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 Bp(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(Ir),r=Object.values(Pr);e.rootNodes=[...n.map(Ap),...r.map(i=>Vp(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}=_p(e.nodeId);if(r&&s==="form"){e.state=Ip(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 Ap(t){const{textColor:e,bgColor:n}=Oa(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{Rt(r,c.unref(s.path),Dp(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 Dp(t,e){return{id:Jo(e,t),label:c.unref(t.path),tags:Sa(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Vp(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 _p(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Ir[e.f];if(!n&&e.ff){const i=Pr[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 Ip(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 Pp(t,e,n){return _r(n==null?void 0:n.type)?Lp(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}=Rp(n),g=f?Ho(Vr):void 0,y=m||g,v=c.computed(()=>Dr(c.toValue(t))),x=c.computed(()=>{if(c.toValue(y==null?void 0:y.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}=Cp(v,{modelValue:r,form:y,bails:o,label:a,type:s,validate:x.value?$:void 0,schema:T?e:void 0}),F=c.computed(()=>A.value[0]);p&&zp({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(y!=null&&y.validateSchema){const{results:re}=await y.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=y==null?void 0:y.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();(!y||!y.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?cp(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}),y||Np(oe)),!y)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=mp(z[ue]).map(fe=>fe.__locatorRef).reduce((fe,be)=>{const Oe=Ue(y.values,be)||y.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(y.keepValuesOnUnmount),ue=c.toValue(v);if(Z||!y||R.pendingUnmount[oe.id]){y==null||y.removePathState(ue,b);return}R.pendingUnmount[oe.id]=!0;const re=y.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),y.setFieldValue(ue,Oe)}Array.isArray(re.id)&&re.id.splice(re.id.indexOf(oe.id),1)}else y.unsetPathValue(c.toValue(v));y.removePathState(ue,b)}}),oe}function Rp(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 Lp(t,e,n){const r=n!=null&&n.standalone?void 0:Ho(Vr),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 g=c.toValue(t),y=r==null?void 0:r.getPathState(g),v=Ti(f);let x=(m=c.toValue(i))!==null&&m!==void 0?m:v;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=ha(Ue(r.values,g)||[],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 zp({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 Fp=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:g,meta:y,checked:v,setErrors:x}=Pp(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:Hp(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}=jp(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);_r(e.attrs.type)&&v&&(D.checked=v.value);const A=Ma(t,e);return lp(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:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:T,handleInput:D=>T(D,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:a,meta:y,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 jp(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 Hp(t,e){return _r(e.attrs.type)?da(t,"modelValue")?t.modelValue:void 0:da(t,"modelValue")?t.modelValue:e.attrs.value}const Rr=Fp;let Wp=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 qp(t){var e;const n=Wp++;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=dp(()=>{f.value=d.value.reduce((M,E)=>(M[Dr(c.toValue(E.path))]=E,M),{})});function p(M,E){const I=$(M);if(!I){typeof M=="string"&&(u.value[Dr(M)]=qo(E));return}if(typeof M=="string"){const q=Dr(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 g=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)}),y=c.computed(()=>Ke(g.value).reduce((M,E)=>{const I=g.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}=Kp(d,a,t),D=Up(d,a,k,y),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 ee=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),te=V.findIndex(qe=>qe===X);te!==-1&&V.splice(te,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:ee,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(ee)))});return d.value.push(xe),f.value[X]=xe,h(),y.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),ee=[...new Set([...Ke(M.results),...d.value.map(w=>w.path),...I])].sort().reduce((w,L)=>{var U;const X=L,te=$(X)||O(X),se=((U=M.results[X])===null||U===void 0?void 0:U.errors)||[],pe=c.toValue(te==null?void 0:te.path)||X,xe=Jp({errors:se,valid:!se.length},w.results[pe]);return w.results[pe]=xe,xe.valid||(w.errors[pe]=xe.errors[0]),te&&u.value[pe]&&delete u.value[pe],te?(te.valid=xe.valid,E==="silent"||E==="validated-only"&&!te.validated||p(te,xe.errors),w):(p(pe,se),w)},{valid:M.valid,results:{},errors:{}});return M.values&&(ee.values=M.values),Ke(ee.results).forEach(w=>{var L;const U=$(w);U&&E!=="silent"&&(E==="validated-only"&&!U.validated||p(U,(L=ee.results[w])===null||L===void 0?void 0:L.errors))}),ee});function N(M){d.value.forEach(M)}function $(M){const E=typeof M=="string"?Dr(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 te=M?X:U;return L.values&&(te=L.values),I(te,{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(ee=>ee.path===M&&(Array.isArray(ee.id)?ee.id.includes(E):ee.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 ee=q.id.indexOf(E);ee>=0&&q.id.splice(ee,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:g,errors:y,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:$r,defineInputBinds:Nr,defineComponentBinds:Br,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:Tr};function Z(M,E,I=!0){const q=me(E),ee=typeof M=="string"?M:M.path;$(ee)||F(ee),Rt(a,ee,q),I&&ft(ee)}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){Ar(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 ee;const w=c.toValue(M);Z(w,q,(ee=c.toValue(E))!==null&&ee!==void 0?ee:!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 Tr(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),ee=$(M);ee&&(ee.__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(()=>{ee&&(ee.__flags.pendingReset=!1)})}function Kt(M,E){let I=me(M!=null&&M.values?M.values:k.value);I=E!=null&&E.force?I:Ar(k.value,I),I=mt(R)&&Me(R.cast)?R.cast(I):I,C(I),N(q=>{var ee;q.__flags.pendingReset=!0,q.validated=!1,q.touched=((ee=M==null?void 0:M.touched)===null||ee===void 0?void 0:ee[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={},ee={};for(const w of I)q[w.key]={valid:w.valid,errors:w.errors},w.errors.length&&(ee[w.key]=w.errors[0]);return{valid:I.every(w=>w.valid),results:q,errors:ee}}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 wp(M,a):await Sp(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(Vr,z),process.env.NODE_ENV!=="production"&&($p(z),c.watch(()=>Object.assign(Object.assign({errors:g.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}),ee=()=>Me(E)?E(Mi(q,$i)):E||{};function w(){var se;q.touched=!0,((se=ee().validateOnBlur)!==null&&se!==void 0?se:vn().validateOnBlur)&&ft(q.path)}function L(){var se;((se=ee().validateOnInput)!==null&&se!==void 0?se:vn().validateOnInput)&&c.nextTick(()=>{ft(q.path)})}function U(){var se;((se=ee().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=ee().validateOnModelUpdate)!==null&&se!==void 0?se:(pe=vn())===null||pe===void 0?void 0:pe.validateOnModelUpdate)!==null&&xe!==void 0?xe:!0}),X]}function $r(M){return Array.isArray(M)?M.map(E=>fe(E,!0)):fe(M)}function Nr(M,E){const[I,q]=bn(M,E);function ee(){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:ee,onInput:w,onChange:L,value:I.value}))}function Br(M,E){const[I,q]=bn(M,E),ee=$(c.toValue(M));function w(L){I.value=L}return c.computed(()=>{const L=Me(E)?E(Mi(ee,$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 Up(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 Kp(t,e,n){const r=Ta(n),i=c.ref(r),o=c.ref(me(r));function s(l,a=!1){i.value=Ar(me(i.value)||{},me(l)),o.value=Ar(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 Jp(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const Gp=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:g,handleSubmit:y,setErrors:v,setFieldError:x,setFieldValue:T,setValues:b,setFieldTouched:S,setTouched:k,resetField:C}=qp({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),D=y(($,{evt:O})=>{ca(O)&&O.target.submit()},t.onInvalidSubmit),A=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):D;function R($){zo($)&&$.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function F($,O){return y(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:g,resetField:C,getValues:j,getMeta:_,getErrors:B}}return e.expose({setFieldError:x,setErrors:v,setFieldValue:T,setValues:b,setFieldTouched:S,setTouched:k,resetForm:g,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)}}}),Yp=c.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=c.inject(Vr,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 Zp(t){const e=Ho(Vr),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},Xp={},Qp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},em=[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 tm(t,e){return c.openBlock(),c.createElementBlock("svg",Qp,em)}const nm=ce(Xp,[["render",tm]]),rm={},im={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},om=[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 sm(t,e){return c.openBlock(),c.createElementBlock("svg",im,om)}const lm=ce(rm,[["render",sm]]),am={class:"relative"},Un=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",am,[c.createVNode(nm,{class:"absolute opacity-25"}),c.createVNode(lm,{class:c.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let Q={theme:"wpic-tools",popoverTarget:"body"};const cm=["is","type","disabled"],dm={key:0,class:"absolute inset-0 flex justify-center items-center"},um={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},fm=["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"},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(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(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,[`${a[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",dm,[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",um,[(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,fm))),256))])],512)):c.createCommentVNode("",!0)],10,cm)}}}),hm=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))}}),pm={name:"WpicInputGroup"},mm={class:"wpic-input-group flex w-full"};function gm(t,e,n,r,i,o){return c.openBlock(),c.createElementBlock("div",mm,[c.renderSlot(t.$slots,"default")])}const ym=ce(pm,[["render",gm]]),bm=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(Gp),{ref_key:"myForm",ref:n},{default:c.withCtx(({values:d,meta:u,errors:f})=>[c.renderSlot(l.$slots,"default")]),_:3},512))}}),Lr=Math.min,Kn=Math.max,Bi=Math.round,Zt=t=>({x:t,y:t}),km={left:"right",right:"left",bottom:"top",top:"bottom"},vm={start:"end",end:"start"};function Yo(t,e,n){return Kn(t,Lr(e,n))}function zr(t,e){return typeof t=="function"?t(e):t}function xn(t){return t.split("-")[0]}function Fr(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 xm(t,e,n){n===void 0&&(n=!1);const r=Fr(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 wm(t){const e=Di(t);return[Qo(t),e,Qo(e)]}function Qo(t){return t.replace(/start|end/g,e=>vm[e])}function Sm(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 Cm(t,e,n,r){const i=Fr(t);let o=Sm(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=>km[e])}function Om(t){return{top:0,right:0,bottom:0,left:0,...t}}function Na(t){return typeof t!="number"?Om(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(Fr(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const Em=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 g=0;g<l.length;g++){const{name:y,fn:v}=l[g],{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,[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}=Ba(d,h,a)),g=-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}=zr(e,t),m=Na(p),y=l[h?f==="floating"?"reference":"floating":f],v=Vi(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(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 Mm=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}=zr(t,e)||{};if(d==null)return{};const f=Na(u),h={x:n,y:r},p=Xo(i),m=Zo(p),g=await s.getDimensions(d),y=p==="y",v=y?"top":"left",x=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=l.floating[T]||o.floating[m]);const D=b/2-S/2,A=C/2-g[m]/2-1,R=Lr(f[v],A),F=Lr(f[x],A),j=R,_=C-g[m]-F,B=C/2-g[m]/2+D,N=Yo(j,B,_),$=!a.arrow&&Fr(i)!=null&&B!==N&&o.reference[m]/2-(B<j?R:F)-g[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:$}}}),Tm=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:g=!0,...y}=zr(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||!g?[Di(l)]:wm(l));!h&&m!=="none"&&b.push(...Cm(l,g,m,T));const S=[l,...b],k=await Aa(e,y),C=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&C.push(k[v]),f){const j=xm(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 $m(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=Fr(n),a=Ai(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&a?-1:1,f=zr(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 Nm=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 $m(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}}}}},Bm=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:y=>{let{x:v,y:x}=y;return{x:v,y:x}}},...a}=zr(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 y=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=p+u[y],T=p-u[v];p=Yo(x,p,T)}if(s){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=m+u[y],T=m-u[v];m=Yo(x,m,T)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.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 jr(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 Am(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 Dm(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)&&jr(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||[],jr(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 Vm=Zt(0);function Pa(t){const e=Xe(t);return!ns()||!e.visualViewport?Vm:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _m(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Xe(t)?!1:e}function Hr(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=_m(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,g=m.frameElement;for(;g&&r&&p!==m;){const y=Gn(g),v=g.getBoundingClientRect(),x=gt(g),T=v.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,b=v.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;a*=y.x,d*=y.y,u*=y.x,f*=y.y,a+=T,d+=b,m=Xe(g),g=m.frameElement}}return Vi({width:u,height:f,x:a,y:d})}const Im=[":popover-open",":modal"];function is(t){return Im.some(e=>{try{return t.matches(e)}catch{return!1}})}function Pm(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"||jr(s))&&(a=_i(r)),St(r))){const h=Hr(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 Rm(t){return Array.from(t.getClientRects())}function Ra(t){return Hr(Xt(t)).left+_i(t).scrollLeft}function Lm(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 zm(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 Fm(t,e){const n=Hr(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=zm(t,n);else if(e==="document")r=Lm(Xt(t));else if(wt(e))r=Fm(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 jm(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)||jr(s)&&!a&&za(t,s))?r=r.filter(u=>u!==s):i=l,s=Qt(s)}return e.set(t,r),r}function Hm(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?is(e)?[]:jm(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=Lr(f.right,d.right),d.bottom=Lr(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 Wm(t){const{width:e,height:n}=_a(t);return{width:e,height:n}}function qm(t,e,n){const r=St(e),i=Xt(e),o=n==="fixed",s=Hr(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const a=Zt(0);if(r||!r&&!o)if((wn(e)!=="body"||jr(i))&&(l=_i(e)),r){const f=Hr(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&&Am(r)&&ss(r);)r=Fa(r,e);return r&&Jn(r)&&ss(r)&&!ts(r)?n:r||Dm(t)||n}const Um=async function(t){const e=this.getOffsetParent||ja,n=this.getDimensions,r=await n(t.floating);return{reference:qm(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Km(t){return gt(t).direction==="rtl"}const Jm={convertOffsetParentRelativeRectToViewportRelativeRect:Pm,getDocumentElement:Xt,getClippingRect:Hm,getOffsetParent:ja,getElementRects:Um,getClientRects:Rm,getDimensions:Wm,getScale:Gn,isElement:wt,isRTL:Km},Ha=Nm,Wa=Bm,qa=Tm,Gm=Mm,Ua=(t,e,n)=>{const r=new Map,i={platform:Jm,...n},o={...i.platform,_c:r};return Em(t,e,{...i,platform:o})};function Ym(t){return t!=null&&typeof t=="object"&&"$el"in t}function Zm(t){if(Ym(t)){const e=t.$el;return es(e)&&wn(e)==="#comment"?null:e}return t}function Xm(t){return{name:"arrow",options:t,fn(e){const n=Zm(c.unref(t.element));return n==null?{}:Gm({element:n,padding:t.padding}).fn(e)}}}const Qm={},eg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},tg=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function ng(t,e){return c.openBlock(),c.createElementBlock("svg",eg,tg)}const Yn=ce(Qm,[["render",ng]]);let Ii;const rg=new Uint8Array(16);function ig(){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(rg)}const Ae=[];for(let t=0;t<256;++t)Ae.push((t+256).toString(16).slice(1));function og(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||ig)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,og(r)}let Ja={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 sg={class:"bg-white dark:bg-gray-700 rounded-t-lg w-full"},lg={class:"flex justify-between items-center border-b dark:border-gray-700 px-4 py-3"},Zn=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":"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),l=c.ref(null),a=c.ref(!0);function d(){Ja.isMobile()&&(document.documentElement.style.overflow="hidden",document.querySelector("#app").style.overflow="hidden"),r.disabled||(a.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,a.value=!0}async function f(){const g=await Ua(s.value,l.value,{placement:r.placement,middleware:[qa(),Wa(),Ha(r.offset)]});l.value.style.left=`${g.x}px`,l.value.style.top=`${g.y}px`}const h=g=>{l.value&&!l.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(v=>a.value?d():u(),["stop"]))},[c.renderSlot(g.$slots,"default",{isHidden:a.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:l,style:c.normalizeStyle({maxWidth:t.maxWidth}),class:c.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:a.value,[`${i[c.unref(Q).theme]}`]:!a.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]=v=>u()),class:c.normalizeClass(["fixed z-30 flex items-end w-screen h-screen top-0 bg-black/20",{hidden:a.value,[`${o[c.unref(Q).theme]}`]:!0}])},[c.createElementVNode("div",sg,[c.createElementVNode("div",lg,[c.createElementVNode("span",null,c.toDisplayString(t.label),1),c.createVNode(Yn,{onClick:u,class:"w-4 h-4"})]),c.renderSlot(g.$slots,"content")])],2)],8,["to"]))],64))}}),ag={},cg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},dg=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function ug(t,e){return c.openBlock(),c.createElementBlock("svg",cg,dg)}const Ga=ce(ag,[["render",ug]]),fg={},hg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},pg=[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 mg(t,e){return c.openBlock(),c.createElementBlock("svg",hg,pg)}const gg=ce(fg,[["render",mg]]),yg={},bg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},kg=[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 vg(t,e){return c.openBlock(),c.createElementBlock("svg",bg,kg)}const as=ce(yg,[["render",vg]]),xg={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-gray-500 flex items-center"},wg={key:0},Sg={class:""},Cg={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},Og={class:"opacity-50 w-4 h-4 leading-none"},Eg={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",xg,[c.createTextVNode(c.toDisplayString(t.label)+" ",1),t.required&&!t.hideRequired?(c.openBlock(),c.createElementBlock("span",wg,"*")):c.createCommentVNode("",!0),c.createElementVNode("div",Sg,[t.info?(c.openBlock(),c.createBlock(Zn,{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(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",Cg,[c.createElementVNode("div",Og,[c.renderSlot(s.$slots,"prepend")])])):c.createCommentVNode("",!0),c.renderSlot(s.$slots,"default"),t.loading?(c.openBlock(),c.createElementBlock("div",Eg,[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(Yn,{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 Mg(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Pi=Mg,Tg=typeof Sn=="object"&&Sn&&Sn.Object===Object&&Sn,Ya=Tg,$g=Ya,Ng=typeof self=="object"&&self&&self.Object===Object&&self,Bg=$g||Ng||Function("return this")(),Ct=Bg,Ag=Ct,Dg=function(){return Ag.Date.now()},Vg=Dg,_g=/\s/;function Ig(t){for(var e=t.length;e--&&_g.test(t.charAt(e)););return e}var Pg=Ig,Rg=Pg,Lg=/^\s+/;function zg(t){return t&&t.slice(0,Rg(t)+1).replace(Lg,"")}var Fg=zg,jg=Ct,Hg=jg.Symbol,ds=Hg,Za=ds,Xa=Object.prototype,Wg=Xa.hasOwnProperty,qg=Xa.toString,qr=Za?Za.toStringTag:void 0;function Ug(t){var e=Wg.call(t,qr),n=t[qr];try{t[qr]=void 0;var r=!0}catch{}var i=qg.call(t);return r&&(e?t[qr]=n:delete t[qr]),i}var Kg=Ug,Jg=Object.prototype,Gg=Jg.toString;function Yg(t){return Gg.call(t)}var Zg=Yg,Qa=ds,Xg=Kg,Qg=Zg,e0="[object Null]",t0="[object Undefined]",ec=Qa?Qa.toStringTag:void 0;function n0(t){return t==null?t===void 0?t0:e0:ec&&ec in Object(t)?Xg(t):Qg(t)}var Ur=n0;function r0(t){return t!=null&&typeof t=="object"}var Kr=r0,i0=Ur,o0=Kr,s0="[object Symbol]";function l0(t){return typeof t=="symbol"||o0(t)&&i0(t)==s0}var a0=l0,c0=Fg,tc=Pi,d0=a0,nc=NaN,u0=/^[-+]0x[0-9a-f]+$/i,f0=/^0b[01]+$/i,h0=/^0o[0-7]+$/i,p0=parseInt;function m0(t){if(typeof t=="number")return t;if(d0(t))return nc;if(tc(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=tc(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=c0(t);var n=f0.test(t);return n||h0.test(t)?p0(t.slice(2),n?2:8):u0.test(t)?nc:+t}var g0=m0,y0=Pi,us=Vg,rc=g0,b0="Expected a function",k0=Math.max,v0=Math.min;function x0(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(b0);e=rc(e)||0,y0(n)&&(u=!!n.leading,f="maxWait"in n,o=f?k0(rc(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 g(k){var C=k-a,D=k-d,A=e-C;return f?v0(A,o-D):A}function y(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(y(k))return x(k);l=setTimeout(v,g(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=y(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 w0=x0;const ic=Wr(w0);function S0(){this.__data__=[],this.size=0}var C0=S0;function O0(t,e){return t===e||t!==t&&e!==e}var oc=O0,E0=oc;function M0(t,e){for(var n=t.length;n--;)if(E0(t[n][0],e))return n;return-1}var Ri=M0,T0=Ri,$0=Array.prototype,N0=$0.splice;function B0(t){var e=this.__data__,n=T0(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():N0.call(e,n,1),--this.size,!0}var A0=B0,D0=Ri;function V0(t){var e=this.__data__,n=D0(e,t);return n<0?void 0:e[n][1]}var _0=V0,I0=Ri;function P0(t){return I0(this.__data__,t)>-1}var R0=P0,L0=Ri;function z0(t,e){var n=this.__data__,r=L0(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var F0=z0,j0=C0,H0=A0,W0=_0,q0=R0,U0=F0;function Xn(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])}}Xn.prototype.clear=j0,Xn.prototype.delete=H0,Xn.prototype.get=W0,Xn.prototype.has=q0,Xn.prototype.set=U0;var Li=Xn,K0=Li;function J0(){this.__data__=new K0,this.size=0}var G0=J0;function Y0(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Z0=Y0;function X0(t){return this.__data__.get(t)}var Q0=X0;function ey(t){return this.__data__.has(t)}var ty=ey,ny=Ur,ry=Pi,iy="[object AsyncFunction]",oy="[object Function]",sy="[object GeneratorFunction]",ly="[object Proxy]";function ay(t){if(!ry(t))return!1;var e=ny(t);return e==oy||e==sy||e==iy||e==ly}var sc=ay,cy=Ct,dy=cy["__core-js_shared__"],uy=dy,fs=uy,lc=function(){var t=/[^.]+$/.exec(fs&&fs.keys&&fs.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function fy(t){return!!lc&&lc in t}var hy=fy,py=Function.prototype,my=py.toString;function gy(t){if(t!=null){try{return my.call(t)}catch{}try{return t+""}catch{}}return""}var ac=gy,yy=sc,by=hy,ky=Pi,vy=ac,xy=/[\\^$.*+?()[\]{}|]/g,wy=/^\[object .+?Constructor\]$/,Sy=Function.prototype,Cy=Object.prototype,Oy=Sy.toString,Ey=Cy.hasOwnProperty,My=RegExp("^"+Oy.call(Ey).replace(xy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ty(t){if(!ky(t)||by(t))return!1;var e=yy(t)?My:wy;return e.test(vy(t))}var $y=Ty;function Ny(t,e){return t==null?void 0:t[e]}var By=Ny,Ay=$y,Dy=By;function Vy(t,e){var n=Dy(t,e);return Ay(n)?n:void 0}var Qn=Vy,_y=Qn,Iy=Ct,Py=_y(Iy,"Map"),hs=Py,Ry=Qn,Ly=Ry(Object,"create"),zi=Ly,cc=zi;function zy(){this.__data__=cc?cc(null):{},this.size=0}var Fy=zy;function jy(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Hy=jy,Wy=zi,qy="__lodash_hash_undefined__",Uy=Object.prototype,Ky=Uy.hasOwnProperty;function Jy(t){var e=this.__data__;if(Wy){var n=e[t];return n===qy?void 0:n}return Ky.call(e,t)?e[t]:void 0}var Gy=Jy,Yy=zi,Zy=Object.prototype,Xy=Zy.hasOwnProperty;function Qy(t){var e=this.__data__;return Yy?e[t]!==void 0:Xy.call(e,t)}var eb=Qy,tb=zi,nb="__lodash_hash_undefined__";function rb(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=tb&&e===void 0?nb:e,this}var ib=rb,ob=Fy,sb=Hy,lb=Gy,ab=eb,cb=ib;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=ob,er.prototype.delete=sb,er.prototype.get=lb,er.prototype.has=ab,er.prototype.set=cb;var db=er,dc=db,ub=Li,fb=hs;function hb(){this.size=0,this.__data__={hash:new dc,map:new(fb||ub),string:new dc}}var pb=hb;function mb(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var gb=mb,yb=gb;function bb(t,e){var n=t.__data__;return yb(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Fi=bb,kb=Fi;function vb(t){var e=kb(this,t).delete(t);return this.size-=e?1:0,e}var xb=vb,wb=Fi;function Sb(t){return wb(this,t).get(t)}var Cb=Sb,Ob=Fi;function Eb(t){return Ob(this,t).has(t)}var Mb=Eb,Tb=Fi;function $b(t,e){var n=Tb(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Nb=$b,Bb=pb,Ab=xb,Db=Cb,Vb=Mb,_b=Nb;function tr(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])}}tr.prototype.clear=Bb,tr.prototype.delete=Ab,tr.prototype.get=Db,tr.prototype.has=Vb,tr.prototype.set=_b;var uc=tr,Ib=Li,Pb=hs,Rb=uc,Lb=200;function zb(t,e){var n=this.__data__;if(n instanceof Ib){var r=n.__data__;if(!Pb||r.length<Lb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Rb(r)}return n.set(t,e),this.size=n.size,this}var Fb=zb,jb=Li,Hb=G0,Wb=Z0,qb=Q0,Ub=ty,Kb=Fb;function nr(t){var e=this.__data__=new jb(t);this.size=e.size}nr.prototype.clear=Hb,nr.prototype.delete=Wb,nr.prototype.get=qb,nr.prototype.has=Ub,nr.prototype.set=Kb;var Jb=nr,Gb="__lodash_hash_undefined__";function Yb(t){return this.__data__.set(t,Gb),this}var Zb=Yb;function Xb(t){return this.__data__.has(t)}var Qb=Xb,e1=uc,t1=Zb,n1=Qb;function ji(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new e1;++e<n;)this.add(t[e])}ji.prototype.add=ji.prototype.push=t1,ji.prototype.has=n1;var r1=ji;function i1(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 o1=i1;function s1(t,e){return t.has(e)}var l1=s1,a1=r1,c1=o1,d1=l1,u1=1,f1=2;function h1(t,e,n,r,i,o){var s=n&u1,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&f1?new a1:void 0;for(o.set(t,e),o.set(e,t);++f<l;){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(!c1(e,function(v,x){if(!d1(p,x)&&(m===v||i(m,v,n,r,o)))return p.push(x)})){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 fc=h1,p1=Ct,m1=p1.Uint8Array,g1=m1;function y1(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var b1=y1;function k1(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var v1=k1,hc=ds,pc=g1,x1=oc,w1=fc,S1=b1,C1=v1,O1=1,E1=2,M1="[object Boolean]",T1="[object Date]",$1="[object Error]",N1="[object Map]",B1="[object Number]",A1="[object RegExp]",D1="[object Set]",V1="[object String]",_1="[object Symbol]",I1="[object ArrayBuffer]",P1="[object DataView]",mc=hc?hc.prototype:void 0,ps=mc?mc.valueOf:void 0;function R1(t,e,n,r,i,o,s){switch(n){case P1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case I1:return!(t.byteLength!=e.byteLength||!o(new pc(t),new pc(e)));case M1:case T1:case B1:return x1(+t,+e);case $1:return t.name==e.name&&t.message==e.message;case A1:case V1:return t==e+"";case N1:var l=S1;case D1:var a=r&O1;if(l||(l=C1),t.size!=e.size&&!a)return!1;var d=s.get(t);if(d)return d==e;r|=E1,s.set(t,e);var u=w1(l(t),l(e),r,i,o,s);return s.delete(t),u;case _1:if(ps)return ps.call(t)==ps.call(e)}return!1}var L1=R1;function z1(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var F1=z1,j1=Array.isArray,ms=j1,H1=F1,W1=ms;function q1(t,e,n){var r=e(t);return W1(t)?r:H1(r,n(t))}var U1=q1;function K1(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 J1=K1;function G1(){return[]}var Y1=G1,Z1=J1,X1=Y1,Q1=Object.prototype,ek=Q1.propertyIsEnumerable,gc=Object.getOwnPropertySymbols,tk=gc?function(t){return t==null?[]:(t=Object(t),Z1(gc(t),function(e){return ek.call(t,e)}))}:X1,nk=tk;function rk(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var ik=rk,ok=Ur,sk=Kr,lk="[object Arguments]";function ak(t){return sk(t)&&ok(t)==lk}var ck=ak,yc=ck,dk=Kr,bc=Object.prototype,uk=bc.hasOwnProperty,fk=bc.propertyIsEnumerable,hk=yc(function(){return arguments}())?yc:function(t){return dk(t)&&uk.call(t,"callee")&&!fk.call(t,"callee")},pk=hk,Hi={exports:{}};function mk(){return!1}var gk=mk;Hi.exports,function(t,e){var n=Ct,r=gk,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 kc=Hi.exports,yk=9007199254740991,bk=/^(?:0|[1-9]\d*)$/;function kk(t,e){var n=typeof t;return e=e??yk,!!e&&(n=="number"||n!="symbol"&&bk.test(t))&&t>-1&&t%1==0&&t<e}var vk=kk,xk=9007199254740991;function wk(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=xk}var vc=wk,Sk=Ur,Ck=vc,Ok=Kr,Ek="[object Arguments]",Mk="[object Array]",Tk="[object Boolean]",$k="[object Date]",Nk="[object Error]",Bk="[object Function]",Ak="[object Map]",Dk="[object Number]",Vk="[object Object]",_k="[object RegExp]",Ik="[object Set]",Pk="[object String]",Rk="[object WeakMap]",Lk="[object ArrayBuffer]",zk="[object DataView]",Fk="[object Float32Array]",jk="[object Float64Array]",Hk="[object Int8Array]",Wk="[object Int16Array]",qk="[object Int32Array]",Uk="[object Uint8Array]",Kk="[object Uint8ClampedArray]",Jk="[object Uint16Array]",Gk="[object Uint32Array]",ke={};ke[Fk]=ke[jk]=ke[Hk]=ke[Wk]=ke[qk]=ke[Uk]=ke[Kk]=ke[Jk]=ke[Gk]=!0,ke[Ek]=ke[Mk]=ke[Lk]=ke[Tk]=ke[zk]=ke[$k]=ke[Nk]=ke[Bk]=ke[Ak]=ke[Dk]=ke[Vk]=ke[_k]=ke[Ik]=ke[Pk]=ke[Rk]=!1;function Yk(t){return Ok(t)&&Ck(t.length)&&!!ke[Sk(t)]}var Zk=Yk;function Xk(t){return function(e){return t(e)}}var Qk=Xk,Wi={exports:{}};Wi.exports,function(t,e){var n=Ya,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 ev=Wi.exports,tv=Zk,nv=Qk,xc=ev,wc=xc&&xc.isTypedArray,rv=wc?nv(wc):tv,Sc=rv,iv=ik,ov=pk,sv=ms,lv=kc,av=vk,cv=Sc,dv=Object.prototype,uv=dv.hasOwnProperty;function fv(t,e){var n=sv(t),r=!n&&ov(t),i=!n&&!r&&lv(t),o=!n&&!r&&!i&&cv(t),s=n||r||i||o,l=s?iv(t.length,String):[],a=l.length;for(var d in t)(e||uv.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||av(d,a)))&&l.push(d);return l}var hv=fv,pv=Object.prototype;function mv(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||pv;return t===n}var gv=mv;function yv(t,e){return function(n){return t(e(n))}}var bv=yv,kv=bv,vv=kv(Object.keys,Object),xv=vv,wv=gv,Sv=xv,Cv=Object.prototype,Ov=Cv.hasOwnProperty;function Ev(t){if(!wv(t))return Sv(t);var e=[];for(var n in Object(t))Ov.call(t,n)&&n!="constructor"&&e.push(n);return e}var Mv=Ev,Tv=sc,$v=vc;function Nv(t){return t!=null&&$v(t.length)&&!Tv(t)}var Bv=Nv,Av=hv,Dv=Mv,Vv=Bv;function _v(t){return Vv(t)?Av(t):Dv(t)}var Iv=_v,Pv=U1,Rv=nk,Lv=Iv;function zv(t){return Pv(t,Lv,Rv)}var Fv=zv,Cc=Fv,jv=1,Hv=Object.prototype,Wv=Hv.hasOwnProperty;function qv(t,e,n,r,i,o){var s=n&jv,l=Cc(t),a=l.length,d=Cc(e),u=d.length;if(a!=u&&!s)return!1;for(var f=a;f--;){var h=l[f];if(!(s?h in e:Wv.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<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)){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 Uv=qv,Kv=Qn,Jv=Ct,Gv=Kv(Jv,"DataView"),Yv=Gv,Zv=Qn,Xv=Ct,Qv=Zv(Xv,"Promise"),ex=Qv,tx=Qn,nx=Ct,rx=tx(nx,"Set"),ix=rx,ox=Qn,sx=Ct,lx=ox(sx,"WeakMap"),ax=lx,gs=Yv,ys=hs,bs=ex,ks=ix,vs=ax,Oc=Ur,rr=ac,Ec="[object Map]",cx="[object Object]",Mc="[object Promise]",Tc="[object Set]",$c="[object WeakMap]",Nc="[object DataView]",dx=rr(gs),ux=rr(ys),fx=rr(bs),hx=rr(ks),px=rr(vs),Cn=Oc;(gs&&Cn(new gs(new ArrayBuffer(1)))!=Nc||ys&&Cn(new ys)!=Ec||bs&&Cn(bs.resolve())!=Mc||ks&&Cn(new ks)!=Tc||vs&&Cn(new vs)!=$c)&&(Cn=function(t){var e=Oc(t),n=e==cx?t.constructor:void 0,r=n?rr(n):"";if(r)switch(r){case dx:return Nc;case ux:return Ec;case fx:return Mc;case hx:return Tc;case px:return $c}return e});var mx=Cn,xs=Jb,gx=fc,yx=L1,bx=Uv,Bc=mx,Ac=ms,Dc=kc,kx=Sc,vx=1,Vc="[object Arguments]",_c="[object Array]",qi="[object Object]",xx=Object.prototype,Ic=xx.hasOwnProperty;function wx(t,e,n,r,i,o){var s=Ac(t),l=Ac(e),a=s?_c:Bc(t),d=l?_c:Bc(e);a=a==Vc?qi:a,d=d==Vc?qi:d;var u=a==qi,f=d==qi,h=a==d;if(h&&Dc(t)){if(!Dc(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new xs),s||kx(t)?gx(t,e,n,r,i,o):yx(t,e,a,n,r,i,o);if(!(n&vx)){var p=u&&Ic.call(t,"__wrapped__"),m=f&&Ic.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new xs),i(g,y,n,r,o)}}return h?(o||(o=new xs),bx(t,e,n,r,i,o)):!1}var Sx=wx,Cx=Sx,Pc=Kr;function Rc(t,e,n,r,i){return t===e?!0:t==null||e==null||!Pc(t)&&!Pc(e)?t!==t&&e!==e:Cx(t,e,n,r,Rc,i)}var Ox=Rc,Ex=Ox;function Mx(t,e){return Ex(t,e)}var Tx=Mx;const Lc=Wr(Tx),$x={key:0,class:"leading-none"},Nx={class:"flex flex-col max-h-80 overflow-y-auto"},Bx={key:0,class:"p-3"},Ax={key:1},Dx={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},Vx=["onClick"],_x={class:"select-none flex w-full items-center justify-between"},zc=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=ic(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=>Lc(T,x)):r.modelValue!==null&&Lc(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"},g=c.computed(()=>{var x,T;return((x=r.modelValue)==null?void 0:x.length)===((T=r.options)==null?void 0:T.length)}),y=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:g}),(x,T)=>(c.openBlock(),c.createBlock(Zn,{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",$x,[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(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(Yn,{class:"w-4 h-4"})])):c.createCommentVNode("",!0),c.createVNode(gg,{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",Nx,[t.filterable?(c.openBlock(),c.createElementBlock("div",Bx,[c.createVNode(jc,{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",Ax,"No data.")):(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[t.multiple&&t.batchSelect?(c.openBlock(),c.createElementBlock("div",Dx,[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:a(S.value)},[c.createElementVNode("div",_x,[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(Ga,{key:0,class:"w-4 h-4"})):c.createCommentVNode("",!0)])],10,Vx)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Ix={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Px={class:""},Rx=["value","disabled","rows","placeholder"],Fc=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",Ix,[c.createTextVNode(c.toDisplayString(t.label)+" ",1),c.createElementVNode("div",Px,[d.info?(c.openBlock(),c.createBlock(Zn,{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,Rx)],64))}}),Lx={},zx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Fx=[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 jx(t,e){return c.openBlock(),c.createElementBlock("svg",zx,Fx)}const Hx=ce(Lx,[["render",jx]]),Wx={},qx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Ux=[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 Kx(t,e){return c.openBlock(),c.createElementBlock("svg",qx,Ux)}const Jx=ce(Wx,[["render",Kx]]),Gx={},Yx={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Zx=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function Xx(t,e){return c.openBlock(),c.createElementBlock("svg",Yx,Zx)}const Qx=ce(Gx,[["render",Xx]]),ew={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-gray-500 flex items-center"},tw={key:0},nw={class:""},rw=["innerHTML"],iw=["name","value","checked"],ow={key:0,class:"absolute dark:text-gray-400 left-0 ml-3 h-full flex items-center justify-center text-center"},sw={class:"opacity-50 w-4 h-4 leading-none"},lw={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},aw={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},cw={key:5,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},jc=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=Zp(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 g(C){C===!0||C===!1?m("update:modelValue",!C):m("update:modelValue",C)}function y(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=ic(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",ew,[c.createTextVNode(c.toDisplayString(a.value)+" ",1),t.required&&!t.hideRequired?(c.openBlock(),c.createElementBlock("span",tw,"*")):c.createCommentVNode("",!0),c.createElementVNode("div",nw,[t.info?(c.openBlock(),c.createBlock(Zn,{key:0,hover:""},{content:c.withCtx(()=>[c.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,rw)]),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(Rr),{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: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(Ga,{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(Rr),{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||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:D[1]||(D[1]=(...R)=>C.onChange&&C.onChange(...R)),checked:t.radioValue==t.modelValue},null,40,iw),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(Rr),{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(zc,{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(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(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(l)}])},[C.$slots.prepend?(c.openBlock(),c.createElementBlock("div",ow,[c.createElementVNode("div",sw,[c.renderSlot(C.$slots,"prepend")])])):c.createCommentVNode("",!0),t.textarea?(c.openBlock(),c.createBlock(c.unref(Rr),{key:1,ref_key:"myInput",ref:T,modelValue:t.modelValue,rules:h.value,name:s.value},{default:c.withCtx(()=>{var A;return[c.createVNode(Fc,{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(Rr),{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(Yn,{class:"w-5 h-5 opacity-50"})])):c.createCommentVNode("",!0),C.$slots.append||t.password||t.type=="password"?(c.openBlock(),c.createElementBlock("div",lw,[c.createElementVNode("div",aw,[c.renderSlot(C.$slots,"append",{},()=>[c.withDirectives(c.createVNode(Hx,{class:"text-zinc-600 select-none",onClick:f},null,512),[[c.vShow,d.value]]),c.withDirectives(c.createVNode(Jx,{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",cw,[c.createVNode(c.unref(Yp),{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))}}),dw=["innerHTML"],Hc=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),Xm({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,dw),c.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),uw={key:1,class:"flex justify-between items-baseline pt-4 px-6"},fw={class:""},hw={key:2,class:"flex items-center justify-end py-4 px-6"},pw=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",uw,[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",fw,[c.renderSlot(r.$slots,"actions")])])):c.createCommentVNode("",!0),c.renderSlot(r.$slots,"default"),r.$slots.buttons?(c.openBlock(),c.createElementBlock("div",hw,[c.renderSlot(r.$slots,"buttons")])):c.createCommentVNode("",!0)],2)}}}),mw={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},gw={class:"flex-1 text-lg dark:text-gray-300 font-semibold"},yw=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",mw,[c.createElementVNode("div",gw,c.toDisplayString(t.title),1),c.renderSlot(n.$slots,"actions")])):c.createCommentVNode("",!0),c.renderSlot(n.$slots,"default")],2))}}),bw=c.createElementVNode("div",{class:""},null,-1),kw=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),vw=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(Hc,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:c.withCtx(()=>[bw]),_:1},8,["text"])],6)):c.createCommentVNode("",!0)],2),t.indicators?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[kw],64)):c.createCommentVNode("",!0)],2))}}),xw={class:"leading-none"},ww=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",xw,[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(Yn,{class:"w-4 h-4"})])):c.createCommentVNode("",!0)],2))}}),Sw=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))}}),Cw=t=>(c.pushScopeId("data-v-947735f2"),t=t(),c.popScopeId(),t),Ow={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Ew=[Cw(()=>c.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Mw=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",Ow,Ew)):(c.openBlock(),c.createBlock(Un,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Tw={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(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",Tw,[c.renderSlot(i.$slots,"default")])],2))}}),$w={},Nw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Bw=[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 Aw(t,e){return c.openBlock(),c.createElementBlock("svg",Nw,Bw)}const Wc=ce($w,[["render",Aw]]),Dw={},Vw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},_w=[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 Iw(t,e){return c.openBlock(),c.createElementBlock("svg",Vw,_w)}const qc=ce(Dw,[["render",Iw]]),Pw={},Rw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Lw=[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 zw(t,e){return c.openBlock(),c.createElementBlock("svg",Rw,Lw)}const Uc=ce(Pw,[["render",zw]]),Fw={},jw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Hw=[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 Ww(t,e){return c.openBlock(),c.createElementBlock("svg",jw,Hw)}const Kc=ce(Fw,[["render",Ww]]),qw={class:"wpic-pagination flex justify-between"},Uw={key:0,class:"flex items-center"},Kw={key:0},Jw={key:1,class:"flex flex-wrap gap-2"},Gw=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 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",qw,[t.info?(c.openBlock(),c.createElementBlock("div",Uw,[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",Kw," / "+c.toDisplayString(t.total),1)):c.createCommentVNode("",!0)],64)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),t.pages?(c.openBlock(),c.createElementBlock("div",Jw,[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(Wc,{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(qc,{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(Kc,{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(Uc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"])])):c.createCommentVNode("",!0),c.createCommentVNode("",!0)]))}}),Jc=(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)};Jc.props=["column","item","rowIndex"];const ws=Jc,Yw={},Zw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Xw=[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 Qw(t,e){return c.openBlock(),c.createElementBlock("svg",Zw,Xw)}const eS=ce(Yw,[["render",Qw]]),tS={class:"font-semibold"},Gc={__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",tS,[(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(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))]))}},nS={},rS={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},iS=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function oS(t,e){return c.openBlock(),c.createElementBlock("svg",rS,iS)}const sS=ce(nS,[["render",oS]]),lS={class:"overflow-auto"},aS={class:"w-full rounded-lg"},cS=["width"],dS=["width"],uS={key:0,class:"rounded-t-lg"},fS=["onClick"],hS={class:"rounded-b-lg relative"},pS={key:0},mS=[c.createElementVNode("td",{class:"text-center py-3"},"   ",-1)],gS={key:1},yS={key:0,class:"text-center text-gray-400 py-3"},bS=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(()=>{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 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 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 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(Q).theme]}`]:!0}])},[c.createElementVNode("div",lS,[c.createElementVNode("table",aS,[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,cS)):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,dS))),128))]),t.hideHeaders?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("thead",uS,[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,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(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(eS,{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,fS)],6)}),256))])])),c.createElementVNode("tbody",hS,[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(Un,{class:"w-6 h-6"})],2),t.data.length?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("tr",pS,mS))],64)):c.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(c.openBlock(),c.createBlock(Gc,{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(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(Ni,{small:"",square:"",onClick:j=>x({item:S,index:k})},{default:c.withCtx(()=>[v[k]?(c.openBlock(),c.createBlock(Qx,{key:0,class:"w-4 h-4"})):(c.openBlock(),c.createBlock(sS,{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(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===((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(Q).theme]]:!t.stripe,[l[c.unref(Q).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(Q).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",gS,[c.createVNode(Gc,{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",yS," No Data ")):c.createCommentVNode("",!0)],2))}}),kS={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 Yc(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=Yc(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Zc(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=Zc(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 Yc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Zc(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=Qc(this.content,e+this.openStart,n);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,n){return new W(Xc(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 Xc(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(Xc(o.content,e-i-1,n-i-1)))}function Qc(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=Qc(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function vS(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 ed(t,e,n,0)}function ed(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=ed(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}=xS(n,t);return En(o,nd(t,s,l,e,r))}else return En(o,Gi(t,e,r))}function td(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 td(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 nd(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)?(td(o,s),On(En(o,nd(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 xS(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)%wS,r}}let Os=[],Es=0,wS=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 SS=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||SS)&&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 vS(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()+")"),rd(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):rd(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 rd(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 CS(e,n);if(r.next==null)return Tn.empty;let i=id(r);r.next&&r.err("Unexpected trailing text");let o=BS(NS(i));return AS(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 CS{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 id(t){let e=[];do e.push(OS(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function OS(t){let e=[];do e.push(ES(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ES(t){let e=$S(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=MS(t,e);else break;return e}function od(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function MS(t,e){let n=od(t),r=n;return t.eat(",")&&(t.next!="}"?r=od(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function TS(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 $S(t){if(t.eat("(")){let e=id(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=TS(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 NS(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 sd(t,e){return e-t}function ld(t,e){let n=[];return r(e),n.sort(sd);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 BS(t){let e=Object.create(null);return n(ld(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]);ld(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(sd);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function AS(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 ad(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 cd(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 dd(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new DS(t[n]);return e}let ud=class jh{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=dd(r.attrs),this.defaultAttrs=ad(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:cd(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 jh(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 DS{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=dd(i.attrs),this.excluded=null;let o=ad(this.attrs);this.instance=o?new ge(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ge(this,cd(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 VS{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=ud.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?fd(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==""?[]:fd(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 ud){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 fd(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 _S(t){return t.tag!=null}function IS(t){return t.style!=null}class ir{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{_S(r)?this.tags.push(r):IS(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 gd(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new gd(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(LS(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=yd(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=yd(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ir(e,ir.schemaRules(e)))}}const hd={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},PS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},pd={ol:!0,ul:!0},Qi=1,eo=2,to=4;function md(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):zS(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&&!hd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class gd{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=md(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;pd.hasOwnProperty(r)&&this.parser.normalizeLists&&RS(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));if(o?o.ignore:PS.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(hd.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=md(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=FS(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 RS(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&pd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function LS(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function yd(t){let e={};for(let n in t)e[n]=t[n];return e}function zS(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 FS(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=bd(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return bd(e.marks)}}function bd(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 kd=65535,vd=Math.pow(2,16);function jS(t,e){return t+e*vd}function xd(t){return t&kd}function HS(t){return(t-(t&kd))/vd}const wd=1,Sd=2,ro=4,Cd=8;class Ts{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Cd)>0}get deletedBefore(){return(this.delInfo&(wd|ro))>0}get deletedAfter(){return(this.delInfo&(Sd|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=xd(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+HS(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:jS(l/3,e-a),g=e==a?Sd:e==f?wd:ro;return(n<0?e!=a:e!=f)&&(g|=Cd),new Ts(p,g,m)}i+=u-d}return r?e+i:new Ts(e+i,0,null)}touches(e,n){let r=0,i=xd(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 or{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 or(this.maps,this.mirror,e,n)}copy(){return new or(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 or;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 sr(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 sr 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 sr(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 sr(n.pos,e.markFromJSON(n.mark))}}Ie.jsonID("removeNodeMark",sr);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 WS(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 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 Et(h,p,f[g])));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 qS(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 Od(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 US(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function lr(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||!US(i,o,s))break}return null}function KS(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,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=P.from(r.node(m).copy(u)),f++):a--;let h=P.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!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=JS(t,e),o=i&&GS(r,e);return o?i.map(Ed).concat({type:e,attrs:n}).concat(o.map(Ed)):null}function Ed(t){return{type:t,attrs:null}}function JS(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 GS(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 YS(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 ZS(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)&&eC(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&&QS(t,s,l,o),Od(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&&XS(t,s,l,o),!1}})}function XS(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 QS(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 eC(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function tC(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 g=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!g.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 nC(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 Md(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Md(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&&Md(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 rC(t,e,n){let r=new Te(e-n,e+n,W.empty,!0);t.step(r)}function iC(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 Td(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 $d(i,o,r)?new Te(e,n,r):new oC(i,o,r).fit()}function $d(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class oC{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 g=0;g<o.length;g++)this.openFrontierNode(o[g]);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 g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let p=l.size+e-(s.content.size-s.openEnd);for(;d<l.childCount;){let g=l.child(d),y=f.matchType(g.type);if(!y)break;d++,(d>1||a==0||g.content.size)&&(f=y,u.push(Nd(g.mark(h.allowedMarks(g.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 g=0,y=l;g<p;g++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=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 Nd(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Nd(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&&!sC(n,o.content,s)?l:null}function sC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function lC(t){return t.spec.defining||t.spec.definingForContent}function aC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if($d(i,o,r))return t.step(new Te(e,n,r));let s=Ad(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=lC(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 g=0;g<s.length;g++){let y=s[(g+a)%s.length],v=!0;y<0&&(v=!1,y=-y);let x=i.node(y-1),T=i.index(y-1);if(x.canReplaceWith(T,T,m.type,m.marks))return t.replace(i.before(y),v?o.after(y):n,new W(Bd(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 Bd(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Bd(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 cC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=iC(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new W(P.from(r),0,0))}function dC(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Ad(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 Ad(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 ar 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 ar(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 ar(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 ar(n.pos,n.attr,n.value)}}Ie.jsonID("attr",ar);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 cr=class extends Error{};cr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},cr.prototype=Object.create(Error.prototype),cr.prototype.constructor=cr,cr.prototype.name="TransformError";class uC{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new or}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cr(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 aC(this,e,n,r),this}replaceRangeWith(e,n,r){return cC(this,e,n,r),this}deleteRange(e,n){return dC(this,e,n),this}lift(e,n){return KS(this,e,n),this}join(e,n=1){return rC(this,e,n),this}wrap(e,n){return YS(this,e,n),this}setBlockType(e,n=e,r,i=null){return ZS(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return tC(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ar(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 sr(e,n)),this}split(e,n=1,r){return nC(this,e,n,r),this}addMark(e,n,r){return WS(this,e,n,r),this}removeMark(e,n,r){return qS(this,e,n,r),this}clearIncompatible(e,n,r){return Od(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 fC(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&&_d(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),_d(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ne(e):dr(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?dr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):dr(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 dr(e,e,0,0,1)||new ot(e)}static atEnd(e){return dr(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 fC{constructor(e,n){this.$from=e,this.$to=n}}let Dd=!1;function Vd(t){!Dd&&!t.parent.inlineContent&&(Dd=!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){Vd(e),Vd(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 hC}}le.jsonID("all",ot);const hC={map(){return this},resolve(t){return new ot(t)}};function dr(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=dr(t,l,n+i,i<0?l.childCount:0,i,o);if(a)return a}n+=l.nodeSize*i}return null}function _d(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 Id=1,Pd=2,Rd=4;class pC extends uC{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|Id)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Id)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Pd,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&Pd)>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|=Rd,this}get scrolledIntoView(){return(this.updated&Rd)>0}}function Ld(t,e){return!e||!t?t:t.bind(e)}class ei{constructor(e,n,r){this.name=e,this.init=Ld(n.init,r),this.apply=Ld(n.apply,r)}}const mC=[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=mC.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 ur{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 ur(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 pC(this)}static create(e){let n=new Ps(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ur(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 ur(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 ur(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 zd(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=zd(i,e,{})),n[r]=i}return n}class ze{constructor(e){this.spec=e,this.props={},e.props&&zd(e.props,this,this.props),this.key=e.key?e.key.key:Fd("plugin")}getState(e){return e[this.key]}}const Rs=Object.create(null);function Fd(t){return t in Rs?t+"$"+ ++Rs[t]:(Rs[t]=0,t+"$")}class yt{constructor(e="key"){this.key=Fd(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},gC=function(){Ls=null},$n=function(t,e,n,r){return n&&(jd(t,e,n,r,-1)||jd(t,e,n,r,1))},yC=/^(img|br|input|textarea|hr)$/i;function jd(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)||yC.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 bC(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 kC(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 vC(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 xC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function wC(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,Hd=typeof document<"u"?document:null,rn=Tt&&Tt.userAgent||"",zs=/Edge\/(\d+)/.exec(rn),Wd=/MSIE \d/.exec(rn),Fs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rn),Ge=!!(Wd||Fs||zs),on=Wd?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,SC=js?+js[1]:0,je=!Ge&&!!Tt&&/Apple Computer/.test(Tt.vendor),fr=je&&(/Mobile\/\w+/.test(rn)||!!Tt&&Tt.maxTouchPoints>2),st=fr||(Tt?/Mac/.test(Tt.platform):!1),CC=Tt?/Win/.test(Tt.platform):!1,kt=/Android \d/.test(rn),ri=!!Hd&&"webkitFontSmoothing"in Hd.documentElement.style,OC=ri?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function EC(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 MC(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 qd(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?EC(o):MC(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,g=l.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function TC(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:Ud(t.dom)}}function Ud(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 $C({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Kd(n,r==0?0:r-e)}function Kd(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 hr=null;function NC(t){if(t.setActive)return t.setActive();if(hr)return t.focus(hr);let e=Ud(t);t.focus(hr==null?{get preventScroll(){return hr={preventScroll:!0},!0}}:void 0),hr||(hr=!1,Kd(e,0))}function Jd(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 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&&!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?BC(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:Jd(n,i)}function BC(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 AC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function DC(t,e,n){let{node:r,offset:i}=Jd(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 VC(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 Gd(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 Gd(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function _C(t,e){let n=t.dom.ownerDocument,r,i=0,o=wC(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=Gd(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=AC(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=VC(t,r,i,e))}l==null&&(l=DC(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Yd(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(Yd(r))return r}return Array.prototype.find.call(n,Yd)||t.getBoundingClientRect()}const IC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Zd(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&&(IC.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 Xd(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 PC(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Xd(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=Zd(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 RC=/[\u0590-\u08ac]/;function LC(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!RC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:Xd(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:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||a==m&&d==g;try{l.collapse(u,f),a&&(a!=u||d!=f)&&l.extend&&l.extend(a,d)}catch{}return h!=null&&(l.caretBidiLevel=h),y})}let Qd=null,eu=null,tu=!1;function zC(t,e,n){return Qd==e&&eu==n?tu:(Qd=e,eu=n,tu=n=="up"||n=="down"?PC(t,e,n):LC(t,e,n))}const lt=0,nu=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 ou){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 ru&&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],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 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,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(l=a={node:g.parentNode,offset:Ve(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(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:nu,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:nu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class ru 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 FC 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=au(u,r,n),d?a=new jC(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 WC(this,s&&s.node,e);KC(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),su(this.contentDOM,this.children,e),fr&&JC(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=GC(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 FC(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=lu(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 iu(t,e,n,r,i){au(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 ou 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 jC 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 su(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=cu(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof An){let a=r?r.previousSibling:t.lastChild;su(s.contentDOM,s.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=cu(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 lu(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}HC(i,l||Dn[0],s)}return i}function HC(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 au(t,e,n){return lu(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 cu(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class WC{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=qC(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 ru(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 ou(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 qC(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 UC(t,e){return t.type.side-e.type.side}function KC(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 y=i[s++];y.widget&&(u?(f||(f=[u])).push(y):u=y)}if(u)if(f){f.sort(UC);for(let y=0;y<f.length;y++)n(f[y],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 y=0;y<l.length;y++)l[y].to<=o&&l.splice(y--,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 y=m;s<i.length&&i[s].from<y&&(y=i[s].from);for(let v=0;v<l.length;v++)l[v].to<y&&(y=l[v].to);y<m&&(a=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?l.filter(y=>!y.inline):l.slice();r(h,g,e.forChild(o,h),p),o=m}}function JC(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 GC(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&&vC(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 du(t){return t.editable?t.hasFocus():yu(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ht(t,e=!1){let n=t.state.selection;if(pu(t,n),!!du(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)ZC(t);else{let{anchor:r,head:i}=n,o,s;uu&&!(n instanceof ne)&&(n.$from.parent.inlineContent||(o=fu(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=fu(t,n.to))),t.docView.setSelection(r,i,t.root,e),uu&&(o&&hu(o),s&&hu(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&YC(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const uu=je||Fe&&SC<63;function fu(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 hu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function YC(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(()=>{(!du(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function ZC(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 pu(t,e){if(e instanceof Y){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(mu(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else mu(t)}function mu(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 gu(t){return t.editable&&!t.hasFocus()?!1:yu(t)}function yu(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 XC(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 bu(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 pr(t,e){return e<0?QC(t):eO(t)}function QC(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(ku(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 eO(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(ku(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 ku(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function tO(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 nO(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=tO(e,n))?(e=s,n=0):(o=nO(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 vu(t,e){let n=t.state.doc.resolve(e);if(!(Fe||CC)&&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 xu(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 wu(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 Su(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function rO(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;Su(t,r,"true"),setTimeout(()=>Su(t,r,"false"),20)}return!1}function iO(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function oO(t,e){let n=e.keyCode,r=iO(e);if(n==8||st&&n==72&&r=="c")return wu(t,-1)||pr(t,-1);if(n==46&&!e.shiftKey||st&&n==68&&r=="c")return wu(t,1)||pr(t,1);if(n==13||n==27)return!0;if(n==37||st&&n==66&&r=="c"){let i=n==37?vu(t,t.state.selection.from)=="ltr"?-1:1:-1;return bu(t,i,r)||pr(t,i)}else if(n==39||st&&n==70&&r=="c"){let i=n==39?vu(t,t.state.selection.from)=="ltr"?1:-1:1;return bu(t,i,r)||pr(t,i)}else{if(n==38||st&&n==80&&r=="c")return xu(t,-1,r)||pr(t,-1);if(n==40||st&&n==78&&r=="c")return rO(t)||xu(t,1,r)||pr(t,1);if(r==(st?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Cu(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=Au(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let d=a.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Nu[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 Ou(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(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=aO(n),ri&&cO(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")||ir.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!sO.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=dO($u(l,+u[1],+u[2]),u[4]);else if(l=W.maxOpen(lO(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=$u(l,f,h)}return t.someProp("transformPasted",f=>{l=f(l,t)}),l}const sO=/^(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 lO(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&&Mu(a,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Tu(s[s.length-1],o.length));let u=Eu(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return P.from(s)}return t}function Eu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,P.from(t));return t}function Mu(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Mu(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(Eu(n,t,i+1))))}}function Tu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Tu(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 $u(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 Nu={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 Bu=null;function Au(){return Bu||(Bu=document.implementation.createHTMLDocument("title"))}function aO(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Au().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Nu[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 cO(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 dO(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={},uO={touchstart:!0,touchmove:!0};class fO{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 hO(t){for(let e in He){let n=He[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{mO(t,r)&&!tl(t,r)&&(t.editable||!(r.type in We))&&n(t,r)},uO[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 pO(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 mO(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 gO(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,!Vu(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(kt&&Fe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),fr&&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))||oO(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(Vu(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 yO(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 mr(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function bO(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(mr(t,new Y(n)),!0):!1}function kO(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?(mr(t,Y.create(t.state.doc,i)),!0):!1}function vO(t,e,n,r,i){return nl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?kO(t,n):bO(t,n))}function xO(t,e,n,r){return nl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function wO(t,e,n,r){return nl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||SO(t,n,r)}function SO(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(mr(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)mr(t,ne.create(r,l+1,l+1+s.content.size));else if(Y.isSelectable(s))mr(t,Y.create(r,l));else continue;return!0}}function rl(t){return fo(t)}const Du=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&&yO(n,t.input.lastClick)&&!n[Du]&&(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 CO(t,s,n,!!r)):(o=="doubleClick"?xO:wO)(t,s.pos,s.inside,n)?n.preventDefault():cn(t,"pointer"))};class CO{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[Du],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"):vO(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)?(mr(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 Vu(t,e){return t.composing?!0:je&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const OO=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}_u(t,OO)},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++,_u(t,20))};function _u(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>fo(t),e))}function Iu(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=MO());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function EO(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=bC(e.focusNode,e.focusOffset),r=kC(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 MO(){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(),Iu(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 TO(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||fr&&OC<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}=Cu(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):TO(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function $O(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function NO(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=Ou(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=$O(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 Pu(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,Pu(r),r.getData("text/html"),i,n)?n.preventDefault():NO(t,n)};class Ru{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Lu=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}=Cu(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 Ru(u,!n[Lu],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=Ou(t,Pu(n.dataTransfer),ai?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[Lu]);if(t.someProp("handleDrop",m=>m(t,n,s||W.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?Td(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((g,y,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 gr=[],Vn={};class Ce{constructor(e,n){this.local=e.length?e:gr,this.children=n.length?n:gr}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?BO(this.children,s||[],e,n,r,i,o):s?new Ce(s.sort(_n),gr):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=Fu(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=zu(o?ju(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),gr);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 gr;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)):gr}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 BO(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,g)=>{let y=g-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&&y&&(l[v]+=y,l[v+1]+=y)}f+=y}),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:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let v=l[d+2].mapInner(n,y,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=AO(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 zu(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 AO(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 Fu(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 ju(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=Fu(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=zu(o?ju(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),Hu(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),Hu(e,i,r.copy(o.from,r.to)));break}}}return e}function Hu(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 DO={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},VO=Ge&&on<=11;class _O{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 IO{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new _O,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()}),VO&&(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,DO)),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(gu(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)&&gu(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||LO(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),PO(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 Wu=new WeakMap,qu=!1;function PO(t){if(!Wu.has(t)&&(Wu.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=bt,qu)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."),qu=!0}}function Uu(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 RO(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Uu(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?Uu(t,n):null}function LO(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 zO(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 y=o;y>i;y--){let v=r.childNodes[y-1],x=v.pmViewDesc;if(v.nodeName=="BR"&&!x){o=y;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||ir.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:FO,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,v=d[1]&&d[1].pos;v==null&&(v=y),m={anchor:y+s,head:v+s}}return{doc:g,sel:m,from:s,to:l}}function FO(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 jO=/^(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 HO(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=zO(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=UO(f.content,d.doc.content,d.from,h,p);if((fr&&t.input.lastIOSEnter>Date.now()-225||kt)&&i.some(A=>A.nodeType==1&&!jO.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=Ku(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 g=d.doc.resolveNoCache(m.start-d.from),y=d.doc.resolveNoCache(m.endB-d.from),v=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=m.endA,T;if((fr&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!x&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(T=le.findFrom(d.doc.resolve(g.pos+1),1,!0))&&T.head==y.pos)&&t.someProp("handleKeyDown",A=>A(t,Nn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&qO(u,m.start,m.endA,g,y)&&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&&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(A){return A(t,Nn(13,"Enter"))})},20));let b=m.start,S=m.endA,k,C,D;if(x){if(g.pos==y.pos)Ge&&on<=11&&g.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=WO(g.parent.content.cut(g.parentOffset,y.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(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let A=g.parent.textBetween(g.parentOffset,y.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=Ku(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 Ku(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 WO(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 qO(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 UO(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&&Ju(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&&Ju(t.textBetween(o-1,o+1))&&(o+=a?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function Ju(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 KO{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 fO,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Qu),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=Zu(this),Yu(this),this.nodeViews=Xu(this),this.docView=iu(this.state.doc,Gu(this),sl(this),this.dom,this),this.domObserver=new IO(this,(r,i,o,s)=>HO(this,r,i,o,s)),this.domObserver.start(),hO(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(Qu),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&&(Iu(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=Xu(this);GO(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&el(this),this.editable=Zu(this),Yu(this);let a=sl(this),d=Gu(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&&TC(this);if(s){this.domObserver.stop();let p=f&&(Ge||Fe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&JO(i.selection,e.selection);if(f){let m=Fe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=EO(this)),(o||!this.docView.update(e.doc,d,a,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=iu(e.doc,d,a,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&XC(this))?Ht(this,p):(pu(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&&$C(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&&qd(this,n.getBoundingClientRect(),e)}else qd(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 Ru(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&&NC(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 _C(this,e)}coordsAtPos(e,n=1){return Zd(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 zC(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&&(pO(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,gC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return gO(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&&xC(this.dom.ownerDocument)==this.dom&&RO(this,e)||e}domSelection(){return this.root.getSelection()}}function Gu(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 Yu(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 Zu(t){return!t.someProp("editable",e=>e(t.state)===!1)}function JO(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 Xu(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 GO(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 Qu(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:'"'},YO=typeof navigator<"u"&&/Mac/.test(navigator.platform),ZO=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 XO(t){var e=YO&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ZO&&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 QO=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function e2(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))QO?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 t2(t){let e=Object.create(null);for(let n in t)e[e2(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 n2(t){return new ze({props:{handleKeyDown:ef(t)}})}function ef(t){let e=t2(t);return function(n,r){let i=XO(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 tf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const nf=(t,e,n)=>{let r=tf(t,n);if(!r)return!1;let i=ul(r);if(!i){let s=r.blockRange(),l=s&&lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&ff(t,i,e))return!0;if(r.parent.content.size==0&&(yr(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(yr(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},r2=(t,e,n)=>{let r=tf(t,n);if(!r)return!1;let i=ul(r);return i?rf(t,i,e):!1},i2=(t,e,n)=>{let r=sf(t,n);if(!r)return!1;let i=fl(r);return i?rf(t,i,e):!1};function rf(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 yr(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 of=(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 sf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const lf=(t,e,n)=>{let r=sf(t,n);if(!r)return!1;let i=fl(r);if(!i)return!1;let o=i.nodeAfter;if(ff(t,i,e))return!0;if(r.parent.content.size==0&&(yr(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(yr(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},af=(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 o2=(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},s2=(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},l2=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},cf=(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 a2=(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},df=(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},uf=(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&&lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function c2(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 d2=c2(),u2=(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 f2(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 ff(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(f2(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 g=o.length-1;g>=0;g--)h=P.from(o[g].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&&lr(d);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(d,u).scrollIntoView()),!0;if(l&&yr(i,"start",!0)&&yr(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=P.empty;for(let v=h.length-1;v>=0;v--)g=P.from(h[v].copy(g));let y=t.tr.step(new $e(e.pos-h.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new W(g,h.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function hf(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 h2=hf(-1),p2=hf(1);function m2(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 pf(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,nf,of),pl(dl,lf,af),pl(cf,df,uf,d2),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function g2(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(y2(n.tr,s,d,l,t).scrollIntoView()),!0):!1}}function y2(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 b2(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?k2(e,n,t,o):v2(e,n,o):!0:!1}}function k2(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=lr(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 v2(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 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 x2(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,(...g)=>{const y=this.buildProps(d,n),v=p(...g)(y);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 w2{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 mf(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 gf(t){return typeof t=="function"}function ae(t,e=void 0,...n){return gf(t)?e?t.bind(e)(...n):t(...n):t}function S2(t={}){return Object.keys(t).length===0&&t.constructor===Object}function C2(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function yf(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):C2(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function bf(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&S2(n)?!1:n!=null))}function O2(t,e){var n;const r=mf(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=bf({...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=>yf(v,u)));const g=J(d,"renderHTML",f);g&&(p.toDOM=v=>g({node:v,HTMLAttributes:ml(v,u)}));const y=J(d,"renderText",f);return y&&(p.toText=y),[d.name,p]})),a=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,v)=>{const x=J(v,"extendMarkSchema",f);return{...y,...x?x(d):{}}},{}),p=bf({...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(y=>{var v;return[y.name,{default:(v=y==null?void 0:y.attribute)===null||v===void 0?void 0:v.default}]}))}),m=ae(J(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>yf(y,u)));const g=J(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:ml(y,u)})),[d.name,p]}));return new VS({topNode:s,nodes:l,marks:a})}function gl(t,e){return e.nodes[t]||e.marks[t]||null}function kf(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const E2=(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 M2=(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=E2(d)+o;return s.forEach(h=>{if(u)return;const p=M2(f,h.find);if(!p)return;const m=a.state.tr,g=go({state:a.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:v,chain:x,can:T}=new yo({editor:n,state:g});h.handler({state:g,range:y,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 T2(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 $2(t){return typeof t=="number"}class N2{constructor(e){this.find=e.find,this.handler=e.handler}}const B2=(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 A2(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 g=Math.max(r,m),y=Math.min(i,m+p.content.size),v=p.textBetween(g-m,y-m,void 0,"");B2(v,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:a,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(C)})}),f.every(p=>p!==null)}const D2=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 V2(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 g=u.tr,y=go({state:u,transaction:g});if(!(!A2({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:l})||!g.steps.length))return l=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,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],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,v=m.getMeta("applyPasteRules"),x=!!v;if(!g&&!y&&!x)return;if(x){const{from:S,text:k}=v,C=S+k.length,D=D2(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(!(!$2(T)||!b||T===b.b))return a({rule:u,state:p,from:T,to:b,pasteEvt:s})}}))}function _2(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class br{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=br.resolve(e),this.schema=O2(this.extensions,n),this.setupExtensions()}static resolve(e){const n=br.sort(br.flatten(e)),r=_2(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=br.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 g=Object.fromEntries(Object.entries(d()).map(([y,v])=>[y,()=>v({editor:e})]));u={...u,...g}}const f=n2(u);a.push(f);const h=J(s,"addInputRules",l);kf(s,e.options.enableInputRules)&&h&&r.push(...h());const p=J(s,"addPasteRules",l);kf(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=J(s,"addProseMirrorPlugins",l);if(m){const g=m();a.push(...g)}return a}).flat();return[T2({editor:e,rules:r}),...V2({editor:e,rules:i}),...o]}get attributes(){return mf(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 I2(t){return Object.prototype.toString.call(t).slice(8,-1)}function bl(t){return I2(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 vf(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 xf(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const P2=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=xf(n);return vf(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),R2=()=>({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),L2=(t=!1)=>({commands:e})=>e.setContent("",t),z2=()=>({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=lr(p);if(l.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},F2=t=>e=>t(e),j2=()=>({state:t,dispatch:e})=>df(t,e),H2=(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},W2=()=>({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},q2=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},U2=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},K2=()=>({state:t,dispatch:e})=>dl(t,e),J2=()=>({commands:t})=>t.keyboardShortcut("Enter"),G2=()=>({state:t,dispatch:e})=>a2(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 Y2(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&&Y2([...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 Z2=(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},X2=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 wf(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 Q2=(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=wf(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},eE=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),tE=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Sf=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&&Sf(r)}return t};function Cf(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Sf(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=ir.fromSchema(e);return n.slice?o.parseSlice(Cf(t),n.parseOptions).content:o.parse(Cf(t),n.parseOptions)}return So("",e,n)}function nE(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 rE=t=>t.toString().startsWith("<"),iE=(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((rE(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&&nE(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},oE=()=>({state:t,dispatch:e})=>o2(t,e),sE=()=>({state:t,dispatch:e})=>s2(t,e),lE=()=>({state:t,dispatch:e})=>nf(t,e),aE=()=>({state:t,dispatch:e})=>lf(t,e),cE=()=>({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}},dE=()=>({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}},uE=()=>({state:t,dispatch:e})=>r2(t,e),fE=()=>({state:t,dispatch:e})=>i2(t,e);function Of(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function hE(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()||Of()?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 pE=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=hE(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 mE=(t,e={})=>({state:n,dispatch:r})=>{const i=Ne(t,n.schema);return ui(n,i,e)?l2(n,r):!1},gE=()=>({state:t,dispatch:e})=>uf(t,e),yE=t=>({state:e,dispatch:n})=>{const r=Ne(t,e.schema);return b2(r)(e,n)},bE=()=>({state:t,dispatch:e})=>cf(t,e);function Co(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ef(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 kE=(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,Ef(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Ef(f.attrs,e)))})})}),!0):!1},vE=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),xE=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),wE=()=>({state:t,dispatch:e})=>of(t,e),SE=()=>({state:t,dispatch:e})=>af(t,e),CE=()=>({state:t,dispatch:e})=>u2(t,e),OE=()=>({state:t,dispatch:e})=>p2(t,e),EE=()=>({state:t,dispatch:e})=>h2(t,e);function Mf(t,e,n={}){return So(t,e,{slice:!1,parseOptions:n})}const ME=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,l=Mf(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 TE(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 $E(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=>$E(e.$from,t)}function NE(t,e){const n=Ot.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function BE(t,e){const n={from:0,to:t.content.size};return vf(t,n,e)}function AE(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 DE(t,e){const n=Co(typeof e=="string"?e:e.name,t.schema);return n==="node"?AE(t,e):n==="mark"?Oo(t,e):{}}function Tf(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,(g,y)=>{if(!g.isText&&!g.marks.length)return;const v=Math.max(p,y),x=Math.min(m,y+g.nodeSize),T=x-v;s+=T,l.push(...g.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 VE(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 $f(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 _E(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 IE(t){return t instanceof Y}function Nf(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 PE(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(g=>g.type.excludes(n));d=p&&m}return!d}),d})}const RE=(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),g=Math.min(p+h.nodeSize,f);h.marks.find(v=>v.type===a)?h.marks.forEach(v=>{a===v.type&&n.addMark(m,g,a.create({...v.attrs,...e}))}):n.addMark(m,g,a.create(e))})});return PE(r,n,a)},LE=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),zE=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Ne(t,n.schema);return o.isTextblock?i().command(({commands:s})=>pf(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>pf(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},FE=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},jE=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},HE=t=>({state:e,dispatch:n})=>{const r=Ne(t,e.schema);return x2(r)(e,n)};function Bf(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 WE=({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&&Bf(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:TE(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 g=e.mapping.map(l.before()),y=e.doc.resolve(g);l.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}t&&Bf(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},qE=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 y=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)y=P.from(l.node(C).copy(y));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;y=y.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(y,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 g=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:y,storedMarks:v}=n,{splittableMarks:x}=i.extensionManager,T=v||y.$to.parentOffset&&y.$from.marks();if(e.split(l.pos,2,g).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 UE=Object.freeze({__proto__:null,blur:R2,clearContent:L2,clearNodes:z2,command:F2,createParagraphNear:j2,cut:H2,deleteCurrentNode:W2,deleteNode:q2,deleteRange:U2,deleteSelection:K2,enter:J2,exitCode:G2,extendMarkRange:Z2,first:X2,focus:Q2,forEach:eE,insertContent:tE,insertContentAt:iE,joinUp:oE,joinDown:sE,joinBackward:lE,joinForward:aE,joinItemBackward:cE,joinItemForward:dE,joinTextblockBackward:uE,joinTextblockForward:fE,keyboardShortcut:pE,lift:mE,liftEmptyBlock:gE,liftListItem:yE,newlineInCode:bE,resetAttributes:kE,scrollIntoView:vE,selectAll:xE,selectNodeBackward:wE,selectNodeForward:SE,selectParentNode:CE,selectTextblockEnd:OE,selectTextblockStart:EE,setContent:ME,setMark:RE,setMeta:LE,setNode:zE,setNodeSelection:FE,setTextSelection:jE,sinkListItem:HE,splitBlock:WE,splitListItem:qE,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:g,storedMarks:y}=s,{$from:v,$to:x}=g,T=v.blockRange(x),b=y||g.$to.parentOffset&&g.$from.marks();if(!T)return!1;const S=Sl(k=>$f(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($f(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(y=>y.type===a))===null||o===void 0?void 0:o.attrs,g=vl(d,a,m);g&&(h=g.from,p=g.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),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=Ne(t,n.schema);return m2(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Ne(t,n.schema);return g2(i,e)(n,r)}});const KE=Re.create({name:"commands",addCommands(){return{...UE}}}),JE=Re.create({name:"editable",addProseMirrorPlugins(){return[new ze({key:new yt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),GE=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}}}})]}}),YE=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,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,v=g&&m.parent.childCount===1?y===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()||Of()?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}})]}}),ZE=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 XE=`.ProseMirror {
5
+ */function Ee(t){return typeof t=="function"}function sa(t){return t==null}const Gt=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function zo(t){return Number(t)>=0}function ep(t){const e=parseFloat(t);return isNaN(e)?t:e}function tp(t){return typeof t=="object"&&t!==null}function np(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function la(t){if(!tp(t)||np(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(la(e[n])&&la(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(zo(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const aa={};function pt(t,e){ip(t,e),aa[t]=e}function rp(t){return aa[t]}function ip(t,e){if(!Ee(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function ca(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++)ca(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]||ca(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Dr=Symbol("vee-validate-form"),da=Symbol("vee-validate-field-instance"),Ci=Symbol("Default empty value"),op=typeof window<"u";function Fo(t){return Ee(t)&&!!t.__locatorRef}function mt(t){return!!t&&Ee(t.parse)&&t.__type==="VVTypedSchema"}function Oi(t){return!!t&&Ee(t.validate)}function Vr(t){return t==="checkbox"||t==="radio"}function sp(t){return Gt(t)||Array.isArray(t)}function lp(t){return Array.isArray(t)?t.length===0:Gt(t)&&Object.keys(t).length===0}function Mi(t){return/^\[.+\]$/i.test(t)}function ap(t){return ua(t)&&t.multiple}function ua(t){return t.tagName==="SELECT"}function cp(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function dp(t,e){return!cp(t,e)&&e.type!=="file"&&!Vr(e.type)}function fa(t){return jo(t)&&t.target&&"submit"in t.target}function jo(t){return t?!!(typeof Event<"u"&&Ee(Event)&&t instanceof Event||t&&t.srcElement):!1}function ha(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(pa(t)&&pa(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 pa(t){return op?t instanceof File:!1}function Ho(t){return Mi(t)?t.replace(/\[|\]/gi,""):t}function Ue(t,e,n){return t?Mi(e)?t[Ho(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>sp(i)&&o in i?i[o]:n,t):n}function Rt(t,e,n){if(Mi(e)){t[Ho(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)||sa(i[r[o]]))&&(i[r[o]]=zo(r[o+1])?[]:{}),i=i[r[o]]}}function Wo(t,e){if(Array.isArray(t)&&zo(e)){t.splice(Number(e),1);return}Gt(t)&&delete t[e]}function ma(t,e){if(Mi(e)){delete t[Ho(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){Wo(r,n[o]);break}if(!(n[o]in r)||sa(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(lp(i[o])){if(o===0){Wo(t,n[0]);continue}Wo(i[o-1],n[o-1])}}function Ke(t){return Object.keys(t)}function qo(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function ga(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 up(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 ya(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 fp(t,e){return Gt(e)&&e.number?ep(t):t}function Uo(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 Ko(t){return Array.isArray(t)?t:t?[t]:[]}function Ei(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function hp(t){let e=null,n=[];return function(...r){const i=a.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 Jo(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 Yo(t){if(ba(t))return t._value}function ba(t){return"_value"in t}function pp(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Ti(t){if(!jo(t))return t;const e=t.target;if(Vr(e.type)&&ba(e))return Yo(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(ap(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Yo);if(ua(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Yo(n):e.value}return pp(e)}function ka(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Gt(t)&&t._$$isNormalized?t:Gt(t)?Object.keys(t).reduce((n,r)=>{const i=mp(t[r]);return t[r]!==!1&&(n[r]=xa(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=gp(r);return i.name&&(n[i.name]=xa(i.params)),n},e):e}function mp(t){return t===!0?[]:Array.isArray(t)||Gt(t)?t:[t]}function xa(t){const e=n=>typeof n=="string"&&n[0]==="@"?yp(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 gp=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function yp(t){const e=n=>Ue(n,t)||n[t];return e.__locatorRef=t,e}function bp(t){return Array.isArray(t)?t.filter(Fo):Ke(t).filter(e=>Fo(t[e])).map(e=>t[e])}let kp=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const xn=()=>kp;async function va(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 xp(i,t)).errors;return{errors:s,valid:!s.length}}async function xp(t,e){if(mt(t.rules)||Oi(t.rules))return wp(e,t.rules);if(Ee(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],c=l.length,d=[];for(let u=0;u<c;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:Sa(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:ka(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await Sp(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function vp(t){return!!t&&t.name==="ValidationError"}function wa(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!vp(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 c=l.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...l.errors),s},{});return{errors:Object.values(o)}}}}}async function wp(t,e){const r=await(mt(e)?e:wa(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function Sp(t,e,n){const r=rp(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=Cp(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:Sa(o)}}function Sa(t){const e=xn().generateMessage;return e?e(t):"Field is invalid"}function Cp(t,e){const n=r=>Fo(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 Op(t,e){const r=await(mt(t)?t:wa(t)).parse(me(e)),i={},o={};for(const s of r.errors){const l=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function Mp(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 va(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={},c={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c}}let Ca=0;function Ep(t,e){const{value:n,initialValue:r,setInitialValue:i}=Tp(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:c,setErrors:d}=Bp(),u=Ca>=Number.MAX_SAFE_INTEGER?0:++Ca,f=Np(n,r,c,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:c,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=a.computed(()=>o.errors);function l(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(a.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(a.unref(t),(f=c.touched)!==null&&f!==void 0?f:!1)),"initialValue"in c&&i(c.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 Tp(t,e,n){const r=a.ref(a.unref(e));function i(){return n?Ue(n.initialValues.value,a.unref(t),a.unref(r)):a.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(a.unref(t),d,!0)}const s=a.computed(i);if(!n)return{value:a.ref(i()),initialValue:s,setInitialValue:o};const l=$p(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return Ue(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function $p(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:Ue(e.values,a.unref(r),a.unref(n))}function Np(t,e,n,r){const i=a.computed(()=>{var s,l,c;return(c=(l=(s=a.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&c!==void 0?c:!1}),o=a.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!a.unref(n).length,initialValue:a.computed(()=>a.unref(e)),dirty:a.computed(()=>!Le(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function Bp(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=Ko(e)}}}function Oa(t){process.env.NODE_ENV!=="production"&&Qh({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"},Vp)}const _r={},Ir={};let Lt;const qn=up(()=>{setTimeout(async()=>{await a.nextTick(),Lt==null||Lt.sendInspectorState(Un),Lt==null||Lt.sendInspectorTree(Un)},100)},100);function Ap(t){const e=a.getCurrentInstance();if(!Lt){const n=e==null?void 0:e.appContext.app;if(!n)return;Oa(n)}_r[t.formId]=Object.assign({},t),_r[t.formId]._vm=e,a.onUnmounted(()=>{delete _r[t.formId],qn()}),qn()}function Dp(t){const e=a.getCurrentInstance();if(!Lt){const n=e==null?void 0:e.appContext.app;if(!n)return;Oa(n)}Ir[t.id]=Object.assign({},t),Ir[t.id]._vm=e,a.onUnmounted(()=>{delete Ir[t.id],qn()}),qn()}const Un="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 Vp(t){Lt=t,t.addInspector({id:Un,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!==Un)return;const n=Object.values(_r),r=Object.values(Ir);e.rootNodes=[...n.map(_p),...r.map(i=>Pp(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Un||n.currentTab!==`custom-inspector:${Un}`)return;const{form:r,field:i,state:o,type:s}=Rp(e.nodeId);if(r&&s==="form"){e.state=Lp(r),we={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Ea(o),we={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Ea({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 _p(t){const{textColor:e,bgColor:n}=Ta(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{Rt(r,a.unref(s.path),Ip(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Gt(s)?{id:`${l.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:Go(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Je.white,backgroundColor:Je.unknown}]}}function Ip(t,e){return{id:Go(e,t),label:a.unref(t.path),tags:Ma(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Pp(t,e){return{id:Go(e,t),label:a.unref(t.name),tags:Ma(!1,1,t.type,t.meta.valid,e)}}function Ma(t,e,n,r,i){const{textColor:o,bgColor:s}=Ta(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 Go(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:a.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 Rp(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 Ea(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 Lp(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,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(l[c]=u),l},{})}]}}function Ta(t){return{bgColor:t?Je.success:Je.error,textColor:t?Je.black:Je.white}}function zp(t,e,n){return Vr(n==null?void 0:n.type)?jp(t,e,n):$a(t,e,n)}function $a(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=Fp(n),y=f?qo(Dr):void 0,g=m||y,k=a.computed(()=>Ar(a.toValue(t))),S=a.computed(()=>{if(a.toValue(g==null?void 0:g.schema))return;const Z=a.unref(e);return Oi(Z)||mt(Z)||Ee(Z)||Array.isArray(Z)?Z:ka(Z)}),N=!Ee(S.value)&&mt(a.toValue(e)),{id:b,value:w,initialValue:x,meta:T,setState:I,errors:A,flags:B}=Ep(k,{modelValue:r,form:g,bails:o,label:c,type:s,validate:S.value?E:void 0,schema:N?e:void 0}),P=a.computed(()=>A.value[0]);p&&Hp({value:w,prop:p,handleChange:C,shouldValidate:()=>d&&!B.pendingReset});const F=(j,Z=!1)=>{T.touched=!0,Z&&D()};async function V(j){var Z,ue;if(g!=null&&g.validateSchema){const{results:re}=await g.validateSchema(j);return(Z=re[a.toValue(k)])!==null&&Z!==void 0?Z:{valid:!0,errors:[]}}return S.value?va(w.value,S.value,{name:a.toValue(k),label:a.toValue(c),values:(ue=g==null?void 0:g.values)!==null&&ue!==void 0?ue:{},bails:o}):{valid:!0,errors:[]}}const D=Uo(async()=>(T.pending=!0,T.validated=!0,V("validated-only")),j=>(B.pendingUnmount[oe.id]||(I({errors:j.errors}),T.pending=!1,T.valid=j.valid),j)),$=Uo(async()=>V("silent"),j=>(T.valid=j.valid,j));function E(j){return(j==null?void 0:j.mode)==="silent"?$():D()}function C(j,Z=!0){const ue=Ti(j);ie(ue,Z)}a.onMounted(()=>{if(i)return D();(!g||!g.validateSchema)&&$()});function _(j){T.touched=j}function W(j){var Z;const ue=j&&"value"in j?j.value:x.value;I({value:me(ue),initialValue:me(ue),touched:(Z=j==null?void 0:j.touched)!==null&&Z!==void 0?Z:!1,errors:(j==null?void 0:j.errors)||[]}),T.pending=!1,T.validated=!1,$()}const Y=a.getCurrentInstance();function ie(j,Z=!0){w.value=Y&&p?fp(j,Y.props.modelModifiers):j,(Z?D:$)()}function de(j){I({errors:Array.isArray(j)?j:[j]})}const he=a.computed({get(){return w.value},set(j){ie(j,d)}}),oe={id:b,name:k,label:c,value:he,meta:T,errors:A,errorMessage:P,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:W,handleReset:()=>W(),validate:E,handleChange:C,handleBlur:F,setState:I,setTouched:_,setErrors:de,setValue:ie};if(a.provide(da,oe),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(j,Z)=>{Le(j,Z)||(T.validated?D():$())},{deep:!0}),process.env.NODE_ENV!=="production"&&(oe._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:A.value},T),{value:w.value}),qn,{deep:!0}),g||Dp(oe)),!g)return oe;const ye=a.computed(()=>{const j=S.value;return!j||Ee(j)||Oi(j)||mt(j)||Array.isArray(j)?{}:Object.keys(j).reduce((Z,ue)=>{const re=bp(j[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 a.watch(ye,(j,Z)=>{if(!Object.keys(j).length)return;!Le(j,Z)&&(T.validated?D():$())}),a.onBeforeUnmount(()=>{var j;const Z=(j=a.toValue(oe.keepValueOnUnmount))!==null&&j!==void 0?j:a.toValue(g.keepValuesOnUnmount),ue=a.toValue(k);if(Z||!g||B.pendingUnmount[oe.id]){g==null||g.removePathState(ue,b);return}B.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,a.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(a.toValue(k));g.removePathState(ue,b)}}),oe}function Fp(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||{}))?Zo(a.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 jp(t,e,n){const r=n!=null&&n.standalone?void 0:qo(Dr),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const c=l.handleChange,d=a.computed(()=>{const f=a.toValue(l.value),h=a.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=a.toValue(t),g=r==null?void 0:r.getPathState(y),k=Ti(f);let S=(m=a.toValue(i))!==null&&m!==void 0?m:k;r&&(g!=null&&g.multiple)&&g.type==="checkbox"?S=ga(Ue(r.values,y)||[],S,void 0):(n==null?void 0:n.type)==="checkbox"&&(S=ga(a.toValue(l.value),S,a.toValue(o))),c(S,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s($a(t,e,n))}function Hp({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=a.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&&(a.watch(e,l=>{Le(l,Zo(i,o))||i.emit(s,l)}),a.watch(()=>Zo(i,o),l=>{if(l===Ci&&e.value===void 0)return;const c=l===Ci?void 0:l;Le(c,e.value)||n(c,r())}))}function Zo(t,e){if(t)return t.props[e]}const Wp=a.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:()=>xn().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=a.toRef(t,"rules"),r=a.toRef(t,"name"),i=a.toRef(t,"label"),o=a.toRef(t,"uncheckedValue"),s=a.toRef(t,"keepValue"),{errors:l,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:y,meta:g,checked:k,setErrors:S}=zp(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:Up(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),N=function(A,B=!0){f(A,B)},b=a.computed(()=>{const{validateOnInput:I,validateOnChange:A,validateOnBlur:B,validateOnModelUpdate:P}=qp(t);function F(E){h(E,B),Ee(e.attrs.onBlur)&&e.attrs.onBlur(E)}function V(E){N(E,I),Ee(e.attrs.onInput)&&e.attrs.onInput(E)}function D(E){N(E,A),Ee(e.attrs.onChange)&&e.attrs.onChange(E)}const $={name:t.name,onBlur:F,onInput:V,onChange:D};return $["onUpdate:modelValue"]=E=>N(E,P),$}),w=a.computed(()=>{const I=Object.assign({},b.value);Vr(e.attrs.type)&&k&&(I.checked=k.value);const A=Na(t,e);return dp(A,e.attrs)&&(I.value=c.value),I}),x=a.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:c.value}));function T(){return{field:w.value,componentField:x.value,value:c.value,meta:g,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:N,handleInput:I=>N(I,!1),handleReset:y,handleBlur:b.value.onBlur,setTouched:p,setErrors:S}}return e.expose({value:c,meta:g,errors:l,errorMessage:d,setErrors:S,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const I=a.resolveDynamicComponent(Na(t,e)),A=Jo(I,e,T);return I?a.h(I,Object.assign(Object.assign({},e.attrs),w.value),A):A}}});function Na(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function qp(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=xn();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:c}}function Up(t,e){return Vr(e.attrs.type)?ha(t,"modelValue")?t.modelValue:void 0:ha(t,"modelValue")?t.modelValue:e.attrs.value}const Pr=Wp;let Kp=0;const $i=["bails","fieldsCount","id","multiple","type","validate"];function Ba(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},a.toValue(e)),r=a.unref(t==null?void 0:t.validationSchema);return r&&mt(r)&&Ee(r.cast)?me(r.cast(n)||{}):me(n)}function Jp(t){var e;const n=Kp++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(Ba(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=hp(()=>{f.value=d.value.reduce((M,O)=>(M[Ar(a.toValue(O.path))]=O,M),{})});function p(M,O){const R=E(M);if(!R){typeof M=="string"&&(u.value[Ar(M)]=Ko(O));return}if(typeof M=="string"){const U=Ar(M);u.value[U]&&delete u.value[U]}R.errors=Ko(O),R.valid=!R.errors.length}function m(M){Ke(M).forEach(O=>{p(O,M[O])})}t!=null&&t.initialErrors&&m(t.initialErrors);const y=a.computed(()=>{const M=d.value.reduce((O,R)=>(R.errors.length&&(O[R.path]=R.errors),O),{});return Object.assign(Object.assign({},u.value),M)}),g=a.computed(()=>Ke(y.value).reduce((M,O)=>{const R=y.value[O];return R!=null&&R.length&&(M[O]=R[0]),M},{})),k=a.computed(()=>d.value.reduce((M,O)=>(M[O.path]={name:O.path||"",label:O.label||""},M),{})),S=a.computed(()=>d.value.reduce((M,O)=>{var R;return M[O.path]=(R=O.bails)!==null&&R!==void 0?R:!0,M},{})),N=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:w,originalInitialValues:x,setInitialValues:T}=Gp(d,c,t),I=Yp(d,c,x,g),A=a.computed(()=>d.value.reduce((M,O)=>{const R=Ue(c,O.path);return Rt(M,O.path,R),M},{})),B=t==null?void 0:t.validationSchema;function P(M,O){var R,U;const Q=a.computed(()=>Ue(w.value,a.toValue(M))),v=f.value[a.toValue(M)],z=(O==null?void 0:O.type)==="checkbox"||(O==null?void 0:O.type)==="radio";if(v&&z){v.multiple=!0;const qe=r++;return Array.isArray(v.id)?v.id.push(qe):v.id=[v.id,qe],v.fieldsCount++,v.__flags.pendingUnmount[qe]=!1,v}const K=a.computed(()=>Ue(c,a.toValue(M))),X=a.toValue(M),ee=_.findIndex(qe=>qe===X);ee!==-1&&_.splice(ee,1);const se=a.computed(()=>{var qe,it,Hn,kn;const Pt=a.toValue(B);if(mt(Pt))return(it=(qe=Pt.describe)===null||qe===void 0?void 0:qe.call(Pt,a.toValue(M)).required)!==null&&it!==void 0?it:!1;const Si=a.toValue(O==null?void 0:O.schema);return mt(Si)&&(kn=(Hn=Si.describe)===null||Hn===void 0?void 0:Hn.call(Si).required)!==null&&kn!==void 0?kn:!1}),pe=r++,ve=a.reactive({id:pe,path:M,touched:!1,pending:!1,valid:!0,validated:!!(!((R=N[X])===null||R===void 0)&&R.length),required:se,initialValue:Q,errors:a.shallowRef([]),bails:(U=O==null?void 0:O.bails)!==null&&U!==void 0?U:!1,label:O==null?void 0:O.label,type:(O==null?void 0:O.type)||"default",value:K,multiple:!1,__flags:{pendingUnmount:{[pe]:!1},pendingReset:!1},fieldsCount:1,validate:O==null?void 0:O.validate,dirty:a.computed(()=>!Le(a.unref(K),a.unref(Q)))});return d.value.push(ve),f.value[X]=ve,h(),g.value[X]&&!N[X]&&a.nextTick(()=>{ft(X,{mode:"silent"})}),a.isRef(M)&&a.watch(M,qe=>{h();const it=me(K.value);f.value[qe]=ve,a.nextTick(()=>{Rt(c,qe,it)})}),ve}const F=ya(It,5),V=ya(It,5),D=Uo(async M=>await(M==="silent"?F():V()),(M,[O])=>{const R=Ke(j.errorBag.value),Q=[...new Set([...Ke(M.results),...d.value.map(v=>v.path),...R])].sort().reduce((v,z)=>{var K;const X=z,ee=E(X)||C(X),se=((K=M.results[X])===null||K===void 0?void 0:K.errors)||[],pe=a.toValue(ee==null?void 0:ee.path)||X,ve=Zp({errors:se,valid:!se.length},v.results[pe]);return v.results[pe]=ve,ve.valid||(v.errors[pe]=ve.errors[0]),ee&&u.value[pe]&&delete u.value[pe],ee?(ee.valid=ve.valid,O==="silent"||O==="validated-only"&&!ee.validated||p(ee,ve.errors),v):(p(pe,se),v)},{valid:M.valid,results:{},errors:{}});return M.values&&(Q.values=M.values),Ke(Q.results).forEach(v=>{var z;const K=E(v);K&&O!=="silent"&&(O==="validated-only"&&!K.validated||p(K,(z=Q.results[v])===null||z===void 0?void 0:z.errors))}),Q});function $(M){d.value.forEach(M)}function E(M){const O=typeof M=="string"?Ar(M):M;return typeof O=="string"?f.value[O]:O}function C(M){return d.value.filter(R=>M.startsWith(R.path)).reduce((R,U)=>R?U.path.length>R.path.length?U:R:U,void 0)}let _=[],W;function Y(M){return _.push(M),W||(W=a.nextTick(()=>{[..._].sort().reverse().forEach(R=>{ma(c,R)}),_=[],W=null})),W}function ie(M){return function(R,U){return function(v){return v instanceof Event&&(v.preventDefault(),v.stopPropagation()),$(z=>z.touched=!0),i.value=!0,s.value++,vt().then(z=>{const K=me(c);if(z.valid&&typeof R=="function"){const X=me(A.value);let ee=M?X:K;return z.values&&(ee=z.values),R(ee,{evt:v,controlledValues:X,setErrors:m,setFieldError:p,setTouched:gn,setFieldTouched:be,setValues:re,setFieldValue:Z,resetForm:Kt,resetField:yn})}!z.valid&&typeof U=="function"&&U({values:K,evt:v,errors:z.errors,results:z.results})}).then(z=>(i.value=!1,z),z=>{throw i.value=!1,z})}}}const he=ie(!1);he.withControlled=ie(!0);function oe(M,O){const R=d.value.findIndex(Q=>Q.path===M&&(Array.isArray(Q.id)?Q.id.includes(O):Q.id===O)),U=d.value[R];if(!(R===-1||!U)){if(a.nextTick(()=>{ft(M,{mode:"silent",warn:!1})}),U.multiple&&U.fieldsCount&&U.fieldsCount--,Array.isArray(U.id)){const Q=U.id.indexOf(O);Q>=0&&U.id.splice(Q,1),delete U.__flags.pendingUnmount[O]}(!U.multiple||U.fieldsCount<=0)&&(d.value.splice(R,1),ht(M),h(),delete f.value[M])}}function ye(M){Ke(f.value).forEach(O=>{O.startsWith(M)&&delete f.value[O]}),d.value=d.value.filter(O=>!O.path.startsWith(M)),a.nextTick(()=>{h()})}const j={formId:n,values:c,controlledValues:A,errorBag:y,errors:g,schema:B,submitCount:s,meta:I,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:b,validateSchema:a.unref(B)?D:void 0,validate:vt,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:P,getPathState:E,unsetPathValue:Y,removePathState:oe,initialValues:w,getAllPathStates:()=>d.value,destroyPath:ye,isFieldTouched:Oe,isFieldDirty:ut,isFieldValid:Er};function Z(M,O,R=!0){const U=me(O),Q=typeof M=="string"?M:M.path;E(Q)||P(Q),Rt(c,Q,U),R&&ft(Q)}function ue(M,O=!0){Ke(c).forEach(R=>{delete c[R]}),Ke(M).forEach(R=>{Z(R,M[R],!1)}),O&&vt()}function re(M,O=!0){Br(c,M),l.forEach(R=>R&&R.reset()),O&&vt()}function fe(M,O){const R=E(a.toValue(M))||P(M);return a.computed({get(){return R.value},set(U){var Q;const v=a.toValue(M);Z(v,U,(Q=a.toValue(O))!==null&&Q!==void 0?Q:!1)}})}function be(M,O){const R=E(M);R&&(R.touched=O)}function Oe(M){const O=E(M);return O?O.touched:d.value.filter(R=>R.path.startsWith(M)).some(R=>R.touched)}function ut(M){const O=E(M);return O?O.dirty:d.value.filter(R=>R.path.startsWith(M)).some(R=>R.dirty)}function Er(M){const O=E(M);return O?O.valid:d.value.filter(R=>R.path.startsWith(M)).every(R=>R.valid)}function gn(M){if(typeof M=="boolean"){$(O=>{O.touched=M});return}Ke(M).forEach(O=>{be(O,!!M[O])})}function yn(M,O){var R;const U=O&&"value"in O?O.value:Ue(w.value,M),Q=E(M);Q&&(Q.__flags.pendingReset=!0),Jt(M,me(U),!0),Z(M,U,!1),be(M,(R=O==null?void 0:O.touched)!==null&&R!==void 0?R:!1),p(M,(O==null?void 0:O.errors)||[]),a.nextTick(()=>{Q&&(Q.__flags.pendingReset=!1)})}function Kt(M,O){let R=me(M!=null&&M.values?M.values:x.value);R=O!=null&&O.force?R:Br(x.value,R),R=mt(B)&&Ee(B.cast)?B.cast(R):R,T(R),$(U=>{var Q;U.__flags.pendingReset=!0,U.validated=!1,U.touched=((Q=M==null?void 0:M.touched)===null||Q===void 0?void 0:Q[U.path])||!1,Z(U.path,Ue(R,U.path),!1),p(U.path,void 0)}),O!=null&&O.force?ue(R,!1):re(R,!1),m((M==null?void 0:M.errors)||{}),s.value=(M==null?void 0:M.submitCount)||0,a.nextTick(()=>{vt({mode:"silent"}),$(U=>{U.__flags.pendingReset=!1})})}async function vt(M){const O=(M==null?void 0:M.mode)||"force";if(O==="force"&&$(v=>v.validated=!0),j.validateSchema)return j.validateSchema(O);o.value=!0;const R=await Promise.all(d.value.map(v=>v.validate?v.validate(M).then(z=>({key:v.path,valid:z.valid,errors:z.errors})):Promise.resolve({key:v.path,valid:!0,errors:[]})));o.value=!1;const U={},Q={};for(const v of R)U[v.key]={valid:v.valid,errors:v.errors},v.errors.length&&(Q[v.key]=v.errors[0]);return{valid:R.every(v=>v.valid),results:U,errors:Q}}async function ft(M,O){var R;const U=E(M);if(U&&(O==null?void 0:O.mode)!=="silent"&&(U.validated=!0),B){const{results:v}=await D((O==null?void 0:O.mode)||"validated-only");return v[M]||{errors:[],valid:!0}}return U!=null&&U.validate?U.validate(O):(!U&&((R=O==null?void 0:O.warn)!==null&&R!==void 0?R:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${M} was not found`),Promise.resolve({errors:[],valid:!0}))}function ht(M){ma(w.value,M)}function _t(M,O,R=!1){Jt(M,O),Rt(c,M,O),R&&!(t!=null&&t.initialValues)&&Rt(x.value,M,me(O))}function Jt(M,O,R=!1){Rt(w.value,M,me(O)),R&&Rt(x.value,M,me(O))}async function It(){const M=a.unref(B);if(!M)return{valid:!0,results:{},errors:{}};o.value=!0;const O=Oi(M)||mt(M)?await Op(M,c):await Mp(M,c,{names:k.value,bailsMap:S.value});return o.value=!1,O}const jn=he((M,{evt:O})=>{fa(O)&&O.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&gn(t.initialTouched),t!=null&&t.validateOnMount){vt();return}j.validateSchema&&j.validateSchema("silent")}),a.isRef(B)&&a.watch(B,()=>{var M;(M=j.validateSchema)===null||M===void 0||M.call(j,"validated-only")}),a.provide(Dr,j),process.env.NODE_ENV!=="production"&&(Ap(j),a.watch(()=>Object.assign(Object.assign({errors:y.value},I.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),qn,{deep:!0}));function bn(M,O){const R=Ee(O)||O==null?void 0:O.label,U=E(a.toValue(M))||P(M,{label:R}),Q=()=>Ee(O)?O(Ei(U,$i)):O||{};function v(){var se;U.touched=!0,((se=Q().validateOnBlur)!==null&&se!==void 0?se:xn().validateOnBlur)&&ft(U.path)}function z(){var se;((se=Q().validateOnInput)!==null&&se!==void 0?se:xn().validateOnInput)&&a.nextTick(()=>{ft(U.path)})}function K(){var se;((se=Q().validateOnChange)!==null&&se!==void 0?se:xn().validateOnChange)&&a.nextTick(()=>{ft(U.path)})}const X=a.computed(()=>{const se={onChange:K,onInput:z,onBlur:v};return Ee(O)?Object.assign(Object.assign({},se),O(Ei(U,$i)).props||{}):O!=null&&O.props?Object.assign(Object.assign({},se),O.props(Ei(U,$i))):se});return[fe(M,()=>{var se,pe,ve;return(ve=(se=Q().validateOnModelUpdate)!==null&&se!==void 0?se:(pe=xn())===null||pe===void 0?void 0:pe.validateOnModelUpdate)!==null&&ve!==void 0?ve:!0}),X]}function Tr(M){return Array.isArray(M)?M.map(O=>fe(O,!0)):fe(M)}function $r(M,O){const[R,U]=bn(M,O);function Q(){U.value.onBlur()}function v(K){const X=Ti(K);Z(a.toValue(M),X,!1),U.value.onInput()}function z(K){const X=Ti(K);Z(a.toValue(M),X,!1),U.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},U.value),{onBlur:Q,onInput:v,onChange:z,value:R.value}))}function Nr(M,O){const[R,U]=bn(M,O),Q=E(a.toValue(M));function v(z){R.value=z}return a.computed(()=>{const z=Ee(O)?O(Ei(Q,$i)):O||{};return Object.assign({[z.model||"modelValue"]:R.value,[`onUpdate:${z.model||"modelValue"}`]:v},U.value)})}return Object.assign(Object.assign({},j),{values:a.readonly(c),handleReset:()=>Kt(),submitForm:jn})}function Yp(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!Le(e,a.unref(n)));function s(){const c=t.value;return Ke(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(s());return a.watchEffect(()=>{const c=s();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!Ke(r.value).length,dirty:o.value}))}function Gp(t,e,n){const r=Ba(n),i=a.ref(r),o=a.ref(me(r));function s(l,c=!1){i.value=Br(me(i.value)||{},me(l)),o.value=Br(me(o.value)||{},me(l)),c&&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 Zp(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const Xp=a.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=a.toRef(t,"validationSchema"),r=a.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:y,handleSubmit:g,setErrors:k,setFieldError:S,setFieldValue:N,setValues:b,setFieldTouched:w,setTouched:x,resetField:T}=Jp({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),I=g((E,{evt:C})=>{fa(C)&&C.target.submit()},t.onInvalidSubmit),A=t.onSubmit?g(t.onSubmit,t.onInvalidSubmit):I;function B(E){jo(E)&&E.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function P(E,C){return g(typeof E=="function"&&!C?E:C,t.onInvalidSubmit)(E)}function F(){return me(s)}function V(){return me(l.value)}function D(){return me(i.value)}function $(){return{meta:l.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:c.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:P,handleReset:m,submitForm:I,setErrors:k,setFieldError:S,setFieldValue:N,setValues:b,setFieldTouched:w,setTouched:x,resetForm:y,resetField:T,getValues:F,getMeta:V,getErrors:D}}return e.expose({setFieldError:S,setErrors:k,setFieldValue:N,setValues:b,setFieldTouched:w,setTouched:x,resetForm:y,validate:h,validateField:p,resetField:T,getValues:F,getMeta:V,getErrors:D,values:s,meta:l,errors:i}),function(){const C=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,_=Jo(C,e,$);if(!C)return _;const W=C==="form"?{novalidate:!0}:{};return a.h(C,Object.assign(Object.assign(Object.assign({},W),e.attrs),{onSubmit:A,onReset:B}),_)}}}),Qp=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Dr,void 0),r=a.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?a.resolveDynamicComponent(t.as):t.as,s=Jo(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)?a.h(o||"span",l,r.value):a.h(o,l,s)}}});function em(t){const e=qo(Dr),n=t?void 0:a.inject(da);return a.computed(()=>t?e==null?void 0:e.errors.value[a.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},tm={},nm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},rm=[a.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 im(t,e){return a.openBlock(),a.createElementBlock("svg",nm,rm)}const om=ce(tm,[["render",im]]),sm={},lm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},am=[a.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 cm(t,e){return a.openBlock(),a.createElementBlock("svg",lm,am)}const dm=ce(sm,[["render",cm]]),um={class:"relative"},Kn=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",um,[a.createVNode(om,{class:"absolute opacity-25"}),a.createVNode(dm,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let te={theme:"wpic-tools",popoverTarget:"body"};const fm=["is","type","disabled"],hm={key:0,class:"absolute inset-0 flex justify-center items-center"},pm={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},mm=["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=a.ref(null),r=a.ref(null),i=a.ref(!1),o=a.computed(()=>e.to?"router-link":"div"),s=k=>{r.value&&!r.value.contains(k.target)&&n.value&&!n.value.contains(k.target)&&(i.value=!1)};a.onMounted(()=>{document.addEventListener("click",s)}),a.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"},c={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(k,S)=>{var N;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:S[0]||(S[0]=b=>{var w;return(w=t.actions)!=null&&w.length?i.value=!i.value:null}),class:a.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[a.unref(te).theme]}`]:!0,[`${u[a.unref(te).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(te).theme]}`]:t.secondary,[`${p[a.unref(te).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(te).theme]}`]:t.primary&&t.plain,[`${g[a.unref(te).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(te).theme]}`]:t.colorless,[`${h[a.unref(te).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${y[a.unref(te).theme]}`]:t.destructive&&t.plain,[`${d[a.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?(a.openBlock(),a.createElementBlock("div",hm,[a.createVNode(Kn,{class:"w-6 h-6"})])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:t.to,class:a.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:a.withCtx(()=>[a.renderSlot(k.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(N=t.actions)!=null&&N.length&&i.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[a.createElementVNode("div",pm,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,b=>(a.openBlock(),a.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(b.label),9,mm))),256))])],512)):a.createCommentVNode("",!0)],10,fm)}}}),gm=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[a.unref(te).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),ym={name:"WpicInputGroup"},bm={class:"wpic-input-group flex w-full"};function km(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",bm,[a.renderSlot(t.$slots,"default")])}const xm=ce(ym,[["render",km]]),vm=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=a.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,c)=>(a.openBlock(),a.createBlock(a.unref(Xp),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Rr=Math.min,Jn=Math.max,Bi=Math.round,Zt=t=>({x:t,y:t}),wm={left:"right",right:"left",bottom:"top",top:"bottom"},Sm={start:"end",end:"start"};function Xo(t,e,n){return Jn(t,Rr(e,n))}function Lr(t,e){return typeof t=="function"?t(e):t}function vn(t){return t.split("-")[0]}function zr(t){return t.split("-")[1]}function Aa(t){return t==="x"?"y":"x"}function Qo(t){return t==="y"?"height":"width"}function Ai(t){return["top","bottom"].includes(vn(t))?"y":"x"}function es(t){return Aa(Ai(t))}function Cm(t,e,n){n===void 0&&(n=!1);const r=zr(t),i=es(t),o=Qo(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 Om(t){const e=Di(t);return[ts(t),e,ts(e)]}function ts(t){return t.replace(/start|end/g,e=>Sm[e])}function Mm(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 Em(t,e,n,r){const i=zr(t);let o=Mm(vn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ts)))),o}function Di(t){return t.replace(/left|right|bottom|top/g,e=>wm[e])}function Tm(t){return{top:0,right:0,bottom:0,left:0,...t}}function Da(t){return typeof t!="number"?Tm(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 Va(t,e,n){let{reference:r,floating:i}=t;const o=Ai(e),s=es(e),l=Qo(s),c=vn(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(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y: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 $m=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Va(d,r,c),h=r,p={},m=0;for(let y=0;y<l.length;y++){const{name:g,fn:k}=l[y],{x:S,y:N,data:b,reset:w}=await k({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=S??u,f=N??f,p={...p,[g]:{...p[g],...b}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(d=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:u,y:f}=Va(d,h,c)),y=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function _a(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Lr(e,t),m=Da(p),g=l[h?f==="floating"?"reference":"floating":f],k=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:c})),S=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),b=await(o.isElement==null?void 0:o.isElement(N))?await(o.getScale==null?void 0:o.getScale(N))||{x:1,y:1}:{x:1,y:1},w=Vi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:S,offsetParent:N,strategy:c}):S);return{top:(k.top-w.top+m.top)/b.y,bottom:(w.bottom-k.bottom+m.bottom)/b.y,left:(k.left-w.left+m.left)/b.x,right:(w.right-k.right+m.right)/b.x}}const Nm=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=Lr(t,e)||{};if(d==null)return{};const f=Da(u),h={x:n,y:r},p=es(i),m=Qo(p),y=await s.getDimensions(d),g=p==="y",k=g?"top":"left",S=g?"bottom":"right",N=g?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],w=h[p]-o.reference[p],x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let T=x?x[N]:0;(!T||!await(s.isElement==null?void 0:s.isElement(x)))&&(T=l.floating[N]||o.floating[m]);const I=b/2-w/2,A=T/2-y[m]/2-1,B=Rr(f[k],A),P=Rr(f[S],A),F=B,V=T-y[m]-P,D=T/2-y[m]/2+I,$=Xo(F,D,V),E=!c.arrow&&zr(i)!=null&&D!==$&&o.reference[m]/2-(D<F?B:P)-y[m]/2<0,C=E?D<F?D-F:D-V:0;return{[p]:h[p]+C,data:{[p]:$,centerOffset:D-$-C,...E&&{alignmentOffset:C}},reset:E}}}),Bm=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:c,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 k=vn(i),S=vn(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),b=h||(S||!y?[Di(l)]:Om(l));!h&&m!=="none"&&b.push(...Em(l,y,m,N));const w=[l,...b],x=await _a(e,g),T=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&T.push(x[k]),f){const F=Cm(i,s,N);T.push(x[F[0]],x[F[1]])}if(I=[...I,{placement:i,overflows:T}],!T.every(F=>F<=0)){var A,B;const F=(((A=o.flip)==null?void 0:A.index)||0)+1,V=w[F];if(V)return{data:{index:F,overflows:I},reset:{placement:V}};let D=(B=I.filter($=>$.overflows[0]<=0).sort(($,E)=>$.overflows[1]-E.overflows[1])[0])==null?void 0:B.placement;if(!D)switch(p){case"bestFit":{var P;const $=(P=I.map(E=>[E.placement,E.overflows.filter(C=>C>0).reduce((C,_)=>C+_,0)]).sort((E,C)=>E[1]-C[1])[0])==null?void 0:P[0];$&&(D=$);break}case"initialPlacement":D=l;break}if(i!==D)return{reset:{placement:D}}}return{}}}};async function Am(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=vn(n),l=zr(n),c=Ai(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-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),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Dm=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,c=await Am(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Vm=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:k,y:S}=g;return{x:k,y:S}}},...c}=Lr(t,e),d={x:n,y:r},u=await _a(e,c),f=Ai(vn(i)),h=Aa(f);let p=d[h],m=d[f];if(o){const g=h==="y"?"top":"left",k=h==="y"?"bottom":"right",S=p+u[g],N=p-u[k];p=Xo(S,p,N)}if(s){const g=f==="y"?"top":"left",k=f==="y"?"bottom":"right",S=m+u[g],N=m-u[k];m=Xo(S,m,N)}const y=l.fn({...e,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r}}}}};function wn(t){return ns(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=(ns(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ns(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 Ia(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 _m(t){return["table","td","th"].includes(wn(t))}function rs(t){const e=is(),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 Im(t){let e=Qt(t);for(;St(e)&&!Yn(e);){if(rs(e))return e;e=Qt(e)}return null}function is(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Yn(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||Ia(t)&&t.host||Xt(t);return Ia(e)?e.host:e}function Pa(t){const e=Qt(t);return Yn(e)?t.ownerDocument?t.ownerDocument.body:t.body:St(e)&&Fr(e)?e:Pa(e)}function ss(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Pa(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?ss(s.frameElement):[]):e.concat(i,ss(i,[],n))}function Ra(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 La(t){return wt(t)?t:t.contextElement}function Gn(t){const e=La(t);if(!St(e))return Zt(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Ra(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 Pm=Zt(0);function za(t){const e=Xe(t);return!is()||!e.visualViewport?Pm:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Rm(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=La(t);let s=Zt(1);e&&(r?wt(r)&&(s=Gn(r)):s=Gn(t));const l=Rm(o,n,r)?za(o):Zt(0);let c=(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),k=y.getBoundingClientRect(),S=gt(y),N=k.left+(y.clientLeft+parseFloat(S.paddingLeft))*g.x,b=k.top+(y.clientTop+parseFloat(S.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,f*=g.y,c+=N,d+=b,m=Xe(y),y=m.frameElement}}return Vi({width:u,height:f,x:c,y:d})}const Lm=[":popover-open",":modal"];function ls(t){return Lm.some(e=>{try{return t.matches(e)}catch{return!1}})}function zm(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Xt(r),l=e?ls(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Zt(1);const u=Zt(0),f=St(r);if((f||!f&&!o)&&((wn(r)!=="body"||Fr(s))&&(c=_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-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function Fm(t){return Array.from(t.getClientRects())}function Fa(t){return jr(Xt(t)).left+_i(t).scrollLeft}function jm(t){const e=Xt(t),n=_i(t),r=t.ownerDocument.body,i=Jn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Jn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Fa(t);const l=-n.scrollTop;return gt(r).direction==="rtl"&&(s+=Jn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function Hm(t,e){const n=Xe(t),r=Xt(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const d=is();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function Wm(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,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function ja(t,e,n){let r;if(e==="viewport")r=Hm(t,n);else if(e==="document")r=jm(Xt(t));else if(wt(e))r=Wm(e,n);else{const i=za(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Vi(r)}function Ha(t,e){const n=Qt(t);return n===e||!wt(n)||Yn(n)?!1:gt(n).position==="fixed"||Ha(n,e)}function qm(t,e){const n=e.get(t);if(n)return n;let r=ss(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)&&!Yn(s);){const l=gt(s),c=rs(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fr(s)&&!c&&Ha(t,s))?r=r.filter(u=>u!==s):i=l,s=Qt(s)}return e.set(t,r),r}function Um(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?ls(e)?[]:qm(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=ja(e,u,i);return d.top=Jn(f.top,d.top),d.right=Rr(f.right,d.right),d.bottom=Rr(f.bottom,d.bottom),d.left=Jn(f.left,d.left),d},ja(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Km(t){const{width:e,height:n}=Ra(t);return{width:e,height:n}}function Jm(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 c=Zt(0);if(r||!r&&!o)if((wn(e)!=="body"||Fr(i))&&(l=_i(e)),r){const f=jr(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Fa(i));const d=s.left+l.scrollLeft-c.x,u=s.top+l.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function as(t){return gt(t).position==="static"}function Wa(t,e){return!St(t)||gt(t).position==="fixed"?null:e?e(t):t.offsetParent}function qa(t,e){const n=Xe(t);if(ls(t))return n;if(!St(t)){let i=Qt(t);for(;i&&!Yn(i);){if(wt(i)&&!as(i))return i;i=Qt(i)}return n}let r=Wa(t,e);for(;r&&_m(r)&&as(r);)r=Wa(r,e);return r&&Yn(r)&&as(r)&&!rs(r)?n:r||Im(t)||n}const Ym=async function(t){const e=this.getOffsetParent||qa,n=this.getDimensions,r=await n(t.floating);return{reference:Jm(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Gm(t){return gt(t).direction==="rtl"}const Zm={convertOffsetParentRelativeRectToViewportRelativeRect:zm,getDocumentElement:Xt,getClippingRect:Um,getOffsetParent:qa,getElementRects:Ym,getClientRects:Fm,getDimensions:Km,getScale:Gn,isElement:wt,isRTL:Gm},Ua=Dm,Ka=Vm,Ja=Bm,Xm=Nm,Ya=(t,e,n)=>{const r=new Map,i={platform:Zm,...n},o={...i.platform,_c:r};return $m(t,e,{...i,platform:o})};function Qm(t){return t!=null&&typeof t=="object"&&"$el"in t}function eg(t){if(Qm(t)){const e=t.$el;return ns(e)&&wn(e)==="#comment"?null:e}return t}function tg(t){return{name:"arrow",options:t,fn(e){const n=eg(a.unref(t.element));return n==null?{}:Xm({element:n,padding:t.padding}).fn(e)}}}const ng={},rg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},ig=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function og(t,e){return a.openBlock(),a.createElementBlock("svg",rg,ig)}const Hr=ce(ng,[["render",og]]);let Ii;const sg=new Uint8Array(16);function lg(){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(sg)}const Ae=[];for(let t=0;t<256;++t)Ae.push((t+256).toString(16).slice(1));function ag(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 Ga={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function cs(t,e,n){if(Ga.randomUUID&&!t)return Ga.randomUUID();t=t||{};const r=t.random||(t.rng||lg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ag(r)}let cg={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 Sn=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},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=cs(),i=n,o=t,s={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"},l=a.ref(null),c=a.ref(null),d=a.ref(!0);function u(){o.disabled||(d.value=!1,h()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function h(){const g=await Ya(l.value,c.value,{placement:o.placement,middleware:[Ja(),Ka(),Ua(o.offset)]});c.value.style.left=`${g.x}px`,c.value.style.top=`${g.y}px`}const p=g=>{c.value&&!c.value.contains(g.target)&&l.value&&!l.value.contains(g.target)&&f()};a.onMounted(()=>{document.addEventListener("click",p),document.addEventListener("submenu-open",g=>{g.detail.uuid!==r&&f()})}),a.onUnmounted(()=>{document.removeEventListener("click",p),document.removeEventListener("submenu-open",f)});function m(){o.hover&&u()}function y(){o.hover&&f()}return e({hide:f}),(g,k)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[(a.openBlock(),a.createElementBlock("div",{class:"flex-1",key:`reference_${a.unref(r)}`,ref_key:"reference",ref:l,onMouseenter:m,onMouseleave:y,onClick:k[0]||(k[0]=a.withModifiers(S=>d.value?u():f(),["stop"]))},[a.renderSlot(g.$slots,"default",{isHidden:d.value})],32)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(te).popoverTarget},[(a.openBlock(),a.createElementBlock("div",{key:`floating_${a.unref(r)}`,ref_key:"floating",ref:c,style:a.normalizeStyle({maxWidth:t.maxWidth}),class:a.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[a.unref(te).theme]}`]:!d.value,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(g.$slots,"content")],6))],8,["to"]))],64))}}),dg={},ug={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},fg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function hg(t,e){return a.openBlock(),a.createElementBlock("svg",ug,fg)}const Za=ce(dg,[["render",hg]]),pg={},mg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},gg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)];function yg(t,e){return a.openBlock(),a.createElementBlock("svg",mg,gg)}const bg=ce(pg,[["render",yg]]),kg={},xg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},vg=[a.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 wg(t,e){return a.openBlock(),a.createElementBlock("svg",xg,vg)}const ds=ce(kg,[["render",wg]]),Sg={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},Cg={class:"flex items-center gap-2"},Og={key:0},Mg={class:""},Eg={class:"flex justify-end"},Tg={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},$g={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},Ng={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},Pi=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)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",Sg,[a.createElementVNode("div",Cg,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",Og,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Mg,[t.info?(a.openBlock(),a.createBlock(Sn,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(ds,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Eg,[a.renderSlot(s.$slots,"more")])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-input overflow-auto leading-none rounded-sm flex relative border pr-3 items-center",{"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[a.unref(te).theme]}`]:!0,"h-8":t.small,"h-10":!t.large,"h-12":t.large,[`${r[a.unref(te).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(a.openBlock(),a.createElementBlock("div",Tg,[a.createElementVNode("div",$g,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",Ng,[a.createVNode(Kn,{class:"w-6 h-6 opacity-50"})])):t.clearable?(a.openBlock(),a.createElementBlock("div",{key:2,onClick:a.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"},[a.createVNode(Hr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)],64))}});var Cn=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 Bg(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ri=Bg,Ag=typeof Cn=="object"&&Cn&&Cn.Object===Object&&Cn,Xa=Ag,Dg=Xa,Vg=typeof self=="object"&&self&&self.Object===Object&&self,_g=Dg||Vg||Function("return this")(),Ct=_g,Ig=Ct,Pg=function(){return Ig.Date.now()},Rg=Pg,Lg=/\s/;function zg(t){for(var e=t.length;e--&&Lg.test(t.charAt(e)););return e}var Fg=zg,jg=Fg,Hg=/^\s+/;function Wg(t){return t&&t.slice(0,jg(t)+1).replace(Hg,"")}var qg=Wg,Ug=Ct,Kg=Ug.Symbol,us=Kg,Qa=us,ec=Object.prototype,Jg=ec.hasOwnProperty,Yg=ec.toString,qr=Qa?Qa.toStringTag:void 0;function Gg(t){var e=Jg.call(t,qr),n=t[qr];try{t[qr]=void 0;var r=!0}catch{}var i=Yg.call(t);return r&&(e?t[qr]=n:delete t[qr]),i}var Zg=Gg,Xg=Object.prototype,Qg=Xg.toString;function e0(t){return Qg.call(t)}var t0=e0,tc=us,n0=Zg,r0=t0,i0="[object Null]",o0="[object Undefined]",nc=tc?tc.toStringTag:void 0;function s0(t){return t==null?t===void 0?o0:i0:nc&&nc in Object(t)?n0(t):r0(t)}var Ur=s0;function l0(t){return t!=null&&typeof t=="object"}var Kr=l0,a0=Ur,c0=Kr,d0="[object Symbol]";function u0(t){return typeof t=="symbol"||c0(t)&&a0(t)==d0}var f0=u0,h0=qg,rc=Ri,p0=f0,ic=NaN,m0=/^[-+]0x[0-9a-f]+$/i,g0=/^0b[01]+$/i,y0=/^0o[0-7]+$/i,b0=parseInt;function k0(t){if(typeof t=="number")return t;if(p0(t))return ic;if(rc(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=rc(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=h0(t);var n=g0.test(t);return n||y0.test(t)?b0(t.slice(2),n?2:8):m0.test(t)?ic:+t}var x0=k0,v0=Ri,fs=Rg,oc=x0,w0="Expected a function",S0=Math.max,C0=Math.min;function O0(t,e,n){var r,i,o,s,l,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(w0);e=oc(e)||0,v0(n)&&(u=!!n.leading,f="maxWait"in n,o=f?S0(oc(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(x){var T=r,I=i;return r=i=void 0,d=x,s=t.apply(I,T),s}function m(x){return d=x,l=setTimeout(k,e),u?p(x):s}function y(x){var T=x-c,I=x-d,A=e-T;return f?C0(A,o-I):A}function g(x){var T=x-c,I=x-d;return c===void 0||T>=e||T<0||f&&I>=o}function k(){var x=fs();if(g(x))return S(x);l=setTimeout(k,y(x))}function S(x){return l=void 0,h&&r?p(x):(r=i=void 0,s)}function N(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function b(){return l===void 0?s:S(fs())}function w(){var x=fs(),T=g(x);if(r=arguments,i=this,c=x,T){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(k,e),p(c)}return l===void 0&&(l=setTimeout(k,e)),s}return w.cancel=N,w.flush=b,w}var M0=O0;const sc=Wr(M0);function E0(){this.__data__=[],this.size=0}var T0=E0;function $0(t,e){return t===e||t!==t&&e!==e}var lc=$0,N0=lc;function B0(t,e){for(var n=t.length;n--;)if(N0(t[n][0],e))return n;return-1}var Li=B0,A0=Li,D0=Array.prototype,V0=D0.splice;function _0(t){var e=this.__data__,n=A0(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():V0.call(e,n,1),--this.size,!0}var I0=_0,P0=Li;function R0(t){var e=this.__data__,n=P0(e,t);return n<0?void 0:e[n][1]}var L0=R0,z0=Li;function F0(t){return z0(this.__data__,t)>-1}var j0=F0,H0=Li;function W0(t,e){var n=this.__data__,r=H0(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var q0=W0,U0=T0,K0=I0,J0=L0,Y0=j0,G0=q0;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=U0,Zn.prototype.delete=K0,Zn.prototype.get=J0,Zn.prototype.has=Y0,Zn.prototype.set=G0;var zi=Zn,Z0=zi;function X0(){this.__data__=new Z0,this.size=0}var Q0=X0;function ey(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var ty=ey;function ny(t){return this.__data__.get(t)}var ry=ny;function iy(t){return this.__data__.has(t)}var oy=iy,sy=Ur,ly=Ri,ay="[object AsyncFunction]",cy="[object Function]",dy="[object GeneratorFunction]",uy="[object Proxy]";function fy(t){if(!ly(t))return!1;var e=sy(t);return e==cy||e==dy||e==ay||e==uy}var ac=fy,hy=Ct,py=hy["__core-js_shared__"],my=py,hs=my,cc=function(){var t=/[^.]+$/.exec(hs&&hs.keys&&hs.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function gy(t){return!!cc&&cc in t}var yy=gy,by=Function.prototype,ky=by.toString;function xy(t){if(t!=null){try{return ky.call(t)}catch{}try{return t+""}catch{}}return""}var dc=xy,vy=ac,wy=yy,Sy=Ri,Cy=dc,Oy=/[\\^$.*+?()[\]{}|]/g,My=/^\[object .+?Constructor\]$/,Ey=Function.prototype,Ty=Object.prototype,$y=Ey.toString,Ny=Ty.hasOwnProperty,By=RegExp("^"+$y.call(Ny).replace(Oy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ay(t){if(!Sy(t)||wy(t))return!1;var e=vy(t)?By:My;return e.test(Cy(t))}var Dy=Ay;function Vy(t,e){return t==null?void 0:t[e]}var _y=Vy,Iy=Dy,Py=_y;function Ry(t,e){var n=Py(t,e);return Iy(n)?n:void 0}var Xn=Ry,Ly=Xn,zy=Ct,Fy=Ly(zy,"Map"),ps=Fy,jy=Xn,Hy=jy(Object,"create"),Fi=Hy,uc=Fi;function Wy(){this.__data__=uc?uc(null):{},this.size=0}var qy=Wy;function Uy(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ky=Uy,Jy=Fi,Yy="__lodash_hash_undefined__",Gy=Object.prototype,Zy=Gy.hasOwnProperty;function Xy(t){var e=this.__data__;if(Jy){var n=e[t];return n===Yy?void 0:n}return Zy.call(e,t)?e[t]:void 0}var Qy=Xy,eb=Fi,tb=Object.prototype,nb=tb.hasOwnProperty;function rb(t){var e=this.__data__;return eb?e[t]!==void 0:nb.call(e,t)}var ib=rb,ob=Fi,sb="__lodash_hash_undefined__";function lb(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ob&&e===void 0?sb:e,this}var ab=lb,cb=qy,db=Ky,ub=Qy,fb=ib,hb=ab;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=cb,Qn.prototype.delete=db,Qn.prototype.get=ub,Qn.prototype.has=fb,Qn.prototype.set=hb;var pb=Qn,fc=pb,mb=zi,gb=ps;function yb(){this.size=0,this.__data__={hash:new fc,map:new(gb||mb),string:new fc}}var bb=yb;function kb(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var xb=kb,vb=xb;function wb(t,e){var n=t.__data__;return vb(e)?n[typeof e=="string"?"string":"hash"]:n.map}var ji=wb,Sb=ji;function Cb(t){var e=Sb(this,t).delete(t);return this.size-=e?1:0,e}var Ob=Cb,Mb=ji;function Eb(t){return Mb(this,t).get(t)}var Tb=Eb,$b=ji;function Nb(t){return $b(this,t).has(t)}var Bb=Nb,Ab=ji;function Db(t,e){var n=Ab(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Vb=Db,_b=bb,Ib=Ob,Pb=Tb,Rb=Bb,Lb=Vb;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=Ib,er.prototype.get=Pb,er.prototype.has=Rb,er.prototype.set=Lb;var hc=er,zb=zi,Fb=ps,jb=hc,Hb=200;function Wb(t,e){var n=this.__data__;if(n instanceof zb){var r=n.__data__;if(!Fb||r.length<Hb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jb(r)}return n.set(t,e),this.size=n.size,this}var qb=Wb,Ub=zi,Kb=Q0,Jb=ty,Yb=ry,Gb=oy,Zb=qb;function tr(t){var e=this.__data__=new Ub(t);this.size=e.size}tr.prototype.clear=Kb,tr.prototype.delete=Jb,tr.prototype.get=Yb,tr.prototype.has=Gb,tr.prototype.set=Zb;var Xb=tr,Qb="__lodash_hash_undefined__";function e1(t){return this.__data__.set(t,Qb),this}var t1=e1;function n1(t){return this.__data__.has(t)}var r1=n1,i1=hc,o1=t1,s1=r1;function Hi(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new i1;++e<n;)this.add(t[e])}Hi.prototype.add=Hi.prototype.push=o1,Hi.prototype.has=s1;var l1=Hi;function a1(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 c1=a1;function d1(t,e){return t.has(e)}var u1=d1,f1=l1,h1=c1,p1=u1,m1=1,g1=2;function y1(t,e,n,r,i,o){var s=n&m1,l=t.length,c=e.length;if(l!=c&&!(s&&c>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&g1?new f1: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(!h1(e,function(k,S){if(!p1(p,S)&&(m===k||i(m,k,n,r,o)))return p.push(S)})){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 pc=y1,b1=Ct,k1=b1.Uint8Array,x1=k1;function v1(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var w1=v1;function S1(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var C1=S1,mc=us,gc=x1,O1=lc,M1=pc,E1=w1,T1=C1,$1=1,N1=2,B1="[object Boolean]",A1="[object Date]",D1="[object Error]",V1="[object Map]",_1="[object Number]",I1="[object RegExp]",P1="[object Set]",R1="[object String]",L1="[object Symbol]",z1="[object ArrayBuffer]",F1="[object DataView]",yc=mc?mc.prototype:void 0,ms=yc?yc.valueOf:void 0;function j1(t,e,n,r,i,o,s){switch(n){case F1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case z1:return!(t.byteLength!=e.byteLength||!o(new gc(t),new gc(e)));case B1:case A1:case _1:return O1(+t,+e);case D1:return t.name==e.name&&t.message==e.message;case I1:case R1:return t==e+"";case V1:var l=E1;case P1:var c=r&$1;if(l||(l=T1),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=N1,s.set(t,e);var u=M1(l(t),l(e),r,i,o,s);return s.delete(t),u;case L1:if(ms)return ms.call(t)==ms.call(e)}return!1}var H1=j1;function W1(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var q1=W1,U1=Array.isArray,gs=U1,K1=q1,J1=gs;function Y1(t,e,n){var r=e(t);return J1(t)?r:K1(r,n(t))}var G1=Y1;function Z1(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 X1=Z1;function Q1(){return[]}var ek=Q1,tk=X1,nk=ek,rk=Object.prototype,ik=rk.propertyIsEnumerable,bc=Object.getOwnPropertySymbols,ok=bc?function(t){return t==null?[]:(t=Object(t),tk(bc(t),function(e){return ik.call(t,e)}))}:nk,sk=ok;function lk(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var ak=lk,ck=Ur,dk=Kr,uk="[object Arguments]";function fk(t){return dk(t)&&ck(t)==uk}var hk=fk,kc=hk,pk=Kr,xc=Object.prototype,mk=xc.hasOwnProperty,gk=xc.propertyIsEnumerable,yk=kc(function(){return arguments}())?kc:function(t){return pk(t)&&mk.call(t,"callee")&&!gk.call(t,"callee")},bk=yk,Wi={exports:{}};function kk(){return!1}var xk=kk;Wi.exports,function(t,e){var n=Ct,r=xk,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,d=c||r;t.exports=d}(Wi,Wi.exports);var vc=Wi.exports,vk=9007199254740991,wk=/^(?:0|[1-9]\d*)$/;function Sk(t,e){var n=typeof t;return e=e??vk,!!e&&(n=="number"||n!="symbol"&&wk.test(t))&&t>-1&&t%1==0&&t<e}var Ck=Sk,Ok=9007199254740991;function Mk(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ok}var wc=Mk,Ek=Ur,Tk=wc,$k=Kr,Nk="[object Arguments]",Bk="[object Array]",Ak="[object Boolean]",Dk="[object Date]",Vk="[object Error]",_k="[object Function]",Ik="[object Map]",Pk="[object Number]",Rk="[object Object]",Lk="[object RegExp]",zk="[object Set]",Fk="[object String]",jk="[object WeakMap]",Hk="[object ArrayBuffer]",Wk="[object DataView]",qk="[object Float32Array]",Uk="[object Float64Array]",Kk="[object Int8Array]",Jk="[object Int16Array]",Yk="[object Int32Array]",Gk="[object Uint8Array]",Zk="[object Uint8ClampedArray]",Xk="[object Uint16Array]",Qk="[object Uint32Array]",ke={};ke[qk]=ke[Uk]=ke[Kk]=ke[Jk]=ke[Yk]=ke[Gk]=ke[Zk]=ke[Xk]=ke[Qk]=!0,ke[Nk]=ke[Bk]=ke[Hk]=ke[Ak]=ke[Wk]=ke[Dk]=ke[Vk]=ke[_k]=ke[Ik]=ke[Pk]=ke[Rk]=ke[Lk]=ke[zk]=ke[Fk]=ke[jk]=!1;function ex(t){return $k(t)&&Tk(t.length)&&!!ke[Ek(t)]}var tx=ex;function nx(t){return function(e){return t(e)}}var rx=nx,qi={exports:{}};qi.exports,function(t,e){var n=Xa,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 c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l}(qi,qi.exports);var ix=qi.exports,ox=tx,sx=rx,Sc=ix,Cc=Sc&&Sc.isTypedArray,lx=Cc?sx(Cc):ox,Oc=lx,ax=ak,cx=bk,dx=gs,ux=vc,fx=Ck,hx=Oc,px=Object.prototype,mx=px.hasOwnProperty;function gx(t,e){var n=dx(t),r=!n&&cx(t),i=!n&&!r&&ux(t),o=!n&&!r&&!i&&hx(t),s=n||r||i||o,l=s?ax(t.length,String):[],c=l.length;for(var d in t)(e||mx.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||fx(d,c)))&&l.push(d);return l}var yx=gx,bx=Object.prototype;function kx(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||bx;return t===n}var xx=kx;function vx(t,e){return function(n){return t(e(n))}}var wx=vx,Sx=wx,Cx=Sx(Object.keys,Object),Ox=Cx,Mx=xx,Ex=Ox,Tx=Object.prototype,$x=Tx.hasOwnProperty;function Nx(t){if(!Mx(t))return Ex(t);var e=[];for(var n in Object(t))$x.call(t,n)&&n!="constructor"&&e.push(n);return e}var Bx=Nx,Ax=ac,Dx=wc;function Vx(t){return t!=null&&Dx(t.length)&&!Ax(t)}var _x=Vx,Ix=yx,Px=Bx,Rx=_x;function Lx(t){return Rx(t)?Ix(t):Px(t)}var zx=Lx,Fx=G1,jx=sk,Hx=zx;function Wx(t){return Fx(t,Hx,jx)}var qx=Wx,Mc=qx,Ux=1,Kx=Object.prototype,Jx=Kx.hasOwnProperty;function Yx(t,e,n,r,i,o){var s=n&Ux,l=Mc(t),c=l.length,d=Mc(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:Jx.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<c;){h=l[f];var k=t[h],S=e[h];if(r)var N=s?r(S,k,h,e,t,o):r(k,S,h,t,e,o);if(!(N===void 0?k===S||i(k,S,n,r,o):N)){y=!1;break}g||(g=h=="constructor")}if(y&&!g){var b=t.constructor,w=e.constructor;b!=w&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof w=="function"&&w instanceof w)&&(y=!1)}return o.delete(t),o.delete(e),y}var Gx=Yx,Zx=Xn,Xx=Ct,Qx=Zx(Xx,"DataView"),ev=Qx,tv=Xn,nv=Ct,rv=tv(nv,"Promise"),iv=rv,ov=Xn,sv=Ct,lv=ov(sv,"Set"),av=lv,cv=Xn,dv=Ct,uv=cv(dv,"WeakMap"),fv=uv,ys=ev,bs=ps,ks=iv,xs=av,vs=fv,Ec=Ur,nr=dc,Tc="[object Map]",hv="[object Object]",$c="[object Promise]",Nc="[object Set]",Bc="[object WeakMap]",Ac="[object DataView]",pv=nr(ys),mv=nr(bs),gv=nr(ks),yv=nr(xs),bv=nr(vs),On=Ec;(ys&&On(new ys(new ArrayBuffer(1)))!=Ac||bs&&On(new bs)!=Tc||ks&&On(ks.resolve())!=$c||xs&&On(new xs)!=Nc||vs&&On(new vs)!=Bc)&&(On=function(t){var e=Ec(t),n=e==hv?t.constructor:void 0,r=n?nr(n):"";if(r)switch(r){case pv:return Ac;case mv:return Tc;case gv:return $c;case yv:return Nc;case bv:return Bc}return e});var kv=On,ws=Xb,xv=pc,vv=H1,wv=Gx,Dc=kv,Vc=gs,_c=vc,Sv=Oc,Cv=1,Ic="[object Arguments]",Pc="[object Array]",Ui="[object Object]",Ov=Object.prototype,Rc=Ov.hasOwnProperty;function Mv(t,e,n,r,i,o){var s=Vc(t),l=Vc(e),c=s?Pc:Dc(t),d=l?Pc:Dc(e);c=c==Ic?Ui:c,d=d==Ic?Ui:d;var u=c==Ui,f=d==Ui,h=c==d;if(h&&_c(t)){if(!_c(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new ws),s||Sv(t)?xv(t,e,n,r,i,o):vv(t,e,c,n,r,i,o);if(!(n&Cv)){var p=u&&Rc.call(t,"__wrapped__"),m=f&&Rc.call(e,"__wrapped__");if(p||m){var y=p?t.value():t,g=m?e.value():e;return o||(o=new ws),i(y,g,n,r,o)}}return h?(o||(o=new ws),wv(t,e,n,r,i,o)):!1}var Ev=Mv,Tv=Ev,Lc=Kr;function zc(t,e,n,r,i){return t===e?!0:t==null||e==null||!Lc(t)&&!Lc(e)?t!==t&&e!==e:Tv(t,e,n,r,zc,i)}var $v=zc,Nv=$v;function Bv(t,e){return Nv(t,e)}var Av=Bv;const Fc=Wr(Av),Dv={key:0,class:"leading-none"},Vv={key:1},_v={class:"flex flex-col max-h-80 overflow-y-auto"},Iv={key:0,class:"p-3"},Pv={key:1},Rv={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},Lv=["onClick"],zv={class:"select-none flex w-full items-center justify-between"},jc=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=a.ref(!1),o=a.ref(r.options);a.watch(()=>r.options,()=>{var b;(b=r.options)!=null&&b.length&&(o.value=[...r.options])},{immediate:!0,deep:!0});const s=n,l=a.ref(),c=a.ref();function d(b){var w,x;if(r.multiple){if(b){let T=r.modelValue||[];T.indexOf(b)>=0?T.splice(T.indexOf(b),1):T.push(b),s("update:modelValue",T),p(T),((w=r.modelValue)==null?void 0:w.length)===((x=r.options)==null?void 0:x.length)?i.value=!0:i.value=!1}}else s("update:modelValue",b),p(b),l.value=null,c.value.hide()}async function u(b){var w,x;s("update:modelValue",b),p(b),await a.nextTick(),((w=r.modelValue)==null?void 0:w.length)===((x=r.options)==null?void 0:x.length)&&(i.value=!0)}function f(b){s("update:modelValue",b),i.value=!1,p(b)}function h(){i.value=!1,r.multiple?(s("update:modelValue",[]),p([])):(s("update:modelValue",null),p(null))}const p=sc(function(b){s("change",b)},r.debounce),m=a.computed(()=>{var b,w,x,T;if(r.multiple)if(r.maxDisplay){let I=(w=o.value)==null?void 0:w.filter(B=>{var P;return((P=r.modelValue)==null?void 0:P.indexOf(B.value))>=0}).map(B=>B.label),A=I==null?void 0:I.slice(0,r.maxDisplay);return(I==null?void 0:I.length)-(A==null?void 0:A.length)>0?(A==null?void 0:A.join(", "))+` (+${(I==null?void 0:I.length)-A.length})`:A==null?void 0:A.join(", ")}else return(b=o.value)==null?void 0:b.filter(I=>{var A;return((A=r.modelValue)==null?void 0:A.indexOf(I.value))>=0}).map(I=>I.label).join(", ");else return((T=(x=o.value)==null?void 0:x.find(I=>I.value===r.modelValue))==null?void 0:T.label)||r.modelValue});function y(b){try{return r.multiple?r.modelValue!==null&&r.modelValue.some(w=>Fc(w,b)):r.modelValue!==null&&Fc(b,r.modelValue)}catch(w){return console.log(w),!1}}const g={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"},k=a.computed(()=>{var b,w;return((b=r.modelValue)==null?void 0:b.length)===((w=r.options)==null?void 0:w.length)}),S=a.computed(()=>{var b;if(r.filterable&&!r.remoteMethod&&((b=l.value)!=null&&b.trim().length)){const w=l.value.trim().toLowerCase();return r.options.filter(x=>{var T;return(T=x.label)==null?void 0:T.toLowerCase().includes(w)})}return r.options});function N(){r.remoteMethod&&r.remoteMethod(l.value)}return e({allSelected:i,isAllSelected:k}),(b,w)=>(a.openBlock(),a.createBlock(Sn,{custom:"",ref_key:"myPopover",ref:c,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:x})=>[a.createVNode(Pi,{disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var T,I,A,B,P,F;return[a.createElementVNode("span",{class:a.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((T=t.modelValue)==null?void 0:T.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Dv,[k.value&&((I=t.allSelectedText)!=null&&I.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((A=t.options)==null?void 0:A.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(m.value),1)],64))])):!t.multiple&&((B=t.options)!=null&&B.find(V=>V.value===null))?(a.openBlock(),a.createElementBlock("span",Vv,a.toDisplayString((F=(P=t.options)==null?void 0:P.find(V=>V.value===null))==null?void 0:F.label),1)):a.renderSlot(b.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(h,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Hr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),a.createVNode(bg,{class:a.normalizeClass(["h-4 w-4 transition-all transform",{"rotate-180":!x}])},null,8,["class"])]}),_:2},1032,["disabled","small","invalid","loading"])]),content:a.withCtx(()=>{var x;return[a.createElementVNode("div",_v,[t.filterable?(a.openBlock(),a.createElementBlock("div",Iv,[a.createVNode(Wc,{slim:"",placeholder:"Search...",clearable:"",modelValue:l.value,"onUpdate:modelValue":[w[0]||(w[0]=T=>l.value=T),N]},null,8,["modelValue"])])):a.createCommentVNode("",!0),!t.options&&((x=t.options)==null?void 0:x.length)==0?(a.openBlock(),a.createElementBlock("span",Pv,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",Rv,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:w[1]||(w[1]=T=>{var I;return u((I=S.value)==null?void 0:I.filter(A=>A.value).map(A=>A.value))})},"Select all"),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:w[2]||(w[2]=T=>f([]))},"Select none")])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(S.value,T=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!y(T.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||T.value,[`${g[a.unref(te).theme]}`]:!0}]),onClick:I=>T.disabled?null:d(T.value)},[a.createElementVNode("div",zv,[a.createElementVNode("span",{class:a.normalizeClass(["",{"opacity-25":T.disabled}])},a.toDisplayString(T.label||T.value),3),t.multiple&&y(T.value)?(a.openBlock(),a.createBlock(Za,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,Lv)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Fv={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},jv={class:""},Hv=["value","disabled","rows","placeholder"],Hc=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=a.ref(null),o=a.ref(!1);a.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&a.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 c(){i.value.focus()}return e({focus:c}),(d,u)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",Fv,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",jv,[d.info?(a.openBlock(),a.createBlock(Sn,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.info),1)]),default:a.withCtx(()=>[a.createVNode(ds,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),a.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:a.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:a.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,Hv)],64))}}),Wv={},qv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Uv=[a.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),a.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 Kv(t,e){return a.openBlock(),a.createElementBlock("svg",qv,Uv)}const Jv=ce(Wv,[["render",Kv]]),Yv={},Gv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Zv=[a.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),a.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),a.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 Xv(t,e){return a.openBlock(),a.createElementBlock("svg",Gv,Zv)}const Qv=ce(Yv,[["render",Xv]]),ew={},tw={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},nw=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function rw(t,e){return a.openBlock(),a.createElementBlock("svg",tw,nw)}const iw=ce(ew,[["render",rw]]),ow={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},sw={class:"flex items-center gap-2"},lw={key:0},aw={class:""},cw=["innerHTML"],dw={class:"flex justify-end"},uw=["name","value","checked"],fw={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},hw={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},pw={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},mw={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},gw={key:5,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Wc=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=a.computed(()=>o.name?o.name:cs()),l=em(s.value),c=a.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=a.ref(!0),u=a.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=a.computed(()=>{var B;if(o.rules&&typeof o.rules=="string"){let P=(B=o.rules)==null?void 0:B.split("|");return o.required&&P.push("required"),o.email&&P.push("email"),P.join("|")}else if(!o.rules){let P=[];return o.required&&P.push("required"),o.email&&P.push("email"),P.join("|")}return"required"});function p(B){let P=B&&B.target?B.target.value:B;S(P)}const m=n;function y(B){B===!0||B===!1?m("update:modelValue",!B):m("update:modelValue",B)}function g(B){let P=B&&B.target?B.target.value:B;m("update:modelValue",P),m("onChange",P)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const S=sc(function(B){m("update:modelValue",B),m("onChange",B)},o.debounce),N=a.ref(null),b=a.ref();function w(){var B,P;o.textarea?(B=b.value)==null||B.focus():(P=N.value)==null||P.$el.focus()}function x(){return N.value.meta.valid}const T=a.ref(),I=a.computed(()=>T.value.allSelected),A=a.computed(()=>T.value.isAllSelected);return e({focus:w,isValid:x,allSelected:I,isAllSelected:A}),(B,P)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio?(a.openBlock(),a.createElementBlock("div",ow,[a.createElementVNode("div",sw,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",lw,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",aw,[t.info?(a.openBlock(),a.createBlock(Sn,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,cw)]),default:a.withCtx(()=>[a.createVNode(ds,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",dw,[a.renderSlot(B.$slots,"more")])])):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(Pr),{key:1,ref_key:"myInput",ref:N,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:F})=>[a.createElementVNode("div",{class:a.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:P[0]||(P[0]=V=>t.disabled?void 0:y(t.modelValue))},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[a.unref(te).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(Za,{key:0})):a.createCommentVNode("",!0)],2),a.createElementVNode("span",{class:a.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}])},[a.renderSlot(B.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(a.openBlock(),a.createBlock(a.unref(Pr),{key:2,ref_key:"myInput",ref:N,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:F})=>[a.createElementVNode("div",{onClick:P[2]||(P[2]=()=>{t.disabled||g(t.radioValue)}),class:a.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[a.createElementVNode("span",{class:a.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:P[1]||(P[1]=(...V)=>B.onChange&&B.onChange(...V)),checked:t.radioValue==t.modelValue},null,40,uw),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base",{"opacity-50":t.disabled}])},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(a.openBlock(),a.createBlock(a.unref(Pr),{key:3,ref_key:"myInput",ref:N,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:F})=>{var V;return[a.createVNode(jc,{ref_key:"myChoiceList",ref:T,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&&a.unref(l)),required:t.required||((V=h.value)==null?void 0:V.indexOf("required"))>=0,label:c.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"])):(a.openBlock(),a.createElementBlock("div",{key:4,class:a.normalizeClass(["wpic-input rounded-sm flex relative border",{[`${r[a.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!":a.unref(l)}])},[B.$slots.prepend?(a.openBlock(),a.createElementBlock("div",fw,[a.createElementVNode("div",hw,[a.renderSlot(B.$slots,"prepend")])])):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(Pr),{key:1,ref_key:"myInput",ref:N,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var F;return[a.createVNode(Hc,{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&&a.unref(l)),required:t.required||((F=h.value)==null?void 0:F.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createBlock(a.unref(Pr),{key:2,ref_key:"myInput",ref:N,autocomplete:"off",style:{"z-index":"1"},class:a.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":!B.$slots.prepend,"pl-8":B.$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:!!a.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(a.openBlock(),a.createElementBlock("div",{key:3,onClick:a.withModifiers(k,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Kn,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(k,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Hr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),B.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",pw,[a.createElementVNode("div",mw,[a.renderSlot(B.$slots,"append",{},()=>[a.withDirectives(a.createVNode(Jv,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(Qv,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,!d.value]])])])])):a.createCommentVNode("",!0)],2)),t.error&&a.unref(l)?(a.openBlock(),a.createElementBlock("div",gw,[a.createVNode(a.unref(Qp),{name:s.value},{default:a.withCtx(F=>[a.createTextVNode(a.toDisplayString(F.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),B.$slots.help||t.help?(a.openBlock(),a.createElementBlock("div",{key:6,class:a.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[a.renderSlot(B.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),yw=["innerHTML"],qc=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=a.ref(),n=a.ref(),r=a.ref();cs();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 a.nextTick();const c=await Ya(e.value,n.value,{placement:i.placement,middleware:[Ja(),Ka(),Ua(i.offset),tg({element:r.value})]});n.value.style.left=`${c.x}px`,n.value.style.top=`${c.y}px`;const{x:d,y:u}=c.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(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("span",{ref_key:"button",ref:e,class:a.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[a.renderSlot(c.$slots,"default")],34),a.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"},[a.createElementVNode("span",{innerHTML:t.text},null,8,yw),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),bw={key:1,class:"flex justify-between items-baseline pt-4 px-6"},kw={class:""},xw={key:2,class:"flex items-center justify-end py-4 px-6"},vw=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=a.resolveComponent("wpic-loading-panel");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["rounded-lg wpic-card relative",{[e[a.unref(te).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions}])},[t.loading?(a.openBlock(),a.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):a.createCommentVNode("",!0),t.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",bw,[t.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-lg 2xl:text-xl",[n[a.unref(te).theme]]])},a.toDisplayString(t.title),3)):a.createCommentVNode("",!0),a.createElementVNode("div",kw,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",xw,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),ww={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},Sw={class:"flex-1 text-lg dark:text-gray-300 font-semibold"},Cw=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[a.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?(a.openBlock(),a.createElementBlock("div",ww,[a.createElementVNode("div",Sw,a.toDisplayString(t.title),1),a.renderSlot(n.$slots,"actions")])):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"default")],2))}}),Ow=a.createElementVNode("div",{class:""},null,-1),Mw=a.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),Ew=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=a.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)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex w-full relative",r[a.unref(te).theme]]),style:{"z-index":"1"}},[n.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({width:`${n.value}%`}),class:a.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[a.unref(te).theme]}`]:!0}])},[a.createVNode(qc,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[Ow]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[Mw],64)):a.createCommentVNode("",!0)],2))}}),Tw={class:"leading-none"},$w=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)=>(a.openBlock(),a.createElementBlock("div",{class:a.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[a.unref(te).theme]]:!0}])},[a.createElementVNode("span",Tw,[a.renderSlot(o.$slots,"default")]),t.clearable?(a.openBlock(),a.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Hr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Nw=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"w-full":t.full})},[a.createElementVNode("div",{class:a.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[a.renderSlot(e.$slots,"default")],2)],2))}}),Bw=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),Aw={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Dw=[Bw(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Vw=ce(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(a.openBlock(),a.createElementBlock("div",Aw,Dw)):(a.openBlock(),a.createBlock(Kn,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),_w={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)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[a.unref(te).theme]]:!t.active&&!t.disabled,[n[a.unref(te).theme]]:t.active&&!t.disabled,[r[a.unref(te).theme]]:t.disabled}])},[a.createElementVNode("span",_w,[a.renderSlot(i.$slots,"default")])],2))}}),Iw={},Pw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Rw=[a.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 Lw(t,e){return a.openBlock(),a.createElementBlock("svg",Pw,Rw)}const Uc=ce(Iw,[["render",Lw]]),zw={},Fw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},jw=[a.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 Hw(t,e){return a.openBlock(),a.createElementBlock("svg",Fw,jw)}const Kc=ce(zw,[["render",Hw]]),Ww={},qw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Uw=[a.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 Kw(t,e){return a.openBlock(),a.createElementBlock("svg",qw,Uw)}const Jc=ce(Ww,[["render",Kw]]),Jw={},Yw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Gw=[a.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 Zw(t,e){return a.openBlock(),a.createElementBlock("svg",Yw,Gw)}const Yc=ce(Jw,[["render",Zw]]),Xw={class:"wpic-pagination flex justify-between"},Qw={key:0,class:"flex items-center"},eS={key:0},tS={key:1,class:"flex flex-wrap gap-2"},nS=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=a.computed(()=>Math.ceil(r.total/r.perPage)),s=a.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 c(){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:c,getEnd:d}),(u,f)=>(a.openBlock(),a.createElementBlock("div",Xw,[t.info?(a.openBlock(),a.createElementBlock("div",Qw,[t.total>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(c())+" - "+a.toDisplayString(d()),1),t.total?(a.openBlock(),a.createElementBlock("span",eS," / "+a.toDisplayString(t.total),1)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",tS,[a.createVNode(Jr,{onClick:f[0]||(f[0]=h=>l(1)),disabled:t.currentPage===1||o.value==0||!o.value},{default:a.withCtx(()=>[a.createVNode(Uc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Jr,{onClick:f[1]||(f[1]=h=>l(t.currentPage-1)),disabled:t.currentPage===1||o.value==0||!o.value},{default:a.withCtx(()=>[a.createVNode(Kc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,h=>(a.openBlock(),a.createBlock(Jr,{key:`page_${h}`,onClick:p=>l(h),active:h===t.currentPage,disabled:o.value==0||!o.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(h),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Jr,{onClick:f[2]||(f[2]=h=>l(t.currentPage+1)),disabled:t.currentPage===o.value||o.value==0||!o.value},{default:a.withCtx(()=>[a.createVNode(Yc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Jr,{onClick:f[3]||(f[3]=h=>l(o.value)),disabled:t.currentPage===o.value||o.value==0||!o.value},{default:a.withCtx(()=>[a.createVNode(Jc,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"])])):a.createCommentVNode("",!0),a.createCommentVNode("",!0)]))}}),Gc=(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 a.h("td",e.attrs,n)};Gc.props=["column","item","rowIndex"];const Ss=Gc,rS={},iS={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},oS=[a.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 sS(t,e){return a.openBlock(),a.createElementBlock("svg",iS,oS)}const lS=ce(rS,[["render",sS]]),aS={class:"font-semibold"},Zc={__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)=>(a.openBlock(),a.createElementBlock("tr",aS,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,(i,o)=>(a.openBlock(),a.createBlock(Ss,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.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))]))}},cS={},dS={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},uS=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function fS(t,e){return a.openBlock(),a.createElementBlock("svg",dS,uS)}const hS=ce(cS,[["render",fS]]),pS={class:"overflow-auto"},mS={class:"w-full rounded-lg"},gS=["width"],yS=["width"],bS={key:0,class:"rounded-t-lg"},kS=["onClick"],xS={class:"rounded-b-lg relative"},vS={key:0},wS=[a.createElementVNode("td",{class:"text-center py-3"},"   ",-1)],SS={key:1},CS={key:0,class:"text-center text-gray-400 py-3"},OS=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":""},c={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;a.onMounted(()=>{y()});const h=a.getCurrentInstance();a.provide("wtable",h==null?void 0:h.proxy);const p=a.useSlots(),m=a.ref([]);function y(){const N=(x,T)=>{let I={};for(let A in x){if(typeof x[A].default=="boolean"&&T[A]!==void 0){I[A]=T[A]!==!1;continue}if(T[A]!==void 0){I[A]=T[A];continue}if(typeof x[A].default=="function"){I[A]=x[A].default();continue}I[A]=x[A].default}return I};let b=[];(p.default&&p.default()||[]).forEach(x=>{var T,I;((T=x.type)==null?void 0:T.name)==="WpicTableColumn"?b.push(x):(I=x.children)!=null&&I.length&&x.children.forEach(A=>{var B;((B=A.type)==null?void 0:B.name)==="WpicTableColumn"&&b.push(A)})}),m.value=b.map(x=>{let T=x.children,I=x.props||{},{field:A,label:B,help:P,width:F,minWidth:V,maxWidth:D,sortable:$,selectable:E,render:C,type:_,align:W,visible:Y,noPadding:ie}=N(x.type.props,I);return{label:B,help:P,width:F,minWidth:V,maxWidth:D,type:_,align:W,sortable:$,selectable:E,field:A,render:C,children:T,visible:Y,noPadding:ie}}).filter(x=>x.visible||x.selectable)}function g(N){var w,x;let b=(w=r.sortOptions)==null?void 0:w.sortDirection;((x=r.sortOptions)==null?void 0:x.sortBy)===N&&(b=b==="asc"?"desc":"asc"),f("changeSort",{sortDirection:b,sortBy:N})}a.watch(()=>p.default,N=>{y()},{deep:!0}),e({buildColumns:y});const k=a.reactive({});function S({index:N,item:b}){k[N]?k[N]=null:(k[N]=!0,f("expandRow",{index:N,item:b}))}return(N,b)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-table relative w-full rounded-lg overflow-hidden",{"no-radius rounded-none":t.noRadius,border:t.border,[`${i[a.unref(te).theme]}`]:!0}])},[a.createElementVNode("div",pS,[a.createElementVNode("table",mS,[a.createElementVNode("colgroup",null,[m.value.find(w=>w.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:0,style:a.normalizeStyle({minWidth:`${m.value.find(w=>w.type=="expand").minWidth}px`}),width:m.value.find(w=>w.type=="expand").width,class:"w-16"},null,12,gS)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m.value.filter(w=>w.type!="expand"),(w,x)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${w.minWidth}px`,maxWidth:`${w.maxWidth}px`}),width:w.width,key:x},null,12,yS))),128))]),t.hideHeaders?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("thead",bS,[a.createElementVNode("tr",null,[m.value.find(w=>w.type=="expand")?(a.openBlock(),a.createElementBlock("th",{key:0,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(te).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m.value.filter(w=>w.type!="expand"),(w,x)=>{var T,I;return a.openBlock(),a.createElementBlock("th",{class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[a.unref(te).theme]}`]:!0,"sticky left-0":x===0}]),style:a.normalizeStyle({maxWidth:`${w.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{w.sortable&&g(w.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":w.sortable&&w.field,"justify-center":w.align=="center","justify-end":w.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium",{"text-right":w.align=="right"}])},a.toDisplayString(w.label),3),w.sortable&&w.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":w.field!=((T=t.sortOptions)==null?void 0:T.sortBy)}])},[a.createVNode(lS,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((I=t.sortOptions)==null?void 0:I.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,kS)],6)}),256))])])),a.createElementVNode("tbody",xS,[t.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:a.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[a.unref(te).theme]]])},[a.createVNode(Kn,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",vS,wS))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock(Zc,{key:1,position:"header",columns:m.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.data,(w,x)=>{var T,I,A,B,P;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${x}`},[a.createElementVNode("tr",{class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":x%2==0,"is-even":x%2!=0,[s[a.unref(te).theme]]:!0}])},[m.value.find(F=>F.type=="expand")?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.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"])},[a.createVNode(Ni,{small:"",square:"",onClick:F=>S({item:w,index:x})},{default:a.withCtx(()=>[k[x]?(a.openBlock(),a.createBlock(iw,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(hS,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m.value.filter(F=>F.type!="expand"),(F,V)=>{var D,$;return a.openBlock(),a.createBlock(Ss,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":V===0,[`${c[a.unref(te).theme]}`]:!0,[`${d[a.unref(te).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!F.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":x===((D=t.data)==null?void 0:D.length)-1&&!t.totalItem&&!m.value.find(E=>E.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":x===(($=t.data)==null?void 0:$.length)-1&&!t.totalItem&&!m.value.find(E=>E.type=="expand")&&!t.noRadius,"text-center justify-center":F.align=="center","text-right justify-end":F.align=="right","align-top py-5":t.valign=="top"}]),style:a.normalizeStyle({maxWidth:`${F.maxWidth}px`}),id:`${x}_${V}`,column:F,item:w,rowIndex:x,key:V},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),m.value.find(F=>F.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(te).theme]]:!t.stripe,[l[a.unref(te).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(Ss,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(te).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((T=m.value.find(F=>F.type=="expand"))!=null&&T.noPadding),"p-0":(I=m.value.find(F=>F.type=="expand"))==null?void 0:I.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":x===((A=t.data)==null?void 0:A.length)-1&&!t.totalItem,"first:rounded-bl-lg":x===((B=t.data)==null?void 0:B.length)-1&&!t.totalItem,"text-center":m.value.find(F=>F.type=="expand").align=="center","text-right":m.value.find(F=>F.type=="expand").align=="right"}]),column:m.value.find(F=>F.type=="expand"),rowIndex:x,colspan:(P=m.value)==null?void 0:P.length,item:w},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,k[x]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",SS,[a.createVNode(Zc,{position:"footer",columns:m.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])])):a.createCommentVNode("",!0)])]),!t.loading&&!t.data.length?(a.openBlock(),a.createElementBlock("div",CS," No Data ")):a.createCommentVNode("",!0)],2))}}),MS={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 Xc(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=Xc(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Qc(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),c=s.nodeSize;if(s==l){n-=c,r-=c;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=Qc(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class L{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 c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.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,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):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 L(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],c=s+l.nodeSize;c>e&&((s<e||c>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=c}return new L(r,i)}cutByIndex(e,n){return e==n?L.empty:e==0&&n==this.content.length?this:new L(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 L(i,o)}addToStart(e){return new L([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new L(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 Xc(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Qc(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ki(0,e);if(e==this.size)return Ki(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?Ki(r+1,s):Ki(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 L.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new L(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return L.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 L(n||e,r)}static from(e){if(!e)return L.empty;if(e instanceof L)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new L([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}L.empty=new L([],0);const Cs={index:0,offset:0};function Ki(t,e){return Cs.index=t,Cs.offset=e,Cs}function Ji(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(!Ji(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ji(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ge=class na{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&&Ji(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 na.none;if(e instanceof na)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ge.none=[];class Yi extends Error{}class q{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=td(this.content,e+this.openStart,n);return r&&new q(r,this.openStart,this.openEnd)}removeBetween(e,n){return new q(ed(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 q.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 q(L.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 q(e,r,i)}}q.empty=new q(L.empty,0,0);function ed(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(ed(o.content,e-i-1,n-i-1)))}function td(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=td(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function ES(t,e,n){if(n.openStart>t.depth)throw new Yi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Yi("Inconsistent open depths");return nd(t,e,n,0)}function nd(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=nd(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}=TS(n,t);return En(o,id(t,s,l,e,r))}else return En(o,Gi(t,e,r))}function rd(t,e){if(!e.type.compatibleContent(t.type))throw new Yi("Cannot join "+e.type.name+" onto "+t.type.name)}function Os(t,e,n){let r=t.node(n);return rd(r,e.node(n)),r}function Mn(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 Yr(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&&(Mn(t.nodeAfter,r),o++));for(let l=o;l<s;l++)Mn(i.child(l),r);e&&e.depth==n&&e.textOffset&&Mn(e.nodeBefore,r)}function En(t,e){return t.type.checkContent(e),t.copy(e)}function id(t,e,n,r,i){let o=t.depth>i&&Os(t,e,i+1),s=r.depth>i&&Os(n,r,i+1),l=[];return Yr(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(rd(o,s),Mn(En(o,id(t,e,n,r,i+1)),l)):(o&&Mn(En(o,Gi(t,e,i+1)),l),Yr(e,n,i,l),s&&Mn(En(s,Gi(n,r,i+1)),l)),Yr(r,null,i,l),new L(l)}function Gi(t,e,n){let r=[];if(Yr(null,t,n,r),t.depth>n){let i=Os(t,e,n+1);Mn(En(i,Gi(t,e,n+1)),r)}return Yr(e,null,n,r),new L(r)}function TS(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(L.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Gr{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 Zi(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:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Gr(n,r,o)}static resolveCached(e,n){for(let i=0;i<Ms.length;i++){let o=Ms[i];if(o.pos==n&&o.doc==e)return o}let r=Ms[Es]=Gr.resolve(e,n);return Es=(Es+1)%$S,r}}let Ms=[],Es=0,$S=12;class Zi{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 NS=Object.create(null);let Tn=class ra{constructor(e,n,r,i=ge.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||L.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&&Ji(this.attrs,n||e.defaultAttrs||NS)&&ge.sameSet(this.marks,r||ge.none)}copy(e=null){return e==this.content?this:new ra(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ra(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 q.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 q(d,i.depth-s,o.depth-s)}replace(e,n,r){return ES(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 Gr.resolveCached(this,e)}resolveNoCache(e){return Gr.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()+")"),od(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=L.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 c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).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=L.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};Tn.prototype.text=void 0;class Xi extends Tn{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):od(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 Xi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Xi(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 od(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class $n{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new BS(e,n);if(r.next==null)return $n.empty;let i=sd(r);r.next&&r.err("Unexpected trailing text");let o=RS(PS(i));return LS(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 c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return L.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:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.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
+ `)}}$n.empty=new $n(!0);class BS{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 sd(t){let e=[];do e.push(AS(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function AS(t){let e=[];do e.push(DS(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function DS(t){let e=IS(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=VS(t,e);else break;return e}function ld(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function VS(t,e){let n=ld(t),r=n;return t.eat(",")&&(t.next!="}"?r=ld(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _S(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 IS(t){if(t.eat("(")){let e=sd(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=_S(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 PS(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let c=n();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let u=n();i(o(s.expr,c),u),c=u}if(s.max==-1)i(o(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=n();r(c,u),i(o(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function ad(t,e){return e-t}function cd(t,e){let n=[];return r(e),n.sort(ad);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:c}=o[s];!l&&n.indexOf(c)==-1&&r(c)}}}function RS(t){let e=Object.create(null);return n(cd(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<i.length;u++)i[u][0]==l&&(d=i[u][1]);cd(t,c).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new $n(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(ad);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function LS(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:c,next:d}=i.next[l];s.push(c.name),o&&!(c.isText||c.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 dd(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 ud(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 fd(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new zS(t[n]);return e}let hd=class qh{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=fd(r.attrs),this.defaultAttrs=dd(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==$n.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:ud(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Tn(this,this.computeAttrs(e),L.from(n),ge.setFrom(r))}createChecked(e=null,n,r){return n=L.from(n),this.checkContent(n),new Tn(this,this.computeAttrs(e),n,ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=L.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(L.empty,!0);return o?new Tn(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 qh(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 zS{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Qi{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=fd(i.attrs),this.excluded=null;let o=dd(this.attrs);this.instance=o?new ge(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ge(this,ud(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Qi(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 FS{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=hd.compile(this.spec.nodes,this),this.marks=Qi.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]=$n.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?pd(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==""?[]:pd(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 hd){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 Xi(r,r.defaultAttrs,e,ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Tn.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 pd(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 c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function jS(t){return t.tag!=null}function HS(t){return t.style!=null}class rr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{jS(r)?this.tags.push(r):HS(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 bd(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new bd(this,n,!0);return r.addAll(e,n.from,n.to),q.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(US(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 c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||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=kd(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=kd(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 md={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},WS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},gd={ol:!0,ul:!0},eo=1,to=2,no=4;function yd(t,e,n){return e!=null?(e?eo:0)|(e==="full"?to:0):t&&t.whitespace=="pre"?eo|to:n&-5}class ro{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&no?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(L.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&eo)){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=L.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(L.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):KS(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&&!md.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class bd{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=yd(null,n.preserveWhitespace,0)|(r?no:0);i?o=new ro(i.type,i.attrs,ge.none,ge.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ro(null,null,ge.none,ge.none,!0,null,s):o=new ro(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 c=0;c<s.length;c++)this.removePendingMark(s[c],l);for(let c=0;c<o.length;c++)this.addPendingMark(o[c]);n();for(let c=0;c<o.length;c++)this.removePendingMark(o[c],l);for(let c=0;c<s.length;c++)this.addPendingMark(s[c])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&to||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&eo)r.options&to?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;gd.hasOwnProperty(r)&&this.parser.normalizeLists&&qS(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));if(o?o.ignore:WS.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,c=this.needsBlock;if(md.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=c}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 c=this.parser.matchStyle(s,e.getPropertyValue(s),this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(d=>{c.clearMark(d)&&(r=d.addToSet(r))}):n=this.parser.schema.marks[c.mark].create(c.attrs).addToSet(n),c.consuming===!1)l=c;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(c=>this.insertNode(c));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c)}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=yd(e,i,o.options);o.options&no&&o.content.length==0&&(s|=no),this.nodes.push(new ro(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,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&u.groups.indexOf(d)==-1)return!1;c--}}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=JS(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 qS(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&gd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function US(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function kd(t){let e={};for(let n in t)e[n]=t[n];return e}function KS(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 c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}function JS(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=Ts(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,c=0;for(;l<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],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(Ts(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(Ts(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),c=n[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(" ");f>0?l.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):l.setAttribute(u,c[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=xd(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return xd(e.marks)}}function xd(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ts(t){return t.document||window.document}const vd=65535,wd=Math.pow(2,16);function YS(t,e){return t+e*wd}function Sd(t){return t&vd}function GS(t){return(t-(t&vd))/wd}const Cd=1,Od=2,io=4,Md=8;class $s{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Md)>0}get deletedBefore(){return(this.delInfo&(Cd|io))>0}get deletedAfter(){return(this.delInfo&(Od|io))>0}get deletedAcross(){return(this.delInfo&io)>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=Sd(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+GS(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 c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+o],u=this.ranges[l+s],f=c+d;if(e<=f){let h=d?e==c?-1:e==f?1:n:n,p=c+i+(h<0?0:u);if(r)return p;let m=e==(n<0?c:f)?null:YS(l/3,e-c),y=e==c?Od:e==f?Cd:io;return(n<0?e!=c:e!=f)&&(y|=Md),new $s(p,y,m)}i+=u-d}return r?e+i:new $s(e+i,0,null)}touches(e,n){let r=0,i=Sd(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+o],u=c+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),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(l,l+d,c,c+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 c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new $s(e,i,null)}}const Ns=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=Ns[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 Ns)throw new RangeError("Duplicate use of step JSON ID "+e);return Ns[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 Yi)return Se.fail(o.message);throw o}}}function Bs(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Bs(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return L.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 q(Bs(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 Mt(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 Mt 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 q(Bs(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 Mt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Mt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Mt(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 Mt(n.from,n.to,e.markFromJSON(n.mark))}}Ie.jsonID("removeMark",Mt);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 q(L.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 q(L.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&&As(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?q.empty:new q(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?q.empty:new q(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,q.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&&(As(e,this.from,this.gapFrom)||As(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,q.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ie.jsonID("replaceAround",$e);function As(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 ZS(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+c.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 Mt(h,p,f[y])));l&&l.to==h?l.to=p:o.push(l=new en(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function XS(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof Qi){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,n);for(let u=0;u<c.length;u++){let f=c[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 Mt(s.from,s.to,s.style)))}function Ed(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Te(l,u,q.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Mt(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 q(L.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 c=r.fillBefore(L.empty,!0);t.replace(l,l,new q(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function QS(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||!QS(i,o,s))break}return null}function eC(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),c=s,d=l,u=L.empty,f=0;for(let m=o,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,u=L.from(r.node(m).copy(u)),f++):c--;let h=L.empty,p=0;for(let m=o,y=!1;m>n;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=L.from(i.node(m).copy(h)),p++):d++;t.step(new $e(c,d,s,l,new q(u.append(h),f,p),u.size-f,!0))}function Ds(t,e,n=null,r=t){let i=tC(t,e),o=i&&nC(r,e);return o?i.map(Td).concat({type:e,attrs:n}).concat(o.map(Td)):null}function Td(t){return{type:t,attrs:null}}function tC(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 nC(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 c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(n.child(d).type);return!c||!c.validEnd?null:s}function rC(t,e,n){let r=L.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=L.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 q(r,0,0),n.length,!0))}function iC(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)&&lC(t.doc,t.mapping.slice(o).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&sC(t,s,l,o),Ed(t,t.mapping.slice(o).map(l,1),r,void 0,c===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 q(L.from(r.create(i,null,s.marks)),0,0),1,!0)),c===!0&&oC(t,s,l,o),!1}})}function oC(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 c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function sC(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 lC(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function aC(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 q(L.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),c=r&&r[0];return i.node(o).canReplaceWith(l,l,c?c.type:i.node(o+1).type)}function cC(t,e,n=1,r){let i=t.doc.resolve(e),o=L.empty,s=L.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){o=L.from(i.node(l).copy(o));let u=r&&r[d];s=L.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}t.step(new Te(e,e,new q(o.append(s),n,n),!0))}function nn(t,e){let n=t.resolve(e),r=n.index();return $d(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $d(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function oo(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&&$d(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 dC(t,e,n){let r=new Te(e-n,e+n,q.empty,!0);t.step(r)}function uC(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 Nd(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,c=r.index(s)+(l>0?1:0),d=r.node(s),u=!1;if(o==1)u=d.canReplace(c,c,i);else{let f=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(c,c,f[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function so(t,e,n=e,r=q.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Bd(i,o,r)?new Te(e,n,r):new fC(i,o,r).fit()}function Bd(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class fC{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=L.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=L.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 c=new q(o,s,l);return e>-1?new $e(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Te(r.pos,i.pos,c):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=Vs(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:c,match:d}=this.frontier[l],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(L.from(s),!1)):o&&c.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=Vs(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new q(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=Vs(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new q(Zr(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new q(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,c=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||c==0||y.content.size)&&(f=g,u.push(Ad(y.mark(h.allowedMarks(y.marks)),d==1?c:0,d==l.childCount?p:-1)))}let m=d==l.childCount;m||(p=-1),this.placed=Xr(this.placed,n,L.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 k=g.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),g=k.content}this.unplaced=m?e==0?q.empty:new q(Zr(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new q(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||!_s(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=_s(e,n,i,r,o);if(s){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=_s(e,l,d,c,!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,L.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(L.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 Vs(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Ad(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Ad(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(L.empty,!0)))),t.copy(r)}function _s(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&&!hC(n,o.content,s)?l:null}function hC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function pC(t){return t.spec.defining||t.spec.definingForContent}function mC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Bd(i,o,r))return t.step(new Te(e,n,r));let s=Vd(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 c=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=pC(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+c)%s.length],k=!0;g<0&&(k=!1,g=-g);let S=i.node(g-1),N=i.index(g-1);if(S.canReplaceWith(N,N,m.type,m.marks))return t.replace(i.before(g),k?o.after(g):n,new q(Dd(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 Dd(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Dd(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(L.empty,!0))}return t}function gC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=uC(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new q(L.from(r),0,0))}function yC(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Vd(r,i);for(let s=0;s<o.length;s++){let l=o[s],c=s==o.length-1;if(c&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),i.end(l));if(l>0&&(c||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 Vd(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 q(L.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 bC{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=q.empty){let i=so(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new q(L.from(r),0,0))}delete(e,n){return this.replace(e,n,q.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return mC(this,e,n,r),this}replaceRangeWith(e,n,r){return gC(this,e,n,r),this}deleteRange(e,n){return yC(this,e,n),this}lift(e,n){return eC(this,e,n),this}join(e,n=1){return dC(this,e,n),this}wrap(e,n){return rC(this,e,n),this}setBlockType(e,n=e,r,i=null){return iC(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return aC(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 cC(this,e,n,r),this}addMark(e,n,r){return ZS(this,e,n,r),this}removeMark(e,n,r){return XS(this,e,n,r),this}clearIncompatible(e,n,r){return Ed(this,e,n,r),this}}const Is=Object.create(null);class le{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new kC(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=q.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:c,$to:d}=s[l],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),l?q.empty:n),l==0&&Pd(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],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(l.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Pd(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=Is[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 Is)throw new RangeError("Duplicate use of selection JSON ID "+e);return Is[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ne.between(this.$anchor,this.$head).getBookmark()}}le.prototype.visible=!0;class kC{constructor(e,n){this.$from=e,this.$to=n}}let _d=!1;function Id(t){!_d&&!t.parent.inlineContent&&(_d=!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){Id(e),Id(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=q.empty){if(super.replace(e,n),n==q.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 lo(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 lo{constructor(e,n){this.anchor=e,this.head=n}map(e){return new lo(e.map(this.anchor),e.map(this.head))}resolve(e){return ne.between(e.resolve(this.anchor),e.resolve(this.head))}}class G 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 G(o)}content(){return new q(L.from(this.node),0,0)}eq(e){return e instanceof G&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ps(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new G(e.resolve(n.anchor))}static create(e,n){return new G(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}G.prototype.visible=!1,le.jsonID("node",G);class Ps{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new lo(r,r):new Ps(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&G.isSelectable(r)?new G(n):le.near(n)}}class ot extends le{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=q.empty){if(n==q.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 xC}}le.jsonID("all",ot);const xC={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&&G.isSelectable(l))return G.create(t,n-(i<0?l.nodeSize:0))}else{let c=cr(t,l,n+i,i<0?l.childCount:0,i,o);if(c)return c}n+=l.nodeSize*i}return null}function Pd(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,c,d,u)=>{s==null&&(s=u)}),t.setSelection(le.near(t.doc.resolve(s),n))}const Rd=1,Ld=2,zd=4;class vC extends bC{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|Rd)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Rd)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ld,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&Ld)>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|=zd,this}get scrolledIntoView(){return(this.updated&zd)>0}}function Fd(t,e){return!e||!t?t:t.bind(e)}class ei{constructor(e,n,r){this.name=e,this.init=Fd(n.init,r),this.apply=Fd(n.apply,r)}}const wC=[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 Rs{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=wC.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 c=i?i[s].n:0,d=i?i[s].state:this,u=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):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 vC(this)}static create(e){let n=new Rs(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 Rs(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 Rs(e.schema,e.plugins),o=new dr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Tn.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 c=r[l],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(c,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function jd(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=jd(i,e,{})),n[r]=i}return n}class ze{constructor(e){this.spec=e,this.props={},e.props&&jd(e.props,this,this.props),this.key=e.key?e.key.key:Hd("plugin")}getState(e){return e[this.key]}}const Ls=Object.create(null);function Hd(t){return t in Ls?t+"$"+ ++Ls[t]:(Ls[t]=0,t+"$")}class yt{constructor(e="key"){this.key=Hd(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 zs=null;const Ft=function(t,e,n){let r=zs||(zs=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},SC=function(){zs=null},Nn=function(t,e,n,r){return n&&(Wd(t,e,n,r,-1)||Wd(t,e,n,r,1))},CC=/^(img|br|input|textarea|hr)$/i;function Wd(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Et(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ni(t)||CC.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?Et(t):0}else return!1}}function Et(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function OC(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=Et(t)}else if(t.parentNode&&!ni(t))e=Ve(t),t=t.parentNode;else return null}}function MC(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 EC(t,e,n){for(let r=e==0,i=e==Et(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==Et(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 ao=function(t){return t.focusNode&&Nn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Bn(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function TC(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function $C(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,qd=typeof document<"u"?document:null,rn=Tt&&Tt.userAgent||"",Fs=/Edge\/(\d+)/.exec(rn),Ud=/MSIE \d/.exec(rn),js=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rn),Ye=!!(Ud||js||Fs),on=Ud?document.documentMode:js?+js[1]:Fs?+Fs[1]:0,bt=!Ye&&/gecko\/(\d+)/i.test(rn);bt&&+(/Firefox\/(\d+)/.exec(rn)||[0,0])[1];const Hs=!Ye&&/Chrome\/(\d+)/.exec(rn),Fe=!!Hs,NC=Hs?+Hs[1]:0,je=!Ye&&!!Tt&&/Apple Computer/.test(Tt.vendor),ur=je&&(/Mobile\/\w+/.test(rn)||!!Tt&&Tt.maxTouchPoints>2),st=ur||(Tt?/Mac/.test(Tt.platform):!1),BC=Tt?/Win/.test(Tt.platform):!1,kt=/Android \d/.test(rn),ri=!!qd&&"webkitFontSmoothing"in qd.documentElement.style,AC=ri?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function DC(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 VC(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 Kd(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,c=l==o.body,d=c?DC(o):VC(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(c)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(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function _C(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 c=l.getBoundingClientRect();if(c.top>=n-20){r=l,i=c.top;break}}return{refDOM:r,refTop:i,stack:Jd(t.dom)}}function Jd(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 IC({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Yd(n,r==0?0:r-e)}function Yd(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 PC(t){if(t.setActive)return t.setActive();if(fr)return t.focus(fr);let e=Jd(t);t.focus(fr==null?{get preventScroll(){return fr={preventScroll:!0},!0}}:void 0),fr||(fr=!1,Yd(e,0))}function Gd(t,e){let n,r=2e8,i,o=0,s=e.top,l=e.top,c,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&&!c&&m.left<=e.left&&m.right>=e.left&&(c=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&&c&&(n=c,i=d,r=0),n&&n.nodeType==3?RC(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:Gd(n,i)}function RC(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&&Ws(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Ws(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function LC(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function zC(t,e,n){let{node:r,offset:i}=Gd(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 FC(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 c=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&c.left>r.left||c.top>r.top?i=l.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(i=l.posAfter),s=!0),!l.contentDOM&&i<0&&!l.node.isText)return(l.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?l.posBefore:l.posAfter}o=l.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Zd(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 c=0;c<l.length;c++){let d=l[c];if(Ws(e,d))return Zd(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function jC(t,e){let n=t.dom.ownerDocument,r,i=0,o=$C(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(!Ws(e,d)||(s=Zd(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=LC(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=FC(t,r,i,e))}l==null&&(l=zC(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function Xd(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(Xd(r))return r}return Array.prototype.find.call(n,Xd)||t.getBoundingClientRect()}const HC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Qd(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&&(HC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=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==c.top){let u=sn(Ft(r,i,i+1),-1);if(u.top!=c.top)return ii(u,u.left<d.left)}}return c}else{let c=i,d=i,u=n<0?1:-1;return n<0&&!i?(d++,u=-1):n>=0&&i==r.nodeValue.length?(c--,u=1):n<0?c--:d++,ii(sn(Ft(r,c,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Et(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return qs(c.getBoundingClientRect(),!1)}if(o==null&&i<Et(r)){let c=r.childNodes[i];if(c.nodeType==1)return qs(c.getBoundingClientRect(),!0)}return qs(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Et(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Ft(c,Et(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return ii(sn(d,1),!1)}if(o==null&&i<Et(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Ft(c,0,s?0:1):c.nodeType==1?c: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 qs(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 eu(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 WC(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return eu(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=Qd(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=Ft(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[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 qC=/[\u0590-\u08ac]/;function UC(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!qC.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:eu(t,e,()=>{let{focusNode:c,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)||c==m&&d==y;try{l.collapse(u,f),c&&(c!=u||d!=f)&&l.extend&&l.extend(c,d)}catch{}return h!=null&&(l.caretBidiLevel=h),g})}let tu=null,nu=null,ru=!1;function KC(t,e,n){return tu==e&&nu==n?ru:(tu=e,nu=n,ru=n=="up"||n=="down"?WC(t,e,n):UC(t,e,n))}const lt=0,iu=1,An=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 lu){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 ou&&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 c=this.children[l],d=s+c.size;if(i==-1&&e<=d){let u=s+c.border;if(e>=u&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.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),c=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=c={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!=c.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||u&&je)&&Nn(l.node,l.offset,d.anchorNode,d.anchorOffset)&&Nn(c.node,c.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(c.node,c.offset),f=!0}catch{}}if(!f){if(e>n){let p=l;l=c,c=p}let h=document.createRange();h.setEnd(c.node,c.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,c=s-o.border;if(e>=l&&n<=c){this.dirty=e==r||n==s?An:iu,e==l&&n==c&&(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?An:$t}r=s}this.dirty=An}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?An:iu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class ou 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 JC 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 Dn 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 Dn(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=Dn.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Js(o,n,s,r)),e>0&&(o=Js(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,c,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],c,d=l&&l(n,o,()=>{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},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=du(u,r,n),d?c=new YC(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new co(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=()=>L.empty)}return e}matchesNode(e,n,r){return this.dirty==lt&&e.eq(this.node)&&Ks(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,c=new ZC(this,s&&s.node,e);eO(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?ge.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,i)},(d,u,f,h)=>{c.syncToMarks(d.marks,r,e);let p;c.findNodeMatch(d,u,f,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(p=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,u,f,p,e)||c.updateNextNode(d,u,f,e,h,i)||c.addNode(d,u,f,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==An)&&(s&&this.protectLocalComposition(e,s),au(this.contentDOM,this.children,e),ur&&tO(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=nO(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 JC(this,o,n,i);e.input.compositionNodes.push(s),this.children=Js(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(Ks(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=cu(this.dom,this.nodeDOM,Us(this.outerDeco,this.node,n),Us(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 su(t,e,n,r,i){du(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 co 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 co(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 lu 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 YC extends ln{constructor(e,n,r,i,o,s,l,c,d,u){super(e,n,r,i,o,s,l,d,u),this.spec=c}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 au(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=uu(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(l,r);if(s instanceof Dn){let c=r?r.previousSibling:t.lastChild;au(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=uu(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const si=function(t){t&&(this.nodeName=t)};si.prototype=Object.create(null);const Vn=[new si];function Us(t,e,n){if(t.length==0)return Vn;let r=n?Vn[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 c=s[l];c!=null&&(n&&i.length==1&&i.push(r=new si(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+c:l=="style"?r.style=(r.style?r.style+";":"")+c:l!="nodeName"&&(r[l]=c))}}}return i}function cu(t,e,n,r){if(n==Vn&&r==Vn)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],l=n[o];if(o){let c;l&&l.nodeName==s.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=Vn[0]),i=c}GC(i,l||Vn[0],s)}return i}function GC(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 du(t,e,n){return cu(t,t,Vn,Us(e,n,t.nodeType!=1))}function Ks(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 uu(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class ZC{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=XC(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 c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=Dn.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,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,c=Math.min(this.top.children.length,l+5);l<c;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=An),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 c=this.top.children[l];if(c instanceof ln){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let u=c.dom,f,h=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=$t&&Ks(n,c.outerDeco));if(!h&&c.update(e,n,r,i))return this.destroyBetween(this.index,l),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(c,e,n,r,i,s)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=An,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 c of l.children)c.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 ou(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 Dn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof co)||/\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 lu(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 XC(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 Dn)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 c=l.node;if(c){if(c!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function QC(t,e){return t.type.side-e.type.side}function eO(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=[],c=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(QC);for(let g=0;g<f.length;g++)n(f[g],d,!!c)}else n(u,d,!!c);let h,p;if(c)p=-1,h=c,c=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 k=0;k<l.length;k++)l[k].to<g&&(g=l[k].to);g<m&&(c=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 tO(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 nO(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 c=s.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=n){if(o>=r&&c.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?c.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&c.length>=r+e.length-l&&c.slice(r-l,r-l+e.length)==e)return r}}return-1}function Js(t,e,n,r,i){let o=[];for(let s=0,l=0;s<t.length;s++){let c=t[s],d=l,u=l+=c.size;d>=n||u<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>n&&o.push(c.slice(n-d,c.size,r)))}return o}function Ys(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),c,d;if(ao(n)){for(c=l;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&G.isSelectable(u)&&i.parent&&!(u.isInline&&EC(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;d=new G(s==f?l:r.resolve(f))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;c=r.resolve(u)}if(!d){let u=e=="pointer"||t.state.selection.head<l.pos&&!o?1:-1;d=Zs(t,c,l,u)}return d}function fu(t){return t.editable?t.hasFocus():ku(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ht(t,e=!1){let n=t.state.selection;if(gu(t,n),!!fu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Fe){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Nn(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)iO(t);else{let{anchor:r,head:i}=n,o,s;hu&&!(n instanceof ne)&&(n.$from.parent.inlineContent||(o=pu(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=pu(t,n.to))),t.docView.setSelection(r,i,t.root,e),hu&&(o&&mu(o),s&&mu(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&rO(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const hu=je||Fe&&NC<63;function pu(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 mu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function rO(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(()=>{(!fu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function iO(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&&Ye&&on<=11&&(r.disabled=!0,r.disabled=!1)}function gu(t,e){if(e instanceof G){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(yu(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else yu(t)}function yu(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Zs(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ne.between(e,n,r)}function bu(t){return t.editable&&!t.hasFocus()?!1:ku(t)}function ku(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 oO(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Nn(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Xs(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 xu(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=Xs(t.state,e);return i&&i instanceof G?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?G.isSelectable(o)?an(t,new G(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 G&&r.node.isInline)return an(t,new ne(e>0?r.$to:r.$from));{let i=Xs(t.state,e);return i?an(t,i):!1}}}function uo(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?sO(t):lO(t)}function sO(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<uo(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(vu(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=uo(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Qs(t,n,r):i&&Qs(t,i,o)}function lO(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=uo(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(vu(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=uo(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Qs(t,o,s)}function vu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function aO(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 cO(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 Qs(t,e,n){if(e.nodeType!=3){let o,s;(s=aO(e,n))?(e=s,n=0):(o=cO(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(ao(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 wu(t,e){let n=t.state.doc.resolve(e);if(!(Fe||BC)&&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 Su(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=Xs(t.state,e);if(s&&s instanceof G)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 Cu(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 Ou(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function dO(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;Ou(t,r,"true"),setTimeout(()=>Ou(t,r,"false"),20)}return!1}function uO(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function fO(t,e){let n=e.keyCode,r=uO(e);if(n==8||st&&n==72&&r=="c")return Cu(t,-1)||hr(t,-1);if(n==46&&!e.shiftKey||st&&n==68&&r=="c")return Cu(t,1)||hr(t,1);if(n==13||n==27)return!0;if(n==37||st&&n==66&&r=="c"){let i=n==37?wu(t,t.state.selection.from)=="ltr"?-1:1:-1;return xu(t,i,r)||hr(t,i)}else if(n==39||st&&n==70&&r=="c"){let i=n==39?wu(t,t.state.selection.from)=="ltr"?1:-1:1;return xu(t,i,r)||hr(t,i)}else{if(n==38||st&&n==80&&r=="c")return Su(t,-1,r)||hr(t,-1);if(n==40||st&&n==78&&r=="c")return dO(t)||Su(t,1,r)||hr(t,1);if(r==(st?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Mu(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=Vu(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Au[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=l.createElement(u[p]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),f++}d=c.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:c,text:h,slice:e}}function Eu(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let c=e&&(r||o||!n);if(c){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return e?new q(L.from(t.state.schema.text(e.replace(/\r\n?/g,`
13
+ `))),0,0):q.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=mO(n),ri&&gO(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:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!hO.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=yO(Bu(l,+u[1],+u[2]),u[4]);else if(l=q.maxOpen(pO(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=Bu(l,f,h)}return t.someProp("transformPasted",f=>{l=f(l,t)}),l}const hO=/^(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 pO(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 c=i.findWrapping(l.type),d;if(!c)return s=null;if(d=s.length&&o.length&&$u(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Nu(s[s.length-1],o.length));let u=Tu(l,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return L.from(s)}return t}function Tu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,L.from(t));return t}function $u(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=$u(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(L.from(Tu(n,t,i+1))))}}function Nu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Nu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(L.empty,!0);return t.copy(n.append(r))}function el(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=el(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(L.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Bu(t,e,n){return e<t.openStart&&(t=new q(el(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new q(el(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Au={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 Du=null;function Vu(){return Du||(Du=document.implementation.createHTMLDocument("title"))}function mO(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Vu().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Au[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 gO(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 yO(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 c=n.nodes[r[l]];if(!c||c.hasRequiredAttrs())break;i=L.from(c.create(r[l+1],i)),o++,s++}return new q(i,o,s)}const He={},We={},bO={touchstart:!0,touchmove:!0};class kO{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 xO(t){for(let e in He){let n=He[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{wO(t,r)&&!nl(t,r)&&(t.editable||!(r.type in We))&&n(t,r)},bO[e]?{passive:!0}:void 0)}je&&t.dom.addEventListener("input",()=>null),tl(t)}function cn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function vO(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 tl(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>nl(t,r))})}function nl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function wO(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 SO(t,e){!nl(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,!Iu(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,Bn(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||fO(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(Iu(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 fo(t){return{left:t.clientX,top:t.clientY}}function CO(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function rl(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 OO(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&G.isSelectable(r)?(pr(t,new G(n)),!0):!1}function MO(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof G&&(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(G.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,G.create(t.state.doc,i)),!0):!1}function EO(t,e,n,r,i){return rl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?MO(t,n):OO(t,n))}function TO(t,e,n,r){return rl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function $O(t,e,n,r){return rl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||NO(t,n,r)}function NO(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(G.isSelectable(s))pr(t,G.create(r,l));else continue;return!0}}function il(t){return ho(t)}const _u=st?"metaKey":"ctrlKey";He.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=il(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&CO(n,t.input.lastClick)&&!n[_u]&&(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(fo(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new BO(t,s,n,!!r)):(o=="doubleClick"?TO:$O)(t,s.pos,s.inside,n)?n.preventDefault():cn(t,"pointer"))};class BO{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[_u],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,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof G&&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(fo(e))),this.updateAllowDefault(e),this.allowDefault||!n?cn(this.view,"pointer"):EO(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(),il(t),cn(t,"pointer")},He.touchmove=t=>{t.input.lastTouch=Date.now(),cn(t,"pointer")},He.contextmenu=t=>il(t);function Iu(t,e){return t.composing?!0:je&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const AO=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(),ho(t,!0),t.markCursor=null;else if(ho(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}Pu(t,AO)},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++,Pu(t,20))};function Pu(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ho(t),e))}function Ru(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=VO());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function DO(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=OC(e.focusNode,e.focusOffset),r=MC(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 VO(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ho(t,e=!1){if(!(kt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Ru(t),e||t.docView&&t.docView.dirty){let n=Ys(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function _O(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=Ye&&on<15||ur&&AC<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:c}=Mu(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):_O(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function IO(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function PO(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=Eu(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||q.empty)))return!0;if(!o)return!1;let s=IO(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 Lu(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,Lu(r),r.getData("text/html"),i,n)?n.preventDefault():PO(t,n)};class zu{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Fu=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(fo(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof G?i.to-1:i.to))){if(r&&r.mightDrag)s=G.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=G.create(t.state.doc,f.posBefore))}}let l=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=Mu(t,l);n.dataTransfer.clearData(),n.dataTransfer.setData(ai?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ai||n.dataTransfer.setData("text/plain",d),t.dragging=new zu(u,!n[Fu],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(fo(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=Eu(t,Lu(n.dataTransfer),ai?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[Fu]);if(t.someProp("handleDrop",m=>m(t,n,s||q.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?Nd(t.state.doc,o.pos,s):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(l){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),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&&G.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new G(p));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((y,g,k,S)=>m=S),d.setSelection(Zs(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,Bn(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 po{constructor(e,n){this.toDOM=e,this.spec=n||_n,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 po&&(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||_n}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 ol{constructor(e,n){this.attrs=e,this.spec=n||_n}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 ol&&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 po(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 ol(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof dn}get widget(){return this.type instanceof po}}const mr=[],_n={};class Ce{constructor(e,n){this.local=e.length?e:mr,this.children=n.length?n:mr}static create(e,n){return n.length?mo(n,e,0,_n):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||_n)}mapInner(e,n,r,i,o){let s;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,r,i);c&&c.type.valid(n,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?RO(this.children,s||[],e,n,r,i,o):s?new Ce(s.sort(In),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,c)=>{let d=c+r,u;if(u=Hu(n,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(l,u,d+1):i.splice(o,0,c,c+l.nodeSize,mo(u,l,d+1,_n)),o+=3}});let s=ju(o?Wu(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(In):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,c=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>l&&f.to<c&&(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 c=this.local[l];if(c.from<s&&c.to>o&&c.type instanceof dn){let d=Math.max(o,c.from)-o,u=Math.min(s,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let l=new Ce(i.sort(In),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 sl(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=sl;const Pe=Ce.empty;class un{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,_n));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?sl(r?n:n.sort(In)):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 RO(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 k=0;k<l.length;k+=3){let S=l[k+1];if(S<0||h>S+u-f)continue;let N=l[k]+u-f;p>=N?l[k+1]=h<=N?-2:-1:h>=u&&g&&(l[k]+=g,l[k+1]+=g)}f+=g}),u=n.maps[d].map(u,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let u=n.map(t[d]+o),f=u-i;if(f<0||f>=r.content.size){c=!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 k=l[d+2].mapInner(n,g,u+1,t[d]+o+1,s);k!=Pe?(l[d]=f,l[d+1]=p,l[d+2]=k):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=LO(l,t,e,n,i,o,s),u=mo(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(In),l)}function ju(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 LO(t,e,n,r,i,o,s){function l(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)l(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&l(t[c+2],e[c]+o+1);return n}function Hu(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 Wu(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function mo(t,e,n,r){let i=[],o=!1;e.forEach((l,c)=>{let d=Hu(t,l,c+n);if(d){o=!0;let u=mo(d,l,n+c+1,r);u!=Pe&&i.push(c,c+l.nodeSize,u)}});let s=ju(o?Wu(t):t,-n).sort(In);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 In(t,e){return t.from-e.from||t.to-e.to}function sl(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),qu(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),qu(e,i,r.copy(o.from,r.to)));break}}}return e}function qu(t,e,n){for(;e<t.length&&In(n,t[e])>0;)e++;t.splice(e,0,n)}function ll(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 zO={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},FO=Ye&&on<=11;class jO{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 HO{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new jO,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]);Ye&&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()}),FO&&(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,zO)),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(bu(this.view)){if(this.suppressingSelectionUpdates)return Ht(this.view);if(Ye&&on<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Nn(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)&&bu(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,c=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],c);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&&c.length){let u=c.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||UO(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&&ao(r)&&(d=Ys(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),WO(e)),this.handleDOMChange(o,s,l,c),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(Ye&&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),c=o&&o.parentNode==e.target?Ve(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,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 Uu=new WeakMap,Ku=!1;function WO(t){if(!Uu.has(t)&&(Uu.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=bt,Ku)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."),Ku=!0}}function Ju(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Nn(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function qO(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Ju(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?Ju(t,n):null}function UO(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 KO(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=t.docView.parseRange(e,n),c=t.domSelectionRange(),d,u=c.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],ao(c)||d.push({node:c.focusNode,offset:c.focusOffset})),Fe&&t.input.lastKeyCode===8)for(let g=o;g>i;g--){let k=r.childNodes[g-1],S=k.pmViewDesc;if(k.nodeName=="BR"&&!S){o=g;break}if(!S||S.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:JO,context:p});if(d&&d[0].pos!=null){let g=d[0].pos,k=d[1]&&d[1].pos;k==null&&(k=g),m={anchor:g+s,head:k+s}}return{doc:y,sel:m,from:s,to:l}}function JO(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 YO=/^(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 GO(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,B=Ys(t,A);if(B&&!t.state.selection.eq(B)){if(Fe&&kt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",F=>F(t,Bn(13,"Enter"))))return;let P=t.state.tr.setSelection(B);A=="pointer"?P.setMeta("pointer",!0):A=="key"&&P.scrollIntoView(),o&&P.setMeta("composition",o),t.dispatch(P)}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 c=t.state.selection,d=KO(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=QO(f.content,d.doc.content,d.from,h,p);if((ur&&t.input.lastIOSEnter>Date.now()-225||kt)&&i.some(A=>A.nodeType==1&&!YO.test(A.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",A=>A(t,Bn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ne&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let A=Yu(t,t.state.doc,d.sel);if(A&&!A.eq(t.state.selection)){let B=t.state.tr.setSelection(A);o&&B.setMeta("composition",o),t.dispatch(B)}}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)),Ye&&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),k=u.resolve(m.start),S=y.sameParent(g)&&y.parent.inlineContent&&k.end()>=m.endA,N;if((ur&&t.input.lastIOSEnter>Date.now()-225&&(!S||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!S&&y.pos<d.doc.content.size&&!y.sameParent(g)&&(N=le.findFrom(d.doc.resolve(y.pos+1),1,!0))&&N.head==g.pos)&&t.someProp("handleKeyDown",A=>A(t,Bn(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&XO(u,m.start,m.endA,y,g)&&t.someProp("handleKeyDown",A=>A(t,Bn(8,"Backspace")))){kt&&Fe&&t.domObserver.suppressSelectionUpdates();return}Fe&&kt&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),kt&&!S&&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,Bn(13,"Enter"))})},20));let b=m.start,w=m.endA,x,T,I;if(S){if(y.pos==g.pos)Ye&&on<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ht(t),20)),x=t.state.tr.delete(b,w),T=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(I=ZO(y.parent.content.cut(y.parentOffset,g.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))x=t.state.tr,I.type=="add"?x.addMark(b,w,I.mark):x.removeMark(b,w,I.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",B=>B(t,b,w,A)))return;x=t.state.tr.insertText(A,b,w)}}if(x||(x=t.state.tr.replace(b,w,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let A=Yu(t,x.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==x.mapping.map(w)-1)||Ye&&A.empty&&A.head==b)&&x.setSelection(A)}T&&x.ensureMarks(T),o&&x.setMeta("composition",o),t.dispatch(x.scrollIntoView())}function Yu(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Zs(t,e.resolve(n.anchor),e.resolve(n.head))}function ZO(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,c;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",c=u=>u.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",c=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(L.from(d).eq(t))return{mark:l,type:s}}function XO(t,e,n,r,i){if(n-e<=i.pos-r.pos||al(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(al(o,!0,!0));return!s.parent.isTextblock||s.pos>n||al(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function al(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 QO(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 c=Math.max(0,o-Math.min(s,l));r-=s+c-o}if(s<o&&t.size<e.size){let c=r<=o&&r>=s?o-r:0;o-=c,o&&o<e.size&&Gu(e.textBetween(o-1,o+1))&&(o+=c?1:-1),l=o+(l-s),s=o}else if(l<o){let c=r<=o&&r>=l?o-r:0;o-=c,o&&o<t.size&&Gu(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function Gu(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 eM{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 kO,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(tf),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=Qu(this),Xu(this),this.nodeViews=ef(this),this.docView=su(this.state.doc,Zu(this),ll(this),this.dom,this),this.domObserver=new HO(this,(r,i,o,s)=>GO(this,r,i,o,s)),this.domObserver.start(),xO(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&&tl(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(tf),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&&(Ru(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=ef(this);nM(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&tl(this),this.editable=Qu(this),Xu(this);let c=ll(this),d=Zu(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,c);(f||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&_C(this);if(s){this.domObserver.stop();let p=f&&(Ye||Fe)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&tM(i.selection,e.selection);if(f){let m=Fe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=DO(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=su(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&oO(this))?Ht(this,p):(gu(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&&IC(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof G){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Kd(this,n.getBoundingClientRect(),e)}else Kd(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 zu(e.slice,e.move,i<0?void 0:G.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(Ye){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&&PC(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 jC(this,e)}coordsAtPos(e,n=1){return Qd(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 KC(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&&(vO(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ll(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,SC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return SO(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&&TC(this.dom.ownerDocument)==this.dom&&qO(this,e)||e}domSelection(){return this.root.getSelection()}}function Zu(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 Xu(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 Qu(t){return!t.someProp("editable",e=>e(t.state)===!1)}function tM(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 ef(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 nM(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 tf(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:"'"},go={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},rM=typeof navigator<"u"&&/Mac/.test(navigator.platform),iM=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),go[_e]=String.fromCharCode(_e);for(var cl in fn)go.hasOwnProperty(cl)||(go[cl]=fn[cl]);function oM(t){var e=rM&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||iM&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?go: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 sM=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function lM(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 c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))sM?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function aM(t){let e=Object.create(null);for(let n in t)e[lM(n)]=t[n];return e}function dl(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 cM(t){return new ze({props:{handleKeyDown:nf(t)}})}function nf(t){let e=aM(t);return function(n,r){let i=oM(r),o,s=e[dl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[dl(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[dl(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const ul=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function rf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const of=(t,e,n)=>{let r=rf(t,n);if(!r)return!1;let i=fl(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&&pf(t,i,e))return!0;if(r.parent.content.size==0&&(gr(o,"end")||G.isSelectable(o))){let s=so(t.doc,r.before(),r.after(),q.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):G.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},dM=(t,e,n)=>{let r=rf(t,n);if(!r)return!1;let i=fl(r);return i?sf(t,i,e):!1},uM=(t,e,n)=>{let r=af(t,n);if(!r)return!1;let i=hl(r);return i?sf(t,i,e):!1};function sf(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,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let d=so(t.doc,o,c,q.empty);if(!d||d.from!=o||d instanceof Te&&d.slice.size>=c-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 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("backward",t):r.parentOffset>0)return!1;o=fl(r)}let s=o&&o.nodeBefore;return!s||!G.isSelectable(s)?!1:(e&&e(t.tr.setSelection(G.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function fl(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 af(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const cf=(t,e,n)=>{let r=af(t,n);if(!r)return!1;let i=hl(r);if(!i)return!1;let o=i.nodeAfter;if(pf(t,i,e))return!0;if(r.parent.content.size==0&&(gr(o,"start")||G.isSelectable(o))){let s=so(t.doc,r.before(),r.after(),q.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):G.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},df=(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=hl(r)}let s=o&&o.nodeAfter;return!s||!G.isSelectable(s)?!1:(e&&e(t.tr.setSelection(G.create(t.doc,o.pos)).scrollIntoView()),!0)};function hl(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 fM=(t,e)=>{let n=t.selection,r=n instanceof G,i;if(r){if(n.node.isTextblock||!nn(t.doc,n.from))return!1;i=n.from}else if(i=oo(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(G.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},hM=(t,e)=>{let n=t.selection,r;if(n instanceof G){if(n.node.isTextblock||!nn(t.doc,n.to))return!1;r=n.to}else if(r=oo(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},pM=(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)},uf=(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 pl(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 mM=(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=pl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),c=t.tr.replaceWith(l,l,s.createAndFill());c.setSelection(le.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},ff=(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=pl(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},hf=(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 gM(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof G&&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:pl(r.node(-1).contentMatchAt(r.indexAfter(-1))),c=o&&l?[{type:l}]:void 0,d=zt(s.doc,s.mapping.map(r.pos),1,c);if(!c&&!d&&zt(s.doc,s.mapping.map(r.pos),1,l?[{type:l}]:void 0)&&(l&&(c=[{type:l}]),d=!0),d&&(s.split(s.mapping.map(r.pos),1,c),!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 yM=gM(),bM=(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(G.create(t.doc,i))),!0)};function kM(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 pf(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(kM(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=L.empty;for(let y=o.length-1;y>=0;y--)h=L.from(o[y].create(null,h));h=L.from(r.copy(h));let p=t.tr.step(new $e(e.pos-1,f,e.pos,f,new q(h,1,0),o.length,!0)),m=f+2*o.length;nn(p.doc,m)&&p.join(m),n(p.scrollIntoView())}return!0}let c=le.findFrom(e,1),d=c&&c.$from.blockRange(c.$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=L.empty;for(let k=h.length-1;k>=0;k--)y=L.from(h[k].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 q(y,h.length,0),0,!0));n(g.scrollIntoView())}return!0}}return!1}function mf(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 xM=mf(-1),vM=mf(1);function wM(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Ds(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function gf(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,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.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:c}}=n.selection.ranges[s];o.setBlockType(l,c,t,e)}r(o.scrollIntoView())}return!0}}function ml(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}ml(ul,of,lf),ml(ul,cf,df),ml(uf,ff,hf,yM),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function SM(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=!1,c=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);c=new Zi(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Zi(i,n.doc.resolve(o.end(s.depth)),s.depth)),l=!0}let d=Ds(c,t,e,s);return d?(r&&r(CM(n.tr,s,d,l,t).scrollIntoView()),!0):!1}}function CM(t,e,n,r,i){let o=L.empty;for(let u=n.length-1;u>=0;u--)o=L.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 q(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,c=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,c,l)&&(t.split(c,l),c+=2*l),c+=d.child(u).nodeSize;return t}function OM(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?MM(e,n,t,o):EM(e,n,o):!0:!1}}function MM(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 q(L.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Zi(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 c=i.mapping.map(o,-1)-1;return nn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function EM(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,c=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(l?0:1),u+1,s.content.append(c?L.empty:L.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new $e(f-(l?1:0),h+(c?1:0),f+1,h-1,new q((l?L.empty:L.from(i.copy(L.empty))).append(c?L.empty:L.from(i.copy(L.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function TM(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,c=l.child(s-1);if(c.type!=t)return!1;if(n){let d=c.lastChild&&c.lastChild.type==l.type,u=L.from(d?t.create():null),f=new q(L.from(t.create(null,L.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 yo(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 bo{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,c])=>[l,(...u)=>{const f=c(...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=[],c=!!e,d=e||o.tr,u=()=>(!c&&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),k=p(...y)(g);return l.push(k),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(([c,d])=>[c,(...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:yo({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(([c,d])=>[c,(...u)=>d(...u)(l)]))}};return l}}class $M{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 ko(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 yf(t){const e=[],{nodeExtensions:n,markExtensions:r}=ko(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},c=J(s,"addGlobalAttributes",l);if(!c)return;c().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},c=J(s,"addAttributes",l);if(!c)return;const d=c();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 Me(...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(" "):[],c=r[i]?r[i].split(" "):[],d=l.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function gl(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)=>Me(n,r),{})}function bf(t){return typeof t=="function"}function ae(t,e=void 0,...n){return bf(t)?e?t.bind(e)(...n):t(...n):t}function NM(t={}){return Object.keys(t).length===0&&t.constructor===Object}function BM(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function kf(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):BM(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function xf(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&NM(n)?!1:n!=null))}function AM(t,e){var n;const r=yf(t),{nodeExtensions:i,markExtensions:o}=ko(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(k=>k.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((k,S)=>{const N=J(S,"extendNodeSchema",f);return{...k,...N?N(d):{}}},{}),p=xf({...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(k=>{var S;return[k.name,{default:(S=k==null?void 0:k.attribute)===null||S===void 0?void 0:S.default}]}))}),m=ae(J(d,"parseHTML",f));m&&(p.parseDOM=m.map(k=>kf(k,u)));const y=J(d,"renderHTML",f);y&&(p.toDOM=k=>y({node:k,HTMLAttributes:gl(k,u)}));const g=J(d,"renderText",f);return g&&(p.toText=g),[d.name,p]})),c=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,k)=>{const S=J(k,"extendMarkSchema",f);return{...g,...S?S(d):{}}},{}),p=xf({...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 k;return[g.name,{default:(k=g==null?void 0:g.attribute)===null||k===void 0?void 0:k.default}]}))}),m=ae(J(d,"parseHTML",f));m&&(p.parseDOM=m.map(g=>kf(g,u)));const y=J(d,"renderHTML",f);return y&&(p.toDOM=g=>y({mark:g,HTMLAttributes:gl(g,u)})),[d.name,p]}));return new FS({topNode:s,nodes:l,marks:c})}function yl(t,e){return e.nodes[t]||e.marks[t]||null}function vf(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const DM=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var c,d;const u=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-o))}),n};function bl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class xo{constructor(e){this.find=e.find,this.handler=e.handler}}const VM=(t,e)=>{if(bl(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:c}=n;if(c.composing)return!1;const d=c.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=DM(d)+o;return s.forEach(h=>{if(u)return;const p=VM(f,h.find);if(!p)return;const m=c.state.tr,y=yo({state:c.state,transaction:m}),g={from:r-(p[0].length-o.length),to:i},{commands:k,chain:S,can:N}=new bo({editor:n,state:y});h.handler({state:y,range:g,match:p,commands:k,chain:S,can:N})===null||!m.steps.length||(m.setMeta(l,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function _M(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 IM(t){return typeof t=="number"}class PM{constructor(e){this.find=e.find,this.handler=e.handler}}const RM=(t,e,n)=>{if(bl(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 LM(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:c,chain:d,can:u}=new bo({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),k=p.textBetween(y-m,g-m,void 0,"");RM(k,o.find,s).forEach(N=>{if(N.index===void 0)return;const b=y+N.index+1,w=b+N[0].length,x={from:n.tr.mapping.map(b),to:n.tr.mapping.map(w)},T=o.handler({state:n,range:x,match:N,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(T)})}),f.every(p=>p!==null)}const zM=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 FM(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 c=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const y=u.tr,g=yo({state:u,transaction:y});if(!(!LM({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,k=m.getMeta("applyPasteRules"),S=!!k;if(!y&&!g&&!S)return;if(S){const{from:w,text:x}=k,T=w+x.length,I=zM(x);return c({rule:u,state:p,from:w,to:{b:T},pasteEvt:I})}const N=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!IM(N)||!b||N===b.b))return c({rule:u,state:p,from:N,to:b,pasteEvt:s})}}))}function jM(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=AM(this.extensions,n),this.setupExtensions()}static resolve(e){const n=yr.sort(yr.flatten(e)),r=jM(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:yl(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:yl(s.name,this.schema)},c=[],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,k])=>[g,()=>k({editor:e})]));u={...u,...y}}const f=cM(u);c.push(f);const h=J(s,"addInputRules",l);vf(s,e.options.enableInputRules)&&h&&r.push(...h());const p=J(s,"addPasteRules",l);vf(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=J(s,"addProseMirrorPlugins",l);if(m){const y=m();c.push(...y)}return c}).flat();return[_M({editor:e,rules:r}),...FM({editor:e,rules:i}),...o]}get attributes(){return yf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=ko(this.extensions);return Object.fromEntries(n.filter(r=>!!J(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.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=(c,d,u,f)=>{const h=gl(c,i);return s()({editor:e,node:c,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:yl(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),c=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),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}function HM(t){return Object.prototype.toString.call(t).slice(8,-1)}function kl(t){return HM(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function wo(t,e){const n={...t};return kl(t)&&kl(e)&&Object.keys(e).forEach(r=>{kl(e[r])?r in t?n[r]=wo(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=wo(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 wf(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
16
+
17
+ `,textSerializers:s={}}=n||{};let l="";return t.nodesBetween(r,i,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(l+=o);const p=s==null?void 0:s[c.type.name];if(p)return u&&(l+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),l}function Sf(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const WM=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)),c=Sf(n);return wf(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),qM=()=>({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),UM=(t=!1)=>({commands:e})=>e.setContent("",t),KM=()=>({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,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+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},JM=t=>e=>t(e),YM=()=>({state:t,dispatch:e})=>ff(t,e),GM=(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},ZM=()=>({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),c=i.after(o);t.delete(l,c).scrollIntoView()}return!0}return!1},XM=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 c=o.before(s),d=o.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},QM=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},e2=()=>({state:t,dispatch:e})=>ul(t,e),t2=()=>({commands:t})=>t.keyboardShortcut("Enter"),n2=()=>({state:t,dispatch:e})=>mM(t,e);function So(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:bl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function xl(t,e,n={}){return t.find(r=>r.type===e&&So(r.attrs,n))}function r2(t,e,n={}){return!!xl(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=xl([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,l=o+1,c=s+r.node.nodeSize;for(xl([...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&&r2([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:s,to:c}}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 i2=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=hn(t,r.schema),{doc:s,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const f=vl(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=ne.create(s,f.from,f.to);n.setSelection(h)}}return!0},o2=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 wl(t){return t instanceof ne}function Wt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Cf(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 Sl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const s2=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Sl()&&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&&!wl(n.state.selection))return s(),!0;const l=Cf(i.doc,t)||n.state.selection,c=n.state.selection.eq(l);return o&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},l2=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),a2=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Of=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&&Of(r)}return t};function Mf(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Of(n)}function Co(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?L.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Co("",e,n)}if(i){const o=rr.fromSchema(e);return n.slice?o.parseSlice(Mf(t),n.parseOptions).content:o.parse(Mf(t),n.parseOptions)}return Co("",e,n)}function c2(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,c,d,u)=>{s===0&&(s=u)}),t.setSelection(le.near(t.doc.resolve(s),n))}const d2=t=>t.toString().startsWith("<"),u2=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const s=Co(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,u=!0;if((d2(s)?s:[s]).forEach(p=>{p.check(),d=d?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),l===c&&u){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=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,c)):(h=s,r.replaceWith(l,c,h)),n.updateSelection&&c2(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},f2=()=>({state:t,dispatch:e})=>fM(t,e),h2=()=>({state:t,dispatch:e})=>hM(t,e),p2=()=>({state:t,dispatch:e})=>of(t,e),m2=()=>({state:t,dispatch:e})=>cf(t,e),g2=()=>({tr:t,state:e,dispatch:n})=>{try{const r=oo(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},y2=()=>({state:t,dispatch:e,tr:n})=>{try{const r=oo(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},b2=()=>({state:t,dispatch:e})=>dM(t,e),k2=()=>({state:t,dispatch:e})=>uM(t,e);function Ef(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function x2(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 c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Sl()||Ef()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const v2=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=x2(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}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.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 c=i-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>So(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const w2=(t,e={})=>({state:n,dispatch:r})=>{const i=Ne(t,n.schema);return ui(n,i,e)?pM(n,r):!1},S2=()=>({state:t,dispatch:e})=>hf(t,e),C2=t=>({state:e,dispatch:n})=>{const r=Ne(t,e.schema);return OM(r)(e,n)},O2=()=>({state:t,dispatch:e})=>uf(t,e);function Oo(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Tf(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 M2=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Oo(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(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&n.setNodeMarkup(u,void 0,Tf(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Tf(f.attrs,e)))})})}),!0):!1},E2=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),T2=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),$2=()=>({state:t,dispatch:e})=>lf(t,e),N2=()=>({state:t,dispatch:e})=>df(t,e),B2=()=>({state:t,dispatch:e})=>bM(t,e),A2=()=>({state:t,dispatch:e})=>vM(t,e),D2=()=>({state:t,dispatch:e})=>xM(t,e);function $f(t,e,n={}){return Co(t,e,{slice:!1,parseOptions:n})}const V2=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,l=$f(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!e),!0};function Mo(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,c=>{s.push(...c.marks)});const l=s.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function _2(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 I2(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 Cl(t){return e=>I2(e.$from,t)}function P2(t,e){const n=Ot.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function R2(t,e){const n={from:0,to:t.content.size};return wf(t,n,e)}function L2(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 z2(t,e){const n=Oo(typeof e=="string"?e:e.name,t.schema);return n==="node"?L2(t,e):n==="mark"?Mo(t,e):{}}function Nf(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 Ol(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=>So(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 k=Math.max(p,g),S=Math.min(m,g+y.nodeSize),N=S-k;s+=N,l.push(...y.marks.map(b=>({mark:b,from:k,to:S})))})}),s===0)return!1;const c=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>So(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(c>0?c+d:c)>=s}function F2(t,e,n={}){if(!e)return ui(t,null,n)||Ol(t,null,n);const r=Oo(e,t.schema);return r==="node"?ui(t,e,n):r==="mark"?Ol(t,e,n):!1}function Bf(t,e){const{nodeExtensions:n}=ko(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 j2(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 H2(t){return t instanceof G}function Af(t,e,n){const i=t.state.doc.content.size,o=Wt(e,0,i),s=Wt(n,0,i),l=t.coordsAtPos(o),c=t.coordsAtPos(s,-1),d=Math.min(l.top,c.top),u=Math.max(l.bottom,c.bottom),f=Math.min(l.left,c.left),h=Math.max(l.right,c.right),p=h-f,m=u-d,k={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...k,toJSON:()=>k}}function W2(t,e,n){var r;const{selection:i}=e;let o=null;if(wl(i)&&(o=i.$cursor),o){const l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:l,$to:c})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,c.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 q2=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,c=hn(t,r.schema);if(i)if(s){const d=Mo(r,c);n.addStoredMark(c.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(k=>k.type===c)?h.marks.forEach(k=>{c===k.type&&n.addMark(m,y,c.create({...k.attrs,...e}))}):n.addMark(m,y,c.create(e))})});return W2(r,n,c)},U2=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),K2=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Ne(t,n.schema);return o.isTextblock?i().command(({commands:s})=>gf(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>gf(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},J2=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Wt(t,0,r.content.size),o=G.create(r,i);e.setSelection(o)}return!0},Y2=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,c=Wt(i,s,l),d=Wt(o,s,l),u=ne.create(r,c,d);e.setSelection(u)}return!0},G2=t=>({state:e,dispatch:n})=>{const r=Ne(t,e.schema);return TM(r)(e,n)};function Df(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 Z2=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:c}=o,d=i.extensionManager.attributes,u=Eo(d,l.node().type.name,l.node().attrs);if(o instanceof G&&o.node.isBlock)return!l.parentOffset||!zt(s,l.pos)?!1:(r&&(t&&Df(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const f=c.parentOffset===c.parent.content.size;o instanceof ne&&e.deleteSelection();const h=l.depth===0?void 0:_2(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&&Df(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},X2=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Ne(t,n.schema),{$from:l,$to:c}=n.selection,d=n.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))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=L.empty;const k=l.index(-1)?1:l.index(-2)?2:3;for(let T=l.depth-k;T>=l.depth-3;T-=1)g=L.from(l.node(T).copy(g));const S=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,N=Eo(f,l.node().type.name,l.node().attrs),b=((o=s.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(N))||void 0;g=g.append(L.from(s.createAndFill(null,b)||void 0));const w=l.before(l.depth-(k-1));e.replace(w,l.after(-S),new q(g,4-k,0));let x=-1;e.doc.nodesBetween(w,e.doc.content.size,(T,I)=>{if(x>-1)return!1;T.isTextblock&&T.content.size===0&&(x=I+1)}),x>-1&&e.setSelection(ne.near(e.doc.resolve(x))),e.scrollIntoView()}return!0}const h=c.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,c.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:k}=n,{splittableMarks:S}=i.extensionManager,N=k||g.$to.parentOffset&&g.$from.marks();if(e.split(l.pos,2,y).scrollIntoView(),!N||!r)return!0;const b=N.filter(w=>S.includes(w.type.name));e.ensureMarks(b)}return!0},Ml=(t,e)=>{const n=Cl(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=Cl(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 Q2=Object.freeze({__proto__:null,blur:qM,clearContent:UM,clearNodes:KM,command:JM,createParagraphNear:YM,cut:GM,deleteCurrentNode:ZM,deleteNode:XM,deleteRange:QM,deleteSelection:e2,enter:t2,exitCode:n2,extendMarkRange:i2,first:o2,focus:s2,forEach:l2,insertContent:a2,insertContentAt:u2,joinUp:f2,joinDown:h2,joinBackward:p2,joinForward:m2,joinItemBackward:g2,joinItemForward:y2,joinTextblockBackward:b2,joinTextblockForward:k2,keyboardShortcut:v2,lift:w2,liftEmptyBlock:S2,liftListItem:C2,newlineInCode:O2,resetAttributes:M2,scrollIntoView:E2,selectAll:T2,selectNodeBackward:$2,selectNodeForward:N2,selectParentNode:B2,selectTextblockEnd:A2,selectTextblockStart:D2,setContent:V2,setMark:q2,setMeta:U2,setNode:K2,setNodeSelection:J2,setTextSelection:Y2,sinkListItem:G2,splitBlock:Z2,splitListItem:X2,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:c,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:k,$to:S}=y,N=k.blockRange(S),b=g||y.$to.parentOffset&&y.$from.marks();if(!N)return!1;const w=Cl(x=>Bf(x.type.name,f))(y);if(N.depth>=1&&w&&N.depth-w.depth<=1){if(w.node.type===p)return d.liftListItem(m);if(Bf(w.node.type.name,f)&&p.validContent(w.node.content)&&l)return c().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>Ml(o,p)).command(()=>El(o,p)).run()}return!n||!b||!l?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>Ml(o,p)).command(()=>El(o,p)).run():c().command(()=>{const x=u().wrapInList(p,r),T=b.filter(I=>h.includes(I.type.name));return o.ensureMarks(T),x?!0:d.clearNodes()}).wrapInList(p,r).command(()=>Ml(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 Ol(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 c=l.steps.length-1;c>=0;c-=1)s.step(l.steps[c].invert(l.docs[c]));if(o.text){const c=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,c))}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,c=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===c))===null||o===void 0?void 0:o.attrs,y=vl(d,c,m);y&&(h=y.from,p=y.to),n.removeMark(h,p,c)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,c)});return n.removeStoredMark(c),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Oo(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(c=>{const d=c.$from.pos,u=c.$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 wM(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Ne(t,n.schema);return SM(i,e)(n,r)}});const eE=Re.create({name:"commands",addCommands(){return{...Q2}}}),tE=Re.create({name:"editable",addProseMirrorPlugins(){return[new ze({key:new yt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),nE=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}}}})]}}),rE=Re.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:f}=c,{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,k=y&&m.parent.childCount===1?g===f.pos:le.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!k||k&&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 Sl()||Ef()?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,c=le.atEnd(e.doc).to;if(i||!(o===l&&s===c)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,h=yo({state:n,transaction:f}),{commands:p}=new bo({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),iE=Re.create({name:"tabindex",addProseMirrorPlugins(){return[new ze({key:new yt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Pn{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 Pn(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 Pn(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 Pn(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 Pn(s,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Pn(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 c=s[l];if(o[c]!==n[c])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(c=>n[c]===s.node.attrs[c])&&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 oE=`.ProseMirror {
18
18
  position: relative;
19
19
  }
20
20
 
@@ -88,33 +88,33 @@ img.ProseMirror-separator {
88
88
 
89
89
  .tippy-box[data-animation=fade][data-state=hidden] {
90
90
  opacity: 0
91
- }`;function QE(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 eM=class extends w2{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=QE(XE,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=gf(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?[JE,P2.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),KE,GE,YE,ZE]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new br(i,this)}createCommandManager(){this.commandManager=new yo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Mf(this.options.content,this.schema,this.options.parseOptions),n=wf(e,this.options.autofocus);this.view=new KO(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ur.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 DE(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return VE(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return NE(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
91
+ }`;function sE(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 lE=class extends $M{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=sE(oE,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=bf(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?[tE,WM.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),eE,nE,rE,iE]:[],...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 bo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=$f(this.options.content,this.schema,this.options.parseOptions),n=Cf(e,this.options.autofocus);this.view=new eM(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 z2(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return F2(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return P2(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
92
92
 
93
- `,textSerializers:r={}}=e||{};return BE(this.state.doc,{blockSeparator:n,textSerializers:{...xf(this.schema),...r}})}get isEmpty(){return _E(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 kr(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(Tf(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+a,d);const h=n.from+a+s.length;o.addMark(n.from+a,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function tM(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 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&&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 vr(t){return new N2({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(Tf(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+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],xr="start",pi="end",nM="clippingParents",Af="viewport",mi="popper",rM="reference",Df=hi.reduce(function(t,e){return t.concat([e+"-"+xr,e+"-"+pi])},[]),Vf=[].concat(hi,[Tl]).reduce(function(t,e){return t.concat([e,e+"-"+xr,e+"-"+pi])},[]),iM="beforeRead",oM="read",sM="afterRead",lM="beforeMain",aM="main",cM="afterMain",dM="beforeWrite",uM="write",fM="afterWrite",hM=[iM,oM,sM,lM,aM,cM,dM,uM,fM];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 pM(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 mM(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 _f={name:"applyStyles",enabled:!0,phase:"write",fn:pM,effect:mM,requires:["computeStyles"]};function At(t){return t.split("-")[0]}var Rn=Math.max,Mo=Math.min,wr=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 If(){return!/^((?!chrome|android).)*safari/i.test(Nl())}function Sr(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&&wr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&wr(r.height)/t.offsetHeight||1);var s=Pn(t)?nt(t):window,l=s.visualViewport,a=!If()&&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=Sr(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 Pf(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 gM(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 Rf(t){return!dt(t)||qt(t).position==="fixed"?null:t.offsetParent}function yM(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=Rf(t);n&&gM(n)&&qt(n).position==="static";)n=Rf(n);return n&&(Bt(n)==="html"||Bt(n)==="body"&&qt(n).position==="static")?e:n||yM(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 bM(t,e,n){var r=yi(t,e,n);return r>n?n:r}function Lf(){return{top:0,right:0,bottom:0,left:0}}function zf(t){return Object.assign({},Lf(),t)}function Ff(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var kM=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,zf(typeof e!="number"?e:Ff(e,hi))};function vM(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=kM(i.padding,n),h=Bl(o),p=a==="y"?Ye:Ze,m=a==="y"?at:ct,g=n.rects.reference[u]+n.rects.reference[a]-s[a]-n.rects.popper[u],y=s[a]-n.rects.reference[a],v=gi(o),x=v?a==="y"?v.clientHeight||0:v.clientWidth||0:0,T=g/2-y/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 xM(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)||Pf(e.elements.popper,i)&&(e.elements.arrow=i))}const wM={name:"arrow",enabled:!0,phase:"main",fn:vM,effect:xM,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Cr(t){return t.split("-")[1]}var SM={top:"auto",right:"auto",bottom:"auto",left:"auto"};function CM(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:wr(n*i)/i||0,y:wr(r*i)/i||0}}function jf(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,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 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];g-=A-r.height,g*=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&&SM),j=u===!0?CM({x:p,y:g},nt(n)):{x:p,y:g};if(p=j.x,g=j.y,a){var _;return Object.assign({},F,(_={},_[b]=x?"0":"",_[T]=v?"0":"",_.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",_))}return Object.assign({},F,(e={},e[b]=x?g+"px":"",e[T]=v?p+"px":"",e.transform="",e))}function OM(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:Cr(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,jf(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,jf(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 EM={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:OM,data:{}};var $o={passive:!0};function MM(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 TM={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:MM,data:{}};var $M={left:"right",right:"left",bottom:"top",top:"bottom"};function No(t){return t.replace(/left|right|bottom|top/g,function(e){return $M[e]})}var NM={start:"end",end:"start"};function Hf(t){return t.replace(/start|end/g,function(e){return NM[e]})}function Dl(t){var e=nt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Vl(t){return Sr(pn(t)).left+Dl(t).scrollLeft}function BM(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=If();(d||!d&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l+Vl(t),y:a}}function AM(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 Wf(t){return["html","body","#document"].indexOf(Bt(t))>=0?t.ownerDocument.body:dt(t)&&_l(t)?t:Wf(To(t))}function bi(t,e){var n;e===void 0&&(e=[]);var r=Wf(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 DM(t,e){var n=Sr(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 qf(t,e,n){return e===Af?Il(BM(t,n)):Pn(e)?DM(e,n):Il(AM(pn(t)))}function VM(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)&&Pf(i,r)&&Bt(i)!=="body"}):[]}function _M(t,e,n,r){var i=e==="clippingParents"?VM(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(a,d){var u=qf(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},qf(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 Uf(t){var e=t.reference,n=t.element,r=t.placement,i=r?At(r):null,o=r?Cr(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 xr: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?nM:l,d=n.rootBoundary,u=d===void 0?Af:d,f=n.elementContext,h=f===void 0?mi:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,v=zf(typeof y!="number"?y:Ff(y,hi)),x=h===mi?rM:mi,T=t.rects.popper,b=t.elements[m?x:h],S=_M(Pn(b)?b:b.contextElement||pn(t.elements.popper),a,u,s),k=Sr(t.elements.reference),C=Uf({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 IM(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?Vf:a,u=Cr(r),f=u?l?Df:Df.filter(function(m){return Cr(m)===u}):hi,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]=ki(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[At(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function PM(t){if(At(t)===Tl)return[];var e=No(t);return[Hf(t),e,Hf(e)]}function RM(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,g=n.allowedAutoPlacements,y=e.options.placement,v=At(y),x=v===y,T=a||(x||!m?[No(y)]:PM(y)),b=[y].concat(T).reduce(function(oe,ye){return oe.concat(At(ye)===Tl?IM(e,{placement:ye,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):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),_=Cr(F)===xr,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 LM={name:"flip",enabled:!0,phase:"main",fn:RM,requiresIfExists:["offset"],data:{_skip:!1}};function Kf(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 Jf(t){return[Ye,ct,at,Ze].some(function(e){return t[e]>=0})}function zM(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=Kf(s,r),d=Kf(l,i,o),u=Jf(a),f=Jf(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 FM={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zM};function jM(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 HM(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Vf.reduce(function(u,f){return u[f]=jM(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 WM={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:HM};function qM(t){var e=t.state,n=t.name;e.modifiersData[n]=Uf({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const UM={name:"popperOffsets",enabled:!0,phase:"read",fn:qM,data:{}};function KM(t){return t==="x"?"y":"x"}function JM(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,g=m===void 0?0:m,y=ki(e,{boundary:a,rootBoundary:d,padding:f,altBoundary:u}),v=At(e.placement),x=Cr(e.placement),T=!x,b=Al(v),S=KM(b),k=e.modifiersData.popperOffsets,C=e.rects.reference,D=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,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+y[B],H=O-y[N],G=p?-D[$]/2:0,ie=x===xr?C[$]:D[$],de=x===xr?-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:Lf(),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,Tr=O+re-ut-Oe,gn=O+fe-ut,yn=yi(p?Mo(V,Tr):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+y[xt],It=ht-y[ft],Fn=[Ye,Ze].indexOf(v)!==-1,bn=(Kt=F==null?void 0:F[S])!=null?Kt:0,$r=Fn?Jt:ht-C[_t]-D[_t]-bn+R.altAxis,Nr=Fn?ht+C[_t]+D[_t]-bn-R.altAxis:It,Br=p&&Fn?bM($r,ht,Nr):yi(p?$r:Jt,ht,p?Nr:It);k[S]=Br,j[S]=Br-ht}e.modifiersData[r]=j}}const GM={name:"preventOverflow",enabled:!0,phase:"main",fn:JM,requiresIfExists:["offset"]};function YM(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function ZM(t){return t===nt(t)||!dt(t)?Dl(t):YM(t)}function XM(t){var e=t.getBoundingClientRect(),n=wr(e.width)/t.offsetWidth||1,r=wr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function QM(t,e,n){n===void 0&&(n=!1);var r=dt(e),i=dt(e)&&XM(e),o=pn(e),s=Sr(t,i,n),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((Bt(e)!=="body"||_l(o))&&(l=ZM(e)),dt(e)?(a=Sr(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 eT(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 tT(t){var e=eT(t);return hM.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function nT(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function rT(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 Gf={placement:"bottom",modifiers:[],strategy:"absolute"};function Yf(){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 iT(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Gf:i;return function(l,a,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Gf,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;g(),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=tT(rT([].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(Yf(x,T)){u.rects={reference:QM(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:nT(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!Yf(l,a))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var v=y.name,x=y.options,T=x===void 0?{}:x,b=y.effect;if(typeof b=="function"){var S=b({state:u,name:v,instance:p,options:T}),k=function(){};f.push(S||k)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var oT=[TM,UM,EM,_f,WM,LM,GM,wM,FM],sT=iT({defaultModifiers:oT}),lT="tippy-box",Zf="tippy-content",aT="tippy-backdrop",Xf="tippy-arrow",Qf="tippy-svg-arrow",Ln={passive:!0,capture:!0},eh=function(){return document.body};function cT(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 th(t,e){return typeof t=="function"?t.apply(void 0,e):t}function nh(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function dT(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function uT(t){return t.split(/\s+/).filter(Boolean)}function Or(t){return[].concat(t)}function rh(t,e){t.indexOf(e)===-1&&t.push(e)}function fT(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function hT(t){return t.split("-")[0]}function Bo(t){return[].slice.call(t)}function ih(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 pT(t){return Rl(t,"NodeList")}function mT(t){return Rl(t,"MouseEvent")}function gT(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function yT(t){return xi(t)?[t]:pT(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 oh(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function bT(t){var e,n=Or(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function kT(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=hT(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>a,y=r-o.bottom-h>a,v=o.left-n+p>a,x=n-o.right-m>a;return g||y||v||x})}function zl(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function sh(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},lh=0;function vT(){Dt.isTouch||(Dt.isTouch=!0,window.performance&&document.addEventListener("mousemove",ah))}function ah(){var t=performance.now();t-lh<20&&(Dt.isTouch=!1,document.removeEventListener("mousemove",ah)),lh=t}function xT(){var t=document.activeElement;if(gT(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function wT(){document.addEventListener("touchstart",vT,Ln),window.addEventListener("blur",xT)}var ST=typeof window<"u"&&typeof document<"u",CT=ST?!!window.msCrypto:!1;function Er(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 ch(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function OT(t){return ch(`
93
+ `,textSerializers:r={}}=e||{};return R2(this.state.doc,{blockSeparator:n,textSerializers:{...Sf(this.schema),...r}})}get isEmpty(){return j2(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 Pn(n,this)}get $doc(){return this.$pos(0)}};function br(t){return new xo({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 c=l.search(/\S/),d=n.from+l.indexOf(s),u=d+s.length;if(Nf(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+c,d);const h=n.from+c+s.length;o.addMark(n.from+c,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function aE(t){return new xo({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 c=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,c)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l));o.scrollIntoView()}})}function Tl(t){return new xo({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 xo({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),c=s.doc.resolve(n.from).blockRange(),d=c&&Ds(c,t.type,o);if(!d)return null;if(s.wrap(c,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=wo(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 c=s.find(d=>(d==null?void 0:d.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let tt=class ia{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 ia(e)}configure(e={}){const n=this.extend();return n.options=wo(this.options,e),n.storage=ae(J(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new ia({...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 PM({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],c=r[0];let d=n.to;if(l){const u=c.search(/\S/),f=n.from+c.indexOf(l),h=f+l.length;if(Nf(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 Ge="top",at="bottom",ct="right",Ze="left",$l="auto",hi=[Ge,at,ct,Ze],xr="start",pi="end",cE="clippingParents",Vf="viewport",mi="popper",dE="reference",_f=hi.reduce(function(t,e){return t.concat([e+"-"+xr,e+"-"+pi])},[]),If=[].concat(hi,[$l]).reduce(function(t,e){return t.concat([e,e+"-"+xr,e+"-"+pi])},[]),uE="beforeRead",fE="read",hE="afterRead",pE="beforeMain",mE="main",gE="afterMain",yE="beforeWrite",bE="write",kE="afterWrite",xE=[uE,fE,hE,pE,mE,gE,yE,bE,kE];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 Rn(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 Nl(t){if(typeof ShadowRoot>"u")return!1;var e=nt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function vE(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 wE(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(c,d){return c[d]="",c},{});!dt(i)||!Bt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Pf={name:"applyStyles",enabled:!0,phase:"write",fn:vE,effect:wE,requires:["computeStyles"]};function At(t){return t.split("-")[0]}var Ln=Math.max,To=Math.min,vr=Math.round;function Bl(){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 Rf(){return!/^((?!chrome|android).)*safari/i.test(Bl())}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&&vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&vr(r.height)/t.offsetHeight||1);var s=Rn(t)?nt(t):window,l=s.visualViewport,c=!Rf()&&n,d=(r.left+(c&&l?l.offsetLeft:0))/i,u=(r.top+(c&&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 Al(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 Lf(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Nl(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 SE(t){return["table","td","th"].indexOf(Bt(t))>=0}function pn(t){return((Rn(t)?t.ownerDocument:t.document)||window.document).documentElement}function $o(t){return Bt(t)==="html"?t:t.assignedSlot||t.parentNode||(Nl(t)?t.host:null)||pn(t)}function zf(t){return!dt(t)||qt(t).position==="fixed"?null:t.offsetParent}function CE(t){var e=/firefox/i.test(Bl()),n=/Trident/i.test(Bl());if(n&&dt(t)){var r=qt(t);if(r.position==="fixed")return null}var i=$o(t);for(Nl(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=zf(t);n&&SE(n)&&qt(n).position==="static";)n=zf(n);return n&&(Bt(n)==="html"||Bt(n)==="body"&&qt(n).position==="static")?e:n||CE(t)||e}function Dl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function yi(t,e,n){return Ln(t,To(e,n))}function OE(t,e,n){var r=yi(t,e,n);return r>n?n:r}function Ff(){return{top:0,right:0,bottom:0,left:0}}function jf(t){return Object.assign({},Ff(),t)}function Hf(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var ME=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,jf(typeof e!="number"?e:Hf(e,hi))};function EE(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=At(n.placement),c=Dl(l),d=[Ze,ct].indexOf(l)>=0,u=d?"height":"width";if(!(!o||!s)){var f=ME(i.padding,n),h=Al(o),p=c==="y"?Ge:Ze,m=c==="y"?at:ct,y=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],g=s[c]-n.rects.reference[c],k=gi(o),S=k?c==="y"?k.clientHeight||0:k.clientWidth||0:0,N=y/2-g/2,b=f[p],w=S-h[u]-f[m],x=S/2-h[u]/2+N,T=yi(b,x,w),I=c;n.modifiersData[r]=(e={},e[I]=T,e.centerOffset=T-x,e)}}function TE(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)||Lf(e.elements.popper,i)&&(e.elements.arrow=i))}const $E={name:"arrow",enabled:!0,phase:"main",fn:EE,effect:TE,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(t){return t.split("-")[1]}var NE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function BE(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:vr(n*i)/i||0,y:vr(r*i)/i||0}}function Wf(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,c=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 k=s.hasOwnProperty("x"),S=s.hasOwnProperty("y"),N=Ze,b=Ge,w=window;if(d){var x=gi(n),T="clientHeight",I="clientWidth";if(x===nt(n)&&(x=pn(n),qt(x).position!=="static"&&l==="absolute"&&(T="scrollHeight",I="scrollWidth")),x=x,i===Ge||(i===Ze||i===ct)&&o===pi){b=at;var A=f&&x===w&&w.visualViewport?w.visualViewport.height:x[T];y-=A-r.height,y*=c?1:-1}if(i===Ze||(i===Ge||i===at)&&o===pi){N=ct;var B=f&&x===w&&w.visualViewport?w.visualViewport.width:x[I];p-=B-r.width,p*=c?1:-1}}var P=Object.assign({position:l},d&&NE),F=u===!0?BE({x:p,y},nt(n)):{x:p,y};if(p=F.x,y=F.y,c){var V;return Object.assign({},P,(V={},V[b]=S?"0":"",V[N]=k?"0":"",V.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+y+"px)":"translate3d("+p+"px, "+y+"px, 0)",V))}return Object.assign({},P,(e={},e[b]=S?y+"px":"",e[N]=k?p+"px":"",e.transform="",e))}function AE(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,c=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,Wf(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Wf(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const DE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:AE,data:{}};var No={passive:!0};function VE(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,c=nt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,No)}),l&&c.addEventListener("resize",n.update,No),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,No)}),l&&c.removeEventListener("resize",n.update,No)}}const _E={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:VE,data:{}};var IE={left:"right",right:"left",bottom:"top",top:"bottom"};function Bo(t){return t.replace(/left|right|bottom|top/g,function(e){return IE[e]})}var PE={start:"end",end:"start"};function qf(t){return t.replace(/start|end/g,function(e){return PE[e]})}function Vl(t){var e=nt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function _l(t){return wr(pn(t)).left+Vl(t).scrollLeft}function RE(t,e){var n=nt(t),r=pn(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;var d=Rf();(d||!d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l+_l(t),y:c}}function LE(t){var e,n=pn(t),r=Vl(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Ln(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ln(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+_l(t),c=-r.scrollTop;return qt(i||n).direction==="rtl"&&(l+=Ln(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function Il(t){var e=qt(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Uf(t){return["html","body","#document"].indexOf(Bt(t))>=0?t.ownerDocument.body:dt(t)&&Il(t)?t:Uf($o(t))}function bi(t,e){var n;e===void 0&&(e=[]);var r=Uf(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=nt(r),s=i?[o].concat(o.visualViewport||[],Il(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(bi($o(s)))}function Pl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function zE(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 Kf(t,e,n){return e===Vf?Pl(RE(t,n)):Rn(e)?zE(e,n):Pl(LE(pn(t)))}function FE(t){var e=bi($o(t)),n=["absolute","fixed"].indexOf(qt(t).position)>=0,r=n&&dt(t)?gi(t):t;return Rn(r)?e.filter(function(i){return Rn(i)&&Lf(i,r)&&Bt(i)!=="body"}):[]}function jE(t,e,n,r){var i=e==="clippingParents"?FE(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(c,d){var u=Kf(t,d,r);return c.top=Ln(u.top,c.top),c.right=To(u.right,c.right),c.bottom=To(u.bottom,c.bottom),c.left=Ln(u.left,c.left),c},Kf(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 Jf(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,c;switch(i){case Ge:c={x:s,y:e.y-n.height};break;case at:c={x:s,y:e.y+e.height};break;case ct:c={x:e.x+e.width,y:l};break;case Ze:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var d=i?Dl(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case xr:c[d]=c[d]-(e[u]/2-n[u]/2);break;case pi:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}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,c=l===void 0?cE:l,d=n.rootBoundary,u=d===void 0?Vf: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,k=jf(typeof g!="number"?g:Hf(g,hi)),S=h===mi?dE:mi,N=t.rects.popper,b=t.elements[m?S:h],w=jE(Rn(b)?b:b.contextElement||pn(t.elements.popper),c,u,s),x=wr(t.elements.reference),T=Jf({reference:x,element:N,placement:i}),I=Pl(Object.assign({},N,T)),A=h===mi?I:x,B={top:w.top-A.top+k.top,bottom:A.bottom-w.bottom+k.bottom,left:w.left-A.left+k.left,right:A.right-w.right+k.right},P=t.modifiersData.offset;if(h===mi&&P){var F=P[i];Object.keys(B).forEach(function(V){var D=[ct,at].indexOf(V)>=0?1:-1,$=[Ge,at].indexOf(V)>=0?"y":"x";B[V]+=F[$]*D})}return B}function HE(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?If:c,u=Sr(r),f=u?l?_f:_f.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 WE(t){if(At(t)===$l)return[];var e=Bo(t);return[qf(t),e,qf(e)]}function qE(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,c=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,k=At(g),S=k===g,N=c||(S||!m?[Bo(g)]:WE(g)),b=[g].concat(N).reduce(function(oe,ye){return oe.concat(At(ye)===$l?HE(e,{placement:ye,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:y}):ye)},[]),w=e.rects.reference,x=e.rects.popper,T=new Map,I=!0,A=b[0],B=0;B<b.length;B++){var P=b[B],F=At(P),V=Sr(P)===xr,D=[Ge,at].indexOf(F)>=0,$=D?"width":"height",E=ki(e,{placement:P,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),C=D?V?ct:Ze:V?at:Ge;w[$]>x[$]&&(C=Bo(C));var _=Bo(C),W=[];if(o&&W.push(E[F]<=0),l&&W.push(E[C]<=0,E[_]<=0),W.every(function(oe){return oe})){A=P,I=!1;break}T.set(P,W)}if(I)for(var Y=m?3:1,ie=function(ye){var j=b.find(function(Z){var ue=T.get(Z);if(ue)return ue.slice(0,ye).every(function(re){return re})});if(j)return A=j,"break"},de=Y;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 UE={name:"flip",enabled:!0,phase:"main",fn:qE,requiresIfExists:["offset"],data:{_skip:!1}};function Yf(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 Gf(t){return[Ge,ct,at,Ze].some(function(e){return t[e]>=0})}function KE(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}),c=Yf(s,r),d=Yf(l,i,o),u=Gf(c),f=Gf(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const JE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:KE};function YE(t,e,n){var r=At(t),i=[Ze,Ge].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 GE(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=If.reduce(function(u,f){return u[f]=YE(f,e.rects,o),u},{}),l=s[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const ZE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:GE};function XE(t){var e=t.state,n=t.name;e.modifiersData[n]=Jf({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const QE={name:"popperOffsets",enabled:!0,phase:"read",fn:XE,data:{}};function eT(t){return t==="x"?"y":"x"}function tT(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,c=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:c,rootBoundary:d,padding:f,altBoundary:u}),k=At(e.placement),S=Sr(e.placement),N=!S,b=Dl(k),w=eT(b),x=e.modifiersData.popperOffsets,T=e.rects.reference,I=e.rects.popper,A=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,B=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,F={x:0,y:0};if(x){if(o){var V,D=b==="y"?Ge:Ze,$=b==="y"?at:ct,E=b==="y"?"height":"width",C=x[b],_=C+g[D],W=C-g[$],Y=p?-I[E]/2:0,ie=S===xr?T[E]:I[E],de=S===xr?-I[E]:-T[E],he=e.elements.arrow,oe=p&&he?Al(he):{width:0,height:0},ye=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ff(),j=ye[D],Z=ye[$],ue=yi(0,T[E],oe[E]),re=N?T[E]/2-Y-ue-j-B.mainAxis:ie-ue-j-B.mainAxis,fe=N?-T[E]/2+Y+ue+Z+B.mainAxis:de+ue+Z+B.mainAxis,be=e.elements.arrow&&gi(e.elements.arrow),Oe=be?b==="y"?be.clientTop||0:be.clientLeft||0:0,ut=(V=P==null?void 0:P[b])!=null?V:0,Er=C+re-ut-Oe,gn=C+fe-ut,yn=yi(p?To(_,Er):_,C,p?Ln(W,gn):W);x[b]=yn,F[b]=yn-C}if(l){var Kt,vt=b==="x"?Ge:Ze,ft=b==="x"?at:ct,ht=x[w],_t=w==="y"?"height":"width",Jt=ht+g[vt],It=ht-g[ft],jn=[Ge,Ze].indexOf(k)!==-1,bn=(Kt=P==null?void 0:P[w])!=null?Kt:0,Tr=jn?Jt:ht-T[_t]-I[_t]-bn+B.altAxis,$r=jn?ht+T[_t]+I[_t]-bn-B.altAxis:It,Nr=p&&jn?OE(Tr,ht,$r):yi(p?Tr:Jt,ht,p?$r:It);x[w]=Nr,F[w]=Nr-ht}e.modifiersData[r]=F}}const nT={name:"preventOverflow",enabled:!0,phase:"main",fn:tT,requiresIfExists:["offset"]};function rT(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function iT(t){return t===nt(t)||!dt(t)?Vl(t):rT(t)}function oT(t){var e=t.getBoundingClientRect(),n=vr(e.width)/t.offsetWidth||1,r=vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function sT(t,e,n){n===void 0&&(n=!1);var r=dt(e),i=dt(e)&&oT(e),o=pn(e),s=wr(t,i,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Bt(e)!=="body"||Il(o))&&(l=iT(e)),dt(e)?(c=wr(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=_l(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function lT(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 c=e.get(l);c&&i(c)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function aT(t){var e=lT(t);return xE.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function cT(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function dT(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 Zf={placement:"bottom",modifiers:[],strategy:"absolute"};function Xf(){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 uT(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Zf:i;return function(l,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Zf,o),modifiersData:{},elements:{reference:l,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(k){var S=typeof k=="function"?k(u.options):k;y(),u.options=Object.assign({},o,u.options,S),u.scrollParents={reference:Rn(l)?bi(l):l.contextElement?bi(l.contextElement):[],popper:bi(c)};var N=aT(dT([].concat(r,u.options.modifiers)));return u.orderedModifiers=N.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var k=u.elements,S=k.reference,N=k.popper;if(Xf(S,N)){u.rects={reference:sT(S,gi(N),u.options.strategy==="fixed"),popper:Al(N)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(B){return u.modifiersData[B.name]=Object.assign({},B.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var w=u.orderedModifiers[b],x=w.fn,T=w.options,I=T===void 0?{}:T,A=w.name;typeof x=="function"&&(u=x({state:u,options:I,name:A,instance:p})||u)}}}},update:cT(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){y(),h=!0}};if(!Xf(l,c))return p;p.setOptions(d).then(function(g){!h&&d.onFirstUpdate&&d.onFirstUpdate(g)});function m(){u.orderedModifiers.forEach(function(g){var k=g.name,S=g.options,N=S===void 0?{}:S,b=g.effect;if(typeof b=="function"){var w=b({state:u,name:k,instance:p,options:N}),x=function(){};f.push(w||x)}})}function y(){f.forEach(function(g){return g()}),f=[]}return p}}var fT=[_E,QE,DE,Pf,ZE,UE,nT,$E,JE],hT=uT({defaultModifiers:fT}),pT="tippy-box",Qf="tippy-content",mT="tippy-backdrop",eh="tippy-arrow",th="tippy-svg-arrow",zn={passive:!0,capture:!0},nh=function(){return document.body};function gT(t,e){return{}.hasOwnProperty.call(t,e)}function Rl(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Ll(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function rh(t,e){return typeof t=="function"?t.apply(void 0,e):t}function ih(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function yT(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function bT(t){return t.split(/\s+/).filter(Boolean)}function Cr(t){return[].concat(t)}function oh(t,e){t.indexOf(e)===-1&&t.push(e)}function kT(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function xT(t){return t.split("-")[0]}function Ao(t){return[].slice.call(t)}function sh(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function xi(){return document.createElement("div")}function vi(t){return["Element","Fragment"].some(function(e){return Ll(t,e)})}function vT(t){return Ll(t,"NodeList")}function wT(t){return Ll(t,"MouseEvent")}function ST(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function CT(t){return vi(t)?[t]:vT(t)?Ao(t):Array.isArray(t)?t:Ao(document.querySelectorAll(t))}function zl(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function lh(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function OT(t){var e,n=Cr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function MT(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,c=l.interactiveBorder,d=xT(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>c,g=r-o.bottom-h>c,k=o.left-n+p>c,S=n-o.right-m>c;return y||g||k||S})}function Fl(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function ah(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},ch=0;function ET(){Dt.isTouch||(Dt.isTouch=!0,window.performance&&document.addEventListener("mousemove",dh))}function dh(){var t=performance.now();t-ch<20&&(Dt.isTouch=!1,document.removeEventListener("mousemove",dh)),ch=t}function TT(){var t=document.activeElement;if(ST(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function $T(){document.addEventListener("touchstart",ET,zn),window.addEventListener("blur",TT)}var NT=typeof window<"u"&&typeof document<"u",BT=NT?!!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 uh(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function AT(t){return uh(`
94
94
  %ctippy.js
95
95
 
96
- %c`+ch(t)+`
96
+ %c`+uh(t)+`
97
97
 
98
98
  %c👷‍ This is a development-only message. It will be removed in production.
99
- `)}function dh(t){return[OT(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var wi;process.env.NODE_ENV!=="production"&&ET();function ET(){wi=new Set}function Ut(t,e){if(t&&!wi.has(e)){var n;wi.add(e),(n=console).warn.apply(n,dh(e))}}function Fl(t,e){if(t&&!wi.has(e)){var n;wi.add(e),(n=console).error.apply(n,dh(e))}}function MT(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 uh={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},TT={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},rt=Object.assign({appendTo:eh,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},uh,TT),$T=Object.keys(rt),NT=function(e){process.env.NODE_ENV!=="production"&&ph(e,[]);var n=Object.keys(e);n.forEach(function(r){rt[r]=e[r]})};function fh(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 BT(t,e){var n=e?Object.keys(fh(Object.assign({},rt,{plugins:e}))):$T,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 hh(t,e){var n=Object.assign({},e,{content:th(e.content,[t])},e.ignoreAttributes?{}:BT(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 ph(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=dT(rt,Object.keys(uh)),o=!cT(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.",`
99
+ `)}function fh(t){return[AT(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var wi;process.env.NODE_ENV!=="production"&&DT();function DT(){wi=new Set}function Ut(t,e){if(t&&!wi.has(e)){var n;wi.add(e),(n=console).warn.apply(n,fh(e))}}function jl(t,e){if(t&&!wi.has(e)){var n;wi.add(e),(n=console).error.apply(n,fh(e))}}function VT(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;jl(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),jl(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var hh={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},_T={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},rt=Object.assign({appendTo:nh,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},hh,_T),IT=Object.keys(rt),PT=function(e){process.env.NODE_ENV!=="production"&&gh(e,[]);var n=Object.keys(e);n.forEach(function(r){rt[r]=e[r]})};function ph(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 RT(t,e){var n=e?Object.keys(ph(Object.assign({},rt,{plugins:e}))):IT,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 mh(t,e){var n=Object.assign({},e,{content:rh(e.content,[t])},e.ignoreAttributes?{}:RT(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 gh(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=yT(rt,Object.keys(hh)),o=!gT(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 AT=function(){return"innerHTML"};function jl(t,e){t[AT()]=e}function mh(t){var e=vi();return t===!0?e.className=Xf:(e.className=Qf,xi(t)?e.appendChild(t):jl(e,t)),e}function gh(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(Zf)}),arrow:n.find(function(r){return r.classList.contains(Xf)||r.classList.contains(Qf)}),backdrop:n.find(function(r){return r.classList.contains(aT)})}}function yh(t){var e=vi(),n=vi();n.className=lT,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=vi();r.className=Zf,r.setAttribute("data-state","hidden"),gh(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)&&gh(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(a.removeChild(u),a.appendChild(mh(s.arrow))):a.appendChild(mh(s.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:i}}yh.$$tippy=!0;var DT=1,Ao=[],Wl=[];function VT(t,e){var n=hh(t,Object.assign({},rt,fh(ih(e)))),r,i,o,s=!1,l=!1,a=!1,d=!1,u,f,h,p=[],m=nh(Tr,n.interactiveDebounce),g,y=DT++,v=null,x=fT(n.plugins),T={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:y,reference:t,popper:vi(),popperInstance:v,props:n,state:T,plugins:x,clearDelayTimeouts:$r,setProps:Nr,setContent:Br,show:M,hide:E,hideWithInteractivity:I,enable:Fn,disable:bn,unmount:q,destroy:ee};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 g||t}function B(){var w=_().parentNode;return w?bT(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(te){te[w]&&te[w].apply(te,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=Or(b.props.triggerTarget||t);X.forEach(function(te){var se=te.getAttribute(L);if(b.state.isVisible)te.setAttribute(L,se?se+" "+U:U);else{var pe=se&&se.replace(U,"").trim();pe?te.setAttribute(L,pe):te.removeAttribute(L)}})}}function G(){if(!(A||!b.props.aria.expanded)){var w=Or(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&&sh(k,L))){if(Or(b.props.triggerTarget||t).some(function(U){return sh(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(te){te.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=Or(b.props.triggerTarget||t);X.forEach(function(te){te.addEventListener(w,L,U),p.push({node:te,eventType:w,handler:L,options:U})})}function be(){F()&&(fe("touchstart",ut,{passive:!0}),fe("touchend",gn,{passive:!0})),uT(b.props.trigger).forEach(function(w){if(w!=="manual")switch(fe(w,ut),w){case"mouseenter":fe("mouseleave",gn);break;case"focus":fe(CT?"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,te=w.options;L.removeEventListener(U,X,te)}),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,g=w.currentTarget,G(),!b.state.isVisible&&mT(w)&&Ao.forEach(function(te){return te(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 Tr(w){var L=w.target,U=_().contains(L)||k.contains(L);if(!(w.type==="mousemove"&&U)){var X=_t().concat(k).map(function(te){var se,pe=te._tippy,xe=(se=pe.popperInstance)==null?void 0:se.state;return xe?{popperRect:te.getBoundingClientRect(),popperState:xe,props:n}:null}).filter(Boolean);kT(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,te=w.getReferenceClientRect,se=w.moveTransition,pe=j()?Hl(k).arrow:null,xe=te?{getBoundingClientRect:te,contextElement:te.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=sT(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===eh||w==="parent"?L=U.parentNode:L=th(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.",`
102
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var LT=function(){return"innerHTML"};function Hl(t,e){t[LT()]=e}function yh(t){var e=xi();return t===!0?e.className=eh:(e.className=th,vi(t)?e.appendChild(t):Hl(e,t)),e}function bh(t,e){vi(e.content)?(Hl(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Hl(t,e.content):t.textContent=e.content)}function Wl(t){var e=t.firstElementChild,n=Ao(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Qf)}),arrow:n.find(function(r){return r.classList.contains(eh)||r.classList.contains(th)}),backdrop:n.find(function(r){return r.classList.contains(mT)})}}function kh(t){var e=xi(),n=xi();n.className=pT,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=xi();r.className=Qf,r.setAttribute("data-state","hidden"),bh(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Wl(e),c=l.box,d=l.content,u=l.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&bh(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(yh(s.arrow))):c.appendChild(yh(s.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:i}}kh.$$tippy=!0;var zT=1,Do=[],ql=[];function FT(t,e){var n=mh(t,Object.assign({},rt,ph(sh(e)))),r,i,o,s=!1,l=!1,c=!1,d=!1,u,f,h,p=[],m=ih(Er,n.interactiveDebounce),y,g=zT++,k=null,S=kT(n.plugins),N={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:g,reference:t,popper:xi(),popperInstance:k,props:n,state:N,plugins:S,clearDelayTimeouts:Tr,setProps:$r,setContent:Nr,show:M,hide:O,hideWithInteractivity:R,enable:jn,disable:bn,unmount:U,destroy:Q};if(!n.render)return process.env.NODE_ENV!=="production"&&jl(!0,"render() function has not been supplied."),b;var w=n.render(b),x=w.popper,T=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,t._tippy=b,x._tippy=b;var I=S.map(function(v){return v.fn(b)}),A=t.hasAttribute("aria-expanded");return be(),Y(),C(),_("onCreate",[b]),n.showOnCreate&&Jt(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&D().addEventListener("mousemove",m)}),b;function B(){var v=b.props.touch;return Array.isArray(v)?v:[v,0]}function P(){return B()[0]==="hold"}function F(){var v;return!!((v=b.props.render)!=null&&v.$$tippy)}function V(){return y||t}function D(){var v=V().parentNode;return v?OT(v):document}function $(){return Wl(x)}function E(v){return b.state.isMounted&&!b.state.isVisible||Dt.isTouch||u&&u.type==="focus"?0:Rl(b.props.delay,v?0:1,rt.delay)}function C(v){v===void 0&&(v=!1),x.style.pointerEvents=b.props.interactive&&!v?"":"none",x.style.zIndex=""+b.props.zIndex}function _(v,z,K){if(K===void 0&&(K=!0),I.forEach(function(ee){ee[v]&&ee[v].apply(ee,z)}),K){var X;(X=b.props)[v].apply(X,z)}}function W(){var v=b.props.aria;if(v.content){var z="aria-"+v.content,K=x.id,X=Cr(b.props.triggerTarget||t);X.forEach(function(ee){var se=ee.getAttribute(z);if(b.state.isVisible)ee.setAttribute(z,se?se+" "+K:K);else{var pe=se&&se.replace(K,"").trim();pe?ee.setAttribute(z,pe):ee.removeAttribute(z)}})}}function Y(){if(!(A||!b.props.aria.expanded)){var v=Cr(b.props.triggerTarget||t);v.forEach(function(z){b.props.interactive?z.setAttribute("aria-expanded",b.state.isVisible&&z===V()?"true":"false"):z.removeAttribute("aria-expanded")})}}function ie(){D().removeEventListener("mousemove",m),Do=Do.filter(function(v){return v!==m})}function de(v){if(!(Dt.isTouch&&(c||v.type==="mousedown"))){var z=v.composedPath&&v.composedPath()[0]||v.target;if(!(b.props.interactive&&ah(x,z))){if(Cr(b.props.triggerTarget||t).some(function(K){return ah(K,z)})){if(Dt.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else _("onClickOutside",[b,v]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout(function(){l=!1}),b.state.isMounted||j())}}}function he(){c=!0}function oe(){c=!1}function ye(){var v=D();v.addEventListener("mousedown",de,!0),v.addEventListener("touchend",de,zn),v.addEventListener("touchstart",oe,zn),v.addEventListener("touchmove",he,zn)}function j(){var v=D();v.removeEventListener("mousedown",de,!0),v.removeEventListener("touchend",de,zn),v.removeEventListener("touchstart",oe,zn),v.removeEventListener("touchmove",he,zn)}function Z(v,z){re(v,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&z()})}function ue(v,z){re(v,z)}function re(v,z){var K=$().box;function X(ee){ee.target===K&&(Fl(K,"remove",X),z())}if(v===0)return z();Fl(K,"remove",f),Fl(K,"add",X),f=X}function fe(v,z,K){K===void 0&&(K=!1);var X=Cr(b.props.triggerTarget||t);X.forEach(function(ee){ee.addEventListener(v,z,K),p.push({node:ee,eventType:v,handler:z,options:K})})}function be(){P()&&(fe("touchstart",ut,{passive:!0}),fe("touchend",gn,{passive:!0})),bT(b.props.trigger).forEach(function(v){if(v!=="manual")switch(fe(v,ut),v){case"mouseenter":fe("mouseleave",gn);break;case"focus":fe(BT?"focusout":"blur",yn);break;case"focusin":fe("focusout",yn);break}})}function Oe(){p.forEach(function(v){var z=v.node,K=v.eventType,X=v.handler,ee=v.options;z.removeEventListener(K,X,ee)}),p=[]}function ut(v){var z,K=!1;if(!(!b.state.isEnabled||Kt(v)||l)){var X=((z=u)==null?void 0:z.type)==="focus";u=v,y=v.currentTarget,Y(),!b.state.isVisible&&wT(v)&&Do.forEach(function(ee){return ee(v)}),v.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?K=!0:Jt(v),v.type==="click"&&(s=!K),K&&!X&&It(v)}}function Er(v){var z=v.target,K=V().contains(z)||x.contains(z);if(!(v.type==="mousemove"&&K)){var X=_t().concat(x).map(function(ee){var se,pe=ee._tippy,ve=(se=pe.popperInstance)==null?void 0:se.state;return ve?{popperRect:ee.getBoundingClientRect(),popperState:ve,props:n}:null}).filter(Boolean);MT(X,v)&&(ie(),It(v))}}function gn(v){var z=Kt(v)||b.props.trigger.indexOf("click")>=0&&s;if(!z){if(b.props.interactive){b.hideWithInteractivity(v);return}It(v)}}function yn(v){b.props.trigger.indexOf("focusin")<0&&v.target!==V()||b.props.interactive&&v.relatedTarget&&x.contains(v.relatedTarget)||It(v)}function Kt(v){return Dt.isTouch?P()!==v.type.indexOf("touch")>=0:!1}function vt(){ft();var v=b.props,z=v.popperOptions,K=v.placement,X=v.offset,ee=v.getReferenceClientRect,se=v.moveTransition,pe=F()?Wl(x).arrow:null,ve=ee?{getBoundingClientRect:ee,contextElement:ee.contextElement||V()}:t,qe={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(kn){var Pt=kn.state;if(F()){var Si=$(),ta=Si.box;["placement","reference-hidden","escaped"].forEach(function(Ro){Ro==="placement"?ta.setAttribute("data-placement",Pt.placement):Pt.attributes.popper["data-popper-"+Ro]?ta.setAttribute("data-"+Ro,""):ta.removeAttribute("data-"+Ro)}),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];F()&&pe&&it.push({name:"arrow",options:{element:pe,padding:3}}),it.push.apply(it,(z==null?void 0:z.modifiers)||[]),b.popperInstance=hT(ve,x,Object.assign({},z,{placement:K,onFirstUpdate:h,modifiers:it}))}function ft(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function ht(){var v=b.props.appendTo,z,K=V();b.props.interactive&&v===nh||v==="parent"?z=K.parentNode:z=rh(v,[K]),z.contains(x)||z.appendChild(x),b.state.isMounted=!0,vt(),process.env.NODE_ENV!=="production"&&Ut(b.props.interactive&&v===rt.appendTo&&K.nextElementSibling!==x,["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 _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],te=U[1];Dt.isTouch&&X==="hold"&&te&&(L=te),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 $r(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Nr(w){if(process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Er("setProps")),!b.state.isDestroyed){V("onBeforeUpdate",[b,w]),Oe();var L=b.props,U=hh(t,Object.assign({},L,ih(w),{ignoreAttributes:!0}));b.props=U,be(),L.interactiveDebounce!==U.interactiveDebounce&&(ie(),m=nh(Tr,U.interactiveDebounce)),L.triggerTarget&&!U.triggerTarget?Or(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 Br(w){b.setProps({content:w})}function M(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Er("show"));var w=b.state.isVisible,L=b.state.isDestroyed,U=!b.state.isEnabled,X=Dt.isTouch&&!b.props.touch,te=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],te),oh([kn,Pt],"visible")}H(),G(),rh(Wl,b),(it=b.popperInstance)==null||it.forceUpdate(),V("onMount",[b]),b.props.animation&&j()&&ue(te,function(){b.state.isShown=!0,V("onShown",[b])})}},ht()}}function E(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Er("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 te=N(),se=te.box,pe=te.content;b.props.animation&&(Ll([se,pe],X),oh([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,Er("hideWithInteractivity")),B().addEventListener("mousemove",m),rh(Ao,m),m(w)}function q(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Er("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 ee(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Er("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),Oe(),delete t._tippy,b.state.isDestroyed=!0,V("onDestroy",[b]))}}function Mr(t,e){e===void 0&&(e={});var n=rt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(MT(t),ph(e,n)),wT();var r=Object.assign({},e,{plugins:n}),i=yT(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.",`
108
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function _t(){return Ao(x.querySelectorAll("[data-tippy-root]"))}function Jt(v){b.clearDelayTimeouts(),v&&_("onTrigger",[b,v]),ye();var z=E(!0),K=B(),X=K[0],ee=K[1];Dt.isTouch&&X==="hold"&&ee&&(z=ee),z?r=setTimeout(function(){b.show()},z):b.show()}function It(v){if(b.clearDelayTimeouts(),_("onUntrigger",[b,v]),!b.state.isVisible){j();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(v.type)>=0&&s)){var z=E(!1);z?i=setTimeout(function(){b.state.isVisible&&b.hide()},z):o=requestAnimationFrame(function(){b.hide()})}}function jn(){b.state.isEnabled=!0}function bn(){b.hide(),b.state.isEnabled=!1}function Tr(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function $r(v){if(process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("setProps")),!b.state.isDestroyed){_("onBeforeUpdate",[b,v]),Oe();var z=b.props,K=mh(t,Object.assign({},z,sh(v),{ignoreAttributes:!0}));b.props=K,be(),z.interactiveDebounce!==K.interactiveDebounce&&(ie(),m=ih(Er,K.interactiveDebounce)),z.triggerTarget&&!K.triggerTarget?Cr(z.triggerTarget).forEach(function(X){X.removeAttribute("aria-expanded")}):K.triggerTarget&&t.removeAttribute("aria-expanded"),Y(),C(),T&&T(z,K),b.popperInstance&&(vt(),_t().forEach(function(X){requestAnimationFrame(X._tippy.popperInstance.forceUpdate)})),_("onAfterUpdate",[b,v])}}function Nr(v){b.setProps({content:v})}function M(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("show"));var v=b.state.isVisible,z=b.state.isDestroyed,K=!b.state.isEnabled,X=Dt.isTouch&&!b.props.touch,ee=Rl(b.props.duration,0,rt.duration);if(!(v||z||K||X)&&!V().hasAttribute("disabled")&&(_("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,F()&&(x.style.visibility="visible"),C(),ye(),b.state.isMounted||(x.style.transition="none"),F()){var se=$(),pe=se.box,ve=se.content;zl([pe,ve],0)}h=function(){var it;if(!(!b.state.isVisible||d)){if(d=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,F()&&b.props.animation){var Hn=$(),kn=Hn.box,Pt=Hn.content;zl([kn,Pt],ee),lh([kn,Pt],"visible")}W(),Y(),oh(ql,b),(it=b.popperInstance)==null||it.forceUpdate(),_("onMount",[b]),b.props.animation&&F()&&ue(ee,function(){b.state.isShown=!0,_("onShown",[b])})}},ht()}}function O(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("hide"));var v=!b.state.isVisible,z=b.state.isDestroyed,K=!b.state.isEnabled,X=Rl(b.props.duration,1,rt.duration);if(!(v||z||K)&&(_("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,F()&&(x.style.visibility="hidden"),ie(),j(),C(!0),F()){var ee=$(),se=ee.box,pe=ee.content;b.props.animation&&(zl([se,pe],X),lh([se,pe],"hidden"))}W(),Y(),b.props.animation?F()&&Z(X,b.unmount):b.unmount()}}function R(v){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("hideWithInteractivity")),D().addEventListener("mousemove",m),oh(Do,m),m(v)}function U(){process.env.NODE_ENV!=="production"&&Ut(b.state.isDestroyed,Or("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(ft(),_t().forEach(function(v){v._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),ql=ql.filter(function(v){return v!==b}),b.state.isMounted=!1,_("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,_("onDestroy",[b]))}}function Mr(t,e){e===void 0&&(e={});var n=rt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(VT(t),gh(e,n)),$T();var r=Object.assign({},e,{plugins:n}),i=CT(t);if(process.env.NODE_ENV!=="production"){var o=vi(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 l=i.reduce(function(a,d){var u=d&&VT(d,r);return u&&a.push(u),a},[]);return xi(t)?l[0]:l}Mr.defaultProps=rt,Mr.setDefaultProps=NT,Mr.currentInput=Dt,Object.assign({},_f,{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)}}),Mr.setDefaultProps({render:yh});class _T{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),g=this.element.contains(document.activeElement);return!(!(l.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: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:g}=l,{selection:y}=m;if(g||!a&&!d)return;this.createTooltip();const{ranges:x}=y,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(IE(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 Nf(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=Mr(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 bh=t=>new ze({key:typeof t.pluginKey=="string"?new yt(t.pluginKey):t.pluginKey,view:e=>new _T({view:e,...t})});Re.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[bh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class IT{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=Mr(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)||(()=>Nf(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 kh=t=>new ze({key:typeof t.pluginKey=="string"?new yt(t.pluginKey):t.pluginKey,view:e=>new IT({view:e,...t})});Re.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[kh({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(bh({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 vh(t){return c.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class PT extends eM{constructor(e={}){return super(e),this.vueRenderers=c.reactive(new Map),this.contentComponent=null,this.reactiveState=vh(this.view.state),this.reactiveExtensionStorage=vh(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 RT=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(kh({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 LT=(t={})=>{const e=c.shallowRef();return c.onMounted(()=>{e.value=new PT(t)}),c.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},zT=/^\s*>\s$/,FT=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:zT,type:this.type})]}}),jT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,HT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,WT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,qT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,UT=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[kr({find:jT,type:this.type}),kr({find:WT,type:this.type})]},addPasteRules(){return[vr({find:HT,type:this.type}),vr({find:qT,type:this.type})]}}),KT=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)}}}),xh=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)}}}}),wh=/^\s*([-+*])\s$/,JT=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(KT.name,this.editor.getAttributes(xh.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:wh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=fi({find:wh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(xh.name),editor:this.editor})),[t]}}),GT=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,YT=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,ZT=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[kr({find:GT,type:this.type})]},addPasteRules(){return[vr({find:YT,type:this.type})]}}),XT=/^```([a-z]+)?[\s\n]$/,QT=/^~~~([a-z]+)?[\s\n]$/,e$=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(`
113
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=i.reduce(function(c,d){var u=d&&FT(d,r);return u&&c.push(u),c},[]);return vi(t)?l[0]:l}Mr.defaultProps=rt,Mr.setDefaultProps=PT,Mr.currentInput=Dt,Object.assign({},Pf,{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)}}),Mr.setDefaultProps({render:kh});class jT{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:c,from:d,to:u})=>{const{doc:f,selection:h}=c,{empty:p}=h,m=!f.textBetween(d,u).length&&wl(c.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 c;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,c)=>{const d=!(c!=null&&c.selection.eq(l.state.selection)),u=!(c!=null&&c.doc.eq(l.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,u,c)},this.updateDelay))},this.updateHandler=(l,c,d,u)=>{var f,h,p;const{state:m,composing:y}=l,{selection:g}=m;if(y||!c&&!d)return;this.createTooltip();const{ranges:S}=g,N=Math.min(...S.map(x=>x.$from.pos)),b=Math.max(...S.map(x=>x.$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:N,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(H2(m.selection)){let x=l.nodeDOM(N);const T=x.dataset.nodeViewWrapper?x:x.querySelector("[data-node-view-wrapper]");if(T&&(x=T.firstChild),x)return x.getBoundingClientRect()}return Af(l,N,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=Mr(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 xh=t=>new ze({key:typeof t.pluginKey=="string"?new yt(t.pluginKey):t.pluginKey,view:e=>new jT({view:e,...t})});Re.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[xh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class HT{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{const{selection:c}=l,{$anchor:d,empty:u}=c,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=Mr(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:c}=s,{from:d,to:u}=c;if(n&&n.doc.eq(l)&&n.selection.eq(c))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)||(()=>Af(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 vh=t=>new ze({key:typeof t.pluginKey=="string"?new yt(t.pluginKey):t.pluginKey,view:e=>new HT({view:e,...t})});Re.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[vh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),a.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=a.ref(null);return a.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:l}=t;i.registerPlugin(xh({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:l}))}),a.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return a.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function wh(t){return a.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class WT extends lE{constructor(e={}){return super(e),this.vueRenderers=a.reactive(new Map),this.contentComponent=null,this.reactiveState=wh(this.view.state),this.reactiveExtensionStorage=wh(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),a.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 qT=a.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=a.ref(),n=a.getCurrentInstance();return a.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&a.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=a.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),a.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=a.h(a.Teleport,{to:e.teleportElement,key:e.id},a.h(e.component,{ref:e.id,...e.props}));t.push(n)}),a.h("div",{ref:e=>{this.rootEl=e}},...t)}});a.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=a.ref(null);return a.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(vh({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),a.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return a.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),a.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return a.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),a.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return a.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 UT=(t={})=>{const e=a.shallowRef();return a.onMounted(()=>{e.value=new WT(t)}),a.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},KT=/^\s*>\s$/,JT=tt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Me(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:KT,type:this.type})]}}),YT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,GT=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ZT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,XT=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,QT=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",Me(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:YT,type:this.type}),br({find:ZT,type:this.type})]},addPasteRules(){return[kr({find:GT,type:this.type}),kr({find:XT,type:this.type})]}}),e$=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",Me(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)}}}),Sh=Nt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Me(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Mo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Ch=/^\s*([-+*])\s$/,t$=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",Me(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(e$.name,this.editor.getAttributes(Sh.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:Ch,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=fi({find:Ch,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Sh.name),editor:this.editor})),[t]}}),n$=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,r$=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,i$=Nt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Me(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:n$,type:this.type})]},addPasteRules(){return[kr({find:r$,type:this.type})]}}),o$=/^```([a-z]+)?[\s\n]$/,s$=/^~~~([a-z]+)?[\s\n]$/,l$=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",Me(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: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:XT,type:this.type,getAttributes:t=>({language:t[1]})}),Ml({find:QT,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}}})]}}),t$=tt.create({name:"doc",topNode:!0,content:"block+"});function n$(t={}){return new ze({view(e){return new r$(e,t)}})}class r${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=Td(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 i$=Re.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[n$(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||!o$(e)||!s$(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 o$(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 s$(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 l$(){return new ze({props:{decorations:u$,createSelectionBetween(t,e,n){return e.pos==n.pos&&ve.valid(n)?new ve(n):null},handleClick:c$,handleKeyDown:a$,handleDOMEvents:{beforeinput:d$}}})}const a$=ef({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 c$(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 d$(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 u$(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 f$=Re.create({name:"gapCursor",addProseMirrorPlugins(){return[l$()]},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}}}),h$=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()}}}),p$=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 m$(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 Sh(e):Be.empty};var Sh=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 Sh([]);var m$=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 g$=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>b$&&(l=y$(l,d),s-=d),new vt(l.append(o),s)}remapping(e,n){let r=new or;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 g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(a+1,p));y&&l++,r.push(new Vt(m,g,y))}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()>g$&&(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 y$(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 b$=20;function k$(t,e,n,r){let i=n.getMeta(zn),o;if(i)return i.historyState;n.getMeta(w$)&&(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,Ch(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||!v$(n,t.prevRanges)),d=s?Ul(t.prevRanges,n.mapping):Ch(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 v$(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 Ch(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 x$(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,Oh=null;function _o(t){let e=t.plugins;if(Oh!=e){Kl=!1,Oh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Kl=!0;break}}return Kl}const zn=new yt("history"),w$=new yt("closeHistory");function S$(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 k$(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Mh:r=="historyRedo"?Th:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Eh(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=x$(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Mh=Eh(!1,!0),Th=Eh(!0,!0),C$=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Mh(t,e),redo:()=>({state:t,dispatch:e})=>Th(t,e)}},addProseMirrorPlugins(){return[S$(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()}}}),O$=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[tM({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),E$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,M$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,T$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,$$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,N$=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[kr({find:E$,type:this.type}),kr({find:T$,type:this.type})]},addPasteRules(){return[vr({find:M$,type:this.type}),vr({find:$$,type:this.type})]}}),B$=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)}}}),A$=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)}}}),$h=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)}}}}),Nh=/^(\d+)\.\s$/,D$=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(A$.name,this.editor.getAttributes($h.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:Nh,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:Nh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($h.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),V$=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()}}}),_$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,I$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,P$=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[kr({find:_$,type:this.type})]},addPasteRules(){return[vr({find:I$,type:this.type})]}}),R$=tt.create({name:"text",group:"inline"}),L$=Re.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,l,a,d,u,f,h,p,m,g,y,v;const x=[];return this.options.blockquote!==!1&&x.push(FT.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(UT.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(JT.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(ZT.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(e$.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(t$.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(i$.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(f$.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&x.push(h$.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&x.push(p$.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(C$.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(O$.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(N$.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(B$.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(D$.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(V$.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(P$.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(R$.configure((v=this.options)===null||v===void 0?void 0:v.text)),x}}),z$=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 g=[this.options.emptyNodeClass];u&&g.push(this.options.emptyEditorClass);const y=et.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}),Ce.create(t,o)}}})]}}),F$={},j$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},H$=[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 W$(t,e){return c.openBlock(),c.createElementBlock("svg",j$,H$)}const q$=ce(F$,[["render",W$]]),U$={},K$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},J$=[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 G$(t,e){return c.openBlock(),c.createElementBlock("svg",K$,J$)}const Y$=ce(U$,[["render",G$]]),Z$={},X$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Q$=[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 eN(t,e){return c.openBlock(),c.createElementBlock("svg",X$,Q$)}const tN=ce(Z$,[["render",eN]]),nN={},rN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},iN=[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 oN(t,e){return c.openBlock(),c.createElementBlock("svg",rN,iN)}const sN=ce(nN,[["render",oN]]),lN={},aN={fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},cN=[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 dN(t,e){return c.openBlock(),c.createElementBlock("svg",aN,cN)}const uN=ce(lN,[["render",dN]]),fN={},hN={fill:"#000000",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},pN=[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 mN(t,e){return c.openBlock(),c.createElementBlock("svg",hN,pN)}const gN=ce(fN,[["render",mN]]),yN={},bN={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"},kN=[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[Tl({find:o$,type:this.type,getAttributes:t=>({language:t[1]})}),Tl({find:s$,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}}})]}}),a$=tt.create({name:"doc",topNode:!0,content:"block+"});function c$(t={}){return new ze({view(e){return new d$(e,t)}})}class d${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,c=e.nodeAfter;if(l||c){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=l?u.bottom:u.top;l&&c&&(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=Nd(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 u$=Re.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[c$(this.options)]}});class xe extends le{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return xe.valid(r)?new xe(r):le.near(r)}content(){return q.empty}eq(e){return e instanceof xe&&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 xe(e.resolve(n.pos))}getBookmark(){return new Ul(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!f$(e)||!h$(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&&xe.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 c=e.doc.resolve(i);if(xe.valid(c))return c}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!G.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(xe.valid(l))return l}return null}}}xe.prototype.visible=!1,xe.findFrom=xe.findGapCursorFrom,le.jsonID("gapcursor",xe);class Ul{constructor(e){this.pos=e}map(e){return new Ul(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return xe.valid(n)?new xe(n):le.near(n)}}function f$(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 h$(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 p$(){return new ze({props:{decorations:b$,createSelectionBetween(t,e,n){return e.pos==n.pos&&xe.valid(n)?new xe(n):null},handleClick:g$,handleKeyDown:m$,handleDOMEvents:{beforeinput:y$}}})}const m$=nf({ArrowLeft:Vo("horiz",-1),ArrowRight:Vo("horiz",1),ArrowUp:Vo("vert",-1),ArrowDown:Vo("vert",1)});function Vo(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,c=s.empty;if(s instanceof ne){if(!o.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=xe.findGapCursorFrom(l,e,c);return d?(i&&i(r.tr.setSelection(new xe(d))),!0):!1}}function g$(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!xe.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&G.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new xe(r))),!0)}function y$(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof xe))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=L.empty;for(let s=r.length-1;s>=0;s--)i=L.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new q(i,0,0));return o.setSelection(ne.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function b$(t){if(!(t.selection instanceof xe))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 k$=Re.create({name:"gapCursor",addProseMirrorPlugins(){return[p$()]},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}}}),x$=tt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Me(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,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&s){const f=c.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()}}}),v$=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]}`,Me(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=>Tl({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var _o=200,Be=function(){};Be.prototype.append=function(e){return e.length?(e=Be.from(e),!this.length&&e||e.length<_o&&this.leafAppend(e)||this.length<_o&&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 w$(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 Oh(e):Be.empty};var Oh=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 c=o;c<s;c++)if(i(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var c=o-1;c>=s;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=_o)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=_o)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 Oh([]);var w$=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 S$=500;class xt{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,c,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,c=new xt(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,c=!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=c&&c.merge(h))&&(h=p,u?o.pop():l=l.slice(0,l.length-1)),o.push(h),n&&(s++,n=void 0),i||(c=h)}let d=s-r.depth;return d>O$&&(l=C$(l,d),s-=d),new xt(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 xt(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 c=n;this.items.forEach(h=>{let p=o.getMirror(--c);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(c+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 xt(u,l);return f.emptyItemCount()>S$&&(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 c=s.step.map(n.slice(r)),d=c&&c.getMap();if(r--,d&&n.appendMap(d,r),c){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new Vt(d.invert(),c,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 xt(Be.from(i.reverse()),o)}}xt.empty=new xt(Be.empty,0);function C$(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 O$=20;function M$(t,e,n,r){let i=n.getMeta(Fn),o;if(i)return i.historyState;n.getMeta($$)&&(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(Fn))return s.getMeta(Fn).redo?new mn(t.done.addTransform(n,void 0,r,Io(e)),t.undone,Mh(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new mn(t.done,t.undone.addTransform(n,void 0,r,Io(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!E$(n,t.prevRanges)),d=s?Kl(t.prevRanges,n.mapping):Mh(n.mapping.maps[n.steps.length-1]);return new mn(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,Io(e)),xt.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),Kl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new mn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Kl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function E$(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 Mh(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Kl(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 T$(t,e,n){let r=Io(e),i=Fn.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),c=new mn(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(Fn,{redo:n,historyState:c})}let Jl=!1,Eh=null;function Io(t){let e=t.plugins;if(Eh!=e){Jl=!1,Eh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Jl=!0;break}}return Jl}const Fn=new yt("history"),$$=new yt("closeHistory");function N$(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new ze({key:Fn,state:{init(){return new mn(xt.empty,xt.empty,null,0,-1)},apply(e,n,r){return M$(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?$h:r=="historyRedo"?Nh:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Th(t,e){return(n,r)=>{let i=Fn.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=T$(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const $h=Th(!1,!0),Nh=Th(!0,!0),B$=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>$h(t,e),redo:()=>({state:t,dispatch:e})=>Nh(t,e)}},addProseMirrorPlugins(){return[N$(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()}}}),A$=tt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Me(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,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(ne.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(G.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(c,d),i.setSelection(ne.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[aE({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),D$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,V$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,_$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,I$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,P$=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",Me(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:D$,type:this.type}),br({find:_$,type:this.type})]},addPasteRules(){return[kr({find:V$,type:this.type}),kr({find:I$,type:this.type})]}}),R$=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",Me(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)}}}),L$=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",Me(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)}}}),Bh=Nt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Me(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Mo(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Ah=/^(\d+)\.\s$/,z$=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",Me(this.options.HTMLAttributes,n),0]:["ol",Me(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(L$.name,this.editor.getAttributes(Bh.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:Ah,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:Ah,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Bh.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),F$=tt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Me(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),j$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,H$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,W$=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",Me(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:j$,type:this.type})]},addPasteRules(){return[kr({find:H$,type:this.type})]}}),q$=tt.create({name:"text",group:"inline"}),U$=Re.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,l,c,d,u,f,h,p,m,y,g,k;const S=[];return this.options.blockquote!==!1&&S.push(JT.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&S.push(QT.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&S.push(t$.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&S.push(i$.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&S.push(l$.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&S.push(a$.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&S.push(u$.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&S.push(k$.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&S.push(x$.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&S.push(v$.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&S.push(B$.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&S.push(A$.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&S.push(P$.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&S.push(R$.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&S.push(z$.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&S.push(F$.configure((y=this.options)===null||y===void 0?void 0:y.paragraph)),this.options.strike!==!1&&S.push(W$.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&S.push(q$.configure((k=this.options)===null||k===void 0?void 0:k.text)),S}}),K$=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,c=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||!c);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)}}})]}}),J$={},Y$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},G$=[a.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 Z$(t,e){return a.openBlock(),a.createElementBlock("svg",Y$,G$)}const X$=ce(J$,[["render",Z$]]),Q$={},eN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},tN=[a.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 nN(t,e){return a.openBlock(),a.createElementBlock("svg",eN,tN)}const rN=ce(Q$,[["render",nN]]),iN={},oN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},sN=[a.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 lN(t,e){return a.openBlock(),a.createElementBlock("svg",oN,sN)}const aN=ce(iN,[["render",lN]]),cN={},dN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},uN=[a.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 fN(t,e){return a.openBlock(),a.createElementBlock("svg",dN,uN)}const hN=ce(cN,[["render",fN]]),pN={},mN={fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},gN=[a.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 yN(t,e){return a.openBlock(),a.createElementBlock("svg",mN,gN)}const bN=ce(pN,[["render",yN]]),kN={},xN={fill:"#000000",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},vN=[a.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 wN(t,e){return a.openBlock(),a.createElementBlock("svg",xN,vN)}const SN=ce(kN,[["render",wN]]),CN={},ON={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"},MN=[a.createElementVNode("g",null,[a.createElementVNode("g",null,[a.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 vN(t,e){return c.openBlock(),c.createElementBlock("svg",bN,kN)}const xN=ce(yN,[["render",vN]]),wN={},SN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},CN=[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 ON(t,e){return c.openBlock(),c.createElementBlock("svg",SN,CN)}const EN=ce(wN,[["render",ON]]),MN={class:"py-1 px-1 border-b"},TN={class:"flex gap-px"},$N=["onClick"],NN={key:1,class:"text-sm"},BN={class:"max-h-72 w-full overflow-auto px-4 py-3"},AN=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:gN,smallIcon:!0,disableCheck:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:uN,smallIcon:!0,disableCheck:!0},{method:"setParagraph",type:"chain",label:"paragraph",icon:xN,smallIcon:!0,disableCheck:!1},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:q$,disableCheck:!1},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:Y$,disableCheck:!1},{method:"undo",type:"chain",label:"undo",icon:tN,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:sN,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:EN,disableCheck:!0}],o=e,s=LT({content:n.modelValue,extensions:[L$,z$.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(Q).theme]])},[c.createElementVNode("div",MN,[c.createElementVNode("div",TN,[(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",NN,c.toDisplayString(c.unref(Ja).capitalize(f.label)),1))],10,$N)),64))])]),c.createElementVNode("div",BN,[c.createVNode(c.unref(RT),{editor:c.unref(s)},null,8,["editor"])])],2)):c.createCommentVNode("",!0)}}),DN={},VN={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_N=[c.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function IN(t,e){return c.openBlock(),c.createElementBlock("svg",VN,_N)}const PN=ce(DN,[["render",IN]]),RN={},LN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},zN=[c.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function FN(t,e){return c.openBlock(),c.createElementBlock("svg",LN,zN)}const jN=ce(RN,[["render",FN]]),HN={},WN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},qN=[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 UN(t,e){return c.openBlock(),c.createElementBlock("svg",WN,qN)}const KN=ce(HN,[["render",UN]]),JN=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(PN,{key:0,class:"w-2.5 h-2.5"})):c.createCommentVNode("",!0),t.incomplete?(c.openBlock(),c.createBlock(jN,{key:1,class:"w-2.5 h-2.5 opacity-80"})):c.createCommentVNode("",!0),t.partially?(c.openBlock(),c.createBlock(KN,{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(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(l.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.day),1)])],2)],6)],2))}};var Bh={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",g="Invalid Date",y=/^(\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(y);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()!==g},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||g;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})})(Bh);var GN=Bh.exports;const K=Wr(GN);var Ah={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)}}})})(Ah);var YN=Ah.exports;const ZN=Wr(YN);var Dh={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))}}})})(Dh);var XN=Dh.exports;const QN=Wr(XN),eB={class:"w-full dark:text-gray-400"},tB={class:"flex justify-between items-center mb-3"},nB={class:"flex"},rB={class:"font-medium"},iB={class:"flex"},oB={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},sB={class:"flex justify-center text-sm"},Vh=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,maxDate:{},minDate:{},week:Boolean,initDates:{}},emits:["update:modelValue"],setup(t,{emit:e}){K.extend(QN),K.extend(ZN);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 g(_){var B;if(n.range&&((B=n.modelValue)==null?void 0:B.length)==2)return K(_).isSame(K(n.modelValue[1]),"day")}function y(_){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",eB,[c.createElementVNode("div",tB,[c.createElementVNode("div",nB,[c.createVNode(Wc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:O=>b(N)},null,8,["onClick"]),c.createVNode(qc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:O=>x(N)},null,8,["onClick"])]),c.createElementVNode("div",rB,c.toDisplayString(r.value[N].format("YYYY MMMM")),1),c.createElementVNode("div",iB,[c.createVNode(Kc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:O=>T(N)},null,8,["onClick"]),c.createVNode(Uc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:O=>S(N)},null,8,["onClick"])])]),c.createElementVNode("div",oB,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(7,O=>{var V;return c.createElementVNode("div",sB,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)&&!y(O)?s(O):null,onMouseover:V=>D(O),today:f(O),selected:h(O),firstDay:m(O)||R(O),lastDay:g(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)&&!y(O)?s(O):null,today:f(O),selected:h(O),firstDay:m(O)||R(O),lastDay:g(O)||F(O),between:p(O),disabled:v(O)||y(O),off:v(O)||y(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)||!y(O)?s(O):null,onMouseover:V=>D(O),today:f(O),selected:h(O),firstDay:m(O)||R(O),lastDay:g(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))}}),lB={},aB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},cB=[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 dB(t,e){return c.openBlock(),c.createElementBlock("svg",aB,cB)}const uB=ce(lB,[["render",dB]]),fB={},hB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},pB=[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 mB(t,e){return c.openBlock(),c.createElementBlock("svg",hB,pB)}const gB=ce(fB,[["render",mB]]),yB={class:"flex gap-3"},bB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},kB=["onClick"],vB=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(Zn,{disabled:t.disabled,maxWidth:"1280px"},{content:c.withCtx(()=>[c.createElementVNode("div",yB,[t.shortcuts?(c.openBlock(),c.createElementBlock("div",bB,[(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,kB))),256))])):c.createCommentVNode("",!0),c.createVNode(Vh,{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(uB,{key:0,class:"dark:text-gray-400"})):(c.openBlock(),c.createBlock(gB,{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"]))}}),xB=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(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))}}),wB={class:"absolute inset-0 flex items-center justify-center py-12"},SB={class:"text-lg font-medium dark:text-gray-300"},CB={key:0,class:"flex justify-end px-6 pb-4"},OB=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",wB,[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",SB,c.toDisplayString(t.title),1),c.createElementVNode("span",{class:"cursor-pointer",onClick:o},[c.createVNode(Yn,{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",CB,[c.renderSlot(f.$slots,"buttons")])):c.createCommentVNode("",!0)],2)])],2))}}),EB={class:"wpic-tabs flex border-b-2 dark:border-gray-930 overflow-x-auto overflow-y-hidden"},MB=["onClick"],TB=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",EB,[(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,MB))),128))]),c.createElementVNode("div",null,[c.renderSlot(a.$slots,"default")])],64))}}),$B=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)}}),NB={},BB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},AB=[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 DB(t,e){return c.openBlock(),c.createElementBlock("svg",BB,AB)}const VB=ce(NB,[["render",DB]]),_B={},IB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},PB=[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 RB(t,e){return c.openBlock(),c.createElementBlock("svg",IB,PB)}const LB=ce(_B,[["render",RB]]),zB={},FB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},jB=[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 HB(t,e){return c.openBlock(),c.createElementBlock("svg",FB,jB)}const WB=ce(zB,[["render",HB]]),qB={},UB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},KB=[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 JB(t,e){return c.openBlock(),c.createElementBlock("svg",UB,KB)}const GB=ce(qB,[["render",JB]]),YB={class:"w-6"},ZB={class:"flex-1"},XB={key:0,class:"mb-2"},QB=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",YB,[t.warning?(c.openBlock(),c.createBlock(VB,{key:0,class:"w-full aspect-square"})):t.info?(c.openBlock(),c.createBlock(LB,{key:1,class:"w-full aspect-square"})):t.success?(c.openBlock(),c.createBlock(WB,{key:2,class:"w-full aspect-square"})):t.error?(c.openBlock(),c.createBlock(GB,{key:3,class:"w-full aspect-square"})):c.createCommentVNode("",!0)]),c.createElementVNode("div",ZB,[t.title?(c.openBlock(),c.createElementBlock("div",XB,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),_h=c.ref(""),Ih=c.ref(""),Ph=c.ref(!1),Rh=c.ref(!1);let Lh=()=>{},zh=()=>{};function Yl(){const t=({title:i,text:o,positive:s=!1,negative:l=!1,onConfirm:a,onCancel:d})=>{_h.value=i,Ih.value=o,Ph.value=s,Rh.value=l,Lh=a||(()=>{}),zh=d||(()=>{}),Gl.value=!0},e=()=>{Gl.value=!1};return{visible:Gl,title:_h,text:Ih,positive:Ph,negative:Rh,show:t,onConfirm:()=>{Lh(),e()},onCancel:()=>{zh(),e()}}}const eA={key:0,class:"confirm-modal-overlay z-40"},tA={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},nA={class:"text-lg font-semibold mb-6"},rA={class:"mb-12"},iA={class:"flex justify-end"},Zl={WpicAlert:QB,WpicCalendar:Vh,WpicTextarea:Fc,WpicDialog:OB,WpicSlidePanel:xB,WpicDateField:vB,WpicFormInput:cs,WpicButton:Ni,WpicBadge:JN,WpicTextEditor:AN,WpicInputGroup:ym,WpicButtonGroup:hm,WpicForm:bm,WpicFormField:jc,WpicSpinner:Un,WpicTooltip:Hc,WpicPopover:Zn,WpicChoiceList:zc,WpicCard:pw,WpicCardSection:yw,WpicProgressBar:vw,WpicTag:ww,WpicTagGroup:Sw,WpicPagination:Gw,WpicLoadingPanel:Mw,WpicTable:bS,WpicTableColumn:kS,WpicTabs:TB,WpicTabPane:$B,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",eA,[c.createElementVNode("div",tA,[c.createElementVNode("div",nA,c.toDisplayString(c.unref(n)),1),c.createElementVNode("div",rA,c.toDisplayString(c.unref(r)),1),c.createElementVNode("div",iA,[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 Fh(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?Fh(t[n],e[n]):t[n]=e[n])}const oA={useConfirm:Yl};function sA(t,e){Fh(Q,e);for(const n in Zl)if(Zl.hasOwnProperty(n)){const r=Zl[n];t.component(r.name,r)}}const lA={install:sA,composables:oA,options:Q};Gt.default=lA,Gt.useConfirm=Yl,Object.defineProperties(Gt,{__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 EN(t,e){return a.openBlock(),a.createElementBlock("svg",ON,MN)}const TN=ce(CN,[["render",EN]]),$N={},NN={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},BN=[a.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 AN(t,e){return a.openBlock(),a.createElementBlock("svg",NN,BN)}const DN=ce($N,[["render",AN]]),VN={class:"py-1 px-1 border-b"},_N={class:"flex gap-px"},IN=["onClick"],PN={key:1,class:"text-sm"},RN={class:"max-h-72 w-full overflow-auto px-4 py-3"},LN=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:SN,smallIcon:!0,disableCheck:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:bN,smallIcon:!0,disableCheck:!0},{method:"setParagraph",type:"chain",label:"paragraph",icon:TN,smallIcon:!0,disableCheck:!1},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:X$,disableCheck:!1},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:rN,disableCheck:!1},{method:"undo",type:"chain",label:"undo",icon:aN,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:hN,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:DN,disableCheck:!0}],o=e,s=UT({content:n.modelValue,extensions:[U$,K$.configure({placeholder:"..."})],onUpdate:()=>{o("update:modelValue",s.value.getHTML())}});a.onBeforeUnmount(()=>{s.value.destroy()}),a.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 c(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)=>a.unref(s)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["pt-px relative flex flex-col rounded-sm border",r[a.unref(te).theme]])},[a.createElementVNode("div",VN,[a.createElementVNode("div",_N,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(i,f=>a.createElementVNode("div",{key:f.method,class:a.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded-sm",{"cursor-pointer":!c(f.method,f.type,f.params,f.disableCheck),"is-active text-white bg-zinc-200!":a.unref(s).isActive(f.label)}]),onClick:h=>l(f.method,f.type,f.params)},[f.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(f.icon),{key:0,class:a.normalizeClass(["",{"w-3 h-3":f.smallIcon,"w-4 h-4":!f.smallIcon}])},null,8,["class"])):(a.openBlock(),a.createElementBlock("span",PN,a.toDisplayString(a.unref(cg).capitalize(f.label)),1))],10,IN)),64))])]),a.createElementVNode("div",RN,[a.createVNode(a.unref(qT),{editor:a.unref(s)},null,8,["editor"])])],2)):a.createCommentVNode("",!0)}}),zN={},FN={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},jN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function HN(t,e){return a.openBlock(),a.createElementBlock("svg",FN,jN)}const WN=ce(zN,[["render",HN]]),qN={},UN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},KN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function JN(t,e){return a.openBlock(),a.createElementBlock("svg",UN,KN)}const YN=ce(qN,[["render",JN]]),GN={},ZN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},XN=[a.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1),a.createElementVNode("line",{x1:"7.5",y1:"2",x2:"22",y2:"16",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1),a.createElementVNode("line",{x1:"2",y1:"7.5",x2:"16",y2:"22",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1)];function QN(t,e){return a.openBlock(),a.createElementBlock("svg",ZN,XN)}const eB=ce(GN,[["render",QN]]),tB=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("span",{class:a.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?(a.openBlock(),a.createBlock(WN,{key:0,class:"w-2.5 h-2.5"})):a.createCommentVNode("",!0),t.incomplete?(a.openBlock(),a.createBlock(YN,{key:1,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),t.partially?(a.openBlock(),a.createBlock(eB,{key:2,class:"w-2.5 h-2.5 opacity-80"})):a.createCommentVNode("",!0),a.renderSlot(e.$slots,"default")],2))}}),Yl={__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,c)=>(a.openBlock(),a.createElementBlock("div",{class:a.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}])},[a.createElementVNode("div",{class:a.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[a.unref(te).theme]}`]:t.between,[`${i[a.unref(te).theme]}`]:t.firstDay,[`${o[a.unref(te).theme]}`]:t.lastDay,[`${s[a.unref(te).theme]}`]:t.highlight}]),style:a.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[a.createElementVNode("span",{class:a.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[a.unref(te).theme]}`]:!0,[`${n[a.unref(te).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[a.renderSlot(l.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.day),1)])],2)],6)],2))}};var Dh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Cn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",l="minute",c="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+)?$/,k=/\[([^\]]+)]|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,S={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(D){var $=["th","st","nd","rd"],E=D%100;return"["+D+($[(E-20)%10]||$[E]||$[0])+"]"}},N=function(D,$,E){var C=String(D);return!C||C.length>=$?D:""+Array($+1-C.length).join(E)+D},b={s:N,z:function(D){var $=-D.utcOffset(),E=Math.abs($),C=Math.floor(E/60),_=E%60;return($<=0?"+":"-")+N(C,2,"0")+":"+N(_,2,"0")},m:function D($,E){if($.date()<E.date())return-D(E,$);var C=12*(E.year()-$.year())+(E.month()-$.month()),_=$.clone().add(C,f),W=E-_<0,Y=$.clone().add(C+(W?-1:1),f);return+(-(C+(E-_)/(W?_-Y:Y-_))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:f,y:p,w:u,d,D:m,h:c,m:l,s,ms:o,Q:h}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},w="en",x={};x[w]=S;var T="$isDayjsObject",I=function(D){return D instanceof F||!(!D||!D[T])},A=function D($,E,C){var _;if(!$)return w;if(typeof $=="string"){var W=$.toLowerCase();x[W]&&(_=W),E&&(x[W]=E,_=W);var Y=$.split("-");if(!_&&Y.length>1)return D(Y[0])}else{var ie=$.name;x[ie]=$,_=ie}return!C&&_&&(w=_),_||!C&&w},B=function(D,$){if(I(D))return D.clone();var E=typeof $=="object"?$:{};return E.date=D,E.args=arguments,new F(E)},P=b;P.l=A,P.i=I,P.w=function(D,$){return B(D,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var F=function(){function D(E){this.$L=A(E.locale,null,!0),this.parse(E),this.$x=this.$x||E.x||{},this[T]=!0}var $=D.prototype;return $.parse=function(E){this.$d=function(C){var _=C.date,W=C.utc;if(_===null)return new Date(NaN);if(P.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var Y=_.match(g);if(Y){var ie=Y[2]-1||0,de=(Y[7]||"0").substring(0,3);return W?new Date(Date.UTC(Y[1],ie,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,de)):new Date(Y[1],ie,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,de)}}return new Date(_)}(E),this.init()},$.init=function(){var E=this.$d;this.$y=E.getFullYear(),this.$M=E.getMonth(),this.$D=E.getDate(),this.$W=E.getDay(),this.$H=E.getHours(),this.$m=E.getMinutes(),this.$s=E.getSeconds(),this.$ms=E.getMilliseconds()},$.$utils=function(){return P},$.isValid=function(){return this.$d.toString()!==y},$.isSame=function(E,C){var _=B(E);return this.startOf(C)<=_&&_<=this.endOf(C)},$.isAfter=function(E,C){return B(E)<this.startOf(C)},$.isBefore=function(E,C){return this.endOf(C)<B(E)},$.$g=function(E,C,_){return P.u(E)?this[C]:this.set(_,E)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(E,C){var _=this,W=!!P.u(C)||C,Y=P.p(E),ie=function(re,fe){var be=P.w(_.$u?Date.UTC(_.$y,fe,re):new Date(_.$y,fe,re),_);return W?be:be.endOf(d)},de=function(re,fe){return P.w(_.toDate()[re].apply(_.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(fe)),_)},he=this.$W,oe=this.$M,ye=this.$D,j="set"+(this.$u?"UTC":"");switch(Y){case p:return W?ie(1,0):ie(31,11);case f:return W?ie(1,oe):ie(0,oe+1);case u:var Z=this.$locale().weekStart||0,ue=(he<Z?he+7:he)-Z;return ie(W?ye-ue:ye+(6-ue),oe);case d:case m:return de(j+"Hours",0);case c:return de(j+"Minutes",1);case l:return de(j+"Seconds",2);case s:return de(j+"Milliseconds",3);default:return this.clone()}},$.endOf=function(E){return this.startOf(E,!1)},$.$set=function(E,C){var _,W=P.p(E),Y="set"+(this.$u?"UTC":""),ie=(_={},_[d]=Y+"Date",_[m]=Y+"Date",_[f]=Y+"Month",_[p]=Y+"FullYear",_[c]=Y+"Hours",_[l]=Y+"Minutes",_[s]=Y+"Seconds",_[o]=Y+"Milliseconds",_)[W],de=W===d?this.$D+(C-this.$W):C;if(W===f||W===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},$.set=function(E,C){return this.clone().$set(E,C)},$.get=function(E){return this[P.p(E)]()},$.add=function(E,C){var _,W=this;E=Number(E);var Y=P.p(C),ie=function(oe){var ye=B(W);return P.w(ye.date(ye.date()+Math.round(oe*E)),W)};if(Y===f)return this.set(f,this.$M+E);if(Y===p)return this.set(p,this.$y+E);if(Y===d)return ie(1);if(Y===u)return ie(7);var de=(_={},_[l]=r,_[c]=i,_[s]=n,_)[Y]||1,he=this.$d.getTime()+E*de;return P.w(he,this)},$.subtract=function(E,C){return this.add(-1*E,C)},$.format=function(E){var C=this,_=this.$locale();if(!this.isValid())return _.invalidDate||y;var W=E||"YYYY-MM-DDTHH:mm:ssZ",Y=P.z(this),ie=this.$H,de=this.$m,he=this.$M,oe=_.weekdays,ye=_.months,j=_.meridiem,Z=function(fe,be,Oe,ut){return fe&&(fe[be]||fe(C,W))||Oe[be].slice(0,ut)},ue=function(fe){return P.s(ie%12||12,fe,"0")},re=j||function(fe,be,Oe){var ut=fe<12?"AM":"PM";return Oe?ut.toLowerCase():ut};return W.replace(k,function(fe,be){return be||function(Oe){switch(Oe){case"YY":return String(C.$y).slice(-2);case"YYYY":return P.s(C.$y,4,"0");case"M":return he+1;case"MM":return P.s(he+1,2,"0");case"MMM":return Z(_.monthsShort,he,ye,3);case"MMMM":return Z(ye,he);case"D":return C.$D;case"DD":return P.s(C.$D,2,"0");case"d":return String(C.$W);case"dd":return Z(_.weekdaysMin,C.$W,oe,2);case"ddd":return Z(_.weekdaysShort,C.$W,oe,3);case"dddd":return oe[C.$W];case"H":return String(ie);case"HH":return P.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 P.s(de,2,"0");case"s":return String(C.$s);case"ss":return P.s(C.$s,2,"0");case"SSS":return P.s(C.$ms,3,"0");case"Z":return Y}return null}(fe)||Y.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(E,C,_){var W,Y=this,ie=P.p(C),de=B(E),he=(de.utcOffset()-this.utcOffset())*r,oe=this-de,ye=function(){return P.m(Y,de)};switch(ie){case p:W=ye()/12;break;case f:W=ye();break;case h:W=ye()/3;break;case u:W=(oe-he)/6048e5;break;case d:W=(oe-he)/864e5;break;case c:W=oe/i;break;case l:W=oe/r;break;case s:W=oe/n;break;default:W=oe}return _?W:P.a(W)},$.daysInMonth=function(){return this.endOf(f).$D},$.$locale=function(){return x[this.$L]},$.locale=function(E,C){if(!E)return this.$L;var _=this.clone(),W=A(E,C,!0);return W&&(_.$L=W),_},$.clone=function(){return P.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},D}(),V=F.prototype;return B.prototype=V,[["$ms",o],["$s",s],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(D){V[D[1]]=function($){return this.$g($,D[0],D[1])}}),B.extend=function(D,$){return D.$i||(D($,F,B),D.$i=!0),B},B.locale=A,B.isDayjs=I,B.unix=function(D){return B(1e3*D)},B.en=x[w],B.Ls=x,B.p={},B})})(Dh);var nB=Dh.exports;const H=Wr(nB);var Vh={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Cn,function(){var n="week",r="year";return function(i,o,s){var l=o.prototype;l.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-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(c){return c===void 0&&(c=null),this.week(c)}}})})(Vh);var rB=Vh.exports;const iB=Wr(rB);var _h={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Cn,function(){return function(n,r,i){r.prototype.isBetween=function(o,s,l,c){var d=i(o),u=i(s),f=(c=c||"()")[0]==="(",h=c[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))}}})})(_h);var oB=_h.exports;const sB=Wr(oB),lB={class:"w-full dark:text-gray-400"},aB={class:"flex justify-between items-center mb-3"},cB={class:"flex"},dB={class:"font-medium"},uB={class:"flex"},fB={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},hB={class:"flex justify-center text-sm"},Gl=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,maxDate:{},minDate:{},week:Boolean,initDates:{}},emits:["update:modelValue"],setup(t,{emit:e}){H.extend(sB),H.extend(iB);const n=t,r=a.ref([H(new Date).subtract(1,"month"),H(new Date)]);a.watch(()=>n.initDates,()=>{var V;!n.range&&n.initDates?r.value[0]=H(n.initDates):!n.range&&!n.initDates?r.value[0]=H(new Date):n.range&&((V=n.initDates)==null?void 0:V.length)==2&&(r.value[0]=H(n.initDates[0]),r.value[1]=H(n.initDates[1]),r.value[0].isSame(r.value[1],"month")&&(r.value[1]=H(n.initDates[0]).add(1,"month")))},{immediate:!0,once:!0});const i=e,o=a.computed(()=>n.doubleMonths||n.range?[0,1]:[0]);function s(V){var D,$,E;if(n.week)i("update:modelValue",[H(V).startOf("week"),H(V).endOf("week")]);else if(n.range){if(((D=n.modelValue)==null?void 0:D.length)==0)i("update:modelValue",[V]);else if((($=n.modelValue)==null?void 0:$.length)==2)i("update:modelValue",[V]);else if(((E=n.modelValue)==null?void 0:E.length)==1){let C=[H(n.modelValue[0]),H(V)];C=C.sort((_,W)=>_-W),i("update:modelValue",C)}}else i("update:modelValue",H(V))}function l(V){const D=H(V).daysInMonth(),$=[],E=H(V).startOf("month");for(let C=1;C<=D;C++){let _=E.clone().date(C);$.push(_)}return $}function c(V){return H(V).startOf("month").day()}function d(V,D){const $=H(`${V}-${D}-01`,"YYYY-MM-DD"),C=$.day(),_=[];for(let W=0;W<C;W++)_.push($.clone().subtract(C-W,"days"));return _}function u(V,D){const $=H(`${V}-${D}`,"YYYY-MM").endOf("month"),C=6-$.day(),_=[];for(let W=1;W<=C;W++)_.push($.clone().add(W,"days"));return _}function f(V){const D=H();return H(V).isSame(D,"day")}function h(V){var D,$;if(n.range){if(((D=n.modelValue)==null?void 0:D.length)==1)return H(V).isSame(H(n.modelValue[0]),"day");if((($=n.modelValue)==null?void 0:$.length)==2)return H(V).isSame(H(n.modelValue[0]),"day")||H(V).isSame(H(n.modelValue[1]),"day")}else if(n.modelValue)return H(V).isSame(H(n.modelValue),"day")}function p(V){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(V).isBetween(H(n.modelValue[0]),H(n.modelValue[1]))}function m(V){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(V).isSame(H(n.modelValue[0]),"day")}function y(V){var D;if(n.range&&((D=n.modelValue)==null?void 0:D.length)==2)return H(V).isSame(H(n.modelValue[1]),"day")}function g(V){try{return n.minDate?H(V).isBefore(H(n.minDate)):!1}catch(D){return console.log(D),!1}}function k(V){try{return n.maxDate?H(V).isAfter(H(n.maxDate)):!1}catch(D){return console.log(D),!1}}function S(V){x(V,r.value[V].subtract(1,"month"))}function N(V){x(V,r.value[V].add(1,"month"))}function b(V){x(V,r.value[V].subtract(1,"year"))}function w(V){x(V,r.value[V].add(1,"year"))}function x(V,D){V==0?r.value=[D,r.value[1]]:r.value=[r.value[0],D]}const T=a.ref();function I(V){n.week&&(T.value=H(V).week())}function A(V){return H(V).week()===T.value}function B(V){return H(V).week()===T.value?H(V).format("YYYY-MM-DD")===H().week(T.value).startOf("week").format("YYYY-MM-DD"):!1}function P(V){return H(V).week()===T.value?H(V).format("YYYY-MM-DD")===H().week(T.value).endOf("week").format("YYYY-MM-DD"):!1}function F(){T.value=null}return(V,D)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":o.value.length===1,"min-w-192":o.value.length===2}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,$=>{var E;return a.openBlock(),a.createElementBlock("div",lB,[a.createElementVNode("div",aB,[a.createElementVNode("div",cB,[a.createVNode(Uc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:C=>b($)},null,8,["onClick"]),a.createVNode(Kc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:C=>S($)},null,8,["onClick"])]),a.createElementVNode("div",dB,a.toDisplayString(r.value[$].format("YYYY MMMM")),1),a.createElementVNode("div",uB,[a.createVNode(Yc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:C=>N($)},null,8,["onClick"]),a.createVNode(Jc,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:C=>w($)},null,8,["onClick"])])]),a.createElementVNode("div",fB,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(7,C=>{var _;return a.createElementVNode("div",hB,a.toDisplayString((_=r.value[$])==null?void 0:_.clone().startOf("week").subtract(1,"days").add(C,"days").format("ddd")),1)}),64))]),a.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:F},[c(r.value[$])>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(d(a.unref(H)(r.value[$]).year(),a.unref(H)(r.value[$]).month()+1),C=>(a.openBlock(),a.createBlock(Yl,{onClick:_=>!k(C)&&!g(C)?s(C):null,onMouseover:_=>I(C),today:f(C),selected:h(C),firstDay:m(C)||B(C),lastDay:y(C)||P(C),between:p(C),highlight:A(C),off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(C).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l(r.value[$].clone()),C=>(a.openBlock(),a.createBlock(Yl,{onMouseover:_=>I(C),onClick:_=>!k(C)&&!g(C)?s(C):null,today:f(C),selected:h(C),firstDay:m(C)||B(C),lastDay:y(C)||P(C),between:p(C),disabled:k(C)||g(C),off:k(C)||g(C),highlight:A(C)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(C).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((E=u(a.unref(H)(r.value[$]).year(),a.unref(H)(r.value[$]).month()+1))==null?void 0:E.length)>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(u(a.unref(H)(r.value[$]).year(),a.unref(H)(r.value[$]).month()+1),C=>(a.openBlock(),a.createBlock(Yl,{onClick:_=>!k(C)||!g(C)?s(C):null,onMouseover:_=>I(C),today:f(C),selected:h(C),firstDay:m(C)||B(C),lastDay:y(C)||P(C),between:p(C),highlight:A(C),off:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(H)(C).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):a.createCommentVNode("",!0)],32)])}),256))],2))}}),pB={},mB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},gB=[a.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 yB(t,e){return a.openBlock(),a.createElementBlock("svg",mB,gB)}const Ih=ce(pB,[["render",yB]]),bB={},kB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},xB=[a.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 vB(t,e){return a.openBlock(),a.createElementBlock("svg",kB,xB)}const Ph=ce(bB,[["render",vB]]),wB={class:"flex gap-3"},SB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},CB=["onClick"],OB=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=a.computed(()=>{var l;if(n.range)return(l=n.modelValue)==null?void 0:l.map(c=>H(c).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return H(n.modelValue).format("YYYY-MM-DD")}),s=a.reactive([{text:"Month to Date",onClick(l){const c=H().subtract(1,"day"),d=H().startOf("month");r("update:modelValue",[d,c])}},{text:"Last Month",onClick(l){const c=H().startOf("month").subtract(1,"month"),d=H(c).endOf("month");r("update:modelValue",[c,d])}},{text:"Year to Date",onClick(l){const c=H().subtract(1,"day"),d=H().startOf("year");r("update:modelValue",[d,c])}}]);return(l,c)=>(a.openBlock(),a.createBlock(Sn,{disabled:t.disabled,maxWidth:"1280px"},{content:a.withCtx(()=>[a.createElementVNode("div",wB,[t.shortcuts?(a.openBlock(),a.createElementBlock("div",SB,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s,d=>(a.openBlock(),a.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:u=>d.onClick()},a.toDisplayString(d.text),9,CB))),256))])):a.createCommentVNode("",!0),a.createVNode(Gl,{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:a.withCtx(()=>{var d;return[a.createVNode(Pi,{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:c[0]||(c[0]=u=>i(null))},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Ih,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Ph,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[a.createTextVNode(" "+a.toDisplayString(o.value||t.placeholder),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),MB=["value","placeholder"],Zl=Object.assign({name:"WpicDateSegment"},{props:{modelValue:String,placeholder:String,segment:{type:String,default:"monthOrDay"},disabled:Boolean},emits:["update:modelValue","blur"],setup(t,{emit:e}){const n=t,r=e;a.computed(()=>n.segment==="year"?"w-[4ch]":"w-[2ch]");function i(s){const l=s.replace(/\D/g,""),c=n.segment==="year"?4:2;r("update:modelValue",l.slice(0,c))}function o(){r("blur")}return(s,l)=>(a.openBlock(),a.createElementBlock("input",{type:"text",value:t.modelValue,onInput:l[0]||(l[0]=c=>i(c.target.value)),onBlur:o,placeholder:t.placeholder,class:a.normalizeClass(["date-input p-0 border-0 focus:ring-0 outline-none font-mono",{"w-[4ch]":t.segment==="year","w-[2ch]":t.segment!="year","text-blue-500":!t.disabled}]),inputmode:"numeric",pattern:"\\d*"},null,42,MB))}}),EB={class:"flex items-center gap-0"},TB=a.createElementVNode("span",{class:"px-px"},"/",-1),$B=a.createElementVNode("span",{class:"px-px"},"/",-1),Po={__name:"DateInput",props:{modelValue:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(""),o=a.ref(""),s=a.ref(""),l=a.ref(null),c=a.ref(null),d=a.ref(null);a.watch(()=>n.modelValue,k=>{if(k&&/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/.test(k)){const S=k.split("-");i.value=S[0],o.value=S[1],s.value=S[2]}else i.value="",o.value="",s.value=""},{immediate:!0});function u(){if(i.value.length===4&&o.value.length===2&&s.value.length===2){const k=`${i.value}-${o.value}-${s.value}`;r("update:modelValue",k)}}function f(k){i.value=k,k.length===4&&a.nextTick(()=>{var S;(S=c.value)==null||S.$el.focus()}),u()}function h(k){o.value=k,k.length===2&&a.nextTick(()=>{var S;(S=d.value)==null||S.$el.focus()}),u()}function p(k){s.value=k,u()}function m(){i.value||(i.value=H().format("YYYY")),u()}function y(){o.value||(o.value=H().format("MM")),u()}function g(){s.value||(s.value=H().format("DD")),u()}return(k,S)=>(a.openBlock(),a.createElementBlock("div",EB,[a.createVNode(Zl,{modelValue:i.value,"onUpdate:modelValue":[S[0]||(S[0]=N=>i.value=N),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:l},null,8,["modelValue","disabled"]),TB,a.createVNode(Zl,{modelValue:o.value,"onUpdate:modelValue":[S[1]||(S[1]=N=>o.value=N),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),$B,a.createVNode(Zl,{modelValue:s.value,"onUpdate:modelValue":[S[2]||(S[2]=N=>s.value=N),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},NB={key:0,class:"flex items-center"},BB=a.createElementVNode("span",{class:"px-1"},"➞",-1),AB={key:1,class:"tabular-nums"},DB=a.createElementVNode("span",{class:"px-1"},"➞",-1),VB={class:"p-4"},_B={__name:"AdvancedDateField",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,i=a.ref(!1);function o(){i.value=!0}function s(){i.value=!1}function l(){r("update:modelValue",null)}const c=a.computed(()=>{if(n.range&&n.modelValue&&Array.isArray(n.modelValue)){const p=H(n.modelValue[0]),m=H(n.modelValue[1]);return[p.format("YYYY"),p.format("MM"),p.format("DD"),m.format("YYYY"),m.format("MM"),m.format("DD")]}else if(n.modelValue){const p=H(n.modelValue);return[p.format("YYYY"),p.format("MM"),p.format("DD")]}return[]}),d=a.ref(""),u=a.ref(""),f=a.ref("");a.watch(()=>n.modelValue,p=>{if(n.range)if(p&&Array.isArray(p)){const m=H(p[0]),y=H(p[1]);u.value=m.format("YYYY-MM-DD"),f.value=y.format("YYYY-MM-DD")}else u.value="",f.value="";else p?d.value=H(p).format("YYYY-MM-DD"):d.value=""},{immediate:!0}),a.watch(d,p=>{if(!n.range&&p&&p.length===10){const m=H(p,"YYYY-MM-DD",!0);m.isValid()&&r("update:modelValue",m.toDate())}}),a.watch([u,f],([p,m])=>{if(n.range&&p&&p.length===10&&m&&m.length===10){const y=H(p,"YYYY-MM-DD",!0),g=H(m,"YYYY-MM-DD",!0);y.isValid()&&g.isValid()&&r("update:modelValue",[y.toDate(),g.toDate()])}});function h(p){r("update:modelValue",p)}return(p,m)=>(a.openBlock(),a.createBlock(Sn,{disabled:t.disabled,maxWidth:"1280px",onShow:o,onHide:s},{content:a.withCtx(()=>[a.createElementVNode("div",VB,[a.createVNode(Gl,{doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":h,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:a.withCtx(()=>[a.createVNode(Pi,{label:t.label,required:t.required,hideRequired:t.hideRequired,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:t.clearable&&!!t.modelValue,onOnClear:l},{prepend:a.withCtx(()=>[t.range?(a.openBlock(),a.createBlock(Ih,{key:0,class:"dark:text-gray-400"})):(a.openBlock(),a.createBlock(Ph,{key:1,class:"dark:text-gray-400"}))]),default:a.withCtx(()=>[i.value?(a.openBlock(),a.createElementBlock("div",NB,[t.range?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(Po,{modelValue:u.value,"onUpdate:modelValue":m[2]||(m[2]=y=>u.value=y),disabled:!i.value,onClick:m[3]||(m[3]=a.withModifiers(()=>{},["stop","prevent"]))},null,8,["modelValue","disabled"]),BB,a.createVNode(Po,{modelValue:f.value,"onUpdate:modelValue":m[4]||(m[4]=y=>f.value=y),disabled:!i.value,onClick:m[5]||(m[5]=a.withModifiers(()=>{},["stop","prevent"]))},null,8,["modelValue","disabled"])],64)):(a.openBlock(),a.createBlock(Po,{key:0,modelValue:d.value,"onUpdate:modelValue":m[0]||(m[0]=y=>d.value=y),disabled:!i.value,onClick:m[1]||(m[1]=a.withModifiers(()=>{},["stop","prevent"]))},null,8,["modelValue","disabled"]))])):(a.openBlock(),a.createElementBlock("div",AB,[!t.range&&c.value.length?(a.openBlock(),a.createBlock(Po,{key:0,modelValue:d.value,"onUpdate:modelValue":m[6]||(m[6]=y=>d.value=y),disabled:!0},null,8,["modelValue"])):t.range&&c.value.length?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createElementVNode("span",null,a.toDisplayString(c.value.slice(0,3).join("-")),1),DB,a.createElementVNode("span",null,a.toDisplayString(c.value.slice(3).join("-")),1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createTextVNode(a.toDisplayString(t.placeholder),1)],64))]))]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}},IB=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:c,goTop:l});const s=a.ref(null);function l(){s.value.scrollTop=0}function c(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.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:a.withModifiers(o,["self"])},[a.createElementVNode("div",{class:a.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[a.unref(te).theme]]:!0}])},[a.createElementVNode("div",{ref_key:"panel",ref:s,class:a.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[a.renderSlot(d.$slots,"default")],2)],2)],2))}}),PB={class:"absolute inset-0 flex items-center justify-center py-12"},RB={class:"text-lg font-medium dark:text-gray-300"},LB={key:0,class:"flex justify-end px-6 pb-4"},zB=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=a.ref(null),l=a.ref(!1);function c(){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 a.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),a.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:c,isScrolledToBottom:l}),(f,h)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[a.createElementVNode("div",PB,[a.createElementVNode("div",{class:"absolute inset-0 bg-black/10 dark:bg-black/75 z-10",onClick:o}),a.createElementVNode("div",{class:a.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}])},[a.createElementVNode("div",{class:a.normalizeClass(["px-6 pt-4 flex justify-between",{"border-b pb-3 dark:border-gray-900":t.border}])},[a.createElementVNode("span",RB,a.toDisplayString(t.title),1),a.createElementVNode("span",{class:"cursor-pointer",onClick:o},[a.createVNode(Hr,{class:"w-6 h-6"})])],2),a.createElementVNode("div",{ref_key:"panel",ref:s,class:a.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[a.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(a.openBlock(),a.createElementBlock("div",LB,[a.renderSlot(f.$slots,"buttons")])):a.createCommentVNode("",!0)],2)])],2))}}),FB={class:"wpic-tabs flex border-b-2 dark:border-gray-930 overflow-x-auto overflow-y-hidden"},jB=["onClick"],HB=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=a.ref([]),o=c=>{r("update:modelValue",c)},s=c=>{i.value.push(c)},l=a.computed(()=>n.modelValue);return a.provide("addTab",s),a.provide("modelValue",l),(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",FB,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,u=>(a.openBlock(),a.createElementBlock("div",{key:u.name,class:a.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)},[a.renderSlot(c.$slots,"label",{},()=>[a.createElementVNode("span",{class:a.normalizeClass({"whitespace-nowrap text-ellipsis overflow-hidden":t.nowrap})},a.toDisplayString(u.label),3)])],10,jB))),128))]),a.createElementVNode("div",null,[a.renderSlot(c.$slots,"default")])],64))}}),WB=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=a.ref(!1),r=a.inject("addTab"),i=a.inject("modelValue");return a.onMounted(()=>{r({label:e.label,name:e.name,disabled:e.disabled})}),a.watch(()=>i.value,o=>{n.value=o===e.name},{immediate:!0,deep:!0}),(o,s)=>n.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["wpic-tab-pane",{"py-3 px-6":!t.noStyle}])},[a.renderSlot(o.$slots,"default")],2)):a.createCommentVNode("",!0)}}),qB={},UB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},KB=[a.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 JB(t,e){return a.openBlock(),a.createElementBlock("svg",UB,KB)}const YB=ce(qB,[["render",JB]]),GB={},ZB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},XB=[a.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 QB(t,e){return a.openBlock(),a.createElementBlock("svg",ZB,XB)}const eA=ce(GB,[["render",QB]]),tA={},nA={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},rA=[a.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 iA(t,e){return a.openBlock(),a.createElementBlock("svg",nA,rA)}const oA=ce(tA,[["render",iA]]),sA={},lA={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},aA=[a.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 cA(t,e){return a.openBlock(),a.createElementBlock("svg",lA,aA)}const dA=ce(sA,[["render",cA]]),uA={class:"w-6"},fA={class:"flex-1"},hA={key:0,class:"mb-2"},pA=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.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}])},[a.createElementVNode("div",uA,[t.warning?(a.openBlock(),a.createBlock(YB,{key:0,class:"w-full aspect-square"})):t.info?(a.openBlock(),a.createBlock(eA,{key:1,class:"w-full aspect-square"})):t.success?(a.openBlock(),a.createBlock(oA,{key:2,class:"w-full aspect-square"})):t.error?(a.openBlock(),a.createBlock(dA,{key:3,class:"w-full aspect-square"})):a.createCommentVNode("",!0)]),a.createElementVNode("div",fA,[t.title?(a.openBlock(),a.createElementBlock("div",hA,a.toDisplayString(t.title),1)):a.createCommentVNode("",!0),a.createElementVNode("span",{class:a.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}])},[a.renderSlot(e.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.text),1)])],2)])],2))}}),Xl=a.ref(!1),Rh=a.ref(""),Lh=a.ref(""),zh=a.ref(!1),Fh=a.ref(!1);let jh=()=>{},Hh=()=>{};function Ql(){const t=({title:i,text:o,positive:s=!1,negative:l=!1,onConfirm:c,onCancel:d})=>{Rh.value=i,Lh.value=o,zh.value=s,Fh.value=l,jh=c||(()=>{}),Hh=d||(()=>{}),Xl.value=!0},e=()=>{Xl.value=!1};return{visible:Xl,title:Rh,text:Lh,positive:zh,negative:Fh,show:t,onConfirm:()=>{jh(),e()},onCancel:()=>{Hh(),e()}}}const mA={key:0,class:"confirm-modal-overlay z-40"},gA={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},yA={class:"text-lg font-semibold mb-6"},bA={class:"mb-12"},kA={class:"flex justify-end"},ea={WpicAlert:pA,WpicAdvDateField:_B,WpicCalendar:Gl,WpicTextarea:Hc,WpicDialog:zB,WpicSlidePanel:IB,WpicDateField:OB,WpicFormInput:Pi,WpicButton:Ni,WpicBadge:tB,WpicTextEditor:LN,WpicInputGroup:xm,WpicButtonGroup:gm,WpicForm:vm,WpicFormField:Wc,WpicSpinner:Kn,WpicTooltip:qc,WpicPopover:Sn,WpicChoiceList:jc,WpicCard:vw,WpicCardSection:Cw,WpicProgressBar:Ew,WpicTag:$w,WpicTagGroup:Nw,WpicPagination:nS,WpicLoadingPanel:Vw,WpicTable:OS,WpicTableColumn:MS,WpicTabs:HB,WpicTabPane:WB,WpicConfirm:ce(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:l}=Ql();return(c,d)=>a.unref(e)?(a.openBlock(),a.createElementBlock("div",mA,[a.createElementVNode("div",gA,[a.createElementVNode("div",yA,a.toDisplayString(a.unref(n)),1),a.createElementVNode("div",bA,a.toDisplayString(a.unref(r)),1),a.createElementVNode("div",kA,[a.createVNode(Ni,{onClick:a.unref(l)},{default:a.withCtx(()=>[a.createTextVNode("Cancel")]),_:1},8,["onClick"]),a.createVNode(Ni,{primary:a.unref(i),destructive:a.unref(o),onClick:a.unref(s)},{default:a.withCtx(()=>[a.createTextVNode("Confirm")]),_:1},8,["primary","destructive","onClick"])])])])):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-613542ab"]])};function Wh(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?Wh(t[n],e[n]):t[n]=e[n])}const xA={useConfirm:Ql};function vA(t,e){Wh(te,e);for(const n in ea)if(ea.hasOwnProperty(n)){const r=ea[n];t.component(r.name,r)}}const wA={install:vA,composables:xA,options:te};Yt.default=wA,Yt.useConfirm=Ql,Object.defineProperties(Yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});