@romainbx/wpic-components 0.0.105 → 0.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/form/ChoiceList.vue.d.ts +4 -0
- package/dist/src/components/form/FormField.vue.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/wpic-components.js +4833 -4806
- package/dist/wpic-components.umd.cjs +35 -35
- package/locales/en.json +2 -1
- package/locales/ja.json +2 -1
- package/locales/ko.json +2 -1
- package/locales/zh-CN.json +2 -1
- package/package.json +1 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
(function(Dn,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(Dn=typeof globalThis<"u"?globalThis:Dn||self,l(Dn.WpicComponents={},Dn.Vue))})(this,function(Dn,l){"use strict";function
|
|
1
|
+
(function(Dn,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(Dn=typeof globalThis<"u"?globalThis:Dn||self,l(Dn.WpicComponents={},Dn.Vue))})(this,function(Dn,l){"use strict";function Gg(){return Ic().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ic(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Jg=typeof Proxy=="function",Zg="devtools-plugin:setup",Xg="plugin:settings:set";let $r,Gs;function Qg(){var t;return $r!==void 0||(typeof window<"u"&&window.performance?($r=!0,Gs=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?($r=!0,Gs=globalThis.perf_hooks.performance):$r=!1),$r}function e0(){return Qg()?Gs.now():Date.now()}class t0{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const s in e.settings){const a=e.settings[s];r[s]=a.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},r);try{const s=localStorage.getItem(i),a=JSON.parse(s);Object.assign(o,a)}catch{}this.fallbacks={getSettings(){return o},setSettings(s){try{localStorage.setItem(i,JSON.stringify(s))}catch{}o=s},now(){return e0()}},n&&n.on(Xg,(s,a)=>{s===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(s,a)=>this.target?this.target.on[a]:(...c)=>{this.onQueue.push({method:a,args:c})}}),this.proxiedTarget=new Proxy({},{get:(s,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...c)=>(this.targetQueue.push({method:a,args:c,resolve:()=>{}}),this.fallbacks[a](...c)):(...c)=>new Promise(d=>{this.targetQueue.push({method:a,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 n0(t,e){const n=t,r=Ic(),i=Gg(),o=Jg&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))i.emit(Zg,t,e);else{const s=o?new t0(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 Ke(t){return typeof t=="function"}function Pc(t){return t==null}const $n=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Js(t){return Number(t)>=0}function i0(t){const e=parseFloat(t);return isNaN(e)?t:e}function o0(t){return typeof t=="object"&&t!==null}function s0(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function Rc(t){if(!o0(t)||s0(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 vi(t,e){return Object.keys(e).forEach(n=>{if(Rc(e[n])&&Rc(t[n])){t[n]||(t[n]={}),vi(t[n],e[n]);return}t[n]=e[n]}),t}function wi(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Js(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Fc={};function Kt(t,e){l0(t,e),Fc[t]=e}function a0(t){return Fc[t]}function l0(t,e){if(!Ke(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function jc(t,e,n){typeof n.value=="object"&&(n.value=De(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function De(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(De(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,a){i.set(De(a),De(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(De(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++)jc(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]||jc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const xi=Symbol("vee-validate-form"),zc=Symbol("vee-validate-field-instance"),wo=Symbol("Default empty value"),c0=typeof window<"u";function Zs(t){return Ke(t)&&!!t.__locatorRef}function Gt(t){return!!t&&Ke(t.parse)&&t.__type==="VVTypedSchema"}function xo(t){return!!t&&Ke(t.validate)}function Ei(t){return t==="checkbox"||t==="radio"}function d0(t){return $n(t)||Array.isArray(t)}function u0(t){return Array.isArray(t)?t.length===0:$n(t)&&Object.keys(t).length===0}function Eo(t){return/^\[.+\]$/i.test(t)}function f0(t){return Hc(t)&&t.multiple}function Hc(t){return t.tagName==="SELECT"}function h0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function p0(t,e){return!h0(t,e)&&e.type!=="file"&&!Ei(e.type)}function Wc(t){return Xs(t)&&t.target&&"submit"in t.target}function Xs(t){return t?!!(typeof Event<"u"&&Ke(Event)&&t instanceof Event||t&&t.srcElement):!1}function Uc(t,e){return e in t&&t[e]!==wo}function pt(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(!pt(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(!pt(r[1],e.get(r[0])))return!1;return!0}if(Yc(t)&&Yc(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(!pt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Yc(t){return c0?t instanceof File:!1}function Qs(t){return Eo(t)?t.replace(/\[|\]/gi,""):t}function wt(t,e,n){return t?Eo(e)?t[Qs(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>d0(i)&&o in i?i[o]:n,t):n}function gn(t,e,n){if(Eo(e)){t[Qs(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)||Pc(i[r[o]]))&&(i[r[o]]=Js(r[o+1])?[]:{}),i=i[r[o]]}}function ea(t,e){if(Array.isArray(t)&&Js(e)){t.splice(Number(e),1);return}$n(t)&&delete t[e]}function qc(t,e){if(Eo(e)){delete t[Qs(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){ea(r,n[o]);break}if(!(n[o]in r)||Pc(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>wt(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(u0(i[o])){if(o===0){ea(t,n[0]);continue}ea(i[o-1],n[o-1])}}function xt(t){return Object.keys(t)}function ta(t,e=void 0){const n=l.getCurrentInstance();return(n==null?void 0:n.provides[t])||l.inject(t,e)}function Kc(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>pt(o,e));return i>=0?r.splice(i,1):r.push(e),r}return pt(t,e)?n:e}function m0(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 Gc(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 g0(t,e){return $n(e)&&e.number?i0(t):t}function na(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 ra(t){return Array.isArray(t)?t:t?[t]:[]}function Co(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function y0(t){let e=null,n=[];return function(...r){const i=l.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 ia(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 oa(t){if(Jc(t))return t._value}function Jc(t){return"_value"in t}function b0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function So(t){if(!Xs(t))return t;const e=t.target;if(Ei(e.type)&&Jc(e))return oa(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(f0(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(oa);if(Hc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?oa(n):e.value}return b0(e)}function Zc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?$n(t)&&t._$$isNormalized?t:$n(t)?Object.keys(t).reduce((n,r)=>{const i=k0(t[r]);return t[r]!==!1&&(n[r]=Xc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=v0(r);return i.name&&(n[i.name]=Xc(i.params)),n},e):e}function k0(t){return t===!0?[]:Array.isArray(t)||$n(t)?t:[t]}function Xc(t){const e=n=>typeof n=="string"&&n[0]==="@"?w0(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 v0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function w0(t){const e=n=>wt(n,t)||n[t];return e.__locatorRef=t,e}function x0(t){return Array.isArray(t)?t.filter(Zs):xt(t).filter(e=>Zs(t[e])).map(e=>t[e])}let E0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const sr=()=>E0;async function Qc(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 C0(i,t)).errors;return{errors:s,valid:!s.length}}async function C0(t,e){if(Gt(t.rules)||xo(t.rules))return _0(e,t.rules);if(Ke(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},a=Array.isArray(t.rules)?t.rules:[t.rules],c=a.length,d=[];for(let u=0;u<c;u++){const f=a[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:td(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Zc(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const a=i[s],c=await O0(n,e,{name:a,params:n.rules[a]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function S0(t){return!!t&&t.name==="ValidationError"}function ed(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!S0(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,a)=>{const c=a.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...a.errors),s},{});return{errors:Object.values(o)}}}}}async function _0(t,e){const r=await(Gt(e)?e:ed(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function O0(t,e,n){const r=a0(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=T0(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:td(o)}}function td(t){const e=sr().generateMessage;return e?e(t):"Field is invalid"}function T0(t,e){const n=r=>Zs(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 N0(t,e){const r=await(Gt(t)?t:ed(t)).parse(De(e)),i={},o={};for(const s of r.errors){const a=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!a.length,errors:a},a.length&&(o[c]=a[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function M0(t,e,n){const i=xt(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 Qc(wt(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),a={},c={};for(const d of s)a[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:a,errors:c}}let nd=0;function A0(t,e){const{value:n,initialValue:r,setInitialValue:i}=D0(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}=B0(),u=nd>=Number.MAX_SAFE_INTEGER?0:++nd,f=L0(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=l.computed(()=>o.errors);function a(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(l.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(l.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:a}}function D0(t,e,n){const r=l.ref(l.unref(e));function i(){return n?wt(n.initialValues.value,l.unref(t),l.unref(r)):l.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(l.unref(t),d,!0)}const s=l.computed(i);if(!n)return{value:l.ref(i()),initialValue:s,setInitialValue:o};const a=$0(e,n,s,t);return n.stageInitialValue(l.unref(t),a,!0),{value:l.computed({get(){return wt(n.values,l.unref(t))},set(d){n.setFieldValue(l.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function $0(t,e,n,r){return l.isRef(t)?l.unref(t):t!==void 0?t:wt(e.values,l.unref(r),l.unref(n))}function L0(t,e,n,r){const i=l.computed(()=>{var s,a,c;return(c=(a=(s=l.toValue(r))===null||s===void 0?void 0:s.describe)===null||a===void 0?void 0:a.call(s).required)!==null&&c!==void 0?c:!1}),o=l.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!l.unref(n).length,initialValue:l.computed(()=>l.unref(e)),dirty:l.computed(()=>!pt(l.unref(t),l.unref(e)))});return l.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function B0(){const t=l.ref([]);return{errors:t,setErrors:e=>{t.value=ra(e)}}}function rd(t){process.env.NODE_ENV!=="production"&&r0({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"},P0)}const Ci={},Si={};let yn;const Lr=m0(()=>{setTimeout(async()=>{await l.nextTick(),yn==null||yn.sendInspectorState(Br),yn==null||yn.sendInspectorTree(Br)},100)},100);function I0(t){const e=l.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Ci[t.formId]=Object.assign({},t),Ci[t.formId]._vm=e,l.onUnmounted(()=>{delete Ci[t.formId],Lr()}),Lr()}function V0(t){const e=l.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Si[t.id]=Object.assign({},t),Si[t.id]._vm=e,l.onUnmounted(()=>{delete Si[t.id],Lr()}),Lr()}const Br="vee-validate-inspector",Et={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let He=null;function P0(t){yn=t,t.addInspector({id:Br,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!He){console.error("There is not a valid selected vee-validate node or component");return}if(He.type==="field"){await He.field.validate();return}if(He.type==="form"){await He.form.validate();return}He.type==="pathState"&&await He.form.validateField(He.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!He){console.error("There is not a valid selected vee-validate node or component");return}if(He.type==="field"){He.field.resetField();return}He.type==="form"&&He.form.resetForm(),He.type==="pathState"&&He.form.resetField(He.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Br)return;const n=Object.values(Ci),r=Object.values(Si);e.rootNodes=[...n.map(R0),...r.map(i=>j0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Br||n.currentTab!==`custom-inspector:${Br}`)return;const{form:r,field:i,state:o,type:s}=z0(e.nodeId);if(r&&s==="form"){e.state=H0(r),He={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=od(o),He={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=od({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),He={field:i,type:"field"};return}He=null})}function R0(t){const{textColor:e,bgColor:n}=sd(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{gn(r,l.unref(s.path),F0(s,t))});function i(s,a=[]){const c=[...a].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):$n(s)?{id:`${a.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...a,d]))}:Array.isArray(s)?{id:`${a.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...a,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:sa(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Et.white,backgroundColor:Et.unknown}]}}function F0(t,e){return{id:sa(e,t),label:l.unref(t.path),tags:id(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function j0(t,e){return{id:sa(e,t),label:l.unref(t.name),tags:id(!1,1,t.type,t.meta.valid,e)}}function id(t,e,n,r,i){const{textColor:o,bgColor:s}=sd(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Et.black,backgroundColor:Et.gray},n==="checkbox"?{label:"Checkbox",textColor:Et.white,backgroundColor:Et.blue}:void 0,n==="radio"?{label:"Radio",textColor:Et.white,backgroundColor:Et.purple}:void 0,t?{label:"Multiple",textColor:Et.black,backgroundColor:Et.orange}:void 0].filter(Boolean)}function sa(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:l.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 z0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Ci[e.f];if(!n&&e.ff){const i=Si[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 od(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 H0(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:xt(e.value).reduce((a,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(a[c]=u),a},{})}]}}function sd(t){return{bgColor:t?Et.success:Et.error,textColor:t?Et.black:Et.white}}function W0(t,e,n){return Ei(n==null?void 0:n.type)?Y0(t,e,n):ad(t,e,n)}function ad(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:a,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=U0(n),g=f?ta(xi):void 0,y=m||g,k=l.computed(()=>wi(l.toValue(t))),x=l.computed(()=>{if(l.toValue(y==null?void 0:y.schema))return;const j=l.unref(e);return xo(j)||Gt(j)||Ke(j)||Array.isArray(j)?j:Zc(j)}),w=!Ke(x.value)&&Gt(l.toValue(e)),{id:b,value:C,initialValue:v,meta:S,setState:D,errors:O,flags:$}=A0(k,{modelValue:r,form:y,bails:o,label:c,type:s,validate:x.value?T:void 0,schema:w?e:void 0}),V=l.computed(()=>O.value[0]);p&&q0({value:C,prop:p,handleChange:R,shouldValidate:()=>d&&!$.pendingReset});const B=(U,j=!1)=>{S.touched=!0,j&&Y()};async function J(U){var j,ce;if(y!=null&&y.validateSchema){const{results:le}=await y.validateSchema(U);return(j=le[l.toValue(k)])!==null&&j!==void 0?j:{valid:!0,errors:[]}}return x.value?Qc(C.value,x.value,{name:l.toValue(k),label:l.toValue(c),values:(ce=y==null?void 0:y.values)!==null&&ce!==void 0?ce:{},bails:o}):{valid:!0,errors:[]}}const Y=na(async()=>(S.pending=!0,S.validated=!0,J("validated-only")),U=>($.pendingUnmount[z.id]||(D({errors:U.errors}),S.pending=!1,S.valid=U.valid),U)),I=na(async()=>J("silent"),U=>(S.valid=U.valid,U));function T(U){return(U==null?void 0:U.mode)==="silent"?I():Y()}function R(U,j=!0){const ce=So(U);he(ce,j)}l.onMounted(()=>{if(i)return Y();(!y||!y.validateSchema)&&I()});function F(U){S.touched=U}function ee(U){var j;const ce=U&&"value"in U?U.value:v.value;D({value:De(ce),initialValue:De(ce),touched:(j=U==null?void 0:U.touched)!==null&&j!==void 0?j:!1,errors:(U==null?void 0:U.errors)||[]}),S.pending=!1,S.validated=!1,I()}const ie=l.getCurrentInstance();function he(U,j=!0){C.value=ie&&p?g0(U,ie.props.modelModifiers):U,(j?Y:I)()}function ue(U){D({errors:Array.isArray(U)?U:[U]})}const L=l.computed({get(){return C.value},set(U){he(U,d)}}),z={id:b,name:k,label:c,value:L,meta:S,errors:O,errorMessage:V,type:s,checkedValue:a,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:ee,handleReset:()=>ee(),validate:T,handleChange:R,handleBlur:B,setState:D,setTouched:F,setErrors:ue,setValue:he};if(l.provide(zc,z),l.isRef(e)&&typeof l.unref(e)!="function"&&l.watch(e,(U,j)=>{pt(U,j)||(S.validated?Y():I())},{deep:!0}),process.env.NODE_ENV!=="production"&&(z._vm=l.getCurrentInstance(),l.watch(()=>Object.assign(Object.assign({errors:O.value},S),{value:C.value}),Lr,{deep:!0}),y||V0(z)),!y)return z;const q=l.computed(()=>{const U=x.value;return!U||Ke(U)||xo(U)||Gt(U)||Array.isArray(U)?{}:Object.keys(U).reduce((j,ce)=>{const le=x0(U[ce]).map(ve=>ve.__locatorRef).reduce((ve,Ne)=>{const Ie=wt(y.values,Ne)||y.values[Ne];return Ie!==void 0&&(ve[Ne]=Ie),ve},{});return Object.assign(j,le),j},{})});return l.watch(q,(U,j)=>{if(!Object.keys(U).length)return;!pt(U,j)&&(S.validated?Y():I())}),l.onBeforeUnmount(()=>{var U;const j=(U=l.toValue(z.keepValueOnUnmount))!==null&&U!==void 0?U:l.toValue(y.keepValuesOnUnmount),ce=l.toValue(k);if(j||!y||$.pendingUnmount[z.id]){y==null||y.removePathState(ce,b);return}$.pendingUnmount[z.id]=!0;const le=y.getPathState(ce);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(z.id):(le==null?void 0:le.id)===z.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const Ne=le.value.findIndex(Ie=>pt(Ie,l.toValue(z.checkedValue)));if(Ne>-1){const Ie=[...le.value];Ie.splice(Ne,1),y.setFieldValue(ce,Ie)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(z.id),1)}else y.unsetPathValue(l.toValue(k));y.removePathState(ce,b)}}),z}function U0(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||{}))?aa(l.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,a=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:a})}function Y0(t,e,n){const r=n!=null&&n.standalone?void 0:ta(xi),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(a){const c=a.handleChange,d=l.computed(()=>{const f=l.toValue(a.value),h=l.toValue(i);return Array.isArray(f)?f.findIndex(p=>pt(p,h))>=0:pt(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&a.validate();return}const g=l.toValue(t),y=r==null?void 0:r.getPathState(g),k=So(f);let x=(m=l.toValue(i))!==null&&m!==void 0?m:k;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=Kc(wt(r.values,g)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Kc(l.toValue(a.value),x,l.toValue(o))),c(x,h)}return Object.assign(Object.assign({},a),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(ad(t,e,n))}function q0({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=l.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&&(l.watch(e,a=>{pt(a,aa(i,o))||i.emit(s,a)}),l.watch(()=>aa(i,o),a=>{if(a===wo&&e.value===void 0)return;const c=a===wo?void 0:a;pt(c,e.value)||n(c,r())}))}function aa(t,e){if(t)return t.props[e]}const K0=l.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:()=>sr().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:wo},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=l.toRef(t,"rules"),r=l.toRef(t,"name"),i=l.toRef(t,"label"),o=l.toRef(t,"uncheckedValue"),s=l.toRef(t,"keepValue"),{errors:a,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:k,setErrors:x}=W0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:J0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),w=function(O,$=!0){f(O,$)},b=l.computed(()=>{const{validateOnInput:D,validateOnChange:O,validateOnBlur:$,validateOnModelUpdate:V}=G0(t);function B(T){h(T,$),Ke(e.attrs.onBlur)&&e.attrs.onBlur(T)}function J(T){w(T,D),Ke(e.attrs.onInput)&&e.attrs.onInput(T)}function Y(T){w(T,O),Ke(e.attrs.onChange)&&e.attrs.onChange(T)}const I={name:t.name,onBlur:B,onInput:J,onChange:Y};return I["onUpdate:modelValue"]=T=>w(T,V),I}),C=l.computed(()=>{const D=Object.assign({},b.value);Ei(e.attrs.type)&&k&&(D.checked=k.value);const O=ld(t,e);return p0(O,e.attrs)&&(D.value=c.value),D}),v=l.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:c.value}));function S(){return{field:C.value,componentField:v.value,value:c.value,meta:y,errors:a.value,errorMessage:d.value,validate:u,resetField:m,handleChange:w,handleInput:D=>w(D,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:c,meta:y,errors:a,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const D=l.resolveDynamicComponent(ld(t,e)),O=ia(D,e,S);return D?l.h(D,Object.assign(Object.assign({},e.attrs),C.value),O):O}}});function ld(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function G0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:a,validateOnModelUpdate:c}=sr();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:a,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function J0(t,e){return Ei(e.attrs.type)?Uc(t,"modelValue")?t.modelValue:void 0:Uc(t,"modelValue")?t.modelValue:e.attrs.value}const ar=K0;let Z0=0;const _o=["bails","fieldsCount","id","multiple","type","validate"];function cd(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},l.toValue(e)),r=l.unref(t==null?void 0:t.validationSchema);return r&&Gt(r)&&Ke(r.cast)?De(r.cast(n)||{}):De(n)}function X0(t){var e;const n=Z0++;let r=0;const i=l.ref(!1),o=l.ref(!1),s=l.ref(0),a=[],c=l.reactive(cd(t)),d=l.ref([]),u=l.ref({}),f=l.ref({}),h=y0(()=>{f.value=d.value.reduce((N,A)=>(N[wi(l.toValue(A.path))]=A,N),{})});function p(N,A){const W=T(N);if(!W){typeof N=="string"&&(u.value[wi(N)]=ra(A));return}if(typeof N=="string"){const te=wi(N);u.value[te]&&delete u.value[te]}W.errors=ra(A),W.valid=!W.errors.length}function m(N){xt(N).forEach(A=>{p(A,N[A])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=l.computed(()=>{const N=d.value.reduce((A,W)=>(W.errors.length&&(A[W.path]=W.errors),A),{});return Object.assign(Object.assign({},u.value),N)}),y=l.computed(()=>xt(g.value).reduce((N,A)=>{const W=g.value[A];return W!=null&&W.length&&(N[A]=W[0]),N},{})),k=l.computed(()=>d.value.reduce((N,A)=>(N[A.path]={name:A.path||"",label:A.label||""},N),{})),x=l.computed(()=>d.value.reduce((N,A)=>{var W;return N[A.path]=(W=A.bails)!==null&&W!==void 0?W:!0,N},{})),w=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:C,originalInitialValues:v,setInitialValues:S}=ey(d,c,t),D=Q0(d,c,v,y),O=l.computed(()=>d.value.reduce((N,A)=>{const W=wt(c,A.path);return gn(N,A.path,W),N},{})),$=t==null?void 0:t.validationSchema;function V(N,A){var W,te;const de=l.computed(()=>wt(C.value,l.toValue(N))),M=f.value[l.toValue(N)],X=(A==null?void 0:A.type)==="checkbox"||(A==null?void 0:A.type)==="radio";if(M&&X){M.multiple=!0;const vt=r++;return Array.isArray(M.id)?M.id.push(vt):M.id=[M.id,vt],M.fieldsCount++,M.__flags.pendingUnmount[vt]=!1,M}const re=l.computed(()=>wt(c,l.toValue(N))),me=l.toValue(N),ye=F.findIndex(vt=>vt===me);ye!==-1&&F.splice(ye,1);const we=l.computed(()=>{var vt,Rt,Dr,or;const mn=l.toValue($);if(Gt(mn))return(Rt=(vt=mn.describe)===null||vt===void 0?void 0:vt.call(mn,l.toValue(N)).required)!==null&&Rt!==void 0?Rt:!1;const vo=l.toValue(A==null?void 0:A.schema);return Gt(vo)&&(or=(Dr=vo.describe)===null||Dr===void 0?void 0:Dr.call(vo).required)!==null&&or!==void 0?or:!1}),Ae=r++,ze=l.reactive({id:Ae,path:N,touched:!1,pending:!1,valid:!0,validated:!!(!((W=w[me])===null||W===void 0)&&W.length),required:we,initialValue:de,errors:l.shallowRef([]),bails:(te=A==null?void 0:A.bails)!==null&&te!==void 0?te:!1,label:A==null?void 0:A.label,type:(A==null?void 0:A.type)||"default",value:re,multiple:!1,__flags:{pendingUnmount:{[Ae]:!1},pendingReset:!1},fieldsCount:1,validate:A==null?void 0:A.validate,dirty:l.computed(()=>!pt(l.unref(re),l.unref(de)))});return d.value.push(ze),f.value[me]=ze,h(),y.value[me]&&!w[me]&&l.nextTick(()=>{ht(me,{mode:"silent"})}),l.isRef(N)&&l.watch(N,vt=>{h();const Rt=De(re.value);f.value[vt]=ze,l.nextTick(()=>{gn(c,vt,Rt)})}),ze}const B=Gc(se,5),J=Gc(se,5),Y=na(async N=>await(N==="silent"?B():J()),(N,[A])=>{const W=xt(U.errorBag.value),de=[...new Set([...xt(N.results),...d.value.map(M=>M.path),...W])].sort().reduce((M,X)=>{var re;const me=X,ye=T(me)||R(me),we=((re=N.results[me])===null||re===void 0?void 0:re.errors)||[],Ae=l.toValue(ye==null?void 0:ye.path)||me,ze=ty({errors:we,valid:!we.length},M.results[Ae]);return M.results[Ae]=ze,ze.valid||(M.errors[Ae]=ze.errors[0]),ye&&u.value[Ae]&&delete u.value[Ae],ye?(ye.valid=ze.valid,A==="silent"||A==="validated-only"&&!ye.validated||p(ye,ze.errors),M):(p(Ae,we),M)},{valid:N.valid,results:{},errors:{}});return N.values&&(de.values=N.values),xt(de.results).forEach(M=>{var X;const re=T(M);re&&A!=="silent"&&(A==="validated-only"&&!re.validated||p(re,(X=de.results[M])===null||X===void 0?void 0:X.errors))}),de});function I(N){d.value.forEach(N)}function T(N){const A=typeof N=="string"?wi(N):N;return typeof A=="string"?f.value[A]:A}function R(N){return d.value.filter(W=>N.startsWith(W.path)).reduce((W,te)=>W?te.path.length>W.path.length?te:W:te,void 0)}let F=[],ee;function ie(N){return F.push(N),ee||(ee=l.nextTick(()=>{[...F].sort().reverse().forEach(W=>{qc(c,W)}),F=[],ee=null})),ee}function he(N){return function(W,te){return function(M){return M instanceof Event&&(M.preventDefault(),M.stopPropagation()),I(X=>X.touched=!0),i.value=!0,s.value++,lt().then(X=>{const re=De(c);if(X.valid&&typeof W=="function"){const me=De(O.value);let ye=N?me:re;return X.values&&(ye=X.values),W(ye,{evt:M,controlledValues:me,setErrors:m,setFieldError:p,setTouched:Ee,setFieldTouched:Ne,setValues:le,setFieldValue:j,resetForm:at,resetField:Mt})}!X.valid&&typeof te=="function"&&te({values:re,evt:M,errors:X.errors,results:X.results})}).then(X=>(i.value=!1,X),X=>{throw i.value=!1,X})}}}const L=he(!1);L.withControlled=he(!0);function z(N,A){const W=d.value.findIndex(de=>de.path===N&&(Array.isArray(de.id)?de.id.includes(A):de.id===A)),te=d.value[W];if(!(W===-1||!te)){if(l.nextTick(()=>{ht(N,{mode:"silent",warn:!1})}),te.multiple&&te.fieldsCount&&te.fieldsCount--,Array.isArray(te.id)){const de=te.id.indexOf(A);de>=0&&te.id.splice(de,1),delete te.__flags.pendingUnmount[A]}(!te.multiple||te.fieldsCount<=0)&&(d.value.splice(W,1),E(N),h(),delete f.value[N])}}function q(N){xt(f.value).forEach(A=>{A.startsWith(N)&&delete f.value[A]}),d.value=d.value.filter(A=>!A.path.startsWith(N)),l.nextTick(()=>{h()})}const U={formId:n,values:c,controlledValues:O,errorBag:g,errors:y,schema:$,submitCount:s,meta:D,isSubmitting:i,isValidating:o,fieldArrays:a,keepValuesOnUnmount:b,validateSchema:l.unref($)?Y:void 0,validate:lt,setFieldError:p,validateField:ht,setFieldValue:j,setValues:le,setErrors:m,setFieldTouched:Ne,setTouched:Ee,resetForm:at,resetField:Mt,handleSubmit:L,useFieldModel:Oe,defineInputBinds:P,defineComponentBinds:Z,defineField:_e,stageInitialValue:_,unsetInitialValue:E,setFieldInitialValue:H,createPathState:V,getPathState:T,unsetPathValue:ie,removePathState:z,initialValues:C,getAllPathStates:()=>d.value,destroyPath:q,isFieldTouched:Ie,isFieldDirty:tt,isFieldValid:Q};function j(N,A,W=!0){const te=De(A),de=typeof N=="string"?N:N.path;T(de)||V(de),gn(c,de,te),W&&ht(de)}function ce(N,A=!0){xt(c).forEach(W=>{delete c[W]}),xt(N).forEach(W=>{j(W,N[W],!1)}),A&<()}function le(N,A=!0){vi(c,N),a.forEach(W=>W&&W.reset()),A&<()}function ve(N,A){const W=T(l.toValue(N))||V(N);return l.computed({get(){return W.value},set(te){var de;const M=l.toValue(N);j(M,te,(de=l.toValue(A))!==null&&de!==void 0?de:!1)}})}function Ne(N,A){const W=T(N);W&&(W.touched=A)}function Ie(N){const A=T(N);return A?A.touched:d.value.filter(W=>W.path.startsWith(N)).some(W=>W.touched)}function tt(N){const A=T(N);return A?A.dirty:d.value.filter(W=>W.path.startsWith(N)).some(W=>W.dirty)}function Q(N){const A=T(N);return A?A.valid:d.value.filter(W=>W.path.startsWith(N)).every(W=>W.valid)}function Ee(N){if(typeof N=="boolean"){I(A=>{A.touched=N});return}xt(N).forEach(A=>{Ne(A,!!N[A])})}function Mt(N,A){var W;const te=A&&"value"in A?A.value:wt(C.value,N),de=T(N);de&&(de.__flags.pendingReset=!0),H(N,De(te),!0),j(N,te,!1),Ne(N,(W=A==null?void 0:A.touched)!==null&&W!==void 0?W:!1),p(N,(A==null?void 0:A.errors)||[]),l.nextTick(()=>{de&&(de.__flags.pendingReset=!1)})}function at(N,A){let W=De(N!=null&&N.values?N.values:v.value);W=A!=null&&A.force?W:vi(v.value,W),W=Gt($)&&Ke($.cast)?$.cast(W):W,S(W),I(te=>{var de;te.__flags.pendingReset=!0,te.validated=!1,te.touched=((de=N==null?void 0:N.touched)===null||de===void 0?void 0:de[te.path])||!1,j(te.path,wt(W,te.path),!1),p(te.path,void 0)}),A!=null&&A.force?ce(W,!1):le(W,!1),m((N==null?void 0:N.errors)||{}),s.value=(N==null?void 0:N.submitCount)||0,l.nextTick(()=>{lt({mode:"silent"}),I(te=>{te.__flags.pendingReset=!1})})}async function lt(N){const A=(N==null?void 0:N.mode)||"force";if(A==="force"&&I(M=>M.validated=!0),U.validateSchema)return U.validateSchema(A);o.value=!0;const W=await Promise.all(d.value.map(M=>M.validate?M.validate(N).then(X=>({key:M.path,valid:X.valid,errors:X.errors})):Promise.resolve({key:M.path,valid:!0,errors:[]})));o.value=!1;const te={},de={};for(const M of W)te[M.key]={valid:M.valid,errors:M.errors},M.errors.length&&(de[M.key]=M.errors[0]);return{valid:W.every(M=>M.valid),results:te,errors:de}}async function ht(N,A){var W;const te=T(N);if(te&&(A==null?void 0:A.mode)!=="silent"&&(te.validated=!0),$){const{results:M}=await Y((A==null?void 0:A.mode)||"validated-only");return M[N]||{errors:[],valid:!0}}return te!=null&&te.validate?te.validate(A):(!te&&((W=A==null?void 0:A.warn)!==null&&W!==void 0?W:!0)&&process.env.NODE_ENV!=="production"&&l.warn(`field with path ${N} was not found`),Promise.resolve({errors:[],valid:!0}))}function E(N){qc(C.value,N)}function _(N,A,W=!1){H(N,A),gn(c,N,A),W&&!(t!=null&&t.initialValues)&&gn(v.value,N,De(A))}function H(N,A,W=!1){gn(C.value,N,De(A)),W&&gn(v.value,N,De(A))}async function se(){const N=l.unref($);if(!N)return{valid:!0,results:{},errors:{}};o.value=!0;const A=xo(N)||Gt(N)?await N0(N,c):await M0(N,c,{names:k.value,bailsMap:x.value});return o.value=!1,A}const Me=L((N,{evt:A})=>{Wc(A)&&A.target.submit()});l.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&Ee(t.initialTouched),t!=null&&t.validateOnMount){lt();return}U.validateSchema&&U.validateSchema("silent")}),l.isRef($)&&l.watch($,()=>{var N;(N=U.validateSchema)===null||N===void 0||N.call(U,"validated-only")}),l.provide(xi,U),process.env.NODE_ENV!=="production"&&(I0(U),l.watch(()=>Object.assign(Object.assign({errors:g.value},D.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Lr,{deep:!0}));function _e(N,A){const W=Ke(A)||A==null?void 0:A.label,te=T(l.toValue(N))||V(N,{label:W}),de=()=>Ke(A)?A(Co(te,_o)):A||{};function M(){var we;te.touched=!0,((we=de().validateOnBlur)!==null&&we!==void 0?we:sr().validateOnBlur)&&ht(te.path)}function X(){var we;((we=de().validateOnInput)!==null&&we!==void 0?we:sr().validateOnInput)&&l.nextTick(()=>{ht(te.path)})}function re(){var we;((we=de().validateOnChange)!==null&&we!==void 0?we:sr().validateOnChange)&&l.nextTick(()=>{ht(te.path)})}const me=l.computed(()=>{const we={onChange:re,onInput:X,onBlur:M};return Ke(A)?Object.assign(Object.assign({},we),A(Co(te,_o)).props||{}):A!=null&&A.props?Object.assign(Object.assign({},we),A.props(Co(te,_o))):we});return[ve(N,()=>{var we,Ae,ze;return(ze=(we=de().validateOnModelUpdate)!==null&&we!==void 0?we:(Ae=sr())===null||Ae===void 0?void 0:Ae.validateOnModelUpdate)!==null&&ze!==void 0?ze:!0}),me]}function Oe(N){return Array.isArray(N)?N.map(A=>ve(A,!0)):ve(N)}function P(N,A){const[W,te]=_e(N,A);function de(){te.value.onBlur()}function M(re){const me=So(re);j(l.toValue(N),me,!1),te.value.onInput()}function X(re){const me=So(re);j(l.toValue(N),me,!1),te.value.onChange()}return l.computed(()=>Object.assign(Object.assign({},te.value),{onBlur:de,onInput:M,onChange:X,value:W.value}))}function Z(N,A){const[W,te]=_e(N,A),de=T(l.toValue(N));function M(X){W.value=X}return l.computed(()=>{const X=Ke(A)?A(Co(de,_o)):A||{};return Object.assign({[X.model||"modelValue"]:W.value,[`onUpdate:${X.model||"modelValue"}`]:M},te.value)})}return Object.assign(Object.assign({},U),{values:l.readonly(c),handleReset:()=>at(),submitForm:Me})}function Q0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=l.computed(()=>!pt(e,l.unref(n)));function s(){const c=t.value;return xt(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const a=l.reactive(s());return l.watchEffect(()=>{const c=s();a.touched=c.touched,a.valid=c.valid,a.pending=c.pending}),l.computed(()=>Object.assign(Object.assign({initialValues:l.unref(n)},a),{valid:a.valid&&!xt(r.value).length,dirty:o.value}))}function ey(t,e,n){const r=cd(n),i=l.ref(r),o=l.ref(De(r));function s(a,c=!1){i.value=vi(De(i.value)||{},De(a)),o.value=vi(De(o.value)||{},De(a)),c&&t.value.forEach(d=>{if(d.touched)return;const f=wt(i.value,d.path);gn(e,d.path,De(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function ty(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const ny=l.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=l.toRef(t,"validationSchema"),r=l.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:a,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetField:S}=X0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),D=y((T,{evt:R})=>{Wc(R)&&R.target.submit()},t.onInvalidSubmit),O=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):D;function $(T){Xs(T)&&T.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function V(T,R){return y(typeof T=="function"&&!R?T:R,t.onInvalidSubmit)(T)}function B(){return De(s)}function J(){return De(a.value)}function Y(){return De(i.value)}function I(){return{meta:a.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:V,handleReset:m,submitForm:D,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetForm:g,resetField:S,getValues:B,getMeta:J,getErrors:Y}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetForm:g,validate:h,validateField:p,resetField:S,getValues:B,getMeta:J,getErrors:Y,values:s,meta:a,errors:i}),function(){const R=t.as==="form"?t.as:t.as?l.resolveDynamicComponent(t.as):null,F=ia(R,e,I);if(!R)return F;const ee=R==="form"?{novalidate:!0}:{};return l.h(R,Object.assign(Object.assign(Object.assign({},ee),e.attrs),{onSubmit:O,onReset:$}),F)}}}),ry=l.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=l.inject(xi,void 0),r=l.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?l.resolveDynamicComponent(t.as):t.as,s=ia(o,e,i),a=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?l.h(o||"span",a,r.value):l.h(o,a,s)}}});function iy(t){const e=ta(xi),n=t?void 0:l.inject(zc);return l.computed(()=>t?e==null?void 0:e.errors.value[l.toValue(t)]:n==null?void 0:n.errorMessage.value)}Kt("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),Kt("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"}),Kt("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"),Kt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Kt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Kt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Kt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Kt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Kt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Kt("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"}),Kt("number",t=>parseFloat(t)?!0:"This field must be a number");const be=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},oy={},sy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},ay=[l.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 ly(t,e){return l.openBlock(),l.createElementBlock("svg",sy,ay)}const cy=be(oy,[["render",ly]]),dy={},uy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},fy=[l.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 hy(t,e){return l.openBlock(),l.createElementBlock("svg",uy,fy)}const py=be(dy,[["render",hy]]),my={class:"relative"},Ir=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",my,[l.createVNode(cy,{class:"absolute opacity-25"}),l.createVNode(py,{class:l.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let fe={theme:"wpic-tools",popoverTarget:"body"};const gy=["is","type","disabled"],yy={key:0,class:"absolute inset-0 flex justify-center items-center"},by={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},ky=["onClick"],_i=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled: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=l.ref(null),r=l.ref(null),i=l.ref(!1),o=l.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)};l.onMounted(()=>{document.addEventListener("click",s)}),l.onUnmounted(()=>{document.removeEventListener("click",s)});const a={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"border-none ring-1 ring-black/5 dark:ring-white/10 bg-transparent text-iron-700 disabled:text-iron-700/50 enabled:hover:bg-iron-900/5 enabled:active:bg-iron-200 enabled:active:shadow-inner dark:enabled:border-iron-900 dark:disabled:border-iron-900 dark:text-iron-200 dark:enabled:hover:bg-iron-900 dark:enabled:active:bg-iron-930 dark:disabled:text-iron-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 bg-wpic-600 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:bg-wpic-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:bg-wpic-700 dark:enabled:active:shadow-inner dark:enabled:hover:bg-wpic-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 bg-iron-100 text-iron-800 disabled:text-iron-800/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:bg-iron-200 enabled:active:bg-iron-300 enabled:active:text-iron-800/80 dark:enabled:active:text-iron-200/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200 dark:bg-iron-900 dark:disabled:text-iron-200/50 dark:enabled:active:shadow-inner dark:enabled:hover:bg-iron-800 dark:enabled:active:bg-iron-700"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b bg-red-500 disabled:text-red-600/50 border-red-500 enabled:hover:bg-red-400 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":" text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/5 shadow-xs enabled:hover:bg-gray-50 enabled:active:text-gray-950/60 bg-white dark:bg-transparent dark:ring-1 dark:ring-gray-800 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:bg-white/10 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(k,x)=>{var w;return l.openBlock(),l.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:x[0]||(x[0]=b=>{var C;return(C=t.actions)!=null&&C.length?i.value=!i.value:null}),class:l.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&&!t.hideDisabled,"":t.outline&&!t.plain,"ring-0!":!t.outline,[`${a[l.unref(fe).theme]}`]:!0,[`${u[l.unref(fe).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[l.unref(fe).theme]}`]:t.secondary,[`${p[l.unref(fe).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[l.unref(fe).theme]}`]:t.primary&&t.plain,[`${y[l.unref(fe).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[l.unref(fe).theme]}`]:t.colorless,[`${h[l.unref(fe).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[l.unref(fe).theme]}`]:t.destructive&&t.plain,[`${d[l.unref(fe).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?(l.openBlock(),l.createElementBlock("div",yy,[l.createVNode(Ir,{class:"w-6 h-6"})])):l.createCommentVNode("",!0),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(o.value),{to:t.to,class:l.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:l.withCtx(()=>[l.renderSlot(k.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(w=t.actions)!=null&&w.length&&i.value?(l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[l.createElementVNode("div",by,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.actions,b=>(l.openBlock(),l.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},l.toDisplayString(b.label),9,ky))),256))])],512)):l.createCommentVNode("",!0)],10,gy)}}}),vy=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[l.unref(fe).theme]]])},[l.renderSlot(n.$slots,"default")],2))}}),wy={name:"WpicInputGroup"},xy={class:"wpic-input-group flex w-full"};function Ey(t,e,n,r,i,o){return l.openBlock(),l.createElementBlock("div",xy,[l.renderSlot(t.$slots,"default")])}const Cy=be(wy,[["render",Ey]]),Sy=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=l.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(a,c)=>(l.openBlock(),l.createBlock(l.unref(ny),{ref_key:"myForm",ref:n},{default:l.withCtx(({values:d,meta:u,errors:f})=>[l.renderSlot(a.$slots,"default")]),_:3},512))}}),Oi=Math.min,Vr=Math.max,Oo=Math.round,Ln=t=>({x:t,y:t}),_y={left:"right",right:"left",bottom:"top",top:"bottom"},Oy={start:"end",end:"start"};function la(t,e,n){return Vr(t,Oi(e,n))}function Ti(t,e){return typeof t=="function"?t(e):t}function lr(t){return t.split("-")[0]}function Ni(t){return t.split("-")[1]}function dd(t){return t==="x"?"y":"x"}function ca(t){return t==="y"?"height":"width"}function To(t){return["top","bottom"].includes(lr(t))?"y":"x"}function da(t){return dd(To(t))}function Ty(t,e,n){n===void 0&&(n=!1);const r=Ni(t),i=da(t),o=ca(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=No(s)),[s,No(s)]}function Ny(t){const e=No(t);return[ua(t),e,ua(e)]}function ua(t){return t.replace(/start|end/g,e=>Oy[e])}function My(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 Ay(t,e,n,r){const i=Ni(t);let o=My(lr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ua)))),o}function No(t){return t.replace(/left|right|bottom|top/g,e=>_y[e])}function Dy(t){return{top:0,right:0,bottom:0,left:0,...t}}function ud(t){return typeof t!="number"?Dy(t):{top:t,right:t,bottom:t,left:t}}function Mo(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 fd(t,e,n){let{reference:r,floating:i}=t;const o=To(e),s=da(e),a=ca(s),c=lr(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(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(Ni(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const $y=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=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}=fd(d,r,c),h=r,p={},m=0;for(let g=0;g<a.length;g++){const{name:y,fn:k}=a[g],{x,y:w,data:b,reset:C}=await k({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=w??f,p={...p,[y]:{...p[y],...b}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):C.rects),{x:u,y:f}=fd(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function hd(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ti(e,t),m=ud(p),y=a[h?f==="floating"?"reference":"floating":f],k=Mo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:c})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),b=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Mo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:c}):x);return{top:(k.top-C.top+m.top)/b.y,bottom:(C.bottom-k.bottom+m.bottom)/b.y,left:(k.left-C.left+m.left)/b.x,right:(C.right-k.right+m.right)/b.x}}const Ly=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:c}=e,{element:d,padding:u=0}=Ti(t,e)||{};if(d==null)return{};const f=ud(u),h={x:n,y:r},p=da(i),m=ca(p),g=await s.getDimensions(d),y=p==="y",k=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],C=h[p]-o.reference[p],v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let S=v?v[w]:0;(!S||!await(s.isElement==null?void 0:s.isElement(v)))&&(S=a.floating[w]||o.floating[m]);const D=b/2-C/2,O=S/2-g[m]/2-1,$=Oi(f[k],O),V=Oi(f[x],O),B=$,J=S-g[m]-V,Y=S/2-g[m]/2+D,I=la(B,Y,J),T=!c.arrow&&Ni(i)!=null&&Y!==I&&o.reference[m]/2-(Y<B?$:V)-g[m]/2<0,R=T?Y<B?Y-B:Y-J:0;return{[p]:h[p]+R,data:{[p]:I,centerOffset:Y-I-R,...T&&{alignmentOffset:R}},reset:T}}}),By=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Ti(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=lr(i),x=lr(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),b=h||(x||!g?[No(a)]:Ny(a));!h&&m!=="none"&&b.push(...Ay(a,g,m,w));const C=[a,...b],v=await hd(e,y),S=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&S.push(v[k]),f){const B=Ty(i,s,w);S.push(v[B[0]],v[B[1]])}if(D=[...D,{placement:i,overflows:S}],!S.every(B=>B<=0)){var O,$;const B=(((O=o.flip)==null?void 0:O.index)||0)+1,J=C[B];if(J)return{data:{index:B,overflows:D},reset:{placement:J}};let Y=($=D.filter(I=>I.overflows[0]<=0).sort((I,T)=>I.overflows[1]-T.overflows[1])[0])==null?void 0:$.placement;if(!Y)switch(p){case"bestFit":{var V;const I=(V=D.map(T=>[T.placement,T.overflows.filter(R=>R>0).reduce((R,F)=>R+F,0)]).sort((T,R)=>T[1]-R[1])[0])==null?void 0:V[0];I&&(Y=I);break}case"initialPlacement":Y=a;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};async function Iy(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=lr(n),a=Ni(n),c=To(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=Ti(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Vy=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,c=await Iy(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Py=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:k,y:x}=y;return{x:k,y:x}}},...c}=Ti(t,e),d={x:n,y:r},u=await hd(e,c),f=To(lr(i)),h=dd(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=p+u[y],w=p-u[k];p=la(x,p,w)}if(s){const y=f==="y"?"top":"left",k=f==="y"?"bottom":"right",x=m+u[y],w=m-u[k];m=la(x,m,w)}const g=a.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function cr(t){return fa(t)?(t.nodeName||"").toLowerCase():"#document"}function At(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bn(t){var e;return(e=(fa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fa(t){return t instanceof Node||t instanceof At(t).Node}function nn(t){return t instanceof Element||t instanceof At(t).Element}function rn(t){return t instanceof HTMLElement||t instanceof At(t).HTMLElement}function pd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof At(t).ShadowRoot}function Mi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Jt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Ry(t){return["table","td","th"].includes(cr(t))}function ha(t){const e=pa(),n=Jt(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 Fy(t){let e=In(t);for(;rn(e)&&!Pr(e);){if(ha(e))return e;e=In(e)}return null}function pa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pr(t){return["html","body","#document"].includes(cr(t))}function Jt(t){return At(t).getComputedStyle(t)}function Ao(t){return nn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function In(t){if(cr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||Bn(t);return pd(e)?e.host:e}function md(t){const e=In(t);return Pr(e)?t.ownerDocument?t.ownerDocument.body:t.body:rn(e)&&Mi(e)?e:md(e)}function ma(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=md(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=At(i);return o?e.concat(s,s.visualViewport||[],Mi(i)?i:[],s.frameElement&&n?ma(s.frameElement):[]):e.concat(i,ma(i,[],n))}function gd(t){const e=Jt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=rn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Oo(n)!==o||Oo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function yd(t){return nn(t)?t:t.contextElement}function Rr(t){const e=yd(t);if(!rn(e))return Ln(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=gd(e);let s=(o?Oo(n.width):n.width)/r,a=(o?Oo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const jy=Ln(0);function bd(t){const e=At(t);return!pa()||!e.visualViewport?jy:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function zy(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==At(t)?!1:e}function Ai(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=yd(t);let s=Ln(1);e&&(r?nn(r)&&(s=Rr(r)):s=Rr(t));const a=zy(o,n,r)?bd(o):Ln(0);let c=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=At(o),p=r&&nn(r)?At(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Rr(g),k=g.getBoundingClientRect(),x=Jt(g),w=k.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,b=k.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=w,d+=b,m=At(g),g=m.frameElement}}return Mo({width:u,height:f,x:c,y:d})}const Hy=[":popover-open",":modal"];function ga(t){return Hy.some(e=>{try{return t.matches(e)}catch{return!1}})}function Wy(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Bn(r),a=e?ga(e.floating):!1;if(r===s||a&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Ln(1);const u=Ln(0),f=rn(r);if((f||!f&&!o)&&((cr(r)!=="body"||Mi(s))&&(c=Ao(r)),rn(r))){const h=Ai(r);d=Rr(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 Uy(t){return Array.from(t.getClientRects())}function kd(t){return Ai(Bn(t)).left+Ao(t).scrollLeft}function Yy(t){const e=Bn(t),n=Ao(t),r=t.ownerDocument.body,i=Vr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Vr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+kd(t);const a=-n.scrollTop;return Jt(r).direction==="rtl"&&(s+=Vr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function qy(t,e){const n=At(t),r=Bn(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const d=pa();(!d||d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}function Ky(t,e){const n=Ai(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=rn(t)?Rr(t):Ln(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:a,x:c,y:d}}function vd(t,e,n){let r;if(e==="viewport")r=qy(t,n);else if(e==="document")r=Yy(Bn(t));else if(nn(e))r=Ky(e,n);else{const i=bd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Mo(r)}function wd(t,e){const n=In(t);return n===e||!nn(n)||Pr(n)?!1:Jt(n).position==="fixed"||wd(n,e)}function Gy(t,e){const n=e.get(t);if(n)return n;let r=ma(t,[],!1).filter(a=>nn(a)&&cr(a)!=="body"),i=null;const o=Jt(t).position==="fixed";let s=o?In(t):t;for(;nn(s)&&!Pr(s);){const a=Jt(s),c=ha(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mi(s)&&!c&&wd(t,s))?r=r.filter(u=>u!==s):i=a,s=In(s)}return e.set(t,r),r}function Jy(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?ga(e)?[]:Gy(e,this._c):[].concat(n),r],a=s[0],c=s.reduce((d,u)=>{const f=vd(e,u,i);return d.top=Vr(f.top,d.top),d.right=Oi(f.right,d.right),d.bottom=Oi(f.bottom,d.bottom),d.left=Vr(f.left,d.left),d},vd(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Zy(t){const{width:e,height:n}=gd(t);return{width:e,height:n}}function Xy(t,e,n){const r=rn(e),i=Bn(e),o=n==="fixed",s=Ai(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const c=Ln(0);if(r||!r&&!o)if((cr(e)!=="body"||Mi(i))&&(a=Ao(e)),r){const f=Ai(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=kd(i));const d=s.left+a.scrollLeft-c.x,u=s.top+a.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function ya(t){return Jt(t).position==="static"}function xd(t,e){return!rn(t)||Jt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ed(t,e){const n=At(t);if(ga(t))return n;if(!rn(t)){let i=In(t);for(;i&&!Pr(i);){if(nn(i)&&!ya(i))return i;i=In(i)}return n}let r=xd(t,e);for(;r&&Ry(r)&&ya(r);)r=xd(r,e);return r&&Pr(r)&&ya(r)&&!ha(r)?n:r||Fy(t)||n}const Qy=async function(t){const e=this.getOffsetParent||Ed,n=this.getDimensions,r=await n(t.floating);return{reference:Xy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function e1(t){return Jt(t).direction==="rtl"}const t1={convertOffsetParentRelativeRectToViewportRelativeRect:Wy,getDocumentElement:Bn,getClippingRect:Jy,getOffsetParent:Ed,getElementRects:Qy,getClientRects:Uy,getDimensions:Zy,getScale:Rr,isElement:nn,isRTL:e1},Cd=Vy,Sd=Py,_d=By,n1=Ly,Od=(t,e,n)=>{const r=new Map,i={platform:t1,...n},o={...i.platform,_c:r};return $y(t,e,{...i,platform:o})};function r1(t){return t!=null&&typeof t=="object"&&"$el"in t}function i1(t){if(r1(t)){const e=t.$el;return fa(e)&&cr(e)==="#comment"?null:e}return t}function o1(t){return{name:"arrow",options:t,fn(e){const n=i1(l.unref(t.element));return n==null?{}:n1({element:n,padding:t.padding}).fn(e)}}}const s1={},a1={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},l1=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function c1(t,e){return l.openBlock(),l.createElementBlock("svg",a1,l1)}const Di=be(s1,[["render",c1]]);let Do;const d1=new Uint8Array(16);function u1(){if(!Do&&(Do=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Do))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Do(d1)}const nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));function f1(t,e=0){return nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]}const Td={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ba(t,e,n){if(Td.randomUUID&&!t)return Td.randomUUID();t=t||{};const r=t.random||(t.rng||u1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,f1(r)}let h1={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)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const a=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(a&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const dr=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"},transparent:Boolean,noBorder:Boolean,noShadow:Boolean,expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=ba(),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"},a=l.ref(null),c=l.ref(null),d=l.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(k){if(d.value)u();else{if(o.noCloseClasses.some(x=>k.target.closest(`.${x}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const k=await Od(a.value,c.value,{placement:o.placement,middleware:[_d(),Sd(),Cd(o.offset)]});c.value.style.left=`${k.x}px`,c.value.style.top=`${k.y}px`}const m=k=>{c.value&&!c.value.contains(k.target)&&a.value&&!a.value.contains(k.target)&&h()};l.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",k=>{k.detail.uuid!==r&&h()})}),l.onUnmounted(()=>{document.removeEventListener("click",m),document.removeEventListener("submenu-open",h)});function g(){o.hover&&u()}function y(){o.hover&&h()}return e({hide:h}),(k,x)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[(l.openBlock(),l.createElementBlock("div",{class:"flex-1",key:`reference_${l.unref(r)}`,ref_key:"reference",ref:a,onMouseenter:g,onMouseleave:y,onClick:x[0]||(x[0]=l.withModifiers(w=>f(w),["stop"]))},[l.renderSlot(k.$slots,"default",{isHidden:d.value})],32)),(l.openBlock(),l.createBlock(l.Teleport,{to:l.unref(fe).popoverTarget},[(l.openBlock(),l.createElementBlock("div",{key:`floating_${l.unref(r)}`,ref_key:"floating",ref:c,style:l.normalizeStyle({maxWidth:t.maxWidth}),class:l.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[l.unref(fe).theme]}`]:!d.value,"bg-transparent!":t.transparent,"border-none!":t.noBorder,"shadow-none":t.noShadow,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[l.renderSlot(k.$slots,"content")],6))],8,["to"]))],64))}});/*!
|
|
5
|
+
*/function Ke(t){return typeof t=="function"}function Vc(t){return t==null}const $n=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Js(t){return Number(t)>=0}function r0(t){const e=parseFloat(t);return isNaN(e)?t:e}function i0(t){return typeof t=="object"&&t!==null}function o0(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function Pc(t){if(!i0(t)||o0(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 vi(t,e){return Object.keys(e).forEach(n=>{if(Pc(e[n])&&Pc(t[n])){t[n]||(t[n]={}),vi(t[n],e[n]);return}t[n]=e[n]}),t}function wi(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Js(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Rc={};function Kt(t,e){a0(t,e),Rc[t]=e}function s0(t){return Rc[t]}function a0(t,e){if(!Ke(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function Fc(t,e,n){typeof n.value=="object"&&(n.value=De(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function De(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(De(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,a){i.set(De(a),De(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(De(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++)Fc(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]||Fc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const xi=Symbol("vee-validate-form"),jc=Symbol("vee-validate-field-instance"),wo=Symbol("Default empty value"),l0=typeof window<"u";function Zs(t){return Ke(t)&&!!t.__locatorRef}function Gt(t){return!!t&&Ke(t.parse)&&t.__type==="VVTypedSchema"}function xo(t){return!!t&&Ke(t.validate)}function Ei(t){return t==="checkbox"||t==="radio"}function c0(t){return $n(t)||Array.isArray(t)}function d0(t){return Array.isArray(t)?t.length===0:$n(t)&&Object.keys(t).length===0}function Eo(t){return/^\[.+\]$/i.test(t)}function u0(t){return zc(t)&&t.multiple}function zc(t){return t.tagName==="SELECT"}function f0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function h0(t,e){return!f0(t,e)&&e.type!=="file"&&!Ei(e.type)}function Hc(t){return Xs(t)&&t.target&&"submit"in t.target}function Xs(t){return t?!!(typeof Event<"u"&&Ke(Event)&&t instanceof Event||t&&t.srcElement):!1}function Wc(t,e){return e in t&&t[e]!==wo}function pt(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(!pt(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(!pt(r[1],e.get(r[0])))return!1;return!0}if(Uc(t)&&Uc(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(!pt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Uc(t){return l0?t instanceof File:!1}function Qs(t){return Eo(t)?t.replace(/\[|\]/gi,""):t}function wt(t,e,n){return t?Eo(e)?t[Qs(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>c0(i)&&o in i?i[o]:n,t):n}function gn(t,e,n){if(Eo(e)){t[Qs(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)||Vc(i[r[o]]))&&(i[r[o]]=Js(r[o+1])?[]:{}),i=i[r[o]]}}function ea(t,e){if(Array.isArray(t)&&Js(e)){t.splice(Number(e),1);return}$n(t)&&delete t[e]}function Yc(t,e){if(Eo(e)){delete t[Qs(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){ea(r,n[o]);break}if(!(n[o]in r)||Vc(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>wt(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(d0(i[o])){if(o===0){ea(t,n[0]);continue}ea(i[o-1],n[o-1])}}function xt(t){return Object.keys(t)}function ta(t,e=void 0){const n=l.getCurrentInstance();return(n==null?void 0:n.provides[t])||l.inject(t,e)}function qc(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>pt(o,e));return i>=0?r.splice(i,1):r.push(e),r}return pt(t,e)?n:e}function p0(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 Kc(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 m0(t,e){return $n(e)&&e.number?r0(t):t}function na(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 ra(t){return Array.isArray(t)?t:t?[t]:[]}function Co(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function g0(t){let e=null,n=[];return function(...r){const i=l.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 ia(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 oa(t){if(Gc(t))return t._value}function Gc(t){return"_value"in t}function y0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function So(t){if(!Xs(t))return t;const e=t.target;if(Ei(e.type)&&Gc(e))return oa(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(u0(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(oa);if(zc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?oa(n):e.value}return y0(e)}function Jc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?$n(t)&&t._$$isNormalized?t:$n(t)?Object.keys(t).reduce((n,r)=>{const i=b0(t[r]);return t[r]!==!1&&(n[r]=Zc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=k0(r);return i.name&&(n[i.name]=Zc(i.params)),n},e):e}function b0(t){return t===!0?[]:Array.isArray(t)||$n(t)?t:[t]}function Zc(t){const e=n=>typeof n=="string"&&n[0]==="@"?v0(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 k0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function v0(t){const e=n=>wt(n,t)||n[t];return e.__locatorRef=t,e}function w0(t){return Array.isArray(t)?t.filter(Zs):xt(t).filter(e=>Zs(t[e])).map(e=>t[e])}let x0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const sr=()=>x0;async function Xc(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 E0(i,t)).errors;return{errors:s,valid:!s.length}}async function E0(t,e){if(Gt(t.rules)||xo(t.rules))return S0(e,t.rules);if(Ke(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},a=Array.isArray(t.rules)?t.rules:[t.rules],c=a.length,d=[];for(let u=0;u<c;u++){const f=a[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:ed(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Jc(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const a=i[s],c=await _0(n,e,{name:a,params:n.rules[a]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function C0(t){return!!t&&t.name==="ValidationError"}function Qc(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!C0(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,a)=>{const c=a.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...a.errors),s},{});return{errors:Object.values(o)}}}}}async function S0(t,e){const r=await(Gt(e)?e:Qc(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function _0(t,e,n){const r=s0(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=O0(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:ed(o)}}function ed(t){const e=sr().generateMessage;return e?e(t):"Field is invalid"}function O0(t,e){const n=r=>Zs(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 T0(t,e){const r=await(Gt(t)?t:Qc(t)).parse(De(e)),i={},o={};for(const s of r.errors){const a=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!a.length,errors:a},a.length&&(o[c]=a[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function N0(t,e,n){const i=xt(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 Xc(wt(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),a={},c={};for(const d of s)a[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:a,errors:c}}let td=0;function M0(t,e){const{value:n,initialValue:r,setInitialValue:i}=A0(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}=L0(),u=td>=Number.MAX_SAFE_INTEGER?0:++td,f=$0(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=l.computed(()=>o.errors);function a(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(l.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(l.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:a}}function A0(t,e,n){const r=l.ref(l.unref(e));function i(){return n?wt(n.initialValues.value,l.unref(t),l.unref(r)):l.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(l.unref(t),d,!0)}const s=l.computed(i);if(!n)return{value:l.ref(i()),initialValue:s,setInitialValue:o};const a=D0(e,n,s,t);return n.stageInitialValue(l.unref(t),a,!0),{value:l.computed({get(){return wt(n.values,l.unref(t))},set(d){n.setFieldValue(l.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function D0(t,e,n,r){return l.isRef(t)?l.unref(t):t!==void 0?t:wt(e.values,l.unref(r),l.unref(n))}function $0(t,e,n,r){const i=l.computed(()=>{var s,a,c;return(c=(a=(s=l.toValue(r))===null||s===void 0?void 0:s.describe)===null||a===void 0?void 0:a.call(s).required)!==null&&c!==void 0?c:!1}),o=l.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!l.unref(n).length,initialValue:l.computed(()=>l.unref(e)),dirty:l.computed(()=>!pt(l.unref(t),l.unref(e)))});return l.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function L0(){const t=l.ref([]);return{errors:t,setErrors:e=>{t.value=ra(e)}}}function nd(t){process.env.NODE_ENV!=="production"&&n0({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"},V0)}const Ci={},Si={};let yn;const Lr=p0(()=>{setTimeout(async()=>{await l.nextTick(),yn==null||yn.sendInspectorState(Br),yn==null||yn.sendInspectorTree(Br)},100)},100);function B0(t){const e=l.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;nd(n)}Ci[t.formId]=Object.assign({},t),Ci[t.formId]._vm=e,l.onUnmounted(()=>{delete Ci[t.formId],Lr()}),Lr()}function I0(t){const e=l.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;nd(n)}Si[t.id]=Object.assign({},t),Si[t.id]._vm=e,l.onUnmounted(()=>{delete Si[t.id],Lr()}),Lr()}const Br="vee-validate-inspector",Et={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let He=null;function V0(t){yn=t,t.addInspector({id:Br,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!He){console.error("There is not a valid selected vee-validate node or component");return}if(He.type==="field"){await He.field.validate();return}if(He.type==="form"){await He.form.validate();return}He.type==="pathState"&&await He.form.validateField(He.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!He){console.error("There is not a valid selected vee-validate node or component");return}if(He.type==="field"){He.field.resetField();return}He.type==="form"&&He.form.resetForm(),He.type==="pathState"&&He.form.resetField(He.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Br)return;const n=Object.values(Ci),r=Object.values(Si);e.rootNodes=[...n.map(P0),...r.map(i=>F0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Br||n.currentTab!==`custom-inspector:${Br}`)return;const{form:r,field:i,state:o,type:s}=j0(e.nodeId);if(r&&s==="form"){e.state=z0(r),He={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=id(o),He={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=id({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),He={field:i,type:"field"};return}He=null})}function P0(t){const{textColor:e,bgColor:n}=od(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{gn(r,l.unref(s.path),R0(s,t))});function i(s,a=[]){const c=[...a].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):$n(s)?{id:`${a.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...a,d]))}:Array.isArray(s)?{id:`${a.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...a,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:sa(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Et.white,backgroundColor:Et.unknown}]}}function R0(t,e){return{id:sa(e,t),label:l.unref(t.path),tags:rd(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function F0(t,e){return{id:sa(e,t),label:l.unref(t.name),tags:rd(!1,1,t.type,t.meta.valid,e)}}function rd(t,e,n,r,i){const{textColor:o,bgColor:s}=od(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Et.black,backgroundColor:Et.gray},n==="checkbox"?{label:"Checkbox",textColor:Et.white,backgroundColor:Et.blue}:void 0,n==="radio"?{label:"Radio",textColor:Et.white,backgroundColor:Et.purple}:void 0,t?{label:"Multiple",textColor:Et.black,backgroundColor:Et.orange}:void 0].filter(Boolean)}function sa(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:l.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 j0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Ci[e.f];if(!n&&e.ff){const i=Si[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 id(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 z0(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:xt(e.value).reduce((a,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(a[c]=u),a},{})}]}}function od(t){return{bgColor:t?Et.success:Et.error,textColor:t?Et.black:Et.white}}function H0(t,e,n){return Ei(n==null?void 0:n.type)?U0(t,e,n):sd(t,e,n)}function sd(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:a,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=W0(n),g=f?ta(xi):void 0,y=m||g,k=l.computed(()=>wi(l.toValue(t))),x=l.computed(()=>{if(l.toValue(y==null?void 0:y.schema))return;const j=l.unref(e);return xo(j)||Gt(j)||Ke(j)||Array.isArray(j)?j:Jc(j)}),v=!Ke(x.value)&&Gt(l.toValue(e)),{id:b,value:C,initialValue:w,meta:N,setState:L,errors:S,flags:D}=M0(k,{modelValue:r,form:y,bails:o,label:c,type:s,validate:x.value?_:void 0,schema:v?e:void 0}),F=l.computed(()=>S.value[0]);p&&Y0({value:C,prop:p,handleChange:P,shouldValidate:()=>d&&!D.pendingReset});const $=(q,j=!1)=>{N.touched=!0,j&&z()};async function U(q){var j,ce;if(y!=null&&y.validateSchema){const{results:le}=await y.validateSchema(q);return(j=le[l.toValue(k)])!==null&&j!==void 0?j:{valid:!0,errors:[]}}return x.value?Xc(C.value,x.value,{name:l.toValue(k),label:l.toValue(c),values:(ce=y==null?void 0:y.values)!==null&&ce!==void 0?ce:{},bails:o}):{valid:!0,errors:[]}}const z=na(async()=>(N.pending=!0,N.validated=!0,U("validated-only")),q=>(D.pendingUnmount[H.id]||(L({errors:q.errors}),N.pending=!1,N.valid=q.valid),q)),I=na(async()=>U("silent"),q=>(N.valid=q.valid,q));function _(q){return(q==null?void 0:q.mode)==="silent"?I():z()}function P(q,j=!0){const ce=So(q);he(ce,j)}l.onMounted(()=>{if(i)return z();(!y||!y.validateSchema)&&I()});function V(q){N.touched=q}function ee(q){var j;const ce=q&&"value"in q?q.value:w.value;L({value:De(ce),initialValue:De(ce),touched:(j=q==null?void 0:q.touched)!==null&&j!==void 0?j:!1,errors:(q==null?void 0:q.errors)||[]}),N.pending=!1,N.validated=!1,I()}const ie=l.getCurrentInstance();function he(q,j=!0){C.value=ie&&p?m0(q,ie.props.modelModifiers):q,(j?z:I)()}function ue(q){L({errors:Array.isArray(q)?q:[q]})}const B=l.computed({get(){return C.value},set(q){he(q,d)}}),H={id:b,name:k,label:c,value:B,meta:N,errors:S,errorMessage:F,type:s,checkedValue:a,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:ee,handleReset:()=>ee(),validate:_,handleChange:P,handleBlur:$,setState:L,setTouched:V,setErrors:ue,setValue:he};if(l.provide(jc,H),l.isRef(e)&&typeof l.unref(e)!="function"&&l.watch(e,(q,j)=>{pt(q,j)||(N.validated?z():I())},{deep:!0}),process.env.NODE_ENV!=="production"&&(H._vm=l.getCurrentInstance(),l.watch(()=>Object.assign(Object.assign({errors:S.value},N),{value:C.value}),Lr,{deep:!0}),y||I0(H)),!y)return H;const K=l.computed(()=>{const q=x.value;return!q||Ke(q)||xo(q)||Gt(q)||Array.isArray(q)?{}:Object.keys(q).reduce((j,ce)=>{const le=w0(q[ce]).map(ve=>ve.__locatorRef).reduce((ve,Ne)=>{const Ie=wt(y.values,Ne)||y.values[Ne];return Ie!==void 0&&(ve[Ne]=Ie),ve},{});return Object.assign(j,le),j},{})});return l.watch(K,(q,j)=>{if(!Object.keys(q).length)return;!pt(q,j)&&(N.validated?z():I())}),l.onBeforeUnmount(()=>{var q;const j=(q=l.toValue(H.keepValueOnUnmount))!==null&&q!==void 0?q:l.toValue(y.keepValuesOnUnmount),ce=l.toValue(k);if(j||!y||D.pendingUnmount[H.id]){y==null||y.removePathState(ce,b);return}D.pendingUnmount[H.id]=!0;const le=y.getPathState(ce);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(H.id):(le==null?void 0:le.id)===H.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const Ne=le.value.findIndex(Ie=>pt(Ie,l.toValue(H.checkedValue)));if(Ne>-1){const Ie=[...le.value];Ie.splice(Ne,1),y.setFieldValue(ce,Ie)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(H.id),1)}else y.unsetPathValue(l.toValue(k));y.removePathState(ce,b)}}),H}function W0(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||{}))?aa(l.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,a=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:a})}function U0(t,e,n){const r=n!=null&&n.standalone?void 0:ta(xi),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(a){const c=a.handleChange,d=l.computed(()=>{const f=l.toValue(a.value),h=l.toValue(i);return Array.isArray(f)?f.findIndex(p=>pt(p,h))>=0:pt(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&a.validate();return}const g=l.toValue(t),y=r==null?void 0:r.getPathState(g),k=So(f);let x=(m=l.toValue(i))!==null&&m!==void 0?m:k;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=qc(wt(r.values,g)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=qc(l.toValue(a.value),x,l.toValue(o))),c(x,h)}return Object.assign(Object.assign({},a),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(sd(t,e,n))}function Y0({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=l.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&&(l.watch(e,a=>{pt(a,aa(i,o))||i.emit(s,a)}),l.watch(()=>aa(i,o),a=>{if(a===wo&&e.value===void 0)return;const c=a===wo?void 0:a;pt(c,e.value)||n(c,r())}))}function aa(t,e){if(t)return t.props[e]}const q0=l.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:()=>sr().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:wo},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=l.toRef(t,"rules"),r=l.toRef(t,"name"),i=l.toRef(t,"label"),o=l.toRef(t,"uncheckedValue"),s=l.toRef(t,"keepValue"),{errors:a,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:k,setErrors:x}=H0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:G0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),v=function(S,D=!0){f(S,D)},b=l.computed(()=>{const{validateOnInput:L,validateOnChange:S,validateOnBlur:D,validateOnModelUpdate:F}=K0(t);function $(_){h(_,D),Ke(e.attrs.onBlur)&&e.attrs.onBlur(_)}function U(_){v(_,L),Ke(e.attrs.onInput)&&e.attrs.onInput(_)}function z(_){v(_,S),Ke(e.attrs.onChange)&&e.attrs.onChange(_)}const I={name:t.name,onBlur:$,onInput:U,onChange:z};return I["onUpdate:modelValue"]=_=>v(_,F),I}),C=l.computed(()=>{const L=Object.assign({},b.value);Ei(e.attrs.type)&&k&&(L.checked=k.value);const S=ad(t,e);return h0(S,e.attrs)&&(L.value=c.value),L}),w=l.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:c.value}));function N(){return{field:C.value,componentField:w.value,value:c.value,meta:y,errors:a.value,errorMessage:d.value,validate:u,resetField:m,handleChange:v,handleInput:L=>v(L,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:c,meta:y,errors:a,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const L=l.resolveDynamicComponent(ad(t,e)),S=ia(L,e,N);return L?l.h(L,Object.assign(Object.assign({},e.attrs),C.value),S):S}}});function ad(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function K0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:a,validateOnModelUpdate:c}=sr();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:a,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function G0(t,e){return Ei(e.attrs.type)?Wc(t,"modelValue")?t.modelValue:void 0:Wc(t,"modelValue")?t.modelValue:e.attrs.value}const ar=q0;let J0=0;const _o=["bails","fieldsCount","id","multiple","type","validate"];function ld(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},l.toValue(e)),r=l.unref(t==null?void 0:t.validationSchema);return r&&Gt(r)&&Ke(r.cast)?De(r.cast(n)||{}):De(n)}function Z0(t){var e;const n=J0++;let r=0;const i=l.ref(!1),o=l.ref(!1),s=l.ref(0),a=[],c=l.reactive(ld(t)),d=l.ref([]),u=l.ref({}),f=l.ref({}),h=g0(()=>{f.value=d.value.reduce((T,A)=>(T[wi(l.toValue(A.path))]=A,T),{})});function p(T,A){const Y=_(T);if(!Y){typeof T=="string"&&(u.value[wi(T)]=ra(A));return}if(typeof T=="string"){const te=wi(T);u.value[te]&&delete u.value[te]}Y.errors=ra(A),Y.valid=!Y.errors.length}function m(T){xt(T).forEach(A=>{p(A,T[A])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=l.computed(()=>{const T=d.value.reduce((A,Y)=>(Y.errors.length&&(A[Y.path]=Y.errors),A),{});return Object.assign(Object.assign({},u.value),T)}),y=l.computed(()=>xt(g.value).reduce((T,A)=>{const Y=g.value[A];return Y!=null&&Y.length&&(T[A]=Y[0]),T},{})),k=l.computed(()=>d.value.reduce((T,A)=>(T[A.path]={name:A.path||"",label:A.label||""},T),{})),x=l.computed(()=>d.value.reduce((T,A)=>{var Y;return T[A.path]=(Y=A.bails)!==null&&Y!==void 0?Y:!0,T},{})),v=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:C,originalInitialValues:w,setInitialValues:N}=Q0(d,c,t),L=X0(d,c,w,y),S=l.computed(()=>d.value.reduce((T,A)=>{const Y=wt(c,A.path);return gn(T,A.path,Y),T},{})),D=t==null?void 0:t.validationSchema;function F(T,A){var Y,te;const de=l.computed(()=>wt(C.value,l.toValue(T))),M=f.value[l.toValue(T)],X=(A==null?void 0:A.type)==="checkbox"||(A==null?void 0:A.type)==="radio";if(M&&X){M.multiple=!0;const vt=r++;return Array.isArray(M.id)?M.id.push(vt):M.id=[M.id,vt],M.fieldsCount++,M.__flags.pendingUnmount[vt]=!1,M}const re=l.computed(()=>wt(c,l.toValue(T))),me=l.toValue(T),ye=V.findIndex(vt=>vt===me);ye!==-1&&V.splice(ye,1);const we=l.computed(()=>{var vt,Rt,Dr,or;const mn=l.toValue(D);if(Gt(mn))return(Rt=(vt=mn.describe)===null||vt===void 0?void 0:vt.call(mn,l.toValue(T)).required)!==null&&Rt!==void 0?Rt:!1;const vo=l.toValue(A==null?void 0:A.schema);return Gt(vo)&&(or=(Dr=vo.describe)===null||Dr===void 0?void 0:Dr.call(vo).required)!==null&&or!==void 0?or:!1}),Ae=r++,ze=l.reactive({id:Ae,path:T,touched:!1,pending:!1,valid:!0,validated:!!(!((Y=v[me])===null||Y===void 0)&&Y.length),required:we,initialValue:de,errors:l.shallowRef([]),bails:(te=A==null?void 0:A.bails)!==null&&te!==void 0?te:!1,label:A==null?void 0:A.label,type:(A==null?void 0:A.type)||"default",value:re,multiple:!1,__flags:{pendingUnmount:{[Ae]:!1},pendingReset:!1},fieldsCount:1,validate:A==null?void 0:A.validate,dirty:l.computed(()=>!pt(l.unref(re),l.unref(de)))});return d.value.push(ze),f.value[me]=ze,h(),y.value[me]&&!v[me]&&l.nextTick(()=>{ht(me,{mode:"silent"})}),l.isRef(T)&&l.watch(T,vt=>{h();const Rt=De(re.value);f.value[vt]=ze,l.nextTick(()=>{gn(c,vt,Rt)})}),ze}const $=Kc(se,5),U=Kc(se,5),z=na(async T=>await(T==="silent"?$():U()),(T,[A])=>{const Y=xt(q.errorBag.value),de=[...new Set([...xt(T.results),...d.value.map(M=>M.path),...Y])].sort().reduce((M,X)=>{var re;const me=X,ye=_(me)||P(me),we=((re=T.results[me])===null||re===void 0?void 0:re.errors)||[],Ae=l.toValue(ye==null?void 0:ye.path)||me,ze=ey({errors:we,valid:!we.length},M.results[Ae]);return M.results[Ae]=ze,ze.valid||(M.errors[Ae]=ze.errors[0]),ye&&u.value[Ae]&&delete u.value[Ae],ye?(ye.valid=ze.valid,A==="silent"||A==="validated-only"&&!ye.validated||p(ye,ze.errors),M):(p(Ae,we),M)},{valid:T.valid,results:{},errors:{}});return T.values&&(de.values=T.values),xt(de.results).forEach(M=>{var X;const re=_(M);re&&A!=="silent"&&(A==="validated-only"&&!re.validated||p(re,(X=de.results[M])===null||X===void 0?void 0:X.errors))}),de});function I(T){d.value.forEach(T)}function _(T){const A=typeof T=="string"?wi(T):T;return typeof A=="string"?f.value[A]:A}function P(T){return d.value.filter(Y=>T.startsWith(Y.path)).reduce((Y,te)=>Y?te.path.length>Y.path.length?te:Y:te,void 0)}let V=[],ee;function ie(T){return V.push(T),ee||(ee=l.nextTick(()=>{[...V].sort().reverse().forEach(Y=>{Yc(c,Y)}),V=[],ee=null})),ee}function he(T){return function(Y,te){return function(M){return M instanceof Event&&(M.preventDefault(),M.stopPropagation()),I(X=>X.touched=!0),i.value=!0,s.value++,lt().then(X=>{const re=De(c);if(X.valid&&typeof Y=="function"){const me=De(S.value);let ye=T?me:re;return X.values&&(ye=X.values),Y(ye,{evt:M,controlledValues:me,setErrors:m,setFieldError:p,setTouched:Ee,setFieldTouched:Ne,setValues:le,setFieldValue:j,resetForm:at,resetField:Mt})}!X.valid&&typeof te=="function"&&te({values:re,evt:M,errors:X.errors,results:X.results})}).then(X=>(i.value=!1,X),X=>{throw i.value=!1,X})}}}const B=he(!1);B.withControlled=he(!0);function H(T,A){const Y=d.value.findIndex(de=>de.path===T&&(Array.isArray(de.id)?de.id.includes(A):de.id===A)),te=d.value[Y];if(!(Y===-1||!te)){if(l.nextTick(()=>{ht(T,{mode:"silent",warn:!1})}),te.multiple&&te.fieldsCount&&te.fieldsCount--,Array.isArray(te.id)){const de=te.id.indexOf(A);de>=0&&te.id.splice(de,1),delete te.__flags.pendingUnmount[A]}(!te.multiple||te.fieldsCount<=0)&&(d.value.splice(Y,1),E(T),h(),delete f.value[T])}}function K(T){xt(f.value).forEach(A=>{A.startsWith(T)&&delete f.value[A]}),d.value=d.value.filter(A=>!A.path.startsWith(T)),l.nextTick(()=>{h()})}const q={formId:n,values:c,controlledValues:S,errorBag:g,errors:y,schema:D,submitCount:s,meta:L,isSubmitting:i,isValidating:o,fieldArrays:a,keepValuesOnUnmount:b,validateSchema:l.unref(D)?z:void 0,validate:lt,setFieldError:p,validateField:ht,setFieldValue:j,setValues:le,setErrors:m,setFieldTouched:Ne,setTouched:Ee,resetForm:at,resetField:Mt,handleSubmit:B,useFieldModel:Oe,defineInputBinds:R,defineComponentBinds:Z,defineField:_e,stageInitialValue:O,unsetInitialValue:E,setFieldInitialValue:W,createPathState:F,getPathState:_,unsetPathValue:ie,removePathState:H,initialValues:C,getAllPathStates:()=>d.value,destroyPath:K,isFieldTouched:Ie,isFieldDirty:tt,isFieldValid:Q};function j(T,A,Y=!0){const te=De(A),de=typeof T=="string"?T:T.path;_(de)||F(de),gn(c,de,te),Y&&ht(de)}function ce(T,A=!0){xt(c).forEach(Y=>{delete c[Y]}),xt(T).forEach(Y=>{j(Y,T[Y],!1)}),A&<()}function le(T,A=!0){vi(c,T),a.forEach(Y=>Y&&Y.reset()),A&<()}function ve(T,A){const Y=_(l.toValue(T))||F(T);return l.computed({get(){return Y.value},set(te){var de;const M=l.toValue(T);j(M,te,(de=l.toValue(A))!==null&&de!==void 0?de:!1)}})}function Ne(T,A){const Y=_(T);Y&&(Y.touched=A)}function Ie(T){const A=_(T);return A?A.touched:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.touched)}function tt(T){const A=_(T);return A?A.dirty:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.dirty)}function Q(T){const A=_(T);return A?A.valid:d.value.filter(Y=>Y.path.startsWith(T)).every(Y=>Y.valid)}function Ee(T){if(typeof T=="boolean"){I(A=>{A.touched=T});return}xt(T).forEach(A=>{Ne(A,!!T[A])})}function Mt(T,A){var Y;const te=A&&"value"in A?A.value:wt(C.value,T),de=_(T);de&&(de.__flags.pendingReset=!0),W(T,De(te),!0),j(T,te,!1),Ne(T,(Y=A==null?void 0:A.touched)!==null&&Y!==void 0?Y:!1),p(T,(A==null?void 0:A.errors)||[]),l.nextTick(()=>{de&&(de.__flags.pendingReset=!1)})}function at(T,A){let Y=De(T!=null&&T.values?T.values:w.value);Y=A!=null&&A.force?Y:vi(w.value,Y),Y=Gt(D)&&Ke(D.cast)?D.cast(Y):Y,N(Y),I(te=>{var de;te.__flags.pendingReset=!0,te.validated=!1,te.touched=((de=T==null?void 0:T.touched)===null||de===void 0?void 0:de[te.path])||!1,j(te.path,wt(Y,te.path),!1),p(te.path,void 0)}),A!=null&&A.force?ce(Y,!1):le(Y,!1),m((T==null?void 0:T.errors)||{}),s.value=(T==null?void 0:T.submitCount)||0,l.nextTick(()=>{lt({mode:"silent"}),I(te=>{te.__flags.pendingReset=!1})})}async function lt(T){const A=(T==null?void 0:T.mode)||"force";if(A==="force"&&I(M=>M.validated=!0),q.validateSchema)return q.validateSchema(A);o.value=!0;const Y=await Promise.all(d.value.map(M=>M.validate?M.validate(T).then(X=>({key:M.path,valid:X.valid,errors:X.errors})):Promise.resolve({key:M.path,valid:!0,errors:[]})));o.value=!1;const te={},de={};for(const M of Y)te[M.key]={valid:M.valid,errors:M.errors},M.errors.length&&(de[M.key]=M.errors[0]);return{valid:Y.every(M=>M.valid),results:te,errors:de}}async function ht(T,A){var Y;const te=_(T);if(te&&(A==null?void 0:A.mode)!=="silent"&&(te.validated=!0),D){const{results:M}=await z((A==null?void 0:A.mode)||"validated-only");return M[T]||{errors:[],valid:!0}}return te!=null&&te.validate?te.validate(A):(!te&&((Y=A==null?void 0:A.warn)!==null&&Y!==void 0?Y:!0)&&process.env.NODE_ENV!=="production"&&l.warn(`field with path ${T} was not found`),Promise.resolve({errors:[],valid:!0}))}function E(T){Yc(C.value,T)}function O(T,A,Y=!1){W(T,A),gn(c,T,A),Y&&!(t!=null&&t.initialValues)&&gn(w.value,T,De(A))}function W(T,A,Y=!1){gn(C.value,T,De(A)),Y&&gn(w.value,T,De(A))}async function se(){const T=l.unref(D);if(!T)return{valid:!0,results:{},errors:{}};o.value=!0;const A=xo(T)||Gt(T)?await T0(T,c):await N0(T,c,{names:k.value,bailsMap:x.value});return o.value=!1,A}const Me=B((T,{evt:A})=>{Hc(A)&&A.target.submit()});l.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&Ee(t.initialTouched),t!=null&&t.validateOnMount){lt();return}q.validateSchema&&q.validateSchema("silent")}),l.isRef(D)&&l.watch(D,()=>{var T;(T=q.validateSchema)===null||T===void 0||T.call(q,"validated-only")}),l.provide(xi,q),process.env.NODE_ENV!=="production"&&(B0(q),l.watch(()=>Object.assign(Object.assign({errors:g.value},L.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Lr,{deep:!0}));function _e(T,A){const Y=Ke(A)||A==null?void 0:A.label,te=_(l.toValue(T))||F(T,{label:Y}),de=()=>Ke(A)?A(Co(te,_o)):A||{};function M(){var we;te.touched=!0,((we=de().validateOnBlur)!==null&&we!==void 0?we:sr().validateOnBlur)&&ht(te.path)}function X(){var we;((we=de().validateOnInput)!==null&&we!==void 0?we:sr().validateOnInput)&&l.nextTick(()=>{ht(te.path)})}function re(){var we;((we=de().validateOnChange)!==null&&we!==void 0?we:sr().validateOnChange)&&l.nextTick(()=>{ht(te.path)})}const me=l.computed(()=>{const we={onChange:re,onInput:X,onBlur:M};return Ke(A)?Object.assign(Object.assign({},we),A(Co(te,_o)).props||{}):A!=null&&A.props?Object.assign(Object.assign({},we),A.props(Co(te,_o))):we});return[ve(T,()=>{var we,Ae,ze;return(ze=(we=de().validateOnModelUpdate)!==null&&we!==void 0?we:(Ae=sr())===null||Ae===void 0?void 0:Ae.validateOnModelUpdate)!==null&&ze!==void 0?ze:!0}),me]}function Oe(T){return Array.isArray(T)?T.map(A=>ve(A,!0)):ve(T)}function R(T,A){const[Y,te]=_e(T,A);function de(){te.value.onBlur()}function M(re){const me=So(re);j(l.toValue(T),me,!1),te.value.onInput()}function X(re){const me=So(re);j(l.toValue(T),me,!1),te.value.onChange()}return l.computed(()=>Object.assign(Object.assign({},te.value),{onBlur:de,onInput:M,onChange:X,value:Y.value}))}function Z(T,A){const[Y,te]=_e(T,A),de=_(l.toValue(T));function M(X){Y.value=X}return l.computed(()=>{const X=Ke(A)?A(Co(de,_o)):A||{};return Object.assign({[X.model||"modelValue"]:Y.value,[`onUpdate:${X.model||"modelValue"}`]:M},te.value)})}return Object.assign(Object.assign({},q),{values:l.readonly(c),handleReset:()=>at(),submitForm:Me})}function X0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=l.computed(()=>!pt(e,l.unref(n)));function s(){const c=t.value;return xt(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const a=l.reactive(s());return l.watchEffect(()=>{const c=s();a.touched=c.touched,a.valid=c.valid,a.pending=c.pending}),l.computed(()=>Object.assign(Object.assign({initialValues:l.unref(n)},a),{valid:a.valid&&!xt(r.value).length,dirty:o.value}))}function Q0(t,e,n){const r=ld(n),i=l.ref(r),o=l.ref(De(r));function s(a,c=!1){i.value=vi(De(i.value)||{},De(a)),o.value=vi(De(o.value)||{},De(a)),c&&t.value.forEach(d=>{if(d.touched)return;const f=wt(i.value,d.path);gn(e,d.path,De(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function ey(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const ty=l.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=l.toRef(t,"validationSchema"),r=l.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:a,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:k,setFieldError:x,setFieldValue:v,setValues:b,setFieldTouched:C,setTouched:w,resetField:N}=Z0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),L=y((_,{evt:P})=>{Hc(P)&&P.target.submit()},t.onInvalidSubmit),S=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):L;function D(_){Xs(_)&&_.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function F(_,P){return y(typeof _=="function"&&!P?_:P,t.onInvalidSubmit)(_)}function $(){return De(s)}function U(){return De(a.value)}function z(){return De(i.value)}function I(){return{meta:a.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:F,handleReset:m,submitForm:L,setErrors:k,setFieldError:x,setFieldValue:v,setValues:b,setFieldTouched:C,setTouched:w,resetForm:g,resetField:N,getValues:$,getMeta:U,getErrors:z}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:v,setValues:b,setFieldTouched:C,setTouched:w,resetForm:g,validate:h,validateField:p,resetField:N,getValues:$,getMeta:U,getErrors:z,values:s,meta:a,errors:i}),function(){const P=t.as==="form"?t.as:t.as?l.resolveDynamicComponent(t.as):null,V=ia(P,e,I);if(!P)return V;const ee=P==="form"?{novalidate:!0}:{};return l.h(P,Object.assign(Object.assign(Object.assign({},ee),e.attrs),{onSubmit:S,onReset:D}),V)}}}),ny=l.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=l.inject(xi,void 0),r=l.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?l.resolveDynamicComponent(t.as):t.as,s=ia(o,e,i),a=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?l.h(o||"span",a,r.value):l.h(o,a,s)}}});function ry(t){const e=ta(xi),n=t?void 0:l.inject(jc);return l.computed(()=>t?e==null?void 0:e.errors.value[l.toValue(t)]:n==null?void 0:n.errorMessage.value)}Kt("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),Kt("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"}),Kt("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"),Kt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Kt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Kt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Kt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Kt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Kt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Kt("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"}),Kt("number",t=>parseFloat(t)?!0:"This field must be a number");const be=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},iy={},oy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},sy=[l.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 ay(t,e){return l.openBlock(),l.createElementBlock("svg",oy,sy)}const ly=be(iy,[["render",ay]]),cy={},dy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},uy=[l.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 fy(t,e){return l.openBlock(),l.createElementBlock("svg",dy,uy)}const hy=be(cy,[["render",fy]]),py={class:"relative"},Ir=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",py,[l.createVNode(ly,{class:"absolute opacity-25"}),l.createVNode(hy,{class:l.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let fe={theme:"wpic-tools",popoverTarget:"body"};const my=["is","type","disabled"],gy={key:0,class:"absolute inset-0 flex justify-center items-center"},yy={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},by=["onClick"],_i=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled: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=l.ref(null),r=l.ref(null),i=l.ref(!1),o=l.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)};l.onMounted(()=>{document.addEventListener("click",s)}),l.onUnmounted(()=>{document.removeEventListener("click",s)});const a={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"border-none ring-1 ring-black/5 dark:ring-white/10 bg-transparent text-iron-700 disabled:text-iron-700/50 enabled:hover:bg-iron-900/5 enabled:active:bg-iron-200 enabled:active:shadow-inner dark:enabled:border-iron-900 dark:disabled:border-iron-900 dark:text-iron-200 dark:enabled:hover:bg-iron-900 dark:enabled:active:bg-iron-930 dark:disabled:text-iron-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 bg-wpic-600 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:bg-wpic-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:bg-wpic-700 dark:enabled:active:shadow-inner dark:enabled:hover:bg-wpic-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 bg-iron-100 text-iron-800 disabled:text-iron-800/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:bg-iron-200 enabled:active:bg-iron-300 enabled:active:text-iron-800/80 dark:enabled:active:text-iron-200/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200 dark:bg-iron-900 dark:disabled:text-iron-200/50 dark:enabled:active:shadow-inner dark:enabled:hover:bg-iron-800 dark:enabled:active:bg-iron-700"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b bg-red-500 disabled:text-red-600/50 border-red-500 enabled:hover:bg-red-400 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":" text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/5 shadow-xs enabled:hover:bg-gray-50 enabled:active:text-gray-950/60 bg-white dark:bg-transparent dark:ring-1 dark:ring-gray-800 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:bg-white/10 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(k,x)=>{var v;return l.openBlock(),l.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:x[0]||(x[0]=b=>{var C;return(C=t.actions)!=null&&C.length?i.value=!i.value:null}),class:l.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&&!t.hideDisabled,"":t.outline&&!t.plain,"ring-0!":!t.outline,[`${a[l.unref(fe).theme]}`]:!0,[`${u[l.unref(fe).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[l.unref(fe).theme]}`]:t.secondary,[`${p[l.unref(fe).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[l.unref(fe).theme]}`]:t.primary&&t.plain,[`${y[l.unref(fe).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[l.unref(fe).theme]}`]:t.colorless,[`${h[l.unref(fe).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[l.unref(fe).theme]}`]:t.destructive&&t.plain,[`${d[l.unref(fe).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?(l.openBlock(),l.createElementBlock("div",gy,[l.createVNode(Ir,{class:"w-6 h-6"})])):l.createCommentVNode("",!0),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(o.value),{to:t.to,class:l.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:l.withCtx(()=>[l.renderSlot(k.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(v=t.actions)!=null&&v.length&&i.value?(l.openBlock(),l.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[l.createElementVNode("div",yy,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.actions,b=>(l.openBlock(),l.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},l.toDisplayString(b.label),9,by))),256))])],512)):l.createCommentVNode("",!0)],10,my)}}}),ky=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[l.unref(fe).theme]]])},[l.renderSlot(n.$slots,"default")],2))}}),vy={name:"WpicInputGroup"},wy={class:"wpic-input-group flex w-full"};function xy(t,e,n,r,i,o){return l.openBlock(),l.createElementBlock("div",wy,[l.renderSlot(t.$slots,"default")])}const Ey=be(vy,[["render",xy]]),Cy=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=l.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(a,c)=>(l.openBlock(),l.createBlock(l.unref(ty),{ref_key:"myForm",ref:n},{default:l.withCtx(({values:d,meta:u,errors:f})=>[l.renderSlot(a.$slots,"default")]),_:3},512))}}),Oi=Math.min,Vr=Math.max,Oo=Math.round,Ln=t=>({x:t,y:t}),Sy={left:"right",right:"left",bottom:"top",top:"bottom"},_y={start:"end",end:"start"};function la(t,e,n){return Vr(t,Oi(e,n))}function Ti(t,e){return typeof t=="function"?t(e):t}function lr(t){return t.split("-")[0]}function Ni(t){return t.split("-")[1]}function cd(t){return t==="x"?"y":"x"}function ca(t){return t==="y"?"height":"width"}function To(t){return["top","bottom"].includes(lr(t))?"y":"x"}function da(t){return cd(To(t))}function Oy(t,e,n){n===void 0&&(n=!1);const r=Ni(t),i=da(t),o=ca(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=No(s)),[s,No(s)]}function Ty(t){const e=No(t);return[ua(t),e,ua(e)]}function ua(t){return t.replace(/start|end/g,e=>_y[e])}function Ny(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 My(t,e,n,r){const i=Ni(t);let o=Ny(lr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ua)))),o}function No(t){return t.replace(/left|right|bottom|top/g,e=>Sy[e])}function Ay(t){return{top:0,right:0,bottom:0,left:0,...t}}function dd(t){return typeof t!="number"?Ay(t):{top:t,right:t,bottom:t,left:t}}function Mo(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 ud(t,e,n){let{reference:r,floating:i}=t;const o=To(e),s=da(e),a=ca(s),c=lr(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(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(Ni(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const Dy=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=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}=ud(d,r,c),h=r,p={},m=0;for(let g=0;g<a.length;g++){const{name:y,fn:k}=a[g],{x,y:v,data:b,reset:C}=await k({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=v??f,p={...p,[y]:{...p[y],...b}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):C.rects),{x:u,y:f}=ud(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function fd(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ti(e,t),m=dd(p),y=a[h?f==="floating"?"reference":"floating":f],k=Mo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:c})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),b=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},C=Mo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:v,strategy:c}):x);return{top:(k.top-C.top+m.top)/b.y,bottom:(C.bottom-k.bottom+m.bottom)/b.y,left:(k.left-C.left+m.left)/b.x,right:(C.right-k.right+m.right)/b.x}}const $y=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:c}=e,{element:d,padding:u=0}=Ti(t,e)||{};if(d==null)return{};const f=dd(u),h={x:n,y:r},p=da(i),m=ca(p),g=await s.getDimensions(d),y=p==="y",k=y?"top":"left",x=y?"bottom":"right",v=y?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],C=h[p]-o.reference[p],w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let N=w?w[v]:0;(!N||!await(s.isElement==null?void 0:s.isElement(w)))&&(N=a.floating[v]||o.floating[m]);const L=b/2-C/2,S=N/2-g[m]/2-1,D=Oi(f[k],S),F=Oi(f[x],S),$=D,U=N-g[m]-F,z=N/2-g[m]/2+L,I=la($,z,U),_=!c.arrow&&Ni(i)!=null&&z!==I&&o.reference[m]/2-(z<$?D:F)-g[m]/2<0,P=_?z<$?z-$:z-U:0;return{[p]:h[p]+P,data:{[p]:I,centerOffset:z-I-P,..._&&{alignmentOffset:P}},reset:_}}}),Ly=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Ti(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=lr(i),x=lr(a)===a,v=await(c.isRTL==null?void 0:c.isRTL(d.floating)),b=h||(x||!g?[No(a)]:Ty(a));!h&&m!=="none"&&b.push(...My(a,g,m,v));const C=[a,...b],w=await fd(e,y),N=[];let L=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&N.push(w[k]),f){const $=Oy(i,s,v);N.push(w[$[0]],w[$[1]])}if(L=[...L,{placement:i,overflows:N}],!N.every($=>$<=0)){var S,D;const $=(((S=o.flip)==null?void 0:S.index)||0)+1,U=C[$];if(U)return{data:{index:$,overflows:L},reset:{placement:U}};let z=(D=L.filter(I=>I.overflows[0]<=0).sort((I,_)=>I.overflows[1]-_.overflows[1])[0])==null?void 0:D.placement;if(!z)switch(p){case"bestFit":{var F;const I=(F=L.map(_=>[_.placement,_.overflows.filter(P=>P>0).reduce((P,V)=>P+V,0)]).sort((_,P)=>_[1]-P[1])[0])==null?void 0:F[0];I&&(z=I);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};async function By(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=lr(n),a=Ni(n),c=To(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=Ti(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Iy=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,c=await By(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Vy=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:k,y:x}=y;return{x:k,y:x}}},...c}=Ti(t,e),d={x:n,y:r},u=await fd(e,c),f=To(lr(i)),h=cd(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=p+u[y],v=p-u[k];p=la(x,p,v)}if(s){const y=f==="y"?"top":"left",k=f==="y"?"bottom":"right",x=m+u[y],v=m-u[k];m=la(x,m,v)}const g=a.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function cr(t){return fa(t)?(t.nodeName||"").toLowerCase():"#document"}function At(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bn(t){var e;return(e=(fa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fa(t){return t instanceof Node||t instanceof At(t).Node}function nn(t){return t instanceof Element||t instanceof At(t).Element}function rn(t){return t instanceof HTMLElement||t instanceof At(t).HTMLElement}function hd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof At(t).ShadowRoot}function Mi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Jt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Py(t){return["table","td","th"].includes(cr(t))}function ha(t){const e=pa(),n=Jt(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 Ry(t){let e=In(t);for(;rn(e)&&!Pr(e);){if(ha(e))return e;e=In(e)}return null}function pa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pr(t){return["html","body","#document"].includes(cr(t))}function Jt(t){return At(t).getComputedStyle(t)}function Ao(t){return nn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function In(t){if(cr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||hd(t)&&t.host||Bn(t);return hd(e)?e.host:e}function pd(t){const e=In(t);return Pr(e)?t.ownerDocument?t.ownerDocument.body:t.body:rn(e)&&Mi(e)?e:pd(e)}function ma(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=pd(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=At(i);return o?e.concat(s,s.visualViewport||[],Mi(i)?i:[],s.frameElement&&n?ma(s.frameElement):[]):e.concat(i,ma(i,[],n))}function md(t){const e=Jt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=rn(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Oo(n)!==o||Oo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function gd(t){return nn(t)?t:t.contextElement}function Rr(t){const e=gd(t);if(!rn(e))return Ln(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=md(e);let s=(o?Oo(n.width):n.width)/r,a=(o?Oo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Fy=Ln(0);function yd(t){const e=At(t);return!pa()||!e.visualViewport?Fy:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jy(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==At(t)?!1:e}function Ai(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=gd(t);let s=Ln(1);e&&(r?nn(r)&&(s=Rr(r)):s=Rr(t));const a=jy(o,n,r)?yd(o):Ln(0);let c=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=At(o),p=r&&nn(r)?At(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Rr(g),k=g.getBoundingClientRect(),x=Jt(g),v=k.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,b=k.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=v,d+=b,m=At(g),g=m.frameElement}}return Mo({width:u,height:f,x:c,y:d})}const zy=[":popover-open",":modal"];function ga(t){return zy.some(e=>{try{return t.matches(e)}catch{return!1}})}function Hy(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Bn(r),a=e?ga(e.floating):!1;if(r===s||a&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Ln(1);const u=Ln(0),f=rn(r);if((f||!f&&!o)&&((cr(r)!=="body"||Mi(s))&&(c=Ao(r)),rn(r))){const h=Ai(r);d=Rr(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 Wy(t){return Array.from(t.getClientRects())}function bd(t){return Ai(Bn(t)).left+Ao(t).scrollLeft}function Uy(t){const e=Bn(t),n=Ao(t),r=t.ownerDocument.body,i=Vr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Vr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+bd(t);const a=-n.scrollTop;return Jt(r).direction==="rtl"&&(s+=Vr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Yy(t,e){const n=At(t),r=Bn(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const d=pa();(!d||d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}function qy(t,e){const n=Ai(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=rn(t)?Rr(t):Ln(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:a,x:c,y:d}}function kd(t,e,n){let r;if(e==="viewport")r=Yy(t,n);else if(e==="document")r=Uy(Bn(t));else if(nn(e))r=qy(e,n);else{const i=yd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Mo(r)}function vd(t,e){const n=In(t);return n===e||!nn(n)||Pr(n)?!1:Jt(n).position==="fixed"||vd(n,e)}function Ky(t,e){const n=e.get(t);if(n)return n;let r=ma(t,[],!1).filter(a=>nn(a)&&cr(a)!=="body"),i=null;const o=Jt(t).position==="fixed";let s=o?In(t):t;for(;nn(s)&&!Pr(s);){const a=Jt(s),c=ha(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mi(s)&&!c&&vd(t,s))?r=r.filter(u=>u!==s):i=a,s=In(s)}return e.set(t,r),r}function Gy(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?ga(e)?[]:Ky(e,this._c):[].concat(n),r],a=s[0],c=s.reduce((d,u)=>{const f=kd(e,u,i);return d.top=Vr(f.top,d.top),d.right=Oi(f.right,d.right),d.bottom=Oi(f.bottom,d.bottom),d.left=Vr(f.left,d.left),d},kd(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Jy(t){const{width:e,height:n}=md(t);return{width:e,height:n}}function Zy(t,e,n){const r=rn(e),i=Bn(e),o=n==="fixed",s=Ai(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const c=Ln(0);if(r||!r&&!o)if((cr(e)!=="body"||Mi(i))&&(a=Ao(e)),r){const f=Ai(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=bd(i));const d=s.left+a.scrollLeft-c.x,u=s.top+a.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function ya(t){return Jt(t).position==="static"}function wd(t,e){return!rn(t)||Jt(t).position==="fixed"?null:e?e(t):t.offsetParent}function xd(t,e){const n=At(t);if(ga(t))return n;if(!rn(t)){let i=In(t);for(;i&&!Pr(i);){if(nn(i)&&!ya(i))return i;i=In(i)}return n}let r=wd(t,e);for(;r&&Py(r)&&ya(r);)r=wd(r,e);return r&&Pr(r)&&ya(r)&&!ha(r)?n:r||Ry(t)||n}const Xy=async function(t){const e=this.getOffsetParent||xd,n=this.getDimensions,r=await n(t.floating);return{reference:Zy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qy(t){return Jt(t).direction==="rtl"}const e1={convertOffsetParentRelativeRectToViewportRelativeRect:Hy,getDocumentElement:Bn,getClippingRect:Gy,getOffsetParent:xd,getElementRects:Xy,getClientRects:Wy,getDimensions:Jy,getScale:Rr,isElement:nn,isRTL:Qy},Ed=Iy,Cd=Vy,Sd=Ly,t1=$y,_d=(t,e,n)=>{const r=new Map,i={platform:e1,...n},o={...i.platform,_c:r};return Dy(t,e,{...i,platform:o})};function n1(t){return t!=null&&typeof t=="object"&&"$el"in t}function r1(t){if(n1(t)){const e=t.$el;return fa(e)&&cr(e)==="#comment"?null:e}return t}function i1(t){return{name:"arrow",options:t,fn(e){const n=r1(l.unref(t.element));return n==null?{}:t1({element:n,padding:t.padding}).fn(e)}}}const o1={},s1={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},a1=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function l1(t,e){return l.openBlock(),l.createElementBlock("svg",s1,a1)}const Di=be(o1,[["render",l1]]);let Do;const c1=new Uint8Array(16);function d1(){if(!Do&&(Do=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Do))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Do(c1)}const nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));function u1(t,e=0){return nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]}const Od={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ba(t,e,n){if(Od.randomUUID&&!t)return Od.randomUUID();t=t||{};const r=t.random||(t.rng||d1)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,u1(r)}let f1={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)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const a=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(a&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const dr=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"},transparent:Boolean,noBorder:Boolean,noShadow:Boolean,expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=ba(),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"},a=l.ref(null),c=l.ref(null),d=l.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(k){if(d.value)u();else{if(o.noCloseClasses.some(x=>k.target.closest(`.${x}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const k=await _d(a.value,c.value,{placement:o.placement,middleware:[Sd(),Cd(),Ed(o.offset)]});c.value.style.left=`${k.x}px`,c.value.style.top=`${k.y}px`}const m=k=>{c.value&&!c.value.contains(k.target)&&a.value&&!a.value.contains(k.target)&&h()};l.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",k=>{k.detail.uuid!==r&&h()})}),l.onUnmounted(()=>{document.removeEventListener("click",m),document.removeEventListener("submenu-open",h)});function g(){o.hover&&u()}function y(){o.hover&&h()}return e({hide:h}),(k,x)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[(l.openBlock(),l.createElementBlock("div",{class:"flex-1",key:`reference_${l.unref(r)}`,ref_key:"reference",ref:a,onMouseenter:g,onMouseleave:y,onClick:x[0]||(x[0]=l.withModifiers(v=>f(v),["stop"]))},[l.renderSlot(k.$slots,"default",{isHidden:d.value})],32)),(l.openBlock(),l.createBlock(l.Teleport,{to:l.unref(fe).popoverTarget},[(l.openBlock(),l.createElementBlock("div",{key:`floating_${l.unref(r)}`,ref_key:"floating",ref:c,style:l.normalizeStyle({maxWidth:t.maxWidth}),class:l.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[l.unref(fe).theme]}`]:!d.value,"bg-transparent!":t.transparent,"border-none!":t.noBorder,"shadow-none":t.noShadow,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[l.renderSlot(k.$slots,"content")],6))],8,["to"]))],64))}});/*!
|
|
6
6
|
* shared v9.14.4
|
|
7
7
|
* (c) 2025 kazuya kawaguchi
|
|
8
8
|
* Released under the MIT License.
|
|
9
|
-
*/const bn=typeof window<"u";let Dt,ur;if(process.env.NODE_ENV!=="production"){const t=bn&&window.performance;t&&t.mark&&t.measure&&t.clearMarks&&t.clearMeasures&&(Dt=e=>{t.mark(e)},ur=(e,n,r)=>{t.measure(e,n,r),t.clearMarks(n),t.clearMarks(r)})}const
|
|
10
|
-
`)}function Lo(t){let e=t;return()=>++e}function wn(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const
|
|
9
|
+
*/const bn=typeof window<"u";let Dt,ur;if(process.env.NODE_ENV!=="production"){const t=bn&&window.performance;t&&t.mark&&t.measure&&t.clearMarks&&t.clearMeasures&&(Dt=e=>{t.mark(e)},ur=(e,n,r)=>{t.measure(e,n,r),t.clearMarks(n),t.clearMarks(r)})}const h1=/\{([0-9a-zA-Z]+)\}/g;function ka(t,...e){return e.length===1&&Te(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(h1,(n,r)=>e.hasOwnProperty(r)?e[r]:"")}const kn=(t,e=!1)=>e?Symbol.for(t):Symbol(t),p1=(t,e,n)=>m1({l:t,k:e,s:n}),m1=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Ge=t=>typeof t=="number"&&isFinite(t),g1=t=>Ad(t)==="[object Date]",Fr=t=>Ad(t)==="[object RegExp]",$o=t=>Se(t)&&Object.keys(t).length===0,ct=Object.assign,y1=Object.create,$e=(t=null)=>y1(t);let Td;const vn=()=>Td||(Td=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:$e());function Nd(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const b1=Object.prototype.hasOwnProperty;function Zt(t,e){return b1.call(t,e)}const We=Array.isArray,Ve=t=>typeof t=="function",oe=t=>typeof t=="string",Le=t=>typeof t=="boolean",Te=t=>t!==null&&typeof t=="object",k1=t=>Te(t)&&Ve(t.then)&&Ve(t.catch),Md=Object.prototype.toString,Ad=t=>Md.call(t),Se=t=>{if(!Te(t))return!1;const e=Object.getPrototypeOf(t);return e===null||e.constructor===Object},v1=t=>t==null?"":We(t)||Se(t)&&t.toString===Md?JSON.stringify(t,null,2):String(t);function w1(t,e=""){return t.reduce((n,r,i)=>i===0?n+r:n+e+r,"")}const Dd=2;function x1(t,e=0,n=t.length){const r=t.split(/\r?\n/);let i=0;const o=[];for(let s=0;s<r.length;s++)if(i+=r[s].length+1,i>=e){for(let a=s-Dd;a<=s+Dd||n>i;a++){if(a<0||a>=r.length)continue;const c=a+1;o.push(`${c}${" ".repeat(3-String(c).length)}| ${r[a]}`);const d=r[a].length;if(a===s){const u=e-(i-d)+1,f=Math.max(1,n>i?d-u:n-e);o.push(" | "+" ".repeat(u)+"^".repeat(f))}else if(a>s){if(n>i){const u=Math.max(Math.min(n-i,d),1);o.push(" | "+"^".repeat(u))}i+=d+1}}break}return o.join(`
|
|
10
|
+
`)}function Lo(t){let e=t;return()=>++e}function wn(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const $d={};function Ld(t){$d[t]||($d[t]=!0,wn(t))}function E1(){const t=new Map;return{events:t,on(n,r){const i=t.get(n);i&&i.push(r)||t.set(n,[r])},off(n,r){const i=t.get(n);i&&i.splice(i.indexOf(r)>>>0,1)},emit(n,r){(t.get(n)||[]).slice().map(i=>i(r)),(t.get("*")||[]).slice().map(i=>i(n,r))}}}const Bo=t=>!Te(t)||We(t);function Io(t,e){if(Bo(t)||Bo(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:i}=n.pop();Object.keys(r).forEach(o=>{o!=="__proto__"&&(Te(r[o])&&!Te(i[o])&&(i[o]=Array.isArray(r[o])?[]:$e()),Bo(i[o])||Bo(r[o])?i[o]=r[o]:n.push({src:r[o],des:i[o]}))})}}/*!
|
|
11
11
|
* message-compiler v9.14.4
|
|
12
12
|
* (c) 2025 kazuya kawaguchi
|
|
13
13
|
* Released under the MIT License.
|
|
14
|
-
*/function
|
|
15
|
-
`,B1="\u2028",I1="\u2029";function V1(t){const e=t;let n=0,r=1,i=1,o=0;const s=S=>e[S]===L1&&e[S+1]===mt,a=S=>e[S]===mt,c=S=>e[S]===I1,d=S=>e[S]===B1,u=S=>s(S)||a(S)||c(S)||d(S),f=()=>n,h=()=>r,p=()=>i,m=()=>o,g=S=>s(S)||c(S)||d(S)?mt:e[S],y=()=>g(n),k=()=>g(n+o);function x(){return o=0,u(n)&&(r++,i=0),s(n)&&n++,n++,i++,e[n]}function w(){return s(n+o)&&o++,o++,e[n+o]}function b(){n=0,r=1,i=1,o=0}function C(S=0){o=S}function v(){const S=n+o;for(;S!==n;)x();o=0}return{index:f,line:h,column:p,peekOffset:m,charAt:g,currentChar:y,currentPeek:k,next:x,peek:w,reset:b,resetPeek:C,skipToPeek:v}}const Vn=void 0,P1=".",Fd="'",R1="tokenizer";function F1(t,e={}){const n=e.location!==!1,r=V1(t),i=()=>r.index(),o=()=>S1(r.line(),r.column(),r.index()),s=o(),a=i(),c={currentType:14,offset:a,startLoc:s,endLoc:s,lastType:14,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},d=()=>c,{onError:u}=e;function f(E,_,H,...se){const Me=d();if(_.column+=H,_.offset+=H,u){const _e=n?Vo(Me.startLoc,_):null,Oe=jr(E,_e,{domain:R1,args:se});u(Oe)}}function h(E,_,H){E.endLoc=o(),E.currentType=_;const se={type:_};return n&&(se.loc=Vo(E.startLoc,E.endLoc)),H!=null&&(se.value=H),se}const p=E=>h(E,14);function m(E,_){return E.currentChar()===_?(E.next(),_):(f(ge.EXPECTED_TOKEN,o(),0,_),"")}function g(E){let _="";for(;E.currentPeek()===xn||E.currentPeek()===mt;)_+=E.currentPeek(),E.peek();return _}function y(E){const _=g(E);return E.skipToPeek(),_}function k(E){if(E===Vn)return!1;const _=E.charCodeAt(0);return _>=97&&_<=122||_>=65&&_<=90||_===95}function x(E){if(E===Vn)return!1;const _=E.charCodeAt(0);return _>=48&&_<=57}function w(E,_){const{currentType:H}=_;if(H!==2)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function b(E,_){const{currentType:H}=_;if(H!==2)return!1;g(E);const se=E.currentPeek()==="-"?E.peek():E.currentPeek(),Me=x(se);return E.resetPeek(),Me}function C(E,_){const{currentType:H}=_;if(H!==2)return!1;g(E);const se=E.currentPeek()===Fd;return E.resetPeek(),se}function v(E,_){const{currentType:H}=_;if(H!==8)return!1;g(E);const se=E.currentPeek()===".";return E.resetPeek(),se}function S(E,_){const{currentType:H}=_;if(H!==9)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function D(E,_){const{currentType:H}=_;if(!(H===8||H===12))return!1;g(E);const se=E.currentPeek()===":";return E.resetPeek(),se}function O(E,_){const{currentType:H}=_;if(H!==10)return!1;const se=()=>{const _e=E.currentPeek();return _e==="{"?k(E.peek()):_e==="@"||_e==="%"||_e==="|"||_e===":"||_e==="."||_e===xn||!_e?!1:_e===mt?(E.peek(),se()):B(E,!1)},Me=se();return E.resetPeek(),Me}function $(E){g(E);const _=E.currentPeek()==="|";return E.resetPeek(),_}function V(E){const _=g(E),H=E.currentPeek()==="%"&&E.peek()==="{";return E.resetPeek(),{isModulo:H,hasSpace:_.length>0}}function B(E,_=!0){const H=(Me=!1,_e="",Oe=!1)=>{const P=E.currentPeek();return P==="{"?_e==="%"?!1:Me:P==="@"||!P?_e==="%"?!0:Me:P==="%"?(E.peek(),H(Me,"%",!0)):P==="|"?_e==="%"||Oe?!0:!(_e===xn||_e===mt):P===xn?(E.peek(),H(!0,xn,Oe)):P===mt?(E.peek(),H(!0,mt,Oe)):!0},se=H();return _&&E.resetPeek(),se}function J(E,_){const H=E.currentChar();return H===Vn?Vn:_(H)?(E.next(),H):null}function Y(E){const _=E.charCodeAt(0);return _>=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===95||_===36}function I(E){return J(E,Y)}function T(E){const _=E.charCodeAt(0);return _>=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===95||_===36||_===45}function R(E){return J(E,T)}function F(E){const _=E.charCodeAt(0);return _>=48&&_<=57}function ee(E){return J(E,F)}function ie(E){const _=E.charCodeAt(0);return _>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102}function he(E){return J(E,ie)}function ue(E){let _="",H="";for(;_=ee(E);)H+=_;return H}function L(E){y(E);const _=E.currentChar();return _!=="%"&&f(ge.EXPECTED_TOKEN,o(),0,_),E.next(),"%"}function z(E){let _="";for(;;){const H=E.currentChar();if(H==="{"||H==="}"||H==="@"||H==="|"||!H)break;if(H==="%")if(B(E))_+=H,E.next();else break;else if(H===xn||H===mt)if(B(E))_+=H,E.next();else{if($(E))break;_+=H,E.next()}else _+=H,E.next()}return _}function q(E){y(E);let _="",H="";for(;_=R(E);)H+=_;return E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),H}function U(E){y(E);let _="";return E.currentChar()==="-"?(E.next(),_+=`-${ue(E)}`):_+=ue(E),E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),_}function j(E){return E!==Fd&&E!==mt}function ce(E){y(E),m(E,"'");let _="",H="";for(;_=J(E,j);)_==="\\"?H+=le(E):H+=_;const se=E.currentChar();return se===mt||se===Vn?(f(ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),se===mt&&(E.next(),m(E,"'")),H):(m(E,"'"),H)}function le(E){const _=E.currentChar();switch(_){case"\\":case"'":return E.next(),`\\${_}`;case"u":return ve(E,_,4);case"U":return ve(E,_,6);default:return f(ge.UNKNOWN_ESCAPE_SEQUENCE,o(),0,_),""}}function ve(E,_,H){m(E,_);let se="";for(let Me=0;Me<H;Me++){const _e=he(E);if(!_e){f(ge.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${_}${se}${E.currentChar()}`);break}se+=_e}return`\\${_}${se}`}function Ne(E){return E!=="{"&&E!=="}"&&E!==xn&&E!==mt}function Ie(E){y(E);let _="",H="";for(;_=J(E,Ne);)H+=_;return H}function tt(E){let _="",H="";for(;_=I(E);)H+=_;return H}function Q(E){const _=H=>{const se=E.currentChar();return se==="{"||se==="%"||se==="@"||se==="|"||se==="("||se===")"||!se||se===xn?H:(H+=se,E.next(),_(H))};return _("")}function Ee(E){y(E);const _=m(E,"|");return y(E),_}function Mt(E,_){let H=null;switch(E.currentChar()){case"{":return _.braceNest>=1&&f(ge.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),E.next(),H=h(_,2,"{"),y(E),_.braceNest++,H;case"}":return _.braceNest>0&&_.currentType===2&&f(ge.EMPTY_PLACEHOLDER,o(),0),E.next(),H=h(_,3,"}"),_.braceNest--,_.braceNest>0&&y(E),_.inLinked&&_.braceNest===0&&(_.inLinked=!1),H;case"@":return _.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),H=at(E,_)||p(_),_.braceNest=0,H;default:{let Me=!0,_e=!0,Oe=!0;if($(E))return _.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),H=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,H;if(_.braceNest>0&&(_.currentType===5||_.currentType===6||_.currentType===7))return f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),_.braceNest=0,lt(E,_);if(Me=w(E,_))return H=h(_,5,q(E)),y(E),H;if(_e=b(E,_))return H=h(_,6,U(E)),y(E),H;if(Oe=C(E,_))return H=h(_,7,ce(E)),y(E),H;if(!Me&&!_e&&!Oe)return H=h(_,13,Ie(E)),f(ge.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,H.value),y(E),H;break}}return H}function at(E,_){const{currentType:H}=_;let se=null;const Me=E.currentChar();switch((H===8||H===9||H===12||H===10)&&(Me===mt||Me===xn)&&f(ge.INVALID_LINKED_FORMAT,o(),0),Me){case"@":return E.next(),se=h(_,8,"@"),_.inLinked=!0,se;case".":return y(E),E.next(),h(_,9,".");case":":return y(E),E.next(),h(_,10,":");default:return $(E)?(se=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,se):v(E,_)||D(E,_)?(y(E),at(E,_)):S(E,_)?(y(E),h(_,12,tt(E))):O(E,_)?(y(E),Me==="{"?Mt(E,_)||se:h(_,11,Q(E))):(H===8&&f(ge.INVALID_LINKED_FORMAT,o(),0),_.braceNest=0,_.inLinked=!1,lt(E,_))}}function lt(E,_){let H={type:14};if(_.braceNest>0)return Mt(E,_)||p(_);if(_.inLinked)return at(E,_)||p(_);switch(E.currentChar()){case"{":return Mt(E,_)||p(_);case"}":return f(ge.UNBALANCED_CLOSING_BRACE,o(),0),E.next(),h(_,3,"}");case"@":return at(E,_)||p(_);default:{if($(E))return H=h(_,1,Ee(E)),_.braceNest=0,_.inLinked=!1,H;const{isModulo:Me,hasSpace:_e}=V(E);if(Me)return _e?h(_,0,z(E)):h(_,4,L(E));if(B(E))return h(_,0,z(E));break}}return H}function ht(){const{currentType:E,offset:_,startLoc:H,endLoc:se}=c;return c.lastType=E,c.lastOffset=_,c.lastStartLoc=H,c.lastEndLoc=se,c.offset=i(),c.startLoc=o(),r.currentChar()===Vn?h(c,14):lt(r,c)}return{nextToken:ht,currentOffset:i,currentPosition:o,context:d}}const j1="parser",z1=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function H1(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function W1(t={}){const e=t.location!==!1,{onError:n,onWarn:r}=t;function i(w,b,C,v,...S){const D=w.currentPosition();if(D.offset+=v,D.column+=v,n){const O=e?Vo(C,D):null,$=jr(b,O,{domain:j1,args:S});n($)}}function o(w,b,C,v,...S){const D=w.currentPosition();if(D.offset+=v,D.column+=v,r){const O=e?Vo(C,D):null;r(N1(b,O,S))}}function s(w,b,C){const v={type:w};return e&&(v.start=b,v.end=b,v.loc={start:C,end:C}),v}function a(w,b,C,v){e&&(w.end=b,w.loc&&(w.loc.end=C))}function c(w,b){const C=w.context(),v=s(3,C.offset,C.startLoc);return v.value=b,a(v,w.currentOffset(),w.currentPosition()),v}function d(w,b){const C=w.context(),{lastOffset:v,lastStartLoc:S}=C,D=s(5,v,S);return D.index=parseInt(b,10),w.nextToken(),a(D,w.currentOffset(),w.currentPosition()),D}function u(w,b,C){const v=w.context(),{lastOffset:S,lastStartLoc:D}=v,O=s(4,S,D);return O.key=b,C===!0&&(O.modulo=!0),w.nextToken(),a(O,w.currentOffset(),w.currentPosition()),O}function f(w,b){const C=w.context(),{lastOffset:v,lastStartLoc:S}=C,D=s(9,v,S);return D.value=b.replace(z1,H1),w.nextToken(),a(D,w.currentOffset(),w.currentPosition()),D}function h(w){const b=w.nextToken(),C=w.context(),{lastOffset:v,lastStartLoc:S}=C,D=s(8,v,S);return b.type!==12?(i(w,ge.UNEXPECTED_EMPTY_LINKED_MODIFIER,C.lastStartLoc,0),D.value="",a(D,v,S),{nextConsumeToken:b,node:D}):(b.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,Xt(b)),D.value=b.value||"",a(D,w.currentOffset(),w.currentPosition()),{node:D})}function p(w,b){const C=w.context(),v=s(7,C.offset,C.startLoc);return v.value=b,a(v,w.currentOffset(),w.currentPosition()),v}function m(w){const b=w.context(),C=s(6,b.offset,b.startLoc);let v=w.nextToken();if(v.type===9){const S=h(w);C.modifier=S.node,v=S.nextConsumeToken||w.nextToken()}switch(v.type!==10&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(v)),v=w.nextToken(),v.type===2&&(v=w.nextToken()),v.type){case 11:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(v)),C.key=p(w,v.value||"");break;case 5:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(v)),C.key=u(w,v.value||"");break;case 6:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(v)),C.key=d(w,v.value||"");break;case 7:v.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(v)),C.key=f(w,v.value||"");break;default:{i(w,ge.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const S=w.context(),D=s(7,S.offset,S.startLoc);return D.value="",a(D,S.offset,S.startLoc),C.key=D,a(C,S.offset,S.startLoc),{nextConsumeToken:v,node:C}}}return a(C,w.currentOffset(),w.currentPosition()),{node:C}}function g(w){const b=w.context(),C=b.currentType===1?w.currentOffset():b.offset,v=b.currentType===1?b.endLoc:b.startLoc,S=s(2,C,v);S.items=[];let D=null,O=null;do{const B=D||w.nextToken();switch(D=null,B.type){case 0:B.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(B)),S.items.push(c(w,B.value||""));break;case 6:B.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(B)),S.items.push(d(w,B.value||""));break;case 4:O=!0;break;case 5:B.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(B)),S.items.push(u(w,B.value||"",!!O)),O&&(o(w,Po.USE_MODULO_SYNTAX,b.lastStartLoc,0,Xt(B)),O=null);break;case 7:B.value==null&&i(w,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(B)),S.items.push(f(w,B.value||""));break;case 8:{const J=m(w);S.items.push(J.node),D=J.nextConsumeToken||null;break}}}while(b.currentType!==14&&b.currentType!==1);const $=b.currentType===1?b.lastOffset:w.currentOffset(),V=b.currentType===1?b.lastEndLoc:w.currentPosition();return a(S,$,V),S}function y(w,b,C,v){const S=w.context();let D=v.items.length===0;const O=s(1,b,C);O.cases=[],O.cases.push(v);do{const $=g(w);D||(D=$.items.length===0),O.cases.push($)}while(S.currentType!==14);return D&&i(w,ge.MUST_HAVE_MESSAGES_IN_PLURAL,C,0),a(O,w.currentOffset(),w.currentPosition()),O}function k(w){const b=w.context(),{offset:C,startLoc:v}=b,S=g(w);return b.currentType===14?S:y(w,C,v,S)}function x(w){const b=F1(w,Vd({},t)),C=b.context(),v=s(0,C.offset,C.startLoc);return e&&v.loc&&(v.loc.source=w),v.body=k(b),t.onCacheKey&&(v.cacheKey=t.onCacheKey(w)),C.currentType!==14&&i(b,ge.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,w[C.offset]||""),a(v,b.currentOffset(),b.currentPosition()),v}return{parse:x}}function Xt(t){if(t.type===14)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function U1(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:o=>(n.helpers.add(o),o)}}function jd(t,e){for(let n=0;n<t.length;n++)va(t[n],e)}function va(t,e){switch(t.type){case 1:jd(t.cases,e),e.helper("plural");break;case 2:jd(t.items,e);break;case 6:{va(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function Y1(t,e={}){const n=U1(t);n.helper("normalize"),t.body&&va(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function q1(t){const e=t.body;return e.type===2?zd(e):e.cases.forEach(n=>zd(n)),t}function zd(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Rd(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const K1="minifier";function zr(t){switch(t.t=t.type,t.type){case 0:{const e=t;zr(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)zr(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)zr(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;zr(e.key),e.k=e.key,delete e.key,e.modifier&&(zr(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:throw jr(ge.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:K1,args:[t.type]})}delete t.type}const G1="parser";function J1(t,e){const{filename:n,breakLineCode:r,needIndent:i}=e,o=e.location!==!1,s={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};o&&t.loc&&(s.source=t.loc.source);const a=()=>s;function c(g,y){s.code+=g}function d(g,y=!0){const k=y?r:"";c(i?k+" ".repeat(g):k)}function u(g=!0){const y=++s.indentLevel;g&&d(y)}function f(g=!0){const y=--s.indentLevel;g&&d(y)}function h(){d(s.indentLevel)}return{context:a,push:c,indent:u,deindent:f,newline:h,helper:g=>`_${g}`,needIndent:()=>s.needIndent}}function Z1(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),Hr(t,e.key),e.modifier?(t.push(", "),Hr(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function X1(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const i=e.items.length;for(let o=0;o<i&&(Hr(t,e.items[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}function Q1(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const i=e.cases.length;for(let o=0;o<i&&(Hr(t,e.cases[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}}function eb(t,e){e.body?Hr(t,e.body):t.push("null")}function Hr(t,e){const{helper:n}=t;switch(e.type){case 0:eb(t,e);break;case 1:Q1(t,e);break;case 2:X1(t,e);break;case 6:Z1(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:throw jr(ge.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:G1,args:[e.type]})}}const tb=(t,e={})=>{const n=Pd(e.mode)?e.mode:"normal",r=Pd(e.filename)?e.filename:"message.intl";e.sourceMap;const i=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
16
|
-
`,o=e.needIndent?e.needIndent:n!=="arrow",s=t.helpers||[],a=
|
|
14
|
+
*/function C1(t,e,n){return{line:t,column:e,offset:n}}function Vo(t,e,n){return{start:t,end:e}}const S1=/\{([0-9a-zA-Z]+)\}/g;function Bd(t,...e){return e.length===1&&_1(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(S1,(n,r)=>e.hasOwnProperty(r)?e[r]:"")}const Id=Object.assign,Vd=t=>typeof t=="string",_1=t=>t!==null&&typeof t=="object";function Pd(t,e=""){return t.reduce((n,r,i)=>i===0?n+r:n+e+r,"")}const Po={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},O1={[Po.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function T1(t,e,...n){const r=Bd(O1[t],...n||[]),i={message:String(r),code:t};return e&&(i.location=e),i}const ge={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},N1={[ge.EXPECTED_TOKEN]:"Expected token: '{0}'",[ge.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[ge.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[ge.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[ge.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[ge.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[ge.EMPTY_PLACEHOLDER]:"Empty placeholder",[ge.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[ge.INVALID_LINKED_FORMAT]:"Invalid linked format",[ge.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[ge.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[ge.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[ge.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[ge.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[ge.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function jr(t,e,n={}){const{domain:r,messages:i,args:o}=n,s=Bd((i||N1)[t]||"",...o||[]),a=new SyntaxError(String(s));return a.code=t,e&&(a.location=e),a.domain=r,a}function M1(t){throw t}const A1=/<\/?[\w\s="/.':;#-\/]+>/,D1=t=>A1.test(t),xn=" ",$1="\r",mt=`
|
|
15
|
+
`,L1="\u2028",B1="\u2029";function I1(t){const e=t;let n=0,r=1,i=1,o=0;const s=N=>e[N]===$1&&e[N+1]===mt,a=N=>e[N]===mt,c=N=>e[N]===B1,d=N=>e[N]===L1,u=N=>s(N)||a(N)||c(N)||d(N),f=()=>n,h=()=>r,p=()=>i,m=()=>o,g=N=>s(N)||c(N)||d(N)?mt:e[N],y=()=>g(n),k=()=>g(n+o);function x(){return o=0,u(n)&&(r++,i=0),s(n)&&n++,n++,i++,e[n]}function v(){return s(n+o)&&o++,o++,e[n+o]}function b(){n=0,r=1,i=1,o=0}function C(N=0){o=N}function w(){const N=n+o;for(;N!==n;)x();o=0}return{index:f,line:h,column:p,peekOffset:m,charAt:g,currentChar:y,currentPeek:k,next:x,peek:v,reset:b,resetPeek:C,skipToPeek:w}}const Vn=void 0,V1=".",Rd="'",P1="tokenizer";function R1(t,e={}){const n=e.location!==!1,r=I1(t),i=()=>r.index(),o=()=>C1(r.line(),r.column(),r.index()),s=o(),a=i(),c={currentType:14,offset:a,startLoc:s,endLoc:s,lastType:14,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},d=()=>c,{onError:u}=e;function f(E,O,W,...se){const Me=d();if(O.column+=W,O.offset+=W,u){const _e=n?Vo(Me.startLoc,O):null,Oe=jr(E,_e,{domain:P1,args:se});u(Oe)}}function h(E,O,W){E.endLoc=o(),E.currentType=O;const se={type:O};return n&&(se.loc=Vo(E.startLoc,E.endLoc)),W!=null&&(se.value=W),se}const p=E=>h(E,14);function m(E,O){return E.currentChar()===O?(E.next(),O):(f(ge.EXPECTED_TOKEN,o(),0,O),"")}function g(E){let O="";for(;E.currentPeek()===xn||E.currentPeek()===mt;)O+=E.currentPeek(),E.peek();return O}function y(E){const O=g(E);return E.skipToPeek(),O}function k(E){if(E===Vn)return!1;const O=E.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O===95}function x(E){if(E===Vn)return!1;const O=E.charCodeAt(0);return O>=48&&O<=57}function v(E,O){const{currentType:W}=O;if(W!==2)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function b(E,O){const{currentType:W}=O;if(W!==2)return!1;g(E);const se=E.currentPeek()==="-"?E.peek():E.currentPeek(),Me=x(se);return E.resetPeek(),Me}function C(E,O){const{currentType:W}=O;if(W!==2)return!1;g(E);const se=E.currentPeek()===Rd;return E.resetPeek(),se}function w(E,O){const{currentType:W}=O;if(W!==8)return!1;g(E);const se=E.currentPeek()===".";return E.resetPeek(),se}function N(E,O){const{currentType:W}=O;if(W!==9)return!1;g(E);const se=k(E.currentPeek());return E.resetPeek(),se}function L(E,O){const{currentType:W}=O;if(!(W===8||W===12))return!1;g(E);const se=E.currentPeek()===":";return E.resetPeek(),se}function S(E,O){const{currentType:W}=O;if(W!==10)return!1;const se=()=>{const _e=E.currentPeek();return _e==="{"?k(E.peek()):_e==="@"||_e==="%"||_e==="|"||_e===":"||_e==="."||_e===xn||!_e?!1:_e===mt?(E.peek(),se()):$(E,!1)},Me=se();return E.resetPeek(),Me}function D(E){g(E);const O=E.currentPeek()==="|";return E.resetPeek(),O}function F(E){const O=g(E),W=E.currentPeek()==="%"&&E.peek()==="{";return E.resetPeek(),{isModulo:W,hasSpace:O.length>0}}function $(E,O=!0){const W=(Me=!1,_e="",Oe=!1)=>{const R=E.currentPeek();return R==="{"?_e==="%"?!1:Me:R==="@"||!R?_e==="%"?!0:Me:R==="%"?(E.peek(),W(Me,"%",!0)):R==="|"?_e==="%"||Oe?!0:!(_e===xn||_e===mt):R===xn?(E.peek(),W(!0,xn,Oe)):R===mt?(E.peek(),W(!0,mt,Oe)):!0},se=W();return O&&E.resetPeek(),se}function U(E,O){const W=E.currentChar();return W===Vn?Vn:O(W)?(E.next(),W):null}function z(E){const O=E.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95||O===36}function I(E){return U(E,z)}function _(E){const O=E.charCodeAt(0);return O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===95||O===36||O===45}function P(E){return U(E,_)}function V(E){const O=E.charCodeAt(0);return O>=48&&O<=57}function ee(E){return U(E,V)}function ie(E){const O=E.charCodeAt(0);return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}function he(E){return U(E,ie)}function ue(E){let O="",W="";for(;O=ee(E);)W+=O;return W}function B(E){y(E);const O=E.currentChar();return O!=="%"&&f(ge.EXPECTED_TOKEN,o(),0,O),E.next(),"%"}function H(E){let O="";for(;;){const W=E.currentChar();if(W==="{"||W==="}"||W==="@"||W==="|"||!W)break;if(W==="%")if($(E))O+=W,E.next();else break;else if(W===xn||W===mt)if($(E))O+=W,E.next();else{if(D(E))break;O+=W,E.next()}else O+=W,E.next()}return O}function K(E){y(E);let O="",W="";for(;O=P(E);)W+=O;return E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),W}function q(E){y(E);let O="";return E.currentChar()==="-"?(E.next(),O+=`-${ue(E)}`):O+=ue(E),E.currentChar()===Vn&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),O}function j(E){return E!==Rd&&E!==mt}function ce(E){y(E),m(E,"'");let O="",W="";for(;O=U(E,j);)O==="\\"?W+=le(E):W+=O;const se=E.currentChar();return se===mt||se===Vn?(f(ge.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),se===mt&&(E.next(),m(E,"'")),W):(m(E,"'"),W)}function le(E){const O=E.currentChar();switch(O){case"\\":case"'":return E.next(),`\\${O}`;case"u":return ve(E,O,4);case"U":return ve(E,O,6);default:return f(ge.UNKNOWN_ESCAPE_SEQUENCE,o(),0,O),""}}function ve(E,O,W){m(E,O);let se="";for(let Me=0;Me<W;Me++){const _e=he(E);if(!_e){f(ge.INVALID_UNICODE_ESCAPE_SEQUENCE,o(),0,`\\${O}${se}${E.currentChar()}`);break}se+=_e}return`\\${O}${se}`}function Ne(E){return E!=="{"&&E!=="}"&&E!==xn&&E!==mt}function Ie(E){y(E);let O="",W="";for(;O=U(E,Ne);)W+=O;return W}function tt(E){let O="",W="";for(;O=I(E);)W+=O;return W}function Q(E){const O=W=>{const se=E.currentChar();return se==="{"||se==="%"||se==="@"||se==="|"||se==="("||se===")"||!se||se===xn?W:(W+=se,E.next(),O(W))};return O("")}function Ee(E){y(E);const O=m(E,"|");return y(E),O}function Mt(E,O){let W=null;switch(E.currentChar()){case"{":return O.braceNest>=1&&f(ge.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),E.next(),W=h(O,2,"{"),y(E),O.braceNest++,W;case"}":return O.braceNest>0&&O.currentType===2&&f(ge.EMPTY_PLACEHOLDER,o(),0),E.next(),W=h(O,3,"}"),O.braceNest--,O.braceNest>0&&y(E),O.inLinked&&O.braceNest===0&&(O.inLinked=!1),W;case"@":return O.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),W=at(E,O)||p(O),O.braceNest=0,W;default:{let Me=!0,_e=!0,Oe=!0;if(D(E))return O.braceNest>0&&f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),W=h(O,1,Ee(E)),O.braceNest=0,O.inLinked=!1,W;if(O.braceNest>0&&(O.currentType===5||O.currentType===6||O.currentType===7))return f(ge.UNTERMINATED_CLOSING_BRACE,o(),0),O.braceNest=0,lt(E,O);if(Me=v(E,O))return W=h(O,5,K(E)),y(E),W;if(_e=b(E,O))return W=h(O,6,q(E)),y(E),W;if(Oe=C(E,O))return W=h(O,7,ce(E)),y(E),W;if(!Me&&!_e&&!Oe)return W=h(O,13,Ie(E)),f(ge.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,W.value),y(E),W;break}}return W}function at(E,O){const{currentType:W}=O;let se=null;const Me=E.currentChar();switch((W===8||W===9||W===12||W===10)&&(Me===mt||Me===xn)&&f(ge.INVALID_LINKED_FORMAT,o(),0),Me){case"@":return E.next(),se=h(O,8,"@"),O.inLinked=!0,se;case".":return y(E),E.next(),h(O,9,".");case":":return y(E),E.next(),h(O,10,":");default:return D(E)?(se=h(O,1,Ee(E)),O.braceNest=0,O.inLinked=!1,se):w(E,O)||L(E,O)?(y(E),at(E,O)):N(E,O)?(y(E),h(O,12,tt(E))):S(E,O)?(y(E),Me==="{"?Mt(E,O)||se:h(O,11,Q(E))):(W===8&&f(ge.INVALID_LINKED_FORMAT,o(),0),O.braceNest=0,O.inLinked=!1,lt(E,O))}}function lt(E,O){let W={type:14};if(O.braceNest>0)return Mt(E,O)||p(O);if(O.inLinked)return at(E,O)||p(O);switch(E.currentChar()){case"{":return Mt(E,O)||p(O);case"}":return f(ge.UNBALANCED_CLOSING_BRACE,o(),0),E.next(),h(O,3,"}");case"@":return at(E,O)||p(O);default:{if(D(E))return W=h(O,1,Ee(E)),O.braceNest=0,O.inLinked=!1,W;const{isModulo:Me,hasSpace:_e}=F(E);if(Me)return _e?h(O,0,H(E)):h(O,4,B(E));if($(E))return h(O,0,H(E));break}}return W}function ht(){const{currentType:E,offset:O,startLoc:W,endLoc:se}=c;return c.lastType=E,c.lastOffset=O,c.lastStartLoc=W,c.lastEndLoc=se,c.offset=i(),c.startLoc=o(),r.currentChar()===Vn?h(c,14):lt(r,c)}return{nextToken:ht,currentOffset:i,currentPosition:o,context:d}}const F1="parser",j1=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function z1(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function H1(t={}){const e=t.location!==!1,{onError:n,onWarn:r}=t;function i(v,b,C,w,...N){const L=v.currentPosition();if(L.offset+=w,L.column+=w,n){const S=e?Vo(C,L):null,D=jr(b,S,{domain:F1,args:N});n(D)}}function o(v,b,C,w,...N){const L=v.currentPosition();if(L.offset+=w,L.column+=w,r){const S=e?Vo(C,L):null;r(T1(b,S,N))}}function s(v,b,C){const w={type:v};return e&&(w.start=b,w.end=b,w.loc={start:C,end:C}),w}function a(v,b,C,w){e&&(v.end=b,v.loc&&(v.loc.end=C))}function c(v,b){const C=v.context(),w=s(3,C.offset,C.startLoc);return w.value=b,a(w,v.currentOffset(),v.currentPosition()),w}function d(v,b){const C=v.context(),{lastOffset:w,lastStartLoc:N}=C,L=s(5,w,N);return L.index=parseInt(b,10),v.nextToken(),a(L,v.currentOffset(),v.currentPosition()),L}function u(v,b,C){const w=v.context(),{lastOffset:N,lastStartLoc:L}=w,S=s(4,N,L);return S.key=b,C===!0&&(S.modulo=!0),v.nextToken(),a(S,v.currentOffset(),v.currentPosition()),S}function f(v,b){const C=v.context(),{lastOffset:w,lastStartLoc:N}=C,L=s(9,w,N);return L.value=b.replace(j1,z1),v.nextToken(),a(L,v.currentOffset(),v.currentPosition()),L}function h(v){const b=v.nextToken(),C=v.context(),{lastOffset:w,lastStartLoc:N}=C,L=s(8,w,N);return b.type!==12?(i(v,ge.UNEXPECTED_EMPTY_LINKED_MODIFIER,C.lastStartLoc,0),L.value="",a(L,w,N),{nextConsumeToken:b,node:L}):(b.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,Xt(b)),L.value=b.value||"",a(L,v.currentOffset(),v.currentPosition()),{node:L})}function p(v,b){const C=v.context(),w=s(7,C.offset,C.startLoc);return w.value=b,a(w,v.currentOffset(),v.currentPosition()),w}function m(v){const b=v.context(),C=s(6,b.offset,b.startLoc);let w=v.nextToken();if(w.type===9){const N=h(v);C.modifier=N.node,w=N.nextConsumeToken||v.nextToken()}switch(w.type!==10&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(w)),w=v.nextToken(),w.type===2&&(w=v.nextToken()),w.type){case 11:w.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(w)),C.key=p(v,w.value||"");break;case 5:w.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(w)),C.key=u(v,w.value||"");break;case 6:w.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(w)),C.key=d(v,w.value||"");break;case 7:w.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt(w)),C.key=f(v,w.value||"");break;default:{i(v,ge.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const N=v.context(),L=s(7,N.offset,N.startLoc);return L.value="",a(L,N.offset,N.startLoc),C.key=L,a(C,N.offset,N.startLoc),{nextConsumeToken:w,node:C}}}return a(C,v.currentOffset(),v.currentPosition()),{node:C}}function g(v){const b=v.context(),C=b.currentType===1?v.currentOffset():b.offset,w=b.currentType===1?b.endLoc:b.startLoc,N=s(2,C,w);N.items=[];let L=null,S=null;do{const $=L||v.nextToken();switch(L=null,$.type){case 0:$.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt($)),N.items.push(c(v,$.value||""));break;case 6:$.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt($)),N.items.push(d(v,$.value||""));break;case 4:S=!0;break;case 5:$.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt($)),N.items.push(u(v,$.value||"",!!S)),S&&(o(v,Po.USE_MODULO_SYNTAX,b.lastStartLoc,0,Xt($)),S=null);break;case 7:$.value==null&&i(v,ge.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Xt($)),N.items.push(f(v,$.value||""));break;case 8:{const U=m(v);N.items.push(U.node),L=U.nextConsumeToken||null;break}}}while(b.currentType!==14&&b.currentType!==1);const D=b.currentType===1?b.lastOffset:v.currentOffset(),F=b.currentType===1?b.lastEndLoc:v.currentPosition();return a(N,D,F),N}function y(v,b,C,w){const N=v.context();let L=w.items.length===0;const S=s(1,b,C);S.cases=[],S.cases.push(w);do{const D=g(v);L||(L=D.items.length===0),S.cases.push(D)}while(N.currentType!==14);return L&&i(v,ge.MUST_HAVE_MESSAGES_IN_PLURAL,C,0),a(S,v.currentOffset(),v.currentPosition()),S}function k(v){const b=v.context(),{offset:C,startLoc:w}=b,N=g(v);return b.currentType===14?N:y(v,C,w,N)}function x(v){const b=R1(v,Id({},t)),C=b.context(),w=s(0,C.offset,C.startLoc);return e&&w.loc&&(w.loc.source=v),w.body=k(b),t.onCacheKey&&(w.cacheKey=t.onCacheKey(v)),C.currentType!==14&&i(b,ge.UNEXPECTED_LEXICAL_ANALYSIS,C.lastStartLoc,0,v[C.offset]||""),a(w,b.currentOffset(),b.currentPosition()),w}return{parse:x}}function Xt(t){if(t.type===14)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function W1(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:o=>(n.helpers.add(o),o)}}function Fd(t,e){for(let n=0;n<t.length;n++)va(t[n],e)}function va(t,e){switch(t.type){case 1:Fd(t.cases,e),e.helper("plural");break;case 2:Fd(t.items,e);break;case 6:{va(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function U1(t,e={}){const n=W1(t);n.helper("normalize"),t.body&&va(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function Y1(t){const e=t.body;return e.type===2?jd(e):e.cases.forEach(n=>jd(n)),t}function jd(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Pd(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const q1="minifier";function zr(t){switch(t.t=t.type,t.type){case 0:{const e=t;zr(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)zr(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)zr(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;zr(e.key),e.k=e.key,delete e.key,e.modifier&&(zr(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:throw jr(ge.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:q1,args:[t.type]})}delete t.type}const K1="parser";function G1(t,e){const{filename:n,breakLineCode:r,needIndent:i}=e,o=e.location!==!1,s={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};o&&t.loc&&(s.source=t.loc.source);const a=()=>s;function c(g,y){s.code+=g}function d(g,y=!0){const k=y?r:"";c(i?k+" ".repeat(g):k)}function u(g=!0){const y=++s.indentLevel;g&&d(y)}function f(g=!0){const y=--s.indentLevel;g&&d(y)}function h(){d(s.indentLevel)}return{context:a,push:c,indent:u,deindent:f,newline:h,helper:g=>`_${g}`,needIndent:()=>s.needIndent}}function J1(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),Hr(t,e.key),e.modifier?(t.push(", "),Hr(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function Z1(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const i=e.items.length;for(let o=0;o<i&&(Hr(t,e.items[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}function X1(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const i=e.cases.length;for(let o=0;o<i&&(Hr(t,e.cases[o]),o!==i-1);o++)t.push(", ");t.deindent(r()),t.push("])")}}function Q1(t,e){e.body?Hr(t,e.body):t.push("null")}function Hr(t,e){const{helper:n}=t;switch(e.type){case 0:Q1(t,e);break;case 1:X1(t,e);break;case 2:Z1(t,e);break;case 6:J1(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:throw jr(ge.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:K1,args:[e.type]})}}const eb=(t,e={})=>{const n=Vd(e.mode)?e.mode:"normal",r=Vd(e.filename)?e.filename:"message.intl";e.sourceMap;const i=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
|
|
16
|
+
`,o=e.needIndent?e.needIndent:n!=="arrow",s=t.helpers||[],a=G1(t,{filename:r,breakLineCode:i,needIndent:o});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(o),s.length>0&&(a.push(`const { ${Pd(s.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),Hr(a,t),a.deindent(o),a.push("}"),delete t.helpers;const{code:c,map:d}=a.context();return{ast:t,code:c,map:d?d.toJSON():void 0}};function tb(t,e={}){const n=Id({},e),r=!!n.jit,i=!!n.minify,o=n.optimize==null?!0:n.optimize,a=H1(n).parse(t);return r?(o&&Y1(a),i&&zr(a),{ast:a,code:""}):(U1(a,n),eb(a,n))}/*!
|
|
17
17
|
* core-base v9.14.4
|
|
18
18
|
* (c) 2025 kazuya kawaguchi
|
|
19
19
|
* Released under the MIT License.
|
|
20
|
-
*/function rb(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vn().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(vn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Qt(t){return Te(t)&&wa(t)===0&&(Zt(t,"b")||Zt(t,"body"))}const Hd=["b","body"];function ib(t){return Pn(t,Hd)}const Wd=["c","cases"];function ob(t){return Pn(t,Wd,[])}const Ud=["s","static"];function sb(t){return Pn(t,Ud)}const Yd=["i","items"];function ab(t){return Pn(t,Yd,[])}const qd=["t","type"];function wa(t){return Pn(t,qd)}const Kd=["v","value"];function Ro(t,e){const n=Pn(t,Kd);if(n!=null)return n;throw $i(e)}const Gd=["m","modifier"];function lb(t){return Pn(t,Gd)}const Jd=["k","key"];function cb(t){const e=Pn(t,Jd);if(e)return e;throw $i(6)}function Pn(t,e,n){for(let r=0;r<e.length;r++){const i=e[r];if(Zt(t,i)&&t[i]!=null)return t[i]}return n}const Zd=[...Hd,...Wd,...Ud,...Yd,...Jd,...Gd,...Kd,...qd];function $i(t){return new Error(`unhandled node type: ${t}`)}const Rn=[];Rn[0]={w:[0],i:[3,0],"[":[4],o:[7]},Rn[1]={w:[1],".":[2],"[":[4],o:[7]},Rn[2]={w:[2],i:[3,0],0:[3,0]},Rn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Rn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Rn[5]={"'":[4,0],o:8,l:[5,0]},Rn[6]={'"':[4,0],o:8,l:[6,0]};const db=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function ub(t){return db.test(t)}function fb(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function hb(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function pb(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:ub(e)?fb(e):"*"+e}function mb(t){const e=[];let n=-1,r=0,i=0,o,s,a,c,d,u,f;const h=[];h[0]=()=>{s===void 0?s=a:s+=a},h[1]=()=>{s!==void 0&&(e.push(s),s=void 0)},h[2]=()=>{h[0](),i++},h[3]=()=>{if(i>0)i--,r=4,h[0]();else{if(i=0,s===void 0||(s=pb(s),s===!1))return!1;h[1]()}};function p(){const m=t[n+1];if(r===5&&m==="'"||r===6&&m==='"')return n++,a="\\"+m,h[0](),!0}for(;r!==null;)if(n++,o=t[n],!(o==="\\"&&p())){if(c=hb(o),f=Rn[r],d=f[c]||f.l||8,d===8||(r=d[0],d[1]!==void 0&&(u=h[d[1]],u&&(a=o,u()===!1))))return;if(r===7)return e}}const Xd=new Map;function gb(t,e){return Te(t)?t[e]:null}function yb(t,e){if(!Te(t))return null;let n=Xd.get(e);if(n||(n=mb(e),n&&Xd.set(e,n)),!n)return null;const r=n.length;let i=t,o=0;for(;o<r;){const s=n[o];if(Zd.includes(s)&&Qt(i))return null;const a=i[s];if(a===void 0||Ve(i))return null;i=a,o++}return i}const bb=t=>t,kb=t=>"",vb="text",wb=t=>t.length===0?"":x1(t),xb=w1;function Qd(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function Eb(t){const e=Ge(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Ge(t.named.count)||Ge(t.named.n))?Ge(t.named.count)?t.named.count:Ge(t.named.n)?t.named.n:e:e}function Cb(t,e){e.count||(e.count=t),e.n||(e.n=t)}function Sb(t={}){const e=t.locale,n=Eb(t),r=Te(t.pluralRules)&&oe(e)&&Ve(t.pluralRules[e])?t.pluralRules[e]:Qd,i=Te(t.pluralRules)&&oe(e)&&Ve(t.pluralRules[e])?Qd:void 0,o=k=>k[r(n,k.length,i)],s=t.list||[],a=k=>s[k],c=t.named||$e();Ge(t.pluralIndex)&&Cb(n,c);const d=k=>c[k];function u(k){const x=Ve(t.messages)?t.messages(k):Te(t.messages)?t.messages[k]:!1;return x||(t.parent?t.parent.message(k):kb)}const f=k=>t.modifiers?t.modifiers[k]:bb,h=Se(t.processor)&&Ve(t.processor.normalize)?t.processor.normalize:wb,p=Se(t.processor)&&Ve(t.processor.interpolate)?t.processor.interpolate:xb,m=Se(t.processor)&&oe(t.processor.type)?t.processor.type:vb,y={list:a,named:d,plural:o,linked:(k,...x)=>{const[w,b]=x;let C="text",v="";x.length===1?Te(w)?(v=w.modifier||v,C=w.type||C):oe(w)&&(v=w||v):x.length===2&&(oe(w)&&(v=w||v),oe(b)&&(C=b||C));const S=u(k)(y),D=C==="vnode"&&We(S)&&v?S[0]:S;return v?f(v)(D,C):D},message:u,type:m,interpolate:p,normalize:h,values:ct($e(),s,c)};return y}let Li=null;function _b(t){Li=t}function Ob(t,e,n){Li&&Li.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const Tb=Nb("function:translate");function Nb(t){return e=>Li&&Li.emit(t,e)}const eu=Po.__EXTEND_POINT__,fr=Lo(eu),gt={NOT_FOUND_KEY:eu,FALLBACK_TO_TRANSLATE:fr(),CANNOT_FORMAT_NUMBER:fr(),FALLBACK_TO_NUMBER_FORMAT:fr(),CANNOT_FORMAT_DATE:fr(),FALLBACK_TO_DATE_FORMAT:fr(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:fr(),__EXTEND_POINT__:fr()},Mb={[gt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[gt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[gt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[gt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[gt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[gt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[gt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function hr(t,...e){return ka(Mb[t],...e)}const tu=ge.__EXTEND_POINT__,pr=Lo(tu),Je={INVALID_ARGUMENT:tu,INVALID_DATE_ARGUMENT:pr(),INVALID_ISO_DATE_ARGUMENT:pr(),NOT_SUPPORT_NON_STRING_MESSAGE:pr(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:pr(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:pr(),NOT_SUPPORT_LOCALE_TYPE:pr(),__EXTEND_POINT__:pr()};function on(t){return jr(t,null,process.env.NODE_ENV!=="production"?{messages:Ab}:void 0)}const Ab={[Je.INVALID_ARGUMENT]:"Invalid arguments",[Je.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Je.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Je.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Je.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function xa(t,e){return e.locale!=null?nu(e.locale):nu(t.locale)}let Ea;function nu(t){if(oe(t))return t;if(Ve(t)){if(t.resolvedOnce&&Ea!=null)return Ea;if(t.constructor.name==="Function"){const e=t();if(v1(e))throw on(Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Ea=e}else throw on(Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw on(Je.NOT_SUPPORT_LOCALE_TYPE)}function Db(t,e,n){return[...new Set([n,...We(e)?e:Te(e)?Object.keys(e):oe(e)?[e]:[n]])]}function ru(t,e,n){const r=oe(n)?n:Bi,i=t;i.__localeChainCache||(i.__localeChainCache=new Map);let o=i.__localeChainCache.get(r);if(!o){o=[];let s=[n];for(;We(s);)s=iu(o,s,e);const a=We(e)||!Se(e)?e:e.default?e.default:null;s=oe(a)?[a]:a,We(s)&&iu(o,s,!1),i.__localeChainCache.set(r,o)}return o}function iu(t,e,n){let r=!0;for(let i=0;i<e.length&&Le(r);i++){const o=e[i];oe(o)&&(r=$b(t,e[i],n))}return r}function $b(t,e,n){let r;const i=e.split("-");do{const o=i.join("-");r=Lb(t,o,n),i.splice(-1,1)}while(i.length&&r===!0);return r}function Lb(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const i=e.replace(/!/g,"");t.push(i),(We(n)||Se(n))&&n[i]&&(r=n[i])}return r}const Bb="9.14.4",Fo=-1,Bi="en-US",jo="",ou=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Ib(){return{upper:(t,e)=>e==="text"&&oe(t)?t.toUpperCase():e==="vnode"&&Te(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&oe(t)?t.toLowerCase():e==="vnode"&&Te(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&oe(t)?ou(t):e==="vnode"&&Te(t)&&"__v_isVNode"in t?ou(t.children):t}}let su;function au(t){su=t}let lu;function Vb(t){lu=t}let cu;function Pb(t){cu=t}let du=null;const Rb=t=>{du=t},Fb=()=>du;let uu=null;const fu=t=>{uu=t},jb=()=>uu;let hu=0;function zb(t={}){const e=Ve(t.onWarn)?t.onWarn:wn,n=oe(t.version)?t.version:Bb,r=oe(t.locale)||Ve(t.locale)?t.locale:Bi,i=Ve(r)?Bi:r,o=We(t.fallbackLocale)||Se(t.fallbackLocale)||oe(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:i,s=Se(t.messages)?t.messages:Ca(i),a=Se(t.datetimeFormats)?t.datetimeFormats:Ca(i),c=Se(t.numberFormats)?t.numberFormats:Ca(i),d=ct($e(),t.modifiers,Ib()),u=t.pluralRules||$e(),f=Ve(t.missing)?t.missing:null,h=Le(t.missingWarn)||Fr(t.missingWarn)?t.missingWarn:!0,p=Le(t.fallbackWarn)||Fr(t.fallbackWarn)?t.fallbackWarn:!0,m=!!t.fallbackFormat,g=!!t.unresolving,y=Ve(t.postTranslation)?t.postTranslation:null,k=Se(t.processor)?t.processor:null,x=Le(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter,b=Ve(t.messageCompiler)?t.messageCompiler:su;process.env.NODE_ENV!=="production"&&Ve(t.messageCompiler)&&Bd(hr(gt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const C=Ve(t.messageResolver)?t.messageResolver:lu||gb,v=Ve(t.localeFallbacker)?t.localeFallbacker:cu||Db,S=Te(t.fallbackContext)?t.fallbackContext:void 0,D=t,O=Te(D.__datetimeFormatters)?D.__datetimeFormatters:new Map,$=Te(D.__numberFormatters)?D.__numberFormatters:new Map,V=Te(D.__meta)?D.__meta:{};hu++;const B={version:n,cid:hu,locale:r,fallbackLocale:o,messages:s,modifiers:d,pluralRules:u,missing:f,missingWarn:h,fallbackWarn:p,fallbackFormat:m,unresolving:g,postTranslation:y,processor:k,warnHtmlMessage:x,escapeParameter:w,messageCompiler:b,messageResolver:C,localeFallbacker:v,fallbackContext:S,onWarn:e,__meta:V};return B.datetimeFormats=a,B.numberFormats=c,B.__datetimeFormatters=O,B.__numberFormatters=$,process.env.NODE_ENV!=="production"&&(B.__v_emitter=D.__v_emitter!=null?D.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&Ob(B,n,V),B}const Ca=t=>({[t]:$e()});function zo(t,e){return t instanceof RegExp?t.test(e):t}function pu(t,e){return t instanceof RegExp?t.test(e):t}function Sa(t,e,n,r,i){const{missing:o,onWarn:s}=t;if(process.env.NODE_ENV!=="production"){const a=t.__v_emitter;a&&a.emit("missing",{locale:n,key:e,type:i,groupId:`${i}:${e}`})}if(o!==null){const a=o(t,n,e,i);return oe(a)?a:e}else return process.env.NODE_ENV!=="production"&&pu(r,e)&&s(hr(gt.NOT_FOUND_KEY,{key:e,locale:n})),e}function Ii(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function mu(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function Hb(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(mu(t,e[r]))return!0;return!1}function _a(t){return n=>Wb(n,t)}function Wb(t,e){const n=ib(e);if(n==null)throw $i(0);if(wa(n)===1){const o=ob(n);return t.plural(o.reduce((s,a)=>[...s,gu(t,a)],[]))}else return gu(t,n)}function gu(t,e){const n=sb(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=ab(e).reduce((i,o)=>[...i,Oa(t,o)],[]);return t.normalize(r)}}function Oa(t,e){const n=wa(e);switch(n){case 3:return Ro(e,n);case 9:return Ro(e,n);case 4:{const r=e;if(Zt(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(Zt(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw $i(n)}case 5:{const r=e;if(Zt(r,"i")&&Ge(r.i))return t.interpolate(t.list(r.i));if(Zt(r,"index")&&Ge(r.index))return t.interpolate(t.list(r.index));throw $i(n)}case 6:{const r=e,i=lb(r),o=cb(r);return t.linked(Oa(t,o),i?Oa(t,i):void 0,t.type)}case 7:return Ro(e,n);case 8:return Ro(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Ub="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function yu(t,e){e&&$1(t)&&wn(ka(Ub,{source:t}))}const bu=t=>t;let Wr=$e();function ku(t){t.code===Po.USE_MODULO_SYNTAX&&wn(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10.
|
|
20
|
+
*/function nb(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vn().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(vn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Qt(t){return Te(t)&&wa(t)===0&&(Zt(t,"b")||Zt(t,"body"))}const zd=["b","body"];function rb(t){return Pn(t,zd)}const Hd=["c","cases"];function ib(t){return Pn(t,Hd,[])}const Wd=["s","static"];function ob(t){return Pn(t,Wd)}const Ud=["i","items"];function sb(t){return Pn(t,Ud,[])}const Yd=["t","type"];function wa(t){return Pn(t,Yd)}const qd=["v","value"];function Ro(t,e){const n=Pn(t,qd);if(n!=null)return n;throw $i(e)}const Kd=["m","modifier"];function ab(t){return Pn(t,Kd)}const Gd=["k","key"];function lb(t){const e=Pn(t,Gd);if(e)return e;throw $i(6)}function Pn(t,e,n){for(let r=0;r<e.length;r++){const i=e[r];if(Zt(t,i)&&t[i]!=null)return t[i]}return n}const Jd=[...zd,...Hd,...Wd,...Ud,...Gd,...Kd,...qd,...Yd];function $i(t){return new Error(`unhandled node type: ${t}`)}const Rn=[];Rn[0]={w:[0],i:[3,0],"[":[4],o:[7]},Rn[1]={w:[1],".":[2],"[":[4],o:[7]},Rn[2]={w:[2],i:[3,0],0:[3,0]},Rn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Rn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Rn[5]={"'":[4,0],o:8,l:[5,0]},Rn[6]={'"':[4,0],o:8,l:[6,0]};const cb=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function db(t){return cb.test(t)}function ub(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function fb(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function hb(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:db(e)?ub(e):"*"+e}function pb(t){const e=[];let n=-1,r=0,i=0,o,s,a,c,d,u,f;const h=[];h[0]=()=>{s===void 0?s=a:s+=a},h[1]=()=>{s!==void 0&&(e.push(s),s=void 0)},h[2]=()=>{h[0](),i++},h[3]=()=>{if(i>0)i--,r=4,h[0]();else{if(i=0,s===void 0||(s=hb(s),s===!1))return!1;h[1]()}};function p(){const m=t[n+1];if(r===5&&m==="'"||r===6&&m==='"')return n++,a="\\"+m,h[0](),!0}for(;r!==null;)if(n++,o=t[n],!(o==="\\"&&p())){if(c=fb(o),f=Rn[r],d=f[c]||f.l||8,d===8||(r=d[0],d[1]!==void 0&&(u=h[d[1]],u&&(a=o,u()===!1))))return;if(r===7)return e}}const Zd=new Map;function mb(t,e){return Te(t)?t[e]:null}function gb(t,e){if(!Te(t))return null;let n=Zd.get(e);if(n||(n=pb(e),n&&Zd.set(e,n)),!n)return null;const r=n.length;let i=t,o=0;for(;o<r;){const s=n[o];if(Jd.includes(s)&&Qt(i))return null;const a=i[s];if(a===void 0||Ve(i))return null;i=a,o++}return i}const yb=t=>t,bb=t=>"",kb="text",vb=t=>t.length===0?"":w1(t),wb=v1;function Xd(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function xb(t){const e=Ge(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Ge(t.named.count)||Ge(t.named.n))?Ge(t.named.count)?t.named.count:Ge(t.named.n)?t.named.n:e:e}function Eb(t,e){e.count||(e.count=t),e.n||(e.n=t)}function Cb(t={}){const e=t.locale,n=xb(t),r=Te(t.pluralRules)&&oe(e)&&Ve(t.pluralRules[e])?t.pluralRules[e]:Xd,i=Te(t.pluralRules)&&oe(e)&&Ve(t.pluralRules[e])?Xd:void 0,o=k=>k[r(n,k.length,i)],s=t.list||[],a=k=>s[k],c=t.named||$e();Ge(t.pluralIndex)&&Eb(n,c);const d=k=>c[k];function u(k){const x=Ve(t.messages)?t.messages(k):Te(t.messages)?t.messages[k]:!1;return x||(t.parent?t.parent.message(k):bb)}const f=k=>t.modifiers?t.modifiers[k]:yb,h=Se(t.processor)&&Ve(t.processor.normalize)?t.processor.normalize:vb,p=Se(t.processor)&&Ve(t.processor.interpolate)?t.processor.interpolate:wb,m=Se(t.processor)&&oe(t.processor.type)?t.processor.type:kb,y={list:a,named:d,plural:o,linked:(k,...x)=>{const[v,b]=x;let C="text",w="";x.length===1?Te(v)?(w=v.modifier||w,C=v.type||C):oe(v)&&(w=v||w):x.length===2&&(oe(v)&&(w=v||w),oe(b)&&(C=b||C));const N=u(k)(y),L=C==="vnode"&&We(N)&&w?N[0]:N;return w?f(w)(L,C):L},message:u,type:m,interpolate:p,normalize:h,values:ct($e(),s,c)};return y}let Li=null;function Sb(t){Li=t}function _b(t,e,n){Li&&Li.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const Ob=Tb("function:translate");function Tb(t){return e=>Li&&Li.emit(t,e)}const Qd=Po.__EXTEND_POINT__,fr=Lo(Qd),gt={NOT_FOUND_KEY:Qd,FALLBACK_TO_TRANSLATE:fr(),CANNOT_FORMAT_NUMBER:fr(),FALLBACK_TO_NUMBER_FORMAT:fr(),CANNOT_FORMAT_DATE:fr(),FALLBACK_TO_DATE_FORMAT:fr(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:fr(),__EXTEND_POINT__:fr()},Nb={[gt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[gt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[gt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[gt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[gt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[gt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[gt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function hr(t,...e){return ka(Nb[t],...e)}const eu=ge.__EXTEND_POINT__,pr=Lo(eu),Je={INVALID_ARGUMENT:eu,INVALID_DATE_ARGUMENT:pr(),INVALID_ISO_DATE_ARGUMENT:pr(),NOT_SUPPORT_NON_STRING_MESSAGE:pr(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:pr(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:pr(),NOT_SUPPORT_LOCALE_TYPE:pr(),__EXTEND_POINT__:pr()};function on(t){return jr(t,null,process.env.NODE_ENV!=="production"?{messages:Mb}:void 0)}const Mb={[Je.INVALID_ARGUMENT]:"Invalid arguments",[Je.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[Je.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[Je.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[Je.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function xa(t,e){return e.locale!=null?tu(e.locale):tu(t.locale)}let Ea;function tu(t){if(oe(t))return t;if(Ve(t)){if(t.resolvedOnce&&Ea!=null)return Ea;if(t.constructor.name==="Function"){const e=t();if(k1(e))throw on(Je.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Ea=e}else throw on(Je.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw on(Je.NOT_SUPPORT_LOCALE_TYPE)}function Ab(t,e,n){return[...new Set([n,...We(e)?e:Te(e)?Object.keys(e):oe(e)?[e]:[n]])]}function nu(t,e,n){const r=oe(n)?n:Bi,i=t;i.__localeChainCache||(i.__localeChainCache=new Map);let o=i.__localeChainCache.get(r);if(!o){o=[];let s=[n];for(;We(s);)s=ru(o,s,e);const a=We(e)||!Se(e)?e:e.default?e.default:null;s=oe(a)?[a]:a,We(s)&&ru(o,s,!1),i.__localeChainCache.set(r,o)}return o}function ru(t,e,n){let r=!0;for(let i=0;i<e.length&&Le(r);i++){const o=e[i];oe(o)&&(r=Db(t,e[i],n))}return r}function Db(t,e,n){let r;const i=e.split("-");do{const o=i.join("-");r=$b(t,o,n),i.splice(-1,1)}while(i.length&&r===!0);return r}function $b(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const i=e.replace(/!/g,"");t.push(i),(We(n)||Se(n))&&n[i]&&(r=n[i])}return r}const Lb="9.14.4",Fo=-1,Bi="en-US",jo="",iu=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Bb(){return{upper:(t,e)=>e==="text"&&oe(t)?t.toUpperCase():e==="vnode"&&Te(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&oe(t)?t.toLowerCase():e==="vnode"&&Te(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&oe(t)?iu(t):e==="vnode"&&Te(t)&&"__v_isVNode"in t?iu(t.children):t}}let ou;function su(t){ou=t}let au;function Ib(t){au=t}let lu;function Vb(t){lu=t}let cu=null;const Pb=t=>{cu=t},Rb=()=>cu;let du=null;const uu=t=>{du=t},Fb=()=>du;let fu=0;function jb(t={}){const e=Ve(t.onWarn)?t.onWarn:wn,n=oe(t.version)?t.version:Lb,r=oe(t.locale)||Ve(t.locale)?t.locale:Bi,i=Ve(r)?Bi:r,o=We(t.fallbackLocale)||Se(t.fallbackLocale)||oe(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:i,s=Se(t.messages)?t.messages:Ca(i),a=Se(t.datetimeFormats)?t.datetimeFormats:Ca(i),c=Se(t.numberFormats)?t.numberFormats:Ca(i),d=ct($e(),t.modifiers,Bb()),u=t.pluralRules||$e(),f=Ve(t.missing)?t.missing:null,h=Le(t.missingWarn)||Fr(t.missingWarn)?t.missingWarn:!0,p=Le(t.fallbackWarn)||Fr(t.fallbackWarn)?t.fallbackWarn:!0,m=!!t.fallbackFormat,g=!!t.unresolving,y=Ve(t.postTranslation)?t.postTranslation:null,k=Se(t.processor)?t.processor:null,x=Le(t.warnHtmlMessage)?t.warnHtmlMessage:!0,v=!!t.escapeParameter,b=Ve(t.messageCompiler)?t.messageCompiler:ou;process.env.NODE_ENV!=="production"&&Ve(t.messageCompiler)&&Ld(hr(gt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const C=Ve(t.messageResolver)?t.messageResolver:au||mb,w=Ve(t.localeFallbacker)?t.localeFallbacker:lu||Ab,N=Te(t.fallbackContext)?t.fallbackContext:void 0,L=t,S=Te(L.__datetimeFormatters)?L.__datetimeFormatters:new Map,D=Te(L.__numberFormatters)?L.__numberFormatters:new Map,F=Te(L.__meta)?L.__meta:{};fu++;const $={version:n,cid:fu,locale:r,fallbackLocale:o,messages:s,modifiers:d,pluralRules:u,missing:f,missingWarn:h,fallbackWarn:p,fallbackFormat:m,unresolving:g,postTranslation:y,processor:k,warnHtmlMessage:x,escapeParameter:v,messageCompiler:b,messageResolver:C,localeFallbacker:w,fallbackContext:N,onWarn:e,__meta:F};return $.datetimeFormats=a,$.numberFormats=c,$.__datetimeFormatters=S,$.__numberFormatters=D,process.env.NODE_ENV!=="production"&&($.__v_emitter=L.__v_emitter!=null?L.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&_b($,n,F),$}const Ca=t=>({[t]:$e()});function zo(t,e){return t instanceof RegExp?t.test(e):t}function hu(t,e){return t instanceof RegExp?t.test(e):t}function Sa(t,e,n,r,i){const{missing:o,onWarn:s}=t;if(process.env.NODE_ENV!=="production"){const a=t.__v_emitter;a&&a.emit("missing",{locale:n,key:e,type:i,groupId:`${i}:${e}`})}if(o!==null){const a=o(t,n,e,i);return oe(a)?a:e}else return process.env.NODE_ENV!=="production"&&hu(r,e)&&s(hr(gt.NOT_FOUND_KEY,{key:e,locale:n})),e}function Ii(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function pu(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function zb(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(pu(t,e[r]))return!0;return!1}function _a(t){return n=>Hb(n,t)}function Hb(t,e){const n=rb(e);if(n==null)throw $i(0);if(wa(n)===1){const o=ib(n);return t.plural(o.reduce((s,a)=>[...s,mu(t,a)],[]))}else return mu(t,n)}function mu(t,e){const n=ob(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=sb(e).reduce((i,o)=>[...i,Oa(t,o)],[]);return t.normalize(r)}}function Oa(t,e){const n=wa(e);switch(n){case 3:return Ro(e,n);case 9:return Ro(e,n);case 4:{const r=e;if(Zt(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(Zt(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw $i(n)}case 5:{const r=e;if(Zt(r,"i")&&Ge(r.i))return t.interpolate(t.list(r.i));if(Zt(r,"index")&&Ge(r.index))return t.interpolate(t.list(r.index));throw $i(n)}case 6:{const r=e,i=ab(r),o=lb(r);return t.linked(Oa(t,o),i?Oa(t,i):void 0,t.type)}case 7:return Ro(e,n);case 8:return Ro(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Wb="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function gu(t,e){e&&D1(t)&&wn(ka(Wb,{source:t}))}const yu=t=>t;let Wr=$e();function bu(t){t.code===Po.USE_MODULO_SYNTAX&&wn(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10.
|
|
21
21
|
reference: https://vue-i18n.intlify.dev/guide/essentials/syntax#rails-i18n-format
|
|
22
|
-
(message compiler warning message: ${t.message})`)}function
|
|
23
|
-
${d}`:c)}else throw s},onCacheKey:s=>
|
|
22
|
+
(message compiler warning message: ${t.message})`)}function ku(t,e={}){let n=!1;const r=e.onError||M1;return e.onError=i=>{n=!0,r(i)},{...tb(t,e),detectError:n}}const Ub=(t,e)=>{if(!oe(t))throw on(Je.NOT_SUPPORT_NON_STRING_MESSAGE);process.env.NODE_ENV!=="production"&&(e.onWarn=bu);{const n=Le(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&gu(t,n);const i=(e.onCacheKey||yu)(t),o=Wr[i];if(o)return o;const{code:s,detectError:a}=ku(t,e),c=new Function(`return ${s}`)();return a?c:Wr[i]=c}};function Yb(t,e){if(process.env.NODE_ENV!=="production"&&(e.onWarn=bu),__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&oe(t)){const n=Le(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&gu(t,n);const i=(e.onCacheKey||yu)(t),o=Wr[i];if(o)return o;const{ast:s,detectError:a}=ku(t,{...e,location:process.env.NODE_ENV!=="production",jit:!0}),c=_a(s);return a?c:Wr[i]=c}else{if(process.env.NODE_ENV!=="production"&&!Qt(t))return wn(`the message that is resolve with key '${e.key}' is not supported for jit compilation`),()=>t;const n=t.cacheKey;if(n){const r=Wr[n];return r||(Wr[n]=_a(t))}else return _a(t)}}const vu=()=>"",Ft=t=>Ve(t);function wu(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:o,fallbackLocale:s,messages:a}=t,[c,d]=Ta(...e),u=Le(d.missingWarn)?d.missingWarn:t.missingWarn,f=Le(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn,h=Le(d.escapeParameter)?d.escapeParameter:t.escapeParameter,p=!!d.resolvedMessage,m=oe(d.default)||Le(d.default)?Le(d.default)?o?c:()=>c:d.default:n?o?c:()=>c:"",g=n||m!=="",y=xa(t,d);h&&qb(d);let[k,x,v]=p?[c,y,a[y]||$e()]:xu(t,c,y,s,f,u),b=k,C=c;if(!p&&!(oe(b)||Qt(b)||Ft(b))&&g&&(b=m,C=b),!p&&(!(oe(b)||Qt(b)||Ft(b))||!oe(x)))return i?Fo:c;if(process.env.NODE_ENV!=="production"&&oe(b)&&t.messageCompiler==null)return wn(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${c}'.`),c;let w=!1;const N=()=>{w=!0},L=Ft(b)?b:Eu(t,c,x,b,C,N);if(w)return b;const S=Zb(t,x,v,d),D=Cb(S),F=Kb(t,L,D),$=r?r(F,c):F;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const U={timestamp:Date.now(),key:oe(c)?c:Ft(b)?b.key:"",locale:x||(Ft(b)?b.locale:""),format:oe(b)?b:Ft(b)?b.source:"",message:$};U.meta=ct({},t.__meta,Rb()||{}),Ob(U)}return $}function qb(t){We(t.list)?t.list=t.list.map(e=>oe(e)?Nd(e):e):Te(t.named)&&Object.keys(t.named).forEach(e=>{oe(t.named[e])&&(t.named[e]=Nd(t.named[e]))})}function xu(t,e,n,r,i,o){const{messages:s,onWarn:a,messageResolver:c,localeFallbacker:d}=t,u=d(t,r,n);let f=$e(),h,p=null,m=n,g=null;const y="translate";for(let k=0;k<u.length;k++){if(h=g=u[k],process.env.NODE_ENV!=="production"&&n!==h&&!pu(n,h)&&zo(i,e)&&a(hr(gt.FALLBACK_TO_TRANSLATE,{key:e,target:h})),process.env.NODE_ENV!=="production"&&n!==h){const C=t.__v_emitter;C&&C.emit("fallback",{type:y,key:e,from:m,to:g,groupId:`${y}:${e}`})}f=s[h]||$e();let x=null,v,b;if(process.env.NODE_ENV!=="production"&&bn&&(x=window.performance.now(),v="intlify-message-resolve-start",b="intlify-message-resolve-end",Dt&&Dt(v)),(p=c(f,e))===null&&(p=f[e]),process.env.NODE_ENV!=="production"&&bn){const C=window.performance.now(),w=t.__v_emitter;w&&x&&p&&w.emit("message-resolve",{type:"message-resolve",key:e,message:p,time:C-x,groupId:`${y}:${e}`}),v&&b&&Dt&&ur&&(Dt(b),ur("intlify message resolve",v,b))}if(oe(p)||Qt(p)||Ft(p))break;if(!zb(h,u)){const C=Sa(t,e,h,o,y);C!==e&&(p=C)}m=g}return[p,h,f]}function Eu(t,e,n,r,i,o){const{messageCompiler:s,warnHtmlMessage:a}=t;if(Ft(r)){const h=r;return h.locale=h.locale||n,h.key=h.key||e,h}if(s==null){const h=()=>r;return h.locale=n,h.key=e,h}let c=null,d,u;process.env.NODE_ENV!=="production"&&bn&&(c=window.performance.now(),d="intlify-message-compilation-start",u="intlify-message-compilation-end",Dt&&Dt(d));const f=s(r,Gb(t,n,i,r,a,o));if(process.env.NODE_ENV!=="production"&&bn){const h=window.performance.now(),p=t.__v_emitter;p&&c&&p.emit("message-compilation",{type:"message-compilation",message:r,time:h-c,groupId:`translate:${e}`}),d&&u&&Dt&&ur&&(Dt(u),ur("intlify message compilation",d,u))}return f.locale=n,f.key=e,f.source=r,f}function Kb(t,e,n){let r=null,i,o;process.env.NODE_ENV!=="production"&&bn&&(r=window.performance.now(),i="intlify-message-evaluation-start",o="intlify-message-evaluation-end",Dt&&Dt(i));const s=e(n);if(process.env.NODE_ENV!=="production"&&bn){const a=window.performance.now(),c=t.__v_emitter;c&&r&&c.emit("message-evaluation",{type:"message-evaluation",value:s,time:a-r,groupId:`translate:${e.key}`}),i&&o&&Dt&&ur&&(Dt(o),ur("intlify message evaluation",i,o))}return s}function Ta(...t){const[e,n,r]=t,i=$e();if(!oe(e)&&!Ge(e)&&!Ft(e)&&!Qt(e))throw on(Je.INVALID_ARGUMENT);const o=Ge(e)?String(e):(Ft(e),e);return Ge(n)?i.plural=n:oe(n)?i.default=n:Se(n)&&!$o(n)?i.named=n:We(n)&&(i.list=n),Ge(r)?i.plural=r:oe(r)?i.default=r:Se(r)&&ct(i,r),[o,i]}function Gb(t,e,n,r,i,o){return{locale:e,key:n,warnHtmlMessage:i,onError:s=>{if(o&&o(s),process.env.NODE_ENV!=="production"){const a=Jb(r),c=`Message compilation error: ${s.message}`,d=s.location&&a&&x1(a,s.location.start.offset,s.location.end.offset),u=t.__v_emitter;u&&a&&u.emit("compile-error",{message:a,error:s.message,start:s.location&&s.location.start.offset,end:s.location&&s.location.end.offset,groupId:`translate:${n}`}),console.error(d?`${c}
|
|
23
|
+
${d}`:c)}else throw s},onCacheKey:s=>p1(e,n,s)}}function Jb(t){if(oe(t))return t;if(t.loc&&t.loc.source)return t.loc.source}function Zb(t,e,n,r){const{modifiers:i,pluralRules:o,messageResolver:s,fallbackLocale:a,fallbackWarn:c,missingWarn:d,fallbackContext:u}=t,h={locale:e,modifiers:i,pluralRules:o,messages:p=>{let m=s(n,p);if(m==null&&u){const[,,g]=xu(u,p,e,a,c,d);m=s(g,p)}if(oe(m)||Qt(m)){let g=!1;const k=Eu(t,p,e,m,p,()=>{g=!0});return g?vu:k}else return Ft(m)?m:vu}};return t.processor&&(h.processor=t.processor),r.list&&(h.list=r.list),r.named&&(h.named=r.named),Ge(r.plural)&&(h.pluralIndex=r.plural),h}const Cu=typeof Intl<"u",Su={dateTimeFormat:Cu&&typeof Intl.DateTimeFormat<"u",numberFormat:Cu&&typeof Intl.NumberFormat<"u"};function _u(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:i,onWarn:o,localeFallbacker:s}=t,{__datetimeFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!Su.dateTimeFormat)return o(hr(gt.CANNOT_FORMAT_DATE)),jo;const[c,d,u,f]=Na(...e),h=Le(u.missingWarn)?u.missingWarn:t.missingWarn,p=Le(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,m=!!u.part,g=xa(t,u),y=s(t,i,g);if(!oe(c)||c==="")return new Intl.DateTimeFormat(g,f).format(d);let k={},x,v=null,b=g,C=null;const w="datetime format";for(let S=0;S<y.length;S++){if(x=C=y[S],process.env.NODE_ENV!=="production"&&g!==x&&zo(p,c)&&o(hr(gt.FALLBACK_TO_DATE_FORMAT,{key:c,target:x})),process.env.NODE_ENV!=="production"&&g!==x){const D=t.__v_emitter;D&&D.emit("fallback",{type:w,key:c,from:b,to:C,groupId:`${w}:${c}`})}if(k=n[x]||{},v=k[c],Se(v))break;Sa(t,c,x,h,w),b=C}if(!Se(v)||!oe(x))return r?Fo:c;let N=`${x}__${c}`;$o(f)||(N=`${N}__${JSON.stringify(f)}`);let L=a.get(N);return L||(L=new Intl.DateTimeFormat(x,ct({},v,f)),a.set(N,L)),m?L.formatToParts(d):L.format(d)}const Ou=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Na(...t){const[e,n,r,i]=t,o=$e();let s=$e(),a;if(oe(e)){const c=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!c)throw on(Je.INVALID_ISO_DATE_ARGUMENT);const d=c[3]?c[3].trim().startsWith("T")?`${c[1].trim()}${c[3].trim()}`:`${c[1].trim()}T${c[3].trim()}`:c[1].trim();a=new Date(d);try{a.toISOString()}catch{throw on(Je.INVALID_ISO_DATE_ARGUMENT)}}else if(g1(e)){if(isNaN(e.getTime()))throw on(Je.INVALID_DATE_ARGUMENT);a=e}else if(Ge(e))a=e;else throw on(Je.INVALID_ARGUMENT);return oe(n)?o.key=n:Se(n)&&Object.keys(n).forEach(c=>{Ou.includes(c)?s[c]=n[c]:o[c]=n[c]}),oe(r)?o.locale=r:Se(r)&&(s=r),Se(i)&&(s=i),[o.key||"",a,o,s]}function Tu(t,e,n){const r=t;for(const i in n){const o=`${e}__${i}`;r.__datetimeFormatters.has(o)&&r.__datetimeFormatters.delete(o)}}function Nu(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:i,onWarn:o,localeFallbacker:s}=t,{__numberFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!Su.numberFormat)return o(hr(gt.CANNOT_FORMAT_NUMBER)),jo;const[c,d,u,f]=Ma(...e),h=Le(u.missingWarn)?u.missingWarn:t.missingWarn,p=Le(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,m=!!u.part,g=xa(t,u),y=s(t,i,g);if(!oe(c)||c==="")return new Intl.NumberFormat(g,f).format(d);let k={},x,v=null,b=g,C=null;const w="number format";for(let S=0;S<y.length;S++){if(x=C=y[S],process.env.NODE_ENV!=="production"&&g!==x&&zo(p,c)&&o(hr(gt.FALLBACK_TO_NUMBER_FORMAT,{key:c,target:x})),process.env.NODE_ENV!=="production"&&g!==x){const D=t.__v_emitter;D&&D.emit("fallback",{type:w,key:c,from:b,to:C,groupId:`${w}:${c}`})}if(k=n[x]||{},v=k[c],Se(v))break;Sa(t,c,x,h,w),b=C}if(!Se(v)||!oe(x))return r?Fo:c;let N=`${x}__${c}`;$o(f)||(N=`${N}__${JSON.stringify(f)}`);let L=a.get(N);return L||(L=new Intl.NumberFormat(x,ct({},v,f)),a.set(N,L)),m?L.formatToParts(d):L.format(d)}const Mu=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Ma(...t){const[e,n,r,i]=t,o=$e();let s=$e();if(!Ge(e))throw on(Je.INVALID_ARGUMENT);const a=e;return oe(n)?o.key=n:Se(n)&&Object.keys(n).forEach(c=>{Mu.includes(c)?s[c]=n[c]:o[c]=n[c]}),oe(r)?o.locale=r:Se(r)&&(s=r),Se(i)&&(s=i),[o.key||"",a,o,s]}function Au(t,e,n){const r=t;for(const i in n){const o=`${e}__${i}`;r.__numberFormatters.has(o)&&r.__numberFormatters.delete(o)}}nb();/*!
|
|
24
24
|
* vue-i18n v9.14.4
|
|
25
25
|
* (c) 2025 kazuya kawaguchi
|
|
26
26
|
* Released under the MIT License.
|
|
27
|
-
*/const Qb="9.14.4";function ek(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(vn().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(vn().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(vn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vn().__INTLIFY_PROD_DEVTOOLS__=!1)}const $u=gt.__EXTEND_POINT__,En=Lo($u),Ct={FALLBACK_TO_ROOT:$u,NOT_SUPPORTED_PRESERVE:En(),NOT_SUPPORTED_FORMATTER:En(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:En(),NOT_SUPPORTED_GET_CHOICE_INDEX:En(),COMPONENT_NAME_LEGACY_COMPATIBLE:En(),NOT_FOUND_PARENT_SCOPE:En(),IGNORE_OBJ_FLATTEN:En(),NOTICE_DROP_ALLOW_COMPOSITION:En(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:En()},tk={[Ct.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[Ct.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[Ct.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[Ct.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[Ct.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[Ct.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[Ct.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[Ct.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[Ct.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[Ct.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ho(t,...e){return ka(tk[t],...e)}const Lu=Je.__EXTEND_POINT__,St=Lo(Lu),Re={UNEXPECTED_RETURN_TYPE:Lu,INVALID_ARGUMENT:St(),MUST_BE_CALL_SETUP_TOP:St(),NOT_INSTALLED:St(),NOT_AVAILABLE_IN_LEGACY_MODE:St(),REQUIRED_VALUE:St(),INVALID_VALUE:St(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:St(),NOT_INSTALLED_WITH_PROVIDE:St(),UNEXPECTED_ERROR:St(),NOT_COMPATIBLE_LEGACY_VUE_I18N:St(),BRIDGE_SUPPORT_VUE_2_ONLY:St(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:St(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:St(),__EXTEND_POINT__:St()};function Fn(t,...e){return jr(t,null,process.env.NODE_ENV!=="production"?{messages:nk,args:e}:void 0)}const nk={[Re.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Re.INVALID_ARGUMENT]:"Invalid argument",[Re.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Re.NOT_INSTALLED]:"Need to install with `app.use` function",[Re.UNEXPECTED_ERROR]:"Unexpected error",[Re.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[Re.REQUIRED_VALUE]:"Required in value: {0}",[Re.INVALID_VALUE]:"Invalid value",[Re.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Re.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Re.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Re.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},Aa=kn("__translateVNode"),Da=kn("__datetimeParts"),$a=kn("__numberParts"),La=kn("__enableEmitter"),Ba=kn("__disableEmitter"),rk=kn("__setPluralRules"),Bu=kn("__injectWithOption"),Ia=kn("__dispose");function Vi(t){if(!Te(t)||Qt(t))return t;for(const e in t)if(Zt(t,e))if(!e.includes("."))Te(t[e])&&Vi(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,o=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in i||(i[n[s]]=$e()),!Te(i[n[s]])){process.env.NODE_ENV!=="production"&&wn(Ho(Ct.IGNORE_OBJ_FLATTEN,{key:n[s]})),o=!0;break}i=i[n[s]]}if(o||(Qt(i)?Zd.includes(n[r])||delete t[e]:(i[n[r]]=t[e],delete t[e])),!Qt(i)){const s=i[n[r]];Te(s)&&Vi(s)}}return t}function Va(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:o}=e,s=Se(n)?n:We(r)?$e():{[t]:$e()};if(We(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:c,resource:d}=a;c?(s[c]=s[c]||$e(),Io(d,s[c])):Io(d,s)}else oe(a)&&Io(JSON.parse(a),s)}),i==null&&o)for(const a in s)Zt(s,a)&&Vi(s[a]);return s}function Iu(t){return t.type}function ik(t,e,n){let r=Te(e.messages)?e.messages:$e();"__i18nGlobal"in n&&(r=Va(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(o=>{t.mergeLocaleMessage(o,r[o])});{if(Te(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(Te(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function Vu(t){return l.createVNode(l.Text,null,t,0)}const Pu="__INTLIFY_META__",Ru=()=>[],ok=()=>!1;let Fu=0;function ju(t){return(e,n,r,i)=>t(n,r,l.getCurrentInstance()||void 0,i)}const sk=()=>{const t=l.getCurrentInstance();let e=null;return t&&(e=Iu(t)[Pu])?{[Pu]:e}:null};function ak(t={},e){const{__root:n,__injectWithOption:r}=t,i=n===void 0,o=t.flatJson,s=bn?l.ref:l.shallowRef,a=!!t.translateExistCompatible;process.env.NODE_ENV!=="production"&&a&&Bd(Ho(Ct.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let c=Le(t.inheritLocale)?t.inheritLocale:!0;const d=s(n&&c?n.locale.value:oe(t.locale)?t.locale:Bi),u=s(n&&c?n.fallbackLocale.value:oe(t.fallbackLocale)||We(t.fallbackLocale)||Se(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:d.value),f=s(Va(d.value,t)),h=s(Se(t.datetimeFormats)?t.datetimeFormats:{[d.value]:{}}),p=s(Se(t.numberFormats)?t.numberFormats:{[d.value]:{}});let m=n?n.missingWarn:Le(t.missingWarn)||Fr(t.missingWarn)?t.missingWarn:!0,g=n?n.fallbackWarn:Le(t.fallbackWarn)||Fr(t.fallbackWarn)?t.fallbackWarn:!0,y=n?n.fallbackRoot:Le(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,x=Ve(t.missing)?t.missing:null,w=Ve(t.missing)?ju(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,C=n?n.warnHtmlMessage:Le(t.warnHtmlMessage)?t.warnHtmlMessage:!0,v=!!t.escapeParameter;const S=n?n.modifiers:Se(t.modifiers)?t.modifiers:{};let D=t.pluralRules||n&&n.pluralRules,O;O=(()=>{i&&fu(null);const P={version:Qb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:S,pluralRules:D,missing:w===null?void 0:w,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:C,escapeParameter:v,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};P.datetimeFormats=h.value,P.numberFormats=p.value,P.__datetimeFormatters=Se(O)?O.__datetimeFormatters:void 0,P.__numberFormatters=Se(O)?O.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(P.__v_emitter=Se(O)?O.__v_emitter:void 0);const Z=zb(P);return i&&fu(Z),Z})(),Ii(O,d.value,u.value);function V(){return[d.value,u.value,f.value,h.value,p.value]}const B=l.computed({get:()=>d.value,set:P=>{d.value=P,O.locale=d.value}}),J=l.computed({get:()=>u.value,set:P=>{u.value=P,O.fallbackLocale=u.value,Ii(O,d.value,P)}}),Y=l.computed(()=>f.value),I=l.computed(()=>h.value),T=l.computed(()=>p.value);function R(){return Ve(b)?b:null}function F(P){b=P,O.postTranslation=P}function ee(){return x}function ie(P){P!==null&&(w=ju(P)),x=P,O.missing=w}function he(P,Z){return P!=="translate"||!Z.resolvedMessage}const ue=(P,Z,N,A,W,te)=>{V();let de;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(O.fallbackContext=n?jb():void 0),de=P(O)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(O.fallbackContext=void 0)}if(N!=="translate exists"&&Ge(de)&&de===Fo||N==="translate exists"&&!de){const[M,X]=Z();if(process.env.NODE_ENV!=="production"&&n&&oe(M)&&he(N,X)&&(y&&(zo(g,M)||pu(m,M))&&wn(Ho(Ct.FALLBACK_TO_ROOT,{key:M,type:N})),process.env.NODE_ENV!=="production")){const{__v_emitter:re}=O;re&&y&&re.emit("fallback",{type:N,key:M,to:"global",groupId:`${N}:${M}`})}return n&&y?A(n):W(M)}else{if(te(de))return de;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function L(...P){return ue(Z=>Reflect.apply(xu,null,[Z,...P]),()=>Ta(...P),"translate",Z=>Reflect.apply(Z.t,Z,[...P]),Z=>Z,Z=>oe(Z))}function z(...P){const[Z,N,A]=P;if(A&&!Te(A))throw Fn(Re.INVALID_ARGUMENT);return L(Z,N,ct({resolvedMessage:!0},A||{}))}function q(...P){return ue(Z=>Reflect.apply(Ou,null,[Z,...P]),()=>Na(...P),"datetime format",Z=>Reflect.apply(Z.d,Z,[...P]),()=>jo,Z=>oe(Z))}function U(...P){return ue(Z=>Reflect.apply(Mu,null,[Z,...P]),()=>Ma(...P),"number format",Z=>Reflect.apply(Z.n,Z,[...P]),()=>jo,Z=>oe(Z))}function j(P){return P.map(Z=>oe(Z)||Ge(Z)||Le(Z)?Vu(String(Z)):Z)}const le={normalize:j,interpolate:P=>P,type:"vnode"};function ve(...P){return ue(Z=>{let N;const A=Z;try{A.processor=le,N=Reflect.apply(xu,null,[A,...P])}finally{A.processor=null}return N},()=>Ta(...P),"translate",Z=>Z[Aa](...P),Z=>[Vu(Z)],Z=>We(Z))}function Ne(...P){return ue(Z=>Reflect.apply(Mu,null,[Z,...P]),()=>Ma(...P),"number format",Z=>Z[$a](...P),Ru,Z=>oe(Z)||We(Z))}function Ie(...P){return ue(Z=>Reflect.apply(Ou,null,[Z,...P]),()=>Na(...P),"datetime format",Z=>Z[Da](...P),Ru,Z=>oe(Z)||We(Z))}function tt(P){D=P,O.pluralRules=D}function Q(P,Z){return ue(()=>{if(!P)return!1;const N=oe(Z)?Z:d.value,A=at(N),W=O.messageResolver(A,P);return a?W!=null:Qt(W)||Ft(W)||oe(W)},()=>[P],"translate exists",N=>Reflect.apply(N.te,N,[P,Z]),ok,N=>Le(N))}function Ee(P){let Z=null;const N=ru(O,u.value,d.value);for(let A=0;A<N.length;A++){const W=f.value[N[A]]||{},te=O.messageResolver(W,P);if(te!=null){Z=te;break}}return Z}function Mt(P){const Z=Ee(P);return Z??(n?n.tm(P)||{}:{})}function at(P){return f.value[P]||{}}function lt(P,Z){if(o){const N={[P]:Z};for(const A in N)Zt(N,A)&&Vi(N[A]);Z=N[P]}f.value[P]=Z,O.messages=f.value}function ht(P,Z){f.value[P]=f.value[P]||{};const N={[P]:Z};if(o)for(const A in N)Zt(N,A)&&Vi(N[A]);Z=N[P],Io(Z,f.value[P]),O.messages=f.value}function E(P){return h.value[P]||{}}function _(P,Z){h.value[P]=Z,O.datetimeFormats=h.value,Nu(O,P,Z)}function H(P,Z){h.value[P]=ct(h.value[P]||{},Z),O.datetimeFormats=h.value,Nu(O,P,Z)}function se(P){return p.value[P]||{}}function Me(P,Z){p.value[P]=Z,O.numberFormats=p.value,Du(O,P,Z)}function _e(P,Z){p.value[P]=ct(p.value[P]||{},Z),O.numberFormats=p.value,Du(O,P,Z)}Fu++,n&&bn&&(l.watch(n.locale,P=>{c&&(d.value=P,O.locale=P,Ii(O,d.value,u.value))}),l.watch(n.fallbackLocale,P=>{c&&(u.value=P,O.fallbackLocale=P,Ii(O,d.value,u.value))}));const Oe={id:Fu,locale:B,fallbackLocale:J,get inheritLocale(){return c},set inheritLocale(P){c=P,P&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ii(O,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:Y,get modifiers(){return S},get pluralRules(){return D||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(P){m=P,O.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(P){g=P,O.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(P){y=P},get fallbackFormat(){return k},set fallbackFormat(P){k=P,O.fallbackFormat=k},get warnHtmlMessage(){return C},set warnHtmlMessage(P){C=P,O.warnHtmlMessage=P},get escapeParameter(){return v},set escapeParameter(P){v=P,O.escapeParameter=P},t:L,getLocaleMessage:at,setLocaleMessage:lt,mergeLocaleMessage:ht,getPostTranslationHandler:R,setPostTranslationHandler:F,getMissingHandler:ee,setMissingHandler:ie,[rk]:tt};return Oe.datetimeFormats=I,Oe.numberFormats=T,Oe.rt=z,Oe.te=Q,Oe.tm=Mt,Oe.d=q,Oe.n=U,Oe.getDateTimeFormat=E,Oe.setDateTimeFormat=_,Oe.mergeDateTimeFormat=H,Oe.getNumberFormat=se,Oe.setNumberFormat=Me,Oe.mergeNumberFormat=_e,Oe[Bu]=r,Oe[Aa]=ve,Oe[Da]=Ie,Oe[$a]=Ne,process.env.NODE_ENV!=="production"&&(Oe[La]=P=>{O.__v_emitter=P},Oe[Ba]=()=>{O.__v_emitter=void 0}),Oe}const Pa={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function lk({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===l.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},$e())}function zu(t){return l.Fragment}ct({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Ge(t)||!isNaN(t)}},Pa);function ck(t){return We(t)&&!oe(t[0])}function Hu(t,e,n,r){const{slots:i,attrs:o}=e;return()=>{const s={part:!0};let a=$e();t.locale&&(s.locale=t.locale),oe(t.format)?s.key=t.format:Te(t.format)&&(oe(t.format.key)&&(s.key=t.format.key),a=Object.keys(t.format).reduce((h,p)=>n.includes(p)?ct($e(),h,{[p]:t.format[p]}):h,$e()));const c=r(t.value,s,a);let d=[s.key];We(c)?d=c.map((h,p)=>{const m=i[h.type],g=m?m({[h.type]:h.value,index:p,parts:c}):[h.value];return ck(g)&&(g[0].key=`${h.type}-${p}`),g}):oe(c)&&(d=[c]);const u=ct($e(),o),f=oe(t.tag)||Te(t.tag)?t.tag:zu();return l.h(f,u,d)}}ct({value:{type:Number,required:!0},format:{type:[String,Object]}},Pa),ct({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Pa);function Wu(t,e){}const dk=kn("global-vue-i18n");function jn(t={}){const e=l.getCurrentInstance();if(e==null)throw Fn(Re.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Fn(Re.NOT_INSTALLED);const n=uk(e),r=hk(n),i=Iu(e),o=fk(t,i);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!t.__useComponent){if(!n.allowComposition)throw Fn(Re.NOT_AVAILABLE_IN_LEGACY_MODE);return yk(e,o,r,t)}if(o==="global")return ik(r,t,i),r;if(o==="parent"){let c=pk(n,e,t.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&wn(Ho(Ct.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=n;let a=s.__getInstance(e);if(a==null){const c=ct({},t);"__i18n"in i&&(c.__i18n=i.__i18n),r&&(c.__root=r),a=ak(c),s.__composerExtend&&(a[Ia]=s.__composerExtend(a)),gk(s,e,a),s.__setInstance(e,a)}return a}function uk(t){{const e=l.inject(t.isCE?dk:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Fn(t.isCE?Re.NOT_INSTALLED_WITH_PROVIDE:Re.UNEXPECTED_ERROR);return e}}function fk(t,e){return $o(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function hk(t){return t.mode==="composition"?t.global:t.global.__composer}function pk(t,e,n=!1){let r=null;const i=e.root;let o=mk(e,n);for(;o!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const a=s.__getInstance(o);a!=null&&(r=a.__composer,n&&r&&!r[Bu]&&(r=null))}if(r!=null||i===o)break;o=o.parent}return r}function mk(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function gk(t,e,n){let r=null;l.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=C1();const i=n;i[La]&&i[La](r),r.on("*",Wu)}},e),l.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",Wu),i[Ba]&&i[Ba](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const o=i[Ia];o&&(o(),delete i[Ia])},e)}function yk(t,e,n,r={}){const i=e==="local",o=l.shallowRef(null);if(i&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw Fn(Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const s=Le(r.inheritLocale)?r.inheritLocale:!oe(r.locale),a=l.ref(!i||s?n.locale.value:oe(r.locale)?r.locale:Bi),c=l.ref(!i||s?n.fallbackLocale.value:oe(r.fallbackLocale)||We(r.fallbackLocale)||Se(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:a.value),d=l.ref(Va(a.value,r)),u=l.ref(Se(r.datetimeFormats)?r.datetimeFormats:{[a.value]:{}}),f=l.ref(Se(r.numberFormats)?r.numberFormats:{[a.value]:{}}),h=i?n.missingWarn:Le(r.missingWarn)||Fr(r.missingWarn)?r.missingWarn:!0,p=i?n.fallbackWarn:Le(r.fallbackWarn)||Fr(r.fallbackWarn)?r.fallbackWarn:!0,m=i?n.fallbackRoot:Le(r.fallbackRoot)?r.fallbackRoot:!0,g=!!r.fallbackFormat,y=Ve(r.missing)?r.missing:null,k=Ve(r.postTranslation)?r.postTranslation:null,x=i?n.warnHtmlMessage:Le(r.warnHtmlMessage)?r.warnHtmlMessage:!0,w=!!r.escapeParameter,b=i?n.modifiers:Se(r.modifiers)?r.modifiers:{},C=r.pluralRules||i&&n.pluralRules;function v(){return[a.value,c.value,d.value,u.value,f.value]}const S=l.computed({get:()=>o.value?o.value.locale.value:a.value,set:Q=>{o.value&&(o.value.locale.value=Q),a.value=Q}}),D=l.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:Q=>{o.value&&(o.value.fallbackLocale.value=Q),c.value=Q}}),O=l.computed(()=>o.value?o.value.messages.value:d.value),$=l.computed(()=>u.value),V=l.computed(()=>f.value);function B(){return o.value?o.value.getPostTranslationHandler():k}function J(Q){o.value&&o.value.setPostTranslationHandler(Q)}function Y(){return o.value?o.value.getMissingHandler():y}function I(Q){o.value&&o.value.setMissingHandler(Q)}function T(Q){return v(),Q()}function R(...Q){return o.value?T(()=>Reflect.apply(o.value.t,null,[...Q])):T(()=>"")}function F(...Q){return o.value?Reflect.apply(o.value.rt,null,[...Q]):""}function ee(...Q){return o.value?T(()=>Reflect.apply(o.value.d,null,[...Q])):T(()=>"")}function ie(...Q){return o.value?T(()=>Reflect.apply(o.value.n,null,[...Q])):T(()=>"")}function he(Q){return o.value?o.value.tm(Q):{}}function ue(Q,Ee){return o.value?o.value.te(Q,Ee):!1}function L(Q){return o.value?o.value.getLocaleMessage(Q):{}}function z(Q,Ee){o.value&&(o.value.setLocaleMessage(Q,Ee),d.value[Q]=Ee)}function q(Q,Ee){o.value&&o.value.mergeLocaleMessage(Q,Ee)}function U(Q){return o.value?o.value.getDateTimeFormat(Q):{}}function j(Q,Ee){o.value&&(o.value.setDateTimeFormat(Q,Ee),u.value[Q]=Ee)}function ce(Q,Ee){o.value&&o.value.mergeDateTimeFormat(Q,Ee)}function le(Q){return o.value?o.value.getNumberFormat(Q):{}}function ve(Q,Ee){o.value&&(o.value.setNumberFormat(Q,Ee),f.value[Q]=Ee)}function Ne(Q,Ee){o.value&&o.value.mergeNumberFormat(Q,Ee)}const Ie={get id(){return o.value?o.value.id:-1},locale:S,fallbackLocale:D,messages:O,datetimeFormats:$,numberFormats:V,get inheritLocale(){return o.value?o.value.inheritLocale:s},set inheritLocale(Q){o.value&&(o.value.inheritLocale=Q)},get availableLocales(){return o.value?o.value.availableLocales:Object.keys(d.value)},get modifiers(){return o.value?o.value.modifiers:b},get pluralRules(){return o.value?o.value.pluralRules:C},get isGlobal(){return o.value?o.value.isGlobal:!1},get missingWarn(){return o.value?o.value.missingWarn:h},set missingWarn(Q){o.value&&(o.value.missingWarn=Q)},get fallbackWarn(){return o.value?o.value.fallbackWarn:p},set fallbackWarn(Q){o.value&&(o.value.missingWarn=Q)},get fallbackRoot(){return o.value?o.value.fallbackRoot:m},set fallbackRoot(Q){o.value&&(o.value.fallbackRoot=Q)},get fallbackFormat(){return o.value?o.value.fallbackFormat:g},set fallbackFormat(Q){o.value&&(o.value.fallbackFormat=Q)},get warnHtmlMessage(){return o.value?o.value.warnHtmlMessage:x},set warnHtmlMessage(Q){o.value&&(o.value.warnHtmlMessage=Q)},get escapeParameter(){return o.value?o.value.escapeParameter:w},set escapeParameter(Q){o.value&&(o.value.escapeParameter=Q)},t:R,getPostTranslationHandler:B,setPostTranslationHandler:J,getMissingHandler:Y,setMissingHandler:I,rt:F,d:ee,n:ie,tm:he,te:ue,getLocaleMessage:L,setLocaleMessage:z,mergeLocaleMessage:q,getDateTimeFormat:U,setDateTimeFormat:j,mergeDateTimeFormat:ce,getNumberFormat:le,setNumberFormat:ve,mergeNumberFormat:Ne};function tt(Q){Q.locale.value=a.value,Q.fallbackLocale.value=c.value,Object.keys(d.value).forEach(Ee=>{Q.mergeLocaleMessage(Ee,d.value[Ee])}),Object.keys(u.value).forEach(Ee=>{Q.mergeDateTimeFormat(Ee,u.value[Ee])}),Object.keys(f.value).forEach(Ee=>{Q.mergeNumberFormat(Ee,f.value[Ee])}),Q.escapeParameter=w,Q.fallbackFormat=g,Q.fallbackRoot=m,Q.fallbackWarn=p,Q.missingWarn=h,Q.warnHtmlMessage=x}return l.onBeforeMount(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw Fn(Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const Q=o.value=t.proxy.$i18n.__composer;e==="global"?(a.value=Q.locale.value,c.value=Q.fallbackLocale.value,d.value=Q.messages.value,u.value=Q.datetimeFormats.value,f.value=Q.numberFormats.value):i&&tt(Q)}),Ie}if(ek(),__INTLIFY_JIT_COMPILATION__?au(qb):au(Yb),Vb(yb),Pb(ru),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=vn();t.__INTLIFY__=!0,_b(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const bk={},kk={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},vk=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function wk(t,e){return l.openBlock(),l.createElementBlock("svg",kk,vk)}const Uu=be(bk,[["render",wk]]),xk={},Ek={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Ck=[l.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 Sk(t,e){return l.openBlock(),l.createElementBlock("svg",Ek,Ck)}const Ra=be(xk,[["render",Sk]]),_k={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},Ok={class:"flex items-center gap-2"},Tk={key:0},Nk={class:""},Mk={class:"flex justify-end"},Ak={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},Dk={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},$k={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,material:Boolean,naked: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! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,a)=>(l.openBlock(),l.createElementBlock("div",null,[t.label?(l.openBlock(),l.createElementBlock("div",_k,[l.createElementVNode("div",Ok,[l.createElementVNode("span",null,l.toDisplayString(t.label),1),t.required&&!t.hideRequired?(l.openBlock(),l.createElementBlock("span",Tk,"*")):l.createCommentVNode("",!0),l.createElementVNode("div",Nk,[t.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.info),1)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])]),l.createElementVNode("div",Mk,[l.renderSlot(s.$slots,"more")])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["wpic-input overflow-auto leading-none flex relative items-center",{"border rounded-sm pr-3":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[l.unref(fe).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[l.unref(fe).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(l.openBlock(),l.createElementBlock("div",Ak,[l.createElementVNode("div",Dk,[l.renderSlot(s.$slots,"prepend")])])):l.createCommentVNode("",!0),l.renderSlot(s.$slots,"default"),t.loading?(l.openBlock(),l.createElementBlock("div",$k,[l.createVNode(Ir,{class:"w-6 h-6 opacity-50"})])):t.clearable?(l.openBlock(),l.createElementBlock("div",{key:2,onClick:l.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"},[l.createVNode(Di,{class:"w-5 h-5 opacity-50"})])):l.createCommentVNode("",!0)],2)]))}});var sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ri(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Lk(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Wo=Lk,Bk=typeof sn=="object"&&sn&&sn.Object===Object&&sn,Yu=Bk,Ik=Yu,Vk=typeof self=="object"&&self&&self.Object===Object&&self,Pk=Ik||Vk||Function("return this")(),an=Pk,Rk=an,Fk=function(){return Rk.Date.now()},jk=Fk,zk=/\s/;function Hk(t){for(var e=t.length;e--&&zk.test(t.charAt(e)););return e}var Wk=Hk,Uk=Wk,Yk=/^\s+/;function qk(t){return t&&t.slice(0,Uk(t)+1).replace(Yk,"")}var Kk=qk,Gk=an,Jk=Gk.Symbol,Fa=Jk,qu=Fa,Ku=Object.prototype,Zk=Ku.hasOwnProperty,Xk=Ku.toString,Fi=qu?qu.toStringTag:void 0;function Qk(t){var e=Zk.call(t,Fi),n=t[Fi];try{t[Fi]=void 0;var r=!0}catch{}var i=Xk.call(t);return r&&(e?t[Fi]=n:delete t[Fi]),i}var e2=Qk,t2=Object.prototype,n2=t2.toString;function r2(t){return n2.call(t)}var i2=r2,Gu=Fa,o2=e2,s2=i2,a2="[object Null]",l2="[object Undefined]",Ju=Gu?Gu.toStringTag:void 0;function c2(t){return t==null?t===void 0?l2:a2:Ju&&Ju in Object(t)?o2(t):s2(t)}var ji=c2;function d2(t){return t!=null&&typeof t=="object"}var zi=d2,u2=ji,f2=zi,h2="[object Symbol]";function p2(t){return typeof t=="symbol"||f2(t)&&u2(t)==h2}var m2=p2,g2=Kk,Zu=Wo,y2=m2,Xu=NaN,b2=/^[-+]0x[0-9a-f]+$/i,k2=/^0b[01]+$/i,v2=/^0o[0-7]+$/i,w2=parseInt;function x2(t){if(typeof t=="number")return t;if(y2(t))return Xu;if(Zu(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Zu(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=g2(t);var n=k2.test(t);return n||v2.test(t)?w2(t.slice(2),n?2:8):b2.test(t)?Xu:+t}var E2=x2,C2=Wo,ja=jk,Qu=E2,S2="Expected a function",_2=Math.max,O2=Math.min;function T2(t,e,n){var r,i,o,s,a,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(S2);e=Qu(e)||0,C2(n)&&(u=!!n.leading,f="maxWait"in n,o=f?_2(Qu(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(v){var S=r,D=i;return r=i=void 0,d=v,s=t.apply(D,S),s}function m(v){return d=v,a=setTimeout(k,e),u?p(v):s}function g(v){var S=v-c,D=v-d,O=e-S;return f?O2(O,o-D):O}function y(v){var S=v-c,D=v-d;return c===void 0||S>=e||S<0||f&&D>=o}function k(){var v=ja();if(y(v))return x(v);a=setTimeout(k,g(v))}function x(v){return a=void 0,h&&r?p(v):(r=i=void 0,s)}function w(){a!==void 0&&clearTimeout(a),d=0,r=c=i=a=void 0}function b(){return a===void 0?s:x(ja())}function C(){var v=ja(),S=y(v);if(r=arguments,i=this,c=v,S){if(a===void 0)return m(c);if(f)return clearTimeout(a),a=setTimeout(k,e),p(c)}return a===void 0&&(a=setTimeout(k,e)),s}return C.cancel=w,C.flush=b,C}var N2=T2;const ef=Ri(N2);function M2(){this.__data__=[],this.size=0}var A2=M2;function D2(t,e){return t===e||t!==t&&e!==e}var tf=D2,$2=tf;function L2(t,e){for(var n=t.length;n--;)if($2(t[n][0],e))return n;return-1}var Uo=L2,B2=Uo,I2=Array.prototype,V2=I2.splice;function P2(t){var e=this.__data__,n=B2(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():V2.call(e,n,1),--this.size,!0}var R2=P2,F2=Uo;function j2(t){var e=this.__data__,n=F2(e,t);return n<0?void 0:e[n][1]}var z2=j2,H2=Uo;function W2(t){return H2(this.__data__,t)>-1}var U2=W2,Y2=Uo;function q2(t,e){var n=this.__data__,r=Y2(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var K2=q2,G2=A2,J2=R2,Z2=z2,X2=U2,Q2=K2;function Ur(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])}}Ur.prototype.clear=G2,Ur.prototype.delete=J2,Ur.prototype.get=Z2,Ur.prototype.has=X2,Ur.prototype.set=Q2;var Yo=Ur,ev=Yo;function tv(){this.__data__=new ev,this.size=0}var nv=tv;function rv(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var iv=rv;function ov(t){return this.__data__.get(t)}var sv=ov;function av(t){return this.__data__.has(t)}var lv=av,cv=ji,dv=Wo,uv="[object AsyncFunction]",fv="[object Function]",hv="[object GeneratorFunction]",pv="[object Proxy]";function mv(t){if(!dv(t))return!1;var e=cv(t);return e==fv||e==hv||e==uv||e==pv}var nf=mv,gv=an,yv=gv["__core-js_shared__"],bv=yv,za=bv,rf=function(){var t=/[^.]+$/.exec(za&&za.keys&&za.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function kv(t){return!!rf&&rf in t}var vv=kv,wv=Function.prototype,xv=wv.toString;function Ev(t){if(t!=null){try{return xv.call(t)}catch{}try{return t+""}catch{}}return""}var of=Ev,Cv=nf,Sv=vv,_v=Wo,Ov=of,Tv=/[\\^$.*+?()[\]{}|]/g,Nv=/^\[object .+?Constructor\]$/,Mv=Function.prototype,Av=Object.prototype,Dv=Mv.toString,$v=Av.hasOwnProperty,Lv=RegExp("^"+Dv.call($v).replace(Tv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bv(t){if(!_v(t)||Sv(t))return!1;var e=Cv(t)?Lv:Nv;return e.test(Ov(t))}var Iv=Bv;function Vv(t,e){return t==null?void 0:t[e]}var Pv=Vv,Rv=Iv,Fv=Pv;function jv(t,e){var n=Fv(t,e);return Rv(n)?n:void 0}var Yr=jv,zv=Yr,Hv=an,Wv=zv(Hv,"Map"),Ha=Wv,Uv=Yr,Yv=Uv(Object,"create"),qo=Yv,sf=qo;function qv(){this.__data__=sf?sf(null):{},this.size=0}var Kv=qv;function Gv(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Jv=Gv,Zv=qo,Xv="__lodash_hash_undefined__",Qv=Object.prototype,ew=Qv.hasOwnProperty;function tw(t){var e=this.__data__;if(Zv){var n=e[t];return n===Xv?void 0:n}return ew.call(e,t)?e[t]:void 0}var nw=tw,rw=qo,iw=Object.prototype,ow=iw.hasOwnProperty;function sw(t){var e=this.__data__;return rw?e[t]!==void 0:ow.call(e,t)}var aw=sw,lw=qo,cw="__lodash_hash_undefined__";function dw(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=lw&&e===void 0?cw:e,this}var uw=dw,fw=Kv,hw=Jv,pw=nw,mw=aw,gw=uw;function qr(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])}}qr.prototype.clear=fw,qr.prototype.delete=hw,qr.prototype.get=pw,qr.prototype.has=mw,qr.prototype.set=gw;var yw=qr,af=yw,bw=Yo,kw=Ha;function vw(){this.size=0,this.__data__={hash:new af,map:new(kw||bw),string:new af}}var ww=vw;function xw(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ew=xw,Cw=Ew;function Sw(t,e){var n=t.__data__;return Cw(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Ko=Sw,_w=Ko;function Ow(t){var e=_w(this,t).delete(t);return this.size-=e?1:0,e}var Tw=Ow,Nw=Ko;function Mw(t){return Nw(this,t).get(t)}var Aw=Mw,Dw=Ko;function $w(t){return Dw(this,t).has(t)}var Lw=$w,Bw=Ko;function Iw(t,e){var n=Bw(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Vw=Iw,Pw=ww,Rw=Tw,Fw=Aw,jw=Lw,zw=Vw;function Kr(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])}}Kr.prototype.clear=Pw,Kr.prototype.delete=Rw,Kr.prototype.get=Fw,Kr.prototype.has=jw,Kr.prototype.set=zw;var lf=Kr,Hw=Yo,Ww=Ha,Uw=lf,Yw=200;function qw(t,e){var n=this.__data__;if(n instanceof Hw){var r=n.__data__;if(!Ww||r.length<Yw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Uw(r)}return n.set(t,e),this.size=n.size,this}var Kw=qw,Gw=Yo,Jw=nv,Zw=iv,Xw=sv,Qw=lv,ex=Kw;function Gr(t){var e=this.__data__=new Gw(t);this.size=e.size}Gr.prototype.clear=Jw,Gr.prototype.delete=Zw,Gr.prototype.get=Xw,Gr.prototype.has=Qw,Gr.prototype.set=ex;var tx=Gr,nx="__lodash_hash_undefined__";function rx(t){return this.__data__.set(t,nx),this}var ix=rx;function ox(t){return this.__data__.has(t)}var sx=ox,ax=lf,lx=ix,cx=sx;function Go(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ax;++e<n;)this.add(t[e])}Go.prototype.add=Go.prototype.push=lx,Go.prototype.has=cx;var dx=Go;function ux(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 fx=ux;function hx(t,e){return t.has(e)}var px=hx,mx=dx,gx=fx,yx=px,bx=1,kx=2;function vx(t,e,n,r,i,o){var s=n&bx,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&kx?new mx:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!gx(e,function(k,x){if(!yx(p,x)&&(m===k||i(m,k,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 cf=vx,wx=an,xx=wx.Uint8Array,Ex=xx;function Cx(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Sx=Cx;function _x(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Ox=_x,df=Fa,uf=Ex,Tx=tf,Nx=cf,Mx=Sx,Ax=Ox,Dx=1,$x=2,Lx="[object Boolean]",Bx="[object Date]",Ix="[object Error]",Vx="[object Map]",Px="[object Number]",Rx="[object RegExp]",Fx="[object Set]",jx="[object String]",zx="[object Symbol]",Hx="[object ArrayBuffer]",Wx="[object DataView]",ff=df?df.prototype:void 0,Wa=ff?ff.valueOf:void 0;function Ux(t,e,n,r,i,o,s){switch(n){case Wx:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Hx:return!(t.byteLength!=e.byteLength||!o(new uf(t),new uf(e)));case Lx:case Bx:case Px:return Tx(+t,+e);case Ix:return t.name==e.name&&t.message==e.message;case Rx:case jx:return t==e+"";case Vx:var a=Mx;case Fx:var c=r&Dx;if(a||(a=Ax),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=$x,s.set(t,e);var u=Nx(a(t),a(e),r,i,o,s);return s.delete(t),u;case zx:if(Wa)return Wa.call(t)==Wa.call(e)}return!1}var Yx=Ux;function qx(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Kx=qx,Gx=Array.isArray,Ua=Gx,Jx=Kx,Zx=Ua;function Xx(t,e,n){var r=e(t);return Zx(t)?r:Jx(r,n(t))}var Qx=Xx;function eE(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 tE=eE;function nE(){return[]}var rE=nE,iE=tE,oE=rE,sE=Object.prototype,aE=sE.propertyIsEnumerable,hf=Object.getOwnPropertySymbols,lE=hf?function(t){return t==null?[]:(t=Object(t),iE(hf(t),function(e){return aE.call(t,e)}))}:oE,cE=lE;function dE(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var uE=dE,fE=ji,hE=zi,pE="[object Arguments]";function mE(t){return hE(t)&&fE(t)==pE}var gE=mE,pf=gE,yE=zi,mf=Object.prototype,bE=mf.hasOwnProperty,kE=mf.propertyIsEnumerable,vE=pf(function(){return arguments}())?pf:function(t){return yE(t)&&bE.call(t,"callee")&&!kE.call(t,"callee")},wE=vE,Jo={exports:{}};function xE(){return!1}var EE=xE;Jo.exports,function(t,e){var n=an,r=EE,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,c=a?a.isBuffer:void 0,d=c||r;t.exports=d}(Jo,Jo.exports);var gf=Jo.exports,CE=9007199254740991,SE=/^(?:0|[1-9]\d*)$/;function _E(t,e){var n=typeof t;return e=e??CE,!!e&&(n=="number"||n!="symbol"&&SE.test(t))&&t>-1&&t%1==0&&t<e}var OE=_E,TE=9007199254740991;function NE(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=TE}var yf=NE,ME=ji,AE=yf,DE=zi,$E="[object Arguments]",LE="[object Array]",BE="[object Boolean]",IE="[object Date]",VE="[object Error]",PE="[object Function]",RE="[object Map]",FE="[object Number]",jE="[object Object]",zE="[object RegExp]",HE="[object Set]",WE="[object String]",UE="[object WeakMap]",YE="[object ArrayBuffer]",qE="[object DataView]",KE="[object Float32Array]",GE="[object Float64Array]",JE="[object Int8Array]",ZE="[object Int16Array]",XE="[object Int32Array]",QE="[object Uint8Array]",eC="[object Uint8ClampedArray]",tC="[object Uint16Array]",nC="[object Uint32Array]",Pe={};Pe[KE]=Pe[GE]=Pe[JE]=Pe[ZE]=Pe[XE]=Pe[QE]=Pe[eC]=Pe[tC]=Pe[nC]=!0,Pe[$E]=Pe[LE]=Pe[YE]=Pe[BE]=Pe[qE]=Pe[IE]=Pe[VE]=Pe[PE]=Pe[RE]=Pe[FE]=Pe[jE]=Pe[zE]=Pe[HE]=Pe[WE]=Pe[UE]=!1;function rC(t){return DE(t)&&AE(t.length)&&!!Pe[ME(t)]}var iC=rC;function oC(t){return function(e){return t(e)}}var sC=oC,Zo={exports:{}};Zo.exports,function(t,e){var n=Yu,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a}(Zo,Zo.exports);var aC=Zo.exports,lC=iC,cC=sC,bf=aC,kf=bf&&bf.isTypedArray,dC=kf?cC(kf):lC,vf=dC,uC=uE,fC=wE,hC=Ua,pC=gf,mC=OE,gC=vf,yC=Object.prototype,bC=yC.hasOwnProperty;function kC(t,e){var n=hC(t),r=!n&&fC(t),i=!n&&!r&&pC(t),o=!n&&!r&&!i&&gC(t),s=n||r||i||o,a=s?uC(t.length,String):[],c=a.length;for(var d in t)(e||bC.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||mC(d,c)))&&a.push(d);return a}var vC=kC,wC=Object.prototype;function xC(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||wC;return t===n}var EC=xC;function CC(t,e){return function(n){return t(e(n))}}var SC=CC,_C=SC,OC=_C(Object.keys,Object),TC=OC,NC=EC,MC=TC,AC=Object.prototype,DC=AC.hasOwnProperty;function $C(t){if(!NC(t))return MC(t);var e=[];for(var n in Object(t))DC.call(t,n)&&n!="constructor"&&e.push(n);return e}var LC=$C,BC=nf,IC=yf;function VC(t){return t!=null&&IC(t.length)&&!BC(t)}var PC=VC,RC=vC,FC=LC,jC=PC;function zC(t){return jC(t)?RC(t):FC(t)}var HC=zC,WC=Qx,UC=cE,YC=HC;function qC(t){return WC(t,YC,UC)}var KC=qC,wf=KC,GC=1,JC=Object.prototype,ZC=JC.hasOwnProperty;function XC(t,e,n,r,i,o){var s=n&GC,a=wf(t),c=a.length,d=wf(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=a[f];if(!(s?h in e:ZC.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<c;){h=a[f];var k=t[h],x=e[h];if(r)var w=s?r(x,k,h,e,t,o):r(k,x,h,t,e,o);if(!(w===void 0?k===x||i(k,x,n,r,o):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var b=t.constructor,C=e.constructor;b!=C&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(g=!1)}return o.delete(t),o.delete(e),g}var QC=XC,eS=Yr,tS=an,nS=eS(tS,"DataView"),rS=nS,iS=Yr,oS=an,sS=iS(oS,"Promise"),aS=sS,lS=Yr,cS=an,dS=lS(cS,"Set"),uS=dS,fS=Yr,hS=an,pS=fS(hS,"WeakMap"),mS=pS,Ya=rS,qa=Ha,Ka=aS,Ga=uS,Ja=mS,xf=ji,Jr=of,Ef="[object Map]",gS="[object Object]",Cf="[object Promise]",Sf="[object Set]",_f="[object WeakMap]",Of="[object DataView]",yS=Jr(Ya),bS=Jr(qa),kS=Jr(Ka),vS=Jr(Ga),wS=Jr(Ja),mr=xf;(Ya&&mr(new Ya(new ArrayBuffer(1)))!=Of||qa&&mr(new qa)!=Ef||Ka&&mr(Ka.resolve())!=Cf||Ga&&mr(new Ga)!=Sf||Ja&&mr(new Ja)!=_f)&&(mr=function(t){var e=xf(t),n=e==gS?t.constructor:void 0,r=n?Jr(n):"";if(r)switch(r){case yS:return Of;case bS:return Ef;case kS:return Cf;case vS:return Sf;case wS:return _f}return e});var xS=mr,Za=tx,ES=cf,CS=Yx,SS=QC,Tf=xS,Nf=Ua,Mf=gf,_S=vf,OS=1,Af="[object Arguments]",Df="[object Array]",Xo="[object Object]",TS=Object.prototype,$f=TS.hasOwnProperty;function NS(t,e,n,r,i,o){var s=Nf(t),a=Nf(e),c=s?Df:Tf(t),d=a?Df:Tf(e);c=c==Af?Xo:c,d=d==Af?Xo:d;var u=c==Xo,f=d==Xo,h=c==d;if(h&&Mf(t)){if(!Mf(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Za),s||_S(t)?ES(t,e,n,r,i,o):CS(t,e,c,n,r,i,o);if(!(n&OS)){var p=u&&$f.call(t,"__wrapped__"),m=f&&$f.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Za),i(g,y,n,r,o)}}return h?(o||(o=new Za),SS(t,e,n,r,i,o)):!1}var MS=NS,AS=MS,Lf=zi;function Bf(t,e,n,r,i){return t===e?!0:t==null||e==null||!Lf(t)&&!Lf(e)?t!==t&&e!==e:AS(t,e,n,r,Bf,i)}var DS=Bf,$S=DS;function LS(t,e){return $S(t,e)}var BS=LS;const If=Ri(BS),IS={},VS={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},PS=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},null,-1)];function RS(t,e){return l.openBlock(),l.createElementBlock("svg",VS,PS)}const FS=be(IS,[["render",RS]]),jS={key:0,class:"leading-none"},zS={key:1},HS={class:"flex flex-col max-h-80 overflow-y-auto"},WS={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},US={key:1},YS={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},qS=["onClick"],KS={class:"select-none flex w-full items-center justify-between"},Vf=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,material:Boolean,naked:Boolean,hideChevron:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,{t:i}=jn(),o=l.computed(()=>r.placeholder==="Select..."?i("wpiccomponents.placeholder_select"):r.placeholder),s=l.ref(!1),a=l.ref(r.options);l.watch(()=>r.options,()=>{var v;(v=r.options)!=null&&v.length&&(a.value=[...r.options])},{immediate:!0,deep:!0});const c=n,d=l.ref(),u=l.ref();function f(v){var S,D;if(r.multiple){if(v){let O=r.modelValue||[];O.indexOf(v)>=0?O.splice(O.indexOf(v),1):O.push(v),c("update:modelValue",O),g(O),((S=r.modelValue)==null?void 0:S.length)===((D=r.options)==null?void 0:D.length)?s.value=!0:s.value=!1}}else c("update:modelValue",v),g(v),d.value=null,u.value.hide()}async function h(v){var S,D;c("update:modelValue",v),g(v),await l.nextTick(),((S=r.modelValue)==null?void 0:S.length)===((D=r.options)==null?void 0:D.length)&&(s.value=!0)}function p(v){c("update:modelValue",v),s.value=!1,g(v)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=ef(function(v){c("change",v)},r.debounce),y=l.computed(()=>{var v,S,D,O;if(r.multiple)if(r.maxDisplay){let $=(S=a.value)==null?void 0:S.filter(B=>{var J;return((J=r.modelValue)==null?void 0:J.indexOf(B.value))>=0}).map(B=>B.label),V=$==null?void 0:$.slice(0,r.maxDisplay);return($==null?void 0:$.length)-(V==null?void 0:V.length)>0?(V==null?void 0:V.join(", "))+` (+${($==null?void 0:$.length)-V.length})`:V==null?void 0:V.join(", ")}else return(v=a.value)==null?void 0:v.filter($=>{var V;return((V=r.modelValue)==null?void 0:V.indexOf($.value))>=0}).map($=>$.label).join(", ");else return((O=(D=a.value)==null?void 0:D.find($=>$.value===r.modelValue))==null?void 0:O.label)||r.modelValue});function k(v){var S;try{return r.multiple?r.modelValue!==null&&((S=r.modelValue)==null?void 0:S.some(D=>If(D,v))):r.modelValue!==null&&If(v,r.modelValue)}catch(D){return console.log(D),!1}}const x={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},w=l.computed(()=>{var v,S;return((v=r.modelValue)==null?void 0:v.length)===((S=r.options)==null?void 0:S.length)}),b=l.computed(()=>{var v;if(r.filterable&&!r.remoteMethod&&((v=d.value)!=null&&v.trim().length)){const S=d.value.trim().toLowerCase();return r.options.filter(D=>{var O;return(O=D.label)==null?void 0:O.toLowerCase().includes(S)})}return r.options});function C(){r.remoteMethod&&r.remoteMethod(d.value)}return e({allSelected:s,isAllSelected:w}),(v,S)=>(l.openBlock(),l.createBlock(dr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:l.withCtx(({isHidden:D})=>[l.createVNode(Pi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:l.withCtx(()=>{var O,$,V,B,J,Y;return[l.createElementVNode("span",{class:l.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((O=t.modelValue)==null?void 0:O.length)>0)&&!t.hideSelect?(l.openBlock(),l.createElementBlock("span",jS,[w.value&&(($=t.allSelectedText)!=null&&$.length)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(t.allSelectedText)+" ("+l.toDisplayString((V=t.options)==null?void 0:V.length)+")",1)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(y.value),1)],64))])):!t.multiple&&((B=t.options)!=null&&B.find(I=>I.value===null))?(l.openBlock(),l.createElementBlock("span",zS,l.toDisplayString((Y=(J=t.options)==null?void 0:J.find(I=>I.value===null))==null?void 0:Y.label),1)):l.renderSlot(v.$slots,"default",{key:2},()=>[l.createTextVNode(l.toDisplayString(o.value),1)])],2),t.modelValue&&t.clearable?(l.openBlock(),l.createElementBlock("div",{key:0,onClick:l.withModifiers(m,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[l.createVNode(Di,{class:"w-4 h-4"})])):l.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(l.openBlock(),l.createBlock(FS,{key:1,class:"h-5 w-5 -mr-[2px]"})):l.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:l.withCtx(()=>{var D;return[l.createElementVNode("div",HS,[t.filterable?(l.openBlock(),l.createElementBlock("div",WS,[l.createVNode(jf,{slim:"",placeholder:v.$t("wpiccomponents.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[S[0]||(S[0]=O=>d.value=O),C]},null,8,["placeholder","modelValue"])])):l.createCommentVNode("",!0),!t.options&&((D=t.options)==null?void 0:D.length)==0?(l.openBlock(),l.createElementBlock("span",US,"No data.")):(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[t.multiple&&t.batchSelect?(l.openBlock(),l.createElementBlock("div",YS,[l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:S[1]||(S[1]=O=>{var $;return h(($=b.value)==null?void 0:$.filter(V=>V.value).map(V=>V.value))})},l.toDisplayString(v.$t("wpiccomponents.select_all")),1),l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:S[2]||(S[2]=O=>p([]))},l.toDisplayString(v.$t("wpiccomponents.select_none")),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b.value,O=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["group",{"is-selected":!!k(O.value)}])},[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||O.value,[`${x[l.unref(fe).theme]}`]:!0}]),onClick:$=>O.disabled?null:f(O.value)},[l.createElementVNode("div",KS,[l.createElementVNode("span",{class:l.normalizeClass(["",{"opacity-25":O.disabled}])},l.toDisplayString(O.label||O.value),3),t.multiple&&k(O.value)?(l.openBlock(),l.createBlock(Uu,{key:0,class:"w-4 h-4"})):l.createCommentVNode("",!0)])],10,qS)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Pf=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[l.createElementVNode("div",{class:l.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[l.createElementVNode("div",{class:l.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),l.createElementVNode("span",{class:l.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},l.toDisplayString(t.label),3)],2))}}),GS={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},JS={class:""},ZS=["value","disabled","rows","placeholder"],Rf=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=l.ref(null),o=l.ref(!1);l.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&l.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function a(d){s("update:modelValue",d==null?void 0:d.target.value)}function c(){i.value.focus()}return e({focus:c}),(d,u)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[t.label?(l.openBlock(),l.createElementBlock("div",GS,[l.createTextVNode(l.toDisplayString(t.label)+" ",1),l.createElementVNode("div",JS,[d.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.info),1)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])])):l.createCommentVNode("",!0),l.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:l.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:l.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:a,placeholder:t.placeholder},null,46,ZS)],64))}}),XS=["placeholder"],Ff={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=l.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return l.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,a)=>(l.openBlock(),l.createBlock(Pi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("input",{type:"color","onUpdate:modelValue":a[0]||(a[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[l.vModelText,i.value]]),l.withDirectives(l.createElementVNode("input",{type:"text","onUpdate:modelValue":a[1]||(a[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,XS),[[l.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},QS={},e_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t_=[l.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),l.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 n_(t,e){return l.openBlock(),l.createElementBlock("svg",e_,t_)}const r_=be(QS,[["render",n_]]),i_={},o_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},s_=[l.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),l.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),l.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 a_(t,e){return l.openBlock(),l.createElementBlock("svg",o_,s_)}const l_=be(i_,[["render",a_]]),c_={},d_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},u_=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function f_(t,e){return l.openBlock(),l.createElementBlock("svg",d_,u_)}const h_=be(c_,[["render",f_]]),p_={class:"flex items-center gap-2"},m_={key:0},g_={class:""},y_=["innerHTML"],b_={class:"flex justify-end"},k_=["name","value","checked"],v_={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},w_={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},x_={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},E_={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},jf=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,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color: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=l.computed(()=>o.name?o.name:ba()),a=iy(s.value),c=l.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=l.ref(!0),u=l.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=l.computed(()=>{var $;if(o.rules&&typeof o.rules=="string"){let V=($=o.rules)==null?void 0:$.split("|");return o.required&&V.push("required"),o.email&&V.push("email"),V.join("|")}else if(!o.rules){let V=[];return o.required&&V.push("required"),o.email&&V.push("email"),V.join("|")}return"required"});function p($){let V=$&&$.target?$.target.value:$;x(V)}const m=n;function g($){$===!0||$===!1?m("update:modelValue",!$):m("update:modelValue",$)}function y($){let V=$&&$.target?$.target.value:$;m("update:modelValue",V),m("onChange",V)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=ef(function($){m("update:modelValue",$),m("onChange",$)},o.debounce),w=l.ref(null),b=l.ref();function C(){var $,V;o.textarea?($=b.value)==null||$.focus():(V=w.value)==null||V.$el.focus()}function v(){return w.value.meta.valid}const S=l.ref(),D=l.computed(()=>S.value.allSelected),O=l.computed(()=>S.value.isAllSelected);return e({focus:C,isValid:v,allSelected:D,isAllSelected:O}),($,V)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass([{"text-sm":t.small,"text-base":!t.small},"mb-2 wpic-form-label text-gray-500 dark:text-gray-500 flex items-center justify-between"])},[l.createElementVNode("div",p_,[l.createElementVNode("span",null,l.toDisplayString(c.value),1),t.required&&!t.hideRequired?(l.openBlock(),l.createElementBlock("span",m_,"*")):l.createCommentVNode("",!0),l.createElementVNode("div",g_,[t.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,y_)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])]),l.createElementVNode("div",b_,[l.renderSlot($.$slots,"more")])],2)):l.createCommentVNode("",!0),t.checkbox?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:w,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:l.withCtx(({field:B})=>[l.createElementVNode("div",{class:l.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:V[0]||(V[0]=J=>t.disabled?void 0:g(t.modelValue))},[l.createElementVNode("div",{class:l.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[l.unref(fe).theme]}`]:!0}])},[t.modelValue===!0?(l.openBlock(),l.createBlock(Uu,{key:0})):l.createCommentVNode("",!0)],2),l.createElementVNode("span",{class:l.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}])},[l.renderSlot($.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(l.openBlock(),l.createBlock(l.unref(ar),{key:2,ref_key:"myInput",ref:w,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:l.withCtx(({field:B})=>[l.createElementVNode("div",{onClick:V[2]||(V[2]=()=>{t.disabled||y(t.radioValue)}),class:l.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[l.createElementVNode("span",{class:l.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):l.createCommentVNode("",!0)],2),l.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:V[1]||(V[1]=(...J)=>$.onChange&&$.onChange(...J)),checked:t.radioValue==t.modelValue},null,40,k_),c.value?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["text-base",{"opacity-50":t.disabled}])},l.toDisplayString(c.value),3)):l.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(l.openBlock(),l.createBlock(l.unref(ar),{key:3,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:B})=>{var J;return[l.createVNode(Vf,{ref_key:"myChoiceList",ref:S,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&&l.unref(a)),required:t.required||((J=h.value)==null?void 0:J.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(l.openBlock(),l.createBlock(l.unref(ar),{key:4,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:B})=>[l.createVNode(Ff,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(l.openBlock(),l.createBlock(l.unref(ar),{key:5,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:B})=>[l.createVNode(Pf,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(l.openBlock(),l.createElementBlock("div",{key:6,class:l.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[l.unref(fe).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":l.unref(a)}])},[$.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[l.createElementVNode("div",v_,[l.renderSlot($.$slots,"prepend")])],2)):l.createCommentVNode("",!0),t.textarea?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(()=>{var B;return[l.createVNode(Rf,{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&&l.unref(a)),required:t.required||((B=h.value)==null?void 0:B.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(l.openBlock(),l.createBlock(l.unref(ar),{key:2,ref_key:"myInput",ref:w,autocomplete:"off",style:{"z-index":"1"},class:l.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":!$.$slots.prepend&&!t.naked,"pl-8":$.$slots.prepend&&!t.naked,"pl-6":$.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":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:!!l.unref(a),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(l.openBlock(),l.createElementBlock("div",{key:3,onClick:l.withModifiers(k,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[l.createVNode(Ir,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(l.openBlock(),l.createElementBlock("div",{key:4,onClick:l.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"},[l.createVNode(Di,{class:"w-5 h-5 opacity-50"})])):l.createCommentVNode("",!0),$.$slots.append||t.password||t.type=="password"?(l.openBlock(),l.createElementBlock("div",w_,[l.createElementVNode("div",x_,[l.renderSlot($.$slots,"append",{},()=>[l.withDirectives(l.createVNode(r_,{class:"text-zinc-600 select-none",onClick:f},null,512),[[l.vShow,d.value]]),l.withDirectives(l.createVNode(l_,{class:"text-zinc-600 select-none",onClick:f},null,512),[[l.vShow,!d.value]])])])])):l.createCommentVNode("",!0)],2)),t.error&&l.unref(a)?(l.openBlock(),l.createElementBlock("div",E_,[l.createVNode(l.unref(ry),{name:s.value},{default:l.withCtx(B=>[l.createTextVNode(l.toDisplayString(B.message),1)]),_:1},8,["name"])])):l.createCommentVNode("",!0),$.$slots.help||t.help?(l.openBlock(),l.createElementBlock("div",{key:8,class:l.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[l.renderSlot($.$slots,"help",{},()=>[l.createTextVNode(l.toDisplayString(t.help),1)])],2)):l.createCommentVNode("",!0)],2))}}),C_=["innerHTML"],zf=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=l.ref(),n=l.ref(),r=l.ref();ba();const i=t;function o(){i.text&&(n.value.style.display="block",a())}function s(){n.value.style.display=""}async function a(){var h,p;await l.nextTick();const c=await Od(e.value,n.value,{placement:i.placement,middleware:[_d(),Sd(),Cd(i.offset),o1({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)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("span",{ref_key:"button",ref:e,class:l.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[l.renderSlot(c.$slots,"default")],34),l.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"},[l.createElementVNode("span",{innerHTML:t.text},null,8,C_),l.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),S_={key:1,class:"flex justify-between items-baseline pt-4 px-6"},__={class:""},O_={key:2,class:"flex items-center justify-end py-4 px-6"},T_=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=l.resolveComponent("wpic-loading-panel");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["rounded-lg wpic-card relative",{[e[l.unref(fe).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(l.openBlock(),l.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):l.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(l.openBlock(),l.createElementBlock("div",S_,[t.title||r.$slots.title||r.$slots.actions?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[l.unref(fe).theme]]])},[l.renderSlot(r.$slots,"title",{},()=>[l.createTextVNode(l.toDisplayString(t.title),1)])],2)):l.createCommentVNode("",!0),l.createElementVNode("div",__,[l.renderSlot(r.$slots,"actions")])])):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"default"),r.$slots.buttons?(l.openBlock(),l.createElementBlock("div",O_,[l.renderSlot(r.$slots,"buttons")])):l.createCommentVNode("",!0)],2)}}}),N_={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},M_={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},A_=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[l.unref(fe).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(l.openBlock(),l.createElementBlock("div",N_,[l.createElementVNode("div",M_,[l.renderSlot(n.$slots,"title",{},()=>[l.createTextVNode(l.toDisplayString(t.title),1)])]),l.renderSlot(n.$slots,"actions")])):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default")],2))}}),D_=l.createElementVNode("div",{class:""},null,-1),$_=l.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),L_=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=l.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)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[l.createElementVNode("div",{class:l.normalizeClass(["flex w-full relative",r[l.unref(fe).theme]]),style:{"z-index":"1"}},[n.value>0?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle({width:`${n.value}%`}),class:l.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[l.unref(fe).theme]}`]:!0}])},[l.createVNode(zf,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:l.withCtx(()=>[D_]),_:1},8,["text"])],6)):l.createCommentVNode("",!0)],2),t.indicators?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[$_],64)):l.createCommentVNode("",!0)],2))}}),B_={class:"leading-none"},I_=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)=>(l.openBlock(),l.createElementBlock("div",{class:l.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[l.unref(fe).theme]]:!0}])},[l.createElementVNode("span",B_,[l.renderSlot(o.$slots,"default")]),t.clearable?(l.openBlock(),l.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[l.createVNode(Di,{class:"w-4 h-4"})])):l.createCommentVNode("",!0)],2))}}),V_=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"w-full":t.full})},[l.createElementVNode("div",{class:l.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[l.renderSlot(e.$slots,"default")],2)],2))}}),P_=t=>(l.pushScopeId("data-v-947735f2"),t=t(),l.popScopeId(),t),R_={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},F_=[P_(()=>l.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],j_=be(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(l.openBlock(),l.createElementBlock("div",R_,F_)):(l.openBlock(),l.createBlock(Ir,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),z_={class:"text-base font-medium select-none"},Hi=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)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[l.unref(fe).theme]]:!t.active&&!t.disabled,[n[l.unref(fe).theme]]:t.active&&!t.disabled,[r[l.unref(fe).theme]]:t.disabled}])},[l.createElementVNode("span",z_,[l.renderSlot(i.$slots,"default")])],2))}}),H_={},W_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},U_=[l.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 Y_(t,e){return l.openBlock(),l.createElementBlock("svg",W_,U_)}const Hf=be(H_,[["render",Y_]]),q_={},K_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},G_=[l.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 J_(t,e){return l.openBlock(),l.createElementBlock("svg",K_,G_)}const Wf=be(q_,[["render",J_]]),Z_={},X_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Q_=[l.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 eO(t,e){return l.openBlock(),l.createElementBlock("svg",X_,Q_)}const Uf=be(Z_,[["render",eO]]),tO={},nO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},rO=[l.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 iO(t,e){return l.openBlock(),l.createElementBlock("svg",nO,rO)}const Yf=be(tO,[["render",iO]]),oO={class:"wpic-pagination flex justify-between"},sO={key:0,class:"flex items-center"},aO={key:0},lO={key:1,class:"flex flex-wrap gap-2"},cO=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!1},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1},perPageOptions:{type:Array,default:()=>[10,20,50,100,200]}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const{t:r}=jn(),i=t,o=l.computed(()=>i.perPageOptions.map(p=>({value:Number(p),label:r("wpiccomponents.per_page",{count:p})}))),s=n,a=l.computed(()=>Math.ceil(i.total/i.perPage)),c=l.computed(()=>{const p=a.value;if(!p||p===1)return[1];const m=i.currentPage,g=1;let y=Math.max(2,m-g),k=Math.min(p-1,m+g);m<=g+2&&(y=2,k=Math.min(2*g+2,p-1)),m>=p-g-1&&(y=Math.max(2,p-2*g-1),k=p-1);const x=[];for(let w=y;w<=k;w++)x.push(w);return y>2&&x.unshift("..."),k<p-1&&x.push("..."),[1,...x,p]});function d(p){p>=1&&p<=a.value&&s("update:currentPage",p)}function u(){return i.perPage*(i.currentPage-1)+1}function f(){return i.perPage*i.currentPage>i.total?i.total:i.perPage*i.currentPage}async function h(p){s("update:perPage",p),s("update:currentPage",1)}return e({getStart:u,getEnd:f}),(p,m)=>{const g=l.resolveComponent("wpic-choice-list");return l.openBlock(),l.createElementBlock("div",oO,[t.info?(l.openBlock(),l.createElementBlock("div",sO,[t.total>0?(l.openBlock(),l.createElementBlock("span",aO,l.toDisplayString(p.$t("wpiccomponents.pagination",{start:u(),end:f(),total:t.total})),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),t.pages?(l.openBlock(),l.createElementBlock("div",lO,[l.createVNode(Hi,{onClick:m[0]||(m[0]=y=>d(1)),disabled:t.currentPage===1||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Hf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),l.createVNode(Hi,{onClick:m[1]||(m[1]=y=>d(t.currentPage-1)),disabled:t.currentPage===1||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Wf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,y=>(l.openBlock(),l.createBlock(Hi,{key:`page_${y}`,onClick:k=>d(y),active:y===t.currentPage,disabled:a.value==0||!a.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(y),1)]),_:2},1032,["onClick","active","disabled"]))),128)),l.createVNode(Hi,{onClick:m[2]||(m[2]=y=>d(t.currentPage+1)),disabled:t.currentPage===a.value||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Yf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),l.createVNode(Hi,{onClick:m[3]||(m[3]=y=>d(a.value)),disabled:t.currentPage===a.value||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Uf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(l.openBlock(),l.createBlock(g,{key:0,modelValue:t.perPage,"onUpdate:modelValue":h,options:o.value},null,8,["modelValue","options"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])}}}),qf=(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 l.h("td",e.attrs,n)};qf.props=["column","item","rowIndex"];const Qo=qf,dO={},uO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},fO=[l.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 hO(t,e){return l.openBlock(),l.createElementBlock("svg",uO,fO)}const pO=be(dO,[["render",hO]]),mO={class:"font-semibold"},Kf={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},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:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(l.openBlock(),l.createElementBlock("tr",mO,[t.checkable?(l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[l.unref(fe).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.columns,(i,o)=>(l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[l.unref(fe).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":t.position==="footer","first:rounded-bl-lg":t.position==="footer","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))]))}},gO={},yO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},bO=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function kO(t,e){return l.openBlock(),l.createElementBlock("svg",yO,bO)}const vO=be(gO,[["render",kO]]),wO={},xO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},EO=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},null,-1)];function CO(t,e){return l.openBlock(),l.createElementBlock("svg",xO,EO)}const SO=be(wO,[["render",CO]]),_O={class:"wpic-table"},OO={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},TO={class:"flex items-center gap-2"},NO={class:"flex items-center gap-2"},MO={class:"w-full rounded-lg"},AO={key:0,class:"w-16"},DO=["width"],$O=["width"],LO={class:"flex justify-center items-center h-full"},BO=["onClick"],IO={class:"rounded-b-lg relative"},VO={key:0},PO=[l.createElementVNode("td",{class:"text-center py-3"}," ",-1)],RO={class:"flex justify-center items-center h-full"},FO={key:1},jO={key:0,class:"text-center text-gray-400 py-3"},zO=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,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},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-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},a={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},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;l.onMounted(()=>{k()});const h=l.getCurrentInstance();l.provide("wtable",h==null?void 0:h.proxy);const p=l.useSlots(),m=l.ref([]),g=l.ref([]),y=l.computed(()=>r.columnToggleable?m.value.filter(B=>g.value.includes(B.field)||!B.selectable):m.value.filter(B=>B.visible||!B.selectable));function k(){const B=(I,T)=>{let R={};for(let F in I){if(typeof I[F].default=="boolean"&&T[F]!==void 0){R[F]=T[F]!==!1;continue}if(T[F]!==void 0){R[F]=T[F];continue}if(typeof I[F].default=="function"){R[F]=I[F].default();continue}R[F]=I[F].default}return R};let J=[];(p.default&&p.default()||[]).forEach(I=>{var T,R;((T=I.type)==null?void 0:T.name)==="WpicTableColumn"?J.push(I):(R=I.children)!=null&&R.length&&I.children.forEach(F=>{var ee;((ee=F.type)==null?void 0:ee.name)==="WpicTableColumn"&&J.push(F)})}),m.value=J.map(I=>{let T=I.children,R=I.props||{},{field:F,label:ee,help:ie,width:he,minWidth:ue,maxWidth:L,sortable:z,selectable:q,render:U,type:j,align:ce,visible:le,noPadding:ve}=B(I.type.props,R);return F||(F=V(ee)),q&&le&&g.value.push(F),{label:ee,help:ie,width:he,minWidth:ue,maxWidth:L,type:j,align:ce,sortable:z,selectable:q,field:F,render:U,children:T,visible:le,noPadding:ve}})}function x(B){var Y,I;let J=(Y=r.sortOptions)==null?void 0:Y.sortDirection;((I=r.sortOptions)==null?void 0:I.sortBy)===B&&(J=J==="asc"?"desc":"asc"),f("changeSort",{sortDirection:J,sortBy:B})}l.watch(()=>p.default,B=>{k()},{deep:!0});const w=l.reactive({});function b({index:B,item:J}){w[B]?w[B]=null:(w[B]=!0,f("expandRow",{index:B,item:J}))}const C=l.ref([]);function v(B){const J=$(B,r.itemId);C.value.includes(J)?(C.value.splice(C.value.indexOf(J),1),S.value=!1):C.value.push(J)}const S=l.ref(!1);function D(){if(S.value=!S.value,C.value=[],S.value)for(let B of r.data){let J=$(B,r.itemId);C.value.push(J)}}function O(){S.value=!1,C.value=[]}e({buildColumns:k,selectedRows:C,selectedColumns:g,resetSelectedRows:O});function $(B,J){return J.split(".").reduce((Y,I)=>Y?Y[I]:void 0,B)}function V(B){return!B||typeof B!="string"?"":B.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(B,J)=>{const Y=l.resolveComponent("wpic-choice-list"),I=l.resolveComponent("wpic-form-field");return l.openBlock(),l.createElementBlock("div",_O,[B.$slots.header||B.$slots.actions||t.columnToggleable?(l.openBlock(),l.createElementBlock("div",OO,[l.createElementVNode("div",TO,[l.renderSlot(B.$slots,"header")]),l.createElementVNode("div",NO,[l.renderSlot(B.$slots,"actions"),l.createVNode(Y,{multiple:"",modelValue:g.value,"onUpdate:modelValue":J[0]||(J[0]=T=>g.value=T),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(T=>T.selectable).map(T=>({label:T.label,value:T.field}))},{default:l.withCtx(()=>[l.createVNode(_i,{medium:"",square:"",colorless:"",class:"ml-px"},{default:l.withCtx(()=>[l.createVNode(SO,{class:"w-5 h-5"})]),_:1})]),_:1},8,["modelValue","options"])])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[l.unref(fe).theme]}`]:!0}])},[l.createElementVNode("div",{class:l.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[l.createElementVNode("table",MO,[l.createElementVNode("colgroup",null,[t.checkable?(l.openBlock(),l.createElementBlock("col",AO)):l.createCommentVNode("",!0),y.value.find(T=>T.type=="expand")?(l.openBlock(),l.createElementBlock("col",{key:1,style:l.normalizeStyle({minWidth:`${y.value.find(T=>T.type=="expand").minWidth}px`}),width:y.value.find(T=>T.type=="expand").width,class:"w-16"},null,12,DO)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(T=>T.type!="expand"),(T,R)=>(l.openBlock(),l.createElementBlock("col",{style:l.normalizeStyle({minWidth:`${T.minWidth}px`,maxWidth:`${T.maxWidth}px`}),width:T.width,key:R},null,12,$O))),128))]),t.hideHeaders?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("thead",{key:0,class:l.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[l.createElementVNode("tr",null,[t.checkable?(l.openBlock(),l.createElementBlock("th",{key:0,class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[l.unref(fe).theme]}`]])},[l.createElementVNode("div",LO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:S.value,"onUpdate:modelValue":D},null,8,["modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(T=>T.type=="expand")?(l.openBlock(),l.createElementBlock("th",{key:1,class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[l.unref(fe).theme]}`]])},null,2)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(T=>T.type!="expand"),(T,R)=>{var F,ee;return l.openBlock(),l.createElementBlock("th",{class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[l.unref(fe).theme]}`]:!0,"sticky top-0 left-0":R===0}]),style:l.normalizeStyle({maxWidth:`${T.maxWidth}px`})},[l.createElementVNode("div",{onClick:()=>{T.sortable&&x(T.field)},class:l.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":T.sortable&&T.field,"justify-center":T.align=="center","justify-end":T.align=="right"}])},[l.createElementVNode("span",{class:l.normalizeClass(["select-none font-medium text-sm",{"text-right":T.align=="right"}])},l.toDisplayString(T.label),3),T.sortable&&T.field?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["ml-1",{"opacity-25":T.field!=((F=t.sortOptions)==null?void 0:F.sortBy)}])},[l.createVNode(pO,{class:l.normalizeClass(["w-4 h-4",{"rotate-180":((ee=t.sortOptions)==null?void 0:ee.sortDirection)==="asc"}])},null,8,["class"])],2)):l.createCommentVNode("",!0)],10,BO)],6)}),256))])],2)),l.createElementVNode("tbody",IO,[t.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",{class:l.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[l.unref(fe).theme]]])},[l.createVNode(Ir,{class:"w-6 h-6"})],2),t.data.length?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("tr",VO,PO))],64)):l.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(l.openBlock(),l.createBlock(Kf,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.data,(T,R)=>{var F,ee,ie,he,ue;return l.openBlock(),l.createElementBlock(l.Fragment,{key:`tr_${R}`},[l.createElementVNode("tr",{class:l.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":R%2==0,"is-even":R%2!=0,[s[l.unref(fe).theme]]:!0}])},[t.checkable?(l.openBlock(),l.createElementBlock("td",{key:0,class:l.normalizeClass([{[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe}])},[l.createElementVNode("div",RO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:C.value.includes($(T,t.itemId)),checkboxValue:$(T,t.itemId),"onUpdate:modelValue":L=>v(T)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(L=>L.type=="expand")?(l.openBlock(),l.createElementBlock("td",{key:1,class:l.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",[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[l.createVNode(_i,{small:"",square:"",onClick:L=>b({item:T,index:R})},{default:l.withCtx(()=>[w[R]?(l.openBlock(),l.createBlock(h_,{key:0,class:"w-4 h-4"})):(l.openBlock(),l.createBlock(vO,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(L=>L.type!="expand"),(L,z)=>{var q,U;return l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":z===0,[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!L.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":R===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(j=>j.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":R===((U=t.data)==null?void 0:U.length)-1&&!t.totalItem&&!y.value.find(j=>j.type=="expand")&&!t.noRadius,"text-center justify-center":L.align=="center","text-right justify-end":L.align=="right","align-top py-5":t.valign=="top"}]),style:l.normalizeStyle({maxWidth:`${L.maxWidth}px`}),id:`${R}_${z}`,column:L,item:T,rowIndex:R,key:z},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(L=>L.type=="expand")?l.withDirectives((l.openBlock(),l.createElementBlock("tr",{key:0,class:l.normalizeClass([{[s[l.unref(fe).theme]]:!t.stripe,[a[l.unref(fe).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[l.createVNode(Qo,{class:l.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[l.unref(fe).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((F=y.value.find(L=>L.type=="expand"))!=null&&F.noPadding),"p-0":(ee=y.value.find(L=>L.type=="expand"))==null?void 0:ee.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":R===((ie=t.data)==null?void 0:ie.length)-1&&!t.totalItem,"first:rounded-bl-lg":R===((he=t.data)==null?void 0:he.length)-1&&!t.totalItem,"text-center":y.value.find(L=>L.type=="expand").align=="center","text-right":y.value.find(L=>L.type=="expand").align=="right"}]),column:y.value.find(L=>L.type=="expand"),rowIndex:R,colspan:(ue=y.value)==null?void 0:ue.length,item:T},null,8,["class","column","rowIndex","colspan","item"])],2)),[[l.vShow,w[R]]]):l.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(l.openBlock(),l.createElementBlock("tfoot",FO,[l.createVNode(Kf,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):l.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(l.openBlock(),l.createElementBlock("div",jO," No Data ")):l.createCommentVNode("",!0)],2)])}}}),HO={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 rt(t){this.content=t}rt.prototype={constructor:rt,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 rt(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 rt(n)},addToStart:function(t,e){return new rt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new rt(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 rt(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=rt.from(t),t.size?new rt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rt.from(t),t.size?new rt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=rt.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}},rt.from=function(t){if(t instanceof rt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new rt(e)};function Gf(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=Gf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Jf(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),c=s.nodeSize;if(s==a){n-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let d=0,u=Math.min(s.text.length,a.text.length);for(;d<u&&s.text[s.text.length-d-1]==a.text[a.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let d=Jf(s.content,a.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class G{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let c=this.content[s],d=a+c.nodeSize;if(d>e&&r(c,i+a,o||null,s)!==!1&&c.content.size){let u=a+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,c)=>{let d=a.isText?a.text.slice(Math.max(e,c)-c,n-c):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new G(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],c=s+a.nodeSize;c>e&&((s<e||c>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=c}return new G(r,i)}cutByIndex(e,n){return e==n?G.empty:e==0&&n==this.content.length?this:new G(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 G(i,o)}addToStart(e){return new G([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new G(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 Gf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Jf(this,e,n,r)}findIndex(e,n=-1){if(e==0)return es(0,e);if(e==this.size)return es(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?es(r+1,s):es(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 G.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new G(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return G.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 G(n||e,r)}static from(e){if(!e)return G.empty;if(e instanceof G)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new G([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}G.empty=new G([],0);const Xa={index:0,offset:0};function es(t,e){return Xa.index=t,Xa.offset=e,Xa}function ts(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(!ts(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ts(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Be=class Lc{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&&ts(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}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 Lc.none;if(e instanceof Lc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Be.none=[];class ns extends Error{}class ne{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=Xf(this.content,e+this.openStart,n);return r&&new ne(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ne(Zf(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 ne.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 ne(G.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 ne(e,r,i)}}ne.empty=new ne(G.empty,0,0);function Zf(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Zf(o.content,e-i-1,n-i-1)))}function Xf(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Xf(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function WO(t,e,n){if(n.openStart>t.depth)throw new ns("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ns("Inconsistent open depths");return Qf(t,e,n,0)}function Qf(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=Qf(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return yr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=UO(n,t);return yr(o,th(t,s,a,e,r))}else return yr(o,rs(t,e,r))}function eh(t,e){if(!e.type.compatibleContent(t.type))throw new ns("Cannot join "+e.type.name+" onto "+t.type.name)}function Qa(t,e,n){let r=t.node(n);return eh(r,e.node(n)),r}function gr(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 Wi(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&&(gr(t.nodeAfter,r),o++));for(let a=o;a<s;a++)gr(i.child(a),r);e&&e.depth==n&&e.textOffset&&gr(e.nodeBefore,r)}function yr(t,e){return t.type.checkContent(e),t.copy(e)}function th(t,e,n,r,i){let o=t.depth>i&&Qa(t,e,i+1),s=r.depth>i&&Qa(n,r,i+1),a=[];return Wi(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(eh(o,s),gr(yr(o,th(t,e,n,r,i+1)),a)):(o&&gr(yr(o,rs(t,e,i+1)),a),Wi(e,n,i,a),s&&gr(yr(s,rs(n,r,i+1)),a)),Wi(r,null,i,a),new G(a)}function rs(t,e,n){let r=[];if(Wi(null,t,n,r),t.depth>n){let i=Qa(t,e,n+1);gr(yr(i,rs(t,e,n+1)),r)}return Wi(e,null,n,r),new G(r)}function UO(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(G.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ui{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Be.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new is(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,a,i+c),!d||(s=s.child(a),s.isText))break;o=d-1,i+=c+1}return new Ui(n,r,o)}static resolveCached(e,n){let r=nh.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else nh.set(e,r=new YO);let i=r.elts[r.i]=Ui.resolve(e,n);return r.i=(r.i+1)%qO,i}}class YO{constructor(){this.elts=[],this.i=0}}const qO=12,nh=new WeakMap;class is{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 KO=Object.create(null);let zn=class Bc{constructor(e,n,r,i=Be.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||G.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,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&&ts(this.attrs,n||e.defaultAttrs||KO)&&Be.sameSet(this.marks,r||Be.none)}copy(e=null){return e==this.content?this:new Bc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Bc(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 ne.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),d=i.node(s).content.cut(i.pos-a,o.pos-a);return new ne(d,i.depth-s,o.depth-s)}replace(e,n,r){return WO(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 Ui.resolveCached(this,e)}resolveNoCache(e){return Ui.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()+")"),rh(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=G.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let 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),this.type.checkAttrs(this.attrs);let e=Be.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Be.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;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=G.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};zn.prototype.text=void 0;class ss extends zn{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):rh(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 ss(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ss(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 rh(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class br{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new GO(e,n);if(r.next==null)return br.empty;let i=ih(r);r.next&&r.err("Unexpected trailing text");let o=nT(tT(i));return rT(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return G.from(a.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,a.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:c}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
28
|
-
`)}}br.empty=new br(!0);class GO{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 ih(t){let e=[];do e.push(JO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function JO(t){let e=[];do e.push(ZO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ZO(t){let e=eT(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=XO(t,e);else break;return e}function oh(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function XO(t,e){let n=oh(t),r=n;return t.eat(",")&&(t.next!="}"?r=oh(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function QO(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.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function eT(t){if(t.eat("(")){let e=ih(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=QO(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 tT(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,c){let d={term:c,to:a};return e[s].push(d),d}function i(s,a){s.forEach(c=>c.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,a)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],a);if(c==s.exprs.length-1)return d;i(d,a=n())}else if(s.type=="star"){let c=n();return r(a,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,a),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let c=a;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(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function sh(t,e){return e-t}function ah(t,e){let n=[];return r(e),n.sort(sh);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:c}=o[s];!a&&n.indexOf(c)==-1&&r(c)}}}function nT(t){let e=Object.create(null);return n(ah(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:c})=>{if(!a)return;let d;for(let u=0;u<i.length;u++)i[u][0]==a&&(d=i[u][1]);ah(t,c).forEach(u=>{d||i.push([a,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new br(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(sh);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function rT(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:c,next:d}=i.next[a];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 lh(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 ch(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 dh(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function uh(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new oT(t,r,e[r]);return n}let fh=class Gg{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=uh(e,r.attrs),this.defaultAttrs=lh(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==br.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ch(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new zn(this,this.computeAttrs(e),G.from(n),Be.setFrom(r))}createChecked(e=null,n,r){return n=G.from(n),this.checkContent(n),new zn(this,this.computeAttrs(e),n,Be.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=G.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(G.empty,!0);return o?new zn(this,e,n.append(o),Be.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){dh(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Be.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Gg(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}};function iT(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class oT{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?iT(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class as{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=uh(e,i.attrs),this.excluded=null;let o=lh(this.attrs);this.instance=o?new Be(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Be(this,ch(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new as(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]}checkAttrs(e){dh(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class hh{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=rt.from(e.nodes),n.marks=rt.from(e.marks||{}),this.nodes=fh.compile(this.spec.nodes,this),this.marks=as.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=br.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?ph(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ph(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 fh){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 ss(r,r.defaultAttrs,e,Be.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return zn.fromJSON(this,e)}markFromJSON(e){return Be.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function ph(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let c=t.marks[a];(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 sT(t){return t.tag!=null}function aT(t){return t.style!=null}class Hn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(sT(i))this.tags.push(i);else if(aT(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new bh(this,n,!1);return r.addAll(e,Be.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new bh(this,n,!0);return r.addAll(e,Be.none,n.from,n.to),ne.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(dT(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let 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 a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=kh(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=kh(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Hn(e,Hn.schemaRules(e)))}}const mh={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},lT={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},gh={ol:!0,ul:!0},Yi=1,el=2,ls=4;function yh(t,e,n){return e!=null?(e?Yi:0)|(e==="full"?el:0):t&&t.whitespace=="pre"?Yi|el:n&-5}class cs{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Be.none,this.match=o||(s&ls?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(G.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&Yi)){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=G.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(G.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!mh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class bh{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=yh(null,n.preserveWhitespace,0)|(r?ls:0);i?o=new cs(i.type,i.attrs,Be.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new cs(null,null,Be.none,!0,null,s):o=new cs(e.schema.topNodeType,null,Be.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&el?"full":this.localPreserveWS||(i.options&Yi)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
29
|
-
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;
|
|
30
|
-
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let c=this.parser.matchStyle(o,s,this,a);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)a=c;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));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,r),this.findAround(e,c,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=Be.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):vh(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=yh(e,o,s.options);s.options&ls&&s.content.length==0&&(a|=ls);let c=Be.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):vh(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new cs(e,n,c,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Yi)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,c)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;c>=o;c--)if(s(a-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.isInGroup(d))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}}}function cT(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&gh.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function dT(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function kh(t){let e={};for(let n in t)e[n]=t[n];return e}function vh(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let c=0;c<a.edgeCount;c++){let{type:d,next:u}=a.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class kr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=tl(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,c=0;for(;a<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[a][0])||d.type.spec.spanning===!1)break;a++,c++}for(;a<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}=ds(tl(n),this.nodes[e.type.name](e),null,e.attrs);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&&ds(tl(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return ds(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new kr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=wh(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return wh(e.marks)}}function wh(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function tl(t){return t.document||window.document}const xh=new WeakMap;function uT(t){let e=xh.get(t);return e===void 0&&xh.set(t,e=fT(t)),e}function fT(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function ds(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=uT(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=ds(t,h,n,r);if(c.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const Eh=65535,Ch=Math.pow(2,16);function hT(t,e){return t+e*Ch}function Sh(t){return t&Eh}function pT(t){return(t-(t&Eh))/Ch}const _h=1,Oh=2,us=4,Th=8;class nl{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Th)>0}get deletedBefore(){return(this.delInfo&(_h|us))>0}get deletedAfter(){return(this.delInfo&(Oh|us))>0}get deletedAcross(){return(this.delInfo&us)>0}}class $t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&$t.empty)return $t.empty}recover(e){let n=0,r=Sh(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+pT(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[a+o],u=this.ranges[a+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:hT(a/3,e-c),g=e==c?Oh:e==f?_h:us;return(n<0?e!=c:e!=f)&&(g|=Th),new nl(p,g,m)}i+=u-d}return r?e+i:new nl(e+i,0,null)}touches(e,n){let r=0,i=Sh(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[a+o],u=c+d;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(a,a+d,c,c+u),o+=u-d}}invert(){return new $t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?$t.empty:new $t(e<0?[0,-e,0]:[0,0,e])}}$t.empty=new $t([]);class Zr{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 Zr(this.maps,this.mirror,e,n)}copy(){return new Zr(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 Zr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,n);if(a.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new nl(e,i,null)}}const rl=Object.create(null);class dt{getMap(){return $t.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=rl[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 rl)throw new RangeError("Duplicate use of step JSON ID "+e);return rl[e]=n,n.prototype.jsonID=e,n}}class Ue{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ue(e,null)}static fail(e){return new Ue(null,e)}static fromReplace(e,n,r,i){try{return Ue.ok(e.replace(n,r,i))}catch(o){if(o instanceof ns)return Ue.fail(o.message);throw o}}}function il(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(il(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return G.fromArray(r)}class Wn extends dt{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 ne(il(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ue.fromReplace(e,this.from,this.to,o)}invert(){return new ln(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 Wn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Wn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Wn(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 Wn(n.from,n.to,e.markFromJSON(n.mark))}}dt.jsonID("addMark",Wn);class ln extends dt{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 ne(il(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ue.fromReplace(e,this.from,this.to,r)}invert(){return new Wn(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 ln(n.pos,r.pos,this.mark)}merge(e){return e instanceof ln&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ln(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 ln(n.from,n.to,e.markFromJSON(n.mark))}}dt.jsonID("removeMark",ln);class Un extends dt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ue.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ue.fromReplace(e,this.pos,this.pos+1,new ne(G.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 Un(this.pos,n.marks[i]);return new Un(this.pos,this.mark)}}return new Xr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Un(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 Un(n.pos,e.markFromJSON(n.mark))}}dt.jsonID("addNodeMark",Un);class Xr extends dt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ue.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ue.fromReplace(e,this.pos,this.pos+1,new ne(G.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Un(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Xr(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 Xr(n.pos,e.markFromJSON(n.mark))}}dt.jsonID("removeNodeMark",Xr);class Ze extends dt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&ol(e,this.from,this.to)?Ue.fail("Structure replace would overwrite content"):Ue.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new $t([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ze(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 Ze(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ze)||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?ne.empty:new ne(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ze(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?ne.empty:new ne(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ze(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 Ze(n.from,n.to,ne.fromJSON(e,n.slice),!!n.structure)}}dt.jsonID("replace",Ze);class Xe extends dt{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(ol(e,this.from,this.gapFrom)||ol(e,this.gapTo,this.to)))return Ue.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ue.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ue.fromReplace(e,this.from,this.to,r):Ue.fail("Content does not fit in gap")}getMap(){return new $t([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 Xe(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 Xe(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 Xe(n.from,n.to,n.gapFrom,n.gapTo,ne.fromJSON(e,n.slice),n.insert,!!n.structure)}}dt.jsonID("replaceAround",Xe);function ol(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 mT(t,e,n,r){let i=[],o=[],s,a;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 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 ln(h,p,f[g])));a&&a.to==h?a.to=p:o.push(a=new Wn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function gT(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof as){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(a+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(a,e),to:d,step:o})}}}),i.forEach(s=>t.step(new ln(s.from,s.to,s.style)))}function sl(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=a+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Ze(a,u,ne.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new ln(a,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new ne(G.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Ze(a+h.index,a+h.index+h[0].length,m))}}a=u}if(!r.validEnd){let c=r.fillBefore(G.empty,!0);t.replace(a,a,new ne(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function yT(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Qr(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||!yT(i,o,s))break}return null}function bT(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),c=s,d=a,u=G.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=G.from(r.node(m).copy(u)),f++):c--;let h=G.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=G.from(i.node(m).copy(h)),p++):d++;t.step(new Xe(c,d,s,a,new ne(u.append(h),f,p),u.size-f,!0))}function al(t,e,n=null,r=t){let i=kT(t,e),o=i&&vT(r,e);return o?i.map(Nh).concat({type:e,attrs:n}).concat(o.map(Nh)):null}function Nh(t){return{type:t,attrs:null}}function kT(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 vT(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 wT(t,e,n){let r=G.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=G.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Xe(i,o,i,o,new ne(r,0,0),n.length,!0))}function xT(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&ET(t.doc,t.mapping.slice(o).map(a),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&Ah(t,s,a,o),sl(t,t.mapping.slice(o).map(a,1),r,void 0,d===null);let u=t.mapping.slice(o),f=u.map(a,1),h=u.map(a+s.nodeSize,1);return t.step(new Xe(f,h,f+1,h-1,new ne(G.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&Mh(t,s,a,o),!1}})}function Mh(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Ah(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(`
|
|
31
|
-
`))}})}function ET(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function CT(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 Xe(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new ne(G.from(s),0,0),1,!0))}function Cn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(a,a,c?c.type:i.node(o+1).type)}function ST(t,e,n=1,r){let i=t.doc.resolve(e),o=G.empty,s=G.empty;for(let a=i.depth,c=i.depth-n,d=n-1;a>c;a--,d--){o=G.from(i.node(a).copy(o));let u=r&&r[d];s=G.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new Ze(e,e,new ne(o.append(s),n,n),!0))}function Yn(t,e){let n=t.resolve(e),r=n.index();return Dh(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function _T(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function Dh(t,e){return!!(t&&e&&!t.isLeaf&&_T(t,e))}function fs(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&Dh(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function OT(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Ah(t,u.node(),u.before(),a)}s.inlineContent&&sl(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let c=t.mapping.slice(a),d=c.map(e-n);if(t.step(new Ze(d,c.map(e+n,-1),ne.empty,!0)),r===!0){let u=t.doc.resolve(d);Mh(t,u.node(),u.before(),t.steps.length)}return t}function TT(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 $h(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(a>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 a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function hs(t,e,n=e,r=ne.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Lh(i,o,r)?new Ze(e,n,r):new NT(i,o,r).fit()}function Lh(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class NT{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=G.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=G.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let c=new ne(o,s,a);return e>-1?new Xe(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Ze(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=ll(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:d}=this.frontier[a],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(G.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ll(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ne(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=ll(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new ne(qi(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ne(qi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,a=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:f,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),y=f.matchType(g.type);if(!y)break;d++,(d>1||c==0||g.content.size)&&(f=y,u.push(Bh(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==a.childCount?p:-1)))}let m=d==a.childCount;m||(p=-1),this.placed=Ki(this.placed,n,G.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<p;g++){let k=y.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),y=k.content}this.unplaced=m?e==0?ne.empty:new ne(qi(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new ne(qi(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||!cl(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=cl(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],u=cl(e,a,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=Ki(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=Ki(this.placed,this.depth,G.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(G.empty,!0);n.childCount&&(this.placed=Ki(this.placed,this.frontier.length,n))}}function qi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(qi(t.firstChild.content,e-1,n)))}function Ki(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ki(t.lastChild.content,e-1,n)))}function ll(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Bh(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Bh(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(G.empty,!0)))),t.copy(r)}function cl(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!MT(n,o.content,s)?a:null}function MT(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function AT(t){return t.spec.defining||t.spec.definingForContent}function DT(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Lh(i,o,r))return t.step(new Ze(e,n,r));let s=Vh(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==p&&s.splice(1,0,-h)}let c=s.indexOf(a),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=AT(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+c)%s.length],k=!0;y<0&&(k=!1,y=-y);let x=i.node(y-1),w=i.index(y-1);if(x.canReplaceWith(w,w,m.type,m.marks))return t.replace(i.before(y),k?o.after(y):n,new ne(Ih(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 Ih(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Ih(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(G.empty,!0))}return t}function $T(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=TT(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new ne(G.from(r),0,0))}function LT(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Vh(r,i);for(let s=0;s<o.length;s++){let a=o[s],c=s==o.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Vh(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 ei extends dt{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 Ue.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 Ue.fromReplace(e,this.pos,this.pos+1,new ne(G.from(i),0,n.isLeaf?0:1))}getMap(){return $t.empty}invert(e){return new ei(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 ei(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 ei(n.pos,n.attr,n.value)}}dt.jsonID("attr",ei);class Gi extends dt{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 Ue.ok(r)}getMap(){return $t.empty}invert(e){return new Gi(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 Gi(n.attr,n.value)}}dt.jsonID("docAttr",Gi);let ti=class extends Error{};ti=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},ti.prototype=Object.create(Error.prototype),ti.prototype.constructor=ti,ti.prototype.name="TransformError";class BT{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ti(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=ne.empty){let i=hs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new ne(G.from(r),0,0))}delete(e,n){return this.replace(e,n,ne.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return DT(this,e,n,r),this}replaceRangeWith(e,n,r){return $T(this,e,n,r),this}deleteRange(e,n){return LT(this,e,n),this}lift(e,n){return bT(this,e,n),this}join(e,n=1){return OT(this,e,n),this}wrap(e,n){return wT(this,e,n),this}setBlockType(e,n=e,r,i=null){return xT(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return CT(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ei(e,n,r)),this}setDocAttribute(e,n){return this.step(new Gi(e,n)),this}addNodeMark(e,n){return this.step(new Un(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Xr(e,n)),this}split(e,n=1,r){return ST(this,e,n,r),this}addMark(e,n,r){return mT(this,e,n,r),this}removeMark(e,n,r){return gT(this,e,n,r),this}clearIncompatible(e,n,r){return sl(this,e,n,r),this}}const dl=Object.create(null);class xe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new IT(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=ne.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:c,$to:d}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),a?ne.empty:n),a==0&&Fh(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(a.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Fh(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ke(e):ni(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?ni(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):ni(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 Lt(e.node(0))}static atStart(e){return ni(e,e,0,0,1)||new Lt(e)}static atEnd(e){return ni(e,e,e.content.size,e.childCount,-1)||new Lt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=dl[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 dl)throw new RangeError("Duplicate use of selection JSON ID "+e);return dl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}}xe.prototype.visible=!0;class IT{constructor(e,n){this.$from=e,this.$to=n}}let Ph=!1;function Rh(t){!Ph&&!t.parent.inlineContent&&(Ph=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ke extends xe{constructor(e,n=e){Rh(e),Rh(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 xe.near(r);let i=e.resolve(n.map(this.anchor));return new ke(i.parent.inlineContent?i:r,r)}replace(e,n=ne.empty){if(super.replace(e,n),n==ne.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ke&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ps(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 ke(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=xe.findFrom(n,r,!0)||xe.findFrom(n,-r,!0);if(o)n=o.$head;else return xe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(xe.findFrom(e,-r,!0)||xe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ke(e,n)}}xe.jsonID("text",ke);class ps{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ps(e.map(this.anchor),e.map(this.head))}resolve(e){return ke.between(e.resolve(this.anchor),e.resolve(this.head))}}class pe extends xe{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?xe.near(o):new pe(o)}content(){return new ne(G.from(this.node),0,0)}eq(e){return e instanceof pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ul(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new pe(e.resolve(n.anchor))}static create(e,n){return new pe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}pe.prototype.visible=!1,xe.jsonID("node",pe);class ul{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ps(r,r):new ul(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&pe.isSelectable(r)?new pe(n):xe.near(n)}}class Lt extends xe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ne.empty){if(n==ne.empty){e.delete(0,e.doc.content.size);let r=xe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Lt(e)}map(e){return new Lt(e)}eq(e){return e instanceof Lt}getBookmark(){return VT}}xe.jsonID("all",Lt);const VT={map(){return this},resolve(t){return new Lt(t)}};function ni(t,e,n,r,i,o=!1){if(e.inlineContent)return ke.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&pe.isSelectable(a))return pe.create(t,n-(i<0?a.nodeSize:0))}else{let c=ni(t,a,n+i,i<0?a.childCount:0,i,o);if(c)return c}n+=a.nodeSize*i}return null}function Fh(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ze||i instanceof Xe))return;let o=t.mapping.maps[r],s;o.forEach((a,c,d,u)=>{s==null&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const jh=1,zh=2,Hh=4;class PT extends BT{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|jh)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&jh)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=zh,this}ensureMarks(e){return Be.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&zh)>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)||Be.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(xe.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|=Hh,this}get scrolledIntoView(){return(this.updated&Hh)>0}}function Wh(t,e){return!e||!t?t:t.bind(e)}class Ji{constructor(e,n,r){this.name=e,this.init=Wh(n.init,r),this.apply=Wh(n.apply,r)}}const RT=[new Ji("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ji("selection",{init(t,e){return t.selection||xe.atStart(e.doc)},apply(t){return t.selection}}),new Ji("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ji("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class fl{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=RT.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ji(r.key,r.spec.state,r))})}}class ri{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let c=i?i[s].n:0,d=i?i[s].state:this,u=c<n.length&&a.spec.appendTransaction.call(a,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 ri(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 PT(this)}static create(e){let n=new fl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ri(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 fl(this.schema,e.plugins),r=n.fields,i=new ri(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 fl(e.schema,e.plugins),o=new ri(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=zn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=xe.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=d.fromJSON.call(c,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function Uh(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Uh(i,e,{})),n[r]=i}return n}class it{constructor(e){this.spec=e,this.props={},e.props&&Uh(e.props,this,this.props),this.key=e.key?e.key.key:Yh("plugin")}getState(e){return e[this.key]}}const hl=Object.create(null);function Yh(t){return t in hl?t+"$"+ ++hl[t]:(hl[t]=0,t+"$")}class Bt{constructor(e="key"){this.key=Yh(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ot=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Zi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let pl=null;const Sn=function(t,e,n){let r=pl||(pl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},FT=function(){pl=null},vr=function(t,e,n,r){return n&&(qh(t,e,n,r,-1)||qh(t,e,n,r,1))},jT=/^(img|br|input|textarea|hr)$/i;function qh(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:jt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Xi(t)||jT.test(t.nodeName)||t.contentEditable=="false")return!1;e=ot(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?jt(t):0}else return!1}}function jt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function zT(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=jt(t)}else if(t.parentNode&&!Xi(t))e=ot(t),t=t.parentNode;else return null}}function HT(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&&!Xi(t))e=ot(t)+1,t=t.parentNode;else return null}}function WT(t,e,n){for(let r=e==0,i=e==jt(t);r||i;){if(t==n)return!0;let o=ot(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==jt(t)}}function Xi(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 ms=function(t){return t.focusNode&&vr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function wr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function UT(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function YT(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(jt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(jt(r.startContainer),r.startOffset)}}}const cn=typeof navigator<"u"?navigator:null,Kh=typeof document<"u"?document:null,qn=cn&&cn.userAgent||"",ml=/Edge\/(\d+)/.exec(qn),Gh=/MSIE \d/.exec(qn),gl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qn),_t=!!(Gh||gl||ml),Kn=Gh?document.documentMode:gl?+gl[1]:ml?+ml[1]:0,en=!_t&&/gecko\/(\d+)/i.test(qn);en&&+(/Firefox\/(\d+)/.exec(qn)||[0,0])[1];const yl=!_t&&/Chrome\/(\d+)/.exec(qn),ut=!!yl,Jh=yl?+yl[1]:0,yt=!_t&&!!cn&&/Apple Computer/.test(cn.vendor),ii=yt&&(/Mobile\/\w+/.test(qn)||!!cn&&cn.maxTouchPoints>2),zt=ii||(cn?/Mac/.test(cn.platform):!1),qT=cn?/Win/.test(cn.platform):!1,_n=/Android \d/.test(qn),Qi=!!Kh&&"webkitFontSmoothing"in Kh.documentElement.style,KT=Qi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function GT(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 On(t,e){return typeof t=="number"?t:t[e]}function JT(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 Zh(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=Zi(s)){if(s.nodeType!=1)continue;let a=s,c=a==o.body,d=c?GT(o):JT(a),u=0,f=0;if(e.top<d.top+On(r,"top")?f=-(d.top-e.top+On(i,"top")):e.bottom>d.bottom-On(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+On(i,"top")-d.top:e.bottom-d.bottom+On(i,"bottom")),e.left<d.left+On(r,"left")?u=-(d.left-e.left+On(i,"left")):e.right>d.right-On(r,"right")&&(u=e.right-d.right+On(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let m=a.scrollLeft-h,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function ZT(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=n-20){r=a,i=c.top;break}}return{refDOM:r,refTop:i,stack:Xh(t.dom)}}function Xh(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Zi(r));return e}function XT({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Qh(n,r==0?0:r-e)}function Qh(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 oi=null;function QT(t){if(t.setActive)return t.setActive();if(oi)return t.focus(oi);let e=Xh(t);t.focus(oi==null?{get preventScroll(){return oi={preventScroll:!0},!0}}:void 0),oi||(oi=!1,Qh(e,0))}function ep(t,e){let n,r=2e8,i,o=0,s=e.top,a=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=Sn(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!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?e5(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:ep(n,i)}function e5(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=Gn(r,1);if(o.top!=o.bottom&&bl(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function bl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function t5(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function n5(t,e,n){let{node:r,offset:i}=ep(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 r5(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),c;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((c=a.dom.getBoundingClientRect()).width||c.height)&&(a.node.isBlock&&a.parent&&(!s&&c.left>r.left||c.top>r.top?i=a.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function tp(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let c=0;c<a.length;c++){let d=a[c];if(bl(e,d))return tp(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function i5(t,e){let n=t.dom.ownerDocument,r,i=0,o=YT(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!bl(e,d)||(s=tp(t.dom,e,d),!s))return null}if(yt)for(let d=s;r&&d;d=Zi(d))d.draggable&&(r=void 0);if(s=t5(s,e),r){if(en&&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;Qi&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=r5(t,r,i,e))}a==null&&(a=n5(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function np(t){return t.top<t.bottom||t.left<t.right}function Gn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(np(r))return r}return Array.prototype.find.call(n,np)||t.getBoundingClientRect()}const o5=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function rp(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Qi||en;if(r.nodeType==3)if(s&&(o5.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Gn(Sn(r,i,i),n);if(en&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Gn(Sn(r,i-1,i-1),-1);if(d.top==c.top){let u=Gn(Sn(r,i,i+1),-1);if(u.top!=c.top)return eo(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++,eo(Gn(Sn(r,c,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return kl(c.getBoundingClientRect(),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];if(c.nodeType==1)return kl(c.getBoundingClientRect(),!0)}return kl(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Sn(c,jt(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return eo(Gn(d,1),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Sn(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return eo(Gn(d,-1),!0)}return eo(Gn(r.nodeType==3?Sn(r):r,-n),n>=0)}function eo(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 kl(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 ip(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 s5(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return ip(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=rp(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=Sn(a,0,a.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 a5=/[\u0590-\u08ac]/;function l5(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!a5.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:ip(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{a.collapse(u,f),c&&(c!=u||d!=f)&&a.extend&&a.extend(c,d)}catch{}return h!=null&&(a.caretBidiLevel=h),y}):r.pos==r.start()||r.pos==r.end()}let op=null,sp=null,ap=!1;function c5(t,e,n){return op==e&&sp==n?ap:(op=e,sp=n,ap=n=="up"||n=="down"?s5(t,e,n):l5(t,e,n))}const Ht=0,lp=1,xr=2,dn=3;class to{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ht,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>ot(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;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof up){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof cp&&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?ot(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?ot(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let c=this.children[a],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=a;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=ot(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||a==this.children.length-1)){n=d;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=ot(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 p=0,m=0;p<this.children.length;p++){let g=this.children[p],y=m+g.size;if(o>m&&s<y)return g.setSelection(e-m-g.border,n-m-g.border,r,i);m=y}let a=this.domFromPos(e,e?-1:1),c=n==e?a:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((en||yt)&&e==n){let{node:p,offset:m}=a;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
32
|
-
`),f&&m==p.nodeValue.length)for(let g=p,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(a=c={node:y.parentNode,offset:ot(y)+1});break}let k=g.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let g=p.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(en&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&yt)&&vr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&vr(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&!f){d.collapse(a.node,a.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=a;a=c,c=m}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,c=s-o.border;if(e>=a&&n<=c){this.dirty=e==r||n==s?xr:lp,e==a&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=dn:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?xr:dn}r=s}this.dirty=xr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?xr:lp;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class cp extends to{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Ht&&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 d5 extends to{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 Er extends to{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=kr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Er(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&dn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=dn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Ht){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ht}}slice(e,n,r){let i=Er.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=wl(o,n,s,r)),e>0&&(o=wl(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Jn extends to{constructor(e,n,r,i,o,s,a,c,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],c,d=a&&a(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}=kr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=pp(u,r,n),d?c=new u5(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new gs(e,n,r,i,u,h,o):new Jn(e,n,r,i,u,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>G.empty)}return e}matchesNode(e,n,r){return this.dirty==Ht&&e.eq(this.node)&&ys(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,c=new h5(this,s&&s.node,e);g5(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?Be.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)||a&&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==xr)&&(s&&this.protectLocalComposition(e,s),fp(this.contentDOM,this.children,e),ii&&y5(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ke)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=b5(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new d5(this,o,n,i);e.input.compositionNodes.push(s),this.children=wl(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==dn||!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=Ht}updateOuterDeco(e){if(ys(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=hp(this.dom,this.nodeDOM,vl(this.outerDeco,this.node,n),vl(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 dp(t,e,n,r,i){pp(r,e,t);let o=new Jn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class gs extends Jn{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==dn||this.dirty!=Ht&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ht||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=Ht,!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 gs(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=dn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class up extends to{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ht&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class u5 extends Jn{constructor(e,n,r,i,o,s,a,c,d,u){super(e,n,r,i,o,s,a,d,u),this.spec=c}update(e,n,r,i){if(this.dirty==dn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){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.root):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 fp(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=mp(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof Er){let c=r?r.previousSibling:t.lastChild;fp(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=mp(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const no=function(t){t&&(this.nodeName=t)};no.prototype=Object.create(null);const Cr=[new no];function vl(t,e,n){if(t.length==0)return Cr;let r=n?Cr[0]:new no,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new no(s.nodeName));for(let a in s){let c=s[a];c!=null&&(n&&i.length==1&&i.push(r=new no(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+c:a=="style"?r.style=(r.style?r.style+";":"")+c:a!="nodeName"&&(r[a]=c))}}}return i}function hp(t,e,n,r){if(n==Cr&&r==Cr)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let c;a&&a.nodeName==s.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(i),a=Cr[0]),i=c}f5(i,a||Cr[0],s)}return i}function f5(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 pp(t,e,n){return hp(t,t,Cr,vl(e,n,t.nodeType!=1))}function ys(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 mp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class h5{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=p5(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=Ht,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let 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)){a=c;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=Er.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 a=this.index,c=Math.min(this.top.children.length,a+5);a<c;a++){let d=this.top.children[a];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==dn&&s.dom==s.contentDOM&&(s.dirty=xr),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let c=this.top.children[a];if(c instanceof Jn){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!=dn&&ys(n,c.outerDeco));if(!h&&c.update(e,n,r,i))return this.destroyBetween(this.index,a),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(c,e,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=xr,f.updateChildren(i,s+1),f.dirty=Ht),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)||!ys(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Jn.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let c of a.children)c.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=Jn.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new cp(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 Er;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof gs)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((yt||ut)&&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 up(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 p5(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof Er)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function m5(t,e){return t.type.side-e.type.side}function g5(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let s=0,a=[],c=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(m5);for(let y=0;y<f.length;y++)n(f[y],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 y=0;y<a.length;y++)a[y].to<=o&&a.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let y=m;s<i.length&&i[s].from<y&&(y=i[s].from);for(let k=0;k<a.length;k++)a[k].to<y&&(y=a[k].to);y<m&&(c=h.cut(y-o),h=h.cut(0,y-o),m=y,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let g=h.isInline&&!h.isLeaf?a.filter(y=>!y.inline):a.slice();r(h,g,e.forChild(o,h),p),o=m}}function y5(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 b5(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let 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-a,r-a)==e)return r-e.length;let d=a<r?c.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=n)return a+d;if(n==r&&c.length>=r+e.length-a&&c.slice(r-a,r-a+e.length)==e)return r}}return-1}function wl(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let c=t[s],d=a,u=a+=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 xl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),c,d;if(ms(n)){for(c=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&pe.isSelectable(f)&&i.parent&&!(f.isInline&&WT(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new pe(s==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,h=s;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[c,s]=h==t.state.selection.anchor?[h,f]:[f,h],a=r.resolve(s)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!d){let f=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;d=Cl(t,u,a,f)}return d}function gp(t){return t.editable?t.hasFocus():Ep(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Tn(t,e=!1){let n=t.state.selection;if(vp(t,n),!!gp(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ut){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&vr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)v5(t);else{let{anchor:r,head:i}=n,o,s;yp&&!(n instanceof ke)&&(n.$from.parent.inlineContent||(o=bp(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=bp(t,n.to))),t.docView.setSelection(r,i,t,e),yp&&(o&&kp(o),s&&kp(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&k5(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const yp=yt||ut&&Jh<63;function bp(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(yt&&i&&i.contentEditable=="false")return El(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return El(i);if(o)return El(o)}}function El(t){return t.contentEditable="true",yt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function kp(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function k5(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(()=>{(!gp(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function v5(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,ot(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&_t&&Kn<=11&&(r.disabled=!0,r.disabled=!1)}function vp(t,e){if(e instanceof pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(wp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else wp(t)}function wp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Cl(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ke.between(e,n,r)}function xp(t){return t.editable&&!t.hasFocus()?!1:Ep(t)}function Ep(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 w5(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return vr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Sl(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&&xe.findFrom(o,e)}function Zn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Cp(t,e,n){let r=t.state.selection;if(r instanceof ke)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 Zn(t,new ke(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Sl(t.state,e);return i&&i instanceof pe?Zn(t,i):!1}else if(!(zt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?pe.isSelectable(o)?Zn(t,new pe(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Qi?Zn(t,new ke(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return Zn(t,new ke(e>0?r.$to:r.$from));{let i=Sl(t.state,e);return i?Zn(t,i):!1}}}function bs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ro(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function si(t,e){return e<0?x5(t):E5(t)}function x5(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(en&&n.nodeType==1&&r<bs(n)&&ro(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ro(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Sp(n))break;{let a=n.previousSibling;for(;a&&ro(a,-1);)i=n.parentNode,o=ot(a),a=a.previousSibling;if(a)n=a,r=bs(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?_l(t,n,r):i&&_l(t,i,o)}function E5(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=bs(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(ro(a,1))o=n,s=++r;else break}else{if(Sp(n))break;{let a=n.nextSibling;for(;a&&ro(a,1);)o=a.parentNode,s=ot(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=bs(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&_l(t,o,s)}function Sp(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function C5(t,e){for(;t&&e==t.childNodes.length&&!Xi(t);)e=ot(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 S5(t,e){for(;t&&!e&&!Xi(t);)e=ot(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function _l(t,e,n){if(e.nodeType!=3){let o,s;(s=C5(e,n))?(e=s,n=0):(o=S5(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ms(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&&Tn(t)},50)}function _p(t,e){let n=t.state.doc.resolve(e);if(!(ut||qT)&&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 Op(t,e,n){let r=t.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||zt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Sl(t.state,e);if(s&&s instanceof pe)return Zn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Lt?xe.near(s,e):xe.findFrom(s,e);return a?Zn(t,a):!1}return!1}function Tp(t,e){if(!(t.state.selection instanceof ke))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 Np(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function _5(t){if(!yt||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;Np(t,r,"true"),setTimeout(()=>Np(t,r,"false"),20)}return!1}function O5(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function T5(t,e){let n=e.keyCode,r=O5(e);if(n==8||zt&&n==72&&r=="c")return Tp(t,-1)||si(t,-1);if(n==46&&!e.shiftKey||zt&&n==68&&r=="c")return Tp(t,1)||si(t,1);if(n==13||n==27)return!0;if(n==37||zt&&n==66&&r=="c"){let i=n==37?_p(t,t.state.selection.from)=="ltr"?-1:1:-1;return Cp(t,i,r)||si(t,i)}else if(n==39||zt&&n==70&&r=="c"){let i=n==39?_p(t,t.state.selection.from)=="ltr"?1:-1:1;return Cp(t,i,r)||si(t,i)}else{if(n==38||zt&&n==80&&r=="c")return Op(t,-1,r)||si(t,-1);if(n==40||zt&&n==78&&r=="c")return _5(t)||Op(t,1,r)||si(t,1);if(r==(zt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ol(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")||kr.fromSchema(t.state.schema),a=Vp(),c=a.createElement("div");c.appendChild(s.serializeFragment(r,{document:a}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Bp[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.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,`
|
|
33
|
-
|
|
34
|
-
`);return{dom:c,text:h,slice:e}}function
|
|
35
|
-
`))),0,0):ne.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)a=f;else{let h=i.marks(),{schema:p}=t.state,m=kr.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=D5(n),Qi&&$5(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Hn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!N5.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=L5(Lp(a,+u[1],+u[2]),u[4]);else if(a=ne.maxOpen(M5(a.content,i),!0),a.openStart||a.openEnd){let f=0,h=0;for(let p=a.content.firstChild;f<a.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=a.content.lastChild;h<a.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);a=Lp(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const N5=/^(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 M5(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let c=i.findWrapping(a.type),d;if(!c)return s=null;if(d=s.length&&o.length&&Dp(c,o,a,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=$p(s[s.length-1],o.length));let u=Ap(a,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return G.from(s)}return t}function Ap(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,G.from(t));return t}function Dp(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Dp(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(G.from(Ap(n,t,i+1))))}}function $p(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,$p(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(G.empty,!0);return t.copy(n.append(r))}function Tl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=Tl(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(G.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Lp(t,e,n){return e<t.openStart&&(t=new ne(Tl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ne(Tl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Bp={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 Ip=null;function Vp(){return Ip||(Ip=document.implementation.createHTMLDocument("title"))}let Nl=null;function A5(t){let e=window.trustedTypes;return e?(Nl||(Nl=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Nl.createHTML(t)):t}function D5(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Vp().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Bp[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=A5(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function $5(t){let e=t.querySelectorAll(ut?"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 L5(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let c=n.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;i=G.from(c.create(r[a+1],i)),o++,s++}return new ne(i,o,s)}const bt={},kt={},B5={touchstart:!0,touchmove:!0};class I5{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.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function V5(t){for(let e in bt){let n=bt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{R5(t,r)&&!Al(t,r)&&(t.editable||!(r.type in kt))&&n(t,r)},B5[e]?{passive:!0}:void 0)}yt&&t.dom.addEventListener("input",()=>null),Ml(t)}function Xn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function P5(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 Ml(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Al(t,r))})}function Al(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function R5(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 F5(t,e){!Al(t,e)&&bt[e.type]&&(t.editable||!(e.type in kt))&&bt[e.type](t,e)}kt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Rp(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(_n&&ut&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ii&&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,wr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||T5(t,n)?n.preventDefault():Xn(t,"key")},kt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},kt.keypress=(t,e)=>{let n=e;if(Rp(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||zt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ke)||!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 ks(t){return{left:t.clientX,top:t.clientY}}function j5(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Dl(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ai(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function z5(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(ai(t,new pe(n)),!0):!1}function H5(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof pe&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(pe.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(ai(t,pe.create(t.state.doc,i)),!0):!1}function W5(t,e,n,r,i){return Dl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?H5(t,n):z5(t,n))}function U5(t,e,n,r){return Dl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Y5(t,e,n,r){return Dl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||q5(t,n,r)}function q5(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ai(t,ke.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)ai(t,ke.create(r,a+1,a+1+s.content.size));else if(pe.isSelectable(s))ai(t,pe.create(r,a));else continue;return!0}}function $l(t){return vs(t)}const Pp=zt?"metaKey":"ctrlKey";bt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=$l(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&j5(n,t.input.lastClick)&&!n[Pp]&&(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(ks(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new K5(t,s,n,!!r)):(o=="doubleClick"?U5:Y5)(t,s.pos,s.inside,n)?n.preventDefault():Xn(t,"pointer"))};class K5{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[Pp],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,c=a?e.docView.nearestDesc(a,!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 pe&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&en&&!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)),Xn(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(()=>Tn(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(ks(e))),this.updateAllowDefault(e),this.allowDefault||!n?Xn(this.view,"pointer"):W5(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||yt&&this.mightDrag&&!this.mightDrag.node.isAtom||ut&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ai(this.view,xe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Xn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Xn(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)}}bt.touchstart=t=>{t.input.lastTouch=Date.now(),$l(t),Xn(t,"pointer")},bt.touchmove=t=>{t.input.lastTouch=Date.now(),Xn(t,"pointer")},bt.contextmenu=t=>$l(t);function Rp(t,e){return t.composing?!0:yt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const G5=_n?5e3:-1;kt.compositionstart=kt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),vs(t,!0),t.markCursor=null;else if(vs(t,!e.selection.empty),en&&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){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Fp(t,G5)},kt.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++,Fp(t,20))};function Fp(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>vs(t),e))}function jp(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Z5());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function J5(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=zT(e.focusNode,e.focusOffset),r=HT(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 Z5(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function vs(t,e=!1){if(!(_n&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),jp(t),e||t.docView&&t.docView.dirty){let n=xl(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function X5(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 io=_t&&Kn<15||ii&&KT<604;bt.copy=kt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=io?null:n.clipboardData,s=r.content(),{dom:a,text:c}=Ol(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",c)):X5(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Q5(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function eN(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?oo(t,r.value,null,i,e):oo(t,r.textContent,r.innerHTML,i,e)},50)}function oo(t,e,n,r,i){let o=Mp(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||ne.empty)))return!0;if(!o)return!1;let s=Q5(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function zp(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," "):""}kt.paste=(t,e)=>{let n=e;if(t.composing&&!_n)return;let r=io?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&oo(t,zp(r),r.getData("text/html"),i,n)?n.preventDefault():eN(t,n)};class Hp{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Wp=zt?"altKey":"ctrlKey";bt.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(ks(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof pe?i.to-1:i.to))){if(r&&r.mightDrag)s=pe.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=pe.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=Ol(t,a);(!n.dataTransfer.files.length||!ut||Jh>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(io?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",io||n.dataTransfer.setData("text/plain",d),t.dragging=new Hp(u,!n[Wp],s)},bt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},kt.dragover=kt.dragenter=(t,e)=>e.preventDefault(),kt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(ks(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=Mp(t,zp(n.dataTransfer),io?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[Wp]);if(t.someProp("handleDrop",m=>m(t,n,s||ne.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?$h(t.state.doc,o.pos,s):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(a){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&&pe.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new pe(p));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,y,k,x)=>m=x),d.setSelection(Cl(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},bt.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())&&Tn(t)},20))},bt.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)},bt.beforeinput=(t,e)=>{if(ut&&_n&&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,wr(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 kt)bt[t]=kt[t];function so(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 ws{constructor(e,n){this.toDOM=e,this.spec=n||Sr,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 It(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ws&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&so(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Qn{constructor(e,n){this.attrs=e,this.spec=n||Sr}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 It(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Qn&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}static is(e){return e.type instanceof Qn}destroy(){}}class Ll{constructor(e,n){this.attrs=e,this.spec=n||Sr}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 It(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 Ll&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}destroy(){}}class It{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new It(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 It(e,e,new ws(n,r))}static inline(e,n,r,i){return new It(e,n,new Qn(r,i))}static node(e,n,r,i){return new It(e,n,new Ll(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Qn}get widget(){return this.type instanceof ws}}const li=[],Sr={};class Ye{constructor(e,n){this.local=e.length?e:li,this.children=n.length?n:li}static create(e,n){return n.length?xs(n,e,0,Sr):ft}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==ft||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Sr)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let c=this.local[a].map(e,r,i);c&&c.type.valid(n,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?tN(this.children,s||[],e,n,r,i,o):s?new Ye(s.sort(_r),li):ft}add(e,n){return n.length?this==ft?Ye.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,c)=>{let d=c+r,u;if(u=Yp(n,a,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(a,u,d+1):i.splice(o,0,c,c+a.nodeSize,xs(u,a,d+1,Sr)),o+=3}});let s=Up(o?qp(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ye(s.length?this.local.concat(s).sort(_r):this.local,i||this.children)}remove(e){return e.length==0||this==ft?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,c=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&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,a+1);d!=ft?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ye(i,r):ft}forChild(e,n){if(this==ft)return this;if(n.isLeaf)return Ye.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let c=this.local[a];if(c.from<s&&c.to>o&&c.type instanceof Qn){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 a=new Ye(i.sort(_r),li);return r?new er([a,r]):a}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof Ye)||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 Bl(this.localsInner(e))}localsInner(e){if(this==ft)return li;if(e.inlineContent||!this.local.some(Qn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Qn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=Bl;const ft=Ye.empty;class er{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Sr));return er.from(r)}forChild(e,n){if(n.isLeaf)return Ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ft&&(o instanceof er?r=r.concat(o.members):r.push(o))}return er.from(r)}eq(e){if(!(e instanceof er)||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?Bl(r?n:n.sort(_r)):li}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new er(e.every(n=>n instanceof Ye)?e:e.reduce((n,r)=>n.concat(r instanceof Ye?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function tN(t,e,n,r,i,o,s){let a=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let k=0;k<a.length;k+=3){let x=a[k+1];if(x<0||h>x+u-f)continue;let w=a[k]+u-f;p>=w?a[k+1]=h<=w?-2:-1:h>=u&&y&&(a[k]+=y,a[k+1]+=y)}f+=y}),u=n.maps[d].map(u,-1)}let c=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){c=!0,a[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:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let k=a[d+2].mapInner(n,y,u+1,t[d]+o+1,s);k!=ft?(a[d]=f,a[d+1]=p,a[d+2]=k):(a[d+1]=-2,c=!0)}else c=!0}if(c){let d=nN(a,t,e,n,i,o,s),u=xs(d,r,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<a.length&&a[h]<p;)h+=3;a.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ye(e.sort(_r),a)}function Up(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 It(i.from+e,i.to+e,i.type))}return n}function nN(t,e,n,r,i,o,s){function a(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)a(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&a(t[c+2],e[c]+o+1);return n}function Yp(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 qp(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function xs(t,e,n,r){let i=[],o=!1;e.forEach((a,c)=>{let d=Yp(t,a,c+n);if(d){o=!0;let u=xs(d,a,n+c+1,r);u!=ft&&i.push(c,c+a.nodeSize,u)}});let s=Up(o?qp(t):t,-n).sort(_r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ye(s,i):ft}function _r(t,e){return t.from-e.from||t.to-e.to}function Bl(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),Kp(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),Kp(e,i,r.copy(o.from,r.to)));break}}}return e}function Kp(t,e,n){for(;e<t.length&&_r(n,t[e])>0;)e++;t.splice(e,0,n)}function Il(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ft&&e.push(r)}),t.cursorWrapper&&e.push(Ye.create(t.state.doc,[t.cursorWrapper.deco])),er.from(e)}const rN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},iN=_t&&Kn<=11;class oN{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 sN{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new oN,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]);_t&&Kn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),iN&&(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,rN)),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(xp(this.view)){if(this.suppressingSelectionUpdates)return Tn(this.view);if(_t&&Kn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vr(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=Zi(o))n.add(o);for(let o=e.anchorNode;o;o=Zi(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)&&xp(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!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&&(a=!0))}if(en&&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||cN(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&&ms(r)&&(d=xl(e))&&d.eq(xe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Tn(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),aN(e)),this.handleDOMChange(o,s,a,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Tn(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(_t&&Kn<=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?ot(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),c=o&&o.parentNode==e.target?ot(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:a,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Gp=new WeakMap,Jp=!1;function aN(t){if(!Gp.has(t)&&(Gp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=en,Jp)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."),Jp=!0}}function Zp(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return vr(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function lN(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Zp(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?Zp(t,n):null}function cN(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 dN(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=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}],ms(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ut&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let k=r.childNodes[y-1],x=k.pmViewDesc;if(k.nodeName=="BR"&&!x){o=y;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||Hn.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:uN,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,k=d[1]&&d[1].pos;k==null&&(k=y),m={anchor:y+s,head:k+s}}return{doc:g,sel:m,from:s,to:a}}function uN(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(yt&&/^(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||yt&&/^(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 fN=/^(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 hN(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let O=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,$=xl(t,O);if($&&!t.state.selection.eq($)){if(ut&&_n&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",B=>B(t,wr(13,"Enter"))))return;let V=t.state.tr.setSelection($);O=="pointer"?V.setMeta("pointer",!0):O=="key"&&V.scrollIntoView(),o&&V.setMeta("composition",o),t.dispatch(V)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let c=t.state.selection,d=dN(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=gN(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(ii&&t.input.lastIOSEnter>Date.now()-225||_n)&&i.some(O=>O.nodeType==1&&!fN.test(O.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",O=>O(t,wr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ke&&!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 O=Xp(t,t.state.doc,d.sel);if(O&&!O.eq(t.state.selection)){let $=t.state.tr.setSelection(O);o&&$.setMeta("composition",o),t.dispatch($)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ke&&(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)),_t&&Kn<=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),k=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&k.end()>=m.endA,w;if((ii&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!x&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(w=xe.findFrom(d.doc.resolve(g.pos+1),1,!0))&&w.head==y.pos)&&t.someProp("handleKeyDown",O=>O(t,wr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&mN(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",O=>O(t,wr(8,"Backspace")))){_n&&ut&&t.domObserver.suppressSelectionUpdates();return}ut&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),_n&&!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(O){return O(t,wr(13,"Enter"))})},20));let b=m.start,C=m.endA,v,S,D;if(x){if(g.pos==y.pos)_t&&Kn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tn(t),20)),v=t.state.tr.delete(b,C),S=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(D=pN(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))v=t.state.tr,D.type=="add"?v.addMark(b,C,D.mark):v.removeMark(b,C,D.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let O=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",$=>$(t,b,C,O)))return;v=t.state.tr.insertText(O,b,C)}}if(v||(v=t.state.tr.replace(b,C,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let O=Xp(t,v.doc,d.sel);O&&!(ut&&t.composing&&O.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==b||O.head==v.mapping.map(C)-1)||_t&&O.empty&&O.head==b)&&v.setSelection(O)}S&&v.ensureMarks(S),o&&v.setMeta("composition",o),t.dispatch(v.scrollIntoView())}function Xp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Cl(t,e.resolve(n.anchor),e.resolve(n.head))}function pN(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,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)a=i[0],s="add",c=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",c=u=>u.mark(a.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(G.from(d).eq(t))return{mark:a,type:s}}function mN(t,e,n,r,i){if(n-e<=i.pos-r.pos||Vl(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Vl(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Vl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Vl(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 gN(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,a));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&&Qp(e.textBetween(o-1,o+1))&&(o+=c?1:-1),a=o+(a-s),s=o}else if(a<o){let c=r<=o&&r>=a?o-r:0;o-=c,o&&o<t.size&&Qp(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function Qp(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 yN{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 I5,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(im),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=nm(this),tm(this),this.nodeViews=rm(this),this.docView=dp(this.state.doc,em(this),Il(this),this.dom,this),this.domObserver=new sN(this,(r,i,o,s)=>hN(this,r,i,o,s)),this.domObserver.start(),V5(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&&Ml(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(im),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&&(jp(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=rm(this);kN(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ml(this),this.editable=nm(this),tm(this);let c=Il(this),d=em(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&&ZT(this);if(s){this.domObserver.stop();let p=f&&(_t||ut)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&bN(i.selection,e.selection);if(f){let m=ut?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=J5(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=dp(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&w5(this))?Tn(this,p):(vp(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&&XT(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof pe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Zh(this,n.getBoundingClientRect(),e)}else Zh(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 Hp(e.slice,e.move,i<0?void 0:pe.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(_t){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&&QT(this.dom),Tn(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 i5(this,e)}coordsAtPos(e,n=1){return rp(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 c5(this,n||this.state,e)}pasteHTML(e,n){return oo(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return oo(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ol(this,e)}destroy(){this.docView&&(P5(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Il(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,FT())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return F5(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 e?yt&&this.root.nodeType===11&&UT(this.dom.ownerDocument)==this.dom&&lN(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function em(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"),[It.node(0,t.state.doc.content.size,e)]}function tm(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:It.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function nm(t){return!t.someProp("editable",e=>e(t.state)===!1)}function bN(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 rm(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 kN(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 im(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 tr={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:"'"},Es={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vN=typeof navigator<"u"&&/Mac/.test(navigator.platform),wN=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),st=0;st<10;st++)tr[48+st]=tr[96+st]=String(st);for(var st=1;st<=24;st++)tr[st+111]="F"+st;for(var st=65;st<=90;st++)tr[st]=String.fromCharCode(st+32),Es[st]=String.fromCharCode(st);for(var Pl in tr)Es.hasOwnProperty(Pl)||(Es[Pl]=tr[Pl]);function xN(t){var e=vN&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||wN&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Es:tr)[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 EN=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function CN(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let c=e[a];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))EN?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 SN(t){let e=Object.create(null);for(let n in t)e[CN(n)]=t[n];return e}function Rl(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 _N(t){return new it({props:{handleKeyDown:om(t)}})}function om(t){let e=SN(t);return function(n,r){let i=xN(r),o,s=e[Rl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Rl(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=tr[r.keyCode])&&o!=i){let a=e[Rl(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Fl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function sm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const am=(t,e,n)=>{let r=sm(t,n);if(!r)return!1;let i=jl(r);if(!i){let s=r.blockRange(),a=s&&Qr(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(gm(t,i,e,-1))return!0;if(r.parent.content.size==0&&(ci(o,"end")||pe.isSelectable(o)))for(let s=r.depth;;s--){let a=hs(t.doc,r.before(s),r.after(s),ne.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(ci(o,"end")?xe.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):pe.create(c.doc,i.pos-o.nodeSize)),e(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},ON=(t,e,n)=>{let r=sm(t,n);if(!r)return!1;let i=jl(r);return i?lm(t,i,e):!1},TN=(t,e,n)=>{let r=dm(t,n);if(!r)return!1;let i=zl(r);return i?lm(t,i,e):!1};function lm(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,a=s,c=e.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let d=hs(t.doc,o,c,ne.empty);if(!d||d.from!=o||d instanceof Ze&&d.slice.size>=c-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(ke.create(u.doc,o)),n(u.scrollIntoView())}return!0}function ci(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 cm=(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=jl(r)}let s=o&&o.nodeBefore;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function jl(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 dm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const um=(t,e,n)=>{let r=dm(t,n);if(!r)return!1;let i=zl(r);if(!i)return!1;let o=i.nodeAfter;if(gm(t,i,e,1))return!0;if(r.parent.content.size==0&&(ci(o,"start")||pe.isSelectable(o))){let s=hs(t.doc,r.before(),r.after(),ne.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(ci(o,"start")?xe.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):pe.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},fm=(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=zl(r)}let s=o&&o.nodeAfter;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos)).scrollIntoView()),!0)};function zl(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 NN=(t,e)=>{let n=t.selection,r=n instanceof pe,i;if(r){if(n.node.isTextblock||!Yn(t.doc,n.from))return!1;i=n.from}else if(i=fs(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(pe.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},MN=(t,e)=>{let n=t.selection,r;if(n instanceof pe){if(n.node.isTextblock||!Yn(t.doc,n.to))return!1;r=n.to}else if(r=fs(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},AN=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Qr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},hm=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
36
|
-
`).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 DN=(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 a=n.after(),c=t.tr.replaceWith(a,a,s.createAndFill());c.setSelection(xe.near(c.doc.resolve(a),1)),e(c.scrollIntoView())}return!0},pm=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Lt||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,a=t.tr.insert(s,o.createAndFill());a.setSelection(ke.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},mm=(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(Cn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Qr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function $N(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof pe&&e.selection.node.isBlock)return!r.parentOffset||!Cn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,c=!1,d=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){c=r.end(p)==r.pos+(r.depth-p),d=r.start(p)==r.pos-(r.depth-p),a=Hl(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),o.unshift(c&&a?{type:a}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof ke||e.selection instanceof Lt)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=Cn(u.doc,f,o.length,o);if(h||(o[0]=a?{type:a}:null,h=Cn(u.doc,f,o.length,o)),u.split(f,o.length,o),!c&&d&&r.node(s).type!=a){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);a&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const LN=$N(),BN=(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(pe.create(t.doc,i))),!0)};function IN(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||Yn(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function gm(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&IN(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,m=G.empty;for(let k=s.length-1;k>=0;k--)m=G.from(s[k].create(null,m));m=G.from(i.copy(m));let g=t.tr.step(new Xe(e.pos-1,p,e.pos,p,new ne(m,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Yn(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&c?null:xe.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),h=f&&Qr(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(d&&ci(o,"start",!0)&&ci(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let k=G.empty;for(let w=m.length-1;w>=0;w--)k=G.from(m[w].copy(k));let x=t.tr.step(new Xe(e.pos-m.length,e.pos+o.nodeSize,e.pos+y,e.pos+o.nodeSize-y,new ne(k,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function ym(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(ke.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const VN=ym(-1),PN=ym(1);function RN(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&al(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function bm(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(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:a},$to:{pos:c}}=n.selection.ranges[s];o.setBlockType(a,c,t,e)}r(o.scrollIntoView())}return!0}}function Wl(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Wl(Fl,am,cm),Wl(Fl,um,fm),Wl(hm,pm,mm,LN),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function FN(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return jN(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function jN(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=s.resolve(e.start-2);o=new is(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new is(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=al(o,n,r,e);return a?(t&&zN(t,e,a,i,n),!0):!1}function zN(t,e,n,r,i){let o=G.empty;for(let u=n.length-1;u>=0;u--)o=G.from(n[u].type.create(n[u].attrs,o));t.step(new Xe(e.start-(r?2:0),e.end,e.start,e.end,new ne(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,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&&Cn(t.doc,c,a)&&(t.split(c,a),c+=2*a),c+=d.child(u).nodeSize;return t}function HN(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?WN(e,n,t,o):UN(e,n,o):!0:!1}}function WN(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Xe(o-1,s,o,s,new ne(G.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new is(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Qr(r);if(a==null)return!1;i.lift(r,a);let c=i.mapping.map(o,-1)-1;return Yn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function UN(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,c=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(a?0:1),u+1,s.content.append(c?G.empty:G.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Xe(f-(a?1:0),h+(c?1:0),f+1,h-1,new ne((a?G.empty:G.from(i.copy(G.empty))).append(c?G.empty:G.from(i.copy(G.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function YN(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,c=a.child(s-1);if(c.type!=t)return!1;if(n){let d=c.lastChild&&c.lastChild.type==a.type,u=G.from(d?t.create():null),f=new ne(G.from(t.create(null,G.from(a.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Xe(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function Cs(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 Ss{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,c])=>[a,(...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,a=[],c=!!e,d=e||o.tr,u=()=>(!c&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),a.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...g)=>{const y=this.buildProps(d,n),k=p(...g)(y);return a.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,a={tr:e,editor:i,view:s,state:Cs({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)(a)]))}};return a}}class qN{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}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function ae(t,e,n){return t.config[e]===void 0&&t.parent?ae(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ae(t.parent,e,n):null}):t.config[e]}function _s(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function km(t){const e=[],{nodeExtensions:n,markExtensions:r}=_s(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},c=ae(s,"addGlobalAttributes",a);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 a={name:s.name,options:s.options,storage:s.storage},c=ae(s,"addAttributes",a);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 Qe(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 Fe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?String(o).split(" "):[],c=r[i]?r[i].split(" "):[],d=a.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else if(i==="style"){const a=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],d=new Map;c.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),a.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),r[i]=Array.from(d.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function Ul(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Fe(n,r),{})}function vm(t){return typeof t=="function"}function Ce(t,e=void 0,...n){return vm(t)?e?t.bind(e)(...n):t(...n):t}function KN(t={}){return Object.keys(t).length===0&&t.constructor===Object}function GN(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function wm(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):GN(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function xm(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&KN(n)?!1:n!=null))}function JN(t,e){var n;const r=km(t),{nodeExtensions:i,markExtensions:o}=_s(t),s=(n=i.find(d=>ae(d,"topNode")))===null||n===void 0?void 0:n.name,a=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,x)=>{const w=ae(x,"extendNodeSchema",f);return{...k,...w?w(d):{}}},{}),p=xm({...h,content:Ce(ae(d,"content",f)),marks:Ce(ae(d,"marks",f)),group:Ce(ae(d,"group",f)),inline:Ce(ae(d,"inline",f)),atom:Ce(ae(d,"atom",f)),selectable:Ce(ae(d,"selectable",f)),draggable:Ce(ae(d,"draggable",f)),code:Ce(ae(d,"code",f)),whitespace:Ce(ae(d,"whitespace",f)),linebreakReplacement:Ce(ae(d,"linebreakReplacement",f)),defining:Ce(ae(d,"defining",f)),isolating:Ce(ae(d,"isolating",f)),attrs:Object.fromEntries(u.map(k=>{var x;return[k.name,{default:(x=k==null?void 0:k.attribute)===null||x===void 0?void 0:x.default}]}))}),m=Ce(ae(d,"parseHTML",f));m&&(p.parseDOM=m.map(k=>wm(k,u)));const g=ae(d,"renderHTML",f);g&&(p.toDOM=k=>g({node:k,HTMLAttributes:Ul(k,u)}));const y=ae(d,"renderText",f);return y&&(p.toText=y),[d.name,p]})),c=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,k)=>{const x=ae(k,"extendMarkSchema",f);return{...y,...x?x(d):{}}},{}),p=xm({...h,inclusive:Ce(ae(d,"inclusive",f)),excludes:Ce(ae(d,"excludes",f)),group:Ce(ae(d,"group",f)),spanning:Ce(ae(d,"spanning",f)),code:Ce(ae(d,"code",f)),attrs:Object.fromEntries(u.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),m=Ce(ae(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>wm(y,u)));const g=ae(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:Ul(y,u)})),[d.name,p]}));return new hh({topNode:s,nodes:a,marks:c})}function Yl(t,e){return e.nodes[t]||e.marks[t]||null}function Em(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function ql(t,e){const n=kr.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const ZN=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{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:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function Kl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Os{constructor(e){this.find=e.find,this.handler=e.handler}}const XN=(t,e)=>{if(Kl(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 Ts(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=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=ZN(d)+o;return s.forEach(h=>{if(u)return;const p=XN(f,h.find);if(!p)return;const m=c.state.tr,g=Cs({state:c.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:k,chain:x,can:w}=new Ss({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:k,chain:x,can:w})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function QN(t){const{editor:e,rules:n}=t,r=new it({state:{init(){return null},apply(i,o,s){const a=i.getMeta(r);if(a)return a;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=ql(G.from(u),s.schema);const{from:f}=c,h=f+u.length;Ts({editor:e,from:f,to:h,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return Ts({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ts({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?Ts({editor:e,from:s.pos,to:s.pos,text:`
|
|
37
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
38
|
-
|
|
39
|
-
`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(a+=o);const p=s==null?void 0:s[c.type.name];if(p)return u&&(a+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(a+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),a}function Sm(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const lM=qe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new it({key:new Bt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),c=Sm(n);return Cm(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),cM=()=>({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),dM=(t=!1)=>({commands:e})=>e.setContent("",t),uM=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,c)=>{if(a.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+a.nodeSize)),p=f.blockRange(h);if(!p)return;const m=Qr(p);if(a.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},fM=t=>e=>t(e),hM=()=>({state:t,dispatch:e})=>pm(t,e),pM=(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 ke(r.doc.resolve(s-1))),!0},mM=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),c=i.after(o);t.delete(a,c).scrollIntoView()}return!0}return!1},gM=t=>({tr:e,state:n,dispatch:r})=>{const i=Qe(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},yM=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},bM=()=>({state:t,dispatch:e})=>Fl(t,e),kM=()=>({commands:t})=>t.keyboardShortcut("Enter"),vM=()=>({state:t,dispatch:e})=>DN(t,e);function Ds(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Kl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function _m(t,e,n={}){return t.find(r=>r.type===e&&Ds(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Om(t,e,n={}){return!!_m(t,e,n)}function Gl(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!_m([...i.node.marks],e,n)))return;let s=i.index,a=t.start()+i.offset,c=s+1,d=a+i.node.nodeSize;for(;s>0&&Om([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;c<t.parent.childCount&&Om([...t.parent.child(c).marks],e,n);)d+=t.parent.child(c).nodeSize,c+=1;return{from:a,to:d}}function nr(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 wM=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=nr(t,r.schema),{doc:s,selection:a}=n,{$from:c,from:d,to:u}=a;if(i){const f=Gl(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=ke.create(s,f.from,f.to);n.setSelection(h)}}return!0},xM=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 Jl(t){return t instanceof ke}function Nn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Tm(t,e=null){if(!e)return null;const n=xe.atStart(t),r=xe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?ke.create(t,Nn(0,i,o),Nn(t.content.size,i,o)):ke.create(t,Nn(e,i,o),Nn(e,i,o))}function EM(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Zl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const CM=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Zl()||EM())&&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&&!Jl(n.state.selection))return s(),!0;const a=Tm(i.doc,t)||n.state.selection,c=n.state.selection.eq(a);return o&&(c||i.setSelection(a),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},SM=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),_M=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Nm=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&&Nm(r)}return t};function $s(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Nm(n)}function Ls(t,e,n){if(t instanceof zn||t instanceof G)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return G.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Ls("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const c=new hh({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Hn.fromSchema(c).parseSlice($s(t),n.parseOptions):Hn.fromSchema(c).parse($s(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Hn.fromSchema(e);return n.slice?o.parseSlice($s(t),n.parseOptions).content:o.parse($s(t),n.parseOptions)}return Ls("",e,n)}function OM(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ze||i instanceof Xe))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,c,d,u)=>{s===0&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const TM=t=>!("type"in t),NM=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=Ls(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,f=!0;if((TM(a)?a:[a]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),c===d&&f){const{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,d+=1)}let p;if(u){if(Array.isArray(e))p=e.map(m=>m.text||"").join("");else if(e instanceof G){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),p=m}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,c,d)}else p=a,r.replaceWith(c,d,p);n.updateSelection&&OM(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},MM=()=>({state:t,dispatch:e})=>NN(t,e),AM=()=>({state:t,dispatch:e})=>MN(t,e),DM=()=>({state:t,dispatch:e})=>am(t,e),$M=()=>({state:t,dispatch:e})=>um(t,e),LM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fs(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},BM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fs(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},IM=()=>({state:t,dispatch:e})=>ON(t,e),VM=()=>({state:t,dispatch:e})=>TN(t,e);function Mm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function PM(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){const c=e[a];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))Zl()||Mm()?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 RM=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=PM(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ao(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Qe(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);a.push({node:f,from:p,to:m})});const c=i-r,d=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>Ds(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const FM=(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return ao(n,i,e)?AN(n,r):!1},jM=()=>({state:t,dispatch:e})=>mm(t,e),zM=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return HN(r)(e,n)},HM=()=>({state:t,dispatch:e})=>hm(t,e);function Bs(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Am(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 WM=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Bs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Qe(t,r.schema)),a==="mark"&&(s=nr(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,Am(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Am(f.attrs,e)))})})}),!0):!1},UM=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),YM=()=>({tr:t,dispatch:e})=>{if(e){const n=new Lt(t.doc);t.setSelection(n)}return!0},qM=()=>({state:t,dispatch:e})=>cm(t,e),KM=()=>({state:t,dispatch:e})=>fm(t,e),GM=()=>({state:t,dispatch:e})=>BN(t,e),JM=()=>({state:t,dispatch:e})=>PN(t,e),ZM=()=>({state:t,dispatch:e})=>VN(t,e);function Xl(t,e,n={},r={}){return Ls(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const XM=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var c,d;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const f=Xl(t,i.schema,n,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function Is(t,e){const n=nr(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 a=s.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function QM(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 eA(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 Ql(t){return e=>eA(e.$from,t)}function tA(t,e){const n={from:0,to:t.content.size};return Cm(t,n,e)}function nA(t,e){const n=Qe(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function rA(t,e){const n=Bs(typeof e=="string"?e:e.name,t.schema);return n==="node"?nA(t,e):n==="mark"?Is(t,e):{}}function Dm(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Gl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Vs(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 ec(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?nr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ds(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const k=Math.max(p,y),x=Math.min(m,y+g.nodeSize),w=x-k;s+=w,a.push(...g.marks.map(b=>({mark:b,from:k,to:x})))})}),s===0)return!1;const c=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ds(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(c>0?c+d:c)>=s}function iA(t,e,n={}){if(!e)return ao(t,null,n)||ec(t,null,n);const r=Bs(e,t.schema);return r==="node"?ao(t,e,n):r==="mark"?ec(t,e,n):!1}function $m(t,e){const{nodeExtensions:n}=_s(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ce(ae(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function tc(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(tc(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function oA(t){return t instanceof pe}function Lm(t,e,n){const i=t.state.doc.content.size,o=Nn(e,0,i),s=Nn(n,0,i),a=t.coordsAtPos(o),c=t.coordsAtPos(s,-1),d=Math.min(a.top,c.top),u=Math.max(a.bottom,c.bottom),f=Math.min(a.left,c.left),h=Math.max(a.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 sA(t,e,n){var r;const{selection:i}=e;let o=null;if(Jl(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(c=>c.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:c})=>{let d=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.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(g=>g.type.excludes(n));d=p&&m}return!d}),d})}const aA=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,c=nr(t,r.schema);if(i)if(s){const d=Is(r,c);n.addStoredMark(c.create({...d,...e}))}else a.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),g=Math.min(p+h.nodeSize,f);h.marks.find(k=>k.type===c)?h.marks.forEach(k=>{c===k.type&&n.addMark(m,g,c.create({...k.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return sA(r,n,c)},lA=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),cA=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Qe(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>bm(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>bm(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},dA=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Nn(t,0,r.content.size),o=pe.create(r,i);e.setSelection(o)}return!0},uA=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ke.atStart(r).from,a=ke.atEnd(r).to,c=Nn(i,s,a),d=Nn(o,s,a),u=ke.create(r,c,d);e.setSelection(u)}return!0},fA=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return YN(r)(e,n)};function Bm(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 hA=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:c}=o,d=i.extensionManager.attributes,u=Vs(d,a.node().type.name,a.node().attrs);if(o instanceof pe&&o.node.isBlock)return!a.parentOffset||!Cn(s,a.pos)?!1:(r&&(t&&Bm(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,h=a.depth===0?void 0:QM(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Cn(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&Cn(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),r){if(m&&(o instanceof ke&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),h&&!f&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Bm(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},pA=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=Qe(t,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const f=c.node(-1);if(f.type!==a)return!1;const h=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let k=G.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let D=c.depth-x;D>=c.depth-3;D-=1)k=G.from(c.node(D).copy(k));const w=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,b={...Vs(h,c.node().type.name,c.node().attrs),...e},C=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;k=k.append(G.from(a.createAndFill(null,C)||void 0));const v=c.before(c.depth-(x-1));n.replace(v,c.after(-w),new ne(k,4-x,0));let S=-1;n.doc.nodesBetween(v,n.doc.content.size,(D,O)=>{if(S>-1)return!1;D.isTextblock&&D.content.size===0&&(S=O+1)}),S>-1&&n.setSelection(ke.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Vs(h,f.type.name,f.attrs),...e},g={...Vs(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const y=p?[{type:a,attrs:m},{type:p,attrs:g}]:[{type:a,attrs:m}];if(!Cn(n.doc,c.pos,2))return!1;if(i){const{selection:k,storedMarks:x}=r,{splittableMarks:w}=o.extensionManager,b=x||k.$to.parentOffset&&k.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!b||!i)return!0;const C=b.filter(v=>w.includes(v.type.name));n.ensureMarks(C)}return!0},nc=(t,e)=>{const n=Ql(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)&&Yn(t.doc,n.pos)&&t.join(n.pos),!0},rc=(t,e)=>{const n=Ql(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)&&Yn(t.doc,r)&&t.join(r),!0};var mA=Object.freeze({__proto__:null,blur:cM,clearContent:dM,clearNodes:uM,command:fM,createParagraphNear:hM,cut:pM,deleteCurrentNode:mM,deleteNode:gM,deleteRange:yM,deleteSelection:bM,enter:kM,exitCode:vM,extendMarkRange:wM,first:xM,focus:CM,forEach:SM,insertContent:_M,insertContentAt:NM,joinBackward:DM,joinDown:AM,joinForward:$M,joinItemBackward:LM,joinItemForward:BM,joinTextblockBackward:IM,joinTextblockForward:VM,joinUp:MM,keyboardShortcut:RM,lift:FM,liftEmptyBlock:jM,liftListItem:zM,newlineInCode:HM,resetAttributes:WM,scrollIntoView:UM,selectAll:YM,selectNodeBackward:qM,selectNodeForward:KM,selectParentNode:GM,selectTextblockEnd:JM,selectTextblockStart:ZM,setContent:XM,setMark:aA,setMeta:lA,setNode:cA,setNodeSelection:dA,setTextSelection:uA,sinkListItem:fA,splitBlock:hA,splitListItem:pA,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Qe(t,s.schema),m=Qe(e,s.schema),{selection:g,storedMarks:y}=s,{$from:k,$to:x}=g,w=k.blockRange(x),b=y||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const C=Ql(v=>$m(v.type.name,f))(g);if(w.depth>=1&&C&&w.depth-C.depth<=1){if(C.node.type===p)return d.liftListItem(m);if($m(C.node.type.name,f)&&p.validContent(C.node.content)&&a)return c().command(()=>(o.setNodeMarkup(C.pos,p),!0)).command(()=>nc(o,p)).command(()=>rc(o,p)).run()}return!n||!b||!a?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>nc(o,p)).command(()=>rc(o,p)).run():c().command(()=>{const v=u().wrapInList(p,r),S=b.filter(D=>h.includes(D.type.name));return o.ensureMarks(S),v?!0:d.clearNodes()}).wrapInList(p,r).command(()=>nc(o,p)).command(()=>rc(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=nr(t,r.schema);return ec(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Qe(t,r.schema),s=Qe(e,r.schema),a=ao(r,o,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),a?i.setNode(s,c):i.setNode(o,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Qe(t,n.schema);return ao(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let c=a.steps.length-1;c>=0;c-=1)s.step(a.steps[c].invert(a.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:a}=n,c=nr(t,r.schema),{$from:d,empty:u,ranges:f}=a;if(!i)return!0;if(u&&s){let{from:h,to:p}=a;const m=(o=d.marks().find(y=>y.type===c))===null||o===void 0?void 0:o.attrs,g=Gl(d,c,m);g&&(h=g.from,p=g.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 a=Bs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Qe(t,r.schema)),a==="mark"&&(s=nr(t,r.schema)),i&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let f,h,p,m;n.selection.empty?r.doc.nodesBetween(d,u,(g,y)=>{o&&o===g.type&&(p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),f=y,h=g)}):r.doc.nodesBetween(d,u,(g,y)=>{y<d&&o&&o===g.type&&(p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),f=y,h=g),y>=d&&y<=u&&(o&&o===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(k=>{if(s===k.type){const x=Math.max(y,d),w=Math.min(y+g.nodeSize,u);n.addMark(x,w,s.create({...k.attrs,...e}))}}))}),h&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&n.addMark(p,m,s.create({...g.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return RN(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return FN(i,e)(n,r)}});const gA=qe.create({name:"commands",addCommands(){return{...mA}}}),yA=qe.create({name:"drop",addProseMirrorPlugins(){return[new it({key:new Bt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),bA=qe.create({name:"editable",addProseMirrorPlugins(){return[new it({key:new Bt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),kA=qe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new it({key:new Bt("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}}}})]}}),vA=qe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:c,doc:d}=a,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?a.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,k=g&&m.parent.childCount===1?y===f.pos:xe.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 Zl()||Mm()?o:i},addProseMirrorPlugins(){return[new it({key:new Bt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:a}=e.selection,c=xe.atStart(e.doc).from,d=xe.atEnd(e.doc).to;if(o||!(s===c&&a===d)||!tc(n.doc))return;const h=n.tr,p=Cs({state:n,transaction:h}),{commands:m}=new Ss({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),wA=qe.create({name:"paste",addProseMirrorPlugins(){return[new it({key:new Bt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),xA=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new it({key:new Bt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Or{get name(){return this.node.type.name}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 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 Or(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 Or(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 Or(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),a=this.resolvedPos.doc.resolve(s);if(!i&&a.depth<=this.depth)return;const c=new Or(a,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new Or(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const c=s[a];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{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const EA=`.ProseMirror {
|
|
27
|
+
*/const Xb="9.14.4";function Qb(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(vn().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(vn().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(vn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vn().__INTLIFY_PROD_DEVTOOLS__=!1)}const Du=gt.__EXTEND_POINT__,En=Lo(Du),Ct={FALLBACK_TO_ROOT:Du,NOT_SUPPORTED_PRESERVE:En(),NOT_SUPPORTED_FORMATTER:En(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:En(),NOT_SUPPORTED_GET_CHOICE_INDEX:En(),COMPONENT_NAME_LEGACY_COMPATIBLE:En(),NOT_FOUND_PARENT_SCOPE:En(),IGNORE_OBJ_FLATTEN:En(),NOTICE_DROP_ALLOW_COMPOSITION:En(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:En()},ek={[Ct.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[Ct.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[Ct.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[Ct.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[Ct.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[Ct.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[Ct.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[Ct.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[Ct.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[Ct.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ho(t,...e){return ka(ek[t],...e)}const $u=Je.__EXTEND_POINT__,St=Lo($u),Re={UNEXPECTED_RETURN_TYPE:$u,INVALID_ARGUMENT:St(),MUST_BE_CALL_SETUP_TOP:St(),NOT_INSTALLED:St(),NOT_AVAILABLE_IN_LEGACY_MODE:St(),REQUIRED_VALUE:St(),INVALID_VALUE:St(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:St(),NOT_INSTALLED_WITH_PROVIDE:St(),UNEXPECTED_ERROR:St(),NOT_COMPATIBLE_LEGACY_VUE_I18N:St(),BRIDGE_SUPPORT_VUE_2_ONLY:St(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:St(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:St(),__EXTEND_POINT__:St()};function Fn(t,...e){return jr(t,null,process.env.NODE_ENV!=="production"?{messages:tk,args:e}:void 0)}const tk={[Re.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Re.INVALID_ARGUMENT]:"Invalid argument",[Re.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Re.NOT_INSTALLED]:"Need to install with `app.use` function",[Re.UNEXPECTED_ERROR]:"Unexpected error",[Re.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[Re.REQUIRED_VALUE]:"Required in value: {0}",[Re.INVALID_VALUE]:"Invalid value",[Re.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Re.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Re.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Re.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},Aa=kn("__translateVNode"),Da=kn("__datetimeParts"),$a=kn("__numberParts"),La=kn("__enableEmitter"),Ba=kn("__disableEmitter"),nk=kn("__setPluralRules"),Lu=kn("__injectWithOption"),Ia=kn("__dispose");function Vi(t){if(!Te(t)||Qt(t))return t;for(const e in t)if(Zt(t,e))if(!e.includes("."))Te(t[e])&&Vi(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,o=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in i||(i[n[s]]=$e()),!Te(i[n[s]])){process.env.NODE_ENV!=="production"&&wn(Ho(Ct.IGNORE_OBJ_FLATTEN,{key:n[s]})),o=!0;break}i=i[n[s]]}if(o||(Qt(i)?Jd.includes(n[r])||delete t[e]:(i[n[r]]=t[e],delete t[e])),!Qt(i)){const s=i[n[r]];Te(s)&&Vi(s)}}return t}function Va(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:o}=e,s=Se(n)?n:We(r)?$e():{[t]:$e()};if(We(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:c,resource:d}=a;c?(s[c]=s[c]||$e(),Io(d,s[c])):Io(d,s)}else oe(a)&&Io(JSON.parse(a),s)}),i==null&&o)for(const a in s)Zt(s,a)&&Vi(s[a]);return s}function Bu(t){return t.type}function rk(t,e,n){let r=Te(e.messages)?e.messages:$e();"__i18nGlobal"in n&&(r=Va(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(o=>{t.mergeLocaleMessage(o,r[o])});{if(Te(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(Te(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function Iu(t){return l.createVNode(l.Text,null,t,0)}const Vu="__INTLIFY_META__",Pu=()=>[],ik=()=>!1;let Ru=0;function Fu(t){return(e,n,r,i)=>t(n,r,l.getCurrentInstance()||void 0,i)}const ok=()=>{const t=l.getCurrentInstance();let e=null;return t&&(e=Bu(t)[Vu])?{[Vu]:e}:null};function sk(t={},e){const{__root:n,__injectWithOption:r}=t,i=n===void 0,o=t.flatJson,s=bn?l.ref:l.shallowRef,a=!!t.translateExistCompatible;process.env.NODE_ENV!=="production"&&a&&Ld(Ho(Ct.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let c=Le(t.inheritLocale)?t.inheritLocale:!0;const d=s(n&&c?n.locale.value:oe(t.locale)?t.locale:Bi),u=s(n&&c?n.fallbackLocale.value:oe(t.fallbackLocale)||We(t.fallbackLocale)||Se(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:d.value),f=s(Va(d.value,t)),h=s(Se(t.datetimeFormats)?t.datetimeFormats:{[d.value]:{}}),p=s(Se(t.numberFormats)?t.numberFormats:{[d.value]:{}});let m=n?n.missingWarn:Le(t.missingWarn)||Fr(t.missingWarn)?t.missingWarn:!0,g=n?n.fallbackWarn:Le(t.fallbackWarn)||Fr(t.fallbackWarn)?t.fallbackWarn:!0,y=n?n.fallbackRoot:Le(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,x=Ve(t.missing)?t.missing:null,v=Ve(t.missing)?Fu(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,C=n?n.warnHtmlMessage:Le(t.warnHtmlMessage)?t.warnHtmlMessage:!0,w=!!t.escapeParameter;const N=n?n.modifiers:Se(t.modifiers)?t.modifiers:{};let L=t.pluralRules||n&&n.pluralRules,S;S=(()=>{i&&uu(null);const R={version:Xb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:N,pluralRules:L,missing:v===null?void 0:v,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:C,escapeParameter:w,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};R.datetimeFormats=h.value,R.numberFormats=p.value,R.__datetimeFormatters=Se(S)?S.__datetimeFormatters:void 0,R.__numberFormatters=Se(S)?S.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(R.__v_emitter=Se(S)?S.__v_emitter:void 0);const Z=jb(R);return i&&uu(Z),Z})(),Ii(S,d.value,u.value);function F(){return[d.value,u.value,f.value,h.value,p.value]}const $=l.computed({get:()=>d.value,set:R=>{d.value=R,S.locale=d.value}}),U=l.computed({get:()=>u.value,set:R=>{u.value=R,S.fallbackLocale=u.value,Ii(S,d.value,R)}}),z=l.computed(()=>f.value),I=l.computed(()=>h.value),_=l.computed(()=>p.value);function P(){return Ve(b)?b:null}function V(R){b=R,S.postTranslation=R}function ee(){return x}function ie(R){R!==null&&(v=Fu(R)),x=R,S.missing=v}function he(R,Z){return R!=="translate"||!Z.resolvedMessage}const ue=(R,Z,T,A,Y,te)=>{F();let de;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=n?Fb():void 0),de=R(S)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=void 0)}if(T!=="translate exists"&&Ge(de)&&de===Fo||T==="translate exists"&&!de){const[M,X]=Z();if(process.env.NODE_ENV!=="production"&&n&&oe(M)&&he(T,X)&&(y&&(zo(g,M)||hu(m,M))&&wn(Ho(Ct.FALLBACK_TO_ROOT,{key:M,type:T})),process.env.NODE_ENV!=="production")){const{__v_emitter:re}=S;re&&y&&re.emit("fallback",{type:T,key:M,to:"global",groupId:`${T}:${M}`})}return n&&y?A(n):Y(M)}else{if(te(de))return de;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function B(...R){return ue(Z=>Reflect.apply(wu,null,[Z,...R]),()=>Ta(...R),"translate",Z=>Reflect.apply(Z.t,Z,[...R]),Z=>Z,Z=>oe(Z))}function H(...R){const[Z,T,A]=R;if(A&&!Te(A))throw Fn(Re.INVALID_ARGUMENT);return B(Z,T,ct({resolvedMessage:!0},A||{}))}function K(...R){return ue(Z=>Reflect.apply(_u,null,[Z,...R]),()=>Na(...R),"datetime format",Z=>Reflect.apply(Z.d,Z,[...R]),()=>jo,Z=>oe(Z))}function q(...R){return ue(Z=>Reflect.apply(Nu,null,[Z,...R]),()=>Ma(...R),"number format",Z=>Reflect.apply(Z.n,Z,[...R]),()=>jo,Z=>oe(Z))}function j(R){return R.map(Z=>oe(Z)||Ge(Z)||Le(Z)?Iu(String(Z)):Z)}const le={normalize:j,interpolate:R=>R,type:"vnode"};function ve(...R){return ue(Z=>{let T;const A=Z;try{A.processor=le,T=Reflect.apply(wu,null,[A,...R])}finally{A.processor=null}return T},()=>Ta(...R),"translate",Z=>Z[Aa](...R),Z=>[Iu(Z)],Z=>We(Z))}function Ne(...R){return ue(Z=>Reflect.apply(Nu,null,[Z,...R]),()=>Ma(...R),"number format",Z=>Z[$a](...R),Pu,Z=>oe(Z)||We(Z))}function Ie(...R){return ue(Z=>Reflect.apply(_u,null,[Z,...R]),()=>Na(...R),"datetime format",Z=>Z[Da](...R),Pu,Z=>oe(Z)||We(Z))}function tt(R){L=R,S.pluralRules=L}function Q(R,Z){return ue(()=>{if(!R)return!1;const T=oe(Z)?Z:d.value,A=at(T),Y=S.messageResolver(A,R);return a?Y!=null:Qt(Y)||Ft(Y)||oe(Y)},()=>[R],"translate exists",T=>Reflect.apply(T.te,T,[R,Z]),ik,T=>Le(T))}function Ee(R){let Z=null;const T=nu(S,u.value,d.value);for(let A=0;A<T.length;A++){const Y=f.value[T[A]]||{},te=S.messageResolver(Y,R);if(te!=null){Z=te;break}}return Z}function Mt(R){const Z=Ee(R);return Z??(n?n.tm(R)||{}:{})}function at(R){return f.value[R]||{}}function lt(R,Z){if(o){const T={[R]:Z};for(const A in T)Zt(T,A)&&Vi(T[A]);Z=T[R]}f.value[R]=Z,S.messages=f.value}function ht(R,Z){f.value[R]=f.value[R]||{};const T={[R]:Z};if(o)for(const A in T)Zt(T,A)&&Vi(T[A]);Z=T[R],Io(Z,f.value[R]),S.messages=f.value}function E(R){return h.value[R]||{}}function O(R,Z){h.value[R]=Z,S.datetimeFormats=h.value,Tu(S,R,Z)}function W(R,Z){h.value[R]=ct(h.value[R]||{},Z),S.datetimeFormats=h.value,Tu(S,R,Z)}function se(R){return p.value[R]||{}}function Me(R,Z){p.value[R]=Z,S.numberFormats=p.value,Au(S,R,Z)}function _e(R,Z){p.value[R]=ct(p.value[R]||{},Z),S.numberFormats=p.value,Au(S,R,Z)}Ru++,n&&bn&&(l.watch(n.locale,R=>{c&&(d.value=R,S.locale=R,Ii(S,d.value,u.value))}),l.watch(n.fallbackLocale,R=>{c&&(u.value=R,S.fallbackLocale=R,Ii(S,d.value,u.value))}));const Oe={id:Ru,locale:$,fallbackLocale:U,get inheritLocale(){return c},set inheritLocale(R){c=R,R&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ii(S,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:z,get modifiers(){return N},get pluralRules(){return L||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(R){m=R,S.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(R){g=R,S.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(R){y=R},get fallbackFormat(){return k},set fallbackFormat(R){k=R,S.fallbackFormat=k},get warnHtmlMessage(){return C},set warnHtmlMessage(R){C=R,S.warnHtmlMessage=R},get escapeParameter(){return w},set escapeParameter(R){w=R,S.escapeParameter=R},t:B,getLocaleMessage:at,setLocaleMessage:lt,mergeLocaleMessage:ht,getPostTranslationHandler:P,setPostTranslationHandler:V,getMissingHandler:ee,setMissingHandler:ie,[nk]:tt};return Oe.datetimeFormats=I,Oe.numberFormats=_,Oe.rt=H,Oe.te=Q,Oe.tm=Mt,Oe.d=K,Oe.n=q,Oe.getDateTimeFormat=E,Oe.setDateTimeFormat=O,Oe.mergeDateTimeFormat=W,Oe.getNumberFormat=se,Oe.setNumberFormat=Me,Oe.mergeNumberFormat=_e,Oe[Lu]=r,Oe[Aa]=ve,Oe[Da]=Ie,Oe[$a]=Ne,process.env.NODE_ENV!=="production"&&(Oe[La]=R=>{S.__v_emitter=R},Oe[Ba]=()=>{S.__v_emitter=void 0}),Oe}const Pa={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function ak({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===l.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},$e())}function ju(t){return l.Fragment}ct({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Ge(t)||!isNaN(t)}},Pa);function lk(t){return We(t)&&!oe(t[0])}function zu(t,e,n,r){const{slots:i,attrs:o}=e;return()=>{const s={part:!0};let a=$e();t.locale&&(s.locale=t.locale),oe(t.format)?s.key=t.format:Te(t.format)&&(oe(t.format.key)&&(s.key=t.format.key),a=Object.keys(t.format).reduce((h,p)=>n.includes(p)?ct($e(),h,{[p]:t.format[p]}):h,$e()));const c=r(t.value,s,a);let d=[s.key];We(c)?d=c.map((h,p)=>{const m=i[h.type],g=m?m({[h.type]:h.value,index:p,parts:c}):[h.value];return lk(g)&&(g[0].key=`${h.type}-${p}`),g}):oe(c)&&(d=[c]);const u=ct($e(),o),f=oe(t.tag)||Te(t.tag)?t.tag:ju();return l.h(f,u,d)}}ct({value:{type:Number,required:!0},format:{type:[String,Object]}},Pa),ct({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Pa);function Hu(t,e){}const ck=kn("global-vue-i18n");function jn(t={}){const e=l.getCurrentInstance();if(e==null)throw Fn(Re.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Fn(Re.NOT_INSTALLED);const n=dk(e),r=fk(n),i=Bu(e),o=uk(t,i);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!t.__useComponent){if(!n.allowComposition)throw Fn(Re.NOT_AVAILABLE_IN_LEGACY_MODE);return gk(e,o,r,t)}if(o==="global")return rk(r,t,i),r;if(o==="parent"){let c=hk(n,e,t.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&wn(Ho(Ct.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=n;let a=s.__getInstance(e);if(a==null){const c=ct({},t);"__i18n"in i&&(c.__i18n=i.__i18n),r&&(c.__root=r),a=sk(c),s.__composerExtend&&(a[Ia]=s.__composerExtend(a)),mk(s,e,a),s.__setInstance(e,a)}return a}function dk(t){{const e=l.inject(t.isCE?ck:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Fn(t.isCE?Re.NOT_INSTALLED_WITH_PROVIDE:Re.UNEXPECTED_ERROR);return e}}function uk(t,e){return $o(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function fk(t){return t.mode==="composition"?t.global:t.global.__composer}function hk(t,e,n=!1){let r=null;const i=e.root;let o=pk(e,n);for(;o!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const a=s.__getInstance(o);a!=null&&(r=a.__composer,n&&r&&!r[Lu]&&(r=null))}if(r!=null||i===o)break;o=o.parent}return r}function pk(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function mk(t,e,n){let r=null;l.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=E1();const i=n;i[La]&&i[La](r),r.on("*",Hu)}},e),l.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",Hu),i[Ba]&&i[Ba](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const o=i[Ia];o&&(o(),delete i[Ia])},e)}function gk(t,e,n,r={}){const i=e==="local",o=l.shallowRef(null);if(i&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw Fn(Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const s=Le(r.inheritLocale)?r.inheritLocale:!oe(r.locale),a=l.ref(!i||s?n.locale.value:oe(r.locale)?r.locale:Bi),c=l.ref(!i||s?n.fallbackLocale.value:oe(r.fallbackLocale)||We(r.fallbackLocale)||Se(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:a.value),d=l.ref(Va(a.value,r)),u=l.ref(Se(r.datetimeFormats)?r.datetimeFormats:{[a.value]:{}}),f=l.ref(Se(r.numberFormats)?r.numberFormats:{[a.value]:{}}),h=i?n.missingWarn:Le(r.missingWarn)||Fr(r.missingWarn)?r.missingWarn:!0,p=i?n.fallbackWarn:Le(r.fallbackWarn)||Fr(r.fallbackWarn)?r.fallbackWarn:!0,m=i?n.fallbackRoot:Le(r.fallbackRoot)?r.fallbackRoot:!0,g=!!r.fallbackFormat,y=Ve(r.missing)?r.missing:null,k=Ve(r.postTranslation)?r.postTranslation:null,x=i?n.warnHtmlMessage:Le(r.warnHtmlMessage)?r.warnHtmlMessage:!0,v=!!r.escapeParameter,b=i?n.modifiers:Se(r.modifiers)?r.modifiers:{},C=r.pluralRules||i&&n.pluralRules;function w(){return[a.value,c.value,d.value,u.value,f.value]}const N=l.computed({get:()=>o.value?o.value.locale.value:a.value,set:Q=>{o.value&&(o.value.locale.value=Q),a.value=Q}}),L=l.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:Q=>{o.value&&(o.value.fallbackLocale.value=Q),c.value=Q}}),S=l.computed(()=>o.value?o.value.messages.value:d.value),D=l.computed(()=>u.value),F=l.computed(()=>f.value);function $(){return o.value?o.value.getPostTranslationHandler():k}function U(Q){o.value&&o.value.setPostTranslationHandler(Q)}function z(){return o.value?o.value.getMissingHandler():y}function I(Q){o.value&&o.value.setMissingHandler(Q)}function _(Q){return w(),Q()}function P(...Q){return o.value?_(()=>Reflect.apply(o.value.t,null,[...Q])):_(()=>"")}function V(...Q){return o.value?Reflect.apply(o.value.rt,null,[...Q]):""}function ee(...Q){return o.value?_(()=>Reflect.apply(o.value.d,null,[...Q])):_(()=>"")}function ie(...Q){return o.value?_(()=>Reflect.apply(o.value.n,null,[...Q])):_(()=>"")}function he(Q){return o.value?o.value.tm(Q):{}}function ue(Q,Ee){return o.value?o.value.te(Q,Ee):!1}function B(Q){return o.value?o.value.getLocaleMessage(Q):{}}function H(Q,Ee){o.value&&(o.value.setLocaleMessage(Q,Ee),d.value[Q]=Ee)}function K(Q,Ee){o.value&&o.value.mergeLocaleMessage(Q,Ee)}function q(Q){return o.value?o.value.getDateTimeFormat(Q):{}}function j(Q,Ee){o.value&&(o.value.setDateTimeFormat(Q,Ee),u.value[Q]=Ee)}function ce(Q,Ee){o.value&&o.value.mergeDateTimeFormat(Q,Ee)}function le(Q){return o.value?o.value.getNumberFormat(Q):{}}function ve(Q,Ee){o.value&&(o.value.setNumberFormat(Q,Ee),f.value[Q]=Ee)}function Ne(Q,Ee){o.value&&o.value.mergeNumberFormat(Q,Ee)}const Ie={get id(){return o.value?o.value.id:-1},locale:N,fallbackLocale:L,messages:S,datetimeFormats:D,numberFormats:F,get inheritLocale(){return o.value?o.value.inheritLocale:s},set inheritLocale(Q){o.value&&(o.value.inheritLocale=Q)},get availableLocales(){return o.value?o.value.availableLocales:Object.keys(d.value)},get modifiers(){return o.value?o.value.modifiers:b},get pluralRules(){return o.value?o.value.pluralRules:C},get isGlobal(){return o.value?o.value.isGlobal:!1},get missingWarn(){return o.value?o.value.missingWarn:h},set missingWarn(Q){o.value&&(o.value.missingWarn=Q)},get fallbackWarn(){return o.value?o.value.fallbackWarn:p},set fallbackWarn(Q){o.value&&(o.value.missingWarn=Q)},get fallbackRoot(){return o.value?o.value.fallbackRoot:m},set fallbackRoot(Q){o.value&&(o.value.fallbackRoot=Q)},get fallbackFormat(){return o.value?o.value.fallbackFormat:g},set fallbackFormat(Q){o.value&&(o.value.fallbackFormat=Q)},get warnHtmlMessage(){return o.value?o.value.warnHtmlMessage:x},set warnHtmlMessage(Q){o.value&&(o.value.warnHtmlMessage=Q)},get escapeParameter(){return o.value?o.value.escapeParameter:v},set escapeParameter(Q){o.value&&(o.value.escapeParameter=Q)},t:P,getPostTranslationHandler:$,setPostTranslationHandler:U,getMissingHandler:z,setMissingHandler:I,rt:V,d:ee,n:ie,tm:he,te:ue,getLocaleMessage:B,setLocaleMessage:H,mergeLocaleMessage:K,getDateTimeFormat:q,setDateTimeFormat:j,mergeDateTimeFormat:ce,getNumberFormat:le,setNumberFormat:ve,mergeNumberFormat:Ne};function tt(Q){Q.locale.value=a.value,Q.fallbackLocale.value=c.value,Object.keys(d.value).forEach(Ee=>{Q.mergeLocaleMessage(Ee,d.value[Ee])}),Object.keys(u.value).forEach(Ee=>{Q.mergeDateTimeFormat(Ee,u.value[Ee])}),Object.keys(f.value).forEach(Ee=>{Q.mergeNumberFormat(Ee,f.value[Ee])}),Q.escapeParameter=v,Q.fallbackFormat=g,Q.fallbackRoot=m,Q.fallbackWarn=p,Q.missingWarn=h,Q.warnHtmlMessage=x}return l.onBeforeMount(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw Fn(Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const Q=o.value=t.proxy.$i18n.__composer;e==="global"?(a.value=Q.locale.value,c.value=Q.fallbackLocale.value,d.value=Q.messages.value,u.value=Q.datetimeFormats.value,f.value=Q.numberFormats.value):i&&tt(Q)}),Ie}if(Qb(),__INTLIFY_JIT_COMPILATION__?su(Yb):su(Ub),Ib(gb),Vb(nu),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=vn();t.__INTLIFY__=!0,Sb(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const yk={},bk={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},kk=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function vk(t,e){return l.openBlock(),l.createElementBlock("svg",bk,kk)}const Wu=be(yk,[["render",vk]]),wk={},xk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Ek=[l.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 Ck(t,e){return l.openBlock(),l.createElementBlock("svg",xk,Ek)}const Ra=be(wk,[["render",Ck]]),Sk={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},_k={class:"flex items-center gap-2"},Ok={key:0},Tk={class:""},Nk={class:"flex justify-end"},Mk={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},Ak={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},Dk={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,material:Boolean,naked: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! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,a)=>(l.openBlock(),l.createElementBlock("div",null,[t.label?(l.openBlock(),l.createElementBlock("div",Sk,[l.createElementVNode("div",_k,[l.createElementVNode("span",null,l.toDisplayString(t.label),1),t.required&&!t.hideRequired?(l.openBlock(),l.createElementBlock("span",Ok,"*")):l.createCommentVNode("",!0),l.createElementVNode("div",Tk,[t.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.info),1)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])]),l.createElementVNode("div",Nk,[l.renderSlot(s.$slots,"more")])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["wpic-input overflow-auto leading-none flex relative items-center",{"border rounded-sm pr-3":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[l.unref(fe).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[l.unref(fe).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(l.openBlock(),l.createElementBlock("div",Mk,[l.createElementVNode("div",Ak,[l.renderSlot(s.$slots,"prepend")])])):l.createCommentVNode("",!0),l.renderSlot(s.$slots,"default"),t.loading?(l.openBlock(),l.createElementBlock("div",Dk,[l.createVNode(Ir,{class:"w-6 h-6 opacity-50"})])):t.clearable?(l.openBlock(),l.createElementBlock("div",{key:2,onClick:l.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"},[l.createVNode(Di,{class:"w-5 h-5 opacity-50"})])):l.createCommentVNode("",!0)],2)]))}});var sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ri(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function $k(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Wo=$k,Lk=typeof sn=="object"&&sn&&sn.Object===Object&&sn,Uu=Lk,Bk=Uu,Ik=typeof self=="object"&&self&&self.Object===Object&&self,Vk=Bk||Ik||Function("return this")(),an=Vk,Pk=an,Rk=function(){return Pk.Date.now()},Fk=Rk,jk=/\s/;function zk(t){for(var e=t.length;e--&&jk.test(t.charAt(e)););return e}var Hk=zk,Wk=Hk,Uk=/^\s+/;function Yk(t){return t&&t.slice(0,Wk(t)+1).replace(Uk,"")}var qk=Yk,Kk=an,Gk=Kk.Symbol,Fa=Gk,Yu=Fa,qu=Object.prototype,Jk=qu.hasOwnProperty,Zk=qu.toString,Fi=Yu?Yu.toStringTag:void 0;function Xk(t){var e=Jk.call(t,Fi),n=t[Fi];try{t[Fi]=void 0;var r=!0}catch{}var i=Zk.call(t);return r&&(e?t[Fi]=n:delete t[Fi]),i}var Qk=Xk,e2=Object.prototype,t2=e2.toString;function n2(t){return t2.call(t)}var r2=n2,Ku=Fa,i2=Qk,o2=r2,s2="[object Null]",a2="[object Undefined]",Gu=Ku?Ku.toStringTag:void 0;function l2(t){return t==null?t===void 0?a2:s2:Gu&&Gu in Object(t)?i2(t):o2(t)}var ji=l2;function c2(t){return t!=null&&typeof t=="object"}var zi=c2,d2=ji,u2=zi,f2="[object Symbol]";function h2(t){return typeof t=="symbol"||u2(t)&&d2(t)==f2}var p2=h2,m2=qk,Ju=Wo,g2=p2,Zu=NaN,y2=/^[-+]0x[0-9a-f]+$/i,b2=/^0b[01]+$/i,k2=/^0o[0-7]+$/i,v2=parseInt;function w2(t){if(typeof t=="number")return t;if(g2(t))return Zu;if(Ju(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ju(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=m2(t);var n=b2.test(t);return n||k2.test(t)?v2(t.slice(2),n?2:8):y2.test(t)?Zu:+t}var x2=w2,E2=Wo,ja=Fk,Xu=x2,C2="Expected a function",S2=Math.max,_2=Math.min;function O2(t,e,n){var r,i,o,s,a,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(C2);e=Xu(e)||0,E2(n)&&(u=!!n.leading,f="maxWait"in n,o=f?S2(Xu(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(w){var N=r,L=i;return r=i=void 0,d=w,s=t.apply(L,N),s}function m(w){return d=w,a=setTimeout(k,e),u?p(w):s}function g(w){var N=w-c,L=w-d,S=e-N;return f?_2(S,o-L):S}function y(w){var N=w-c,L=w-d;return c===void 0||N>=e||N<0||f&&L>=o}function k(){var w=ja();if(y(w))return x(w);a=setTimeout(k,g(w))}function x(w){return a=void 0,h&&r?p(w):(r=i=void 0,s)}function v(){a!==void 0&&clearTimeout(a),d=0,r=c=i=a=void 0}function b(){return a===void 0?s:x(ja())}function C(){var w=ja(),N=y(w);if(r=arguments,i=this,c=w,N){if(a===void 0)return m(c);if(f)return clearTimeout(a),a=setTimeout(k,e),p(c)}return a===void 0&&(a=setTimeout(k,e)),s}return C.cancel=v,C.flush=b,C}var T2=O2;const Qu=Ri(T2);function N2(){this.__data__=[],this.size=0}var M2=N2;function A2(t,e){return t===e||t!==t&&e!==e}var ef=A2,D2=ef;function $2(t,e){for(var n=t.length;n--;)if(D2(t[n][0],e))return n;return-1}var Uo=$2,L2=Uo,B2=Array.prototype,I2=B2.splice;function V2(t){var e=this.__data__,n=L2(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():I2.call(e,n,1),--this.size,!0}var P2=V2,R2=Uo;function F2(t){var e=this.__data__,n=R2(e,t);return n<0?void 0:e[n][1]}var j2=F2,z2=Uo;function H2(t){return z2(this.__data__,t)>-1}var W2=H2,U2=Uo;function Y2(t,e){var n=this.__data__,r=U2(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var q2=Y2,K2=M2,G2=P2,J2=j2,Z2=W2,X2=q2;function Ur(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])}}Ur.prototype.clear=K2,Ur.prototype.delete=G2,Ur.prototype.get=J2,Ur.prototype.has=Z2,Ur.prototype.set=X2;var Yo=Ur,Q2=Yo;function ev(){this.__data__=new Q2,this.size=0}var tv=ev;function nv(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var rv=nv;function iv(t){return this.__data__.get(t)}var ov=iv;function sv(t){return this.__data__.has(t)}var av=sv,lv=ji,cv=Wo,dv="[object AsyncFunction]",uv="[object Function]",fv="[object GeneratorFunction]",hv="[object Proxy]";function pv(t){if(!cv(t))return!1;var e=lv(t);return e==uv||e==fv||e==dv||e==hv}var tf=pv,mv=an,gv=mv["__core-js_shared__"],yv=gv,za=yv,nf=function(){var t=/[^.]+$/.exec(za&&za.keys&&za.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function bv(t){return!!nf&&nf in t}var kv=bv,vv=Function.prototype,wv=vv.toString;function xv(t){if(t!=null){try{return wv.call(t)}catch{}try{return t+""}catch{}}return""}var rf=xv,Ev=tf,Cv=kv,Sv=Wo,_v=rf,Ov=/[\\^$.*+?()[\]{}|]/g,Tv=/^\[object .+?Constructor\]$/,Nv=Function.prototype,Mv=Object.prototype,Av=Nv.toString,Dv=Mv.hasOwnProperty,$v=RegExp("^"+Av.call(Dv).replace(Ov,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Lv(t){if(!Sv(t)||Cv(t))return!1;var e=Ev(t)?$v:Tv;return e.test(_v(t))}var Bv=Lv;function Iv(t,e){return t==null?void 0:t[e]}var Vv=Iv,Pv=Bv,Rv=Vv;function Fv(t,e){var n=Rv(t,e);return Pv(n)?n:void 0}var Yr=Fv,jv=Yr,zv=an,Hv=jv(zv,"Map"),Ha=Hv,Wv=Yr,Uv=Wv(Object,"create"),qo=Uv,of=qo;function Yv(){this.__data__=of?of(null):{},this.size=0}var qv=Yv;function Kv(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Gv=Kv,Jv=qo,Zv="__lodash_hash_undefined__",Xv=Object.prototype,Qv=Xv.hasOwnProperty;function ew(t){var e=this.__data__;if(Jv){var n=e[t];return n===Zv?void 0:n}return Qv.call(e,t)?e[t]:void 0}var tw=ew,nw=qo,rw=Object.prototype,iw=rw.hasOwnProperty;function ow(t){var e=this.__data__;return nw?e[t]!==void 0:iw.call(e,t)}var sw=ow,aw=qo,lw="__lodash_hash_undefined__";function cw(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=aw&&e===void 0?lw:e,this}var dw=cw,uw=qv,fw=Gv,hw=tw,pw=sw,mw=dw;function qr(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])}}qr.prototype.clear=uw,qr.prototype.delete=fw,qr.prototype.get=hw,qr.prototype.has=pw,qr.prototype.set=mw;var gw=qr,sf=gw,yw=Yo,bw=Ha;function kw(){this.size=0,this.__data__={hash:new sf,map:new(bw||yw),string:new sf}}var vw=kw;function ww(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var xw=ww,Ew=xw;function Cw(t,e){var n=t.__data__;return Ew(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Ko=Cw,Sw=Ko;function _w(t){var e=Sw(this,t).delete(t);return this.size-=e?1:0,e}var Ow=_w,Tw=Ko;function Nw(t){return Tw(this,t).get(t)}var Mw=Nw,Aw=Ko;function Dw(t){return Aw(this,t).has(t)}var $w=Dw,Lw=Ko;function Bw(t,e){var n=Lw(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Iw=Bw,Vw=vw,Pw=Ow,Rw=Mw,Fw=$w,jw=Iw;function Kr(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])}}Kr.prototype.clear=Vw,Kr.prototype.delete=Pw,Kr.prototype.get=Rw,Kr.prototype.has=Fw,Kr.prototype.set=jw;var af=Kr,zw=Yo,Hw=Ha,Ww=af,Uw=200;function Yw(t,e){var n=this.__data__;if(n instanceof zw){var r=n.__data__;if(!Hw||r.length<Uw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ww(r)}return n.set(t,e),this.size=n.size,this}var qw=Yw,Kw=Yo,Gw=tv,Jw=rv,Zw=ov,Xw=av,Qw=qw;function Gr(t){var e=this.__data__=new Kw(t);this.size=e.size}Gr.prototype.clear=Gw,Gr.prototype.delete=Jw,Gr.prototype.get=Zw,Gr.prototype.has=Xw,Gr.prototype.set=Qw;var ex=Gr,tx="__lodash_hash_undefined__";function nx(t){return this.__data__.set(t,tx),this}var rx=nx;function ix(t){return this.__data__.has(t)}var ox=ix,sx=af,ax=rx,lx=ox;function Go(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new sx;++e<n;)this.add(t[e])}Go.prototype.add=Go.prototype.push=ax,Go.prototype.has=lx;var cx=Go;function dx(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 ux=dx;function fx(t,e){return t.has(e)}var hx=fx,px=cx,mx=ux,gx=hx,yx=1,bx=2;function kx(t,e,n,r,i,o){var s=n&yx,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&bx?new px:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!mx(e,function(k,x){if(!gx(p,x)&&(m===k||i(m,k,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 lf=kx,vx=an,wx=vx.Uint8Array,xx=wx;function Ex(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Cx=Ex;function Sx(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var _x=Sx,cf=Fa,df=xx,Ox=ef,Tx=lf,Nx=Cx,Mx=_x,Ax=1,Dx=2,$x="[object Boolean]",Lx="[object Date]",Bx="[object Error]",Ix="[object Map]",Vx="[object Number]",Px="[object RegExp]",Rx="[object Set]",Fx="[object String]",jx="[object Symbol]",zx="[object ArrayBuffer]",Hx="[object DataView]",uf=cf?cf.prototype:void 0,Wa=uf?uf.valueOf:void 0;function Wx(t,e,n,r,i,o,s){switch(n){case Hx:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case zx:return!(t.byteLength!=e.byteLength||!o(new df(t),new df(e)));case $x:case Lx:case Vx:return Ox(+t,+e);case Bx:return t.name==e.name&&t.message==e.message;case Px:case Fx:return t==e+"";case Ix:var a=Nx;case Rx:var c=r&Ax;if(a||(a=Mx),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=Dx,s.set(t,e);var u=Tx(a(t),a(e),r,i,o,s);return s.delete(t),u;case jx:if(Wa)return Wa.call(t)==Wa.call(e)}return!1}var Ux=Wx;function Yx(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var qx=Yx,Kx=Array.isArray,Ua=Kx,Gx=qx,Jx=Ua;function Zx(t,e,n){var r=e(t);return Jx(t)?r:Gx(r,n(t))}var Xx=Zx;function Qx(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 eE=Qx;function tE(){return[]}var nE=tE,rE=eE,iE=nE,oE=Object.prototype,sE=oE.propertyIsEnumerable,ff=Object.getOwnPropertySymbols,aE=ff?function(t){return t==null?[]:(t=Object(t),rE(ff(t),function(e){return sE.call(t,e)}))}:iE,lE=aE;function cE(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var dE=cE,uE=ji,fE=zi,hE="[object Arguments]";function pE(t){return fE(t)&&uE(t)==hE}var mE=pE,hf=mE,gE=zi,pf=Object.prototype,yE=pf.hasOwnProperty,bE=pf.propertyIsEnumerable,kE=hf(function(){return arguments}())?hf:function(t){return gE(t)&&yE.call(t,"callee")&&!bE.call(t,"callee")},vE=kE,Jo={exports:{}};function wE(){return!1}var xE=wE;Jo.exports,function(t,e){var n=an,r=xE,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,c=a?a.isBuffer:void 0,d=c||r;t.exports=d}(Jo,Jo.exports);var mf=Jo.exports,EE=9007199254740991,CE=/^(?:0|[1-9]\d*)$/;function SE(t,e){var n=typeof t;return e=e??EE,!!e&&(n=="number"||n!="symbol"&&CE.test(t))&&t>-1&&t%1==0&&t<e}var _E=SE,OE=9007199254740991;function TE(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=OE}var gf=TE,NE=ji,ME=gf,AE=zi,DE="[object Arguments]",$E="[object Array]",LE="[object Boolean]",BE="[object Date]",IE="[object Error]",VE="[object Function]",PE="[object Map]",RE="[object Number]",FE="[object Object]",jE="[object RegExp]",zE="[object Set]",HE="[object String]",WE="[object WeakMap]",UE="[object ArrayBuffer]",YE="[object DataView]",qE="[object Float32Array]",KE="[object Float64Array]",GE="[object Int8Array]",JE="[object Int16Array]",ZE="[object Int32Array]",XE="[object Uint8Array]",QE="[object Uint8ClampedArray]",eC="[object Uint16Array]",tC="[object Uint32Array]",Pe={};Pe[qE]=Pe[KE]=Pe[GE]=Pe[JE]=Pe[ZE]=Pe[XE]=Pe[QE]=Pe[eC]=Pe[tC]=!0,Pe[DE]=Pe[$E]=Pe[UE]=Pe[LE]=Pe[YE]=Pe[BE]=Pe[IE]=Pe[VE]=Pe[PE]=Pe[RE]=Pe[FE]=Pe[jE]=Pe[zE]=Pe[HE]=Pe[WE]=!1;function nC(t){return AE(t)&&ME(t.length)&&!!Pe[NE(t)]}var rC=nC;function iC(t){return function(e){return t(e)}}var oC=iC,Zo={exports:{}};Zo.exports,function(t,e){var n=Uu,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a}(Zo,Zo.exports);var sC=Zo.exports,aC=rC,lC=oC,yf=sC,bf=yf&&yf.isTypedArray,cC=bf?lC(bf):aC,kf=cC,dC=dE,uC=vE,fC=Ua,hC=mf,pC=_E,mC=kf,gC=Object.prototype,yC=gC.hasOwnProperty;function bC(t,e){var n=fC(t),r=!n&&uC(t),i=!n&&!r&&hC(t),o=!n&&!r&&!i&&mC(t),s=n||r||i||o,a=s?dC(t.length,String):[],c=a.length;for(var d in t)(e||yC.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||pC(d,c)))&&a.push(d);return a}var kC=bC,vC=Object.prototype;function wC(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||vC;return t===n}var xC=wC;function EC(t,e){return function(n){return t(e(n))}}var CC=EC,SC=CC,_C=SC(Object.keys,Object),OC=_C,TC=xC,NC=OC,MC=Object.prototype,AC=MC.hasOwnProperty;function DC(t){if(!TC(t))return NC(t);var e=[];for(var n in Object(t))AC.call(t,n)&&n!="constructor"&&e.push(n);return e}var $C=DC,LC=tf,BC=gf;function IC(t){return t!=null&&BC(t.length)&&!LC(t)}var VC=IC,PC=kC,RC=$C,FC=VC;function jC(t){return FC(t)?PC(t):RC(t)}var zC=jC,HC=Xx,WC=lE,UC=zC;function YC(t){return HC(t,UC,WC)}var qC=YC,vf=qC,KC=1,GC=Object.prototype,JC=GC.hasOwnProperty;function ZC(t,e,n,r,i,o){var s=n&KC,a=vf(t),c=a.length,d=vf(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=a[f];if(!(s?h in e:JC.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<c;){h=a[f];var k=t[h],x=e[h];if(r)var v=s?r(x,k,h,e,t,o):r(k,x,h,t,e,o);if(!(v===void 0?k===x||i(k,x,n,r,o):v)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var b=t.constructor,C=e.constructor;b!=C&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(g=!1)}return o.delete(t),o.delete(e),g}var XC=ZC,QC=Yr,eS=an,tS=QC(eS,"DataView"),nS=tS,rS=Yr,iS=an,oS=rS(iS,"Promise"),sS=oS,aS=Yr,lS=an,cS=aS(lS,"Set"),dS=cS,uS=Yr,fS=an,hS=uS(fS,"WeakMap"),pS=hS,Ya=nS,qa=Ha,Ka=sS,Ga=dS,Ja=pS,wf=ji,Jr=rf,xf="[object Map]",mS="[object Object]",Ef="[object Promise]",Cf="[object Set]",Sf="[object WeakMap]",_f="[object DataView]",gS=Jr(Ya),yS=Jr(qa),bS=Jr(Ka),kS=Jr(Ga),vS=Jr(Ja),mr=wf;(Ya&&mr(new Ya(new ArrayBuffer(1)))!=_f||qa&&mr(new qa)!=xf||Ka&&mr(Ka.resolve())!=Ef||Ga&&mr(new Ga)!=Cf||Ja&&mr(new Ja)!=Sf)&&(mr=function(t){var e=wf(t),n=e==mS?t.constructor:void 0,r=n?Jr(n):"";if(r)switch(r){case gS:return _f;case yS:return xf;case bS:return Ef;case kS:return Cf;case vS:return Sf}return e});var wS=mr,Za=ex,xS=lf,ES=Ux,CS=XC,Of=wS,Tf=Ua,Nf=mf,SS=kf,_S=1,Mf="[object Arguments]",Af="[object Array]",Xo="[object Object]",OS=Object.prototype,Df=OS.hasOwnProperty;function TS(t,e,n,r,i,o){var s=Tf(t),a=Tf(e),c=s?Af:Of(t),d=a?Af:Of(e);c=c==Mf?Xo:c,d=d==Mf?Xo:d;var u=c==Xo,f=d==Xo,h=c==d;if(h&&Nf(t)){if(!Nf(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Za),s||SS(t)?xS(t,e,n,r,i,o):ES(t,e,c,n,r,i,o);if(!(n&_S)){var p=u&&Df.call(t,"__wrapped__"),m=f&&Df.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Za),i(g,y,n,r,o)}}return h?(o||(o=new Za),CS(t,e,n,r,i,o)):!1}var NS=TS,MS=NS,$f=zi;function Lf(t,e,n,r,i){return t===e?!0:t==null||e==null||!$f(t)&&!$f(e)?t!==t&&e!==e:MS(t,e,n,r,Lf,i)}var AS=Lf,DS=AS;function $S(t,e){return DS(t,e)}var LS=$S;const Bf=Ri(LS),BS={},IS={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},VS=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},null,-1)];function PS(t,e){return l.openBlock(),l.createElementBlock("svg",IS,VS)}const RS=be(BS,[["render",PS]]),FS={key:0,class:"leading-none"},jS={key:1},zS={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},HS={key:1},WS={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},US=["onClick"],YS={class:"select-none flex w-full items-center justify-between"},qS={class:"flex-1"},If=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,material:Boolean,naked:Boolean,hideChevron:Boolean,summaryText:String,oneLine:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,{t:i}=jn(),o=l.computed(()=>r.placeholder==="Select..."?i("wpiccomponents.placeholder_select"):r.placeholder),s=l.ref(!1),a=l.ref(r.options);l.watch(()=>r.options,()=>{var S;(S=r.options)!=null&&S.length&&(a.value=[...r.options])},{immediate:!0,deep:!0});const c=n,d=l.ref(),u=l.ref();function f(S){var D,F;if(r.multiple){if(S){let $=r.modelValue||[];$.indexOf(S)>=0?$.splice($.indexOf(S),1):$.push(S),c("update:modelValue",$),g($),((D=r.modelValue)==null?void 0:D.length)===((F=r.options)==null?void 0:F.length)?s.value=!0:s.value=!1}}else c("update:modelValue",S),g(S),d.value=null,u.value.hide()}async function h(S){var D,F;c("update:modelValue",S),g(S),await l.nextTick(),((D=r.modelValue)==null?void 0:D.length)===((F=r.options)==null?void 0:F.length)&&(s.value=!0)}function p(S){c("update:modelValue",S),s.value=!1,g(S)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=Qu(function(S){c("change",S)},r.debounce),y=l.computed(()=>{var S,D,F;if(r.multiple){const $=((S=a.value)==null?void 0:S.filter(U=>{var z;return(z=r.modelValue)==null?void 0:z.includes(U.value)}))||[];if(r.summaryText&&$.length){const U=i(r.summaryText,$.length);return i("wpiccomponents.summary_items",{count:$.length,type:U})}if(r.maxDisplay){const U=$.slice(0,r.maxDisplay);return $.length-U.length>0?`${U.map(z=>z.label).join(", ")} (+${$.length-U.length})`:U.map(z=>z.label).join(", ")}else return $.map(U=>U.label).join(", ")}else return((F=(D=a.value)==null?void 0:D.find($=>$.value===r.modelValue))==null?void 0:F.label)||r.modelValue});function k(S){var D;try{return r.multiple?r.modelValue!==null&&((D=r.modelValue)==null?void 0:D.some(F=>Bf(F,S))):r.modelValue!==null&&Bf(S,r.modelValue)}catch(F){return console.log(F),!1}}const x={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},v=l.computed(()=>{var S,D;return((S=r.modelValue)==null?void 0:S.length)===((D=r.options)==null?void 0:D.length)}),b=l.computed(()=>{var S;if(r.filterable&&!r.remoteMethod&&((S=d.value)!=null&&S.trim().length)){const D=d.value.trim().toLowerCase();return r.options.filter(F=>{var $;return($=F.label)==null?void 0:$.toLowerCase().includes(D)})}return r.options});function C(){w.value=1,r.remoteMethod&&r.remoteMethod(d.value,w.value)}const w=l.ref(1),N=l.ref(!1);function L(S){const D=S.target;D.scrollTop+D.clientHeight>=D.scrollHeight-30&&!N.value&&(N.value=!0,w.value+=1,r.remoteMethod(d.value,w.value).finally(()=>{N.value=!1}))}return e({allSelected:s,isAllSelected:v}),(S,D)=>(l.openBlock(),l.createBlock(dr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:l.withCtx(({isHidden:F})=>[l.createVNode(Pi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:l.withCtx(()=>{var $,U,z,I,_,P;return[l.createElementVNode("span",{class:l.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&(($=t.modelValue)==null?void 0:$.length)>0)&&!t.hideSelect?(l.openBlock(),l.createElementBlock("span",FS,[v.value&&((U=t.allSelectedText)!=null&&U.length)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(t.allSelectedText)+" ("+l.toDisplayString((z=t.options)==null?void 0:z.length)+")",1)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(y.value),1)],64))])):!t.multiple&&((I=t.options)!=null&&I.find(V=>V.value===null))?(l.openBlock(),l.createElementBlock("span",jS,l.toDisplayString((P=(_=t.options)==null?void 0:_.find(V=>V.value===null))==null?void 0:P.label),1)):l.renderSlot(S.$slots,"default",{key:2},()=>[l.createTextVNode(l.toDisplayString(o.value),1)])],2),t.modelValue&&t.clearable?(l.openBlock(),l.createElementBlock("div",{key:0,onClick:l.withModifiers(m,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[l.createVNode(Di,{class:"w-4 h-4"})])):l.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(l.openBlock(),l.createBlock(RS,{key:1,class:"h-5 w-5 -mr-[2px]"})):l.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:l.withCtx(()=>{var F;return[l.createElementVNode("div",{class:"flex flex-col max-h-80 overflow-y-auto",onScrollPassive:L},[t.filterable?(l.openBlock(),l.createElementBlock("div",zS,[l.createVNode(Ff,{slim:"",placeholder:S.$t("wpiccomponents.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[D[0]||(D[0]=$=>d.value=$),C]},null,8,["placeholder","modelValue"])])):l.createCommentVNode("",!0),!t.options&&((F=t.options)==null?void 0:F.length)==0?(l.openBlock(),l.createElementBlock("span",HS,"No data.")):(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[t.multiple&&t.batchSelect?(l.openBlock(),l.createElementBlock("div",WS,[l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:D[1]||(D[1]=$=>{var U;return h((U=b.value)==null?void 0:U.filter(z=>z.value).map(z=>z.value))})},l.toDisplayString(S.$t("wpiccomponents.select_all")),1),l.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:D[2]||(D[2]=$=>p([]))},l.toDisplayString(S.$t("wpiccomponents.select_none")),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b.value,$=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["group",{"is-selected":!!k($.value)}])},[l.createElementVNode("div",{class:l.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||$.value,[`${x[l.unref(fe).theme]}`]:!0}]),onClick:U=>$.disabled?null:f($.value)},[l.createElementVNode("div",YS,[l.createElementVNode("div",qS,[l.createElementVNode("div",{class:l.normalizeClass(["",{"opacity-25":$.disabled,"line-clamp-1":t.oneLine}])},l.toDisplayString($.label||$.value),3),$.description?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["text-xs opacity-50 font-normal!",{"opacity-10":$.disabled}])},l.toDisplayString($.description),3)):l.createCommentVNode("",!0)]),t.multiple&&k($.value)?(l.openBlock(),l.createBlock(Wu,{key:0,class:"w-4 h-4"})):l.createCommentVNode("",!0)])],10,US)],2))),256))],64))],32)]}),_:3},8,["label","disabled"]))}}),Vf=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[l.createElementVNode("div",{class:l.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[l.createElementVNode("div",{class:l.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),l.createElementVNode("span",{class:l.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},l.toDisplayString(t.label),3)],2))}}),KS={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},GS={class:""},JS=["value","disabled","rows","placeholder"],Pf=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=l.ref(null),o=l.ref(!1);l.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&l.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function a(d){s("update:modelValue",d==null?void 0:d.target.value)}function c(){i.value.focus()}return e({focus:c}),(d,u)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[t.label?(l.openBlock(),l.createElementBlock("div",KS,[l.createTextVNode(l.toDisplayString(t.label)+" ",1),l.createElementVNode("div",GS,[d.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.info),1)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])])):l.createCommentVNode("",!0),l.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:l.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:l.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:a,placeholder:t.placeholder},null,46,JS)],64))}}),ZS=["placeholder"],Rf={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=l.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return l.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,a)=>(l.openBlock(),l.createBlock(Pi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("input",{type:"color","onUpdate:modelValue":a[0]||(a[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[l.vModelText,i.value]]),l.withDirectives(l.createElementVNode("input",{type:"text","onUpdate:modelValue":a[1]||(a[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,ZS),[[l.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},XS={},QS={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},e_=[l.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),l.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 t_(t,e){return l.openBlock(),l.createElementBlock("svg",QS,e_)}const n_=be(XS,[["render",t_]]),r_={},i_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},o_=[l.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),l.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),l.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 s_(t,e){return l.openBlock(),l.createElementBlock("svg",i_,o_)}const a_=be(r_,[["render",s_]]),l_={},c_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},d_=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function u_(t,e){return l.openBlock(),l.createElementBlock("svg",c_,d_)}const f_=be(l_,[["render",u_]]),h_={class:"flex items-center gap-2"},p_={key:0},m_={class:""},g_=["innerHTML"],y_={class:"flex justify-end"},b_=["name","value","checked"],k_={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},v_={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},w_={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},x_={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Ff=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,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean,summaryText:String,oneLine: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=l.computed(()=>o.name?o.name:ba()),a=ry(s.value),c=l.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=l.ref(!0),u=l.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=l.computed(()=>{var D;if(o.rules&&typeof o.rules=="string"){let F=(D=o.rules)==null?void 0:D.split("|");return o.required&&F.push("required"),o.email&&F.push("email"),F.join("|")}else if(!o.rules){let F=[];return o.required&&F.push("required"),o.email&&F.push("email"),F.join("|")}return"required"});function p(D){let F=D&&D.target?D.target.value:D;x(F)}const m=n;function g(D){D===!0||D===!1?m("update:modelValue",!D):m("update:modelValue",D)}function y(D){let F=D&&D.target?D.target.value:D;m("update:modelValue",F),m("onChange",F)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=Qu(function(D){m("update:modelValue",D),m("onChange",D)},o.debounce),v=l.ref(null),b=l.ref();function C(){var D,F;o.textarea?(D=b.value)==null||D.focus():(F=v.value)==null||F.$el.focus()}function w(){return v.value.meta.valid}const N=l.ref(),L=l.computed(()=>N.value.allSelected),S=l.computed(()=>N.value.isAllSelected);return e({focus:C,isValid:w,allSelected:L,isAllSelected:S}),(D,F)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass([{"text-sm":t.small,"text-base":!t.small},"mb-2 wpic-form-label text-gray-500 dark:text-gray-500 flex items-center justify-between"])},[l.createElementVNode("div",h_,[l.createElementVNode("span",null,l.toDisplayString(c.value),1),t.required&&!t.hideRequired?(l.openBlock(),l.createElementBlock("span",p_,"*")):l.createCommentVNode("",!0),l.createElementVNode("div",m_,[t.info?(l.openBlock(),l.createBlock(dr,{key:0,hover:""},{content:l.withCtx(()=>[l.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,g_)]),default:l.withCtx(()=>[l.createVNode(Ra,{class:"w-4 h-4 text-zinc-600"})]),_:1})):l.createCommentVNode("",!0)])]),l.createElementVNode("div",y_,[l.renderSlot(D.$slots,"more")])],2)):l.createCommentVNode("",!0),t.checkbox?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:v,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:l.withCtx(({field:$})=>[l.createElementVNode("div",{class:l.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:F[0]||(F[0]=U=>t.disabled?void 0:g(t.modelValue))},[l.createElementVNode("div",{class:l.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[l.unref(fe).theme]}`]:!0}])},[t.modelValue===!0?(l.openBlock(),l.createBlock(Wu,{key:0})):l.createCommentVNode("",!0)],2),l.createElementVNode("span",{class:l.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}])},[l.renderSlot(D.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(l.openBlock(),l.createBlock(l.unref(ar),{key:2,ref_key:"myInput",ref:v,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:l.withCtx(({field:$})=>[l.createElementVNode("div",{onClick:F[2]||(F[2]=()=>{t.disabled||y(t.radioValue)}),class:l.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[l.createElementVNode("span",{class:l.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):l.createCommentVNode("",!0)],2),l.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:F[1]||(F[1]=(...U)=>D.onChange&&D.onChange(...U)),checked:t.radioValue==t.modelValue},null,40,b_),c.value?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["text-base",{"opacity-50":t.disabled}])},l.toDisplayString(c.value),3)):l.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(l.openBlock(),l.createBlock(l.unref(ar),{key:3,ref_key:"myInput",ref:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:$})=>{var U;return[l.createVNode(If,{ref_key:"myChoiceList",ref:N,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,oneLine:t.oneLine,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,summaryText:t.summaryText,isInvalid:!!(t.error&&l.unref(a)),required:t.required||((U=h.value)==null?void 0:U.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","oneLine","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","summaryText","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(l.openBlock(),l.createBlock(l.unref(ar),{key:4,ref_key:"myInput",ref:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:$})=>[l.createVNode(Rf,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(l.openBlock(),l.createBlock(l.unref(ar),{key:5,ref_key:"myInput",ref:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(({field:$})=>[l.createVNode(Vf,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(l.openBlock(),l.createElementBlock("div",{key:6,class:l.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[l.unref(fe).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":l.unref(a)}])},[D.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[l.createElementVNode("div",k_,[l.renderSlot(D.$slots,"prepend")])],2)):l.createCommentVNode("",!0),t.textarea?(l.openBlock(),l.createBlock(l.unref(ar),{key:1,ref_key:"myInput",ref:v,modelValue:t.modelValue,rules:h.value,name:s.value},{default:l.withCtx(()=>{var $;return[l.createVNode(Pf,{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&&l.unref(a)),required:t.required||(($=h.value)==null?void 0:$.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(l.openBlock(),l.createBlock(l.unref(ar),{key:2,ref_key:"myInput",ref:v,autocomplete:"off",style:{"z-index":"1"},class:l.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":!D.$slots.prepend&&!t.naked,"pl-8":D.$slots.prepend&&!t.naked,"pl-6":D.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":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:!!l.unref(a),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(l.openBlock(),l.createElementBlock("div",{key:3,onClick:l.withModifiers(k,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[l.createVNode(Ir,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(l.openBlock(),l.createElementBlock("div",{key:4,onClick:l.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"},[l.createVNode(Di,{class:"w-5 h-5 opacity-50"})])):l.createCommentVNode("",!0),D.$slots.append||t.password||t.type=="password"?(l.openBlock(),l.createElementBlock("div",v_,[l.createElementVNode("div",w_,[l.renderSlot(D.$slots,"append",{},()=>[l.withDirectives(l.createVNode(n_,{class:"text-zinc-600 select-none",onClick:f},null,512),[[l.vShow,d.value]]),l.withDirectives(l.createVNode(a_,{class:"text-zinc-600 select-none",onClick:f},null,512),[[l.vShow,!d.value]])])])])):l.createCommentVNode("",!0)],2)),t.error&&l.unref(a)?(l.openBlock(),l.createElementBlock("div",x_,[l.createVNode(l.unref(ny),{name:s.value},{default:l.withCtx($=>[l.createTextVNode(l.toDisplayString($.message),1)]),_:1},8,["name"])])):l.createCommentVNode("",!0),D.$slots.help||t.help?(l.openBlock(),l.createElementBlock("div",{key:8,class:l.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[l.renderSlot(D.$slots,"help",{},()=>[l.createTextVNode(l.toDisplayString(t.help),1)])],2)):l.createCommentVNode("",!0)],2))}}),E_=["innerHTML"],jf=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=l.ref(),n=l.ref(),r=l.ref();ba();const i=t;function o(){i.text&&(n.value.style.display="block",a())}function s(){n.value.style.display=""}async function a(){var h,p;await l.nextTick();const c=await _d(e.value,n.value,{placement:i.placement,middleware:[Sd(),Cd(),Ed(i.offset),i1({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)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("span",{ref_key:"button",ref:e,class:l.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[l.renderSlot(c.$slots,"default")],34),l.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"},[l.createElementVNode("span",{innerHTML:t.text},null,8,E_),l.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),C_={key:1,class:"flex justify-between items-baseline pt-4 px-6"},S_={class:""},__={key:2,class:"flex items-center justify-end py-4 px-6"},O_=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=l.resolveComponent("wpic-loading-panel");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["rounded-lg wpic-card relative",{[e[l.unref(fe).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(l.openBlock(),l.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):l.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(l.openBlock(),l.createElementBlock("div",C_,[t.title||r.$slots.title||r.$slots.actions?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[l.unref(fe).theme]]])},[l.renderSlot(r.$slots,"title",{},()=>[l.createTextVNode(l.toDisplayString(t.title),1)])],2)):l.createCommentVNode("",!0),l.createElementVNode("div",S_,[l.renderSlot(r.$slots,"actions")])])):l.createCommentVNode("",!0),l.renderSlot(r.$slots,"default"),r.$slots.buttons?(l.openBlock(),l.createElementBlock("div",__,[l.renderSlot(r.$slots,"buttons")])):l.createCommentVNode("",!0)],2)}}}),T_={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},N_={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},M_=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[l.unref(fe).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(l.openBlock(),l.createElementBlock("div",T_,[l.createElementVNode("div",N_,[l.renderSlot(n.$slots,"title",{},()=>[l.createTextVNode(l.toDisplayString(t.title),1)])]),l.renderSlot(n.$slots,"actions")])):l.createCommentVNode("",!0),l.renderSlot(n.$slots,"default")],2))}}),A_=l.createElementVNode("div",{class:""},null,-1),D_=l.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),$_=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=l.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)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[l.createElementVNode("div",{class:l.normalizeClass(["flex w-full relative",r[l.unref(fe).theme]]),style:{"z-index":"1"}},[n.value>0?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle({width:`${n.value}%`}),class:l.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[l.unref(fe).theme]}`]:!0}])},[l.createVNode(jf,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:l.withCtx(()=>[A_]),_:1},8,["text"])],6)):l.createCommentVNode("",!0)],2),t.indicators?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D_],64)):l.createCommentVNode("",!0)],2))}}),L_={class:"leading-none"},B_=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)=>(l.openBlock(),l.createElementBlock("div",{class:l.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[l.unref(fe).theme]]:!0}])},[l.createElementVNode("span",L_,[l.renderSlot(o.$slots,"default")]),t.clearable?(l.openBlock(),l.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[l.createVNode(Di,{class:"w-4 h-4"})])):l.createCommentVNode("",!0)],2))}}),I_=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({"w-full":t.full})},[l.createElementVNode("div",{class:l.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[l.renderSlot(e.$slots,"default")],2)],2))}}),V_=t=>(l.pushScopeId("data-v-947735f2"),t=t(),l.popScopeId(),t),P_={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},R_=[V_(()=>l.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],F_=be(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(l.openBlock(),l.createElementBlock("div",P_,R_)):(l.openBlock(),l.createBlock(Ir,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),j_={class:"text-base font-medium select-none"},Hi=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)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[l.unref(fe).theme]]:!t.active&&!t.disabled,[n[l.unref(fe).theme]]:t.active&&!t.disabled,[r[l.unref(fe).theme]]:t.disabled}])},[l.createElementVNode("span",j_,[l.renderSlot(i.$slots,"default")])],2))}}),z_={},H_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},W_=[l.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 U_(t,e){return l.openBlock(),l.createElementBlock("svg",H_,W_)}const zf=be(z_,[["render",U_]]),Y_={},q_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},K_=[l.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 G_(t,e){return l.openBlock(),l.createElementBlock("svg",q_,K_)}const Hf=be(Y_,[["render",G_]]),J_={},Z_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},X_=[l.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 Q_(t,e){return l.openBlock(),l.createElementBlock("svg",Z_,X_)}const Wf=be(J_,[["render",Q_]]),eO={},tO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},nO=[l.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 rO(t,e){return l.openBlock(),l.createElementBlock("svg",tO,nO)}const Uf=be(eO,[["render",rO]]),iO={class:"wpic-pagination flex justify-between"},oO={key:0,class:"flex items-center"},sO={key:0},aO={key:1,class:"flex flex-wrap gap-2"},lO=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!1},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1},perPageOptions:{type:Array,default:()=>[10,20,50,100,200]}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const{t:r}=jn(),i=t,o=l.computed(()=>i.perPageOptions.map(p=>({value:Number(p),label:r("wpiccomponents.per_page",{count:p})}))),s=n,a=l.computed(()=>Math.ceil(i.total/i.perPage)),c=l.computed(()=>{const p=a.value;if(!p||p===1)return[1];const m=i.currentPage,g=1;let y=Math.max(2,m-g),k=Math.min(p-1,m+g);m<=g+2&&(y=2,k=Math.min(2*g+2,p-1)),m>=p-g-1&&(y=Math.max(2,p-2*g-1),k=p-1);const x=[];for(let v=y;v<=k;v++)x.push(v);return y>2&&x.unshift("..."),k<p-1&&x.push("..."),[1,...x,p]});function d(p){p>=1&&p<=a.value&&s("update:currentPage",p)}function u(){return i.perPage*(i.currentPage-1)+1}function f(){return i.perPage*i.currentPage>i.total?i.total:i.perPage*i.currentPage}async function h(p){s("update:perPage",p),s("update:currentPage",1)}return e({getStart:u,getEnd:f}),(p,m)=>{const g=l.resolveComponent("wpic-choice-list");return l.openBlock(),l.createElementBlock("div",iO,[t.info?(l.openBlock(),l.createElementBlock("div",oO,[t.total>0?(l.openBlock(),l.createElementBlock("span",sO,l.toDisplayString(p.$t("wpiccomponents.pagination",{start:u(),end:f(),total:t.total})),1)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),t.pages?(l.openBlock(),l.createElementBlock("div",aO,[l.createVNode(Hi,{onClick:m[0]||(m[0]=y=>d(1)),disabled:t.currentPage===1||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(zf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),l.createVNode(Hi,{onClick:m[1]||(m[1]=y=>d(t.currentPage-1)),disabled:t.currentPage===1||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Hf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,y=>(l.openBlock(),l.createBlock(Hi,{key:`page_${y}`,onClick:k=>d(y),active:y===t.currentPage,disabled:a.value==0||!a.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(y),1)]),_:2},1032,["onClick","active","disabled"]))),128)),l.createVNode(Hi,{onClick:m[2]||(m[2]=y=>d(t.currentPage+1)),disabled:t.currentPage===a.value||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Uf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),l.createVNode(Hi,{onClick:m[3]||(m[3]=y=>d(a.value)),disabled:t.currentPage===a.value||a.value==0||!a.value},{default:l.withCtx(()=>[l.createVNode(Wf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(l.openBlock(),l.createBlock(g,{key:0,modelValue:t.perPage,"onUpdate:modelValue":h,options:o.value},null,8,["modelValue","options"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])}}}),Yf=(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 l.h("td",e.attrs,n)};Yf.props=["column","item","rowIndex"];const Qo=Yf,cO={},dO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},uO=[l.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 fO(t,e){return l.openBlock(),l.createElementBlock("svg",dO,uO)}const hO=be(cO,[["render",fO]]),pO={class:"font-semibold"},qf={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},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:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(l.openBlock(),l.createElementBlock("tr",pO,[t.checkable?(l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[l.unref(fe).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.columns,(i,o)=>(l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[l.unref(fe).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":t.position==="footer","first:rounded-bl-lg":t.position==="footer","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))]))}},mO={},gO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},yO=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function bO(t,e){return l.openBlock(),l.createElementBlock("svg",gO,yO)}const kO=be(mO,[["render",bO]]),vO={},wO={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},xO=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},null,-1)];function EO(t,e){return l.openBlock(),l.createElementBlock("svg",wO,xO)}const CO=be(vO,[["render",EO]]),SO={class:"wpic-table"},_O={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},OO={class:"flex items-center gap-2"},TO={class:"flex items-center gap-2"},NO={class:"w-full rounded-lg"},MO={key:0,class:"w-16"},AO=["width"],DO=["width"],$O={class:"flex justify-center items-center h-full"},LO=["onClick"],BO={class:"rounded-b-lg relative"},IO={key:0},VO=[l.createElementVNode("td",{class:"text-center py-3"}," ",-1)],PO={class:"flex justify-center items-center h-full"},RO={key:1},FO={key:0,class:"text-center text-gray-400 py-3"},jO=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,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},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-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},a={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},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;l.onMounted(()=>{k()});const h=l.getCurrentInstance();l.provide("wtable",h==null?void 0:h.proxy);const p=l.useSlots(),m=l.ref([]),g=l.ref([]),y=l.computed(()=>r.columnToggleable?m.value.filter($=>g.value.includes($.field)||!$.selectable):m.value.filter($=>$.visible||!$.selectable));function k(){const $=(I,_)=>{let P={};for(let V in I){if(typeof I[V].default=="boolean"&&_[V]!==void 0){P[V]=_[V]!==!1;continue}if(_[V]!==void 0){P[V]=_[V];continue}if(typeof I[V].default=="function"){P[V]=I[V].default();continue}P[V]=I[V].default}return P};let U=[];(p.default&&p.default()||[]).forEach(I=>{var _,P;((_=I.type)==null?void 0:_.name)==="WpicTableColumn"?U.push(I):(P=I.children)!=null&&P.length&&I.children.forEach(V=>{var ee;((ee=V.type)==null?void 0:ee.name)==="WpicTableColumn"&&U.push(V)})}),m.value=U.map(I=>{let _=I.children,P=I.props||{},{field:V,label:ee,help:ie,width:he,minWidth:ue,maxWidth:B,sortable:H,selectable:K,render:q,type:j,align:ce,visible:le,noPadding:ve}=$(I.type.props,P);return V||(V=F(ee)),K&&le&&g.value.push(V),{label:ee,help:ie,width:he,minWidth:ue,maxWidth:B,type:j,align:ce,sortable:H,selectable:K,field:V,render:q,children:_,visible:le,noPadding:ve}})}function x($){var z,I;let U=(z=r.sortOptions)==null?void 0:z.sortDirection;((I=r.sortOptions)==null?void 0:I.sortBy)===$&&(U=U==="asc"?"desc":"asc"),f("changeSort",{sortDirection:U,sortBy:$})}l.watch(()=>p.default,$=>{k()},{deep:!0});const v=l.reactive({});function b({index:$,item:U}){v[$]?v[$]=null:(v[$]=!0,f("expandRow",{index:$,item:U}))}const C=l.ref([]);function w($){const U=D($,r.itemId);C.value.includes(U)?(C.value.splice(C.value.indexOf(U),1),N.value=!1):C.value.push(U)}const N=l.ref(!1);function L(){if(N.value=!N.value,C.value=[],N.value)for(let $ of r.data){let U=D($,r.itemId);C.value.push(U)}}function S(){N.value=!1,C.value=[]}e({buildColumns:k,selectedRows:C,selectedColumns:g,resetSelectedRows:S});function D($,U){return U.split(".").reduce((z,I)=>z?z[I]:void 0,$)}function F($){return!$||typeof $!="string"?"":$.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return($,U)=>{const z=l.resolveComponent("wpic-choice-list"),I=l.resolveComponent("wpic-form-field");return l.openBlock(),l.createElementBlock("div",SO,[$.$slots.header||$.$slots.actions||t.columnToggleable?(l.openBlock(),l.createElementBlock("div",_O,[l.createElementVNode("div",OO,[l.renderSlot($.$slots,"header")]),l.createElementVNode("div",TO,[l.renderSlot($.$slots,"actions"),l.createVNode(z,{multiple:"",modelValue:g.value,"onUpdate:modelValue":U[0]||(U[0]=_=>g.value=_),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(_=>_.selectable).map(_=>({label:_.label,value:_.field}))},{default:l.withCtx(()=>[l.createVNode(_i,{medium:"",square:"",colorless:"",class:"ml-px"},{default:l.withCtx(()=>[l.createVNode(CO,{class:"w-5 h-5"})]),_:1})]),_:1},8,["modelValue","options"])])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[l.unref(fe).theme]}`]:!0}])},[l.createElementVNode("div",{class:l.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[l.createElementVNode("table",NO,[l.createElementVNode("colgroup",null,[t.checkable?(l.openBlock(),l.createElementBlock("col",MO)):l.createCommentVNode("",!0),y.value.find(_=>_.type=="expand")?(l.openBlock(),l.createElementBlock("col",{key:1,style:l.normalizeStyle({minWidth:`${y.value.find(_=>_.type=="expand").minWidth}px`}),width:y.value.find(_=>_.type=="expand").width,class:"w-16"},null,12,AO)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(_=>_.type!="expand"),(_,P)=>(l.openBlock(),l.createElementBlock("col",{style:l.normalizeStyle({minWidth:`${_.minWidth}px`,maxWidth:`${_.maxWidth}px`}),width:_.width,key:P},null,12,DO))),128))]),t.hideHeaders?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("thead",{key:0,class:l.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[l.createElementVNode("tr",null,[t.checkable?(l.openBlock(),l.createElementBlock("th",{key:0,class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[l.unref(fe).theme]}`]])},[l.createElementVNode("div",$O,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:N.value,"onUpdate:modelValue":L},null,8,["modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(_=>_.type=="expand")?(l.openBlock(),l.createElementBlock("th",{key:1,class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[l.unref(fe).theme]}`]])},null,2)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(_=>_.type!="expand"),(_,P)=>{var V,ee;return l.openBlock(),l.createElementBlock("th",{class:l.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[l.unref(fe).theme]}`]:!0,"sticky top-0 left-0":P===0}]),style:l.normalizeStyle({maxWidth:`${_.maxWidth}px`})},[l.createElementVNode("div",{onClick:()=>{_.sortable&&x(_.field)},class:l.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":_.sortable&&_.field,"justify-center":_.align=="center","justify-end":_.align=="right"}])},[l.createElementVNode("span",{class:l.normalizeClass(["select-none font-medium text-sm",{"text-right":_.align=="right"}])},l.toDisplayString(_.label),3),_.sortable&&_.field?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["ml-1",{"opacity-25":_.field!=((V=t.sortOptions)==null?void 0:V.sortBy)}])},[l.createVNode(hO,{class:l.normalizeClass(["w-4 h-4",{"rotate-180":((ee=t.sortOptions)==null?void 0:ee.sortDirection)==="asc"}])},null,8,["class"])],2)):l.createCommentVNode("",!0)],10,LO)],6)}),256))])],2)),l.createElementVNode("tbody",BO,[t.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",{class:l.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[l.unref(fe).theme]]])},[l.createVNode(Ir,{class:"w-6 h-6"})],2),t.data.length?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("tr",IO,VO))],64)):l.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(l.openBlock(),l.createBlock(qf,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.data,(_,P)=>{var V,ee,ie,he,ue;return l.openBlock(),l.createElementBlock(l.Fragment,{key:`tr_${P}`},[l.createElementVNode("tr",{class:l.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":P%2==0,"is-even":P%2!=0,[s[l.unref(fe).theme]]:!0}])},[t.checkable?(l.openBlock(),l.createElementBlock("td",{key:0,class:l.normalizeClass([{[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe}])},[l.createElementVNode("div",PO,[l.createVNode(I,{slim:"","hide-error":"",checkbox:"",modelValue:C.value.includes(D(_,t.itemId)),checkboxValue:D(_,t.itemId),"onUpdate:modelValue":B=>w(_)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):l.createCommentVNode("",!0),y.value.find(B=>B.type=="expand")?(l.openBlock(),l.createElementBlock("td",{key:1,class:l.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",[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[l.createVNode(_i,{small:"",square:"",onClick:B=>b({item:_,index:P})},{default:l.withCtx(()=>[v[P]?(l.openBlock(),l.createBlock(f_,{key:0,class:"w-4 h-4"})):(l.openBlock(),l.createBlock(kO,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value.filter(B=>B.type!="expand"),(B,H)=>{var K,q;return l.openBlock(),l.createBlock(Qo,{class:l.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":H===0,[`${c[l.unref(fe).theme]}`]:!0,[`${d[l.unref(fe).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!B.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":P===((K=t.data)==null?void 0:K.length)-1&&!t.totalItem&&!y.value.find(j=>j.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":P===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(j=>j.type=="expand")&&!t.noRadius,"text-center justify-center":B.align=="center","text-right justify-end":B.align=="right","align-top py-5":t.valign=="top"}]),style:l.normalizeStyle({maxWidth:`${B.maxWidth}px`}),id:`${P}_${H}`,column:B,item:_,rowIndex:P,key:H},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(B=>B.type=="expand")?l.withDirectives((l.openBlock(),l.createElementBlock("tr",{key:0,class:l.normalizeClass([{[s[l.unref(fe).theme]]:!t.stripe,[a[l.unref(fe).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[l.createVNode(Qo,{class:l.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[l.unref(fe).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((V=y.value.find(B=>B.type=="expand"))!=null&&V.noPadding),"p-0":(ee=y.value.find(B=>B.type=="expand"))==null?void 0:ee.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":P===((ie=t.data)==null?void 0:ie.length)-1&&!t.totalItem,"first:rounded-bl-lg":P===((he=t.data)==null?void 0:he.length)-1&&!t.totalItem,"text-center":y.value.find(B=>B.type=="expand").align=="center","text-right":y.value.find(B=>B.type=="expand").align=="right"}]),column:y.value.find(B=>B.type=="expand"),rowIndex:P,colspan:(ue=y.value)==null?void 0:ue.length,item:_},null,8,["class","column","rowIndex","colspan","item"])],2)),[[l.vShow,v[P]]]):l.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(l.openBlock(),l.createElementBlock("tfoot",RO,[l.createVNode(qf,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):l.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(l.openBlock(),l.createElementBlock("div",FO," No Data ")):l.createCommentVNode("",!0)],2)])}}}),zO={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 rt(t){this.content=t}rt.prototype={constructor:rt,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 rt(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 rt(n)},addToStart:function(t,e){return new rt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new rt(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 rt(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=rt.from(t),t.size?new rt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rt.from(t),t.size?new rt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=rt.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}},rt.from=function(t){if(t instanceof rt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new rt(e)};function Kf(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=Kf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Gf(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),c=s.nodeSize;if(s==a){n-=c,r-=c;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let d=0,u=Math.min(s.text.length,a.text.length);for(;d<u&&s.text[s.text.length-d-1]==a.text[a.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let d=Gf(s.content,a.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class J{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let c=this.content[s],d=a+c.nodeSize;if(d>e&&r(c,i+a,o||null,s)!==!1&&c.content.size){let u=a+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,c)=>{let d=a.isText?a.text.slice(Math.max(e,c)-c,n-c):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new J(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],c=s+a.nodeSize;c>e&&((s<e||c>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=c}return new J(r,i)}cutByIndex(e,n){return e==n?J.empty:e==0&&n==this.content.length?this:new J(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 J(i,o)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(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 Kf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Gf(this,e,n,r)}findIndex(e,n=-1){if(e==0)return es(0,e);if(e==this.size)return es(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?es(r+1,s):es(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 J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.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 J(n||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const Xa={index:0,offset:0};function es(t,e){return Xa.index=t,Xa.offset=e,Xa}function ts(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(!ts(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ts(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Be=class $c{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&&ts(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}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 $c.none;if(e instanceof $c)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Be.none=[];class ns extends Error{}class ne{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=Zf(this.content,e+this.openStart,n);return r&&new ne(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ne(Jf(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 ne.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 ne(J.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 ne(e,r,i)}}ne.empty=new ne(J.empty,0,0);function Jf(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Jf(o.content,e-i-1,n-i-1)))}function Zf(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Zf(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function HO(t,e,n){if(n.openStart>t.depth)throw new ns("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ns("Inconsistent open depths");return Xf(t,e,n,0)}function Xf(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=Xf(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return yr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=WO(n,t);return yr(o,eh(t,s,a,e,r))}else return yr(o,rs(t,e,r))}function Qf(t,e){if(!e.type.compatibleContent(t.type))throw new ns("Cannot join "+e.type.name+" onto "+t.type.name)}function Qa(t,e,n){let r=t.node(n);return Qf(r,e.node(n)),r}function gr(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 Wi(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&&(gr(t.nodeAfter,r),o++));for(let a=o;a<s;a++)gr(i.child(a),r);e&&e.depth==n&&e.textOffset&&gr(e.nodeBefore,r)}function yr(t,e){return t.type.checkContent(e),t.copy(e)}function eh(t,e,n,r,i){let o=t.depth>i&&Qa(t,e,i+1),s=r.depth>i&&Qa(n,r,i+1),a=[];return Wi(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Qf(o,s),gr(yr(o,eh(t,e,n,r,i+1)),a)):(o&&gr(yr(o,rs(t,e,i+1)),a),Wi(e,n,i,a),s&&gr(yr(s,rs(n,r,i+1)),a)),Wi(r,null,i,a),new J(a)}function rs(t,e,n){let r=[];if(Wi(null,t,n,r),t.depth>n){let i=Qa(t,e,n+1);gr(yr(i,rs(t,e,n+1)),r)}return Wi(e,null,n,r),new J(r)}function WO(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(J.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ui{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Be.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new is(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,a,i+c),!d||(s=s.child(a),s.isText))break;o=d-1,i+=c+1}return new Ui(n,r,o)}static resolveCached(e,n){let r=th.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else th.set(e,r=new UO);let i=r.elts[r.i]=Ui.resolve(e,n);return r.i=(r.i+1)%YO,i}}class UO{constructor(){this.elts=[],this.i=0}}const YO=12,th=new WeakMap;class is{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 qO=Object.create(null);let zn=class Lc{constructor(e,n,r,i=Be.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||J.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,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&&ts(this.attrs,n||e.defaultAttrs||qO)&&Be.sameSet(this.marks,r||Be.none)}copy(e=null){return e==this.content?this:new Lc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Lc(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 ne.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),d=i.node(s).content.cut(i.pos-a,o.pos-a);return new ne(d,i.depth-s,o.depth-s)}replace(e,n,r){return HO(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 Ui.resolveCached(this,e)}resolveNoCache(e){return Ui.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()+")"),nh(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=J.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let 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),this.type.checkAttrs(this.attrs);let e=Be.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Be.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;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=J.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};zn.prototype.text=void 0;class ss extends zn{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):nh(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 ss(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ss(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 nh(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class br{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new KO(e,n);if(r.next==null)return br.empty;let i=rh(r);r.next&&r.err("Unexpected trailing text");let o=tT(eT(i));return nT(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return J.from(a.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,a.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:c}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||c.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
28
|
+
`)}}br.empty=new br(!0);class KO{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function rh(t){let e=[];do e.push(GO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function GO(t){let e=[];do e.push(JO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function JO(t){let e=QO(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=ZO(t,e);else break;return e}function ih(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function ZO(t,e){let n=ih(t),r=n;return t.eat(",")&&(t.next!="}"?r=ih(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function XO(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.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function QO(t){if(t.eat("(")){let e=rh(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=XO(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 eT(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,c){let d={term:c,to:a};return e[s].push(d),d}function i(s,a){s.forEach(c=>c.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,a)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],a);if(c==s.exprs.length-1)return d;i(d,a=n())}else if(s.type=="star"){let c=n();return r(a,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,a),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let c=a;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(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function oh(t,e){return e-t}function sh(t,e){let n=[];return r(e),n.sort(oh);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:c}=o[s];!a&&n.indexOf(c)==-1&&r(c)}}}function tT(t){let e=Object.create(null);return n(sh(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:c})=>{if(!a)return;let d;for(let u=0;u<i.length;u++)i[u][0]==a&&(d=i[u][1]);sh(t,c).forEach(u=>{d||i.push([a,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new br(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(oh);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function nT(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:c,next:d}=i.next[a];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 ah(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 lh(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 ch(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function dh(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new iT(t,r,e[r]);return n}let uh=class Kg{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=dh(e,r.attrs),this.defaultAttrs=ah(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==br.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:lh(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new zn(this,this.computeAttrs(e),J.from(n),Be.setFrom(r))}createChecked(e=null,n,r){return n=J.from(n),this.checkContent(n),new zn(this,this.computeAttrs(e),n,Be.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=J.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(J.empty,!0);return o?new zn(this,e,n.append(o),Be.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ch(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Be.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Kg(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}};function rT(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class iT{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?rT(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class as{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=dh(e,i.attrs),this.excluded=null;let o=ah(this.attrs);this.instance=o?new Be(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Be(this,lh(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new as(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]}checkAttrs(e){ch(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class fh{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=rt.from(e.nodes),n.marks=rt.from(e.marks||{}),this.nodes=uh.compile(this.spec.nodes,this),this.marks=as.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=br.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?hh(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:hh(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 uh){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 ss(r,r.defaultAttrs,e,Be.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return zn.fromJSON(this,e)}markFromJSON(e){return Be.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function hh(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let c=t.marks[a];(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 oT(t){return t.tag!=null}function sT(t){return t.style!=null}class Hn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(oT(i))this.tags.push(i);else if(sT(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new yh(this,n,!1);return r.addAll(e,Be.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new yh(this,n,!0);return r.addAll(e,Be.none,n.from,n.to),ne.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(cT(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let 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 a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=bh(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=bh(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Hn(e,Hn.schemaRules(e)))}}const ph={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},aT={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},mh={ol:!0,ul:!0},Yi=1,el=2,ls=4;function gh(t,e,n){return e!=null?(e?Yi:0)|(e==="full"?el:0):t&&t.whitespace=="pre"?Yi|el:n&-5}class cs{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Be.none,this.match=o||(s&ls?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.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&Yi)){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=J.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ph.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class yh{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=gh(null,n.preserveWhitespace,0)|(r?ls:0);i?o=new cs(i.type,i.attrs,Be.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new cs(null,null,Be.none,!0,null,s):o=new cs(e.schema.topNodeType,null,Be.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&el?"full":this.localPreserveWS||(i.options&Yi)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
29
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;mh.hasOwnProperty(s)&&this.parser.normalizeLists&&lT(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(c?c.ignore:aT.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(ph.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=c&&c.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),d&&this.sync(o),this.needsBlock=u}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,c,d,c.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
30
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let c=this.parser.matchStyle(o,s,this,a);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)a=c;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));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,r),this.findAround(e,c,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=Be.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):kh(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=gh(e,o,s.options);s.options&ls&&s.content.length==0&&(a|=ls);let c=Be.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):kh(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new cs(e,n,c,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Yi)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,c)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;c>=o;c--)if(s(a-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.isInGroup(d))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}}}function lT(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&mh.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function cT(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function bh(t){let e={};for(let n in t)e[n]=t[n];return e}function kh(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let c=0;c<a.edgeCount;c++){let{type:d,next:u}=a.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class kr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=tl(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,c=0;for(;a<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[a][0])||d.type.spec.spanning===!1)break;a++,c++}for(;a<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}=ds(tl(n),this.nodes[e.type.name](e),null,e.attrs);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&&ds(tl(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return ds(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new kr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=vh(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return vh(e.marks)}}function vh(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function tl(t){return t.document||window.document}const wh=new WeakMap;function dT(t){let e=wh.get(t);return e===void 0&&wh.set(t,e=uT(t)),e}function uT(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function ds(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=dT(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=ds(t,h,n,r);if(c.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const xh=65535,Eh=Math.pow(2,16);function fT(t,e){return t+e*Eh}function Ch(t){return t&xh}function hT(t){return(t-(t&xh))/Eh}const Sh=1,_h=2,us=4,Oh=8;class nl{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Oh)>0}get deletedBefore(){return(this.delInfo&(Sh|us))>0}get deletedAfter(){return(this.delInfo&(_h|us))>0}get deletedAcross(){return(this.delInfo&us)>0}}class $t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&$t.empty)return $t.empty}recover(e){let n=0,r=Ch(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+hT(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[a+o],u=this.ranges[a+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:fT(a/3,e-c),g=e==c?_h:e==f?Sh:us;return(n<0?e!=c:e!=f)&&(g|=Oh),new nl(p,g,m)}i+=u-d}return r?e+i:new nl(e+i,0,null)}touches(e,n){let r=0,i=Ch(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let c=this.ranges[a]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[a+o],u=c+d;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(a,a+d,c,c+u),o+=u-d}}invert(){return new $t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?$t.empty:new $t(e<0?[0,-e,0]:[0,0,e])}}$t.empty=new $t([]);class Zr{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 Zr(this.maps,this.mirror,e,n)}copy(){return new Zr(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 Zr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,n);if(a.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new nl(e,i,null)}}const rl=Object.create(null);class dt{getMap(){return $t.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=rl[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 rl)throw new RangeError("Duplicate use of step JSON ID "+e);return rl[e]=n,n.prototype.jsonID=e,n}}class Ue{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ue(e,null)}static fail(e){return new Ue(null,e)}static fromReplace(e,n,r,i){try{return Ue.ok(e.replace(n,r,i))}catch(o){if(o instanceof ns)return Ue.fail(o.message);throw o}}}function il(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(il(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return J.fromArray(r)}class Wn extends dt{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 ne(il(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ue.fromReplace(e,this.from,this.to,o)}invert(){return new ln(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 Wn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Wn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Wn(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 Wn(n.from,n.to,e.markFromJSON(n.mark))}}dt.jsonID("addMark",Wn);class ln extends dt{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 ne(il(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ue.fromReplace(e,this.from,this.to,r)}invert(){return new Wn(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 ln(n.pos,r.pos,this.mark)}merge(e){return e instanceof ln&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ln(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 ln(n.from,n.to,e.markFromJSON(n.mark))}}dt.jsonID("removeMark",ln);class Un extends dt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ue.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ue.fromReplace(e,this.pos,this.pos+1,new ne(J.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 Un(this.pos,n.marks[i]);return new Un(this.pos,this.mark)}}return new Xr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Un(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 Un(n.pos,e.markFromJSON(n.mark))}}dt.jsonID("addNodeMark",Un);class Xr extends dt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ue.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ue.fromReplace(e,this.pos,this.pos+1,new ne(J.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Un(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Xr(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 Xr(n.pos,e.markFromJSON(n.mark))}}dt.jsonID("removeNodeMark",Xr);class Ze extends dt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&ol(e,this.from,this.to)?Ue.fail("Structure replace would overwrite content"):Ue.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new $t([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ze(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 Ze(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ze)||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?ne.empty:new ne(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ze(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?ne.empty:new ne(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ze(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 Ze(n.from,n.to,ne.fromJSON(e,n.slice),!!n.structure)}}dt.jsonID("replace",Ze);class Xe extends dt{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(ol(e,this.from,this.gapFrom)||ol(e,this.gapTo,this.to)))return Ue.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ue.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ue.fromReplace(e,this.from,this.to,r):Ue.fail("Content does not fit in gap")}getMap(){return new $t([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 Xe(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 Xe(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 Xe(n.from,n.to,n.gapFrom,n.gapTo,ne.fromJSON(e,n.slice),n.insert,!!n.structure)}}dt.jsonID("replaceAround",Xe);function ol(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 pT(t,e,n,r){let i=[],o=[],s,a;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 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 ln(h,p,f[g])));a&&a.to==h?a.to=p:o.push(a=new Wn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function mT(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof as){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(a+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(a,e),to:d,step:o})}}}),i.forEach(s=>t.step(new ln(s.from,s.to,s.style)))}function sl(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=a+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Ze(a,u,ne.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new ln(a,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new ne(J.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Ze(a+h.index,a+h.index+h[0].length,m))}}a=u}if(!r.validEnd){let c=r.fillBefore(J.empty,!0);t.replace(a,a,new ne(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function gT(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Qr(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||!gT(i,o,s))break}return null}function yT(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),c=s,d=a,u=J.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=J.from(r.node(m).copy(u)),f++):c--;let h=J.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=J.from(i.node(m).copy(h)),p++):d++;t.step(new Xe(c,d,s,a,new ne(u.append(h),f,p),u.size-f,!0))}function al(t,e,n=null,r=t){let i=bT(t,e),o=i&&kT(r,e);return o?i.map(Th).concat({type:e,attrs:n}).concat(o.map(Th)):null}function Th(t){return{type:t,attrs:null}}function bT(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 kT(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 vT(t,e,n){let r=J.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=J.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Xe(i,o,i,o,new ne(r,0,0),n.length,!0))}function wT(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&xT(t.doc,t.mapping.slice(o).map(a),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&Mh(t,s,a,o),sl(t,t.mapping.slice(o).map(a,1),r,void 0,d===null);let u=t.mapping.slice(o),f=u.map(a,1),h=u.map(a+s.nodeSize,1);return t.step(new Xe(f,h,f+1,h-1,new ne(J.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&Nh(t,s,a,o),!1}})}function Nh(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Mh(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(`
|
|
31
|
+
`))}})}function xT(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function ET(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 Xe(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new ne(J.from(s),0,0),1,!0))}function Cn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(a,a,c?c.type:i.node(o+1).type)}function CT(t,e,n=1,r){let i=t.doc.resolve(e),o=J.empty,s=J.empty;for(let a=i.depth,c=i.depth-n,d=n-1;a>c;a--,d--){o=J.from(i.node(a).copy(o));let u=r&&r[d];s=J.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new Ze(e,e,new ne(o.append(s),n,n),!0))}function Yn(t,e){let n=t.resolve(e),r=n.index();return Ah(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ST(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function Ah(t,e){return!!(t&&e&&!t.isLeaf&&ST(t,e))}function fs(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&Ah(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function _T(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Mh(t,u.node(),u.before(),a)}s.inlineContent&&sl(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let c=t.mapping.slice(a),d=c.map(e-n);if(t.step(new Ze(d,c.map(e+n,-1),ne.empty,!0)),r===!0){let u=t.doc.resolve(d);Nh(t,u.node(),u.before(),t.steps.length)}return t}function OT(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 Dh(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(a>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 a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function hs(t,e,n=e,r=ne.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return $h(i,o,r)?new Ze(e,n,r):new TT(i,o,r).fit()}function $h(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class TT{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.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=J.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let c=new ne(o,s,a);return e>-1?new Xe(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Ze(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=ll(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:c,match:d}=this.frontier[a],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(J.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ll(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ne(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=ll(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new ne(qi(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ne(qi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,a=r?r.content:s.content,c=s.openStart-e,d=0,u=[],{match:f,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),y=f.matchType(g.type);if(!y)break;d++,(d>1||c==0||g.content.size)&&(f=y,u.push(Lh(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==a.childCount?p:-1)))}let m=d==a.childCount;m||(p=-1),this.placed=Ki(this.placed,n,J.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<p;g++){let k=y.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),y=k.content}this.unplaced=m?e==0?ne.empty:new ne(qi(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new ne(qi(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||!cl(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=cl(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:c,type:d}=this.frontier[a],u=cl(e,a,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=Ki(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=Ki(this.placed,this.depth,J.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=Ki(this.placed,this.frontier.length,n))}}function qi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(qi(t.firstChild.content,e-1,n)))}function Ki(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ki(t.lastChild.content,e-1,n)))}function ll(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Lh(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Lh(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(J.empty,!0)))),t.copy(r)}function cl(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!NT(n,o.content,s)?a:null}function NT(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function MT(t){return t.spec.defining||t.spec.definingForContent}function AT(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if($h(i,o,r))return t.step(new Ze(e,n,r));let s=Ih(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==p&&s.splice(1,0,-h)}let c=s.indexOf(a),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=MT(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+c)%s.length],k=!0;y<0&&(k=!1,y=-y);let x=i.node(y-1),v=i.index(y-1);if(x.canReplaceWith(v,v,m.type,m.marks))return t.replace(i.before(y),k?o.after(y):n,new ne(Bh(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 Bh(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Bh(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(J.empty,!0))}return t}function DT(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=OT(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new ne(J.from(r),0,0))}function $T(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Ih(r,i);for(let s=0;s<o.length;s++){let a=o[s],c=s==o.length-1;if(c&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(c||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Ih(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 ei extends dt{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 Ue.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 Ue.fromReplace(e,this.pos,this.pos+1,new ne(J.from(i),0,n.isLeaf?0:1))}getMap(){return $t.empty}invert(e){return new ei(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 ei(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 ei(n.pos,n.attr,n.value)}}dt.jsonID("attr",ei);class Gi extends dt{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 Ue.ok(r)}getMap(){return $t.empty}invert(e){return new Gi(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 Gi(n.attr,n.value)}}dt.jsonID("docAttr",Gi);let ti=class extends Error{};ti=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},ti.prototype=Object.create(Error.prototype),ti.prototype.constructor=ti,ti.prototype.name="TransformError";class LT{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ti(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=ne.empty){let i=hs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new ne(J.from(r),0,0))}delete(e,n){return this.replace(e,n,ne.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return AT(this,e,n,r),this}replaceRangeWith(e,n,r){return DT(this,e,n,r),this}deleteRange(e,n){return $T(this,e,n),this}lift(e,n){return yT(this,e,n),this}join(e,n=1){return _T(this,e,n),this}wrap(e,n){return vT(this,e,n),this}setBlockType(e,n=e,r,i=null){return wT(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return ET(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new ei(e,n,r)),this}setDocAttribute(e,n){return this.step(new Gi(e,n)),this}addNodeMark(e,n){return this.step(new Un(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Xr(e,n)),this}split(e,n=1,r){return CT(this,e,n,r),this}addMark(e,n,r){return pT(this,e,n,r),this}removeMark(e,n,r){return mT(this,e,n,r),this}clearIncompatible(e,n,r){return sl(this,e,n,r),this}}const dl=Object.create(null);class xe{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new BT(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=ne.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:c,$to:d}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),a?ne.empty:n),a==0&&Rh(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],c=e.mapping.slice(r),d=c.map(s.pos),u=c.map(a.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Rh(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ke(e):ni(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?ni(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):ni(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 Lt(e.node(0))}static atStart(e){return ni(e,e,0,0,1)||new Lt(e)}static atEnd(e){return ni(e,e,e.content.size,e.childCount,-1)||new Lt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=dl[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 dl)throw new RangeError("Duplicate use of selection JSON ID "+e);return dl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}}xe.prototype.visible=!0;class BT{constructor(e,n){this.$from=e,this.$to=n}}let Vh=!1;function Ph(t){!Vh&&!t.parent.inlineContent&&(Vh=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ke extends xe{constructor(e,n=e){Ph(e),Ph(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 xe.near(r);let i=e.resolve(n.map(this.anchor));return new ke(i.parent.inlineContent?i:r,r)}replace(e,n=ne.empty){if(super.replace(e,n),n==ne.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ke&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ps(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 ke(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=xe.findFrom(n,r,!0)||xe.findFrom(n,-r,!0);if(o)n=o.$head;else return xe.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(xe.findFrom(e,-r,!0)||xe.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ke(e,n)}}xe.jsonID("text",ke);class ps{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ps(e.map(this.anchor),e.map(this.head))}resolve(e){return ke.between(e.resolve(this.anchor),e.resolve(this.head))}}class pe extends xe{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?xe.near(o):new pe(o)}content(){return new ne(J.from(this.node),0,0)}eq(e){return e instanceof pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ul(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new pe(e.resolve(n.anchor))}static create(e,n){return new pe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}pe.prototype.visible=!1,xe.jsonID("node",pe);class ul{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ps(r,r):new ul(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&pe.isSelectable(r)?new pe(n):xe.near(n)}}class Lt extends xe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ne.empty){if(n==ne.empty){e.delete(0,e.doc.content.size);let r=xe.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Lt(e)}map(e){return new Lt(e)}eq(e){return e instanceof Lt}getBookmark(){return IT}}xe.jsonID("all",Lt);const IT={map(){return this},resolve(t){return new Lt(t)}};function ni(t,e,n,r,i,o=!1){if(e.inlineContent)return ke.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&pe.isSelectable(a))return pe.create(t,n-(i<0?a.nodeSize:0))}else{let c=ni(t,a,n+i,i<0?a.childCount:0,i,o);if(c)return c}n+=a.nodeSize*i}return null}function Rh(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ze||i instanceof Xe))return;let o=t.mapping.maps[r],s;o.forEach((a,c,d,u)=>{s==null&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const Fh=1,jh=2,zh=4;class VT extends LT{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|Fh)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Fh)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=jh,this}ensureMarks(e){return Be.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&jh)>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)||Be.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(xe.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|=zh,this}get scrolledIntoView(){return(this.updated&zh)>0}}function Hh(t,e){return!e||!t?t:t.bind(e)}class Ji{constructor(e,n,r){this.name=e,this.init=Hh(n.init,r),this.apply=Hh(n.apply,r)}}const PT=[new Ji("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ji("selection",{init(t,e){return t.selection||xe.atStart(e.doc)},apply(t){return t.selection}}),new Ji("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ji("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class fl{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=PT.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ji(r.key,r.spec.state,r))})}}class ri{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let c=i?i[s].n:0,d=i?i[s].state:this,u=c<n.length&&a.spec.appendTransaction.call(a,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 ri(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 VT(this)}static create(e){let n=new fl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ri(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 fl(this.schema,e.plugins),r=n.fields,i=new ri(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 fl(e.schema,e.plugins),o=new ri(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=zn.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=xe.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let c=r[a],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=d.fromJSON.call(c,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function Wh(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Wh(i,e,{})),n[r]=i}return n}class it{constructor(e){this.spec=e,this.props={},e.props&&Wh(e.props,this,this.props),this.key=e.key?e.key.key:Uh("plugin")}getState(e){return e[this.key]}}const hl=Object.create(null);function Uh(t){return t in hl?t+"$"+ ++hl[t]:(hl[t]=0,t+"$")}class Bt{constructor(e="key"){this.key=Uh(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ot=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Zi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let pl=null;const Sn=function(t,e,n){let r=pl||(pl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},RT=function(){pl=null},vr=function(t,e,n,r){return n&&(Yh(t,e,n,r,-1)||Yh(t,e,n,r,1))},FT=/^(img|br|input|textarea|hr)$/i;function Yh(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:jt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Xi(t)||FT.test(t.nodeName)||t.contentEditable=="false")return!1;e=ot(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?jt(t):0}else return!1}}function jt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function jT(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=jt(t)}else if(t.parentNode&&!Xi(t))e=ot(t),t=t.parentNode;else return null}}function zT(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&&!Xi(t))e=ot(t)+1,t=t.parentNode;else return null}}function HT(t,e,n){for(let r=e==0,i=e==jt(t);r||i;){if(t==n)return!0;let o=ot(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==jt(t)}}function Xi(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 ms=function(t){return t.focusNode&&vr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function wr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function WT(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function UT(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(jt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(jt(r.startContainer),r.startOffset)}}}const cn=typeof navigator<"u"?navigator:null,qh=typeof document<"u"?document:null,qn=cn&&cn.userAgent||"",ml=/Edge\/(\d+)/.exec(qn),Kh=/MSIE \d/.exec(qn),gl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qn),_t=!!(Kh||gl||ml),Kn=Kh?document.documentMode:gl?+gl[1]:ml?+ml[1]:0,en=!_t&&/gecko\/(\d+)/i.test(qn);en&&+(/Firefox\/(\d+)/.exec(qn)||[0,0])[1];const yl=!_t&&/Chrome\/(\d+)/.exec(qn),ut=!!yl,Gh=yl?+yl[1]:0,yt=!_t&&!!cn&&/Apple Computer/.test(cn.vendor),ii=yt&&(/Mobile\/\w+/.test(qn)||!!cn&&cn.maxTouchPoints>2),zt=ii||(cn?/Mac/.test(cn.platform):!1),YT=cn?/Win/.test(cn.platform):!1,_n=/Android \d/.test(qn),Qi=!!qh&&"webkitFontSmoothing"in qh.documentElement.style,qT=Qi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function KT(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 On(t,e){return typeof t=="number"?t:t[e]}function GT(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 Jh(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=Zi(s)){if(s.nodeType!=1)continue;let a=s,c=a==o.body,d=c?KT(o):GT(a),u=0,f=0;if(e.top<d.top+On(r,"top")?f=-(d.top-e.top+On(i,"top")):e.bottom>d.bottom-On(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+On(i,"top")-d.top:e.bottom-d.bottom+On(i,"bottom")),e.left<d.left+On(r,"left")?u=-(d.left-e.left+On(i,"left")):e.right>d.right-On(r,"right")&&(u=e.right-d.right+On(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let m=a.scrollLeft-h,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function JT(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let c=a.getBoundingClientRect();if(c.top>=n-20){r=a,i=c.top;break}}return{refDOM:r,refTop:i,stack:Zh(t.dom)}}function Zh(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Zi(r));return e}function ZT({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Xh(n,r==0?0:r-e)}function Xh(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 oi=null;function XT(t){if(t.setActive)return t.setActive();if(oi)return t.focus(oi);let e=Zh(t);t.focus(oi==null?{get preventScroll(){return oi={preventScroll:!0},!0}}:void 0),oi||(oi=!1,Xh(e,0))}function Qh(t,e){let n,r=2e8,i,o=0,s=e.top,a=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=Sn(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!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?QT(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:Qh(n,i)}function QT(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=Gn(r,1);if(o.top!=o.bottom&&bl(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function bl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function e5(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function t5(t,e,n){let{node:r,offset:i}=Qh(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 n5(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),c;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((c=a.dom.getBoundingClientRect()).width||c.height)&&(a.node.isBlock&&a.parent&&(!s&&c.left>r.left||c.top>r.top?i=a.posBefore:(!s&&c.right<r.left||c.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function ep(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let c=0;c<a.length;c++){let d=a[c];if(bl(e,d))return ep(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function r5(t,e){let n=t.dom.ownerDocument,r,i=0,o=UT(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!bl(e,d)||(s=ep(t.dom,e,d),!s))return null}if(yt)for(let d=s;r&&d;d=Zi(d))d.draggable&&(r=void 0);if(s=e5(s,e),r){if(en&&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;Qi&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=n5(t,r,i,e))}a==null&&(a=t5(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function tp(t){return t.top<t.bottom||t.left<t.right}function Gn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(tp(r))return r}return Array.prototype.find.call(n,tp)||t.getBoundingClientRect()}const i5=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function np(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Qi||en;if(r.nodeType==3)if(s&&(i5.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Gn(Sn(r,i,i),n);if(en&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Gn(Sn(r,i-1,i-1),-1);if(d.top==c.top){let u=Gn(Sn(r,i,i+1),-1);if(u.top!=c.top)return eo(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++,eo(Gn(Sn(r,c,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return kl(c.getBoundingClientRect(),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];if(c.nodeType==1)return kl(c.getBoundingClientRect(),!0)}return kl(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==jt(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Sn(c,jt(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return eo(Gn(d,1),!1)}if(o==null&&i<jt(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Sn(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return eo(Gn(d,-1),!0)}return eo(Gn(r.nodeType==3?Sn(r):r,-n),n>=0)}function eo(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 kl(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 rp(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 o5(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return rp(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=np(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let c;if(a.nodeType==1)c=a.getClientRects();else if(a.nodeType==3)c=Sn(a,0,a.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 s5=/[\u0590-\u08ac]/;function a5(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!s5.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:rp(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{a.collapse(u,f),c&&(c!=u||d!=f)&&a.extend&&a.extend(c,d)}catch{}return h!=null&&(a.caretBidiLevel=h),y}):r.pos==r.start()||r.pos==r.end()}let ip=null,op=null,sp=!1;function l5(t,e,n){return ip==e&&op==n?sp:(ip=e,op=n,sp=n=="up"||n=="down"?o5(t,e,n):a5(t,e,n))}const Ht=0,ap=1,xr=2,dn=3;class to{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ht,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>ot(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;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof dp){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof lp&&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?ot(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?ot(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let c=this.children[a],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=a;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=ot(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||a==this.children.length-1)){n=d;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=ot(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 p=0,m=0;p<this.children.length;p++){let g=this.children[p],y=m+g.size;if(o>m&&s<y)return g.setSelection(e-m-g.border,n-m-g.border,r,i);m=y}let a=this.domFromPos(e,e?-1:1),c=n==e?a:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((en||yt)&&e==n){let{node:p,offset:m}=a;if(p.nodeType==3){if(f=!!(m&&p.nodeValue[m-1]==`
|
|
32
|
+
`),f&&m==p.nodeValue.length)for(let g=p,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(a=c={node:y.parentNode,offset:ot(y)+1});break}let k=g.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let g=p.childNodes[m-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(en&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&yt)&&vr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&vr(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&!f){d.collapse(a.node,a.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=a;a=c,c=m}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,c=s-o.border;if(e>=a&&n<=c){this.dirty=e==r||n==s?xr:ap,e==a&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=dn:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?xr:dn}r=s}this.dirty=xr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?xr:ap;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class lp extends to{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Ht&&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 c5 extends to{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 Er extends to{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=kr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Er(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&dn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=dn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Ht){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ht}}slice(e,n,r){let i=Er.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=wl(o,n,s,r)),e>0&&(o=wl(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Jn extends to{constructor(e,n,r,i,o,s,a,c,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],c,d=a&&a(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}=kr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=hp(u,r,n),d?c=new d5(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new gs(e,n,r,i,u,h,o):new Jn(e,n,r,i,u,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>J.empty)}return e}matchesNode(e,n,r){return this.dirty==Ht&&e.eq(this.node)&&ys(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,c=new f5(this,s&&s.node,e);m5(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?Be.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)||a&&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==xr)&&(s&&this.protectLocalComposition(e,s),up(this.contentDOM,this.children,e),ii&&g5(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ke)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=y5(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new c5(this,o,n,i);e.input.compositionNodes.push(s),this.children=wl(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==dn||!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=Ht}updateOuterDeco(e){if(ys(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=fp(this.dom,this.nodeDOM,vl(this.outerDeco,this.node,n),vl(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 cp(t,e,n,r,i){hp(r,e,t);let o=new Jn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class gs extends Jn{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==dn||this.dirty!=Ht&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ht||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=Ht,!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 gs(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=dn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class dp extends to{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ht&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class d5 extends Jn{constructor(e,n,r,i,o,s,a,c,d,u){super(e,n,r,i,o,s,a,d,u),this.spec=c}update(e,n,r,i){if(this.dirty==dn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){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.root):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 up(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=pp(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof Er){let c=r?r.previousSibling:t.lastChild;up(s.contentDOM,s.children,n),r=c?c.nextSibling:t.firstChild}}for(;r;)r=pp(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const no=function(t){t&&(this.nodeName=t)};no.prototype=Object.create(null);const Cr=[new no];function vl(t,e,n){if(t.length==0)return Cr;let r=n?Cr[0]:new no,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new no(s.nodeName));for(let a in s){let c=s[a];c!=null&&(n&&i.length==1&&i.push(r=new no(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+c:a=="style"?r.style=(r.style?r.style+";":"")+c:a!="nodeName"&&(r[a]=c))}}}return i}function fp(t,e,n,r){if(n==Cr&&r==Cr)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let c;a&&a.nodeName==s.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==s.nodeName||(c=document.createElement(s.nodeName),c.pmIsDeco=!0,c.appendChild(i),a=Cr[0]),i=c}u5(i,a||Cr[0],s)}return i}function u5(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 hp(t,e,n){return fp(t,t,Cr,vl(e,n,t.nodeType!=1))}function ys(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 pp(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class f5{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=h5(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=Ht,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let 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)){a=c;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let c=Er.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 a=this.index,c=Math.min(this.top.children.length,a+5);a<c;a++){let d=this.top.children[a];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==dn&&s.dom==s.contentDOM&&(s.dirty=xr),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let c=this.top.children[a];if(c instanceof Jn){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!=dn&&ys(n,c.outerDeco));if(!h&&c.update(e,n,r,i))return this.destroyBetween(this.index,a),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(c,e,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=xr,f.updateChildren(i,s+1),f.dirty=Ht),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)||!ys(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Jn.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let c of a.children)c.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=Jn.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new lp(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 Er;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof gs)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((yt||ut)&&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 dp(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 h5(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof Er)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=a.node;if(c){if(c!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function p5(t,e){return t.type.side-e.type.side}function m5(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let s=0,a=[],c=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(p5);for(let y=0;y<f.length;y++)n(f[y],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 y=0;y<a.length;y++)a[y].to<=o&&a.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let y=m;s<i.length&&i[s].from<y&&(y=i[s].from);for(let k=0;k<a.length;k++)a[k].to<y&&(y=a[k].to);y<m&&(c=h.cut(y-o),h=h.cut(0,y-o),m=y,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let g=h.isInline&&!h.isLeaf?a.filter(y=>!y.inline):a.slice();r(h,g,e.forChild(o,h),p),o=m}}function g5(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 y5(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let 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-a,r-a)==e)return r-e.length;let d=a<r?c.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=n)return a+d;if(n==r&&c.length>=r+e.length-a&&c.slice(r-a,r-a+e.length)==e)return r}}return-1}function wl(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let c=t[s],d=a,u=a+=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 xl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),c,d;if(ms(n)){for(c=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&pe.isSelectable(f)&&i.parent&&!(f.isInline&&HT(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;d=new pe(s==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,h=s;for(let p=0;p<n.rangeCount;p++){let m=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(f<0)return null;[c,s]=h==t.state.selection.anchor?[h,f]:[f,h],a=r.resolve(s)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!d){let f=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;d=Cl(t,u,a,f)}return d}function mp(t){return t.editable?t.hasFocus():xp(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Tn(t,e=!1){let n=t.state.selection;if(kp(t,n),!!mp(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ut){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&vr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)k5(t);else{let{anchor:r,head:i}=n,o,s;gp&&!(n instanceof ke)&&(n.$from.parent.inlineContent||(o=yp(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=yp(t,n.to))),t.docView.setSelection(r,i,t,e),gp&&(o&&bp(o),s&&bp(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&b5(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const gp=yt||ut&&Gh<63;function yp(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(yt&&i&&i.contentEditable=="false")return El(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return El(i);if(o)return El(o)}}function El(t){return t.contentEditable="true",yt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function bp(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function b5(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(()=>{(!mp(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function k5(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,ot(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&_t&&Kn<=11&&(r.disabled=!0,r.disabled=!1)}function kp(t,e){if(e instanceof pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(vp(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else vp(t)}function vp(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Cl(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ke.between(e,n,r)}function wp(t){return t.editable&&!t.hasFocus()?!1:xp(t)}function xp(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 v5(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return vr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Sl(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&&xe.findFrom(o,e)}function Zn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Ep(t,e,n){let r=t.state.selection;if(r instanceof ke)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 Zn(t,new ke(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Sl(t.state,e);return i&&i instanceof pe?Zn(t,i):!1}else if(!(zt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?pe.isSelectable(o)?Zn(t,new pe(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Qi?Zn(t,new ke(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return Zn(t,new ke(e>0?r.$to:r.$from));{let i=Sl(t.state,e);return i?Zn(t,i):!1}}}function bs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ro(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function si(t,e){return e<0?w5(t):x5(t)}function w5(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(en&&n.nodeType==1&&r<bs(n)&&ro(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ro(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Cp(n))break;{let a=n.previousSibling;for(;a&&ro(a,-1);)i=n.parentNode,o=ot(a),a=a.previousSibling;if(a)n=a,r=bs(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?_l(t,n,r):i&&_l(t,i,o)}function x5(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=bs(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(ro(a,1))o=n,s=++r;else break}else{if(Cp(n))break;{let a=n.nextSibling;for(;a&&ro(a,1);)o=a.parentNode,s=ot(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=bs(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&_l(t,o,s)}function Cp(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function E5(t,e){for(;t&&e==t.childNodes.length&&!Xi(t);)e=ot(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 C5(t,e){for(;t&&!e&&!Xi(t);)e=ot(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function _l(t,e,n){if(e.nodeType!=3){let o,s;(s=E5(e,n))?(e=s,n=0):(o=C5(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(ms(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&&Tn(t)},50)}function Sp(t,e){let n=t.state.doc.resolve(e);if(!(ut||YT)&&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 _p(t,e,n){let r=t.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||zt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Sl(t.state,e);if(s&&s instanceof pe)return Zn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Lt?xe.near(s,e):xe.findFrom(s,e);return a?Zn(t,a):!1}return!1}function Op(t,e){if(!(t.state.selection instanceof ke))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 Tp(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function S5(t){if(!yt||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;Tp(t,r,"true"),setTimeout(()=>Tp(t,r,"false"),20)}return!1}function _5(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function O5(t,e){let n=e.keyCode,r=_5(e);if(n==8||zt&&n==72&&r=="c")return Op(t,-1)||si(t,-1);if(n==46&&!e.shiftKey||zt&&n==68&&r=="c")return Op(t,1)||si(t,1);if(n==13||n==27)return!0;if(n==37||zt&&n==66&&r=="c"){let i=n==37?Sp(t,t.state.selection.from)=="ltr"?-1:1:-1;return Ep(t,i,r)||si(t,i)}else if(n==39||zt&&n==70&&r=="c"){let i=n==39?Sp(t,t.state.selection.from)=="ltr"?1:-1:1;return Ep(t,i,r)||si(t,i)}else{if(n==38||zt&&n==80&&r=="c")return _p(t,-1,r)||si(t,-1);if(n==40||zt&&n==78&&r=="c")return S5(t)||_p(t,1,r)||si(t,1);if(r==(zt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ol(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")||kr.fromSchema(t.state.schema),a=Ip(),c=a.createElement("div");c.appendChild(s.serializeFragment(r,{document:a}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Lp[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.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,`
|
|
33
|
+
|
|
34
|
+
`);return{dom:c,text:h,slice:e}}function Np(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;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 ne(J.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
35
|
+
`))),0,0):ne.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)a=f;else{let h=i.marks(),{schema:p}=t.state,m=kr.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=A5(n),Qi&&D5(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Hn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!T5.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=$5($p(a,+u[1],+u[2]),u[4]);else if(a=ne.maxOpen(N5(a.content,i),!0),a.openStart||a.openEnd){let f=0,h=0;for(let p=a.content.firstChild;f<a.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=a.content.lastChild;h<a.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);a=$p(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const T5=/^(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 N5(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let c=i.findWrapping(a.type),d;if(!c)return s=null;if(d=s.length&&o.length&&Ap(c,o,a,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Dp(s[s.length-1],o.length));let u=Mp(a,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return J.from(s)}return t}function Mp(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,J.from(t));return t}function Ap(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Ap(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(J.from(Mp(n,t,i+1))))}}function Dp(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Dp(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(J.empty,!0);return t.copy(n.append(r))}function Tl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=Tl(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(J.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function $p(t,e,n){return e<t.openStart&&(t=new ne(Tl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ne(Tl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Lp={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 Bp=null;function Ip(){return Bp||(Bp=document.implementation.createHTMLDocument("title"))}let Nl=null;function M5(t){let e=window.trustedTypes;return e?(Nl||(Nl=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Nl.createHTML(t)):t}function A5(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Ip().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Lp[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=M5(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function D5(t){let e=t.querySelectorAll(ut?"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 $5(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let c=n.nodes[r[a]];if(!c||c.hasRequiredAttrs())break;i=J.from(c.create(r[a+1],i)),o++,s++}return new ne(i,o,s)}const bt={},kt={},L5={touchstart:!0,touchmove:!0};class B5{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.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function I5(t){for(let e in bt){let n=bt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{P5(t,r)&&!Al(t,r)&&(t.editable||!(r.type in kt))&&n(t,r)},L5[e]?{passive:!0}:void 0)}yt&&t.dom.addEventListener("input",()=>null),Ml(t)}function Xn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function V5(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 Ml(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Al(t,r))})}function Al(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function P5(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 R5(t,e){!Al(t,e)&&bt[e.type]&&(t.editable||!(e.type in kt))&&bt[e.type](t,e)}kt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Pp(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(_n&&ut&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ii&&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,wr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||O5(t,n)?n.preventDefault():Xn(t,"key")},kt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},kt.keypress=(t,e)=>{let n=e;if(Pp(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||zt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ke)||!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 ks(t){return{left:t.clientX,top:t.clientY}}function F5(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Dl(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ai(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function j5(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(ai(t,new pe(n)),!0):!1}function z5(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof pe&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(pe.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(ai(t,pe.create(t.state.doc,i)),!0):!1}function H5(t,e,n,r,i){return Dl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?z5(t,n):j5(t,n))}function W5(t,e,n,r){return Dl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function U5(t,e,n,r){return Dl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Y5(t,n,r)}function Y5(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ai(t,ke.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)ai(t,ke.create(r,a+1,a+1+s.content.size));else if(pe.isSelectable(s))ai(t,pe.create(r,a));else continue;return!0}}function $l(t){return vs(t)}const Vp=zt?"metaKey":"ctrlKey";bt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=$l(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&F5(n,t.input.lastClick)&&!n[Vp]&&(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(ks(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new q5(t,s,n,!!r)):(o=="doubleClick"?W5:U5)(t,s.pos,s.inside,n)?n.preventDefault():Xn(t,"pointer"))};class q5{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[Vp],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,c=a?e.docView.nearestDesc(a,!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 pe&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&en&&!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)),Xn(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(()=>Tn(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(ks(e))),this.updateAllowDefault(e),this.allowDefault||!n?Xn(this.view,"pointer"):H5(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||yt&&this.mightDrag&&!this.mightDrag.node.isAtom||ut&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ai(this.view,xe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Xn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Xn(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)}}bt.touchstart=t=>{t.input.lastTouch=Date.now(),$l(t),Xn(t,"pointer")},bt.touchmove=t=>{t.input.lastTouch=Date.now(),Xn(t,"pointer")},bt.contextmenu=t=>$l(t);function Pp(t,e){return t.composing?!0:yt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const K5=_n?5e3:-1;kt.compositionstart=kt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),vs(t,!0),t.markCursor=null;else if(vs(t,!e.selection.empty),en&&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){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Rp(t,K5)},kt.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++,Rp(t,20))};function Rp(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>vs(t),e))}function Fp(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=J5());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function G5(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=jT(e.focusNode,e.focusOffset),r=zT(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 J5(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function vs(t,e=!1){if(!(_n&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Fp(t),e||t.docView&&t.docView.dirty){let n=xl(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Z5(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 io=_t&&Kn<15||ii&&qT<604;bt.copy=kt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=io?null:n.clipboardData,s=r.content(),{dom:a,text:c}=Ol(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",c)):Z5(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function X5(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Q5(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?oo(t,r.value,null,i,e):oo(t,r.textContent,r.innerHTML,i,e)},50)}function oo(t,e,n,r,i){let o=Np(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||ne.empty)))return!0;if(!o)return!1;let s=X5(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function jp(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," "):""}kt.paste=(t,e)=>{let n=e;if(t.composing&&!_n)return;let r=io?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&oo(t,jp(r),r.getData("text/html"),i,n)?n.preventDefault():Q5(t,n)};class zp{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Hp=zt?"altKey":"ctrlKey";bt.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(ks(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof pe?i.to-1:i.to))){if(r&&r.mightDrag)s=pe.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=pe.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=Ol(t,a);(!n.dataTransfer.files.length||!ut||Gh>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(io?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",io||n.dataTransfer.setData("text/plain",d),t.dragging=new zp(u,!n[Hp],s)},bt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},kt.dragover=kt.dragenter=(t,e)=>e.preventDefault(),kt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(ks(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=Np(t,jp(n.dataTransfer),io?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[Hp]);if(t.someProp("handleDrop",m=>m(t,n,s||ne.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?Dh(t.state.doc,o.pos,s):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(a){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&&pe.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new pe(p));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,y,k,x)=>m=x),d.setSelection(Cl(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},bt.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())&&Tn(t)},20))},bt.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)},bt.beforeinput=(t,e)=>{if(ut&&_n&&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,wr(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 kt)bt[t]=kt[t];function so(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 ws{constructor(e,n){this.toDOM=e,this.spec=n||Sr,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 It(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ws&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&so(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Qn{constructor(e,n){this.attrs=e,this.spec=n||Sr}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 It(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Qn&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}static is(e){return e.type instanceof Qn}destroy(){}}class Ll{constructor(e,n){this.attrs=e,this.spec=n||Sr}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 It(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 Ll&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}destroy(){}}class It{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new It(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 It(e,e,new ws(n,r))}static inline(e,n,r,i){return new It(e,n,new Qn(r,i))}static node(e,n,r,i){return new It(e,n,new Ll(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Qn}get widget(){return this.type instanceof ws}}const li=[],Sr={};class Ye{constructor(e,n){this.local=e.length?e:li,this.children=n.length?n:li}static create(e,n){return n.length?xs(n,e,0,Sr):ft}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==ft||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Sr)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let c=this.local[a].map(e,r,i);c&&c.type.valid(n,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?eN(this.children,s||[],e,n,r,i,o):s?new Ye(s.sort(_r),li):ft}add(e,n){return n.length?this==ft?Ye.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,c)=>{let d=c+r,u;if(u=Up(n,a,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(a,u,d+1):i.splice(o,0,c,c+a.nodeSize,xs(u,a,d+1,Sr)),o+=3}});let s=Wp(o?Yp(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ye(s.length?this.local.concat(s).sort(_r):this.local,i||this.children)}remove(e){return e.length==0||this==ft?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,c=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&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,a+1);d!=ft?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ye(i,r):ft}forChild(e,n){if(this==ft)return this;if(n.isLeaf)return Ye.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let c=this.local[a];if(c.from<s&&c.to>o&&c.type instanceof Qn){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 a=new Ye(i.sort(_r),li);return r?new er([a,r]):a}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof Ye)||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 Bl(this.localsInner(e))}localsInner(e){if(this==ft)return li;if(e.inlineContent||!this.local.some(Qn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Qn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=Bl;const ft=Ye.empty;class er{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Sr));return er.from(r)}forChild(e,n){if(n.isLeaf)return Ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=ft&&(o instanceof er?r=r.concat(o.members):r.push(o))}return er.from(r)}eq(e){if(!(e instanceof er)||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?Bl(r?n:n.sort(_r)):li}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new er(e.every(n=>n instanceof Ye)?e:e.reduce((n,r)=>n.concat(r instanceof Ye?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function eN(t,e,n,r,i,o,s){let a=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let k=0;k<a.length;k+=3){let x=a[k+1];if(x<0||h>x+u-f)continue;let v=a[k]+u-f;p>=v?a[k+1]=h<=v?-2:-1:h>=u&&y&&(a[k]+=y,a[k+1]+=y)}f+=y}),u=n.maps[d].map(u,-1)}let c=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){c=!0,a[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:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let k=a[d+2].mapInner(n,y,u+1,t[d]+o+1,s);k!=ft?(a[d]=f,a[d+1]=p,a[d+2]=k):(a[d+1]=-2,c=!0)}else c=!0}if(c){let d=tN(a,t,e,n,i,o,s),u=xs(d,r,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<a.length&&a[h]<p;)h+=3;a.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ye(e.sort(_r),a)}function Wp(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 It(i.from+e,i.to+e,i.type))}return n}function tN(t,e,n,r,i,o,s){function a(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)a(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&a(t[c+2],e[c]+o+1);return n}function Up(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 Yp(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function xs(t,e,n,r){let i=[],o=!1;e.forEach((a,c)=>{let d=Up(t,a,c+n);if(d){o=!0;let u=xs(d,a,n+c+1,r);u!=ft&&i.push(c,c+a.nodeSize,u)}});let s=Wp(o?Yp(t):t,-n).sort(_r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ye(s,i):ft}function _r(t,e){return t.from-e.from||t.to-e.to}function Bl(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),qp(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),qp(e,i,r.copy(o.from,r.to)));break}}}return e}function qp(t,e,n){for(;e<t.length&&_r(n,t[e])>0;)e++;t.splice(e,0,n)}function Il(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ft&&e.push(r)}),t.cursorWrapper&&e.push(Ye.create(t.state.doc,[t.cursorWrapper.deco])),er.from(e)}const nN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},rN=_t&&Kn<=11;class iN{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 oN{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new iN,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]);_t&&Kn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),rN&&(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,nN)),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(wp(this.view)){if(this.suppressingSelectionUpdates)return Tn(this.view);if(_t&&Kn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vr(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=Zi(o))n.add(o);for(let o=e.anchorNode;o;o=Zi(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)&&wp(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!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&&(a=!0))}if(en&&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||lN(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&&ms(r)&&(d=xl(e))&&d.eq(xe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Tn(e),this.currentSelection.set(r)):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),sN(e)),this.handleDOMChange(o,s,a,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Tn(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(_t&&Kn<=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?ot(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),c=o&&o.parentNode==e.target?ot(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:a,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Kp=new WeakMap,Gp=!1;function sN(t){if(!Kp.has(t)&&(Kp.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=en,Gp)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."),Gp=!0}}function Jp(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return vr(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function aN(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Jp(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?Jp(t,n):null}function lN(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 cN(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=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}],ms(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ut&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let k=r.childNodes[y-1],x=k.pmViewDesc;if(k.nodeName=="BR"&&!x){o=y;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||Hn.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:dN,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,k=d[1]&&d[1].pos;k==null&&(k=y),m={anchor:y+s,head:k+s}}return{doc:g,sel:m,from:s,to:a}}function dN(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(yt&&/^(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||yt&&/^(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 uN=/^(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 fN(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let S=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,D=xl(t,S);if(D&&!t.state.selection.eq(D)){if(ut&&_n&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",$=>$(t,wr(13,"Enter"))))return;let F=t.state.tr.setSelection(D);S=="pointer"?F.setMeta("pointer",!0):S=="key"&&F.scrollIntoView(),o&&F.setMeta("composition",o),t.dispatch(F)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let c=t.state.selection,d=cN(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=mN(f.content,d.doc.content,d.from,h,p);if(m&&t.input.domChangeCount++,(ii&&t.input.lastIOSEnter>Date.now()-225||_n)&&i.some(S=>S.nodeType==1&&!uN.test(S.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",S=>S(t,wr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ke&&!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 S=Zp(t,t.state.doc,d.sel);if(S&&!S.eq(t.state.selection)){let D=t.state.tr.setSelection(S);o&&D.setMeta("composition",o),t.dispatch(D)}}return}t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ke&&(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)),_t&&Kn<=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),k=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&k.end()>=m.endA,v;if((ii&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!x&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(v=xe.findFrom(d.doc.resolve(g.pos+1),1,!0))&&v.head==y.pos)&&t.someProp("handleKeyDown",S=>S(t,wr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&pN(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",S=>S(t,wr(8,"Backspace")))){_n&&ut&&t.domObserver.suppressSelectionUpdates();return}ut&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),_n&&!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(S){return S(t,wr(13,"Enter"))})},20));let b=m.start,C=m.endA,w,N,L;if(x){if(g.pos==y.pos)_t&&Kn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Tn(t),20)),w=t.state.tr.delete(b,C),N=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(L=hN(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))w=t.state.tr,L.type=="add"?w.addMark(b,C,L.mark):w.removeMark(b,C,L.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let S=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",D=>D(t,b,C,S)))return;w=t.state.tr.insertText(S,b,C)}}if(w||(w=t.state.tr.replace(b,C,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let S=Zp(t,w.doc,d.sel);S&&!(ut&&t.composing&&S.empty&&(m.start!=m.endB||t.input.lastChromeDelete<Date.now()-100)&&(S.head==b||S.head==w.mapping.map(C)-1)||_t&&S.empty&&S.head==b)&&w.setSelection(S)}N&&w.ensureMarks(N),o&&w.setMeta("composition",o),t.dispatch(w.scrollIntoView())}function Zp(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Cl(t,e.resolve(n.anchor),e.resolve(n.head))}function hN(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,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)a=i[0],s="add",c=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",c=u=>u.mark(a.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(J.from(d).eq(t))return{mark:a,type:s}}function pN(t,e,n,r,i){if(n-e<=i.pos-r.pos||Vl(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Vl(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Vl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Vl(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 mN(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,a));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&&Xp(e.textBetween(o-1,o+1))&&(o+=c?1:-1),a=o+(a-s),s=o}else if(a<o){let c=r<=o&&r>=a?o-r:0;o-=c,o&&o<t.size&&Xp(t.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function Xp(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 gN{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 B5,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(rm),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=tm(this),em(this),this.nodeViews=nm(this),this.docView=cp(this.state.doc,Qp(this),Il(this),this.dom,this),this.domObserver=new oN(this,(r,i,o,s)=>fN(this,r,i,o,s)),this.domObserver.start(),I5(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&&Ml(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(rm),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&&(Fp(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=nm(this);bN(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ml(this),this.editable=tm(this),em(this);let c=Il(this),d=Qp(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&&JT(this);if(s){this.domObserver.stop();let p=f&&(_t||ut)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&yN(i.selection,e.selection);if(f){let m=ut?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=G5(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=cp(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&v5(this))?Tn(this,p):(kp(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&&ZT(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof pe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Jh(this,n.getBoundingClientRect(),e)}else Jh(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 zp(e.slice,e.move,i<0?void 0:pe.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(_t){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&&XT(this.dom),Tn(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 r5(this,e)}coordsAtPos(e,n=1){return np(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 l5(this,n||this.state,e)}pasteHTML(e,n){return oo(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return oo(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ol(this,e)}destroy(){this.docView&&(V5(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Il(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,RT())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return R5(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 e?yt&&this.root.nodeType===11&&WT(this.dom.ownerDocument)==this.dom&&aN(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Qp(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"),[It.node(0,t.state.doc.content.size,e)]}function em(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:It.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function tm(t){return!t.someProp("editable",e=>e(t.state)===!1)}function yN(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 nm(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 bN(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 rm(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 tr={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:"'"},Es={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kN=typeof navigator<"u"&&/Mac/.test(navigator.platform),vN=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),st=0;st<10;st++)tr[48+st]=tr[96+st]=String(st);for(var st=1;st<=24;st++)tr[st+111]="F"+st;for(var st=65;st<=90;st++)tr[st]=String.fromCharCode(st+32),Es[st]=String.fromCharCode(st);for(var Pl in tr)Es.hasOwnProperty(Pl)||(Es[Pl]=tr[Pl]);function wN(t){var e=kN&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||vN&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Es:tr)[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 xN=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function EN(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let c=e[a];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))xN?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 CN(t){let e=Object.create(null);for(let n in t)e[EN(n)]=t[n];return e}function Rl(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 SN(t){return new it({props:{handleKeyDown:im(t)}})}function im(t){let e=CN(t);return function(n,r){let i=wN(r),o,s=e[Rl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Rl(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=tr[r.keyCode])&&o!=i){let a=e[Rl(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Fl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function om(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const sm=(t,e,n)=>{let r=om(t,n);if(!r)return!1;let i=jl(r);if(!i){let s=r.blockRange(),a=s&&Qr(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(mm(t,i,e,-1))return!0;if(r.parent.content.size==0&&(ci(o,"end")||pe.isSelectable(o)))for(let s=r.depth;;s--){let a=hs(t.doc,r.before(s),r.after(s),ne.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(ci(o,"end")?xe.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):pe.create(c.doc,i.pos-o.nodeSize)),e(c.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},_N=(t,e,n)=>{let r=om(t,n);if(!r)return!1;let i=jl(r);return i?am(t,i,e):!1},ON=(t,e,n)=>{let r=cm(t,n);if(!r)return!1;let i=zl(r);return i?am(t,i,e):!1};function am(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,a=s,c=e.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let d=hs(t.doc,o,c,ne.empty);if(!d||d.from!=o||d instanceof Ze&&d.slice.size>=c-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(ke.create(u.doc,o)),n(u.scrollIntoView())}return!0}function ci(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 lm=(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=jl(r)}let s=o&&o.nodeBefore;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function jl(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 cm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const dm=(t,e,n)=>{let r=cm(t,n);if(!r)return!1;let i=zl(r);if(!i)return!1;let o=i.nodeAfter;if(mm(t,i,e,1))return!0;if(r.parent.content.size==0&&(ci(o,"start")||pe.isSelectable(o))){let s=hs(t.doc,r.before(),r.after(),ne.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(ci(o,"start")?xe.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):pe.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},um=(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=zl(r)}let s=o&&o.nodeAfter;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos)).scrollIntoView()),!0)};function zl(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 TN=(t,e)=>{let n=t.selection,r=n instanceof pe,i;if(r){if(n.node.isTextblock||!Yn(t.doc,n.from))return!1;i=n.from}else if(i=fs(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(pe.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},NN=(t,e)=>{let n=t.selection,r;if(n instanceof pe){if(n.node.isTextblock||!Yn(t.doc,n.to))return!1;r=n.to}else if(r=fs(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},MN=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Qr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},fm=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
36
|
+
`).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 AN=(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 a=n.after(),c=t.tr.replaceWith(a,a,s.createAndFill());c.setSelection(xe.near(c.doc.resolve(a),1)),e(c.scrollIntoView())}return!0},hm=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Lt||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,a=t.tr.insert(s,o.createAndFill());a.setSelection(ke.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},pm=(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(Cn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Qr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function DN(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof pe&&e.selection.node.isBlock)return!r.parentOffset||!Cn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,c=!1,d=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){c=r.end(p)==r.pos+(r.depth-p),d=r.start(p)==r.pos-(r.depth-p),a=Hl(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),o.unshift(c&&a?{type:a}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof ke||e.selection instanceof Lt)&&u.deleteSelection();let f=u.mapping.map(r.pos),h=Cn(u.doc,f,o.length,o);if(h||(o[0]=a?{type:a}:null,h=Cn(u.doc,f,o.length,o)),u.split(f,o.length,o),!c&&d&&r.node(s).type!=a){let p=u.mapping.map(r.before(s)),m=u.doc.resolve(p);a&&r.node(s-1).canReplaceWith(m.index(),m.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const $N=DN(),LN=(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(pe.create(t.doc,i))),!0)};function BN(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||Yn(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function mm(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&BN(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,m=J.empty;for(let k=s.length-1;k>=0;k--)m=J.from(s[k].create(null,m));m=J.from(i.copy(m));let g=t.tr.step(new Xe(e.pos-1,p,e.pos,p,new ne(m,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Yn(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&c?null:xe.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),h=f&&Qr(f);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(f,h).scrollIntoView()),!0;if(d&&ci(o,"start",!0)&&ci(i,"end")){let p=i,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let k=J.empty;for(let v=m.length-1;v>=0;v--)k=J.from(m[v].copy(k));let x=t.tr.step(new Xe(e.pos-m.length,e.pos+o.nodeSize,e.pos+y,e.pos+o.nodeSize-y,new ne(k,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function gm(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(ke.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const IN=gm(-1),VN=gm(1);function PN(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&al(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function ym(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(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:a},$to:{pos:c}}=n.selection.ranges[s];o.setBlockType(a,c,t,e)}r(o.scrollIntoView())}return!0}}function Wl(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Wl(Fl,sm,lm),Wl(Fl,dm,um),Wl(fm,hm,pm,$N),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function RN(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return FN(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function FN(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=s.resolve(e.start-2);o=new is(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new is(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=al(o,n,r,e);return a?(t&&jN(t,e,a,i,n),!0):!1}function jN(t,e,n,r,i){let o=J.empty;for(let u=n.length-1;u>=0;u--)o=J.from(n[u].type.create(n[u].attrs,o));t.step(new Xe(e.start-(r?2:0),e.end,e.start,e.end,new ne(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,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&&Cn(t.doc,c,a)&&(t.split(c,a),c+=2*a),c+=d.child(u).nodeSize;return t}function zN(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?HN(e,n,t,o):WN(e,n,o):!0:!1}}function HN(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Xe(o-1,s,o,s,new ne(J.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new is(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Qr(r);if(a==null)return!1;i.lift(r,a);let c=i.mapping.map(o,-1)-1;return Yn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function WN(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,c=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(a?0:1),u+1,s.content.append(c?J.empty:J.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Xe(f-(a?1:0),h+(c?1:0),f+1,h-1,new ne((a?J.empty:J.from(i.copy(J.empty))).append(c?J.empty:J.from(i.copy(J.empty))),a?0:1,c?0:1),a?0:1)),e(r.scrollIntoView()),!0}function UN(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,c=a.child(s-1);if(c.type!=t)return!1;if(n){let d=c.lastChild&&c.lastChild.type==a.type,u=J.from(d?t.create():null),f=new ne(J.from(t.create(null,J.from(a.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Xe(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function Cs(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 Ss{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,c])=>[a,(...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,a=[],c=!!e,d=e||o.tr,u=()=>(!c&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),a.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...g)=>{const y=this.buildProps(d,n),k=p(...g)(y);return a.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,a={tr:e,editor:i,view:s,state:Cs({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)(a)]))}};return a}}class YN{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}once(e,n){const r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function ae(t,e,n){return t.config[e]===void 0&&t.parent?ae(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ae(t.parent,e,n):null}):t.config[e]}function _s(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function bm(t){const e=[],{nodeExtensions:n,markExtensions:r}=_s(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},c=ae(s,"addGlobalAttributes",a);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 a={name:s.name,options:s.options,storage:s.storage},c=ae(s,"addAttributes",a);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 Qe(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 Fe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?String(o).split(" "):[],c=r[i]?r[i].split(" "):[],d=a.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else if(i==="style"){const a=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],d=new Map;c.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),a.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),r[i]=Array.from(d.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function Ul(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Fe(n,r),{})}function km(t){return typeof t=="function"}function Ce(t,e=void 0,...n){return km(t)?e?t.bind(e)(...n):t(...n):t}function qN(t={}){return Object.keys(t).length===0&&t.constructor===Object}function KN(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function vm(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):KN(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function wm(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&qN(n)?!1:n!=null))}function GN(t,e){var n;const r=bm(t),{nodeExtensions:i,markExtensions:o}=_s(t),s=(n=i.find(d=>ae(d,"topNode")))===null||n===void 0?void 0:n.name,a=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,x)=>{const v=ae(x,"extendNodeSchema",f);return{...k,...v?v(d):{}}},{}),p=wm({...h,content:Ce(ae(d,"content",f)),marks:Ce(ae(d,"marks",f)),group:Ce(ae(d,"group",f)),inline:Ce(ae(d,"inline",f)),atom:Ce(ae(d,"atom",f)),selectable:Ce(ae(d,"selectable",f)),draggable:Ce(ae(d,"draggable",f)),code:Ce(ae(d,"code",f)),whitespace:Ce(ae(d,"whitespace",f)),linebreakReplacement:Ce(ae(d,"linebreakReplacement",f)),defining:Ce(ae(d,"defining",f)),isolating:Ce(ae(d,"isolating",f)),attrs:Object.fromEntries(u.map(k=>{var x;return[k.name,{default:(x=k==null?void 0:k.attribute)===null||x===void 0?void 0:x.default}]}))}),m=Ce(ae(d,"parseHTML",f));m&&(p.parseDOM=m.map(k=>vm(k,u)));const g=ae(d,"renderHTML",f);g&&(p.toDOM=k=>g({node:k,HTMLAttributes:Ul(k,u)}));const y=ae(d,"renderText",f);return y&&(p.toText=y),[d.name,p]})),c=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,k)=>{const x=ae(k,"extendMarkSchema",f);return{...y,...x?x(d):{}}},{}),p=wm({...h,inclusive:Ce(ae(d,"inclusive",f)),excludes:Ce(ae(d,"excludes",f)),group:Ce(ae(d,"group",f)),spanning:Ce(ae(d,"spanning",f)),code:Ce(ae(d,"code",f)),attrs:Object.fromEntries(u.map(y=>{var k;return[y.name,{default:(k=y==null?void 0:y.attribute)===null||k===void 0?void 0:k.default}]}))}),m=Ce(ae(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>vm(y,u)));const g=ae(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:Ul(y,u)})),[d.name,p]}));return new fh({topNode:s,nodes:a,marks:c})}function Yl(t,e){return e.nodes[t]||e.marks[t]||null}function xm(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function ql(t,e){const n=kr.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const JN=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{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:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function Kl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Os{constructor(e){this.find=e.find,this.handler=e.handler}}const ZN=(t,e)=>{if(Kl(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 Ts(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=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=JN(d)+o;return s.forEach(h=>{if(u)return;const p=ZN(f,h.find);if(!p)return;const m=c.state.tr,g=Cs({state:c.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:k,chain:x,can:v}=new Ss({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:k,chain:x,can:v})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function XN(t){const{editor:e,rules:n}=t,r=new it({state:{init(){return null},apply(i,o,s){const a=i.getMeta(r);if(a)return a;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=ql(J.from(u),s.schema);const{from:f}=c,h=f+u.length;Ts({editor:e,from:f,to:h,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return Ts({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ts({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?Ts({editor:e,from:s.pos,to:s.pos,text:`
|
|
37
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function QN(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ns(t){return QN(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Ms(t,e){const n={...t};return Ns(t)&&Ns(e)&&Object.keys(e).forEach(r=>{Ns(e[r])&&Ns(t[r])?n[r]=Ms(t[r],e[r]):n[r]=e[r]}),n}class Wt{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=Ce(ae(this,"addOptions",{name:this.name}))),this.storage=Ce(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Wt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ms(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Wt(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.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: "${n.name}".`),n.options=Ce(ae(n,"addOptions",{name:n.name})),n.storage=Ce(ae(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}}function eM(t){return typeof t=="number"}class tM{constructor(e){this.find=e.find,this.handler=e.handler}}const nM=(t,e,n)=>{if(Kl(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 rM(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:c,chain:d,can:u}=new Ss({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),k=p.textBetween(g-m,y-m,void 0,"");nM(k,o.find,s).forEach(v=>{if(v.index===void 0)return;const b=g+v.index+1,C=b+v[0].length,w={from:n.tr.mapping.map(b),to:n.tr.mapping.map(C)},N=o.handler({state:n,range:w,match:v,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:a});f.push(N)})}),f.every(p=>p!==null)}let As=null;const iM=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 oM(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const c=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const g=u.tr,y=Cs({state:u,transaction:g});if(!(!rM({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new it({view(f){const h=m=>{var g;r=!((g=f.dom.parentElement)===null||g===void 0)&&g.contains(m.target)?f.dom.parentElement:null,r&&(As=e)},p=()=>{As&&(As=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,h)=>{if(o=r===f.dom.parentElement,a=h,!o){const p=As;p&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!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,k=m.getMeta("applyPasteRules"),x=!!k;if(!g&&!y&&!x)return;if(x){let{text:C}=k;typeof C=="string"?C=C:C=ql(J.from(C),p.schema);const{from:w}=k,N=w+C.length,L=iM(C);return c({rule:u,state:p,from:w,to:{b:N},pasteEvt:L})}const v=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!eM(v)||!b||v===b.b))return c({rule:u,state:p,from:v,to:b,pasteEvt:s})}}))}function sM(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class di{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=di.resolve(e),this.schema=GN(this.extensions,n),this.setupExtensions()}static resolve(e){const n=di.sort(di.flatten(e)),r=sM(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=ae(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=ae(r,"priority")||100,s=ae(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=ae(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=di.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Yl(s.name,this.schema)},c=[],d=ae(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&ae(s,"exitable",a)&&(u.ArrowRight=()=>Wt.handleExit({editor:e,mark:s})),d){const g=Object.fromEntries(Object.entries(d()).map(([y,k])=>[y,()=>k({editor:e})]));u={...u,...g}}const f=SN(u);c.push(f);const h=ae(s,"addInputRules",a);xm(s,e.options.enableInputRules)&&h&&r.push(...h());const p=ae(s,"addPasteRules",a);xm(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=ae(s,"addProseMirrorPlugins",a);if(m){const g=m();c.push(...g)}return c}).flat();return[XN({editor:e,rules:r}),...oM({editor:e,rules:i}),...o]}get attributes(){return bm(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=_s(this.extensions);return Object.fromEntries(n.filter(r=>!!ae(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:Qe(r.name,this.schema)},s=ae(r,"addNodeView",o);if(!s)return[];const a=(c,d,u,f,h)=>{const p=Ul(c,i);return s()({node:c,view:d,getPos:u,decorations:f,innerDecorations:h,editor:e,extension:r,HTMLAttributes:p})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Yl(e.name,this.schema)};e.type==="mark"&&(!((n=Ce(ae(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=ae(e,"onBeforeCreate",r),o=ae(e,"onCreate",r),s=ae(e,"onUpdate",r),a=ae(e,"onSelectionUpdate",r),c=ae(e,"onTransaction",r),d=ae(e,"onFocus",r),u=ae(e,"onBlur",r),f=ae(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}class qe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ce(ae(this,"addOptions",{name:this.name}))),this.storage=Ce(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qe(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ms(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new qe({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ce(ae(n,"addOptions",{name:n.name})),n.storage=Ce(ae(n,"addStorage",{name:n.name,options:n.options})),n}}function Em(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
38
|
+
|
|
39
|
+
`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(a+=o);const p=s==null?void 0:s[c.type.name];if(p)return u&&(a+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(a+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),a}function Cm(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const aM=qe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new it({key:new Bt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),c=Cm(n);return Em(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),lM=()=>({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),cM=(t=!1)=>({commands:e})=>e.setContent("",t),dM=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,c)=>{if(a.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+a.nodeSize)),p=f.blockRange(h);if(!p)return;const m=Qr(p);if(a.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},uM=t=>e=>t(e),fM=()=>({state:t,dispatch:e})=>hm(t,e),hM=(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 ke(r.doc.resolve(s-1))),!0},pM=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),c=i.after(o);t.delete(a,c).scrollIntoView()}return!0}return!1},mM=t=>({tr:e,state:n,dispatch:r})=>{const i=Qe(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},gM=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},yM=()=>({state:t,dispatch:e})=>Fl(t,e),bM=()=>({commands:t})=>t.keyboardShortcut("Enter"),kM=()=>({state:t,dispatch:e})=>AN(t,e);function Ds(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Kl(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Sm(t,e,n={}){return t.find(r=>r.type===e&&Ds(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function _m(t,e,n={}){return!!Sm(t,e,n)}function Gl(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!Sm([...i.node.marks],e,n)))return;let s=i.index,a=t.start()+i.offset,c=s+1,d=a+i.node.nodeSize;for(;s>0&&_m([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;c<t.parent.childCount&&_m([...t.parent.child(c).marks],e,n);)d+=t.parent.child(c).nodeSize,c+=1;return{from:a,to:d}}function nr(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 vM=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=nr(t,r.schema),{doc:s,selection:a}=n,{$from:c,from:d,to:u}=a;if(i){const f=Gl(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=ke.create(s,f.from,f.to);n.setSelection(h)}}return!0},wM=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 Jl(t){return t instanceof ke}function Nn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Om(t,e=null){if(!e)return null;const n=xe.atStart(t),r=xe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?ke.create(t,Nn(0,i,o),Nn(t.content.size,i,o)):ke.create(t,Nn(e,i,o),Nn(e,i,o))}function xM(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Zl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const EM=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Zl()||xM())&&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&&!Jl(n.state.selection))return s(),!0;const a=Om(i.doc,t)||n.state.selection,c=n.state.selection.eq(a);return o&&(c||i.setSelection(a),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},CM=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),SM=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Tm=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&&Tm(r)}return t};function $s(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Tm(n)}function Ls(t,e,n){if(t instanceof zn||t instanceof J)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return J.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Ls("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const c=new fh({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Hn.fromSchema(c).parseSlice($s(t),n.parseOptions):Hn.fromSchema(c).parse($s(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Hn.fromSchema(e);return n.slice?o.parseSlice($s(t),n.parseOptions).content:o.parse($s(t),n.parseOptions)}return Ls("",e,n)}function _M(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ze||i instanceof Xe))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,c,d,u)=>{s===0&&(s=u)}),t.setSelection(xe.near(t.doc.resolve(s),n))}const OM=t=>!("type"in t),TM=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=Ls(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,f=!0;if((OM(a)?a:[a]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,f=f?m.isBlock:!1}),c===d&&f){const{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,d+=1)}let p;if(u){if(Array.isArray(e))p=e.map(m=>m.text||"").join("");else if(e instanceof J){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),p=m}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,c,d)}else p=a,r.replaceWith(c,d,p);n.updateSelection&&_M(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},NM=()=>({state:t,dispatch:e})=>TN(t,e),MM=()=>({state:t,dispatch:e})=>NN(t,e),AM=()=>({state:t,dispatch:e})=>sm(t,e),DM=()=>({state:t,dispatch:e})=>dm(t,e),$M=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fs(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},LM=()=>({state:t,dispatch:e,tr:n})=>{try{const r=fs(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},BM=()=>({state:t,dispatch:e})=>_N(t,e),IM=()=>({state:t,dispatch:e})=>ON(t,e);function Nm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function VM(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){const c=e[a];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))Zl()||Nm()?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 PM=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=VM(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ao(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Qe(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);a.push({node:f,from:p,to:m})});const c=i-r,d=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>Ds(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}const RM=(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return ao(n,i,e)?MN(n,r):!1},FM=()=>({state:t,dispatch:e})=>pm(t,e),jM=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return zN(r)(e,n)},zM=()=>({state:t,dispatch:e})=>fm(t,e);function Bs(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Mm(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 HM=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Bs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Qe(t,r.schema)),a==="mark"&&(s=nr(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,Mm(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Mm(f.attrs,e)))})})}),!0):!1},WM=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),UM=()=>({tr:t,dispatch:e})=>{if(e){const n=new Lt(t.doc);t.setSelection(n)}return!0},YM=()=>({state:t,dispatch:e})=>lm(t,e),qM=()=>({state:t,dispatch:e})=>um(t,e),KM=()=>({state:t,dispatch:e})=>LN(t,e),GM=()=>({state:t,dispatch:e})=>VN(t,e),JM=()=>({state:t,dispatch:e})=>IN(t,e);function Xl(t,e,n={},r={}){return Ls(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const ZM=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var c,d;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const f=Xl(t,i.schema,n,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function Is(t,e){const n=nr(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 a=s.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function XM(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 QM(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 Ql(t){return e=>QM(e.$from,t)}function eA(t,e){const n={from:0,to:t.content.size};return Em(t,n,e)}function tA(t,e){const n=Qe(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function nA(t,e){const n=Bs(typeof e=="string"?e:e.name,t.schema);return n==="node"?tA(t,e):n==="mark"?Is(t,e):{}}function Am(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t),s=Gl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Vs(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 ec(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?nr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ds(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const k=Math.max(p,y),x=Math.min(m,y+g.nodeSize),v=x-k;s+=v,a.push(...g.marks.map(b=>({mark:b,from:k,to:x})))})}),s===0)return!1;const c=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ds(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(c>0?c+d:c)>=s}function rA(t,e,n={}){if(!e)return ao(t,null,n)||ec(t,null,n);const r=Bs(e,t.schema);return r==="node"?ao(t,e,n):r==="mark"?ec(t,e,n):!1}function Dm(t,e){const{nodeExtensions:n}=_s(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ce(ae(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function tc(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(tc(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function iA(t){return t instanceof pe}function $m(t,e,n){const i=t.state.doc.content.size,o=Nn(e,0,i),s=Nn(n,0,i),a=t.coordsAtPos(o),c=t.coordsAtPos(s,-1),d=Math.min(a.top,c.top),u=Math.max(a.bottom,c.bottom),f=Math.min(a.left,c.left),h=Math.max(a.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 oA(t,e,n){var r;const{selection:i}=e;let o=null;if(Jl(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(c=>c.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:c})=>{let d=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.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(g=>g.type.excludes(n));d=p&&m}return!d}),d})}const sA=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,c=nr(t,r.schema);if(i)if(s){const d=Is(r,c);n.addStoredMark(c.create({...d,...e}))}else a.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),g=Math.min(p+h.nodeSize,f);h.marks.find(k=>k.type===c)?h.marks.forEach(k=>{c===k.type&&n.addMark(m,g,c.create({...k.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return oA(r,n,c)},aA=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),lA=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Qe(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>ym(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>ym(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},cA=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Nn(t,0,r.content.size),o=pe.create(r,i);e.setSelection(o)}return!0},dA=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=ke.atStart(r).from,a=ke.atEnd(r).to,c=Nn(i,s,a),d=Nn(o,s,a),u=ke.create(r,c,d);e.setSelection(u)}return!0},uA=t=>({state:e,dispatch:n})=>{const r=Qe(t,e.schema);return UN(r)(e,n)};function Lm(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 fA=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:c}=o,d=i.extensionManager.attributes,u=Vs(d,a.node().type.name,a.node().attrs);if(o instanceof pe&&o.node.isBlock)return!a.parentOffset||!Cn(s,a.pos)?!1:(r&&(t&&Lm(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,h=a.depth===0?void 0:XM(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Cn(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&Cn(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),r){if(m&&(o instanceof ke&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),h&&!f&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Lm(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},hA=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=Qe(t,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const f=c.node(-1);if(f.type!==a)return!1;const h=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let k=J.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let L=c.depth-x;L>=c.depth-3;L-=1)k=J.from(c.node(L).copy(k));const v=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,b={...Vs(h,c.node().type.name,c.node().attrs),...e},C=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;k=k.append(J.from(a.createAndFill(null,C)||void 0));const w=c.before(c.depth-(x-1));n.replace(w,c.after(-v),new ne(k,4-x,0));let N=-1;n.doc.nodesBetween(w,n.doc.content.size,(L,S)=>{if(N>-1)return!1;L.isTextblock&&L.content.size===0&&(N=S+1)}),N>-1&&n.setSelection(ke.near(n.doc.resolve(N))),n.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Vs(h,f.type.name,f.attrs),...e},g={...Vs(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const y=p?[{type:a,attrs:m},{type:p,attrs:g}]:[{type:a,attrs:m}];if(!Cn(n.doc,c.pos,2))return!1;if(i){const{selection:k,storedMarks:x}=r,{splittableMarks:v}=o.extensionManager,b=x||k.$to.parentOffset&&k.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!b||!i)return!0;const C=b.filter(w=>v.includes(w.type.name));n.ensureMarks(C)}return!0},nc=(t,e)=>{const n=Ql(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)&&Yn(t.doc,n.pos)&&t.join(n.pos),!0},rc=(t,e)=>{const n=Ql(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)&&Yn(t.doc,r)&&t.join(r),!0};var pA=Object.freeze({__proto__:null,blur:lM,clearContent:cM,clearNodes:dM,command:uM,createParagraphNear:fM,cut:hM,deleteCurrentNode:pM,deleteNode:mM,deleteRange:gM,deleteSelection:yM,enter:bM,exitCode:kM,extendMarkRange:vM,first:wM,focus:EM,forEach:CM,insertContent:SM,insertContentAt:TM,joinBackward:AM,joinDown:MM,joinForward:DM,joinItemBackward:$M,joinItemForward:LM,joinTextblockBackward:BM,joinTextblockForward:IM,joinUp:NM,keyboardShortcut:PM,lift:RM,liftEmptyBlock:FM,liftListItem:jM,newlineInCode:zM,resetAttributes:HM,scrollIntoView:WM,selectAll:UM,selectNodeBackward:YM,selectNodeForward:qM,selectParentNode:KM,selectTextblockEnd:GM,selectTextblockStart:JM,setContent:ZM,setMark:sA,setMeta:aA,setNode:lA,setNodeSelection:cA,setTextSelection:dA,sinkListItem:uA,splitBlock:fA,splitListItem:hA,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Qe(t,s.schema),m=Qe(e,s.schema),{selection:g,storedMarks:y}=s,{$from:k,$to:x}=g,v=k.blockRange(x),b=y||g.$to.parentOffset&&g.$from.marks();if(!v)return!1;const C=Ql(w=>Dm(w.type.name,f))(g);if(v.depth>=1&&C&&v.depth-C.depth<=1){if(C.node.type===p)return d.liftListItem(m);if(Dm(C.node.type.name,f)&&p.validContent(C.node.content)&&a)return c().command(()=>(o.setNodeMarkup(C.pos,p),!0)).command(()=>nc(o,p)).command(()=>rc(o,p)).run()}return!n||!b||!a?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>nc(o,p)).command(()=>rc(o,p)).run():c().command(()=>{const w=u().wrapInList(p,r),N=b.filter(L=>h.includes(L.type.name));return o.ensureMarks(N),w?!0:d.clearNodes()}).wrapInList(p,r).command(()=>nc(o,p)).command(()=>rc(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=nr(t,r.schema);return ec(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Qe(t,r.schema),s=Qe(e,r.schema),a=ao(r,o,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),a?i.setNode(s,c):i.setNode(o,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Qe(t,n.schema);return ao(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let c=a.steps.length-1;c>=0;c-=1)s.step(a.steps[c].invert(a.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:a}=n,c=nr(t,r.schema),{$from:d,empty:u,ranges:f}=a;if(!i)return!0;if(u&&s){let{from:h,to:p}=a;const m=(o=d.marks().find(y=>y.type===c))===null||o===void 0?void 0:o.attrs,g=Gl(d,c,m);g&&(h=g.from,p=g.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 a=Bs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Qe(t,r.schema)),a==="mark"&&(s=nr(t,r.schema)),i&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let f,h,p,m;n.selection.empty?r.doc.nodesBetween(d,u,(g,y)=>{o&&o===g.type&&(p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),f=y,h=g)}):r.doc.nodesBetween(d,u,(g,y)=>{y<d&&o&&o===g.type&&(p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),f=y,h=g),y>=d&&y<=u&&(o&&o===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(k=>{if(s===k.type){const x=Math.max(y,d),v=Math.min(y+g.nodeSize,u);n.addMark(x,v,s.create({...k.attrs,...e}))}}))}),h&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&n.addMark(p,m,s.create({...g.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return PN(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Qe(t,n.schema);return RN(i,e)(n,r)}});const mA=qe.create({name:"commands",addCommands(){return{...pA}}}),gA=qe.create({name:"drop",addProseMirrorPlugins(){return[new it({key:new Bt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),yA=qe.create({name:"editable",addProseMirrorPlugins(){return[new it({key:new Bt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),bA=qe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new it({key:new Bt("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}}}})]}}),kA=qe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:c,doc:d}=a,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?a.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,k=g&&m.parent.childCount===1?y===f.pos:xe.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 Zl()||Nm()?o:i},addProseMirrorPlugins(){return[new it({key:new Bt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),i=t.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:a}=e.selection,c=xe.atStart(e.doc).from,d=xe.atEnd(e.doc).to;if(o||!(s===c&&a===d)||!tc(n.doc))return;const h=n.tr,p=Cs({state:n,transaction:h}),{commands:m}=new Ss({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),vA=qe.create({name:"paste",addProseMirrorPlugins(){return[new it({key:new Bt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),wA=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new it({key:new Bt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Or{get name(){return this.node.type.name}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 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 Or(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 Or(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 Or(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),a=this.resolvedPos.doc.resolve(s);if(!i&&a.depth<=this.depth)return;const c=new Or(a,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new Or(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const c=s[a];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{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const xA=`.ProseMirror {
|
|
40
40
|
position: relative;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -110,36 +110,36 @@ img.ProseMirror-separator {
|
|
|
110
110
|
|
|
111
111
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
112
112
|
opacity: 0
|
|
113
|
-
}`;function
|
|
113
|
+
}`;function EA(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 CA=class extends YN{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!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,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>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.on("contentError",this.options.onContentError),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),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},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=EA(xA,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=km(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=n.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[yA,aM.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),mA,bA,kA,wA,gA,vA].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new di(i,this)}createCommandManager(){this.commandManager=new Ss({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Xl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=Xl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=Om(n,this.options.autofocus);this.view=new gN(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:ri.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),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 nA(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return rA(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ql(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
114
114
|
|
|
115
|
-
`,textSerializers:r={}}=e||{};return tA(this.state.doc,{blockSeparator:n,textSerializers:{...Sm(this.schema),...r}})}get isEmpty(){return tc(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(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,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 Or(n,this)}get $doc(){return this.$pos(0)}};function ui(t){return new Os({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ce(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const c=a.search(/\S/),d=n.from+a.indexOf(s),u=d+s.length;if(Dm(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+c,d);const h=n.from+c+s.length;o.addMark(n.from+c,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function Im(t){return new Os({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ce(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const c=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,a,c)}else if(r[0]){const d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function ic(t){return new Os({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=Ce(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 lo(t){return new Os({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=Ce(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&al(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 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&&Yn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let Ot=class Ic{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=Ce(ae(this,"addOptions",{name:this.name}))),this.storage=Ce(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ic(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ms(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ic(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.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: "${n.name}".`),n.options=Ce(ae(n,"addOptions",{name:n.name})),n.storage=Ce(ae(n,"addStorage",{name:n.name,options:n.options})),n}};function fi(t){return new nM({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=Ce(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],c=r[0];let d=n.to;if(a){const u=c.search(/\S/),f=n.from+c.indexOf(a),h=f+a.length;if(Dm(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+a.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var Tt="top",Ut="bottom",Yt="right",Nt="left",oc="auto",co=[Tt,Ut,Yt,Nt],hi="start",uo="end",_A="clippingParents",Vm="viewport",fo="popper",OA="reference",Pm=co.reduce(function(t,e){return t.concat([e+"-"+hi,e+"-"+uo])},[]),Rm=[].concat(co,[oc]).reduce(function(t,e){return t.concat([e,e+"-"+hi,e+"-"+uo])},[]),TA="beforeRead",NA="read",MA="afterRead",AA="beforeMain",DA="main",$A="afterMain",LA="beforeWrite",BA="write",IA="afterWrite",VA=[TA,NA,MA,AA,DA,$A,LA,BA,IA];function un(t){return t?(t.nodeName||"").toLowerCase():null}function Vt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Tr(t){var e=Vt(t).Element;return t instanceof e||t instanceof Element}function qt(t){var e=Vt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function sc(t){if(typeof ShadowRoot>"u")return!1;var e=Vt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function PA(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];!qt(o)||!un(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function RA(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(c,d){return c[d]="",c},{});!qt(i)||!un(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Fm={name:"applyStyles",enabled:!0,phase:"write",fn:PA,effect:RA,requires:["computeStyles"]};function fn(t){return t.split("-")[0]}var Nr=Math.max,Ps=Math.min,pi=Math.round;function ac(){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 jm(){return!/^((?!chrome|android).)*safari/i.test(ac())}function mi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&qt(t)&&(i=t.offsetWidth>0&&pi(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&pi(r.height)/t.offsetHeight||1);var s=Tr(t)?Vt(t):window,a=s.visualViewport,c=!jm()&&n,d=(r.left+(c&&a?a.offsetLeft:0))/i,u=(r.top+(c&&a?a.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function lc(t){var e=mi(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 zm(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&sc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Mn(t){return Vt(t).getComputedStyle(t)}function FA(t){return["table","td","th"].indexOf(un(t))>=0}function rr(t){return((Tr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Rs(t){return un(t)==="html"?t:t.assignedSlot||t.parentNode||(sc(t)?t.host:null)||rr(t)}function Hm(t){return!qt(t)||Mn(t).position==="fixed"?null:t.offsetParent}function jA(t){var e=/firefox/i.test(ac()),n=/Trident/i.test(ac());if(n&&qt(t)){var r=Mn(t);if(r.position==="fixed")return null}var i=Rs(t);for(sc(i)&&(i=i.host);qt(i)&&["html","body"].indexOf(un(i))<0;){var o=Mn(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 ho(t){for(var e=Vt(t),n=Hm(t);n&&FA(n)&&Mn(n).position==="static";)n=Hm(n);return n&&(un(n)==="html"||un(n)==="body"&&Mn(n).position==="static")?e:n||jA(t)||e}function cc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function po(t,e,n){return Nr(t,Ps(e,n))}function zA(t,e,n){var r=po(t,e,n);return r>n?n:r}function Wm(){return{top:0,right:0,bottom:0,left:0}}function Um(t){return Object.assign({},Wm(),t)}function Ym(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var HA=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Um(typeof e!="number"?e:Ym(e,co))};function WA(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=fn(n.placement),c=cc(a),d=[Nt,Yt].indexOf(a)>=0,u=d?"height":"width";if(!(!o||!s)){var f=HA(i.padding,n),h=lc(o),p=c==="y"?Tt:Nt,m=c==="y"?Ut:Yt,g=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],y=s[c]-n.rects.reference[c],k=ho(o),x=k?c==="y"?k.clientHeight||0:k.clientWidth||0:0,w=g/2-y/2,b=f[p],C=x-h[u]-f[m],v=x/2-h[u]/2+w,S=po(b,v,C),D=c;n.modifiersData[r]=(e={},e[D]=S,e.centerOffset=S-v,e)}}function UA(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)||zm(e.elements.popper,i)&&(e.elements.arrow=i))}const YA={name:"arrow",enabled:!0,phase:"main",fn:WA,effect:UA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gi(t){return t.split("-")[1]}var qA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function KA(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:pi(n*i)/i||0,y:pi(r*i)/i||0}}function qm(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=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,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 k=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),w=Nt,b=Tt,C=window;if(d){var v=ho(n),S="clientHeight",D="clientWidth";if(v===Vt(n)&&(v=rr(n),Mn(v).position!=="static"&&a==="absolute"&&(S="scrollHeight",D="scrollWidth")),v=v,i===Tt||(i===Nt||i===Yt)&&o===uo){b=Ut;var O=f&&v===C&&C.visualViewport?C.visualViewport.height:v[S];g-=O-r.height,g*=c?1:-1}if(i===Nt||(i===Tt||i===Ut)&&o===uo){w=Yt;var $=f&&v===C&&C.visualViewport?C.visualViewport.width:v[D];p-=$-r.width,p*=c?1:-1}}var V=Object.assign({position:a},d&&qA),B=u===!0?KA({x:p,y:g},Vt(n)):{x:p,y:g};if(p=B.x,g=B.y,c){var J;return Object.assign({},V,(J={},J[b]=x?"0":"",J[w]=k?"0":"",J.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",J))}return Object.assign({},V,(e={},e[b]=x?g+"px":"",e[w]=k?p+"px":"",e.transform="",e))}function GA(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,c=a===void 0?!0:a,d={placement:fn(e.placement),variation:gi(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,qm(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,qm(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 JA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:GA,data:{}};var Fs={passive:!0};function ZA(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,c=Vt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,Fs)}),a&&c.addEventListener("resize",n.update,Fs),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Fs)}),a&&c.removeEventListener("resize",n.update,Fs)}}const XA={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ZA,data:{}};var QA={left:"right",right:"left",bottom:"top",top:"bottom"};function js(t){return t.replace(/left|right|bottom|top/g,function(e){return QA[e]})}var e3={start:"end",end:"start"};function Km(t){return t.replace(/start|end/g,function(e){return e3[e]})}function dc(t){var e=Vt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function uc(t){return mi(rr(t)).left+dc(t).scrollLeft}function t3(t,e){var n=Vt(t),r=rr(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;var d=jm();(d||!d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a+uc(t),y:c}}function n3(t){var e,n=rr(t),r=dc(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Nr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Nr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+uc(t),c=-r.scrollTop;return Mn(i||n).direction==="rtl"&&(a+=Nr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}function fc(t){var e=Mn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Gm(t){return["html","body","#document"].indexOf(un(t))>=0?t.ownerDocument.body:qt(t)&&fc(t)?t:Gm(Rs(t))}function mo(t,e){var n;e===void 0&&(e=[]);var r=Gm(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Vt(r),s=i?[o].concat(o.visualViewport||[],fc(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(mo(Rs(s)))}function hc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function r3(t,e){var n=mi(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 Jm(t,e,n){return e===Vm?hc(t3(t,n)):Tr(e)?r3(e,n):hc(n3(rr(t)))}function i3(t){var e=mo(Rs(t)),n=["absolute","fixed"].indexOf(Mn(t).position)>=0,r=n&&qt(t)?ho(t):t;return Tr(r)?e.filter(function(i){return Tr(i)&&zm(i,r)&&un(i)!=="body"}):[]}function o3(t,e,n,r){var i=e==="clippingParents"?i3(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(c,d){var u=Jm(t,d,r);return c.top=Nr(u.top,c.top),c.right=Ps(u.right,c.right),c.bottom=Ps(u.bottom,c.bottom),c.left=Nr(u.left,c.left),c},Jm(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Zm(t){var e=t.reference,n=t.element,r=t.placement,i=r?fn(r):null,o=r?gi(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,c;switch(i){case Tt:c={x:s,y:e.y-n.height};break;case Ut:c={x:s,y:e.y+e.height};break;case Yt:c={x:e.x+e.width,y:a};break;case Nt:c={x:e.x-n.width,y:a};break;default:c={x:e.x,y:e.y}}var d=i?cc(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case hi:c[d]=c[d]-(e[u]/2-n[u]/2);break;case uo:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}function go(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,c=a===void 0?_A:a,d=n.rootBoundary,u=d===void 0?Vm:d,f=n.elementContext,h=f===void 0?fo:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,k=Um(typeof y!="number"?y:Ym(y,co)),x=h===fo?OA:fo,w=t.rects.popper,b=t.elements[m?x:h],C=o3(Tr(b)?b:b.contextElement||rr(t.elements.popper),c,u,s),v=mi(t.elements.reference),S=Zm({reference:v,element:w,placement:i}),D=hc(Object.assign({},w,S)),O=h===fo?D:v,$={top:C.top-O.top+k.top,bottom:O.bottom-C.bottom+k.bottom,left:C.left-O.left+k.left,right:O.right-C.right+k.right},V=t.modifiersData.offset;if(h===fo&&V){var B=V[i];Object.keys($).forEach(function(J){var Y=[Yt,Ut].indexOf(J)>=0?1:-1,I=[Tt,Ut].indexOf(J)>=0?"y":"x";$[J]+=B[I]*Y})}return $}function s3(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Rm:c,u=gi(r),f=u?a?Pm:Pm.filter(function(m){return gi(m)===u}):co,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]=go(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[fn(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function a3(t){if(fn(t)===oc)return[];var e=js(t);return[Km(t),e,Km(e)]}function l3(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,c=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,k=fn(y),x=k===y,w=c||(x||!m?[js(y)]:a3(y)),b=[y].concat(w).reduce(function(z,q){return z.concat(fn(q)===oc?s3(e,{placement:q,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):q)},[]),C=e.rects.reference,v=e.rects.popper,S=new Map,D=!0,O=b[0],$=0;$<b.length;$++){var V=b[$],B=fn(V),J=gi(V)===hi,Y=[Tt,Ut].indexOf(B)>=0,I=Y?"width":"height",T=go(e,{placement:V,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),R=Y?J?Yt:Nt:J?Ut:Tt;C[I]>v[I]&&(R=js(R));var F=js(R),ee=[];if(o&&ee.push(T[B]<=0),a&&ee.push(T[R]<=0,T[F]<=0),ee.every(function(z){return z})){O=V,D=!1;break}S.set(V,ee)}if(D)for(var ie=m?3:1,he=function(q){var U=b.find(function(j){var ce=S.get(j);if(ce)return ce.slice(0,q).every(function(le){return le})});if(U)return O=U,"break"},ue=ie;ue>0;ue--){var L=he(ue);if(L==="break")break}e.placement!==O&&(e.modifiersData[r]._skip=!0,e.placement=O,e.reset=!0)}}const c3={name:"flip",enabled:!0,phase:"main",fn:l3,requiresIfExists:["offset"],data:{_skip:!1}};function Xm(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 Qm(t){return[Tt,Yt,Ut,Nt].some(function(e){return t[e]>=0})}function d3(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=go(e,{elementContext:"reference"}),a=go(e,{altBoundary:!0}),c=Xm(s,r),d=Xm(a,i,o),u=Qm(c),f=Qm(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 u3={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:d3};function f3(t,e,n){var r=fn(t),i=[Nt,Tt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Nt,Yt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function h3(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Rm.reduce(function(u,f){return u[f]=f3(f,e.rects,o),u},{}),a=s[e.placement],c=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const p3={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:h3};function m3(t){var e=t.state,n=t.name;e.modifiersData[n]=Zm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const g3={name:"popperOffsets",enabled:!0,phase:"read",fn:m3,data:{}};function y3(t){return t==="x"?"y":"x"}function b3(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,c=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=go(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),k=fn(e.placement),x=gi(e.placement),w=!x,b=cc(k),C=y3(b),v=e.modifiersData.popperOffsets,S=e.rects.reference,D=e.rects.popper,O=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,$=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),V=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if(v){if(o){var J,Y=b==="y"?Tt:Nt,I=b==="y"?Ut:Yt,T=b==="y"?"height":"width",R=v[b],F=R+y[Y],ee=R-y[I],ie=p?-D[T]/2:0,he=x===hi?S[T]:D[T],ue=x===hi?-D[T]:-S[T],L=e.elements.arrow,z=p&&L?lc(L):{width:0,height:0},q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Wm(),U=q[Y],j=q[I],ce=po(0,S[T],z[T]),le=w?S[T]/2-ie-ce-U-$.mainAxis:he-ce-U-$.mainAxis,ve=w?-S[T]/2+ie+ce+j+$.mainAxis:ue+ce+j+$.mainAxis,Ne=e.elements.arrow&&ho(e.elements.arrow),Ie=Ne?b==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,tt=(J=V==null?void 0:V[b])!=null?J:0,Q=R+le-tt-Ie,Ee=R+ve-tt,Mt=po(p?Ps(F,Q):F,R,p?Nr(ee,Ee):ee);v[b]=Mt,B[b]=Mt-R}if(a){var at,lt=b==="x"?Tt:Nt,ht=b==="x"?Ut:Yt,E=v[C],_=C==="y"?"height":"width",H=E+y[lt],se=E-y[ht],Me=[Tt,Nt].indexOf(k)!==-1,_e=(at=V==null?void 0:V[C])!=null?at:0,Oe=Me?H:E-S[_]-D[_]-_e+$.altAxis,P=Me?E+S[_]+D[_]-_e-$.altAxis:se,Z=p&&Me?zA(Oe,E,P):po(p?Oe:H,E,p?P:se);v[C]=Z,B[C]=Z-E}e.modifiersData[r]=B}}const k3={name:"preventOverflow",enabled:!0,phase:"main",fn:b3,requiresIfExists:["offset"]};function v3(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function w3(t){return t===Vt(t)||!qt(t)?dc(t):v3(t)}function x3(t){var e=t.getBoundingClientRect(),n=pi(e.width)/t.offsetWidth||1,r=pi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function E3(t,e,n){n===void 0&&(n=!1);var r=qt(e),i=qt(e)&&x3(e),o=rr(e),s=mi(t,i,n),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((un(e)!=="body"||fc(o))&&(a=w3(e)),qt(e)?(c=mi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=uc(o))),{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function C3(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var c=e.get(a);c&&i(c)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function S3(t){var e=C3(t);return VA.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function _3(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function O3(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 eg={placement:"bottom",modifiers:[],strategy:"absolute"};function tg(){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 T3(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?eg:i;return function(a,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},eg,o),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(k){var x=typeof k=="function"?k(u.options):k;g(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:Tr(a)?mo(a):a.contextElement?mo(a.contextElement):[],popper:mo(c)};var w=S3(O3([].concat(r,u.options.modifiers)));return u.orderedModifiers=w.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var k=u.elements,x=k.reference,w=k.popper;if(tg(x,w)){u.rects={reference:E3(x,ho(w),u.options.strategy==="fixed"),popper:lc(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function($){return u.modifiersData[$.name]=Object.assign({},$.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var C=u.orderedModifiers[b],v=C.fn,S=C.options,D=S===void 0?{}:S,O=C.name;typeof v=="function"&&(u=v({state:u,options:D,name:O,instance:p})||u)}}}},update:_3(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!tg(a,c))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var k=y.name,x=y.options,w=x===void 0?{}:x,b=y.effect;if(typeof b=="function"){var C=b({state:u,name:k,instance:p,options:w}),v=function(){};f.push(C||v)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var N3=[XA,g3,JA,Fm,p3,c3,k3,YA,u3],M3=T3({defaultModifiers:N3}),A3="tippy-box",ng="tippy-content",D3="tippy-backdrop",rg="tippy-arrow",ig="tippy-svg-arrow",Mr={passive:!0,capture:!0},og=function(){return document.body};function $3(t,e){return{}.hasOwnProperty.call(t,e)}function pc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function mc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function sg(t,e){return typeof t=="function"?t.apply(void 0,e):t}function ag(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function L3(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function B3(t){return t.split(/\s+/).filter(Boolean)}function yi(t){return[].concat(t)}function lg(t,e){t.indexOf(e)===-1&&t.push(e)}function I3(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function V3(t){return t.split("-")[0]}function zs(t){return[].slice.call(t)}function cg(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function yo(){return document.createElement("div")}function bo(t){return["Element","Fragment"].some(function(e){return mc(t,e)})}function P3(t){return mc(t,"NodeList")}function R3(t){return mc(t,"MouseEvent")}function F3(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function j3(t){return bo(t)?[t]:P3(t)?zs(t):Array.isArray(t)?t:zs(document.querySelectorAll(t))}function gc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function dg(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function z3(t){var e,n=yi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function H3(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,c=a.interactiveBorder,d=V3(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>c,y=r-o.bottom-h>c,k=o.left-n+p>c,x=n-o.right-m>c;return g||y||k||x})}function yc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function ug(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 hn={isTouch:!1},fg=0;function W3(){hn.isTouch||(hn.isTouch=!0,window.performance&&document.addEventListener("mousemove",hg))}function hg(){var t=performance.now();t-fg<20&&(hn.isTouch=!1,document.removeEventListener("mousemove",hg)),fg=t}function U3(){var t=document.activeElement;if(F3(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Y3(){document.addEventListener("touchstart",W3,Mr),window.addEventListener("blur",U3)}var q3=typeof window<"u"&&typeof document<"u",K3=q3?!!window.msCrypto:!1;function bi(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 pg(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function G3(t){return pg(`
|
|
115
|
+
`,textSerializers:r={}}=e||{};return eA(this.state.doc,{blockSeparator:n,textSerializers:{...Cm(this.schema),...r}})}get isEmpty(){return tc(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(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,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 Or(n,this)}get $doc(){return this.$pos(0)}};function ui(t){return new Os({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ce(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const c=a.search(/\S/),d=n.from+a.indexOf(s),u=d+s.length;if(Am(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+c,d);const h=n.from+c+s.length;o.addMark(n.from+c,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function Bm(t){return new Os({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Ce(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const c=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,a,c)}else if(r[0]){const d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function ic(t){return new Os({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=Ce(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 lo(t){return new Os({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=Ce(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&al(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 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&&Yn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let Ot=class Bc{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=Ce(ae(this,"addOptions",{name:this.name}))),this.storage=Ce(ae(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Bc(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Ms(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Bc(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.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: "${n.name}".`),n.options=Ce(ae(n,"addOptions",{name:n.name})),n.storage=Ce(ae(n,"addStorage",{name:n.name,options:n.options})),n}};function fi(t){return new tM({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=Ce(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],c=r[0];let d=n.to;if(a){const u=c.search(/\S/),f=n.from+c.indexOf(a),h=f+a.length;if(Am(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+a.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var Tt="top",Ut="bottom",Yt="right",Nt="left",oc="auto",co=[Tt,Ut,Yt,Nt],hi="start",uo="end",SA="clippingParents",Im="viewport",fo="popper",_A="reference",Vm=co.reduce(function(t,e){return t.concat([e+"-"+hi,e+"-"+uo])},[]),Pm=[].concat(co,[oc]).reduce(function(t,e){return t.concat([e,e+"-"+hi,e+"-"+uo])},[]),OA="beforeRead",TA="read",NA="afterRead",MA="beforeMain",AA="main",DA="afterMain",$A="beforeWrite",LA="write",BA="afterWrite",IA=[OA,TA,NA,MA,AA,DA,$A,LA,BA];function un(t){return t?(t.nodeName||"").toLowerCase():null}function Vt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Tr(t){var e=Vt(t).Element;return t instanceof e||t instanceof Element}function qt(t){var e=Vt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function sc(t){if(typeof ShadowRoot>"u")return!1;var e=Vt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function VA(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];!qt(o)||!un(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function PA(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(c,d){return c[d]="",c},{});!qt(i)||!un(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Rm={name:"applyStyles",enabled:!0,phase:"write",fn:VA,effect:PA,requires:["computeStyles"]};function fn(t){return t.split("-")[0]}var Nr=Math.max,Ps=Math.min,pi=Math.round;function ac(){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 Fm(){return!/^((?!chrome|android).)*safari/i.test(ac())}function mi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&qt(t)&&(i=t.offsetWidth>0&&pi(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&pi(r.height)/t.offsetHeight||1);var s=Tr(t)?Vt(t):window,a=s.visualViewport,c=!Fm()&&n,d=(r.left+(c&&a?a.offsetLeft:0))/i,u=(r.top+(c&&a?a.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function lc(t){var e=mi(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 jm(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&sc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Mn(t){return Vt(t).getComputedStyle(t)}function RA(t){return["table","td","th"].indexOf(un(t))>=0}function rr(t){return((Tr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Rs(t){return un(t)==="html"?t:t.assignedSlot||t.parentNode||(sc(t)?t.host:null)||rr(t)}function zm(t){return!qt(t)||Mn(t).position==="fixed"?null:t.offsetParent}function FA(t){var e=/firefox/i.test(ac()),n=/Trident/i.test(ac());if(n&&qt(t)){var r=Mn(t);if(r.position==="fixed")return null}var i=Rs(t);for(sc(i)&&(i=i.host);qt(i)&&["html","body"].indexOf(un(i))<0;){var o=Mn(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 ho(t){for(var e=Vt(t),n=zm(t);n&&RA(n)&&Mn(n).position==="static";)n=zm(n);return n&&(un(n)==="html"||un(n)==="body"&&Mn(n).position==="static")?e:n||FA(t)||e}function cc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function po(t,e,n){return Nr(t,Ps(e,n))}function jA(t,e,n){var r=po(t,e,n);return r>n?n:r}function Hm(){return{top:0,right:0,bottom:0,left:0}}function Wm(t){return Object.assign({},Hm(),t)}function Um(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var zA=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Wm(typeof e!="number"?e:Um(e,co))};function HA(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=fn(n.placement),c=cc(a),d=[Nt,Yt].indexOf(a)>=0,u=d?"height":"width";if(!(!o||!s)){var f=zA(i.padding,n),h=lc(o),p=c==="y"?Tt:Nt,m=c==="y"?Ut:Yt,g=n.rects.reference[u]+n.rects.reference[c]-s[c]-n.rects.popper[u],y=s[c]-n.rects.reference[c],k=ho(o),x=k?c==="y"?k.clientHeight||0:k.clientWidth||0:0,v=g/2-y/2,b=f[p],C=x-h[u]-f[m],w=x/2-h[u]/2+v,N=po(b,w,C),L=c;n.modifiersData[r]=(e={},e[L]=N,e.centerOffset=N-w,e)}}function WA(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)||jm(e.elements.popper,i)&&(e.elements.arrow=i))}const UA={name:"arrow",enabled:!0,phase:"main",fn:HA,effect:WA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gi(t){return t.split("-")[1]}var YA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qA(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:pi(n*i)/i||0,y:pi(r*i)/i||0}}function Ym(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=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,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 k=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),v=Nt,b=Tt,C=window;if(d){var w=ho(n),N="clientHeight",L="clientWidth";if(w===Vt(n)&&(w=rr(n),Mn(w).position!=="static"&&a==="absolute"&&(N="scrollHeight",L="scrollWidth")),w=w,i===Tt||(i===Nt||i===Yt)&&o===uo){b=Ut;var S=f&&w===C&&C.visualViewport?C.visualViewport.height:w[N];g-=S-r.height,g*=c?1:-1}if(i===Nt||(i===Tt||i===Ut)&&o===uo){v=Yt;var D=f&&w===C&&C.visualViewport?C.visualViewport.width:w[L];p-=D-r.width,p*=c?1:-1}}var F=Object.assign({position:a},d&&YA),$=u===!0?qA({x:p,y:g},Vt(n)):{x:p,y:g};if(p=$.x,g=$.y,c){var U;return Object.assign({},F,(U={},U[b]=x?"0":"",U[v]=k?"0":"",U.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",U))}return Object.assign({},F,(e={},e[b]=x?g+"px":"",e[v]=k?p+"px":"",e.transform="",e))}function KA(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,c=a===void 0?!0:a,d={placement:fn(e.placement),variation:gi(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,Ym(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,Ym(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 GA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:KA,data:{}};var Fs={passive:!0};function JA(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,c=Vt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,Fs)}),a&&c.addEventListener("resize",n.update,Fs),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Fs)}),a&&c.removeEventListener("resize",n.update,Fs)}}const ZA={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:JA,data:{}};var XA={left:"right",right:"left",bottom:"top",top:"bottom"};function js(t){return t.replace(/left|right|bottom|top/g,function(e){return XA[e]})}var QA={start:"end",end:"start"};function qm(t){return t.replace(/start|end/g,function(e){return QA[e]})}function dc(t){var e=Vt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function uc(t){return mi(rr(t)).left+dc(t).scrollLeft}function e3(t,e){var n=Vt(t),r=rr(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;var d=Fm();(d||!d&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a+uc(t),y:c}}function t3(t){var e,n=rr(t),r=dc(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Nr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Nr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+uc(t),c=-r.scrollTop;return Mn(i||n).direction==="rtl"&&(a+=Nr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:c}}function fc(t){var e=Mn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Km(t){return["html","body","#document"].indexOf(un(t))>=0?t.ownerDocument.body:qt(t)&&fc(t)?t:Km(Rs(t))}function mo(t,e){var n;e===void 0&&(e=[]);var r=Km(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Vt(r),s=i?[o].concat(o.visualViewport||[],fc(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(mo(Rs(s)))}function hc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function n3(t,e){var n=mi(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 Gm(t,e,n){return e===Im?hc(e3(t,n)):Tr(e)?n3(e,n):hc(t3(rr(t)))}function r3(t){var e=mo(Rs(t)),n=["absolute","fixed"].indexOf(Mn(t).position)>=0,r=n&&qt(t)?ho(t):t;return Tr(r)?e.filter(function(i){return Tr(i)&&jm(i,r)&&un(i)!=="body"}):[]}function i3(t,e,n,r){var i=e==="clippingParents"?r3(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(c,d){var u=Gm(t,d,r);return c.top=Nr(u.top,c.top),c.right=Ps(u.right,c.right),c.bottom=Ps(u.bottom,c.bottom),c.left=Nr(u.left,c.left),c},Gm(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Jm(t){var e=t.reference,n=t.element,r=t.placement,i=r?fn(r):null,o=r?gi(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,c;switch(i){case Tt:c={x:s,y:e.y-n.height};break;case Ut:c={x:s,y:e.y+e.height};break;case Yt:c={x:e.x+e.width,y:a};break;case Nt:c={x:e.x-n.width,y:a};break;default:c={x:e.x,y:e.y}}var d=i?cc(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case hi:c[d]=c[d]-(e[u]/2-n[u]/2);break;case uo:c[d]=c[d]+(e[u]/2-n[u]/2);break}}return c}function go(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,c=a===void 0?SA:a,d=n.rootBoundary,u=d===void 0?Im:d,f=n.elementContext,h=f===void 0?fo:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,k=Wm(typeof y!="number"?y:Um(y,co)),x=h===fo?_A:fo,v=t.rects.popper,b=t.elements[m?x:h],C=i3(Tr(b)?b:b.contextElement||rr(t.elements.popper),c,u,s),w=mi(t.elements.reference),N=Jm({reference:w,element:v,placement:i}),L=hc(Object.assign({},v,N)),S=h===fo?L:w,D={top:C.top-S.top+k.top,bottom:S.bottom-C.bottom+k.bottom,left:C.left-S.left+k.left,right:S.right-C.right+k.right},F=t.modifiersData.offset;if(h===fo&&F){var $=F[i];Object.keys(D).forEach(function(U){var z=[Yt,Ut].indexOf(U)>=0?1:-1,I=[Tt,Ut].indexOf(U)>=0?"y":"x";D[U]+=$[I]*z})}return D}function o3(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Pm:c,u=gi(r),f=u?a?Vm:Vm.filter(function(m){return gi(m)===u}):co,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]=go(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[fn(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function s3(t){if(fn(t)===oc)return[];var e=js(t);return[qm(t),e,qm(e)]}function a3(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,c=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,k=fn(y),x=k===y,v=c||(x||!m?[js(y)]:s3(y)),b=[y].concat(v).reduce(function(H,K){return H.concat(fn(K)===oc?o3(e,{placement:K,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):K)},[]),C=e.rects.reference,w=e.rects.popper,N=new Map,L=!0,S=b[0],D=0;D<b.length;D++){var F=b[D],$=fn(F),U=gi(F)===hi,z=[Tt,Ut].indexOf($)>=0,I=z?"width":"height",_=go(e,{placement:F,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),P=z?U?Yt:Nt:U?Ut:Tt;C[I]>w[I]&&(P=js(P));var V=js(P),ee=[];if(o&&ee.push(_[$]<=0),a&&ee.push(_[P]<=0,_[V]<=0),ee.every(function(H){return H})){S=F,L=!1;break}N.set(F,ee)}if(L)for(var ie=m?3:1,he=function(K){var q=b.find(function(j){var ce=N.get(j);if(ce)return ce.slice(0,K).every(function(le){return le})});if(q)return S=q,"break"},ue=ie;ue>0;ue--){var B=he(ue);if(B==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}const l3={name:"flip",enabled:!0,phase:"main",fn:a3,requiresIfExists:["offset"],data:{_skip:!1}};function Zm(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 Xm(t){return[Tt,Yt,Ut,Nt].some(function(e){return t[e]>=0})}function c3(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=go(e,{elementContext:"reference"}),a=go(e,{altBoundary:!0}),c=Zm(s,r),d=Zm(a,i,o),u=Xm(c),f=Xm(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 d3={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c3};function u3(t,e,n){var r=fn(t),i=[Nt,Tt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Nt,Yt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function f3(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Pm.reduce(function(u,f){return u[f]=u3(f,e.rects,o),u},{}),a=s[e.placement],c=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const h3={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:f3};function p3(t){var e=t.state,n=t.name;e.modifiersData[n]=Jm({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const m3={name:"popperOffsets",enabled:!0,phase:"read",fn:p3,data:{}};function g3(t){return t==="x"?"y":"x"}function y3(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,c=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=go(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),k=fn(e.placement),x=gi(e.placement),v=!x,b=cc(k),C=g3(b),w=e.modifiersData.popperOffsets,N=e.rects.reference,L=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,D=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(w){if(o){var U,z=b==="y"?Tt:Nt,I=b==="y"?Ut:Yt,_=b==="y"?"height":"width",P=w[b],V=P+y[z],ee=P-y[I],ie=p?-L[_]/2:0,he=x===hi?N[_]:L[_],ue=x===hi?-L[_]:-N[_],B=e.elements.arrow,H=p&&B?lc(B):{width:0,height:0},K=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Hm(),q=K[z],j=K[I],ce=po(0,N[_],H[_]),le=v?N[_]/2-ie-ce-q-D.mainAxis:he-ce-q-D.mainAxis,ve=v?-N[_]/2+ie+ce+j+D.mainAxis:ue+ce+j+D.mainAxis,Ne=e.elements.arrow&&ho(e.elements.arrow),Ie=Ne?b==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,tt=(U=F==null?void 0:F[b])!=null?U:0,Q=P+le-tt-Ie,Ee=P+ve-tt,Mt=po(p?Ps(V,Q):V,P,p?Nr(ee,Ee):ee);w[b]=Mt,$[b]=Mt-P}if(a){var at,lt=b==="x"?Tt:Nt,ht=b==="x"?Ut:Yt,E=w[C],O=C==="y"?"height":"width",W=E+y[lt],se=E-y[ht],Me=[Tt,Nt].indexOf(k)!==-1,_e=(at=F==null?void 0:F[C])!=null?at:0,Oe=Me?W:E-N[O]-L[O]-_e+D.altAxis,R=Me?E+N[O]+L[O]-_e-D.altAxis:se,Z=p&&Me?jA(Oe,E,R):po(p?Oe:W,E,p?R:se);w[C]=Z,$[C]=Z-E}e.modifiersData[r]=$}}const b3={name:"preventOverflow",enabled:!0,phase:"main",fn:y3,requiresIfExists:["offset"]};function k3(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function v3(t){return t===Vt(t)||!qt(t)?dc(t):k3(t)}function w3(t){var e=t.getBoundingClientRect(),n=pi(e.width)/t.offsetWidth||1,r=pi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function x3(t,e,n){n===void 0&&(n=!1);var r=qt(e),i=qt(e)&&w3(e),o=rr(e),s=mi(t,i,n),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((un(e)!=="body"||fc(o))&&(a=v3(e)),qt(e)?(c=mi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=uc(o))),{x:s.left+a.scrollLeft-c.x,y:s.top+a.scrollTop-c.y,width:s.width,height:s.height}}function E3(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var c=e.get(a);c&&i(c)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function C3(t){var e=E3(t);return IA.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function S3(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function _3(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 Qm={placement:"bottom",modifiers:[],strategy:"absolute"};function eg(){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 O3(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Qm:i;return function(a,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Qm,o),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(k){var x=typeof k=="function"?k(u.options):k;g(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:Tr(a)?mo(a):a.contextElement?mo(a.contextElement):[],popper:mo(c)};var v=C3(_3([].concat(r,u.options.modifiers)));return u.orderedModifiers=v.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var k=u.elements,x=k.reference,v=k.popper;if(eg(x,v)){u.rects={reference:x3(x,ho(v),u.options.strategy==="fixed"),popper:lc(v)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(D){return u.modifiersData[D.name]=Object.assign({},D.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var C=u.orderedModifiers[b],w=C.fn,N=C.options,L=N===void 0?{}:N,S=C.name;typeof w=="function"&&(u=w({state:u,options:L,name:S,instance:p})||u)}}}},update:S3(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!eg(a,c))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var k=y.name,x=y.options,v=x===void 0?{}:x,b=y.effect;if(typeof b=="function"){var C=b({state:u,name:k,instance:p,options:v}),w=function(){};f.push(C||w)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var T3=[ZA,m3,GA,Rm,h3,l3,b3,UA,d3],N3=O3({defaultModifiers:T3}),M3="tippy-box",tg="tippy-content",A3="tippy-backdrop",ng="tippy-arrow",rg="tippy-svg-arrow",Mr={passive:!0,capture:!0},ig=function(){return document.body};function D3(t,e){return{}.hasOwnProperty.call(t,e)}function pc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function mc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function og(t,e){return typeof t=="function"?t.apply(void 0,e):t}function sg(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function $3(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function L3(t){return t.split(/\s+/).filter(Boolean)}function yi(t){return[].concat(t)}function ag(t,e){t.indexOf(e)===-1&&t.push(e)}function B3(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function I3(t){return t.split("-")[0]}function zs(t){return[].slice.call(t)}function lg(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function yo(){return document.createElement("div")}function bo(t){return["Element","Fragment"].some(function(e){return mc(t,e)})}function V3(t){return mc(t,"NodeList")}function P3(t){return mc(t,"MouseEvent")}function R3(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function F3(t){return bo(t)?[t]:V3(t)?zs(t):Array.isArray(t)?t:zs(document.querySelectorAll(t))}function gc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function cg(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function j3(t){var e,n=yi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function z3(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,c=a.interactiveBorder,d=I3(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>c,y=r-o.bottom-h>c,k=o.left-n+p>c,x=n-o.right-m>c;return g||y||k||x})}function yc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function dg(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 hn={isTouch:!1},ug=0;function H3(){hn.isTouch||(hn.isTouch=!0,window.performance&&document.addEventListener("mousemove",fg))}function fg(){var t=performance.now();t-ug<20&&(hn.isTouch=!1,document.removeEventListener("mousemove",fg)),ug=t}function W3(){var t=document.activeElement;if(R3(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function U3(){document.addEventListener("touchstart",H3,Mr),window.addEventListener("blur",W3)}var Y3=typeof window<"u"&&typeof document<"u",q3=Y3?!!window.msCrypto:!1;function bi(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 hg(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function K3(t){return hg(`
|
|
116
116
|
%ctippy.js
|
|
117
117
|
|
|
118
|
-
%c`+
|
|
118
|
+
%c`+hg(t)+`
|
|
119
119
|
|
|
120
120
|
%c👷 This is a development-only message. It will be removed in production.
|
|
121
|
-
`)}function
|
|
121
|
+
`)}function pg(t){return[K3(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ko;process.env.NODE_ENV!=="production"&&G3();function G3(){ko=new Set}function An(t,e){if(t&&!ko.has(e)){var n;ko.add(e),(n=console).warn.apply(n,pg(e))}}function bc(t,e){if(t&&!ko.has(e)){var n;ko.add(e),(n=console).error.apply(n,pg(e))}}function J3(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;bc(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),bc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var mg={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Z3={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Pt=Object.assign({appendTo:ig,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},mg,Z3),X3=Object.keys(Pt),Q3=function(e){process.env.NODE_ENV!=="production"&&bg(e,[]);var n=Object.keys(e);n.forEach(function(r){Pt[r]=e[r]})};function gg(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=Pt[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function eD(t,e){var n=e?Object.keys(gg(Object.assign({},Pt,{plugins:e}))):X3,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 yg(t,e){var n=Object.assign({},e,{content:og(e.content,[t])},e.ignoreAttributes?{}:eD(t,e.plugins));return n.aria=Object.assign({},Pt.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 bg(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=$3(Pt,Object.keys(mg)),o=!D3(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),An(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.",`
|
|
122
122
|
|
|
123
123
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
124
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
124
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var tD=function(){return"innerHTML"};function kc(t,e){t[tD()]=e}function kg(t){var e=yo();return t===!0?e.className=ng:(e.className=rg,bo(t)?e.appendChild(t):kc(e,t)),e}function vg(t,e){bo(e.content)?(kc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?kc(t,e.content):t.textContent=e.content)}function vc(t){var e=t.firstElementChild,n=zs(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(tg)}),arrow:n.find(function(r){return r.classList.contains(ng)||r.classList.contains(rg)}),backdrop:n.find(function(r){return r.classList.contains(A3)})}}function wg(t){var e=yo(),n=yo();n.className=M3,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=yo();r.className=tg,r.setAttribute("data-state","hidden"),vg(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=vc(e),c=a.box,d=a.content,u=a.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)&&vg(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(kg(s.arrow))):c.appendChild(kg(s.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:i}}wg.$$tippy=!0;var nD=1,Hs=[],wc=[];function rD(t,e){var n=yg(t,Object.assign({},Pt,gg(lg(e)))),r,i,o,s=!1,a=!1,c=!1,d=!1,u,f,h,p=[],m=sg(Q,n.interactiveDebounce),g,y=nD++,k=null,x=B3(n.plugins),v={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:y,reference:t,popper:yo(),popperInstance:k,props:n,state:v,plugins:x,clearDelayTimeouts:Oe,setProps:R,setContent:Z,show:T,hide:A,hideWithInteractivity:Y,enable:Me,disable:_e,unmount:te,destroy:de};if(!n.render)return process.env.NODE_ENV!=="production"&&bc(!0,"render() function has not been supplied."),b;var C=n.render(b),w=C.popper,N=C.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+b.id,b.popper=w,t._tippy=b,w._tippy=b;var L=x.map(function(M){return M.fn(b)}),S=t.hasAttribute("aria-expanded");return Ne(),ie(),P(),V("onCreate",[b]),n.showOnCreate&&W(),w.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&z().addEventListener("mousemove",m)}),b;function D(){var M=b.props.touch;return Array.isArray(M)?M:[M,0]}function F(){return D()[0]==="hold"}function $(){var M;return!!((M=b.props.render)!=null&&M.$$tippy)}function U(){return g||t}function z(){var M=U().parentNode;return M?j3(M):document}function I(){return vc(w)}function _(M){return b.state.isMounted&&!b.state.isVisible||hn.isTouch||u&&u.type==="focus"?0:pc(b.props.delay,M?0:1,Pt.delay)}function P(M){M===void 0&&(M=!1),w.style.pointerEvents=b.props.interactive&&!M?"":"none",w.style.zIndex=""+b.props.zIndex}function V(M,X,re){if(re===void 0&&(re=!0),L.forEach(function(ye){ye[M]&&ye[M].apply(ye,X)}),re){var me;(me=b.props)[M].apply(me,X)}}function ee(){var M=b.props.aria;if(M.content){var X="aria-"+M.content,re=w.id,me=yi(b.props.triggerTarget||t);me.forEach(function(ye){var we=ye.getAttribute(X);if(b.state.isVisible)ye.setAttribute(X,we?we+" "+re:re);else{var Ae=we&&we.replace(re,"").trim();Ae?ye.setAttribute(X,Ae):ye.removeAttribute(X)}})}}function ie(){if(!(S||!b.props.aria.expanded)){var M=yi(b.props.triggerTarget||t);M.forEach(function(X){b.props.interactive?X.setAttribute("aria-expanded",b.state.isVisible&&X===U()?"true":"false"):X.removeAttribute("aria-expanded")})}}function he(){z().removeEventListener("mousemove",m),Hs=Hs.filter(function(M){return M!==m})}function ue(M){if(!(hn.isTouch&&(c||M.type==="mousedown"))){var X=M.composedPath&&M.composedPath()[0]||M.target;if(!(b.props.interactive&&dg(w,X))){if(yi(b.props.triggerTarget||t).some(function(re){return dg(re,X)})){if(hn.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else V("onClickOutside",[b,M]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||q())}}}function B(){c=!0}function H(){c=!1}function K(){var M=z();M.addEventListener("mousedown",ue,!0),M.addEventListener("touchend",ue,Mr),M.addEventListener("touchstart",H,Mr),M.addEventListener("touchmove",B,Mr)}function q(){var M=z();M.removeEventListener("mousedown",ue,!0),M.removeEventListener("touchend",ue,Mr),M.removeEventListener("touchstart",H,Mr),M.removeEventListener("touchmove",B,Mr)}function j(M,X){le(M,function(){!b.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&X()})}function ce(M,X){le(M,X)}function le(M,X){var re=I().box;function me(ye){ye.target===re&&(yc(re,"remove",me),X())}if(M===0)return X();yc(re,"remove",f),yc(re,"add",me),f=me}function ve(M,X,re){re===void 0&&(re=!1);var me=yi(b.props.triggerTarget||t);me.forEach(function(ye){ye.addEventListener(M,X,re),p.push({node:ye,eventType:M,handler:X,options:re})})}function Ne(){F()&&(ve("touchstart",tt,{passive:!0}),ve("touchend",Ee,{passive:!0})),L3(b.props.trigger).forEach(function(M){if(M!=="manual")switch(ve(M,tt),M){case"mouseenter":ve("mouseleave",Ee);break;case"focus":ve(q3?"focusout":"blur",Mt);break;case"focusin":ve("focusout",Mt);break}})}function Ie(){p.forEach(function(M){var X=M.node,re=M.eventType,me=M.handler,ye=M.options;X.removeEventListener(re,me,ye)}),p=[]}function tt(M){var X,re=!1;if(!(!b.state.isEnabled||at(M)||a)){var me=((X=u)==null?void 0:X.type)==="focus";u=M,g=M.currentTarget,ie(),!b.state.isVisible&&P3(M)&&Hs.forEach(function(ye){return ye(M)}),M.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?re=!0:W(M),M.type==="click"&&(s=!re),re&&!me&&se(M)}}function Q(M){var X=M.target,re=U().contains(X)||w.contains(X);if(!(M.type==="mousemove"&&re)){var me=O().concat(w).map(function(ye){var we,Ae=ye._tippy,ze=(we=Ae.popperInstance)==null?void 0:we.state;return ze?{popperRect:ye.getBoundingClientRect(),popperState:ze,props:n}:null}).filter(Boolean);z3(me,M)&&(he(),se(M))}}function Ee(M){var X=at(M)||b.props.trigger.indexOf("click")>=0&&s;if(!X){if(b.props.interactive){b.hideWithInteractivity(M);return}se(M)}}function Mt(M){b.props.trigger.indexOf("focusin")<0&&M.target!==U()||b.props.interactive&&M.relatedTarget&&w.contains(M.relatedTarget)||se(M)}function at(M){return hn.isTouch?F()!==M.type.indexOf("touch")>=0:!1}function lt(){ht();var M=b.props,X=M.popperOptions,re=M.placement,me=M.offset,ye=M.getReferenceClientRect,we=M.moveTransition,Ae=$()?vc(w).arrow:null,ze=ye?{getBoundingClientRect:ye,contextElement:ye.contextElement||U()}:t,vt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(or){var mn=or.state;if($()){var vo=I(),Dc=vo.box;["placement","reference-hidden","escaped"].forEach(function(Ks){Ks==="placement"?Dc.setAttribute("data-placement",mn.placement):mn.attributes.popper["data-popper-"+Ks]?Dc.setAttribute("data-"+Ks,""):Dc.removeAttribute("data-"+Ks)}),mn.attributes.popper={}}}},Rt=[{name:"offset",options:{offset:me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!we}},vt];$()&&Ae&&Rt.push({name:"arrow",options:{element:Ae,padding:3}}),Rt.push.apply(Rt,(X==null?void 0:X.modifiers)||[]),b.popperInstance=N3(ze,w,Object.assign({},X,{placement:re,onFirstUpdate:h,modifiers:Rt}))}function ht(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function E(){var M=b.props.appendTo,X,re=U();b.props.interactive&&M===ig||M==="parent"?X=re.parentNode:X=og(M,[re]),X.contains(w)||X.appendChild(w),b.state.isMounted=!0,lt(),process.env.NODE_ENV!=="production"&&An(b.props.interactive&&M===Pt.appendTo&&re.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
125
125
|
|
|
126
126
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
127
127
|
|
|
128
128
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
129
129
|
|
|
130
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function
|
|
130
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function O(){return zs(w.querySelectorAll("[data-tippy-root]"))}function W(M){b.clearDelayTimeouts(),M&&V("onTrigger",[b,M]),K();var X=_(!0),re=D(),me=re[0],ye=re[1];hn.isTouch&&me==="hold"&&ye&&(X=ye),X?r=setTimeout(function(){b.show()},X):b.show()}function se(M){if(b.clearDelayTimeouts(),V("onUntrigger",[b,M]),!b.state.isVisible){q();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(M.type)>=0&&s)){var X=_(!1);X?i=setTimeout(function(){b.state.isVisible&&b.hide()},X):o=requestAnimationFrame(function(){b.hide()})}}function Me(){b.state.isEnabled=!0}function _e(){b.hide(),b.state.isEnabled=!1}function Oe(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function R(M){if(process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("setProps")),!b.state.isDestroyed){V("onBeforeUpdate",[b,M]),Ie();var X=b.props,re=yg(t,Object.assign({},X,lg(M),{ignoreAttributes:!0}));b.props=re,Ne(),X.interactiveDebounce!==re.interactiveDebounce&&(he(),m=sg(Q,re.interactiveDebounce)),X.triggerTarget&&!re.triggerTarget?yi(X.triggerTarget).forEach(function(me){me.removeAttribute("aria-expanded")}):re.triggerTarget&&t.removeAttribute("aria-expanded"),ie(),P(),N&&N(X,re),b.popperInstance&&(lt(),O().forEach(function(me){requestAnimationFrame(me._tippy.popperInstance.forceUpdate)})),V("onAfterUpdate",[b,M])}}function Z(M){b.setProps({content:M})}function T(){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("show"));var M=b.state.isVisible,X=b.state.isDestroyed,re=!b.state.isEnabled,me=hn.isTouch&&!b.props.touch,ye=pc(b.props.duration,0,Pt.duration);if(!(M||X||re||me)&&!U().hasAttribute("disabled")&&(V("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,$()&&(w.style.visibility="visible"),P(),K(),b.state.isMounted||(w.style.transition="none"),$()){var we=I(),Ae=we.box,ze=we.content;gc([Ae,ze],0)}h=function(){var Rt;if(!(!b.state.isVisible||d)){if(d=!0,w.offsetHeight,w.style.transition=b.props.moveTransition,$()&&b.props.animation){var Dr=I(),or=Dr.box,mn=Dr.content;gc([or,mn],ye),cg([or,mn],"visible")}ee(),ie(),ag(wc,b),(Rt=b.popperInstance)==null||Rt.forceUpdate(),V("onMount",[b]),b.props.animation&&$()&&ce(ye,function(){b.state.isShown=!0,V("onShown",[b])})}},E()}}function A(){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("hide"));var M=!b.state.isVisible,X=b.state.isDestroyed,re=!b.state.isEnabled,me=pc(b.props.duration,1,Pt.duration);if(!(M||X||re)&&(V("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,$()&&(w.style.visibility="hidden"),he(),q(),P(!0),$()){var ye=I(),we=ye.box,Ae=ye.content;b.props.animation&&(gc([we,Ae],me),cg([we,Ae],"hidden"))}ee(),ie(),b.props.animation?$()&&j(me,b.unmount):b.unmount()}}function Y(M){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("hideWithInteractivity")),z().addEventListener("mousemove",m),ag(Hs,m),m(M)}function te(){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(ht(),O().forEach(function(M){M._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),wc=wc.filter(function(M){return M!==b}),b.state.isMounted=!1,V("onHidden",[b]))}function de(){process.env.NODE_ENV!=="production"&&An(b.state.isDestroyed,bi("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),Ie(),delete t._tippy,b.state.isDestroyed=!0,V("onDestroy",[b]))}}function ki(t,e){e===void 0&&(e={});var n=Pt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(J3(t),bg(e,n)),U3();var r=Object.assign({},e,{plugins:n}),i=F3(t);if(process.env.NODE_ENV!=="production"){var o=bo(r.content),s=i.length>1;An(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.",`
|
|
131
131
|
|
|
132
132
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
133
133
|
|
|
134
134
|
`,`1) content: element.innerHTML
|
|
135
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(c,d){var u=d&&iD(d,r);return u&&c.push(u),c},[]);return bo(t)?a[0]:a}ki.defaultProps=Pt,ki.setDefaultProps=eD,ki.currentInput=hn,Object.assign({},Fm,{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)}}),ki.setDefaultProps({render:xg});class oD{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:c,from:d,to:u})=>{const{doc:f,selection:h}=c,{empty:p}=h,m=!f.textBetween(d,u).length&&Jl(c.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var c;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,c)=>{const d=!(c!=null&&c.selection.eq(a.state.selection)),u=!(c!=null&&c.doc.eq(a.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,d,u,c)},this.updateDelay))},this.updateHandler=(a,c,d,u)=>{var f,h,p;const{state:m,composing:g}=a,{selection:y}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:x}=y,w=Math.min(...x.map(v=>v.$from.pos)),b=Math.max(...x.map(v=>v.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:a,state:m,oldState:u,from:w,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(oA(m.selection)){let v=a.nodeDOM(w);const S=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(S&&(v=S.firstChild),v)return v.getBoundingClientRect()}return Lm(a,w,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=ki(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 Eg=t=>new it({key:typeof t.pluginKey=="string"?new Bt(t.pluginKey):t.pluginKey,view:e=>new oD({view:e,...t})});qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Eg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class sD{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:c}=a,{$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 a;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ki(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:a,selection:c}=s,{from:d,to:u}=c;if(n&&n.doc.eq(a)&&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)||(()=>Lm(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 Cg=t=>new it({key:typeof t.pluginKey=="string"?new Bt(t.pluginKey):t.pluginKey,view:e=>new sD({view:e,...t})});qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Cg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),l.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=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:a}=t;i.registerPlugin(Eg({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Sg(t){return l.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class aD extends SA{constructor(e={}){return super(e),this.vueRenderers=l.reactive(new Map),this.contentComponent=null,this.reactiveState=Sg(this.view.state),this.reactiveExtensionStorage=Sg(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),l.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const lD=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=l.ref(),n=l.getCurrentInstance();return l.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),l.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=l.h(l.Teleport,{to:e.teleportElement,key:e.id},l.h(e.component,{ref:e.id,...e.props}));t.push(n)}),l.h("div",{ref:e=>{this.rootEl=e}},...t)}});l.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=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(Cg({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return l.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 cD=(t={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new aD(t)}),l.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},dD=/^\s*>\s$/,uD=Ot.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Fe(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[lo({find:dD,type:this.type})]}}),fD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,hD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,pD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,mD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,gD=Wt.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",Fe(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[ui({find:fD,type:this.type}),ui({find:pD,type:this.type})]},addPasteRules(){return[fi({find:hD,type:this.type}),fi({find:mD,type:this.type})]}}),yD=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),_g=Wt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Is(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Og=/^\s*([-+*])\s$/,bD=Ot.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",Fe(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(yD.name,this.editor.getAttributes(_g.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=lo({find:Og,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=lo({find:Og,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(_g.name),editor:this.editor})),[t]}}),kD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,vD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,wD=Wt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Fe(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[ui({find:kD,type:this.type})]},addPasteRules(){return[fi({find:vD,type:this.type})]}}),xD=/^```([a-z]+)?[\s\n]$/,ED=/^~~~([a-z]+)?[\s\n]$/,CD=Ot.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",Fe(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(`
|
|
135
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(c,d){var u=d&&rD(d,r);return u&&c.push(u),c},[]);return bo(t)?a[0]:a}ki.defaultProps=Pt,ki.setDefaultProps=Q3,ki.currentInput=hn,Object.assign({},Rm,{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)}}),ki.setDefaultProps({render:wg});class iD{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:c,from:d,to:u})=>{const{doc:f,selection:h}=c,{empty:p}=h,m=!f.textBetween(d,u).length&&Jl(c.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var c;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,c)=>{const d=!(c!=null&&c.selection.eq(a.state.selection)),u=!(c!=null&&c.doc.eq(a.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,d,u,c)},this.updateDelay))},this.updateHandler=(a,c,d,u)=>{var f,h,p;const{state:m,composing:g}=a,{selection:y}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:x}=y,v=Math.min(...x.map(w=>w.$from.pos)),b=Math.max(...x.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:a,state:m,oldState:u,from:v,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(iA(m.selection)){let w=a.nodeDOM(v);const N=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(N&&(w=N.firstChild),w)return w.getBoundingClientRect()}return $m(a,v,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=ki(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 xg=t=>new it({key:typeof t.pluginKey=="string"?new Bt(t.pluginKey):t.pluginKey,view:e=>new iD({view:e,...t})});qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[xg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class oD{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:c}=a,{$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 a;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ki(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:a,selection:c}=s,{from:d,to:u}=c;if(n&&n.doc.eq(a)&&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)||(()=>$m(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 Eg=t=>new it({key:typeof t.pluginKey=="string"?new Bt(t.pluginKey):t.pluginKey,view:e=>new oD({view:e,...t})});qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Eg({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),l.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=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:a}=t;i.registerPlugin(xg({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Cg(t){return l.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class sD extends CA{constructor(e={}){return super(e),this.vueRenderers=l.reactive(new Map),this.contentComponent=null,this.reactiveState=Cg(this.view.state),this.reactiveExtensionStorage=Cg(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),l.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 aD=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=l.ref(),n=l.getCurrentInstance();return l.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),l.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=l.h(l.Teleport,{to:e.teleportElement,key:e.id},l.h(e.component,{ref:e.id,...e.props}));t.push(n)}),l.h("div",{ref:e=>{this.rootEl=e}},...t)}});l.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=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(Eg({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return l.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 lD=(t={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new sD(t)}),l.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},cD=/^\s*>\s$/,dD=Ot.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Fe(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[lo({find:cD,type:this.type})]}}),uD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,fD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,hD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,pD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,mD=Wt.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",Fe(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[ui({find:uD,type:this.type}),ui({find:hD,type:this.type})]},addPasteRules(){return[fi({find:fD,type:this.type}),fi({find:pD,type:this.type})]}}),gD=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),Sg=Wt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Is(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),_g=/^\s*([-+*])\s$/,yD=Ot.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",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(gD.name,this.editor.getAttributes(Sg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=lo({find:_g,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=lo({find:_g,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Sg.name),editor:this.editor})),[t]}}),bD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,kD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,vD=Wt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Fe(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[ui({find:bD,type:this.type})]},addPasteRules(){return[fi({find:kD,type:this.type})]}}),wD=/^```([a-z]+)?[\s\n]$/,xD=/^~~~([a-z]+)?[\s\n]$/,ED=Ot.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",Fe(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(`
|
|
136
136
|
|
|
137
|
-
`);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:t.commands.exitCode()}}},addInputRules(){return[ic({find:
|
|
138
|
-
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),
|
|
139
|
-
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,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=>a.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),PD=Ot.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]}`,Fe(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=>ic({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Us=200,et=function(){};et.prototype.append=function(e){return e.length?(e=et.from(e),!this.length&&e||e.length<Us&&this.leafAppend(e)||this.length<Us&&e.leafPrepend(this)||this.appendInner(e)):this},et.prototype.prepend=function(e){return e.length?et.from(e).append(this):this},et.prototype.appendInner=function(e){return new RD(this,e)},et.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?et.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},et.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},et.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)},et.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},et.from=function(e){return e instanceof et?e:e&&e.length?new Tg(e):et.empty};var Tg=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var c=o;c<s;c++)if(i(this.values[c],a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var c=o-1;c>=s;c--)if(i(this.values[c],a+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Us)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Us)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}(et);et.empty=new Tg([]);var RD=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(et);const FD=500;class tn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,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 pn(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 pn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,c=new tn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,c=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new pn(e.mapping.maps[u],f,n),p;(p=c&&c.merge(h))&&(h=p,u?o.pop():a=a.slice(0,a.length-1)),o.push(h),n&&(s++,n=void 0),i||(c=h)}let d=s-r.depth;return d>zD&&(a=jD(a,d),s-=d),new tn(a.append(o),s)}remapping(e,n){let r=new Zr;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 tn(this.items.append(e.map(n=>new pn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let 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 g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(c+1,p));y&&a++,r.push(new pn(m,g,y))}else r.push(new pn(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new pn(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new tn(u,a);return f.emptyItemCount()>FD&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let 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 pn(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 tn(et.from(i.reverse()),o)}}tn.empty=new tn(et.empty,0);function jD(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class pn{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 pn(n.getMap().invert(),n,this.selection)}}}class ir{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const zD=20;function HD(t,e,n,r){let i=n.getMeta(Ar),o;if(i)return i.historyState;n.getMeta(YD)&&(t=new ir(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Ar))return s.getMeta(Ar).redo?new ir(t.done.addTransform(n,void 0,r,Ys(e)),t.undone,Ng(n.mapping.maps),t.prevTime,t.prevComposition):new ir(t.done,t.undone.addTransform(n,void 0,r,Ys(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),c=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!WD(n,t.prevRanges)),d=s?Ec(t.prevRanges,n.mapping):Ng(n.mapping.maps);return new ir(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,Ys(e)),tn.empty,d,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new ir(t.done.rebased(n,o),t.undone.rebased(n,o),Ec(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ir(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ec(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function WD(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 Ng(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Ec(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 UD(t,e,n){let r=Ys(e),i=Ar.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new ir(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ar,{redo:n,historyState:c})}let Cc=!1,Mg=null;function Ys(t){let e=t.plugins;if(Mg!=e){Cc=!1,Mg=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Cc=!0;break}}return Cc}const Ar=new Bt("history"),YD=new Bt("closeHistory");function qD(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new it({key:Ar,state:{init(){return new ir(tn.empty,tn.empty,null,0,-1)},apply(e,n,r){return HD(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Dg:r=="historyRedo"?$g:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Ag(t,e){return(n,r)=>{let i=Ar.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=UD(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Dg=Ag(!1,!0),$g=Ag(!0,!0),KD=qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Dg(t,e),redo:()=>({state:t,dispatch:e})=>$g(t,e)}},addProseMirrorPlugins(){return[qD(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()}}}),GD=Ot.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Fe(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:a}=i.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(ke.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(pe.create(i.doc,a.pos)):i.setSelection(ke.create(i.doc,a.pos));else{const d=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(c,d),i.setSelection(ke.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Im({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),JD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ZD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,XD=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,QD=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,e$=Wt.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",Fe(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[ui({find:JD,type:this.type}),ui({find:XD,type:this.type})]},addPasteRules(){return[fi({find:ZD,type:this.type}),fi({find:QD,type:this.type})]}}),t$=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),n$=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),Lg=Wt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Is(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Bg=/^(\d+)\.\s$/,r$=Ot.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",Fe(this.options.HTMLAttributes,n),0]:["ol",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(n$.name,this.editor.getAttributes(Lg.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=lo({find:Bg,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=lo({find:Bg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Lg.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),i$=Ot.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),o$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,s$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,a$=Wt.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",Fe(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[ui({find:o$,type:this.type})]},addPasteRules(){return[fi({find:s$,type:this.type})]}}),l$=Ot.create({name:"text",group:"inline"}),c$=qe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,c,d,u,f,h,p,m,g,y,k;const x=[];return this.options.blockquote!==!1&&x.push(uD.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(gD.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(bD.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(wD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(CD.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(SD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(TD.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(ID.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(VD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&x.push(PD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(KD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(GD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(e$.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(t$.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(r$.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(i$.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(a$.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(l$.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),d$=qe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new it({key:new Bt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,a=s&&s.type.isLeaf,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&&(!a||!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 g=[this.options.emptyNodeClass];u&&g.push(this.options.emptyEditorClass);const y=It.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}),Ye.create(t,o)}}})]}}),u$=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;Ot.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Fe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Im({find:u$,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const f$=qe.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),h$=Wt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),p$=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},m$=Wt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&p$(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),g$=qe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),y$={},b$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},k$=[l.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 v$(t,e){return l.openBlock(),l.createElementBlock("svg",b$,k$)}const w$=be(y$,[["render",v$]]),x$={},E$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},C$=[l.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 S$(t,e){return l.openBlock(),l.createElementBlock("svg",E$,C$)}const _$=be(x$,[["render",S$]]),O$={},T$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},N$=[l.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 M$(t,e){return l.openBlock(),l.createElementBlock("svg",T$,N$)}const A$=be(O$,[["render",M$]]),D$={},$$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},L$=[l.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 B$(t,e){return l.openBlock(),l.createElementBlock("svg",$$,L$)}const I$=be(D$,[["render",B$]]),V$={},P$={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},R$=[l.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 F$(t,e){return l.openBlock(),l.createElementBlock("svg",P$,R$)}const j$=be(V$,[["render",F$]]),z$={},H$={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},W$=[l.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 U$(t,e){return l.openBlock(),l.createElementBlock("svg",H$,W$)}const Y$=be(z$,[["render",U$]]),q$={},K$={fill:"currentColor",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"},G$=[l.createElementVNode("g",null,[l.createElementVNode("g",null,[l.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
|
|
137
|
+
`);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:t.commands.exitCode()}}},addInputRules(){return[ic({find:wD,type:this.type,getAttributes:t=>({language:t[1]})}),ic({find:xD,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new it({key:new Bt("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(ke.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,`
|
|
138
|
+
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),CD=Ot.create({name:"doc",topNode:!0,content:"block+"});function SD(t={}){return new it({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 a=e.nodeBefore,c=e.nodeAfter;if(a||c){let d=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=a?u.bottom:u.top;a&&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 a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Dh(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const OD=qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[SD(this.options)]}});class je extends xe{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return je.valid(r)?new je(r):xe.near(r)}content(){return ne.empty}eq(e){return e instanceof je&&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 je(e.resolve(n.pos))}getBookmark(){return new xc(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!TD(e)||!ND(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&&je.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let c=e.doc.resolve(i);if(je.valid(c))return c}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!pe.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(je.valid(a))return a}return null}}}je.prototype.visible=!1,je.findFrom=je.findGapCursorFrom,xe.jsonID("gapcursor",je);class xc{constructor(e){this.pos=e}map(e){return new xc(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return je.valid(n)?new je(n):xe.near(n)}}function TD(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 ND(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 MD(){return new it({props:{decorations:LD,createSelectionBetween(t,e,n){return e.pos==n.pos&&je.valid(n)?new je(n):null},handleClick:DD,handleKeyDown:AD,handleDOMEvents:{beforeinput:$D}}})}const AD=im({ArrowLeft:Ws("horiz",-1),ArrowRight:Ws("horiz",1),ArrowUp:Ws("vert",-1),ArrowDown:Ws("vert",1)});function Ws(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,c=s.empty;if(s instanceof ke){if(!o.endOfTextblock(n)||a.depth==0)return!1;c=!1,a=r.doc.resolve(e>0?a.after():a.before())}let d=je.findGapCursorFrom(a,e,c);return d?(i&&i(r.tr.setSelection(new je(d))),!0):!1}}function DD(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!je.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&pe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new je(r))),!0)}function $D(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof je))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=J.empty;for(let s=r.length-1;s>=0;s--)i=J.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new ne(i,0,0));return o.setSelection(ke.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function LD(t){if(!(t.selection instanceof je))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ye.create(t.doc,[It.widget(t.selection.head,e,{key:"gapcursor"})])}const BD=qe.create({name:"gapCursor",addProseMirrorPlugins(){return[MD()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ce(ae(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),ID=Ot.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Fe(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
139
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,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=>a.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),VD=Ot.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]}`,Fe(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=>ic({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Us=200,et=function(){};et.prototype.append=function(e){return e.length?(e=et.from(e),!this.length&&e||e.length<Us&&this.leafAppend(e)||this.length<Us&&e.leafPrepend(this)||this.appendInner(e)):this},et.prototype.prepend=function(e){return e.length?et.from(e).append(this):this},et.prototype.appendInner=function(e){return new PD(this,e)},et.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?et.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},et.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},et.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)},et.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},et.from=function(e){return e instanceof et?e:e&&e.length?new Og(e):et.empty};var Og=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var c=o;c<s;c++)if(i(this.values[c],a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var c=o-1;c>=s;c--)if(i(this.values[c],a+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Us)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Us)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}(et);et.empty=new Og([]);var PD=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(et);const RD=500;class tn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,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 pn(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 pn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,c=new tn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,c=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new pn(e.mapping.maps[u],f,n),p;(p=c&&c.merge(h))&&(h=p,u?o.pop():a=a.slice(0,a.length-1)),o.push(h),n&&(s++,n=void 0),i||(c=h)}let d=s-r.depth;return d>jD&&(a=FD(a,d),s-=d),new tn(a.append(o),s)}remapping(e,n){let r=new Zr;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 tn(this.items.append(e.map(n=>new pn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let 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 g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(c+1,p));y&&a++,r.push(new pn(m,g,y))}else r.push(new pn(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new pn(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new tn(u,a);return f.emptyItemCount()>RD&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let 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 pn(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 tn(et.from(i.reverse()),o)}}tn.empty=new tn(et.empty,0);function FD(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class pn{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 pn(n.getMap().invert(),n,this.selection)}}}class ir{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const jD=20;function zD(t,e,n,r){let i=n.getMeta(Ar),o;if(i)return i.historyState;n.getMeta(UD)&&(t=new ir(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Ar))return s.getMeta(Ar).redo?new ir(t.done.addTransform(n,void 0,r,Ys(e)),t.undone,Tg(n.mapping.maps),t.prevTime,t.prevComposition):new ir(t.done,t.undone.addTransform(n,void 0,r,Ys(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),c=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!HD(n,t.prevRanges)),d=s?Ec(t.prevRanges,n.mapping):Tg(n.mapping.maps);return new ir(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,Ys(e)),tn.empty,d,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new ir(t.done.rebased(n,o),t.undone.rebased(n,o),Ec(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ir(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ec(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function HD(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 Tg(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Ec(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 WD(t,e,n){let r=Ys(e),i=Ar.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new ir(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ar,{redo:n,historyState:c})}let Cc=!1,Ng=null;function Ys(t){let e=t.plugins;if(Ng!=e){Cc=!1,Ng=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Cc=!0;break}}return Cc}const Ar=new Bt("history"),UD=new Bt("closeHistory");function YD(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new it({key:Ar,state:{init(){return new ir(tn.empty,tn.empty,null,0,-1)},apply(e,n,r){return zD(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Ag:r=="historyRedo"?Dg:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Mg(t,e){return(n,r)=>{let i=Ar.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=WD(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Ag=Mg(!1,!0),Dg=Mg(!0,!0),qD=qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Ag(t,e),redo:()=>({state:t,dispatch:e})=>Dg(t,e)}},addProseMirrorPlugins(){return[YD(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()}}}),KD=Ot.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Fe(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:a}=i.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(ke.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(pe.create(i.doc,a.pos)):i.setSelection(ke.create(i.doc,a.pos));else{const d=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(c,d),i.setSelection(ke.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Bm({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,JD=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ZD=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,XD=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,QD=Wt.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",Fe(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[ui({find:GD,type:this.type}),ui({find:ZD,type:this.type})]},addPasteRules(){return[fi({find:JD,type:this.type}),fi({find:XD,type:this.type})]}}),e$=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),t$=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Fe(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)}}}),$g=Wt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Is(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Lg=/^(\d+)\.\s$/,n$=Ot.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",Fe(this.options.HTMLAttributes,n),0]:["ol",Fe(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(t$.name,this.editor.getAttributes($g.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=lo({find:Lg,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=lo({find:Lg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($g.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),r$=Ot.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),i$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,o$=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,s$=Wt.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",Fe(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[ui({find:i$,type:this.type})]},addPasteRules(){return[fi({find:o$,type:this.type})]}}),a$=Ot.create({name:"text",group:"inline"}),l$=qe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,c,d,u,f,h,p,m,g,y,k;const x=[];return this.options.blockquote!==!1&&x.push(dD.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(mD.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(yD.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(vD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(ED.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(CD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(OD.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(BD.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(ID.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&x.push(VD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(qD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(KD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(QD.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(e$.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(n$.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(r$.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(s$.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(a$.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),c$=qe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new it({key:new Bt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,a=s&&s.type.isLeaf,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&&(!a||!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 g=[this.options.emptyNodeClass];u&&g.push(this.options.emptyEditorClass);const y=It.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}),Ye.create(t,o)}}})]}}),d$=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;Ot.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Fe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Bm({find:d$,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});const u$=qe.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),f$=Wt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),h$=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;const o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},p$=Wt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&h$(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),m$=qe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),g$={},y$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},b$=[l.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 k$(t,e){return l.openBlock(),l.createElementBlock("svg",y$,b$)}const v$=be(g$,[["render",k$]]),w$={},x$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},E$=[l.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 C$(t,e){return l.openBlock(),l.createElementBlock("svg",x$,E$)}const S$=be(w$,[["render",C$]]),_$={},O$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},T$=[l.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 N$(t,e){return l.openBlock(),l.createElementBlock("svg",O$,T$)}const M$=be(_$,[["render",N$]]),A$={},D$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},$$=[l.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 L$(t,e){return l.openBlock(),l.createElementBlock("svg",D$,$$)}const B$=be(A$,[["render",L$]]),I$={},V$={fill:"currentColor",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},P$=[l.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 R$(t,e){return l.openBlock(),l.createElementBlock("svg",V$,P$)}const F$=be(I$,[["render",R$]]),j$={},z$={fill:"currentColor",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},H$=[l.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 W$(t,e){return l.openBlock(),l.createElementBlock("svg",z$,H$)}const U$=be(j$,[["render",W$]]),Y$={},q$={fill:"currentColor",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"},K$=[l.createElementVNode("g",null,[l.createElementVNode("g",null,[l.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
|
|
140
140
|
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
|
|
141
141
|
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
|
|
142
|
-
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 J$(t,e){return l.openBlock(),l.createElementBlock("svg",K$,G$)}const Z$=be(q$,[["render",J$]]),X$={},Q$={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},eL=[l.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_1_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-432.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_1_fill" transform="translate(432.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M19.0001,13.5187 L19.0001,20 C19.0001,20.5523 18.5524,21 18.0001,21 C17.4478,21 17.0001,20.5523 17.0001,20 L17.0001,15.366 C16.5471,15.6281 15.9624,15.4962 15.6681,15.0547 C15.3617,14.5951 15.4859,13.9743 15.9454,13.6679 L17.4299,12.6783 C18.101,12.2308 19.0001,12.712 19.0001,13.5187 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function tL(t,e){return l.openBlock(),l.createElementBlock("svg",Q$,eL)}const nL=be(X$,[["render",tL]]),rL={},iL={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},oL=[l.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_2_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-480.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_2_fill" transform="translate(480.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M17.6575,12.6792 C18.2901,12.521 18.9499,12.6085 19.5304,12.8987 C20.6957,13.4814 21.2873,14.8195 20.9732,16.0757 C20.8743714,16.4711857 20.6906857,16.8394878 20.4358711,17.1556055 L20.3026,17.3092 L18.7244,19.0001 L20.3542,19.0001 C20.9065,19.0001 21.3542,19.4478 21.3542,20.0001 C21.3542,20.51295 20.968173,20.9356092 20.4708239,20.9933725 L20.3542,21.0001 L16.6492,21.0001 C16.0918,21.0001 15.6399,20.5482 15.6399,19.9908 C15.6399,19.69785 15.6621031,19.4213609 15.830043,19.1827703 L15.9113,19.0829 L18.8405,15.9446 C19.313,15.4383 18.8904,14.4325 18.1425,14.6195 C17.8287222,14.6979889 17.6756556,14.9547296 17.6455145,15.2464465 L17.6399,15.3572 C17.6399,15.9095 17.1922,16.3572 16.6399,16.3572 C16.0876,16.3572 15.6399,15.9095 15.6399,15.3572 C15.6399,14.1109 16.4218,12.9881 17.6575,12.6792 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function sL(t,e){return l.openBlock(),l.createElementBlock("svg",iL,oL)}const aL=be(rL,[["render",sL]]),lL={},cL={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},dL=[l.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_3_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-528.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_3_fill" transform="translate(528.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M18.3715,12.5 C19.827,12.5 21.0001,13.6854 21.0001,15.1334 C21.0001,15.7245 20.8,16.2932 20.4418,16.7501 C20.7999,17.2069 20.9999,17.7756 20.9999,18.3666 C20.9999,19.8146 19.8268,21 18.3713,21 C17.3195,21 16.332,20.6496 15.8873,19.6016 C15.6461,19.033 15.6582,18.3518 16.3235,18.0694 C16.7955857,17.8691071 17.3354439,18.0594112 17.5829394,18.4946729 L17.6347,18.5994 C17.7727273,18.9247091 17.9135661,18.9858645 18.1765622,18.9973488 L18.3713,19 L18.3713,19 C18.7147,19 18.9999,18.7176 18.9999,18.3666 C18.9999,17.9941455 18.7151893,17.7892942 18.3855875,17.7551267 L18.2856,17.75 C17.7333,17.75 17.2856,17.3023 17.2856,16.75 C17.2856,16.23715 17.6717995,15.8144908 18.1691731,15.7567275 L18.2858,15.75 C18.6556,15.75 19.0001,15.5431 19.0001,15.1334 C19.0001,14.7824 18.7149,14.5 18.3715,14.5 L18.1767622,14.5026512 C17.9429879,14.5128595 17.8057329,14.562314 17.6811769,14.8016529 L17.6349,14.9006 C17.4192,15.409 16.8322,15.6463 16.3238,15.4306 C15.6584,15.1482 15.6463,14.467 15.8876,13.8984 C16.3323,12.8504 17.3197,12.5 18.3715,12.5 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function uL(t,e){return l.openBlock(),l.createElementBlock("svg",cL,dL)}const fL=be(lL,[["render",uL]]),hL={},pL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},mL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function gL(t,e){return l.openBlock(),l.createElementBlock("svg",pL,mL)}const yL=be(hL,[["render",gL]]),bL={},kL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},vL=[l.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8ZM5.5 12.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z"},null,-1)];function wL(t,e){return l.openBlock(),l.createElementBlock("svg",kL,vL)}const xL=be(bL,[["render",wL]]),EL={},CL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},SL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm6 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function _L(t,e){return l.openBlock(),l.createElementBlock("svg",CL,SL)}const OL=be(EL,[["render",_L]]),TL={},NL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},ML=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function AL(t,e){return l.openBlock(),l.createElementBlock("svg",NL,ML)}const DL=be(TL,[["render",AL]]),$L={},LL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},BL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.75 2a.75.75 0 0 1 .75.75V7a2.5 2.5 0 0 0 5 0V2.75a.75.75 0 0 1 1.5 0V7a4 4 0 0 1-8 0V2.75A.75.75 0 0 1 4.75 2ZM2 13.25a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function IL(t,e){return l.openBlock(),l.createElementBlock("svg",LL,BL)}const VL=be($L,[["render",IL]]),PL={},RL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},FL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.165 3.654c-.95-.255-1.921-.273-2.693-.042-.769.231-1.087.624-1.173.947-.087.323-.008.822.543 1.407.389.412.927.77 1.55 1.034H13a.75.75 0 0 1 0 1.5H3A.75.75 0 0 1 3 7h1.756l-.006-.006c-.787-.835-1.161-1.849-.9-2.823.26-.975 1.092-1.666 2.191-1.995 1.097-.33 2.36-.28 3.512.029.75.2 1.478.518 2.11.939a.75.75 0 0 1-.833 1.248 5.682 5.682 0 0 0-1.665-.738Zm2.074 6.365a.75.75 0 0 1 .91.543 2.44 2.44 0 0 1-.35 2.024c-.405.585-1.052 1.003-1.84 1.24-1.098.329-2.36.279-3.512-.03-1.152-.308-2.27-.897-3.056-1.73a.75.75 0 0 1 1.092-1.029c.552.586 1.403 1.056 2.352 1.31.95.255 1.92.273 2.692.042.55-.165.873-.417 1.038-.656a.942.942 0 0 0 .13-.803.75.75 0 0 1 .544-.91Z","clip-rule":"evenodd"},null,-1)];function jL(t,e){return l.openBlock(),l.createElementBlock("svg",RL,FL)}const zL=be(PL,[["render",jL]]),HL={},WL={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},UL=[l.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"},null,-1),l.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),l.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[l.createElementVNode("path",{d:"M5 18h14v3H5zm7.5-14h-1c-.401 0-.764.24-.921.609L5.745 16h2.173l1.273-3h5.604l1.268 3h2.171L13.421 4.61A1 1 0 0 0 12.5 4zm-2.46 7 1.959-4.616L13.95 11h-3.91z"})],-1)];function YL(t,e){return l.openBlock(),l.createElementBlock("svg",WL,UL)}const qL=be(HL,[["render",YL]]),KL={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},GL={class:"flex gap-px"},JL=["onClick"],ZL={key:1,class:"text-sm"},XL=Object.assign({name:"WpicTextEditor"},{props:{modelValue:{type:String,default:""},heading:Boolean,textAlign:Boolean,underline:Boolean,strike:Boolean,customStyles:{type:{},default:()=>{}},color:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=l.ref("#000000"),i=l.ref(!1),o=l.ref(),s={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 dark:text-gray-200 dark:bg-gray-930 dark:border-gray-900"},a=[{method:"toggleBold",type:"chain",label:"bold",icon:Y$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:j$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:VL,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:zL,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:Z$,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:nL,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:aL,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:fL,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:yL,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:xL,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:OL,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:DL,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:w$,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:_$,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:A$,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:I$,disableCheck:!0,active:!0}],c=e,d=cD({content:n.modelValue,extensions:[c$,h$,g$,m$,f$.configure({types:["heading","paragraph"]}),d$.configure({placeholder:"..."})],onUpdate:()=>{c("update:modelValue",d.value.getHTML())}});l.onBeforeUnmount(()=>{d.value.destroy()}),l.watch(()=>n.modelValue,m=>{m!==d.value.getHTML()&&d.value.commands.setContent(m,!1)});function u(m,g,y){if(m==="setTextAlign"){d.value.isActive({textAlign:y})?d.value.chain().focus().unsetTextAlign().run():d.value.chain().focus().setTextAlign(y).run();return}g==="chain"?y?d.value.chain().focus()[m](y).run():d.value.chain().focus()[m]().run():d.value[m]()()}function f(m,g,y,k){return k?g==="chain"?y?!d.value.can().chain().focus()[m](y).run():!d.value.can().chain().focus()[m]().run():!d.value.can()[m]().run():!1}const h=()=>{d.value.chain().focus().setColor(r.value).run(),i.value=!1},p=()=>{o.value.click()};return(m,g)=>{var y;return l.unref(d)?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["pt-px relative flex flex-col rounded-sm border",s[l.unref(fe).theme]])},[l.createElementVNode("div",KL,[l.createElementVNode("div",GL,[t.color?(l.openBlock(),l.createElementBlock("div",{key:0,onClick:p,class:"w-8 h-8 relative flex cursor-pointer items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10"},[l.createVNode(qL,{class:"w-5 h-5",style:{}}),l.withDirectives(l.createElementVNode("input",{ref_key:"myColorPicker",ref:o,type:"color","onUpdate:modelValue":g[0]||(g[0]=k=>r.value=k),class:"w-0",onInput:h},null,544),[[l.vModelText,r.value]])])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.filter(k=>k.active),k=>(l.openBlock(),l.createElementBlock("div",{key:k.method,class:l.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10",{"cursor-pointer":!f(k.method,k.type,k.params,k.disableCheck),"is-active text-gray-800 bg-gray-200 dark:text-white dark:bg-white/10":k.label.startsWith("h")?l.unref(d).isActive("heading",{level:k.params.level}):k.method==="setTextAlign"?l.unref(d).isActive({textAlign:k.params}):l.unref(d).isActive(k.label)}]),onClick:x=>u(k.method,k.type,k.params)},[k.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(k.icon),{key:0,class:l.normalizeClass(["",{"w-3 h-3":k.smallIcon,"w-4 h-4":!k.smallIcon&&!k.largeIcon,"w-5 h-5":k.largeIcon}])},null,8,["class"])):(l.openBlock(),l.createElementBlock("span",ZL,l.toDisplayString(l.unref(h1).capitalize(k.label)),1))],10,JL))),128))])]),l.createElementVNode("div",{class:"max-h-72 w-full overflow-auto px-4 py-3 rounded-b-sm",style:l.normalizeStyle({backgroundColor:(y=t.customStyles)==null?void 0:y.backgroundColor})},[l.createVNode(l.unref(lD),{editor:l.unref(d)},null,8,["editor"])],4)],2)):l.createCommentVNode("",!0)}}}),QL={},eB={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function nB(t,e){return l.openBlock(),l.createElementBlock("svg",eB,tB)}const rB=be(QL,[["render",nB]]),iB={},oB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},sB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function aB(t,e){return l.openBlock(),l.createElementBlock("svg",oB,sB)}const lB=be(iB,[["render",aB]]),cB={},dB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},uB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1),l.createElementVNode("line",{x1:"7.5",y1:"2",x2:"22",y2:"16",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1),l.createElementVNode("line",{x1:"2",y1:"7.5",x2:"16",y2:"22",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1)];function fB(t,e){return l.openBlock(),l.createElementBlock("svg",dB,uB)}const hB=be(cB,[["render",fB]]),pB={class:"flex-1"},mB=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean,info:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("span",{class:l.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-purple-100 border-purple-200 text-purple-700 dark:border-purple-600/30 dark:bg-purple-800/25 dark:text-purple-500/85":t.info,"bg-gray-100 border-gray-200 text-gray-700 dark:border-gray-600/30 dark:bg-white/5 dark:text-gray-400/85":!t.info&&!t.success&&!t.warning&&!t.error}])},[t.complete?(l.openBlock(),l.createBlock(rB,{key:0,class:"w-2.5 h-2.5"})):l.createCommentVNode("",!0),t.incomplete?(l.openBlock(),l.createBlock(lB,{key:1,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),t.partially?(l.openBlock(),l.createBlock(hB,{key:2,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),l.createElementVNode("span",pB,[l.renderSlot(e.$slots,"default")])],2))}}),Sc={__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":`
|
|
142
|
+
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 G$(t,e){return l.openBlock(),l.createElementBlock("svg",q$,K$)}const J$=be(Y$,[["render",G$]]),Z$={},X$={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},Q$=[l.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_1_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-432.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_1_fill" transform="translate(432.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M19.0001,13.5187 L19.0001,20 C19.0001,20.5523 18.5524,21 18.0001,21 C17.4478,21 17.0001,20.5523 17.0001,20 L17.0001,15.366 C16.5471,15.6281 15.9624,15.4962 15.6681,15.0547 C15.3617,14.5951 15.4859,13.9743 15.9454,13.6679 L17.4299,12.6783 C18.101,12.2308 19.0001,12.712 19.0001,13.5187 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function eL(t,e){return l.openBlock(),l.createElementBlock("svg",X$,Q$)}const tL=be(Z$,[["render",eL]]),nL={},rL={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},iL=[l.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_2_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-480.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_2_fill" transform="translate(480.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M17.6575,12.6792 C18.2901,12.521 18.9499,12.6085 19.5304,12.8987 C20.6957,13.4814 21.2873,14.8195 20.9732,16.0757 C20.8743714,16.4711857 20.6906857,16.8394878 20.4358711,17.1556055 L20.3026,17.3092 L18.7244,19.0001 L20.3542,19.0001 C20.9065,19.0001 21.3542,19.4478 21.3542,20.0001 C21.3542,20.51295 20.968173,20.9356092 20.4708239,20.9933725 L20.3542,21.0001 L16.6492,21.0001 C16.0918,21.0001 15.6399,20.5482 15.6399,19.9908 C15.6399,19.69785 15.6621031,19.4213609 15.830043,19.1827703 L15.9113,19.0829 L18.8405,15.9446 C19.313,15.4383 18.8904,14.4325 18.1425,14.6195 C17.8287222,14.6979889 17.6756556,14.9547296 17.6455145,15.2464465 L17.6399,15.3572 C17.6399,15.9095 17.1922,16.3572 16.6399,16.3572 C16.0876,16.3572 15.6399,15.9095 15.6399,15.3572 C15.6399,14.1109 16.4218,12.9881 17.6575,12.6792 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function oL(t,e){return l.openBlock(),l.createElementBlock("svg",rL,iL)}const sL=be(nL,[["render",oL]]),aL={},lL={viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",fill:"currentColor"},cL=[l.createStaticVNode('<g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><title>Heading_3_fill</title> <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Editor" transform="translate(-528.000000, -48.000000)" fill-rule="nonzero"><g id="Heading_3_fill" transform="translate(528.000000, 48.000000)"><path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero"></path> <path d="M13,2.5 C13.7796706,2.5 14.4204457,3.09488554 14.4931332,3.85553954 L14.5,4 L14.5,20 C14.5,20.8284 13.8284,21.5 13,21.5 C12.2203294,21.5 11.5795543,20.9050879 11.5068668,20.1444558 L11.5,20 L11.5,13.5 L5.5,13.5 L5.5,20 C5.5,20.8284 4.82843,21.5 4,21.5 C3.22030118,21.5 2.579551,20.9050879 2.50686655,20.1444558 L2.5,20 L2.5,4 C2.5,3.17157 3.17157,2.5 4,2.5 C4.77969882,2.5 5.420449,3.09488554 5.49313345,3.85553954 L5.5,4 L5.5,10.5 L11.5,10.5 L11.5,4 C11.5,3.17157 12.1716,2.5 13,2.5 Z M18.3715,12.5 C19.827,12.5 21.0001,13.6854 21.0001,15.1334 C21.0001,15.7245 20.8,16.2932 20.4418,16.7501 C20.7999,17.2069 20.9999,17.7756 20.9999,18.3666 C20.9999,19.8146 19.8268,21 18.3713,21 C17.3195,21 16.332,20.6496 15.8873,19.6016 C15.6461,19.033 15.6582,18.3518 16.3235,18.0694 C16.7955857,17.8691071 17.3354439,18.0594112 17.5829394,18.4946729 L17.6347,18.5994 C17.7727273,18.9247091 17.9135661,18.9858645 18.1765622,18.9973488 L18.3713,19 L18.3713,19 C18.7147,19 18.9999,18.7176 18.9999,18.3666 C18.9999,17.9941455 18.7151893,17.7892942 18.3855875,17.7551267 L18.2856,17.75 C17.7333,17.75 17.2856,17.3023 17.2856,16.75 C17.2856,16.23715 17.6717995,15.8144908 18.1691731,15.7567275 L18.2858,15.75 C18.6556,15.75 19.0001,15.5431 19.0001,15.1334 C19.0001,14.7824 18.7149,14.5 18.3715,14.5 L18.1767622,14.5026512 C17.9429879,14.5128595 17.8057329,14.562314 17.6811769,14.8016529 L17.6349,14.9006 C17.4192,15.409 16.8322,15.6463 16.3238,15.4306 C15.6584,15.1482 15.6463,14.467 15.8876,13.8984 C16.3323,12.8504 17.3197,12.5 18.3715,12.5 Z" id="形状" fill="currentColor"></path></g></g></g></g>',3)];function dL(t,e){return l.openBlock(),l.createElementBlock("svg",lL,cL)}const uL=be(aL,[["render",dL]]),fL={},hL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},pL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function mL(t,e){return l.openBlock(),l.createElementBlock("svg",hL,pL)}const gL=be(fL,[["render",mL]]),yL={},bL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},kL=[l.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8ZM5.5 12.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z"},null,-1)];function vL(t,e){return l.openBlock(),l.createElementBlock("svg",bL,kL)}const wL=be(yL,[["render",vL]]),xL={},EL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},CL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm6 4.25a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function SL(t,e){return l.openBlock(),l.createElementBlock("svg",EL,CL)}const _L=be(xL,[["render",SL]]),OL={},TL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},NL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M2 3.75A.75.75 0 0 1 2.75 3h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 3.75ZM2 8a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 8Zm0 4.25a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function ML(t,e){return l.openBlock(),l.createElementBlock("svg",TL,NL)}const AL=be(OL,[["render",ML]]),DL={},$L={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},LL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.75 2a.75.75 0 0 1 .75.75V7a2.5 2.5 0 0 0 5 0V2.75a.75.75 0 0 1 1.5 0V7a4 4 0 0 1-8 0V2.75A.75.75 0 0 1 4.75 2ZM2 13.25a.75.75 0 0 1 .75-.75h10.5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1-.75-.75Z","clip-rule":"evenodd"},null,-1)];function BL(t,e){return l.openBlock(),l.createElementBlock("svg",$L,LL)}const IL=be(DL,[["render",BL]]),VL={},PL={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},RL=[l.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.165 3.654c-.95-.255-1.921-.273-2.693-.042-.769.231-1.087.624-1.173.947-.087.323-.008.822.543 1.407.389.412.927.77 1.55 1.034H13a.75.75 0 0 1 0 1.5H3A.75.75 0 0 1 3 7h1.756l-.006-.006c-.787-.835-1.161-1.849-.9-2.823.26-.975 1.092-1.666 2.191-1.995 1.097-.33 2.36-.28 3.512.029.75.2 1.478.518 2.11.939a.75.75 0 0 1-.833 1.248 5.682 5.682 0 0 0-1.665-.738Zm2.074 6.365a.75.75 0 0 1 .91.543 2.44 2.44 0 0 1-.35 2.024c-.405.585-1.052 1.003-1.84 1.24-1.098.329-2.36.279-3.512-.03-1.152-.308-2.27-.897-3.056-1.73a.75.75 0 0 1 1.092-1.029c.552.586 1.403 1.056 2.352 1.31.95.255 1.92.273 2.692.042.55-.165.873-.417 1.038-.656a.942.942 0 0 0 .13-.803.75.75 0 0 1 .544-.91Z","clip-rule":"evenodd"},null,-1)];function FL(t,e){return l.openBlock(),l.createElementBlock("svg",PL,RL)}const jL=be(VL,[["render",FL]]),zL={},HL={fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},WL=[l.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"},null,-1),l.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),l.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[l.createElementVNode("path",{d:"M5 18h14v3H5zm7.5-14h-1c-.401 0-.764.24-.921.609L5.745 16h2.173l1.273-3h5.604l1.268 3h2.171L13.421 4.61A1 1 0 0 0 12.5 4zm-2.46 7 1.959-4.616L13.95 11h-3.91z"})],-1)];function UL(t,e){return l.openBlock(),l.createElementBlock("svg",HL,WL)}const YL=be(zL,[["render",UL]]),qL={class:"py-1 px-1 border-b dark:border-gray-900 dark:bg-gray-810"},KL={class:"flex gap-px"},GL=["onClick"],JL={key:1,class:"text-sm"},ZL=Object.assign({name:"WpicTextEditor"},{props:{modelValue:{type:String,default:""},heading:Boolean,textAlign:Boolean,underline:Boolean,strike:Boolean,customStyles:{type:{},default:()=>{}},color:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=l.ref("#000000"),i=l.ref(!1),o=l.ref(),s={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 dark:text-gray-200 dark:bg-gray-930 dark:border-gray-900"},a=[{method:"toggleBold",type:"chain",label:"bold",icon:U$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:F$,smallIcon:!0,disableCheck:!0,active:!0},{method:"toggleUnderline",type:"chain",label:"underline",icon:IL,disableCheck:!0,active:n.underline},{method:"toggleStrike",type:"chain",label:"strike",icon:jL,disableCheck:!0,active:n.strike},{method:"setParagraph",type:"chain",label:"paragraph",icon:J$,smallIcon:!0,disableCheck:!1,active:!0},{method:"toggleHeading",type:"chain",label:"h1",icon:tL,params:{level:1},disableCheck:!0,active:n.heading},{method:"toggleHeading",type:"chain",label:"h2",icon:sL,params:{level:2},disableCheck:!1,active:n.heading},{method:"toggleHeading",type:"chain",label:"h3",icon:uL,params:{level:3},disableCheck:!1,active:n.heading},{method:"setTextAlign",type:"chain",label:"left",icon:gL,disableCheck:!1,active:n.textAlign,params:"left"},{method:"setTextAlign",type:"chain",label:"center",icon:wL,disableCheck:!1,active:n.textAlign,params:"center"},{method:"setTextAlign",type:"chain",label:"right",icon:_L,disableCheck:!1,active:n.textAlign,params:"right"},{method:"setTextAlign",type:"chain",label:"justify",icon:AL,disableCheck:!1,active:n.textAlign,params:"justify"},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:v$,disableCheck:!1,active:!0},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:S$,disableCheck:!1,active:!0},{method:"undo",type:"chain",label:"undo",icon:M$,disableCheck:!0,active:!0},{method:"redo",type:"chain",label:"redo",icon:B$,disableCheck:!0,active:!0}],c=e,d=lD({content:n.modelValue,extensions:[l$,f$,m$,p$,u$.configure({types:["heading","paragraph"]}),c$.configure({placeholder:"..."})],onUpdate:()=>{c("update:modelValue",d.value.getHTML())}});l.onBeforeUnmount(()=>{d.value.destroy()}),l.watch(()=>n.modelValue,m=>{m!==d.value.getHTML()&&d.value.commands.setContent(m,!1)});function u(m,g,y){if(m==="setTextAlign"){d.value.isActive({textAlign:y})?d.value.chain().focus().unsetTextAlign().run():d.value.chain().focus().setTextAlign(y).run();return}g==="chain"?y?d.value.chain().focus()[m](y).run():d.value.chain().focus()[m]().run():d.value[m]()()}function f(m,g,y,k){return k?g==="chain"?y?!d.value.can().chain().focus()[m](y).run():!d.value.can().chain().focus()[m]().run():!d.value.can()[m]().run():!1}const h=()=>{d.value.chain().focus().setColor(r.value).run(),i.value=!1},p=()=>{o.value.click()};return(m,g)=>{var y;return l.unref(d)?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["pt-px relative flex flex-col rounded-sm border",s[l.unref(fe).theme]])},[l.createElementVNode("div",qL,[l.createElementVNode("div",KL,[t.color?(l.openBlock(),l.createElementBlock("div",{key:0,onClick:p,class:"w-8 h-8 relative flex cursor-pointer items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10"},[l.createVNode(YL,{class:"w-5 h-5",style:{}}),l.withDirectives(l.createElementVNode("input",{ref_key:"myColorPicker",ref:o,type:"color","onUpdate:modelValue":g[0]||(g[0]=k=>r.value=k),class:"w-0",onInput:h},null,544),[[l.vModelText,r.value]])])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.filter(k=>k.active),k=>(l.openBlock(),l.createElementBlock("div",{key:k.method,class:l.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded-sm text-gray-800 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/10",{"cursor-pointer":!f(k.method,k.type,k.params,k.disableCheck),"is-active text-gray-800 bg-gray-200 dark:text-white dark:bg-white/10":k.label.startsWith("h")?l.unref(d).isActive("heading",{level:k.params.level}):k.method==="setTextAlign"?l.unref(d).isActive({textAlign:k.params}):l.unref(d).isActive(k.label)}]),onClick:x=>u(k.method,k.type,k.params)},[k.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(k.icon),{key:0,class:l.normalizeClass(["",{"w-3 h-3":k.smallIcon,"w-4 h-4":!k.smallIcon&&!k.largeIcon,"w-5 h-5":k.largeIcon}])},null,8,["class"])):(l.openBlock(),l.createElementBlock("span",JL,l.toDisplayString(l.unref(f1).capitalize(k.label)),1))],10,GL))),128))])]),l.createElementVNode("div",{class:"max-h-72 w-full overflow-auto px-4 py-3 rounded-b-sm",style:l.normalizeStyle({backgroundColor:(y=t.customStyles)==null?void 0:y.backgroundColor})},[l.createVNode(l.unref(aD),{editor:l.unref(d)},null,8,["editor"])],4)],2)):l.createCommentVNode("",!0)}}}),XL={},QL={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"currentColor","stroke-width":"2.5"},null,-1)];function tB(t,e){return l.openBlock(),l.createElementBlock("svg",QL,eB)}const nB=be(XL,[["render",tB]]),rB={},iB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"none"},oB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1)];function sB(t,e){return l.openBlock(),l.createElementBlock("svg",iB,oB)}const aB=be(rB,[["render",sB]]),lB={},cB={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none"},dB=[l.createElementVNode("rect",{x:"2",y:"2",width:"20",height:"20",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"3"},null,-1),l.createElementVNode("line",{x1:"7.5",y1:"2",x2:"22",y2:"16",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1),l.createElementVNode("line",{x1:"2",y1:"7.5",x2:"16",y2:"22",stroke:"currentColor",class:"opacity-75","stroke-width":"2.5"},null,-1)];function uB(t,e){return l.openBlock(),l.createElementBlock("svg",cB,dB)}const fB=be(lB,[["render",uB]]),hB={class:"flex-1"},pB=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean,complete:Boolean,incomplete:Boolean,partially:Boolean,info:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("span",{class:l.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-purple-100 border-purple-200 text-purple-700 dark:border-purple-600/30 dark:bg-purple-800/25 dark:text-purple-500/85":t.info,"bg-gray-100 border-gray-200 text-gray-700 dark:border-gray-600/30 dark:bg-white/5 dark:text-gray-400/85":!t.info&&!t.success&&!t.warning&&!t.error}])},[t.complete?(l.openBlock(),l.createBlock(nB,{key:0,class:"w-2.5 h-2.5"})):l.createCommentVNode("",!0),t.incomplete?(l.openBlock(),l.createBlock(aB,{key:1,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),t.partially?(l.openBlock(),l.createBlock(fB,{key:2,class:"w-2.5 h-2.5 opacity-80"})):l.createCommentVNode("",!0),l.createElementVNode("span",hB,[l.renderSlot(e.$slots,"default")])],2))}}),Sc={__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":`
|
|
143
143
|
hover:text-lime-500
|
|
144
144
|
rounded-full
|
|
145
145
|
|
|
@@ -152,4 +152,4 @@ img.ProseMirror-separator {
|
|
|
152
152
|
group-[.is-off]:text-gray-300
|
|
153
153
|
dark:group-[.is-off]:text-gray-800
|
|
154
154
|
|
|
155
|
-
`},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-gray-200"},r={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800"},i={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-l-0"},o={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-r-0"},s={pmi:"","wpic-tools":"bg-gray-200"};return(a,c)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected&&!t.off,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[l.createElementVNode("div",{class:l.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[l.unref(fe).theme]}`]:t.between,[`${i[l.unref(fe).theme]}`]:t.firstDay,[`${o[l.unref(fe).theme]}`]:t.lastDay,[`${s[l.unref(fe).theme]}`]:t.highlight}]),style:l.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[l.createElementVNode("span",{class:l.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[l.unref(fe).theme]}`]:!0,[`${n[l.unref(fe).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[l.renderSlot(a.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.day),1)])],2)],6)],2))}};var _c={exports:{}},Ig;function qs(){return Ig||(Ig=1,function(t,e){(function(n,r){t.exports=r()})(sn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",c="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+)?$/,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,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(Y){var I=["th","st","nd","rd"],T=Y%100;return"["+Y+(I[(T-20)%10]||I[T]||I[0])+"]"}},w=function(Y,I,T){var R=String(Y);return!R||R.length>=I?Y:""+Array(I+1-R.length).join(T)+Y},b={s:w,z:function(Y){var I=-Y.utcOffset(),T=Math.abs(I),R=Math.floor(T/60),F=T%60;return(I<=0?"+":"-")+w(R,2,"0")+":"+w(F,2,"0")},m:function Y(I,T){if(I.date()<T.date())return-Y(T,I);var R=12*(T.year()-I.year())+(T.month()-I.month()),F=I.clone().add(R,f),ee=T-F<0,ie=I.clone().add(R+(ee?-1:1),f);return+(-(R+(T-F)/(ee?F-ie:ie-F))||0)},a:function(Y){return Y<0?Math.ceil(Y)||0:Math.floor(Y)},p:function(Y){return{M:f,y:p,w:u,d,D:m,h:c,m:a,s,ms:o,Q:h}[Y]||String(Y||"").toLowerCase().replace(/s$/,"")},u:function(Y){return Y===void 0}},C="en",v={};v[C]=x;var S="$isDayjsObject",D=function(Y){return Y instanceof B||!(!Y||!Y[S])},O=function Y(I,T,R){var F;if(!I)return C;if(typeof I=="string"){var ee=I.toLowerCase();v[ee]&&(F=ee),T&&(v[ee]=T,F=ee);var ie=I.split("-");if(!F&&ie.length>1)return Y(ie[0])}else{var he=I.name;v[he]=I,F=he}return!R&&F&&(C=F),F||!R&&C},$=function(Y,I){if(D(Y))return Y.clone();var T=typeof I=="object"?I:{};return T.date=Y,T.args=arguments,new B(T)},V=b;V.l=O,V.i=D,V.w=function(Y,I){return $(Y,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var B=function(){function Y(T){this.$L=O(T.locale,null,!0),this.parse(T),this.$x=this.$x||T.x||{},this[S]=!0}var I=Y.prototype;return I.parse=function(T){this.$d=function(R){var F=R.date,ee=R.utc;if(F===null)return new Date(NaN);if(V.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var ie=F.match(y);if(ie){var he=ie[2]-1||0,ue=(ie[7]||"0").substring(0,3);return ee?new Date(Date.UTC(ie[1],he,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,ue)):new Date(ie[1],he,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,ue)}}return new Date(F)}(T),this.init()},I.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},I.$utils=function(){return V},I.isValid=function(){return this.$d.toString()!==g},I.isSame=function(T,R){var F=$(T);return this.startOf(R)<=F&&F<=this.endOf(R)},I.isAfter=function(T,R){return $(T)<this.startOf(R)},I.isBefore=function(T,R){return this.endOf(R)<$(T)},I.$g=function(T,R,F){return V.u(T)?this[R]:this.set(F,T)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(T,R){var F=this,ee=!!V.u(R)||R,ie=V.p(T),he=function(le,ve){var Ne=V.w(F.$u?Date.UTC(F.$y,ve,le):new Date(F.$y,ve,le),F);return ee?Ne:Ne.endOf(d)},ue=function(le,ve){return V.w(F.toDate()[le].apply(F.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(ve)),F)},L=this.$W,z=this.$M,q=this.$D,U="set"+(this.$u?"UTC":"");switch(ie){case p:return ee?he(1,0):he(31,11);case f:return ee?he(1,z):he(0,z+1);case u:var j=this.$locale().weekStart||0,ce=(L<j?L+7:L)-j;return he(ee?q-ce:q+(6-ce),z);case d:case m:return ue(U+"Hours",0);case c:return ue(U+"Minutes",1);case a:return ue(U+"Seconds",2);case s:return ue(U+"Milliseconds",3);default:return this.clone()}},I.endOf=function(T){return this.startOf(T,!1)},I.$set=function(T,R){var F,ee=V.p(T),ie="set"+(this.$u?"UTC":""),he=(F={},F[d]=ie+"Date",F[m]=ie+"Date",F[f]=ie+"Month",F[p]=ie+"FullYear",F[c]=ie+"Hours",F[a]=ie+"Minutes",F[s]=ie+"Seconds",F[o]=ie+"Milliseconds",F)[ee],ue=ee===d?this.$D+(R-this.$W):R;if(ee===f||ee===p){var L=this.clone().set(m,1);L.$d[he](ue),L.init(),this.$d=L.set(m,Math.min(this.$D,L.daysInMonth())).$d}else he&&this.$d[he](ue);return this.init(),this},I.set=function(T,R){return this.clone().$set(T,R)},I.get=function(T){return this[V.p(T)]()},I.add=function(T,R){var F,ee=this;T=Number(T);var ie=V.p(R),he=function(z){var q=$(ee);return V.w(q.date(q.date()+Math.round(z*T)),ee)};if(ie===f)return this.set(f,this.$M+T);if(ie===p)return this.set(p,this.$y+T);if(ie===d)return he(1);if(ie===u)return he(7);var ue=(F={},F[a]=r,F[c]=i,F[s]=n,F)[ie]||1,L=this.$d.getTime()+T*ue;return V.w(L,this)},I.subtract=function(T,R){return this.add(-1*T,R)},I.format=function(T){var R=this,F=this.$locale();if(!this.isValid())return F.invalidDate||g;var ee=T||"YYYY-MM-DDTHH:mm:ssZ",ie=V.z(this),he=this.$H,ue=this.$m,L=this.$M,z=F.weekdays,q=F.months,U=F.meridiem,j=function(ve,Ne,Ie,tt){return ve&&(ve[Ne]||ve(R,ee))||Ie[Ne].slice(0,tt)},ce=function(ve){return V.s(he%12||12,ve,"0")},le=U||function(ve,Ne,Ie){var tt=ve<12?"AM":"PM";return Ie?tt.toLowerCase():tt};return ee.replace(k,function(ve,Ne){return Ne||function(Ie){switch(Ie){case"YY":return String(R.$y).slice(-2);case"YYYY":return V.s(R.$y,4,"0");case"M":return L+1;case"MM":return V.s(L+1,2,"0");case"MMM":return j(F.monthsShort,L,q,3);case"MMMM":return j(q,L);case"D":return R.$D;case"DD":return V.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return j(F.weekdaysMin,R.$W,z,2);case"ddd":return j(F.weekdaysShort,R.$W,z,3);case"dddd":return z[R.$W];case"H":return String(he);case"HH":return V.s(he,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return le(he,ue,!0);case"A":return le(he,ue,!1);case"m":return String(ue);case"mm":return V.s(ue,2,"0");case"s":return String(R.$s);case"ss":return V.s(R.$s,2,"0");case"SSS":return V.s(R.$ms,3,"0");case"Z":return ie}return null}(ve)||ie.replace(":","")})},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(T,R,F){var ee,ie=this,he=V.p(R),ue=$(T),L=(ue.utcOffset()-this.utcOffset())*r,z=this-ue,q=function(){return V.m(ie,ue)};switch(he){case p:ee=q()/12;break;case f:ee=q();break;case h:ee=q()/3;break;case u:ee=(z-L)/6048e5;break;case d:ee=(z-L)/864e5;break;case c:ee=z/i;break;case a:ee=z/r;break;case s:ee=z/n;break;default:ee=z}return F?ee:V.a(ee)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return v[this.$L]},I.locale=function(T,R){if(!T)return this.$L;var F=this.clone(),ee=O(T,R,!0);return ee&&(F.$L=ee),F},I.clone=function(){return V.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},Y}(),J=B.prototype;return $.prototype=J,[["$ms",o],["$s",s],["$m",a],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(Y){J[Y[1]]=function(I){return this.$g(I,Y[0],Y[1])}}),$.extend=function(Y,I){return Y.$i||(Y(I,B,$),Y.$i=!0),$},$.locale=O,$.isDayjs=D,$.unix=function(Y){return $(1e3*Y)},$.en=v[C],$.Ls=v,$.p={},$})}(_c)),_c.exports}var gB=qs();const K=Ri(gB);var yB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs())})(sn,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,a){return a==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,a){var c=100*s+a;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return i.default.locale(o,null,!0),o})})(yB);var bB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs())})(sn,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s){return s+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(s){return s<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return i.default.locale(o,null,!0),o})})(bB);var kB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs())})(sn,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(s){return s+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(s){return s<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return i.default.locale(o,null,!0),o})})(kB);var Vg={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(sn,function(){var n="week",r="year";return function(i,o,s){var a=o.prototype;a.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)},a.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}})})(Vg);var vB=Vg.exports;const wB=Ri(vB);var Pg={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(sn,function(){return function(n,r,i){r.prototype.isBetween=function(o,s,a,c){var d=i(o),u=i(s),f=(c=c||"()")[0]==="(",h=c[1]===")";return(f?this.isAfter(d,a):!this.isBefore(d,a))&&(h?this.isBefore(u,a):!this.isAfter(u,a))||(f?this.isBefore(d,a):!this.isAfter(d,a))&&(h?this.isAfter(u,a):!this.isBefore(u,a))}}})})(Pg);var xB=Pg.exports;const EB=Ri(xB),CB={class:"w-full dark:text-gray-400"},SB={class:"flex justify-between items-center mb-3"},_B={class:"flex"},OB={class:"font-medium flex items-center gap-2"},TB=["value","onChange"],NB=["value"],MB=["value","onChange"],AB=["value"],DB={class:"flex"},$B={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},Oc=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,displayYearStart:Number,displayMonthStart:Number,displayYearEnd:Number,displayMonthEnd:Number,maxDate:{},minDate:{},week:Boolean,initDates:{},defaultMinYear:{type:Number,default:2019},defaultMaxYear:{type:Number,default:K().year()+10}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=jn();K.extend(EB),K.extend(wB);const r=t,i=l.computed(()=>Array.from({length:7},(z,q)=>K().day((1+q)%7).locale(n.value).format("ddd"))),o=l.ref([K(new Date).subtract(1,"month"),K(new Date)]);l.watch(()=>r.initDates,()=>{var L;if(!r.range&&r.initDates)o.value[0]=K(r.initDates);else if(!r.range&&!r.initDates)o.value[0]=K(new Date);else if(r.range&&((L=r.initDates)==null?void 0:L.length)===2){let z=K(r.initDates[0]),q=K(r.initDates[1]);q.isBefore(z,"month")&&(q=z.add(1,"month")),z.isSame(q,"month")&&(q=z.add(1,"month")),o.value=[z,q]}},{immediate:!0,once:!0}),l.watch(()=>[r.displayYearStart,r.displayMonthStart],([L,z])=>{L&&z&&(o.value[0]=K().year(Number(L)).month(Number(z)).startOf("month"),o.value[1]=K().year(Number(L)).month(Number(z)).startOf("month").add(1,"month"))},{immediate:!0}),l.watch(()=>[r.displayYearEnd,r.displayMonthEnd],([L,z])=>{if(L&&z){const q=o.value[0],U=K().year(Number(L)).month(Number(z)).startOf("month");U.isAfter(q,"month")&&(o.value[1]=U)}},{immediate:!0});const s=e,a=l.computed(()=>r.doubleMonths||r.range?[0,1]:[0]);function c(L){if(r.week)s("update:modelValue",[K(L).startOf("week"),K(L).endOf("week")]);else if(r.range){const z=r.modelValue.filter(q=>q).length;if(z==0)s("update:modelValue",[L]);else if(z==2)s("update:modelValue",[L]);else if(z==1){let q=[K(r.modelValue[0]),K(L)];q=q.sort((U,j)=>U-j),s("update:modelValue",q)}}else s("update:modelValue",K(L))}function d(L){const z=K(L).daysInMonth(),q=[],U=K(L).startOf("month");for(let j=1;j<=z;j++){let ce=U.clone().date(j);q.push(ce)}return q}function u(L){return K(L).startOf("month").day()}function f(L,z){const q=K(`${L}-${z}-01`,"YYYY-MM-DD"),j=q.day(),ce=[];for(let le=0;le<j;le++)ce.push(q.clone().subtract(j-le,"days"));return ce}function h(L,z){const q=K(`${L}-${z}`,"YYYY-MM").endOf("month"),j=6-q.day(),ce=[];for(let le=1;le<=j;le++)ce.push(q.clone().add(le,"days"));return ce}function p(L){const z=K();return K(L).isSame(z,"day")}function m(L){var z,q;if(r.range){if(((z=r.modelValue)==null?void 0:z.length)==1)return K(L).isSame(K(r.modelValue[0]),"day");if(((q=r.modelValue)==null?void 0:q.length)==2)return K(L).isSame(K(r.modelValue[0]),"day")||K(L).isSame(K(r.modelValue[1]),"day")}else if(r.modelValue)return K(L).isSame(K(r.modelValue),"day")}function g(L){var z;if(r.range&&((z=r.modelValue)==null?void 0:z.length)==2)return K(L).isBetween(K(r.modelValue[0]),K(r.modelValue[1]))}function y(L){var z;if(r.range&&((z=r.modelValue)==null?void 0:z.length)==2)return K(L).isSame(K(r.modelValue[0]),"day")}function k(L){var z;if(r.range&&((z=r.modelValue)==null?void 0:z.length)==2)return K(L).isSame(K(r.modelValue[1]),"day")}function x(L){try{return r.minDate?K(L).isBefore(K(r.minDate)):!1}catch(z){return console.log(z),!1}}function w(L){try{return r.maxDate?K(L).isAfter(K(r.maxDate)):!1}catch(z){return console.log(z),!1}}function b(L){B(L,o.value[L].subtract(1,"month"))}function C(L){B(L,o.value[L].add(1,"month"))}function v(L){B(L,o.value[L].subtract(1,"year"))}function S(L){B(L,o.value[L].add(1,"year"))}const D=L=>a.value.length===1||L===0?!0:o.value[L].subtract(1,"month").isAfter(o.value[0],"month"),O=L=>a.value.length===1||L===1?!0:o.value[L].add(1,"month").isBefore(o.value[1],"month"),$=L=>a.value.length===1||L===0?!0:o.value[L].subtract(1,"year").isAfter(o.value[0],"year"),V=L=>a.value.length===1||L===1?!0:o.value[L].add(1,"year").isBefore(o.value[1],"year");function B(L,z){if(L===0){if(!a.value.length===1&&!z.isBefore(o.value[1],"month"))return;o.value=[z,o.value[1]]}else{if(!a.value.length===1&&!z.isAfter(o.value[0],"month"))return;(z.isBefore(o.value[0],"month")||z.isSame(o.value[0],"month"))&&(z=o.value[0].add(1,"month")),o.value=[o.value[0],z]}}const J=l.ref();function Y(L){r.week&&(J.value=K(L).week())}function I(L){return K(L).week()===J.value}function T(L){return K(L).week()===J.value?K(L).format("YYYY-MM-DD")===K().week(J.value).startOf("week").format("YYYY-MM-DD"):!1}function R(L){return K(L).week()===J.value?K(L).format("YYYY-MM-DD")===K().week(J.value).endOf("week").format("YYYY-MM-DD"):!1}function F(){J.value=null}function ee(L,z){const q=o.value[L].year(Number(z));B(L,q)}function ie(L,z){const q=o.value[L].month(Number(z));B(L,q)}const he=l.computed(()=>{const L=r.defaultMinYear,z=r.defaultMaxYear,q=[];for(let U=L;U<=z;U++)q.push(U);return q}),ue=l.computed(()=>Array.from({length:12},(L,z)=>K().month(z).locale(n.value).format("MMMM")));return(L,z)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":a.value.length===1,"min-w-192":a.value.length===2}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,q=>{var U;return l.openBlock(),l.createElementBlock("div",CB,[l.createElementVNode("div",SB,[l.createElementVNode("div",_B,[l.createVNode(Hf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!$(q),"hover:opacity-100":$(q)}]),onClick:j=>$(q)?v(q):null},null,8,["class","onClick"]),l.createVNode(Wf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!D(q),"hover:opacity-100":D(q)}]),onClick:j=>D(q)?b(q):null},null,8,["class","onClick"])]),l.createElementVNode("div",OB,[l.createElementVNode("select",{value:o.value[q].format("YYYY"),onChange:j=>ee(q,j.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(he.value,j=>(l.openBlock(),l.createElementBlock("option",{key:j,value:j},l.toDisplayString(j),9,NB))),128))],40,TB),l.createElementVNode("select",{value:o.value[q].month(),onChange:j=>ie(q,j.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(ue.value,(j,ce)=>(l.openBlock(),l.createElementBlock("option",{key:ce,value:ce},l.toDisplayString(j),9,AB))),128))],40,MB)]),l.createElementVNode("div",DB,[l.createVNode(Yf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!O(q),"hover:opacity-100":O(q)}]),onClick:j=>O(q)?C(q):null},null,8,["class","onClick"]),l.createVNode(Uf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!V(q),"hover:opacity-100":V(q)}]),onClick:j=>V(q)?S(q):null},null,8,["class","onClick"])])]),l.createElementVNode("div",$B,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(j,ce)=>(l.openBlock(),l.createElementBlock("div",{key:ce,class:"flex justify-center text-sm"},l.toDisplayString(j),1))),128))]),l.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:F},[u(o.value[q])>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(f(l.unref(K)(o.value[q]).year(),l.unref(K)(o.value[q]).month()+1),j=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!w(j)&&!x(j)?c(j):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(K)(j).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d(o.value[q].clone()),j=>(l.openBlock(),l.createBlock(Sc,{onMouseover:ce=>Y(j),onClick:ce=>!w(j)&&!x(j)?c(j):null,today:p(j),selected:m(j),firstDay:y(j)||T(j),lastDay:k(j)||R(j),between:g(j),disabled:w(j)||x(j),off:w(j)||x(j),highlight:I(j)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(K)(j).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((U=h(l.unref(K)(o.value[q]).year(),l.unref(K)(o.value[q]).month()+1))==null?void 0:U.length)>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(h(l.unref(K)(o.value[q]).year(),l.unref(K)(o.value[q]).month()+1),j=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!w(j)&&!x(j)?c(j):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(K)(j).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0)],32)])}),256))],2))}}),LB={},BB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},IB=[l.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 VB(t,e){return l.openBlock(),l.createElementBlock("svg",BB,IB)}const Rg=be(LB,[["render",VB]]),PB={},RB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},FB=[l.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 jB(t,e){return l.openBlock(),l.createElementBlock("svg",RB,FB)}const Fg=be(PB,[["render",jB]]),zB={class:"flex gap-3"},HB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},WB=["onClick"],UB=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{t:n}=jn(),r=t,i=l.computed(()=>r.placeholder==="Select date"?n("wpiccomponents.select_date"):r.placeholder),o=e;function s(d){o("update:modelValue",d)}const a=l.computed(()=>{var d;if(r.range)return(d=r.modelValue)==null?void 0:d.map(u=>K(u).format("YYYY-MM-DD")).join(" to ");if(r.modelValue)return K(r.modelValue).format("YYYY-MM-DD")}),c=l.reactive([{text:l.computed(()=>n("wpiccomponents.month_to_date")),onClick(d){const u=K().subtract(1,"day"),f=K().startOf("month");o("update:modelValue",[f,u])}},{text:l.computed(()=>n("wpiccomponents.last_month")),onClick(d){const u=K().startOf("month").subtract(1,"month"),f=K(u).endOf("month");o("update:modelValue",[u,f])}},{text:l.computed(()=>n("wpiccomponents.year_to_date")),onClick(d){const u=K().subtract(1,"day"),f=K().startOf("year");o("update:modelValue",[f,u])}}]);return(d,u)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px"},{content:l.withCtx(()=>[l.createElementVNode("div",zB,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",HB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c,f=>(l.openBlock(),l.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:h=>f.onClick()},l.toDisplayString(f.text),9,WB))),256))])):l.createCommentVNode("",!0),l.createVNode(Oc,{doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":s,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:l.withCtx(()=>{var f;return[l.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&&((f=a.value)!=null&&f.length)),onOnClear:u[0]||(u[0]=h=>s(null))},{prepend:l.withCtx(()=>[t.range?(l.openBlock(),l.createBlock(Rg,{key:0,class:"dark:text-gray-400"})):(l.openBlock(),l.createBlock(Fg,{key:1,class:"dark:text-gray-400"}))]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(a.value||i.value),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),YB={class:"relative inline-block tabular-nums"},qB=["value","placeholder","maxlength"],Tc={__name:"DateSegment",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,i=l.ref(null),o=l.computed(()=>n.segment==="year"?4:2);function s(c){const d=c.target.value.replace(/\D/g,"");r("update:modelValue",d.slice(0,o.value)),d.length>=o.value&&n.nextRef&&l.nextTick(()=>{n.nextRef.focus()})}function a(){r("blur")}return(c,d)=>(l.openBlock(),l.createElementBlock("div",YB,[l.createElementVNode("input",{ref_key:"inputRef",ref:i,type:"text",value:t.modelValue,onInput:s,onKeydown:d[0]||(d[0]=(...u)=>c.onKeydown&&c.onKeydown(...u)),onBlur:a,placeholder:t.placeholder,class:l.normalizeClass(["date-segment bg-transparent text-gray-900 dark:text-gray-400 focus:outline-none border-b border-transparent focus:border-gray-800 dark:focus:border-gray-300 transition-all duration-200 ease-in-out hover:bg-gray-50 dark:hover:bg-gray-800 focus:bg-white dark:focus:bg-gray-900 placeholder:opacity-25 placeholder:tracking-wider placeholder:pl-1",{"w-[4ch]":o.value===4,"w-[2ch]":o.value===2}]),inputmode:"numeric",pattern:"\\d*",maxlength:o.value},null,42,qB)]))}},KB={class:"flex items-center gap-0"},GB=l.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),JB=l.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-600"},"/",-1),Nc={__name:"DateInput",props:{modelValue:String,disabled:Boolean},emits:["update:modelValue","update:initDates","update:displayYear","update:displayMonth"],setup(t,{emit:e}){const n=t,r=e,i=l.ref(""),o=l.ref(""),s=l.ref(""),a=l.ref(null),c=l.ref(null),d=l.ref(null);l.watch(()=>n.modelValue,k=>{n.range?Array.isArray(k)&&k.length===2?(yearStart.value=k[0]?K(k[0]).format("YYYY"):"",monthStart.value=k[0]?K(k[0]).format("MM"):"",dayStart.value=k[0]?K(k[0]).format("DD"):"",yearEnd.value=k[1]?K(k[1]).format("YYYY"):"",monthEnd.value=k[1]?K(k[1]).format("MM"):"",dayEnd.value=k[1]?K(k[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):k?(i.value=K(k).format("YYYY"),o.value=K(k).format("MM"),s.value=K(k).format("DD")):i.value=o.value=s.value=""},{immediate:!0});function u(){i.value.length===4&&o.value.length===2&&s.value.length===2&&r("update:modelValue",`${i.value}-${o.value}-${s.value}`)}function f(k){k.length===4&&r("update:displayYear",Number(k)),u()}function h(k){k.length===2&&r("update:displayMonth",Number(k)-1),u()}function p(k){s.value=k,u()}function m(){i.value||(i.value=K().format("YYYY")),u()}function g(){o.value||(o.value=K().format("MM")),u()}function y(){s.value||(s.value=K().format("DD")),u()}return(k,x)=>(l.openBlock(),l.createElementBlock("div",KB,[l.createVNode(Tc,{modelValue:i.value,"onUpdate:modelValue":[x[0]||(x[0]=w=>i.value=w),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:a},null,8,["modelValue","disabled"]),GB,l.createVNode(Tc,{modelValue:o.value,"onUpdate:modelValue":[x[1]||(x[1]=w=>o.value=w),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),JB,l.createVNode(Tc,{modelValue:s.value,"onUpdate:modelValue":[x[2]||(x[2]=w=>s.value=w),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},ZB={class:"tabular-nums"},XB={key:1,class:"flex items-center"},QB=l.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),eI={class:"flex gap-3"},tI={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},nI=["onClick"],rI=Object.assign({name:"WpicAdvDateField"},{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{t:n}=jn(),r=t,i=e,o=l.computed(()=>r.placeholder==="Select date"?n("wpiccomponents.select_date"):r.placeholder);l.ref(!1);const s=l.ref(K().year()),a=l.ref(K().month()),c=l.ref(null),d=l.ref(null);function u(){i("update:modelValue",null)}l.watch(()=>r.initDates,m=>{var g;r.range&&((g=r.initDates)==null?void 0:g.length)==2?(s.value=K(r.initDates[0]).year(),a.value=K(r.initDates[0]).month(),c.value=K(r.initDates[1]).year(),d.value=K(r.initDates[1]).month()):r.initDates&&(s.value=K(r.initDates).year(),a.value=K(r.initDates).month())},{immediate:!0});const f=l.ref(r.range?[]:"");l.watch(()=>r.modelValue,m=>{if(r.range){const g=m!=null&&m[0]?K(m[0]).format("YYYY-MM-DD"):"",y=m!=null&&m[1]?K(m[1]).format("YYYY-MM-DD"):"";(f.value[0]!==g||f.value[1]!==y)&&(f.value=[g,y])}else{const g=m?K(m).format("YYYY-MM-DD"):"";f.value!==g&&(f.value=g)}},{immediate:!0}),l.watch(()=>f.value,m=>{var g,y;if(r.range){const k=m[0]&&m[0].length===10?K(m[0]).toDate():null,x=m[1]&&m[1].length===10?K(m[1]).toDate():null;(!((g=r.modelValue)!=null&&g[0])||r.modelValue[0]!==k||!((y=r.modelValue)!=null&&y[1])||r.modelValue[1]!==x)&&i("update:modelValue",[k,x])}else if(m&&m.length===10){const k=K(m,"YYYY-MM-DD",!0);k.isValid()&&r.modelValue!==k.toDate()&&i("update:modelValue",k.toDate())}},{deep:!0});function h(m){i("update:modelValue",m)}const p=l.reactive([{text:l.computed(()=>n("wpiccomponents.month_to_date")),onClick(m){const g=K().subtract(1,"day"),y=K().startOf("month");i("update:modelValue",[y,g])}},{text:l.computed(()=>n("wpiccomponents.last_month")),onClick(m){const g=K().startOf("month").subtract(1,"month"),y=K(g).endOf("month");i("update:modelValue",[g,y])}},{text:l.computed(()=>n("wpiccomponents.year_to_date")),onClick(m){const g=K().subtract(1,"day"),y=K().startOf("year");i("update:modelValue",[y,g])}}]);return(m,g)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:l.withCtx(()=>[l.createElementVNode("div",eI,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",tI,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p,y=>(l.openBlock(),l.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:k=>y.onClick()},l.toDisplayString(y.text),9,nI))),256))])):l.createCommentVNode("",!0),l.createVNode(Oc,{doubleMonths:t.doubleMonths,displayYearStart:s.value,displayMonthStart:a.value,displayYearEnd:c.value,displayMonthEnd:d.value,shortcuts:t.shortcuts,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:r.range?[...f.value]:f.value,"onUpdate:modelValue":h,range:t.range},null,8,["doubleMonths","displayYearStart","displayMonthStart","displayYearEnd","displayMonthEnd","shortcuts","week","min-date","max-date","modelValue","range"])])]),default:l.withCtx(()=>[l.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:u},{prepend:l.withCtx(()=>[t.range?(l.openBlock(),l.createBlock(Rg,{key:0,class:"dark:text-gray-400"})):(l.openBlock(),l.createBlock(Fg,{key:1,class:"dark:text-gray-400"}))]),default:l.withCtx(()=>[l.createElementVNode("div",ZB,[t.range?t.range?(l.openBlock(),l.createElementBlock("div",XB,[l.createVNode(Nc,{modelValue:f.value[0],"onUpdate:modelValue":g[3]||(g[3]=y=>f.value[0]=y),disabled:t.disabled,"onUpdate:displayYear":g[4]||(g[4]=y=>s.value=y),"onUpdate:displayMonth":g[5]||(g[5]=y=>a.value=y)},null,8,["modelValue","disabled"]),QB,l.createVNode(Nc,{modelValue:f.value[1],"onUpdate:modelValue":g[6]||(g[6]=y=>f.value[1]=y),disabled:t.disabled,"onUpdate:displayYear":g[7]||(g[7]=y=>{c.value=y}),"onUpdate:displayMonth":g[8]||(g[8]=y=>{d.value=y})},null,8,["modelValue","disabled"])])):(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[l.createTextVNode(l.toDisplayString(o.value),1)],64)):(l.openBlock(),l.createBlock(Nc,{key:0,modelValue:f.value,"onUpdate:modelValue":g[0]||(g[0]=y=>f.value=y),disabled:t.disabled,"onUpdate:displayYear":g[1]||(g[1]=y=>s.value=y),"onUpdate:displayMonth":g[2]||(g[2]=y=>a.value=y)},null,8,["modelValue","disabled"]))])]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}}),iI=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:a});const s=l.ref(null);function a(){s.value.scrollTop=0}function c(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fixed inset-0 h-full flex justify-end bg-black/10 dark:bg-black/50 backdrop-blur-md 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:l.withModifiers(o,["self"])},[l.createElementVNode("div",{class:l.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[l.unref(fe).theme]]:!0}])},[l.createElementVNode("div",{ref_key:"panel",ref:s,class:l.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[l.renderSlot(d.$slots,"default")],2)],2)],2))}}),oI={class:"absolute inset-0 flex items-center justify-center py-12"},sI={class:"text-lg font-medium dark:text-gray-300"},aI={key:0,class:"flex justify-end px-6 pb-4"},lI=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,extraLarge:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean,blur:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,i=n;function o(){i("close")}const s=l.ref(null),a=l.ref(!1);function c(){s.value.scrollTop=0}function d(){s.value.scrollTop=s.value.scrollHeight}function u(){s.value&&r.visible&&(a.value=s.value.scrollTop+s.value.clientHeight>=s.value.scrollHeight-20)}return l.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),l.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:c,isScrolledToBottom:a}),(f,h)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[l.createElementVNode("div",oI,[l.createElementVNode("div",{class:l.normalizeClass(["absolute transition-opacity inset-0 bg-black/10 dark:bg-black/50 z-10",{"backdrop-blur-md":t.blur}]),onClick:o},null,2),l.createElementVNode("div",{class:l.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-3/5":t.large,"w-4/5":t.extraLarge,"w-192":!t.large&&!t.extraLarge,"h-full":t.high,"overflow-hidden":!t.overflow}])},[l.createElementVNode("div",{class:l.normalizeClass(["px-6 pt-4 pb-4 flex items-center justify-between",{"border-b pb-3 dark:border-gray-900":t.border}])},[l.createElementVNode("span",sI,l.toDisplayString(t.title),1),l.createElementVNode("span",{class:"cursor-pointer",onClick:o},[l.createVNode(Di,{class:"w-6 h-6"})])],2),l.createElementVNode("div",{ref_key:"panel",ref:s,class:l.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[l.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(l.openBlock(),l.createElementBlock("div",aI,[l.renderSlot(f.$slots,"buttons")])):l.createCommentVNode("",!0)],2)])],2))}}),cI=["onClick"],dI=Object.assign({name:"WpicTabs"},{props:{modelValue:{type:String,required:!0},pills:Boolean,contrastPills:Boolean,nowrap:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=l.ref([]),o=c=>{r("update:modelValue",c)},s=c=>{i.value.push(c)},a=l.computed(()=>n.modelValue);return l.provide("addTab",s),l.provide("modelValue",a),(c,d)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",{class:l.normalizeClass(["wpic-tabs flex dark:border-gray-930 overflow-x-auto overflow-y-hidden",{"border-b-[1px]":!t.pills}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,u=>(l.openBlock(),l.createElementBlock("div",{key:u.name,class:l.normalizeClass(["items-center flex leading-snug cursor-pointer px-6 -mb-[px]",{"py-2":t.pills,"border-b-[2px] py-3":!t.pills,"border-transparent":!t.pills&&u.name!=t.modelValue,"dark:border-gray-930 hover:text-gray-800 dark:hover:text-gray-400 hover:border-gray-200":u.name!=t.modelValue,"text-wpic-500 border-b-wpic-500 dark:text-wpic-600 dark:border-b-wpic-600":!t.pills&&u.name===t.modelValue,"rounded-lg":t.pills,"bg-black/5 dark:bg-white/10 text-gray-800 dark:!text-gray-300":t.pills&&u.name===t.modelValue,"bg-gray-900 dark:bg-gray-300! text-white! dark:text-gray-800!":t.pills&&t.contrastPills&&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)},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(u.labelSlot||"span"),{class:l.normalizeClass({"whitespace-nowrap text-ellipsis overflow-hidden":t.nowrap})},{default:l.withCtx(()=>[u.labelSlot?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(u.label),1)],64))]),_:2},1032,["class"]))],10,cI))),128))],2),l.createElementVNode("div",null,[l.renderSlot(c.$slots,"default")])],64))}}),uI=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=l.ref(!1),r=l.inject("addTab"),i=l.inject("modelValue"),o=l.useSlots();return l.onMounted(()=>{r({label:e.label,name:e.name,disabled:e.disabled,labelSlot:o.label})}),l.watch(()=>i.value,s=>{n.value=s===e.name},{immediate:!0,deep:!0}),(s,a)=>n.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["wpic-tab-pane",{"py-3 px-6":!t.noStyle}])},[l.renderSlot(s.$slots,"default")],2)):l.createCommentVNode("",!0)}}),fI={},hI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},pI=[l.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 mI(t,e){return l.openBlock(),l.createElementBlock("svg",hI,pI)}const gI=be(fI,[["render",mI]]),yI={},bI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},kI=[l.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 vI(t,e){return l.openBlock(),l.createElementBlock("svg",bI,kI)}const wI=be(yI,[["render",vI]]),xI={},EI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},CI=[l.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 SI(t,e){return l.openBlock(),l.createElementBlock("svg",EI,CI)}const _I=be(xI,[["render",SI]]),OI={},TI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},NI=[l.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 MI(t,e){return l.openBlock(),l.createElementBlock("svg",TI,NI)}const AI=be(OI,[["render",MI]]),DI={key:0,class:"w-6 opacity-50"},$I={class:"flex-1"},LI={key:0,class:"mb-2"},BI=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["py-3 rounded-md text-base flex gap-3 pr-6 mb-3",{"bg-iron-500/10 text-iron-900 dark:bg-iron-500/20 dark:text-iron-200/90":!t.warning&&!t.info&&!t.error&&!t.success,"bg-yellow-500/10 text-yellow-900 dark:bg-yellow-500/20 dark:text-yellow-200/90":t.warning,"bg-purple-500/10 text-purple-900 dark:bg-purple-500/20 dark:text-purple-200/90":t.info,"bg-red-500/10 text-red-900 dark:bg-red-500/20 dark:text-red-200/90":t.error,"bg-emerald-500/10 text-emerald-900 dark:bg-emerald-500/20 dark:text-emerald-200/90":t.success,"pl-4":t.warning||t.info||t.success||t.error,"pl-6":!t.warning&&!t.info&&!t.success&&!t.error}])},[t.warning||t.info||t.success||t.error?(l.openBlock(),l.createElementBlock("div",DI,[t.warning?(l.openBlock(),l.createBlock(gI,{key:0,class:"w-full aspect-square"})):t.info?(l.openBlock(),l.createBlock(wI,{key:1,class:"w-full aspect-square"})):t.success?(l.openBlock(),l.createBlock(_I,{key:2,class:"w-full aspect-square"})):t.error?(l.openBlock(),l.createBlock(AI,{key:3,class:"w-full aspect-square"})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",$I,[t.title?(l.openBlock(),l.createElementBlock("div",LI,l.toDisplayString(t.title),1)):l.createCommentVNode("",!0),l.createElementVNode("span",{class:l.normalizeClass(["",{"":!t.warning&&!t.info&&!t.error&&!t.success,"":t.warning,"":t.info,"":t.error,"":t.success}])},[l.renderSlot(e.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.text),1)])],2)])],2))}}),Mc=l.ref(!1),jg=l.ref(""),zg=l.ref(""),Hg=l.ref(!1),Wg=l.ref(!1),Ug=l.ref(!1);let Yg=()=>{},qg=()=>{};function Ac(){const t=({title:i,text:o,positive:s=!1,negative:a=!1,onConfirm:c,onCancel:d,blur:u=!1})=>{jg.value=i,zg.value=o,Hg.value=s,Wg.value=a,Ug.value=u,Yg=c||(()=>{}),qg=d||(()=>{}),Mc.value=!0},e=()=>{Mc.value=!1};return{visible:Mc,title:jg,text:zg,positive:Hg,negative:Wg,show:t,onConfirm:()=>{Yg(),e()},onCancel:()=>{qg(),e()},blur:Ug}}const II={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},VI={class:"text-lg font-semibold mb-6"},PI={class:"mb-12"},RI={class:"flex justify-end"},Dc={WpicColorPicker:Ff,WpicAlert:BI,WpicToggleSwitch:Pf,WpicAdvDateField:rI,WpicCalendar:Oc,WpicTextarea:Rf,WpicDialog:lI,WpicSlidePanel:iI,WpicDateField:UB,WpicFormInput:Pi,WpicButton:_i,WpicBadge:mB,WpicTextEditor:XL,WpicInputGroup:Cy,WpicButtonGroup:vy,WpicForm:Sy,WpicFormField:jf,WpicSpinner:Ir,WpicTooltip:zf,WpicPopover:dr,WpicChoiceList:Vf,WpicCard:T_,WpicCardSection:A_,WpicProgressBar:L_,WpicTag:I_,WpicTagGroup:V_,WpicPagination:cO,WpicLoadingPanel:j_,WpicTable:zO,WpicTableColumn:HO,WpicTabs:dI,WpicTabPane:uI,WpicConfirm:be(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:a,blur:c}=Ac();return(d,u)=>l.unref(e)?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["z-40 fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black/10 dark:bg-black/50 transition-opacity",{"backdrop-blur-md":l.unref(c)}])},[l.createElementVNode("div",II,[l.createElementVNode("div",VI,l.toDisplayString(l.unref(n)),1),l.createElementVNode("div",PI,l.toDisplayString(l.unref(r)),1),l.createElementVNode("div",RI,[l.createVNode(_i,{onClick:l.unref(a)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.$t("wpiccomponents.cancel")),1)]),_:1},8,["onClick"]),l.createVNode(_i,{primary:l.unref(i),destructive:l.unref(o),onClick:l.unref(s)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.$t("wpiccomponents.confirm")),1)]),_:1},8,["primary","destructive","onClick"])])])],2)):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-e79ca400"]])};function Kg(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?Kg(t[n],e[n]):t[n]=e[n])}const FI={useConfirm:Ac};function jI(t,e){Kg(fe,e);for(const n in Dc)if(Dc.hasOwnProperty(n)){const r=Dc[n];t.component(r.name,r)}}const zI={install:jI,composables:FI,options:fe};Dn.default=zI,Dn.useConfirm=Ac,Object.defineProperties(Dn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
155
|
+
`},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-gray-200"},r={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800"},i={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-l-0"},o={pmi:"","wpic-tools":"bg-gray-100 dark:bg-gray-800 rounded-r-0"},s={pmi:"","wpic-tools":"bg-gray-200"};return(a,c)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected&&!t.off,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[l.createElementVNode("div",{class:l.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[l.unref(fe).theme]}`]:t.between,[`${i[l.unref(fe).theme]}`]:t.firstDay,[`${o[l.unref(fe).theme]}`]:t.lastDay,[`${s[l.unref(fe).theme]}`]:t.highlight}]),style:l.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[l.createElementVNode("span",{class:l.normalizeClass(["absolute w-8 h-8 flex items-center justify-center dark:text-gray-400",{[`${e[l.unref(fe).theme]}`]:!0,[`${n[l.unref(fe).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[l.renderSlot(a.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.day),1)])],2)],6)],2))}};var Bg={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(sn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",c="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+)?$/,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,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(z){var I=["th","st","nd","rd"],_=z%100;return"["+z+(I[(_-20)%10]||I[_]||I[0])+"]"}},v=function(z,I,_){var P=String(z);return!P||P.length>=I?z:""+Array(I+1-P.length).join(_)+z},b={s:v,z:function(z){var I=-z.utcOffset(),_=Math.abs(I),P=Math.floor(_/60),V=_%60;return(I<=0?"+":"-")+v(P,2,"0")+":"+v(V,2,"0")},m:function z(I,_){if(I.date()<_.date())return-z(_,I);var P=12*(_.year()-I.year())+(_.month()-I.month()),V=I.clone().add(P,f),ee=_-V<0,ie=I.clone().add(P+(ee?-1:1),f);return+(-(P+(_-V)/(ee?V-ie:ie-V))||0)},a:function(z){return z<0?Math.ceil(z)||0:Math.floor(z)},p:function(z){return{M:f,y:p,w:u,d,D:m,h:c,m:a,s,ms:o,Q:h}[z]||String(z||"").toLowerCase().replace(/s$/,"")},u:function(z){return z===void 0}},C="en",w={};w[C]=x;var N="$isDayjsObject",L=function(z){return z instanceof $||!(!z||!z[N])},S=function z(I,_,P){var V;if(!I)return C;if(typeof I=="string"){var ee=I.toLowerCase();w[ee]&&(V=ee),_&&(w[ee]=_,V=ee);var ie=I.split("-");if(!V&&ie.length>1)return z(ie[0])}else{var he=I.name;w[he]=I,V=he}return!P&&V&&(C=V),V||!P&&C},D=function(z,I){if(L(z))return z.clone();var _=typeof I=="object"?I:{};return _.date=z,_.args=arguments,new $(_)},F=b;F.l=S,F.i=L,F.w=function(z,I){return D(z,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var $=function(){function z(_){this.$L=S(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[N]=!0}var I=z.prototype;return I.parse=function(_){this.$d=function(P){var V=P.date,ee=P.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 ie=V.match(y);if(ie){var he=ie[2]-1||0,ue=(ie[7]||"0").substring(0,3);return ee?new Date(Date.UTC(ie[1],he,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,ue)):new Date(ie[1],he,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,ue)}}return new Date(V)}(_),this.init()},I.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()},I.$utils=function(){return F},I.isValid=function(){return this.$d.toString()!==g},I.isSame=function(_,P){var V=D(_);return this.startOf(P)<=V&&V<=this.endOf(P)},I.isAfter=function(_,P){return D(_)<this.startOf(P)},I.isBefore=function(_,P){return this.endOf(P)<D(_)},I.$g=function(_,P,V){return F.u(_)?this[P]:this.set(V,_)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(_,P){var V=this,ee=!!F.u(P)||P,ie=F.p(_),he=function(le,ve){var Ne=F.w(V.$u?Date.UTC(V.$y,ve,le):new Date(V.$y,ve,le),V);return ee?Ne:Ne.endOf(d)},ue=function(le,ve){return F.w(V.toDate()[le].apply(V.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(ve)),V)},B=this.$W,H=this.$M,K=this.$D,q="set"+(this.$u?"UTC":"");switch(ie){case p:return ee?he(1,0):he(31,11);case f:return ee?he(1,H):he(0,H+1);case u:var j=this.$locale().weekStart||0,ce=(B<j?B+7:B)-j;return he(ee?K-ce:K+(6-ce),H);case d:case m:return ue(q+"Hours",0);case c:return ue(q+"Minutes",1);case a:return ue(q+"Seconds",2);case s:return ue(q+"Milliseconds",3);default:return this.clone()}},I.endOf=function(_){return this.startOf(_,!1)},I.$set=function(_,P){var V,ee=F.p(_),ie="set"+(this.$u?"UTC":""),he=(V={},V[d]=ie+"Date",V[m]=ie+"Date",V[f]=ie+"Month",V[p]=ie+"FullYear",V[c]=ie+"Hours",V[a]=ie+"Minutes",V[s]=ie+"Seconds",V[o]=ie+"Milliseconds",V)[ee],ue=ee===d?this.$D+(P-this.$W):P;if(ee===f||ee===p){var B=this.clone().set(m,1);B.$d[he](ue),B.init(),this.$d=B.set(m,Math.min(this.$D,B.daysInMonth())).$d}else he&&this.$d[he](ue);return this.init(),this},I.set=function(_,P){return this.clone().$set(_,P)},I.get=function(_){return this[F.p(_)]()},I.add=function(_,P){var V,ee=this;_=Number(_);var ie=F.p(P),he=function(H){var K=D(ee);return F.w(K.date(K.date()+Math.round(H*_)),ee)};if(ie===f)return this.set(f,this.$M+_);if(ie===p)return this.set(p,this.$y+_);if(ie===d)return he(1);if(ie===u)return he(7);var ue=(V={},V[a]=r,V[c]=i,V[s]=n,V)[ie]||1,B=this.$d.getTime()+_*ue;return F.w(B,this)},I.subtract=function(_,P){return this.add(-1*_,P)},I.format=function(_){var P=this,V=this.$locale();if(!this.isValid())return V.invalidDate||g;var ee=_||"YYYY-MM-DDTHH:mm:ssZ",ie=F.z(this),he=this.$H,ue=this.$m,B=this.$M,H=V.weekdays,K=V.months,q=V.meridiem,j=function(ve,Ne,Ie,tt){return ve&&(ve[Ne]||ve(P,ee))||Ie[Ne].slice(0,tt)},ce=function(ve){return F.s(he%12||12,ve,"0")},le=q||function(ve,Ne,Ie){var tt=ve<12?"AM":"PM";return Ie?tt.toLowerCase():tt};return ee.replace(k,function(ve,Ne){return Ne||function(Ie){switch(Ie){case"YY":return String(P.$y).slice(-2);case"YYYY":return F.s(P.$y,4,"0");case"M":return B+1;case"MM":return F.s(B+1,2,"0");case"MMM":return j(V.monthsShort,B,K,3);case"MMMM":return j(K,B);case"D":return P.$D;case"DD":return F.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return j(V.weekdaysMin,P.$W,H,2);case"ddd":return j(V.weekdaysShort,P.$W,H,3);case"dddd":return H[P.$W];case"H":return String(he);case"HH":return F.s(he,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return le(he,ue,!0);case"A":return le(he,ue,!1);case"m":return String(ue);case"mm":return F.s(ue,2,"0");case"s":return String(P.$s);case"ss":return F.s(P.$s,2,"0");case"SSS":return F.s(P.$ms,3,"0");case"Z":return ie}return null}(ve)||ie.replace(":","")})},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(_,P,V){var ee,ie=this,he=F.p(P),ue=D(_),B=(ue.utcOffset()-this.utcOffset())*r,H=this-ue,K=function(){return F.m(ie,ue)};switch(he){case p:ee=K()/12;break;case f:ee=K();break;case h:ee=K()/3;break;case u:ee=(H-B)/6048e5;break;case d:ee=(H-B)/864e5;break;case c:ee=H/i;break;case a:ee=H/r;break;case s:ee=H/n;break;default:ee=H}return V?ee:F.a(ee)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return w[this.$L]},I.locale=function(_,P){if(!_)return this.$L;var V=this.clone(),ee=S(_,P,!0);return ee&&(V.$L=ee),V},I.clone=function(){return F.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},z}(),U=$.prototype;return D.prototype=U,[["$ms",o],["$s",s],["$m",a],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(z){U[z[1]]=function(I){return this.$g(I,z[0],z[1])}}),D.extend=function(z,I){return z.$i||(z(I,$,D),z.$i=!0),D},D.locale=S,D.isDayjs=L,D.unix=function(z){return D(1e3*z)},D.en=w[C],D.Ls=w,D.p={},D})})(Bg);var qs=Bg.exports;const G=Ri(qs);var mB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs)})(sn,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,a){return a==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,a){var c=100*s+a;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return i.default.locale(o,null,!0),o})})(mB);var gB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs)})(sn,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s){return s+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(s){return s<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return i.default.locale(o,null,!0),o})})(gB);var yB={exports:{}};(function(t,e){(function(n,r){t.exports=r(qs)})(sn,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(n),o={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(s){return s+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(s){return s<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return i.default.locale(o,null,!0),o})})(yB);var Ig={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(sn,function(){var n="week",r="year";return function(i,o,s){var a=o.prototype;a.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)},a.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}})})(Ig);var bB=Ig.exports;const kB=Ri(bB);var Vg={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(sn,function(){return function(n,r,i){r.prototype.isBetween=function(o,s,a,c){var d=i(o),u=i(s),f=(c=c||"()")[0]==="(",h=c[1]===")";return(f?this.isAfter(d,a):!this.isBefore(d,a))&&(h?this.isBefore(u,a):!this.isAfter(u,a))||(f?this.isBefore(d,a):!this.isAfter(d,a))&&(h?this.isAfter(u,a):!this.isBefore(u,a))}}})})(Vg);var vB=Vg.exports;const wB=Ri(vB),xB={class:"w-full dark:text-gray-400"},EB={class:"flex justify-between items-center mb-3"},CB={class:"flex"},SB={class:"font-medium flex items-center gap-2"},_B=["value","onChange"],OB=["value"],TB=["value","onChange"],NB=["value"],MB={class:"flex"},AB={class:"grid grid-cols-7 border-b dark:border-gray-800 mb-2 pb-2"},_c=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,displayYearStart:Number,displayMonthStart:Number,displayYearEnd:Number,displayMonthEnd:Number,maxDate:{},minDate:{},week:Boolean,initDates:{},defaultMinYear:{type:Number,default:2019},defaultMaxYear:{type:Number,default:G().year()+10}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=jn();G.extend(wB),G.extend(kB);const r=t,i=l.computed(()=>Array.from({length:7},(H,K)=>G().day((1+K)%7).locale(n.value).format("ddd"))),o=l.ref([G(new Date).subtract(1,"month"),G(new Date)]);l.watch(()=>r.initDates,()=>{var B;if(!r.range&&r.initDates)o.value[0]=G(r.initDates);else if(!r.range&&!r.initDates)o.value[0]=G(new Date);else if(r.range&&((B=r.initDates)==null?void 0:B.length)===2){let H=G(r.initDates[0]),K=G(r.initDates[1]);K.isBefore(H,"month")&&(K=H.add(1,"month")),H.isSame(K,"month")&&(K=H.add(1,"month")),o.value=[H,K]}},{immediate:!0,once:!0}),l.watch(()=>[r.displayYearStart,r.displayMonthStart],([B,H])=>{B&&H&&(o.value[0]=G().year(Number(B)).month(Number(H)).startOf("month"),o.value[1]=G().year(Number(B)).month(Number(H)).startOf("month").add(1,"month"))},{immediate:!0}),l.watch(()=>[r.displayYearEnd,r.displayMonthEnd],([B,H])=>{if(B&&H){const K=o.value[0],q=G().year(Number(B)).month(Number(H)).startOf("month");q.isAfter(K,"month")&&(o.value[1]=q)}},{immediate:!0});const s=e,a=l.computed(()=>r.doubleMonths||r.range?[0,1]:[0]);function c(B){if(r.week)s("update:modelValue",[G(B).startOf("week"),G(B).endOf("week")]);else if(r.range){const H=r.modelValue.filter(K=>K).length;if(H==0)s("update:modelValue",[B]);else if(H==2)s("update:modelValue",[B]);else if(H==1){let K=[G(r.modelValue[0]),G(B)];K=K.sort((q,j)=>q-j),s("update:modelValue",K)}}else s("update:modelValue",G(B))}function d(B){const H=G(B).daysInMonth(),K=[],q=G(B).startOf("month");for(let j=1;j<=H;j++){let ce=q.clone().date(j);K.push(ce)}return K}function u(B){return G(B).startOf("month").day()}function f(B,H){const K=G(`${B}-${H}-01`,"YYYY-MM-DD"),j=K.day(),ce=[];for(let le=0;le<j;le++)ce.push(K.clone().subtract(j-le,"days"));return ce}function h(B,H){const K=G(`${B}-${H}`,"YYYY-MM").endOf("month"),j=6-K.day(),ce=[];for(let le=1;le<=j;le++)ce.push(K.clone().add(le,"days"));return ce}function p(B){const H=G();return G(B).isSame(H,"day")}function m(B){var H,K;if(r.range){if(((H=r.modelValue)==null?void 0:H.length)==1)return G(B).isSame(G(r.modelValue[0]),"day");if(((K=r.modelValue)==null?void 0:K.length)==2)return G(B).isSame(G(r.modelValue[0]),"day")||G(B).isSame(G(r.modelValue[1]),"day")}else if(r.modelValue)return G(B).isSame(G(r.modelValue),"day")}function g(B){var H;if(r.range&&((H=r.modelValue)==null?void 0:H.length)==2)return G(B).isBetween(G(r.modelValue[0]),G(r.modelValue[1]))}function y(B){var H;if(r.range&&((H=r.modelValue)==null?void 0:H.length)==2)return G(B).isSame(G(r.modelValue[0]),"day")}function k(B){var H;if(r.range&&((H=r.modelValue)==null?void 0:H.length)==2)return G(B).isSame(G(r.modelValue[1]),"day")}function x(B){try{return r.minDate?G(B).isBefore(G(r.minDate)):!1}catch(H){return console.log(H),!1}}function v(B){try{return r.maxDate?G(B).isAfter(G(r.maxDate)):!1}catch(H){return console.log(H),!1}}function b(B){$(B,o.value[B].subtract(1,"month"))}function C(B){$(B,o.value[B].add(1,"month"))}function w(B){$(B,o.value[B].subtract(1,"year"))}function N(B){$(B,o.value[B].add(1,"year"))}const L=B=>a.value.length===1||B===0?!0:o.value[B].subtract(1,"month").isAfter(o.value[0],"month"),S=B=>a.value.length===1||B===1?!0:o.value[B].add(1,"month").isBefore(o.value[1],"month"),D=B=>a.value.length===1||B===0?!0:o.value[B].subtract(1,"year").isAfter(o.value[0],"year"),F=B=>a.value.length===1||B===1?!0:o.value[B].add(1,"year").isBefore(o.value[1],"year");function $(B,H){if(B===0){if(!a.value.length===1&&!H.isBefore(o.value[1],"month"))return;o.value=[H,o.value[1]]}else{if(!a.value.length===1&&!H.isAfter(o.value[0],"month"))return;(H.isBefore(o.value[0],"month")||H.isSame(o.value[0],"month"))&&(H=o.value[0].add(1,"month")),o.value=[o.value[0],H]}}const U=l.ref();function z(B){r.week&&(U.value=G(B).week())}function I(B){return G(B).week()===U.value}function _(B){return G(B).week()===U.value?G(B).format("YYYY-MM-DD")===G().week(U.value).startOf("week").format("YYYY-MM-DD"):!1}function P(B){return G(B).week()===U.value?G(B).format("YYYY-MM-DD")===G().week(U.value).endOf("week").format("YYYY-MM-DD"):!1}function V(){U.value=null}function ee(B,H){const K=o.value[B].year(Number(H));$(B,K)}function ie(B,H){const K=o.value[B].month(Number(H));$(B,K)}const he=l.computed(()=>{const B=r.defaultMinYear,H=r.defaultMaxYear,K=[];for(let q=B;q<=H;q++)K.push(q);return K}),ue=l.computed(()=>Array.from({length:12},(B,H)=>G().month(H).locale(n.value).format("MMMM")));return(B,H)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["shrink-0 flex gap-6",{"min-w-96":a.value.length===1,"min-w-192":a.value.length===2}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.value,K=>{var q;return l.openBlock(),l.createElementBlock("div",xB,[l.createElementVNode("div",EB,[l.createElementVNode("div",CB,[l.createVNode(zf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!D(K),"hover:opacity-100":D(K)}]),onClick:j=>D(K)?w(K):null},null,8,["class","onClick"]),l.createVNode(Hf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!L(K),"hover:opacity-100":L(K)}]),onClick:j=>L(K)?b(K):null},null,8,["class","onClick"])]),l.createElementVNode("div",SB,[l.createElementVNode("select",{value:o.value[K].format("YYYY"),onChange:j=>ee(K,j.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(he.value,j=>(l.openBlock(),l.createElementBlock("option",{key:j,value:j},l.toDisplayString(j),9,OB))),128))],40,_B),l.createElementVNode("select",{value:o.value[K].month(),onChange:j=>ie(K,j.target.value),class:"bg-none appearance-none outline-hidden cursor-pointer"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(ue.value,(j,ce)=>(l.openBlock(),l.createElementBlock("option",{key:ce,value:ce},l.toDisplayString(j),9,NB))),128))],40,TB)]),l.createElementVNode("div",MB,[l.createVNode(Uf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!S(K),"hover:opacity-100":S(K)}]),onClick:j=>S(K)?C(K):null},null,8,["class","onClick"]),l.createVNode(Wf,{class:l.normalizeClass(["w-5 h-5 cursor-pointer select-none",{"opacity-25 cursor-not-allowed":!F(K),"hover:opacity-100":F(K)}]),onClick:j=>F(K)?N(K):null},null,8,["class","onClick"])])]),l.createElementVNode("div",AB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,(j,ce)=>(l.openBlock(),l.createElementBlock("div",{key:ce,class:"flex justify-center text-sm"},l.toDisplayString(j),1))),128))]),l.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:V},[u(o.value[K])>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(f(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1),j=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!v(j)&&!x(j)?c(j):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(j).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d(o.value[K].clone()),j=>(l.openBlock(),l.createBlock(Sc,{onMouseover:ce=>z(j),onClick:ce=>!v(j)&&!x(j)?c(j):null,today:p(j),selected:m(j),firstDay:y(j)||_(j),lastDay:k(j)||P(j),between:g(j),disabled:v(j)||x(j),off:v(j)||x(j),highlight:I(j)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(j).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((q=h(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1))==null?void 0:q.length)>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(h(l.unref(G)(o.value[K]).year(),l.unref(G)(o.value[K]).month()+1),j=>(l.openBlock(),l.createBlock(Sc,{onClick:ce=>!v(j)&&!x(j)?c(j):null,off:""},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(G)(j).format("D")),1)]),_:2},1032,["onClick"]))),256)):l.createCommentVNode("",!0)],32)])}),256))],2))}}),DB={},$B={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},LB=[l.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 BB(t,e){return l.openBlock(),l.createElementBlock("svg",$B,LB)}const Pg=be(DB,[["render",BB]]),IB={},VB={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},PB=[l.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 RB(t,e){return l.openBlock(),l.createElementBlock("svg",VB,PB)}const Rg=be(IB,[["render",RB]]),FB={class:"flex gap-3"},jB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},zB=["onClick"],HB=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{t:n}=jn(),r=t,i=l.computed(()=>r.placeholder==="Select date"?n("wpiccomponents.select_date"):r.placeholder),o=e;function s(d){o("update:modelValue",d)}const a=l.computed(()=>{var d;if(r.range)return(d=r.modelValue)==null?void 0:d.map(u=>G(u).format("YYYY-MM-DD")).join(" to ");if(r.modelValue)return G(r.modelValue).format("YYYY-MM-DD")}),c=l.reactive([{text:l.computed(()=>n("wpiccomponents.month_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("month");o("update:modelValue",[f,u])}},{text:l.computed(()=>n("wpiccomponents.last_month")),onClick(d){const u=G().startOf("month").subtract(1,"month"),f=G(u).endOf("month");o("update:modelValue",[u,f])}},{text:l.computed(()=>n("wpiccomponents.year_to_date")),onClick(d){const u=G().subtract(1,"day"),f=G().startOf("year");o("update:modelValue",[f,u])}}]);return(d,u)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px"},{content:l.withCtx(()=>[l.createElementVNode("div",FB,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",jB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c,f=>(l.openBlock(),l.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:h=>f.onClick()},l.toDisplayString(f.text),9,zB))),256))])):l.createCommentVNode("",!0),l.createVNode(_c,{doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":s,range:t.range},null,8,["doubleMonths","initDates","week","min-date","max-date","modelValue","range"])])]),default:l.withCtx(()=>{var f;return[l.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&&((f=a.value)!=null&&f.length)),onOnClear:u[0]||(u[0]=h=>s(null))},{prepend:l.withCtx(()=>[t.range?(l.openBlock(),l.createBlock(Pg,{key:0,class:"dark:text-gray-400"})):(l.openBlock(),l.createBlock(Rg,{key:1,class:"dark:text-gray-400"}))]),default:l.withCtx(()=>[l.createTextVNode(" "+l.toDisplayString(a.value||i.value),1)]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),WB={class:"relative inline-block tabular-nums"},UB=["value","placeholder","maxlength"],Oc={__name:"DateSegment",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,i=l.ref(null),o=l.computed(()=>n.segment==="year"?4:2);function s(c){const d=c.target.value.replace(/\D/g,"");r("update:modelValue",d.slice(0,o.value)),d.length>=o.value&&n.nextRef&&l.nextTick(()=>{n.nextRef.focus()})}function a(){r("blur")}return(c,d)=>(l.openBlock(),l.createElementBlock("div",WB,[l.createElementVNode("input",{ref_key:"inputRef",ref:i,type:"text",value:t.modelValue,onInput:s,onKeydown:d[0]||(d[0]=(...u)=>c.onKeydown&&c.onKeydown(...u)),onBlur:a,placeholder:t.placeholder,class:l.normalizeClass(["date-segment bg-transparent text-gray-900 dark:text-gray-400 focus:outline-none border-b border-transparent focus:border-gray-800 dark:focus:border-gray-300 transition-all duration-200 ease-in-out hover:bg-gray-50 dark:hover:bg-gray-800 focus:bg-white dark:focus:bg-gray-900 placeholder:opacity-25 placeholder:tracking-wider placeholder:pl-1",{"w-[4ch]":o.value===4,"w-[2ch]":o.value===2}]),inputmode:"numeric",pattern:"\\d*",maxlength:o.value},null,42,UB)]))}},YB={class:"flex items-center gap-0"},qB=l.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-700"},"/",-1),KB=l.createElementVNode("span",{class:"px-px text-gray-400 dark:text-gray-600"},"/",-1),Tc={__name:"DateInput",props:{modelValue:String,disabled:Boolean},emits:["update:modelValue","update:initDates","update:displayYear","update:displayMonth"],setup(t,{emit:e}){const n=t,r=e,i=l.ref(""),o=l.ref(""),s=l.ref(""),a=l.ref(null),c=l.ref(null),d=l.ref(null);l.watch(()=>n.modelValue,k=>{n.range?Array.isArray(k)&&k.length===2?(yearStart.value=k[0]?G(k[0]).format("YYYY"):"",monthStart.value=k[0]?G(k[0]).format("MM"):"",dayStart.value=k[0]?G(k[0]).format("DD"):"",yearEnd.value=k[1]?G(k[1]).format("YYYY"):"",monthEnd.value=k[1]?G(k[1]).format("MM"):"",dayEnd.value=k[1]?G(k[1]).format("DD"):""):(yearStart.value=monthStart.value=dayStart.value="",yearEnd.value=monthEnd.value=dayEnd.value=""):k?(i.value=G(k).format("YYYY"),o.value=G(k).format("MM"),s.value=G(k).format("DD")):i.value=o.value=s.value=""},{immediate:!0});function u(){i.value.length===4&&o.value.length===2&&s.value.length===2&&r("update:modelValue",`${i.value}-${o.value}-${s.value}`)}function f(k){k.length===4&&r("update:displayYear",Number(k)),u()}function h(k){k.length===2&&r("update:displayMonth",Number(k)-1),u()}function p(k){s.value=k,u()}function m(){i.value||(i.value=G().format("YYYY")),u()}function g(){o.value||(o.value=G().format("MM")),u()}function y(){s.value||(s.value=G().format("DD")),u()}return(k,x)=>(l.openBlock(),l.createElementBlock("div",YB,[l.createVNode(Oc,{modelValue:i.value,"onUpdate:modelValue":[x[0]||(x[0]=v=>i.value=v),f],segment:"year",disabled:t.disabled,placeholder:"••••",onBlur:m,ref_key:"yearRef",ref:a},null,8,["modelValue","disabled"]),qB,l.createVNode(Oc,{modelValue:o.value,"onUpdate:modelValue":[x[1]||(x[1]=v=>o.value=v),h],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:g,ref_key:"monthRef",ref:c},null,8,["modelValue","disabled"]),KB,l.createVNode(Oc,{modelValue:s.value,"onUpdate:modelValue":[x[2]||(x[2]=v=>s.value=v),p],segment:"monthOrDay",disabled:t.disabled,placeholder:"••",onBlur:y,ref_key:"dayRef",ref:d},null,8,["modelValue","disabled"])]))}},GB={class:"tabular-nums"},JB={key:1,class:"flex items-center"},ZB=l.createElementVNode("span",{class:"px-1 text-gray-400 dark:text-gray-600"},"➞",-1),XB={class:"flex gap-3"},QB={key:0,class:"w-32 py-2 border-r dark:border-gray-800 flex flex-col gap-3 shrink-0"},eI=["onClick"],tI=Object.assign({name:"WpicAdvDateField"},{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{t:n}=jn(),r=t,i=e,o=l.computed(()=>r.placeholder==="Select date"?n("wpiccomponents.select_date"):r.placeholder);l.ref(!1);const s=l.ref(G().year()),a=l.ref(G().month()),c=l.ref(null),d=l.ref(null);function u(){i("update:modelValue",null)}l.watch(()=>r.initDates,m=>{var g;r.range&&((g=r.initDates)==null?void 0:g.length)==2?(s.value=G(r.initDates[0]).year(),a.value=G(r.initDates[0]).month(),c.value=G(r.initDates[1]).year(),d.value=G(r.initDates[1]).month()):r.initDates&&(s.value=G(r.initDates).year(),a.value=G(r.initDates).month())},{immediate:!0});const f=l.ref(r.range?[]:"");l.watch(()=>r.modelValue,m=>{if(r.range){const g=m!=null&&m[0]?G(m[0]).format("YYYY-MM-DD"):"",y=m!=null&&m[1]?G(m[1]).format("YYYY-MM-DD"):"";(f.value[0]!==g||f.value[1]!==y)&&(f.value=[g,y])}else{const g=m?G(m).format("YYYY-MM-DD"):"";f.value!==g&&(f.value=g)}},{immediate:!0}),l.watch(()=>f.value,m=>{var g,y;if(r.range){const k=m[0]&&m[0].length===10?G(m[0]).toDate():null,x=m[1]&&m[1].length===10?G(m[1]).toDate():null;(!((g=r.modelValue)!=null&&g[0])||r.modelValue[0]!==k||!((y=r.modelValue)!=null&&y[1])||r.modelValue[1]!==x)&&i("update:modelValue",[k,x])}else if(m&&m.length===10){const k=G(m,"YYYY-MM-DD",!0);k.isValid()&&r.modelValue!==k.toDate()&&i("update:modelValue",k.toDate())}},{deep:!0});function h(m){i("update:modelValue",m)}const p=l.reactive([{text:l.computed(()=>n("wpiccomponents.month_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("month");i("update:modelValue",[y,g])}},{text:l.computed(()=>n("wpiccomponents.last_month")),onClick(m){const g=G().startOf("month").subtract(1,"month"),y=G(g).endOf("month");i("update:modelValue",[g,y])}},{text:l.computed(()=>n("wpiccomponents.year_to_date")),onClick(m){const g=G().subtract(1,"day"),y=G().startOf("year");i("update:modelValue",[y,g])}}]);return(m,g)=>(l.openBlock(),l.createBlock(dr,{disabled:t.disabled,maxWidth:"1280px",noCloseClasses:["date-segment"]},{content:l.withCtx(()=>[l.createElementVNode("div",XB,[t.shortcuts?(l.openBlock(),l.createElementBlock("div",QB,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(p,y=>(l.openBlock(),l.createElementBlock("div",{class:"opacity-50 hover:opacity-100 dark:text-gray-300 cursor-pointer",onClick:k=>y.onClick()},l.toDisplayString(y.text),9,eI))),256))])):l.createCommentVNode("",!0),l.createVNode(_c,{doubleMonths:t.doubleMonths,displayYearStart:s.value,displayMonthStart:a.value,displayYearEnd:c.value,displayMonthEnd:d.value,shortcuts:t.shortcuts,week:t.week,"min-date":t.minDate,"max-date":t.maxDate,modelValue:r.range?[...f.value]:f.value,"onUpdate:modelValue":h,range:t.range},null,8,["doubleMonths","displayYearStart","displayMonthStart","displayYearEnd","displayMonthEnd","shortcuts","week","min-date","max-date","modelValue","range"])])]),default:l.withCtx(()=>[l.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:u},{prepend:l.withCtx(()=>[t.range?(l.openBlock(),l.createBlock(Pg,{key:0,class:"dark:text-gray-400"})):(l.openBlock(),l.createBlock(Rg,{key:1,class:"dark:text-gray-400"}))]),default:l.withCtx(()=>[l.createElementVNode("div",GB,[t.range?t.range?(l.openBlock(),l.createElementBlock("div",JB,[l.createVNode(Tc,{modelValue:f.value[0],"onUpdate:modelValue":g[3]||(g[3]=y=>f.value[0]=y),disabled:t.disabled,"onUpdate:displayYear":g[4]||(g[4]=y=>s.value=y),"onUpdate:displayMonth":g[5]||(g[5]=y=>a.value=y)},null,8,["modelValue","disabled"]),ZB,l.createVNode(Tc,{modelValue:f.value[1],"onUpdate:modelValue":g[6]||(g[6]=y=>f.value[1]=y),disabled:t.disabled,"onUpdate:displayYear":g[7]||(g[7]=y=>{c.value=y}),"onUpdate:displayMonth":g[8]||(g[8]=y=>{d.value=y})},null,8,["modelValue","disabled"])])):(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[l.createTextVNode(l.toDisplayString(o.value),1)],64)):(l.openBlock(),l.createBlock(Tc,{key:0,modelValue:f.value,"onUpdate:modelValue":g[0]||(g[0]=y=>f.value=y),disabled:t.disabled,"onUpdate:displayYear":g[1]||(g[1]=y=>s.value=y),"onUpdate:displayMonth":g[2]||(g[2]=y=>a.value=y)},null,8,["modelValue","disabled"]))])]),_:1},8,["label","required","hideRequired","slim","disabled","large","info","clearable"])]),_:1},8,["disabled"]))}}),nI=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:a});const s=l.ref(null);function a(){s.value.scrollTop=0}function c(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["fixed inset-0 h-full flex justify-end bg-black/10 dark:bg-black/50 backdrop-blur-md 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:l.withModifiers(o,["self"])},[l.createElementVNode("div",{class:l.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[l.unref(fe).theme]]:!0}])},[l.createElementVNode("div",{ref_key:"panel",ref:s,class:l.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[l.renderSlot(d.$slots,"default")],2)],2)],2))}}),rI={class:"absolute inset-0 flex items-center justify-center py-12"},iI={class:"text-lg font-medium dark:text-gray-300"},oI={key:0,class:"flex justify-end px-6 pb-4"},sI=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,extraLarge:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean,blur:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,i=n;function o(){i("close")}const s=l.ref(null),a=l.ref(!1);function c(){s.value.scrollTop=0}function d(){s.value.scrollTop=s.value.scrollHeight}function u(){s.value&&r.visible&&(a.value=s.value.scrollTop+s.value.clientHeight>=s.value.scrollHeight-20)}return l.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),l.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:c,isScrolledToBottom:a}),(f,h)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[l.createElementVNode("div",rI,[l.createElementVNode("div",{class:l.normalizeClass(["absolute transition-opacity inset-0 bg-black/10 dark:bg-black/50 z-10",{"backdrop-blur-md":t.blur}]),onClick:o},null,2),l.createElementVNode("div",{class:l.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-3/5":t.large,"w-4/5":t.extraLarge,"w-192":!t.large&&!t.extraLarge,"h-full":t.high,"overflow-hidden":!t.overflow}])},[l.createElementVNode("div",{class:l.normalizeClass(["px-6 pt-4 pb-4 flex items-center justify-between",{"border-b pb-3 dark:border-gray-900":t.border}])},[l.createElementVNode("span",iI,l.toDisplayString(t.title),1),l.createElementVNode("span",{class:"cursor-pointer",onClick:o},[l.createVNode(Di,{class:"w-6 h-6"})])],2),l.createElementVNode("div",{ref_key:"panel",ref:s,class:l.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[l.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(l.openBlock(),l.createElementBlock("div",oI,[l.renderSlot(f.$slots,"buttons")])):l.createCommentVNode("",!0)],2)])],2))}}),aI=["onClick"],lI=Object.assign({name:"WpicTabs"},{props:{modelValue:{type:String,required:!0},pills:Boolean,contrastPills:Boolean,nowrap:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=l.ref([]),o=c=>{r("update:modelValue",c)},s=c=>{i.value.push(c)},a=l.computed(()=>n.modelValue);return l.provide("addTab",s),l.provide("modelValue",a),(c,d)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",{class:l.normalizeClass(["wpic-tabs flex dark:border-gray-930 overflow-x-auto overflow-y-hidden",{"border-b-[1px]":!t.pills}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.value,u=>(l.openBlock(),l.createElementBlock("div",{key:u.name,class:l.normalizeClass(["items-center flex leading-snug cursor-pointer px-6 -mb-[px]",{"py-2":t.pills,"border-b-[2px] py-3":!t.pills,"border-transparent":!t.pills&&u.name!=t.modelValue,"dark:border-gray-930 hover:text-gray-800 dark:hover:text-gray-400 hover:border-gray-200":u.name!=t.modelValue,"text-wpic-500 border-b-wpic-500 dark:text-wpic-600 dark:border-b-wpic-600":!t.pills&&u.name===t.modelValue,"rounded-lg":t.pills,"bg-black/5 dark:bg-white/10 text-gray-800 dark:!text-gray-300":t.pills&&u.name===t.modelValue,"bg-gray-900 dark:bg-gray-300! text-white! dark:text-gray-800!":t.pills&&t.contrastPills&&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)},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(u.labelSlot||"span"),{class:l.normalizeClass({"whitespace-nowrap text-ellipsis overflow-hidden":t.nowrap})},{default:l.withCtx(()=>[u.labelSlot?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(u.label),1)],64))]),_:2},1032,["class"]))],10,aI))),128))],2),l.createElementVNode("div",null,[l.renderSlot(c.$slots,"default")])],64))}}),cI=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=l.ref(!1),r=l.inject("addTab"),i=l.inject("modelValue"),o=l.useSlots();return l.onMounted(()=>{r({label:e.label,name:e.name,disabled:e.disabled,labelSlot:o.label})}),l.watch(()=>i.value,s=>{n.value=s===e.name},{immediate:!0,deep:!0}),(s,a)=>n.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["wpic-tab-pane",{"py-3 px-6":!t.noStyle}])},[l.renderSlot(s.$slots,"default")],2)):l.createCommentVNode("",!0)}}),dI={},uI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},fI=[l.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 hI(t,e){return l.openBlock(),l.createElementBlock("svg",uI,fI)}const pI=be(dI,[["render",hI]]),mI={},gI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},yI=[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)];function bI(t,e){return l.openBlock(),l.createElementBlock("svg",gI,yI)}const kI=be(mI,[["render",bI]]),vI={},wI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},xI=[l.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 EI(t,e){return l.openBlock(),l.createElementBlock("svg",wI,xI)}const CI=be(vI,[["render",EI]]),SI={},_I={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},OI=[l.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 TI(t,e){return l.openBlock(),l.createElementBlock("svg",_I,OI)}const NI=be(SI,[["render",TI]]),MI={key:0,class:"w-6 opacity-50"},AI={class:"flex-1"},DI={key:0,class:"mb-2"},$I=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["py-3 rounded-md text-base flex gap-3 pr-6 mb-3",{"bg-iron-500/10 text-iron-900 dark:bg-iron-500/20 dark:text-iron-200/90":!t.warning&&!t.info&&!t.error&&!t.success,"bg-yellow-500/10 text-yellow-900 dark:bg-yellow-500/20 dark:text-yellow-200/90":t.warning,"bg-purple-500/10 text-purple-900 dark:bg-purple-500/20 dark:text-purple-200/90":t.info,"bg-red-500/10 text-red-900 dark:bg-red-500/20 dark:text-red-200/90":t.error,"bg-emerald-500/10 text-emerald-900 dark:bg-emerald-500/20 dark:text-emerald-200/90":t.success,"pl-4":t.warning||t.info||t.success||t.error,"pl-6":!t.warning&&!t.info&&!t.success&&!t.error}])},[t.warning||t.info||t.success||t.error?(l.openBlock(),l.createElementBlock("div",MI,[t.warning?(l.openBlock(),l.createBlock(pI,{key:0,class:"w-full aspect-square"})):t.info?(l.openBlock(),l.createBlock(kI,{key:1,class:"w-full aspect-square"})):t.success?(l.openBlock(),l.createBlock(CI,{key:2,class:"w-full aspect-square"})):t.error?(l.openBlock(),l.createBlock(NI,{key:3,class:"w-full aspect-square"})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",AI,[t.title?(l.openBlock(),l.createElementBlock("div",DI,l.toDisplayString(t.title),1)):l.createCommentVNode("",!0),l.createElementVNode("span",{class:l.normalizeClass(["",{"":!t.warning&&!t.info&&!t.error&&!t.success,"":t.warning,"":t.info,"":t.error,"":t.success}])},[l.renderSlot(e.$slots,"default",{},()=>[l.createTextVNode(l.toDisplayString(t.text),1)])],2)])],2))}}),Nc=l.ref(!1),Fg=l.ref(""),jg=l.ref(""),zg=l.ref(!1),Hg=l.ref(!1),Wg=l.ref(!1);let Ug=()=>{},Yg=()=>{};function Mc(){const t=({title:i,text:o,positive:s=!1,negative:a=!1,onConfirm:c,onCancel:d,blur:u=!1})=>{Fg.value=i,jg.value=o,zg.value=s,Hg.value=a,Wg.value=u,Ug=c||(()=>{}),Yg=d||(()=>{}),Nc.value=!0},e=()=>{Nc.value=!1};return{visible:Nc,title:Fg,text:jg,positive:zg,negative:Hg,show:t,onConfirm:()=>{Ug(),e()},onCancel:()=>{Yg(),e()},blur:Wg}}const LI={class:"bg-white dark:border dark:border-gray-900 dark:bg-gray-940 p-6 rounded-lg w-128 flex flex-col"},BI={class:"text-lg font-semibold mb-6"},II={class:"mb-12"},VI={class:"flex justify-end"},Ac={WpicColorPicker:Rf,WpicAlert:$I,WpicToggleSwitch:Vf,WpicAdvDateField:tI,WpicCalendar:_c,WpicTextarea:Pf,WpicDialog:sI,WpicSlidePanel:nI,WpicDateField:HB,WpicFormInput:Pi,WpicButton:_i,WpicBadge:pB,WpicTextEditor:ZL,WpicInputGroup:Ey,WpicButtonGroup:ky,WpicForm:Cy,WpicFormField:Ff,WpicSpinner:Ir,WpicTooltip:jf,WpicPopover:dr,WpicChoiceList:If,WpicCard:O_,WpicCardSection:M_,WpicProgressBar:$_,WpicTag:B_,WpicTagGroup:I_,WpicPagination:lO,WpicLoadingPanel:F_,WpicTable:jO,WpicTableColumn:zO,WpicTabs:lI,WpicTabPane:cI,WpicConfirm:be(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:a,blur:c}=Mc();return(d,u)=>l.unref(e)?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["z-40 fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black/10 dark:bg-black/50 transition-opacity",{"backdrop-blur-md":l.unref(c)}])},[l.createElementVNode("div",LI,[l.createElementVNode("div",BI,l.toDisplayString(l.unref(n)),1),l.createElementVNode("div",II,l.toDisplayString(l.unref(r)),1),l.createElementVNode("div",VI,[l.createVNode(_i,{onClick:l.unref(a)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.$t("wpiccomponents.cancel")),1)]),_:1},8,["onClick"]),l.createVNode(_i,{primary:l.unref(i),destructive:l.unref(o),onClick:l.unref(s)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(d.$t("wpiccomponents.confirm")),1)]),_:1},8,["primary","destructive","onClick"])])])],2)):l.createCommentVNode("",!0)}}),[["__scopeId","data-v-e79ca400"]])};function qg(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?qg(t[n],e[n]):t[n]=e[n])}const PI={useConfirm:Mc};function RI(t,e){qg(fe,e);for(const n in Ac)if(Ac.hasOwnProperty(n)){const r=Ac[n];t.component(r.name,r)}}const FI={install:RI,composables:PI,options:fe};Dn.default=FI,Dn.useConfirm=Mc,Object.defineProperties(Dn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|