@fewangsit/wangsvue-fats 1.0.1-alpha.10 → 1.0.1-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var YG=Object.defineProperty;var QG=(ce,qt,dt)=>qt in ce?YG(ce,qt,{enumerable:!0,configurable:!0,writable:!0,value:dt}):ce[qt]=dt;var Ct=(ce,qt,dt)=>QG(ce,typeof qt!="symbol"?qt+"":qt,dt);System.register(["vue","@tagsamurai/fats-api-services","vue-router","axios"],function(ce,qt){"use strict";var dt,oe,re,wf,$r,bt,Pt,Re,O,sn,W,x,za,Ks,$t,Vi,Fa,Ov,ye,er,ft,T,g,ee,ht,_,E,et,an,L,N,pe,le,z,it,Hu,I,Vr,yt,Dn,_e,Cn,si,Ot,xt,Jo,Zn,tr,ja,Tv,Sf,zn,Yo,Cf,kf,Of,xv,Mv,Ev,uo,Tf,xf,Mf,Ef,Pf,Pv,Iv,If,Lv,Lf,Dv,Rv;return{setters:[Ke=>{dt=Ke.inject,oe=Ke.shallowRef,re=Ke.ref,wf=Ke.readonly,$r=Ke.getCurrentInstance,bt=Ke.onMounted,Pt=Ke.nextTick,Re=Ke.watch,O=Ke.mergeProps,sn=Ke.reactive,W=Ke.computed,x=Ke.unref,za=Ke.isRef,Ks=Ke.provide,$t=Ke.toValue,Vi=Ke.onBeforeUnmount,Fa=Ke.watchEffect,Ov=Ke.shallowReactive,ye=Ke.defineComponent,er=Ke.h,ft=Ke.withDirectives,T=Ke.createElementBlock,g=Ke.openBlock,ee=Ke.renderSlot,ht=Ke.createTextVNode,_=Ke.toDisplayString,E=Ke.createElementVNode,et=Ke.resolveComponent,an=Ke.resolveDirective,L=Ke.createBlock,N=Ke.createCommentVNode,pe=Ke.normalizeClass,le=Ke.Fragment,z=Ke.withCtx,it=Ke.normalizeProps,Hu=Ke.Teleport,I=Ke.createVNode,Vr=Ke.Transition,yt=Ke.resolveDynamicComponent,Dn=Ke.createSlots,_e=Ke.renderList,Cn=Ke.mergeModels,si=Ke.useModel,Ot=Ke.guardReactiveProps,xt=Ke.withModifiers,Jo=Ke.onUnmounted,Zn=Ke.vShow,tr=Ke.normalizeStyle,ja=Ke.useSlots,Tv=Ke.TransitionGroup,Sf=Ke.onBeforeMount,zn=Ke.withKeys,Yo=Ke.toHandlers,Cf=Ke.vModelText,kf=Ke.markRaw,Of=Ke.render,xv=Ke.customRef},Ke=>{Mv=Ke.I18nService,Ev=Ke.ChangelogServices,uo=Ke.AssetServices,Tf=Ke.DisposalServices,xf=Ke.getImageURL,Mf=Ke.TAGServices,Ef=Ke.AssetNameServices,Pf=Ke.DamageServices,Pv=Ke.TrackingServices,Iv=Ke.MissingServices,If=Ke.TransferServices,Lv=Ke.GroupCategoryServices},Ke=>{Lf=Ke.isNavigationFailure},Ke=>{Dv=Ke.AxiosError,Rv=Ke.default}],execute:function(){var ao;ce({getStatusSeverity:Iy,mitt:Ke});function Ke(t){var n;t=t||((n=window.eventBus)==null?void 0:n.all)||new Map;const e={all:t,on(i,r){const o=t==null?void 0:t.get(i);o?o.push(r):t==null||t.set(i,[r])},off(i,r){const o=t==null?void 0:t.get(i);o&&(r?o.splice(o.indexOf(r)>>>0,1):t==null||t.set(i,[]))},emit(i,r){let o=t==null?void 0:t.get(i);o&&o.slice().map(s=>{s(r)}),o=t==null?void 0:t.get("*"),o&&o.slice().map(s=>{s(i,r)})}};return window.eventBus??(window.eventBus=e),window.eventBus}const Ye=ce("eventBus",Ke()),eZ=ce("extendEventBus",()=>Ye);function Df(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Nf(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(u){throw u},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ var YG=Object.defineProperty;var QG=(ce,qt,dt)=>qt in ce?YG(ce,qt,{enumerable:!0,configurable:!0,writable:!0,value:dt}):ce[qt]=dt;var Ct=(ce,qt,dt)=>QG(ce,typeof qt!="symbol"?qt+"":qt,dt);System.register(["vue","@tagsamurai/fats-api-services","vue-router","axios"],function(ce,qt){"use strict";var dt,oe,re,wf,$r,bt,Pt,Re,O,sn,W,x,za,Ks,$t,Vi,Fa,Ov,ye,er,ft,T,g,ee,ht,_,E,et,an,L,N,pe,le,z,it,Hu,I,Vr,yt,Dn,_e,Cn,si,Ot,xt,Jo,Zn,tr,ja,Tv,Sf,zn,Yo,Cf,kf,xv,Of,Mv,Ev,uo,Tf,xf,Mf,Ef,Pf,Pv,Iv,If,Lv,Lf,Dv,Rv;return{setters:[Ke=>{dt=Ke.inject,oe=Ke.shallowRef,re=Ke.ref,wf=Ke.readonly,$r=Ke.getCurrentInstance,bt=Ke.onMounted,Pt=Ke.nextTick,Re=Ke.watch,O=Ke.mergeProps,sn=Ke.reactive,W=Ke.computed,x=Ke.unref,za=Ke.isRef,Ks=Ke.provide,$t=Ke.toValue,Vi=Ke.onBeforeUnmount,Fa=Ke.watchEffect,Ov=Ke.shallowReactive,ye=Ke.defineComponent,er=Ke.h,ft=Ke.withDirectives,T=Ke.createElementBlock,g=Ke.openBlock,ee=Ke.renderSlot,ht=Ke.createTextVNode,_=Ke.toDisplayString,E=Ke.createElementVNode,et=Ke.resolveComponent,an=Ke.resolveDirective,L=Ke.createBlock,N=Ke.createCommentVNode,pe=Ke.normalizeClass,le=Ke.Fragment,z=Ke.withCtx,it=Ke.normalizeProps,Hu=Ke.Teleport,I=Ke.createVNode,Vr=Ke.Transition,yt=Ke.resolveDynamicComponent,Dn=Ke.createSlots,_e=Ke.renderList,Cn=Ke.mergeModels,si=Ke.useModel,Ot=Ke.guardReactiveProps,xt=Ke.withModifiers,Jo=Ke.onUnmounted,Zn=Ke.vShow,tr=Ke.normalizeStyle,ja=Ke.useSlots,Tv=Ke.TransitionGroup,Sf=Ke.onBeforeMount,zn=Ke.withKeys,Yo=Ke.toHandlers,Cf=Ke.markRaw,kf=Ke.render,xv=Ke.customRef,Of=Ke.vModelText},Ke=>{Mv=Ke.I18nService,Ev=Ke.ChangelogServices,uo=Ke.AssetServices,Tf=Ke.DisposalServices,xf=Ke.getImageURL,Mf=Ke.TAGServices,Ef=Ke.AssetNameServices,Pf=Ke.DamageServices,Pv=Ke.TrackingServices,Iv=Ke.MissingServices,If=Ke.TransferServices,Lv=Ke.GroupCategoryServices},Ke=>{Lf=Ke.isNavigationFailure},Ke=>{Dv=Ke.AxiosError,Rv=Ke.default}],execute:function(){var ao;ce({getStatusSeverity:Iy,mitt:Ke});function Ke(t){var n;t=t||((n=window.eventBus)==null?void 0:n.all)||new Map;const e={all:t,on(i,r){const o=t==null?void 0:t.get(i);o?o.push(r):t==null||t.set(i,[r])},off(i,r){const o=t==null?void 0:t.get(i);o&&(r?o.splice(o.indexOf(r)>>>0,1):t==null||t.set(i,[]))},emit(i,r){let o=t==null?void 0:t.get(i);o&&o.slice().map(s=>{s(r)}),o=t==null?void 0:t.get("*"),o&&o.slice().map(s=>{s(i,r)})}};return window.eventBus??(window.eventBus=e),window.eventBus}const Ye=ce("eventBus",Ke()),eZ=ce("extendEventBus",()=>Ye);function Df(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Nf(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(u){throw u},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function HC(t){return WC(t)||KC(t)||Nf(t)||UC()}function UC(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KC(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function WC(t){if(Array.isArray(t))return Bf(t)}function Ha(t){"@babel/helpers - typeof";return Ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ha(t)}function Rf(t,e){return GC(t)||XC(t,e)||Nf(t,e)||qC()}function qC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nf(t,e){if(t){if(typeof t=="string")return Bf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bf(t,e)}}function Bf(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function XC(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(c){u=!0,r=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}function GC(t){if(Array.isArray(t))return t}var G={innerWidth:function(e){if(e){var n=e.offsetWidth,i=getComputedStyle(e);return n+=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),n}return 0},width:function(e){if(e){var n=e.offsetWidth,i=getComputedStyle(e);return n-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),n}return 0},getWindowScrollTop:function(){var e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)},getWindowScrollLeft:function(){var e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)},getOuterWidth:function(e,n){if(e){var i=e.offsetWidth;if(n){var r=getComputedStyle(e);i+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return i}return 0},getOuterHeight:function(e,n){if(e){var i=e.offsetHeight;if(n){var r=getComputedStyle(e);i+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return i}return 0},getClientHeight:function(e,n){if(e){var i=e.clientHeight;if(n){var r=getComputedStyle(e);i+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return i}return 0},getViewport:function(){var e=window,n=document,i=n.documentElement,r=n.getElementsByTagName("body")[0],o=e.innerWidth||i.clientWidth||r.clientWidth,s=e.innerHeight||i.clientHeight||r.clientHeight;return{width:o,height:s}},getOffset:function(e){if(e){var n=e.getBoundingClientRect();return{top:n.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:n.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}},index:function(e){if(e)for(var n,i=(n=this.getParentNode(e))===null||n===void 0?void 0:n.childNodes,r=0,o=0;o<i.length;o++){if(i[o]===e)return r;i[o].nodeType===1&&r++}return-1},addMultipleClasses:function(e,n){var i=this;e&&n&&[n].flat().filter(Boolean).forEach(function(r){return r.split(" ").forEach(function(o){return i.addClass(e,o)})})},removeMultipleClasses:function(e,n){var i=this;e&&n&&[n].flat().filter(Boolean).forEach(function(r){return r.split(" ").forEach(function(o){return i.removeClass(e,o)})})},addClass:function(e,n){e&&n&&!this.hasClass(e,n)&&(e.classList?e.classList.add(n):e.className+=" "+n)},removeClass:function(e,n){e&&n&&(e.classList?e.classList.remove(n):e.className=e.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," "))},hasClass:function(e,n){return e?e.classList?e.classList.contains(n):new RegExp("(^| )"+n+"( |$)","gi").test(e.className):!1},addStyles:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e&&Object.entries(n).forEach(function(i){var r=Rf(i,2),o=r[0],s=r[1];return e.style[o]=s})},find:function(e,n){return this.isElement(e)?e.querySelectorAll(n):[]},findSingle:function(e,n){return this.isElement(e)?e.querySelector(n):null},createElement:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e){var i=document.createElement(e);this.setAttributes(i,n);for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return i.append.apply(i,o),i}},setAttribute:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;this.isElement(e)&&i!==null&&i!==void 0&&e.setAttribute(n,i)},setAttributes:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.isElement(e)){var r=function o(s,a){var l,u,c=e!=null&&(l=e.$attrs)!==null&&l!==void 0&&l[s]?[e==null||(u=e.$attrs)===null||u===void 0?void 0:u[s]]:[];return[a].flat().reduce(function(d,f){if(f!=null){var p=Ha(f);if(p==="string"||p==="number")d.push(f);else if(p==="object"){var h=Array.isArray(f)?o(s,f):Object.entries(f).map(function(m){var v=Rf(m,2),S=v[0],b=v[1];return s==="style"&&(b||b===0)?"".concat(S.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(b):b?S:void 0});d=h.length?d.concat(h.filter(function(m){return!!m})):d}}return d},c)};Object.entries(i).forEach(function(o){var s=Rf(o,2),a=s[0],l=s[1];if(l!=null){var u=a.match(/^on(.+)/);u?e.addEventListener(u[1].toLowerCase(),l):a==="p-bind"?n.setAttributes(e,l):(l=a==="class"?HC(new Set(r("class",l))).join(" ").trim():a==="style"?r("style",l).join(";").trim():l,(e.$attrs=e.$attrs||{})&&(e.$attrs[a]=l),e.setAttribute(a,l))}})}},getAttribute:function(e,n){if(this.isElement(e)){var i=e.getAttribute(n);return isNaN(i)?i==="true"||i==="false"?i==="true":i:+i}},isAttributeEquals:function(e,n,i){return this.isElement(e)?this.getAttribute(e,n)===i:!1},isAttributeNotEquals:function(e,n,i){return!this.isAttributeEquals(e,n,i)},getHeight:function(e){if(e){var n=e.offsetHeight,i=getComputedStyle(e);return n-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),n}return 0},getWidth:function(e){if(e){var n=e.offsetWidth,i=getComputedStyle(e);return n-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),n}return 0},absolutePosition:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e){var r=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),o=r.height,s=r.width,a=n.offsetHeight,l=n.offsetWidth,u=n.getBoundingClientRect(),c=this.getWindowScrollTop(),d=this.getWindowScrollLeft(),f=this.getViewport(),p,h,m="top";u.top+a+o>f.height?(p=u.top+c-o,m="bottom",p<0&&(p=c)):p=a+u.top+c,u.left+s>f.width?h=Math.max(0,u.left+d+l-s):h=u.left+d,e.style.top=p+"px",e.style.left=h+"px",e.style.transformOrigin=m,i&&(e.style.marginTop=m==="bottom"?"calc(var(--p-anchor-gutter) * -1)":"calc(var(--p-anchor-gutter))")}},relativePosition:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e){var r=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),o=n.offsetHeight,s=n.getBoundingClientRect(),a=this.getViewport(),l,u,c="top";s.top+o+r.height>a.height?(l=-1*r.height,c="bottom",s.top+l<0&&(l=-1*s.top)):l=o,r.width>a.width?u=s.left*-1:s.left+r.width>a.width?u=(s.left+r.width-a.width)*-1:u=0,e.style.top=l+"px",e.style.left=u+"px",e.style.transformOrigin=c,i&&(e.style.marginTop=c==="bottom"?"calc(var(--p-anchor-gutter) * -1)":"calc(var(--p-anchor-gutter))")}},nestedPosition:function(e,n){if(e){var i=e.parentElement,r=this.getOffset(i),o=this.getViewport(),s=e.offsetParent?e.offsetWidth:this.getHiddenElementOuterWidth(e),a=this.getOuterWidth(i.children[0]),l;parseInt(r.left,10)+a+s>o.width-this.calculateScrollbarWidth()?parseInt(r.left,10)<s?n%2===1?l=parseInt(r.left,10)?"-"+parseInt(r.left,10)+"px":"100%":n%2===0&&(l=o.width-s-this.calculateScrollbarWidth()+"px"):l="-100%":l="100%",e.style.top="0px",e.style.left=l}},getParentNode:function(e){var n=e==null?void 0:e.parentNode;return n&&n instanceof ShadowRoot&&n.host&&(n=n.host),n},getParents:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=this.getParentNode(e);return i===null?n:this.getParents(i,n.concat([i]))},getScrollableParents:function(e){var n=[];if(e){var i=this.getParents(e),r=/(auto|scroll)/,o=function(v){try{var S=window.getComputedStyle(v,null);return r.test(S.getPropertyValue("overflow"))||r.test(S.getPropertyValue("overflowX"))||r.test(S.getPropertyValue("overflowY"))}catch{return!1}},s=Df(i),a;try{for(s.s();!(a=s.n()).done;){var l=a.value,u=l.nodeType===1&&l.dataset.scrollselectors;if(u){var c=u.split(","),d=Df(c),f;try{for(d.s();!(f=d.n()).done;){var p=f.value,h=this.findSingle(l,p);h&&o(h)&&n.push(h)}}catch(m){d.e(m)}finally{d.f()}}l.nodeType!==9&&o(l)&&n.push(l)}}catch(m){s.e(m)}finally{s.f()}}return n},getHiddenElementOuterHeight:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var n=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",n}return 0},getHiddenElementOuterWidth:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var n=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",n}return 0},getHiddenElementDimensions:function(e){if(e){var n={};return e.style.visibility="hidden",e.style.display="block",n.width=e.offsetWidth,n.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible",n}return 0},fadeIn:function(e,n){if(e){e.style.opacity=0;var i=+new Date,r=0,o=function s(){r=+e.style.opacity+(new Date().getTime()-i)/n,e.style.opacity=r,i=+new Date,+r<1&&(window.requestAnimationFrame&&requestAnimationFrame(s)||setTimeout(s,16))};o()}},fadeOut:function(e,n){if(e)var i=1,r=50,o=n,s=r/o,a=setInterval(function(){i-=s,i<=0&&(i=0,clearInterval(a)),e.style.opacity=i},r)},getUserAgent:function(){return navigator.userAgent},appendChild:function(e,n){if(this.isElement(n))n.appendChild(e);else if(n.el&&n.elElement)n.elElement.appendChild(e);else throw new Error("Cannot append "+n+" to "+e)},isElement:function(e){return(typeof HTMLElement>"u"?"undefined":Ha(HTMLElement))==="object"?e instanceof HTMLElement:e&&Ha(e)==="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"},scrollInView:function(e,n){var i=getComputedStyle(e).getPropertyValue("borderTopWidth"),r=i?parseFloat(i):0,o=getComputedStyle(e).getPropertyValue("paddingTop"),s=o?parseFloat(o):0,a=e.getBoundingClientRect(),l=n.getBoundingClientRect(),u=l.top+document.body.scrollTop-(a.top+document.body.scrollTop)-r-s,c=e.scrollTop,d=e.clientHeight,f=this.getOuterHeight(n);u<0?e.scrollTop=c+u:u+f>d&&(e.scrollTop=c+u-d+f)},clearSelection:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch{}},getSelection:function(){return window.getSelection?window.getSelection().toString():document.getSelection?document.getSelection().toString():document.selection?document.selection.createRange().text:null},calculateScrollbarWidth:function(){if(this.calculatedScrollbarWidth!=null)return this.calculatedScrollbarWidth;var e=document.createElement("div");this.addStyles(e,{width:"100px",height:"100px",overflow:"scroll",position:"absolute",top:"-9999px"}),document.body.appendChild(e);var n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),this.calculatedScrollbarWidth=n,n},calculateBodyScrollbarWidth:function(){return window.innerWidth-document.documentElement.offsetWidth},getBrowser:function(){if(!this.browser){var e=this.resolveUserAgent();this.browser={},e.browser&&(this.browser[e.browser]=!0,this.browser.version=e.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser},resolveUserAgent:function(){var e=navigator.userAgent.toLowerCase(),n=/(chrome)[ ]([\w.]+)/.exec(e)||/(webkit)[ ]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:n[1]||"",version:n[2]||"0"}},isVisible:function(e){return e&&e.offsetParent!=null},invokeElementMethod:function(e,n,i){e[n].apply(e,i)},isExist:function(e){return!!(e!==null&&typeof e<"u"&&e.nodeName&&this.getParentNode(e))},isClient:function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)},focus:function(e,n){e&&document.activeElement!==e&&e.focus(n)},isFocusableElement:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return this.isElement(e)?e.matches('button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(n,`,
@@ -204,44 +204,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
204
204
  display: none;
205
205
  }
206
206
  }
207
- `)}this.styleElement.innerHTML=i}},hasBreakpoints:function(){return xh(this.template)==="object"},setPaginatorAttribute:function(){var e=this;this.$refs.paginator&&this.$refs.paginator.length>=0&&PD(this.$refs.paginator).forEach(function(n){n.setAttribute(e.attributeSelector,"")})},getAriaLabel:function(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[e]:void 0}},computed:{templateItems:function(){var e={};if(this.hasBreakpoints()){e=this.template,e.default||(e.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(var n in e)e[n]=this.template[n].split(" ").map(function(i){return i.trim()});return e}return e.default=this.template.split(" ").map(function(i){return i.trim()}),e},page:function(){return Math.floor(this.d_first/this.d_rows)},pageCount:function(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage:function(){return this.page===0},isLastPage:function(){return this.page===this.pageCount-1},calculatePageLinkBoundaries:function(){var e=this.pageCount,n=Math.min(this.pageLinkSize,e),i=Math.max(0,Math.ceil(this.page-n/2)),r=Math.min(e-1,i+n-1),o=this.pageLinkSize-(r-i+1);return i=Math.max(0,i-o),[i,r]},pageLinks:function(){for(var e=[],n=this.calculatePageLinkBoundaries,i=n[0],r=n[1],o=i;o<=r;o++)e.push(o+1);return e},currentState:function(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty:function(){return this.pageCount===0},currentPage:function(){return this.pageCount>0?this.page+1:0},attributeSelector:function(){return jn()}},components:{CurrentPageReport:EA,FirstPageLink:PA,LastPageLink:DA,NextPageLink:RA,PageLinks:NA,PrevPageLink:BA,RowsPerPageDropdown:$A,JumpToPageDropdown:IA,JumpToPageInput:LA}};function $D(t,e,n,i,r,o){var s=et("FirstPageLink"),a=et("PrevPageLink"),l=et("NextPageLink"),u=et("LastPageLink"),c=et("PageLinks"),d=et("CurrentPageReport"),f=et("RowsPerPageDropdown"),p=et("JumpToPageDropdown"),h=et("JumpToPageInput");return t.alwaysShow||o.pageLinks&&o.pageLinks.length>1?(g(),T("nav",it(O({key:0},t.ptmi("paginatorWrapper"))),[(g(!0),T(le,null,_e(o.templateItems,function(m,v){return g(),T("div",O({key:v,ref_for:!0,ref:"paginator",class:t.cx("paginator",{key:v})},t.ptm("root")),[t.$slots.start?(g(),T("div",O({key:0,class:t.cx("start")},t.ptm("start")),[ee(t.$slots,"start",{state:o.currentState})],16)):N("",!0),(g(!0),T(le,null,_e(m,function(S){return g(),T(le,{key:S},[S==="FirstPageLink"?(g(),L(s,{key:0,"aria-label":o.getAriaLabel("firstPageLabel"),template:t.$slots.firstpagelinkicon,onClick:e[0]||(e[0]=function(b){return o.changePageToFirst(b)}),disabled:o.isFirstPage||o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","template","disabled","unstyled","pt"])):S==="PrevPageLink"?(g(),L(a,{key:1,"aria-label":o.getAriaLabel("prevPageLabel"),template:t.$slots.prevpagelinkicon,onClick:e[1]||(e[1]=function(b){return o.changePageToPrev(b)}),disabled:o.isFirstPage||o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","template","disabled","unstyled","pt"])):S==="NextPageLink"?(g(),L(l,{key:2,"aria-label":o.getAriaLabel("nextPageLabel"),template:t.$slots.nextpagelinkicon,onClick:e[2]||(e[2]=function(b){return o.changePageToNext(b)}),disabled:o.isLastPage||o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","template","disabled","unstyled","pt"])):S==="LastPageLink"?(g(),L(u,{key:3,"aria-label":o.getAriaLabel("lastPageLabel"),template:t.$slots.lastpagelinkicon,onClick:e[3]||(e[3]=function(b){return o.changePageToLast(b)}),disabled:o.isLastPage||o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","template","disabled","unstyled","pt"])):S==="PageLinks"?(g(),L(c,{key:4,"aria-label":o.getAriaLabel("pageLabel"),value:o.pageLinks,page:o.page,onClick:e[4]||(e[4]=function(b){return o.changePageLink(b)}),pt:t.pt},null,8,["aria-label","value","page","pt"])):S==="CurrentPageReport"?(g(),L(d,{key:5,"aria-live":"polite",template:t.currentPageReportTemplate,currentPage:o.currentPage,page:o.page,pageCount:o.pageCount,first:r.d_first,rows:r.d_rows,totalRecords:t.totalRecords,unstyled:t.unstyled,pt:t.pt},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords","unstyled","pt"])):S==="RowsPerPageDropdown"&&t.rowsPerPageOptions?(g(),L(f,{key:6,"aria-label":o.getAriaLabel("rowsPerPageLabel"),rows:r.d_rows,options:t.rowsPerPageOptions,onRowsChange:e[5]||(e[5]=function(b){return o.onRowChange(b)}),disabled:o.empty,templates:t.$slots,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","rows","options","disabled","templates","unstyled","pt"])):S==="JumpToPageDropdown"?(g(),L(p,{key:7,"aria-label":o.getAriaLabel("jumpToPageDropdownLabel"),page:o.page,pageCount:o.pageCount,onPageChange:e[6]||(e[6]=function(b){return o.changePage(b)}),disabled:o.empty,templates:t.$slots,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","page","pageCount","disabled","templates","unstyled","pt"])):S==="JumpToPageInput"?(g(),L(h,{key:8,page:o.currentPage,onPageChange:e[7]||(e[7]=function(b){return o.changePage(b)}),disabled:o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["page","disabled","unstyled","pt"])):N("",!0)],64)}),128)),t.$slots.end?(g(),T("div",O({key:1,class:t.cx("end")},t.ptm("end")),[ee(t.$slots,"end",{state:o.currentState})],16)):N("",!0)],16)}),128))],16)):N("",!0)}Eh.render=$D;const VD=(t,e,n)=>{const i=t[e];return i?typeof i=="function"?i():Promise.resolve(i):new Promise((r,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},Kl=ye({__name:"Animation",props:{animation:{},autoplay:{type:Boolean,default:!0},loop:{type:Boolean,default:!0}},setup(t){const e=t,{defaultProps:n}=_t("Animation"),i=W(()=>Hi(e,n)),r=re(null);bt(async()=>{const s=await VD(Object.assign({"../../assets/lottie/admin/loading-page.lottie":()=>qt.import("./loading-page-BrQattYE.js"),"../../assets/lottie/admin/loading-table.lottie":()=>qt.import("./loading-table-BzrSQlA0.js"),"../../assets/lottie/admin/no-data.lottie":()=>qt.import("./no-data-y1X5WtcQ.js"),"../../assets/lottie/supplyasset/loading-page.lottie":()=>qt.import("./loading-page-DbLuqCHa.js"),"../../assets/lottie/supplyasset/loading-table.lottie":()=>qt.import("./loading-table-Bdr9ZhtP.js"),"../../assets/lottie/supplyasset/no-data.lottie":()=>qt.import("./no-data-Cgze_Rvp.js"),"../../assets/lottie/workspace/loading-page.lottie":()=>qt.import("./loading-page-CgfbWppy.js"),"../../assets/lottie/workspace/loading-plane.lottie":()=>qt.import("./loading-plane-CgfbWppy.js"),"../../assets/lottie/workspace/loading-table.lottie":()=>qt.import("./loading-table-chOgXi94.js"),"../../assets/lottie/workspace/no-data.lottie":()=>qt.import("./no-data-Dep79CBh.js")}),`../../assets/lottie/${i.value.libPath}/${e.animation}.lottie`,6),{DotLottie:a}=await o();r.value&&new a({canvas:r.value,src:s.default,autoplay:e.autoplay,loop:e.loop})});const o=()=>qt.import("https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web@0.38.2/+esm");return(s,a)=>(g(),T("div",O({"data-wv-name":"animation"},s.$attrs),[E("canvas",{ref_key:"canvasRef",ref:r,style:{width:"100%",height:"100%"}},null,512)],16))}}),zD=ye({__name:"MultiRow",props:{attributes:{}},setup(t){const e=t,n=dt("preset",{}).datatable;return(i,r)=>{var o;return g(),T("div",it(Ot((o=x(n))==null?void 0:o.multirowcontainer({props:e}))),[(g(!0),T(le,null,_e(i.attributes,(s,a)=>{var l;return g(),T("span",O({key:a,ref_for:!0},(l=x(n))==null?void 0:l.multirow({context:{firstIndex:a===0}}),{class:s.class}),[s.bodyComponent?(g(),L(yt(s.bodyComponent.component),O({key:0,modelValue:s.bodyComponent.model,"onUpdate:modelValue":u=>s.bodyComponent.model=u,ref_for:!0},s.bodyComponent.props,{class:s.class,disabled:s.bodyComponent.disabled},Yo(s.bodyComponent.events?s.bodyComponent.events:{}),{onClick:r[0]||(r[0]=xt(()=>{},["stop"]))}),null,16,["modelValue","onUpdate:modelValue","class","disabled"])):(g(),T(le,{key:1},[ht(_(s.value),1)],64))],16)}),128))],16)}}}),FD=["id"],jD=["onClick"],HD={class:"flex"},UD=["id"],KD={key:0},WD=["colspan"],qD=["id","draggable","onClick","onDblclick","onDragenter","onDragstart"],XD=["onClick"],GD=["colspan"],ZD=["colspan"],_D=["colspan"],JD=["colspan"],YD=["colspan"],QD=["contenteditable","onBlur","onKeypress"],eR={key:1},tR={key:2},nR=["colspan"],iR=ye({__name:"DataTable",props:Cn({treeTable:{type:Boolean},childTableProps:{},tableName:{default:"datatable"},tableTitle:{default:void 0},columns:{},useOption:{type:Boolean,default:!0},data:{},dataKey:{default:"_id"},disableKey:{default:"isDefault"},includeCheckDisabledRows:{type:Boolean},highlightKey:{},disableAllRows:{type:Boolean},search:{},tag:{},defaultQueryParams:{},fetchFunction:{},rows:{},isSelectedAll:{type:Boolean},filters:{},lazy:{type:Boolean,default:!0},loading:{type:Boolean},selectionType:{default:"checkbox"},useSelection:{type:Boolean},selectedData:{},expandedRows:{},usePaginator:{type:Boolean},options:{default:()=>[]},singleSelect:{type:Boolean},customColumn:{type:Boolean,default:!0},scrollHeight:{},rowHeight:{default:"fixed"},reorderable:{type:Boolean},globalFilterFields:{},totalDisabledRows:{},excelToastErrorMessage:{},emptyTableMessage:{},singleSelection:{}},{singleSelection:{},singleSelectionModifiers:{}}),emits:Cn(["toggleOption","selectData","rowSelect","page","sort","update:selectedData","update:singleSelection","cellEdited","input","rowReorder"],["update:singleSelection"]),setup(t,{emit:e}){const n=t,i=e,r=si(t,"singleSelection"),{defaultProps:o,locale:s}=_t("DataTable"),a=W(()=>Hi(n,o)),l=dt("preset",{}).datatable,u=[10,25,50,100],c=dt("useToastConfig"),d=vo(c),{setLoading:f}=Fi(),p=`${window.location.pathname.replace("/","").split("/").join("-")}-${n.tableName}`,h=re(n.data??[]),m=oe(n.data??[]),v=re({}),S=re(n.columns),b=re(),k=re(),A=oe([]),w=oe(),y=oe(0),C=oe(!1),P=oe(!1),R=oe(0),M=oe(0),D=oe(0),$=oe(!1),q=oe(),J=re(),ve=re(),ae=re([]),me=oe({}),se=oe(),Ie=oe(),Be=oe(),xe=oe(),de=oe(1),ge=oe(10),Pe=oe(0),Te=re({}),ue=W(()=>{var V,ne;return(V=n.childTableProps)!=null&&V.columns?(ne=n.childTableProps)==null?void 0:ne.columns.filter(Ve=>{var qe;return!Ve.parentColumnsFields||((qe=Ve.parentColumnsFields)==null?void 0:qe.some(Wt=>S.value.some(Qe=>Qe.field===Wt)))}):S.value}),Se=W(()=>S.value.length+(n.selectionType==="checkbox"?1:0)+(n.useOption?1:0)+(n.reorderable?1:0)+(n.treeTable?1:0)),Z=W(()=>({...n.defaultQueryParams,search:n.lazy?se.value:n.search,tag:n.lazy?Ie.value:void 0,page:n.usePaginator?de.value:void 0,limit:n.usePaginator?ge.value:void 0,sortOrder:xe.value,sortBy:Be.value,...n.lazy?me.value:n.filters})),X=W(()=>{var ne;const V=(ne=h.value)==null?void 0:ne.filter(Ve=>{var qe;return((qe=Ve.children)==null?void 0:qe.length)||Ve.hasChildren});return(V==null?void 0:V.length)&&V.every(Ve=>v.value[Ve[n.dataKey]]>0)}),U=W(()=>{var Qe,Ht,Nt,On,En;if(n.disableAllRows||!((Qe=lt())!=null&&Qe.length)||n.selectionType!=="checkbox"||((Ht=Y.value)==null?void 0:Ht.length)===h.value.length)return!1;const V=(Nt=A.value)==null?void 0:Nt.length,ne=((On=at(lt()))==null?void 0:On.map(be=>be[n.dataKey]))??[],Ve=((En=A.value)==null?void 0:En.map(be=>be[n.dataKey]))??[],qe=Ve.length?$L(ne,Ve):!1,Wt=V>0&&V===(Pe.value??0)-(Y.value.length??0);return qe||Wt}),Y=W(()=>Qt(n.data??lt()??[])),ke=W(()=>C.value||n.loading),Fe=W(()=>{var V;return!ke.value&&!((V=h.value)!=null&&V.length)}),H=W(()=>n.lazy&&n.fetchFunction||!n.usePaginator?h.value:h.value.slice((de.value-1)*ge.value,de.value*ge.value)),he=V=>Object.keys(v.value).includes(V),De=V=>Y.value.includes(V),nt=V=>n.selectionType==="checkbox"?!!A.value.find(ne=>ne[n.dataKey]===V):St(V),St=V=>{var ne;return V!==void 0&&((ne=r.value)==null?void 0:ne[n.dataKey])===V},lt=V=>(h.value??[]).filter(ne=>!ne.childRowHeader&&!ne.childRow),At=async(V,ne,Ve)=>{var Wt,Qe;if(he(V[n.dataKey])===Ve)return;const qe=Ve??!he(V[n.dataKey]);if(!P.value)if(!qe)h.value.splice(ne+1,v.value[V[n.dataKey]]),delete v.value[V[n.dataKey]];else{v.value[V[n.dataKey]]=1;let{children:Ht}=V;if((Wt=n.childTableProps)!=null&&Wt.fetchFunction&&V.hasChildren)try{h.value.splice(ne+1,0,{childRow:!0,loadingRow:!0}),P.value=!0;const Nt=await((Qe=n.childTableProps)==null?void 0:Qe.fetchFunction(V));Ht=Nt==null?void 0:Nt.data}catch(Nt){console.error("🚀 ~ toggleRowExpand ~ error:",Nt)}finally{h.value.splice(ne+1,1),P.value=!1}if(ne>=0&&(Ht!=null&&Ht.length)){const Nt=Ht.flatMap(On=>[{childRowHeader:!0,header:On.groupHeader},...(On.groupItems??[]).map(be=>({childRow:!0,...be}))]);v.value[V[n.dataKey]]=Nt.length,h.value.splice(ne+1,0,...Nt)}else h.value.splice(ne+1,0,{childRow:!0,noDataRow:!0})}},Ut=V=>{n.includeCheckDisabledRows?A.value=V?lt():lt().filter(ne=>De(ne[n.dataKey])):A.value=V?at(lt()):[]},cn=(V,ne,Ve)=>{if(!ne.childRow&&!ne.childRowHeader&&!De(ne[n.dataKey])&&n.selectionType!=="none"){const qe=nt(ne[n.dataKey]);i("rowSelect",{originalEvent:V,data:ne,index:Ve}),n.selectionType==="checkbox"?qe?A.value=A.value.filter(Wt=>Wt[n.dataKey]!=ne[n.dataKey]):A.value=[...A.value,ne]:r.value=qe?void 0:ne}},dn=async()=>{var ne;const V=!X.value;if(!P.value){let Ve=0;for(const qe of h.value)((ne=qe.children)!=null&&ne.length||qe.hasChildren)&&await At(qe,Ve,V),Ve++}},tn=async(V,ne)=>{const Ve=V.target,qe=Ve.tagName.toLowerCase()==="button"?Ve:Ve.parentElement;i("toggleOption",ne);const Wt={...V,currentTarget:V.currentTarget??V.target};we(),await Pt(()=>{var Qe;qe!=null&&qe.classList.contains("option-button-active")?we():((Qe=ve.value)==null||Qe.toggle(Wt),we(),qe==null||qe.classList.add("option-button-active"))})},zt=async(V,ne,Ve)=>{var Wt,Qe,Ht,Nt;if(!Ve.preset)return;const qe=()=>ea(ne,Ve.field,!Hn(ne,Ve.field));if(Ve.preset.type==="checkbox"?(Qe=(Wt=Ve.preset).onCheck)==null||Qe.call(Wt,V,ne,qe):Ve.preset.type==="toggle"&&((Nt=(Ht=Ve.preset).onToggle)==null||Nt.call(Ht,V,ne,qe)),"confirmDialogProps"in Ve.preset){const{showWhen:On}=Kt(Ve.preset,ne[Ve.field],ne)??{};typeof On=="function"?Te.value[ne[n.dataKey]+Ve.field]=await On(ne,V):Te.value[ne[n.dataKey]+Ve.field]=!On||On==="active"&&V||On==="inactive"&&!V}},Rt=V=>V.draggable!==!1&&!V.childRow&&!V.childRowHeader&&n.reorderable&&!xe.value,kn=(V,ne,Ve)=>{if(ne.childRow||ne.childRowHeader)return;v.value={};const{dataTransfer:qe}=V;q.value=ne,w.value={item:ne,fromIndex:Ve},qe&&(qe.dropEffect="move",qe.effectAllowed="move",qe.setData("id",ne._id),qe.setData("index",Ve.toString()))},Yt=(V,ne)=>{var Ve,qe;if(V.preventDefault(),Rt(ne)){const Wt=V.target,Qe=Wt.tagName==="TR"?Wt:Wt.closest("tr");if(Qe==null||Qe.classList.add("bg-primary-50"),(Ve=Qe==null?void 0:Qe.nextElementSibling)==null||Ve.classList.remove("bg-primary-50"),(qe=Qe==null?void 0:Qe.previousElementSibling)==null||qe.classList.remove("bg-primary-50"),!Qe||!q.value)return;const Ht=ae.value.findIndex(On=>{var En;return On._id===((En=q.value)==null?void 0:En._id)}),Nt=ae.value.findIndex(On=>On._id===Qe.id);Ht!==-1&&Nt!==-1&&(w.value&&(w.value.toIndex=Nt),[ae.value[Ht],ae.value[Nt]]=[ae.value[Nt],ae.value[Ht]],Q())}},te=()=>{w.value&&i("rowReorder",w.value),q.value=void 0,$.value=!1,w.value=void 0},Q=()=>{h.value=[...ae.value]},we=()=>{const V=document.querySelectorAll(".option-button-active");V==null||V.forEach(ne=>{ne.classList.remove("option-button-active")})},je=()=>{Be.value=void 0,xe.value=void 0},st=()=>{de.value=1,D.value++},ie=()=>{ge.value=n.rows??10,de.value=1,D.value++},Ae=()=>{ie(),je()},He=async()=>{M.value++,D.value++,Ae(),n.lazy?await fn():ut()},ut=()=>{let V=[...m.value??[]];const ne=me.value,Ve=Object.entries(ne);try{V=Ve.length?V.filter(qe=>Ve.every(([Wt,{value:Qe,matchMode:Ht}])=>{const Nt=Hn(qe,Wt);switch(Ht){case"IN":return Array.isArray(Qe)?Qe.includes(Nt):!1;case"CONTAINS":return Nt&&Qe?Nt.toString().toLowerCase().includes(Qe):!1;case"EQUALS":return Nt?Nt.toString()===Qe.toString():!1;case"BETWEEN":return Array.isArray(Qe)&&Qe.length===2?!isNaN(Nt)&&(Qe[0]==null||Nt>=Qe[0])&&(Qe[1]==null||Nt<=Qe[1]):!1;case"DATE_BETWEEN":return Array.isArray(Qe)?+new Date(Nt)>=Qe[0]&&+new Date(Nt)<=Qe[1]:!1;default:return!1}})):m.value}catch(qe){console.error("🚀 ~ applyStaticFilter ~ error:",qe)}rt(V)},rt=V=>{var ne;try{h.value=(ne=se.value)!=null&&ne.length?V.filter(Ve=>{const qe=JSON.stringify(Ve);return new RegExp(se.value,"i").test(qe)||se.value.split(/\s+/).filter(Boolean).every(Wt=>new RegExp(Wt,"i").test(qe))}):V}catch(Ve){console.error("🚀 ~ applyStaticSearch ~ error:",Ve)}},gt=async V=>{ge.value=V.rows,de.value=V.page+1,n.lazy&&n.fetchFunction&&await fn(),Object.keys(v.value).forEach(ne=>{const Ve=h.value.findIndex(qe=>qe[n.dataKey]==ne);Ve>=0&&At(h.value[Ve],Ve,!0)})},Ft=(V,ne)=>{V!==Be.value&&(xe.value=void 0),Be.value=V,xe.value?xe.value==-1?(xe.value=void 0,Be.value=void 0):xe.value=-1:xe.value=1,i("sort",{sortOrder:xe.value,sortField:Be.value,originalEvent:ne,rows:ge.value}),st(),n.lazy&&n.fetchFunction?fn():on()},on=()=>{const V=[...h.value??[]],ne=new Map;if(!xe.value){h.value=m.value??[];return}for(const qe of V)ne.set(qe,Ce.resolveFieldData(qe,Be.value));const Ve=new Intl.Collator(void 0,{numeric:!0}).compare;V.sort((qe,Wt)=>{const Qe=ne.get(qe),Ht=ne.get(Wt);return Ce.sort(Qe,Ht,xe.value,Ve,-1)}),h.value=V},fn=async()=>{var V;try{C.value=!0;const ne=await((V=n.fetchFunction)==null?void 0:V.call(n,Z.value)),{data:Ve=[],totalRecords:qe=0}=(ne==null?void 0:ne.data)??{};h.value=Ve,ae.value=[...h.value],Pe.value=qe}catch(ne){console.error("🚀 ~ reFetch ~ error:",ne)}finally{C.value=!1,v.value={}}},gn=async()=>{var Ve;const V=go(Z.value);delete V.page,delete V.limit;const ne=await((Ve=n.fetchFunction)==null?void 0:Ve.call(n,V));if(ne instanceof Error)throw ne;return(ne==null?void 0:ne.data)??{data:[],totalRecords:0}},F=async V=>{if(n.tableName===V.tableName)try{C.value=!0;const{data:ne,totalRecords:Ve=0}=n.lazy?await gn():{totalRecords:(n.data??[]).length,data:n.data},qe=Qt(ne);A.value=n.includeCheckDisabledRows?ne??[]:at(ne,qe),Pe.value=Ve}finally{C.value=!1}},fe=(V,ne)=>l==null?void 0:l.headercell({props:n,context:{sortOrder:xe.value,customColumn:ne,sorted:Be.value&&Be.value===(V==null?void 0:V.field),sortable:V==null?void 0:V.sortable}}),Ne=V=>{(!V.tableName||V.tableName===n.tableName)&&Pt(()=>{R.value++,fn()})},at=(V,ne)=>(V??[]).filter(Ve=>!(ne??Y.value).includes(Ve[n.dataKey])),Qt=(V=[])=>n.disableAllRows?V.map(ne=>ne[n.dataKey]):V.filter(ne=>ne[n.disableKey]).map(ne=>ne[n.dataKey]),Jt=async({tableName:V,multiTableNames:ne,fileName:Ve,additionalTexts:qe})=>{var On;if(V!==n.tableName&&!(ne!=null&&ne.includes(n.tableName)))return;const Qe=S.value.filter(En=>En.visible!==!1).filter(En=>!En.excluded),Ht=Qe.map(En=>En.header??En.exportHeader??"-"),Nt=()=>Ve.trim().replace(/[^a-zA-Z0-9\s]/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/-+$/,"");try{if(Ye.off("data-table:download",B),V===n.tableName){f(!0,s.downloadingMessage);const{data:En}=n.fetchFunction?await gn():{data:n.data},be=Ey(En,Qe,s);if(ne!=null&&ne.length){Ye.emit("button-download:multi-tables",{table:{headers:Ht,data:be,tableName:V,tableTitle:n.tableTitle}});return}await ep({tables:[{headers:Ht,data:be,tableName:V,tableTitle:n.tableTitle}],fileName:Nt(),additionalTexts:qe})}}catch(En){console.error("🚀 ~ downloadExcel error:",En),d.removeAllGroups(),d.add({message:((On=a.value.excelToastErrorMessage)==null?void 0:On.replace("{fileName}",Ve))??"Data gagal diunduh.",error:En,group:"download"})}finally{f(!1),Ye.on("data-table:download",B)}};bt(async()=>{var V;n.fetchFunction&&(await fn(),Ue()),(V=n.selectedData)!=null&&V.length&&(A.value=n.selectedData),Je()}),Jo(()=>{Ge()}),Re(()=>n.columns,()=>{n.customColumn||(S.value=n.columns),y.value++}),Re(()=>n.data,V=>{h.value=V??[],m.value=V??[],Ye.emit("data-table:updated",{tableName:n.tableName,data:V}),Pe.value=V==null?void 0:V.length},{immediate:!0}),Re(Pe,V=>{K(V)}),Re(A,V=>{i("selectData",V),i("update:selectedData",V),Ye.emit("data-table:update-selected-data",{tableName:n.tableName,data:V})},{deep:!0});const Je=()=>{Ye.on("data-table:apply-filter",vt),Ye.on("search-table",Mn),Ye.on("search-by-scan-table",wn),Ye.on("data-table:clear-selected-data",Qi),Ye.on("data-table:select-all-record",Rr),Ye.on("data-table:download",B),Ye.on("data-table:import-excel-to-json",Ze)},Ge=()=>{Ye.off("data-table:update",Ne),Ye.off("data-table:apply-filter",vt),Ye.off("search-table",Mn),Ye.off("search-by-scan-table",wn),Ye.off("data-table:clear-selected-data",Qi),Ye.off("data-table:select-all-record",Rr),Ye.off("data-table:download",B),Ye.off("data-table:import-excel-to-json",Ze)},vt=V=>{V.tableName===n.tableName&&(me.value=V.filter,He())},Mn=V=>{V.tableName===n.tableName&&(se.value=V.search,He())},wn=V=>{V.tableName===n.tableName&&(Ie.value=V.tag,He())},Rr=V=>{V.tableName===n.tableName&&F(V)},Qi=V=>{V.tableName===n.tableName&&(A.value=[])},B=V=>{var ne;(V.tableName===n.tableName||(ne=V.multiTableNames)!=null&&ne.includes(n.tableName))&&Jt(V)},j=V=>{V.code.includes("Digit")||V.code.includes("Numpad")||["ArrowLeft","ArrowRight","Backspace","Delete"].includes(V.code)||V.preventDefault()},K=V=>{const ne=n.includeCheckDisabledRows?0:(Y.value.length||n.totalDisabledRows)??0,Ve={total:(V??Pe.value??0)-ne,tableName:n.tableName};Ye.emit("data-table:update-total-record",Ve)},Ue=()=>{Ye.on("data-table:update",Ne)},Ze=V=>{V.tableName===n.tableName&&(h.value=V.data,ae.value=[...h.value],Pe.value=V.data.length)},Kt=(V,ne,Ve)=>typeof(V==null?void 0:V.confirmDialogProps)=="function"?V==null?void 0:V.confirmDialogProps(ne,Ve):V==null?void 0:V.confirmDialogProps;return(V,ne)=>{var Ve,qe,Wt;return g(),T("div",it(Ot((Ve=x(l))==null?void 0:Ve.root)),[E("div",it(Ot((qe=x(l))==null?void 0:qe.tablewrapper)),[I(x(NL),O({"auto-hide":!1},(Wt=x(l))==null?void 0:Wt.scrollheightwrapper({props:n}),{class:"custom-scrollbar"}),{default:z(()=>{var Qe,Ht,Nt,On,En;return[(g(),T("table",O({id:x(p)},(Qe=x(l))==null?void 0:Qe.table,{key:M.value,ref:b.value}),[E("thead",it(Ot(x(l).thead)),[E("tr",it(Ot(x(l).headerrow)),[V.reorderable&&!xe.value?(g(),T("th",O({key:0},x(l).headercellreorderable,{class:fe().class}),null,16)):N("",!0),V.selectionType==="checkbox"?(g(),T("th",O({key:1},x(l).headercellcheckbox,{class:fe().class}),[I(fs,O((Ht=x(l))==null?void 0:Ht.headercheckbox({context:{isSelectedAll:U.value}}),{"model-value":U.value,"onUpdate:modelValue":ne[0]||(ne[0]=be=>Ut(!!be)),binary:""}),null,16,["model-value"])],16)):N("",!0),V.treeTable?(g(),T("th",O({key:2},x(l).headertoggler,{class:fe().class}),[I(We,O({onClick:dn},x(l).headertogglerbutton({context:{isExpandedAll:X.value}}),{icon:"arrow-down",text:""}),null,16)],16)):N("",!0),(g(!0),T(le,null,_e(S.value,be=>(g(),T("th",O({key:be.field,class:[be.headerClass,be.class],ref_for:!0},fe(be),{onClick:Tn=>be.sortable?Ft(be.field,Tn):null}),[E("span",O({ref_for:!0},x(l).headercellcontent),[E("span",HD,[ht(_(be.header)+" ",1),be.info?(g(),L(Me,{key:0,info:be.info,severity:be.infoSeverity,class:"w-[10px] h-[10px]",icon:"info"},null,8,["info","severity"])):N("",!0)]),be.sortable?(g(),L(Me,{key:0,icon:!Be.value||Be.value!=be.field?"arrow-up-down":xe.value==1?"sort-asc":"sort-desc",class:"text-base"},null,8,["icon"])):N("",!0)],16)],16,jD))),128)),n.customColumn||n.useOption?(g(),T("th",O({key:3},fe(void 0,n.customColumn),{id:`column-visibility-toggle-${x(p)}`,onClick:ne[1]||(ne[1]=(...be)=>{var Tn,Nr;return((Tn=J.value)==null?void 0:Tn.toggleMenu)&&((Nr=J.value)==null?void 0:Nr.toggleMenu(...be))})}),[n.customColumn?(g(),L(Me,O({key:0},x(l).columnvisibilityicon,{icon:"ellipsis-h","tooltip-pos":"left"}),null,16)):N("",!0)],16,UD)):N("",!0)],16)],16),E("tbody",it(Ot((Nt=x(l))==null?void 0:Nt.tbody)),[ke.value?(g(),T("tr",KD,[E("td",O({colspan:Se.value},(On=x(l))==null?void 0:On.bodycell),[(g(!0),T(le,null,_e(x(l).invisiblelottiewrapper?2:1,be=>(g(),T("div",O({key:be,ref_for:!0},be===1?x(l).loadingtablewrapper:x(l).invisiblelottiewrapper),[I(Kl,O({animation:"loading-table",ref_for:!0},x(l).loadingtablelottie),null,16)],16))),128))],16,WD)])):Fe.value?(g(),T("tr",tR,[E("td",O({colspan:Se.value},(En=x(l))==null?void 0:En.bodycell),[(g(!0),T(le,null,_e(x(l).invisiblelottiewrapper?2:1,be=>(g(),T("div",O({key:be,ref_for:!0},be===1?x(l).nodatalottiewrapper:x(l).invisiblelottiewrapper),[I(Kl,O({animation:"no-data",ref_for:!0},x(l).nodatalottie),null,16),a.value.emptyTableMessage?(g(),T("span",O({key:0,ref_for:!0},x(l).nodatamessage),_(a.value.emptyTableMessage),17)):N("",!0)],16))),128))],16,nR)])):(g(!0),T(le,{key:1},_e(H.value,(be,Tn)=>{var Nr,mf,$e,ct,Bt,nn,In,Ii,mr,js,di;return g(),T("tr",O({id:be._id,key:`${Tn}-${be[V.dataKey]}`,draggable:Rt(be),ref_for:!0},(Nr=x(l))==null?void 0:Nr.bodyrow({context:{highlighted:be[V.highlightKey??""],selected:nt(be[V.dataKey]),disabled:De(be[V.dataKey]),draggable:Rt(be),dragging:$.value},props:n}),{onClick:Oe=>cn(Oe,be,Tn),onDblclick:Oe=>{var gr;return V.treeTable&&((gr=be.children)!=null&&gr.length||be.hasChildren)?At(be,Tn):null},onDrag:ne[10]||(ne[10]=Oe=>$.value=!0),onDragenter:xt(Oe=>Yt(Oe,be),["prevent"]),onDragleave:ne[11]||(ne[11]=xt(()=>{},["prevent"])),onDragover:ne[12]||(ne[12]=xt(()=>{},["prevent"])),onDragstart:Oe=>kn(Oe,be,Tn),onDrop:te}),[V.reorderable&&!xe.value?(g(),T("td",O({key:0,ref_for:!0},(mf=x(l))==null?void 0:mf.bodycell),[!be.childRow&&!be.childRowHeader?(g(),L(Me,{key:0,class:"draggableicon",icon:"dragable-menu"})):N("",!0)],16)):N("",!0),V.selectionType==="checkbox"?(g(),T("td",O({key:1,ref_for:!0},($e=x(l))==null?void 0:$e.bodycell,{onClick:ne[3]||(ne[3]=xt(()=>{},["stop"]))}),[!be.childRow&&!be.childRowHeader?(g(),L(fs,O({key:0,ref_for:!0},(ct=x(l))==null?void 0:ct.rowcheckbox,{modelValue:A.value,"onUpdate:modelValue":ne[2]||(ne[2]=Oe=>A.value=Oe),binary:!1,disabled:De(be[V.dataKey]),value:be}),null,16,["modelValue","disabled","value"])):N("",!0)],16)):N("",!0),V.treeTable?(g(),T("td",O({key:2,ref_for:!0},(Bt=x(l))==null?void 0:Bt.bodycell,{onClick:Oe=>{(be.childRow||be.childRowHeader)&&Oe.stopPropagation()}}),[(nn=be.children)!=null&&nn.length||be.hasChildren?(g(),L(We,O({key:0,onClick:xt(Oe=>At(be,Tn),["stop"]),ref_for:!0},x(l).rowtogglerbutton({context:{isRowExpanded:he(be[V.dataKey])}}),{icon:"arrow-down",text:""}),null,16,["onClick"])):N("",!0)],16,XD)):N("",!0),(()=>{var Oe;return be.childRowHeader&&((Oe=n.childTableProps)==null?void 0:Oe.useColumnsHeader)})()?(g(!0),T(le,{key:3},_e(ue.value,Oe=>{var gr,_o;return g(),T("td",{key:Oe.header,class:pe([(gr=x(l))==null?void 0:gr.bodycell.class,"font-semibold text-xs"]),colspan:Oe.colspan??((_o=Oe.parentColumnsFields)==null?void 0:_o.length),onClick:ne[4]||(ne[4]=xt(()=>{},["stop"]))},_(Oe.header),11,GD)}),128)):be.childRowHeader?(g(),T("td",O({key:4,ref_for:!0},x(l).childrowheader,{class:(In=x(l))==null?void 0:In.bodycell.class,colspan:n.columns.length+1,onClick:ne[5]||(ne[5]=xt(()=>{},["stop"]))}),_(be.header),17,ZD)):be.loadingRow?(g(),T("td",{key:5,class:pe((Ii=x(l))==null?void 0:Ii.bodycell.class),colspan:n.columns.length+1,onClick:ne[6]||(ne[6]=xt(()=>{},["stop"]))},[E("div",O({ref_for:!0},x(l).loadingtablewrapper),[I(Kl,O({animation:"loading-table",ref_for:!0},x(l).loadingtablelottie),null,16)],16)],10,_D)):be.noDataRow?(g(),T("td",{key:6,class:pe((mr=x(l))==null?void 0:mr.bodycell.class),colspan:n.columns.length+1,onClick:ne[7]||(ne[7]=xt(()=>{},["stop"]))},[E("div",O({ref_for:!0},x(l).nodatalottiewrapper),[I(Kl,O({animation:"no-data",ref_for:!0},x(l).nodatalottie),null,16),a.value.emptyTableMessage?(g(),T("span",O({key:0,ref_for:!0},x(l).nodatamessage),_(a.value.emptyTableMessage),17)):N("",!0)],16)],10,JD)):(g(),T(le,{key:7},[(g(!0),T(le,null,_e(be.childRow?ue.value:S.value,Oe=>{var gr,_o,zu,gf,vf,yf,bf,Hs,Fu,$i,Af,Va,wt,ju,Vn,en,Us,Br;return g(),T("td",O({key:Oe.field,class:[{"!py-0":Oe.editable,"!px-0":((gr=Oe.preset)==null?void 0:gr.type)==="multirow"},typeof Oe.bodyClass=="function"?Oe.bodyClass(be):Oe.bodyClass,Oe.class],colspan:Oe.colspan??((_o=Oe.parentColumnsFields)==null?void 0:_o.length),ref_for:!0},(zu=x(l))==null?void 0:zu.bodycell),[((gf=Oe.preset)==null?void 0:gf.type)==="toggle"||((vf=Oe.preset)==null?void 0:vf.type)==="checkbox"?(g(),T(le,{key:0},[((yf=Oe.preset)==null?void 0:yf.type)==="toggle"?(g(),L(N0,{key:0,disabled:De(be[V.dataKey])||(typeof((bf=Oe.preset)==null?void 0:bf.disabled)=="function"?(Hs=Oe.preset)==null?void 0:Hs.disabled(be):(Fu=Oe.preset)==null?void 0:Fu.disabled),"input-id":be[V.dataKey],"model-value":x(Hn)(be,Oe.field),onClick:ne[8]||(ne[8]=xt(()=>{},["stop"])),"onUpdate:modelValue":Sn=>{x(ea)(be,Oe.field,Sn),zt(Sn,be,Oe)}},null,8,["disabled","input-id","model-value","onUpdate:modelValue"])):N("",!0),(($i=Oe.preset)==null?void 0:$i.type)==="checkbox"?(g(),L(fs,{key:1,disabled:De(be[V.dataKey])||(typeof((Af=Oe.preset)==null?void 0:Af.disabled)=="function"?(Va=Oe.preset)==null?void 0:Va.disabled(be):(wt=Oe.preset)==null?void 0:wt.disabled),"input-id":be[V.dataKey],"model-value":x(Hn)(be,Oe.field),onClick:ne[9]||(ne[9]=xt(()=>{},["stop"])),"onUpdate:modelValue":Sn=>{x(ea)(be,Oe.field,!!Sn),zt(!!Sn,be,Oe)},binary:""},null,8,["disabled","input-id","model-value","onUpdate:modelValue"])):N("",!0),(ju=Oe.preset)!=null&&ju.confirmDialogProps?(g(),L(cr,O({key:2,list:[be],visible:!!Te.value[be[V.dataKey]+Oe.field],onClose:()=>{var oi,ze,ot;const Sn=()=>x(ea)(be,Oe.field,!x(Hn)(be,Oe.field));((oi=Kt(Oe.preset,be[Oe.field],be))==null?void 0:oi.actionable)==!1&&"onConfirm"in Oe.preset?(ot=(ze=Oe.preset).onConfirm)==null||ot.call(ze,be[Oe.field],be,Sn):Sn()},onConfirm:Sn=>{var oi,ze;return(ze=(oi=Oe.preset)==null?void 0:oi.onConfirm)==null?void 0:ze.call(oi,be[Oe.field],be,()=>x(ea)(be,Oe.field,!x(Hn)(be,Oe.field)))},"onUpdate:visible":Sn=>Te.value[be[V.dataKey]+Oe.field]=Sn,actionable:"",ref_for:!0},Kt(Oe.preset,be[Oe.field],be)),null,16,["list","visible","onClose","onConfirm","onUpdate:visible"])):N("",!0)],64)):((Vn=Oe.preset)==null?void 0:Vn.type)==="multirow"?(g(),L(zD,{key:1,attributes:((Us=(en=Oe.preset)==null?void 0:en.fieldAttributes)==null?void 0:Us.call(en,be))??[]},null,8,["attributes"])):Oe.editable?(g(),T("span",O({key:2,ref_for:!0},x(l).celleditableelement,{contenteditable:Oe.editable,onBlur:Sn=>{V.$emit("cellEdited",{item:be,field:Oe.field,index:Tn,value:Sn.target.innerText})},onKeypress:Sn=>{Oe.numberInputOnly&&j(Sn)}}),_(x(Hn)(be,Oe.field)||"-"),17,QD)):Oe.bodyComponent||Oe.bodyClass||Oe.bodyTemplate||Oe.dateFormatOptions?(g(),T(le,{key:3},[Oe.bodyComponent?(g(),L(yt(Oe.bodyComponent(be,Tn).component),O({key:0,modelValue:Oe.bodyComponent(be,Tn).model,"onUpdate:modelValue":Sn=>Oe.bodyComponent(be,Tn).model=Sn,disabled:Oe.bodyComponent(be,Tn).disabled,ref_for:!0},Oe.bodyComponent(be,Tn).props,Yo(Oe.bodyComponent(be,Tn).events?Oe.bodyComponent(be,Tn).events:{}),{onChange:Sn=>{var oi,ze;return(ze=(oi=Oe.bodyComponent(be,Tn)).onChange)==null?void 0:ze.call(oi,be)},onClick:Sn=>{Oe.bodyComponent(be,Tn).stop!==!1&&Sn.stopPropagation()},"onUpdate:modelValue":Sn=>{var oi,ze;return(ze=(oi=Oe.bodyComponent(be,Tn)).onChange)==null?void 0:ze.call(oi,be)}}),null,16,["modelValue","onUpdate:modelValue","disabled","onChange","onClick"])):(g(),T("span",eR,[Oe.bodyTemplate?(g(),T(le,{key:0},[ht(_(((Br=Oe.bodyTemplate)==null?void 0:Br.call(Oe,be,Tn))||"-"),1)],64)):Oe.dateFormatOptions?(g(),T(le,{key:1},[ht(_(x(Zu)(new Date(x(Hn)(be,Oe.field)),Oe.dateFormatOptions)),1)],64)):(g(),T(le,{key:2},[ht(_(x(Hn)(be,Oe.field)||"-"),1)],64))]))],64)):(g(),T(le,{key:4},[ht(_(x(Hn)(be,Oe.field)??"-"),1)],64))],16,YD)}),128)),(()=>{var Oe;return(V.useOption||J.value)&&!be.childRow||be.childRow&&((Oe=V.childTableProps)==null?void 0:Oe.useOption)})()?(g(),T("td",O({key:0,ref_for:!0,ref_key:"rowSingleActionCell",ref:k},(js=x(l))==null?void 0:js.rowsingleactioncell({props:n,context:{selected:nt(be[V.dataKey]),highlighted:be[V.highlightKey??""]}}),{class:x(l).bodycell.class}),[V.useOption||(di=V.childTableProps)!=null&&di.useOption?(g(),T("div",O({key:0,ref_for:!0},x(l).singleactionwrapper),[I(We,O({id:"button-action-"+be[n.dataKey],ref_for:!0},x(l).singleactionbutton({props:n}),{disabled:V.disableAllRows,onClick:xt(Oe=>tn(Oe,be),["stop"]),icon:"ellipsis-h",outlined:"",size:"small","tooltip-pos":"left",type:"button"}),null,16,["id","disabled","onClick"])],16)):N("",!0)],16)):N("",!0)],64))],16,qD)}),128))],16)],16,FD))]}),_:1},16)],16),V.usePaginator?ft((g(),L(x(Eh),O({key:D.value,rows:ge.value,"onUpdate:rows":ne[13]||(ne[13]=Qe=>ge.value=Qe)},x(l).paginator({context:{totalRecords:Pe.value}}),{"rows-per-page-options":u,"total-records":Pe.value,onPage:gt}),{firstpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-double-arrow-left"})]),lastpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-double-arrow-right"})]),prevpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-arrow-left"})]),nextpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-arrow-right"})]),_:1},16,["rows","total-records"])),[[Zn,!ke.value]]):N("",!0),I(Zp,{id:"single-action-menu",ref_key:"optionMenu",ref:ve,model:V.options,onFocus:x(BL),"append-to":"body","auto-z-index":"",popup:""},null,8,["model","onFocus"]),n.customColumn?(g(),L(gL,{key:y.value,ref_key:"customColumn",ref:J,"visible-columns":S.value,"onUpdate:visibleColumns":ne[14]||(ne[14]=Qe=>S.value=Qe),"default-columns":V.columns.filter(Qe=>Qe.visible!==!1),"table-id":x(p)},null,8,["visible-columns","default-columns","table-id"])):N("",!0),I(aa,{group:"download"})],16)}}}),FA=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},Ph=ce("DataTable",FA(iR,[["__scopeId","data-v-96b7926f"]])),jA=ce("Form",ye({__name:"Form",props:{buttonsTemplate:{},disableSubmit:{type:Boolean},cancelBtnLabel:{default:"Batal"},clearBtnLabel:{default:"Bersihkan Field"},columnPerRow:{},hideFooter:{type:Boolean},hideStayCheckbox:{type:Boolean},invalid:{type:Boolean},resetAfterSubmit:{type:Boolean,default:!0},saveBtnLabel:{default:"Simpan"},submitBtnLabel:{default:"Simpan"},stayCheckboxLabel:{default:"Tetap di halaman ini"},validatorMessage:{default:"Please input all required field!"},validateOnSave:{type:Boolean,default:!1},cancelBtnSeverity:{default:"secondary"},saveBtnSeverity:{default:"success"},submitBtnSeverity:{default:"success"}},emits:["cancel","clear","save","submit"],setup(t,{expose:e,emit:n}){const i=t,r=n;bt(()=>{if(C.value){const ae=i.columnPerRow??1;C.value.style.gridTemplateColumns=`repeat(${ae}, minmax(0, 1fr))`,R()}});const o=dt("preset",{}).form,{handleSubmit:s,values:a,resetForm:l,errors:u,resetField:c,setValues:d,setFieldValue:f,setErrors:p}=Tp(),h=oe(!1),m=re(),v=oe(!1),S=oe(!1),b=oe(0),k=re(),A=oe(!1),w=oe(!1),y=oe(!1),C=re(null),P=re(null);Ks("isSubmitting",A);const R=()=>{var ae;if(k.value){const me=(ae=k.value)==null?void 0:ae.offsetHeight;P.value&&(P.value.style.height=`calc(100% + ${me+20}px)`)}},M=()=>{A.value=!0,y.value=!0,S.value||(v.value=!0)},D=()=>{A.value=!0,w.value=!0,i.validateOnSave?(S.value||(v.value=!0),$()):q()},$=s(ae=>{if(!i.invalid){const me=ve(ae),se={stayAfterSubmit:h.value,formValues:me};w.value?r("save",se):r("submit",se),v.value=!1,w.value=!1,i.resetAfterSubmit&&(b.value+=1,l())}A.value=!1},()=>{A.value=!1}),q=()=>{const ae=ve(a),me={stayAfterSubmit:h.value,formValues:ae};r("save",me),A.value=!1},J=()=>{l(),b.value++,r("clear"),v.value=!1,y.value=!1},ve=ae=>{const me=ae,se=Object.keys(me);for(const Ie of se)typeof me[Ie]=="string"&&(me[Ie]=me[Ie].trim());return me};return Re(a,()=>{y.value=!1},{deep:!0}),e({stayAfterSubmit:h,submit:$,onSubmitClicked:M,onSaveClicked:D,showValidator:v,formElement:m,clearField:J,resetField:c,errors:u,setOuterFieldsWrapperHeight:R,setValues:d,setFieldValue:f,setErrors:p,values:a,isSubmitClicked:y}),(ae,me)=>{var se,Ie,Be,xe,de,ge,Pe,Te,ue,Se,Z,X,U,Y,ke;return g(),T("form",O({ref_key:"formElement",ref:m},(se=x(o))==null?void 0:se.root({props:i}),{onInput:me[2]||(me[2]=Fe=>v.value=!1),onSubmit:me[3]||(me[3]=xt((...Fe)=>x($)&&x($)(...Fe),["prevent"]))}),[E("div",{ref_key:"outerFieldsWrapper",ref:P},[E("div",O({ref_key:"fieldsWrapper",ref:C},(Ie=x(o))==null?void 0:Ie["fields-wrapper"]),[ee(ae.$slots,"fields",{key:b.value,formValues:x(a)})],16)],512),ae.hideFooter?N("",!0):(g(),T("div",O({key:0,ref_key:"footer",ref:k},(Be=x(o))==null?void 0:Be.footer),[ae.hideStayCheckbox?N("",!0):(g(),T("div",it(O({key:0},(xe=x(o))==null?void 0:xe.staycheckbox)),[I(fs,{modelValue:h.value,"onUpdate:modelValue":me[0]||(me[0]=Fe=>h.value=Fe),label:ae.stayCheckboxLabel},null,8,["modelValue","label"])],16)),E("div",O({id:"footer-actions-wrapper"},(de=x(o))==null?void 0:de["action-buttons"]),[ft(I(Rn,O((ge=x(o))==null?void 0:ge["validator-message"],{message:ae.validatorMessage}),null,16,["message"]),[[Zn,v.value||i.invalid]]),E("div",it(Ot((Pe=x(o))==null?void 0:Pe["button-wrapper"])),[(Te=i.buttonsTemplate)!=null&&Te.includes("cancel")?(g(),L(We,O({key:0},(ue=x(o))==null?void 0:ue["cancel-button"],{label:ae.cancelBtnLabel,severity:ae.cancelBtnSeverity,onClick:me[1]||(me[1]=Fe=>ae.$emit("cancel")),"data-test":"cancel-button",text:"",type:"button"}),null,16,["label","severity"])):N("",!0),(Se=i.buttonsTemplate)!=null&&Se.includes("clear")?(g(),L(We,O({key:1},(Z=x(o))==null?void 0:Z["clear-button"],{label:ae.clearBtnLabel,onClick:J,text:"",type:"button"}),null,16,["label"])):N("",!0),(X=i.buttonsTemplate)!=null&&X.includes("save")?(g(),L(We,O({key:2},(U=x(o))==null?void 0:U["save-button"],{label:ae.saveBtnLabel,severity:ae.saveBtnSeverity,onClick:D,outlined:"",type:"button"}),null,16,["label","severity"])):N("",!0),(Y=i.buttonsTemplate)!=null&&Y.includes("submit")?(g(),L(We,O({key:3},(ke=x(o))==null?void 0:ke["submit-button"],{disabled:ae.disableSubmit,label:ae.submitBtnLabel,severity:ae.submitBtnSeverity,onClick:M,type:"submit"}),null,16,["disabled","label","severity"])):N("",!0)],16)],16)],16))],16)}}})),Ih=ce("DialogForm",ye({__name:"DialogForm",props:{buttonsTemplate:{},header:{},visible:{type:Boolean},asideRightWidth:{default:260},class:{},cancelBtnLabel:{},clearBtnLabel:{},closable:{type:Boolean,default:!0},closeOnSubmit:{type:Boolean,default:!0},contentClass:{},dateHeader:{},headerIcon:{},invalid:{type:Boolean},resetAfterSubmit:{type:Boolean,default:!0},severity:{},showStayCheckbox:{type:Boolean,default:void 0},stayCheckboxLabel:{},submitBtnLabel:{},validatorMessage:{},validationFunction:{},width:{default:"small"},disableSubmit:{type:Boolean},columnPerRow:{default:1},hideFooter:{type:Boolean},hideStayCheckbox:{type:Boolean},saveBtnLabel:{},validateOnSave:{type:Boolean},cancelBtnSeverity:{},saveBtnSeverity:{},submitBtnSeverity:{}},emits:["clear","close","hide","show","submit","update:visible"],setup(t,{expose:e,emit:n}){const i=t,r=n,o=ja(),{locale:s}=_t("DialogForm"),a=dt("preset",{}).dialog,l=dt("preset",{}).dialogform,u=re(),c=re(),d=oe(0),f=oe(!1),p=oe(!1),h=re({stayAfterSubmit:!1,formValues:{}}),m=W(()=>{const w=o["aside-right"]&&p.value?i.asideRightWidth:0;return`calc(${{small:400,medium:500,large:572,"semi-xlarge":600,xlarge:800}[i.width]}px + ${w}px)`}),v=()=>{r("update:visible",!1),r("close")},S=()=>{u.value&&!i.invalid&&!i.validatorMessage&&(u.value.onSubmitClicked(),u.value.submit())},b=()=>{u.value&&u.value.clearField(),r("clear")},k=async w=>{i.validationFunction&&await i.validationFunction(w.formValues),!i.invalid&&!i.validatorMessage&&(h.value=w,o.confirm?f.value=!0:A())},A=async w=>{const{stayAfterSubmit:y}=h.value;if(!y&&i.closeOnSubmit&&r("update:visible",!1),o.confirm)try{await(w==null?void 0:w(h.value))}catch(C){console.error(C)}else r("submit",h.value);i.resetAfterSubmit&&b()};return e({form:u,clearField:b,setValues:w=>{var y;(y=u.value)==null||y.setValues(w)},setFieldValue:(w,y,C)=>{var P;(P=u.value)==null||P.setFieldValue(w,y,C)},setErrors:w=>{var y;(y=u.value)==null||y.setErrors(w)}}),(w,y)=>{var C,P,R,M;return g(),L(x(wl),O({ref_key:"dialogForm",ref:c},(C=x(l))==null?void 0:C.root,{class:i.class,closable:w.closable,draggable:!1,header:w.header,pt:{root:{class:[...(P=x(a))==null?void 0:P.root({state:{}}).class,...(R=x(l))==null?void 0:R.root.class],style:(M=x(l))==null?void 0:M.root.style(m.value)}},visible:w.visible,onHide:y[3]||(y[3]=D=>r("hide")),onShow:y[4]||(y[4]=D=>r("show")),"onUpdate:visible":y[5]||(y[5]=D=>r("update:visible",!!D)),modal:""}),{container:z(()=>{var D,$,q,J,ve,ae,me,se,Ie,Be;return[E("div",it(Ot((D=x(l))==null?void 0:D.container(p.value))),[E("section",O(($=x(l))==null?void 0:$.mainsection,{id:"main"}),[E("div",it(Ot((q=x(l))==null?void 0:q.header)),[ee(w.$slots,"header",{},()=>{var xe,de,ge,Pe;return[w.headerIcon?(g(),L(Me,O({key:0},(xe=x(l))==null?void 0:xe.headericon,{icon:w.headerIcon,severity:w.severity,"aria-label":"Header Icon"}),null,16,["icon","severity"])):N("",!0),E("h3",it(Ot((de=x(l))==null?void 0:de.headertitle)),_(w.header),17),w.$slots["aside-right"]?(g(),L(We,O({key:1},(ge=x(l))==null?void 0:ge.expandasidebutton,{label:p.value?x(s).asideRightExpandedButtonLabel:x(s).asideRightCollapsedButtonLabel,onClick:y[0]||(y[0]=Te=>p.value=!p.value),text:""}),null,16,["label"])):N("",!0),w.closable?(g(),L(We,O({key:2,onClick:v},(Pe=x(l))==null?void 0:Pe.closedialog,{icon:"close","icon-class":"w-[22px] h-[22px]",rounded:"",severity:"secondary",text:""}),null,16)):N("",!0)]})],16),I(jA,O((J=x(l))==null?void 0:J.form,{ref_key:"form",ref:u,"buttons-template":w.buttonsTemplate,"column-per-row":w.columnPerRow,"reset-after-submit":w.resetAfterSubmit,onSubmit:k,"hide-footer":""}),{fields:z(({formValues:xe})=>[ee(w.$slots,"fields",{key:d.value,formValues:xe})]),_:3},16,["buttons-template","column-per-row","reset-after-submit"]),ee(w.$slots,"confirm",{hide:()=>f.value=!1,submit:A,visible:f.value}),E("div",it(Ot((ve=x(l))==null?void 0:ve.footer)),[w.showStayCheckbox?(g(),L(fs,O({key:0},(ae=x(l))==null?void 0:ae.staycheckbox,{label:w.stayCheckboxLabel??x(s).stayCheckboxLabel,"model-value":(me=u.value)==null?void 0:me.stayAfterSubmit,"onUpdate:modelValue":y[1]||(y[1]=xe=>u.value&&(u.value.stayAfterSubmit=xe))}),null,16,["label","model-value"])):N("",!0),ft(I(Rn,O((se=x(l))==null?void 0:se.validatormessage,{format:!1,message:w.validatorMessage}),null,16,["message"]),[[Zn,w.invalid&&w.validatorMessage]]),i.buttonsTemplate.length?(g(),T("div",it(O({key:1},(Ie=x(l))==null?void 0:Ie.footerbutton)),[ee(w.$slots,"actionButtons",{submit:S},()=>{var xe,de,ge,Pe,Te,ue;return[(xe=i.buttonsTemplate)!=null&&xe.includes("cancel")?(g(),L(We,O({key:0},(de=x(l))==null?void 0:de.cancelbtn,{label:w.cancelBtnLabel??x(s).cancelBtnLabel,onClick:y[2]||(y[2]=Se=>(r("close"),r("update:visible",!1))),severity:"dark",text:""}),null,16,["label"])):N("",!0),(ge=i.buttonsTemplate)!=null&&ge.includes("clear")?(g(),L(We,O({key:1},(Pe=x(l))==null?void 0:Pe.clearfield,{label:w.clearBtnLabel??x(s).clearBtnLabel,onClick:b,class:"whitespace-nowrap",text:""}),null,16,["label"])):N("",!0),(Te=i.buttonsTemplate)!=null&&Te.includes("submit")?(g(),L(We,O({key:2},(ue=x(l))==null?void 0:ue.savesubmitbutton,{label:w.submitBtnLabel??x(s).submitBtnLabel,severity:i.severity==="primary"?void 0:i.severity??"success",onClick:S}),null,16,["label","severity"])):N("",!0)]})],16)):N("",!0)],16)],16),w.$slots["aside-right"]?(g(),T("aside",it(O({key:0},(Be=x(l))==null?void 0:Be.asidesection(p.value,w.asideRightWidth))),[ee(w.$slots,"aside-right")],16)):N("",!0)],16)]}),_:3},16,["class","closable","header","pt","visible"])}}}));var HA={name:"PlusIcon",extends:bn},rR=E("path",{d:"M7.67742 6.32258V0.677419C7.67742 0.497757 7.60605 0.325452 7.47901 0.198411C7.35197 0.0713707 7.17966 0 7 0C6.82034 0 6.64803 0.0713707 6.52099 0.198411C6.39395 0.325452 6.32258 0.497757 6.32258 0.677419V6.32258H0.677419C0.497757 6.32258 0.325452 6.39395 0.198411 6.52099C0.0713707 6.64803 0 6.82034 0 7C0 7.17966 0.0713707 7.35197 0.198411 7.47901C0.325452 7.60605 0.497757 7.67742 0.677419 7.67742H6.32258V13.3226C6.32492 13.5015 6.39704 13.6725 6.52358 13.799C6.65012 13.9255 6.82106 13.9977 7 14C7.17966 14 7.35197 13.9286 7.47901 13.8016C7.60605 13.6745 7.67742 13.5022 7.67742 13.3226V7.67742H13.3226C13.5022 7.67742 13.6745 7.60605 13.8016 7.47901C13.9286 7.35197 14 7.17966 14 7C13.9977 6.82106 13.9255 6.65012 13.799 6.52358C13.6725 6.39704 13.5015 6.32492 13.3226 6.32258H7.67742Z",fill:"currentColor"},null,-1),oR=[rR];function sR(t,e,n,i,r,o){return g(),T("svg",O({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),oR,16)}HA.render=sR;var UA={name:"UploadIcon",extends:bn},aR=E("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z",fill:"currentColor"},null,-1),lR=[aR];function uR(t,e,n,i,r,o){return g(),T("svg",O({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),lR,16)}UA.render=uR;var cR={root:function(e){var n=e.props;return"p-message p-component p-message-"+n.severity},wrapper:"p-message-wrapper",icon:"p-message-icon",text:"p-message-text",closeButton:"p-message-close p-link",closeIcon:"p-message-close-icon"},dR=Xt.extend({name:"message",classes:cR}),fR={name:"BaseMessage",extends:It,props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:void 0},closeIcon:{type:String,default:void 0},closeButtonProps:{type:null,default:null}},style:dR,provide:function(){return{$parentInstance:this}}},KA={name:"Message",extends:fR,inheritAttrs:!1,emits:["close","life-end"],timeout:null,data:function(){return{visible:!0}},watch:{sticky:function(e){e||this.closeAfterDelay()}},mounted:function(){this.sticky||this.closeAfterDelay()},methods:{close:function(e){this.visible=!1,this.$emit("close",e)},closeAfterDelay:function(){var e=this;setTimeout(function(){e.visible=!1,e.$emit("life-end")},this.life)}},computed:{iconComponent:function(){return{info:Pl,success:Co,warn:El,error:sa}[this.severity]},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{ripple:gi},components:{TimesIcon:vr,InfoCircleIcon:Pl,CheckIcon:Co,ExclamationTriangleIcon:El,TimesCircleIcon:sa}};function Wl(t){"@babel/helpers - typeof";return Wl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wl(t)}function WA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function ms(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?WA(Object(n),!0).forEach(function(i){pR(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):WA(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function pR(t,e,n){return e=hR(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hR(t){var e=mR(t,"string");return Wl(e)=="symbol"?e:String(e)}function mR(t,e){if(Wl(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Wl(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var gR=["aria-label"];function vR(t,e,n,i,r,o){var s=et("TimesIcon"),a=an("ripple");return g(),L(Vr,O({name:"p-message",appear:""},t.ptmi("transition")),{default:z(function(){return[ft(E("div",O({class:t.cx("root"),role:"alert","aria-live":"assertive","aria-atomic":"true"},t.ptm("root")),[t.$slots.container?ee(t.$slots,"container",{key:0,onClose:o.close,closeCallback:o.close}):(g(),T("div",O({key:1,class:t.cx("wrapper")},t.ptm("wrapper")),[ee(t.$slots,"messageicon",{class:"p-message-icon"},function(){return[(g(),L(yt(t.icon?"span":o.iconComponent),O({class:[t.cx("icon"),t.icon]},t.ptm("icon")),null,16,["class"]))]}),E("div",O({class:["p-message-text",t.cx("text")]},t.ptm("text")),[ee(t.$slots,"default")],16),t.closable?ft((g(),T("button",O({key:0,class:t.cx("closeButton"),"aria-label":o.closeAriaLabel,type:"button",onClick:e[0]||(e[0]=function(l){return o.close(l)})},ms(ms(ms({},t.closeButtonProps),t.ptm("button")),t.ptm("closeButton"))),[ee(t.$slots,"closeicon",{},function(){return[t.closeIcon?(g(),T("i",O({key:0,class:[t.cx("closeIcon"),t.closeIcon]},ms(ms({},t.ptm("buttonIcon")),t.ptm("closeIcon"))),null,16)):(g(),L(s,O({key:1,class:[t.cx("closeIcon"),t.closeIcon]},ms(ms({},t.ptm("buttonIcon")),t.ptm("closeIcon"))),null,16,["class"]))]})],16,gR)),[[a]]):N("",!0)],16))],16),[[Zn,r.visible]])]}),_:3},16)}KA.render=vR;var yR={root:function(e){var n=e.instance;return["p-progressbar p-component",{"p-progressbar-determinate":n.determinate,"p-progressbar-indeterminate":n.indeterminate}]},container:"p-progressbar-indeterminate-container",value:"p-progressbar-value p-progressbar-value-animate",label:"p-progressbar-label"},bR=Xt.extend({name:"progressbar",classes:yR}),AR={name:"BaseProgressBar",extends:It,props:{value:{type:Number,default:null},mode:{type:String,default:"determinate"},showValue:{type:Boolean,default:!0}},style:bR,provide:function(){return{$parentInstance:this}}},qA={name:"ProgressBar",extends:AR,inheritAttrs:!1,computed:{progressStyle:function(){return{width:this.value+"%",display:"flex"}},indeterminate:function(){return this.mode==="indeterminate"},determinate:function(){return this.mode==="determinate"}}},wR=["aria-valuenow"];function SR(t,e,n,i,r,o){return g(),T("div",O({role:"progressbar",class:t.cx("root"),"aria-valuemin":"0","aria-valuenow":t.value,"aria-valuemax":"100"},t.ptmi("root")),[o.determinate?(g(),T("div",O({key:0,class:t.cx("value"),style:o.progressStyle},t.ptm("value")),[t.value!=null&&t.value!==0&&t.showValue?(g(),T("div",O({key:0,class:t.cx("label")},t.ptm("label")),[ee(t.$slots,"default",{},function(){return[ht(_(t.value+"%"),1)]})],16)):N("",!0)],16)):N("",!0),o.indeterminate?(g(),T("div",O({key:1,class:t.cx("container")},t.ptm("container")),[E("div",O({class:t.cx("value")},t.ptm("value")),null,16)],16)):N("",!0)],16,wR)}qA.render=SR;var CR={root:function(e){var n=e.props;return["p-fileupload p-fileupload-".concat(n.mode," p-component")]},buttonbar:"p-fileupload-buttonbar",chooseButton:function(e){var n=e.instance,i=e.props;return["p-button p-component p-fileupload-choose",{"p-fileupload-choose-selected":i.mode==="basic"&&n.hasFiles,"p-disabled":i.disabled,"p-focus":n.focused}]},chooseIcon:"p-button-icon p-button-icon-left",chooseButtonLabel:"p-button-label",content:"p-fileupload-content",empty:"p-fileupload-empty",uploadIcon:"p-button-icon p-button-icon-left",label:"p-button-label",file:"p-fileupload-file",thumbnail:"p-fileupload-file-thumbnail",details:"p-fileupload-file-details",fileName:"p-fileupload-file-name",fileSize:"p-fileupload-file-size",badge:"p-fileupload-file-badge",actions:"p-fileupload-file-actions",removeButton:"p-fileupload-file-remove"},kR=Xt.extend({name:"fileupload",classes:CR}),OR={name:"BaseFileUpload",extends:It,props:{name:{type:String,default:null},url:{type:String,default:null},mode:{type:String,default:"advanced"},multiple:{type:Boolean,default:!1},accept:{type:String,default:null},disabled:{type:Boolean,default:!1},auto:{type:Boolean,default:!1},maxFileSize:{type:Number,default:null},invalidFileSizeMessage:{type:String,default:"{0}: Invalid file size, file size should be smaller than {1}."},invalidFileTypeMessage:{type:String,default:"{0}: Invalid file type, allowed file types: {1}."},fileLimit:{type:Number,default:null},invalidFileLimitMessage:{type:String,default:"Maximum number of files exceeded, limit is {0} at most."},withCredentials:{type:Boolean,default:!1},previewWidth:{type:Number,default:50},chooseLabel:{type:String,default:null},uploadLabel:{type:String,default:null},cancelLabel:{type:String,default:null},customUpload:{type:Boolean,default:!1},showUploadButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},chooseIcon:{type:String,default:void 0},uploadIcon:{type:String,default:void 0},cancelIcon:{type:String,default:void 0},style:null,class:null},style:kR,provide:function(){return{$parentInstance:this}}},XA={name:"FileContent",hostName:"FileUpload",extends:It,emits:["remove"],props:{files:{type:Array,default:function(){return[]}},badgeSeverity:{type:String,default:"warning"},badgeValue:{type:String,default:null},previewWidth:{type:Number,default:50},templates:{type:null,default:null}},methods:{formatSize:function(e){var n,i=1024,r=3,o=((n=this.$primevue.config.locale)===null||n===void 0?void 0:n.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e===0)return"0 ".concat(o[0]);var s=Math.floor(Math.log(e)/Math.log(i)),a=parseFloat((e/Math.pow(i,s)).toFixed(r));return"".concat(a," ").concat(o[s])}},components:{FileUploadButton:wo,FileUploadBadge:Wp,TimesIcon:vr}},TR=["alt","src","width"];function xR(t,e,n,i,r,o){var s=et("FileUploadBadge"),a=et("TimesIcon"),l=et("FileUploadButton");return g(!0),T(le,null,_e(n.files,function(u,c){return g(),T("div",O({key:u.name+u.type+u.size,class:t.cx("file")},t.ptm("file")),[E("img",O({role:"presentation",class:t.cx("thumbnail"),alt:u.name,src:u.objectURL,width:n.previewWidth},t.ptm("thumbnail")),null,16,TR),E("div",O({class:t.cx("details")},t.ptm("details")),[E("div",O({class:t.cx("fileName")},t.ptm("fileName")),_(u.name),17),E("span",O({class:t.cx("fileSize")},t.ptm("fileSize")),_(o.formatSize(u.size)),17),I(s,{value:n.badgeValue,class:pe(t.cx("badge")),severity:n.badgeSeverity,unstyled:t.unstyled,pt:t.ptm("badge")},null,8,["value","class","severity","unstyled","pt"])],16),E("div",O({class:t.cx("actions")},t.ptm("actions")),[I(l,{onClick:function(f){return t.$emit("remove",c)},text:"",rounded:"",severity:"danger",class:pe(t.cx("removeButton")),unstyled:t.unstyled,pt:t.ptm("removeButton")},{icon:z(function(d){return[n.templates.fileremoveicon?(g(),L(yt(n.templates.fileremoveicon),{key:0,class:pe(d.class),file:u,index:c},null,8,["class","file","index"])):(g(),L(a,O({key:1,class:d.class,"aria-hidden":"true"},t.ptm("removeButton").icon),null,16,["class"]))]}),_:2},1032,["onClick","class","unstyled","pt"])],16)],16)}),128)}XA.render=xR;function Lh(t){return PR(t)||ER(t)||GA(t)||MR()}function MR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
208
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ER(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PR(t){if(Array.isArray(t))return Dh(t)}function Mc(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=GA(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(u){throw u},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
209
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function GA(t,e){if(t){if(typeof t=="string")return Dh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dh(t,e)}}function Dh(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var ZA={name:"FileUpload",extends:OR,inheritAttrs:!1,emits:["select","uploader","before-upload","progress","upload","error","before-send","clear","remove","remove-uploaded-file"],duplicateIEEvent:!1,data:function(){return{uploadedFileCount:0,files:[],messages:[],focused:!1,progress:null,uploadedFiles:[]}},methods:{onFileSelect:function(e){if(e.type!=="drop"&&this.isIE11()&&this.duplicateIEEvent){this.duplicateIEEvent=!1;return}this.messages=[],this.files=this.files||[];var n=e.dataTransfer?e.dataTransfer.files:e.target.files,i=Mc(n),r;try{for(i.s();!(r=i.n()).done;){var o=r.value;this.isFileSelected(o)||this.validate(o)&&(this.isImage(o)&&(o.objectURL=window.URL.createObjectURL(o)),this.files.push(o))}}catch(s){i.e(s)}finally{i.f()}this.$emit("select",{originalEvent:e,files:this.files}),this.fileLimit&&this.checkFileLimit(),this.auto&&this.hasFiles&&!this.isFileLimitExceeded()&&this.upload(),e.type!=="drop"&&this.isIE11()?this.clearIEInput():this.clearInputElement()},choose:function(){this.$refs.fileInput.click()},upload:function(){var e=this;if(this.customUpload)this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.$emit("uploader",{files:this.files}),this.clear();else{var n=new XMLHttpRequest,i=new FormData;this.$emit("before-upload",{xhr:n,formData:i});var r=Mc(this.files),o;try{for(r.s();!(o=r.n()).done;){var s=o.value;i.append(this.name,s,s.name)}}catch(a){r.e(a)}finally{r.f()}n.upload.addEventListener("progress",function(a){a.lengthComputable&&(e.progress=Math.round(a.loaded*100/a.total)),e.$emit("progress",{originalEvent:a,progress:e.progress})}),n.onreadystatechange=function(){if(n.readyState===4){var a;e.progress=0,n.status>=200&&n.status<300?(e.fileLimit&&(e.uploadedFileCount+=e.files.length),e.$emit("upload",{xhr:n,files:e.files})):e.$emit("error",{xhr:n,files:e.files}),(a=e.uploadedFiles).push.apply(a,Lh(e.files)),e.clear()}},n.open("POST",this.url,!0),this.$emit("before-send",{xhr:n,formData:i}),n.withCredentials=this.withCredentials,n.send(i)}},clear:function(){this.files=[],this.messages=null,this.$emit("clear"),this.isAdvanced&&this.clearInputElement()},onFocus:function(){this.focused=!0},onBlur:function(){this.focused=!1},isFileSelected:function(e){if(this.files&&this.files.length){var n=Mc(this.files),i;try{for(n.s();!(i=n.n()).done;){var r=i.value;if(r.name+r.type+r.size===e.name+e.type+e.size)return!0}}catch(o){n.e(o)}finally{n.f()}}return!1},isIE11:function(){return!!window.MSInputMethodContext&&!!document.documentMode},validate:function(e){return this.accept&&!this.isFileTypeValid(e)?(this.messages.push(this.invalidFileTypeMessage.replace("{0}",e.name).replace("{1}",this.accept)),!1):this.maxFileSize&&e.size>this.maxFileSize?(this.messages.push(this.invalidFileSizeMessage.replace("{0}",e.name).replace("{1}",this.formatSize(this.maxFileSize))),!1):!0},isFileTypeValid:function(e){var n=this.accept.split(",").map(function(a){return a.trim()}),i=Mc(n),r;try{for(i.s();!(r=i.n()).done;){var o=r.value,s=this.isWildcard(o)?this.getTypeClass(e.type)===this.getTypeClass(o):e.type==o||this.getFileExtension(e).toLowerCase()===o.toLowerCase();if(s)return!0}}catch(a){i.e(a)}finally{i.f()}return!1},getTypeClass:function(e){return e.substring(0,e.indexOf("/"))},isWildcard:function(e){return e.indexOf("*")!==-1},getFileExtension:function(e){return"."+e.name.split(".").pop()},isImage:function(e){return/^image\//.test(e.type)},onDragEnter:function(e){this.disabled||(e.stopPropagation(),e.preventDefault())},onDragOver:function(e){this.disabled||(!this.isUnstyled&&G.addClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!0),e.stopPropagation(),e.preventDefault())},onDragLeave:function(){this.disabled||(!this.isUnstyled&&G.removeClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1))},onDrop:function(e){if(!this.disabled){!this.isUnstyled&&G.removeClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1),e.stopPropagation(),e.preventDefault();var n=e.dataTransfer?e.dataTransfer.files:e.target.files,i=this.multiple||n&&n.length===1;i&&this.onFileSelect(e)}},onBasicUploaderClick:function(e){this.hasFiles?this.upload():e.button===0&&this.$refs.fileInput.click()},remove:function(e){this.clearInputElement();var n=this.files.splice(e,1)[0];this.files=Lh(this.files),this.$emit("remove",{file:n,files:this.files})},removeUploadedFile:function(e){var n=this.uploadedFiles.splice(e,1)[0];this.uploadedFiles=Lh(this.uploadedFiles),this.$emit("remove-uploaded-file",{file:n,files:this.uploadedFiles})},clearInputElement:function(){this.$refs.fileInput.value=""},clearIEInput:function(){this.$refs.fileInput&&(this.duplicateIEEvent=!0,this.$refs.fileInput.value="")},formatSize:function(e){var n,i=1024,r=3,o=((n=this.$primevue.config.locale)===null||n===void 0?void 0:n.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e===0)return"0 ".concat(o[0]);var s=Math.floor(Math.log(e)/Math.log(i)),a=parseFloat((e/Math.pow(i,s)).toFixed(r));return"".concat(a," ").concat(o[s])},isFileLimitExceeded:function(){return this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount&&this.focused&&(this.focused=!1),this.fileLimit&&this.fileLimit<this.files.length+this.uploadedFileCount},checkFileLimit:function(){this.isFileLimitExceeded()&&this.messages.push(this.invalidFileLimitMessage.replace("{0}",this.fileLimit.toString()))},onMessageClose:function(){this.messages=null}},computed:{isAdvanced:function(){return this.mode==="advanced"},isBasic:function(){return this.mode==="basic"},chooseButtonClass:function(){return[this.cx("chooseButton"),this.class]},basicChooseButtonLabel:function(){return this.auto?this.chooseButtonLabel:this.hasFiles?this.files.map(function(e){return e.name}).join(", "):this.chooseButtonLabel},hasFiles:function(){return this.files&&this.files.length>0},hasUploadedFiles:function(){return this.uploadedFiles&&this.uploadedFiles.length>0},chooseDisabled:function(){return this.disabled||this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount},uploadDisabled:function(){return this.disabled||!this.hasFiles||this.fileLimit&&this.fileLimit<this.files.length},cancelDisabled:function(){return this.disabled||!this.hasFiles},chooseButtonLabel:function(){return this.chooseLabel||this.$primevue.config.locale.choose},uploadButtonLabel:function(){return this.uploadLabel||this.$primevue.config.locale.upload},cancelButtonLabel:function(){return this.cancelLabel||this.$primevue.config.locale.cancel},completedLabel:function(){return this.$primevue.config.locale.completed},pendingLabel:function(){return this.$primevue.config.locale.pending}},components:{FileUploadButton:wo,FileUploadProgressBar:qA,FileUploadMessage:KA,FileContent:XA,PlusIcon:HA,UploadIcon:UA,TimesIcon:vr},directives:{ripple:gi}},IR=["multiple","accept","disabled"],LR=["accept","disabled","multiple"];function DR(t,e,n,i,r,o){var s=et("FileUploadButton"),a=et("FileUploadProgressBar"),l=et("FileContent"),u=et("FileUploadMessage"),c=an("ripple");return o.isAdvanced?(g(),T("div",O({key:0,class:t.cx("root")},t.ptmi("root")),[E("input",O({ref:"fileInput",type:"file",onChange:e[0]||(e[0]=function(){return o.onFileSelect&&o.onFileSelect.apply(o,arguments)}),multiple:t.multiple,accept:t.accept,disabled:o.chooseDisabled},t.ptm("input")),null,16,IR),E("div",O({class:t.cx("buttonbar")},t.ptm("buttonbar")),[ee(t.$slots,"header",{files:r.files,uploadedFiles:r.uploadedFiles,chooseCallback:o.choose,uploadCallback:o.upload,clearCallback:o.clear},function(){return[ft((g(),T("span",O({class:o.chooseButtonClass,style:t.style,onClick:e[1]||(e[1]=function(){return o.choose&&o.choose.apply(o,arguments)}),onKeydown:e[2]||(e[2]=zn(function(){return o.choose&&o.choose.apply(o,arguments)},["enter"])),onFocus:e[3]||(e[3]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[4]||(e[4]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),tabindex:"0"},t.ptm("chooseButton")),[ee(t.$slots,"chooseicon",{class:pe(t.cx("chooseIcon"))},function(){return[(g(),L(yt(t.chooseIcon?"span":"PlusIcon"),O({class:[t.cx("chooseIcon"),t.chooseIcon],"aria-hidden":"true"},t.ptm("chooseIcon")),null,16,["class"]))]}),E("span",O({class:t.cx("chooseButtonLabel")},t.ptm("chooseButtonLabel")),_(o.chooseButtonLabel),17)],16)),[[c]]),t.showUploadButton?(g(),L(s,{key:0,label:o.uploadButtonLabel,onClick:o.upload,disabled:o.uploadDisabled,unstyled:t.unstyled,pt:t.ptm("uploadButton")},{icon:z(function(d){return[ee(t.$slots,"uploadicon",{},function(){return[(g(),L(yt(t.uploadIcon?"span":"UploadIcon"),O({class:[d.class,t.uploadIcon],"aria-hidden":"true"},t.ptm("uploadButton").icon,{"data-pc-section":"uploadbuttonicon"}),null,16,["class"]))]})]}),_:3},8,["label","onClick","disabled","unstyled","pt"])):N("",!0),t.showCancelButton?(g(),L(s,{key:1,label:o.cancelButtonLabel,onClick:o.clear,disabled:o.cancelDisabled,unstyled:t.unstyled,pt:t.ptm("cancelButton")},{icon:z(function(d){return[ee(t.$slots,"cancelicon",{},function(){return[(g(),L(yt(t.cancelIcon?"span":"TimesIcon"),O({class:[d.class,t.cancelIcon],"aria-hidden":"true"},t.ptm("cancelButton").icon,{"data-pc-section":"cancelbuttonicon"}),null,16,["class"]))]})]}),_:3},8,["label","onClick","disabled","unstyled","pt"])):N("",!0)]})],16),E("div",O({ref:"content",class:t.cx("content"),onDragenter:e[5]||(e[5]=function(){return o.onDragEnter&&o.onDragEnter.apply(o,arguments)}),onDragover:e[6]||(e[6]=function(){return o.onDragOver&&o.onDragOver.apply(o,arguments)}),onDragleave:e[7]||(e[7]=function(){return o.onDragLeave&&o.onDragLeave.apply(o,arguments)}),onDrop:e[8]||(e[8]=function(){return o.onDrop&&o.onDrop.apply(o,arguments)})},t.ptm("content"),{"data-p-highlight":!1}),[ee(t.$slots,"content",{files:r.files,uploadedFiles:r.uploadedFiles,removeUploadedFileCallback:o.removeUploadedFile,removeFileCallback:o.remove,progress:r.progress,messages:r.messages},function(){return[o.hasFiles?(g(),T(le,{key:0},[I(a,{value:r.progress,showValue:!1,unstyled:t.unstyled,pt:t.ptm("progressbar")},null,8,["value","unstyled","pt"]),I(l,{files:r.files,onRemove:o.remove,badgeValue:o.pendingLabel,previewWidth:t.previewWidth,templates:t.$slots,unstyled:t.unstyled,pt:t.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])],64)):N("",!0),(g(!0),T(le,null,_e(r.messages,function(d){return g(),L(u,{key:d,severity:"error",onClose:o.onMessageClose,unstyled:t.unstyled,pt:t.ptm("message")},{default:z(function(){return[ht(_(d),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),I(l,{files:r.uploadedFiles,onRemove:o.removeUploadedFile,badgeValue:o.completedLabel,badgeSeverity:"success",previewWidth:t.previewWidth,templates:t.$slots,unstyled:t.unstyled,pt:t.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])]}),t.$slots.empty&&!o.hasFiles&&!o.hasUploadedFiles?(g(),T("div",O({key:0,class:t.cx("empty")},t.ptm("empty")),[ee(t.$slots,"empty")],16)):N("",!0)],16)],16)):o.isBasic?(g(),T("div",O({key:1,class:t.cx("root")},t.ptmi("root")),[(g(!0),T(le,null,_e(r.messages,function(d){return g(),L(u,{key:d,severity:"error",onClose:o.onMessageClose,unstyled:t.unstyled,pt:t.ptm("messages")},{default:z(function(){return[ht(_(d),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),ft((g(),T("span",O({class:o.chooseButtonClass,style:t.style,onMouseup:e[12]||(e[12]=function(){return o.onBasicUploaderClick&&o.onBasicUploaderClick.apply(o,arguments)}),onKeydown:e[13]||(e[13]=zn(function(){return o.choose&&o.choose.apply(o,arguments)},["enter"])),onFocus:e[14]||(e[14]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[15]||(e[15]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),tabindex:"0"},t.ptm("chooseButton")),[!o.hasFiles||t.auto?ee(t.$slots,"uploadicon",{key:0,class:pe(t.cx("uploadIcon"))},function(){return[(g(),L(yt(t.uploadIcon?"span":"UploadIcon"),O({class:[t.cx("uploadIcon"),t.uploadIcon],"aria-hidden":"true"},t.ptm("uploadIcon")),null,16,["class"]))]}):ee(t.$slots,"chooseicon",{key:1,class:pe(t.cx("chooseIcon"))},function(){return[(g(),L(yt(t.chooseIcon?"span":"PlusIcon"),O({class:[t.cx("chooseIcon"),t.chooseIcon],"aria-hidden":"true"},t.ptm("chooseIcon")),null,16,["class"]))]}),E("span",O({class:t.cx("label")},t.ptm("label")),_(o.basicChooseButtonLabel),17),o.hasFiles?N("",!0):(g(),T("input",O({key:2,ref:"fileInput",type:"file",accept:t.accept,disabled:t.disabled,multiple:t.multiple,onChange:e[9]||(e[9]=function(){return o.onFileSelect&&o.onFileSelect.apply(o,arguments)}),onFocus:e[10]||(e[10]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[11]||(e[11]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)})},t.ptm("input")),null,16,LR))],16)),[[c]])],16)):N("",!0)}ZA.render=DR;const Ec="Checking availability...",ca=ce("InputText",ye({__name:"InputText",props:{allowedCharacters:{},autoUppercase:{type:Boolean,default:!1},modelValue:{},value:{},existingValues:{},checkAvailability:{},maxLength:{},label:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},manualInvalidContainer:{type:Boolean,default:!1},validatorMessage:{},validatorMessageClass:{},placeholder:{},type:{default:"text"},disabled:{type:Boolean},fieldInfo:{},inputClass:{},inputContainerClass:{},labelClass:{},blurOnReachMaxLength:{type:Boolean},preventInputOnMaxLength:{type:Boolean},validateOnBlur:{type:Boolean,default:!1},useProtocol:{type:Boolean,default:!0},allowSpecialCharacters:{type:Boolean,default:!0},useInputGroup:{type:Boolean,default:!0},inputId:{}},emits:["update:modelValue","blur","input"],setup(t,{emit:e}){const n=t,i=e,{defaultProps:r}=_t(n.type==="email"?"InputEmail":n.type==="url"?"InputURL":"InputText"),{locale:o}=_t("InputText"),s=Hi(n,r),a=dt("preset",{}).inputgroupaddon,l=sn({value:void 0}),u=dt("isSubmitting"),c=W(()=>n.invalid||!!l.errorMessage),d=oe(0),f=oe(n.value||n.modelValue);bt(()=>{var M;n.useValidator&&(Object.assign(l,Ln(n.fieldName??"textInput",D=>Pt(()=>m(D==null?void 0:D.trim())))),n.value!=null&&R(n.value)),n.modelValue!=null&&(l.value=(M=n.modelValue)==null?void 0:M.trim()),n.invalid&&n.useValidator&&l.validate()}),Vi(()=>{n.useValidator&&l.handleReset()});const p=W(()=>{var M,D;return n.placeholder??((D=o.defaultPlaceholder)==null?void 0:D.replace("{label}",n.label?(M=n.label)==null?void 0:M.toLowerCase():""))}),h=W(()=>{var M,D;return typeof n.validatorMessage=="object"&&"exist"in n.validatorMessage?(M=n.validatorMessage)==null?void 0:M.exist:(D=o.alreadyExistInvalidText)==null?void 0:D.replace("{label}",n.label)}),m=M=>{var D,$,q,J;if(typeof n.validatorMessage=="string"&&n.invalid)return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{invalidFormat:ve,empty:ae,exceed:me}=n.validatorMessage??{};if(!M&&n.mandatory)return ae??o.emptyInvalidText.replace("{label}",n.label);if((M==null?void 0:M.length)>s.maxLength)return me??((D=o.exceedMaxLengthInvalidText)==null?void 0:D.replace("{maxLength}",s.maxLength.toString()));if(($=(n.existingValues??[]).filter(se=>se!=n.value))!=null&&$.includes(M))return((q=n.validatorMessage)==null?void 0:q.exist)??((J=o.alreadyExistInvalidText)==null?void 0:J.replace("{label}",n.label));if(M&&n.type==="email")return S(M,ve??o.emailFormatInvalidText);if(M&&n.type==="url")return v(M,ve??o.urlFormatInvalidText)}else if(!n.allowSpecialCharacters)return/[^A-Za-z0-9 ]/.test(M)?o.includeSpecialCharsInvalidText:!0;return n.checkAvailability?C():!0},v=(M,D)=>{const $=new RegExp(`^(https?:\\/\\/)${n.useProtocol?"":"?"}((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+:@!$&'()*+,;=]*)*(\\?[;&a-z\\d%_.~+=:@!$&'()*+,;=-]*)?(\\#[-a-z\\d_:@!$&'()*+,;=]*)?$`,"i");return D==null||$.test(M)?!0:D},S=(M,D)=>{const $=/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;return D==null||$.test(M)?!n.checkAvailability||!!n.checkAvailability&&C():D},b=()=>{n.validateOnBlur&&(l.value=f.value),i("blur",f.value)},k=M=>{var q;const D=s.maxLength&&s.maxLength===((q=f.value)==null?void 0:q.length);(n.allowedCharacters&&!n.allowedCharacters.test(M.key)||D&&(n.preventInputOnMaxLength||n.blurOnReachMaxLength))&&(M.preventDefault(),n.blurOnReachMaxLength&&D&&d.value++)},A=M=>{var q,J,ve;const D=(q=M.clipboardData)==null?void 0:q.getData("text"),$=s.maxLength&&s.maxLength===((J=f.value)==null?void 0:J.length)||((ve=f.value)==null?void 0:ve.length)+(D==null?void 0:D.length)>s.maxLength||(D==null?void 0:D.length)>s.maxLength;(n.allowedCharacters&&!n.allowedCharacters.test(D)||$&&(n.preventInputOnMaxLength||n.blurOnReachMaxLength))&&(M.preventDefault(),n.blurOnReachMaxLength&&$&&d.value++)},w=M=>{M===""&&(M=void 0),n.autoUppercase&&M&&(M=M.replace(/[a-z]/g,D=>D.toUpperCase())),f.value=M,(!n.validateOnBlur&&n.useValidator||!n.useValidator)&&(l.value=f.value),i("update:modelValue",f.value)},y=M=>{i("input",M.target.value||void 0)},C=()=>{if(u!=null&&u.value){if(l.errorMessage===h.value||l.errorMessage===Ec)return l.errorMessage}else return P(),Ec;return!0},P=X7(async()=>{var M;if(l.value!=n.value&&(M=l.value)!=null&&M.length&&!await n.checkAvailability(l.value))return l.setErrors(h.value);l.errorMessage===Ec&&l.setErrors("")},300),R=M=>{n.useValidator?l.setValue(M==null?void 0:M.trim(),!1):l.value=M==null?void 0:M.trim()};return Re(()=>n.value,M=>{R(M),f.value=M==null?void 0:M.trim()},{once:!0}),Re(()=>n.modelValue,M=>{f.value=M==null?void 0:M.trim(),n.validateOnBlur||(l.value=f.value)}),Re(()=>n.invalid,()=>{var M;(M=l.validate)==null||M.call(l)}),(M,D)=>(g(),L(Yn,{info:M.fieldInfo,label:n.label,"label-class":n.labelClass,mandatory:n.mandatory},{default:z(()=>[I(br,{class:pe(n.inputContainerClass??["grid ",{"grid-cols-[max-content,1fr,max-content]":M.$slots["addon-left"]&&M.$slots["addon-right"],"grid-cols-[1fr,max-content]":!M.$slots["addon-left"]&&M.$slots["addon-right"],"grid-cols-[max-content,1fr]":M.$slots["addon-left"]&&!M.$slots["addon-right"]}]),disabled:n.disabled,invalid:c.value&&!n.manualInvalidContainer,"use-input-group":M.useInputGroup},{default:z(()=>[M.$slots["addon-left"]?(g(),L(x(ps),{key:0,disabled:n.disabled},{default:z(()=>[ee(M.$slots,"addon-left")]),_:3},8,["disabled"])):N("",!0),(g(),L(x(Xr),{id:M.inputId,key:d.value,class:pe(M.inputClass),disabled:M.disabled,invalid:c.value,"model-value":l.value,placeholder:p.value,onBlur:b,onInput:y,onKeypress:k,onPaste:A,"onUpdate:modelValue":w},null,8,["id","class","disabled","invalid","model-value","placeholder"])),M.$slots["addon-right"]?(g(),L(x(ps),{key:1,pt:{root:x(a).root({props:{class:[{"!text-general-200":n.disabled}]}})}},{default:z(()=>[ee(M.$slots,"addon-right")]),_:3},8,["pt"])):N("",!0)]),_:3},8,["class","disabled","invalid","use-input-group"]),l.errorMessage==Ec?(g(),T("span",O({key:0},M.$preset.validatormessage.root,{class:"text-general-800","data-wv-section":"checking-availability"})," Checking availability... ",16)):(g(),L(Rn,{key:1,class:pe(M.validatorMessageClass),message:l.errorMessage},null,8,["class","message"]))]),_:3},8,["info","label","label-class","mandatory"]))}})),RR={class:"'!mt-0 font-light text-xs text-general-500'"},NR=1048576,LZ=ce("FileUpload",ye({__name:"FileUpload",props:Cn({accept:{},disabled:{type:Boolean},maxFileSize:{},modelValue:{},multiple:{type:Boolean,default:!1},invalidFileSizeMessage:{},invalidFileTypeMessage:{},label:{default:"Upload File"},withUpload:{type:Boolean,default:!0},uploadLabel:{default:"Upload"},placeholder:{default:"Select File"},fileExtensions:{},fileRequirements:{},uploadFunction:{},useValidator:{type:Boolean},fieldName:{default:"fileUpload"},mandatory:{type:Boolean},useErrorToast:{type:Boolean,default:!0},validatorMessage:{},validatorMessageClass:{}},{modelValue:{},modelModifiers:{}}),emits:Cn(["select","update:modelValue","upload","error"],["update:modelValue"]),setup(t,{emit:e}){const n=vo(),i=si(t,"modelValue"),r=t,o=e,{fileupload:s={}}=dt("preset",{}),a=oe(),l=oe(),u=oe(),c=re(),d=sn({value:void 0}),f=W(()=>!!d.errorMessage||(k.value?k.value.length>0:!1)),p=oe(!1);bt(()=>{r.useValidator&&Object.assign(d,Ln(r.fieldName,y=>h(y))),i.value&&(Array.isArray(i.value)&&r.multiple?(u.value=i.value,a.value=i.value.map(y=>y.name)):i.value instanceof File&&(u.value=i.value,a.value=i.value.name))});const h=y=>{if(typeof r.validatorMessage=="string")return r.validatorMessage;if(typeof r.validatorMessage!="string"){const{empty:C}=r.validatorMessage??{};if(!y&&r.mandatory&&!u.value)return C??!0}return!0},m=y=>{if(!r.useErrorToast&&typeof r.validatorMessage!="string"){const{exceed:C,invalidFormat:P}=r.validatorMessage;y.includes("Invalid file size")&&C?l.value=C:y.includes("Invalid file type")?l.value=P:l.value=void 0}},v=y=>{var C;try{if(!y.files||y.files.length===0)return;r.multiple?(u.value=y.files,a.value=y.files.map(P=>P.name),o("select",y.files)):(u.value=y.files[0],a.value=(C=y.files[0])==null?void 0:C.name,o("select",y.files[0]))}catch(P){console.error(P)}},S=(y,C)=>{r.disabled||p.value||(k.value=void 0,new Promise((P,R)=>{try{C(),P()}catch(M){R(M)}}).then(()=>{y()}))},b=async(y,C)=>{try{p.value=!0,r.uploadFunction&&await r.uploadFunction(y),u.value=void 0,a.value=void 0,C(),p.value=!1}catch(P){throw p.value=!1,P}},k=re(),A=y=>{k.value=y},w=(y,C,P)=>{(y.key==="Enter"||y.key===" ")&&S(C,P)};return Re(u,y=>{d.value=y,i.value=y,k.value=void 0,l.value=void 0}),Re(i,y=>{Array.isArray(y)&&r.multiple?(u.value=y,a.value=y.map(C=>C.name)):y instanceof File?(u.value=y,a.value=y.name):(u.value=void 0,a.value=void 0),d.value=y,"messages"in c.value&&(c.value.messages=[]),k.value=void 0,l.value=void 0}),Re(k,y=>{if(y&&y.length>0){const C=y[0].replace("{2}",r.accept||"").replace("{2.1}",r.fileExtensions||"");C.includes("Invalid file size")&&o("error","FILE_SIZE_TOO_LARGE"),m(C),r.useErrorToast&&n.add({message:C,severity:"error"}),u.value=void 0,a.value=void 0}else l.value=void 0}),(y,C)=>(g(),L(x(ZA),O(r,{ref_key:"fileUpload",ref:c,"file-limit":y.multiple?void 0:1,pt:{input:{style:"display: none"}},onSelect:v,onUpload:C[0]||(C[0]=P=>y.$emit("upload",P))}),{header:z(({files:P,chooseCallback:R,clearCallback:M})=>[E("div",{class:pe([{"grid-cols-[auto,max-content]":r.withUpload},"grid gap-3 items-end"])},[I(Yn,O(x(s).wrapper,{"error-messages":k.value,label:r.label,mandatory:r.mandatory}),{default:z(()=>[I(ca,{disabled:r.disabled||p.value,"input-class":x(s).input({state:{fileName:a.value}}).class,invalid:f.value,"model-value":Array.isArray(a.value)?a.value.join(", "):a.value,placeholder:r.placeholder,onClick:D=>S(R,M),onKeydown:xt(D=>w(D,R,M),["prevent"])},{"addon-left":z(()=>C[1]||(C[1]=[ht(" Browse")])),_:2},1032,["disabled","input-class","invalid","model-value","placeholder","onClick","onKeydown"]),r.fileExtensions||r.fileRequirements||d.errorMessage||l.value||r.validatorMessage?(g(),T("div",{key:0,class:pe([{"justify-between":d.errorMessage||l.value,"justify-end":(!d.errorMessage||!l.value)&&r.validatorMessage},"flex w-full"])},[I(Rn,{class:pe(r.validatorMessageClass),message:l.value??d.errorMessage},null,8,["class","message"]),r.fileExtensions||r.fileRequirements?(g(),T("div",it(O({key:0},x(s).requirements)),[E("small",RR,[y.fileRequirements?(g(),T(le,{key:0},[ht(_(y.fileRequirements),1)],64)):(g(),T(le,{key:1},[ht(_(r.maxFileSize?`${r.fileExtensions}. max file ${Math.round(r.maxFileSize/NR)} MB`:`${r.fileExtensions} file`),1)],64))])],16)):N("",!0)],2)):N("",!0)]),_:2},1040,["error-messages","label","mandatory"]),r.withUpload?(g(),L(We,O({key:0},x(s).buttonupload({props:r}),{disabled:r.disabled||p.value||!u.value,label:r.uploadLabel,onClick:D=>b(P,M),severity:"success",type:"button"}),null,16,["disabled","label","onClick"])):N("",!0)],2)]),content:z(({messages:P})=>[ht(_(A(P)),1)]),_:1},16,["file-limit"]))}}));var ql={exports:{}},BR=ql.exports,_A;function $R(){return _A||(_A=1,function(t,e){(function(){function n(i,r){r=r||"";for(var o=1024,s=window.atob(i),a=[],l=0,u=s.length;l<u;l+=o){for(var c=s.slice(l,l+o),d=new Array(c.length),f=0;f<c.length;f++)d[f]=c.charCodeAt(f);var p=new Uint8Array(d);a.push(p)}return new Blob(a,{type:r})}t.exports&&(e=t.exports=n),e.base64ToBlob=n}).call(BR)}(ql,ql.exports)),ql.exports}var VR=$R();const zR=Vl(VR);function JA(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Gt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?JA(Object(n),!0).forEach(function(i){Ui(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):JA(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Ui(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FR(t,e){if(t==null)return{};var n,i,r=function(s,a){if(s==null)return{};var l,u,c={},d=Object.keys(s);for(u=0;u<d.length;u++)l=d[u],a.indexOf(l)>=0||(c[l]=s[l]);return c}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function gs(t){return function(e){if(Array.isArray(e))return Rh(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,n){if(e){if(typeof e=="string")return Rh(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Rh(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
210
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Rh(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var YA,jR,Pc,Fn=(YA=function(t){/*!
211
- Copyright (c) 2018 Jed Watson.
212
- Licensed under the MIT License (MIT), see
213
- http://jedwatson.github.io/classnames
214
- */(function(){var e={}.hasOwnProperty;function n(){for(var i=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var s=typeof o;if(s==="string"||s==="number")i.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&i.push(a)}}else if(s==="object")if(o.toString===Object.prototype.toString)for(var l in o)e.call(o,l)&&o[l]&&i.push(l);else i.push(o.toString())}}return i.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()},YA(Pc={path:jR,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e==null&&Pc.path)}},Pc.exports),Pc.exports),dr=function(t){return function(e,n){if(!e)return t;var i;typeof e=="string"?i=e:n=e;var r=t;return i&&(r+="__"+i),r+(n?Object.keys(n).reduce(function(o,s){var a=n[s];return a&&(o+=" "+(typeof a=="boolean"?r+"--"+s:r+"--"+s+"_"+a)),o},""):"")}};function Nh(t,e,n){var i,r,o,s,a;function l(){var c=Date.now()-s;c<e&&c>=0?i=setTimeout(l,e-c):(i=null,n||(a=t.apply(o,r),o=r=null))}e==null&&(e=100);var u=function(){o=this,r=arguments,s=Date.now();var c=n&&!i;return i||(i=setTimeout(l,e)),c&&(a=t.apply(o,r),o=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=t.apply(o,r),o=r=null,clearTimeout(i),i=null)},u}Nh.debounce=Nh;var Bh=Nh,pt=function(){return pt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pt.apply(this,arguments)};/*! *****************************************************************************
215
- Copyright (c) Microsoft Corporation.
216
-
217
- Permission to use, copy, modify, and/or distribute this software for any
218
- purpose with or without fee is hereby granted.
219
-
220
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
221
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
222
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
223
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
224
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
225
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
226
- PERFORMANCE OF THIS SOFTWARE.
227
- ***************************************************************************** */function QA(t,e){var n,i;return t&&e?(n=""+t+e[0].toUpperCase()+e.slice(1),i=t+"-"+e):(n=t||e,i=t||e),{name:n,classname:i}}function e2(t){return/^blob:/.test(t)}function t2(t){return e2(t)||function(e){return/^data:/.test(e)}(t)}function da(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Un(t){return t===void 0}function Ic(t){return typeof t=="object"&&t!==null}function $h(t,e,n){var i={};return Ic(t)?(Object.keys(e).forEach(function(r){Un(t[r])?i[r]=e[r]:Ic(e[r])?Ic(t[r])?i[r]=$h(t[r],e[r],n[r]):i[r]=t[r]?e[r]:n[r]:e[r]===!0||e[r]===!1?i[r]=!!t[r]:i[r]=t[r]}),i):t?e:n}function Lc(t){var e=Number(t);return Number.isNaN(e)?t:e}function n2(t){return typeof(t=="number"||function(e){return typeof e=="object"&&e!==null}(t)&&toString.call(t)=="[object Number]")&&!i2(t)}function i2(t){return t!=t}function r2(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var Xl=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},HR=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},Vh=function(t){this.type="move",this.directions=t},UR=function(){function t(e,n,i,r,o){this.type="drag",this.nativeEvent=e,this.position=i,this.previousPosition=r,this.element=n,this.anchor=o}return t.prototype.shift=function(){var e=this,n=e.element,i=e.anchor,r=e.position;if(n){var o=n.getBoundingClientRect(),s=o.left,a=o.top;return{left:r.left-s-i.left,top:r.top-a-i.top}}return{left:0,top:0}},t}(),zh={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=gs(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,n){return{clientX:e.clientX+n.clientX/t.touches.length,clientY:e.clientY+n.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),n=e.left,i=e.right,r=e.bottom,o=e.top;this.anchor={left:t.clientX-n,top:t.clientY-o,bottom:r-t.clientY,right:i-t.clientX}},processMove:function(t,e){var n=gs(e);if(this.touches.length){if(this.touches.length===1&&n.length===1){var i=this.$refs.draggable;this.$emit("drag",new UR(t,i,{left:n[0].clientX,top:n[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=n}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};zh.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"draggable",class:n.classname,onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)}),onMouseover:e[3]||(e[3]=function(){return o.onMouseOver&&o.onMouseOver.apply(o,arguments)}),onMouseleave:e[4]||(e[4]=function(){return o.onMouseLeave&&o.onMouseLeave.apply(o,arguments)})},[ee(t.$slots,"default")],34)};var Fh=dr("vue-handler-wrapper"),o2={name:"HandlerWrapper",components:{DraggableElement:zh},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,n=QA(this.horizontalPosition,this.verticalPosition);t=Fh((Ui(e={},n.classname,!0),Ui(e,"disabled",this.disabled),e))}else t=Fh({disabled:this.disabled});return{root:t,draggable:Fh("draggable")}}},emits:["leave","enter","drag","drag-end"]};o2.render=function(t,e,n,i,r,o){var s=et("DraggableElement");return g(),L("div",{class:o.classes.root},[I(s,{class:o.classes.draggable,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:z(function(){return[ee(t.$slots,"default")]}),_:3},8,["class"])],2)};var KR=dr("vue-line-wrapper"),s2={name:"LineWrapper",components:{DraggableElement:zh},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return KR((Ui(t={},this.position,!0),Ui(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"]};s2.render=function(t,e,n,i,r,o){var s=et("DraggableElement");return g(),L(s,{class:o.classname,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:z(function(){return[ee(t.$slots,"default")]}),_:3},8,["class"])};var wr=["left","right","top","bottom"],WR=["left","right"],qR=["top","bottom"],XR=["left","top"],GR=["fill-area","fit-area","stencil","none"],a2={left:0,top:0,width:0,height:0};function l2(t,e,n){return!(n=n||["width","height","left","top"]).some(function(i){return t[i]!==e[i]})}function Sr(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function fa(t,e){return{left:t.left-e.left,top:t.top-e.top}}function Qn(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function Gl(t,e){var n={left:0,top:0,right:0,bottom:0};return wr.forEach(function(i){var r=e[i],o=Sr(t)[i];n[i]=r!==void 0&&o!==void 0?i==="left"||i==="top"?Math.max(0,r-o):Math.max(0,o-r):0}),n}function Cr(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function Dc(t){return{left:-t.left,top:-t.top}}function Oi(t,e){return pt(pt({},t),{left:t.left+e.left,top:t.top+e.top})}function Ki(t,e,n,i){if(e!==1){if(n){var r=Qn(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(n.left-r.left)*(1-e),top:t.top+t.height*(1-e)/2+(n.top-r.top)*(1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function Zt(t){return t.width/t.height}function pa(t,e){return Math.min(e.right!==void 0&&e.left!==void 0?(e.right-e.left)/t.width:1/0,e.bottom!==void 0&&e.top!==void 0?(e.bottom-e.top)/t.height:1/0)}function ha(t,e){var n={left:0,top:0},i=Gl(t,e);return i.left&&i.left>0?n.left=i.left:i.right&&i.right>0&&(n.left=-i.right),i.top&&i.top>0?n.top=i.top:i.bottom&&i.bottom>0&&(n.top=-i.bottom),n}function jh(t,e){var n;return e.minimum&&t<e.minimum?n=e.minimum:e.maximum&&t>e.maximum&&(n=e.maximum),n}function u2(t,e){var n=Zt(t),i=Zt(e);return e.width<1/0&&e.height<1/0?n>i?{width:e.width,height:e.width/n}:{width:e.height*n,height:e.height}:e.width<1/0?{width:e.width,height:e.width/n}:e.height<1/0?{width:e.height*n,height:e.height}:t}function c2(t,e){var n=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(n))+Math.abs(t.height*Math.sin(n)),height:Math.abs(t.width*Math.sin(n))+Math.abs(t.height*Math.cos(n))}}function xo(t,e){var n=e*Math.PI/180;return{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function Rc(t,e){var n=Gl(ei(t,e),e);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((t.width+n.left+n.right)/t.width,pa(t,e)):Math.min((t.height+n.top+n.bottom)/t.height,pa(t,e)):1}function ei(t,e,n){n===void 0&&(n=!1);var i=ha(t,e);return Oi(t,n?Dc(i):i)}function Hh(t){return{width:t.right!==void 0&&t.left!==void 0?t.right-t.left:1/0,height:t.bottom!==void 0&&t.top!==void 0?t.bottom-t.top:1/0}}function ZR(t,e){return pt(pt({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function d2(t,e,n){n===void 0&&(n=!0);var i={};return wr.forEach(function(r){var o=t[r],s=e[r];o!==void 0&&s!==void 0?i[r]=r==="left"||r==="top"?n?Math.max(o,s):Math.min(o,s):n?Math.min(o,s):Math.max(o,s):s!==void 0?i[r]=s:o!==void 0&&(i[r]=o)}),i}function Nc(t,e){return d2(t,e,!0)}function f2(t){var e=t.size,n=t.aspectRatio,i=t.ignoreMinimum,r=t.sizeRestrictions;return!!((e.correctRatio||Zt(e)>=n.minimum&&Zt(e)<=n.maximum)&&e.height<=r.maxHeight&&e.width<=r.maxWidth&&e.width&&e.height&&(i||e.height>=r.minHeight&&e.width>=r.minWidth))}function p2(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function Gr(t){var e=t.width,n=t.height,i=t.sizeRestrictions,r={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},o={width:Math.max(i.minWidth,Math.min(i.maxWidth,e)),height:Math.max(i.minHeight,Math.min(i.maxHeight,n))};function s(u,c){return c===void 0&&(c=!1),u.reduce(function(d,f){return f2({size:f,aspectRatio:r,sizeRestrictions:i,ignoreMinimum:c})&&(!d||p2(f,{width:e,height:n})<p2(d,{width:e,height:n}))?f:d},null)}var a=[];r&&[r.minimum,r.maximum].forEach(function(u){u&&a.push({width:o.width,height:o.width/u,correctRatio:!0},{width:o.height*u,height:o.height,correctRatio:!0})}),f2({size:o,aspectRatio:r,sizeRestrictions:i})&&a.push(o);var l=s(a)||s(a,!0);return l&&{width:l.width,height:l.height}}function Uh(t){var e=t.event,n=t.coordinates,i=t.positionRestrictions,r=i===void 0?{}:i,o=Oi(n,e.directions);return Oi(o,ha(o,r))}function _R(t){var e=t.coordinates,n=t.transform,i=t.imageSize,r=t.sizeRestrictions,o=t.positionRestrictions,s=t.aspectRatio,a=t.visibleArea,l=function(c,d){return Uh({coordinates:c,positionRestrictions:o,event:new Vh({left:d.left-c.left,top:d.top-c.top})})},u=pt({},e);return(Array.isArray(n)?n:[n]).forEach(function(c){var d={};Un((d=typeof c=="function"?c({coordinates:u,imageSize:i,visibleArea:a}):c).width)&&Un(d.height)||(u=function(f,p){var h=pt(pt(pt({},f),Gr({width:p.width,height:p.height,sizeRestrictions:r,aspectRatio:s})),{left:0,top:0});return l(h,{left:f.left,top:f.top})}(u,pt(pt({},u),d))),Un(d.left)&&Un(d.top)||(u=l(u,pt(pt({},u),d)))}),u}function JR(t){t.event;var e=t.getAreaRestrictions,n=t.boundaries,i=t.coordinates,r=t.visibleArea;t.aspectRatio;var o=t.stencilSize,s=t.sizeRestrictions,a=t.positionRestrictions;t.stencilReference;var l,u,c,d=pt({},i),f=pt({},r),p=pt({},o);l=Zt(p),u=Zt(d),c===void 0&&(c=.001),(l===0||u===0?Math.abs(u-l)<c:Math.abs(u/l)<1+c&&Math.abs(u/l)>1-c)||(d=pt(pt({},d),Gr({sizeRestrictions:s,width:d.width,height:d.height,aspectRatio:{minimum:Zt(p),maximum:Zt(p)}})));var h=Rc(f=Ki(f,d.width*n.width/(f.width*p.width)),e({visibleArea:f,type:"resize"}));return h!==1&&(f=Ki(f,h),d=Ki(d,h)),f=ei(f=Oi(f,fa(Qn(d),Qn(f))),e({visibleArea:f,type:"move"})),{coordinates:d=ei(d,Nc(Sr(f),a)),visibleArea:f}}function YR(t){var e=t.event,n=t.getAreaRestrictions,i=t.boundaries,r=t.coordinates,o=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var s=t.positionRestrictions;t.stencilReference;var a=pt({},r),l=pt({},o);if(r&&o&&e.type!=="manipulateImage"){var u={width:0,height:0};l.width,i.width,Zt(i)>Zt(a)?(u.height=.8*i.height,u.width=u.height*Zt(a)):(u.width=.8*i.width,u.height=u.width*Zt(a));var c=Rc(l=Ki(l,a.width*i.width/(l.width*u.width)),n({visibleArea:l,type:"resize"}));l=Ki(l,c),c!==1&&(u.height/=c,u.width/=c),l=ei(l=Oi(l,fa(Qn(a),Qn(l))),n({visibleArea:l,type:"move"})),a=ei(a,Nc(Sr(l),s))}return{coordinates:a,visibleArea:l}}function QR(t){var e=t.event,n=t.coordinates,i=t.visibleArea,r=t.getAreaRestrictions,o=pt({},i),s=pt({},n);if(e.type==="setCoordinates"){var a=Math.max(0,s.width-o.width),l=Math.max(0,s.height-o.height);a>l?o=Ki(o,Math.min(s.width/o.width,pa(o,r({visibleArea:o,type:"resize"})))):l>a&&(o=Ki(o,Math.min(s.height/o.height,pa(o,r({visibleArea:o,type:"resize"}))))),o=ei(o=Oi(o,Dc(ha(s,Sr(o)))),r({visibleArea:o,type:"move"}))}return{visibleArea:o,coordinates:s}}function eN(t){var e=t.imageSize,n=t.visibleArea,i=t.coordinates,r=n||e;return{left:(n?n.left:0)+r.width/2-i.width/2,top:(n?n.top:0)+r.height/2-i.height/2}}function tN(t){var e=t.imageSize,n=t.visibleArea,i=t.aspectRatio,r=t.sizeRestrictions,o=n||e,s=Math.min(i.maximum||1/0,Math.max(i.minimum||0,Zt(o))),a=o.width<o.height?{width:.8*o.width,height:.8*o.width/s}:{height:.8*o.height,width:.8*o.height*s};return Gr(pt(pt({},a),{aspectRatio:i,sizeRestrictions:r}))}function nN(t){var e,n,i=t.imageSize,r=t.visibleArea,o=t.boundaries,s=t.aspectRatio,a=t.sizeRestrictions,l=t.stencilSize,u=r||i;return Zt(u)>Zt(o)?n=(e=l.height*u.height/o.height)*Zt(l):e=(n=l.width*u.width/o.width)/Zt(l),Gr({width:n,height:e,aspectRatio:s,sizeRestrictions:a})}function iN(t){var e=t.getAreaRestrictions,n=t.coordinates,i=t.imageSize,r=Zt(t.boundaries);if(n){var o={height:Math.max(n.height,i.height),width:Math.max(n.width,i.width)},s=u2({width:Zt(o)>r?o.width:o.height*r,height:Zt(o)>r?o.width/r:o.height},Hh(e())),a={left:n.left+n.width/2-s.width/2,top:n.top+n.height/2-s.height/2,width:s.width,height:s.height},l=Gl(n,Sr(pt({left:0,top:0},i))),u={};return!l.left&&!l.right&&a.width<=i.width&&(u.left=0,u.right=i.width),!l.top&&!l.bottom&&a.height<=i.height&&(u.top=0,u.bottom=i.height),ei(a,u)}var c=Zt(i);return s={height:c>r?i.height:i.width/r,width:c>r?i.height*r:i.width},{left:i.width/2-s.width/2,top:i.height/2-s.height/2,width:s.width,height:s.height}}function Bc(t,e){return d2(t,Sr(e))}function rN(t){var e=t.event,n=t.coordinates,i=t.visibleArea,r=t.sizeRestrictions,o=t.getAreaRestrictions,s=t.positionRestrictions,a=t.adjustStencil,l=e.scale,u=e.move,c=pt({},i),d=pt({},n),f=1,p=1,h=l.factor&&Math.abs(l.factor-1)>.001;c=Oi(c,{left:u.left||0,top:u.top||0});var m={stencil:{minimum:Math.max(r.minWidth?r.minWidth/d.width:0,r.minHeight?r.minHeight/d.height:0),maximum:Math.min(r.maxWidth?r.maxWidth/d.width:1/0,r.maxHeight?r.maxHeight/d.height:1/0,pa(d,s))},area:{maximum:pa(c,o({visibleArea:c,type:"resize"}))}};l.factor&&h&&(l.factor<1?(p=Math.max(l.factor,m.stencil.minimum))>1&&(p=1):l.factor>1&&(p=Math.min(l.factor,Math.min(m.area.maximum,m.stencil.maximum)))<1&&(p=1)),p&&(c=Ki(c,p,l.center));var v=n.left-i.left,S=i.width+i.left-(n.width+n.left),b=n.top-i.top,k=i.height+i.top-(n.height+n.top);return c=ei(c=Oi(c,ha(c,{left:s.left!==void 0?s.left-v*p:void 0,top:s.top!==void 0?s.top-b*p:void 0,bottom:s.bottom!==void 0?s.bottom+k*p:void 0,right:s.right!==void 0?s.right+S*p:void 0})),o({visibleArea:c,type:"move"})),d.width=d.width*p,d.height=d.height*p,d.left=c.left+v*p,d.top=c.top+b*p,d=ei(d,Nc(Sr(c),s)),l.factor&&h&&a&&(l.factor>1?f=Math.min(m.area.maximum,l.factor)/p:l.factor<1&&(f=Math.max(d.height/c.height,d.width/c.width,l.factor/p)),f!==1&&(c=Oi(c=ei(c=Ki(c,f,l.factor>1?l.center:Qn(d)),o({visibleArea:c,type:"move"})),Dc(ha(d,Sr(c)))))),{coordinates:d,visibleArea:c}}function oN(t){var e=t.aspectRatio,n=t.getAreaRestrictions,i=t.coordinates,r=t.visibleArea,o=t.sizeRestrictions,s=t.positionRestrictions,a=t.imageSize,l=t.previousImageSize,u=t.angle,c=pt({},i),d=pt({},r),f=xo(Qn(pt({left:0,top:0},l)),u);return(c=pt(pt({},Gr({sizeRestrictions:o,aspectRatio:e,width:c.width,height:c.height})),xo(Qn(c),u))).left-=f.left-a.width/2+c.width/2,c.top-=f.top-a.height/2+c.height/2,d=Ki(d,Rc(d,n({visibleArea:d,type:"resize"}))),{coordinates:c=ei(c,s),visibleArea:d=ei(d=Oi(d,fa(Qn(c),Qn(i))),n({visibleArea:d,type:"move"}))}}function sN(t){var e=t.flip,n=t.previousFlip,i=t.rotate,r=t.getAreaRestrictions,o=t.coordinates,s=t.visibleArea,a=t.imageSize,l=pt({},o),u=pt({},s),c=n.horizontal!==e.horizontal,d=n.vertical!==e.vertical;if(c||d){var f=xo({left:a.width/2,top:a.height/2},-i),p=xo(Qn(l),-i),h=xo({left:c?f.left-(p.left-f.left):p.left,top:d?f.top-(p.top-f.top):p.top},i);l=Oi(l,fa(h,Qn(l))),p=xo(Qn(u),-i),u=ei(u=Oi(u,fa(h=xo({left:c?f.left-(p.left-f.left):p.left,top:d?f.top-(p.top-f.top):p.top},i),Qn(u))),r({visibleArea:u,type:"move"}))}return{coordinates:l,visibleArea:u}}function h2(t){var e=t.directions,n=t.coordinates,i=t.positionRestrictions,r=i===void 0?{}:i,o=t.sizeRestrictions,s=t.preserveRatio,a=t.compensate,l=pt({},e),u=Cr(n,l).width,c=Cr(n,l).height;u<0&&(l.left<0&&l.right<0?(l.left=-(n.width-o.minWidth)/(l.left/l.right),l.right=-(n.width-o.minWidth)/(l.right/l.left)):l.left<0?l.left=-(n.width-o.minWidth):l.right<0&&(l.right=-(n.width-o.minWidth))),c<0&&(l.top<0&&l.bottom<0?(l.top=-(n.height-o.minHeight)/(l.top/l.bottom),l.bottom=-(n.height-o.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(n.height-o.minHeight):l.bottom<0&&(l.bottom=-(n.height-o.minHeight)));var d=Gl(Cr(n,l),r);a&&(d.left&&d.left>0&&d.right===0?(l.right+=d.left,l.left-=d.left):d.right&&d.right>0&&d.left===0&&(l.left+=d.right,l.right-=d.right),d.top&&d.top>0&&d.bottom===0?(l.bottom+=d.top,l.top-=d.top):d.bottom&&d.bottom>0&&d.top===0&&(l.top+=d.bottom,l.bottom-=d.bottom),d=Gl(Cr(n,l),r));var f={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(wr.forEach(function(m){var v=d[m];v&&l[m]&&(f[m]=Math.max(0,1-v/l[m]))}),s){var p=Math.min.apply(null,wr.map(function(m){return f[m]}));p!==1/0&&wr.forEach(function(m){l[m]*=p})}else wr.forEach(function(m){f[m]!==1/0&&(l[m]*=f[m])});if(u=Cr(n,l).width,c=Cr(n,l).height,l.right+l.left&&(u>o.maxWidth?f.width=(o.maxWidth-n.width)/(l.right+l.left):u<o.minWidth&&(f.width=(o.minWidth-n.width)/(l.right+l.left))),l.bottom+l.top&&(c>o.maxHeight?f.height=(o.maxHeight-n.height)/(l.bottom+l.top):c<o.minHeight&&(f.height=(o.minHeight-n.height)/(l.bottom+l.top))),s){var h=Math.min(f.width,f.height);h!==1/0&&wr.forEach(function(m){l[m]*=h})}else f.width!==1/0&&WR.forEach(function(m){l[m]*=f.width}),f.height!==1/0&&qR.forEach(function(m){l[m]*=f.height});return l}function $c(t,e,n){return e==0&&n==0?t/2:e==0?0:n==0?t:t*Math.abs(e/(e+n))}var aN=dr("vue-simple-handler"),lN=dr("vue-simple-handler-wrapper"),Kh={name:"SimpleHandler",components:{HandlerWrapper:o2},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(Ui(t={},this.horizontalPosition,!!this.horizontalPosition),Ui(t,this.verticalPosition,!!this.verticalPosition),Ui(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),Ui(t,"hover",this.hover),t);return{default:Fn(aN(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:Fn(lN(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Kh.render=function(t,e,n,i,r,o){var s=et("HandlerWrapper");return g(),L(s,{class:o.classes.wrapper,"vertical-position":n.verticalPosition,"horizontal-position":n.horizontalPosition,disabled:n.disabled,onDrag:o.onDrag,onDragEnd:o.onDragEnd,onEnter:o.onEnter,onLeave:o.onLeave},{default:z(function(){return[I("div",{class:o.classes.default},null,2)]}),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var uN=dr("vue-simple-line"),cN=dr("vue-simple-line-wrapper"),Wh={name:"SimpleLine",components:{LineWrapper:s2},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:Fn(uN(Ui({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:Fn(cN(Ui({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Wh.render=function(t,e,n,i,r,o){var s=et("LineWrapper");return g(),L(s,{class:o.classes.wrapper,position:n.position,disabled:n.disabled,onDrag:o.onDrag,onDragEnd:o.onDragEnd,onEnter:o.onEnter,onLeave:o.onLeave},{default:z(function(){return[I("div",{class:o.classes.root},null,2)]}),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var qh=dr("vue-bounding-box"),dN=["east","west",null],fN=["south","north",null],m2={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return Kh}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return Wh}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return dN.forEach(function(e){fN.forEach(function(n){if(e!==n){var i=QA(e,n),r=i.name,o=i.classname;t.push({name:r,classname:o,verticalDirection:n,horizontalDirection:e})}})}),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,n=this.linesClasses,i=this.linesWrappersClasses;return{root:qh(),handlers:t,handlersWrappers:e,lines:n,linesWrappers:i}},lineNodes:function(){var t=this,e=[];return this.points.forEach(function(n){n.horizontalDirection&&n.verticalDirection||!t.lines[n.name]||e.push({name:n.name,component:t.linesComponent,class:Fn(t.classes.lines.default,t.classes.lines[n.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:Fn(t.classes.linesWrappers.default,t.classes.linesWrappers[n.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!t.resizable})}),e},handlerNodes:function(){var t=this,e=[],n=this.width,i=this.height;return this.points.forEach(function(r){if(t.handlers[r.name]){var o={name:r.name,component:t.handlersComponent,class:Fn(t.classes.handlers.default,t.classes.handlers[r.name]),wrapperClass:Fn(t.classes.handlersWrappers.default,t.classes.handlersWrappers[r.name]),hoverClass:t.classes.handlers.hover,verticalDirection:r.verticalDirection,horizontalDirection:r.horizontalDirection,disabled:!t.resizable};if(n&&i){var s=r.horizontalDirection,a=r.verticalDirection,l=s==="east"?n:s==="west"?0:n/2,u=a==="south"?i:a==="north"?0:i/2;o.wrapperClass=qh("handler"),o.wrapperStyle={transform:"translate(".concat(l,"px, ").concat(u,"px)")},t.transitions&&t.transitions.enabled&&(o.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else o.wrapperClass=qh("handler",Ui({},r.classname,!0));e.push(o)}}),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,n){var i,r=t.shift(),o=r.left,s=r.top,a={left:0,right:0,top:0,bottom:0};e==="west"?a.left-=o:e==="east"&&(a.right+=o),n==="north"?a.top-=s:n==="south"&&(a.bottom+=s),!n&&e?i="width":n&&!e&&(i="height"),this.resizable&&this.$emit("resize",new HR(a,{allowedDirections:{left:e==="west"||!e,right:e==="east"||!e,bottom:n==="south"||!n,top:n==="north"||!n},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:i}))}},emits:["resize","resize-end"]};m2.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"box",class:o.classes.root,style:o.style},[ee(t.$slots,"default"),I("div",null,[(g(!0),L(le,null,_e(o.lineNodes,function(s){return g(),L(yt(s.component),{key:s.name,"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,position:s.name,disabled:s.disabled,onDrag:function(a){return o.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[1]||(e[1]=function(a){return o.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])}),128))]),(g(!0),L(le,null,_e(o.handlerNodes,function(s){return g(),L("div",{key:s.name,style:s.wrapperStyle,class:s.wrapperClass},[(g(),L(yt(s.component),{"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,"horizontal-position":s.horizontalDirection,"vertical-position":s.verticalDirection,disabled:s.disabled,onDrag:function(a){return o.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[2]||(e[2]=function(a){return o.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)}),128))],6)};var pN=dr("vue-draggable-area"),g2={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:pN()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&t.touches.length===1;e&&(this.touches=gs(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):r2({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&t.button===0){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top;this.anchor={x:t.clientX-n,y:t.clientY-i}},processMove:function(t,e){var n=gs(e);if(this.touches.length){var i=this.$refs.container.getBoundingClientRect(),r=i.left,o=i.top;this.touches.length===1&&n.length===1&&this.$emit("move",new Vh({left:n[0].clientX-(r+this.anchor.x),top:n[0].clientY-(o+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};g2.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)})},[ee(t.$slots,"default")],544)};function Xh(t){var e,n;return{rotate:t.rotate||0,flip:{horizontal:((e=t==null?void 0:t.flip)===null||e===void 0?void 0:e.horizontal)||!1,vertical:((n=t==null?void 0:t.flip)===null||n===void 0?void 0:n.vertical)||!1}}}function hN(t){return new Promise(function(e,n){try{if(t)if(/^data:/i.test(t))e(function(l){l=l.replace(/^data:([^;]+);base64,/gim,"");for(var u=atob(l),c=u.length,d=new ArrayBuffer(c),f=new Uint8Array(d),p=0;p<c;p++)f[p]=u.charCodeAt(p);return d}(t));else if(/^blob:/i.test(t)){var i=new FileReader;i.onload=function(l){e(l.target.result)},o=t,s=function(l){i.readAsArrayBuffer(l)},(a=new XMLHttpRequest).open("GET",o,!0),a.responseType="blob",a.onload=function(){this.status!=200&&this.status!==0||s(this.response)},a.send()}else{var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState===4&&(r.status===200||r.status===0?e(r.response):n("Warning: could not load an image to parse its orientation"),r=null)},r.onprogress=function(){r.getResponseHeader("content-type")!=="image/jpeg"&&r.abort()},r.withCredentials=!1,r.open("GET",t,!0),r.responseType="arraybuffer",r.send(null)}else n("Error: the image is empty")}catch(l){n(l)}var o,s,a})}function v2(t){var e=t.rotate,n=t.flip,i=t.scaleX,r=t.scaleY,o="";return o+=" rotate("+e+"deg) ",o+=" scaleX("+i*(n.horizontal?-1:1)+") ",o+=" scaleY("+r*(n.vertical?-1:1)+") "}function mN(t){try{var e,n=new DataView(t),i=void 0,r=void 0,o=void 0,s=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var a=n.byteLength,l=2;l+1<a;){if(n.getUint8(l)===255&&n.getUint8(l+1)===225){o=l;break}l++}if(o&&(i=o+10,function(p,h,m){var v,S="";for(v=h,m+=h;v<m;v++)S+=String.fromCharCode(p.getUint8(v));return S}(n,o+4,4)==="Exif")){var u=n.getUint16(i);if(((r=u===18761)||u===19789)&&n.getUint16(i+2,r)===42){var c=n.getUint32(i+4,r);c>=8&&(s=i+c)}}if(s){for(var d=n.getUint16(s,r),f=0;f<d;f++)if(l=s+12*f+2,n.getUint16(l,r)===274){l+=8,e=n.getUint16(l,r),n.setUint16(l,1,r);break}}return e}catch{return null}}function y2(t,e){var n=e.getBoundingClientRect(),i=n.left,r=n.top,o={left:0,top:0},s=0;return t.forEach(function(a){o.left+=(a.clientX-i)/t.length,o.top+=(a.clientY-r)/t.length}),t.forEach(function(a){s+=r2({x:o.left,y:o.top},{x:a.clientX-i,y:a.clientY-r})}),{centerMass:o,spread:s,count:t.length}}var Gh={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=Bh(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(this.touches.length===1&&e.length===1)this.$emit("move",new Xl({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=y2(e,this.$refs.container),i=this.oldGeometricProperties;i.count===n.count&&i.count>1&&this.$emit("resize",new Xl({left:i.centerMass.left-n.centerMass.left,top:i.centerMass.top-n.centerMass.top},{factor:i.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?this.eventsFilter(t,this.transforming)!==!1:(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,n=e.getBoundingClientRect(),i=n.left,r=n.top,o=n.bottom,s=n.right;this.touches=gs(t.touches).filter(function(a){return a.clientX>i&&a.clientX<s&&a.clientY>r&&a.clientY<o}),this.oldGeometricProperties=y2(this.touches,e)}},onTouchEnd:function(t){t.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var n=gs(t.touches).filter(function(i){return!i.identifier||e.touches.find(function(r){return r.identifier===i.identifier})});this.processEvent(t)&&(this.processMove(t,n),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&t.buttons===1&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top,r=1+this.wheelResize.ratio*(s=t.deltaY||t.detail||t.wheelDelta,(a=+s)==0||i2(a)?a:a>0?1:-1),o={left:t.clientX-n,top:t.clientY-i};this.$emit("resize",new Xl({},{factor:r,center:o})),this.touches.length||this.debouncedProcessEnd()}var s,a}},emits:["resize","move","transform-end"]};Gh.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)}),onWheel:e[3]||(e[3]=function(){return o.onWheel&&o.onWheel.apply(o,arguments)})},[ee(t.$slots,"default")],544)};var Zh={components:{TransformableImage:Gh},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};Zh.render=function(t,e,n,i,r,o){var s=et("transformable-image");return g(),L(s,{"touch-move":n.touchMove,"touch-resize":n.touchResize,"mouse-move":n.mouseMove,"wheel-resize":n.wheelResize,onMove:e[1]||(e[1]=function(a){return t.$emit("move",a)}),onResize:e[2]||(e[2]=function(a){return t.$emit("resize",a)})},{default:z(function(){return[ee(t.$slots,"default")]}),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var Vc=dr("vue-preview"),b2={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:Vc({fill:this.fill}),wrapper:Vc("wrapper"),imageWrapper:Vc("image-wrapper"),image:Fn(Vc("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=Gt(Gt({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),n=this.imageSize.width,i=this.imageSize.height,r=c2({width:n,height:i},e.rotate),o={width:"".concat(n,"px"),height:"".concat(i,"px"),left:"0px",top:"0px"},s={rotate:{left:(n-r.width)*e.scaleX/2,top:(i-r.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*n/2,top:(1-e.scaleY)*i/2}};return o.transform=`translate(
228
- `.concat(-this.coordinates.left/t-s.rotate.left-s.scale.left,"px,").concat(-this.coordinates.top/t-s.rotate.top-s.scale.top,"px) ")+v2(e),this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",function(){t.refreshImage()}),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};b2.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"root",class:o.classes.root,style:o.style},[I("div",{ref:"wrapper",class:o.classes.wrapper,style:o.wrapperStyle},[ft(I("img",{ref:"image",src:n.image&&n.image.src,class:o.classes.image,style:o.imageStyle},null,14,["src"]),[[Zn,n.image&&n.image.src]])],6)],6)};var A2={components:{Preview:b2},inheritAttrs:!1};A2.render=function(t,e,n,i,r,o){var s=et("preview");return g(),L(s,O(t.$attrs,{fill:!0}),null,16)};var _h=dr("vue-rectangle-stencil"),w2={name:"RectangleStencil",components:{StencilPreview:A2,BoundingBox:m2,DraggableArea:g2},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return Kh}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return Wh}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:Fn(_h({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:Fn(_h("preview"),this.previewClass),boundingBox:Fn(_h("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,i=t.left,r=t.top,o={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(i,"px, ").concat(r,"px)")};return this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};w2.render=function(t,e,n,i,r,o){var s=et("stencil-preview"),a=et("draggable-area"),l=et("bounding-box");return g(),L("div",{class:o.classes.stencil,style:o.style},[I(l,{width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,transitions:n.transitions,class:o.classes.boundingBox,handlers:n.handlers,"handlers-component":n.handlersComponent,"handlers-classes":n.handlersClasses,"handlers-wrappers-classes":n.handlersWrappersClasses,lines:n.lines,"lines-component":n.linesComponent,"lines-classes":n.linesClasses,"lines-wrappers-classes":n.linesWrappersClasses,resizable:n.resizable,onResize:o.onResize,onResizeEnd:o.onResizeEnd},{default:z(function(){return[I(a,{movable:n.movable,onMove:o.onMove,onMoveEnd:o.onMoveEnd},{default:z(function(){return[I(s,{image:n.image,coordinates:n.coordinates,width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,class:o.classes.preview,transitions:n.transitions},null,8,["image","coordinates","width","height","class","transitions"])]}),_:1},8,["movable","onMove","onMoveEnd"])]}),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var gN=["transitions"],Zr=dr("vue-advanced-cropper"),S2={name:"Cropper",components:{BackgroundWrapper:Zh},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return w2}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Zh}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return GR.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,i=t.aspectRatio,r=t.positionRestrictions,o=t.sizeRestrictions,s=pt(pt({},n),{right:n.left+n.width,bottom:n.top+n.height}),a=e.params||{},l=pt({},e.directions),u=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};o.widthFrozen&&(l.left=0,l.right=0),o.heightFrozen&&(l.top=0,l.bottom=0),wr.forEach(function(A){u[A]||(l[A]=0)});var c=Cr(s,l=h2({coordinates:s,directions:l,sizeRestrictions:o,positionRestrictions:r})).width,d=Cr(s,l).height,f=a.preserveRatio?Zt(s):jh(c/d,i);if(f){var p=a.respectDirection;if(p||(p=s.width>=s.height||f===1?"width":"height"),p==="width"){var h=c/f-s.height;if(u.top&&u.bottom){var m=l.top,v=l.bottom;l.bottom=$c(h,v,m),l.top=$c(h,m,v)}else u.bottom?l.bottom=h:u.top?l.top=h:u.right?l.right=0:u.left&&(l.left=0)}else if(p==="height"){var S=s.width-d*f;if(u.left&&u.right){var b=l.left,k=l.right;l.left=-$c(S,b,k),l.right=-$c(S,k,b)}else u.left?l.left=-S:u.right?l.right=-S:u.top?l.top=0:u.bottom&&(l.bottom=0)}l=h2({directions:l,coordinates:s,sizeRestrictions:o,positionRestrictions:r,preserveRatio:!0,compensate:a.compensate})}return c=Cr(s,l).width,d=Cr(s,l).height,(f=a.preserveRatio?Zt(s):jh(c/d,i))&&Math.abs(f-c/d)>.001&&wr.forEach(function(A){u[A]||(l[A]=0)}),Uh({event:new Vh({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:r})}},moveAlgorithm:{type:Function,default:Uh},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,i=Zt(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/i+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,i=t.aspectRatio,r=t.sizeRestrictions,o=t.positionRestrictions,s=pt(pt({},n),Gr({width:n.width,height:n.height,aspectRatio:i,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,r.minHeight),minWidth:Math.min(e.width,r.minWidth)}}));return s=ei(s=Oi(s,fa(Qn(n),Qn(s))),Nc(Sr(e),o))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.getAreaRestrictions,r=t.coordinates,o=pt({},e);o.height=o.width/Zt(n),o.top+=(e.height-o.height)/2,(r.height-o.height>0||r.width-o.width>0)&&(o=Ki(o,Math.max(r.height/o.height,r.width/o.width)));var s=Dc(ha(r,Sr(o=Ki(o,Rc(o,i({visibleArea:o,type:"resize"}))))));return o.width<r.width&&(s.left=0),o.height<r.height&&(s.top=0),o=ei(o=Oi(o,s),i({visibleArea:o,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.imageSize,r=t.imageRestriction,o=t.type,s={};return r==="fill-area"?s={left:0,top:0,right:i.width,bottom:i.height}:r==="fit-area"&&(Zt(n)>Zt(i)?(s={top:0,bottom:i.height},e&&o==="move"&&(e.width>i.width?(s.left=-(e.width-i.width)/2,s.right=i.width-s.left):(s.left=0,s.right=i.width))):(s={left:0,right:i.width},e&&o==="move"&&(e.height>i.height?(s.top=-(e.height-i.height)/2,s.bottom=i.height-s.top):(s.top=0,s.bottom=i.height)))),s}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return t.imageRestriction!=="none"&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:Gt({},a2)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=function(e){return e*Math.PI/180}(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=$h(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:$h(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:Un(this.minWidth)?0:Lc(this.minWidth),minHeight:Un(this.minHeight)?0:Lc(this.minHeight),maxWidth:Un(this.maxWidth)?1/0:Lc(this.maxWidth),maxHeight:Un(this.maxHeight)?1/0:Lc(this.maxHeight)});if(t=function(i){var r=i.areaRestrictions,o=i.sizeRestrictions,s=i.boundaries,a=i.positionRestrictions,l=pt(pt({},o),{minWidth:o.minWidth!==void 0?o.minWidth:0,minHeight:o.minHeight!==void 0?o.minHeight:0,maxWidth:o.maxWidth!==void 0?o.maxWidth:1/0,maxHeight:o.maxHeight!==void 0?o.maxHeight:1/0});a.left!==void 0&&a.right!==void 0&&(l.maxWidth=Math.min(l.maxWidth,a.right-a.left)),a.bottom!==void 0&&a.top!==void 0&&(l.maxHeight=Math.min(l.maxHeight,a.bottom-a.top));var u=Hh(r),c=u2(s,u);return u.width<1/0&&(!l.maxWidth||l.maxWidth>c.width)&&(l.maxWidth=Math.min(l.maxWidth,c.width)),u.height<1/0&&(!l.maxHeight||l.maxHeight>c.height)&&(l.maxHeight=Math.min(l.maxHeight,c.height)),l.minWidth>l.maxWidth&&(l.minWidth=l.maxWidth,l.widthFrozen=!0),l.minHeight>l.maxHeight&&(l.minHeight=l.maxHeight,l.heightFrozen=!0),l}({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=Hh(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Zr(),image:Fn(Zr("image"),this.imageClass),stencil:Zr("stencil"),boundaries:Fn(Zr("boundaries"),this.boundariesClass),stretcher:Fn(Zr("stretcher")),background:Fn(Zr("background"),this.backgroundClass),foreground:Fn(Zr("foreground"),this.foregroundClass),imageWrapper:Fn(Zr("image-wrapper")),cropperWrapper:Fn(Zr("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,n=t.height,i=t.left,r=t.top;return{width:e/this.coefficient,height:n/this.coefficient,left:(i-this.visibleArea.left)/this.coefficient,top:(r-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},i=Gt(Gt({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),r={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-n.left-this.imageTransforms.translateX,"px, ").concat(-e.top-n.top-this.imageTransforms.translateY,"px)")+v2(i)};return this.transitionsOptions.enabled&&(r.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),r}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick(function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()})},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find(function(n){return t[n]!==e[n]})&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=Bh(this.update,this.debounce),this.debouncedDisableTransitions=Bh(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(Gt({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:Gt({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Gt({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Gt({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,r=i===void 0||i;this.onManipulateImage(new Xl({},{factor:1/t,center:e}),{normalize:!1,transitions:r})},move:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,r=i===void 0||i;this.onManipulateImage(new Xl({left:t||0,top:e||0}),{normalize:!1,transitions:r})},setCoordinates:function(t){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.autoZoom,r=i===void 0||i,o=n.transitions,s=o===void 0||o;this.$nextTick(function(){e.imageLoaded?(e.transitionsActive||(s&&e.enableTransitions(),e.coordinates=e.applyTransform(t),r&&e.runAutoZoom("setCoordinates"),s&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t})},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then(function(){t.onChange()}):this.resetVisibleArea().then(function(){t.onChange()})},reset:function(){var t=this;return this.resetVisibleArea().then(function(){t.onChange(!1)})},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick(function(){t(),e.awaiting=!1}))},prepareResult:function(t){return this.roundResult?function(e){var n=e.coordinates,i=e.sizeRestrictions,r=e.positionRestrictions,o={width:Math.round(n.width),height:Math.round(n.height),left:Math.round(n.left),top:Math.round(n.top)};return o.width>i.maxWidth?o.width=Math.floor(n.width):o.width<i.minWidth&&(o.width=Math.ceil(n.width)),o.height>i.maxHeight?o.height=Math.floor(n.height):o.height<i.minHeight&&(o.height=Math.ceil(n.height)),ei(o,r)}(Gt(Gt({},this.getPublicProperties()),{},{positionRestrictions:Bc(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,n,i){var r=this.autoZoomAlgorithm;r||(r=this.stencilSize?JR:this.autoZoom?YR:QR);var o=r({event:{type:t,params:i},visibleArea:e,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return Gt(Gt({},o),{},{changed:!l2(o.visibleArea,e)||!l2(o.coordinates,n)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n!==void 0&&n,r=FR(e,gN),o=this.processAutoZoom(t,this.visibleArea,this.coordinates,r),s=o.visibleArea,a=o.coordinates,l=o.changed;i&&l&&this.enableTransitions(),this.visibleArea=s,this.coordinates=a,i&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return function(e){var n=e.event,i=e.visibleArea,r=e.coefficient;if(n.type==="manipulateImage")return pt(pt({},n),{move:{left:n.move&&n.move.left?r*n.move.left:0,top:n.move&&n.move.top?r*n.move.top:0},scale:{factor:n.scale&&n.scale.factor?n.scale.factor:1,center:n.scale&&n.scale.center?{left:n.scale.center.left*r+i.left,top:n.scale.center.top*r+i.top}:null}});if(n.type==="resize"){var o=pt(pt({},n),{directions:pt({},n.directions)});return wr.forEach(function(a){o.directions[a]*=r}),o}if(n.type==="move"){var s=pt(pt({},n),{directions:pt({},n.directions)});return XR.forEach(function(a){s.directions[a]*=r}),s}return n}(Gt(Gt({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?function(a,l,u){var c=u.rotate,d=u.flip,f={width:l.naturalWidth,height:l.naturalHeight},p=c2(f,c),h=a.getContext("2d");a.height=p.height,a.width=p.width,h.save();var m=xo(Qn(pt({left:0,top:0},f)),c);return h.translate(-(m.left-p.width/2),-(m.top-p.height/2)),h.rotate(c*Math.PI/180),h.translate(d.horizontal?f.width:0,d.vertical?f.height:0),h.scale(d.horizontal?-1:1,d.vertical?-1:1),h.drawImage(l,0,0,f.width,f.height),h.restore(),a}(this.$refs.sourceCanvas,e,this.imageTransforms):e,i=Gt({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),r=function(a){return a.find(function(l){return u=l,!Number.isNaN(parseFloat(u))&&isFinite(u);var u})},o=Gr({sizeRestrictions:{minWidth:r([i.width,i.minWidth])||0,minHeight:r([i.height,i.minHeight])||0,maxWidth:r([i.width,i.maxWidth])||1/0,maxHeight:r([i.height,i.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(i.maxArea&&o.width*o.height>i.maxArea){var s=Math.sqrt(i.maxArea/(o.width*o.height));o={width:Math.round(s*o.width),height:Math.round(s*o.height)}}return function(a,l,u,c,d){a.width=c?c.width:u.width,a.height=c?c.height:u.height;var f=a.getContext("2d");f.clearRect(0,0,a.width,a.height),d&&(d.imageSmoothingEnabled&&(f.imageSmoothingEnabled=d.imageSmoothingEnabled),d.imageSmoothingQuality&&(f.imageSmoothingQuality=d.imageSmoothingQuality),d.fillColor&&(f.fillStyle=d.fillColor,f.fillRect(0,0,a.width,a.height),f.save()));var p=u.left<0?-u.left:0,h=u.top<0?-u.top:0;f.drawImage(l,u.left+p,u.top+h,u.width,u.height,p*(a.width/u.width),h*(a.height/u.height),a.width,a.height)}(t,n,this.coordinates,o,i),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&e?ZR(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,i=this.visibleArea&&e?Bc(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return _R({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:i,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?nN:tN);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var i=da(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,r=this.defaultPosition||eN,o=[i,function(s){var a=s.coordinates;return Gt({},da(r)?r({coordinates:a,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&o.push.apply(o,gs(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(o,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout(function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}},this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then(function(){var i={cropper:n,imageSize:t.imageSize};if(da(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(i):t.defaultBoundaries==="fit"?t.boundaries=function(r){var o=r.cropper,s=r.imageSize,a=o.clientHeight,l=o.clientWidth,u=a,c=s.width*a/s.height;return c>l&&(c=l,u=s.height*l/s.width),{width:c,height:u}}(i):t.boundaries=function(r){var o=r.cropper;return{width:o.clientWidth,height:o.clientHeight}}(i),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")})},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=Gt(Gt({},this.defaultImageTransforms),{},{flip:Gt({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then(function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,n,i,r,o,s,a=t.defaultVisibleArea||iN;t.visibleArea=da(a)?a({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},n=e.visibleArea,i=e.boundaries,r=e.getAreaRestrictions,o=pt({},n),s=Zt(i),o.width/o.height!==s&&(o.height=o.width/s),ei(o,r({visibleArea:o,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")}).catch(function(){t.visibleArea=null})},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then(function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")}).catch(function(){t.visibleArea=null})},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(r){if(t2(r))return!1;var o=window.location,s=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(r)||[],a={protocol:s[1]||"",host:s[2]||"",port:s[3]||""},l=function(u){return u.port||((u.protocol||o.protocol)==="http"?80:433)};return!(!a.protocol&&!a.host&&!a.port||a.protocol&&a.protocol==o.protocol&&a.host&&a.host==o.host&&a.host&&l(a)==l(o))}(this.src)){var n=Un(this.crossOrigin)?this.canvas:this.crossOrigin;n===!0&&(n="anonymous"),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var i=(t=this.src,new Promise(function(r){hN(t).then(function(o){var s=mN(o);r(o?{source:t,arrayBuffer:o,orientation:s}:{source:t,arrayBuffer:null,orientation:null})}).catch(function(o){console.warn(o),r({source:t,arrayBuffer:null,orientation:null})})}));setTimeout(function(){i.then(e.onParseImage)},this.transitionTime)}else setTimeout(function(){e.onParseImage({source:e.src})},this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then(function(){t.$emit("ready"),t.onChange(!1)}))},onParseImage:function(t){var e=this,n=t.source,i=t.arrayBuffer,r=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,i&&r&&r>1?e2(n)||!t2(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([i])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(o){for(var s=[],a=new Uint8Array(o);a.length>0;){var l=a.subarray(0,8192);s.push(String.fromCharCode.apply(null,Array.from?Array.from(l):l.slice())),a=a.subarray(8192)}return"data:image/jpeg;base64,"+btoa(s.join(""))}(i):this.imageAttributes.src=n,da(this.defaultTransforms)?this.appliedImageTransforms=Xh(this.defaultTransforms()):Ic(this.defaultTransforms)?this.appliedImageTransforms=Xh(this.defaultTransforms):this.appliedImageTransforms=function(o){var s=Xh({});if(o)switch(o){case 2:s.flip.horizontal=!0;break;case 3:s.rotate=-180;break;case 4:s.flip.vertical=!0;break;case 5:s.rotate=90,s.flip.vertical=!0;break;case 6:s.rotate=90;break;case 7:s.rotate=90,s.flip.horizontal=!0;break;case 8:s.rotate=-90}return s}(r),this.defaultImageTransforms=Gt(Gt({},this.appliedImageTransforms),{},{flip:Gt({},this.appliedImageTransforms.flip)}),this.$nextTick(function(){var o=e.$refs.image;o&&o.complete&&(function(s){return!!s.naturalWidth}(o)?e.onSuccessLoadImage():e.onFailLoadImage())})},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender(function(){e.coordinates=e.moveAlgorithm(Gt(Gt({},e.getPublicProperties()),{},{positionRestrictions:Bc(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()})},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender(function(){var n=e.sizeRestrictions,i=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(Gt(Gt({},e.getPublicProperties()),{},{positionRestrictions:Bc(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,i),minHeight:Math.max(n.minHeight,i)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1})},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,i=n!==void 0&&n,r=e.normalize,o=r===void 0||r;i&&this.enableTransitions();var s=rN(Gt(Gt({},this.getPublicProperties()),{},{event:o?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),a=s.visibleArea,l=s.coordinates;this.visibleArea=a,this.coordinates=l,this.runAutoZoom("manipulateImage"),this.onChange(),i&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,n=t.type,i=n===void 0?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:i})},getAspectRatio:function(t){var e,n,i=this.stencilProps,r=i.aspectRatio,o=i.minAspectRatio,s=i.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,n=a.maximum}if(Un(e)&&(e=Un(r)?o:r),Un(n)&&(n=Un(r)?s:r),!t&&(Un(e)||Un(n))){var l=this.getStencilSize(),u=l?Zt(l):null;Un(e)&&(e=n2(u)?u:void 0),Un(n)&&(n=n2(u)?u:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,n=t.stencilSize,i=t.aspectRatio,jh(Zt(r=da(n)?n({boundaries:e,aspectRatio:i}):n),i)&&(r=Gr({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:r.width,height:r.height,aspectRatio:{minimum:i.minimum,maximum:i.maximum}})),(r.width>e.width||r.height>e.height)&&(r=Gr({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:r.width,height:r.height,aspectRatio:{minimum:Zt(r),maximum:Zt(r)}})),r;var t,e,n,i,r},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return Gt({},a2)},flip:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,r=i===void 0||i;if(!this.transitionsActive){r&&this.enableTransitions();var o=Gt({},this.imageTransforms.flip),s=sN({flip:{horizontal:t?!o.horizontal:o.horizontal,vertical:e?!o.vertical:o.vertical},previousFlip:o,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=s.visibleArea,l=s.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=a,this.coordinates=l,this.onChange(),r&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n===void 0||n;if(!this.transitionsActive){i&&this.enableTransitions();var r=Gt({},this.imageSize);this.appliedImageTransforms.rotate+=t;var o=oN({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:r,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),s=o.visibleArea,a=o.coordinates,l=this.processAutoZoom("rotateImage",s,a);s=l.visibleArea,a=l.coordinates,this.visibleArea=s,this.coordinates=a,this.onChange(),i&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},vN={key:0,ref:"canvas",style:{display:"none"}},yN={key:1,ref:"sourceCanvas",style:{display:"none"}};S2.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"cropper",class:o.classes.cropper},[I("div",{ref:"stretcher",class:o.classes.stretcher},null,2),I("div",{class:o.classes.boundaries,style:o.boundariesStyle},[(g(),L(yt(n.backgroundWrapperComponent),{class:o.classes.cropperWrapper,"wheel-resize":o.settings.resizeImage.wheel,"touch-resize":o.settings.resizeImage.touch,"touch-move":o.settings.moveImage.touch,"mouse-move":o.settings.moveImage.mouse,onMove:o.onManipulateImage,onResize:o.onManipulateImage},{default:z(function(){return[I("div",{class:o.classes.background,style:o.boundariesStyle},null,6),I("div",{class:o.classes.imageWrapper},[I("img",{ref:"image",crossorigin:r.imageAttributes.crossOrigin,src:r.imageAttributes.src,class:o.classes.image,style:o.imageStyle,onMousedown:e[1]||(e[1]=xt(function(){},["prevent"]))},null,46,["crossorigin","src"])],2),I("div",{class:o.classes.foreground,style:o.boundariesStyle},null,6),ft((g(),L(yt(n.stencilComponent),O({ref:"stencil",image:o.image,coordinates:r.coordinates,"stencil-coordinates":o.stencilCoordinates,transitions:o.transitionsOptions},n.stencilProps,{onResize:o.onResize,onResizeEnd:o.onResizeEnd,onMove:o.onMove,onMoveEnd:o.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[Zn,r.imageLoaded]]),n.canvas?(g(),L("canvas",vN,null,512)):N("",!0),n.canvas?(g(),L("canvas",yN,null,512)):N("",!0)]}),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const C2=["#57291F","#C0413B","#D77B5F","#FF9200","#C87505","#F18E3F","#C14C32","#80003A","#506432","#B30019","#EC410B","#8CB5B5","#6C3400","#FFA400","#41222A","#FFB27B","#BC7576"],k2=()=>{const t=Math.floor(Math.random()*C2.length);return C2[t]},bN=(t,e,n,i)=>{const r=n??k2(),o=document.createElement("canvas");o.style.background=r,o.width=e,o.height=e;const s=o.getContext("2d");if(s){const a="Poppins",l="600",c="#fff";s.font=`${l} 48px/48px ${a}`,s.textAlign="center",s.textBaseline="middle";const d=o.width/2,f=(o.height+8)/2;s.fillStyle=r,s.fillRect(0,0,o.width,o.height),s.fillStyle=c,s.fillText(t,d,f)}return o},AN={class:"!hidden"},wN=ce("InvisibleField",ye({__name:"InvisibleField",props:{value:{type:[String,Array,Number,Boolean,null,Object],default:void 0},fieldName:{default:"invisibleinput"}},setup(t){var i;const e=t,n=sn({value:typeof e.value=="string"?(i=e.value)==null?void 0:i.trim():e.value});return bt(()=>{var r;Object.assign(n,Ln(e.fieldName??"invisibleinput")),e.value!=null&&(n.value=typeof e.value=="string"?(r=e.value)==null?void 0:r.trim():e.value)}),Re(()=>e.value,r=>{n.value=r}),(r,o)=>(g(),T("div",AN))}})),SN=FA(ye({__name:"BackgroundImageCropper",props:{touchMove:{},mouseMove:{},touchResize:{},wheelResize:{}},emits:["move","resize"],setup(t){const e=t,{locale:n}=_t("ImageCompressor"),i=oe(!1),r=re(),o=(a,l)=>{if(a.type==="touchstart"||a.type==="touchmove"){if(a.touches.length===1&&!l)return i.value=!0,r.value="touch",s(),!1;i.value=!1}else if(a.type==="wheel"){if(!l&&!a.ctrlKey)return i.value=!0,r.value="wheel",s(),!1;i.value=!1}a.preventDefault(),a.stopPropagation()},s=()=>{setTimeout(()=>{i.value=!1},1e3)};return(a,l)=>(g(),L(x(Gh),{"events-filter":o,"mouse-move":e.mouseMove,"touch-move":e.touchMove,"touch-resize":e.touchResize,"wheel-resize":e.wheelResize,onMove:l[0]||(l[0]=u=>a.$emit("move",u)),onResize:l[1]||(l[1]=u=>a.$emit("resize",u))},{default:z(()=>[ee(a.$slots,"default",{},void 0,!0),E("div",{class:pe([{"cropper-event-notification--visible":i.value},"cropper-event-notification"])},_(r.value==="wheel"?x(n).cropperCtrlScrollInfo:x(n).cropperTwoFingerInfo),3)]),_:3},8,["mouse-move","touch-move","touch-resize","wheel-resize"]))}}),[["__scopeId","data-v-9031c32d"]]),CN={class:"flex flex-col gap-y-4"},kN={key:0,class:pe(["text-xs font-normal text-grayscale-900","[&_li]:before:content-['•']","[&_li]:before:inline-block [&_li]:before:w-[12px] [&_li]:before:ml-[-12px] pl-3","max-w-[121px] [&_li]:pl-0.5"]),"data-wv-section":"image-requirements-info"},O2=ye({__name:"ImageInputInfo",props:{customRequirements:{},showInfo:{type:Boolean},showAddButton:{type:Boolean}},emits:["addPhoto"],setup(t){const{locale:e}=_t("ImageCompressor");return(n,i)=>{var r;return g(),T("div",CN,[n.showInfo?(g(),T("ul",kN,[(r=n.customRequirements)!=null&&r.length?(g(!0),T(le,{key:0},_e(n.customRequirements,o=>(g(),T("li",{key:o},_(o),1))),128)):(g(),T(le,{key:1},[E("li",null,_(x(e).maxSizeRequirement),1),E("li",null,_(x(e).imageTypeRequirement),1)],64))])):N("",!0),n.showAddButton?(g(),L(We,{key:1,onClick:i[0]||(i[0]=o=>n.$emit("addPhoto")),icon:"add",label:"Add Photo",text:""})):N("",!0),ee(n.$slots,"default")])}}}),ON={key:1,class:"flex gap-1 items-start"},TN=["id","multiple"],xN=["for"],MN=ce("ImageCompressor",ye({__name:"ImageCompressor",props:Cn({initialName:{},multiple:{type:Boolean},defaultImage:{},disabled:{type:Boolean,default:!1},compressedBlob:{default:void 0},imagePreviewUrl:{default:void 0},imagePreviewSize:{default:"big"},rounded:{type:Boolean,default:!1},useDeleteButton:{type:Boolean,default:!0},useValidator:{type:Boolean,default:!1},mandatory:{type:Boolean,default:!1},invalid:{type:Boolean},validatorMessage:{default:"Photo must be uploaded"},label:{default:void 0},fieldName:{default:"imageInput"},fieldInfo:{default:void 0},showInfo:{type:Boolean,default:!0},customRequirements:{default:void 0},confirmOnDelete:{type:Boolean},emitDeleteFn:{type:Boolean},showValidatorMessage:{type:Boolean,default:!0},fileType:{default:"webp"},type:{default:"normal"}},{defaultImage:{default:0},defaultImageModifiers:{}}),emits:Cn(["apply","applyProp","update:defaultImage","update:fieldValue","delete"],["update:defaultImage"]),setup(t,{expose:e,emit:n}){const i=dt("preset",{}).image,r=t,o=n,{locale:s}=_t("ImageCompressor");bt(async()=>{ve(),M()}),Jo(()=>{Pe(0),Pe(1)});const a=re([{src:null,type:null},{src:null,type:null}]),l=k2(),u=re(),c=re(),d=re([]),f=re(),p=oe(0),h=re(),m=re(),v=oe(),S=si(t,"defaultImage"),b=sn({value:r.multiple?[]:void 0}),k=oe(!1),A=oe(),w=oe(0),y=oe(!1),C=re([!1,!1]),P=W(()=>`image/${r.fileType}`),R=U=>typeof d.value[U]=="string"&&d.value[U].includes("data:image/png;base64"),M=async()=>{var U,Y;(U=r.imagePreviewUrl)!=null&&U.length?d.value=Array.isArray(r.imagePreviewUrl)?r.imagePreviewUrl:[r.imagePreviewUrl]:Array.isArray(r.compressedBlob)?d.value=r.compressedBlob:r.compressedBlob?d.value=[r.compressedBlob]:r.initialName?(u.value=bN(r.initialName,125,l),d.value=[(Y=u.value)==null?void 0:Y.toDataURL()]):d.value=[],r.imagePreviewUrl?b.value=r.imagePreviewUrl:r.initialName&&(b.value=await D()),o("applyProp")},D=async()=>new Promise(U=>{var Y;(Y=u.value)==null||Y.toBlob(ke=>{U(new File([ke??new Blob],Date.now()+".png",{type:"image/png"}))})}),$=(U=!1)=>{var Y;r.disabled||(U&&(v.value=1),(Y=f.value)==null||Y.click())},q=async U=>{const{files:Y}=U.target,ke=Array.from(Y??[]).slice(0,d.value.length?1:2);for(const[Fe,H]of ke.entries())try{const he=v.value??Fe;await J(H,he)}catch(he){console.error("Error loading image:",he)}finally{v.value=void 0}},J=async(U,Y)=>{const ke=H=>H.includes("image"),Fe=H=>H>1e6;return new Promise((H,he)=>{var De,nt;if(U)if(ae(Y),!ke(U.type))k.value=!0,A.value=typeof r.validatorMessage!="string"&&((De=r.validatorMessage)!=null&&De.invalidFormat)?r.validatorMessage.invalidFormat:"Tipe file harus berupa gambar!",M(),y.value=!1,Pe(Y),he("Tipe file harus berupa gambar!");else if(Fe(U.size))k.value=!0,A.value=typeof r.validatorMessage!="string"&&((nt=r.validatorMessage)!=null&&nt.exceed)?r.validatorMessage.exceed:"Ukuran gambar terlalu besar! Maks. 1 MB",M(),y.value=!1,Pe(Y),he("Ukuran gambar terlalu besar! Maks. 1 MB");else{Pe(Y);const St=URL.createObjectURL(U),lt=new FileReader;lt.onload=At=>{var Ut;a.value[Y].src=St,a.value[Y].type=me((Ut=At==null?void 0:At.target)==null?void 0:Ut.result,U.type)},lt.onerror=At=>{console.error("🚀 ~ returnnewPromise ~ e:",At)},lt.readAsArrayBuffer(U),v.value==null&&(v.value=Y),y.value||(y.value=!0),k.value=!1,A.value=void 0}w.value+=1,m.value=H})},ve=()=>{r.useValidator&&Object.assign(b,Ln(r.fieldName,U=>{var Y;return!U&&r.mandatory?typeof r.validatorMessage!="string"&&((Y=r.validatorMessage)!=null&&Y.empty)?r.validatorMessage.empty:(r.label??"Photo")+" must be uploaded":r.invalid&&r.validatorMessage?r.validatorMessage:A.value?A.value:!0}))},ae=U=>{a.value[U]={src:null,type:null}},me=(U,Y=null)=>{if(U){const ke=new Uint8Array(U).subarray(0,4);let Fe="";for(const H of ke)Fe+=H.toString(16);switch(Fe){case"89504e47":return"image/png";case"47494638":return"image/gif";case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":return P.value;default:return Y}}return null},se=U=>{const Y=zR(U.split(",")[1],P.value);return window.URL.createObjectURL(Y)},Ie=async(U,Y)=>{const ke=await fetch(U).then(Fe=>Fe.blob());return new File([ke],Y,{type:P.value})},Be=async()=>{const U=v.value??0;try{await de(U)}catch(Y){console.error(Y)}xe()},xe=()=>{var U;y.value=!1,(U=m.value)==null||U.call(m),m.value=void 0},de=async U=>{if(h.value){const Y=h.value.getResult();if(Y.canvas){const ke=Y.canvas.toDataURL(P.value);await ge(ke,U)}}},ge=async(U,Y)=>{try{c.value=document.createElement("canvas");const ke=c.value.getContext("2d"),Fe=new Image;Fe.src=U,await Fe.decode();const H=80/100,he=Fe.width*H,De=Fe.height*H;c.value.setAttribute("width",he.toString()),c.value.setAttribute("height",De.toString()),ke&&ke.drawImage(Fe,0,0,he,De);const nt=c.value.toDataURL(P.value,.95),St=Date.now()+`.${r.fileType}`,lt={canvas:c.value,compressed:{blob:se(nt),base64:nt,fileName:St,file:await Ie(se(nt),St),size:"",type:P.value},message:"File has been compressed."};lt.compressed.size=Math.round(lt.compressed.file.size/1e3)+"KB",d.value[Y]=lt.compressed.blob,r.multiple?b.value&&Array.isArray(b.value)?b.value[Y]=lt.compressed.file:b.value=[lt.compressed.file]:b.value=lt.compressed.file,o("apply",lt)}catch(ke){console.error(ke)}},Pe=U=>{a.value[U].src&&URL.revokeObjectURL(a.value[U].src)},Te=U=>{r.confirmOnDelete?C.value[U]=!0:r.emitDeleteFn?o("delete",ue,U):ue(U)},ue=(U=0)=>{k.value=!1,A.value=void 0,d.value=d.value.toSpliced(U,1),Pe(U),a.value[U]={src:null,type:null},a.value=[a.value[+!U],a.value[U]],v.value=0,S.value=0,r.confirmOnDelete||o("delete"),r.multiple&&Array.isArray(b.value)?b.value=b.value.toSpliced(U,1):b.handleReset&&b.handleReset()},Se=U=>{var ke;const Y=(ke=d.value[U])==null?void 0:ke.toString();v.value=U,Y!=null&&Y.includes("blob")?(v.value=U,y.value=!0):(ae(U),$())},Z=()=>{$()},X=W(()=>navigator.userAgent.includes("Firefox"));return Re(()=>b.value,U=>{(U instanceof File||Array.isArray(U)&&U.some(Y=>Y instanceof File))&&o("update:fieldValue",U)}),Re(A,U=>{U&&b.setErrors&&b.setErrors(U)}),Re(y,U=>{U||p.value++}),Re(()=>r.initialName,()=>{M()}),Re(()=>r.imagePreviewUrl,()=>{M()},{once:!0}),e({assignPreviewImagesFromProp:M}),(U,Y)=>(g(),T(le,null,[I(Yn,{class:pe([{"!w-max":!r.multiple,"!w-full":r.multiple}]),info:r.fieldInfo,label:r.label,mandatory:r.mandatory,"data-wv-name":"image-compressor","data-wv-section":"root"},{default:z(()=>[E("div",{class:pe(["w-full",{"grid gap-6 items-start grid-cols-2":U.multiple&&U.type==="normal"},{"grid gap-3 items-start grid-cols-[max-content,max-content]":U.multiple&&U.type==="inline-table"}]),"data-wv-section":"wrapper"},[d.value.length?(g(!0),T(le,{key:0},_e(d.value,(ke,Fe)=>{var H;return g(),T("div",{key:Fe,class:pe([[{"items-start":U.type==="normal"},{"items-center":U.type==="inline-table"}],"flex gap-1"]),"data-wv-section":"preview"},[E("div",{class:pe(["flex gap-1 items-center",{"max-w-[80px]":U.imagePreviewSize==="medium"},{"max-w-[125px]":U.imagePreviewSize==="big"},{"flex-col":U.type==="normal"}]),"data-wv-section":"preview-image-wrapper"},[E("div",{class:pe([{"[&>span]:hover:opacity-30 [&>[data-wv-section=input-image-trigger]]:hover:opacity-100":R(Fe)},"relative",{"w-[125px] h-[125px]":U.imagePreviewSize==="big"&&U.type==="normal","w-[30px] h-[30px]":U.imagePreviewSize==="small"||U.type==="inline-table","w-[80px] h-[80px]":U.imagePreviewSize==="medium"&&U.type==="normal"}]),"data-wv-section":"image-wrapper"},[I(Ar,{class:pe([{"w-[30px] h-[30px]":U.type==="inline-table"},"transition-opacity duration-300"]),rounded:U.rounded,size:U.type==="normal"?U.imagePreviewSize:"small",src:ke,"data-wv-section":"preview-image"},null,8,["class","rounded","size","src"]),R(Fe)?(g(),T("button",{key:0,class:pe([(H=x(i))==null?void 0:H.button.class,"hover:bg-opacity-0 rounded-lg opacity-0"]),onClick:Y[0]||(Y[0]=he=>$(!1)),"data-wv-section":"input-image-trigger",type:"button"},[I(Me,{class:"w-6 h-6","data-wv-section":"trigger-icon",icon:"image-add",severity:"primary"})],2)):N("",!0)],2),!r.disabled&&!R(Fe)?(g(),T(le,{key:0},[E("div",{class:pe(["flex gap-0.5 justify-center",{"scale-75":U.imagePreviewSize==="medium"}]),"data-wv-section":"preview-buttons"},[U.type==="normal"?(g(),T(le,{key:0},[I(We,{onClick:he=>Se(Fe),class:"!py-0 !px-1 !h-max",icon:"pencil",label:"Edit",text:""},null,8,["onClick"]),U.useDeleteButton?(g(),L(We,{key:0,onClick:he=>Te(Fe),class:"!py-0 !px-1 !h-max",icon:"delete-bin",label:"Delete",severity:"danger",text:""},null,8,["onClick"])):N("",!0)],64)):(g(),T(le,{key:1},[I(Me,{onClick:he=>Se(Fe),class:"text-xs p-0.5 rounded-xs mr-1",icon:"pencil",severity:"primary"},null,8,["onClick"]),I(Me,{onClick:he=>Te(Fe),class:"text-xs p-0.5 rounded-xs",icon:"delete-bin",severity:"danger"},null,8,["onClick"])],64))],2),I(cr,{visible:C.value[Fe],"onUpdate:visible":he=>C.value[Fe]=he,closable:!1,onConfirm:he=>o("delete",ue,Fe),body:"Are you sure you want to delete it?","confirm-label":"Delete",header:"Delete Photo",severity:"danger"},null,8,["visible","onUpdate:visible","onConfirm"])],64)):N("",!0)],2),U.type==="normal"?(g(),L(O2,{key:0,"custom-requirements":U.customRequirements,"show-add-button":d.value.length===1&&r.multiple,"show-info":U.showInfo,onAddPhoto:Y[2]||(Y[2]=he=>$(!0))},{default:z(()=>[d.value.length===2&&r.multiple?(g(),L(vE,{key:0,modelValue:S.value,"onUpdate:modelValue":Y[1]||(Y[1]=he=>S.value=he),"label-id":"default-"+Fe,value:Fe,label:"Set as default"},null,8,["modelValue","label-id","value"])):N("",!0)]),_:2},1032,["custom-requirements","show-add-button","show-info"])):N("",!0),U.multiple&&d.value.length==1&&U.type==="inline-table"?(g(),L(We,{key:1,onClick:Y[3]||(Y[3]=he=>$(!0)),icon:"add",label:"Photo",text:""})):N("",!0)],2)}),128)):U.type!="inline-table"?(g(),T("div",ON,[E("button",{class:pe([{"w-[125px] h-[125px]":U.imagePreviewSize==="big","w-[30px] h-[30px]":U.imagePreviewSize==="small","w-[80px] h-[80px]":U.imagePreviewSize==="medium"},"flex items-center justify-center","ring-inset","cursor-pointer",{"ring-1":X.value,"ring-[0.5px]":!X.value},{"rounded-full":U.rounded,"rounded-lg":!U.rounded},{"ring-general-400 focus-visible:ring-primary-500":!k.value&&!b.errorMessage,"ring-danger-500":k.value||b.errorMessage},{"bg-white":!r.disabled,"bg-general-50":r.disabled}]),onClick:Y[4]||(Y[4]=ke=>$(!1)),"data-wv-section":"input-image-trigger",type:"button"},[I(Me,{class:"w-6 h-6","data-wv-section":"trigger-icon",icon:"image-add",severity:"primary"})],2),I(O2,{"custom-requirements":U.customRequirements,"show-info":U.showInfo},null,8,["custom-requirements","show-info"])])):N("",!0)],2),(g(),T("input",{id:U.fieldName,key:p.value,ref_key:"inputImageFile",ref:f,multiple:r.multiple&&!d.value.length,onChange:q,accept:"image/*",class:"hidden","data-wv-section":"hidden-image-input",type:"file"},null,40,TN)),U.type==="inline-table"&&!d.value.length?(g(),T("label",{key:0,for:U.fieldName,class:"inline-flex items-center cursor-pointer"},Y[6]||(Y[6]=[E("span",{class:"inline-flex items-center text-body-medium rounded-bl rounded-tl bg-general-50 px-3 h-[26px] border-[0.5px] border-general-200"}," Browse ",-1),E("span",{class:"inline-flex items-center text-body-medium !text-general-200 !font-light rounded-br rounded-tr px-3 h-[26px] leading-4 border-[0.5px] border-l-0 border-general-200"}," Select File ",-1)]),8,xN)):N("",!0),U.showValidatorMessage?(g(),L(Rn,{key:1,format:!1,message:b.errorMessage??A.value},null,8,["message"])):N("",!0),r.multiple?(g(),L(wN,{key:2,value:S.value?"secondImage":"firstImage","field-name":"defaultImage"},null,8,["value"])):N("",!0)]),_:1},8,["class","info","label","mandatory"]),I(ur,{visible:y.value,"onUpdate:visible":Y[5]||(Y[5]=ke=>y.value=ke),draggable:!1,header:x(s).cropDialogHeader,class:"w-max max-w-[98vw] min-w-[min(500px,98vw)] !max-h-[94vh]","content-class":"overflow-hidden overflow-y-auto min-h-[100px]","data-wv-section":"dialog-cropper","footer-class":"!gap-1",modal:""},{footer:z(()=>[I(We,{label:x(s).cancelCropLabel,onClick:xe,"data-wv-section":"cancel-crop",severity:"secondary",text:"",type:"button"},null,8,["label"]),I(We,{label:x(s).changeImageLabel,onClick:Z,"data-wv-section":"change-image-button",text:"",type:"button"},null,8,["label"]),I(We,{label:x(s).applyCropLabel,onClick:Be,"data-wv-section":"apply-image-button",severity:"success",type:"button"},null,8,["label"])]),default:z(()=>[v.value!=null?(g(),L(x(S2),{key:0,ref_key:"vueAdvanceCropper",ref:h,"auto-zoom":!1,"background-wrapper-component":SN,src:a.value[v.value].src,class:"upload-example-cropper h-400","foreground-class":"h-400","image-class":"h-400"},null,8,["src"])):N("",!0)]),_:1},8,["visible","header"])],64))}})),EN=["id","disabled","placeholder"],RZ=ce("InputBadge",ye({__name:"InputBadge",props:{type:{default:"text"},modelValue:{},initialValue:{},useValidator:{type:Boolean},existingValues:{},mandatory:{type:Boolean},validatorMessage:{},showValidatorMessage:{type:Boolean,default:!0},invalid:{type:Boolean},fieldName:{default:"inputBadge"},placeholder:{},disabled:{type:Boolean},label:{},fieldInfo:{},preserveDeletedIndex:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e;bt(()=>{var w,y;n.useValidator&&(Object.assign(l,Ln(n.fieldName,C=>Pt(()=>f(C)))),(w=n.initialValue)!=null&&w.length?l.value=n.initialValue:(y=n.modelValue)!=null&&y.length&&(l.value=n.modelValue))}),Vi(()=>{n.useValidator&&l.handleReset()});const r=dt("preset",{}).inputbadge,o=re(null),s=re(),a=oe(),l=sn({value:n.initialValue??n.modelValue??[]}),u=W(()=>{var w;return((w=n.label)==null?void 0:w.toLowerCase)+"-badge-input"}),c=W(()=>n.invalid&&typeof n.validatorMessage=="string"?n.validatorMessage:l.errorMessage),d=W(()=>n.placeholder?n.placeholder:n.type==="email"?"Enter valid email":"Enter value"),f=w=>{var y;if(typeof n.validatorMessage=="string"&&n.invalid)return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{empty:C,exist:P}=n.validatorMessage??{};if(!(w!=null&&w.length)&&n.mandatory)return C??!0;if((y=n.existingValues)!=null&&y.length||P){let R=!0;return w.forEach(M=>{const D=w.filter($=>$===M);(n.existingValues.includes(M)||D.length>1)&&(R=P)}),R}}return!0},p=W(()=>{var w;return n.invalid||!!l.errorMessage||!((w=l.value)!=null&&w.length)&&typeof a.value=="string"&&!a.value.length}),h=W(()=>{var w,y;return!!((y=(w=l.value)==null?void 0:w.filter(Boolean))!=null&&y.length)}),m=w=>/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/.test(w),v=()=>{a.value&&(l.value=[...l.value??[],a.value],a.value=void 0,i("update:modelValue",l.value))},S=w=>{if(n.type==="email"&&o.value&&s.value&&a.value&&!m(a.value)){s.value.show(w,o.value);return}v()},b=w=>{var y;(y=l.value)==null||y.splice(w,1,...n.preserveDeletedIndex?[null]:[]),l.value=go(l.value)},k=w=>{var y,C;w.key==="Backspace"&&!a.value&&(w.preventDefault(),n.type==="text"?a.value=(y=l.value)==null?void 0:y.pop():(C=l.value)==null||C.pop(),l.value=go(l.value))},A=(w,y)=>{l.value&&w&&(l.value[y]=w,l.value=go(l.value),i("update:modelValue",l.value))};return Re(()=>n.initialValue,w=>{w&&(l.value=w)},{once:!0}),Re(()=>n.modelValue,w=>{w&&(l.value=w)}),n.preserveDeletedIndex&&Fa(()=>{var w,y;(w=l.value)!=null&&w.length&&((y=l.value)!=null&&y.every(C=>C==null))&&(l.value=[])}),(w,y)=>(g(),L(Yn,{info:w.fieldInfo,label:n.label,mandatory:n.mandatory},{default:z(()=>{var C,P;return[E("div",O((C=x(r))==null?void 0:C.root({context:{invalidInput:p.value,disabled:w.disabled}}),{"data-wv-name":"inputbadge","data-wv-section":"root"}),[(g(!0),T(le,null,_e(l.value,(R,M)=>(g(),T(le,{key:R},[R?(g(),L(Lt,{key:0,label:R,onRemove:()=>{var D;(D=o.value)==null||D.focus(),b(M)},"onUpdate:label":D=>A(D,M),editable:"",format:"nowrap",removable:"",severity:"dark"},null,8,["label","onRemove","onUpdate:label"])):N("",!0)],64))),128)),E("form",{onSubmit:xt(S,["prevent"]),class:"flex-1","data-wv-section":"form-input"},[ft(E("input",O({id:u.value,ref_key:"badgeInput",ref:o,"onUpdate:modelValue":y[0]||(y[0]=R=>a.value=R)},(P=x(r))==null?void 0:P.input({context:{disabled:w.disabled,value:l.value,showPlaceholder:h.value},parent:w.$parent,props:n}),{disabled:w.disabled,placeholder:d.value,onBlur:S,onFocus:y[1]||(y[1]=R=>{var M;return(M=s.value)==null?void 0:M.hide()}),onInput:y[2]||(y[2]=R=>{var M;return(M=s.value)==null?void 0:M.hide()}),onKeydown:k,"data-wv-section":"input",type:"text"}),null,16,EN),[[Cf,a.value]]),I(Oc,O({ref_key:"op",ref:s},x(r).erroroverlaypanel,{dismissable:!1}),{default:z(()=>[I(Me,O(x(r).erroricon,{icon:"error"}),null,16),y[3]||(y[3]=ht(" Email format is incorrect "))]),_:1,__:[3]},16)],32)],16),n.showValidatorMessage?(g(),L(Rn,{key:0,message:c.value},null,8,["message"])):N("",!0)]}),_:1},8,["info","label","mandatory"]))}})),T2=ce("InputNumber",ye({__name:"InputNumber",props:{modelValue:{},value:{},existingValues:{},label:{},min:{},max:{},maxDigit:{default:16},padStart:{default:0},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},validatorMessage:{},showValidatorMessage:{type:Boolean,default:!0},placeholder:{},disabled:{type:Boolean},invalid:{type:Boolean},showButtons:{type:Boolean},size:{},mode:{},currency:{},locale:{},prefix:{},suffix:{},minFractionDigits:{default:0},maxFractionDigits:{default:2},useGrouping:{type:Boolean},fieldInfo:{},tooltipPos:{},addonVariant:{default:"filled"},addonLeftClass:{},addonRightClass:{},inputGroupClass:{},inputNumberClass:{},inputId:{},autoResize:{type:Boolean},allowEmptyValue:{type:Boolean,default:!0}},emits:["update:modelValue","input"],setup(t,{emit:e}){const n=t,i=e,r=ja(),o=dt("preset",{}).inputgroupaddon,{locale:s}=_t("InputNumber"),a=dt("preset",{}).inputnumber,l=oe(0),u=re(),c=sn({value:n.value??n.modelValue}),d=W(()=>{var y,C;return n.placeholder??((C=s.defaultPlaceholder)==null?void 0:C.replace("{label}",n.label?(y=n.label)==null?void 0:y.toLowerCase():""))});bt(()=>{n.useValidator&&Object.assign(c,Ln(n.fieldName??"numberInput",P=>Pt(()=>h(P))));const y=n.value??n.modelValue,C=y!=null?w(y):y;C!=null&&n.allowEmptyValue?c.value=C:n.allowEmptyValue||(c.value=C??n.min??0),n.invalid&&n.useValidator&&c.validate()});const f=W(()=>n.invalid||!!c.errorMessage),p=W(()=>n.inputId?n.inputId:(n.label??n.fieldName??"input-number").toLowerCase().trim().replaceAll(" ","-")+"-inputnumber"),h=y=>{var P,R;const C=y!=null&&typeof y=="number";if(n.invalid&&typeof n.validatorMessage=="string")return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{empty:M,exist:D}=n.validatorMessage??{};if(y==null&&n.mandatory)return M??s.emptyInvalidText.replace("{label}",n.label);if(C&&((P=n.existingValues)!=null&&P.includes(y)))return D??((R=s.alreadyExistInvalidText)==null?void 0:R.replace("{label}",n.label))}return!0},m=()=>{l.value++,Pt(()=>{var P;const y=(P=u.value)==null?void 0:P.$el,C=y==null?void 0:y.querySelector("input");C==null||C.focus()})},v=(y,C)=>{const P=C==="input"?y.value:y;let M=(()=>{if(P!=null)return P!=="-"?+P:P})();if(M!=null&&!isNaN(+M))M=P!=null?+P:void 0,S(C,M);else if(M==null&&typeof M!="string"){const D=n.allowEmptyValue?M:M??n.min??0;c.value=D,C==="input"?(!n.allowEmptyValue&&u.value&&m(),i("input",D)):i("update:modelValue",D)}},S=(y,C)=>{const P=typeof C=="number"?b(C):!1;let R=C==null?void 0:C.toString().slice(0,C<0?n.maxDigit+1:n.maxDigit);R!=null&&(R=+(R??0)),c.value=P?+(R??0):C,P&&m(),i(y==="input"?"input":"update:modelValue",P?+(R??0):C)},b=y=>y!=null&&y.toString().length>(n.maxDigit>16?16:n.maxDigit),k=()=>{const y=+(c.value??0)+1;(n.max&&n.max>=y||n.max==null)&&v(y,"modelValue")},A=()=>{const y=+(c.value??0)-1;(n.min&&n.min<=y||n.min==null)&&v(y,"modelValue")},w=y=>n.min&&y<n.min?n.min:n.max&&y>n.max?n.max:y;return Re(()=>n.value,y=>{const C=y!=null?w(y):y;b(C)||(c.value=C)},{once:!0}),Re(()=>n.modelValue,y=>{const C=y!=null?w(y):y;b(C)||(c.value=C)}),(y,C)=>(g(),L(Yn,{info:y.fieldInfo,label:n.label,mandatory:n.mandatory,"tooltip-pos":y.tooltipPos},Dn({default:z(()=>[I(br,{class:pe(["grid ",{"grid-cols-[max-content,1fr,max-content]":r["addon-left"]&&r["addon-right"]||y.showButtons,"grid-cols-[1fr,max-content]":!r["addon-left"]&&r["addon-right"],"grid-cols-[max-content,1fr]":r["addon-left"]&&!r["addon-right"]},{"w-max":y.autoResize},y.inputGroupClass]),disabled:n.disabled,invalid:f.value},{default:z(()=>[r["addon-left"]||n.showButtons?(g(),L(x(ps),{key:0,class:pe([y.addonLeftClass,{"cursor-pointer":n.showButtons}]),disabled:y.disabled,pt:{root:x(o).root({props:n})},onClick:C[0]||(C[0]=P=>n.showButtons&&!n.disabled?A():void 0)},{default:z(()=>[ee(y.$slots,"addon-left",{},()=>[I(Me,O(x(a).decrementicon({props:n}),{icon:"subtract"}),null,16)])]),_:3},8,["class","disabled","pt"])):N("",!0),E("span",{class:pe(["relative",{"w-max":y.autoResize}]),"data-wv-section":"autoresizeinputwrapper"},[y.autoResize?(g(),T("span",O({key:0,"data-wv-section":"inputresizer"},x(a).inputresizer),_((c.value??"").toString().padStart(y.padStart,"0")),17)):N("",!0),(g(),L(x(Ul),O({key:l.value,ref_key:"inputNumber",ref:u},n,{class:[y.inputNumberClass,{"absolute left-0 top-0":y.autoResize}],"input-id":p.value,"model-value":c.value,placeholder:y.autoResize?"":d.value,"show-buttons":!1,onInput:C[1]||(C[1]=P=>v(P,"input")),"onUpdate:modelValue":C[2]||(C[2]=P=>v(P,"modelValue"))}),null,16,["class","input-id","model-value","placeholder"]))],2),r["addon-right"]||n.showButtons?(g(),L(x(ps),{key:1,class:pe([y.addonRightClass,{"cursor-pointer":n.showButtons}]),disabled:y.disabled,pt:{root:x(o).root({props:n})},onClick:C[3]||(C[3]=P=>n.showButtons&&!y.disabled?k():void 0)},{default:z(()=>[ee(y.$slots,"addon-right",{},()=>[I(Me,O(x(a).incrementicon({props:n}),{icon:"add"}),null,16)])]),_:3},8,["class","disabled","pt"])):N("",!0)]),_:3},8,["class","disabled","invalid"]),ee(y.$slots,"validatormessage",{},()=>[n.showValidatorMessage?(g(),L(Rn,{key:0,message:c.errorMessage},null,8,["message"])):N("",!0)])]),_:2},[r["field-label-addon"]?{name:"label-addon",fn:z(()=>[ee(y.$slots,"field-label-addon")]),key:"0"}:void 0]),1032,["info","label","mandatory","tooltip-pos"]))}})),NZ=ce("InputCurrency",ye({__name:"InputCurrency",props:{modelValue:{},value:{},label:{},max:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},validatorMessage:{},invalid:{type:Boolean},placeholder:{},disabled:{type:Boolean},showButtons:{type:Boolean},size:{},mode:{},useGrouping:{type:Boolean},fieldInfo:{},inputnNumberId:{}},emits:["update:modelValue","input"],setup(t,{emit:e}){var k,A;const n=t,i=e;bt(()=>{n.useValidator&&(Object.assign(f,Ln(n.fieldName??"currencyInput",w=>{var y;return!(w!=null&&w.value)&&n.mandatory?typeof n.validatorMessage=="object"&&"empty"in n.validatorMessage?n.validatorMessage.empty.replace("{label}",n.label):(y=r.emptyInputErrorMessage)==null?void 0:y.replace("{label}",n.label):!0})),n.modelValue&&(f.value=n.modelValue))});const{locale:r}=_t("InputCurrency"),{locale:o}=_t("Dropdown"),{dropdown:s={},inputcurrency:a={}}=dt("preset",{}),l=oe(!1),u=oe((k=n.modelValue)==null?void 0:k.value),c=navigator.userAgent.includes("Firefox"),d=oe(hp((A=n.modelValue)==null?void 0:A.currency)),f=sn({value:n.modelValue}),p=oe(w1),h=W(()=>{var w;return(w=d.value)==null?void 0:w.locale}),m=W(()=>n.inputnNumberId?n.inputnNumberId:(n.label??n.fieldName??"input-number").toLowerCase().trim().replaceAll(" ","-")+"-inputnumber"),v=W(()=>n.invalid||!!f.errorMessage),S=({currency:w},y)=>{const C={currency:w,value:y};i("update:modelValue",C),f.value=C},b=()=>{Pt(()=>{const w=document.getElementById(m.value);w&&w.focus()})};return Re(()=>n.modelValue,()=>{var w,y,C;d.value=(w=n.modelValue)!=null&&w.currency?hp((y=n.modelValue)==null?void 0:y.currency):d.value,f.value=n.modelValue,u.value=(C=n.modelValue)==null?void 0:C.value}),(w,y)=>(g(),L(T2,O(n,{modelValue:u.value,"onUpdate:modelValue":[y[4]||(y[4]=C=>u.value=C),y[5]||(y[5]=C=>S(d.value,C))],"input-id":m.value,"input-number-class":x(a).value({isFirefoxBased:x(c),invalidInput:v.value}).class,locale:h.value,"min-fraction-digits":0,"use-validator":!1,"addon-left-class":"!p-0 !bg-transparent","input-group-class":"!ring-0",mode:"decimal","use-grouping":""}),{"addon-left":z(()=>[I(x(qr),{modelValue:d.value,"onUpdate:modelValue":[y[0]||(y[0]=C=>d.value=C),y[3]||(y[3]=C=>S(C,u.value))],class:pe(x(a).currency({isFirefoxBased:x(c),invalidInput:v.value}).class),"filter-fields":["label","currency"],"filter-placeholder":x(o).filterPlaceholder,options:p.value,pt:{input:{class:["py-1 pl-3 pr-0.5",x(s).input({props:{modelValue:d.value}}).class]}},onHide:y[1]||(y[1]=C=>(l.value=!1,b())),onShow:y[2]||(y[2]=C=>l.value=!0),"data-key":"currency",filter:"","option-label":"symbol"},{dropdownicon:z(()=>[I(Me,it(Ot(x(s).dropdownicon({state:{isShowOverlay:l.value}}))),null,16)]),option:z(({option:C})=>[ht(_(C.label),1)]),_:1},8,["modelValue","class","filter-placeholder","options","pt"])]),validatormessage:z(()=>[I(Rn,{message:f.errorMessage},null,8,["message"])]),_:1},16,["modelValue","input-id","input-number-class","locale"]))}})),BZ=ce("InputEmail",ye({__name:"InputEmail",props:{allowedCharacters:{},autoUppercase:{type:Boolean},modelValue:{},value:{},existingValues:{},checkAvailability:{},maxLength:{},label:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},manualInvalidContainer:{type:Boolean},validatorMessage:{},validatorMessageClass:{},placeholder:{},disabled:{type:Boolean},fieldInfo:{},inputClass:{},inputContainerClass:{},labelClass:{},blurOnReachMaxLength:{type:Boolean},preventInputOnMaxLength:{type:Boolean},validateOnBlur:{type:Boolean},useProtocol:{type:Boolean,default:!0},allowSpecialCharacters:{type:Boolean,default:!0},useInputGroup:{type:Boolean,default:!0},inputId:{}},emits:["update:modelValue","blur","input"],setup(t){return(e,n)=>(g(),L(ca,O({onBlur:n[0]||(n[0]=i=>e.$emit("blur",i)),onInput:n[1]||(n[1]=i=>e.$emit("input",i)),"onUpdate:modelValue":n[2]||(n[2]=i=>e.$emit("update:modelValue",i))},e.$props,{type:"email","validate-on-blur":""}),null,16))}})),$Z=ce("InputOtp",ye({__name:"InputOtp",props:{disabled:{type:Boolean},integerOnly:{type:Boolean},invalid:{type:Boolean},length:{},mask:{type:Boolean},modelValue:{},onBlur:{type:Function},onChange:{type:Function},onCompleted:{type:Function},onFocus:{type:Function},"onUpdate:modelValue":{type:Function},pt:{},readonly:{type:Boolean},variant:{}},setup(t){return(e,n)=>(g(),L(x(vT),O(e.$props,{onVnodeBeforeMount:n[0]||(n[0]=i=>x(Rb)("WANGS-INPUT-OTP",e.$preset.inputotp))}),null,16))}}));var x2={name:"EyeSlashIcon",extends:bn},PN=E("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.9414 6.74792C13.9437 6.75295 13.9455 6.757 13.9469 6.76003C13.982 6.8394 14.0001 6.9252 14.0001 7.01195C14.0001 7.0987 13.982 7.1845 13.9469 7.26386C13.6004 8.00059 13.1711 8.69549 12.6674 9.33515C12.6115 9.4071 12.54 9.46538 12.4582 9.50556C12.3765 9.54574 12.2866 9.56678 12.1955 9.56707C12.0834 9.56671 11.9737 9.53496 11.8788 9.47541C11.7838 9.41586 11.7074 9.3309 11.6583 9.23015C11.6092 9.12941 11.5893 9.01691 11.6008 8.90543C11.6124 8.79394 11.6549 8.68793 11.7237 8.5994C12.1065 8.09726 12.4437 7.56199 12.7313 6.99995C12.2595 6.08027 10.3402 2.8014 6.99732 2.8014C6.63723 2.80218 6.27816 2.83969 5.92569 2.91336C5.77666 2.93304 5.62568 2.89606 5.50263 2.80972C5.37958 2.72337 5.29344 2.59398 5.26125 2.44714C5.22907 2.30031 5.2532 2.14674 5.32885 2.01685C5.40451 1.88696 5.52618 1.79021 5.66978 1.74576C6.10574 1.64961 6.55089 1.60134 6.99732 1.60181C11.5916 1.60181 13.7864 6.40856 13.9414 6.74792ZM2.20333 1.61685C2.35871 1.61411 2.5091 1.67179 2.6228 1.77774L12.2195 11.3744C12.3318 11.4869 12.3949 11.6393 12.3949 11.7983C12.3949 11.9572 12.3318 12.1097 12.2195 12.2221C12.107 12.3345 11.9546 12.3976 11.7956 12.3976C11.6367 12.3976 11.4842 12.3345 11.3718 12.2221L10.5081 11.3584C9.46549 12.0426 8.24432 12.4042 6.99729 12.3981C2.403 12.3981 0.208197 7.59135 0.0532336 7.25198C0.0509364 7.24694 0.0490875 7.2429 0.0476856 7.23986C0.0162332 7.16518 3.05176e-05 7.08497 3.05176e-05 7.00394C3.05176e-05 6.92291 0.0162332 6.8427 0.0476856 6.76802C0.631261 5.47831 1.46902 4.31959 2.51084 3.36119L1.77509 2.62545C1.66914 2.51175 1.61146 2.36136 1.61421 2.20597C1.61695 2.05059 1.6799 1.90233 1.78979 1.79244C1.89968 1.68254 2.04794 1.6196 2.20333 1.61685ZM7.45314 8.35147L5.68574 6.57609V6.5361C5.5872 6.78938 5.56498 7.06597 5.62183 7.33173C5.67868 7.59749 5.8121 7.84078 6.00563 8.03158C6.19567 8.21043 6.43052 8.33458 6.68533 8.39089C6.94014 8.44721 7.20543 8.43359 7.45314 8.35147ZM1.26327 6.99994C1.7351 7.91163 3.64645 11.1985 6.99729 11.1985C7.9267 11.2048 8.8408 10.9618 9.64438 10.4947L8.35682 9.20718C7.86027 9.51441 7.27449 9.64491 6.69448 9.57752C6.11446 9.51014 5.57421 9.24881 5.16131 8.83592C4.74842 8.42303 4.4871 7.88277 4.41971 7.30276C4.35232 6.72274 4.48282 6.13697 4.79005 5.64041L3.35855 4.2089C2.4954 5.00336 1.78523 5.94935 1.26327 6.99994Z",fill:"currentColor"},null,-1),IN=[PN];function LN(t,e,n,i,r,o){return g(),T("svg",O({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),IN,16)}x2.render=LN;var DN={root:function(e){var n=e.props;return{position:n.appendTo==="self"?"relative":void 0}}},RN={root:function(e){var n=e.instance,i=e.props;return["p-password p-component p-inputwrapper",{"p-inputwrapper-filled":n.filled,"p-inputwrapper-focus":n.focused,"p-icon-field p-icon-field-right":i.toggleMask}]},input:function(e){var n=e.props;return["p-password-input",{"p-disabled":n.disabled}]},hideIcon:"p-input-icon",showIcon:"p-input-icon",panel:function(e){var n=e.instance;return["p-password-panel p-component",{"p-ripple-disabled":n.$primevue.config.ripple===!1}]},meter:"p-password-meter",meterLabel:function(e){var n=e.instance;return"p-password-strength ".concat(n.meter?n.meter.strength:"")},info:"p-password-info"},NN=Xt.extend({name:"password",classes:RN,inlineStyles:DN}),BN={name:"BasePassword",extends:It,props:{modelValue:String,promptLabel:{type:String,default:null},mediumRegex:{type:[String,RegExp],default:"^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"},strongRegex:{type:[String,RegExp],default:"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})"},weakLabel:{type:String,default:null},mediumLabel:{type:String,default:null},strongLabel:{type:String,default:null},feedback:{type:Boolean,default:!0},appendTo:{type:[String,Object],default:"body"},toggleMask:{type:Boolean,default:!1},hideIcon:{type:String,default:void 0},showIcon:{type:String,default:void 0},variant:{type:String,default:null},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:NN,provide:function(){return{$parentInstance:this}}},M2={name:"Password",extends:BN,inheritAttrs:!1,emits:["update:modelValue","change","focus","blur","invalid"],data:function(){return{id:this.$attrs.id,overlayVisible:!1,meter:null,infoText:null,focused:!1,unmasked:!1}},watch:{"$attrs.id":function(e){this.id=e||jn()}},mediumCheckRegExp:null,strongCheckRegExp:null,resizeListener:null,scrollHandler:null,overlay:null,mounted:function(){this.id=this.id||jn(),this.infoText=this.promptText,this.mediumCheckRegExp=new RegExp(this.mediumRegex),this.strongCheckRegExp=new RegExp(this.strongRegex)},beforeUnmount:function(){this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(pn.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter:function(e){pn.set("overlay",e,this.$primevue.config.zIndex.overlay),G.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave:function(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave:function(e){pn.clear(e)},alignOverlay:function(){this.appendTo==="self"?G.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=G.getOuterWidth(this.$refs.input.$el)+"px",G.absolutePosition(this.overlay,this.$refs.input.$el))},testStrength:function(e){var n=0;return this.strongCheckRegExp.test(e)?n=3:this.mediumCheckRegExp.test(e)?n=2:e.length&&(n=1),n},onInput:function(e){this.$emit("update:modelValue",e.target.value),this.$emit("change",e)},onFocus:function(e){this.focused=!0,this.feedback&&(this.setPasswordMeter(this.modelValue),this.overlayVisible=!0),this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.feedback&&(this.overlayVisible=!1),this.$emit("blur",e)},onKeyUp:function(e){if(this.feedback){var n=e.target.value,i=this.checkPasswordStrength(n),r=i.meter,o=i.label;if(this.meter=r,this.infoText=o,e.code==="Escape"){this.overlayVisible&&(this.overlayVisible=!1);return}this.overlayVisible||(this.overlayVisible=!0)}},setPasswordMeter:function(){if(!this.modelValue){this.meter=null,this.infoText=this.promptText;return}var e=this.checkPasswordStrength(this.modelValue),n=e.meter,i=e.label;this.meter=n,this.infoText=i,this.overlayVisible||(this.overlayVisible=!0)},checkPasswordStrength:function(e){var n=null,i=null;switch(this.testStrength(e)){case 1:n=this.weakText,i={strength:"weak",width:"33.33%"};break;case 2:n=this.mediumText,i={strength:"medium",width:"66.66%"};break;case 3:n=this.strongText,i={strength:"strong",width:"100%"};break;default:n=this.promptText,i=null;break}return{label:n,meter:i}},onInvalid:function(e){this.$emit("invalid",e)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new Ws(this.$refs.input.$el,function(){e.overlayVisible&&(e.overlayVisible=!1)})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!G.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},overlayRef:function(e){this.overlay=e},onMaskToggle:function(){this.unmasked=!this.unmasked},onOverlayClick:function(e){So.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{inputType:function(){return this.unmasked?"text":"password"},filled:function(){return this.modelValue!=null&&this.modelValue.toString().length>0},weakText:function(){return this.weakLabel||this.$primevue.config.locale.weak},mediumText:function(){return this.mediumLabel||this.$primevue.config.locale.medium},strongText:function(){return this.strongLabel||this.$primevue.config.locale.strong},promptText:function(){return this.promptLabel||this.$primevue.config.locale.passwordPrompt},panelUniqueId:function(){return this.id+"_panel"}},components:{PInputText:Xr,Portal:Wr,EyeSlashIcon:x2,EyeIcon:oh}};function Zl(t){"@babel/helpers - typeof";return Zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zl(t)}function E2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function P2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?E2(Object(n),!0).forEach(function(i){$N(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function $N(t,e,n){return e=VN(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VN(t){var e=zN(t,"string");return Zl(e)=="symbol"?e:String(e)}function zN(t,e){if(Zl(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Zl(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var FN=["id"];function jN(t,e,n,i,r,o){var s=et("PInputText"),a=et("Portal");return g(),T("div",O({class:t.cx("root"),style:t.sx("root")},t.ptmi("root")),[I(s,O({ref:"input",id:t.inputId,type:o.inputType,class:[t.cx("input"),t.inputClass],style:t.inputStyle,value:t.modelValue,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-controls":t.panelProps&&t.panelProps.id||t.panelId||o.panelUniqueId,"aria-expanded":r.overlayVisible,"aria-haspopup":!0,placeholder:t.placeholder,required:t.required,disabled:t.disabled,variant:t.variant,invalid:t.invalid,onInput:o.onInput,onFocus:o.onFocus,onBlur:o.onBlur,onKeyup:o.onKeyUp,onInvalid:o.onInvalid},t.inputProps,{pt:t.ptm("input"),unstyled:t.unstyled}),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","required","disabled","variant","invalid","onInput","onFocus","onBlur","onKeyup","onInvalid","pt","unstyled"]),t.toggleMask&&r.unmasked?ee(t.$slots,"hideicon",{key:0,onClick:o.onMaskToggle,toggleCallback:o.onMaskToggle},function(){return[(g(),L(yt(t.hideIcon?"i":"EyeSlashIcon"),O({class:[t.cx("hideIcon"),t.hideIcon],onClick:o.onMaskToggle},t.ptm("hideIcon")),null,16,["class","onClick"]))]}):N("",!0),t.toggleMask&&!r.unmasked?ee(t.$slots,"showicon",{key:1,onClick:o.onMaskToggle,toggleCallback:o.onMaskToggle},function(){return[(g(),L(yt(t.showIcon?"i":"EyeIcon"),O({class:[t.cx("showIcon"),t.showIcon],onClick:o.onMaskToggle},t.ptm("showIcon")),null,16,["class","onClick"]))]}):N("",!0),E("span",O({class:"p-hidden-accessible","aria-live":"polite"},t.ptm("hiddenAccesible"),{"data-p-hidden-accessible":!0}),_(r.infoText),17),I(a,{appendTo:t.appendTo},{default:z(function(){return[I(Vr,O({name:"p-connected-overlay",onEnter:o.onOverlayEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},t.ptm("transition")),{default:z(function(){return[r.overlayVisible?(g(),T("div",O({key:0,ref:o.overlayRef,id:t.panelId||o.panelUniqueId,class:[t.cx("panel"),t.panelClass],style:t.panelStyle,onClick:e[0]||(e[0]=function(){return o.onOverlayClick&&o.onOverlayClick.apply(o,arguments)})},P2(P2({},t.panelProps),t.ptm("panel"))),[ee(t.$slots,"header"),ee(t.$slots,"content",{},function(){return[E("div",O({class:t.cx("meter")},t.ptm("meter")),[E("div",O({class:t.cx("meterLabel"),style:{width:r.meter?r.meter.width:""}},t.ptm("meterLabel")),null,16)],16),E("div",O({class:t.cx("info")},t.ptm("info")),_(r.infoText),17)]}),ee(t.$slots,"footer")],16,FN)):N("",!0)]}),_:3},16,["onEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo"])],16)}M2.render=jN;const HN=["onClick"],UN=["onClick"],VZ=ce("InputPassword",ye({__name:"InputPassword",props:{modelValue:{},label:{},labelClass:{},inputContainerClass:{},mandatory:{type:Boolean},placeholder:{},feedback:{type:Boolean},fieldName:{},useValidator:{type:Boolean},invalid:{type:Boolean},validatorMessage:{},validatorMessageClass:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=dt("preset",{}).password,i=t,r=e,o=re(i.modelValue),s=sn({value:void 0}),a=W(()=>i.invalid||!!s.errorMessage);bt(()=>{i.useValidator&&(Object.assign(s,Ln(i.fieldName??"password",d=>Pt(()=>l(d==null?void 0:d.trim())))),i.modelValue!=null&&(s.value=i.modelValue))});const l=d=>{if(typeof i.validatorMessage=="string"&&i.invalid)return i.validatorMessage;if(typeof i.validatorMessage!="string"){const{empty:f}=i.validatorMessage??{};if(!d&&i.mandatory)return f??!0}return!0},u=d=>{r("update:modelValue",d),i.useValidator&&(s.value=d)},c=d=>{const f=d.target;f.previousElementSibling&&f.previousElementSibling.tagName==="INPUT"&&f.previousElementSibling.focus()};return Re(()=>i.modelValue,d=>{o.value=d,s.value=d}),Re(()=>i.invalid,()=>{var d;(d=s.validate)==null||d.call(s)}),(d,f)=>(g(),L(Yn,{label:i.label,"label-class":i.labelClass,mandatory:i.mandatory},{default:z(()=>[I(br,{class:pe(i.inputContainerClass),invalid:a.value},{default:z(()=>[I(x(M2),{modelValue:o.value,"onUpdate:modelValue":[f[0]||(f[0]=p=>o.value=p),u],feedback:i.feedback,invalid:a.value,placeholder:i.placeholder,"toggle-mask":""},{showicon:z(({toggleCallback:p})=>{var h;return[E("button",{class:pe([(h=x(n))==null?void 0:h.showicon.class,"unset"]),onClick:m=>(p(),c(m))},[I(Me,{icon:"eye"})],10,HN)]}),hideicon:z(({toggleCallback:p})=>{var h;return[E("button",{class:pe([(h=x(n))==null?void 0:h.showicon.class,"unset"]),onClick:m=>(p(),c(m))},[I(Me,{icon:"eye-off"})],10,UN)]}),_:1},8,["modelValue","feedback","invalid","placeholder"])]),_:1},8,["class","invalid"]),I(Rn,{class:pe(i.validatorMessageClass),message:s.errorMessage},null,8,["class","message"])]),_:1},8,["label","label-class","mandatory"]))}})),KN={Andorra:"Andorra",Dubai:"United Arab Emirates",Kabul:"Afghanistan",Tirane:"Albania",Yerevan:"Armenia",Casey:"Antarctica",Davis:"Antarctica",Mawson:"Antarctica",Palmer:"Antarctica",Rothera:"Antarctica",Troll:"Antarctica",Vostok:"Antarctica",Buenos_Aires:"Argentina",Cordoba:"Argentina",Salta:"Argentina",Jujuy:"Argentina",Tucuman:"Argentina",Catamarca:"Argentina",La_Rioja:"Argentina",San_Juan:"Argentina",Mendoza:"Argentina",San_Luis:"Argentina",Rio_Gallegos:"Argentina",Ushuaia:"Argentina",Pago_Pago:"Samoa (American)",Vienna:"Austria",Lord_Howe:"Australia",Macquarie:"Australia",Hobart:"Australia",Melbourne:"Australia",Sydney:"Australia",Broken_Hill:"Australia",Brisbane:"Australia",Lindeman:"Australia",Adelaide:"Australia",Darwin:"Australia",Perth:"Australia",Eucla:"Australia",Baku:"Azerbaijan",Barbados:"Barbados",Dhaka:"Bangladesh",Brussels:"Belgium",Sofia:"Bulgaria",Bermuda:"Bermuda",La_Paz:"Bolivia",Noronha:"Brazil",Belem:"Brazil",Fortaleza:"Brazil",Recife:"Brazil",Araguaina:"Brazil",Maceio:"Brazil",Bahia:"Brazil",Sao_Paulo:"Brazil",Campo_Grande:"Brazil",Cuiaba:"Brazil",Santarem:"Brazil",Porto_Velho:"Brazil",Boa_Vista:"Brazil",Manaus:"Brazil",Eirunepe:"Brazil",Rio_Branco:"Brazil",Thimphu:"Bhutan",Minsk:"Belarus",Belize:"Belize",St_Johns:"Canada",Halifax:"Canada",Glace_Bay:"Canada",Moncton:"Canada",Goose_Bay:"Canada",Toronto:"Canada",Iqaluit:"Canada",Winnipeg:"Canada",Resolute:"Canada",Rankin_Inlet:"Canada",Regina:"Canada",Swift_Current:"Canada",Edmonton:"Canada",Cambridge_Bay:"Canada",Inuvik:"Canada",Dawson_Creek:"Canada",Fort_Nelson:"Canada",Whitehorse:"Canada",Dawson:"Canada",Vancouver:"Canada",Zurich:"Switzerland",Abidjan:"Côte d'Ivoire",Rarotonga:"Cook Islands",Santiago:"Chile",Coyhaique:"Chile",Punta_Arenas:"Chile",Easter:"Chile",Shanghai:"China",Urumqi:"China",Bogota:"Colombia",Costa_Rica:"Costa Rica",Havana:"Cuba",Cape_Verde:"Cape Verde",Nicosia:"Cyprus",Famagusta:"Cyprus",Prague:"Czech Republic",Berlin:"Germany",Santo_Domingo:"Dominican Republic",Algiers:"Algeria",Guayaquil:"Ecuador",Galapagos:"Ecuador",Tallinn:"Estonia",Cairo:"Egypt",El_Aaiun:"Western Sahara",Madrid:"Spain",Ceuta:"Spain",Canary:"Spain",Helsinki:"Finland",Fiji:"Fiji",Stanley:"Falkland Islands",Kosrae:"Micronesia",Faroe:"Faroe Islands",Paris:"France",London:"Britain (UK)",Tbilisi:"Georgia",Cayenne:"French Guiana",Gibraltar:"Gibraltar",Nuuk:"Greenland",Danmarkshavn:"Greenland",Scoresbysund:"Greenland",Thule:"Greenland",Athens:"Greece",South_Georgia:"South Georgia & the South Sandwich Islands",Guatemala:"Guatemala",Guam:"Guam",Bissau:"Guinea-Bissau",Guyana:"Guyana",Hong_Kong:"Hong Kong",Tegucigalpa:"Honduras","Port-au-Prince":"Haiti",Budapest:"Hungary",Jakarta:"Indonesia",Pontianak:"Indonesia",Makassar:"Indonesia",Jayapura:"Indonesia",Dublin:"Ireland",Jerusalem:"Israel",Kolkata:"India",Chagos:"British Indian Ocean Territory",Baghdad:"Iraq",Tehran:"Iran",Rome:"Italy",Jamaica:"Jamaica",Amman:"Jordan",Tokyo:"Japan",Nairobi:"Kenya",Bishkek:"Kyrgyzstan",Tarawa:"Kiribati",Kanton:"Kiribati",Kiritimati:"Kiribati",Pyongyang:"Korea (North)",Seoul:"Korea (South)",Almaty:"Kazakhstan",Qyzylorda:"Kazakhstan",Qostanay:"Kazakhstan",Aqtobe:"Kazakhstan",Aqtau:"Kazakhstan",Atyrau:"Kazakhstan",Oral:"Kazakhstan",Beirut:"Lebanon",Colombo:"Sri Lanka",Monrovia:"Liberia",Vilnius:"Lithuania",Riga:"Latvia",Tripoli:"Libya",Casablanca:"Morocco",Chisinau:"Moldova",Kwajalein:"Marshall Islands",Yangon:"Myanmar (Burma)",Ulaanbaatar:"Mongolia",Hovd:"Mongolia",Macau:"Macau",Martinique:"Martinique",Malta:"Malta",Mauritius:"Mauritius",Maldives:"Maldives",Mexico_City:"Mexico",Cancun:"Mexico",Merida:"Mexico",Monterrey:"Mexico",Matamoros:"Mexico",Chihuahua:"Mexico",Ciudad_Juarez:"Mexico",Ojinaga:"Mexico",Mazatlan:"Mexico",Bahia_Banderas:"Mexico",Hermosillo:"Mexico",Tijuana:"Mexico",Kuching:"Malaysia",Maputo:"Mozambique",Windhoek:"Namibia",Noumea:"New Caledonia",Norfolk:"Norfolk Island",Lagos:"Nigeria",Managua:"Nicaragua",Kathmandu:"Nepal",Nauru:"Nauru",Niue:"Niue",Auckland:"New Zealand",Chatham:"New Zealand",Panama:"Panama",Lima:"Peru",Tahiti:"French Polynesia",Marquesas:"French Polynesia",Gambier:"French Polynesia",Port_Moresby:"Papua New Guinea",Bougainville:"Papua New Guinea",Manila:"Philippines",Karachi:"Pakistan",Warsaw:"Poland",Miquelon:"St Pierre & Miquelon",Pitcairn:"Pitcairn",Puerto_Rico:"Puerto Rico",Gaza:"Palestine",Hebron:"Palestine",Lisbon:"Portugal",Madeira:"Portugal",Azores:"Portugal",Palau:"Palau",Asuncion:"Paraguay",Qatar:"Qatar",Bucharest:"Romania",Belgrade:"Serbia",Kaliningrad:"Russia",Moscow:"Russia",Simferopol:"Russia",Kirov:"Russia",Volgograd:"Russia",Astrakhan:"Russia",Saratov:"Russia",Ulyanovsk:"Russia",Samara:"Russia",Yekaterinburg:"Russia",Omsk:"Russia",Novosibirsk:"Russia",Barnaul:"Russia",Tomsk:"Russia",Novokuznetsk:"Russia",Krasnoyarsk:"Russia",Irkutsk:"Russia",Chita:"Russia",Yakutsk:"Russia",Khandyga:"Russia",Vladivostok:"Russia","Ust-Nera":"Russia",Magadan:"Russia",Sakhalin:"Russia",Srednekolymsk:"Russia",Kamchatka:"Russia",Anadyr:"Russia",Riyadh:"Saudi Arabia",Guadalcanal:"Solomon Islands",Khartoum:"Sudan",Singapore:"Singapore",Paramaribo:"Suriname",Juba:"South Sudan",Sao_Tome:"Sao Tome & Principe",El_Salvador:"El Salvador",Damascus:"Syria",Grand_Turk:"Turks & Caicos Is",Ndjamena:"Chad",Bangkok:"Thailand",Dushanbe:"Tajikistan",Fakaofo:"Tokelau",Dili:"East Timor",Ashgabat:"Turkmenistan",Tunis:"Tunisia",Tongatapu:"Tonga",Istanbul:"Turkey",Taipei:"Taiwan",Kyiv:"Ukraine",New_York:"United States",Detroit:"United States",Louisville:"United States",Monticello:"United States",Indianapolis:"United States",Vincennes:"United States",Winamac:"United States",Marengo:"United States",Petersburg:"United States",Vevay:"United States",Chicago:"United States",Tell_City:"United States",Knox:"United States",Menominee:"United States",Center:"United States",New_Salem:"United States",Beulah:"United States",Denver:"United States",Boise:"United States",Phoenix:"United States",Los_Angeles:"United States",Anchorage:"United States",Juneau:"United States",Sitka:"United States",Metlakatla:"United States",Yakutat:"United States",Nome:"United States",Adak:"United States",Honolulu:"United States",Montevideo:"Uruguay",Samarkand:"Uzbekistan",Tashkent:"Uzbekistan",Caracas:"Venezuela",Ho_Chi_Minh:"Vietnam",Efate:"Vanuatu",Apia:"Samoa (western)",Johannesburg:"South Africa",Antigua:"Antigua & Barbuda",Anguilla:"Anguilla",Luanda:"Angola",McMurdo:"Antarctica",DumontDUrville:"Antarctica",Syowa:"Antarctica",Aruba:"Aruba",Mariehamn:"Åland Islands",Sarajevo:"Bosnia & Herzegovina",Ouagadougou:"Burkina Faso",Bahrain:"Bahrain",Bujumbura:"Burundi","Porto-Novo":"Benin",St_Barthelemy:"St Barthelemy",Brunei:"Brunei",Kralendijk:"Caribbean NL",Nassau:"Bahamas",Gaborone:"Botswana","Blanc-Sablon":"Canada",Atikokan:"Canada",Creston:"Canada",Cocos:"Cocos (Keeling) Islands",Kinshasa:"Congo (Dem. Rep.)",Lubumbashi:"Congo (Dem. Rep.)",Bangui:"Central African Rep.",Brazzaville:"Congo (Rep.)",Douala:"Cameroon",Curacao:"Curaçao",Christmas:"Christmas Island",Busingen:"Germany",Djibouti:"Djibouti",Copenhagen:"Denmark",Dominica:"Dominica",Asmara:"Eritrea",Addis_Ababa:"Ethiopia",Chuuk:"Micronesia",Pohnpei:"Micronesia",Libreville:"Gabon",Grenada:"Grenada",Guernsey:"Guernsey",Accra:"Ghana",Banjul:"Gambia",Conakry:"Guinea",Guadeloupe:"Guadeloupe",Malabo:"Equatorial Guinea",Zagreb:"Croatia",Isle_of_Man:"Isle of Man",Reykjavik:"Iceland",Jersey:"Jersey",Phnom_Penh:"Cambodia",Comoro:"Comoros",St_Kitts:"St Kitts & Nevis",Kuwait:"Kuwait",Cayman:"Cayman Islands",Vientiane:"Laos",St_Lucia:"St Lucia",Vaduz:"Liechtenstein",Maseru:"Lesotho",Luxembourg:"Luxembourg",Monaco:"Monaco",Podgorica:"Montenegro",Marigot:"St Martin (French)",Antananarivo:"Madagascar",Majuro:"Marshall Islands",Skopje:"North Macedonia",Bamako:"Mali",Saipan:"Northern Mariana Islands",Nouakchott:"Mauritania",Montserrat:"Montserrat",Blantyre:"Malawi",Kuala_Lumpur:"Malaysia",Niamey:"Niger",Amsterdam:"Netherlands",Oslo:"Norway",Muscat:"Oman",Reunion:"Réunion",Kigali:"Rwanda",Mahe:"Seychelles",Stockholm:"Sweden",St_Helena:"St Helena",Ljubljana:"Slovenia",Longyearbyen:"Svalbard & Jan Mayen",Bratislava:"Slovakia",Freetown:"Sierra Leone",San_Marino:"San Marino",Dakar:"Senegal",Mogadishu:"Somalia",Lower_Princes:"St Maarten (Dutch)",Mbabane:"Eswatini (Swaziland)",Kerguelen:"French S. Terr.",Lome:"Togo",Port_of_Spain:"Trinidad & Tobago",Funafuti:"Tuvalu",Dar_es_Salaam:"Tanzania",Kampala:"Uganda",Midway:"US minor outlying islands",Wake:"US minor outlying islands",Vatican:"Vatican City",St_Vincent:"St Vincent",Tortola:"Virgin Islands (UK)",St_Thomas:"Virgin Islands (US)",Wallis:"Wallis & Futuna",Aden:"Yemen",Mayotte:"Mayotte",Lusaka:"Zambia",Harare:"Zimbabwe"};function WN(){let t=Intl.DateTimeFormat().resolvedOptions().timeZone;t==="Asia/Bangkok"&&(t="Asia/Jakarta");const[e,...n]=t.split("/"),i=n.join("/");return{timezone:t,region:e,city:i,country:KN[i]||"Unknown"}}const qN={class:"grid grid-cols-[max-content,auto] w-full","data-wv-section":"phone-number-input-wrapper"},XN={class:"flex gap-2"},GN=["src"],Sie=ce("InputPhoneNumber",ye({__name:"InputPhoneNumber",props:{modelValue:{},value:{},label:{},placeholder:{},disabled:{type:Boolean},maxDigit:{default:14},invalid:{type:Boolean},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},validatorMessage:{},fieldInfo:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e;Sf(async()=>{c.value=await m(),n.value||(d.value=A())}),bt(async()=>{h.value=n.modelValue,n.useValidator&&Object.assign(h,Ln(n.fieldName??"numberInput",async w=>await Pt(()=>u(w)))),n.value!=null&&k(n.value),n.modelValue!=null&&k(n.modelValue)});const{locale:r}=_t("InputPhoneNumber"),o=dt("preset",{}).inputphonenumber,s=oe(!1),a=W(()=>n.invalid||!!h.errorMessage),l=navigator.userAgent.includes("Firefox"),u=w=>n.invalid&&n.validatorMessage?n.validatorMessage:w==null&&n.mandatory?n.validatorMessage??`${n.label} harus diisi.`:!0,c=oe(),d=oe(),f=oe(),p=oe(0),h=sn({value:null}),m=async()=>{const{data:w}=await Rv.get("https://assets.tagsamurai.com/json/country-dial-code.json");return w.filter(y=>y.dial_code)??[]},v=()=>{h.value=f.value?`${d.value} ${f.value}`:void 0,i("update:modelValue",h.value)},S=()=>{Pt(()=>{const w=document.getElementById("phone-number-input");w&&w.focus()})},b=(w,y)=>{d.value=w,f.value=y},k=w=>{const y=w==null?void 0:w.split(" ");y!=null&&y.length?(b(y[0],y[1]),h.value=f.value?`${d.value} ${f.value}`:void 0):h.value=void 0},A=()=>{if(c.value){const{country:w}=WN(),y=c.value.find(C=>C.name===w);return y?y.dial_code:"+62"}return"+62"};return Re(()=>n.value,w=>{k(w)},{once:!0}),Re(()=>h.value,()=>{var C;const[w,y]=((C=h.value)==null?void 0:C.split(" "))??[];w&&y&&b(w,y)}),Re(()=>n.modelValue,w=>{k(w)}),(w,y)=>(g(),L(Yn,{info:n.fieldInfo,label:n.label,mandatory:n.mandatory},{default:z(()=>{var C,P;return[E("div",qN,[I(x(qr),{modelValue:d.value,"onUpdate:modelValue":y[0]||(y[0]=R=>d.value=R),class:pe((C=x(o))==null?void 0:C.dialcode.root({isFirefoxBased:x(l),invalidInput:a.value}).class),disabled:n.disabled,"filter-fields":["dial_code","name"],options:c.value,onChange:v,onHide:y[1]||(y[1]=()=>{S(),s.value=!1}),onShow:y[2]||(y[2]=R=>s.value=!0),"data-wv-section":"dialcode",filter:"","filter-placeholder":"Search","option-label":"dial_code","option-value":"dial_code"},{dropdownicon:z(()=>[I(Me,it(Ot(x(o).dialcode.dropdownicon({state:{isShowOverlay:s.value}}))),null,16)]),option:z(({option:R})=>[E("div",XN,[E("img",{src:R.image,alt:"country-img",style:{height:"16px"}},null,8,GN),E("span",null,_(R.name),1),E("span",null,_(R.dial_code),1)])]),_:1},8,["modelValue","class","disabled","options"]),(g(),L(ca,{key:p.value,modelValue:f.value,"onUpdate:modelValue":y[3]||(y[3]=R=>f.value=R),"allowed-characters":/\d/,disabled:w.disabled,"input-class":(P=x(o))==null?void 0:P.input({isFirefoxBased:x(l),invalidInput:a.value}).class,"max-length":w.maxDigit,placeholder:w.placeholder??x(r).defaultPlaceholder,"use-field-wrapper":!1,"use-input-group":!1,"use-validator":!1,onBlur:v,"data-wv-section":"phoneinput","input-id":"phone-number-input","prevent-input-on-max-length":""},null,8,["modelValue","disabled","input-class","max-length","placeholder"]))]),ft(I(Rn,{message:h.errorMessage},null,8,["message"]),[[Zn,h.errorMessage]])]}),_:1},8,["info","label","mandatory"]))}})),ZN={class:"flex gap-2 w-full items-center","data-wv-section":"inputwrapper"},_N=ce("InputRangeNumber",ye({__name:"InputRangeNumber",props:{modelValue:{},value:{},label:{},placeholder:{},minPlaceholder:{},maxPlaceholder:{},disabled:{type:Boolean},invalid:{type:Boolean},showOptionalText:{type:Boolean},useValidator:{type:Boolean},mandatory:{type:Boolean},validatorMessage:{},minFieldName:{},maxFieldName:{}},emits:["update:modelValue","submit"],setup(t,{emit:e}){const n=t,i=e,{locale:r}=_t("InputRangeNumber"),o=sn({value:void 0}),s=sn({value:void 0});bt(()=>{n.useValidator&&(Object.assign(o,Ln(n.minFieldName??"minNumberInput",c=>u(c),{initialValue:void 0})),Object.assign(s,Ln(n.maxFieldName??"maxNumberInput",c=>u(c),{initialValue:void 0})),n.value&&(o.value=n.value[0],s.value=n.value[1])),n.invalid&&n.useValidator&&(o.validate(),s.validate())});const a=W(()=>n.invalid||!!o.errorMessage||!!s.errorMessage),l=c=>{c.key==="Enter"&&i("submit")},u=async c=>{if(await Pt(),typeof n.validatorMessage=="string"&&n.invalid)return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{empty:d}=n.validatorMessage??{};if(c==null&&n.mandatory)return d??!0}return!0};return Re([()=>o.value,()=>s.value],([c,d])=>{i("update:modelValue",[c,d])}),Re(()=>n.value,c=>{o.value=c?c[0]:void 0,s.value=c?c[1]:void 0},{once:!0}),Re(()=>n.modelValue,c=>{o.value=c?c[0]:void 0,s.value=c?c[1]:void 0}),(c,d)=>(g(),L(Yn,{label:n.label,"show-optional-text":c.showOptionalText},{default:z(()=>[E("div",ZN,[I(br,{invalid:a.value},{default:z(()=>[I(x(Ul),O(c.$props,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=f=>o.value=f),max:s.value,placeholder:c.placeholder??c.minPlaceholder??x(r).minPlaceholder,"use-grouping":!1,onKeydown:l,class:"w-full","input-id":"range-start"}),null,16,["modelValue","max","placeholder"])]),_:1},8,["invalid"]),d[2]||(d[2]=ht(" - ")),I(br,{invalid:a.value},{default:z(()=>[I(x(Ul),O(c.$props,{modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=f=>s.value=f),min:o.value,placeholder:c.placeholder??c.maxPlaceholder??x(r).maxPlaceholder,"use-grouping":!1,onKeydown:l,class:"w-full","input-id":"range-end"}),null,16,["modelValue","min","placeholder"])]),_:1},8,["invalid"])]),I(Rn,{message:o.errorMessage??s.errorMessage},null,8,["message"])]),_:1},8,["label","show-optional-text"]))}})),I2=ce("InputURL",ye({__name:"InputURL",props:{allowedCharacters:{},autoUppercase:{type:Boolean},modelValue:{},value:{},existingValues:{},checkAvailability:{},maxLength:{},label:{},useValidator:{type:Boolean,default:!0},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},manualInvalidContainer:{type:Boolean},validatorMessage:{},validatorMessageClass:{},placeholder:{},disabled:{type:Boolean},fieldInfo:{},inputClass:{},inputContainerClass:{},labelClass:{},blurOnReachMaxLength:{type:Boolean},preventInputOnMaxLength:{type:Boolean},validateOnBlur:{type:Boolean},useProtocol:{type:Boolean,default:!0},allowSpecialCharacters:{type:Boolean,default:!0},useInputGroup:{type:Boolean,default:!0},inputId:{}},emits:["update:modelValue","blur","input"],setup(t){return(e,n)=>(g(),L(ca,O({onBlur:n[0]||(n[0]=i=>e.$emit("blur",i)),onInput:n[1]||(n[1]=i=>e.$emit("input",i)),"onUpdate:modelValue":n[2]||(n[2]=i=>e.$emit("update:modelValue",i))},e.$props,{type:"url"}),Dn({_:2},[e.$slots["addon-left"]?{name:"addon-left",fn:z(()=>[ee(e.$slots,"addon-left")]),key:"0"}:void 0,e.$slots["addon-right"]?{name:"addon-right",fn:z(()=>[ee(e.$slots,"addon-right")]),key:"1"}:void 0]),1040))}})),Cie=ce("LiteDropdown",ye({__name:"LiteDropdown",props:Cn({modelValue:{type:[String,Number,Boolean,Object]},options:{},optionLabel:{},optionValue:{},mandatory:{type:Boolean},placeholder:{default:"Pilih data"},loading:{type:Boolean},disabled:{type:Boolean},filter:{type:Boolean,default:!0},filterPlaceholder:{default:"Cari"}},{modelValue:{type:[String,Number,Boolean,Object],required:!0},modelModifiers:{}}),emits:Cn(["update:modelValue","show","change"],["update:modelValue"]),setup(t){const e=dt("preset",{}).dropdown,n=si(t,"modelValue"),i=t,r=oe(!1);return(o,s)=>(g(),L(Yn,{mandatory:i.mandatory},{default:z(()=>[I(x(qr),O(i,{modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=a=>n.value=a),placeholder:i.loading?"Loading...":i.placeholder,pt:{root:({state:a,props:l})=>{var u;return{class:[...(u=x(e))==null?void 0:u.root({state:a,props:l}).class,"text-base",{"cursor-pointer":!l.disabled}],"data-wv-name":"litedropdown"}},input:({props:a})=>({class:["!font-semibold",{"!text-general-200":a.modelValue==null,"!text-grayscale-900":a.modelValue!=null}]})},onChange:s[1]||(s[1]=a=>o.$emit("change",a)),onHide:s[2]||(s[2]=a=>r.value=!1),onShow:s[3]||(s[3]=()=>{o.$emit("show"),r.value=!0}),class:"!w-fit"}),Dn({dropdownicon:z(()=>[I(Me,{class:pe(["!w-6 !h-6 !transition-transform !text-general-500",{"rotate-180":r.value}]),icon:"arrow-drop-down"},null,8,["class"])]),loadingicon:z(()=>[I(Me,{class:"text-xs animate-spin duration-200",icon:"spinner"})]),filtericon:z(()=>[I(Me,{class:"text-xs w-6 h-6",icon:"search-line"})]),_:2},[o.$slots.option?{name:"option",fn:z(({option:a})=>[ee(o.$slots,"option",{option:a})]),key:"0"}:void 0]),1040,["modelValue","placeholder","pt"])]),_:3},8,["mandatory"]))}})),JN=["data-user-lang"],YN=["alt","src"],QN={key:1,class:"flex items-center gap-0.5 text-xs text-general-800"},eB={key:2},L2=ye({__name:"LanguageDropdownOption",props:{option:{},iconOnly:{type:Boolean}},setup(t){return(e,n)=>{const i=an("tooltip");return g(),T("div",{"data-user-lang":e.option.isoCode,class:"flex gap-2 items-center"},[e.option.flag?ft((g(),T("img",{key:0,alt:"Country Flag of "+e.option.name,class:pe(["cursor-pointer aspect-square rounded-full ring-general-100 ring-[0.5px] outline-none",{"w-4 h-4":!e.iconOnly,"w-6 h-6":e.iconOnly}]),src:e.option.flag},null,10,YN)),[[i,e.iconOnly?`${e.option.name} (${e.option.isoCode.toUpperCase()})`:void 0,void 0,{left:!0}]]):e.iconOnly?(g(),T("span",QN,[I(Me,{class:"!text-base",icon:"global-line"}),ht(" "+_(e.option.isoCode.toUpperCase()),1)])):N("",!0),e.iconOnly?N("",!0):(g(),T("span",eB,_(e.option.name)+" ("+_(e.option.isoCode.toUpperCase())+") ",1))],8,JN)}}}),kie=ce("LanguageSwitcher",ye({__name:"LanguageSwitcher",setup(t){bt(async()=>{i.value=await s()});const{service:e,setLocale:n}=ls(),i=oe(),r=oe([]),o=oe(!1),s=async()=>{const l=localStorage.getItem("lang")||navigator.language.split("-")[0];if(!r.value.length)try{const u=await e.getLanguageOptionMeta(l);if(u.isoCode)return r.value[0]=u,u}catch(u){console.error("Ups! Something error while fetching Language Option Meta.",u)}return r.value.find(u=>u.isoCode===l)||r.value[0]},a=async()=>{if(!(!e||r.value.length>1))try{o.value=!0;const l=await e.getLanguageOptions();r.value=l}catch(l){console.error("Ups! Something error while fetching language options.",l)}finally{o.value=!1}};return Re(i,l=>{n(l.isoCode)}),(l,u)=>(g(),L(x(qr),{modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c),"filter-fields":["language","name"],loading:o.value,options:r.value,pt:{root:{class:"flex items-center gap-1 gap-1"},input:{class:"p-0 outline-none"},trigger:{class:"w-max hover:bg-primary-50 rounded-full"}},onShow:a,class:"w-max","data-key":"language",filter:"","filter-placeholder":"Search language"},{dropdownicon:z(()=>[I(Me,{class:"w-4 h-4 rotate-180 text-general-800 transition-transform",icon:"arrow-up-s"})]),value:z(({value:c})=>[c?(g(),L(L2,{key:0,option:c,"icon-only":""},null,8,["option"])):N("",!0)]),option:z(({option:c})=>[I(L2,{option:c},null,8,["option"])]),_:1},8,["modelValue","loading","options"]))}})),Oie=ce("Loading",ye({__name:"Loading",setup(t){const{loading:e,message:n}=Fi();return(i,r)=>x(e)?(g(),L(Hu,{key:0,to:"body"},[E("div",O(i.$preset.loading.root,{"data-wv-name":"loading-overlay","data-wv-section":"overlay"}),[I(Kl,O({animation:"loading-page"},i.$preset.loading.animation),null,16),ht(" "+_(x(n)),1)],16)])):N("",!0)}}));var tB={root:function(e){var n=e.instance,i=e.props;return["p-checkbox p-component",{"p-highlight":n.checked,"p-disabled":i.disabled,"p-invalid":i.invalid,"p-variant-filled":i.variant?i.variant==="filled":n.$primevue.config.inputStyle==="filled"}]},box:"p-checkbox-box",input:"p-checkbox-input",icon:"p-checkbox-icon"},nB=Xt.extend({name:"checkbox",classes:tB}),iB={name:"BaseCheckbox",extends:It,props:{value:null,modelValue:null,binary:Boolean,name:{type:String,default:null},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},variant:{type:String,default:null},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:nB,provide:function(){return{$parentInstance:this}}};function rB(t){return lB(t)||aB(t)||sB(t)||oB()}function oB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
229
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sB(t,e){if(t){if(typeof t=="string")return Jh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jh(t,e)}}function aB(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function lB(t){if(Array.isArray(t))return Jh(t)}function Jh(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var D2={name:"Checkbox",extends:iB,inheritAttrs:!1,emits:["update:modelValue","change","focus","blur"],methods:{getPTOptions:function(e){var n=e==="root"?this.ptmi:this.ptm;return n(e,{context:{checked:this.checked,disabled:this.disabled}})},onChange:function(e){var n=this;if(!this.disabled&&!this.readonly){var i;this.binary?i=this.checked?this.falseValue:this.trueValue:this.checked?i=this.modelValue.filter(function(r){return!Ce.equals(r,n.value)}):i=this.modelValue?[].concat(rB(this.modelValue),[this.value]):[this.value],this.$emit("update:modelValue",i),this.$emit("change",e)}},onFocus:function(e){this.$emit("focus",e)},onBlur:function(e){this.$emit("blur",e)}},computed:{checked:function(){return this.binary?this.modelValue===this.trueValue:Ce.contains(this.value,this.modelValue)}},components:{CheckIcon:Co}},uB=["data-p-highlight","data-p-disabled"],cB=["id","value","name","checked","tabindex","disabled","readonly","required","aria-labelledby","aria-label","aria-invalid"];function dB(t,e,n,i,r,o){var s=et("CheckIcon");return g(),T("div",O({class:t.cx("root")},o.getPTOptions("root"),{"data-p-highlight":o.checked,"data-p-disabled":t.disabled}),[E("input",O({id:t.inputId,type:"checkbox",class:[t.cx("input"),t.inputClass],style:t.inputStyle,value:t.value,name:t.name,checked:o.checked,tabindex:t.tabindex,disabled:t.disabled,readonly:t.readonly,required:t.required,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-invalid":t.invalid||void 0,onFocus:e[0]||(e[0]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[1]||(e[1]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),onChange:e[2]||(e[2]=function(){return o.onChange&&o.onChange.apply(o,arguments)})},o.getPTOptions("input")),null,16,cB),E("div",O({class:t.cx("box")},o.getPTOptions("box")),[ee(t.$slots,"icon",{checked:o.checked,class:pe(t.cx("icon"))},function(){return[o.checked?(g(),L(s,O({key:0,class:t.cx("icon")},o.getPTOptions("icon")),null,16,["class"])):N("",!0)]})],16)],16,uB)}D2.render=dB;var fB={root:function(e){var n=e.props;return{position:n.appendTo==="self"?"relative":void 0}}},pB={root:function(e){var n=e.instance,i=e.props;return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":i.display==="chip","p-disabled":i.disabled,"p-invalid":i.invalid,"p-variant-filled":i.variant?i.variant==="filled":n.$primevue.config.inputStyle==="filled","p-focus":n.focused,"p-inputwrapper-filled":i.modelValue&&i.modelValue.length,"p-inputwrapper-focus":n.focused||n.overlayVisible,"p-overlay-open":n.overlayVisible}]},labelContainer:"p-multiselect-label-container",label:function(e){var n=e.instance,i=e.props;return["p-multiselect-label",{"p-placeholder":n.label===i.placeholder,"p-multiselect-label-empty":!i.placeholder&&(!i.modelValue||i.modelValue.length===0)}]},token:"p-multiselect-token",tokenLabel:"p-multiselect-token-label",removeTokenIcon:"p-multiselect-token-icon",trigger:"p-multiselect-trigger",loadingIcon:"p-multiselect-trigger-icon",dropdownIcon:"p-multiselect-trigger-icon",panel:function(e){e.props;var n=e.instance;return["p-multiselect-panel p-component",{"p-ripple-disabled":n.$primevue.config.ripple===!1}]},header:"p-multiselect-header",filterContainer:"p-multiselect-filter-container",filterInput:function(e){var n=e.props,i=e.instance;return["p-multiselect-filter p-inputtext p-component",{"p-variant-filled":n.variant?n.variant==="filled":i.$primevue.config.inputStyle==="filled"}]},filterIcon:"p-multiselect-filter-icon",closeButton:"p-multiselect-close p-link",closeIcon:"p-multiselect-close-icon",wrapper:"p-multiselect-items-wrapper",list:"p-multiselect-items p-component",itemGroup:"p-multiselect-item-group",item:function(e){var n=e.instance,i=e.option,r=e.index,o=e.getItemOptions,s=e.props;return["p-multiselect-item",{"p-highlight":n.isSelected(i)&&s.highlightOnSelect,"p-focus":n.focusedOptionIndex===n.getOptionIndex(r,o),"p-disabled":n.isOptionDisabled(i)}]},emptyMessage:"p-multiselect-empty-message"},hB=Xt.extend({name:"multiselect",classes:pB,inlineStyles:fB}),mB={name:"BaseMultiSelect",extends:It,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,variant:{type:String,default:null},invalid:{type:Boolean,default:!1},disabled:Boolean,inputId:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default:null},dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},appendTo:{type:[String,Object],default:"body"},display:{type:String,default:"comma"},selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},checkboxIcon:{type:String,default:void 0},closeIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},removeTokenIcon:{type:String,default:void 0},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!1},autoFilterFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},highlightOnSelect:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:hB,provide:function(){return{$parentInstance:this}}};function _l(t){"@babel/helpers - typeof";return _l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_l(t)}function R2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function N2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?R2(Object(n),!0).forEach(function(i){B2(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R2(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function B2(t,e,n){return e=gB(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gB(t){var e=vB(t,"string");return _l(e)=="symbol"?e:String(e)}function vB(t,e){if(_l(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(_l(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $2(t){return wB(t)||AB(t)||bB(t)||yB()}function yB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
230
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bB(t,e){if(t){if(typeof t=="string")return Yh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yh(t,e)}}function AB(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wB(t){if(Array.isArray(t))return Yh(t)}function Yh(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var V2={name:"MultiSelect",extends:mB,inheritAttrs:!1,emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter","selectall-change"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,startRangeIndex:-1,searchTimeout:null,searchValue:"",selectOnFocus:!1,data:function(){return{id:this.$attrs.id,clicked:!1,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||jn()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||jn(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(pn.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,n){return this.virtualScrollerDisabled?e:n&&n(e).index},getOptionLabel:function(e){return this.optionLabel?Ce.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?Ce.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,n){return this.dataKey?Ce.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)+"_".concat(n)},getHeaderCheckboxPTOptions:function(e){return this.ptm(e,{context:{selected:this.allSelected}})},getCheckboxPTOptions:function(e,n,i,r){return this.ptm(r,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,n),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return this.maxSelectionLimitReached&&!this.isSelected(e)?!0:this.optionDisabled?Ce.resolveFieldData(e,this.optionDisabled):!1},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return Ce.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return Ce.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var n=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter(function(i){return n.isOptionGroup(i)}).length:e)+1},show:function(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),e&&G.focus(this.$refs.focusInput)},hide:function(e){var n=this,i=function(){n.$emit("before-hide"),n.overlayVisible=!1,n.clicked=!1,n.focusedOptionIndex=-1,n.searchValue="",n.resetFilterOnHide&&(n.filterValue=null),e&&G.focus(n.$refs.focusInput)};setTimeout(function(){i()},0)},onFocus:function(e){this.disabled||(this.focused=!0,this.overlayVisible&&(this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.scrollInView(this.focusedOptionIndex)),this.$emit("focus",e))},onBlur:function(e){this.clicked=!1,this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){var n=this;if(this.disabled){e.preventDefault();return}var i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(e.code==="KeyA"&&i){var r=this.visibleOptions.filter(function(o){return n.isValidOption(o)}).map(function(o){return n.getOptionValue(o)});this.updateModel(e,r),e.preventDefault();break}!i&&Ce.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault());break}this.clicked=!1},onContainerClick:function(e){this.disabled||this.loading||((!this.overlay||!this.overlay.contains(e.target))&&(this.overlayVisible?this.hide(!0):this.show(!0)),this.clicked=!0)},onFirstHiddenFocus:function(e){var n=e.relatedTarget===this.$refs.focusInput?G.getFirstFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;G.focus(n)},onLastHiddenFocus:function(e){var n=e.relatedTarget===this.$refs.focusInput?G.getLastFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;G.focus(n)},onCloseClick:function(){this.hide(!0)},onOptionSelect:function(e,n){var i=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!(this.disabled||this.isOptionDisabled(n))){var s=this.isSelected(n),a=null;s?a=this.modelValue.filter(function(l){return!Ce.equals(l,i.getOptionValue(n),i.equalityKey)}):a=[].concat($2(this.modelValue||[]),[this.getOptionValue(n)]),this.updateModel(e,a),r!==-1&&(this.focusedOptionIndex=r),o&&G.focus(this.$refs.focusInput)}},onOptionMouseMove:function(e,n){this.focusOnHover&&this.changeFocusedOptionIndex(e,n)},onOptionSelectRange:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(i===-1&&(i=this.findNearestSelectedOptionIndex(r,!0)),r===-1&&(r=this.findNearestSelectedOptionIndex(i)),i!==-1&&r!==-1){var o=Math.min(i,r),s=Math.max(i,r),a=this.visibleOptions.slice(o,s+1).filter(function(l){return n.isValidOption(l)}).map(function(l){return n.getOptionValue(l)});this.updateModel(e,a)}},onFilterChange:function(e){var n=e.target.value;this.filterValue=n,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:n}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0);break}},onFilterBlur:function(){this.focusedOptionIndex=-1},onFilterUpdated:function(){this.overlayVisible&&this.alignOverlay()},onOverlayClick:function(e){So.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){switch(e.code){case"Escape":this.onEscapeKey(e);break}},onArrowDownKey:function(e){if(!this.overlayVisible)this.show();else{var n=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.clicked?this.findFirstOptionIndex():this.findFirstFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,n),this.changeFocusedOptionIndex(e,n)}e.preventDefault()},onArrowUpKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.altKey&&!n)this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var i=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.clicked?this.findLastOptionIndex():this.findLastFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;n&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n){var i=e.currentTarget;e.shiftKey?i.setSelectionRange(0,e.target.selectionStart):(i.setSelectionRange(0,0),this.focusedOptionIndex=-1)}else{var r=e.metaKey||e.ctrlKey,o=this.findFirstOptionIndex();e.shiftKey&&r&&this.onOptionSelectRange(e,o,this.startRangeIndex),this.changeFocusedOptionIndex(e,o),!this.overlayVisible&&this.show()}e.preventDefault()},onEndKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n){var i=e.currentTarget;if(e.shiftKey)i.setSelectionRange(e.target.selectionStart,i.value.length);else{var r=i.value.length;i.setSelectionRange(r,r),this.focusedOptionIndex=-1}}else{var o=e.metaKey||e.ctrlKey,s=this.findLastOptionIndex();e.shiftKey&&o&&this.onOptionSelectRange(e,this.startRangeIndex,s),this.changeFocusedOptionIndex(e,s),!this.overlayVisible&&this.show()}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.overlayVisible?this.focusedOptionIndex!==-1&&(e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])):(this.focusedOptionIndex=-1,this.onArrowDownKey(e)),e.preventDefault()},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;n||(this.overlayVisible&&this.hasFocusableElements()?(G.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter:function(e){pn.set("overlay",e,this.$primevue.config.zIndex.overlay),G.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&G.focus(this.$refs.filterInput)},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){pn.clear(e)},alignOverlay:function(){this.appendTo==="self"?G.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=G.getOuterWidth(this.$el)+"px",G.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.overlayVisible&&e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new Ws(this.$refs.container,function(){e.overlayVisible&&e.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!G.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked:function(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue:function(e){var n=this,i=this.optionGroupLabel?this.flatOptions(this.options):this.options||[],r=i.find(function(o){return!n.isOptionGroup(o)&&Ce.equals(n.getOptionValue(o),e,n.equalityKey)});return r?this.getOptionLabel(r):null},getSelectedItemsLabel:function(){var e=/{(.*?)}/,n=this.selectedItemsLabel||this.$primevue.config.locale.selectionMessage;return e.test(n)?n.replace(n.match(e)[0],this.modelValue.length+""):n},onToggleAll:function(e){var n=this;if(this.selectAll!==null)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{var i=this.allSelected?[]:this.visibleOptions.filter(function(r){return n.isValidOption(r)}).map(function(r){return n.getOptionValue(r)});this.updateModel(e,i)}},removeOption:function(e,n){var i=this,r=this.modelValue.filter(function(o){return!Ce.equals(o,n,i.equalityKey)});this.updateModel(e,r)},clearFilter:function(){this.filterValue=null},hasFocusableElements:function(){return G.getFocusableElements(this.overlay,':not([data-p-hidden-focusable="true"])').length>0},isOptionMatched:function(e){var n;return this.isValidOption(e)&&((n=this.getOptionLabel(e))===null||n===void 0?void 0:n.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return Ce.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,n){return Ce.equals(e,n,this.equalityKey)},isSelected:function(e){var n=this,i=this.getOptionValue(e);return(this.modelValue||[]).some(function(r){return n.isEquals(r,i)})},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex(function(n){return e.isValidOption(n)})},findLastOptionIndex:function(){var e=this;return Ce.findLastIndex(this.visibleOptions,function(n){return e.isValidOption(n)})},findNextOptionIndex:function(e){var n=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(r){return n.isValidOption(r)}):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var n=this,i=e>0?Ce.findLastIndex(this.visibleOptions.slice(0,e),function(r){return n.isValidOption(r)}):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;if(this.hasSelectedOption){for(var n=function(){var s=e.modelValue[r],a=e.visibleOptions.findIndex(function(l){return e.isValidSelectedOption(l)&&e.isEquals(s,e.getOptionValue(l))});if(a>-1)return{v:a}},i,r=this.modelValue.length-1;r>=0;r--)if(i=n(),i)return i.v}return-1},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex(function(n){return e.isValidSelectedOption(n)}):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?Ce.findLastIndex(this.visibleOptions,function(n){return e.isValidSelectedOption(n)}):-1},findNextSelectedOptionIndex:function(e){var n=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(r){return n.isValidSelectedOption(r)}):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var n=this,i=this.hasSelectedOption&&e>0?Ce.findLastIndex(this.visibleOptions.slice(0,e),function(r){return n.isValidSelectedOption(r)}):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=-1;return this.hasSelectedOption&&(n?(i=this.findPrevSelectedOptionIndex(e),i=i===-1?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=i===-1?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e){var n=this;this.searchValue=(this.searchValue||"")+e.key;var i=-1;Ce.isNotEmpty(this.searchValue)&&(this.focusedOptionIndex!==-1?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function(r){return n.isOptionMatched(r)}),i=i===-1?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex(function(r){return n.isOptionMatched(r)}):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex(function(r){return n.isOptionMatched(r)}),i===-1&&this.focusedOptionIndex===-1&&(i=this.findFirstFocusedOptionIndex()),i!==-1&&this.changeFocusedOptionIndex(e,i)),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(function(){n.searchValue="",n.searchTimeout=null},500)},changeFocusedOptionIndex:function(e,n){this.focusedOptionIndex!==n&&(this.focusedOptionIndex=n,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[n]))},scrollInView:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;this.$nextTick(function(){var i=n!==-1?"".concat(e.id,"_").concat(n):e.focusedOptionId,r=G.findSingle(e.list,'li[id="'.concat(i,'"]'));r?r.scrollIntoView&&r.scrollIntoView({block:"nearest",inline:"nearest"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(n!==-1?n:e.focusedOptionIndex)})},autoUpdateModel:function(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();var e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,[e])}},updateModel:function(e,n){this.$emit("update:modelValue",n),this.$emit("change",{originalEvent:e,value:n})},flatOptions:function(e){var n=this;return(e||[]).reduce(function(i,r,o){i.push({optionGroup:r,group:!0,index:o});var s=n.getOptionGroupChildren(r);return s&&s.forEach(function(a){return i.push(a)}),i},[])},overlayRef:function(e){this.overlay=e},listRef:function(e,n){this.list=e,n&&n(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var e=this,n=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){var i=jb.filter(n,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){var r=this.options||[],o=[];return r.forEach(function(s){var a=e.getOptionGroupChildren(s),l=a.filter(function(u){return i.includes(u)});l.length>0&&o.push(N2(N2({},s),{},B2({},typeof e.optionGroupChildren=="string"?e.optionGroupChildren:"items",$2(l))))}),this.flatOptions(o)}return i}return n},label:function(){var e;if(this.modelValue&&this.modelValue.length){if(Ce.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(var n=0;n<this.modelValue.length;n++)n!==0&&(e+=", "),e+=this.getLabelByValue(this.modelValue[n])}else e=this.placeholder;return e},chipSelectedItems:function(){return Ce.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected:function(){var e=this;return this.selectAll!==null?this.selectAll:Ce.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every(function(n){return e.isOptionGroup(n)||e.isOptionDisabled(n)||e.isSelected(n)})},hasSelectedOption:function(){return Ce.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},maxSelectionLimitReached:function(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},filterResultMessageText:function(){return Ce.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.modelValue.length):this.emptySelectionMessageText},focusedOptionId:function(){return this.focusedOptionIndex!==-1?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter(function(n){return!e.isOptionGroup(n)}).length},toggleAllAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[this.allSelected?"selectAll":"unselectAll"]:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},listAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.listLabel:void 0},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:gi},components:{Checkbox:D2,VirtualScroller:Yp,Portal:Wr,TimesIcon:vr,SearchIcon:Jp,TimesCircleIcon:sa,ChevronDownIcon:_p,SpinnerIcon:yl,CheckIcon:Co}};function Jl(t){"@babel/helpers - typeof";return Jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jl(t)}function z2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Mo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?z2(Object(n),!0).forEach(function(i){Qh(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z2(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Qh(t,e,n){return e=SB(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SB(t){var e=CB(t,"string");return Jl(e)=="symbol"?e:String(e)}function CB(t,e){if(Jl(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Jl(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kB=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-invalid"],OB=["onClick"],TB=["value","placeholder","aria-owns","aria-activedescendant"],xB=["aria-label"],MB=["id","aria-label"],EB=["id"],PB=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"];function IB(t,e,n,i,r,o){var s=et("TimesCircleIcon"),a=et("SpinnerIcon"),l=et("Checkbox"),u=et("VirtualScroller"),c=et("Portal"),d=an("ripple");return g(),T("div",O({ref:"container",class:t.cx("root"),style:t.sx("root"),onClick:e[13]||(e[13]=function(){return o.onContainerClick&&o.onContainerClick.apply(o,arguments)})},t.ptmi("root")),[E("div",O({class:"p-hidden-accessible"},t.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[E("input",O({ref:"focusInput",id:t.inputId,type:"text",readonly:"",disabled:t.disabled,placeholder:t.placeholder,tabindex:t.disabled?-1:t.tabindex,role:"combobox","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":r.overlayVisible,"aria-controls":r.id+"_list","aria-activedescendant":r.focused?o.focusedOptionId:void 0,"aria-invalid":t.invalid||void 0,onFocus:e[0]||(e[0]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[1]||(e[1]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),onKeydown:e[2]||(e[2]=function(){return o.onKeyDown&&o.onKeyDown.apply(o,arguments)})},Mo(Mo({},t.inputProps),t.ptm("hiddenInput"))),null,16,kB)],16),E("div",O({class:t.cx("labelContainer")},t.ptm("labelContainer")),[E("div",O({class:t.cx("label")},t.ptm("label")),[ee(t.$slots,"value",{value:t.modelValue,placeholder:t.placeholder},function(){return[t.display==="comma"?(g(),T(le,{key:0},[ht(_(o.label||"empty"),1)],64)):t.display==="chip"?(g(),T(le,{key:1},[(g(!0),T(le,null,_e(o.chipSelectedItems,function(f){return g(),T("div",O({key:o.getLabelByValue(f),class:t.cx("token")},t.ptm("token")),[ee(t.$slots,"chip",{value:f},function(){return[E("span",O({class:t.cx("tokenLabel")},t.ptm("tokenLabel")),_(o.getLabelByValue(f)),17)]}),t.disabled?N("",!0):ee(t.$slots,"removetokenicon",{key:0,class:pe(t.cx("removeTokenIcon")),item:f,onClick:function(h){return o.removeOption(h,f)},removeCallback:function(h){return o.removeOption(h,f)}},function(){return[t.removeTokenIcon?(g(),T("span",O({key:0,class:[t.cx("removeTokenIcon"),t.removeTokenIcon],onClick:xt(function(p){return o.removeOption(p,f)},["stop"])},t.ptm("removeTokenIcon")),null,16,OB)):(g(),L(s,O({key:1,class:t.cx("removeTokenIcon"),onClick:xt(function(p){return o.removeOption(p,f)},["stop"])},t.ptm("removeTokenIcon")),null,16,["class","onClick"]))]})],16)}),128)),!t.modelValue||t.modelValue.length===0?(g(),T(le,{key:0},[ht(_(t.placeholder||"empty"),1)],64)):N("",!0)],64)):N("",!0)]})],16)],16),E("div",O({class:t.cx("trigger")},t.ptm("trigger")),[t.loading?ee(t.$slots,"loadingicon",{key:0,class:pe(t.cx("loadingIcon"))},function(){return[t.loadingIcon?(g(),T("span",O({key:0,class:[t.cx("loadingIcon"),"pi-spin",t.loadingIcon],"aria-hidden":"true"},t.ptm("loadingIcon")),null,16)):(g(),L(a,O({key:1,class:t.cx("loadingIcon"),spin:"","aria-hidden":"true"},t.ptm("loadingIcon")),null,16,["class"]))]}):ee(t.$slots,"dropdownicon",{key:1,class:pe(t.cx("dropdownIcon"))},function(){return[(g(),L(yt(t.dropdownIcon?"span":"ChevronDownIcon"),O({class:[t.cx("dropdownIcon"),t.dropdownIcon],"aria-hidden":"true"},t.ptm("dropdownIcon")),null,16,["class"]))]})],16),I(c,{appendTo:t.appendTo},{default:z(function(){return[I(Vr,O({name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},t.ptm("transition")),{default:z(function(){return[r.overlayVisible?(g(),T("div",O({key:0,ref:o.overlayRef,style:t.panelStyle,class:[t.cx("panel"),t.panelClass],onClick:e[11]||(e[11]=function(){return o.onOverlayClick&&o.onOverlayClick.apply(o,arguments)}),onKeydown:e[12]||(e[12]=function(){return o.onOverlayKeyDown&&o.onOverlayKeyDown.apply(o,arguments)})},Mo(Mo({},t.panelProps),t.ptm("panel"))),[E("span",O({ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:e[3]||(e[3]=function(){return o.onFirstHiddenFocus&&o.onFirstHiddenFocus.apply(o,arguments)})},t.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16),ee(t.$slots,"header",{value:t.modelValue,options:o.visibleOptions}),t.showToggleAll&&t.selectionLimit==null||t.filter?(g(),T("div",O({key:0,class:t.cx("header")},t.ptm("header")),[t.showToggleAll&&t.selectionLimit==null?(g(),L(l,{key:0,modelValue:o.allSelected,binary:!0,disabled:t.disabled,variant:t.variant,"aria-label":o.toggleAllAriaLabel,onChange:o.onToggleAll,unstyled:t.unstyled,pt:o.getHeaderCheckboxPTOptions("headerCheckbox")},{icon:z(function(f){return[t.$slots.headercheckboxicon?(g(),L(yt(t.$slots.headercheckboxicon),{key:0,checked:f.checked,class:pe(f.class)},null,8,["checked","class"])):f.checked?(g(),L(yt(t.checkboxIcon?"span":"CheckIcon"),O({key:1,class:[f.class,Qh({},t.checkboxIcon,f.checked)]},o.getHeaderCheckboxPTOptions("headerCheckbox.icon")),null,16,["class"])):N("",!0)]}),_:1},8,["modelValue","disabled","variant","aria-label","onChange","unstyled","pt"])):N("",!0),t.filter?(g(),T("div",O({key:1,class:t.cx("filterContainer")},t.ptm("filterContainer")),[E("input",O({ref:"filterInput",type:"text",value:r.filterValue,onVnodeMounted:e[4]||(e[4]=function(){return o.onFilterUpdated&&o.onFilterUpdated.apply(o,arguments)}),onVnodeUpdated:e[5]||(e[5]=function(){return o.onFilterUpdated&&o.onFilterUpdated.apply(o,arguments)}),class:t.cx("filterInput"),placeholder:t.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":r.id+"_list","aria-activedescendant":o.focusedOptionId,onKeydown:e[6]||(e[6]=function(){return o.onFilterKeyDown&&o.onFilterKeyDown.apply(o,arguments)}),onBlur:e[7]||(e[7]=function(){return o.onFilterBlur&&o.onFilterBlur.apply(o,arguments)}),onInput:e[8]||(e[8]=function(){return o.onFilterChange&&o.onFilterChange.apply(o,arguments)})},Mo(Mo({},t.filterInputProps),t.ptm("filterInput"))),null,16,TB),ee(t.$slots,"filtericon",{class:pe(t.cx("filterIcon"))},function(){return[(g(),L(yt(t.filterIcon?"span":"SearchIcon"),O({class:[t.cx("filterIcon"),t.filterIcon]},t.ptm("filterIcon")),null,16,["class"]))]})],16)):N("",!0),t.filter?(g(),T("span",O({key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),_(o.filterResultMessageText),17)):N("",!0),ft((g(),T("button",O({class:t.cx("closeButton"),"aria-label":o.closeAriaLabel,onClick:e[9]||(e[9]=function(){return o.onCloseClick&&o.onCloseClick.apply(o,arguments)}),type:"button"},Mo(Mo({},t.closeButtonProps),t.ptm("closeButton"))),[ee(t.$slots,"closeicon",{class:pe(t.cx("closeIcon"))},function(){return[(g(),L(yt(t.closeIcon?"span":"TimesIcon"),O({class:[t.cx("closeIcon"),t.closeIcon]},t.ptm("closeIcon")),null,16,["class"]))]})],16,xB)),[[d]])],16)):N("",!0),E("div",O({class:t.cx("wrapper"),style:{"max-height":o.virtualScrollerDisabled?t.scrollHeight:""}},t.ptm("wrapper")),[I(u,O({ref:o.virtualScrollerRef},t.virtualScrollerOptions,{items:o.visibleOptions,style:{height:t.scrollHeight},tabindex:-1,disabled:o.virtualScrollerDisabled,pt:t.ptm("virtualScroller")}),Dn({content:z(function(f){var p=f.styleClass,h=f.contentRef,m=f.items,v=f.getItemOptions,S=f.contentStyle,b=f.itemSize;return[E("ul",O({ref:function(A){return o.listRef(A,h)},id:r.id+"_list",class:[t.cx("list"),p],style:S,role:"listbox","aria-multiselectable":"true","aria-label":o.listAriaLabel},t.ptm("list")),[(g(!0),T(le,null,_e(m,function(k,A){return g(),T(le,{key:o.getOptionRenderKey(k,o.getOptionIndex(A,v))},[o.isOptionGroup(k)?(g(),T("li",O({key:0,id:r.id+"_"+o.getOptionIndex(A,v),style:{height:b?b+"px":void 0},class:t.cx("itemGroup"),role:"option"},t.ptm("itemGroup")),[ee(t.$slots,"optiongroup",{option:k.optionGroup,index:o.getOptionIndex(A,v)},function(){return[ht(_(o.getOptionGroupLabel(k.optionGroup)),1)]})],16,EB)):ft((g(),T("li",O({key:1,id:r.id+"_"+o.getOptionIndex(A,v),style:{height:b?b+"px":void 0},class:t.cx("item",{option:k,index:A,getItemOptions:v}),role:"option","aria-label":o.getOptionLabel(k),"aria-selected":o.isSelected(k),"aria-disabled":o.isOptionDisabled(k),"aria-setsize":o.ariaSetSize,"aria-posinset":o.getAriaPosInset(o.getOptionIndex(A,v)),onClick:function(y){return o.onOptionSelect(y,k,o.getOptionIndex(A,v),!0)},onMousemove:function(y){return o.onOptionMouseMove(y,o.getOptionIndex(A,v))}},o.getCheckboxPTOptions(k,v,A,"item"),{"data-p-highlight":o.isSelected(k),"data-p-focused":r.focusedOptionIndex===o.getOptionIndex(A,v),"data-p-disabled":o.isOptionDisabled(k)}),[I(l,{modelValue:o.isSelected(k),binary:!0,tabindex:-1,variant:t.variant,unstyled:t.unstyled,pt:o.getCheckboxPTOptions(k,v,A,"itemCheckbox")},{icon:z(function(w){return[t.$slots.itemcheckboxicon?(g(),L(yt(t.$slots.itemcheckboxicon),{key:0,checked:w.checked,class:pe(w.class)},null,8,["checked","class"])):w.checked?(g(),L(yt(t.checkboxIcon?"span":"CheckIcon"),O({key:1,class:[w.class,Qh({},t.checkboxIcon,w.checked)]},o.getCheckboxPTOptions(k,v,A,"itemCheckbox.icon")),null,16,["class"])):N("",!0)]}),_:2},1032,["modelValue","variant","unstyled","pt"]),ee(t.$slots,"option",{option:k,index:o.getOptionIndex(A,v)},function(){return[E("span",it(Ot(t.ptm("option"))),_(o.getOptionLabel(k)),17)]})],16,PB)),[[d]])],64)}),128)),r.filterValue&&(!m||m&&m.length===0)?(g(),T("li",O({key:0,class:t.cx("emptyMessage"),role:"option"},t.ptm("emptyMessage")),[ee(t.$slots,"emptyfilter",{},function(){return[ht(_(o.emptyFilterMessageText),1)]})],16)):!t.options||t.options&&t.options.length===0?(g(),T("li",O({key:1,class:t.cx("emptyMessage"),role:"option"},t.ptm("emptyMessage")),[ee(t.$slots,"empty",{},function(){return[ht(_(o.emptyMessageText),1)]})],16)):N("",!0)],16,MB)]}),_:2},[t.$slots.loader?{name:"loader",fn:z(function(f){var p=f.options;return[ee(t.$slots,"loader",{options:p})]}),key:"0"}:void 0]),1040,["items","style","disabled","pt"])],16),ee(t.$slots,"footer",{value:t.modelValue,options:o.visibleOptions}),!t.options||t.options&&t.options.length===0?(g(),T("span",O({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),_(o.emptyMessageText),17)):N("",!0),E("span",O({role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),_(o.selectedMessageText),17),E("span",O({ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:e[10]||(e[10]=function(){return o.onLastHiddenFocus&&o.onLastHiddenFocus.apply(o,arguments)})},t.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16)],16)):N("",!0)]}),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo"])],16)}V2.render=IB;const LB=ce("MultiSelect",ye({__name:"MultiSelect",props:{modelValue:{},initialValue:{},label:{},options:{},optionLabel:{},optionValue:{},useValidator:{type:Boolean},mandatory:{type:Boolean},showOptionalText:{type:Boolean,default:void 0},validatorMessage:{},fieldName:{},placeholder:{},loading:{type:Boolean},fieldInfo:{},controls:{type:Boolean},disabled:{type:Boolean},filter:{type:Boolean,default:!0},filterPlaceholder:{},display:{default:"chip"},selectedItemsLabel:{},maxSelectedLabels:{}},emits:["update:modelValue","show","hide"],setup(t,{expose:e,emit:n}){const i=t,r=n;bt(()=>{p(),Ye.on("multi-select:hide-overlay",m)}),Jo(()=>{Ye.off("multi-select:hide-overlay")});const{locale:o}=_t("MultiSelect"),s=dt("preset",{}).multiselect,a=oe(!1),l=re(),u=sn({value:i.initialValue?i.initialValue:i.modelValue}),c=W(()=>x0(i.options)),d=W(()=>{var S;return o.emptySelectionErrorMessage.replace("{label}",i.label).replace("{formattedLabel}",(S=Qf(i.label))==null?void 0:S.toLowerCase())}),f=W(()=>{var S;return i.loading?o.loadingPlaceholder:i.placeholder??((S=o.inputPlaceholder)==null?void 0:S.replace("{label}",i.label??"").replace("{lowercaseLabel}",(i.label??"").toLowerCase()))}),p=()=>{var S;i.useValidator&&(Object.assign(u,Ln(i.fieldName??"multiSelect",b=>!(Array.isArray(b)&&b.length)&&i.mandatory?typeof i.validatorMessage=="object"&&"empty"in i.validatorMessage?i.validatorMessage.empty:i.validatorMessage??d.value:!0)),(S=i.initialValue)!=null&&S.length&&(u.value=i.initialValue))},h=()=>{l.value&&l.value.show()},m=()=>{l.value&&l.value.hide()},v=S=>{const b=S!=null&&S.length?S:void 0;r("update:modelValue",b)};return Re(()=>u.value,()=>{v(u.value)}),Re(()=>i.modelValue,S=>{u.value=S}),Re(()=>i.initialValue,S=>{u.value=S},{once:!0}),e({isShowOverlay:a,showOverlay:h,hideOverlay:m}),(S,b)=>(g(),L(Yn,{info:S.fieldInfo,label:i.label,mandatory:i.mandatory,"show-optional-text":S.showOptionalText},{default:z(()=>[I(br,{class:pe({"rounded-none !ring-0 !w-max":S.controls}),disabled:i.disabled,invalid:!!u.errorMessage},{default:z(()=>{var k;return[I(x(V2),O(i,{ref_key:"multiselect",ref:l,modelValue:u.value,"onUpdate:modelValue":b[0]||(b[0]=A=>u.value=A),"aria-describedby":i.label+"error",class:[{"invisible !w-0":S.controls}],display:i.display,"filter-placeholder":i.filterPlaceholder||x(o).filterPlaceholder,"max-selected-labels":i.maxSelectedLabels,options:c.value,placeholder:f.value,"selected-items-label":i.selectedItemsLabel,"show-toggle-all":i.filter,"virtual-scroller-options":(((k=S.options)==null?void 0:k.length)??0)>10?{itemSize:32}:void 0,onHide:b[1]||(b[1]=A=>(a.value=!1,S.$emit("hide"))),onShow:b[2]||(b[2]=A=>(S.$emit("show"),a.value=!0))}),Dn({dropdownicon:z(()=>[I(Me,it(Ot(x(s).dropdownicon({state:{isShowOverlay:a.value}}))),null,16)]),headercheckboxicon:z(()=>[I(Me,{icon:"check"})]),itemcheckboxicon:z(()=>[I(Me,{icon:"check"})]),filtericon:z(()=>[I(Me,it(Ot(x(s).filtericon)),null,16)]),removetokenicon:z(({removeCallback:A,item:w})=>[I(We,O({onClick:xt(y=>A(y,w),["stop"])},x(s).removeTokenIcon,{icon:"close",rounded:"",severity:"dark",text:""}),null,16,["onClick"])]),loadingicon:z(()=>[I(Me,it(Ot(x(s).loadingicon)),null,16)]),_:2},[S.loading?{name:"value",fn:z(({placeholder:A})=>[E("span",it(Ot(x(s).loadingplaceholder)),_(A),17)]),key:"0"}:void 0]),1040,["modelValue","aria-describedby","class","display","filter-placeholder","max-selected-labels","options","placeholder","selected-items-label","show-toggle-all","virtual-scroller-options"]),ee(S.$slots,"trigger",{disabled:i.disabled},()=>[S.controls?(g(),L(We,{key:0,disabled:i.disabled,onClick:h,class:"!rounded !ring-0",icon:"add"},null,8,["disabled"])):N("",!0)])]}),_:3},8,["class","disabled","invalid"]),I(Rn,{id:i.label+"error",message:u.errorMessage},null,8,["id","message"])]),_:3},8,["info","label","mandatory","show-optional-text"]))}})),Tie=ce("Paginator",ye({__name:"Paginator",props:Cn({totalRecords:{},rows:{},first:{},pageLinkSize:{},rowsPerPageOptions:{},template:{},currentPageReportTemplate:{},alwaysShow:{type:Boolean},pt:{},ptOptions:{}},{rows:{},rowsModifiers:{}}),emits:Cn(["page","update:rows"],["update:rows"]),setup(t){const e=si(t,"rows"),n=dt("preset",{}).datatable;return(i,r)=>(g(),L(x(Eh),O({rows:e.value,"onUpdate:rows":r[0]||(r[0]=o=>e.value=o)},x(n).paginator({context:{totalRecords:i.totalRecords}}),{template:i.template,"total-records":i.totalRecords,onPage:r[1]||(r[1]=o=>i.$emit("page",o))}),{firstpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-double-arrow-left"})]),lastpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-double-arrow-right"})]),prevpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-arrow-left"})]),nextpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-arrow-right"})]),_:1},16,["rows","template","total-records"]))}})),em=ce("TabMenu",ye({__name:"TabMenu",props:{menu:{},type:{default:"tab"},activeIndex:{default:0},useTrailingLine:{type:Boolean,default:!0},model:{},pt:{}},emits:["tabChange","update:activeIndex"],setup(t){return(e,n)=>(g(),L(x(yT),{"active-index":e.activeIndex,model:e.model||e.menu,type:e.type,"use-trailing-line":e.useTrailingLine,onTabChange:n[0]||(n[0]=i=>e.$emit("tabChange",i)),"onUpdate:activeIndex":n[1]||(n[1]=i=>e.$emit("update:activeIndex",i)),onVnodeBeforeMount:n[2]||(n[2]=i=>x(Rb)("WANGS-TAB-MENU",e.$preset.tabmenu))},null,8,["active-index","model","type","use-trailing-line"]))}})),DB={class:"text-[10px] leading-3 tracking-[0.03em] flex gap-1","data-wv-name":"tagtype"},RB=["data-wv-section"],F2=ce("TagType",ye({__name:"TagType",props:{type:{},useNfc:{type:Boolean,default:void 0}},setup(t){const e=t,{defaultProps:n}=_t("TagType"),i=W(()=>Hi(e,n)),r=W(()=>[{tag:"rfid",active:i.value.type.includes("RFID")},{tag:"nfc",active:i.value.type.includes("NFC"),visible:i.value.useNfc},{tag:"qr",active:i.value.type.includes("QR")}].filter(o=>o.visible!==!1));return(o,s)=>(g(),T("span",DB,[(g(!0),T(le,null,_e(r.value,a=>(g(),T("span",{key:a.tag,class:pe(["inline-flex items-center gap-[1px]",{"text-primary-700":a.active,"text-general-200":!a.active}]),"data-wv-section":a.tag},[I(Me,{class:pe({"!w-[14px]":a.tag==="rfid"}),icon:a.tag},null,8,["class","icon"]),ht(" "+_(a.tag.toUpperCase()),1)],10,RB))),128))]))}}));var NB={root:function(e){var n=e.instance,i=e.props;return["p-inputtextarea p-inputtext p-component",{"p-filled":n.filled,"p-inputtextarea-resizable ":i.autoResize,"p-invalid":i.invalid,"p-variant-filled":i.variant?i.variant==="filled":n.$primevue.config.inputStyle==="filled"}]}},BB=Xt.extend({name:"textarea",classes:NB}),$B={name:"BaseTextarea",extends:It,props:{modelValue:null,autoResize:Boolean,invalid:{type:Boolean,default:!1},variant:{type:String,default:null}},style:BB,provide:function(){return{$parentInstance:this}}},j2={name:"Textarea",extends:$B,inheritAttrs:!1,emits:["update:modelValue"],mounted:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},updated:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},methods:{resize:function(){this.$el.style.height="auto",this.$el.style.height=this.$el.scrollHeight+"px",parseFloat(this.$el.style.height)>=parseFloat(this.$el.style.maxHeight)?(this.$el.style.overflowY="scroll",this.$el.style.height=this.$el.style.maxHeight):this.$el.style.overflow="hidden"},onInput:function(e){this.autoResize&&this.resize(),this.$emit("update:modelValue",e.target.value)}},computed:{filled:function(){return this.modelValue!=null&&this.modelValue.toString().length>0},ptmParams:function(){return{context:{disabled:this.$attrs.disabled||this.$attrs.disabled===""}}}}},VB=["value","aria-invalid"];function zB(t,e,n,i,r,o){return g(),T("textarea",O({class:t.cx("root"),value:t.modelValue,"aria-invalid":t.invalid||void 0,onInput:e[0]||(e[0]=function(){return o.onInput&&o.onInput.apply(o,arguments)})},t.ptmi("root",o.ptmParams)),null,16,VB)}j2.render=zB;const zc=ce("Textarea",ye({__name:"Textarea",props:{modelValue:{},value:{},invalid:{type:Boolean},disabled:{type:Boolean},autoResize:{type:Boolean,default:!0},variant:{},useValidator:{type:Boolean},validatorMessage:{},fieldName:{default:"textareaInput"},fieldInfo:{},mandatory:{type:Boolean},maxInput:{default:void 0},maxlength:{},preventInputOnMaxLength:{type:Boolean,default:!0},inputClass:{},rows:{default:5},placeholder:{},label:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e;bt(()=>{u()});const{locale:r}=_t("TextArea"),o=dt("preset",{}).textarea,s=sn({value:void 0}),a=W(()=>n.invalid||!!s.errorMessage),l=W(()=>{var f,p;return n.placeholder??((p=r.defaultPlaceholder)==null?void 0:p.replace("{label}",((f=n.label)==null?void 0:f.toLowerCase())??""))}),u=()=>{var f,p;n.useValidator&&Object.assign(s,Ln(n.fieldName,h=>Pt(()=>c(h)))),(n.value??n.modelValue)&&(s.value=((f=n.value)==null?void 0:f.trim())??((p=n.modelValue)==null?void 0:p.trim())),n.invalid&&n.useValidator&&s.validate()},c=f=>{if(typeof n.validatorMessage=="string"&&n.invalid)return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{empty:p,exceed:h}=n.validatorMessage??{};if(!f&&n.mandatory)return p??r.emptyInvalidText.replace("{label}",n.label);if(n.maxInput&&((f==null?void 0:f.length)??0)>n.maxInput||n.maxlength&&((f==null?void 0:f.length)??0)>n.maxlength)return h??r.exceedMaxLengthInvalidText.replace("{maxLength}",(n.maxInput??n.maxlength).toString())}return!0},d=()=>{var f;s.value=(f=s.value)==null?void 0:f.trim(),i("update:modelValue",s.value)};return Re(()=>n.value,f=>{s.value=f==null?void 0:f.trim()},{once:!0}),Re(()=>n.modelValue,f=>{s.value=f}),(f,p)=>(g(),L(Yn,{info:f.fieldInfo,label:n.label,mandatory:n.mandatory},{default:z(()=>[I(x(j2),O({modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=h=>s.value=h)},x(o).root({props:n,context:{disabled:f.disabled,invalidInput:a.value}}),{"auto-resize":f.autoResize,disabled:f.disabled,maxlength:f.preventInputOnMaxLength?f.maxlength:void 0,placeholder:l.value,rows:f.rows,onBlur:d,"onUpdate:modelValue":p[1]||(p[1]=h=>i("update:modelValue",h))}),null,16,["modelValue","auto-resize","disabled","maxlength","placeholder","rows"]),I(Rn,{message:s.errorMessage},null,8,["message"])]),_:1},8,["info","label","mandatory"]))}}));var FB={root:function(e){var n=e.props;return["p-timeline p-component","p-timeline-"+n.align,"p-timeline-"+n.layout]},event:"p-timeline-event",opposite:"p-timeline-event-opposite",separator:"p-timeline-event-separator",marker:"p-timeline-event-marker",connector:"p-timeline-event-connector",content:"p-timeline-event-content"},jB=Xt.extend({name:"timeline",classes:FB}),HB={name:"BaseTimeline",extends:It,props:{value:null,align:{mode:String,default:"left"},layout:{mode:String,default:"vertical"},dataKey:null},style:jB,provide:function(){return{$parentInstance:this}}},H2={name:"Timeline",extends:HB,inheritAttrs:!1,methods:{getKey:function(e,n){return this.dataKey?Ce.resolveFieldData(e,this.dataKey):n},getPTOptions:function(e,n){return this.ptm(e,{context:{index:n,count:this.value.length}})}}};function UB(t,e,n,i,r,o){return g(),T("div",O({class:t.cx("root")},t.ptmi("root")),[(g(!0),T(le,null,_e(t.value,function(s,a){return g(),T("div",O({key:o.getKey(s,a),class:t.cx("event")},o.getPTOptions("event",a)),[E("div",O({class:t.cx("opposite",{index:a})},o.getPTOptions("opposite",a)),[ee(t.$slots,"opposite",{item:s,index:a})],16),E("div",O({class:t.cx("separator")},o.getPTOptions("separator",a)),[ee(t.$slots,"marker",{item:s,index:a},function(){return[E("div",O({class:t.cx("marker")},o.getPTOptions("marker",a)),null,16)]}),a!==t.value.length-1?ee(t.$slots,"connector",{key:0,item:s,index:a},function(){return[E("div",O({class:t.cx("connector")},o.getPTOptions("connector",a)),null,16)]}):N("",!0)],16),E("div",O({class:t.cx("content")},o.getPTOptions("content",a)),[ee(t.$slots,"content",{item:s,index:a})],16)],16)}),128))],16)}H2.render=UB;const KB={key:0},Yl=ce("UserName",ye({__name:"UserName",props:{user:{},fetchDetailOnPanelShow:{type:Boolean,default:!0},detailUserPath:{},type:{},showUserName:{type:Boolean,default:void 0},formatUserName:{type:Boolean,default:void 0},userNameField:{},profilePictureField:{},getUserDetail:{}},setup(t){const e=t,{locale:n,defaultProps:i}=_t("UserName"),r=W(()=>Hi(e,i)),o=oe(!1),s=oe(),a=oe(!1),l=re(),u=W(()=>Hn(e.user??{},r.value.userNameField)),c=W(()=>r.value.formatUserName?My(u.value):u.value),d=async()=>{var f,p,h;if(!s.value&&e.fetchDetailOnPanelShow)try{o.value=!0;const m=await((h=(p=r.value).getUserDetail)==null?void 0:h.call(p,(f=e.user)==null?void 0:f._id));s.value=m}catch(m){console.error(m)}finally{o.value=!1}else e.fetchDetailOnPanelShow||(s.value=e.user)};return(f,p)=>{const h=an("tooltip");return Object.keys(e.user??{}).length<1?(g(),T("span",KB," - ")):(g(),T("span",O({key:1,onClick:p[4]||(p[4]=(...m)=>{var v,S;return((v=l.value)==null?void 0:v.toggle)&&((S=l.value)==null?void 0:S.toggle(...m))})},f.$preset.username.root,{"data-wv-name":"username","data-wv-section":"root"}),[r.value.type=="picture"?(g(),L(Ar,{key:0,preview:u.value!==void 0,src:x(Hn)(e.user??{},r.value.profilePictureField),onClick:p[0]||(p[0]=xt(m=>{var v;u.value||(v=l.value)==null||v.toggle(m)},["stop"])),rounded:"",size:"small"},null,8,["preview","src"])):(g(),L(Me,{key:1,class:"text-general-300 text-base",icon:"user"})),r.value.showUserName?ft((g(),T("span",O({key:2},f.$preset.username.displayname({props:e}),{"data-wv-section":"displayname"}),[ht(_(c.value),1)],16)),[[h,c.value===u.value?void 0:u.value,void 0,{top:!0}]]):N("",!0),Object.keys(e.user??{}).length>1?(g(),L(Oc,{key:3,ref_key:"miniProfile",ref:l,dismissable:!a.value,onShow:d},{default:z(()=>{var m,v,S,b,k,A,w,y;return[E("div",O(f.$preset.username.panel.contentwrapper,{"data-wv-section":"contentwrapper"}),[E("div",O(f.$preset.username.panel.background,{"data-wv-section":"background"}),null,16),I(Ar,{src:((m=s.value)==null?void 0:m.profilePicture)??((v=s.value)==null?void 0:v.profilePictureBig),width:60,onHide:p[1]||(p[1]=C=>a.value=!1),onShow:p[2]||(p[2]=C=>a.value=!0),class:"w-[60px] h-[60px]",rounded:""},null,8,["src"]),o.value?(g(),L(x(Nl),{key:1,height:"29px",width:"100px"})):(g(),T("div",it(O({key:0},f.$preset.username.panel.detailwrapper)),[E("h4",O(f.$preset.username.panel.username,{"data-wv-section":"username"}),[ht(_((S=s.value)==null?void 0:S.fullName)+" ",1),(b=s.value)!=null&&b.nickName?(g(),T(le,{key:0},[ht(" ("+_((k=s.value)==null?void 0:k.nickName)+") ",1)],64)):N("",!0)],16),E("span",O(f.$preset.username.panel.useremail,{"data-wv-section":"useremail"}),_((A=s.value)==null?void 0:A.email),17)],16)),o.value?(g(),L(x(Nl),{key:3,height:"12px",width:"60px"})):(g(),T("span",O({key:2},f.$preset.username.panel.positiondivision,{"data-wv-section":"positiondivision"}),_((w=s.value)==null?void 0:w.division)+" / "+_((y=s.value)==null?void 0:y.position),17)),o.value?(g(),L(x(Nl),{key:5,width:"75px"})):(g(),T("a",O({key:4,onClick:p[3]||(p[3]=xt(C=>{var P;return x(Js)(r.value.detailUserPath.replace("{userId}",(P=e.user)==null?void 0:P._id))},["stop"]))},f.$preset.username.panel.userdetaillink,{"data-wv-section":"userdetaillink"}),_(x(n).detailUserAnchorText),17))],16)]}),_:1},8,["dismissable"])):N("",!0)],16))}}})),WB="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%2353C26F'/%3e%3cpath%20d='M8.38742%2017.7024C8.01617%2017.7024%207.69563%2017.6216%207.42578%2017.46C7.15766%2017.2985%206.95055%2017.0725%206.80445%2016.782C6.66008%2016.4915%206.58789%2016.1538%206.58789%2015.7688C6.58789%2015.3838%206.66008%2015.0461%206.80445%2014.7556C6.95055%2014.4651%207.15766%2014.2391%207.42578%2014.0775C7.69563%2013.916%208.01617%2013.8352%208.38742%2013.8352C8.81367%2013.8352%209.17117%2013.9409%209.45992%2014.1523C9.75039%2014.3637%209.95492%2014.6499%2010.0735%2015.0108L9.36711%2015.2068C9.29836%2014.9816%209.18234%2014.8072%209.01906%2014.6834C8.85578%2014.5579%208.64523%2014.4952%208.38742%2014.4952C8.15195%2014.4952%207.95516%2014.5476%207.79703%2014.6525C7.64062%2014.7573%207.52289%2014.9051%207.44383%2015.0959C7.36477%2015.2867%207.32523%2015.511%207.32523%2015.7688C7.32523%2016.0266%207.36477%2016.2509%207.44383%2016.4417C7.52289%2016.6325%207.64062%2016.7803%207.79703%2016.8851C7.95516%2016.99%208.15195%2017.0424%208.38742%2017.0424C8.64523%2017.0424%208.85578%2016.9797%209.01906%2016.8542C9.18234%2016.7287%209.29836%2016.5543%209.36711%2016.3308L10.0735%2016.5268C9.95492%2016.8877%209.75039%2017.1739%209.45992%2017.3853C9.17117%2017.5967%208.81367%2017.7024%208.38742%2017.7024Z'%20fill='white'/%3e%3cpath%20d='M12.3545%2017.7024C12.0795%2017.7024%2011.8311%2017.6543%2011.6094%2017.558C11.3894%2017.46%2011.2081%2017.3208%2011.0654%2017.1404C10.9245%2016.9582%2010.8351%2016.7416%2010.7973%2016.4907L11.5295%2016.3824C11.581%2016.5955%2011.6876%2016.7597%2011.8492%2016.8748C12.0107%2016.99%2012.1946%2017.0475%2012.4009%2017.0475C12.516%2017.0475%2012.6278%2017.0295%2012.736%2016.9934C12.8443%2016.9573%2012.9328%2016.904%2013.0016%2016.8336C13.072%2016.7631%2013.1073%2016.6763%2013.1073%2016.5732C13.1073%2016.5354%2013.1013%2016.4993%2013.0892%2016.4649C13.0789%2016.4288%2013.0609%2016.3953%2013.0351%2016.3643C13.0093%2016.3334%2012.9724%2016.3042%2012.9242%2016.2767C12.8778%2016.2492%2012.8185%2016.2243%2012.7463%2016.2019L11.7821%2015.9183C11.7099%2015.8977%2011.6257%2015.8685%2011.5295%2015.8307C11.4349%2015.7929%2011.343%2015.7387%2011.2536%2015.6683C11.1642%2015.5978%2011.0895%2015.505%2011.0293%2015.3898C10.9709%2015.2729%2010.9417%2015.126%2010.9417%2014.949C10.9417%2014.6997%2011.0044%2014.4926%2011.1299%2014.3276C11.2553%2014.1626%2011.4229%2014.0397%2011.6326%2013.959C11.8423%2013.8782%2012.0743%2013.8386%2012.3287%2013.8404C12.5848%2013.8438%2012.8134%2013.8876%2013.0145%2013.9718C13.2156%2014.0561%2013.384%2014.179%2013.5198%2014.3405C13.6556%2014.5004%2013.7535%2014.6963%2013.8137%2014.9283L13.0557%2015.0572C13.0282%2014.9369%2012.9775%2014.8355%2012.9036%2014.753C12.8297%2014.6705%2012.7412%2014.6078%2012.6381%2014.5648C12.5367%2014.5218%2012.4301%2014.4986%2012.3184%2014.4952C12.2084%2014.4918%2012.1044%2014.5072%2012.0064%2014.5416C11.9102%2014.5743%2011.8311%2014.6224%2011.7692%2014.686C11.7091%2014.7496%2011.679%2014.8252%2011.679%2014.9129C11.679%2014.9936%2011.7039%2015.0598%2011.7538%2015.1114C11.8036%2015.1612%2011.8663%2015.2016%2011.942%2015.2325C12.0176%2015.2635%2012.0949%2015.2893%2012.174%2015.3099L12.8185%2015.4852C12.9148%2015.511%2013.0213%2015.5454%2013.1382%2015.5883C13.2551%2015.6296%2013.3668%2015.688%2013.4734%2015.7636C13.5817%2015.8375%2013.6702%2015.9355%2013.7389%2016.0575C13.8094%2016.1796%2013.8446%2016.3343%2013.8446%2016.5216C13.8446%2016.721%2013.8025%2016.8954%2013.7183%2017.045C13.6358%2017.1928%2013.5241%2017.3157%2013.3831%2017.4136C13.2422%2017.5099%2013.0824%2017.5821%2012.9036%2017.6302C12.7266%2017.6783%2012.5435%2017.7024%2012.3545%2017.7024Z'%20fill='white'/%3e%3cpath%20d='M15.2645%2017.625L14.1301%2013.9125H14.852L15.7801%2016.965L16.7237%2013.9125H17.4456L16.3112%2017.625H15.2645Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",qB="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%234E4B66'/%3e%3cpath%20d='M5.43604%2017.6251V13.9126H6.63744C6.66666%2013.9126%206.72682%2013.9135%206.81791%2013.9152C6.909%2013.9169%206.99666%2013.9229%207.08088%2013.9332C7.37994%2013.9693%207.63346%2014.0733%207.84143%2014.2452C8.04939%2014.4171%208.20752%2014.6353%208.3158%2014.9C8.42408%2015.1647%208.47822%2015.4543%208.47822%2015.7688C8.47822%2016.0834%208.42408%2016.373%208.3158%2016.6377C8.20752%2016.9024%208.04939%2017.1206%207.84143%2017.2925C7.63346%2017.4644%207.37994%2017.5684%207.08088%2017.6045C6.99666%2017.6148%206.909%2017.6208%206.81791%2017.6225C6.72682%2017.6242%206.66666%2017.6251%206.63744%2017.6251H5.43604ZM6.1476%2016.9651H6.63744C6.68385%2016.9651%206.74658%2016.9642%206.82564%2016.9625C6.90471%2016.9591%206.97604%2016.9513%207.03963%2016.9393C7.20119%2016.9067%207.33268%2016.831%207.43408%2016.7124C7.53721%2016.5938%207.61283%2016.4512%207.66096%2016.2845C7.7108%2016.1178%207.73572%2015.9459%207.73572%2015.7688C7.73572%2015.5832%207.70994%2015.4071%207.65838%2015.2403C7.60854%2015.0736%207.53205%2014.9327%207.42893%2014.8175C7.3258%2014.7024%207.19604%2014.6293%207.03963%2014.5984C6.97604%2014.5846%206.90471%2014.5769%206.82564%2014.5752C6.74658%2014.5735%206.68385%2014.5726%206.63744%2014.5726H6.1476V16.9651Z'%20fill='white'/%3e%3cpath%20d='M8.89294%2017.6251L10.0273%2013.9126H11.074L12.2084%2017.6251H11.4865L10.4759%2014.3509H10.61L9.61481%2017.6251H8.89294ZM9.57356%2016.8517V16.1968H11.5329V16.8517H9.57356Z'%20fill='white'/%3e%3cpath%20d='M13.3791%2017.6251V14.5674H12.2086V13.9126H15.2508V14.5674H14.0804V17.6251H13.3791Z'%20fill='white'/%3e%3cpath%20d='M15.4613%2017.6251L16.5957%2013.9126H17.6424L18.7768%2017.6251H18.0549L17.0443%2014.3509H17.1783L16.1832%2017.6251H15.4613ZM16.1419%2016.8517V16.1968H18.1013V16.8517H16.1419Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",XB="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%232A61CA'/%3e%3cpath%20d='M6.47522%2017.625V13.9125H7.67663C7.70584%2013.9125%207.766%2013.9134%207.85709%2013.9151C7.94819%2013.9168%208.03584%2013.9229%208.12006%2013.9332C8.41913%2013.9693%208.67264%2014.0733%208.88061%2014.2451C9.08858%2014.417%209.2467%2014.6353%209.35499%2014.9C9.46327%2015.1647%209.51741%2015.4543%209.51741%2015.7688C9.51741%2016.0833%209.46327%2016.3729%209.35499%2016.6376C9.2467%2016.9023%209.08858%2017.1206%208.88061%2017.2925C8.67264%2017.4643%208.41913%2017.5683%208.12006%2017.6044C8.03584%2017.6147%207.94819%2017.6208%207.85709%2017.6225C7.766%2017.6242%207.70584%2017.625%207.67663%2017.625H6.47522ZM7.18678%2016.965H7.67663C7.72303%2016.965%207.78577%2016.9642%207.86483%2016.9625C7.94389%2016.959%208.01522%2016.9513%208.07881%2016.9393C8.24038%2016.9066%208.37186%2016.831%208.47327%2016.7124C8.57639%2016.5938%208.65202%2016.4511%208.70014%2016.2844C8.74999%2016.1177%208.77491%2015.9458%208.77491%2015.7688C8.77491%2015.5832%208.74913%2015.407%208.69756%2015.2403C8.64772%2015.0736%208.57124%2014.9326%208.46811%2014.8175C8.36499%2014.7023%208.23522%2014.6293%208.07881%2014.5983C8.01522%2014.5846%207.94389%2014.5768%207.86483%2014.5751C7.78577%2014.5734%207.72303%2014.5725%207.67663%2014.5725H7.18678V16.965Z'%20fill='white'/%3e%3cpath%20d='M11.8839%2017.7024C11.5127%2017.7024%2011.1921%2017.6216%2010.9223%2017.46C10.6542%2017.2985%2010.447%2017.0725%2010.301%2016.782C10.1566%2016.4915%2010.0844%2016.1538%2010.0844%2015.7688C10.0844%2015.3838%2010.1566%2015.0461%2010.301%2014.7556C10.447%2014.4651%2010.6542%2014.2391%2010.9223%2014.0775C11.1921%2013.916%2011.5127%2013.8352%2011.8839%2013.8352C12.2552%2013.8352%2012.5749%2013.916%2012.843%2014.0775C13.1128%2014.2391%2013.3199%2014.4651%2013.4643%2014.7556C13.6104%2015.0461%2013.6835%2015.3838%2013.6835%2015.7688C13.6835%2016.1538%2013.6104%2016.4915%2013.4643%2016.782C13.3199%2017.0725%2013.1128%2017.2985%2012.843%2017.46C12.5749%2017.6216%2012.2552%2017.7024%2011.8839%2017.7024ZM11.8839%2017.0424C12.1194%2017.0458%2012.3153%2016.9951%2012.4717%2016.8903C12.6281%2016.7854%2012.745%2016.6368%2012.8224%2016.4443C12.9014%2016.2518%2012.941%2016.0266%2012.941%2015.7688C12.941%2015.511%2012.9014%2015.2875%2012.8224%2015.0985C12.745%2014.9094%2012.6281%2014.7625%2012.4717%2014.6576C12.3153%2014.5528%2012.1194%2014.4986%2011.8839%2014.4952C11.6485%2014.4918%2011.4525%2014.5425%2011.2961%2014.6473C11.1397%2014.7522%2011.022%2014.9008%2010.9429%2015.0933C10.8656%2015.2858%2010.8269%2015.511%2010.8269%2015.7688C10.8269%2016.0266%2010.8656%2016.25%2010.9429%2016.4391C11.022%2016.6282%2011.1397%2016.7751%2011.2961%2016.88C11.4525%2016.9848%2011.6485%2017.039%2011.8839%2017.0424Z'%20fill='white'/%3e%3cpath%20d='M15.9461%2017.7024C15.5748%2017.7024%2015.2543%2017.6216%2014.9844%2017.46C14.7163%2017.2985%2014.5092%2017.0725%2014.3631%2016.782C14.2187%2016.4915%2014.1466%2016.1538%2014.1466%2015.7688C14.1466%2015.3838%2014.2187%2015.0461%2014.3631%2014.7556C14.5092%2014.4651%2014.7163%2014.2391%2014.9844%2014.0775C15.2543%2013.916%2015.5748%2013.8352%2015.9461%2013.8352C16.3723%2013.8352%2016.7298%2013.9409%2017.0186%2014.1523C17.3091%2014.3637%2017.5136%2014.6499%2017.6322%2015.0108L16.9258%2015.2068C16.857%2014.9816%2016.741%2014.8072%2016.5777%2014.6834C16.4144%2014.5579%2016.2039%2014.4952%2015.9461%2014.4952C15.7106%2014.4952%2015.5138%2014.5476%2015.3557%2014.6525C15.1993%2014.7573%2015.0816%2014.9051%2015.0025%2015.0959C14.9234%2015.2867%2014.8839%2015.511%2014.8839%2015.7688C14.8839%2016.0266%2014.9234%2016.2509%2015.0025%2016.4417C15.0816%2016.6325%2015.1993%2016.7803%2015.3557%2016.8851C15.5138%2016.99%2015.7106%2017.0424%2015.9461%2017.0424C16.2039%2017.0424%2016.4144%2016.9797%2016.5777%2016.8542C16.741%2016.7287%2016.857%2016.5543%2016.9258%2016.3308L17.6322%2016.5268C17.5136%2016.8877%2017.3091%2017.1739%2017.0186%2017.3853C16.7298%2017.5967%2016.3723%2017.7024%2015.9461%2017.7024Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",GB="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%23E5252A'/%3e%3cpath%20d='M7.30859%2017.6251V13.9126H8.87609C8.91219%2013.9126%208.96031%2013.9143%209.02047%2013.9178C9.08234%2013.9195%209.13734%2013.9246%209.18547%2013.9332C9.40719%2013.9676%209.58852%2014.0406%209.72945%2014.1524C9.87211%2014.2641%209.97695%2014.405%2010.044%2014.5752C10.111%2014.7436%2010.1445%2014.9318%2010.1445%2015.1398C10.1445%2015.3478%2010.1102%2015.5368%2010.0414%2015.707C9.97438%2015.8754%209.86953%2016.0155%209.72688%2016.1272C9.58594%2016.2389%209.40547%2016.312%209.18547%2016.3463C9.13734%2016.3532%209.08234%2016.3584%209.02047%2016.3618C8.95859%2016.3653%208.91047%2016.367%208.87609%2016.367H8.00984V17.6251H7.30859ZM8.00984%2015.7121H8.84516C8.88125%2015.7121%208.92078%2015.7104%208.96375%2015.707C9.00672%2015.7035%209.04625%2015.6967%209.08234%2015.6863C9.17688%2015.6606%209.24992%2015.6176%209.30148%2015.5574C9.35305%2015.4956%209.38828%2015.4277%209.40719%2015.3538C9.42781%2015.2781%209.43813%2015.2068%209.43813%2015.1398C9.43813%2015.0728%209.42781%2015.0023%209.40719%2014.9284C9.38828%2014.8528%209.35305%2014.7849%209.30148%2014.7247C9.24992%2014.6628%209.17688%2014.619%209.08234%2014.5932C9.04625%2014.5829%209.00672%2014.576%208.96375%2014.5726C8.92078%2014.5692%208.88125%2014.5674%208.84516%2014.5674H8.00984V15.7121Z'%20fill='white'/%3e%3cpath%20d='M10.8169%2017.6251V13.9126H12.0183C12.0475%2013.9126%2012.1076%2013.9135%2012.1987%2013.9152C12.2898%2013.9169%2012.3775%2013.9229%2012.4617%2013.9332C12.7608%2013.9693%2013.0143%2014.0733%2013.2222%2014.2452C13.4302%2014.4171%2013.5883%2014.6353%2013.6966%2014.9C13.8049%2015.1647%2013.859%2015.4543%2013.859%2015.7688C13.859%2016.0834%2013.8049%2016.373%2013.6966%2016.6377C13.5883%2016.9024%2013.4302%2017.1206%2013.2222%2017.2925C13.0143%2017.4644%2012.7608%2017.5684%2012.4617%2017.6045C12.3775%2017.6148%2012.2898%2017.6208%2012.1987%2017.6225C12.1076%2017.6242%2012.0475%2017.6251%2012.0183%2017.6251H10.8169ZM11.5284%2016.9651H12.0183C12.0647%2016.9651%2012.1274%2016.9642%2012.2065%2016.9625C12.2855%2016.9591%2012.3569%2016.9513%2012.4205%2016.9393C12.582%2016.9067%2012.7135%2016.831%2012.8149%2016.7124C12.918%2016.5938%2012.9937%2016.4512%2013.0418%2016.2845C13.0916%2016.1178%2013.1165%2015.9459%2013.1165%2015.7688C13.1165%2015.5832%2013.0908%2015.4071%2013.0392%2015.2403C12.9894%2015.0736%2012.9129%2014.9327%2012.8097%2014.8175C12.7066%2014.7024%2012.5769%2014.6293%2012.4205%2014.5984C12.3569%2014.5846%2012.2855%2014.5769%2012.2065%2014.5752C12.1274%2014.5735%2012.0647%2014.5726%2012.0183%2014.5726H11.5284V16.9651Z'%20fill='white'/%3e%3cpath%20d='M14.6323%2017.6251V13.9126H16.901V14.6138H15.3335V15.4182H16.5917V16.1195H15.3335V17.6251H14.6323Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",ZB="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%23317141'/%3e%3cpath%20d='M6.99329%2017.6251L8.2411%2015.7482L7.02938%2013.9126H7.89047L8.67938%2015.1501L9.45797%2013.9126H10.3242L9.1125%2015.7482L10.3552%2017.6251H9.49407L8.67938%2016.3463L7.85954%2017.6251H6.99329Z'%20fill='white'/%3e%3cpath%20d='M10.9733%2017.6251V13.9126H11.6745V16.9702H13.273V17.6251H10.9733Z'%20fill='white'/%3e%3cpath%20d='M15.2685%2017.7024C14.9935%2017.7024%2014.7451%2017.6543%2014.5234%2017.558C14.3034%2017.4601%2014.1221%2017.3209%2013.9794%2017.1404C13.8385%2016.9582%2013.7491%2016.7416%2013.7113%2016.4907L14.4435%2016.3824C14.4951%2016.5955%2014.6016%2016.7597%2014.7632%2016.8748C14.9248%2016.99%2015.1087%2017.0476%2015.3149%2017.0476C15.4301%2017.0476%2015.5418%2017.0295%2015.6501%2016.9934C15.7583%2016.9573%2015.8469%2016.9041%2015.9156%2016.8336C15.9861%2016.7631%2016.0213%2016.6763%2016.0213%2016.5732C16.0213%2016.5354%2016.0153%2016.4993%2016.0033%2016.4649C15.993%2016.4288%2015.9749%2016.3953%2015.9491%2016.3644C15.9233%2016.3334%2015.8864%2016.3042%2015.8383%2016.2767C15.7919%2016.2492%2015.7326%2016.2243%2015.6604%2016.2019L14.6962%2015.9184C14.624%2015.8977%2014.5398%2015.8685%2014.4435%2015.8307C14.349%2015.7929%2014.257%2015.7387%2014.1676%2015.6683C14.0783%2015.5978%2014.0035%2015.505%2013.9433%2015.3898C13.8849%2015.273%2013.8557%2015.126%2013.8557%2014.949C13.8557%2014.6998%2013.9184%2014.4927%2014.0439%2014.3277C14.1694%2014.1627%2014.3369%2014.0398%2014.5466%2013.959C14.7563%2013.8782%2014.9883%2013.8387%2015.2427%2013.8404C15.4988%2013.8438%2015.7274%2013.8877%2015.9285%2013.9719C16.1296%2014.0561%2016.298%2014.179%2016.4338%2014.3405C16.5696%2014.5004%2016.6676%2014.6963%2016.7277%2014.9284L15.9698%2015.0573C15.9423%2014.9369%2015.8916%2014.8355%2015.8176%2014.753C15.7437%2014.6705%2015.6552%2014.6078%2015.5521%2014.5648C15.4507%2014.5219%2015.3441%2014.4987%2015.2324%2014.4952C15.1224%2014.4918%2015.0184%2014.5073%2014.9205%2014.5416C14.8242%2014.5743%2014.7451%2014.6224%2014.6833%2014.686C14.6231%2014.7496%2014.593%2014.8252%2014.593%2014.9129C14.593%2014.9937%2014.618%2015.0598%2014.6678%2015.1114C14.7176%2015.1612%2014.7804%2015.2016%2014.856%2015.2326C14.9316%2015.2635%2015.009%2015.2893%2015.088%2015.3099L15.7326%2015.4852C15.8288%2015.511%2015.9354%2015.5454%2016.0523%2015.5884C16.1691%2015.6296%2016.2808%2015.688%2016.3874%2015.7637C16.4957%2015.8376%2016.5842%2015.9355%2016.653%2016.0576C16.7234%2016.1796%2016.7587%2016.3343%2016.7587%2016.5216C16.7587%2016.721%2016.7165%2016.8955%2016.6323%2017.045C16.5498%2017.1928%2016.4381%2017.3157%2016.2972%2017.4137C16.1562%2017.5099%2015.9964%2017.5821%2015.8176%2017.6302C15.6406%2017.6784%2015.4576%2017.7024%2015.2685%2017.7024Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e";var tm,U2;function _B(){if(U2)return tm;U2=1;function t(F){return F instanceof Map?F.clear=F.delete=F.set=function(){throw new Error("map is read-only")}:F instanceof Set&&(F.add=F.clear=F.delete=function(){throw new Error("set is read-only")}),Object.freeze(F),Object.getOwnPropertyNames(F).forEach(fe=>{const Ne=F[fe],at=typeof Ne;(at==="object"||at==="function")&&!Object.isFrozen(Ne)&&t(Ne)}),F}class e{constructor(fe){fe.data===void 0&&(fe.data={}),this.data=fe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(F){return F.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(F,...fe){const Ne=Object.create(null);for(const at in F)Ne[at]=F[at];return fe.forEach(function(at){for(const Qt in at)Ne[Qt]=at[Qt]}),Ne}const r="</span>",o=F=>!!F.scope,s=(F,{prefix:fe})=>{if(F.startsWith("language:"))return F.replace("language:","language-");if(F.includes(".")){const Ne=F.split(".");return[`${fe}${Ne.shift()}`,...Ne.map((at,Qt)=>`${at}${"_".repeat(Qt+1)}`)].join(" ")}return`${fe}${F}`};class a{constructor(fe,Ne){this.buffer="",this.classPrefix=Ne.classPrefix,fe.walk(this)}addText(fe){this.buffer+=n(fe)}openNode(fe){if(!o(fe))return;const Ne=s(fe.scope,{prefix:this.classPrefix});this.span(Ne)}closeNode(fe){o(fe)&&(this.buffer+=r)}value(){return this.buffer}span(fe){this.buffer+=`<span class="${fe}">`}}const l=(F={})=>{const fe={children:[]};return Object.assign(fe,F),fe};class u{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(fe){this.top.children.push(fe)}openNode(fe){const Ne=l({scope:fe});this.add(Ne),this.stack.push(Ne)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(fe){return this.constructor._walk(fe,this.rootNode)}static _walk(fe,Ne){return typeof Ne=="string"?fe.addText(Ne):Ne.children&&(fe.openNode(Ne),Ne.children.forEach(at=>this._walk(fe,at)),fe.closeNode(Ne)),fe}static _collapse(fe){typeof fe!="string"&&fe.children&&(fe.children.every(Ne=>typeof Ne=="string")?fe.children=[fe.children.join("")]:fe.children.forEach(Ne=>{u._collapse(Ne)}))}}class c extends u{constructor(fe){super(),this.options=fe}addText(fe){fe!==""&&this.add(fe)}startScope(fe){this.openNode(fe)}endScope(){this.closeNode()}__addSublanguage(fe,Ne){const at=fe.root;Ne&&(at.scope=`language:${Ne}`),this.add(at)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(F){return F?typeof F=="string"?F:F.source:null}function f(F){return m("(?=",F,")")}function p(F){return m("(?:",F,")*")}function h(F){return m("(?:",F,")?")}function m(...F){return F.map(Ne=>d(Ne)).join("")}function v(F){const fe=F[F.length-1];return typeof fe=="object"&&fe.constructor===Object?(F.splice(F.length-1,1),fe):{}}function S(...F){return"("+(v(F).capture?"":"?:")+F.map(at=>d(at)).join("|")+")"}function b(F){return new RegExp(F.toString()+"|").exec("").length-1}function k(F,fe){const Ne=F&&F.exec(fe);return Ne&&Ne.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function w(F,{joinWith:fe}){let Ne=0;return F.map(at=>{Ne+=1;const Qt=Ne;let Jt=d(at),Je="";for(;Jt.length>0;){const Ge=A.exec(Jt);if(!Ge){Je+=Jt;break}Je+=Jt.substring(0,Ge.index),Jt=Jt.substring(Ge.index+Ge[0].length),Ge[0][0]==="\\"&&Ge[1]?Je+="\\"+String(Number(Ge[1])+Qt):(Je+=Ge[0],Ge[0]==="("&&Ne++)}return Je}).map(at=>`(${at})`).join(fe)}const y=/\b\B/,C="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",R="\\b\\d+(\\.\\d+)?",M="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",D="\\b(0b[01]+)",$="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",q=(F={})=>{const fe=/^#![ ]*\//;return F.binary&&(F.begin=m(fe,/.*\b/,F.binary,/\b.*/)),i({scope:"meta",begin:fe,end:/$/,relevance:0,"on:begin":(Ne,at)=>{Ne.index!==0&&at.ignoreMatch()}},F)},J={begin:"\\\\[\\s\\S]",relevance:0},ve={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[J]},ae={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[J]},me={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},se=function(F,fe,Ne={}){const at=i({scope:"comment",begin:F,end:fe,contains:[]},Ne);at.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Qt=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return at.contains.push({begin:m(/[ ]+/,"(",Qt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),at},Ie=se("//","$"),Be=se("/\\*","\\*/"),xe=se("#","$"),de={scope:"number",begin:R,relevance:0},ge={scope:"number",begin:M,relevance:0},Pe={scope:"number",begin:D,relevance:0},Te={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[J,{begin:/\[/,end:/\]/,relevance:0,contains:[J]}]},ue={scope:"title",begin:C,relevance:0},Se={scope:"title",begin:P,relevance:0},Z={begin:"\\.\\s*"+P,relevance:0};var U=Object.freeze({__proto__:null,APOS_STRING_MODE:ve,BACKSLASH_ESCAPE:J,BINARY_NUMBER_MODE:Pe,BINARY_NUMBER_RE:D,COMMENT:se,C_BLOCK_COMMENT_MODE:Be,C_LINE_COMMENT_MODE:Ie,C_NUMBER_MODE:ge,C_NUMBER_RE:M,END_SAME_AS_BEGIN:function(F){return Object.assign(F,{"on:begin":(fe,Ne)=>{Ne.data._beginMatch=fe[1]},"on:end":(fe,Ne)=>{Ne.data._beginMatch!==fe[1]&&Ne.ignoreMatch()}})},HASH_COMMENT_MODE:xe,IDENT_RE:C,MATCH_NOTHING_RE:y,METHOD_GUARD:Z,NUMBER_MODE:de,NUMBER_RE:R,PHRASAL_WORDS_MODE:me,QUOTE_STRING_MODE:ae,REGEXP_MODE:Te,RE_STARTERS_RE:$,SHEBANG:q,TITLE_MODE:ue,UNDERSCORE_IDENT_RE:P,UNDERSCORE_TITLE_MODE:Se});function Y(F,fe){F.input[F.index-1]==="."&&fe.ignoreMatch()}function ke(F,fe){F.className!==void 0&&(F.scope=F.className,delete F.className)}function Fe(F,fe){fe&&F.beginKeywords&&(F.begin="\\b("+F.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",F.__beforeBegin=Y,F.keywords=F.keywords||F.beginKeywords,delete F.beginKeywords,F.relevance===void 0&&(F.relevance=0))}function H(F,fe){Array.isArray(F.illegal)&&(F.illegal=S(...F.illegal))}function he(F,fe){if(F.match){if(F.begin||F.end)throw new Error("begin & end are not supported with match");F.begin=F.match,delete F.match}}function De(F,fe){F.relevance===void 0&&(F.relevance=1)}const nt=(F,fe)=>{if(!F.beforeMatch)return;if(F.starts)throw new Error("beforeMatch cannot be used with starts");const Ne=Object.assign({},F);Object.keys(F).forEach(at=>{delete F[at]}),F.keywords=Ne.keywords,F.begin=m(Ne.beforeMatch,f(Ne.begin)),F.starts={relevance:0,contains:[Object.assign(Ne,{endsParent:!0})]},F.relevance=0,delete Ne.beforeMatch},St=["of","and","for","in","not","or","if","then","parent","list","value"],lt="keyword";function At(F,fe,Ne=lt){const at=Object.create(null);return typeof F=="string"?Qt(Ne,F.split(" ")):Array.isArray(F)?Qt(Ne,F):Object.keys(F).forEach(function(Jt){Object.assign(at,At(F[Jt],fe,Jt))}),at;function Qt(Jt,Je){fe&&(Je=Je.map(Ge=>Ge.toLowerCase())),Je.forEach(function(Ge){const vt=Ge.split("|");at[vt[0]]=[Jt,Ut(vt[0],vt[1])]})}}function Ut(F,fe){return fe?Number(fe):cn(F)?0:1}function cn(F){return St.includes(F.toLowerCase())}const dn={},tn=F=>{console.error(F)},zt=(F,...fe)=>{console.log(`WARN: ${F}`,...fe)},Rt=(F,fe)=>{dn[`${F}/${fe}`]||(console.log(`Deprecated as of ${F}. ${fe}`),dn[`${F}/${fe}`]=!0)},kn=new Error;function Yt(F,fe,{key:Ne}){let at=0;const Qt=F[Ne],Jt={},Je={};for(let Ge=1;Ge<=fe.length;Ge++)Je[Ge+at]=Qt[Ge],Jt[Ge+at]=!0,at+=b(fe[Ge-1]);F[Ne]=Je,F[Ne]._emit=Jt,F[Ne]._multi=!0}function te(F){if(Array.isArray(F.begin)){if(F.skip||F.excludeBegin||F.returnBegin)throw tn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),kn;if(typeof F.beginScope!="object"||F.beginScope===null)throw tn("beginScope must be object"),kn;Yt(F,F.begin,{key:"beginScope"}),F.begin=w(F.begin,{joinWith:""})}}function Q(F){if(Array.isArray(F.end)){if(F.skip||F.excludeEnd||F.returnEnd)throw tn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),kn;if(typeof F.endScope!="object"||F.endScope===null)throw tn("endScope must be object"),kn;Yt(F,F.end,{key:"endScope"}),F.end=w(F.end,{joinWith:""})}}function we(F){F.scope&&typeof F.scope=="object"&&F.scope!==null&&(F.beginScope=F.scope,delete F.scope)}function je(F){we(F),typeof F.beginScope=="string"&&(F.beginScope={_wrap:F.beginScope}),typeof F.endScope=="string"&&(F.endScope={_wrap:F.endScope}),te(F),Q(F)}function st(F){function fe(Je,Ge){return new RegExp(d(Je),"m"+(F.case_insensitive?"i":"")+(F.unicodeRegex?"u":"")+(Ge?"g":""))}class Ne{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ge,vt){vt.position=this.position++,this.matchIndexes[this.matchAt]=vt,this.regexes.push([vt,Ge]),this.matchAt+=b(Ge)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ge=this.regexes.map(vt=>vt[1]);this.matcherRe=fe(w(Ge,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ge){this.matcherRe.lastIndex=this.lastIndex;const vt=this.matcherRe.exec(Ge);if(!vt)return null;const Mn=vt.findIndex((Rr,Qi)=>Qi>0&&Rr!==void 0),wn=this.matchIndexes[Mn];return vt.splice(0,Mn),Object.assign(vt,wn)}}class at{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ge){if(this.multiRegexes[Ge])return this.multiRegexes[Ge];const vt=new Ne;return this.rules.slice(Ge).forEach(([Mn,wn])=>vt.addRule(Mn,wn)),vt.compile(),this.multiRegexes[Ge]=vt,vt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ge,vt){this.rules.push([Ge,vt]),vt.type==="begin"&&this.count++}exec(Ge){const vt=this.getMatcher(this.regexIndex);vt.lastIndex=this.lastIndex;let Mn=vt.exec(Ge);if(this.resumingScanAtSamePosition()&&!(Mn&&Mn.index===this.lastIndex)){const wn=this.getMatcher(0);wn.lastIndex=this.lastIndex+1,Mn=wn.exec(Ge)}return Mn&&(this.regexIndex+=Mn.position+1,this.regexIndex===this.count&&this.considerAll()),Mn}}function Qt(Je){const Ge=new at;return Je.contains.forEach(vt=>Ge.addRule(vt.begin,{rule:vt,type:"begin"})),Je.terminatorEnd&&Ge.addRule(Je.terminatorEnd,{type:"end"}),Je.illegal&&Ge.addRule(Je.illegal,{type:"illegal"}),Ge}function Jt(Je,Ge){const vt=Je;if(Je.isCompiled)return vt;[ke,he,je,nt].forEach(wn=>wn(Je,Ge)),F.compilerExtensions.forEach(wn=>wn(Je,Ge)),Je.__beforeBegin=null,[Fe,H,De].forEach(wn=>wn(Je,Ge)),Je.isCompiled=!0;let Mn=null;return typeof Je.keywords=="object"&&Je.keywords.$pattern&&(Je.keywords=Object.assign({},Je.keywords),Mn=Je.keywords.$pattern,delete Je.keywords.$pattern),Mn=Mn||/\w+/,Je.keywords&&(Je.keywords=At(Je.keywords,F.case_insensitive)),vt.keywordPatternRe=fe(Mn,!0),Ge&&(Je.begin||(Je.begin=/\B|\b/),vt.beginRe=fe(vt.begin),!Je.end&&!Je.endsWithParent&&(Je.end=/\B|\b/),Je.end&&(vt.endRe=fe(vt.end)),vt.terminatorEnd=d(vt.end)||"",Je.endsWithParent&&Ge.terminatorEnd&&(vt.terminatorEnd+=(Je.end?"|":"")+Ge.terminatorEnd)),Je.illegal&&(vt.illegalRe=fe(Je.illegal)),Je.contains||(Je.contains=[]),Je.contains=[].concat(...Je.contains.map(function(wn){return Ae(wn==="self"?Je:wn)})),Je.contains.forEach(function(wn){Jt(wn,vt)}),Je.starts&&Jt(Je.starts,Ge),vt.matcher=Qt(vt),vt}if(F.compilerExtensions||(F.compilerExtensions=[]),F.contains&&F.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return F.classNameAliases=i(F.classNameAliases||{}),Jt(F)}function ie(F){return F?F.endsWithParent||ie(F.starts):!1}function Ae(F){return F.variants&&!F.cachedVariants&&(F.cachedVariants=F.variants.map(function(fe){return i(F,{variants:null},fe)})),F.cachedVariants?F.cachedVariants:ie(F)?i(F,{starts:F.starts?i(F.starts):null}):Object.isFrozen(F)?i(F):F}var He="11.10.0";class ut extends Error{constructor(fe,Ne){super(fe),this.name="HTMLInjectionError",this.html=Ne}}const rt=n,gt=i,Ft=Symbol("nomatch"),on=7,fn=function(F){const fe=Object.create(null),Ne=Object.create(null),at=[];let Qt=!0;const Jt="Could not find the language '{}', did you forget to load/include a language module?",Je={disableAutodetect:!0,name:"Plain text",contains:[]};let Ge={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function vt($e){return Ge.noHighlightRe.test($e)}function Mn($e){let ct=$e.className+" ";ct+=$e.parentNode?$e.parentNode.className:"";const Bt=Ge.languageDetectRe.exec(ct);if(Bt){const nn=Ht(Bt[1]);return nn||(zt(Jt.replace("{}",Bt[1])),zt("Falling back to no-highlight mode for this block.",$e)),nn?Bt[1]:"no-highlight"}return ct.split(/\s+/).find(nn=>vt(nn)||Ht(nn))}function wn($e,ct,Bt){let nn="",In="";typeof ct=="object"?(nn=$e,Bt=ct.ignoreIllegals,In=ct.language):(Rt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Rt("10.7.0",`Please use highlight(code, options) instead.
231
- https://github.com/highlightjs/highlight.js/issues/2277`),In=$e,nn=ct),Bt===void 0&&(Bt=!0);const Ii={code:nn,language:In};Nr("before:highlight",Ii);const mr=Ii.result?Ii.result:Rr(Ii.language,Ii.code,Bt);return mr.code=Ii.code,Nr("after:highlight",mr),mr}function Rr($e,ct,Bt,nn){const In=Object.create(null);function Ii(ze,ot){return ze.keywords[ot]}function mr(){if(!wt.keywords){Vn.addText(en);return}let ze=0;wt.keywordPatternRe.lastIndex=0;let ot=wt.keywordPatternRe.exec(en),Et="";for(;ot;){Et+=en.substring(ze,ot.index);const rn=$i.case_insensitive?ot[0].toLowerCase():ot[0],fi=Ii(wt,rn);if(fi){const[lo,_G]=fi;if(Vn.addText(Et),Et="",In[rn]=(In[rn]||0)+1,In[rn]<=on&&(Us+=_G),lo.startsWith("_"))Et+=ot[0];else{const JG=$i.classNameAliases[lo]||lo;Oe(ot[0],JG)}}else Et+=ot[0];ze=wt.keywordPatternRe.lastIndex,ot=wt.keywordPatternRe.exec(en)}Et+=en.substring(ze),Vn.addText(Et)}function js(){if(en==="")return;let ze=null;if(typeof wt.subLanguage=="string"){if(!fe[wt.subLanguage]){Vn.addText(en);return}ze=Rr(wt.subLanguage,en,!0,ju[wt.subLanguage]),ju[wt.subLanguage]=ze._top}else ze=B(en,wt.subLanguage.length?wt.subLanguage:null);wt.relevance>0&&(Us+=ze.relevance),Vn.__addSublanguage(ze._emitter,ze.language)}function di(){wt.subLanguage!=null?js():mr(),en=""}function Oe(ze,ot){ze!==""&&(Vn.startScope(ot),Vn.addText(ze),Vn.endScope())}function gr(ze,ot){let Et=1;const rn=ot.length-1;for(;Et<=rn;){if(!ze._emit[Et]){Et++;continue}const fi=$i.classNameAliases[ze[Et]]||ze[Et],lo=ot[Et];fi?Oe(lo,fi):(en=lo,mr(),en=""),Et++}}function _o(ze,ot){return ze.scope&&typeof ze.scope=="string"&&Vn.openNode($i.classNameAliases[ze.scope]||ze.scope),ze.beginScope&&(ze.beginScope._wrap?(Oe(en,$i.classNameAliases[ze.beginScope._wrap]||ze.beginScope._wrap),en=""):ze.beginScope._multi&&(gr(ze.beginScope,ot),en="")),wt=Object.create(ze,{parent:{value:wt}}),wt}function zu(ze,ot,Et){let rn=k(ze.endRe,Et);if(rn){if(ze["on:end"]){const fi=new e(ze);ze["on:end"](ot,fi),fi.isMatchIgnored&&(rn=!1)}if(rn){for(;ze.endsParent&&ze.parent;)ze=ze.parent;return ze}}if(ze.endsWithParent)return zu(ze.parent,ot,Et)}function gf(ze){return wt.matcher.regexIndex===0?(en+=ze[0],1):(oi=!0,0)}function vf(ze){const ot=ze[0],Et=ze.rule,rn=new e(Et),fi=[Et.__beforeBegin,Et["on:begin"]];for(const lo of fi)if(lo&&(lo(ze,rn),rn.isMatchIgnored))return gf(ot);return Et.skip?en+=ot:(Et.excludeBegin&&(en+=ot),di(),!Et.returnBegin&&!Et.excludeBegin&&(en=ot)),_o(Et,ze),Et.returnBegin?0:ot.length}function yf(ze){const ot=ze[0],Et=ct.substring(ze.index),rn=zu(wt,ze,Et);if(!rn)return Ft;const fi=wt;wt.endScope&&wt.endScope._wrap?(di(),Oe(ot,wt.endScope._wrap)):wt.endScope&&wt.endScope._multi?(di(),gr(wt.endScope,ze)):fi.skip?en+=ot:(fi.returnEnd||fi.excludeEnd||(en+=ot),di(),fi.excludeEnd&&(en=ot));do wt.scope&&Vn.closeNode(),!wt.skip&&!wt.subLanguage&&(Us+=wt.relevance),wt=wt.parent;while(wt!==rn.parent);return rn.starts&&_o(rn.starts,ze),fi.returnEnd?0:ot.length}function bf(){const ze=[];for(let ot=wt;ot!==$i;ot=ot.parent)ot.scope&&ze.unshift(ot.scope);ze.forEach(ot=>Vn.openNode(ot))}let Hs={};function Fu(ze,ot){const Et=ot&&ot[0];if(en+=ze,Et==null)return di(),0;if(Hs.type==="begin"&&ot.type==="end"&&Hs.index===ot.index&&Et===""){if(en+=ct.slice(ot.index,ot.index+1),!Qt){const rn=new Error(`0 width match regex (${$e})`);throw rn.languageName=$e,rn.badRule=Hs.rule,rn}return 1}if(Hs=ot,ot.type==="begin")return vf(ot);if(ot.type==="illegal"&&!Bt){const rn=new Error('Illegal lexeme "'+Et+'" for mode "'+(wt.scope||"<unnamed>")+'"');throw rn.mode=wt,rn}else if(ot.type==="end"){const rn=yf(ot);if(rn!==Ft)return rn}if(ot.type==="illegal"&&Et==="")return 1;if(Sn>1e5&&Sn>ot.index*3)throw new Error("potential infinite loop, way more iterations than matches");return en+=Et,Et.length}const $i=Ht($e);if(!$i)throw tn(Jt.replace("{}",$e)),new Error('Unknown language: "'+$e+'"');const Af=st($i);let Va="",wt=nn||Af;const ju={},Vn=new Ge.__emitter(Ge);bf();let en="",Us=0,Br=0,Sn=0,oi=!1;try{if($i.__emitTokens)$i.__emitTokens(ct,Vn);else{for(wt.matcher.considerAll();;){Sn++,oi?oi=!1:wt.matcher.considerAll(),wt.matcher.lastIndex=Br;const ze=wt.matcher.exec(ct);if(!ze)break;const ot=ct.substring(Br,ze.index),Et=Fu(ot,ze);Br=ze.index+Et}Fu(ct.substring(Br))}return Vn.finalize(),Va=Vn.toHTML(),{language:$e,value:Va,relevance:Us,illegal:!1,_emitter:Vn,_top:wt}}catch(ze){if(ze.message&&ze.message.includes("Illegal"))return{language:$e,value:rt(ct),illegal:!0,relevance:0,_illegalBy:{message:ze.message,index:Br,context:ct.slice(Br-100,Br+100),mode:ze.mode,resultSoFar:Va},_emitter:Vn};if(Qt)return{language:$e,value:rt(ct),illegal:!1,relevance:0,errorRaised:ze,_emitter:Vn,_top:wt};throw ze}}function Qi($e){const ct={value:rt($e),illegal:!1,relevance:0,_top:Je,_emitter:new Ge.__emitter(Ge)};return ct._emitter.addText($e),ct}function B($e,ct){ct=ct||Ge.languages||Object.keys(fe);const Bt=Qi($e),nn=ct.filter(Ht).filter(On).map(di=>Rr(di,$e,!1));nn.unshift(Bt);const In=nn.sort((di,Oe)=>{if(di.relevance!==Oe.relevance)return Oe.relevance-di.relevance;if(di.language&&Oe.language){if(Ht(di.language).supersetOf===Oe.language)return 1;if(Ht(Oe.language).supersetOf===di.language)return-1}return 0}),[Ii,mr]=In,js=Ii;return js.secondBest=mr,js}function j($e,ct,Bt){const nn=ct&&Ne[ct]||Bt;$e.classList.add("hljs"),$e.classList.add(`language-${nn}`)}function K($e){let ct=null;const Bt=Mn($e);if(vt(Bt))return;if(Nr("before:highlightElement",{el:$e,language:Bt}),$e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",$e);return}if($e.children.length>0&&(Ge.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn($e)),Ge.throwUnescapedHTML))throw new ut("One of your code blocks includes unescaped HTML.",$e.innerHTML);ct=$e;const nn=ct.textContent,In=Bt?wn(nn,{language:Bt,ignoreIllegals:!0}):B(nn);$e.innerHTML=In.value,$e.dataset.highlighted="yes",j($e,Bt,In.language),$e.result={language:In.language,re:In.relevance,relevance:In.relevance},In.secondBest&&($e.secondBest={language:In.secondBest.language,relevance:In.secondBest.relevance}),Nr("after:highlightElement",{el:$e,result:In,text:nn})}function Ue($e){Ge=gt(Ge,$e)}const Ze=()=>{ne(),Rt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Kt(){ne(),Rt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let V=!1;function ne(){if(document.readyState==="loading"){V=!0;return}document.querySelectorAll(Ge.cssSelector).forEach(K)}function Ve(){V&&ne()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",Ve,!1);function qe($e,ct){let Bt=null;try{Bt=ct(F)}catch(nn){if(tn("Language definition for '{}' could not be registered.".replace("{}",$e)),Qt)tn(nn);else throw nn;Bt=Je}Bt.name||(Bt.name=$e),fe[$e]=Bt,Bt.rawDefinition=ct.bind(null,F),Bt.aliases&&Nt(Bt.aliases,{languageName:$e})}function Wt($e){delete fe[$e];for(const ct of Object.keys(Ne))Ne[ct]===$e&&delete Ne[ct]}function Qe(){return Object.keys(fe)}function Ht($e){return $e=($e||"").toLowerCase(),fe[$e]||fe[Ne[$e]]}function Nt($e,{languageName:ct}){typeof $e=="string"&&($e=[$e]),$e.forEach(Bt=>{Ne[Bt.toLowerCase()]=ct})}function On($e){const ct=Ht($e);return ct&&!ct.disableAutodetect}function En($e){$e["before:highlightBlock"]&&!$e["before:highlightElement"]&&($e["before:highlightElement"]=ct=>{$e["before:highlightBlock"](Object.assign({block:ct.el},ct))}),$e["after:highlightBlock"]&&!$e["after:highlightElement"]&&($e["after:highlightElement"]=ct=>{$e["after:highlightBlock"](Object.assign({block:ct.el},ct))})}function be($e){En($e),at.push($e)}function Tn($e){const ct=at.indexOf($e);ct!==-1&&at.splice(ct,1)}function Nr($e,ct){const Bt=$e;at.forEach(function(nn){nn[Bt]&&nn[Bt](ct)})}function mf($e){return Rt("10.7.0","highlightBlock will be removed entirely in v12.0"),Rt("10.7.0","Please use highlightElement now."),K($e)}Object.assign(F,{highlight:wn,highlightAuto:B,highlightAll:ne,highlightElement:K,highlightBlock:mf,configure:Ue,initHighlighting:Ze,initHighlightingOnLoad:Kt,registerLanguage:qe,unregisterLanguage:Wt,listLanguages:Qe,getLanguage:Ht,registerAliases:Nt,autoDetection:On,inherit:gt,addPlugin:be,removePlugin:Tn}),F.debugMode=function(){Qt=!1},F.safeMode=function(){Qt=!0},F.versionString=He,F.regex={concat:m,lookahead:f,either:S,optional:h,anyNumberOfTimes:p};for(const $e in U)typeof U[$e]=="object"&&t(U[$e]);return Object.assign(F,U),F},gn=fn({});return gn.newInstance=()=>fn({}),tm=gn,gn.HighlightJS=gn,gn.default=gn,tm}var JB=_B();const Ql=Vl(JB),K2="[A-Za-z$_][0-9A-Za-z$_]*",YB=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],QB=["true","false","null","undefined","NaN","Infinity"],W2=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],q2=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],X2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],e$=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],t$=[].concat(X2,W2,q2);function n$(t){const e=t.regex,n=(se,{after:Ie})=>{const Be="</"+se[0].slice(1);return se.input.indexOf(Be,Ie)!==-1},i=K2,r={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(se,Ie)=>{const Be=se[0].length+se.index,xe=se.input[Be];if(xe==="<"||xe===","){Ie.ignoreMatch();return}xe===">"&&(n(se,{after:Be})||Ie.ignoreMatch());let de;const ge=se.input.substring(Be);if(de=ge.match(/^\s*=/)){Ie.ignoreMatch();return}if((de=ge.match(/^\s+extends\s+/))&&de.index===0){Ie.ignoreMatch();return}}},a={$pattern:K2,keyword:YB,literal:QB,built_in:t$,"variable.language":e$},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,v,{match:/\$\d+/},d];f.contains=k.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(k)});const A=[].concat(b,f.contains),w=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(A)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:w},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...W2,...q2]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(se){return e.concat("(?!",se.join("|"),")")}const q={match:e.concat(/\b/,$([...X2,"super","import"].map(se=>`${se}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ve={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",me={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,v,b,{match:/\$\d+/},d,P,{className:"attr",begin:i+e.lookahead(":"),relevance:0},me,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},q,D,C,ve,{match:/\$[(.]/}]}}function i$(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[e,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const Fc="[A-Za-z$_][0-9A-Za-z$_]*",G2=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Z2=["true","false","null","undefined","NaN","Infinity"],_2=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],J2=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Y2=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Q2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ew=[].concat(Y2,_2,J2);function r$(t){const e=t.regex,n=(se,{after:Ie})=>{const Be="</"+se[0].slice(1);return se.input.indexOf(Be,Ie)!==-1},i=Fc,r={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(se,Ie)=>{const Be=se[0].length+se.index,xe=se.input[Be];if(xe==="<"||xe===","){Ie.ignoreMatch();return}xe===">"&&(n(se,{after:Be})||Ie.ignoreMatch());let de;const ge=se.input.substring(Be);if(de=ge.match(/^\s*=/)){Ie.ignoreMatch();return}if((de=ge.match(/^\s+extends\s+/))&&de.index===0){Ie.ignoreMatch();return}}},a={$pattern:Fc,keyword:G2,literal:Z2,built_in:ew,"variable.language":Q2},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,v,{match:/\$\d+/},d];f.contains=k.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(k)});const A=[].concat(b,f.contains),w=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(A)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:w},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._2,...J2]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(se){return e.concat("(?!",se.join("|"),")")}const q={match:e.concat(/\b/,$([...Y2,"super","import"].map(se=>`${se}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ve={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",me={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,v,b,{match:/\$\d+/},d,P,{className:"attr",begin:i+e.lookahead(":"),relevance:0},me,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},q,D,C,ve,{match:/\$[(.]/}]}}function o$(t){const e=r$(t),n=Fc,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],r={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],l={$pattern:Fc,keyword:G2.concat(a),literal:Z2,built_in:ew.concat(i),"variable.language":Q2},u={className:"meta",begin:"@"+n},c=(p,h,m)=>{const v=p.contains.findIndex(S=>S.label===h);if(v===-1)throw new Error("can not find mode to replace");p.contains.splice(v,1,m)};Object.assign(e.keywords,l),e.exports.PARAMS_CONTAINS.push(u);const d=e.contains.find(p=>p.className==="attr");e.exports.PARAMS_CONTAINS.push([e.exports.CLASS_REFERENCE,d]),e.contains=e.contains.concat([u,r,o]),c(e,"shebang",t.SHEBANG()),c(e,"use_strict",s);const f=e.contains.find(p=>p.label==="func.def");return f.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function s$(t){return{name:"VBScript in HTML",subLanguage:"xml",contains:[{begin:"<%",end:"%>",subLanguage:"vbscript"}]}}const a$={class:"relative w-full overflow-hidden"},l$=["placeholder"],u$={class:"relative"},c$=["innerHTML"],tw=ye({__name:"CodeSnippet",props:Cn({code:{},lang:{default:"json"},readonly:{type:Boolean},placeholder:{}},{code:{default:""},codeModifiers:{}}),emits:["update:code"],setup(t){Ql.registerLanguage("javascript",n$),Ql.registerLanguage("typescript",o$),Ql.registerLanguage("json",i$),Ql.registerLanguage("html",s$);const e=t,n=si(t,"code"),i=dt("preset",{}).codesnippet,r=re(),o=re(),s=oe(0),a=oe(!1),l=W(()=>n.value.split(`
232
- `).map((f,p)=>{const h=Ql.highlight(f,{language:e.lang}).value;return{line:p+1,code:h}})),u=()=>{var d;(d=navigator.clipboard)==null||d.writeText(n.value),a.value=!0,setTimeout(()=>{a.value=!1},1500)};bt(()=>{c()});const c=()=>{if(o.value){const d=o.value.querySelector("[data-wv-section=linenumber]");s.value=d.offsetWidth}};return Re(l,()=>{c()}),(d,f)=>{var p,h,m;return g(),T("div",a$,[n.value.length&&d.readonly?(g(),L(We,O({key:0},(p=x(i))==null?void 0:p.copybutton,{icon:a.value?"check":"file-copy",onClick:u,size:"small",text:""}),null,16,["icon"])):N("",!0),E("div",O((h=x(i))==null?void 0:h.body,{style:{"scrollbar-width":"none"}}),[d.readonly?N("",!0):ft((g(),T("textarea",O({key:0,ref_key:"textarea",ref:r},(m=x(i))==null?void 0:m.textarea,{"onUpdate:modelValue":f[0]||(f[0]=v=>n.value=v),placeholder:d.placeholder,spellcheck:!1,style:`left: ${s.value}px; width: calc(100% - ${s.value+6}px); scrollbar-width: none;`}),null,16,l$)),[[Cf,n.value]]),E("table",{ref_key:"codesnippet",ref:o,class:"relative"},[E("tbody",u$,[(g(!0),T(le,null,_e(l.value,({line:v,code:S})=>{var b;return g(),T("tr",{key:v,class:"h-5"},[E("td",O({ref_for:!0},(b=x(i))==null?void 0:b.linenumber,{class:[{"pt-1.5":v===1,"pb-1.5":v===l.value.length}],"data-wv-section":"linenumber"}),_(v),17),E("td",{class:pe(["px-1.5",{"pt-1.5":v==1,"pb-1.5":v===l.value.length}])},[E("pre",{innerHTML:S,class:"font-poppins"},null,8,c$)],2)])}),128))])],512)],16)])}}});function ti(t){this.content=t}ti.prototype={constructor:ti,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 i=n&&n!=t?this.remove(n):this,r=i.find(t),o=i.content.slice();return r==-1?o.push(n||t,e):(o[r+1]=e,n&&(o[r]=n)),new ti(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 ti(n)},addToStart:function(t,e){return new ti([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ti(n)},addBefore:function(t,e,n){var i=this.remove(e),r=i.content.slice(),o=i.find(t);return r.splice(o==-1?r.length:o,0,e,n),new ti(r)},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=ti.from(t),t.size?new ti(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ti.from(t),t.size?new ti(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ti.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}},ti.from=function(t){if(t instanceof ti)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ti(e)};function nw(t,e,n){for(let i=0;;i++){if(i==t.childCount||i==e.childCount)return t.childCount==e.childCount?null:n;let r=t.child(i),o=e.child(i);if(r==o){n+=r.nodeSize;continue}if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(let s=0;r.text[s]==o.text[s];s++)n++;return n}if(r.content.size||o.content.size){let s=nw(r.content,o.content,n+1);if(s!=null)return s}n+=r.nodeSize}}function iw(t,e,n,i){for(let r=t.childCount,o=e.childCount;;){if(r==0||o==0)return r==o?null:{a:n,b:i};let s=t.child(--r),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,i-=l;continue}if(!s.sameMarkup(a))return{a:n,b:i};if(s.isText&&s.text!=a.text){let u=0,c=Math.min(s.text.length,a.text.length);for(;u<c&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,i--;return{a:n,b:i}}if(s.content.size||a.content.size){let u=iw(s.content,a.content,n-1,i-1);if(u)return u}n-=l,i-=l}}class Ee{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,n,i,r=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&i(l,r+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),i,r+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,i,r){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?r?typeof r=="function"?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&i&&(s?s=!1:o+=i),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,i=e.firstChild,r=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(i)&&(r[r.length-1]=n.withText(n.text+i.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new Ee(r,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let i=[],r=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),i.push(a),r+=a.nodeSize),s=l}return new Ee(i,r)}cutByIndex(e,n){return e==n?Ee.empty:e==0&&n==this.content.length?this:new Ee(this.content.slice(e,n))}replaceChild(e,n){let i=this.content[e];if(i==n)return this;let r=this.content.slice(),o=this.size+n.nodeSize-i.nodeSize;return r[e]=n,new Ee(r,o)}addToStart(e){return new Ee([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ee(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,i=0;n<this.content.length;n++){let r=this.content[n];e(r,i,n),i+=r.nodeSize}}findDiffStart(e,n=0){return nw(this,e,n)}findDiffEnd(e,n=this.size,i=e.size){return iw(this,e,n,i)}findIndex(e,n=-1){if(e==0)return jc(0,e);if(e==this.size)return jc(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let i=0,r=0;;i++){let o=this.child(i),s=r+o.nodeSize;if(s>=e)return s==e||n>0?jc(i+1,s):jc(i,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Ee.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ee(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ee.empty;let n,i=0;for(let r=0;r<e.length;r++){let o=e[r];i+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(n||(n=e.slice(0,r)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Ee(n||e,i)}static from(e){if(!e)return Ee.empty;if(e instanceof Ee)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ee([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ee.empty=new Ee([],0);const nm={index:0,offset:0};function jc(t,e){return nm.index=t,nm.offset=e,nm}function Hc(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 i=0;i<t.length;i++)if(!Hc(t[i],e[i]))return!1}else{for(let i in t)if(!(i in e)||!Hc(t[i],e[i]))return!1;for(let i in e)if(!(i in t))return!1}return!0}let un=class Cv{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,i=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!i&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,r)),n.push(this),i=!0),n&&n.push(o)}}return n||(n=e.slice()),i||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&&Hc(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 i=e.marks[n.type];if(!i)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=i.create(n.attrs);return i.checkAttrs(r.attrs),r}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(n[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cv.none;if(e instanceof Cv)return[e];let n=e.slice();return n.sort((i,r)=>i.type.rank-r.type.rank),n}};un.none=[];class Uc extends Error{}class Xe{constructor(e,n,i){this.content=e,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let i=ow(this.content,e+this.openStart,n);return i&&new Xe(i,this.openStart,this.openEnd)}removeBetween(e,n){return new Xe(rw(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 Xe.empty;let i=n.openStart||0,r=n.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Xe(Ee.fromJSON(e,n.content),i,r)}static maxOpen(e,n=!0){let i=0,r=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)i++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)r++;return new Xe(e,i,r)}}Xe.empty=new Xe(Ee.empty,0,0);function rw(t,e,n){let{index:i,offset:r}=t.findIndex(e),o=t.maybeChild(i),{index:s,offset:a}=t.findIndex(n);if(r==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(i!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(i,o.copy(rw(o.content,e-r-1,n-r-1)))}function ow(t,e,n,i){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=ow(s.content,e-o-1,n);return a&&t.replaceChild(r,s.copy(a))}function d$(t,e,n){if(n.openStart>t.depth)throw new Uc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Uc("Inconsistent open depths");return sw(t,e,n,0)}function sw(t,e,n,i){let r=t.index(i),o=t.node(i);if(r==e.index(i)&&i<t.depth-n.openStart){let s=sw(t,e,n,i+1);return o.copy(o.content.replaceChild(r,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==i&&e.depth==i){let s=t.parent,a=s.content;return ys(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=f$(n,t);return ys(o,lw(t,s,a,e,i))}else return ys(o,Kc(t,e,i))}function aw(t,e){if(!e.type.compatibleContent(t.type))throw new Uc("Cannot join "+e.type.name+" onto "+t.type.name)}function im(t,e,n){let i=t.node(n);return aw(i,e.node(n)),i}function vs(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 eu(t,e,n,i){let r=(e||t).node(n),o=0,s=e?e.index(n):r.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(vs(t.nodeAfter,i),o++));for(let a=o;a<s;a++)vs(r.child(a),i);e&&e.depth==n&&e.textOffset&&vs(e.nodeBefore,i)}function ys(t,e){return t.type.checkContent(e),t.copy(e)}function lw(t,e,n,i,r){let o=t.depth>r&&im(t,e,r+1),s=i.depth>r&&im(n,i,r+1),a=[];return eu(null,t,r,a),o&&s&&e.index(r)==n.index(r)?(aw(o,s),vs(ys(o,lw(t,e,n,i,r+1)),a)):(o&&vs(ys(o,Kc(t,e,r+1)),a),eu(e,n,r,a),s&&vs(ys(s,Kc(n,i,r+1)),a)),eu(i,null,r,a),new Ee(a)}function Kc(t,e,n){let i=[];if(eu(null,t,n,i),t.depth>n){let r=im(t,e,n+1);vs(ys(r,Kc(t,e,n+1)),i)}return eu(e,null,n,i),new Ee(i)}function f$(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(Ee.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class tu{constructor(e,n,i){this.pos=e,this.path=n,this.parentOffset=i,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 i=this.pos-this.path[this.path.length-1],r=e.child(n);return i?e.child(n).cut(i):r}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 i=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)r+=i.child(o).nodeSize;return r}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return un.none;if(this.textOffset)return e.child(n).marks;let i=e.maybeChild(n-1),r=e.maybeChild(n);if(!i){let a=i;i=r,r=a}let o=i.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!r||!o[s].isInSet(r.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!r||!i[o].isInSet(r.marks))&&(i=i[o--].removeFromSet(i));return i}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 i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!n||n(this.node(i))))return new Wc(this,e,i);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 i=[],r=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(i.push(s,a,r+l),!u||(s=s.child(a),s.isText))break;o=u-1,r+=l+1}return new tu(n,i,o)}static resolveCached(e,n){let i=uw.get(e);if(i)for(let o=0;o<i.elts.length;o++){let s=i.elts[o];if(s.pos==n)return s}else uw.set(e,i=new p$);let r=i.elts[i.i]=tu.resolve(e,n);return i.i=(i.i+1)%h$,r}}class p${constructor(){this.elts=[],this.i=0}}const h$=12,uw=new WeakMap;class Wc{constructor(e,n,i){this.$from=e,this.$to=n,this.depth=i}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 m$=Object.create(null);let Eo=class kv{constructor(e,n,i,r=un.none){this.type=e,this.attrs=n,this.marks=r,this.content=i||Ee.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,i,r=0){this.content.nodesBetween(e,n,i,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,i,r){return this.content.textBetween(e,n,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,i){return this.type==e&&Hc(this.attrs,n||e.defaultAttrs||m$)&&un.sameSet(this.marks,i||un.none)}copy(e=null){return e==this.content?this:new kv(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new kv(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,i=!1){if(e==n)return Xe.empty;let r=this.resolve(e),o=this.resolve(n),s=i?0:r.sharedDepth(n),a=r.start(s),u=r.node(s).content.cut(r.pos-a,o.pos-a);return new Xe(u,r.depth-s,o.depth-s)}replace(e,n,i){return d$(this.resolve(e),this.resolve(n),i)}nodeAt(e){for(let n=this;;){let{index:i,offset:r}=n.content.findIndex(e);if(n=n.maybeChild(i),!n)return null;if(r==e||n.isText)return n;e-=r+1}}childAfter(e){let{index:n,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(n),index:n,offset:i};let r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}}resolve(e){return tu.resolveCached(this,e)}resolveNoCache(e){return tu.resolve(this,e)}rangeHasMark(e,n,i){let r=!1;return n>e&&this.nodesBetween(e,n,o=>(i.isInSet(o.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),cw(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,i=Ee.empty,r=0,o=i.childCount){let s=this.contentMatchAt(e).matchFragment(i,r,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=r;l<o;l++)if(!this.type.allowsMarks(i.child(l).marks))return!1;return!0}canReplaceWith(e,n,i,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(i),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=un.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!un.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 i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=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,i)}let r=Ee.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,r,i);return o.type.checkAttrs(o.attrs),o}};Eo.prototype.text=void 0;class qc extends Eo{constructor(e,n,i,r){if(super(e,n,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):cw(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 qc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new qc(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 cw(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class bs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let i=new g$(e,n);if(i.next==null)return bs.empty;let r=dw(i);i.next&&i.err("Unexpected trailing text");let o=C$(S$(r));return k$(o,i),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,i=e.childCount){let r=this;for(let o=n;r&&o<i;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type: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 i=0;i<e.next.length;i++)if(this.next[n].type==e.next[i].type)return!0;return!1}fillBefore(e,n=!1,i=0){let r=[this];function o(s,a){let l=s.matchFragment(e,i);if(l&&(!n||l.validEnd))return Ee.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&r.indexOf(d)==-1){r.push(d);let f=o(d,a.concat(c));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),o=r.match;if(o.matchType(e)){let s=[];for(let a=r;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!r.type||l.validEnd)&&(i.push({match:a.contentMatch,type:a,via:r}),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(i){e.push(i);for(let r=0;r<i.next.length;r++)e.indexOf(i.next[r].next)==-1&&n(i.next[r].next)}return n(this),e.map((i,r)=>{let o=r+(i.validEnd?"*":" ")+" ";for(let s=0;s<i.next.length;s++)o+=(s?", ":"")+i.next[s].type.name+"->"+e.indexOf(i.next[s].next);return o}).join(`
233
- `)}}bs.empty=new bs(!0);class g${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 dw(t){let e=[];do e.push(v$(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function v$(t){let e=[];do e.push(y$(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function y$(t){let e=w$(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=b$(t,e);else break;return e}function fw(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function b$(t,e){let n=fw(t),i=n;return t.eat(",")&&(t.next!="}"?i=fw(t):i=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:e}}function A$(t,e){let n=t.nodeTypes,i=n[e];if(i)return[i];let r=[];for(let o in n){let s=n[o];s.isInGroup(e)&&r.push(s)}return r.length==0&&t.err("No node type or group '"+e+"' found"),r}function w$(t){if(t.eat("(")){let e=dw(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=A$(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 S$(t){let e=[[]];return r(o(t,0),n()),e;function n(){return e.push([])-1}function i(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function r(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;r(u,a=n())}else if(s.type=="star"){let l=n();return i(a,l),r(o(s.expr,l),l),[i(l)]}else if(s.type=="plus"){let l=n();return r(o(s.expr,a),l),r(o(s.expr,l),l),[i(l)]}else{if(s.type=="opt")return[i(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u<s.min;u++){let c=n();r(o(s.expr,l),c),l=c}if(s.max==-1)r(o(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let c=n();i(l,c),r(o(s.expr,l),c),l=c}return[i(l)]}else{if(s.type=="name")return[i(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function pw(t,e){return e-t}function hw(t,e){let n=[];return i(e),n.sort(pw);function i(r){let o=t[r];if(o.length==1&&!o[0].term)return i(o[0].to);n.push(r);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&i(l)}}}function C$(t){let e=Object.create(null);return n(hw(t,0));function n(i){let r=[];i.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c<r.length;c++)r[c][0]==a&&(u=r[c][1]);hw(t,l).forEach(c=>{u||r.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[i.join(",")]=new bs(i.indexOf(t.length-1)>-1);for(let s=0;s<r.length;s++){let a=r[s][1].sort(pw);o.next.push({type:r[s][0],next:e[a.join(",")]||n(a)})}return o}}function k$(t,e){for(let n=0,i=[t];n<i.length;n++){let r=i[n],o=!r.validEnd,s=[];for(let a=0;a<r.next.length;a++){let{type:l,next:u}=r.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),i.indexOf(u)==-1&&i.push(u)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function mw(t){let e=Object.create(null);for(let n in t){let i=t[n];if(!i.hasDefault)return null;e[n]=i.default}return e}function gw(t,e){let n=Object.create(null);for(let i in t){let r=e&&e[i];if(r===void 0){let o=t[i];if(o.hasDefault)r=o.default;else throw new RangeError("No value supplied for attribute "+i)}n[i]=r}return n}function vw(t,e,n,i){for(let r in e)if(!(r in t))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let r in t){let o=t[r];o.validate&&o.validate(e[r])}}function yw(t,e){let n=Object.create(null);if(e)for(let i in e)n[i]=new T$(t,i,e[i]);return n}let bw=class jC{constructor(e,n,i){this.name=e,this.schema=n,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=yw(e,i.attrs),this.defaultAttrs=mw(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==bs.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:gw(this.attrs,e)}create(e=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Eo(this,this.computeAttrs(e),Ee.from(n),un.setFrom(i))}createChecked(e=null,n,i){return n=Ee.from(n),this.checkContent(n),new Eo(this,this.computeAttrs(e),n,un.setFrom(i))}createAndFill(e=null,n,i){if(e=this.computeAttrs(e),n=Ee.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let r=this.contentMatch.matchFragment(n),o=r&&r.fillBefore(Ee.empty,!0);return o?new Eo(this,e,n.append(o),un.setFrom(i)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).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){vw(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 i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?n&&n.push(e[i]):n||(n=e.slice(0,i));return n?n.length?n:un.none:e}static compile(e,n){let i=Object.create(null);e.forEach((o,s)=>i[o]=new jC(o,n,s));let r=n.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let o in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function O$(t,e,n){let i=n.split("|");return r=>{let o=r===null?"null":typeof r;if(i.indexOf(o)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${t}, got ${o}`)}}class T${constructor(e,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?O$(e,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Xc{constructor(e,n,i,r){this.name=e,this.rank=n,this.schema=i,this.spec=r,this.attrs=yw(e,r.attrs),this.excluded=null;let o=mw(this.attrs);this.instance=o?new un(this,o):null}create(e=null){return!e&&this.instance?this.instance:new un(this,gw(this.attrs,e))}static compile(e,n){let i=Object.create(null),r=0;return e.forEach((o,s)=>i[o]=new Xc(o,r++,n,s)),i}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){vw(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Aw{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in e)n[r]=e[r];n.nodes=ti.from(e.nodes),n.marks=ti.from(e.marks||{}),this.nodes=bw.compile(this.spec.nodes,this),this.marks=Xc.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let o=this.nodes[r],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=i[s]||(i[s]=bs.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?ww(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let r in this.marks){let o=this.marks[r],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ww(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,i,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof bw){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,i,r)}text(e,n){let i=this.nodes.text;return new qc(i,i.defaultAttrs,e,un.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Eo.fromJSON(this,e)}markFromJSON(e){return un.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function ww(t,e){let n=[];for(let i=0;i<e.length;i++){let r=e[i],o=t.marks[r],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(r=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(r)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return n}function x$(t){return t.tag!=null}function M$(t){return t.style!=null}class Po{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(r=>{if(x$(r))this.tags.push(r);else if(M$(r)){let o=/[^=]*/.exec(r.style)[0];i.indexOf(o)<0&&i.push(o),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let i=new Ow(this,n,!1);return i.addAll(e,un.none,n.from,n.to),i.finish()}parseSlice(e,n={}){let i=new Ow(this,n,!0);return i.addAll(e,un.none,n.from,n.to),Xe.maxOpen(i.finish())}matchTag(e,n,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let o=this.tags[r];if(I$(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,i,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!i.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function i(r){let o=r.priority==null?50:r.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,r)}for(let r in e.marks){let o=e.marks[r].spec.parseDOM;o&&o.forEach(s=>{i(s=Tw(s)),s.mark||s.ignore||s.clearMark||(s.mark=r)})}for(let r in e.nodes){let o=e.nodes[r].spec.parseDOM;o&&o.forEach(s=>{i(s=Tw(s)),s.node||s.ignore||s.mark||(s.node=r)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Po(e,Po.schemaRules(e)))}}const Sw={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},E$={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Cw={ol:!0,ul:!0},nu=1,rm=2,Gc=4;function kw(t,e,n){return e!=null?(e?nu:0)|(e==="full"?rm:0):t&&t.whitespace=="pre"?nu|rm:n&-5}class Zc{constructor(e,n,i,r,o,s){this.type=e,this.attrs=n,this.marks=i,this.solid=r,this.options=s,this.content=[],this.activeMarks=un.none,this.match=o||(s&Gc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Ee.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(e.type))?(this.match=i,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nu)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let o=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-r[0].length))}}let n=Ee.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Ee.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&&!Sw.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ow{constructor(e,n,i){this.parser=e,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=n.topNode,o,s=kw(null,n.preserveWhitespace,0)|(i?Gc:0);r?o=new Zc(r.type,r.attrs,un.none,!0,n.topMatch||r.type.contentMatch,s):i?o=new Zc(null,null,un.none,!0,null,s):o=new Zc(e.schema.topNodeType,null,un.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 i=e.nodeValue,r=this.top,o=r.options&rm?"full":this.localPreserveWS||(r.options&nu)>0;if(o==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(o)o!=="full"?i=i.replace(/\r?\n|\r/g," "):i=i.replace(/\r\n?/g,`
234
- `);else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let s=r.content[r.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(i=i.slice(1))}i&&this.insertNode(this.parser.schema.text(i),n,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,n,i){let r=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Cw.hasOwnProperty(s)&&this.parser.normalizeLists&&P$(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,i));e:if(l?l.ignore:E$.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(Sw.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(o),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=r}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
235
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let i=e.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let o=this.parser.matchedStyles[r],s=i.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,i,r){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),i,e.nodeName=="BR")||this.leafFallback(e,i);else{let l=this.enter(s,n.attrs||null,i,n.preserveWhitespace);l&&(o=!0,i=l)}else{let l=this.parser.schema.marks[n.mark];i=i.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,i,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,i,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,i),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,i,r){let o=i||0;for(let s=i?e.childNodes[i]:e.firstChild,a=r==null?null:e.childNodes[r];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n,i){let r,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!r||r.length>u.length+a)&&(r=u,o=l,!u.length))break;if(l.solid){if(i)break;a+=2}}if(!r)return null;this.sync(o);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(e,n,i){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n,i);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=un.none;for(let a of r.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):xw(a.type,e.type))&&(s=a.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,n,i,r){let o=this.findPlace(e.create(n),i,!1);return o&&(o=this.enterInner(e,n,i,!0,r)),o}enterInner(e,n,i,r=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=kw(e,o,s.options);s.options&Gc&&s.content.length==0&&(a|=Gc);let l=un.none;return i=i.filter(u=>(s.type?s.type.allowsMarkType(u.type):xw(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Zc(e,n,l,r,null,a)),this.open++,i}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|=nu)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let r=i.length-1;r>=0;r--)e+=i[r].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==n&&(this.find[i].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,i){if(e!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].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("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),o=-(i?i.depth+1:0)+(r?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&r?this.nodes[l].type:i&&l>=o?i.node(l-o).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function P$(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let i=e.nodeType==1?e.nodeName.toLowerCase():null;i&&Cw.hasOwnProperty(i)&&n?(n.appendChild(e),e=n):i=="li"?n=e:i&&(n=null)}}function I$(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Tw(t){let e={};for(let n in t)e[n]=t[n];return e}function xw(t,e){let n=e.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||o.indexOf(c)<0&&s(c))return!0}};if(s(r.contentMatch))return!0}}class As{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},i){i||(i=om(n).createDocumentFragment());let r=i,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)r=o.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,n);c&&(o.push([u,r]),r.appendChild(c.dom),r=c.contentDOM||c.dom)}}r.appendChild(this.serializeNodeInner(s,n))}),i}serializeNodeInner(e,n){let{dom:i,contentDOM:r}=_c(om(n),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,r)}return i}serializeNode(e,n={}){let i=this.serializeNodeInner(e,n);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(i),i=o.dom)}return i}serializeMark(e,n,i={}){let r=this.marks[e.type.name];return r&&_c(om(i),r(e,n),null,e.attrs)}static renderSpec(e,n,i=null,r){return _c(e,n,i,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new As(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Mw(e.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(e){return Mw(e.marks)}}function Mw(t){let e={};for(let n in t){let i=t[n].spec.toDOM;i&&(e[n]=i)}return e}function om(t){return t.document||window.document}const Ew=new WeakMap;function L$(t){let e=Ew.get(t);return e===void 0&&Ew.set(t,e=D$(t)),e}function D$(t){let e=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")e||(e=[]),e.push(i);else for(let r=0;r<i.length;r++)n(i[r]);else for(let r in i)n(i[r])}return n(t),e}function _c(t,e,n,i){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 r=e[0],o;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(o=L$(i))&&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=r.indexOf(" ");s>0&&(n=r.slice(0,s),r=r.slice(s+1));let a,l=n?t.createElementNS(n,r):t.createElement(r),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:h}=_c(t,f,n,i);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}const Pw=65535,Iw=Math.pow(2,16);function R$(t,e){return t+e*Iw}function Lw(t){return t&Pw}function N$(t){return(t-(t&Pw))/Iw}const Dw=1,Rw=2,Jc=4,Nw=8;class sm{constructor(e,n,i){this.pos=e,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&Nw)>0}get deletedBefore(){return(this.delInfo&(Dw|Jc))>0}get deletedAfter(){return(this.delInfo&(Rw|Jc))>0}get deletedAcross(){return(this.delInfo&Jc)>0}}class Di{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Di.empty)return Di.empty}recover(e){let n=0,i=Lw(e);if(!this.inverted)for(let r=0;r<i;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+n+N$(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,i){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let f=u?e==l?-1:e==d?1:n:n,p=l+r+(f<0?0:c);if(i)return p;let h=e==(n<0?l:d)?null:R$(a/3,e-l),m=e==l?Rw:e==d?Dw:Jc;return(n<0?e!=l:e!=d)&&(m|=Nw),new sm(p,m,h)}r+=c-u}return i?e+r:new sm(e+r,0,null)}touches(e,n){let i=0,r=Lw(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==r*3)return!0;i+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let s=this.ranges[r],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[r+n],c=this.ranges[r+i];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Di(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Di.empty:new Di(e<0?[0,-e,0]:[0,0,e])}}Di.empty=new Di([]);class iu{constructor(e,n,i=0,r=e?e.length:0){this.mirror=n,this.from=i,this.to=r,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new iu(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,i=this._maps.length;n<e._maps.length;n++){let r=e.getMirror(n);this.appendMap(e._maps[n],r!=null&&r<n?i+r: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,i=this._maps.length+e._maps.length;n>=0;n--){let r=e.getMirror(n);this.appendMap(e._maps[n].invert(),r!=null&&r>n?i-r-1:void 0)}}invert(){let e=new iu;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let i=this.from;i<this.to;i++)e=this._maps[i].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,i){let r=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}r|=a.delInfo,e=a.pos}return i?e:new sm(e,r,null)}}const am=Object.create(null);class li{getMap(){return Di.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=am[n.stepType];if(!i)throw new RangeError(`No step type ${n.stepType} defined`);return i.fromJSON(e,n)}static jsonID(e,n){if(e in am)throw new RangeError("Duplicate use of step JSON ID "+e);return am[e]=n,n.prototype.jsonID=e,n}}class Nn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Nn(e,null)}static fail(e){return new Nn(null,e)}static fromReplace(e,n,i,r){try{return Nn.ok(e.replace(n,i,r))}catch(o){if(o instanceof Uc)return Nn.fail(o.message);throw o}}}function lm(t,e,n){let i=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(lm(o.content,e,o))),o.isInline&&(o=e(o,n,r)),i.push(o)}return Ee.fromArray(i)}class Io extends li{constructor(e,n,i){super(),this.from=e,this.to=n,this.mark=i}apply(e){let n=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),o=new Xe(lm(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),r),n.openStart,n.openEnd);return Nn.fromReplace(e,this.from,this.to,o)}invert(){return new kr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Io(n.pos,i.pos,this.mark)}merge(e){return e instanceof Io&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Io(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 Io(n.from,n.to,e.markFromJSON(n.mark))}}li.jsonID("addMark",Io);class kr extends li{constructor(e,n,i){super(),this.from=e,this.to=n,this.mark=i}apply(e){let n=e.slice(this.from,this.to),i=new Xe(lm(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),e),n.openStart,n.openEnd);return Nn.fromReplace(e,this.from,this.to,i)}invert(){return new Io(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new kr(n.pos,i.pos,this.mark)}merge(e){return e instanceof kr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kr(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 kr(n.from,n.to,e.markFromJSON(n.mark))}}li.jsonID("removeMark",kr);class Lo extends li{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nn.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Nn.fromReplace(e,this.pos,this.pos+1,new Xe(Ee.from(i),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(i))return new Lo(this.pos,n.marks[r]);return new Lo(this.pos,this.mark)}}return new ws(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Lo(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Lo(n.pos,e.markFromJSON(n.mark))}}li.jsonID("addNodeMark",Lo);class ws extends li{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nn.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Nn.fromReplace(e,this.pos,this.pos+1,new Xe(Ee.from(i),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Lo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ws(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 ws(n.pos,e.markFromJSON(n.mark))}}li.jsonID("removeNodeMark",ws);class Kn extends li{constructor(e,n,i,r=!1){super(),this.from=e,this.to=n,this.slice=i,this.structure=r}apply(e){return this.structure&&um(e,this.from,this.to)?Nn.fail("Structure replace would overwrite content"):Nn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Di([this.from,this.to-this.from,this.slice.size])}invert(e){return new Kn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deletedAcross&&i.deletedAcross?null:new Kn(n.pos,Math.max(n.pos,i.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Kn)||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?Xe.empty:new Xe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Kn(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?Xe.empty:new Xe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Kn(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 Kn(n.from,n.to,Xe.fromJSON(e,n.slice),!!n.structure)}}li.jsonID("replace",Kn);class Wn extends li{constructor(e,n,i,r,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(um(e,this.from,this.gapFrom)||um(e,this.gapTo,this.to)))return Nn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Nn.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,n.content);return i?Nn.fromReplace(e,this.from,this.to,i):Nn.fail("Content does not fit in gap")}getMap(){return new Di([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 Wn(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),i=e.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?i.pos:e.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||r<n.pos||o>i.pos?null:new Wn(n.pos,i.pos,r,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 Wn(n.from,n.to,n.gapFrom,n.gapTo,Xe.fromJSON(e,n.slice),n.insert,!!n.structure)}}li.jsonID("replaceAround",Wn);function um(t,e,n){let i=t.resolve(e),r=n-e,o=i.depth;for(;r>0&&o>0&&i.indexAfter(o)==i.node(o).childCount;)o--,r--;if(r>0){let s=i.node(o).maybeChild(i.indexAfter(o));for(;r>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,r--}}return!1}function B$(t,e,n,i){let r=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,n),h=i.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(h)||(s&&s.to==f&&s.mark.eq(d[m])?s.to=p:r.push(s=new kr(f,p,d[m])));a&&a.to==f?a.to=p:o.push(a=new Io(f,p,i))}}),r.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function $$(t,e,n,i){let r=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(i instanceof Xc){let u=s.marks,c;for(;c=i.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(s.marks)&&(l=[i]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],f;for(let p=0;p<r.length;p++){let h=r[p];h.step==o-1&&d.eq(r[p].style)&&(f=h)}f?(f.to=u,f.step=o):r.push({style:d,from:Math.max(a,e),to:u,step:o})}}}),r.forEach(s=>t.step(new kr(s.from,s.to,s.style)))}function cm(t,e,n,i=n.contentMatch,r=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let u=o.child(l),c=a+u.nodeSize,d=i.matchType(u.type);if(!d)s.push(new Kn(a,c,Xe.empty));else{i=d;for(let f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||t.step(new kr(a,c,u.marks[f]));if(r&&u.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(u.text);)h||(h=new Xe(Ee.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new Kn(a+f.index,a+f.index+f[0].length,h))}}a=c}if(!i.validEnd){let l=i.fillBefore(Ee.empty,!0);t.replace(a,a,new Xe(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function V$(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ma(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let i=t.depth;;--i){let r=t.$from.node(i),o=t.$from.index(i),s=t.$to.indexAfter(i);if(i<t.depth&&r.canReplace(o,s,n))return i;if(i==0||r.type.spec.isolating||!V$(r,o,s))break}return null}function z$(t,e,n){let{$from:i,$to:r,depth:o}=e,s=i.before(o+1),a=r.after(o+1),l=s,u=a,c=Ee.empty,d=0;for(let h=o,m=!1;h>n;h--)m||i.index(h)>0?(m=!0,c=Ee.from(i.node(h).copy(c)),d++):l--;let f=Ee.empty,p=0;for(let h=o,m=!1;h>n;h--)m||r.after(h+1)<r.end(h)?(m=!0,f=Ee.from(r.node(h).copy(f)),p++):u++;t.step(new Wn(l,u,s,a,new Xe(c.append(f),d,p),c.size-d,!0))}function dm(t,e,n=null,i=t){let r=F$(t,e),o=r&&j$(i,e);return o?r.map(Bw).concat({type:e,attrs:n}).concat(o.map(Bw)):null}function Bw(t){return{type:t,attrs:null}}function F$(t,e){let{parent:n,startIndex:i,endIndex:r}=t,o=n.contentMatchAt(i).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(i,r,s)?o:null}function j$(t,e){let{parent:n,startIndex:i,endIndex:r}=t,o=n.child(i),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let u=i;l&&u<r;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function H$(t,e,n){let i=Ee.empty;for(let s=n.length-1;s>=0;s--){if(i.size){let a=n[s].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Ee.from(n[s].type.create(n[s].attrs,i))}let r=e.start,o=e.end;t.step(new Wn(r,o,r,o,new Xe(i,0,0),n.length,!0))}function U$(t,e,n,i,r){if(!i.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 l=typeof r=="function"?r(s):r;if(s.isTextblock&&!s.hasMarkup(i,l)&&K$(t.doc,t.mapping.slice(o).map(a),i)){let u=null;if(i.schema.linebreakReplacement){let p=i.whitespace=="pre",h=!!i.contentMatch.matchType(i.schema.linebreakReplacement);p&&!h?u=!1:!p&&h&&(u=!0)}u===!1&&Vw(t,s,a,o),cm(t,t.mapping.slice(o).map(a,1),i,void 0,u===null);let c=t.mapping.slice(o),d=c.map(a,1),f=c.map(a+s.nodeSize,1);return t.step(new Wn(d,f,d+1,f-1,new Xe(Ee.from(i.create(l,null,s.marks)),0,0),1,!0)),u===!0&&$w(t,s,a,o),!1}})}function $w(t,e,n,i){e.forEach((r,o)=>{if(r.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(r.text);){let l=t.mapping.slice(i).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Vw(t,e,n,i){e.forEach((r,o)=>{if(r.type==r.type.schema.linebreakReplacement){let s=t.mapping.slice(i).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
236
- `))}})}function K$(t,e,n){let i=t.resolve(e),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}function W$(t,e,n,i,r){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(i,null,r||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 Wn(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Xe(Ee.from(s),0,0),1,!0))}function _r(t,e,n=1,i){let r=t.resolve(e),o=r.depth-n,s=i&&i[i.length-1]||r.parent;if(o<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!s.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,c=n-2;u>o;u--,c--){let d=r.node(u),f=r.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=i&&i[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=r.indexAfter(o),l=i&&i[0];return r.node(o).canReplaceWith(a,a,l?l.type:r.node(o+1).type)}function q$(t,e,n=1,i){let r=t.doc.resolve(e),o=Ee.empty,s=Ee.empty;for(let a=r.depth,l=r.depth-n,u=n-1;a>l;a--,u--){o=Ee.from(r.node(a).copy(o));let c=i&&i[u];s=Ee.from(c?c.type.create(c.attrs,s):r.node(a).copy(s))}t.step(new Kn(e,e,new Xe(o.append(s),n,n),!0))}function Do(t,e){let n=t.resolve(e),i=n.index();return zw(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function X$(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:i}=t.type.schema;for(let r=0;r<e.childCount;r++){let o=e.child(r),s=o.type==i?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function zw(t,e){return!!(t&&e&&!t.isLeaf&&X$(t,e))}function Yc(t,e,n=-1){let i=t.resolve(e);for(let r=i.depth;;r--){let o,s,a=i.index(r);if(r==i.depth?(o=i.nodeBefore,s=i.nodeAfter):n>0?(o=i.node(r+1),a++,s=i.node(r).maybeChild(a)):(o=i.node(r).maybeChild(a-1),s=i.node(r+1)),o&&!o.isTextblock&&zw(o,s)&&i.node(r).canReplace(a,a+1))return e;if(r==0)break;e=n<0?i.before(r):i.after(r)}}function G$(t,e,n){let i=null,{linebreakReplacement:r}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(r&&s.inlineContent){let c=s.whitespace=="pre",d=!!s.contentMatch.matchType(r);c&&!d?i=!1:!c&&d&&(i=!0)}let a=t.steps.length;if(i===!1){let c=t.doc.resolve(e+n);Vw(t,c.node(),c.before(),a)}s.inlineContent&&cm(t,e+n-1,s,o.node().contentMatchAt(o.index()),i==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Kn(u,l.map(e+n,-1),Xe.empty,!0)),i===!0){let c=t.doc.resolve(u);$w(t,c.node(),c.before(),t.steps.length)}return t}function Z$(t,e,n){let i=t.resolve(e);if(i.parent.canReplaceWith(i.index(),i.index(),n))return e;if(i.parentOffset==0)for(let r=i.depth-1;r>=0;r--){let o=i.index(r);if(i.node(r).canReplaceWith(o,o,n))return i.before(r+1);if(o>0)return null}if(i.parentOffset==i.parent.content.size)for(let r=i.depth-1;r>=0;r--){let o=i.indexAfter(r);if(i.node(r).canReplaceWith(o,o,n))return i.after(r+1);if(o<i.node(r).childCount)return null}return null}function _$(t,e,n){let i=t.resolve(e);if(!n.content.size)return e;let r=n.content;for(let o=0;o<n.openStart;o++)r=r.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=i.depth;s>=0;s--){let a=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,l=i.index(s)+(a>0?1:0),u=i.node(s),c=!1;if(o==1)c=u.canReplace(l,l,r);else{let d=u.contentMatchAt(l).findWrapping(r.firstChild.type);c=d&&u.canReplaceWith(l,l,d[0])}if(c)return a==0?i.pos:a<0?i.before(s+1):i.after(s+1)}return null}function Qc(t,e,n=e,i=Xe.empty){if(e==n&&!i.size)return null;let r=t.resolve(e),o=t.resolve(n);return Fw(r,o,i)?new Kn(e,n,i):new J$(r,o,i).fit()}function Fw(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class J${constructor(e,n,i){this.$from=e,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=Ee.empty;for(let r=0;r<=e.depth;r++){let o=e.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=Ee.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(e<0?this.$to:i.doc.resolve(e));if(!r)return null;let o=this.placed,s=i.depth,a=r.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new Xe(o,s,a);return e>-1?new Wn(i.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||i.pos!=this.$to.pos?new Kn(i.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,r=this.unplaced.openEnd;i<e;i++){let o=n.firstChild;if(n.childCount>1&&(r=0),o.type.spec.isolating&&r<=i){e=i;break}n=o.content}for(let n=1;n<=2;n++)for(let i=n==1?e:this.unplaced.openStart;i>=0;i--){let r,o=null;i?(o=fm(this.unplaced.content,i-1).firstChild,r=o.content):r=this.unplaced.content;let s=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,d=null;if(n==1&&(s?u.matchType(s.type)||(d=u.fillBefore(Ee.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:i,frontierDepth:a,parent:o,inject:d};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:i,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:i}=this.unplaced,r=fm(e,n);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new Xe(e,n+1,Math.max(i,r.size+n>=e.size-i?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:i}=this.unplaced,r=fm(e,n);if(r.childCount<=1&&n>0){let o=e.size-n<=n+r.size;this.unplaced=new Xe(ru(e,n-1,1),n-1,o?n-1:i)}else this.unplaced=new Xe(ru(e,n,1),n,i)}placeNodes({sliceDepth:e,frontierDepth:n,parent:i,inject:r,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=i?i.content:s.content,l=s.openStart-e,u=0,c=[],{match:d,type:f}=this.frontier[n];if(r){for(let m=0;m<r.childCount;m++)c.push(r.child(m));d=d.matchFragment(r)}let p=a.size+e-(s.content.size-s.openEnd);for(;u<a.childCount;){let m=a.child(u),v=d.matchType(m.type);if(!v)break;u++,(u>1||l==0||m.content.size)&&(d=v,c.push(jw(m.mark(f.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?p:-1)))}let h=u==a.childCount;h||(p=-1),this.placed=ou(this.placed,n,Ee.from(c)),this.frontier[n].match=d,h&&p<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,v=a;m<p;m++){let S=v.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),v=S.content}this.unplaced=h?e==0?Xe.empty:new Xe(ru(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new Xe(ru(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!pm(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:i}=this.$to,r=this.$to.after(i);for(;i>1&&r==this.$to.end(--i);)++r;return r}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:i,type:r}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=pm(e,n,r,i,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=pm(e,a,u,l,!0);if(!c||c.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=ou(this.placed,n.depth,n.fit)),e=n.move;for(let i=n.depth+1;i<=e.depth;i++){let r=e.node(i),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(i));this.openFrontierNode(r.type,r.attrs,o)}return e}openFrontierNode(e,n=null,i){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=ou(this.placed,this.depth,Ee.from(e.create(n,i))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Ee.empty,!0);n.childCount&&(this.placed=ou(this.placed,this.frontier.length,n))}}function ru(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ru(t.firstChild.content,e-1,n)))}function ou(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ou(t.lastChild.content,e-1,n)))}function fm(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function jw(t,e,n){if(e<=0)return t;let i=t.content;return e>1&&(i=i.replaceChild(0,jw(i.firstChild,e-1,i.childCount==1?n-1:0))),e>0&&(i=t.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(Ee.empty,!0)))),t.copy(i)}function pm(t,e,n,i,r){let o=t.node(e),s=r?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=i.fillBefore(o.content,!0,s);return a&&!Y$(n,o.content,s)?a:null}function Y$(t,e,n){for(let i=n;i<e.childCount;i++)if(!t.allowsMarks(e.child(i).marks))return!0;return!1}function Q$(t){return t.spec.defining||t.spec.definingForContent}function eV(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let r=t.doc.resolve(e),o=t.doc.resolve(n);if(Fw(r,o,i))return t.step(new Kn(e,n,i));let s=Uw(r,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(r.depth+1);s.unshift(a);for(let f=r.depth,p=r.pos-1;f>0;f--,p--){let h=r.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:r.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),u=[],c=i.openStart;for(let f=i.content,p=0;;p++){let h=f.firstChild;if(u.push(h),p==i.openStart)break;f=h.content}for(let f=c-1;f>=0;f--){let p=u[f],h=Q$(p.type);if(h&&!p.sameMarkup(r.node(Math.abs(a)-1)))c=f;else if(h||!p.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let p=(f+c+1)%(i.openStart+1),h=u[p];if(h)for(let m=0;m<s.length;m++){let v=s[(m+l)%s.length],S=!0;v<0&&(S=!1,v=-v);let b=r.node(v-1),k=r.index(v-1);if(b.canReplaceWith(k,k,h.type,h.marks))return t.replace(r.before(v),S?o.after(v):n,new Xe(Hw(i.content,0,i.openStart,p),p,i.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,i),!(t.steps.length>d));f--){let p=s[f];p<0||(e=r.before(p),n=o.after(p))}}function Hw(t,e,n,i,r){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Hw(o.content,e+1,n,i,o)))}if(e>i){let o=r.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(Ee.empty,!0))}return t}function tV(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=Z$(t.doc,e,i.type);r!=null&&(e=n=r)}t.replaceRange(e,n,new Xe(Ee.from(i),0,0))}function nV(t,e,n){let i=t.doc.resolve(e),r=t.doc.resolve(n),o=Uw(i,r);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||i.node(a).type.contentMatch.validEnd)return t.delete(i.start(a),r.end(a));if(a>0&&(l||i.node(a-1).canReplace(i.index(a-1),r.indexAfter(a-1))))return t.delete(i.before(a),r.after(a))}for(let s=1;s<=i.depth&&s<=r.depth;s++)if(e-i.start(s)==i.depth-s&&n>i.end(s)&&r.end(s)-n!=r.depth-s&&i.start(s-1)==r.start(s-1)&&i.node(s-1).canReplace(i.index(s-1),r.index(s-1)))return t.delete(i.before(s),n);t.delete(e,n)}function Uw(t,e){let n=[],i=Math.min(t.depth,e.depth);for(let r=i;r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class ga extends li{constructor(e,n,i){super(),this.pos=e,this.attr=n,this.value=i}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nn.fail("No node at attribute step's position");let i=Object.create(null);for(let o in n.attrs)i[o]=n.attrs[o];i[this.attr]=this.value;let r=n.type.create(i,null,n.marks);return Nn.fromReplace(e,this.pos,this.pos+1,new Xe(Ee.from(r),0,n.isLeaf?0:1))}getMap(){return Di.empty}invert(e){return new ga(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 ga(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 ga(n.pos,n.attr,n.value)}}li.jsonID("attr",ga);class su extends li{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;let i=e.type.create(n,e.content,e.marks);return Nn.ok(i)}getMap(){return Di.empty}invert(e){return new su(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 su(n.attr,n.value)}}li.jsonID("docAttr",su);let va=class extends Error{};va=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},va.prototype=Object.create(Error.prototype),va.prototype.constructor=va,va.prototype.name="TransformError";class Kw{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new iu}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new va(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,i=Xe.empty){let r=Qc(this.doc,e,n,i);return r&&this.step(r),this}replaceWith(e,n,i){return this.replace(e,n,new Xe(Ee.from(i),0,0))}delete(e,n){return this.replace(e,n,Xe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,i){return eV(this,e,n,i),this}replaceRangeWith(e,n,i){return tV(this,e,n,i),this}deleteRange(e,n){return nV(this,e,n),this}lift(e,n){return z$(this,e,n),this}join(e,n=1){return G$(this,e,n),this}wrap(e,n){return H$(this,e,n),this}setBlockType(e,n=e,i,r=null){return U$(this,e,n,i,r),this}setNodeMarkup(e,n,i=null,r){return W$(this,e,n,i,r),this}setNodeAttribute(e,n,i){return this.step(new ga(e,n,i)),this}setDocAttribute(e,n){return this.step(new su(e,n)),this}addNodeMark(e,n){return this.step(new Lo(e,n)),this}removeNodeMark(e,n){let i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at position "+e);if(n instanceof un)n.isInSet(i.marks)&&this.step(new ws(e,n));else{let r=i.marks,o,s=[];for(;o=n.isInSet(r);)s.push(new ws(e,o)),r=o.removeFromSet(r);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(e,n=1,i){return q$(this,e,n,i),this}addMark(e,n,i){return B$(this,e,n,i),this}removeMark(e,n,i){return $$(this,e,n,i),this}clearIncompatible(e,n,i){return cm(this,e,n,i),this}}const hm=Object.create(null);class Vt{constructor(e,n,i){this.$anchor=e,this.$head=n,this.ranges=i||[new iV(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=Xe.empty){let i=n.content.lastChild,r=null;for(let a=0;a<n.openEnd;a++)r=i,i=i.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:u}=s[a],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(u.pos),a?Xe.empty:n),a==0&&Xw(e,o,(i?i.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,n){let i=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:s,$to:a}=r[o],l=e.mapping.slice(i),u=l.map(s.pos),c=l.map(a.pos);o?e.deleteRange(u,c):(e.replaceRangeWith(u,c,n),Xw(e,i,n.isInline?-1:1))}}static findFrom(e,n,i=!1){let r=e.parent.inlineContent?new Mt(e):ya(e.node(0),e.parent,e.pos,e.index(),n,i);if(r)return r;for(let o=e.depth-1;o>=0;o--){let s=n<0?ya(e.node(0),e.node(o),e.before(o+1),e.index(o),n,i):ya(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,i);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ri(e.node(0))}static atStart(e){return ya(e,e,0,0,1)||new Ri(e)}static atEnd(e){return ya(e,e,e.content.size,e.childCount,-1)||new Ri(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=hm[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(e,n)}static jsonID(e,n){if(e in hm)throw new RangeError("Duplicate use of selection JSON ID "+e);return hm[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Mt.between(this.$anchor,this.$head).getBookmark()}}Vt.prototype.visible=!0;class iV{constructor(e,n){this.$from=e,this.$to=n}}let Ww=!1;function qw(t){!Ww&&!t.parent.inlineContent&&(Ww=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Mt extends Vt{constructor(e,n=e){qw(e),qw(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let i=e.resolve(n.map(this.head));if(!i.parent.inlineContent)return Vt.near(i);let r=e.resolve(n.map(this.anchor));return new Mt(r.parent.inlineContent?r:i,i)}replace(e,n=Xe.empty){if(super.replace(e,n),n==Xe.empty){let i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}eq(e){return e instanceof Mt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ed(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 Mt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,i=n){let r=e.resolve(n);return new this(r,i==n?r:e.resolve(i))}static between(e,n,i){let r=e.pos-n.pos;if((!i||r)&&(i=r>=0?1:-1),!n.parent.inlineContent){let o=Vt.findFrom(n,i,!0)||Vt.findFrom(n,-i,!0);if(o)n=o.$head;else return Vt.near(n,i)}return e.parent.inlineContent||(r==0?e=n:(e=(Vt.findFrom(e,-i,!0)||Vt.findFrom(e,i,!0)).$anchor,e.pos<n.pos!=r<0&&(e=n))),new Mt(e,n)}}Vt.jsonID("text",Mt);class ed{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ed(e.map(this.anchor),e.map(this.head))}resolve(e){return Mt.between(e.resolve(this.anchor),e.resolve(this.head))}}class mt extends Vt{constructor(e){let n=e.nodeAfter,i=e.node(0).resolve(e.pos+n.nodeSize);super(e,i),this.node=n}map(e,n){let{deleted:i,pos:r}=n.mapResult(this.anchor),o=e.resolve(r);return i?Vt.near(o):new mt(o)}content(){return new Xe(Ee.from(this.node),0,0)}eq(e){return e instanceof mt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new mm(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new mt(e.resolve(n.anchor))}static create(e,n){return new mt(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}mt.prototype.visible=!1,Vt.jsonID("node",mt);class mm{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:i}=e.mapResult(this.anchor);return n?new ed(i,i):new mm(i)}resolve(e){let n=e.resolve(this.anchor),i=n.nodeAfter;return i&&mt.isSelectable(i)?new mt(n):Vt.near(n)}}class Ri extends Vt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Xe.empty){if(n==Xe.empty){e.delete(0,e.doc.content.size);let i=Vt.atStart(e.doc);i.eq(e.selection)||e.setSelection(i)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ri(e)}map(e){return new Ri(e)}eq(e){return e instanceof Ri}getBookmark(){return rV}}Vt.jsonID("all",Ri);const rV={map(){return this},resolve(t){return new Ri(t)}};function ya(t,e,n,i,r,o=!1){if(e.inlineContent)return Mt.create(t,n);for(let s=i-(r>0?0:1);r>0?s<e.childCount:s>=0;s+=r){let a=e.child(s);if(a.isAtom){if(!o&&mt.isSelectable(a))return mt.create(t,n-(r<0?a.nodeSize:0))}else{let l=ya(t,a,n+r,r<0?a.childCount:0,r,o);if(l)return l}n+=a.nodeSize*r}return null}function Xw(t,e,n){let i=t.steps.length-1;if(i<e)return;let r=t.steps[i];if(!(r instanceof Kn||r instanceof Wn))return;let o=t.mapping.maps[i],s;o.forEach((a,l,u,c)=>{s==null&&(s=c)}),t.setSelection(Vt.near(t.doc.resolve(s),n))}const Gw=1,Zw=2,_w=4;class oV extends Kw{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|Gw)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Gw)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Zw,this}ensureMarks(e){return un.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&Zw)>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 i=this.selection;return n&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||un.none))),i.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,i){let r=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(i==null&&(i=n),i=i??n,!e)return this.deleteRange(n,i);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=i==n?s.marks():s.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,r.text(e,o)),this.selection.empty||this.setSelection(Vt.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|=_w,this}get scrolledIntoView(){return(this.updated&_w)>0}}function Jw(t,e){return!e||!t?t:t.bind(e)}class au{constructor(e,n,i){this.name=e,this.init=Jw(n.init,i),this.apply=Jw(n.apply,i)}}const sV=[new au("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new au("selection",{init(t,e){return t.selection||Vt.atStart(e.doc)},apply(t){return t.selection}}),new au("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,i){return i.selection.$cursor?t.storedMarks:null}}),new au("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class gm{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sV.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new au(i.key,i.spec.state,i))})}}class ba{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 i=0;i<this.config.plugins.length;i++)if(i!=n){let r=this.config.plugins[i];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],i=this.applyInner(e),r=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=r?r[s].n:0,u=r?r[s].state:this,c=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,i);if(c&&i.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let d=0;d<this.config.plugins.length;d++)r.push(d<s?{state:i,n:n.length}:{state:this,n:0})}n.push(c),i=i.applyInner(c),o=!0}r&&(r[s]={state:i,n:n.length})}}if(!o)return{state:i,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ba(this.config),i=this.config.fields;for(let r=0;r<i.length;r++){let o=i[r];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new oV(this)}static create(e){let n=new gm(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new ba(n);for(let r=0;r<n.fields.length;r++)i[n.fields[r].name]=n.fields[r].init(e,i);return i}reconfigure(e){let n=new gm(this.schema,e.plugins),i=n.fields,r=new ba(n);for(let o=0;o<i.length;o++){let s=i[o].name;r[s]=this.hasOwnProperty(s)?this[s]:i[o].init(e,r)}return r}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(i=>i.toJSON())),e&&typeof e=="object")for(let i in e){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[i],o=r.spec.state;o&&o.toJSON&&(n[i]=o.toJSON.call(r,this[r.key]))}return n}static fromJSON(e,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new gm(e.schema,e.plugins),o=new ba(r);return r.fields.forEach(s=>{if(s.name=="doc")o.doc=Eo.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=Vt.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(i)for(let a in i){let l=i[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=u.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function Yw(t,e,n){for(let i in t){let r=t[i];r instanceof Function?r=r.bind(e):i=="handleDOMEvents"&&(r=Yw(r,e,{})),n[i]=r}return n}class qn{constructor(e){this.spec=e,this.props={},e.props&&Yw(e.props,this,this.props),this.key=e.key?e.key.key:Qw("plugin")}getState(e){return e[this.key]}}const vm=Object.create(null);function Qw(t){return t in vm?t+"$"+ ++vm[t]:(vm[t]=0,t+"$")}class ni{constructor(e="key"){this.key=Qw(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ii=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Aa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let ym=null;const Jr=function(t,e,n){let i=ym||(ym=document.createRange());return i.setEnd(t,n??t.nodeValue.length),i.setStart(t,e||0),i},aV=function(){ym=null},Ss=function(t,e,n,i){return n&&(eS(t,e,n,i,-1)||eS(t,e,n,i,1))},lV=/^(img|br|input|textarea|hr)$/i;function eS(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:Wi(t))){let o=t.parentNode;if(!o||o.nodeType!=1||lu(t)||lV.test(t.nodeName)||t.contentEditable=="false")return!1;e=ii(t)+(r<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.contentEditable=="false")return!1;e=r<0?Wi(t):0}else return!1}}function Wi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function uV(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=Wi(t)}else if(t.parentNode&&!lu(t))e=ii(t),t=t.parentNode;else return null}}function cV(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&&!lu(t))e=ii(t)+1,t=t.parentNode;else return null}}function dV(t,e,n){for(let i=e==0,r=e==Wi(t);i||r;){if(t==n)return!0;let o=ii(t);if(t=t.parentNode,!t)return!1;i=i&&o==0,r=r&&o==Wi(t)}}function lu(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 td=function(t){return t.focusNode&&Ss(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Cs(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function fV(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function pV(t,e,n){if(t.caretPositionFromPoint)try{let i=t.caretPositionFromPoint(e,n);if(i)return{node:i.offsetNode,offset:Math.min(Wi(i.offsetNode),i.offset)}}catch{}if(t.caretRangeFromPoint){let i=t.caretRangeFromPoint(e,n);if(i)return{node:i.startContainer,offset:Math.min(Wi(i.startContainer),i.startOffset)}}}const Or=typeof navigator<"u"?navigator:null,tS=typeof document<"u"?document:null,Ro=Or&&Or.userAgent||"",bm=/Edge\/(\d+)/.exec(Ro),nS=/MSIE \d/.exec(Ro),Am=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ro),Ti=!!(nS||Am||bm),No=nS?document.documentMode:Am?+Am[1]:bm?+bm[1]:0,fr=!Ti&&/gecko\/(\d+)/i.test(Ro);fr&&+(/Firefox\/(\d+)/.exec(Ro)||[0,0])[1];const wm=!Ti&&/Chrome\/(\d+)/.exec(Ro),ui=!!wm,iS=wm?+wm[1]:0,vi=!Ti&&!!Or&&/Apple Computer/.test(Or.vendor),wa=vi&&(/Mobile\/\w+/.test(Ro)||!!Or&&Or.maxTouchPoints>2),qi=wa||(Or?/Mac/.test(Or.platform):!1),hV=Or?/Win/.test(Or.platform):!1,Yr=/Android \d/.test(Ro),uu=!!tS&&"webkitFontSmoothing"in tS.documentElement.style,mV=uu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function gV(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 Qr(t,e){return typeof t=="number"?t:t[e]}function vV(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,i=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*i}}function rS(t,e,n){let i=t.someProp("scrollThreshold")||0,r=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=Aa(s);continue}let a=s,l=a==o.body,u=l?gV(o):vV(a),c=0,d=0;if(e.top<u.top+Qr(i,"top")?d=-(u.top-e.top+Qr(r,"top")):e.bottom>u.bottom-Qr(i,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Qr(r,"top")-u.top:e.bottom-u.bottom+Qr(r,"bottom")),e.left<u.left+Qr(i,"left")?c=-(u.left-e.left+Qr(r,"left")):e.right>u.right-Qr(i,"right")&&(c=e.right-u.right+Qr(r,"right")),c||d)if(l)o.defaultView.scrollBy(c,d);else{let p=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let m=a.scrollLeft-p,v=a.scrollTop-h;e={left:e.left-m,top:e.top-v,right:e.right-m,bottom:e.bottom-v}}let f=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(f))break;s=f=="absolute"?s.offsetParent:Aa(s)}}function yV(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),i,r;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){i=a,r=l.top;break}}return{refDOM:i,refTop:r,stack:oS(t.dom)}}function oS(t){let e=[],n=t.ownerDocument;for(let i=t;i&&(e.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=n);i=Aa(i));return e}function bV({refDOM:t,refTop:e,stack:n}){let i=t?t.getBoundingClientRect().top:0;sS(n,i==0?0:i-e)}function sS(t,e){for(let n=0;n<t.length;n++){let{dom:i,top:r,left:o}=t[n];i.scrollTop!=r+e&&(i.scrollTop=r+e),i.scrollLeft!=o&&(i.scrollLeft=o)}}let Sa=null;function AV(t){if(t.setActive)return t.setActive();if(Sa)return t.focus(Sa);let e=oS(t);t.focus(Sa==null?{get preventScroll(){return Sa={preventScroll:!0},!0}}:void 0),Sa||(Sa=!1,sS(e,0))}function aS(t,e){let n,i=2e8,r,o=0,s=e.top,a=e.top,l,u;for(let c=t.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=Jr(c).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<i){n=c,i=m,r=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,c.nodeType==1&&m&&(o=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=c,u={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=d+1)}}return!n&&l&&(n=l,r=u,i=0),n&&n.nodeType==3?wV(n,r):!n||i&&n.nodeType==1?{node:t,offset:o}:aS(n,r)}function wV(t,e){let n=t.nodeValue.length,i=document.createRange();for(let r=0;r<n;r++){i.setEnd(t,r+1),i.setStart(t,r);let o=Bo(i,1);if(o.top!=o.bottom&&Sm(e,o))return{node:t,offset:r+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Sm(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function SV(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function CV(t,e,n){let{node:i,offset:r}=aS(e,n),o=-1;if(i.nodeType==1&&!i.firstChild){let s=i.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(i,r,o)}function kV(t,e,n,i){let r=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>i.left||l.top>i.top?r=a.posBefore:(!s&&l.right<i.left||l.bottom<i.top)&&(r=a.posAfter),s=!0),!a.contentDOM&&r<0&&!a.node.isText))return(a.node.isBlock?i.top<(l.top+l.bottom)/2:i.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return r>-1?r:t.docView.posFromDOM(e,n,-1)}function lS(t,e,n){let i=t.childNodes.length;if(i&&n.top<n.bottom)for(let r=Math.max(0,Math.min(i-1,Math.floor(i*(e.top-n.top)/(n.bottom-n.top))-2)),o=r;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(Sm(e,u))return lS(s,e,u)}}if((o=(o+1)%i)==r)break}return t}function OV(t,e){let n=t.dom.ownerDocument,i,r=0,o=pV(n,e.left,e.top);o&&({node:i,offset:r}=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 u=t.dom.getBoundingClientRect();if(!Sm(e,u)||(s=lS(t.dom,e,u),!s))return null}if(vi)for(let u=s;i&&u;u=Aa(u))u.draggable&&(i=void 0);if(s=SV(s,e),i){if(fr&&i.nodeType==1&&(r=Math.min(r,i.childNodes.length),r<i.childNodes.length)){let c=i.childNodes[r],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&r++}let u;uu&&r&&i.nodeType==1&&(u=i.childNodes[r-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&r--,i==t.dom&&r==i.childNodes.length-1&&i.lastChild.nodeType==1&&e.top>i.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(r==0||i.nodeType!=1||i.childNodes[r-1].nodeName!="BR")&&(a=kV(t,i,r,e))}a==null&&(a=CV(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function uS(t){return t.top<t.bottom||t.left<t.right}function Bo(t,e){let n=t.getClientRects();if(n.length){let i=n[e<0?0:n.length-1];if(uS(i))return i}return Array.prototype.find.call(n,uS)||t.getBoundingClientRect()}const TV=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function cS(t,e,n){let{node:i,offset:r,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=uu||fr;if(i.nodeType==3)if(s&&(TV.test(i.nodeValue)||(n<0?!r:r==i.nodeValue.length))){let l=Bo(Jr(i,r,r),n);if(fr&&r&&/\s/.test(i.nodeValue[r-1])&&r<i.nodeValue.length){let u=Bo(Jr(i,r-1,r-1),-1);if(u.top==l.top){let c=Bo(Jr(i,r,r+1),-1);if(c.top!=l.top)return cu(c,c.left<u.left)}}return l}else{let l=r,u=r,c=n<0?1:-1;return n<0&&!r?(u++,c=-1):n>=0&&r==i.nodeValue.length?(l--,c=1):n<0?l--:u++,cu(Bo(Jr(i,l,u),c),c<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&r&&(n<0||r==Wi(i))){let l=i.childNodes[r-1];if(l.nodeType==1)return Cm(l.getBoundingClientRect(),!1)}if(o==null&&r<Wi(i)){let l=i.childNodes[r];if(l.nodeType==1)return Cm(l.getBoundingClientRect(),!0)}return Cm(i.getBoundingClientRect(),n>=0)}if(o==null&&r&&(n<0||r==Wi(i))){let l=i.childNodes[r-1],u=l.nodeType==3?Jr(l,Wi(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return cu(Bo(u,1),!1)}if(o==null&&r<Wi(i)){let l=i.childNodes[r];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Jr(l,0,s?0:1):l.nodeType==1?l:null:null;if(u)return cu(Bo(u,-1),!0)}return cu(Bo(i.nodeType==3?Jr(i):i,-n),n>=0)}function cu(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 Cm(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 dS(t,e,n){let i=t.state,r=t.root.activeElement;i!=e&&t.updateState(e),r!=t.dom&&t.focus();try{return n()}finally{i!=e&&t.updateState(i),r!=t.dom&&r&&r.focus()}}function xV(t,e,n){let i=e.selection,r=n=="up"?i.$from:i.$to;return dS(t,e,()=>{let{node:o}=t.docView.domFromPos(r.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=cS(t,r.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Jr(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const MV=/[\u0590-\u08ac]/;function EV(t,e,n){let{$head:i}=e.selection;if(!i.parent.isTextblock)return!1;let r=i.parentOffset,o=!r,s=r==i.parent.content.size,a=t.domSelection();return a?!MV.test(i.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:dS(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),v=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&u==m;try{a.collapse(c,d),l&&(l!=c||u!=d)&&a.extend&&a.extend(l,u)}catch{}return f!=null&&(a.caretBidiLevel=f),v}):i.pos==i.start()||i.pos==i.end()}let fS=null,pS=null,hS=!1;function PV(t,e,n){return fS==e&&pS==n?hS:(fS=e,pS=n,hS=n=="up"||n=="down"?xV(t,e,n):EV(t,e,n))}const Xi=0,mS=1,ks=2,Tr=3;class du{constructor(e,n,i,r){this.parent=e,this.children=n,this.dom=i,this.contentDOM=r,this.dirty=Xi,i.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,i){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,i=this.posAtStart;;n++){let r=this.children[n];if(r==e)return i;i+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,i){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(i<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 r;if(e==this.dom&&this.contentDOM)r=n>ii(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){r=!1;break}if(o.previousSibling)break}if(r==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){r=!0;break}if(o.nextSibling)break}}return r??i>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let i=!0,r=e;r;r=r.parentNode){let o=this.getDesc(r),s;if(o&&(!n||o.node))if(i&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))i=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let i=n;i;i=i.parent)if(i==this)return n}posFromDOM(e,n,i){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,n,i)}return-1}descAt(e){for(let n=0,i=0;n<this.children.length;n++){let r=this.children[n],o=i+r.size;if(i==e&&o!=i){for(;!r.border&&r.children.length;)for(let s=0;s<r.children.length;s++){let a=r.children[s];if(a.size){r=a;break}}return r}if(e<o)return r.descAt(e-i-r.border);i=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let i=0,r=0;for(let o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.size;if(a>e||s instanceof yS){r=e-o;break}o=a}if(r)return this.children[i].domFromPos(r-this.children[i].border,n);for(let o;i&&!(o=this.children[i-1]).size&&o instanceof gS&&o.side>=0;i--);if(n<=0){let o,s=!0;for(;o=i?this.children[i-1]:null,!(!o||o.dom.parentNode==this.contentDOM);i--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?ii(o.dom)+1:0}}else{let o,s=!0;for(;o=i<this.children.length?this.children[i]:null,!(!o||o.dom.parentNode==this.contentDOM);i++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?ii(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,i=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let s=i,a=0;;a++){let l=this.children[a],u=s+l.size;if(r==-1&&e<=u){let c=s+l.border;if(e>=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=ii(f.dom)+1;break}e-=f.size}r==-1&&(r=0)}if(r>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=ii(d.dom);break}n+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:n,fromOffset:r,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:i}=this.domFromPos(e,0);if(n.nodeType!=1||i==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[i]}setSelection(e,n,i,r=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],v=h+m.size;if(o>h&&s<v)return m.setSelection(e-h-m.border,n-h-m.border,i,r);h=v}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=i.root.getSelection(),c=i.domSelectionRange(),d=!1;if((fr||vi)&&e==n){let{node:p,offset:h}=a;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==`
237
- `),d&&h==p.nodeValue.length)for(let m=p,v;m;m=m.parentNode){if(v=m.nextSibling){v.nodeName=="BR"&&(a=l={node:v.parentNode,offset:ii(v)+1});break}let S=m.pmViewDesc;if(S&&S.node&&S.node.isBlock)break}}else{let m=p.childNodes[h-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(fr&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let p=c.focusNode.childNodes[c.focusOffset];p&&p.contentEditable=="false"&&(r=!0)}if(!(r||d&&vi)&&Ss(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Ss(l.node,l.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||e==n)&&!d){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let h=a;a=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.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 i=0,r=0;r<this.children.length;r++){let o=this.children[r],s=i+o.size;if(i==s?e<=s&&n>=i:e<s&&n>i){let a=i+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==i||n==s?ks:mS,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Tr:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?ks:Tr}i=s}this.dirty=ks}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let i=e==1?ks:mS;n.dirty<i&&(n.dirty=i)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class gS extends du{constructor(e,n,i,r){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(i,()=>{if(!o)return r;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==Xi&&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 IV extends du{constructor(e,n,i,r){super(e,[],n,null),this.textDOM=i,this.text=r}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 Os extends du{constructor(e,n,i,r,o){super(e,[],i,r),this.mark=n,this.spec=o}static create(e,n,i,r){let o=r.nodeViews[n.type.name],s=o&&o(n,r,i);return(!s||!s.dom)&&(s=As.renderSpec(document,n.type.spec.toDOM(n,i),null,n.attrs)),new Os(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Tr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Tr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Xi){let i=this.parent;for(;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=Xi}}slice(e,n,i){let r=Os.create(this.parent,this.mark,!0,i),o=this.children,s=this.size;n<s&&(o=Om(o,n,s,i)),e>0&&(o=Om(o,0,e,i));for(let a=0;a<o.length;a++)o[a].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class $o extends du{constructor(e,n,i,r,o,s,a,l,u){super(e,[],o,s),this.node=n,this.outerDeco=i,this.innerDeco=r,this.nodeDOM=a}static create(e,n,i,r,o,s){let a=o.nodeViews[n.type.name],l,u=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},i,r),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=As.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=wS(c,i,n),u?l=new LV(e,n,i,r,c,d||null,f,u,o,s+1):n.isText?new nd(e,n,i,r,c,f,o):new $o(e,n,i,r,c,d||null,f,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 i=this.children[n];if(this.dom.contains(i.dom.parentNode)){e.contentElement=i.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ee.empty)}return e}matchesNode(e,n,i){return this.dirty==Xi&&e.eq(this.node)&&id(n,this.outerDeco)&&i.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let i=this.node.inlineContent,r=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new RV(this,s&&s.node,e);$V(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,i,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?un.none:this.node.child(c).marks,i,e),l.placeWidget(u,e,r)},(u,c,d,f)=>{l.syncToMarks(u.marks,i,e);let p;l.findNodeMatch(u,c,d,f)||a&&e.state.selection.from>r&&e.state.selection.to<r+u.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(u,c,d,p,e)||l.updateNextNode(u,c,d,e,f,r)||l.addNode(u,c,d,e,r),r+=u.nodeSize}),l.syncToMarks([],i,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ks)&&(s&&this.protectLocalComposition(e,s),bS(this.contentDOM,this.children,e),wa&&VV(this.dom))}localCompositionInfo(e,n){let{from:i,to:r}=e.state.selection;if(!(e.state.selection instanceof Mt)||i<n||r>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=zV(this.node.content,s,i-n,r-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:i,text:r}){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 IV(this,o,n,r);e.input.compositionNodes.push(s),this.children=Om(this.children,i,i+r.length,e,s)}update(e,n,i,r){return this.dirty==Tr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,i,r),!0)}updateInner(e,n,i,r){this.updateOuterDeco(n),this.node=e,this.innerDeco=i,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Xi}updateOuterDeco(e){if(id(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,i=this.dom;this.dom=AS(this.dom,this.nodeDOM,km(this.outerDeco,this.node,n),km(e,this.node,n)),this.dom!=i&&(i.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 vS(t,e,n,i,r){wS(i,e,t);let o=new $o(void 0,t,e,n,i,i,i,r,0);return o.contentDOM&&o.updateChildren(r,0),o}class nd extends $o{constructor(e,n,i,r,o,s,a){super(e,n,i,r,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,i,r){return this.dirty==Tr||this.dirty!=Xi&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Xi||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Xi,!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,i){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,i)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,i){let r=this.node.cut(e,n),o=document.createTextNode(r.text);return new nd(this.parent,r,this.outerDeco,this.innerDeco,o,o,i)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Tr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class yS extends du{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Xi&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class LV extends $o{constructor(e,n,i,r,o,s,a,l,u,c){super(e,n,i,r,o,s,a,u,c),this.spec=l}update(e,n,i,r){if(this.dirty==Tr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,i);return o&&this.updateInner(e,n,i,r),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,i,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,i,r){this.spec.setSelection?this.spec.setSelection(e,n,i.root):super.setSelection(e,n,i,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function bS(t,e,n){let i=t.firstChild,r=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=i;)i=SS(i),r=!0;i=i.nextSibling}else r=!0,t.insertBefore(a,i);if(s instanceof Os){let l=i?i.previousSibling:t.lastChild;bS(s.contentDOM,s.children,n),i=l?l.nextSibling:t.firstChild}}for(;i;)i=SS(i),r=!0;r&&n.trackWrites==t&&(n.trackWrites=null)}const fu=function(t){t&&(this.nodeName=t)};fu.prototype=Object.create(null);const Ts=[new fu];function km(t,e,n){if(t.length==0)return Ts;let i=n?Ts[0]:new fu,r=[i];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&r.push(i=new fu(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&r.length==1&&r.push(i=new fu(e.isInline?"span":"div")),a=="class"?i.class=(i.class?i.class+" ":"")+l:a=="style"?i.style=(i.style?i.style+";":"")+l:a!="nodeName"&&(i[a]=l))}}}return r}function AS(t,e,n,i){if(n==Ts&&i==Ts)return e;let r=e;for(let o=0;o<i.length;o++){let s=i[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&r!=t&&(l=r.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(r),a=Ts[0]),r=l}DV(r,a||Ts[0],s)}return r}function DV(t,e,n){for(let i in e)i!="class"&&i!="style"&&i!="nodeName"&&!(i in n)&&t.removeAttribute(i);for(let i in n)i!="class"&&i!="style"&&i!="nodeName"&&n[i]!=e[i]&&t.setAttribute(i,n[i]);if(e.class!=n.class){let i=e.class?e.class.split(" ").filter(Boolean):[],r=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.remove(i[o]);for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.add(r[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=i.exec(e.style);)t.style.removeProperty(r[1])}n.style&&(t.style.cssText+=n.style)}}function wS(t,e,n){return AS(t,t,Ts,km(e,n,t.nodeType!=1))}function id(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 SS(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class RV{constructor(e,n,i){this.lock=n,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=NV(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let i=e;i<n;i++)this.top.children[i].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,i){let r=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;r<s&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&e[r].type.spec.spanning!==!1;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=Xi,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Os.create(this.top,e[o],n,i);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,i,r){let o=-1,s;if(r>=this.preMatch.index&&(s=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,i))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,i)&&!this.preMatch.matched.has(u)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,i,r,o){let s=this.top.children[r];return s.dirty==Tr&&s.dom==s.contentDOM&&(s.dirty=ks),s.update(e,n,i,o)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let i=e.pmViewDesc;if(i){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==i)return r}return-1}e=n}}updateNextNode(e,n,i,r,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof $o){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let c=l.dom,d,f=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Tr&&id(n,l.outerDeco));if(!f&&l.update(e,n,i,r))return this.destroyBetween(this.index,a),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,i,r,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=ks,d.updateChildren(r,s+1),d.dirty=Xi),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,i,r,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!id(i,e.outerDeco)||!r.eq(e.innerDeco))return null;let a=$o.create(this.top,n,i,r,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,i,r,o){let s=$o.create(this.top,e,n,i,r,o);s.contentDOM&&s.updateChildren(r,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,i){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let o=new gS(this.top,e,n,i);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 Os;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof nd)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((vi||ui)&&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 i=document.createElement(e);e=="IMG"&&(i.className="ProseMirror-separator",i.alt=""),e=="BR"&&(i.className="ProseMirror-trailingBreak");let r=new yS(this.top,[],i,null);n!=this.top?n.children.push(r):n.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function NV(t,e){let n=e,i=n.children.length,r=t.childCount,o=new Map,s=[];e:for(;r>0;){let a;for(;;)if(i){let u=n.children[i-1];if(u instanceof Os)n=u,i=u.children.length;else{a=u,i--;break}}else{if(n==e)break e;i=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(r-1))break;--r,o.set(a,r),s.push(a)}}return{index:r,matched:o,matches:s.reverse()}}function BV(t,e){return t.type.side-e.type.side}function $V(t,e,n,i){let r=e.locals(t),o=0;if(r.length==0){for(let u=0;u<t.childCount;u++){let c=t.child(u);i(c,r,e.forChild(o,c),u),o+=c.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){let c,d;for(;s<r.length&&r[s].to==o;){let v=r[s++];v.widget&&(c?(d||(d=[c])).push(v):c=v)}if(c)if(d){d.sort(BV);for(let v=0;v<d.length;v++)n(d[v],u,!!l)}else n(c,u,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(u<t.childCount)p=u,f=t.child(u++);else break;for(let v=0;v<a.length;v++)a[v].to<=o&&a.splice(v--,1);for(;s<r.length&&r[s].from<=o&&r[s].to>o;)a.push(r[s++]);let h=o+f.nodeSize;if(f.isText){let v=h;s<r.length&&r[s].from<v&&(v=r[s].from);for(let S=0;S<a.length;S++)a[S].to<v&&(v=a[S].to);v<h&&(l=f.cut(v-o),f=f.cut(0,v-o),h=v,p=-1)}else for(;s<r.length&&r[s].to<h;)s++;let m=f.isInline&&!f.isLeaf?a.filter(v=>!v.inline):a.slice();i(f,m,e.forChild(o,f),p),o=h}}function VV(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 zV(t,e,n,i){for(let r=0,o=0;r<t.childCount&&o<=i;){let s=t.child(r++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;r<t.childCount;){let u=t.child(r++);if(o+=u.nodeSize,!u.isText)break;l+=u.text}if(o>=n){if(o>=i&&l.slice(i-e.length-a,i-a)==e)return i-e.length;let u=a<i?l.lastIndexOf(e,i-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==i&&l.length>=i+e.length-a&&l.slice(i-a,i-a+e.length)==e)return i}}return-1}function Om(t,e,n,i,r){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],u=a,c=a+=l.size;u>=n||c<=e?o.push(l):(u<e&&o.push(l.slice(0,e-u,i)),r&&(o.push(r),r=void 0),c>n&&o.push(l.slice(n-u,l.size,i)))}return o}function Tm(t,e=null){let n=t.domSelectionRange(),i=t.state.doc;if(!n.focusNode)return null;let r=t.docView.nearestDesc(n.focusNode),o=r&&r.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=i.resolve(s),l,u;if(td(n)){for(l=s;r&&!r.node;)r=r.parent;let d=r.node;if(r&&d.isAtom&&mt.isSelectable(d)&&r.parent&&!(d.isInline&&dV(n.focusNode,n.focusOffset,r.dom))){let f=r.posBefore;u=new mt(s==f?a:i.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,f=s;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,s]=f==t.state.selection.anchor?[f,d]:[d,f],a=i.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=i.resolve(l);if(!u){let d=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;u=Mm(t,c,a,d)}return u}function CS(t){return t.editable?t.hasFocus():PS(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function eo(t,e=!1){let n=t.state.selection;if(xS(t,n),!!CS(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ui){let i=t.domSelectionRange(),r=t.domObserver.currentSelection;if(i.anchorNode&&r.anchorNode&&Ss(i.anchorNode,i.anchorOffset,r.anchorNode,r.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)jV(t);else{let{anchor:i,head:r}=n,o,s;kS&&!(n instanceof Mt)&&(n.$from.parent.inlineContent||(o=OS(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=OS(t,n.to))),t.docView.setSelection(i,r,t,e),kS&&(o&&TS(o),s&&TS(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&FV(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const kS=vi||ui&&iS<63;function OS(t,e){let{node:n,offset:i}=t.docView.domFromPos(e,0),r=i<n.childNodes.length?n.childNodes[i]:null,o=i?n.childNodes[i-1]:null;if(vi&&r&&r.contentEditable=="false")return xm(r);if((!r||r.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(r)return xm(r);if(o)return xm(o)}}function xm(t){return t.contentEditable="true",vi&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function TS(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function FV(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),i=n.anchorNode,r=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=i||n.anchorOffset!=r)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!CS(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function jV(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let i=t.cursorWrapper.dom,r=i.nodeName=="IMG";r?n.setStart(i.parentNode,ii(i)+1):n.setStart(i,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!r&&!t.state.selection.visible&&Ti&&No<=11&&(i.disabled=!0,i.disabled=!1)}function xS(t,e){if(e instanceof mt){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(MS(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else MS(t)}function MS(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Mm(t,e,n,i){return t.someProp("createSelectionBetween",r=>r(t,e,n))||Mt.between(e,n,i)}function ES(t){return t.editable&&!t.hasFocus()?!1:PS(t)}function PS(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 HV(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Ss(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Em(t,e){let{$anchor:n,$head:i}=t.selection,r=e>0?n.max(i):n.min(i),o=r.parent.inlineContent?r.depth?t.doc.resolve(e>0?r.after():r.before()):null:r;return o&&Vt.findFrom(o,e)}function Vo(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function IS(t,e,n){let i=t.state.selection;if(i instanceof Mt)if(n.indexOf("s")>-1){let{$head:r}=i,o=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(r.pos+o.nodeSize*(e<0?-1:1));return Vo(t,new Mt(i.$anchor,s))}else if(i.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let r=Em(t.state,e);return r&&r instanceof mt?Vo(t,r):!1}else if(!(qi&&n.indexOf("m")>-1)){let r=i.$head,o=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?r.pos-o.nodeSize:r.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?mt.isSelectable(o)?Vo(t,new mt(e<0?t.state.doc.resolve(r.pos-o.nodeSize):r)):uu?Vo(t,new Mt(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(i instanceof mt&&i.node.isInline)return Vo(t,new Mt(e>0?i.$to:i.$from));{let r=Em(t.state,e);return r?Vo(t,r):!1}}}function rd(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pu(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ca(t,e){return e<0?UV(t):KV(t)}function UV(t){let e=t.domSelectionRange(),n=e.focusNode,i=e.focusOffset;if(!n)return;let r,o,s=!1;for(fr&&n.nodeType==1&&i<rd(n)&&pu(n.childNodes[i],-1)&&(s=!0);;)if(i>0){if(n.nodeType!=1)break;{let a=n.childNodes[i-1];if(pu(a,-1))r=n,o=--i;else if(a.nodeType==3)n=a,i=n.nodeValue.length;else break}}else{if(LS(n))break;{let a=n.previousSibling;for(;a&&pu(a,-1);)r=n.parentNode,o=ii(a),a=a.previousSibling;if(a)n=a,i=rd(n);else{if(n=n.parentNode,n==t.dom)break;i=0}}}s?Pm(t,n,i):r&&Pm(t,r,o)}function KV(t){let e=t.domSelectionRange(),n=e.focusNode,i=e.focusOffset;if(!n)return;let r=rd(n),o,s;for(;;)if(i<r){if(n.nodeType!=1)break;let a=n.childNodes[i];if(pu(a,1))o=n,s=++i;else break}else{if(LS(n))break;{let a=n.nextSibling;for(;a&&pu(a,1);)o=a.parentNode,s=ii(a)+1,a=a.nextSibling;if(a)n=a,i=0,r=rd(n);else{if(n=n.parentNode,n==t.dom)break;i=r=0}}}o&&Pm(t,o,s)}function LS(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function WV(t,e){for(;t&&e==t.childNodes.length&&!lu(t);)e=ii(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 qV(t,e){for(;t&&!e&&!lu(t);)e=ii(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 Pm(t,e,n){if(e.nodeType!=3){let o,s;(s=WV(e,n))?(e=s,n=0):(o=qV(e,n))&&(e=o,n=o.nodeValue.length)}let i=t.domSelection();if(!i)return;if(td(i)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),i.removeAllRanges(),i.addRange(o)}else i.extend&&i.extend(e,n);t.domObserver.setCurSelection();let{state:r}=t;setTimeout(()=>{t.state==r&&eo(t)},50)}function DS(t,e){let n=t.state.doc.resolve(e);if(!(ui||hV)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function RS(t,e,n){let i=t.state.selection;if(i instanceof Mt&&!i.empty||n.indexOf("s")>-1||qi&&n.indexOf("m")>-1)return!1;let{$from:r,$to:o}=i;if(!r.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Em(t.state,e);if(s&&s instanceof mt)return Vo(t,s)}if(!r.parent.inlineContent){let s=e<0?r:o,a=i instanceof Ri?Vt.near(s,e):Vt.findFrom(s,e);return a?Vo(t,a):!1}return!1}function NS(t,e){if(!(t.state.selection instanceof Mt))return!0;let{$head:n,$anchor:i,empty:r}=t.state.selection;if(!n.sameParent(i))return!0;if(!r)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 BS(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function XV(t){if(!vi||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 i=e.firstChild;BS(t,i,"true"),setTimeout(()=>BS(t,i,"false"),20)}return!1}function GV(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function ZV(t,e){let n=e.keyCode,i=GV(e);if(n==8||qi&&n==72&&i=="c")return NS(t,-1)||Ca(t,-1);if(n==46&&!e.shiftKey||qi&&n==68&&i=="c")return NS(t,1)||Ca(t,1);if(n==13||n==27)return!0;if(n==37||qi&&n==66&&i=="c"){let r=n==37?DS(t,t.state.selection.from)=="ltr"?-1:1:-1;return IS(t,r,i)||Ca(t,r)}else if(n==39||qi&&n==70&&i=="c"){let r=n==39?DS(t,t.state.selection.from)=="ltr"?1:-1:1;return IS(t,r,i)||Ca(t,r)}else{if(n==38||qi&&n==80&&i=="c")return RS(t,-1,i)||Ca(t,-1);if(n==40||qi&&n==78&&i=="c")return XV(t)||RS(t,1,i)||Ca(t,1);if(i==(qi?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Im(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:i,openStart:r,openEnd:o}=e;for(;r>1&&o>1&&i.childCount==1&&i.firstChild.childCount==1;){r--,o--;let p=i.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),i=p.content}let s=t.someProp("clipboardSerializer")||As.fromSchema(t.state.schema),a=KS(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let u=l.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=HS[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=a.createElement(c[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
238
-
239
- `);return{dom:l,text:f,slice:e}}function $S(t,e,n,i,r){let o=r.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(i||o||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,o||i,t)}),o)return e?new Xe(Ee.from(t.state.schema.text(e.replace(/\r\n?/g,`
240
- `))),0,0):Xe.empty;let d=t.someProp("clipboardTextParser",f=>f(e,r,i,t));if(d)a=d;else{let f=r.marks(),{schema:p}=t.state,h=As.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let v=s.appendChild(document.createElement("p"));m&&v.appendChild(h.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=QV(n),uu&&ez(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Po.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:r,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!_V.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)a=tz(jS(a,+c[1],+c[2]),c[4]);else if(a=Xe.maxOpen(JV(a.content,r),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d<a.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=jS(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const _V=/^(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 JV(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=r.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&zS(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=FS(s[s.length-1],o.length));let c=VS(a,l);s.push(c),r=r.matchType(c.type),o=l}}),s)return Ee.from(s)}return t}function VS(t,e,n=0){for(let i=e.length-1;i>=n;i--)t=e[i].create(null,Ee.from(t));return t}function zS(t,e,n,i,r){if(r<t.length&&r<e.length&&t[r]==e[r]){let o=zS(t,e,n,i.lastChild,r+1);if(o)return i.copy(i.content.replaceChild(i.childCount-1,o));if(i.contentMatchAt(i.childCount).matchType(r==t.length-1?n.type:t[r+1]))return i.copy(i.content.append(Ee.from(VS(n,t,r+1))))}}function FS(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,FS(t.lastChild,e-1)),i=t.contentMatchAt(t.childCount).fillBefore(Ee.empty,!0);return t.copy(n.append(i))}function Lm(t,e,n,i,r,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),r<i-1&&(a=Lm(a,e,n,i,r+1,o)),r>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=r).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Ee.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function jS(t,e,n){return e<t.openStart&&(t=new Xe(Lm(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Xe(Lm(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const HS={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 US=null;function KS(){return US||(US=document.implementation.createHTMLDocument("title"))}let Dm=null;function YV(t){let e=window.trustedTypes;return e?(Dm||(Dm=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Dm.createHTML(t)):t}function QV(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=KS().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),r;if((r=i&&HS[i[1].toLowerCase()])&&(t=r.map(o=>"<"+o+">").join("")+t+r.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=YV(t),r)for(let o=0;o<r.length;o++)n=n.querySelector(r[o])||n;return n}function ez(t){let e=t.querySelectorAll(ui?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let i=e[n];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}function tz(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,i;try{i=JSON.parse(e)}catch{return t}let{content:r,openStart:o,openEnd:s}=t;for(let a=i.length-2;a>=0;a-=2){let l=n.nodes[i[a]];if(!l||l.hasRequiredAttrs())break;r=Ee.from(l.create(i[a+1],r)),o++,s++}return new Xe(r,o,s)}const yi={},bi={},nz={touchstart:!0,touchmove:!0};class iz{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 rz(t){for(let e in yi){let n=yi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=i=>{sz(t,i)&&!Nm(t,i)&&(t.editable||!(i.type in bi))&&n(t,i)},nz[e]?{passive:!0}:void 0)}vi&&t.dom.addEventListener("input",()=>null),Rm(t)}function zo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function oz(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 Rm(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=i=>Nm(t,i))})}function Nm(t,e){return t.someProp("handleDOMEvents",n=>{let i=n[e.type];return i?i(t,e)||e.defaultPrevented:!1})}function sz(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 az(t,e){!Nm(t,e)&&yi[e.type]&&(t.editable||!(e.type in bi))&&yi[e.type](t,e)}bi.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!qS(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Yr&&ui&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),wa&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();t.input.lastIOSEnter=i,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==i&&(t.someProp("handleKeyDown",r=>r(t,Cs(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",i=>i(t,n))||ZV(t,n)?n.preventDefault():zo(t,"key")},bi.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},bi.keypress=(t,e)=>{let n=e;if(qS(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||qi&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let i=t.state.selection;if(!(i instanceof Mt)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(n.charCode);!/[\r\n]/.test(r)&&!t.someProp("handleTextInput",o=>o(t,i.$from.pos,i.$to.pos,r))&&t.dispatch(t.state.tr.insertText(r).scrollIntoView()),n.preventDefault()}};function od(t){return{left:t.clientX,top:t.clientY}}function lz(t,e){let n=e.x-t.clientX,i=e.y-t.clientY;return n*n+i*i<100}function Bm(t,e,n,i,r){if(i==-1)return!1;let o=t.state.doc.resolve(i);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),r,!0):a(t,n,o.node(s),o.before(s),r,!1)))return!0;return!1}function ka(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let i=t.state.tr.setSelection(e);i.setMeta("pointer",!0),t.dispatch(i)}function uz(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),i=n.nodeAfter;return i&&i.isAtom&&mt.isSelectable(i)?(ka(t,new mt(n)),!0):!1}function cz(t,e){if(e==-1)return!1;let n=t.state.selection,i,r;n instanceof mt&&(i=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(mt.isSelectable(a)){i&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?r=o.before(n.$from.depth):r=o.before(s);break}}return r!=null?(ka(t,mt.create(t.state.doc,r)),!0):!1}function dz(t,e,n,i,r){return Bm(t,"handleClickOn",e,n,i)||t.someProp("handleClick",o=>o(t,e,i))||(r?cz(t,n):uz(t,n))}function fz(t,e,n,i){return Bm(t,"handleDoubleClickOn",e,n,i)||t.someProp("handleDoubleClick",r=>r(t,e,i))}function pz(t,e,n,i){return Bm(t,"handleTripleClickOn",e,n,i)||t.someProp("handleTripleClick",r=>r(t,e,i))||hz(t,n,i)}function hz(t,e,n){if(n.button!=0)return!1;let i=t.state.doc;if(e==-1)return i.inlineContent?(ka(t,Mt.create(i,0,i.content.size)),!0):!1;let r=i.resolve(e);for(let o=r.depth+1;o>0;o--){let s=o>r.depth?r.nodeAfter:r.node(o),a=r.before(o);if(s.inlineContent)ka(t,Mt.create(i,a+1,a+1+s.content.size));else if(mt.isSelectable(s))ka(t,mt.create(i,a));else continue;return!0}}function $m(t){return sd(t)}const WS=qi?"metaKey":"ctrlKey";yi.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let i=$m(t),r=Date.now(),o="singleClick";r-t.input.lastClick.time<500&&lz(n,t.input.lastClick)&&!n[WS]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(od(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new mz(t,s,n,!!i)):(o=="doubleClick"?fz:pz)(t,s.pos,s.inside,n)?n.preventDefault():zo(t,"pointer"))};class mz{constructor(e,n,i,r){this.view=e,this.pos=n,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!i[WS],this.allowDefault=i.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}const a=r?null:i.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(i.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof mt&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&fr&&!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)),zo(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(()=>eo(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(od(e))),this.updateAllowDefault(e),this.allowDefault||!n?zo(this.view,"pointer"):dz(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||vi&&this.mightDrag&&!this.mightDrag.node.isAtom||ui&&!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)?(ka(this.view,Vt.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):zo(this.view,"pointer")}move(e){this.updateAllowDefault(e),zo(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)}}yi.touchstart=t=>{t.input.lastTouch=Date.now(),$m(t),zo(t,"pointer")},yi.touchmove=t=>{t.input.lastTouch=Date.now(),zo(t,"pointer")},yi.contextmenu=t=>$m(t);function qS(t,e){return t.composing?!0:vi&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const gz=Yr?5e3:-1;bi.compositionstart=bi.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Mt&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),sd(t,!0),t.markCursor=null;else if(sd(t,!e.selection.empty),fr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=t.domSelectionRange();for(let r=i.focusNode,o=i.focusOffset;r&&r.nodeType==1&&o!=0;){let s=o<0?r.lastChild:r.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else r=s,o=-1}}t.input.composing=!0}XS(t,gz)},bi.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++,XS(t,20))};function XS(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>sd(t),e))}function GS(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=yz());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function vz(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=uV(e.focusNode,e.focusOffset),i=cV(e.focusNode,e.focusOffset);if(n&&i&&n!=i){let r=i.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||i==o)return o;if(!r||!r.isText(i.nodeValue))return i;if(t.input.compositionNode==i){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return i}}return n||i}function yz(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function sd(t,e=!1){if(!(Yr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),GS(t),e||t.docView&&t.docView.dirty){let n=Tm(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 bz(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 i=getSelection(),r=document.createRange();r.selectNodeContents(e),t.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const hu=Ti&&No<15||wa&&mV<604;yi.copy=bi.cut=(t,e)=>{let n=e,i=t.state.selection,r=n.type=="cut";if(i.empty)return;let o=hu?null:n.clipboardData,s=i.content(),{dom:a,text:l}=Im(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):bz(t,a),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Az(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function wz(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),n?mu(t,i.value,null,r,e):mu(t,i.textContent,i.innerHTML,r,e)},50)}function mu(t,e,n,i,r){let o=$S(t,e,n,i,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,r,o||Xe.empty)))return!0;if(!o)return!1;let s=Az(o),a=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ZS(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," "):""}bi.paste=(t,e)=>{let n=e;if(t.composing&&!Yr)return;let i=hu?null:n.clipboardData,r=t.input.shiftKey&&t.input.lastKeyCode!=45;i&&mu(t,ZS(i),i.getData("text/html"),r,n)?n.preventDefault():wz(t,n)};class _S{constructor(e,n,i){this.slice=e,this.move=n,this.node=i}}const Sz=qi?"altKey":"ctrlKey";function JS(t,e){let n=t.someProp("dragCopies",i=>!i(e));return n??!e[Sz]}yi.dragstart=(t,e)=>{let n=e,i=t.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=t.state.selection,o=r.empty?null:t.posAtCoords(od(n)),s;if(!(o&&o.pos>=r.from&&o.pos<=(r instanceof mt?r.to-1:r.to))){if(i&&i.mightDrag)s=mt.create(t.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=mt.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:u,slice:c}=Im(t,a);(!n.dataTransfer.files.length||!ui||iS>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(hu?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",hu||n.dataTransfer.setData("text/plain",u),t.dragging=new _S(c,JS(t,n),s)},yi.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},bi.dragover=bi.dragenter=(t,e)=>e.preventDefault(),bi.drop=(t,e)=>{let n=e,i=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let r=t.posAtCoords(od(n));if(!r)return;let o=t.state.doc.resolve(r.pos),s=i&&i.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=$S(t,ZS(n.dataTransfer),hu?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(i&&JS(t,n));if(t.someProp("handleDrop",h=>h(t,n,s||Xe.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?_$(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(a){let{node:h}=i;h?h.replace(u):u.deleteSelection()}let c=u.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(f))return;let p=u.doc.resolve(c);if(d&&mt.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new mt(p));else{let h=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,v,S,b)=>h=b),u.setSelection(Mm(t,p,u.doc.resolve(h)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},yi.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())&&eo(t)},20))},yi.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)},yi.beforeinput=(t,e)=>{if(ui&&Yr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:i}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=i||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Cs(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in bi)yi[t]=bi[t];function gu(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 ad{constructor(e,n){this.toDOM=e,this.spec=n||xs,this.side=this.spec.side||0}map(e,n,i,r){let{pos:o,deleted:s}=e.mapResult(n.from+r,this.side<0?-1:1);return s?null:new Ni(o-i,o-i,this)}valid(){return!0}eq(e){return this==e||e instanceof ad&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&gu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Fo{constructor(e,n){this.attrs=e,this.spec=n||xs}map(e,n,i,r){let o=e.map(n.from+r,this.spec.inclusiveStart?-1:1)-i,s=e.map(n.to+r,this.spec.inclusiveEnd?1:-1)-i;return o>=s?null:new Ni(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Fo&&gu(this.attrs,e.attrs)&&gu(this.spec,e.spec)}static is(e){return e.type instanceof Fo}destroy(){}}class Vm{constructor(e,n){this.attrs=e,this.spec=n||xs}map(e,n,i,r){let o=e.mapResult(n.from+r,1);if(o.deleted)return null;let s=e.mapResult(n.to+r,-1);return s.deleted||s.pos<=o.pos?null:new Ni(o.pos-i,s.pos-i,this)}valid(e,n){let{index:i,offset:r}=e.content.findIndex(n.from),o;return r==n.from&&!(o=e.child(i)).isText&&r+o.nodeSize==n.to}eq(e){return this==e||e instanceof Vm&&gu(this.attrs,e.attrs)&&gu(this.spec,e.spec)}destroy(){}}class Ni{constructor(e,n,i){this.from=e,this.to=n,this.type=i}copy(e,n){return new Ni(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,i){return this.type.map(e,this,n,i)}static widget(e,n,i){return new Ni(e,e,new ad(n,i))}static inline(e,n,i,r){return new Ni(e,n,new Fo(i,r))}static node(e,n,i,r){return new Ni(e,n,new Vm(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Fo}get widget(){return this.type instanceof ad}}const Oa=[],xs={};class Bn{constructor(e,n){this.local=e.length?e:Oa,this.children=n.length?n:Oa}static create(e,n){return n.length?ld(n,e,0,xs):ci}find(e,n,i){let r=[];return this.findInner(e??0,n??1e9,r,0,i),r}findInner(e,n,i,r,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))&&i.push(a.copy(a.from+r,a.to+r))}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,i,r+a,o)}}map(e,n,i){return this==ci||e.maps.length==0?this:this.mapInner(e,n,0,0,i||xs)}mapInner(e,n,i,r,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,i,r);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?Cz(this.children,s||[],e,n,i,r,o):s?new Bn(s.sort(Ms),Oa):ci}add(e,n){return n.length?this==ci?Bn.create(e,n):this.addInner(e,n,0):this}addInner(e,n,i){let r,o=0;e.forEach((a,l)=>{let u=l+i,c;if(c=QS(n,a,u)){for(r||(r=this.children.slice());o<r.length&&r[o]<l;)o+=3;r[o]==l?r[o+2]=r[o+2].addInner(a,c,u+1):r.splice(o,0,l,l+a.nodeSize,ld(c,a,u+1,xs)),o+=3}});let s=YS(o?e6(n):n,-i);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Bn(s.length?this.local.concat(s).sort(Ms):this.local,r||this.children)}remove(e){return e.length==0||this==ci?this:this.removeInner(e,0)}removeInner(e,n){let i=this.children,r=this.local;for(let o=0;o<i.length;o+=3){let s,a=i[o]+n,l=i[o+1]+n;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>a&&d.to<l&&(e[c]=null,(s||(s=[])).push(d));if(!s)continue;i==this.children&&(i=this.children.slice());let u=i[o+2].removeInner(s,a+1);u!=ci?i[o+2]=u:(i.splice(o,3),o-=3)}if(r.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<r.length;a++)r[a].eq(s,n)&&(r==this.local&&(r=this.local.slice()),r.splice(a--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new Bn(r,i):ci}forChild(e,n){if(this==ci)return this;if(n.isLeaf)return Bn.empty;let i,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(i=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Fo){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;u<c&&(r||(r=[])).push(l.copy(u,c))}}if(r){let a=new Bn(r.sort(Ms),Oa);return i?new jo([a,i]):a}return i||ci}eq(e){if(this==e)return!0;if(!(e instanceof Bn)||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 zm(this.localsInner(e))}localsInner(e){if(this==ci)return Oa;if(e.inlineContent||!this.local.some(Fo.is))return this.local;let n=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof Fo||n.push(this.local[i]);return n}forEachSet(e){e(this)}}Bn.empty=new Bn([],[]),Bn.removeOverlap=zm;const ci=Bn.empty;class jo{constructor(e){this.members=e}map(e,n){const i=this.members.map(r=>r.map(e,n,xs));return jo.from(i)}forChild(e,n){if(n.isLeaf)return Bn.empty;let i=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,n);o!=ci&&(o instanceof jo?i=i.concat(o.members):i.push(o))}return jo.from(i)}eq(e){if(!(e instanceof jo)||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,i=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(!n)n=o;else{i&&(n=n.slice(),i=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?zm(i?n:n.sort(Ms)):Oa}static from(e){switch(e.length){case 0:return ci;case 1:return e[0];default:return new jo(e.every(n=>n instanceof Bn)?e:e.reduce((n,i)=>n.concat(i instanceof Bn?i:i.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Cz(t,e,n,i,r,o,s){let a=t.slice();for(let u=0,c=o;u<n.maps.length;u++){let d=0;n.maps[u].forEach((f,p,h,m)=>{let v=m-h-(p-f);for(let S=0;S<a.length;S+=3){let b=a[S+1];if(b<0||f>b+c-d)continue;let k=a[S]+c-d;p>=k?a[S+1]=f<=k?-2:-1:f>=c&&v&&(a[S]+=v,a[S+1]+=v)}d+=v}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let c=n.map(t[u]+o),d=c-r;if(d<0||d>=i.content.size){l=!0;continue}let f=n.map(t[u+1]+o,-1),p=f-r,{index:h,offset:m}=i.content.findIndex(d),v=i.maybeChild(h);if(v&&m==d&&m+v.nodeSize==p){let S=a[u+2].mapInner(n,v,c+1,t[u]+o+1,s);S!=ci?(a[u]=d,a[u+1]=p,a[u+2]=S):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=kz(a,t,e,n,r,o,s),c=ld(u,i,0,s);e=c.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let p=c.children[d];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new Bn(e.sort(Ms),a)}function YS(t,e){if(!e||!t.length)return t;let n=[];for(let i=0;i<t.length;i++){let r=t[i];n.push(new Ni(r.from+e,r.to+e,r.type))}return n}function kz(t,e,n,i,r,o,s){function a(l,u){for(let c=0;c<l.local.length;c++){let d=l.local[c].map(i,r,u);d?n.push(d):s.onRemove&&s.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)a(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function QS(t,e,n){if(e.isLeaf)return null;let i=n+e.nodeSize,r=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<i&&((r||(r=[])).push(s),t[o]=null);return r}function e6(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ld(t,e,n,i){let r=[],o=!1;e.forEach((a,l)=>{let u=QS(t,a,l+n);if(u){o=!0;let c=ld(u,a,n+l+1,i);c!=ci&&r.push(l,l+a.nodeSize,c)}});let s=YS(o?e6(t):t,-n).sort(Ms);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(i.onRemove&&i.onRemove(s[a].spec),s.splice(a--,1));return s.length||r.length?new Bn(s,r):ci}function Ms(t,e){return t.from-e.from||t.to-e.to}function zm(t){let e=t;for(let n=0;n<e.length-1;n++){let i=e[n];if(i.from!=i.to)for(let r=n+1;r<e.length;r++){let o=e[r];if(o.from==i.from){o.to!=i.to&&(e==t&&(e=t.slice()),e[r]=o.copy(o.from,i.to),t6(e,r+1,o.copy(i.to,o.to)));continue}else{o.from<i.to&&(e==t&&(e=t.slice()),e[n]=i.copy(i.from,o.from),t6(e,r,i.copy(o.from,i.to)));break}}}return e}function t6(t,e,n){for(;e<t.length&&Ms(n,t[e])>0;)e++;t.splice(e,0,n)}function Fm(t){let e=[];return t.someProp("decorations",n=>{let i=n(t.state);i&&i!=ci&&e.push(i)}),t.cursorWrapper&&e.push(Bn.create(t.state.doc,[t.cursorWrapper.deco])),jo.from(e)}const Oz={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Tz=Ti&&No<=11;class xz{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 Mz{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new xz,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let r=0;r<i.length;r++)this.queue.push(i[r]);Ti&&No<=11&&i.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),Tz&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.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,Oz)),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(ES(this.view)){if(this.suppressingSelectionUpdates)return eo(this.view);if(Ti&&No<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ss(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,i;for(let o=e.focusNode;o;o=Aa(o))n.add(o);for(let o=e.anchorNode;o;o=Aa(o))if(n.has(o)){i=o;break}let r=i&&this.view.docView.nearestDesc(i);if(r&&r.ignoreMutation({type:"selection",target:i.nodeType==3?i.parentNode:i}))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 i=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&ES(e)&&!this.ignoreSelectionChange(i),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],l);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(fr&&l.length){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||Iz(e,d)!=p)&&f.remove()}}}let u=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&td(i)&&(u=Tm(e))&&u.eq(Vt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,eo(e),this.currentSelection.set(i),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,s),Ez(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(i)||eo(e),this.currentSelection.set(i))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let i=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(i==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!i||i.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(e.target))return{from:i.posBefore,to:i.posAfter};let r=e.previousSibling,o=e.nextSibling;if(Ti&&No<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(r=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f)}let s=r&&r.parentNode==e.target?ii(r)+1:0,a=i.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?ii(o):e.target.childNodes.length,u=i.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=e.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let n6=new WeakMap,i6=!1;function Ez(t){if(!n6.has(t)&&(n6.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=fr,i6)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."),i6=!0}}function r6(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return Ss(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}function Pz(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return r6(t,r)}let n;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",i,!0),n?r6(t,n):null}function Iz(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let i=t.docView.nearestDesc(n,!0);if(i&&i.node.isBlock)return n}return null}function Lz(t,e,n){let{node:i,fromOffset:r,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,c=l.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:l.anchorOffset}],td(l)||u.push({node:l.focusNode,offset:l.focusOffset})),ui&&t.input.lastKeyCode===8)for(let v=o;v>r;v--){let S=i.childNodes[v-1],b=S.pmViewDesc;if(S.nodeName=="BR"&&!b){o=v;break}if(!b||b.size)break}let d=t.state.doc,f=t.someProp("domParser")||Po.fromSchema(t.state.schema),p=d.resolve(s),h=null,m=f.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:r,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:Dz,context:p});if(u&&u[0].pos!=null){let v=u[0].pos,S=u[1]&&u[1].pos;S==null&&(S=v),h={anchor:v+s,head:S+s}}return{doc:m,sel:h,from:s,to:a}}function Dz(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(vi&&/^(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||vi&&/^(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 Rz=/^(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 Nz(t,e,n,i,r){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let R=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,M=Tm(t,R);if(M&&!t.state.selection.eq(M)){if(ui&&Yr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",$=>$(t,Cs(13,"Enter"))))return;let D=t.state.tr.setSelection(M);R=="pointer"?D.setMeta("pointer",!0):R=="key"&&D.scrollIntoView(),o&&D.setMeta("composition",o),t.dispatch(D)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=Lz(t,e,n),c=t.state.doc,d=c.slice(u.from,u.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=Vz(d.content,u.doc.content,u.from,f,p);if(h&&t.input.domChangeCount++,(wa&&t.input.lastIOSEnter>Date.now()-225||Yr)&&r.some(R=>R.nodeType==1&&!Rz.test(R.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",R=>R(t,Cs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(i&&l instanceof Mt&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let R=o6(t,t.state.doc,u.sel);if(R&&!R.eq(t.state.selection)){let M=t.state.tr.setSelection(R);o&&M.setMeta("composition",o),t.dispatch(M)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof Mt&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Ti&&No<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=u.doc.resolveNoCache(h.start-u.from),v=u.doc.resolveNoCache(h.endB-u.from),S=c.resolve(h.start),b=m.sameParent(v)&&m.parent.inlineContent&&S.end()>=h.endA,k;if((wa&&t.input.lastIOSEnter>Date.now()-225&&(!b||r.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!b&&m.pos<u.doc.content.size&&(!m.sameParent(v)||!m.parent.inlineContent)&&!/\S/.test(u.doc.textBetween(m.pos,v.pos,"",""))&&(k=Vt.findFrom(u.doc.resolve(m.pos+1),1,!0))&&k.head>m.pos)&&t.someProp("handleKeyDown",R=>R(t,Cs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&$z(c,h.start,h.endA,m,v)&&t.someProp("handleKeyDown",R=>R(t,Cs(8,"Backspace")))){Yr&&ui&&t.domObserver.suppressSelectionUpdates();return}ui&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),Yr&&!b&&m.start()!=v.start()&&v.parentOffset==0&&m.depth==v.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,v=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(R){return R(t,Cs(13,"Enter"))})},20));let A=h.start,w=h.endA,y,C,P;if(b){if(m.pos==v.pos)Ti&&No<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>eo(t),20)),y=t.state.tr.delete(A,w),C=c.resolve(h.start).marksAcross(c.resolve(h.endA));else if(h.endA==h.endB&&(P=Bz(m.parent.content.cut(m.parentOffset,v.parentOffset),S.parent.content.cut(S.parentOffset,h.endA-S.start()))))y=t.state.tr,P.type=="add"?y.addMark(A,w,P.mark):y.removeMark(A,w,P.mark);else if(m.parent.child(m.index()).isText&&m.index()==v.index()-(v.textOffset?0:1)){let R=m.parent.textBetween(m.parentOffset,v.parentOffset);if(t.someProp("handleTextInput",M=>M(t,A,w,R)))return;y=t.state.tr.insertText(R,A,w)}}if(y||(y=t.state.tr.replace(A,w,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let R=o6(t,y.doc,u.sel);R&&!(ui&&t.composing&&R.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(R.head==A||R.head==y.mapping.map(w)-1)||Ti&&R.empty&&R.head==A)&&y.setSelection(R)}C&&y.ensureMarks(C),o&&y.setMeta("composition",o),t.dispatch(y.scrollIntoView())}function o6(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Mm(t,e.resolve(n.anchor),e.resolve(n.head))}function Bz(t,e){let n=t.firstChild.marks,i=e.firstChild.marks,r=n,o=i,s,a,l;for(let c=0;c<i.length;c++)r=i[c].removeFromSet(r);for(let c=0;c<n.length;c++)o=n[c].removeFromSet(o);if(r.length==1&&o.length==0)a=r[0],s="add",l=c=>c.mark(a.addToSet(c.marks));else if(r.length==0&&o.length==1)a=o[0],s="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(Ee.from(u).eq(t))return{mark:a,type:s}}function $z(t,e,n,i,r){if(n-e<=r.pos-i.pos||jm(i,!0,!1)<r.pos)return!1;let o=t.resolve(e);if(!i.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(jm(o,!0,!0));return!s.parent.isTextblock||s.pos>n||jm(s,!0,!1)<n?!1:i.parent.content.cut(i.parentOffset).eq(s.parent.content)}function jm(t,e,n){let i=t.depth,r=e?t.end():t.pos;for(;i>0&&(e||t.indexAfter(i)==t.node(i).childCount);)i--,r++,e=!1;if(n){let o=t.node(i).maybeChild(t.indexAfter(i));for(;o&&!o.isLeaf;)o=o.firstChild,r++}return r}function Vz(t,e,n,i,r){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(r=="end"){let l=Math.max(0,o-Math.min(s,a));i-=s+l-o}if(s<o&&t.size<e.size){let l=i<=o&&i>=s?o-i:0;o-=l,o&&o<e.size&&s6(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=i<=o&&i>=a?o-i:0;o-=l,o&&o<t.size&&s6(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function s6(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 zz{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 iz,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(d6),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=u6(this),l6(this),this.nodeViews=c6(this),this.docView=vS(this.state.doc,a6(this),Fm(this),this.dom,this),this.domObserver=new Mz(this,(i,r,o,s)=>Nz(this,i,r,o,s)),this.domObserver.start(),rz(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&&Rm(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(d6),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let i in this._props)n[i]=this._props[i];n.state=this.state;for(let i in e)n[i]=e[i];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var i;let r=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(GS(this),s=!0),this.state=e;let a=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=c6(this);jz(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Rm(this),this.editable=u6(this),l6(this);let l=Fm(this),u=a6(this),c=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(r.selection))&&(s=!0);let f=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&yV(this);if(s){this.domObserver.stop();let p=d&&(Ti||ui)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&Fz(r.selection,e.selection);if(d){let h=ui?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=vz(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=vS(e.doc,u,l,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&HV(this))?eo(this,p):(xS(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((i=this.dragging)===null||i===void 0)&&i.node&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&bV(f)}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 mt){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&rS(this,n.getBoundingClientRect(),e)}else rS(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 i=this.directPlugins[n];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let i=this.state.plugins[n];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let i=this.pluginViews[n];i.update&&i.update(this,e)}}updateDraggedNode(e,n){let i=e.node,r=-1;if(this.state.doc.nodeAt(i.from)==i.node)r=i.from;else{let o=i.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==i.node&&(r=o)}this.dragging=new _S(e.slice,e.move,r<0?void 0:mt.create(this.state.doc,r))}someProp(e,n){let i=this._props&&this._props[e],r;if(i!=null&&(r=n?n(i):i))return r;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(r=n?n(a):a))return r}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(r=n?n(a):a))return r}}hasFocus(){if(Ti){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&&AV(this.dom),eo(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 OV(this,e)}coordsAtPos(e,n=1){return cS(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,i=-1){let r=this.docView.posFromDOM(e,n,i);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,n){return PV(this,n||this.state,e)}pasteHTML(e,n){return mu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return mu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Im(this,e)}destroy(){this.docView&&(oz(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Fm(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,aV())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return az(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?vi&&this.root.nodeType===11&&fV(this.dom.ownerDocument)==this.dom&&Pz(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function a6(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 i in n)i=="class"?e.class+=" "+n[i]:i=="style"?e.style=(e.style?e.style+";":"")+n[i]:!e[i]&&i!="contenteditable"&&i!="nodeName"&&(e[i]=String(n[i]))}),e.translate||(e.translate="no"),[Ni.node(0,t.state.doc.content.size,e)]}function l6(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:Ni.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function u6(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Fz(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 c6(t){let e=Object.create(null);function n(i){for(let r in i)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=i[r])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function jz(t,e){let n=0,i=0;for(let r in t){if(t[r]!=e[r])return!0;n++}for(let r in e)i++;return n!=i}function d6(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 Ho={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:"'"},ud={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Hz=typeof navigator<"u"&&/Mac/.test(navigator.platform),Uz=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ri=0;ri<10;ri++)Ho[48+ri]=Ho[96+ri]=String(ri);for(var ri=1;ri<=24;ri++)Ho[ri+111]="F"+ri;for(var ri=65;ri<=90;ri++)Ho[ri]=String.fromCharCode(ri+32),ud[ri]=String.fromCharCode(ri);for(var Hm in Ho)ud.hasOwnProperty(Hm)||(ud[Hm]=Ho[Hm]);function Kz(t){var e=Hz&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Uz&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ud:Ho)[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 Wz=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function qz(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let i,r,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Wz?s=!0:r=!0;else throw new Error("Unrecognized modifier name: "+l)}return i&&(n="Alt-"+n),r&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function Xz(t){let e=Object.create(null);for(let n in t)e[qz(n)]=t[n];return e}function Um(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 Gz(t){return new qn({props:{handleKeyDown:Zz(t)}})}function Zz(t){let e=Xz(t);return function(n,i){let r=Kz(i),o,s=e[Um(r,i)];if(s&&s(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let a=e[Um(r,i,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((i.shiftKey||i.altKey||i.metaKey||r.charCodeAt(0)>127)&&(o=Ho[i.keyCode])&&o!=r){let a=e[Um(o,i)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Km=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function f6(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const p6=(t,e,n)=>{let i=f6(t,n);if(!i)return!1;let r=Wm(i);if(!r){let s=i.blockRange(),a=s&&ma(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=r.nodeBefore;if(S6(t,r,e,-1))return!0;if(i.parent.content.size==0&&(Ta(o,"end")||mt.isSelectable(o)))for(let s=i.depth;;s--){let a=Qc(t.doc,i.before(s),i.after(s),Xe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Ta(o,"end")?Vt.findFrom(l.doc.resolve(l.mapping.map(r.pos,-1)),-1):mt.create(l.doc,r.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||i.node(s-1).childCount>1)break}return o.isAtom&&r.depth==i.depth-1?(e&&e(t.tr.delete(r.pos-o.nodeSize,r.pos).scrollIntoView()),!0):!1},_z=(t,e,n)=>{let i=f6(t,n);if(!i)return!1;let r=Wm(i);return r?h6(t,r,e):!1},Jz=(t,e,n)=>{let i=g6(t,n);if(!i)return!1;let r=qm(i);return r?h6(t,r,e):!1};function h6(t,e,n){let i=e.nodeBefore,r=i,o=e.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let c=r.lastChild;if(!c)return!1;r=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=Qc(t.doc,o,l,Xe.empty);if(!u||u.from!=o||u instanceof Kn&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(Mt.create(c.doc,o)),n(c.scrollIntoView())}return!0}function Ta(t,e,n=!1){for(let i=t;i;i=e=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const m6=(t,e,n)=>{let{$head:i,empty:r}=t.selection,o=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):i.parentOffset>0)return!1;o=Wm(i)}let s=o&&o.nodeBefore;return!s||!mt.isSelectable(s)?!1:(e&&e(t.tr.setSelection(mt.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Wm(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 g6(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const v6=(t,e,n)=>{let i=g6(t,n);if(!i)return!1;let r=qm(i);if(!r)return!1;let o=r.nodeAfter;if(S6(t,r,e,1))return!0;if(i.parent.content.size==0&&(Ta(o,"start")||mt.isSelectable(o))){let s=Qc(t.doc,i.before(),i.after(),Xe.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Ta(o,"start")?Vt.findFrom(a.doc.resolve(a.mapping.map(r.pos)),1):mt.create(a.doc,a.mapping.map(r.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&r.depth==i.depth-1?(e&&e(t.tr.delete(r.pos,r.pos+o.nodeSize).scrollIntoView()),!0):!1},y6=(t,e,n)=>{let{$head:i,empty:r}=t.selection,o=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;o=qm(i)}let s=o&&o.nodeAfter;return!s||!mt.isSelectable(s)?!1:(e&&e(t.tr.setSelection(mt.create(t.doc,o.pos)).scrollIntoView()),!0)};function qm(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 Yz=(t,e)=>{let n=t.selection,i=n instanceof mt,r;if(i){if(n.node.isTextblock||!Do(t.doc,n.from))return!1;r=n.from}else if(r=Yc(t.doc,n.from,-1),r==null)return!1;if(e){let o=t.tr.join(r);i&&o.setSelection(mt.create(o.doc,r-t.doc.resolve(r).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Qz=(t,e)=>{let n=t.selection,i;if(n instanceof mt){if(n.node.isTextblock||!Do(t.doc,n.to))return!1;i=n.to}else if(i=Yc(t.doc,n.to,1),i==null)return!1;return e&&e(t.tr.join(i).scrollIntoView()),!0},eF=(t,e)=>{let{$from:n,$to:i}=t.selection,r=n.blockRange(i),o=r&&ma(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},b6=(t,e)=>{let{$head:n,$anchor:i}=t.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(e&&e(t.tr.insertText(`
241
- `).scrollIntoView()),!0)};function Xm(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 tF=(t,e)=>{let{$head:n,$anchor:i}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),o=n.indexAfter(-1),s=Xm(r.contentMatchAt(o));if(!s||!r.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Vt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},A6=(t,e)=>{let n=t.selection,{$from:i,$to:r}=n;if(n instanceof Ri||i.parent.inlineContent||r.parent.inlineContent)return!1;let o=Xm(r.parent.contentMatchAt(r.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(Mt.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},w6=(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(_r(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let i=n.blockRange(),r=i&&ma(i);return r==null?!1:(e&&e(t.tr.lift(i,r).scrollIntoView()),!0)};function nF(t){return(e,n)=>{let{$from:i,$to:r}=e.selection;if(e.selection instanceof mt&&e.selection.node.isBlock)return!i.parentOffset||!_r(e.doc,i.pos)?!1:(n&&n(e.tr.split(i.pos).scrollIntoView()),!0);if(!i.depth)return!1;let o=[],s,a,l=!1,u=!1;for(let p=i.depth;;p--)if(i.node(p).isBlock){l=i.end(p)==i.pos+(i.depth-p),u=i.start(p)==i.pos-(i.depth-p),a=Xm(i.node(p-1).contentMatchAt(i.indexAfter(p-1))),o.unshift(l&&a?{type:a}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let c=e.tr;(e.selection instanceof Mt||e.selection instanceof Ri)&&c.deleteSelection();let d=c.mapping.map(i.pos),f=_r(c.doc,d,o.length,o);if(f||(o[0]=a?{type:a}:null,f=_r(c.doc,d,o.length,o)),c.split(d,o.length,o),!l&&u&&i.node(s).type!=a){let p=c.mapping.map(i.before(s)),h=c.doc.resolve(p);a&&i.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&c.setNodeMarkup(c.mapping.map(i.before(s)),a)}return n&&n(c.scrollIntoView()),!0}}const iF=nF(),rF=(t,e)=>{let{$from:n,to:i}=t.selection,r,o=n.sharedDepth(i);return o==0?!1:(r=n.before(o),e&&e(t.tr.setSelection(mt.create(t.doc,r))),!0)};function oF(t,e,n){let i=e.nodeBefore,r=e.nodeAfter,o=e.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-i.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(r.isTextblock||Do(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function S6(t,e,n,i){let r=e.nodeBefore,o=e.nodeAfter,s,a,l=r.type.spec.isolating||o.type.spec.isolating;if(!l&&oF(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(s=(a=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,h=Ee.empty;for(let S=s.length-1;S>=0;S--)h=Ee.from(s[S].create(null,h));h=Ee.from(r.copy(h));let m=t.tr.step(new Wn(e.pos-1,p,e.pos,p,new Xe(h,1,0),s.length,!0)),v=m.doc.resolve(p+2*s.length);v.nodeAfter&&v.nodeAfter.type==r.type&&Do(m.doc,v.pos)&&m.join(v.pos),n(m.scrollIntoView())}return!0}let c=o.type.spec.isolating||i>0&&l?null:Vt.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),f=d&&ma(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(u&&Ta(o,"start",!0)&&Ta(r,"end")){let p=r,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=o,v=1;for(;!m.isTextblock;m=m.firstChild)v++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let S=Ee.empty;for(let k=h.length-1;k>=0;k--)S=Ee.from(h[k].copy(S));let b=t.tr.step(new Wn(e.pos-h.length,e.pos+o.nodeSize,e.pos+v,e.pos+o.nodeSize-v,new Xe(S,h.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function C6(t){return function(e,n){let i=e.selection,r=t<0?i.$from:i.$to,o=r.depth;for(;r.node(o).isInline;){if(!o)return!1;o--}return r.node(o).isTextblock?(n&&n(e.tr.setSelection(Mt.create(e.doc,t<0?r.start(o):r.end(o)))),!0):!1}}const sF=C6(-1),aF=C6(1);function lF(t,e=null){return function(n,i){let{$from:r,$to:o}=n.selection,s=r.blockRange(o),a=s&&dm(s,t,e);return a?(i&&i(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function k6(t,e=null){return function(n,i){let r=!1;for(let o=0;o<n.selection.ranges.length&&!r;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,u)=>{if(r)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)r=!0;else{let c=n.doc.resolve(u),d=c.index();r=c.parent.canReplaceWith(d,d+1,t)}})}if(!r)return!1;if(i){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}i(o.scrollIntoView())}return!0}}function Gm(...t){return function(e,n,i){for(let r=0;r<t.length;r++)if(t[r](e,n,i))return!0;return!1}}Gm(Km,p6,m6),Gm(Km,v6,y6),Gm(b6,A6,w6,iF),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function uF(t,e=null){return function(n,i){let{$from:r,$to:o}=n.selection,s=r.blockRange(o);if(!s)return!1;let a=i?n.tr:null;return cF(a,s,t,e)?(i&&i(a.scrollIntoView()),!0):!1}}function cF(t,e,n,i=null){let r=!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 l=s.resolve(e.start-2);o=new Wc(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Wc(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),r=!0}let a=dm(o,n,i,e);return a?(t&&dF(t,e,a,r,n),!0):!1}function dF(t,e,n,i,r){let o=Ee.empty;for(let c=n.length-1;c>=0;c--)o=Ee.from(n[c].type.create(n[c].attrs,o));t.step(new Wn(e.start-(i?2:0),e.end,e.start,e.end,new Xe(o,0,0),n.length,!0));let s=0;for(let c=0;c<n.length;c++)n[c].type==r&&(s=c+1);let a=n.length-s,l=e.start+n.length-(i?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,f=!0;c<d;c++,f=!1)!f&&_r(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return t}function fF(t){return function(e,n){let{$from:i,$to:r}=e.selection,o=i.blockRange(r,s=>s.childCount>0&&s.firstChild.type==t);return o?n?i.node(o.depth-1).type==t?pF(e,n,t,o):hF(e,n,o):!0:!1}}function pF(t,e,n,i){let r=t.tr,o=i.end,s=i.$to.end(i.depth);o<s&&(r.step(new Wn(o-1,s,o,s,new Xe(Ee.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new Wc(r.doc.resolve(i.$from.pos),r.doc.resolve(s),i.depth));const a=ma(i);if(a==null)return!1;r.lift(i,a);let l=r.mapping.map(o,-1)-1;return Do(r.doc,l)&&r.join(l),e(r.scrollIntoView()),!0}function hF(t,e,n){let i=t.tr,r=n.parent;for(let p=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)p-=r.child(h).nodeSize,i.delete(p-1,p+1);let o=i.doc.resolve(n.start),s=o.nodeAfter;if(i.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==r.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?Ee.empty:Ee.from(r))))return!1;let d=o.pos,f=d+s.nodeSize;return i.step(new Wn(d-(a?1:0),f+(l?1:0),d+1,f-1,new Xe((a?Ee.empty:Ee.from(r.copy(Ee.empty))).append(l?Ee.empty:Ee.from(r.copy(Ee.empty))),a?0:1,l?0:1),a?0:1)),e(i.scrollIntoView()),!0}function mF(t){return function(e,n){let{$from:i,$to:r}=e.selection,o=i.blockRange(r,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=Ee.from(u?t.create():null),d=new Xe(Ee.from(t.create(null,Ee.from(a.type.create(null,c)))),u?3:1,0),f=o.start,p=o.end;n(e.tr.step(new Wn(f-(u?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function cd(t){const{state:e,transaction:n}=t;let{selection:i}=n,{doc:r}=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 i},get doc(){return r},get tr(){return i=n.selection,r=n.doc,o=n.storedMarks,n}}}class dd{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:i}=this,{view:r}=n,{tr:o}=i,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const d=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:i,editor:r,state:o}=this,{view:s}=r,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(i).map(([f,p])=>[f,(...m)=>{const v=this.buildProps(u,n),S=p(...m)(v);return a.push(S),d}])),run:c};return d}createCan(e){const{rawCommands:n,state:i}=this,r=!1,o=e||i.tr,s=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(e,n=!0){const{rawCommands:i,editor:r,state:o}=this,{view:s}=r,a={tr:e,editor:r,view:s,state:cd({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(i).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}}class gF{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const i=this.callbacks[e];return i&&i.forEach(r=>r.apply(this,n)),this}off(e,n){const i=this.callbacks[e];return i&&(n?this.callbacks[e]=i.filter(r=>r!==n):delete this.callbacks[e]),this}once(e,n){const i=(...r)=>{this.off(e,i),n.apply(this,r)};return this.on(e,i)}removeAllListeners(){this.callbacks={}}}function tt(t,e,n){return t.config[e]===void 0&&t.parent?tt(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?tt(t.parent,e,n):null}):t.config[e]}function fd(t){const e=t.filter(r=>r.type==="extension"),n=t.filter(r=>r.type==="node"),i=t.filter(r=>r.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:i}}function O6(t){const e=[],{nodeExtensions:n,markExtensions:i}=fd(t),r=[...n,...i],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:r},l=tt(s,"addGlobalAttributes",a);if(!l)return;l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...o,...p}})})})})}),r.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=tt(s,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([c,d])=>{const f={...o,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:c,attribute:f})})}),e}function Xn(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 $n(...t){return t.filter(e=>!!e).reduce((e,n)=>{const i={...e};return Object.entries(n).forEach(([r,o])=>{if(!i[r]){i[r]=o;return}if(r==="class"){const a=o?String(o).split(" "):[],l=i[r]?i[r].split(" "):[],u=a.filter(c=>!l.includes(c));i[r]=[...l,...u].join(" ")}else if(r==="style"){const a=o?o.split(";").map(c=>c.trim()).filter(Boolean):[],l=i[r]?i[r].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;l.forEach(c=>{const[d,f]=c.split(":").map(p=>p.trim());u.set(d,f)}),a.forEach(c=>{const[d,f]=c.split(":").map(p=>p.trim());u.set(d,f)}),i[r]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else i[r]=o}),i},{})}function Zm(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,i)=>$n(n,i),{})}function T6(t){return typeof t=="function"}function Dt(t,e=void 0,...n){return T6(t)?e?t.bind(e)(...n):t(...n):t}function vF(t={}){return Object.keys(t).length===0&&t.constructor===Object}function yF(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function x6(t,e){return"style"in t?t:{...t,getAttrs:n=>{const i=t.getAttrs?t.getAttrs(n):t.attrs;if(i===!1)return!1;const r=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):yF(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...i,...r}}}}function M6(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&vF(n)?!1:n!=null))}function bF(t,e){var n;const i=O6(t),{nodeExtensions:r,markExtensions:o}=fd(t),s=(n=r.find(u=>tt(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(r.map(u=>{const c=i.filter(S=>S.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((S,b)=>{const k=tt(b,"extendNodeSchema",d);return{...S,...k?k(u):{}}},{}),p=M6({...f,content:Dt(tt(u,"content",d)),marks:Dt(tt(u,"marks",d)),group:Dt(tt(u,"group",d)),inline:Dt(tt(u,"inline",d)),atom:Dt(tt(u,"atom",d)),selectable:Dt(tt(u,"selectable",d)),draggable:Dt(tt(u,"draggable",d)),code:Dt(tt(u,"code",d)),whitespace:Dt(tt(u,"whitespace",d)),linebreakReplacement:Dt(tt(u,"linebreakReplacement",d)),defining:Dt(tt(u,"defining",d)),isolating:Dt(tt(u,"isolating",d)),attrs:Object.fromEntries(c.map(S=>{var b;return[S.name,{default:(b=S==null?void 0:S.attribute)===null||b===void 0?void 0:b.default}]}))}),h=Dt(tt(u,"parseHTML",d));h&&(p.parseDOM=h.map(S=>x6(S,c)));const m=tt(u,"renderHTML",d);m&&(p.toDOM=S=>m({node:S,HTMLAttributes:Zm(S,c)}));const v=tt(u,"renderText",d);return v&&(p.toText=v),[u.name,p]})),l=Object.fromEntries(o.map(u=>{const c=i.filter(v=>v.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((v,S)=>{const b=tt(S,"extendMarkSchema",d);return{...v,...b?b(u):{}}},{}),p=M6({...f,inclusive:Dt(tt(u,"inclusive",d)),excludes:Dt(tt(u,"excludes",d)),group:Dt(tt(u,"group",d)),spanning:Dt(tt(u,"spanning",d)),code:Dt(tt(u,"code",d)),attrs:Object.fromEntries(c.map(v=>{var S;return[v.name,{default:(S=v==null?void 0:v.attribute)===null||S===void 0?void 0:S.default}]}))}),h=Dt(tt(u,"parseHTML",d));h&&(p.parseDOM=h.map(v=>x6(v,c)));const m=tt(u,"renderHTML",d);return m&&(p.toDOM=v=>m({mark:v,HTMLAttributes:Zm(v,c)})),[u.name,p]}));return new Aw({topNode:s,nodes:a,marks:l})}function _m(t,e){return e.nodes[t]||e.marks[t]||null}function E6(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Jm(t,e){const n=As.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const AF=(t,e=500)=>{let n="";const i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-e),i,(r,o,s,a)=>{var l,u;const c=((u=(l=r.type.spec).toText)===null||u===void 0?void 0:u.call(l,{node:r,pos:o,parent:s,index:a}))||r.textContent||"%leaf%";n+=r.isAtom&&!r.isText?c:c.slice(0,Math.max(0,i-o))}),n};function Ym(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class pd{constructor(e){this.find=e.find,this.handler=e.handler}}const wF=(t,e)=>{if(Ym(e))return e.exec(t);const n=e(t);if(!n)return null;const i=[n.text];return i.index=n.index,i.input=t,i.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(n.replaceWith)),i};function hd(t){var e;const{editor:n,from:i,to:r,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(i);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let c=!1;const d=AF(u)+o;return s.forEach(f=>{if(c)return;const p=wF(d,f.find);if(!p)return;const h=l.state.tr,m=cd({state:l.state,transaction:h}),v={from:i-(p[0].length-o.length),to:r},{commands:S,chain:b,can:k}=new dd({editor:n,state:m});f.handler({state:m,range:v,match:p,commands:S,chain:b,can:k})===null||!h.steps.length||(h.setMeta(a,{transform:h,from:i,to:r,text:o}),l.dispatch(h),c=!0)}),c}function SF(t){const{editor:e,rules:n}=t,i=new qn({state:{init(){return null},apply(r,o,s){const a=r.getMeta(i);if(a)return a;const l=r.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=Jm(Ee.from(c),s.schema);const{from:d}=l,f=d+c.length;hd({editor:e,from:d,to:f,text:c,rules:n,plugin:i})}),r.selectionSet||r.docChanged?null:o}},props:{handleTextInput(r,o,s,a){return hd({editor:e,from:o,to:s,text:a,rules:n,plugin:i})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:o}=r.state.selection;o&&hd({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:i})}),!1)},handleKeyDown(r,o){if(o.key!=="Enter")return!1;const{$cursor:s}=r.state.selection;return s?hd({editor:e,from:s.pos,to:s.pos,text:`
242
- `,rules:n,plugin:i}):!1}},isInputRules:!0});return i}function CF(t){return Object.prototype.toString.call(t).slice(8,-1)}function md(t){return CF(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function gd(t,e){const n={...t};return md(t)&&md(e)&&Object.keys(e).forEach(i=>{md(e[i])&&md(t[i])?n[i]=gd(t[i],e[i]):n[i]=e[i]}),n}class to{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=Dt(tt(this,"addOptions",{name:this.name}))),this.storage=Dt(tt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new to(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>gd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new to(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=Dt(tt(n,"addOptions",{name:n.name})),n.storage=Dt(tt(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:i}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const s=r.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&i.removeStoredMark(l),i.insertText(" ",r.pos),e.view.dispatch(i),!0}return!1}}function kF(t){return typeof t=="number"}class OF{constructor(e){this.find=e.find,this.handler=e.handler}}const TF=(t,e,n)=>{if(Ym(e))return[...t.matchAll(e)];const i=e(t,n);return i?i.map(r=>{const o=[r.text];return o.index=r.index,o.input=t,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function xF(t){const{editor:e,state:n,from:i,to:r,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:u,can:c}=new dd({editor:e,state:n}),d=[];return n.doc.nodesBetween(i,r,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;const m=Math.max(i,h),v=Math.min(r,h+p.content.size),S=p.textBetween(m-h,v-h,void 0,"");TF(S,o.find,s).forEach(k=>{if(k.index===void 0)return;const A=m+k.index+1,w=A+k[0].length,y={from:n.tr.mapping.map(A),to:n.tr.mapping.map(w)},C=o.handler({state:n,range:y,match:k,commands:l,chain:u,can:c,pasteEvent:s,dropEvent:a});d.push(C)})}),d.every(p=>p!==null)}let vd=null;const MF=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 EF(t){const{editor:e,rules:n}=t;let i=null,r=!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 l=({state:c,from:d,to:f,rule:p,pasteEvt:h})=>{const m=c.tr,v=cd({state:c,transaction:m});if(!(!xF({editor:e,state:v,from:Math.max(d-1,0),to:f.b-1,rule:p,pasteEvent:h,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(c=>new qn({view(d){const f=h=>{var m;i=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(h.target)?d.dom.parentElement:null,i&&(vd=e)},p=()=>{vd&&(vd=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(o=i===d.dom.parentElement,a=f,!o){const p=vd;p&&setTimeout(()=>{const h=p.state.selection;h&&p.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(d,f)=>{var p;const h=(p=f.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=f,r=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,p)=>{const h=d[0],m=h.getMeta("uiEvent")==="paste"&&!r,v=h.getMeta("uiEvent")==="drop"&&!o,S=h.getMeta("applyPasteRules"),b=!!S;if(!m&&!v&&!b)return;if(b){let{text:w}=S;typeof w=="string"?w=w:w=Jm(Ee.from(w),p.schema);const{from:y}=S,C=y+w.length,P=MF(w);return l({rule:c,state:p,from:y,to:{b:C},pasteEvt:P})}const k=f.doc.content.findDiffStart(p.doc.content),A=f.doc.content.findDiffEnd(p.doc.content);if(!(!kF(k)||!A||k===A.b))return l({rule:c,state:p,from:k,to:A,pasteEvt:s})}}))}function PF(t){const e=t.filter((n,i)=>t.indexOf(n)!==i);return Array.from(new Set(e))}class xa{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=xa.resolve(e),this.schema=bF(this.extensions,n),this.setupExtensions()}static resolve(e){const n=xa.sort(xa.flatten(e)),i=PF(n.map(r=>r.name));return i.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${i.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const i={name:n.name,options:n.options,storage:n.storage},r=tt(n,"addExtensions",i);return r?[n,...this.flatten(r())]:n}).flat(10)}static sort(e){return e.sort((i,r)=>{const o=tt(i,"priority")||100,s=tt(r,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const i={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:_m(n.name,this.schema)},r=tt(n,"addCommands",i);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this,n=xa.sort([...this.extensions].reverse()),i=[],r=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:_m(s.name,this.schema)},l=[],u=tt(s,"addKeyboardShortcuts",a);let c={};if(s.type==="mark"&&tt(s,"exitable",a)&&(c.ArrowRight=()=>to.handleExit({editor:e,mark:s})),u){const m=Object.fromEntries(Object.entries(u()).map(([v,S])=>[v,()=>S({editor:e})]));c={...c,...m}}const d=Gz(c);l.push(d);const f=tt(s,"addInputRules",a);E6(s,e.options.enableInputRules)&&f&&i.push(...f());const p=tt(s,"addPasteRules",a);E6(s,e.options.enablePasteRules)&&p&&r.push(...p());const h=tt(s,"addProseMirrorPlugins",a);if(h){const m=h();l.push(...m)}return l}).flat();return[SF({editor:e,rules:i}),...EF({editor:e,rules:r}),...o]}get attributes(){return O6(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=fd(this.extensions);return Object.fromEntries(n.filter(i=>!!tt(i,"addNodeView")).map(i=>{const r=this.attributes.filter(l=>l.type===i.name),o={name:i.name,options:i.options,storage:i.storage,editor:e,type:Xn(i.name,this.schema)},s=tt(i,"addNodeView",o);if(!s)return[];const a=(l,u,c,d,f)=>{const p=Zm(l,r);return s()({node:l,view:u,getPos:c,decorations:d,innerDecorations:f,editor:e,extension:i,HTMLAttributes:p})};return[i.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const i={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:_m(e.name,this.schema)};e.type==="mark"&&(!((n=Dt(tt(e,"keepOnSplit",i)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const r=tt(e,"onBeforeCreate",i),o=tt(e,"onCreate",i),s=tt(e,"onUpdate",i),a=tt(e,"onSelectionUpdate",i),l=tt(e,"onTransaction",i),u=tt(e,"onFocus",i),c=tt(e,"onBlur",i),d=tt(e,"onDestroy",i);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class Ai{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=Dt(tt(this,"addOptions",{name:this.name}))),this.storage=Dt(tt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ai(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>gd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ai({...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=Dt(tt(n,"addOptions",{name:n.name})),n.storage=Dt(tt(n,"addStorage",{name:n.name,options:n.options})),n}}function P6(t,e,n){const{from:i,to:r}=e,{blockSeparator:o=`
243
-
244
- `,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(i,r,(l,u,c,d)=>{var f;l.isBlock&&u>i&&(a+=o);const p=s==null?void 0:s[l.type.name];if(p)return c&&(a+=p({node:l,pos:u,parent:c,index:d,range:e})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)===null||f===void 0?void 0:f.slice(Math.max(i,u)-u,r-u))}),a}function Qm(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const IF=Ai.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new qn({key:new ni("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:i,selection:r}=e,{ranges:o}=r,s=Math.min(...o.map(c=>c.$from.pos)),a=Math.max(...o.map(c=>c.$to.pos)),l=Qm(n);return P6(i,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),LF=()=>({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),DF=(t=!1)=>({commands:e})=>e.setContent("",t),RF=()=>({state:t,tr:e,dispatch:n})=>{const{selection:i}=e,{ranges:r}=i;return n&&r.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(l)),f=u.resolve(c.map(l+a.nodeSize)),p=d.blockRange(f);if(!p)return;const h=ma(p);if(a.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},NF=t=>e=>t(e),BF=()=>({state:t,dispatch:e})=>A6(t,e),$F=(t,e)=>({editor:n,tr:i})=>{const{state:r}=n,o=r.doc.slice(t.from,t.to);i.deleteRange(t.from,t.to);const s=i.mapping.map(e);return i.insert(s,o.content),i.setSelection(new Mt(i.doc.resolve(s-1))),!0},VF=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,i=n.$anchor.node();if(i.content.size>0)return!1;const r=t.selection.$anchor;for(let o=r.depth;o>0;o-=1)if(r.node(o).type===i.type){if(e){const a=r.before(o),l=r.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},zF=t=>({tr:e,state:n,dispatch:i})=>{const r=Xn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r){if(i){const l=o.before(s),u=o.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},FF=t=>({tr:e,dispatch:n})=>{const{from:i,to:r}=t;return n&&e.delete(i,r),!0},jF=()=>({state:t,dispatch:e})=>Km(t,e),HF=()=>({commands:t})=>t.keyboardShortcut("Enter"),UF=()=>({state:t,dispatch:e})=>tF(t,e);function yd(t,e,n={strict:!0}){const i=Object.keys(e);return i.length?i.every(r=>n.strict?e[r]===t[r]:Ym(e[r])?e[r].test(t[r]):e[r]===t[r]):!0}function I6(t,e,n={}){return t.find(i=>i.type===e&&yd(Object.fromEntries(Object.keys(n).map(r=>[r,i.attrs[r]])),n))}function L6(t,e,n={}){return!!I6(t,e,n)}function eg(t,e,n){var i;if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e)||(n=n||((i=r.node.marks[0])===null||i===void 0?void 0:i.attrs),!I6([...r.node.marks],e,n)))return;let s=r.index,a=t.start()+r.offset,l=s+1,u=a+r.node.nodeSize;for(;s>0&&L6([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&L6([...t.parent.child(l).marks],e,n);)u+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function Uo(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 KF=(t,e={})=>({tr:n,state:i,dispatch:r})=>{const o=Uo(t,i.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(r){const d=eg(l,o,e);if(d&&d.from<=u&&d.to>=c){const f=Mt.create(s,d.from,d.to);n.setSelection(f)}}return!0},WF=t=>e=>{const n=typeof t=="function"?t(e):t;for(let i=0;i<n.length;i+=1)if(n[i](e))return!0;return!1};function tg(t){return t instanceof Mt}function no(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function D6(t,e=null){if(!e)return null;const n=Vt.atStart(t),i=Vt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return i;const r=n.from,o=i.to;return e==="all"?Mt.create(t,no(0,r,o),no(t.content.size,r,o)):Mt.create(t,no(e,r,o),no(e,r,o))}function R6(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function bd(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const qF=(t=null,e={})=>({editor:n,view:i,tr:r,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(bd()||R6())&&i.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(i.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(i.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!tg(n.state.selection))return s(),!0;const a=D6(r.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||r.setSelection(a),l&&r.storedMarks&&r.setStoredMarks(r.storedMarks),s()),!0},XF=(t,e)=>n=>t.every((i,r)=>e(i,{...n,index:r})),GF=(t,e)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),N6=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const i=e[n];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?t.removeChild(i):i.nodeType===1&&N6(i)}return t};function Ad(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return N6(n)}function wd(t,e,n){if(t instanceof Eo||t instanceof Ee)return t;n={slice:!0,parseOptions:{},...n};const i=typeof t=="object"&&t!==null,r=typeof t=="string";if(i)try{if(Array.isArray(t)&&t.length>0)return Ee.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),wd("",e,n)}if(r){if(n.errorOnInvalidContent){let s=!1,a="";const l=new Aw({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:u=>(s=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Po.fromSchema(l).parseSlice(Ad(t),n.parseOptions):Po.fromSchema(l).parse(Ad(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Po.fromSchema(e);return n.slice?o.parseSlice(Ad(t),n.parseOptions).content:o.parse(Ad(t),n.parseOptions)}return wd("",e,n)}function ZF(t,e,n){const i=t.steps.length-1;if(i<e)return;const r=t.steps[i];if(!(r instanceof Kn||r instanceof Wn))return;const o=t.mapping.maps[i];let s=0;o.forEach((a,l,u,c)=>{s===0&&(s=c)}),t.setSelection(Vt.near(t.doc.resolve(s),n))}const _F=t=>!("type"in t),JF=(t,e,n)=>({tr:i,dispatch:r,editor:o})=>{var s;if(r){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=wd(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(h){return o.emit("contentError",{editor:o,error:h,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,d=!0;if((_F(a)?a:[a]).forEach(h=>{h.check(),c=c?h.isText&&h.marks.length===0:!1,d=d?h.isBlock:!1}),l===u&&d){const{parent:h}=i.doc.resolve(l);h.isTextblock&&!h.type.spec.code&&!h.childCount&&(l-=1,u+=1)}let p;if(c){if(Array.isArray(e))p=e.map(h=>h.text||"").join("");else if(e instanceof Ee){let h="";e.forEach(m=>{m.text&&(h+=m.text)}),p=h}else typeof e=="object"&&e&&e.text?p=e.text:p=e;i.insertText(p,l,u)}else p=a,i.replaceWith(l,u,p);n.updateSelection&&ZF(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:l,text:p}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:l,text:p})}return!0},YF=()=>({state:t,dispatch:e})=>Yz(t,e),QF=()=>({state:t,dispatch:e})=>Qz(t,e),ej=()=>({state:t,dispatch:e})=>p6(t,e),tj=()=>({state:t,dispatch:e})=>v6(t,e),nj=()=>({state:t,dispatch:e,tr:n})=>{try{const i=Yc(t.doc,t.selection.$from.pos,-1);return i==null?!1:(n.join(i,2),e&&e(n),!0)}catch{return!1}},ij=()=>({state:t,dispatch:e,tr:n})=>{try{const i=Yc(t.doc,t.selection.$from.pos,1);return i==null?!1:(n.join(i,2),e&&e(n),!0)}catch{return!1}},rj=()=>({state:t,dispatch:e})=>_z(t,e),oj=()=>({state:t,dispatch:e})=>Jz(t,e);function B6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function sj(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let i,r,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))bd()||B6()?s=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return i&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const aj=t=>({editor:e,view:n,tr:i,dispatch:r})=>{const o=sj(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(i.mapping);c&&r&&i.maybeStep(c)}),!0};function vu(t,e,n={}){const{from:i,to:r,empty:o}=t.selection,s=e?Xn(e,t.schema):null,a=[];t.doc.nodesBetween(i,r,(d,f)=>{if(d.isText)return;const p=Math.max(i,f),h=Math.min(r,f+d.nodeSize);a.push({node:d,from:p,to:h})});const l=r-i,u=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>yd(d.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((d,f)=>d+f.to-f.from,0)>=l}const lj=(t,e={})=>({state:n,dispatch:i})=>{const r=Xn(t,n.schema);return vu(n,r,e)?eF(n,i):!1},uj=()=>({state:t,dispatch:e})=>w6(t,e),cj=t=>({state:e,dispatch:n})=>{const i=Xn(t,e.schema);return fF(i)(e,n)},dj=()=>({state:t,dispatch:e})=>b6(t,e);function Sd(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function $6(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((i,r)=>(n.includes(r)||(i[r]=t[r]),i),{})}const fj=(t,e)=>({tr:n,state:i,dispatch:r})=>{let o=null,s=null;const a=Sd(typeof t=="string"?t:t.name,i.schema);return a?(a==="node"&&(o=Xn(t,i.schema)),a==="mark"&&(s=Uo(t,i.schema)),r&&n.selection.ranges.forEach(l=>{i.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,$6(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(d=>{s===d.type&&n.addMark(c,c+u.nodeSize,s.create($6(d.attrs,e)))})})}),!0):!1},pj=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),hj=()=>({tr:t,dispatch:e})=>{if(e){const n=new Ri(t.doc);t.setSelection(n)}return!0},mj=()=>({state:t,dispatch:e})=>m6(t,e),gj=()=>({state:t,dispatch:e})=>y6(t,e),vj=()=>({state:t,dispatch:e})=>rF(t,e),yj=()=>({state:t,dispatch:e})=>aF(t,e),bj=()=>({state:t,dispatch:e})=>sF(t,e);function ng(t,e,n={},i={}){return wd(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:i.errorOnInvalidContent})}const Aj=(t,e=!1,n={},i={})=>({editor:r,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const d=ng(t,r.schema,n,{errorOnInvalidContent:(l=i.errorOnInvalidContent)!==null&&l!==void 0?l:r.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=i.errorOnInvalidContent)!==null&&u!==void 0?u:r.options.enableContentCheck})};function V6(t,e){const n=Uo(e,t.schema),{from:i,to:r,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,r,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function wj(t,e){const n=new Kw(t);return e.forEach(i=>{i.steps.forEach(r=>{n.step(r)})}),n}function Sj(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 Cj(t,e,n){const i=[];return t.nodesBetween(e.from,e.to,(r,o)=>{n(r)&&i.push({node:r,pos:o})}),i}function kj(t,e){for(let n=t.depth;n>0;n-=1){const i=t.node(n);if(e(i))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}}function ig(t){return e=>kj(e.$from,t)}function z6(t,e){const n={from:0,to:t.content.size};return P6(t,n,e)}function Oj(t,e){const n=Xn(e,t.schema),{from:i,to:r}=t.selection,o=[];t.doc.nodesBetween(i,r,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function F6(t,e){const n=Sd(typeof e=="string"?e:e.name,t.schema);return n==="node"?Oj(t,e):n==="mark"?V6(t,e):{}}function Tj(t,e=JSON.stringify){const n={};return t.filter(i=>{const r=e(i);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function xj(t){const e=Tj(t);return e.length===1?e:e.filter((n,i)=>!e.filter((o,s)=>s!==i).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function Mj(t){const{mapping:e,steps:n}=t,i=[];return e.maps.forEach((r,o)=>{const s=[];if(r.ranges.length)r.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const u=e.slice(o).map(a,-1),c=e.slice(o).map(l),d=e.invert().map(u,-1),f=e.invert().map(c);i.push({oldRange:{from:d,to:f},newRange:{from:u,to:c}})})}),xj(i)}function rg(t,e,n){const i=[];return t===e?n.resolve(t).marks().forEach(r=>{const o=n.resolve(t),s=eg(o,r.type);s&&i.push({mark:r,...s})}):n.nodesBetween(t,e,(r,o)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(s=>({from:o,to:o+r.nodeSize,mark:s})))}),i}function Cd(t,e,n){return Object.fromEntries(Object.entries(n).filter(([i])=>{const r=t.find(o=>o.type===e&&o.name===i);return r?r.attribute.keepOnSplit:!1}))}function og(t,e,n={}){const{empty:i,ranges:r}=t.selection,o=e?Uo(e,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>yd(d.attrs,n,{strict:!1}));let s=0;const a=[];if(r.forEach(({$from:d,$to:f})=>{const p=d.pos,h=f.pos;t.doc.nodesBetween(p,h,(m,v)=>{if(!m.isText&&!m.marks.length)return;const S=Math.max(p,v),b=Math.min(h,v+m.nodeSize),k=b-S;s+=k,a.push(...m.marks.map(A=>({mark:A,from:S,to:b})))})}),s===0)return!1;const l=a.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>yd(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),u=a.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+u:l)>=s}function Ej(t,e,n={}){if(!e)return vu(t,null,n)||og(t,null,n);const i=Sd(e,t.schema);return i==="node"?vu(t,e,n):i==="mark"?og(t,e,n):!1}function j6(t,e){const{nodeExtensions:n}=fd(e),i=n.find(s=>s.name===t);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},o=Dt(tt(i,"group",r));return typeof o!="string"?!1:o.split(" ").includes("list")}function kd(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var i;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((i=t.text)!==null&&i!==void 0?i:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let r=!0;return t.content.forEach(o=>{r!==!1&&(kd(o,{ignoreWhitespace:n,checkChildren:e})||(r=!1))}),r}return!1}function Pj(t){return t instanceof mt}function H6(t,e,n){const r=t.state.doc.content.size,o=no(e,0,r),s=no(n,0,r),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),f=Math.max(a.right,l.right),p=f-d,h=c-u,S={top:u,bottom:c,left:d,right:f,width:p,height:h,x:d,y:u};return{...S,toJSON:()=>S}}function Ij(t,e,n){var i;const{selection:r}=e;let o=null;if(tg(r)&&(o=r.$cursor),o){const a=(i=t.storedMarks)!==null&&i!==void 0?i:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=r;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){const p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=p&&h}return!u}),u})}const Lj=(t,e={})=>({tr:n,state:i,dispatch:r})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Uo(t,i.schema);if(r)if(s){const u=V6(i,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;i.doc.nodesBetween(c,d,(f,p)=>{const h=Math.max(p,c),m=Math.min(p+f.nodeSize,d);f.marks.find(S=>S.type===l)?f.marks.forEach(S=>{l===S.type&&n.addMark(h,m,l.create({...S.attrs,...e}))}):n.addMark(h,m,l.create(e))})});return Ij(i,n,l)},Dj=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Rj=(t,e={})=>({state:n,dispatch:i,chain:r})=>{const o=Xn(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?r().command(({commands:a})=>k6(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>k6(o,{...s,...e})(a,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Nj=t=>({tr:e,dispatch:n})=>{if(n){const{doc:i}=e,r=no(t,0,i.content.size),o=mt.create(i,r);e.setSelection(o)}return!0},Bj=t=>({tr:e,dispatch:n})=>{if(n){const{doc:i}=e,{from:r,to:o}=typeof t=="number"?{from:t,to:t}:t,s=Mt.atStart(i).from,a=Mt.atEnd(i).to,l=no(r,s,a),u=no(o,s,a),c=Mt.create(i,l,u);e.setSelection(c)}return!0},$j=t=>({state:e,dispatch:n})=>{const i=Xn(t,e.schema);return mF(i)(e,n)};function U6(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const i=n.filter(r=>e==null?void 0:e.includes(r.type.name));t.tr.ensureMarks(i)}}const Vj=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:i,editor:r})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=r.extensionManager.attributes,c=Cd(u,a.node().type.name,a.node().attrs);if(o instanceof mt&&o.node.isBlock)return!a.parentOffset||!_r(s,a.pos)?!1:(i&&(t&&U6(n,r.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:Sj(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=d&&f?[{type:f,attrs:c}]:void 0,h=_r(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!h&&_r(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:c}]:void 0),i){if(h&&(o instanceof Mt&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),f&&!d&&!a.parentOffset&&a.parent.type!==f)){const m=e.mapping.map(a.before()),v=e.doc.resolve(m);a.node(-1).canReplaceWith(v.index(),v.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&U6(n,r.extensionManager.splittableMarks),e.scrollIntoView()}return h},zj=(t,e={})=>({tr:n,state:i,dispatch:r,editor:o})=>{var s;const a=Xn(t,i.schema),{$from:l,$to:u}=i.selection,c=i.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==a)return!1;const f=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let S=Ee.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let P=l.depth-b;P>=l.depth-3;P-=1)S=Ee.from(l.node(P).copy(S));const k=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,A={...Cd(f,l.node().type.name,l.node().attrs),...e},w=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(A))||void 0;S=S.append(Ee.from(a.createAndFill(null,w)||void 0));const y=l.before(l.depth-(b-1));n.replace(y,l.after(-k),new Xe(S,4-b,0));let C=-1;n.doc.nodesBetween(y,n.doc.content.size,(P,R)=>{if(C>-1)return!1;P.isTextblock&&P.content.size===0&&(C=R+1)}),C>-1&&n.setSelection(Mt.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const p=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,h={...Cd(f,d.type.name,d.attrs),...e},m={...Cd(f,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const v=p?[{type:a,attrs:h},{type:p,attrs:m}]:[{type:a,attrs:h}];if(!_r(n.doc,l.pos,2))return!1;if(r){const{selection:S,storedMarks:b}=i,{splittableMarks:k}=o.extensionManager,A=b||S.$to.parentOffset&&S.$from.marks();if(n.split(l.pos,2,v).scrollIntoView(),!A||!r)return!0;const w=A.filter(y=>k.includes(y.type.name));n.ensureMarks(w)}return!0},sg=(t,e)=>{const n=ig(s=>s.type===e)(t.selection);if(!n)return!0;const i=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(i===void 0)return!0;const r=t.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Do(t.doc,n.pos)&&t.join(n.pos),!0},ag=(t,e)=>{const n=ig(s=>s.type===e)(t.selection);if(!n)return!0;const i=t.doc.resolve(n.start).after(n.depth);if(i===void 0)return!0;const r=t.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Do(t.doc,i)&&t.join(i),!0};var Fj=Object.freeze({__proto__:null,blur:LF,clearContent:DF,clearNodes:RF,command:NF,createParagraphNear:BF,cut:$F,deleteCurrentNode:VF,deleteNode:zF,deleteRange:FF,deleteSelection:jF,enter:HF,exitCode:UF,extendMarkRange:KF,first:WF,focus:qF,forEach:XF,insertContent:GF,insertContentAt:JF,joinBackward:ej,joinDown:QF,joinForward:tj,joinItemBackward:nj,joinItemForward:ij,joinTextblockBackward:rj,joinTextblockForward:oj,joinUp:YF,keyboardShortcut:aj,lift:lj,liftEmptyBlock:uj,liftListItem:cj,newlineInCode:dj,resetAttributes:fj,scrollIntoView:pj,selectAll:hj,selectNodeBackward:mj,selectNodeForward:gj,selectParentNode:vj,selectTextblockEnd:yj,selectTextblockStart:bj,setContent:Aj,setMark:Lj,setMeta:Dj,setNode:Rj,setNodeSelection:Nj,setTextSelection:Bj,sinkListItem:$j,splitBlock:Vj,splitListItem:zj,toggleList:(t,e,n,i={})=>({editor:r,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:d,splittableMarks:f}=r.extensionManager,p=Xn(t,s.schema),h=Xn(e,s.schema),{selection:m,storedMarks:v}=s,{$from:S,$to:b}=m,k=S.blockRange(b),A=v||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;const w=ig(y=>j6(y.type.name,d))(m);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===p)return u.liftListItem(h);if(j6(w.node.type.name,d)&&p.validContent(w.node.content)&&a)return l().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>sg(o,p)).command(()=>ag(o,p)).run()}return!n||!A||!a?l().command(()=>c().wrapInList(p,i)?!0:u.clearNodes()).wrapInList(p,i).command(()=>sg(o,p)).command(()=>ag(o,p)).run():l().command(()=>{const y=c().wrapInList(p,i),C=A.filter(P=>f.includes(P.type.name));return o.ensureMarks(C),y?!0:u.clearNodes()}).wrapInList(p,i).command(()=>sg(o,p)).command(()=>ag(o,p)).run()},toggleMark:(t,e={},n={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:o=!1}=n,s=Uo(t,i.schema);return og(i,s,e)?r.unsetMark(s,{extendEmptyMarkRange:o}):r.setMark(s,e)},toggleNode:(t,e,n={})=>({state:i,commands:r})=>{const o=Xn(t,i.schema),s=Xn(e,i.schema),a=vu(i,o,n);let l;return i.selection.$anchor.sameParent(i.selection.$head)&&(l=i.selection.$anchor.parent.attrs),a?r.setNode(s,l):r.setNode(o,{...l,...n})},toggleWrap:(t,e={})=>({state:n,commands:i})=>{const r=Xn(t,n.schema);return vu(n,r,e)?i.lift(r):i.wrapIn(r,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let i=0;i<n.length;i+=1){const r=n[i];let o;if(r.spec.isInputRules&&(o=r.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:i,ranges:r}=n;return i||e&&r.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:i,dispatch:r})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Uo(t,i.schema),{$from:u,empty:c,ranges:d}=a;if(!r)return!0;if(c&&s){let{from:f,to:p}=a;const h=(o=u.marks().find(v=>v.type===l))===null||o===void 0?void 0:o.attrs,m=eg(u,l,h);m&&(f=m.from,p=m.to),n.removeMark(f,p,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:i,dispatch:r})=>{let o=null,s=null;const a=Sd(typeof t=="string"?t:t.name,i.schema);return a?(a==="node"&&(o=Xn(t,i.schema)),a==="mark"&&(s=Uo(t,i.schema)),r&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;let d,f,p,h;n.selection.empty?i.doc.nodesBetween(u,c,(m,v)=>{o&&o===m.type&&(p=Math.max(v,u),h=Math.min(v+m.nodeSize,c),d=v,f=m)}):i.doc.nodesBetween(u,c,(m,v)=>{v<u&&o&&o===m.type&&(p=Math.max(v,u),h=Math.min(v+m.nodeSize,c),d=v,f=m),v>=u&&v<=c&&(o&&o===m.type&&n.setNodeMarkup(v,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(S=>{if(s===S.type){const b=Math.max(v,u),k=Math.min(v+m.nodeSize,c);n.addMark(b,k,s.create({...S.attrs,...e}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&n.addMark(p,h,s.create({...m.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:i})=>{const r=Xn(t,n.schema);return lF(r,e)(n,i)},wrapInList:(t,e={})=>({state:n,dispatch:i})=>{const r=Xn(t,n.schema);return uF(r,e)(n,i)}});const jj=Ai.create({name:"commands",addCommands(){return{...Fj}}}),Hj=Ai.create({name:"drop",addProseMirrorPlugins(){return[new qn({key:new ni("tiptapDrop"),props:{handleDrop:(t,e,n,i)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:i})}}})]}}),Uj=Ai.create({name:"editable",addProseMirrorPlugins(){return[new qn({key:new ni("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Kj=new ni("focusEvents"),Wj=Ai.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new qn({key:Kj,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const i=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(i),!1},blur:(e,n)=>{t.isFocused=!1;const i=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(i),!1}}}})]}}),qj=Ai.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:d}=l,{pos:f,parent:p}=d,h=d.parent.isTextblock&&f>0?a.doc.resolve(f-1):d,m=h.parent.type.spec.isolating,v=d.pos-d.parentOffset,S=m&&h.parent.childCount===1?v===d.pos:Vt.atStart(u).from===f;return!c||!p.type.isTextblock||p.textContent.length||!S||S&&d.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()]),i={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},o={...i,"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 bd()||B6()?o:r},addProseMirrorPlugins(){return[new qn({key:new ni("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(m=>m.getMeta("composition")))return;const i=t.some(m=>m.docChanged)&&!e.doc.eq(n.doc),r=t.some(m=>m.getMeta("preventClearDocument"));if(!i||r)return;const{empty:o,from:s,to:a}=e.selection,l=Vt.atStart(e.doc).from,u=Vt.atEnd(e.doc).to;if(o||!(s===l&&a===u)||!kd(n.doc))return;const f=n.tr,p=cd({state:n,transaction:f}),{commands:h}=new dd({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),Xj=Ai.create({name:"paste",addProseMirrorPlugins(){return[new qn({key:new ni("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Gj=Ai.create({name:"tabindex",addProseMirrorPlugins(){return[new qn({key:new ni("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Es{get name(){return this.node.type.name}constructor(e,n,i=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=e,this.editor=n,this.currentNode=r}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,i=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,i=this.to-1}this.editor.commands.insertContentAt({from:n,to:i},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 Es(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 Es(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 Es(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,i)=>{const r=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+i+(o?0:1),a=this.resolvedPos.doc.resolve(s);if(!r&&a.depth<=this.depth)return;const l=new Es(a,this.editor,r,r?n:null);r&&(l.actualDepth=this.depth+1),e.push(new Es(a,this.editor,r,r?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 i=null,r=this.parent;for(;r&&!i;){if(r.node.type.name===e)if(Object.keys(n).length>0){const o=r.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==n[l])break}}else i=r;r=r.parent}return i}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},i=!1){let r=[];if(!this.children||this.children.length===0)return r;const o=Object.keys(n);return this.children.forEach(s=>{i&&r.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&r.push(s),!(i&&r.length>0)&&(r=r.concat(s.querySelectorAll(e,n,i))))}),r}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const Zj=`.ProseMirror {
207
+ `)}this.styleElement.innerHTML=i}},hasBreakpoints:function(){return xh(this.template)==="object"},setPaginatorAttribute:function(){var e=this;this.$refs.paginator&&this.$refs.paginator.length>=0&&PD(this.$refs.paginator).forEach(function(n){n.setAttribute(e.attributeSelector,"")})},getAriaLabel:function(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[e]:void 0}},computed:{templateItems:function(){var e={};if(this.hasBreakpoints()){e=this.template,e.default||(e.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(var n in e)e[n]=this.template[n].split(" ").map(function(i){return i.trim()});return e}return e.default=this.template.split(" ").map(function(i){return i.trim()}),e},page:function(){return Math.floor(this.d_first/this.d_rows)},pageCount:function(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage:function(){return this.page===0},isLastPage:function(){return this.page===this.pageCount-1},calculatePageLinkBoundaries:function(){var e=this.pageCount,n=Math.min(this.pageLinkSize,e),i=Math.max(0,Math.ceil(this.page-n/2)),r=Math.min(e-1,i+n-1),o=this.pageLinkSize-(r-i+1);return i=Math.max(0,i-o),[i,r]},pageLinks:function(){for(var e=[],n=this.calculatePageLinkBoundaries,i=n[0],r=n[1],o=i;o<=r;o++)e.push(o+1);return e},currentState:function(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty:function(){return this.pageCount===0},currentPage:function(){return this.pageCount>0?this.page+1:0},attributeSelector:function(){return jn()}},components:{CurrentPageReport:EA,FirstPageLink:PA,LastPageLink:DA,NextPageLink:RA,PageLinks:NA,PrevPageLink:BA,RowsPerPageDropdown:$A,JumpToPageDropdown:IA,JumpToPageInput:LA}};function $D(t,e,n,i,r,o){var s=et("FirstPageLink"),a=et("PrevPageLink"),l=et("NextPageLink"),u=et("LastPageLink"),c=et("PageLinks"),d=et("CurrentPageReport"),f=et("RowsPerPageDropdown"),p=et("JumpToPageDropdown"),h=et("JumpToPageInput");return t.alwaysShow||o.pageLinks&&o.pageLinks.length>1?(g(),T("nav",it(O({key:0},t.ptmi("paginatorWrapper"))),[(g(!0),T(le,null,_e(o.templateItems,function(m,v){return g(),T("div",O({key:v,ref_for:!0,ref:"paginator",class:t.cx("paginator",{key:v})},t.ptm("root")),[t.$slots.start?(g(),T("div",O({key:0,class:t.cx("start")},t.ptm("start")),[ee(t.$slots,"start",{state:o.currentState})],16)):N("",!0),(g(!0),T(le,null,_e(m,function(S){return g(),T(le,{key:S},[S==="FirstPageLink"?(g(),L(s,{key:0,"aria-label":o.getAriaLabel("firstPageLabel"),template:t.$slots.firstpagelinkicon,onClick:e[0]||(e[0]=function(b){return o.changePageToFirst(b)}),disabled:o.isFirstPage||o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","template","disabled","unstyled","pt"])):S==="PrevPageLink"?(g(),L(a,{key:1,"aria-label":o.getAriaLabel("prevPageLabel"),template:t.$slots.prevpagelinkicon,onClick:e[1]||(e[1]=function(b){return o.changePageToPrev(b)}),disabled:o.isFirstPage||o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","template","disabled","unstyled","pt"])):S==="NextPageLink"?(g(),L(l,{key:2,"aria-label":o.getAriaLabel("nextPageLabel"),template:t.$slots.nextpagelinkicon,onClick:e[2]||(e[2]=function(b){return o.changePageToNext(b)}),disabled:o.isLastPage||o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","template","disabled","unstyled","pt"])):S==="LastPageLink"?(g(),L(u,{key:3,"aria-label":o.getAriaLabel("lastPageLabel"),template:t.$slots.lastpagelinkicon,onClick:e[3]||(e[3]=function(b){return o.changePageToLast(b)}),disabled:o.isLastPage||o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","template","disabled","unstyled","pt"])):S==="PageLinks"?(g(),L(c,{key:4,"aria-label":o.getAriaLabel("pageLabel"),value:o.pageLinks,page:o.page,onClick:e[4]||(e[4]=function(b){return o.changePageLink(b)}),pt:t.pt},null,8,["aria-label","value","page","pt"])):S==="CurrentPageReport"?(g(),L(d,{key:5,"aria-live":"polite",template:t.currentPageReportTemplate,currentPage:o.currentPage,page:o.page,pageCount:o.pageCount,first:r.d_first,rows:r.d_rows,totalRecords:t.totalRecords,unstyled:t.unstyled,pt:t.pt},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords","unstyled","pt"])):S==="RowsPerPageDropdown"&&t.rowsPerPageOptions?(g(),L(f,{key:6,"aria-label":o.getAriaLabel("rowsPerPageLabel"),rows:r.d_rows,options:t.rowsPerPageOptions,onRowsChange:e[5]||(e[5]=function(b){return o.onRowChange(b)}),disabled:o.empty,templates:t.$slots,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","rows","options","disabled","templates","unstyled","pt"])):S==="JumpToPageDropdown"?(g(),L(p,{key:7,"aria-label":o.getAriaLabel("jumpToPageDropdownLabel"),page:o.page,pageCount:o.pageCount,onPageChange:e[6]||(e[6]=function(b){return o.changePage(b)}),disabled:o.empty,templates:t.$slots,unstyled:t.unstyled,pt:t.pt},null,8,["aria-label","page","pageCount","disabled","templates","unstyled","pt"])):S==="JumpToPageInput"?(g(),L(h,{key:8,page:o.currentPage,onPageChange:e[7]||(e[7]=function(b){return o.changePage(b)}),disabled:o.empty,unstyled:t.unstyled,pt:t.pt},null,8,["page","disabled","unstyled","pt"])):N("",!0)],64)}),128)),t.$slots.end?(g(),T("div",O({key:1,class:t.cx("end")},t.ptm("end")),[ee(t.$slots,"end",{state:o.currentState})],16)):N("",!0)],16)}),128))],16)):N("",!0)}Eh.render=$D;const VD=(t,e,n)=>{const i=t[e];return i?typeof i=="function"?i():Promise.resolve(i):new Promise((r,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},Kl=ye({__name:"Animation",props:{animation:{},autoplay:{type:Boolean,default:!0},loop:{type:Boolean,default:!0}},setup(t){const e=t,{defaultProps:n}=_t("Animation"),i=W(()=>Hi(e,n)),r=re(null);bt(async()=>{const s=await VD(Object.assign({"../../assets/lottie/admin/loading-page.lottie":()=>qt.import("./loading-page-BrQattYE.js"),"../../assets/lottie/admin/loading-table.lottie":()=>qt.import("./loading-table-BzrSQlA0.js"),"../../assets/lottie/admin/no-data.lottie":()=>qt.import("./no-data-y1X5WtcQ.js"),"../../assets/lottie/supplyasset/loading-page.lottie":()=>qt.import("./loading-page-DbLuqCHa.js"),"../../assets/lottie/supplyasset/loading-table.lottie":()=>qt.import("./loading-table-Bdr9ZhtP.js"),"../../assets/lottie/supplyasset/no-data.lottie":()=>qt.import("./no-data-Cgze_Rvp.js"),"../../assets/lottie/workspace/loading-page.lottie":()=>qt.import("./loading-page-CgfbWppy.js"),"../../assets/lottie/workspace/loading-plane.lottie":()=>qt.import("./loading-plane-CgfbWppy.js"),"../../assets/lottie/workspace/loading-table.lottie":()=>qt.import("./loading-table-chOgXi94.js"),"../../assets/lottie/workspace/no-data.lottie":()=>qt.import("./no-data-Dep79CBh.js")}),`../../assets/lottie/${i.value.libPath}/${e.animation}.lottie`,6),{DotLottie:a}=await o();r.value&&new a({canvas:r.value,src:s.default,autoplay:e.autoplay,loop:e.loop})});const o=()=>qt.import("https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web@0.38.2/+esm");return(s,a)=>(g(),T("div",O({"data-wv-name":"animation"},s.$attrs),[E("canvas",{ref_key:"canvasRef",ref:r,style:{width:"100%",height:"100%"}},null,512)],16))}}),zD=ye({__name:"MultiRow",props:{attributes:{}},setup(t){const e=t,n=dt("preset",{}).datatable;return(i,r)=>{var o;return g(),T("div",it(Ot((o=x(n))==null?void 0:o.multirowcontainer({props:e}))),[(g(!0),T(le,null,_e(i.attributes,(s,a)=>{var l;return g(),T("span",O({key:a,ref_for:!0},(l=x(n))==null?void 0:l.multirow({context:{firstIndex:a===0}}),{class:s.class}),[s.bodyComponent?(g(),L(yt(s.bodyComponent.component),O({key:0,modelValue:s.bodyComponent.model,"onUpdate:modelValue":u=>s.bodyComponent.model=u,ref_for:!0},s.bodyComponent.props,{class:s.class,disabled:s.bodyComponent.disabled},Yo(s.bodyComponent.events?s.bodyComponent.events:{}),{onClick:r[0]||(r[0]=xt(()=>{},["stop"]))}),null,16,["modelValue","onUpdate:modelValue","class","disabled"])):(g(),T(le,{key:1},[ht(_(s.value),1)],64))],16)}),128))],16)}}}),FD=["id"],jD=["onClick"],HD={class:"flex"},UD=["id"],KD={key:0},WD=["colspan"],qD=["id","draggable","onClick","onDblclick","onDragenter","onDragstart"],XD=["onClick"],GD=["colspan"],ZD=["colspan"],_D=["colspan"],JD=["colspan"],YD=["colspan"],QD=["contenteditable","onBlur","onKeypress"],eR={key:1},tR={key:2},nR=["colspan"],iR=ye({__name:"DataTable",props:Cn({treeTable:{type:Boolean},childTableProps:{},tableName:{default:"datatable"},tableTitle:{default:void 0},columns:{},useOption:{type:Boolean,default:!0},data:{},dataKey:{default:"_id"},disableKey:{default:"isDefault"},includeCheckDisabledRows:{type:Boolean},highlightKey:{},disableAllRows:{type:Boolean},search:{},tag:{},defaultQueryParams:{},fetchFunction:{},rows:{},isSelectedAll:{type:Boolean},filters:{},lazy:{type:Boolean,default:!0},loading:{type:Boolean},selectionType:{default:"checkbox"},useSelection:{type:Boolean},selectedData:{},expandedRows:{},usePaginator:{type:Boolean},options:{default:()=>[]},singleSelect:{type:Boolean},customColumn:{type:Boolean,default:!0},scrollHeight:{},rowHeight:{default:"fixed"},reorderable:{type:Boolean},globalFilterFields:{},totalDisabledRows:{},excelToastErrorMessage:{},emptyTableMessage:{},singleSelection:{}},{singleSelection:{},singleSelectionModifiers:{}}),emits:Cn(["toggleOption","selectData","rowSelect","page","sort","update:selectedData","update:singleSelection","cellEdited","input","rowReorder"],["update:singleSelection"]),setup(t,{emit:e}){const n=t,i=e,r=si(t,"singleSelection"),{defaultProps:o,locale:s}=_t("DataTable"),a=W(()=>Hi(n,o)),l=dt("preset",{}).datatable,u=[10,25,50,100],c=dt("useToastConfig"),d=vo(c),{setLoading:f}=Fi(),p=`${window.location.pathname.replace("/","").split("/").join("-")}-${n.tableName}`,h=re(n.data??[]),m=oe(n.data??[]),v=re({}),S=re(n.columns),b=re(),k=re(),A=oe([]),w=oe(),y=oe(0),C=oe(!1),P=oe(!1),R=oe(0),M=oe(0),D=oe(0),$=oe(!1),q=oe(),J=re(),ve=re(),ae=re([]),me=oe({}),se=oe(),Ie=oe(),Be=oe(),xe=oe(),de=oe(1),ge=oe(10),Pe=oe(0),Te=re({}),ue=W(()=>{var V,ne;return(V=n.childTableProps)!=null&&V.columns?(ne=n.childTableProps)==null?void 0:ne.columns.filter(Ve=>{var qe;return!Ve.parentColumnsFields||((qe=Ve.parentColumnsFields)==null?void 0:qe.some(Wt=>S.value.some(Qe=>Qe.field===Wt)))}):S.value}),Se=W(()=>S.value.length+(n.selectionType==="checkbox"?1:0)+(n.useOption?1:0)+(n.reorderable?1:0)+(n.treeTable?1:0)),Z=W(()=>({...n.defaultQueryParams,search:n.lazy?se.value:n.search,tag:n.lazy?Ie.value:void 0,page:n.usePaginator?de.value:void 0,limit:n.usePaginator?ge.value:void 0,sortOrder:xe.value,sortBy:Be.value,...n.lazy?me.value:n.filters})),X=W(()=>{var ne;const V=(ne=h.value)==null?void 0:ne.filter(Ve=>{var qe;return((qe=Ve.children)==null?void 0:qe.length)||Ve.hasChildren});return(V==null?void 0:V.length)&&V.every(Ve=>v.value[Ve[n.dataKey]]>0)}),U=W(()=>{var Qe,Ht,Nt,On,En;if(n.disableAllRows||!((Qe=lt())!=null&&Qe.length)||n.selectionType!=="checkbox"||((Ht=Y.value)==null?void 0:Ht.length)===h.value.length)return!1;const V=(Nt=A.value)==null?void 0:Nt.length,ne=((On=at(lt()))==null?void 0:On.map(be=>be[n.dataKey]))??[],Ve=((En=A.value)==null?void 0:En.map(be=>be[n.dataKey]))??[],qe=Ve.length?$L(ne,Ve):!1,Wt=V>0&&V===(Pe.value??0)-(Y.value.length??0);return qe||Wt}),Y=W(()=>Qt(n.data??lt()??[])),ke=W(()=>C.value||n.loading),Fe=W(()=>{var V;return!ke.value&&!((V=h.value)!=null&&V.length)}),H=W(()=>n.lazy&&n.fetchFunction||!n.usePaginator?h.value:h.value.slice((de.value-1)*ge.value,de.value*ge.value)),he=V=>Object.keys(v.value).includes(V),De=V=>Y.value.includes(V),nt=V=>n.selectionType==="checkbox"?!!A.value.find(ne=>ne[n.dataKey]===V):St(V),St=V=>{var ne;return V!==void 0&&((ne=r.value)==null?void 0:ne[n.dataKey])===V},lt=V=>(h.value??[]).filter(ne=>!ne.childRowHeader&&!ne.childRow),At=async(V,ne,Ve)=>{var Wt,Qe;if(he(V[n.dataKey])===Ve)return;const qe=Ve??!he(V[n.dataKey]);if(!P.value)if(!qe)h.value.splice(ne+1,v.value[V[n.dataKey]]),delete v.value[V[n.dataKey]];else{v.value[V[n.dataKey]]=1;let{children:Ht}=V;if((Wt=n.childTableProps)!=null&&Wt.fetchFunction&&V.hasChildren)try{h.value.splice(ne+1,0,{childRow:!0,loadingRow:!0}),P.value=!0;const Nt=await((Qe=n.childTableProps)==null?void 0:Qe.fetchFunction(V));Ht=Nt==null?void 0:Nt.data}catch(Nt){console.error("🚀 ~ toggleRowExpand ~ error:",Nt)}finally{h.value.splice(ne+1,1),P.value=!1}if(ne>=0&&(Ht!=null&&Ht.length)){const Nt=Ht.flatMap(On=>[{childRowHeader:!0,header:On.groupHeader},...(On.groupItems??[]).map(be=>({childRow:!0,...be}))]);v.value[V[n.dataKey]]=Nt.length,h.value.splice(ne+1,0,...Nt)}else h.value.splice(ne+1,0,{childRow:!0,noDataRow:!0})}},Ut=V=>{n.includeCheckDisabledRows?A.value=V?lt():lt().filter(ne=>De(ne[n.dataKey])):A.value=V?at(lt()):[]},cn=(V,ne,Ve)=>{if(!ne.childRow&&!ne.childRowHeader&&!De(ne[n.dataKey])&&n.selectionType!=="none"){const qe=nt(ne[n.dataKey]);i("rowSelect",{originalEvent:V,data:ne,index:Ve}),n.selectionType==="checkbox"?qe?A.value=A.value.filter(Wt=>Wt[n.dataKey]!=ne[n.dataKey]):A.value=[...A.value,ne]:r.value=qe?void 0:ne}},dn=async()=>{var ne;const V=!X.value;if(!P.value){let Ve=0;for(const qe of h.value)((ne=qe.children)!=null&&ne.length||qe.hasChildren)&&await At(qe,Ve,V),Ve++}},tn=async(V,ne)=>{const Ve=V.target,qe=Ve.tagName.toLowerCase()==="button"?Ve:Ve.parentElement;i("toggleOption",ne);const Wt={...V,currentTarget:V.currentTarget??V.target};we(),await Pt(()=>{var Qe;qe!=null&&qe.classList.contains("option-button-active")?we():((Qe=ve.value)==null||Qe.toggle(Wt),we(),qe==null||qe.classList.add("option-button-active"))})},zt=async(V,ne,Ve)=>{var Wt,Qe,Ht,Nt;if(!Ve.preset)return;const qe=()=>ea(ne,Ve.field,!Hn(ne,Ve.field));if(Ve.preset.type==="checkbox"?(Qe=(Wt=Ve.preset).onCheck)==null||Qe.call(Wt,V,ne,qe):Ve.preset.type==="toggle"&&((Nt=(Ht=Ve.preset).onToggle)==null||Nt.call(Ht,V,ne,qe)),"confirmDialogProps"in Ve.preset){const{showWhen:On}=Kt(Ve.preset,ne[Ve.field],ne)??{};typeof On=="function"?Te.value[ne[n.dataKey]+Ve.field]=await On(ne,V):Te.value[ne[n.dataKey]+Ve.field]=!On||On==="active"&&V||On==="inactive"&&!V}},Rt=V=>V.draggable!==!1&&!V.childRow&&!V.childRowHeader&&n.reorderable&&!xe.value,kn=(V,ne,Ve)=>{if(ne.childRow||ne.childRowHeader)return;v.value={};const{dataTransfer:qe}=V;q.value=ne,w.value={item:ne,fromIndex:Ve},qe&&(qe.dropEffect="move",qe.effectAllowed="move",qe.setData("id",ne._id),qe.setData("index",Ve.toString()))},Yt=(V,ne)=>{var Ve,qe;if(V.preventDefault(),Rt(ne)){const Wt=V.target,Qe=Wt.tagName==="TR"?Wt:Wt.closest("tr");if(Qe==null||Qe.classList.add("bg-primary-50"),(Ve=Qe==null?void 0:Qe.nextElementSibling)==null||Ve.classList.remove("bg-primary-50"),(qe=Qe==null?void 0:Qe.previousElementSibling)==null||qe.classList.remove("bg-primary-50"),!Qe||!q.value)return;const Ht=ae.value.findIndex(On=>{var En;return On._id===((En=q.value)==null?void 0:En._id)}),Nt=ae.value.findIndex(On=>On._id===Qe.id);Ht!==-1&&Nt!==-1&&(w.value&&(w.value.toIndex=Nt),[ae.value[Ht],ae.value[Nt]]=[ae.value[Nt],ae.value[Ht]],Q())}},te=()=>{w.value&&i("rowReorder",w.value),q.value=void 0,$.value=!1,w.value=void 0},Q=()=>{h.value=[...ae.value]},we=()=>{const V=document.querySelectorAll(".option-button-active");V==null||V.forEach(ne=>{ne.classList.remove("option-button-active")})},je=()=>{Be.value=void 0,xe.value=void 0},st=()=>{de.value=1,D.value++},ie=()=>{ge.value=n.rows??10,de.value=1,D.value++},Ae=()=>{ie(),je()},He=async()=>{M.value++,D.value++,Ae(),n.lazy?await fn():ut()},ut=()=>{let V=[...m.value??[]];const ne=me.value,Ve=Object.entries(ne);try{V=Ve.length?V.filter(qe=>Ve.every(([Wt,{value:Qe,matchMode:Ht}])=>{const Nt=Hn(qe,Wt);switch(Ht){case"IN":return Array.isArray(Qe)?Qe.includes(Nt):!1;case"CONTAINS":return Nt&&Qe?Nt.toString().toLowerCase().includes(Qe):!1;case"EQUALS":return Nt?Nt.toString()===Qe.toString():!1;case"BETWEEN":return Array.isArray(Qe)&&Qe.length===2?!isNaN(Nt)&&(Qe[0]==null||Nt>=Qe[0])&&(Qe[1]==null||Nt<=Qe[1]):!1;case"DATE_BETWEEN":return Array.isArray(Qe)?+new Date(Nt)>=Qe[0]&&+new Date(Nt)<=Qe[1]:!1;default:return!1}})):m.value}catch(qe){console.error("🚀 ~ applyStaticFilter ~ error:",qe)}rt(V)},rt=V=>{var ne;try{h.value=(ne=se.value)!=null&&ne.length?V.filter(Ve=>{const qe=JSON.stringify(Ve);return new RegExp(se.value,"i").test(qe)||se.value.split(/\s+/).filter(Boolean).every(Wt=>new RegExp(Wt,"i").test(qe))}):V}catch(Ve){console.error("🚀 ~ applyStaticSearch ~ error:",Ve)}},gt=async V=>{ge.value=V.rows,de.value=V.page+1,n.lazy&&n.fetchFunction&&await fn(),Object.keys(v.value).forEach(ne=>{const Ve=h.value.findIndex(qe=>qe[n.dataKey]==ne);Ve>=0&&At(h.value[Ve],Ve,!0)})},Ft=(V,ne)=>{V!==Be.value&&(xe.value=void 0),Be.value=V,xe.value?xe.value==-1?(xe.value=void 0,Be.value=void 0):xe.value=-1:xe.value=1,i("sort",{sortOrder:xe.value,sortField:Be.value,originalEvent:ne,rows:ge.value}),st(),n.lazy&&n.fetchFunction?fn():on()},on=()=>{const V=[...h.value??[]],ne=new Map;if(!xe.value){h.value=m.value??[];return}for(const qe of V)ne.set(qe,Ce.resolveFieldData(qe,Be.value));const Ve=new Intl.Collator(void 0,{numeric:!0}).compare;V.sort((qe,Wt)=>{const Qe=ne.get(qe),Ht=ne.get(Wt);return Ce.sort(Qe,Ht,xe.value,Ve,-1)}),h.value=V},fn=async()=>{var V;try{C.value=!0;const ne=await((V=n.fetchFunction)==null?void 0:V.call(n,Z.value)),{data:Ve=[],totalRecords:qe=0}=(ne==null?void 0:ne.data)??{};h.value=Ve,ae.value=[...h.value],Pe.value=qe}catch(ne){console.error("🚀 ~ reFetch ~ error:",ne)}finally{C.value=!1,v.value={}}},gn=async()=>{var Ve;const V=go(Z.value);delete V.page,delete V.limit;const ne=await((Ve=n.fetchFunction)==null?void 0:Ve.call(n,V));if(ne instanceof Error)throw ne;return(ne==null?void 0:ne.data)??{data:[],totalRecords:0}},F=async V=>{if(n.tableName===V.tableName)try{C.value=!0;const{data:ne,totalRecords:Ve=0}=n.lazy?await gn():{totalRecords:(n.data??[]).length,data:n.data},qe=Qt(ne);A.value=n.includeCheckDisabledRows?ne??[]:at(ne,qe),Pe.value=Ve}finally{C.value=!1}},fe=(V,ne)=>l==null?void 0:l.headercell({props:n,context:{sortOrder:xe.value,customColumn:ne,sorted:Be.value&&Be.value===(V==null?void 0:V.field),sortable:V==null?void 0:V.sortable}}),Ne=V=>{(!V.tableName||V.tableName===n.tableName)&&Pt(()=>{R.value++,fn()})},at=(V,ne)=>(V??[]).filter(Ve=>!(ne??Y.value).includes(Ve[n.dataKey])),Qt=(V=[])=>n.disableAllRows?V.map(ne=>ne[n.dataKey]):V.filter(ne=>ne[n.disableKey]).map(ne=>ne[n.dataKey]),Jt=async({tableName:V,multiTableNames:ne,fileName:Ve,additionalTexts:qe})=>{var On;if(V!==n.tableName&&!(ne!=null&&ne.includes(n.tableName)))return;const Qe=S.value.filter(En=>En.visible!==!1).filter(En=>!En.excluded),Ht=Qe.map(En=>En.header??En.exportHeader??"-"),Nt=()=>Ve.trim().replace(/[^a-zA-Z0-9\s]/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/-+$/,"");try{if(Ye.off("data-table:download",B),V===n.tableName){f(!0,s.downloadingMessage);const{data:En}=n.fetchFunction?await gn():{data:n.data},be=Ey(En,Qe,s);if(ne!=null&&ne.length){Ye.emit("button-download:multi-tables",{table:{headers:Ht,data:be,tableName:V,tableTitle:n.tableTitle}});return}await ep({tables:[{headers:Ht,data:be,tableName:V,tableTitle:n.tableTitle}],fileName:Nt(),additionalTexts:qe})}}catch(En){console.error("🚀 ~ downloadExcel error:",En),d.removeAllGroups(),d.add({message:((On=a.value.excelToastErrorMessage)==null?void 0:On.replace("{fileName}",Ve))??"Data gagal diunduh.",error:En,group:"download"})}finally{f(!1),Ye.on("data-table:download",B)}};bt(async()=>{var V;n.fetchFunction&&(await fn(),Ue()),(V=n.selectedData)!=null&&V.length&&(A.value=n.selectedData),Je()}),Jo(()=>{Ge()}),Re(()=>n.columns,()=>{n.customColumn||(S.value=n.columns),y.value++}),Re(()=>n.data,V=>{h.value=V??[],m.value=V??[],Ye.emit("data-table:updated",{tableName:n.tableName,data:V}),Pe.value=V==null?void 0:V.length},{immediate:!0}),Re(Pe,V=>{K(V)}),Re(A,V=>{i("selectData",V),i("update:selectedData",V),Ye.emit("data-table:update-selected-data",{tableName:n.tableName,data:V})},{deep:!0});const Je=()=>{Ye.on("data-table:apply-filter",vt),Ye.on("search-table",Mn),Ye.on("search-by-scan-table",wn),Ye.on("data-table:clear-selected-data",Qi),Ye.on("data-table:select-all-record",Rr),Ye.on("data-table:download",B),Ye.on("data-table:import-excel-to-json",Ze)},Ge=()=>{Ye.off("data-table:update",Ne),Ye.off("data-table:apply-filter",vt),Ye.off("search-table",Mn),Ye.off("search-by-scan-table",wn),Ye.off("data-table:clear-selected-data",Qi),Ye.off("data-table:select-all-record",Rr),Ye.off("data-table:download",B),Ye.off("data-table:import-excel-to-json",Ze)},vt=V=>{V.tableName===n.tableName&&(me.value=V.filter,He())},Mn=V=>{V.tableName===n.tableName&&(se.value=V.search,He())},wn=V=>{V.tableName===n.tableName&&(Ie.value=V.tag,He())},Rr=V=>{V.tableName===n.tableName&&F(V)},Qi=V=>{V.tableName===n.tableName&&(A.value=[])},B=V=>{var ne;(V.tableName===n.tableName||(ne=V.multiTableNames)!=null&&ne.includes(n.tableName))&&Jt(V)},j=V=>{V.code.includes("Digit")||V.code.includes("Numpad")||["ArrowLeft","ArrowRight","Backspace","Delete"].includes(V.code)||V.preventDefault()},K=V=>{const ne=n.includeCheckDisabledRows?0:(Y.value.length||n.totalDisabledRows)??0,Ve={total:(V??Pe.value??0)-ne,tableName:n.tableName};Ye.emit("data-table:update-total-record",Ve)},Ue=()=>{Ye.on("data-table:update",Ne)},Ze=V=>{V.tableName===n.tableName&&(h.value=V.data,ae.value=[...h.value],Pe.value=V.data.length)},Kt=(V,ne,Ve)=>typeof(V==null?void 0:V.confirmDialogProps)=="function"?V==null?void 0:V.confirmDialogProps(ne,Ve):V==null?void 0:V.confirmDialogProps;return(V,ne)=>{var Ve,qe,Wt;return g(),T("div",it(Ot((Ve=x(l))==null?void 0:Ve.root)),[E("div",it(Ot((qe=x(l))==null?void 0:qe.tablewrapper)),[I(x(NL),O({"auto-hide":!1},(Wt=x(l))==null?void 0:Wt.scrollheightwrapper({props:n}),{class:"custom-scrollbar"}),{default:z(()=>{var Qe,Ht,Nt,On,En;return[(g(),T("table",O({id:x(p)},(Qe=x(l))==null?void 0:Qe.table,{key:M.value,ref:b.value}),[E("thead",it(Ot(x(l).thead)),[E("tr",it(Ot(x(l).headerrow)),[V.reorderable&&!xe.value?(g(),T("th",O({key:0},x(l).headercellreorderable,{class:fe().class}),null,16)):N("",!0),V.selectionType==="checkbox"?(g(),T("th",O({key:1},x(l).headercellcheckbox,{class:fe().class}),[I(fs,O((Ht=x(l))==null?void 0:Ht.headercheckbox({context:{isSelectedAll:U.value}}),{"model-value":U.value,"onUpdate:modelValue":ne[0]||(ne[0]=be=>Ut(!!be)),binary:""}),null,16,["model-value"])],16)):N("",!0),V.treeTable?(g(),T("th",O({key:2},x(l).headertoggler,{class:fe().class}),[I(We,O({onClick:dn},x(l).headertogglerbutton({context:{isExpandedAll:X.value}}),{icon:"arrow-down",text:""}),null,16)],16)):N("",!0),(g(!0),T(le,null,_e(S.value,be=>(g(),T("th",O({key:be.field,class:[be.headerClass,be.class],ref_for:!0},fe(be),{onClick:Tn=>be.sortable?Ft(be.field,Tn):null}),[E("span",O({ref_for:!0},x(l).headercellcontent),[E("span",HD,[ht(_(be.header)+" ",1),be.info?(g(),L(Me,{key:0,info:be.info,severity:be.infoSeverity,class:"w-[10px] h-[10px]",icon:"info"},null,8,["info","severity"])):N("",!0)]),be.sortable?(g(),L(Me,{key:0,icon:!Be.value||Be.value!=be.field?"arrow-up-down":xe.value==1?"sort-asc":"sort-desc",class:"text-base"},null,8,["icon"])):N("",!0)],16)],16,jD))),128)),n.customColumn||n.useOption?(g(),T("th",O({key:3},fe(void 0,n.customColumn),{id:`column-visibility-toggle-${x(p)}`,onClick:ne[1]||(ne[1]=(...be)=>{var Tn,Nr;return((Tn=J.value)==null?void 0:Tn.toggleMenu)&&((Nr=J.value)==null?void 0:Nr.toggleMenu(...be))})}),[n.customColumn?(g(),L(Me,O({key:0},x(l).columnvisibilityicon,{icon:"ellipsis-h","tooltip-pos":"left"}),null,16)):N("",!0)],16,UD)):N("",!0)],16)],16),E("tbody",it(Ot((Nt=x(l))==null?void 0:Nt.tbody)),[ke.value?(g(),T("tr",KD,[E("td",O({colspan:Se.value},(On=x(l))==null?void 0:On.bodycell),[(g(!0),T(le,null,_e(x(l).invisiblelottiewrapper?2:1,be=>(g(),T("div",O({key:be,ref_for:!0},be===1?x(l).loadingtablewrapper:x(l).invisiblelottiewrapper),[I(Kl,O({animation:"loading-table",ref_for:!0},x(l).loadingtablelottie),null,16)],16))),128))],16,WD)])):Fe.value?(g(),T("tr",tR,[E("td",O({colspan:Se.value},(En=x(l))==null?void 0:En.bodycell),[(g(!0),T(le,null,_e(x(l).invisiblelottiewrapper?2:1,be=>(g(),T("div",O({key:be,ref_for:!0},be===1?x(l).nodatalottiewrapper:x(l).invisiblelottiewrapper),[I(Kl,O({animation:"no-data",ref_for:!0},x(l).nodatalottie),null,16),a.value.emptyTableMessage?(g(),T("span",O({key:0,ref_for:!0},x(l).nodatamessage),_(a.value.emptyTableMessage),17)):N("",!0)],16))),128))],16,nR)])):(g(!0),T(le,{key:1},_e(H.value,(be,Tn)=>{var Nr,mf,$e,ct,Bt,nn,In,Ii,mr,js,di;return g(),T("tr",O({id:be._id,key:`${Tn}-${be[V.dataKey]}`,draggable:Rt(be),ref_for:!0},(Nr=x(l))==null?void 0:Nr.bodyrow({context:{highlighted:be[V.highlightKey??""],selected:nt(be[V.dataKey]),disabled:De(be[V.dataKey]),draggable:Rt(be),dragging:$.value},props:n}),{onClick:Oe=>cn(Oe,be,Tn),onDblclick:Oe=>{var gr;return V.treeTable&&((gr=be.children)!=null&&gr.length||be.hasChildren)?At(be,Tn):null},onDrag:ne[10]||(ne[10]=Oe=>$.value=!0),onDragenter:xt(Oe=>Yt(Oe,be),["prevent"]),onDragleave:ne[11]||(ne[11]=xt(()=>{},["prevent"])),onDragover:ne[12]||(ne[12]=xt(()=>{},["prevent"])),onDragstart:Oe=>kn(Oe,be,Tn),onDrop:te}),[V.reorderable&&!xe.value?(g(),T("td",O({key:0,ref_for:!0},(mf=x(l))==null?void 0:mf.bodycell),[!be.childRow&&!be.childRowHeader?(g(),L(Me,{key:0,class:"draggableicon",icon:"dragable-menu"})):N("",!0)],16)):N("",!0),V.selectionType==="checkbox"?(g(),T("td",O({key:1,ref_for:!0},($e=x(l))==null?void 0:$e.bodycell,{onClick:ne[3]||(ne[3]=xt(()=>{},["stop"]))}),[!be.childRow&&!be.childRowHeader?(g(),L(fs,O({key:0,ref_for:!0},(ct=x(l))==null?void 0:ct.rowcheckbox,{modelValue:A.value,"onUpdate:modelValue":ne[2]||(ne[2]=Oe=>A.value=Oe),binary:!1,disabled:De(be[V.dataKey]),value:be}),null,16,["modelValue","disabled","value"])):N("",!0)],16)):N("",!0),V.treeTable?(g(),T("td",O({key:2,ref_for:!0},(Bt=x(l))==null?void 0:Bt.bodycell,{onClick:Oe=>{(be.childRow||be.childRowHeader)&&Oe.stopPropagation()}}),[(nn=be.children)!=null&&nn.length||be.hasChildren?(g(),L(We,O({key:0,onClick:xt(Oe=>At(be,Tn),["stop"]),ref_for:!0},x(l).rowtogglerbutton({context:{isRowExpanded:he(be[V.dataKey])}}),{icon:"arrow-down",text:""}),null,16,["onClick"])):N("",!0)],16,XD)):N("",!0),(()=>{var Oe;return be.childRowHeader&&((Oe=n.childTableProps)==null?void 0:Oe.useColumnsHeader)})()?(g(!0),T(le,{key:3},_e(ue.value,Oe=>{var gr,_o;return g(),T("td",{key:Oe.header,class:pe([(gr=x(l))==null?void 0:gr.bodycell.class,"font-semibold text-xs"]),colspan:Oe.colspan??((_o=Oe.parentColumnsFields)==null?void 0:_o.length),onClick:ne[4]||(ne[4]=xt(()=>{},["stop"]))},_(Oe.header),11,GD)}),128)):be.childRowHeader?(g(),T("td",O({key:4,ref_for:!0},x(l).childrowheader,{class:(In=x(l))==null?void 0:In.bodycell.class,colspan:n.columns.length+1,onClick:ne[5]||(ne[5]=xt(()=>{},["stop"]))}),_(be.header),17,ZD)):be.loadingRow?(g(),T("td",{key:5,class:pe((Ii=x(l))==null?void 0:Ii.bodycell.class),colspan:n.columns.length+1,onClick:ne[6]||(ne[6]=xt(()=>{},["stop"]))},[E("div",O({ref_for:!0},x(l).loadingtablewrapper),[I(Kl,O({animation:"loading-table",ref_for:!0},x(l).loadingtablelottie),null,16)],16)],10,_D)):be.noDataRow?(g(),T("td",{key:6,class:pe((mr=x(l))==null?void 0:mr.bodycell.class),colspan:n.columns.length+1,onClick:ne[7]||(ne[7]=xt(()=>{},["stop"]))},[E("div",O({ref_for:!0},x(l).nodatalottiewrapper),[I(Kl,O({animation:"no-data",ref_for:!0},x(l).nodatalottie),null,16),a.value.emptyTableMessage?(g(),T("span",O({key:0,ref_for:!0},x(l).nodatamessage),_(a.value.emptyTableMessage),17)):N("",!0)],16)],10,JD)):(g(),T(le,{key:7},[(g(!0),T(le,null,_e(be.childRow?ue.value:S.value,Oe=>{var gr,_o,zu,gf,vf,yf,bf,Hs,Fu,$i,Af,Va,wt,ju,Vn,en,Us,Br;return g(),T("td",O({key:Oe.field,class:[{"!py-0":Oe.editable,"!px-0":((gr=Oe.preset)==null?void 0:gr.type)==="multirow"},typeof Oe.bodyClass=="function"?Oe.bodyClass(be):Oe.bodyClass,Oe.class],colspan:Oe.colspan??((_o=Oe.parentColumnsFields)==null?void 0:_o.length),ref_for:!0},(zu=x(l))==null?void 0:zu.bodycell),[((gf=Oe.preset)==null?void 0:gf.type)==="toggle"||((vf=Oe.preset)==null?void 0:vf.type)==="checkbox"?(g(),T(le,{key:0},[((yf=Oe.preset)==null?void 0:yf.type)==="toggle"?(g(),L(N0,{key:0,disabled:De(be[V.dataKey])||(typeof((bf=Oe.preset)==null?void 0:bf.disabled)=="function"?(Hs=Oe.preset)==null?void 0:Hs.disabled(be):(Fu=Oe.preset)==null?void 0:Fu.disabled),"input-id":be[V.dataKey],"model-value":x(Hn)(be,Oe.field),onClick:ne[8]||(ne[8]=xt(()=>{},["stop"])),"onUpdate:modelValue":Sn=>{x(ea)(be,Oe.field,Sn),zt(Sn,be,Oe)}},null,8,["disabled","input-id","model-value","onUpdate:modelValue"])):N("",!0),(($i=Oe.preset)==null?void 0:$i.type)==="checkbox"?(g(),L(fs,{key:1,disabled:De(be[V.dataKey])||(typeof((Af=Oe.preset)==null?void 0:Af.disabled)=="function"?(Va=Oe.preset)==null?void 0:Va.disabled(be):(wt=Oe.preset)==null?void 0:wt.disabled),"input-id":be[V.dataKey],"model-value":x(Hn)(be,Oe.field),onClick:ne[9]||(ne[9]=xt(()=>{},["stop"])),"onUpdate:modelValue":Sn=>{x(ea)(be,Oe.field,!!Sn),zt(!!Sn,be,Oe)},binary:""},null,8,["disabled","input-id","model-value","onUpdate:modelValue"])):N("",!0),(ju=Oe.preset)!=null&&ju.confirmDialogProps?(g(),L(cr,O({key:2,list:[be],visible:!!Te.value[be[V.dataKey]+Oe.field],onClose:()=>{var oi,ze,ot;const Sn=()=>x(ea)(be,Oe.field,!x(Hn)(be,Oe.field));((oi=Kt(Oe.preset,be[Oe.field],be))==null?void 0:oi.actionable)==!1&&"onConfirm"in Oe.preset?(ot=(ze=Oe.preset).onConfirm)==null||ot.call(ze,be[Oe.field],be,Sn):Sn()},onConfirm:Sn=>{var oi,ze;return(ze=(oi=Oe.preset)==null?void 0:oi.onConfirm)==null?void 0:ze.call(oi,be[Oe.field],be,()=>x(ea)(be,Oe.field,!x(Hn)(be,Oe.field)))},"onUpdate:visible":Sn=>Te.value[be[V.dataKey]+Oe.field]=Sn,actionable:"",ref_for:!0},Kt(Oe.preset,be[Oe.field],be)),null,16,["list","visible","onClose","onConfirm","onUpdate:visible"])):N("",!0)],64)):((Vn=Oe.preset)==null?void 0:Vn.type)==="multirow"?(g(),L(zD,{key:1,attributes:((Us=(en=Oe.preset)==null?void 0:en.fieldAttributes)==null?void 0:Us.call(en,be))??[]},null,8,["attributes"])):Oe.editable?(g(),T("span",O({key:2,ref_for:!0},x(l).celleditableelement,{contenteditable:Oe.editable,onBlur:Sn=>{V.$emit("cellEdited",{item:be,field:Oe.field,index:Tn,value:Sn.target.innerText})},onKeypress:Sn=>{Oe.numberInputOnly&&j(Sn)}}),_(x(Hn)(be,Oe.field)||"-"),17,QD)):Oe.bodyComponent||Oe.bodyClass||Oe.bodyTemplate||Oe.dateFormatOptions?(g(),T(le,{key:3},[Oe.bodyComponent?(g(),L(yt(Oe.bodyComponent(be,Tn).component),O({key:0,modelValue:Oe.bodyComponent(be,Tn).model,"onUpdate:modelValue":Sn=>Oe.bodyComponent(be,Tn).model=Sn,disabled:Oe.bodyComponent(be,Tn).disabled,ref_for:!0},Oe.bodyComponent(be,Tn).props,Yo(Oe.bodyComponent(be,Tn).events?Oe.bodyComponent(be,Tn).events:{}),{onChange:Sn=>{var oi,ze;return(ze=(oi=Oe.bodyComponent(be,Tn)).onChange)==null?void 0:ze.call(oi,be)},onClick:Sn=>{Oe.bodyComponent(be,Tn).stop!==!1&&Sn.stopPropagation()},"onUpdate:modelValue":Sn=>{var oi,ze;return(ze=(oi=Oe.bodyComponent(be,Tn)).onChange)==null?void 0:ze.call(oi,be)}}),null,16,["modelValue","onUpdate:modelValue","disabled","onChange","onClick"])):(g(),T("span",eR,[Oe.bodyTemplate?(g(),T(le,{key:0},[ht(_(((Br=Oe.bodyTemplate)==null?void 0:Br.call(Oe,be,Tn))||"-"),1)],64)):Oe.dateFormatOptions?(g(),T(le,{key:1},[ht(_(x(Zu)(new Date(x(Hn)(be,Oe.field)),Oe.dateFormatOptions)),1)],64)):(g(),T(le,{key:2},[ht(_(x(Hn)(be,Oe.field)||"-"),1)],64))]))],64)):(g(),T(le,{key:4},[ht(_(x(Hn)(be,Oe.field)??"-"),1)],64))],16,YD)}),128)),(()=>{var Oe;return(V.useOption||J.value)&&!be.childRow||be.childRow&&((Oe=V.childTableProps)==null?void 0:Oe.useOption)})()?(g(),T("td",O({key:0,ref_for:!0,ref_key:"rowSingleActionCell",ref:k},(js=x(l))==null?void 0:js.rowsingleactioncell({props:n,context:{selected:nt(be[V.dataKey]),highlighted:be[V.highlightKey??""]}}),{class:x(l).bodycell.class}),[V.useOption||(di=V.childTableProps)!=null&&di.useOption?(g(),T("div",O({key:0,ref_for:!0},x(l).singleactionwrapper),[I(We,O({id:"button-action-"+be[n.dataKey],ref_for:!0},x(l).singleactionbutton({props:n}),{disabled:V.disableAllRows,onClick:xt(Oe=>tn(Oe,be),["stop"]),icon:"ellipsis-h",outlined:"",size:"small","tooltip-pos":"left",type:"button"}),null,16,["id","disabled","onClick"])],16)):N("",!0)],16)):N("",!0)],64))],16,qD)}),128))],16)],16,FD))]}),_:1},16)],16),V.usePaginator?ft((g(),L(x(Eh),O({key:D.value,rows:ge.value,"onUpdate:rows":ne[13]||(ne[13]=Qe=>ge.value=Qe)},x(l).paginator({context:{totalRecords:Pe.value}}),{"rows-per-page-options":u,"total-records":Pe.value,onPage:gt}),{firstpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-double-arrow-left"})]),lastpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-double-arrow-right"})]),prevpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-arrow-left"})]),nextpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-arrow-right"})]),_:1},16,["rows","total-records"])),[[Zn,!ke.value]]):N("",!0),I(Zp,{id:"single-action-menu",ref_key:"optionMenu",ref:ve,model:V.options,onFocus:x(BL),"append-to":"body","auto-z-index":"",popup:""},null,8,["model","onFocus"]),n.customColumn?(g(),L(gL,{key:y.value,ref_key:"customColumn",ref:J,"visible-columns":S.value,"onUpdate:visibleColumns":ne[14]||(ne[14]=Qe=>S.value=Qe),"default-columns":V.columns.filter(Qe=>Qe.visible!==!1),"table-id":x(p)},null,8,["visible-columns","default-columns","table-id"])):N("",!0),I(aa,{group:"download"})],16)}}}),FA=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},Ph=ce("DataTable",FA(iR,[["__scopeId","data-v-96b7926f"]])),jA=ce("Form",ye({__name:"Form",props:{buttonsTemplate:{},disableSubmit:{type:Boolean},cancelBtnLabel:{default:"Batal"},clearBtnLabel:{default:"Bersihkan Field"},columnPerRow:{},hideFooter:{type:Boolean},hideStayCheckbox:{type:Boolean},invalid:{type:Boolean},resetAfterSubmit:{type:Boolean,default:!0},saveBtnLabel:{default:"Simpan"},submitBtnLabel:{default:"Simpan"},stayCheckboxLabel:{default:"Tetap di halaman ini"},validatorMessage:{default:"Please input all required field!"},validateOnSave:{type:Boolean,default:!1},cancelBtnSeverity:{default:"secondary"},saveBtnSeverity:{default:"success"},submitBtnSeverity:{default:"success"}},emits:["cancel","clear","save","submit"],setup(t,{expose:e,emit:n}){const i=t,r=n;bt(()=>{if(C.value){const ae=i.columnPerRow??1;C.value.style.gridTemplateColumns=`repeat(${ae}, minmax(0, 1fr))`,R()}});const o=dt("preset",{}).form,{handleSubmit:s,values:a,resetForm:l,errors:u,resetField:c,setValues:d,setFieldValue:f,setErrors:p}=Tp(),h=oe(!1),m=re(),v=oe(!1),S=oe(!1),b=oe(0),k=re(),A=oe(!1),w=oe(!1),y=oe(!1),C=re(null),P=re(null);Ks("isSubmitting",A);const R=()=>{var ae;if(k.value){const me=(ae=k.value)==null?void 0:ae.offsetHeight;P.value&&(P.value.style.height=`calc(100% + ${me+20}px)`)}},M=()=>{A.value=!0,y.value=!0,S.value||(v.value=!0)},D=()=>{A.value=!0,w.value=!0,i.validateOnSave?(S.value||(v.value=!0),$()):q()},$=s(ae=>{if(!i.invalid){const me=ve(ae),se={stayAfterSubmit:h.value,formValues:me};w.value?r("save",se):r("submit",se),v.value=!1,w.value=!1,i.resetAfterSubmit&&(b.value+=1,l())}A.value=!1},()=>{A.value=!1}),q=()=>{const ae=ve(a),me={stayAfterSubmit:h.value,formValues:ae};r("save",me),A.value=!1},J=()=>{l(),b.value++,r("clear"),v.value=!1,y.value=!1},ve=ae=>{const me=ae,se=Object.keys(me);for(const Ie of se)typeof me[Ie]=="string"&&(me[Ie]=me[Ie].trim());return me};return Re(a,()=>{y.value=!1},{deep:!0}),e({stayAfterSubmit:h,submit:$,onSubmitClicked:M,onSaveClicked:D,showValidator:v,formElement:m,clearField:J,resetField:c,errors:u,setOuterFieldsWrapperHeight:R,setValues:d,setFieldValue:f,setErrors:p,values:a,isSubmitClicked:y}),(ae,me)=>{var se,Ie,Be,xe,de,ge,Pe,Te,ue,Se,Z,X,U,Y,ke;return g(),T("form",O({ref_key:"formElement",ref:m},(se=x(o))==null?void 0:se.root({props:i}),{onInput:me[2]||(me[2]=Fe=>v.value=!1),onSubmit:me[3]||(me[3]=xt((...Fe)=>x($)&&x($)(...Fe),["prevent"]))}),[E("div",{ref_key:"outerFieldsWrapper",ref:P},[E("div",O({ref_key:"fieldsWrapper",ref:C},(Ie=x(o))==null?void 0:Ie["fields-wrapper"]),[ee(ae.$slots,"fields",{key:b.value,formValues:x(a)})],16)],512),ae.hideFooter?N("",!0):(g(),T("div",O({key:0,ref_key:"footer",ref:k},(Be=x(o))==null?void 0:Be.footer),[ae.hideStayCheckbox?N("",!0):(g(),T("div",it(O({key:0},(xe=x(o))==null?void 0:xe.staycheckbox)),[I(fs,{modelValue:h.value,"onUpdate:modelValue":me[0]||(me[0]=Fe=>h.value=Fe),label:ae.stayCheckboxLabel},null,8,["modelValue","label"])],16)),E("div",O({id:"footer-actions-wrapper"},(de=x(o))==null?void 0:de["action-buttons"]),[ft(I(Rn,O((ge=x(o))==null?void 0:ge["validator-message"],{message:ae.validatorMessage}),null,16,["message"]),[[Zn,v.value||i.invalid]]),E("div",it(Ot((Pe=x(o))==null?void 0:Pe["button-wrapper"])),[(Te=i.buttonsTemplate)!=null&&Te.includes("cancel")?(g(),L(We,O({key:0},(ue=x(o))==null?void 0:ue["cancel-button"],{label:ae.cancelBtnLabel,severity:ae.cancelBtnSeverity,onClick:me[1]||(me[1]=Fe=>ae.$emit("cancel")),"data-test":"cancel-button",text:"",type:"button"}),null,16,["label","severity"])):N("",!0),(Se=i.buttonsTemplate)!=null&&Se.includes("clear")?(g(),L(We,O({key:1},(Z=x(o))==null?void 0:Z["clear-button"],{label:ae.clearBtnLabel,onClick:J,text:"",type:"button"}),null,16,["label"])):N("",!0),(X=i.buttonsTemplate)!=null&&X.includes("save")?(g(),L(We,O({key:2},(U=x(o))==null?void 0:U["save-button"],{label:ae.saveBtnLabel,severity:ae.saveBtnSeverity,onClick:D,outlined:"",type:"button"}),null,16,["label","severity"])):N("",!0),(Y=i.buttonsTemplate)!=null&&Y.includes("submit")?(g(),L(We,O({key:3},(ke=x(o))==null?void 0:ke["submit-button"],{disabled:ae.disableSubmit,label:ae.submitBtnLabel,severity:ae.submitBtnSeverity,onClick:M,type:"submit"}),null,16,["disabled","label","severity"])):N("",!0)],16)],16)],16))],16)}}})),Ih=ce("DialogForm",ye({__name:"DialogForm",props:{buttonsTemplate:{},header:{},visible:{type:Boolean},asideRightWidth:{default:260},class:{},cancelBtnLabel:{},clearBtnLabel:{},closable:{type:Boolean,default:!0},closeOnSubmit:{type:Boolean,default:!0},contentClass:{},dateHeader:{},headerIcon:{},invalid:{type:Boolean},resetAfterSubmit:{type:Boolean,default:!0},severity:{},showStayCheckbox:{type:Boolean,default:void 0},stayCheckboxLabel:{},submitBtnLabel:{},validatorMessage:{},validationFunction:{},width:{default:"small"},disableSubmit:{type:Boolean},columnPerRow:{default:1},hideFooter:{type:Boolean},hideStayCheckbox:{type:Boolean},saveBtnLabel:{},validateOnSave:{type:Boolean},cancelBtnSeverity:{},saveBtnSeverity:{},submitBtnSeverity:{}},emits:["clear","close","hide","show","submit","update:visible"],setup(t,{expose:e,emit:n}){const i=t,r=n,o=ja(),{locale:s}=_t("DialogForm"),a=dt("preset",{}).dialog,l=dt("preset",{}).dialogform,u=re(),c=re(),d=oe(0),f=oe(!1),p=oe(!1),h=re({stayAfterSubmit:!1,formValues:{}}),m=W(()=>{const w=o["aside-right"]&&p.value?i.asideRightWidth:0;return`calc(${{small:400,medium:500,large:572,"semi-xlarge":600,xlarge:800}[i.width]}px + ${w}px)`}),v=()=>{r("update:visible",!1),r("close")},S=()=>{u.value&&!i.invalid&&!i.validatorMessage&&(u.value.onSubmitClicked(),u.value.submit())},b=()=>{u.value&&u.value.clearField(),r("clear")},k=async w=>{i.validationFunction&&await i.validationFunction(w.formValues),!i.invalid&&!i.validatorMessage&&(h.value=w,o.confirm?f.value=!0:A())},A=async w=>{const{stayAfterSubmit:y}=h.value;if(!y&&i.closeOnSubmit&&r("update:visible",!1),o.confirm)try{await(w==null?void 0:w(h.value))}catch(C){console.error(C)}else r("submit",h.value);i.resetAfterSubmit&&b()};return e({form:u,clearField:b,setValues:w=>{var y;(y=u.value)==null||y.setValues(w)},setFieldValue:(w,y,C)=>{var P;(P=u.value)==null||P.setFieldValue(w,y,C)},setErrors:w=>{var y;(y=u.value)==null||y.setErrors(w)}}),(w,y)=>{var C,P,R,M;return g(),L(x(wl),O({ref_key:"dialogForm",ref:c},(C=x(l))==null?void 0:C.root,{class:i.class,closable:w.closable,draggable:!1,header:w.header,pt:{root:{class:[...(P=x(a))==null?void 0:P.root({state:{}}).class,...(R=x(l))==null?void 0:R.root.class],style:(M=x(l))==null?void 0:M.root.style(m.value)}},visible:w.visible,onHide:y[3]||(y[3]=D=>r("hide")),onShow:y[4]||(y[4]=D=>r("show")),"onUpdate:visible":y[5]||(y[5]=D=>r("update:visible",!!D)),modal:""}),{container:z(()=>{var D,$,q,J,ve,ae,me,se,Ie,Be;return[E("div",it(Ot((D=x(l))==null?void 0:D.container(p.value))),[E("section",O(($=x(l))==null?void 0:$.mainsection,{id:"main"}),[E("div",it(Ot((q=x(l))==null?void 0:q.header)),[ee(w.$slots,"header",{},()=>{var xe,de,ge,Pe;return[w.headerIcon?(g(),L(Me,O({key:0},(xe=x(l))==null?void 0:xe.headericon,{icon:w.headerIcon,severity:w.severity,"aria-label":"Header Icon"}),null,16,["icon","severity"])):N("",!0),E("h3",it(Ot((de=x(l))==null?void 0:de.headertitle)),_(w.header),17),w.$slots["aside-right"]?(g(),L(We,O({key:1},(ge=x(l))==null?void 0:ge.expandasidebutton,{label:p.value?x(s).asideRightExpandedButtonLabel:x(s).asideRightCollapsedButtonLabel,onClick:y[0]||(y[0]=Te=>p.value=!p.value),text:""}),null,16,["label"])):N("",!0),w.closable?(g(),L(We,O({key:2,onClick:v},(Pe=x(l))==null?void 0:Pe.closedialog,{icon:"close","icon-class":"w-[22px] h-[22px]",rounded:"",severity:"secondary",text:""}),null,16)):N("",!0)]})],16),I(jA,O((J=x(l))==null?void 0:J.form,{ref_key:"form",ref:u,"buttons-template":w.buttonsTemplate,"column-per-row":w.columnPerRow,"reset-after-submit":w.resetAfterSubmit,onSubmit:k,"hide-footer":""}),{fields:z(({formValues:xe})=>[ee(w.$slots,"fields",{key:d.value,formValues:xe})]),_:3},16,["buttons-template","column-per-row","reset-after-submit"]),ee(w.$slots,"confirm",{hide:()=>f.value=!1,submit:A,visible:f.value}),E("div",it(Ot((ve=x(l))==null?void 0:ve.footer)),[w.showStayCheckbox?(g(),L(fs,O({key:0},(ae=x(l))==null?void 0:ae.staycheckbox,{label:w.stayCheckboxLabel??x(s).stayCheckboxLabel,"model-value":(me=u.value)==null?void 0:me.stayAfterSubmit,"onUpdate:modelValue":y[1]||(y[1]=xe=>u.value&&(u.value.stayAfterSubmit=xe))}),null,16,["label","model-value"])):N("",!0),ft(I(Rn,O((se=x(l))==null?void 0:se.validatormessage,{format:!1,message:w.validatorMessage}),null,16,["message"]),[[Zn,w.invalid&&w.validatorMessage]]),i.buttonsTemplate.length?(g(),T("div",it(O({key:1},(Ie=x(l))==null?void 0:Ie.footerbutton)),[ee(w.$slots,"actionButtons",{submit:S},()=>{var xe,de,ge,Pe,Te,ue;return[(xe=i.buttonsTemplate)!=null&&xe.includes("cancel")?(g(),L(We,O({key:0},(de=x(l))==null?void 0:de.cancelbtn,{label:w.cancelBtnLabel??x(s).cancelBtnLabel,onClick:y[2]||(y[2]=Se=>(r("close"),r("update:visible",!1))),severity:"dark",text:""}),null,16,["label"])):N("",!0),(ge=i.buttonsTemplate)!=null&&ge.includes("clear")?(g(),L(We,O({key:1},(Pe=x(l))==null?void 0:Pe.clearfield,{label:w.clearBtnLabel??x(s).clearBtnLabel,onClick:b,class:"whitespace-nowrap",text:""}),null,16,["label"])):N("",!0),(Te=i.buttonsTemplate)!=null&&Te.includes("submit")?(g(),L(We,O({key:2},(ue=x(l))==null?void 0:ue.savesubmitbutton,{label:w.submitBtnLabel??x(s).submitBtnLabel,severity:i.severity==="primary"?void 0:i.severity??"success",onClick:S}),null,16,["label","severity"])):N("",!0)]})],16)):N("",!0)],16)],16),w.$slots["aside-right"]?(g(),T("aside",it(O({key:0},(Be=x(l))==null?void 0:Be.asidesection(p.value,w.asideRightWidth))),[ee(w.$slots,"aside-right")],16)):N("",!0)],16)]}),_:3},16,["class","closable","header","pt","visible"])}}}));function Qn(t){this.content=t}Qn.prototype={constructor:Qn,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 i=n&&n!=t?this.remove(n):this,r=i.find(t),o=i.content.slice();return r==-1?o.push(n||t,e):(o[r+1]=e,n&&(o[r]=n)),new Qn(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 Qn(n)},addToStart:function(t,e){return new Qn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Qn(n)},addBefore:function(t,e,n){var i=this.remove(e),r=i.content.slice(),o=i.find(t);return r.splice(o==-1?r.length:o,0,e,n),new Qn(r)},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=Qn.from(t),t.size?new Qn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Qn.from(t),t.size?new Qn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Qn.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}},Qn.from=function(t){if(t instanceof Qn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Qn(e)};function HA(t,e,n){for(let i=0;;i++){if(i==t.childCount||i==e.childCount)return t.childCount==e.childCount?null:n;let r=t.child(i),o=e.child(i);if(r==o){n+=r.nodeSize;continue}if(!r.sameMarkup(o))return n;if(r.isText&&r.text!=o.text){for(let s=0;r.text[s]==o.text[s];s++)n++;return n}if(r.content.size||o.content.size){let s=HA(r.content,o.content,n+1);if(s!=null)return s}n+=r.nodeSize}}function UA(t,e,n,i){for(let r=t.childCount,o=e.childCount;;){if(r==0||o==0)return r==o?null:{a:n,b:i};let s=t.child(--r),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,i-=l;continue}if(!s.sameMarkup(a))return{a:n,b:i};if(s.isText&&s.text!=a.text){let u=0,c=Math.min(s.text.length,a.text.length);for(;u<c&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,i--;return{a:n,b:i}}if(s.content.size||a.content.size){let u=UA(s.content,a.content,n-1,i-1);if(u)return u}n-=l,i-=l}}class Ee{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,n,i,r=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&i(l,r+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),i,r+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,i,r){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?r?typeof r=="function"?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&i&&(s?s=!1:o+=i),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,i=e.firstChild,r=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(i)&&(r[r.length-1]=n.withText(n.text+i.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new Ee(r,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let i=[],r=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),i.push(a),r+=a.nodeSize),s=l}return new Ee(i,r)}cutByIndex(e,n){return e==n?Ee.empty:e==0&&n==this.content.length?this:new Ee(this.content.slice(e,n))}replaceChild(e,n){let i=this.content[e];if(i==n)return this;let r=this.content.slice(),o=this.size+n.nodeSize-i.nodeSize;return r[e]=n,new Ee(r,o)}addToStart(e){return new Ee([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ee(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,i=0;n<this.content.length;n++){let r=this.content[n];e(r,i,n),i+=r.nodeSize}}findDiffStart(e,n=0){return HA(this,e,n)}findDiffEnd(e,n=this.size,i=e.size){return UA(this,e,n,i)}findIndex(e,n=-1){if(e==0)return Mc(0,e);if(e==this.size)return Mc(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let i=0,r=0;;i++){let o=this.child(i),s=r+o.nodeSize;if(s>=e)return s==e||n>0?Mc(i+1,s):Mc(i,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Ee.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ee(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ee.empty;let n,i=0;for(let r=0;r<e.length;r++){let o=e[r];i+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(n||(n=e.slice(0,r)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Ee(n||e,i)}static from(e){if(!e)return Ee.empty;if(e instanceof Ee)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ee([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ee.empty=new Ee([],0);const Lh={index:0,offset:0};function Mc(t,e){return Lh.index=t,Lh.offset=e,Lh}function Ec(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 i=0;i<t.length;i++)if(!Ec(t[i],e[i]))return!1}else{for(let i in t)if(!(i in e)||!Ec(t[i],e[i]))return!1;for(let i in e)if(!(i in t))return!1}return!0}let un=class Cv{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,i=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!i&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,r)),n.push(this),i=!0),n&&n.push(o)}}return n||(n=e.slice()),i||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&&Ec(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 i=e.marks[n.type];if(!i)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=i.create(n.attrs);return i.checkAttrs(r.attrs),r}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(n[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cv.none;if(e instanceof Cv)return[e];let n=e.slice();return n.sort((i,r)=>i.type.rank-r.type.rank),n}};un.none=[];class Pc extends Error{}class Xe{constructor(e,n,i){this.content=e,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let i=WA(this.content,e+this.openStart,n);return i&&new Xe(i,this.openStart,this.openEnd)}removeBetween(e,n){return new Xe(KA(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 Xe.empty;let i=n.openStart||0,r=n.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Xe(Ee.fromJSON(e,n.content),i,r)}static maxOpen(e,n=!0){let i=0,r=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)i++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)r++;return new Xe(e,i,r)}}Xe.empty=new Xe(Ee.empty,0,0);function KA(t,e,n){let{index:i,offset:r}=t.findIndex(e),o=t.maybeChild(i),{index:s,offset:a}=t.findIndex(n);if(r==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(i!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(i,o.copy(KA(o.content,e-r-1,n-r-1)))}function WA(t,e,n,i){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=WA(s.content,e-o-1,n);return a&&t.replaceChild(r,s.copy(a))}function rR(t,e,n){if(n.openStart>t.depth)throw new Pc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Pc("Inconsistent open depths");return qA(t,e,n,0)}function qA(t,e,n,i){let r=t.index(i),o=t.node(i);if(r==e.index(i)&&i<t.depth-n.openStart){let s=qA(t,e,n,i+1);return o.copy(o.content.replaceChild(r,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==i&&e.depth==i){let s=t.parent,a=s.content;return gs(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=oR(n,t);return gs(o,GA(t,s,a,e,i))}else return gs(o,Ic(t,e,i))}function XA(t,e){if(!e.type.compatibleContent(t.type))throw new Pc("Cannot join "+e.type.name+" onto "+t.type.name)}function Dh(t,e,n){let i=t.node(n);return XA(i,e.node(n)),i}function ms(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 Wl(t,e,n,i){let r=(e||t).node(n),o=0,s=e?e.index(n):r.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(ms(t.nodeAfter,i),o++));for(let a=o;a<s;a++)ms(r.child(a),i);e&&e.depth==n&&e.textOffset&&ms(e.nodeBefore,i)}function gs(t,e){return t.type.checkContent(e),t.copy(e)}function GA(t,e,n,i,r){let o=t.depth>r&&Dh(t,e,r+1),s=i.depth>r&&Dh(n,i,r+1),a=[];return Wl(null,t,r,a),o&&s&&e.index(r)==n.index(r)?(XA(o,s),ms(gs(o,GA(t,e,n,i,r+1)),a)):(o&&ms(gs(o,Ic(t,e,r+1)),a),Wl(e,n,r,a),s&&ms(gs(s,Ic(n,i,r+1)),a)),Wl(i,null,r,a),new Ee(a)}function Ic(t,e,n){let i=[];if(Wl(null,t,n,i),t.depth>n){let r=Dh(t,e,n+1);ms(gs(r,Ic(t,e,n+1)),i)}return Wl(e,null,n,i),new Ee(i)}function oR(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(Ee.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class ql{constructor(e,n,i){this.pos=e,this.path=n,this.parentOffset=i,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 i=this.pos-this.path[this.path.length-1],r=e.child(n);return i?e.child(n).cut(i):r}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 i=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)r+=i.child(o).nodeSize;return r}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return un.none;if(this.textOffset)return e.child(n).marks;let i=e.maybeChild(n-1),r=e.maybeChild(n);if(!i){let a=i;i=r,r=a}let o=i.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!r||!o[s].isInSet(r.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!r||!i[o].isInSet(r.marks))&&(i=i[o--].removeFromSet(i));return i}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 i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!n||n(this.node(i))))return new Lc(this,e,i);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 i=[],r=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(i.push(s,a,r+l),!u||(s=s.child(a),s.isText))break;o=u-1,r+=l+1}return new ql(n,i,o)}static resolveCached(e,n){let i=ZA.get(e);if(i)for(let o=0;o<i.elts.length;o++){let s=i.elts[o];if(s.pos==n)return s}else ZA.set(e,i=new sR);let r=i.elts[i.i]=ql.resolve(e,n);return i.i=(i.i+1)%aR,r}}class sR{constructor(){this.elts=[],this.i=0}}const aR=12,ZA=new WeakMap;class Lc{constructor(e,n,i){this.$from=e,this.$to=n,this.depth=i}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 lR=Object.create(null);let xo=class kv{constructor(e,n,i,r=un.none){this.type=e,this.attrs=n,this.marks=r,this.content=i||Ee.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,i,r=0){this.content.nodesBetween(e,n,i,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,i,r){return this.content.textBetween(e,n,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,i){return this.type==e&&Ec(this.attrs,n||e.defaultAttrs||lR)&&un.sameSet(this.marks,i||un.none)}copy(e=null){return e==this.content?this:new kv(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new kv(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,i=!1){if(e==n)return Xe.empty;let r=this.resolve(e),o=this.resolve(n),s=i?0:r.sharedDepth(n),a=r.start(s),u=r.node(s).content.cut(r.pos-a,o.pos-a);return new Xe(u,r.depth-s,o.depth-s)}replace(e,n,i){return rR(this.resolve(e),this.resolve(n),i)}nodeAt(e){for(let n=this;;){let{index:i,offset:r}=n.content.findIndex(e);if(n=n.maybeChild(i),!n)return null;if(r==e||n.isText)return n;e-=r+1}}childAfter(e){let{index:n,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(n),index:n,offset:i};let r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}}resolve(e){return ql.resolveCached(this,e)}resolveNoCache(e){return ql.resolve(this,e)}rangeHasMark(e,n,i){let r=!1;return n>e&&this.nodesBetween(e,n,o=>(i.isInSet(o.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),_A(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,i=Ee.empty,r=0,o=i.childCount){let s=this.contentMatchAt(e).matchFragment(i,r,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=r;l<o;l++)if(!this.type.allowsMarks(i.child(l).marks))return!1;return!0}canReplaceWith(e,n,i,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(i),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=un.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!un.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 i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=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,i)}let r=Ee.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,r,i);return o.type.checkAttrs(o.attrs),o}};xo.prototype.text=void 0;class Dc extends xo{constructor(e,n,i,r){if(super(e,n,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):_A(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 Dc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Dc(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 _A(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class vs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let i=new uR(e,n);if(i.next==null)return vs.empty;let r=JA(i);i.next&&i.err("Unexpected trailing text");let o=gR(mR(r));return vR(o,i),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,i=e.childCount){let r=this;for(let o=n;r&&o<i;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type: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 i=0;i<e.next.length;i++)if(this.next[n].type==e.next[i].type)return!0;return!1}fillBefore(e,n=!1,i=0){let r=[this];function o(s,a){let l=s.matchFragment(e,i);if(l&&(!n||l.validEnd))return Ee.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&r.indexOf(d)==-1){r.push(d);let f=o(d,a.concat(c));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),o=r.match;if(o.matchType(e)){let s=[];for(let a=r;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!r.type||l.validEnd)&&(i.push({match:a.contentMatch,type:a,via:r}),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(i){e.push(i);for(let r=0;r<i.next.length;r++)e.indexOf(i.next[r].next)==-1&&n(i.next[r].next)}return n(this),e.map((i,r)=>{let o=r+(i.validEnd?"*":" ")+" ";for(let s=0;s<i.next.length;s++)o+=(s?", ":"")+i.next[s].type.name+"->"+e.indexOf(i.next[s].next);return o}).join(`
208
+ `)}}vs.empty=new vs(!0);class uR{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 JA(t){let e=[];do e.push(cR(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function cR(t){let e=[];do e.push(dR(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function dR(t){let e=hR(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=fR(t,e);else break;return e}function YA(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function fR(t,e){let n=YA(t),i=n;return t.eat(",")&&(t.next!="}"?i=YA(t):i=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:e}}function pR(t,e){let n=t.nodeTypes,i=n[e];if(i)return[i];let r=[];for(let o in n){let s=n[o];s.isInGroup(e)&&r.push(s)}return r.length==0&&t.err("No node type or group '"+e+"' found"),r}function hR(t){if(t.eat("(")){let e=JA(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=pR(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 mR(t){let e=[[]];return r(o(t,0),n()),e;function n(){return e.push([])-1}function i(s,a,l){let u={term:l,to:a};return e[s].push(u),u}function r(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;r(u,a=n())}else if(s.type=="star"){let l=n();return i(a,l),r(o(s.expr,l),l),[i(l)]}else if(s.type=="plus"){let l=n();return r(o(s.expr,a),l),r(o(s.expr,l),l),[i(l)]}else{if(s.type=="opt")return[i(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u<s.min;u++){let c=n();r(o(s.expr,l),c),l=c}if(s.max==-1)r(o(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let c=n();i(l,c),r(o(s.expr,l),c),l=c}return[i(l)]}else{if(s.type=="name")return[i(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function QA(t,e){return e-t}function e2(t,e){let n=[];return i(e),n.sort(QA);function i(r){let o=t[r];if(o.length==1&&!o[0].term)return i(o[0].to);n.push(r);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&i(l)}}}function gR(t){let e=Object.create(null);return n(e2(t,0));function n(i){let r=[];i.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c<r.length;c++)r[c][0]==a&&(u=r[c][1]);e2(t,l).forEach(c=>{u||r.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[i.join(",")]=new vs(i.indexOf(t.length-1)>-1);for(let s=0;s<r.length;s++){let a=r[s][1].sort(QA);o.next.push({type:r[s][0],next:e[a.join(",")]||n(a)})}return o}}function vR(t,e){for(let n=0,i=[t];n<i.length;n++){let r=i[n],o=!r.validEnd,s=[];for(let a=0;a<r.next.length;a++){let{type:l,next:u}=r.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),i.indexOf(u)==-1&&i.push(u)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function t2(t){let e=Object.create(null);for(let n in t){let i=t[n];if(!i.hasDefault)return null;e[n]=i.default}return e}function n2(t,e){let n=Object.create(null);for(let i in t){let r=e&&e[i];if(r===void 0){let o=t[i];if(o.hasDefault)r=o.default;else throw new RangeError("No value supplied for attribute "+i)}n[i]=r}return n}function i2(t,e,n,i){for(let r in e)if(!(r in t))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let r in t){let o=t[r];o.validate&&o.validate(e[r])}}function r2(t,e){let n=Object.create(null);if(e)for(let i in e)n[i]=new bR(t,i,e[i]);return n}let o2=class jC{constructor(e,n,i){this.name=e,this.schema=n,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=r2(e,i.attrs),this.defaultAttrs=t2(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==vs.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:n2(this.attrs,e)}create(e=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new xo(this,this.computeAttrs(e),Ee.from(n),un.setFrom(i))}createChecked(e=null,n,i){return n=Ee.from(n),this.checkContent(n),new xo(this,this.computeAttrs(e),n,un.setFrom(i))}createAndFill(e=null,n,i){if(e=this.computeAttrs(e),n=Ee.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let r=this.contentMatch.matchFragment(n),o=r&&r.fillBefore(Ee.empty,!0);return o?new xo(this,e,n.append(o),un.setFrom(i)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).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){i2(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 i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?n&&n.push(e[i]):n||(n=e.slice(0,i));return n?n.length?n:un.none:e}static compile(e,n){let i=Object.create(null);e.forEach((o,s)=>i[o]=new jC(o,n,s));let r=n.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let o in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function yR(t,e,n){let i=n.split("|");return r=>{let o=r===null?"null":typeof r;if(i.indexOf(o)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${t}, got ${o}`)}}class bR{constructor(e,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?yR(e,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Rc{constructor(e,n,i,r){this.name=e,this.rank=n,this.schema=i,this.spec=r,this.attrs=r2(e,r.attrs),this.excluded=null;let o=t2(this.attrs);this.instance=o?new un(this,o):null}create(e=null){return!e&&this.instance?this.instance:new un(this,n2(this.attrs,e))}static compile(e,n){let i=Object.create(null),r=0;return e.forEach((o,s)=>i[o]=new Rc(o,r++,n,s)),i}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){i2(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class s2{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in e)n[r]=e[r];n.nodes=Qn.from(e.nodes),n.marks=Qn.from(e.marks||{}),this.nodes=o2.compile(this.spec.nodes,this),this.marks=Rc.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let o=this.nodes[r],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=i[s]||(i[s]=vs.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?a2(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let r in this.marks){let o=this.marks[r],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:a2(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,i,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof o2){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,i,r)}text(e,n){let i=this.nodes.text;return new Dc(i,i.defaultAttrs,e,un.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return xo.fromJSON(this,e)}markFromJSON(e){return un.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function a2(t,e){let n=[];for(let i=0;i<e.length;i++){let r=e[i],o=t.marks[r],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(r=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(r)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return n}function AR(t){return t.tag!=null}function wR(t){return t.style!=null}class Mo{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(r=>{if(AR(r))this.tags.push(r);else if(wR(r)){let o=/[^=]*/.exec(r.style)[0];i.indexOf(o)<0&&i.push(o),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let i=new d2(this,n,!1);return i.addAll(e,un.none,n.from,n.to),i.finish()}parseSlice(e,n={}){let i=new d2(this,n,!0);return i.addAll(e,un.none,n.from,n.to),Xe.maxOpen(i.finish())}matchTag(e,n,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let o=this.tags[r];if(kR(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,i,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!i.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function i(r){let o=r.priority==null?50:r.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,r)}for(let r in e.marks){let o=e.marks[r].spec.parseDOM;o&&o.forEach(s=>{i(s=f2(s)),s.mark||s.ignore||s.clearMark||(s.mark=r)})}for(let r in e.nodes){let o=e.nodes[r].spec.parseDOM;o&&o.forEach(s=>{i(s=f2(s)),s.node||s.ignore||s.mark||(s.node=r)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mo(e,Mo.schemaRules(e)))}}const l2={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},SR={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},u2={ol:!0,ul:!0},Xl=1,Rh=2,Nc=4;function c2(t,e,n){return e!=null?(e?Xl:0)|(e==="full"?Rh:0):t&&t.whitespace=="pre"?Xl|Rh:n&-5}class Bc{constructor(e,n,i,r,o,s){this.type=e,this.attrs=n,this.marks=i,this.solid=r,this.options=s,this.content=[],this.activeMarks=un.none,this.match=o||(s&Nc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Ee.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(e.type))?(this.match=i,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Xl)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let o=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-r[0].length))}}let n=Ee.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Ee.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&&!l2.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class d2{constructor(e,n,i){this.parser=e,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=n.topNode,o,s=c2(null,n.preserveWhitespace,0)|(i?Nc:0);r?o=new Bc(r.type,r.attrs,un.none,!0,n.topMatch||r.type.contentMatch,s):i?o=new Bc(null,null,un.none,!0,null,s):o=new Bc(e.schema.topNodeType,null,un.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 i=e.nodeValue,r=this.top,o=r.options&Rh?"full":this.localPreserveWS||(r.options&Xl)>0;if(o==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(o)o!=="full"?i=i.replace(/\r?\n|\r/g," "):i=i.replace(/\r\n?/g,`
209
+ `);else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let s=r.content[r.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(i=i.slice(1))}i&&this.insertNode(this.parser.schema.text(i),n,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,n,i){let r=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;u2.hasOwnProperty(s)&&this.parser.normalizeLists&&CR(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,i));e:if(l?l.ignore:SR.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(l2.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(o),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=r}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
210
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let i=e.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let o=this.parser.matchedStyles[r],s=i.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,i,r){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),i,e.nodeName=="BR")||this.leafFallback(e,i);else{let l=this.enter(s,n.attrs||null,i,n.preserveWhitespace);l&&(o=!0,i=l)}else{let l=this.parser.schema.marks[n.mark];i=i.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,i,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,i,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,i),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,i,r){let o=i||0;for(let s=i?e.childNodes[i]:e.firstChild,a=r==null?null:e.childNodes[r];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n,i){let r,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!r||r.length>u.length+a)&&(r=u,o=l,!u.length))break;if(l.solid){if(i)break;a+=2}}if(!r)return null;this.sync(o);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(e,n,i){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n,i);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=un.none;for(let a of r.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):p2(a.type,e.type))&&(s=a.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,n,i,r){let o=this.findPlace(e.create(n),i,!1);return o&&(o=this.enterInner(e,n,i,!0,r)),o}enterInner(e,n,i,r=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=c2(e,o,s.options);s.options&Nc&&s.content.length==0&&(a|=Nc);let l=un.none;return i=i.filter(u=>(s.type?s.type.allowsMarkType(u.type):p2(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Bc(e,n,l,r,null,a)),this.open++,i}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|=Xl)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let r=i.length-1;r>=0;r--)e+=i[r].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==n&&(this.find[i].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,i){if(e!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].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("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),o=-(i?i.depth+1:0)+(r?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&r?this.nodes[l].type:i&&l>=o?i.node(l-o).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function CR(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let i=e.nodeType==1?e.nodeName.toLowerCase():null;i&&u2.hasOwnProperty(i)&&n?(n.appendChild(e),e=n):i=="li"?n=e:i&&(n=null)}}function kR(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function f2(t){let e={};for(let n in t)e[n]=t[n];return e}function p2(t,e){let n=e.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||o.indexOf(c)<0&&s(c))return!0}};if(s(r.contentMatch))return!0}}class ys{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},i){i||(i=Nh(n).createDocumentFragment());let r=i,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)r=o.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,n);c&&(o.push([u,r]),r.appendChild(c.dom),r=c.contentDOM||c.dom)}}r.appendChild(this.serializeNodeInner(s,n))}),i}serializeNodeInner(e,n){let{dom:i,contentDOM:r}=$c(Nh(n),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,r)}return i}serializeNode(e,n={}){let i=this.serializeNodeInner(e,n);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(i),i=o.dom)}return i}serializeMark(e,n,i={}){let r=this.marks[e.type.name];return r&&$c(Nh(i),r(e,n),null,e.attrs)}static renderSpec(e,n,i=null,r){return $c(e,n,i,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ys(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=h2(e.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(e){return h2(e.marks)}}function h2(t){let e={};for(let n in t){let i=t[n].spec.toDOM;i&&(e[n]=i)}return e}function Nh(t){return t.document||window.document}const m2=new WeakMap;function OR(t){let e=m2.get(t);return e===void 0&&m2.set(t,e=TR(t)),e}function TR(t){let e=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")e||(e=[]),e.push(i);else for(let r=0;r<i.length;r++)n(i[r]);else for(let r in i)n(i[r])}return n(t),e}function $c(t,e,n,i){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 r=e[0],o;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(o=OR(i))&&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=r.indexOf(" ");s>0&&(n=r.slice(0,s),r=r.slice(s+1));let a,l=n?t.createElementNS(n,r):t.createElement(r),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:h}=$c(t,f,n,i);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}const g2=65535,v2=Math.pow(2,16);function xR(t,e){return t+e*v2}function y2(t){return t&g2}function MR(t){return(t-(t&g2))/v2}const b2=1,A2=2,Vc=4,w2=8;class Bh{constructor(e,n,i){this.pos=e,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&w2)>0}get deletedBefore(){return(this.delInfo&(b2|Vc))>0}get deletedAfter(){return(this.delInfo&(A2|Vc))>0}get deletedAcross(){return(this.delInfo&Vc)>0}}class Di{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Di.empty)return Di.empty}recover(e){let n=0,i=y2(e);if(!this.inverted)for(let r=0;r<i;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+n+MR(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,i){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let f=u?e==l?-1:e==d?1:n:n,p=l+r+(f<0?0:c);if(i)return p;let h=e==(n<0?l:d)?null:xR(a/3,e-l),m=e==l?A2:e==d?b2:Vc;return(n<0?e!=l:e!=d)&&(m|=w2),new Bh(p,m,h)}r+=c-u}return i?e+r:new Bh(e+r,0,null)}touches(e,n){let i=0,r=y2(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=l+u;if(e<=c&&a==r*3)return!0;i+=this.ranges[a+s]-u}return!1}forEach(e){let n=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let s=this.ranges[r],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[r+n],c=this.ranges[r+i];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Di(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Di.empty:new Di(e<0?[0,-e,0]:[0,0,e])}}Di.empty=new Di([]);class Gl{constructor(e,n,i=0,r=e?e.length:0){this.mirror=n,this.from=i,this.to=r,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Gl(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,i=this._maps.length;n<e._maps.length;n++){let r=e.getMirror(n);this.appendMap(e._maps[n],r!=null&&r<n?i+r: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,i=this._maps.length+e._maps.length;n>=0;n--){let r=e.getMirror(n);this.appendMap(e._maps[n].invert(),r!=null&&r>n?i-r-1:void 0)}}invert(){let e=new Gl;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let i=this.from;i<this.to;i++)e=this._maps[i].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,i){let r=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}r|=a.delInfo,e=a.pos}return i?e:new Bh(e,r,null)}}const $h=Object.create(null);class li{getMap(){return Di.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=$h[n.stepType];if(!i)throw new RangeError(`No step type ${n.stepType} defined`);return i.fromJSON(e,n)}static jsonID(e,n){if(e in $h)throw new RangeError("Duplicate use of step JSON ID "+e);return $h[e]=n,n.prototype.jsonID=e,n}}class Nn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Nn(e,null)}static fail(e){return new Nn(null,e)}static fromReplace(e,n,i,r){try{return Nn.ok(e.replace(n,i,r))}catch(o){if(o instanceof Pc)return Nn.fail(o.message);throw o}}}function Vh(t,e,n){let i=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(Vh(o.content,e,o))),o.isInline&&(o=e(o,n,r)),i.push(o)}return Ee.fromArray(i)}class Eo extends li{constructor(e,n,i){super(),this.from=e,this.to=n,this.mark=i}apply(e){let n=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),o=new Xe(Vh(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),r),n.openStart,n.openEnd);return Nn.fromReplace(e,this.from,this.to,o)}invert(){return new wr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Eo(n.pos,i.pos,this.mark)}merge(e){return e instanceof Eo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Eo(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 Eo(n.from,n.to,e.markFromJSON(n.mark))}}li.jsonID("addMark",Eo);class wr extends li{constructor(e,n,i){super(),this.from=e,this.to=n,this.mark=i}apply(e){let n=e.slice(this.from,this.to),i=new Xe(Vh(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),e),n.openStart,n.openEnd);return Nn.fromReplace(e,this.from,this.to,i)}invert(){return new Eo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new wr(n.pos,i.pos,this.mark)}merge(e){return e instanceof wr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wr(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 wr(n.from,n.to,e.markFromJSON(n.mark))}}li.jsonID("removeMark",wr);class Po extends li{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nn.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Nn.fromReplace(e,this.pos,this.pos+1,new Xe(Ee.from(i),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(i))return new Po(this.pos,n.marks[r]);return new Po(this.pos,this.mark)}}return new bs(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Po(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 Po(n.pos,e.markFromJSON(n.mark))}}li.jsonID("addNodeMark",Po);class bs extends li{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nn.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Nn.fromReplace(e,this.pos,this.pos+1,new Xe(Ee.from(i),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Po(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new bs(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 bs(n.pos,e.markFromJSON(n.mark))}}li.jsonID("removeNodeMark",bs);class Un extends li{constructor(e,n,i,r=!1){super(),this.from=e,this.to=n,this.slice=i,this.structure=r}apply(e){return this.structure&&zh(e,this.from,this.to)?Nn.fail("Structure replace would overwrite content"):Nn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Di([this.from,this.to-this.from,this.slice.size])}invert(e){return new Un(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deletedAcross&&i.deletedAcross?null:new Un(n.pos,Math.max(n.pos,i.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Un)||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?Xe.empty:new Xe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Un(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?Xe.empty:new Xe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Un(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 Un(n.from,n.to,Xe.fromJSON(e,n.slice),!!n.structure)}}li.jsonID("replace",Un);class Kn extends li{constructor(e,n,i,r,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(zh(e,this.from,this.gapFrom)||zh(e,this.gapTo,this.to)))return Nn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Nn.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,n.content);return i?Nn.fromReplace(e,this.from,this.to,i):Nn.fail("Content does not fit in gap")}getMap(){return new Di([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 Kn(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),i=e.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?i.pos:e.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||r<n.pos||o>i.pos?null:new Kn(n.pos,i.pos,r,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 Kn(n.from,n.to,n.gapFrom,n.gapTo,Xe.fromJSON(e,n.slice),n.insert,!!n.structure)}}li.jsonID("replaceAround",Kn);function zh(t,e,n){let i=t.resolve(e),r=n-e,o=i.depth;for(;r>0&&o>0&&i.indexAfter(o)==i.node(o).childCount;)o--,r--;if(r>0){let s=i.node(o).maybeChild(i.indexAfter(o));for(;r>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,r--}}return!1}function ER(t,e,n,i){let r=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,n),h=i.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(h)||(s&&s.to==f&&s.mark.eq(d[m])?s.to=p:r.push(s=new wr(f,p,d[m])));a&&a.to==f?a.to=p:o.push(a=new Eo(f,p,i))}}),r.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function PR(t,e,n,i){let r=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(i instanceof Rc){let u=s.marks,c;for(;c=i.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(s.marks)&&(l=[i]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],f;for(let p=0;p<r.length;p++){let h=r[p];h.step==o-1&&d.eq(r[p].style)&&(f=h)}f?(f.to=u,f.step=o):r.push({style:d,from:Math.max(a,e),to:u,step:o})}}}),r.forEach(s=>t.step(new wr(s.from,s.to,s.style)))}function Fh(t,e,n,i=n.contentMatch,r=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let u=o.child(l),c=a+u.nodeSize,d=i.matchType(u.type);if(!d)s.push(new Un(a,c,Xe.empty));else{i=d;for(let f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||t.step(new wr(a,c,u.marks[f]));if(r&&u.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(u.text);)h||(h=new Xe(Ee.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new Un(a+f.index,a+f.index+f[0].length,h))}}a=c}if(!i.validEnd){let l=i.fillBefore(Ee.empty,!0);t.replace(a,a,new Xe(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function IR(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ca(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let i=t.depth;;--i){let r=t.$from.node(i),o=t.$from.index(i),s=t.$to.indexAfter(i);if(i<t.depth&&r.canReplace(o,s,n))return i;if(i==0||r.type.spec.isolating||!IR(r,o,s))break}return null}function LR(t,e,n){let{$from:i,$to:r,depth:o}=e,s=i.before(o+1),a=r.after(o+1),l=s,u=a,c=Ee.empty,d=0;for(let h=o,m=!1;h>n;h--)m||i.index(h)>0?(m=!0,c=Ee.from(i.node(h).copy(c)),d++):l--;let f=Ee.empty,p=0;for(let h=o,m=!1;h>n;h--)m||r.after(h+1)<r.end(h)?(m=!0,f=Ee.from(r.node(h).copy(f)),p++):u++;t.step(new Kn(l,u,s,a,new Xe(c.append(f),d,p),c.size-d,!0))}function jh(t,e,n=null,i=t){let r=DR(t,e),o=r&&RR(i,e);return o?r.map(S2).concat({type:e,attrs:n}).concat(o.map(S2)):null}function S2(t){return{type:t,attrs:null}}function DR(t,e){let{parent:n,startIndex:i,endIndex:r}=t,o=n.contentMatchAt(i).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(i,r,s)?o:null}function RR(t,e){let{parent:n,startIndex:i,endIndex:r}=t,o=n.child(i),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let u=i;l&&u<r;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function NR(t,e,n){let i=Ee.empty;for(let s=n.length-1;s>=0;s--){if(i.size){let a=n[s].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Ee.from(n[s].type.create(n[s].attrs,i))}let r=e.start,o=e.end;t.step(new Kn(r,o,r,o,new Xe(i,0,0),n.length,!0))}function BR(t,e,n,i,r){if(!i.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 l=typeof r=="function"?r(s):r;if(s.isTextblock&&!s.hasMarkup(i,l)&&$R(t.doc,t.mapping.slice(o).map(a),i)){let u=null;if(i.schema.linebreakReplacement){let p=i.whitespace=="pre",h=!!i.contentMatch.matchType(i.schema.linebreakReplacement);p&&!h?u=!1:!p&&h&&(u=!0)}u===!1&&k2(t,s,a,o),Fh(t,t.mapping.slice(o).map(a,1),i,void 0,u===null);let c=t.mapping.slice(o),d=c.map(a,1),f=c.map(a+s.nodeSize,1);return t.step(new Kn(d,f,d+1,f-1,new Xe(Ee.from(i.create(l,null,s.marks)),0,0),1,!0)),u===!0&&C2(t,s,a,o),!1}})}function C2(t,e,n,i){e.forEach((r,o)=>{if(r.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(r.text);){let l=t.mapping.slice(i).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function k2(t,e,n,i){e.forEach((r,o)=>{if(r.type==r.type.schema.linebreakReplacement){let s=t.mapping.slice(i).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
211
+ `))}})}function $R(t,e,n){let i=t.resolve(e),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}function VR(t,e,n,i,r){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(i,null,r||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 Kn(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Xe(Ee.from(s),0,0),1,!0))}function Gr(t,e,n=1,i){let r=t.resolve(e),o=r.depth-n,s=i&&i[i.length-1]||r.parent;if(o<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!s.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,c=n-2;u>o;u--,c--){let d=r.node(u),f=r.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=i&&i[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=r.indexAfter(o),l=i&&i[0];return r.node(o).canReplaceWith(a,a,l?l.type:r.node(o+1).type)}function zR(t,e,n=1,i){let r=t.doc.resolve(e),o=Ee.empty,s=Ee.empty;for(let a=r.depth,l=r.depth-n,u=n-1;a>l;a--,u--){o=Ee.from(r.node(a).copy(o));let c=i&&i[u];s=Ee.from(c?c.type.create(c.attrs,s):r.node(a).copy(s))}t.step(new Un(e,e,new Xe(o.append(s),n,n),!0))}function Io(t,e){let n=t.resolve(e),i=n.index();return O2(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function FR(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:i}=t.type.schema;for(let r=0;r<e.childCount;r++){let o=e.child(r),s=o.type==i?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function O2(t,e){return!!(t&&e&&!t.isLeaf&&FR(t,e))}function zc(t,e,n=-1){let i=t.resolve(e);for(let r=i.depth;;r--){let o,s,a=i.index(r);if(r==i.depth?(o=i.nodeBefore,s=i.nodeAfter):n>0?(o=i.node(r+1),a++,s=i.node(r).maybeChild(a)):(o=i.node(r).maybeChild(a-1),s=i.node(r+1)),o&&!o.isTextblock&&O2(o,s)&&i.node(r).canReplace(a,a+1))return e;if(r==0)break;e=n<0?i.before(r):i.after(r)}}function jR(t,e,n){let i=null,{linebreakReplacement:r}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(r&&s.inlineContent){let c=s.whitespace=="pre",d=!!s.contentMatch.matchType(r);c&&!d?i=!1:!c&&d&&(i=!0)}let a=t.steps.length;if(i===!1){let c=t.doc.resolve(e+n);k2(t,c.node(),c.before(),a)}s.inlineContent&&Fh(t,e+n-1,s,o.node().contentMatchAt(o.index()),i==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Un(u,l.map(e+n,-1),Xe.empty,!0)),i===!0){let c=t.doc.resolve(u);C2(t,c.node(),c.before(),t.steps.length)}return t}function HR(t,e,n){let i=t.resolve(e);if(i.parent.canReplaceWith(i.index(),i.index(),n))return e;if(i.parentOffset==0)for(let r=i.depth-1;r>=0;r--){let o=i.index(r);if(i.node(r).canReplaceWith(o,o,n))return i.before(r+1);if(o>0)return null}if(i.parentOffset==i.parent.content.size)for(let r=i.depth-1;r>=0;r--){let o=i.indexAfter(r);if(i.node(r).canReplaceWith(o,o,n))return i.after(r+1);if(o<i.node(r).childCount)return null}return null}function UR(t,e,n){let i=t.resolve(e);if(!n.content.size)return e;let r=n.content;for(let o=0;o<n.openStart;o++)r=r.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=i.depth;s>=0;s--){let a=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,l=i.index(s)+(a>0?1:0),u=i.node(s),c=!1;if(o==1)c=u.canReplace(l,l,r);else{let d=u.contentMatchAt(l).findWrapping(r.firstChild.type);c=d&&u.canReplaceWith(l,l,d[0])}if(c)return a==0?i.pos:a<0?i.before(s+1):i.after(s+1)}return null}function Fc(t,e,n=e,i=Xe.empty){if(e==n&&!i.size)return null;let r=t.resolve(e),o=t.resolve(n);return T2(r,o,i)?new Un(e,n,i):new KR(r,o,i).fit()}function T2(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class KR{constructor(e,n,i){this.$from=e,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=Ee.empty;for(let r=0;r<=e.depth;r++){let o=e.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=Ee.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(e<0?this.$to:i.doc.resolve(e));if(!r)return null;let o=this.placed,s=i.depth,a=r.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new Xe(o,s,a);return e>-1?new Kn(i.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||i.pos!=this.$to.pos?new Un(i.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,r=this.unplaced.openEnd;i<e;i++){let o=n.firstChild;if(n.childCount>1&&(r=0),o.type.spec.isolating&&r<=i){e=i;break}n=o.content}for(let n=1;n<=2;n++)for(let i=n==1?e:this.unplaced.openStart;i>=0;i--){let r,o=null;i?(o=Hh(this.unplaced.content,i-1).firstChild,r=o.content):r=this.unplaced.content;let s=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,d=null;if(n==1&&(s?u.matchType(s.type)||(d=u.fillBefore(Ee.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:i,frontierDepth:a,parent:o,inject:d};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:i,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:i}=this.unplaced,r=Hh(e,n);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new Xe(e,n+1,Math.max(i,r.size+n>=e.size-i?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:i}=this.unplaced,r=Hh(e,n);if(r.childCount<=1&&n>0){let o=e.size-n<=n+r.size;this.unplaced=new Xe(Zl(e,n-1,1),n-1,o?n-1:i)}else this.unplaced=new Xe(Zl(e,n,1),n,i)}placeNodes({sliceDepth:e,frontierDepth:n,parent:i,inject:r,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=i?i.content:s.content,l=s.openStart-e,u=0,c=[],{match:d,type:f}=this.frontier[n];if(r){for(let m=0;m<r.childCount;m++)c.push(r.child(m));d=d.matchFragment(r)}let p=a.size+e-(s.content.size-s.openEnd);for(;u<a.childCount;){let m=a.child(u),v=d.matchType(m.type);if(!v)break;u++,(u>1||l==0||m.content.size)&&(d=v,c.push(x2(m.mark(f.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?p:-1)))}let h=u==a.childCount;h||(p=-1),this.placed=_l(this.placed,n,Ee.from(c)),this.frontier[n].match=d,h&&p<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,v=a;m<p;m++){let S=v.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),v=S.content}this.unplaced=h?e==0?Xe.empty:new Xe(Zl(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new Xe(Zl(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Uh(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:i}=this.$to,r=this.$to.after(i);for(;i>1&&r==this.$to.end(--i);)++r;return r}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:i,type:r}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Uh(e,n,r,i,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=Uh(e,a,u,l,!0);if(!c||c.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=_l(this.placed,n.depth,n.fit)),e=n.move;for(let i=n.depth+1;i<=e.depth;i++){let r=e.node(i),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(i));this.openFrontierNode(r.type,r.attrs,o)}return e}openFrontierNode(e,n=null,i){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=_l(this.placed,this.depth,Ee.from(e.create(n,i))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Ee.empty,!0);n.childCount&&(this.placed=_l(this.placed,this.frontier.length,n))}}function Zl(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Zl(t.firstChild.content,e-1,n)))}function _l(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(_l(t.lastChild.content,e-1,n)))}function Hh(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function x2(t,e,n){if(e<=0)return t;let i=t.content;return e>1&&(i=i.replaceChild(0,x2(i.firstChild,e-1,i.childCount==1?n-1:0))),e>0&&(i=t.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(Ee.empty,!0)))),t.copy(i)}function Uh(t,e,n,i,r){let o=t.node(e),s=r?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=i.fillBefore(o.content,!0,s);return a&&!WR(n,o.content,s)?a:null}function WR(t,e,n){for(let i=n;i<e.childCount;i++)if(!t.allowsMarks(e.child(i).marks))return!0;return!1}function qR(t){return t.spec.defining||t.spec.definingForContent}function XR(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let r=t.doc.resolve(e),o=t.doc.resolve(n);if(T2(r,o,i))return t.step(new Un(e,n,i));let s=E2(r,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(r.depth+1);s.unshift(a);for(let f=r.depth,p=r.pos-1;f>0;f--,p--){let h=r.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:r.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),u=[],c=i.openStart;for(let f=i.content,p=0;;p++){let h=f.firstChild;if(u.push(h),p==i.openStart)break;f=h.content}for(let f=c-1;f>=0;f--){let p=u[f],h=qR(p.type);if(h&&!p.sameMarkup(r.node(Math.abs(a)-1)))c=f;else if(h||!p.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let p=(f+c+1)%(i.openStart+1),h=u[p];if(h)for(let m=0;m<s.length;m++){let v=s[(m+l)%s.length],S=!0;v<0&&(S=!1,v=-v);let b=r.node(v-1),k=r.index(v-1);if(b.canReplaceWith(k,k,h.type,h.marks))return t.replace(r.before(v),S?o.after(v):n,new Xe(M2(i.content,0,i.openStart,p),p,i.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,i),!(t.steps.length>d));f--){let p=s[f];p<0||(e=r.before(p),n=o.after(p))}}function M2(t,e,n,i,r){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(M2(o.content,e+1,n,i,o)))}if(e>i){let o=r.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(Ee.empty,!0))}return t}function GR(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=HR(t.doc,e,i.type);r!=null&&(e=n=r)}t.replaceRange(e,n,new Xe(Ee.from(i),0,0))}function ZR(t,e,n){let i=t.doc.resolve(e),r=t.doc.resolve(n),o=E2(i,r);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||i.node(a).type.contentMatch.validEnd)return t.delete(i.start(a),r.end(a));if(a>0&&(l||i.node(a-1).canReplace(i.index(a-1),r.indexAfter(a-1))))return t.delete(i.before(a),r.after(a))}for(let s=1;s<=i.depth&&s<=r.depth;s++)if(e-i.start(s)==i.depth-s&&n>i.end(s)&&r.end(s)-n!=r.depth-s&&i.start(s-1)==r.start(s-1)&&i.node(s-1).canReplace(i.index(s-1),r.index(s-1)))return t.delete(i.before(s),n);t.delete(e,n)}function E2(t,e){let n=[],i=Math.min(t.depth,e.depth);for(let r=i;r>=0;r--){let o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}class da extends li{constructor(e,n,i){super(),this.pos=e,this.attr=n,this.value=i}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nn.fail("No node at attribute step's position");let i=Object.create(null);for(let o in n.attrs)i[o]=n.attrs[o];i[this.attr]=this.value;let r=n.type.create(i,null,n.marks);return Nn.fromReplace(e,this.pos,this.pos+1,new Xe(Ee.from(r),0,n.isLeaf?0:1))}getMap(){return Di.empty}invert(e){return new da(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 da(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 da(n.pos,n.attr,n.value)}}li.jsonID("attr",da);class Jl extends li{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;let i=e.type.create(n,e.content,e.marks);return Nn.ok(i)}getMap(){return Di.empty}invert(e){return new Jl(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 Jl(n.attr,n.value)}}li.jsonID("docAttr",Jl);let fa=class extends Error{};fa=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},fa.prototype=Object.create(Error.prototype),fa.prototype.constructor=fa,fa.prototype.name="TransformError";class P2{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Gl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new fa(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,i=Xe.empty){let r=Fc(this.doc,e,n,i);return r&&this.step(r),this}replaceWith(e,n,i){return this.replace(e,n,new Xe(Ee.from(i),0,0))}delete(e,n){return this.replace(e,n,Xe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,i){return XR(this,e,n,i),this}replaceRangeWith(e,n,i){return GR(this,e,n,i),this}deleteRange(e,n){return ZR(this,e,n),this}lift(e,n){return LR(this,e,n),this}join(e,n=1){return jR(this,e,n),this}wrap(e,n){return NR(this,e,n),this}setBlockType(e,n=e,i,r=null){return BR(this,e,n,i,r),this}setNodeMarkup(e,n,i=null,r){return VR(this,e,n,i,r),this}setNodeAttribute(e,n,i){return this.step(new da(e,n,i)),this}setDocAttribute(e,n){return this.step(new Jl(e,n)),this}addNodeMark(e,n){return this.step(new Po(e,n)),this}removeNodeMark(e,n){let i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at position "+e);if(n instanceof un)n.isInSet(i.marks)&&this.step(new bs(e,n));else{let r=i.marks,o,s=[];for(;o=n.isInSet(r);)s.push(new bs(e,o)),r=o.removeFromSet(r);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(e,n=1,i){return zR(this,e,n,i),this}addMark(e,n,i){return ER(this,e,n,i),this}removeMark(e,n,i){return PR(this,e,n,i),this}clearIncompatible(e,n,i){return Fh(this,e,n,i),this}}const Kh=Object.create(null);class Vt{constructor(e,n,i){this.$anchor=e,this.$head=n,this.ranges=i||[new _R(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=Xe.empty){let i=n.content.lastChild,r=null;for(let a=0;a<n.openEnd;a++)r=i,i=i.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:u}=s[a],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(u.pos),a?Xe.empty:n),a==0&&D2(e,o,(i?i.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,n){let i=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:s,$to:a}=r[o],l=e.mapping.slice(i),u=l.map(s.pos),c=l.map(a.pos);o?e.deleteRange(u,c):(e.replaceRangeWith(u,c,n),D2(e,i,n.isInline?-1:1))}}static findFrom(e,n,i=!1){let r=e.parent.inlineContent?new Mt(e):pa(e.node(0),e.parent,e.pos,e.index(),n,i);if(r)return r;for(let o=e.depth-1;o>=0;o--){let s=n<0?pa(e.node(0),e.node(o),e.before(o+1),e.index(o),n,i):pa(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,i);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ri(e.node(0))}static atStart(e){return pa(e,e,0,0,1)||new Ri(e)}static atEnd(e){return pa(e,e,e.content.size,e.childCount,-1)||new Ri(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Kh[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(e,n)}static jsonID(e,n){if(e in Kh)throw new RangeError("Duplicate use of selection JSON ID "+e);return Kh[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Mt.between(this.$anchor,this.$head).getBookmark()}}Vt.prototype.visible=!0;class _R{constructor(e,n){this.$from=e,this.$to=n}}let I2=!1;function L2(t){!I2&&!t.parent.inlineContent&&(I2=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Mt extends Vt{constructor(e,n=e){L2(e),L2(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let i=e.resolve(n.map(this.head));if(!i.parent.inlineContent)return Vt.near(i);let r=e.resolve(n.map(this.anchor));return new Mt(r.parent.inlineContent?r:i,i)}replace(e,n=Xe.empty){if(super.replace(e,n),n==Xe.empty){let i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}eq(e){return e instanceof Mt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new jc(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 Mt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,i=n){let r=e.resolve(n);return new this(r,i==n?r:e.resolve(i))}static between(e,n,i){let r=e.pos-n.pos;if((!i||r)&&(i=r>=0?1:-1),!n.parent.inlineContent){let o=Vt.findFrom(n,i,!0)||Vt.findFrom(n,-i,!0);if(o)n=o.$head;else return Vt.near(n,i)}return e.parent.inlineContent||(r==0?e=n:(e=(Vt.findFrom(e,-i,!0)||Vt.findFrom(e,i,!0)).$anchor,e.pos<n.pos!=r<0&&(e=n))),new Mt(e,n)}}Vt.jsonID("text",Mt);class jc{constructor(e,n){this.anchor=e,this.head=n}map(e){return new jc(e.map(this.anchor),e.map(this.head))}resolve(e){return Mt.between(e.resolve(this.anchor),e.resolve(this.head))}}class mt extends Vt{constructor(e){let n=e.nodeAfter,i=e.node(0).resolve(e.pos+n.nodeSize);super(e,i),this.node=n}map(e,n){let{deleted:i,pos:r}=n.mapResult(this.anchor),o=e.resolve(r);return i?Vt.near(o):new mt(o)}content(){return new Xe(Ee.from(this.node),0,0)}eq(e){return e instanceof mt&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Wh(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new mt(e.resolve(n.anchor))}static create(e,n){return new mt(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}mt.prototype.visible=!1,Vt.jsonID("node",mt);class Wh{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:i}=e.mapResult(this.anchor);return n?new jc(i,i):new Wh(i)}resolve(e){let n=e.resolve(this.anchor),i=n.nodeAfter;return i&&mt.isSelectable(i)?new mt(n):Vt.near(n)}}class Ri extends Vt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Xe.empty){if(n==Xe.empty){e.delete(0,e.doc.content.size);let i=Vt.atStart(e.doc);i.eq(e.selection)||e.setSelection(i)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ri(e)}map(e){return new Ri(e)}eq(e){return e instanceof Ri}getBookmark(){return JR}}Vt.jsonID("all",Ri);const JR={map(){return this},resolve(t){return new Ri(t)}};function pa(t,e,n,i,r,o=!1){if(e.inlineContent)return Mt.create(t,n);for(let s=i-(r>0?0:1);r>0?s<e.childCount:s>=0;s+=r){let a=e.child(s);if(a.isAtom){if(!o&&mt.isSelectable(a))return mt.create(t,n-(r<0?a.nodeSize:0))}else{let l=pa(t,a,n+r,r<0?a.childCount:0,r,o);if(l)return l}n+=a.nodeSize*r}return null}function D2(t,e,n){let i=t.steps.length-1;if(i<e)return;let r=t.steps[i];if(!(r instanceof Un||r instanceof Kn))return;let o=t.mapping.maps[i],s;o.forEach((a,l,u,c)=>{s==null&&(s=c)}),t.setSelection(Vt.near(t.doc.resolve(s),n))}const R2=1,N2=2,B2=4;class YR extends P2{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|R2)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&R2)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=N2,this}ensureMarks(e){return un.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&N2)>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 i=this.selection;return n&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||un.none))),i.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,i){let r=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(i==null&&(i=n),i=i??n,!e)return this.deleteRange(n,i);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=i==n?s.marks():s.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,r.text(e,o)),this.selection.empty||this.setSelection(Vt.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|=B2,this}get scrolledIntoView(){return(this.updated&B2)>0}}function $2(t,e){return!e||!t?t:t.bind(e)}class Yl{constructor(e,n,i){this.name=e,this.init=$2(n.init,i),this.apply=$2(n.apply,i)}}const QR=[new Yl("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Yl("selection",{init(t,e){return t.selection||Vt.atStart(e.doc)},apply(t){return t.selection}}),new Yl("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,i){return i.selection.$cursor?t.storedMarks:null}}),new Yl("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class qh{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=QR.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new Yl(i.key,i.spec.state,i))})}}class ha{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 i=0;i<this.config.plugins.length;i++)if(i!=n){let r=this.config.plugins[i];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],i=this.applyInner(e),r=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=r?r[s].n:0,u=r?r[s].state:this,c=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,i);if(c&&i.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let d=0;d<this.config.plugins.length;d++)r.push(d<s?{state:i,n:n.length}:{state:this,n:0})}n.push(c),i=i.applyInner(c),o=!0}r&&(r[s]={state:i,n:n.length})}}if(!o)return{state:i,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ha(this.config),i=this.config.fields;for(let r=0;r<i.length;r++){let o=i[r];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new YR(this)}static create(e){let n=new qh(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new ha(n);for(let r=0;r<n.fields.length;r++)i[n.fields[r].name]=n.fields[r].init(e,i);return i}reconfigure(e){let n=new qh(this.schema,e.plugins),i=n.fields,r=new ha(n);for(let o=0;o<i.length;o++){let s=i[o].name;r[s]=this.hasOwnProperty(s)?this[s]:i[o].init(e,r)}return r}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(i=>i.toJSON())),e&&typeof e=="object")for(let i in e){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[i],o=r.spec.state;o&&o.toJSON&&(n[i]=o.toJSON.call(r,this[r.key]))}return n}static fromJSON(e,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new qh(e.schema,e.plugins),o=new ha(r);return r.fields.forEach(s=>{if(s.name=="doc")o.doc=xo.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=Vt.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(i)for(let a in i){let l=i[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=u.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function V2(t,e,n){for(let i in t){let r=t[i];r instanceof Function?r=r.bind(e):i=="handleDOMEvents"&&(r=V2(r,e,{})),n[i]=r}return n}class Wn{constructor(e){this.spec=e,this.props={},e.props&&V2(e.props,this,this.props),this.key=e.key?e.key.key:z2("plugin")}getState(e){return e[this.key]}}const Xh=Object.create(null);function z2(t){return t in Xh?t+"$"+ ++Xh[t]:(Xh[t]=0,t+"$")}class ei{constructor(e="key"){this.key=z2(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ti=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ma=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Gh=null;const Zr=function(t,e,n){let i=Gh||(Gh=document.createRange());return i.setEnd(t,n??t.nodeValue.length),i.setStart(t,e||0),i},eN=function(){Gh=null},As=function(t,e,n,i){return n&&(F2(t,e,n,i,-1)||F2(t,e,n,i,1))},tN=/^(img|br|input|textarea|hr)$/i;function F2(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:Ui(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Ql(t)||tN.test(t.nodeName)||t.contentEditable=="false")return!1;e=ti(t)+(r<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.contentEditable=="false")return!1;e=r<0?Ui(t):0}else return!1}}function Ui(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function nN(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=Ui(t)}else if(t.parentNode&&!Ql(t))e=ti(t),t=t.parentNode;else return null}}function iN(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&&!Ql(t))e=ti(t)+1,t=t.parentNode;else return null}}function rN(t,e,n){for(let i=e==0,r=e==Ui(t);i||r;){if(t==n)return!0;let o=ti(t);if(t=t.parentNode,!t)return!1;i=i&&o==0,r=r&&o==Ui(t)}}function Ql(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 Hc=function(t){return t.focusNode&&As(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ws(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function oN(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function sN(t,e,n){if(t.caretPositionFromPoint)try{let i=t.caretPositionFromPoint(e,n);if(i)return{node:i.offsetNode,offset:Math.min(Ui(i.offsetNode),i.offset)}}catch{}if(t.caretRangeFromPoint){let i=t.caretRangeFromPoint(e,n);if(i)return{node:i.startContainer,offset:Math.min(Ui(i.startContainer),i.startOffset)}}}const Sr=typeof navigator<"u"?navigator:null,j2=typeof document<"u"?document:null,Lo=Sr&&Sr.userAgent||"",Zh=/Edge\/(\d+)/.exec(Lo),H2=/MSIE \d/.exec(Lo),_h=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Lo),Oi=!!(H2||_h||Zh),Do=H2?document.documentMode:_h?+_h[1]:Zh?+Zh[1]:0,dr=!Oi&&/gecko\/(\d+)/i.test(Lo);dr&&+(/Firefox\/(\d+)/.exec(Lo)||[0,0])[1];const Jh=!Oi&&/Chrome\/(\d+)/.exec(Lo),ui=!!Jh,U2=Jh?+Jh[1]:0,vi=!Oi&&!!Sr&&/Apple Computer/.test(Sr.vendor),ga=vi&&(/Mobile\/\w+/.test(Lo)||!!Sr&&Sr.maxTouchPoints>2),Ki=ga||(Sr?/Mac/.test(Sr.platform):!1),aN=Sr?/Win/.test(Sr.platform):!1,_r=/Android \d/.test(Lo),eu=!!j2&&"webkitFontSmoothing"in j2.documentElement.style,lN=eu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function uN(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 Jr(t,e){return typeof t=="number"?t:t[e]}function cN(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,i=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*i}}function K2(t,e,n){let i=t.someProp("scrollThreshold")||0,r=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=ma(s);continue}let a=s,l=a==o.body,u=l?uN(o):cN(a),c=0,d=0;if(e.top<u.top+Jr(i,"top")?d=-(u.top-e.top+Jr(r,"top")):e.bottom>u.bottom-Jr(i,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Jr(r,"top")-u.top:e.bottom-u.bottom+Jr(r,"bottom")),e.left<u.left+Jr(i,"left")?c=-(u.left-e.left+Jr(r,"left")):e.right>u.right-Jr(i,"right")&&(c=e.right-u.right+Jr(r,"right")),c||d)if(l)o.defaultView.scrollBy(c,d);else{let p=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let m=a.scrollLeft-p,v=a.scrollTop-h;e={left:e.left-m,top:e.top-v,right:e.right-m,bottom:e.bottom-v}}let f=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(f))break;s=f=="absolute"?s.offsetParent:ma(s)}}function dN(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),i,r;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){i=a,r=l.top;break}}return{refDOM:i,refTop:r,stack:W2(t.dom)}}function W2(t){let e=[],n=t.ownerDocument;for(let i=t;i&&(e.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=n);i=ma(i));return e}function fN({refDOM:t,refTop:e,stack:n}){let i=t?t.getBoundingClientRect().top:0;q2(n,i==0?0:i-e)}function q2(t,e){for(let n=0;n<t.length;n++){let{dom:i,top:r,left:o}=t[n];i.scrollTop!=r+e&&(i.scrollTop=r+e),i.scrollLeft!=o&&(i.scrollLeft=o)}}let va=null;function pN(t){if(t.setActive)return t.setActive();if(va)return t.focus(va);let e=W2(t);t.focus(va==null?{get preventScroll(){return va={preventScroll:!0},!0}}:void 0),va||(va=!1,q2(e,0))}function X2(t,e){let n,i=2e8,r,o=0,s=e.top,a=e.top,l,u;for(let c=t.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(c.nodeType==1)f=c.getClientRects();else if(c.nodeType==3)f=Zr(c).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<i){n=c,i=m,r=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,c.nodeType==1&&m&&(o=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=c,u={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=d+1)}}return!n&&l&&(n=l,r=u,i=0),n&&n.nodeType==3?hN(n,r):!n||i&&n.nodeType==1?{node:t,offset:o}:X2(n,r)}function hN(t,e){let n=t.nodeValue.length,i=document.createRange();for(let r=0;r<n;r++){i.setEnd(t,r+1),i.setStart(t,r);let o=Ro(i,1);if(o.top!=o.bottom&&Yh(e,o))return{node:t,offset:r+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Yh(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function mN(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function gN(t,e,n){let{node:i,offset:r}=X2(e,n),o=-1;if(i.nodeType==1&&!i.firstChild){let s=i.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(i,r,o)}function vN(t,e,n,i){let r=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>i.left||l.top>i.top?r=a.posBefore:(!s&&l.right<i.left||l.bottom<i.top)&&(r=a.posAfter),s=!0),!a.contentDOM&&r<0&&!a.node.isText))return(a.node.isBlock?i.top<(l.top+l.bottom)/2:i.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return r>-1?r:t.docView.posFromDOM(e,n,-1)}function G2(t,e,n){let i=t.childNodes.length;if(i&&n.top<n.bottom)for(let r=Math.max(0,Math.min(i-1,Math.floor(i*(e.top-n.top)/(n.bottom-n.top))-2)),o=r;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(Yh(e,u))return G2(s,e,u)}}if((o=(o+1)%i)==r)break}return t}function yN(t,e){let n=t.dom.ownerDocument,i,r=0,o=sN(n,e.left,e.top);o&&({node:i,offset:r}=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 u=t.dom.getBoundingClientRect();if(!Yh(e,u)||(s=G2(t.dom,e,u),!s))return null}if(vi)for(let u=s;i&&u;u=ma(u))u.draggable&&(i=void 0);if(s=mN(s,e),i){if(dr&&i.nodeType==1&&(r=Math.min(r,i.childNodes.length),r<i.childNodes.length)){let c=i.childNodes[r],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&r++}let u;eu&&r&&i.nodeType==1&&(u=i.childNodes[r-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&r--,i==t.dom&&r==i.childNodes.length-1&&i.lastChild.nodeType==1&&e.top>i.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(r==0||i.nodeType!=1||i.childNodes[r-1].nodeName!="BR")&&(a=vN(t,i,r,e))}a==null&&(a=gN(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Z2(t){return t.top<t.bottom||t.left<t.right}function Ro(t,e){let n=t.getClientRects();if(n.length){let i=n[e<0?0:n.length-1];if(Z2(i))return i}return Array.prototype.find.call(n,Z2)||t.getBoundingClientRect()}const bN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _2(t,e,n){let{node:i,offset:r,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=eu||dr;if(i.nodeType==3)if(s&&(bN.test(i.nodeValue)||(n<0?!r:r==i.nodeValue.length))){let l=Ro(Zr(i,r,r),n);if(dr&&r&&/\s/.test(i.nodeValue[r-1])&&r<i.nodeValue.length){let u=Ro(Zr(i,r-1,r-1),-1);if(u.top==l.top){let c=Ro(Zr(i,r,r+1),-1);if(c.top!=l.top)return tu(c,c.left<u.left)}}return l}else{let l=r,u=r,c=n<0?1:-1;return n<0&&!r?(u++,c=-1):n>=0&&r==i.nodeValue.length?(l--,c=1):n<0?l--:u++,tu(Ro(Zr(i,l,u),c),c<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&r&&(n<0||r==Ui(i))){let l=i.childNodes[r-1];if(l.nodeType==1)return Qh(l.getBoundingClientRect(),!1)}if(o==null&&r<Ui(i)){let l=i.childNodes[r];if(l.nodeType==1)return Qh(l.getBoundingClientRect(),!0)}return Qh(i.getBoundingClientRect(),n>=0)}if(o==null&&r&&(n<0||r==Ui(i))){let l=i.childNodes[r-1],u=l.nodeType==3?Zr(l,Ui(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return tu(Ro(u,1),!1)}if(o==null&&r<Ui(i)){let l=i.childNodes[r];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Zr(l,0,s?0:1):l.nodeType==1?l:null:null;if(u)return tu(Ro(u,-1),!0)}return tu(Ro(i.nodeType==3?Zr(i):i,-n),n>=0)}function tu(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 Qh(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 J2(t,e,n){let i=t.state,r=t.root.activeElement;i!=e&&t.updateState(e),r!=t.dom&&t.focus();try{return n()}finally{i!=e&&t.updateState(i),r!=t.dom&&r&&r.focus()}}function AN(t,e,n){let i=e.selection,r=n=="up"?i.$from:i.$to;return J2(t,e,()=>{let{node:o}=t.docView.domFromPos(r.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=_2(t,r.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Zr(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const wN=/[\u0590-\u08ac]/;function SN(t,e,n){let{$head:i}=e.selection;if(!i.parent.isTextblock)return!1;let r=i.parentOffset,o=!r,s=r==i.parent.content.size,a=t.domSelection();return a?!wN.test(i.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:J2(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),v=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&u==m;try{a.collapse(c,d),l&&(l!=c||u!=d)&&a.extend&&a.extend(l,u)}catch{}return f!=null&&(a.caretBidiLevel=f),v}):i.pos==i.start()||i.pos==i.end()}let Y2=null,Q2=null,ew=!1;function CN(t,e,n){return Y2==e&&Q2==n?ew:(Y2=e,Q2=n,ew=n=="up"||n=="down"?AN(t,e,n):SN(t,e,n))}const Wi=0,tw=1,Ss=2,Cr=3;class nu{constructor(e,n,i,r){this.parent=e,this.children=n,this.dom=i,this.contentDOM=r,this.dirty=Wi,i.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,i){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,i=this.posAtStart;;n++){let r=this.children[n];if(r==e)return i;i+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,i){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(i<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 r;if(e==this.dom&&this.contentDOM)r=n>ti(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){r=!1;break}if(o.previousSibling)break}if(r==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){r=!0;break}if(o.nextSibling)break}}return r??i>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let i=!0,r=e;r;r=r.parentNode){let o=this.getDesc(r),s;if(o&&(!n||o.node))if(i&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))i=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let i=n;i;i=i.parent)if(i==this)return n}posFromDOM(e,n,i){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,n,i)}return-1}descAt(e){for(let n=0,i=0;n<this.children.length;n++){let r=this.children[n],o=i+r.size;if(i==e&&o!=i){for(;!r.border&&r.children.length;)for(let s=0;s<r.children.length;s++){let a=r.children[s];if(a.size){r=a;break}}return r}if(e<o)return r.descAt(e-i-r.border);i=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let i=0,r=0;for(let o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.size;if(a>e||s instanceof rw){r=e-o;break}o=a}if(r)return this.children[i].domFromPos(r-this.children[i].border,n);for(let o;i&&!(o=this.children[i-1]).size&&o instanceof nw&&o.side>=0;i--);if(n<=0){let o,s=!0;for(;o=i?this.children[i-1]:null,!(!o||o.dom.parentNode==this.contentDOM);i--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?ti(o.dom)+1:0}}else{let o,s=!0;for(;o=i<this.children.length?this.children[i]:null,!(!o||o.dom.parentNode==this.contentDOM);i++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?ti(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,i=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let s=i,a=0;;a++){let l=this.children[a],u=s+l.size;if(r==-1&&e<=u){let c=s+l.border;if(e>=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,c);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=ti(f.dom)+1;break}e-=f.size}r==-1&&(r=0)}if(r>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=ti(d.dom);break}n+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:n,fromOffset:r,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:i}=this.domFromPos(e,0);if(n.nodeType!=1||i==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[i]}setSelection(e,n,i,r=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],v=h+m.size;if(o>h&&s<v)return m.setSelection(e-h-m.border,n-h-m.border,i,r);h=v}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=i.root.getSelection(),c=i.domSelectionRange(),d=!1;if((dr||vi)&&e==n){let{node:p,offset:h}=a;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==`
212
+ `),d&&h==p.nodeValue.length)for(let m=p,v;m;m=m.parentNode){if(v=m.nextSibling){v.nodeName=="BR"&&(a=l={node:v.parentNode,offset:ti(v)+1});break}let S=m.pmViewDesc;if(S&&S.node&&S.node.isBlock)break}}else{let m=p.childNodes[h-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(dr&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let p=c.focusNode.childNodes[c.focusOffset];p&&p.contentEditable=="false"&&(r=!0)}if(!(r||d&&vi)&&As(a.node,a.offset,c.anchorNode,c.anchorOffset)&&As(l.node,l.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||e==n)&&!d){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let h=a;a=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.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 i=0,r=0;r<this.children.length;r++){let o=this.children[r],s=i+o.size;if(i==s?e<=s&&n>=i:e<s&&n>i){let a=i+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==i||n==s?Ss:tw,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Cr:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Ss:Cr}i=s}this.dirty=Ss}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let i=e==1?Ss:tw;n.dirty<i&&(n.dirty=i)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class nw extends nu{constructor(e,n,i,r){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(i,()=>{if(!o)return r;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==Wi&&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 kN extends nu{constructor(e,n,i,r){super(e,[],n,null),this.textDOM=i,this.text=r}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 Cs extends nu{constructor(e,n,i,r,o){super(e,[],i,r),this.mark=n,this.spec=o}static create(e,n,i,r){let o=r.nodeViews[n.type.name],s=o&&o(n,r,i);return(!s||!s.dom)&&(s=ys.renderSpec(document,n.type.spec.toDOM(n,i),null,n.attrs)),new Cs(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Cr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Cr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Wi){let i=this.parent;for(;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=Wi}}slice(e,n,i){let r=Cs.create(this.parent,this.mark,!0,i),o=this.children,s=this.size;n<s&&(o=tm(o,n,s,i)),e>0&&(o=tm(o,0,e,i));for(let a=0;a<o.length;a++)o[a].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class No extends nu{constructor(e,n,i,r,o,s,a,l,u){super(e,[],o,s),this.node=n,this.outerDeco=i,this.innerDeco=r,this.nodeDOM=a}static create(e,n,i,r,o,s){let a=o.nodeViews[n.type.name],l,u=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},i,r),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=ys.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=aw(c,i,n),u?l=new ON(e,n,i,r,c,d||null,f,u,o,s+1):n.isText?new Uc(e,n,i,r,c,f,o):new No(e,n,i,r,c,d||null,f,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 i=this.children[n];if(this.dom.contains(i.dom.parentNode)){e.contentElement=i.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ee.empty)}return e}matchesNode(e,n,i){return this.dirty==Wi&&e.eq(this.node)&&Kc(n,this.outerDeco)&&i.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let i=this.node.inlineContent,r=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new xN(this,s&&s.node,e);PN(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,i,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?un.none:this.node.child(c).marks,i,e),l.placeWidget(u,e,r)},(u,c,d,f)=>{l.syncToMarks(u.marks,i,e);let p;l.findNodeMatch(u,c,d,f)||a&&e.state.selection.from>r&&e.state.selection.to<r+u.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(u,c,d,p,e)||l.updateNextNode(u,c,d,e,f,r)||l.addNode(u,c,d,e,r),r+=u.nodeSize}),l.syncToMarks([],i,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ss)&&(s&&this.protectLocalComposition(e,s),ow(this.contentDOM,this.children,e),ga&&IN(this.dom))}localCompositionInfo(e,n){let{from:i,to:r}=e.state.selection;if(!(e.state.selection instanceof Mt)||i<n||r>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=LN(this.node.content,s,i-n,r-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:i,text:r}){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 kN(this,o,n,r);e.input.compositionNodes.push(s),this.children=tm(this.children,i,i+r.length,e,s)}update(e,n,i,r){return this.dirty==Cr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,i,r),!0)}updateInner(e,n,i,r){this.updateOuterDeco(n),this.node=e,this.innerDeco=i,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Wi}updateOuterDeco(e){if(Kc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,i=this.dom;this.dom=sw(this.dom,this.nodeDOM,em(this.outerDeco,this.node,n),em(e,this.node,n)),this.dom!=i&&(i.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 iw(t,e,n,i,r){aw(i,e,t);let o=new No(void 0,t,e,n,i,i,i,r,0);return o.contentDOM&&o.updateChildren(r,0),o}class Uc extends No{constructor(e,n,i,r,o,s,a){super(e,n,i,r,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,i,r){return this.dirty==Cr||this.dirty!=Wi&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Wi||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Wi,!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,i){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,i)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,i){let r=this.node.cut(e,n),o=document.createTextNode(r.text);return new Uc(this.parent,r,this.outerDeco,this.innerDeco,o,o,i)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Cr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class rw extends nu{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Wi&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class ON extends No{constructor(e,n,i,r,o,s,a,l,u,c){super(e,n,i,r,o,s,a,u,c),this.spec=l}update(e,n,i,r){if(this.dirty==Cr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,i);return o&&this.updateInner(e,n,i,r),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,i,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,i,r){this.spec.setSelection?this.spec.setSelection(e,n,i.root):super.setSelection(e,n,i,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function ow(t,e,n){let i=t.firstChild,r=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=i;)i=lw(i),r=!0;i=i.nextSibling}else r=!0,t.insertBefore(a,i);if(s instanceof Cs){let l=i?i.previousSibling:t.lastChild;ow(s.contentDOM,s.children,n),i=l?l.nextSibling:t.firstChild}}for(;i;)i=lw(i),r=!0;r&&n.trackWrites==t&&(n.trackWrites=null)}const iu=function(t){t&&(this.nodeName=t)};iu.prototype=Object.create(null);const ks=[new iu];function em(t,e,n){if(t.length==0)return ks;let i=n?ks[0]:new iu,r=[i];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&r.push(i=new iu(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&r.length==1&&r.push(i=new iu(e.isInline?"span":"div")),a=="class"?i.class=(i.class?i.class+" ":"")+l:a=="style"?i.style=(i.style?i.style+";":"")+l:a!="nodeName"&&(i[a]=l))}}}return r}function sw(t,e,n,i){if(n==ks&&i==ks)return e;let r=e;for(let o=0;o<i.length;o++){let s=i[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&r!=t&&(l=r.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(r),a=ks[0]),r=l}TN(r,a||ks[0],s)}return r}function TN(t,e,n){for(let i in e)i!="class"&&i!="style"&&i!="nodeName"&&!(i in n)&&t.removeAttribute(i);for(let i in n)i!="class"&&i!="style"&&i!="nodeName"&&n[i]!=e[i]&&t.setAttribute(i,n[i]);if(e.class!=n.class){let i=e.class?e.class.split(" ").filter(Boolean):[],r=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.remove(i[o]);for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.add(r[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=i.exec(e.style);)t.style.removeProperty(r[1])}n.style&&(t.style.cssText+=n.style)}}function aw(t,e,n){return sw(t,t,ks,em(e,n,t.nodeType!=1))}function Kc(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 lw(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class xN{constructor(e,n,i){this.lock=n,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=MN(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let i=e;i<n;i++)this.top.children[i].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,i){let r=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;r<s&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&e[r].type.spec.spanning!==!1;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=Wi,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Cs.create(this.top,e[o],n,i);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,i,r){let o=-1,s;if(r>=this.preMatch.index&&(s=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,i))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,i)&&!this.preMatch.matched.has(u)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,i,r,o){let s=this.top.children[r];return s.dirty==Cr&&s.dom==s.contentDOM&&(s.dirty=Ss),s.update(e,n,i,o)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let i=e.pmViewDesc;if(i){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==i)return r}return-1}e=n}}updateNextNode(e,n,i,r,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof No){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let c=l.dom,d,f=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Cr&&Kc(n,l.outerDeco));if(!f&&l.update(e,n,i,r))return this.destroyBetween(this.index,a),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,i,r,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=Ss,d.updateChildren(r,s+1),d.dirty=Wi),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,i,r,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Kc(i,e.outerDeco)||!r.eq(e.innerDeco))return null;let a=No.create(this.top,n,i,r,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,i,r,o){let s=No.create(this.top,e,n,i,r,o);s.contentDOM&&s.updateChildren(r,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,i){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let o=new nw(this.top,e,n,i);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 Cs;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Uc)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((vi||ui)&&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 i=document.createElement(e);e=="IMG"&&(i.className="ProseMirror-separator",i.alt=""),e=="BR"&&(i.className="ProseMirror-trailingBreak");let r=new rw(this.top,[],i,null);n!=this.top?n.children.push(r):n.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function MN(t,e){let n=e,i=n.children.length,r=t.childCount,o=new Map,s=[];e:for(;r>0;){let a;for(;;)if(i){let u=n.children[i-1];if(u instanceof Cs)n=u,i=u.children.length;else{a=u,i--;break}}else{if(n==e)break e;i=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(r-1))break;--r,o.set(a,r),s.push(a)}}return{index:r,matched:o,matches:s.reverse()}}function EN(t,e){return t.type.side-e.type.side}function PN(t,e,n,i){let r=e.locals(t),o=0;if(r.length==0){for(let u=0;u<t.childCount;u++){let c=t.child(u);i(c,r,e.forChild(o,c),u),o+=c.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){let c,d;for(;s<r.length&&r[s].to==o;){let v=r[s++];v.widget&&(c?(d||(d=[c])).push(v):c=v)}if(c)if(d){d.sort(EN);for(let v=0;v<d.length;v++)n(d[v],u,!!l)}else n(c,u,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(u<t.childCount)p=u,f=t.child(u++);else break;for(let v=0;v<a.length;v++)a[v].to<=o&&a.splice(v--,1);for(;s<r.length&&r[s].from<=o&&r[s].to>o;)a.push(r[s++]);let h=o+f.nodeSize;if(f.isText){let v=h;s<r.length&&r[s].from<v&&(v=r[s].from);for(let S=0;S<a.length;S++)a[S].to<v&&(v=a[S].to);v<h&&(l=f.cut(v-o),f=f.cut(0,v-o),h=v,p=-1)}else for(;s<r.length&&r[s].to<h;)s++;let m=f.isInline&&!f.isLeaf?a.filter(v=>!v.inline):a.slice();i(f,m,e.forChild(o,f),p),o=h}}function IN(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 LN(t,e,n,i){for(let r=0,o=0;r<t.childCount&&o<=i;){let s=t.child(r++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;r<t.childCount;){let u=t.child(r++);if(o+=u.nodeSize,!u.isText)break;l+=u.text}if(o>=n){if(o>=i&&l.slice(i-e.length-a,i-a)==e)return i-e.length;let u=a<i?l.lastIndexOf(e,i-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==i&&l.length>=i+e.length-a&&l.slice(i-a,i-a+e.length)==e)return i}}return-1}function tm(t,e,n,i,r){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],u=a,c=a+=l.size;u>=n||c<=e?o.push(l):(u<e&&o.push(l.slice(0,e-u,i)),r&&(o.push(r),r=void 0),c>n&&o.push(l.slice(n-u,l.size,i)))}return o}function nm(t,e=null){let n=t.domSelectionRange(),i=t.state.doc;if(!n.focusNode)return null;let r=t.docView.nearestDesc(n.focusNode),o=r&&r.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=i.resolve(s),l,u;if(Hc(n)){for(l=s;r&&!r.node;)r=r.parent;let d=r.node;if(r&&d.isAtom&&mt.isSelectable(d)&&r.parent&&!(d.isInline&&rN(n.focusNode,n.focusOffset,r.dom))){let f=r.posBefore;u=new mt(s==f?a:i.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,f=s;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,s]=f==t.state.selection.anchor?[f,d]:[d,f],a=i.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=i.resolve(l);if(!u){let d=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;u=rm(t,c,a,d)}return u}function uw(t){return t.editable?t.hasFocus():gw(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Yr(t,e=!1){let n=t.state.selection;if(pw(t,n),!!uw(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ui){let i=t.domSelectionRange(),r=t.domObserver.currentSelection;if(i.anchorNode&&r.anchorNode&&As(i.anchorNode,i.anchorOffset,r.anchorNode,r.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)RN(t);else{let{anchor:i,head:r}=n,o,s;cw&&!(n instanceof Mt)&&(n.$from.parent.inlineContent||(o=dw(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=dw(t,n.to))),t.docView.setSelection(i,r,t,e),cw&&(o&&fw(o),s&&fw(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&DN(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const cw=vi||ui&&U2<63;function dw(t,e){let{node:n,offset:i}=t.docView.domFromPos(e,0),r=i<n.childNodes.length?n.childNodes[i]:null,o=i?n.childNodes[i-1]:null;if(vi&&r&&r.contentEditable=="false")return im(r);if((!r||r.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(r)return im(r);if(o)return im(o)}}function im(t){return t.contentEditable="true",vi&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function fw(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function DN(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),i=n.anchorNode,r=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=i||n.anchorOffset!=r)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!uw(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function RN(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let i=t.cursorWrapper.dom,r=i.nodeName=="IMG";r?n.setStart(i.parentNode,ti(i)+1):n.setStart(i,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!r&&!t.state.selection.visible&&Oi&&Do<=11&&(i.disabled=!0,i.disabled=!1)}function pw(t,e){if(e instanceof mt){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(hw(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else hw(t)}function hw(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function rm(t,e,n,i){return t.someProp("createSelectionBetween",r=>r(t,e,n))||Mt.between(e,n,i)}function mw(t){return t.editable&&!t.hasFocus()?!1:gw(t)}function gw(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 NN(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return As(e.node,e.offset,n.anchorNode,n.anchorOffset)}function om(t,e){let{$anchor:n,$head:i}=t.selection,r=e>0?n.max(i):n.min(i),o=r.parent.inlineContent?r.depth?t.doc.resolve(e>0?r.after():r.before()):null:r;return o&&Vt.findFrom(o,e)}function Bo(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function vw(t,e,n){let i=t.state.selection;if(i instanceof Mt)if(n.indexOf("s")>-1){let{$head:r}=i,o=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(r.pos+o.nodeSize*(e<0?-1:1));return Bo(t,new Mt(i.$anchor,s))}else if(i.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let r=om(t.state,e);return r&&r instanceof mt?Bo(t,r):!1}else if(!(Ki&&n.indexOf("m")>-1)){let r=i.$head,o=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?r.pos-o.nodeSize:r.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?mt.isSelectable(o)?Bo(t,new mt(e<0?t.state.doc.resolve(r.pos-o.nodeSize):r)):eu?Bo(t,new Mt(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(i instanceof mt&&i.node.isInline)return Bo(t,new Mt(e>0?i.$to:i.$from));{let r=om(t.state,e);return r?Bo(t,r):!1}}}function Wc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ru(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ya(t,e){return e<0?BN(t):$N(t)}function BN(t){let e=t.domSelectionRange(),n=e.focusNode,i=e.focusOffset;if(!n)return;let r,o,s=!1;for(dr&&n.nodeType==1&&i<Wc(n)&&ru(n.childNodes[i],-1)&&(s=!0);;)if(i>0){if(n.nodeType!=1)break;{let a=n.childNodes[i-1];if(ru(a,-1))r=n,o=--i;else if(a.nodeType==3)n=a,i=n.nodeValue.length;else break}}else{if(yw(n))break;{let a=n.previousSibling;for(;a&&ru(a,-1);)r=n.parentNode,o=ti(a),a=a.previousSibling;if(a)n=a,i=Wc(n);else{if(n=n.parentNode,n==t.dom)break;i=0}}}s?sm(t,n,i):r&&sm(t,r,o)}function $N(t){let e=t.domSelectionRange(),n=e.focusNode,i=e.focusOffset;if(!n)return;let r=Wc(n),o,s;for(;;)if(i<r){if(n.nodeType!=1)break;let a=n.childNodes[i];if(ru(a,1))o=n,s=++i;else break}else{if(yw(n))break;{let a=n.nextSibling;for(;a&&ru(a,1);)o=a.parentNode,s=ti(a)+1,a=a.nextSibling;if(a)n=a,i=0,r=Wc(n);else{if(n=n.parentNode,n==t.dom)break;i=r=0}}}o&&sm(t,o,s)}function yw(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function VN(t,e){for(;t&&e==t.childNodes.length&&!Ql(t);)e=ti(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 zN(t,e){for(;t&&!e&&!Ql(t);)e=ti(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 sm(t,e,n){if(e.nodeType!=3){let o,s;(s=VN(e,n))?(e=s,n=0):(o=zN(e,n))&&(e=o,n=o.nodeValue.length)}let i=t.domSelection();if(!i)return;if(Hc(i)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),i.removeAllRanges(),i.addRange(o)}else i.extend&&i.extend(e,n);t.domObserver.setCurSelection();let{state:r}=t;setTimeout(()=>{t.state==r&&Yr(t)},50)}function bw(t,e){let n=t.state.doc.resolve(e);if(!(ui||aN)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(o.left-r.left)>1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Aw(t,e,n){let i=t.state.selection;if(i instanceof Mt&&!i.empty||n.indexOf("s")>-1||Ki&&n.indexOf("m")>-1)return!1;let{$from:r,$to:o}=i;if(!r.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=om(t.state,e);if(s&&s instanceof mt)return Bo(t,s)}if(!r.parent.inlineContent){let s=e<0?r:o,a=i instanceof Ri?Vt.near(s,e):Vt.findFrom(s,e);return a?Bo(t,a):!1}return!1}function ww(t,e){if(!(t.state.selection instanceof Mt))return!0;let{$head:n,$anchor:i,empty:r}=t.state.selection;if(!n.sameParent(i))return!0;if(!r)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 Sw(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function FN(t){if(!vi||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 i=e.firstChild;Sw(t,i,"true"),setTimeout(()=>Sw(t,i,"false"),20)}return!1}function jN(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function HN(t,e){let n=e.keyCode,i=jN(e);if(n==8||Ki&&n==72&&i=="c")return ww(t,-1)||ya(t,-1);if(n==46&&!e.shiftKey||Ki&&n==68&&i=="c")return ww(t,1)||ya(t,1);if(n==13||n==27)return!0;if(n==37||Ki&&n==66&&i=="c"){let r=n==37?bw(t,t.state.selection.from)=="ltr"?-1:1:-1;return vw(t,r,i)||ya(t,r)}else if(n==39||Ki&&n==70&&i=="c"){let r=n==39?bw(t,t.state.selection.from)=="ltr"?1:-1:1;return vw(t,r,i)||ya(t,r)}else{if(n==38||Ki&&n==80&&i=="c")return Aw(t,-1,i)||ya(t,-1);if(n==40||Ki&&n==78&&i=="c")return FN(t)||Aw(t,1,i)||ya(t,1);if(i==(Ki?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function am(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:i,openStart:r,openEnd:o}=e;for(;r>1&&o>1&&i.childCount==1&&i.firstChild.childCount==1;){r--,o--;let p=i.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),i=p.content}let s=t.someProp("clipboardSerializer")||ys.fromSchema(t.state.schema),a=Pw(),l=a.createElement("div");l.appendChild(s.serializeFragment(i,{document:a}));let u=l.firstChild,c,d=0;for(;u&&u.nodeType==1&&(c=Mw[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=a.createElement(c[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
213
+
214
+ `);return{dom:l,text:f,slice:e}}function Cw(t,e,n,i,r){let o=r.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(i||o||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,o||i,t)}),o)return e?new Xe(Ee.from(t.state.schema.text(e.replace(/\r\n?/g,`
215
+ `))),0,0):Xe.empty;let d=t.someProp("clipboardTextParser",f=>f(e,r,i,t));if(d)a=d;else{let f=r.marks(),{schema:p}=t.state,h=ys.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let v=s.appendChild(document.createElement("p"));m&&v.appendChild(h.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=qN(n),eu&&XN(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Mo.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:r,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!UN.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)a=GN(xw(a,+c[1],+c[2]),c[4]);else if(a=Xe.maxOpen(KN(a.content,r),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d<a.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=xw(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const UN=/^(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 KN(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=r.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&Ow(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=Tw(s[s.length-1],o.length));let c=kw(a,l);s.push(c),r=r.matchType(c.type),o=l}}),s)return Ee.from(s)}return t}function kw(t,e,n=0){for(let i=e.length-1;i>=n;i--)t=e[i].create(null,Ee.from(t));return t}function Ow(t,e,n,i,r){if(r<t.length&&r<e.length&&t[r]==e[r]){let o=Ow(t,e,n,i.lastChild,r+1);if(o)return i.copy(i.content.replaceChild(i.childCount-1,o));if(i.contentMatchAt(i.childCount).matchType(r==t.length-1?n.type:t[r+1]))return i.copy(i.content.append(Ee.from(kw(n,t,r+1))))}}function Tw(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Tw(t.lastChild,e-1)),i=t.contentMatchAt(t.childCount).fillBefore(Ee.empty,!0);return t.copy(n.append(i))}function lm(t,e,n,i,r,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),r<i-1&&(a=lm(a,e,n,i,r+1,o)),r>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=r).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Ee.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function xw(t,e,n){return e<t.openStart&&(t=new Xe(lm(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Xe(lm(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Mw={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 Ew=null;function Pw(){return Ew||(Ew=document.implementation.createHTMLDocument("title"))}let um=null;function WN(t){let e=window.trustedTypes;return e?(um||(um=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),um.createHTML(t)):t}function qN(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Pw().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),r;if((r=i&&Mw[i[1].toLowerCase()])&&(t=r.map(o=>"<"+o+">").join("")+t+r.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=WN(t),r)for(let o=0;o<r.length;o++)n=n.querySelector(r[o])||n;return n}function XN(t){let e=t.querySelectorAll(ui?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let i=e[n];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}function GN(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,i;try{i=JSON.parse(e)}catch{return t}let{content:r,openStart:o,openEnd:s}=t;for(let a=i.length-2;a>=0;a-=2){let l=n.nodes[i[a]];if(!l||l.hasRequiredAttrs())break;r=Ee.from(l.create(i[a+1],r)),o++,s++}return new Xe(r,o,s)}const yi={},bi={},ZN={touchstart:!0,touchmove:!0};class _N{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 JN(t){for(let e in yi){let n=yi[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=i=>{QN(t,i)&&!dm(t,i)&&(t.editable||!(i.type in bi))&&n(t,i)},ZN[e]?{passive:!0}:void 0)}vi&&t.dom.addEventListener("input",()=>null),cm(t)}function $o(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function YN(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 cm(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=i=>dm(t,i))})}function dm(t,e){return t.someProp("handleDOMEvents",n=>{let i=n[e.type];return i?i(t,e)||e.defaultPrevented:!1})}function QN(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 eB(t,e){!dm(t,e)&&yi[e.type]&&(t.editable||!(e.type in bi))&&yi[e.type](t,e)}bi.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Lw(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(_r&&ui&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ga&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();t.input.lastIOSEnter=i,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==i&&(t.someProp("handleKeyDown",r=>r(t,ws(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",i=>i(t,n))||HN(t,n)?n.preventDefault():$o(t,"key")},bi.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},bi.keypress=(t,e)=>{let n=e;if(Lw(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ki&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let i=t.state.selection;if(!(i instanceof Mt)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(n.charCode);!/[\r\n]/.test(r)&&!t.someProp("handleTextInput",o=>o(t,i.$from.pos,i.$to.pos,r))&&t.dispatch(t.state.tr.insertText(r).scrollIntoView()),n.preventDefault()}};function qc(t){return{left:t.clientX,top:t.clientY}}function tB(t,e){let n=e.x-t.clientX,i=e.y-t.clientY;return n*n+i*i<100}function fm(t,e,n,i,r){if(i==-1)return!1;let o=t.state.doc.resolve(i);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),r,!0):a(t,n,o.node(s),o.before(s),r,!1)))return!0;return!1}function ba(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let i=t.state.tr.setSelection(e);i.setMeta("pointer",!0),t.dispatch(i)}function nB(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),i=n.nodeAfter;return i&&i.isAtom&&mt.isSelectable(i)?(ba(t,new mt(n)),!0):!1}function iB(t,e){if(e==-1)return!1;let n=t.state.selection,i,r;n instanceof mt&&(i=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(mt.isSelectable(a)){i&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?r=o.before(n.$from.depth):r=o.before(s);break}}return r!=null?(ba(t,mt.create(t.state.doc,r)),!0):!1}function rB(t,e,n,i,r){return fm(t,"handleClickOn",e,n,i)||t.someProp("handleClick",o=>o(t,e,i))||(r?iB(t,n):nB(t,n))}function oB(t,e,n,i){return fm(t,"handleDoubleClickOn",e,n,i)||t.someProp("handleDoubleClick",r=>r(t,e,i))}function sB(t,e,n,i){return fm(t,"handleTripleClickOn",e,n,i)||t.someProp("handleTripleClick",r=>r(t,e,i))||aB(t,n,i)}function aB(t,e,n){if(n.button!=0)return!1;let i=t.state.doc;if(e==-1)return i.inlineContent?(ba(t,Mt.create(i,0,i.content.size)),!0):!1;let r=i.resolve(e);for(let o=r.depth+1;o>0;o--){let s=o>r.depth?r.nodeAfter:r.node(o),a=r.before(o);if(s.inlineContent)ba(t,Mt.create(i,a+1,a+1+s.content.size));else if(mt.isSelectable(s))ba(t,mt.create(i,a));else continue;return!0}}function pm(t){return Xc(t)}const Iw=Ki?"metaKey":"ctrlKey";yi.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let i=pm(t),r=Date.now(),o="singleClick";r-t.input.lastClick.time<500&&tB(n,t.input.lastClick)&&!n[Iw]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(qc(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new lB(t,s,n,!!i)):(o=="doubleClick"?oB:sB)(t,s.pos,s.inside,n)?n.preventDefault():$o(t,"pointer"))};class lB{constructor(e,n,i,r){this.view=e,this.pos=n,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!i[Iw],this.allowDefault=i.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}const a=r?null:i.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(i.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof mt&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&dr&&!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)),$o(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(()=>Yr(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(qc(e))),this.updateAllowDefault(e),this.allowDefault||!n?$o(this.view,"pointer"):rB(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||vi&&this.mightDrag&&!this.mightDrag.node.isAtom||ui&&!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)?(ba(this.view,Vt.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):$o(this.view,"pointer")}move(e){this.updateAllowDefault(e),$o(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)}}yi.touchstart=t=>{t.input.lastTouch=Date.now(),pm(t),$o(t,"pointer")},yi.touchmove=t=>{t.input.lastTouch=Date.now(),$o(t,"pointer")},yi.contextmenu=t=>pm(t);function Lw(t,e){return t.composing?!0:vi&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const uB=_r?5e3:-1;bi.compositionstart=bi.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Mt&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Xc(t,!0),t.markCursor=null;else if(Xc(t,!e.selection.empty),dr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=t.domSelectionRange();for(let r=i.focusNode,o=i.focusOffset;r&&r.nodeType==1&&o!=0;){let s=o<0?r.lastChild:r.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else r=s,o=-1}}t.input.composing=!0}Dw(t,uB)},bi.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++,Dw(t,20))};function Dw(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Xc(t),e))}function Rw(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=dB());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function cB(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=nN(e.focusNode,e.focusOffset),i=iN(e.focusNode,e.focusOffset);if(n&&i&&n!=i){let r=i.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||i==o)return o;if(!r||!r.isText(i.nodeValue))return i;if(t.input.compositionNode==i){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return i}}return n||i}function dB(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Xc(t,e=!1){if(!(_r&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Rw(t),e||t.docView&&t.docView.dirty){let n=nm(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 fB(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 i=getSelection(),r=document.createRange();r.selectNodeContents(e),t.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ou=Oi&&Do<15||ga&&lN<604;yi.copy=bi.cut=(t,e)=>{let n=e,i=t.state.selection,r=n.type=="cut";if(i.empty)return;let o=ou?null:n.clipboardData,s=i.content(),{dom:a,text:l}=am(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):fB(t,a),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function pB(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function hB(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),n?su(t,i.value,null,r,e):su(t,i.textContent,i.innerHTML,r,e)},50)}function su(t,e,n,i,r){let o=Cw(t,e,n,i,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,r,o||Xe.empty)))return!0;if(!o)return!1;let s=pB(o),a=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Nw(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," "):""}bi.paste=(t,e)=>{let n=e;if(t.composing&&!_r)return;let i=ou?null:n.clipboardData,r=t.input.shiftKey&&t.input.lastKeyCode!=45;i&&su(t,Nw(i),i.getData("text/html"),r,n)?n.preventDefault():hB(t,n)};class Bw{constructor(e,n,i){this.slice=e,this.move=n,this.node=i}}const mB=Ki?"altKey":"ctrlKey";function $w(t,e){let n=t.someProp("dragCopies",i=>!i(e));return n??!e[mB]}yi.dragstart=(t,e)=>{let n=e,i=t.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=t.state.selection,o=r.empty?null:t.posAtCoords(qc(n)),s;if(!(o&&o.pos>=r.from&&o.pos<=(r instanceof mt?r.to-1:r.to))){if(i&&i.mightDrag)s=mt.create(t.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=mt.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:u,slice:c}=am(t,a);(!n.dataTransfer.files.length||!ui||U2>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ou?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ou||n.dataTransfer.setData("text/plain",u),t.dragging=new Bw(c,$w(t,n),s)},yi.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},bi.dragover=bi.dragenter=(t,e)=>e.preventDefault(),bi.drop=(t,e)=>{let n=e,i=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let r=t.posAtCoords(qc(n));if(!r)return;let o=t.state.doc.resolve(r.pos),s=i&&i.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=Cw(t,Nw(n.dataTransfer),ou?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(i&&$w(t,n));if(t.someProp("handleDrop",h=>h(t,n,s||Xe.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?UR(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(a){let{node:h}=i;h?h.replace(u):u.deleteSelection()}let c=u.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(f))return;let p=u.doc.resolve(c);if(d&&mt.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new mt(p));else{let h=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,v,S,b)=>h=b),u.setSelection(rm(t,p,u.doc.resolve(h)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},yi.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())&&Yr(t)},20))},yi.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)},yi.beforeinput=(t,e)=>{if(ui&&_r&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:i}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=i||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,ws(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in bi)yi[t]=bi[t];function au(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 Gc{constructor(e,n){this.toDOM=e,this.spec=n||Os,this.side=this.spec.side||0}map(e,n,i,r){let{pos:o,deleted:s}=e.mapResult(n.from+r,this.side<0?-1:1);return s?null:new Ni(o-i,o-i,this)}valid(){return!0}eq(e){return this==e||e instanceof Gc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&au(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Vo{constructor(e,n){this.attrs=e,this.spec=n||Os}map(e,n,i,r){let o=e.map(n.from+r,this.spec.inclusiveStart?-1:1)-i,s=e.map(n.to+r,this.spec.inclusiveEnd?1:-1)-i;return o>=s?null:new Ni(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Vo&&au(this.attrs,e.attrs)&&au(this.spec,e.spec)}static is(e){return e.type instanceof Vo}destroy(){}}class hm{constructor(e,n){this.attrs=e,this.spec=n||Os}map(e,n,i,r){let o=e.mapResult(n.from+r,1);if(o.deleted)return null;let s=e.mapResult(n.to+r,-1);return s.deleted||s.pos<=o.pos?null:new Ni(o.pos-i,s.pos-i,this)}valid(e,n){let{index:i,offset:r}=e.content.findIndex(n.from),o;return r==n.from&&!(o=e.child(i)).isText&&r+o.nodeSize==n.to}eq(e){return this==e||e instanceof hm&&au(this.attrs,e.attrs)&&au(this.spec,e.spec)}destroy(){}}class Ni{constructor(e,n,i){this.from=e,this.to=n,this.type=i}copy(e,n){return new Ni(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,i){return this.type.map(e,this,n,i)}static widget(e,n,i){return new Ni(e,e,new Gc(n,i))}static inline(e,n,i,r){return new Ni(e,n,new Vo(i,r))}static node(e,n,i,r){return new Ni(e,n,new hm(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Vo}get widget(){return this.type instanceof Gc}}const Aa=[],Os={};class Bn{constructor(e,n){this.local=e.length?e:Aa,this.children=n.length?n:Aa}static create(e,n){return n.length?Zc(n,e,0,Os):ci}find(e,n,i){let r=[];return this.findInner(e??0,n??1e9,r,0,i),r}findInner(e,n,i,r,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))&&i.push(a.copy(a.from+r,a.to+r))}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,i,r+a,o)}}map(e,n,i){return this==ci||e.maps.length==0?this:this.mapInner(e,n,0,0,i||Os)}mapInner(e,n,i,r,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,i,r);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?gB(this.children,s||[],e,n,i,r,o):s?new Bn(s.sort(Ts),Aa):ci}add(e,n){return n.length?this==ci?Bn.create(e,n):this.addInner(e,n,0):this}addInner(e,n,i){let r,o=0;e.forEach((a,l)=>{let u=l+i,c;if(c=zw(n,a,u)){for(r||(r=this.children.slice());o<r.length&&r[o]<l;)o+=3;r[o]==l?r[o+2]=r[o+2].addInner(a,c,u+1):r.splice(o,0,l,l+a.nodeSize,Zc(c,a,u+1,Os)),o+=3}});let s=Vw(o?Fw(n):n,-i);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Bn(s.length?this.local.concat(s).sort(Ts):this.local,r||this.children)}remove(e){return e.length==0||this==ci?this:this.removeInner(e,0)}removeInner(e,n){let i=this.children,r=this.local;for(let o=0;o<i.length;o+=3){let s,a=i[o]+n,l=i[o+1]+n;for(let c=0,d;c<e.length;c++)(d=e[c])&&d.from>a&&d.to<l&&(e[c]=null,(s||(s=[])).push(d));if(!s)continue;i==this.children&&(i=this.children.slice());let u=i[o+2].removeInner(s,a+1);u!=ci?i[o+2]=u:(i.splice(o,3),o-=3)}if(r.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<r.length;a++)r[a].eq(s,n)&&(r==this.local&&(r=this.local.slice()),r.splice(a--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new Bn(r,i):ci}forChild(e,n){if(this==ci)return this;if(n.isLeaf)return Bn.empty;let i,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(i=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Vo){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;u<c&&(r||(r=[])).push(l.copy(u,c))}}if(r){let a=new Bn(r.sort(Ts),Aa);return i?new zo([a,i]):a}return i||ci}eq(e){if(this==e)return!0;if(!(e instanceof Bn)||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 mm(this.localsInner(e))}localsInner(e){if(this==ci)return Aa;if(e.inlineContent||!this.local.some(Vo.is))return this.local;let n=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof Vo||n.push(this.local[i]);return n}forEachSet(e){e(this)}}Bn.empty=new Bn([],[]),Bn.removeOverlap=mm;const ci=Bn.empty;class zo{constructor(e){this.members=e}map(e,n){const i=this.members.map(r=>r.map(e,n,Os));return zo.from(i)}forChild(e,n){if(n.isLeaf)return Bn.empty;let i=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,n);o!=ci&&(o instanceof zo?i=i.concat(o.members):i.push(o))}return zo.from(i)}eq(e){if(!(e instanceof zo)||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,i=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(!n)n=o;else{i&&(n=n.slice(),i=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?mm(i?n:n.sort(Ts)):Aa}static from(e){switch(e.length){case 0:return ci;case 1:return e[0];default:return new zo(e.every(n=>n instanceof Bn)?e:e.reduce((n,i)=>n.concat(i instanceof Bn?i:i.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function gB(t,e,n,i,r,o,s){let a=t.slice();for(let u=0,c=o;u<n.maps.length;u++){let d=0;n.maps[u].forEach((f,p,h,m)=>{let v=m-h-(p-f);for(let S=0;S<a.length;S+=3){let b=a[S+1];if(b<0||f>b+c-d)continue;let k=a[S]+c-d;p>=k?a[S+1]=f<=k?-2:-1:f>=c&&v&&(a[S]+=v,a[S+1]+=v)}d+=v}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let c=n.map(t[u]+o),d=c-r;if(d<0||d>=i.content.size){l=!0;continue}let f=n.map(t[u+1]+o,-1),p=f-r,{index:h,offset:m}=i.content.findIndex(d),v=i.maybeChild(h);if(v&&m==d&&m+v.nodeSize==p){let S=a[u+2].mapInner(n,v,c+1,t[u]+o+1,s);S!=ci?(a[u]=d,a[u+1]=p,a[u+2]=S):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=vB(a,t,e,n,r,o,s),c=Zc(u,i,0,s);e=c.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let p=c.children[d];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new Bn(e.sort(Ts),a)}function Vw(t,e){if(!e||!t.length)return t;let n=[];for(let i=0;i<t.length;i++){let r=t[i];n.push(new Ni(r.from+e,r.to+e,r.type))}return n}function vB(t,e,n,i,r,o,s){function a(l,u){for(let c=0;c<l.local.length;c++){let d=l.local[c].map(i,r,u);d?n.push(d):s.onRemove&&s.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)a(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function zw(t,e,n){if(e.isLeaf)return null;let i=n+e.nodeSize,r=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<i&&((r||(r=[])).push(s),t[o]=null);return r}function Fw(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Zc(t,e,n,i){let r=[],o=!1;e.forEach((a,l)=>{let u=zw(t,a,l+n);if(u){o=!0;let c=Zc(u,a,n+l+1,i);c!=ci&&r.push(l,l+a.nodeSize,c)}});let s=Vw(o?Fw(t):t,-n).sort(Ts);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(i.onRemove&&i.onRemove(s[a].spec),s.splice(a--,1));return s.length||r.length?new Bn(s,r):ci}function Ts(t,e){return t.from-e.from||t.to-e.to}function mm(t){let e=t;for(let n=0;n<e.length-1;n++){let i=e[n];if(i.from!=i.to)for(let r=n+1;r<e.length;r++){let o=e[r];if(o.from==i.from){o.to!=i.to&&(e==t&&(e=t.slice()),e[r]=o.copy(o.from,i.to),jw(e,r+1,o.copy(i.to,o.to)));continue}else{o.from<i.to&&(e==t&&(e=t.slice()),e[n]=i.copy(i.from,o.from),jw(e,r,i.copy(o.from,i.to)));break}}}return e}function jw(t,e,n){for(;e<t.length&&Ts(n,t[e])>0;)e++;t.splice(e,0,n)}function gm(t){let e=[];return t.someProp("decorations",n=>{let i=n(t.state);i&&i!=ci&&e.push(i)}),t.cursorWrapper&&e.push(Bn.create(t.state.doc,[t.cursorWrapper.deco])),zo.from(e)}const yB={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},bB=Oi&&Do<=11;class AB{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 wB{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new AB,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let r=0;r<i.length;r++)this.queue.push(i[r]);Oi&&Do<=11&&i.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),bB&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.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,yB)),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(mw(this.view)){if(this.suppressingSelectionUpdates)return Yr(this.view);if(Oi&&Do<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&As(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,i;for(let o=e.focusNode;o;o=ma(o))n.add(o);for(let o=e.anchorNode;o;o=ma(o))if(n.has(o)){i=o;break}let r=i&&this.view.docView.nearestDesc(i);if(r&&r.ignoreMutation({type:"selection",target:i.nodeType==3?i.parentNode:i}))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 i=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&mw(e)&&!this.ignoreSelectionChange(i),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],l);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(dr&&l.length){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||kB(e,d)!=p)&&f.remove()}}}let u=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Hc(i)&&(u=nm(e))&&u.eq(Vt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Yr(e),this.currentSelection.set(i),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,s),SB(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(i)||Yr(e),this.currentSelection.set(i))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let i=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(i==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!i||i.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let d=e.addedNodes[c];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(e.target))return{from:i.posBefore,to:i.posAfter};let r=e.previousSibling,o=e.nextSibling;if(Oi&&Do<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=e.addedNodes[c];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(r=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f)}let s=r&&r.parentNode==e.target?ti(r)+1:0,a=i.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?ti(o):e.target.childNodes.length,u=i.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=e.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Hw=new WeakMap,Uw=!1;function SB(t){if(!Hw.has(t)&&(Hw.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=dr,Uw)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."),Uw=!0}}function Kw(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return As(s.node,s.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}function CB(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return Kw(t,r)}let n;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",i,!0),n?Kw(t,n):null}function kB(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let i=t.docView.nearestDesc(n,!0);if(i&&i.node.isBlock)return n}return null}function OB(t,e,n){let{node:i,fromOffset:r,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,c=l.anchorNode;if(c&&t.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:l.anchorOffset}],Hc(l)||u.push({node:l.focusNode,offset:l.focusOffset})),ui&&t.input.lastKeyCode===8)for(let v=o;v>r;v--){let S=i.childNodes[v-1],b=S.pmViewDesc;if(S.nodeName=="BR"&&!b){o=v;break}if(!b||b.size)break}let d=t.state.doc,f=t.someProp("domParser")||Mo.fromSchema(t.state.schema),p=d.resolve(s),h=null,m=f.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:r,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:TB,context:p});if(u&&u[0].pos!=null){let v=u[0].pos,S=u[1]&&u[1].pos;S==null&&(S=v),h={anchor:v+s,head:S+s}}return{doc:m,sel:h,from:s,to:a}}function TB(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(vi&&/^(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||vi&&/^(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 xB=/^(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 MB(t,e,n,i,r){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let R=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,M=nm(t,R);if(M&&!t.state.selection.eq(M)){if(ui&&_r&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",$=>$(t,ws(13,"Enter"))))return;let D=t.state.tr.setSelection(M);R=="pointer"?D.setMeta("pointer",!0):R=="key"&&D.scrollIntoView(),o&&D.setMeta("composition",o),t.dispatch(D)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=OB(t,e,n),c=t.state.doc,d=c.slice(u.from,u.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=IB(d.content,u.doc.content,u.from,f,p);if(h&&t.input.domChangeCount++,(ga&&t.input.lastIOSEnter>Date.now()-225||_r)&&r.some(R=>R.nodeType==1&&!xB.test(R.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",R=>R(t,ws(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(i&&l instanceof Mt&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let R=Ww(t,t.state.doc,u.sel);if(R&&!R.eq(t.state.selection)){let M=t.state.tr.setSelection(R);o&&M.setMeta("composition",o),t.dispatch(M)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof Mt&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Oi&&Do<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=u.doc.resolveNoCache(h.start-u.from),v=u.doc.resolveNoCache(h.endB-u.from),S=c.resolve(h.start),b=m.sameParent(v)&&m.parent.inlineContent&&S.end()>=h.endA,k;if((ga&&t.input.lastIOSEnter>Date.now()-225&&(!b||r.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!b&&m.pos<u.doc.content.size&&(!m.sameParent(v)||!m.parent.inlineContent)&&!/\S/.test(u.doc.textBetween(m.pos,v.pos,"",""))&&(k=Vt.findFrom(u.doc.resolve(m.pos+1),1,!0))&&k.head>m.pos)&&t.someProp("handleKeyDown",R=>R(t,ws(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&PB(c,h.start,h.endA,m,v)&&t.someProp("handleKeyDown",R=>R(t,ws(8,"Backspace")))){_r&&ui&&t.domObserver.suppressSelectionUpdates();return}ui&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),_r&&!b&&m.start()!=v.start()&&v.parentOffset==0&&m.depth==v.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,v=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(R){return R(t,ws(13,"Enter"))})},20));let A=h.start,w=h.endA,y,C,P;if(b){if(m.pos==v.pos)Oi&&Do<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Yr(t),20)),y=t.state.tr.delete(A,w),C=c.resolve(h.start).marksAcross(c.resolve(h.endA));else if(h.endA==h.endB&&(P=EB(m.parent.content.cut(m.parentOffset,v.parentOffset),S.parent.content.cut(S.parentOffset,h.endA-S.start()))))y=t.state.tr,P.type=="add"?y.addMark(A,w,P.mark):y.removeMark(A,w,P.mark);else if(m.parent.child(m.index()).isText&&m.index()==v.index()-(v.textOffset?0:1)){let R=m.parent.textBetween(m.parentOffset,v.parentOffset);if(t.someProp("handleTextInput",M=>M(t,A,w,R)))return;y=t.state.tr.insertText(R,A,w)}}if(y||(y=t.state.tr.replace(A,w,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let R=Ww(t,y.doc,u.sel);R&&!(ui&&t.composing&&R.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(R.head==A||R.head==y.mapping.map(w)-1)||Oi&&R.empty&&R.head==A)&&y.setSelection(R)}C&&y.ensureMarks(C),o&&y.setMeta("composition",o),t.dispatch(y.scrollIntoView())}function Ww(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:rm(t,e.resolve(n.anchor),e.resolve(n.head))}function EB(t,e){let n=t.firstChild.marks,i=e.firstChild.marks,r=n,o=i,s,a,l;for(let c=0;c<i.length;c++)r=i[c].removeFromSet(r);for(let c=0;c<n.length;c++)o=n[c].removeFromSet(o);if(r.length==1&&o.length==0)a=r[0],s="add",l=c=>c.mark(a.addToSet(c.marks));else if(r.length==0&&o.length==1)a=o[0],s="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(Ee.from(u).eq(t))return{mark:a,type:s}}function PB(t,e,n,i,r){if(n-e<=r.pos-i.pos||vm(i,!0,!1)<r.pos)return!1;let o=t.resolve(e);if(!i.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(vm(o,!0,!0));return!s.parent.isTextblock||s.pos>n||vm(s,!0,!1)<n?!1:i.parent.content.cut(i.parentOffset).eq(s.parent.content)}function vm(t,e,n){let i=t.depth,r=e?t.end():t.pos;for(;i>0&&(e||t.indexAfter(i)==t.node(i).childCount);)i--,r++,e=!1;if(n){let o=t.node(i).maybeChild(t.indexAfter(i));for(;o&&!o.isLeaf;)o=o.firstChild,r++}return r}function IB(t,e,n,i,r){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(r=="end"){let l=Math.max(0,o-Math.min(s,a));i-=s+l-o}if(s<o&&t.size<e.size){let l=i<=o&&i>=s?o-i:0;o-=l,o&&o<e.size&&qw(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=i<=o&&i>=a?o-i:0;o-=l,o&&o<t.size&&qw(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function qw(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 LB{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 _N,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Jw),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=Zw(this),Gw(this),this.nodeViews=_w(this),this.docView=iw(this.state.doc,Xw(this),gm(this),this.dom,this),this.domObserver=new wB(this,(i,r,o,s)=>MB(this,i,r,o,s)),this.domObserver.start(),JN(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&&cm(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Jw),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let i in this._props)n[i]=this._props[i];n.state=this.state;for(let i in e)n[i]=e[i];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var i;let r=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Rw(this),s=!0),this.state=e;let a=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=_w(this);RB(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&cm(this),this.editable=Zw(this),Gw(this);let l=gm(this),u=Xw(this),c=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(r.selection))&&(s=!0);let f=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&dN(this);if(s){this.domObserver.stop();let p=d&&(Oi||ui)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&DB(r.selection,e.selection);if(d){let h=ui?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=cB(this)),(o||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=iw(e.doc,u,l,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&NN(this))?Yr(this,p):(pw(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((i=this.dragging)===null||i===void 0)&&i.node&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&fN(f)}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 mt){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&K2(this,n.getBoundingClientRect(),e)}else K2(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 i=this.directPlugins[n];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let i=this.state.plugins[n];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let i=this.pluginViews[n];i.update&&i.update(this,e)}}updateDraggedNode(e,n){let i=e.node,r=-1;if(this.state.doc.nodeAt(i.from)==i.node)r=i.from;else{let o=i.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==i.node&&(r=o)}this.dragging=new Bw(e.slice,e.move,r<0?void 0:mt.create(this.state.doc,r))}someProp(e,n){let i=this._props&&this._props[e],r;if(i!=null&&(r=n?n(i):i))return r;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(r=n?n(a):a))return r}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(r=n?n(a):a))return r}}hasFocus(){if(Oi){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&&pN(this.dom),Yr(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 yN(this,e)}coordsAtPos(e,n=1){return _2(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,i=-1){let r=this.docView.posFromDOM(e,n,i);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,n){return CN(this,n||this.state,e)}pasteHTML(e,n){return su(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return su(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return am(this,e)}destroy(){this.docView&&(YN(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],gm(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,eN())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return eB(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?vi&&this.root.nodeType===11&&oN(this.dom.ownerDocument)==this.dom&&CB(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Xw(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 i in n)i=="class"?e.class+=" "+n[i]:i=="style"?e.style=(e.style?e.style+";":"")+n[i]:!e[i]&&i!="contenteditable"&&i!="nodeName"&&(e[i]=String(n[i]))}),e.translate||(e.translate="no"),[Ni.node(0,t.state.doc.content.size,e)]}function Gw(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:Ni.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Zw(t){return!t.someProp("editable",e=>e(t.state)===!1)}function DB(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 _w(t){let e=Object.create(null);function n(i){for(let r in i)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=i[r])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function RB(t,e){let n=0,i=0;for(let r in t){if(t[r]!=e[r])return!0;n++}for(let r in e)i++;return n!=i}function Jw(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 Fo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},_c={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},NB=typeof navigator<"u"&&/Mac/.test(navigator.platform),BB=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ni=0;ni<10;ni++)Fo[48+ni]=Fo[96+ni]=String(ni);for(var ni=1;ni<=24;ni++)Fo[ni+111]="F"+ni;for(var ni=65;ni<=90;ni++)Fo[ni]=String.fromCharCode(ni+32),_c[ni]=String.fromCharCode(ni);for(var ym in Fo)_c.hasOwnProperty(ym)||(_c[ym]=Fo[ym]);function $B(t){var e=NB&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||BB&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?_c:Fo)[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 VB=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function zB(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let i,r,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))VB?s=!0:r=!0;else throw new Error("Unrecognized modifier name: "+l)}return i&&(n="Alt-"+n),r&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function FB(t){let e=Object.create(null);for(let n in t)e[zB(n)]=t[n];return e}function bm(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 jB(t){return new Wn({props:{handleKeyDown:HB(t)}})}function HB(t){let e=FB(t);return function(n,i){let r=$B(i),o,s=e[bm(r,i)];if(s&&s(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let a=e[bm(r,i,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((i.shiftKey||i.altKey||i.metaKey||r.charCodeAt(0)>127)&&(o=Fo[i.keyCode])&&o!=r){let a=e[bm(o,i)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Am=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Yw(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Qw=(t,e,n)=>{let i=Yw(t,n);if(!i)return!1;let r=wm(i);if(!r){let s=i.blockRange(),a=s&&ca(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=r.nodeBefore;if(lS(t,r,e,-1))return!0;if(i.parent.content.size==0&&(wa(o,"end")||mt.isSelectable(o)))for(let s=i.depth;;s--){let a=Fc(t.doc,i.before(s),i.after(s),Xe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(wa(o,"end")?Vt.findFrom(l.doc.resolve(l.mapping.map(r.pos,-1)),-1):mt.create(l.doc,r.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||i.node(s-1).childCount>1)break}return o.isAtom&&r.depth==i.depth-1?(e&&e(t.tr.delete(r.pos-o.nodeSize,r.pos).scrollIntoView()),!0):!1},UB=(t,e,n)=>{let i=Yw(t,n);if(!i)return!1;let r=wm(i);return r?eS(t,r,e):!1},KB=(t,e,n)=>{let i=nS(t,n);if(!i)return!1;let r=Sm(i);return r?eS(t,r,e):!1};function eS(t,e,n){let i=e.nodeBefore,r=i,o=e.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let c=r.lastChild;if(!c)return!1;r=c}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=Fc(t.doc,o,l,Xe.empty);if(!u||u.from!=o||u instanceof Un&&u.slice.size>=l-o)return!1;if(n){let c=t.tr.step(u);c.setSelection(Mt.create(c.doc,o)),n(c.scrollIntoView())}return!0}function wa(t,e,n=!1){for(let i=t;i;i=e=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const tS=(t,e,n)=>{let{$head:i,empty:r}=t.selection,o=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):i.parentOffset>0)return!1;o=wm(i)}let s=o&&o.nodeBefore;return!s||!mt.isSelectable(s)?!1:(e&&e(t.tr.setSelection(mt.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function wm(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 nS(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const iS=(t,e,n)=>{let i=nS(t,n);if(!i)return!1;let r=Sm(i);if(!r)return!1;let o=r.nodeAfter;if(lS(t,r,e,1))return!0;if(i.parent.content.size==0&&(wa(o,"start")||mt.isSelectable(o))){let s=Fc(t.doc,i.before(),i.after(),Xe.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(wa(o,"start")?Vt.findFrom(a.doc.resolve(a.mapping.map(r.pos)),1):mt.create(a.doc,a.mapping.map(r.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&r.depth==i.depth-1?(e&&e(t.tr.delete(r.pos,r.pos+o.nodeSize).scrollIntoView()),!0):!1},rS=(t,e,n)=>{let{$head:i,empty:r}=t.selection,o=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;o=Sm(i)}let s=o&&o.nodeAfter;return!s||!mt.isSelectable(s)?!1:(e&&e(t.tr.setSelection(mt.create(t.doc,o.pos)).scrollIntoView()),!0)};function Sm(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 WB=(t,e)=>{let n=t.selection,i=n instanceof mt,r;if(i){if(n.node.isTextblock||!Io(t.doc,n.from))return!1;r=n.from}else if(r=zc(t.doc,n.from,-1),r==null)return!1;if(e){let o=t.tr.join(r);i&&o.setSelection(mt.create(o.doc,r-t.doc.resolve(r).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},qB=(t,e)=>{let n=t.selection,i;if(n instanceof mt){if(n.node.isTextblock||!Io(t.doc,n.to))return!1;i=n.to}else if(i=zc(t.doc,n.to,1),i==null)return!1;return e&&e(t.tr.join(i).scrollIntoView()),!0},XB=(t,e)=>{let{$from:n,$to:i}=t.selection,r=n.blockRange(i),o=r&&ca(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},oS=(t,e)=>{let{$head:n,$anchor:i}=t.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(e&&e(t.tr.insertText(`
216
+ `).scrollIntoView()),!0)};function Cm(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 GB=(t,e)=>{let{$head:n,$anchor:i}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),o=n.indexAfter(-1),s=Cm(r.contentMatchAt(o));if(!s||!r.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Vt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},sS=(t,e)=>{let n=t.selection,{$from:i,$to:r}=n;if(n instanceof Ri||i.parent.inlineContent||r.parent.inlineContent)return!1;let o=Cm(r.parent.contentMatchAt(r.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(Mt.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},aS=(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(Gr(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let i=n.blockRange(),r=i&&ca(i);return r==null?!1:(e&&e(t.tr.lift(i,r).scrollIntoView()),!0)};function ZB(t){return(e,n)=>{let{$from:i,$to:r}=e.selection;if(e.selection instanceof mt&&e.selection.node.isBlock)return!i.parentOffset||!Gr(e.doc,i.pos)?!1:(n&&n(e.tr.split(i.pos).scrollIntoView()),!0);if(!i.depth)return!1;let o=[],s,a,l=!1,u=!1;for(let p=i.depth;;p--)if(i.node(p).isBlock){l=i.end(p)==i.pos+(i.depth-p),u=i.start(p)==i.pos-(i.depth-p),a=Cm(i.node(p-1).contentMatchAt(i.indexAfter(p-1))),o.unshift(l&&a?{type:a}:null),s=p;break}else{if(p==1)return!1;o.unshift(null)}let c=e.tr;(e.selection instanceof Mt||e.selection instanceof Ri)&&c.deleteSelection();let d=c.mapping.map(i.pos),f=Gr(c.doc,d,o.length,o);if(f||(o[0]=a?{type:a}:null,f=Gr(c.doc,d,o.length,o)),c.split(d,o.length,o),!l&&u&&i.node(s).type!=a){let p=c.mapping.map(i.before(s)),h=c.doc.resolve(p);a&&i.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&c.setNodeMarkup(c.mapping.map(i.before(s)),a)}return n&&n(c.scrollIntoView()),!0}}const _B=ZB(),JB=(t,e)=>{let{$from:n,to:i}=t.selection,r,o=n.sharedDepth(i);return o==0?!1:(r=n.before(o),e&&e(t.tr.setSelection(mt.create(t.doc,r))),!0)};function YB(t,e,n){let i=e.nodeBefore,r=e.nodeAfter,o=e.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-i.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(r.isTextblock||Io(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function lS(t,e,n,i){let r=e.nodeBefore,o=e.nodeAfter,s,a,l=r.type.spec.isolating||o.type.spec.isolating;if(!l&&YB(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(s=(a=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,h=Ee.empty;for(let S=s.length-1;S>=0;S--)h=Ee.from(s[S].create(null,h));h=Ee.from(r.copy(h));let m=t.tr.step(new Kn(e.pos-1,p,e.pos,p,new Xe(h,1,0),s.length,!0)),v=m.doc.resolve(p+2*s.length);v.nodeAfter&&v.nodeAfter.type==r.type&&Io(m.doc,v.pos)&&m.join(v.pos),n(m.scrollIntoView())}return!0}let c=o.type.spec.isolating||i>0&&l?null:Vt.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),f=d&&ca(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(u&&wa(o,"start",!0)&&wa(r,"end")){let p=r,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=o,v=1;for(;!m.isTextblock;m=m.firstChild)v++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let S=Ee.empty;for(let k=h.length-1;k>=0;k--)S=Ee.from(h[k].copy(S));let b=t.tr.step(new Kn(e.pos-h.length,e.pos+o.nodeSize,e.pos+v,e.pos+o.nodeSize-v,new Xe(S,h.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function uS(t){return function(e,n){let i=e.selection,r=t<0?i.$from:i.$to,o=r.depth;for(;r.node(o).isInline;){if(!o)return!1;o--}return r.node(o).isTextblock?(n&&n(e.tr.setSelection(Mt.create(e.doc,t<0?r.start(o):r.end(o)))),!0):!1}}const QB=uS(-1),e$=uS(1);function t$(t,e=null){return function(n,i){let{$from:r,$to:o}=n.selection,s=r.blockRange(o),a=s&&jh(s,t,e);return a?(i&&i(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function cS(t,e=null){return function(n,i){let r=!1;for(let o=0;o<n.selection.ranges.length&&!r;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,u)=>{if(r)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)r=!0;else{let c=n.doc.resolve(u),d=c.index();r=c.parent.canReplaceWith(d,d+1,t)}})}if(!r)return!1;if(i){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}i(o.scrollIntoView())}return!0}}function km(...t){return function(e,n,i){for(let r=0;r<t.length;r++)if(t[r](e,n,i))return!0;return!1}}km(Am,Qw,tS),km(Am,iS,rS),km(oS,sS,aS,_B),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function n$(t,e=null){return function(n,i){let{$from:r,$to:o}=n.selection,s=r.blockRange(o);if(!s)return!1;let a=i?n.tr:null;return i$(a,s,t,e)?(i&&i(a.scrollIntoView()),!0):!1}}function i$(t,e,n,i=null){let r=!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 l=s.resolve(e.start-2);o=new Lc(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Lc(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),r=!0}let a=jh(o,n,i,e);return a?(t&&r$(t,e,a,r,n),!0):!1}function r$(t,e,n,i,r){let o=Ee.empty;for(let c=n.length-1;c>=0;c--)o=Ee.from(n[c].type.create(n[c].attrs,o));t.step(new Kn(e.start-(i?2:0),e.end,e.start,e.end,new Xe(o,0,0),n.length,!0));let s=0;for(let c=0;c<n.length;c++)n[c].type==r&&(s=c+1);let a=n.length-s,l=e.start+n.length-(i?2:0),u=e.parent;for(let c=e.startIndex,d=e.endIndex,f=!0;c<d;c++,f=!1)!f&&Gr(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return t}function o$(t){return function(e,n){let{$from:i,$to:r}=e.selection,o=i.blockRange(r,s=>s.childCount>0&&s.firstChild.type==t);return o?n?i.node(o.depth-1).type==t?s$(e,n,t,o):a$(e,n,o):!0:!1}}function s$(t,e,n,i){let r=t.tr,o=i.end,s=i.$to.end(i.depth);o<s&&(r.step(new Kn(o-1,s,o,s,new Xe(Ee.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new Lc(r.doc.resolve(i.$from.pos),r.doc.resolve(s),i.depth));const a=ca(i);if(a==null)return!1;r.lift(i,a);let l=r.mapping.map(o,-1)-1;return Io(r.doc,l)&&r.join(l),e(r.scrollIntoView()),!0}function a$(t,e,n){let i=t.tr,r=n.parent;for(let p=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)p-=r.child(h).nodeSize,i.delete(p-1,p+1);let o=i.doc.resolve(n.start),s=o.nodeAfter;if(i.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==r.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?Ee.empty:Ee.from(r))))return!1;let d=o.pos,f=d+s.nodeSize;return i.step(new Kn(d-(a?1:0),f+(l?1:0),d+1,f-1,new Xe((a?Ee.empty:Ee.from(r.copy(Ee.empty))).append(l?Ee.empty:Ee.from(r.copy(Ee.empty))),a?0:1,l?0:1),a?0:1)),e(i.scrollIntoView()),!0}function l$(t){return function(e,n){let{$from:i,$to:r}=e.selection,o=i.blockRange(r,u=>u.childCount>0&&u.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=Ee.from(u?t.create():null),d=new Xe(Ee.from(t.create(null,Ee.from(a.type.create(null,c)))),u?3:1,0),f=o.start,p=o.end;n(e.tr.step(new Kn(f-(u?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function Jc(t){const{state:e,transaction:n}=t;let{selection:i}=n,{doc:r}=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 i},get doc(){return r},get tr(){return i=n.selection,r=n.doc,o=n.storedMarks,n}}}class Yc{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:i}=this,{view:r}=n,{tr:o}=i,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>{const d=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:i,editor:r,state:o}=this,{view:s}=r,a=[],l=!!e,u=e||o.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(i).map(([f,p])=>[f,(...m)=>{const v=this.buildProps(u,n),S=p(...m)(v);return a.push(S),d}])),run:c};return d}createCan(e){const{rawCommands:n,state:i}=this,r=!1,o=e||i.tr,s=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(e,n=!0){const{rawCommands:i,editor:r,state:o}=this,{view:s}=r,a={tr:e,editor:r,view:s,state:Jc({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(i).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}}class u${constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const i=this.callbacks[e];return i&&i.forEach(r=>r.apply(this,n)),this}off(e,n){const i=this.callbacks[e];return i&&(n?this.callbacks[e]=i.filter(r=>r!==n):delete this.callbacks[e]),this}once(e,n){const i=(...r)=>{this.off(e,i),n.apply(this,r)};return this.on(e,i)}removeAllListeners(){this.callbacks={}}}function tt(t,e,n){return t.config[e]===void 0&&t.parent?tt(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?tt(t.parent,e,n):null}):t.config[e]}function Qc(t){const e=t.filter(r=>r.type==="extension"),n=t.filter(r=>r.type==="node"),i=t.filter(r=>r.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:i}}function dS(t){const e=[],{nodeExtensions:n,markExtensions:i}=Qc(t),r=[...n,...i],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:r},l=tt(s,"addGlobalAttributes",a);if(!l)return;l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...o,...p}})})})})}),r.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=tt(s,"addAttributes",a);if(!l)return;const u=l();Object.entries(u).forEach(([c,d])=>{const f={...o,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:c,attribute:f})})}),e}function qn(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 $n(...t){return t.filter(e=>!!e).reduce((e,n)=>{const i={...e};return Object.entries(n).forEach(([r,o])=>{if(!i[r]){i[r]=o;return}if(r==="class"){const a=o?String(o).split(" "):[],l=i[r]?i[r].split(" "):[],u=a.filter(c=>!l.includes(c));i[r]=[...l,...u].join(" ")}else if(r==="style"){const a=o?o.split(";").map(c=>c.trim()).filter(Boolean):[],l=i[r]?i[r].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;l.forEach(c=>{const[d,f]=c.split(":").map(p=>p.trim());u.set(d,f)}),a.forEach(c=>{const[d,f]=c.split(":").map(p=>p.trim());u.set(d,f)}),i[r]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else i[r]=o}),i},{})}function Om(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,i)=>$n(n,i),{})}function fS(t){return typeof t=="function"}function Dt(t,e=void 0,...n){return fS(t)?e?t.bind(e)(...n):t(...n):t}function c$(t={}){return Object.keys(t).length===0&&t.constructor===Object}function d$(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function pS(t,e){return"style"in t?t:{...t,getAttrs:n=>{const i=t.getAttrs?t.getAttrs(n):t.attrs;if(i===!1)return!1;const r=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):d$(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...i,...r}}}}function hS(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&c$(n)?!1:n!=null))}function f$(t,e){var n;const i=dS(t),{nodeExtensions:r,markExtensions:o}=Qc(t),s=(n=r.find(u=>tt(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(r.map(u=>{const c=i.filter(S=>S.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((S,b)=>{const k=tt(b,"extendNodeSchema",d);return{...S,...k?k(u):{}}},{}),p=hS({...f,content:Dt(tt(u,"content",d)),marks:Dt(tt(u,"marks",d)),group:Dt(tt(u,"group",d)),inline:Dt(tt(u,"inline",d)),atom:Dt(tt(u,"atom",d)),selectable:Dt(tt(u,"selectable",d)),draggable:Dt(tt(u,"draggable",d)),code:Dt(tt(u,"code",d)),whitespace:Dt(tt(u,"whitespace",d)),linebreakReplacement:Dt(tt(u,"linebreakReplacement",d)),defining:Dt(tt(u,"defining",d)),isolating:Dt(tt(u,"isolating",d)),attrs:Object.fromEntries(c.map(S=>{var b;return[S.name,{default:(b=S==null?void 0:S.attribute)===null||b===void 0?void 0:b.default}]}))}),h=Dt(tt(u,"parseHTML",d));h&&(p.parseDOM=h.map(S=>pS(S,c)));const m=tt(u,"renderHTML",d);m&&(p.toDOM=S=>m({node:S,HTMLAttributes:Om(S,c)}));const v=tt(u,"renderText",d);return v&&(p.toText=v),[u.name,p]})),l=Object.fromEntries(o.map(u=>{const c=i.filter(v=>v.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((v,S)=>{const b=tt(S,"extendMarkSchema",d);return{...v,...b?b(u):{}}},{}),p=hS({...f,inclusive:Dt(tt(u,"inclusive",d)),excludes:Dt(tt(u,"excludes",d)),group:Dt(tt(u,"group",d)),spanning:Dt(tt(u,"spanning",d)),code:Dt(tt(u,"code",d)),attrs:Object.fromEntries(c.map(v=>{var S;return[v.name,{default:(S=v==null?void 0:v.attribute)===null||S===void 0?void 0:S.default}]}))}),h=Dt(tt(u,"parseHTML",d));h&&(p.parseDOM=h.map(v=>pS(v,c)));const m=tt(u,"renderHTML",d);return m&&(p.toDOM=v=>m({mark:v,HTMLAttributes:Om(v,c)})),[u.name,p]}));return new s2({topNode:s,nodes:a,marks:l})}function Tm(t,e){return e.nodes[t]||e.marks[t]||null}function mS(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function xm(t,e){const n=ys.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const p$=(t,e=500)=>{let n="";const i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-e),i,(r,o,s,a)=>{var l,u;const c=((u=(l=r.type.spec).toText)===null||u===void 0?void 0:u.call(l,{node:r,pos:o,parent:s,index:a}))||r.textContent||"%leaf%";n+=r.isAtom&&!r.isText?c:c.slice(0,Math.max(0,i-o))}),n};function Mm(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class ed{constructor(e){this.find=e.find,this.handler=e.handler}}const h$=(t,e)=>{if(Mm(e))return e.exec(t);const n=e(t);if(!n)return null;const i=[n.text];return i.index=n.index,i.input=t,i.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(n.replaceWith)),i};function td(t){var e;const{editor:n,from:i,to:r,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(i);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let c=!1;const d=p$(u)+o;return s.forEach(f=>{if(c)return;const p=h$(d,f.find);if(!p)return;const h=l.state.tr,m=Jc({state:l.state,transaction:h}),v={from:i-(p[0].length-o.length),to:r},{commands:S,chain:b,can:k}=new Yc({editor:n,state:m});f.handler({state:m,range:v,match:p,commands:S,chain:b,can:k})===null||!h.steps.length||(h.setMeta(a,{transform:h,from:i,to:r,text:o}),l.dispatch(h),c=!0)}),c}function m$(t){const{editor:e,rules:n}=t,i=new Wn({state:{init(){return null},apply(r,o,s){const a=r.getMeta(i);if(a)return a;const l=r.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=xm(Ee.from(c),s.schema);const{from:d}=l,f=d+c.length;td({editor:e,from:d,to:f,text:c,rules:n,plugin:i})}),r.selectionSet||r.docChanged?null:o}},props:{handleTextInput(r,o,s,a){return td({editor:e,from:o,to:s,text:a,rules:n,plugin:i})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:o}=r.state.selection;o&&td({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:i})}),!1)},handleKeyDown(r,o){if(o.key!=="Enter")return!1;const{$cursor:s}=r.state.selection;return s?td({editor:e,from:s.pos,to:s.pos,text:`
217
+ `,rules:n,plugin:i}):!1}},isInputRules:!0});return i}function g$(t){return Object.prototype.toString.call(t).slice(8,-1)}function nd(t){return g$(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function id(t,e){const n={...t};return nd(t)&&nd(e)&&Object.keys(e).forEach(i=>{nd(e[i])&&nd(t[i])?n[i]=id(t[i],e[i]):n[i]=e[i]}),n}class Qr{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=Dt(tt(this,"addOptions",{name:this.name}))),this.storage=Dt(tt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Qr(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>id(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Qr(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=Dt(tt(n,"addOptions",{name:n.name})),n.storage=Dt(tt(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:i}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const s=r.marks();if(!!!s.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=s.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&i.removeStoredMark(l),i.insertText(" ",r.pos),e.view.dispatch(i),!0}return!1}}function v$(t){return typeof t=="number"}class y${constructor(e){this.find=e.find,this.handler=e.handler}}const b$=(t,e,n)=>{if(Mm(e))return[...t.matchAll(e)];const i=e(t,n);return i?i.map(r=>{const o=[r.text];return o.index=r.index,o.input=t,o.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(r.replaceWith)),o}):[]};function A$(t){const{editor:e,state:n,from:i,to:r,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:u,can:c}=new Yc({editor:e,state:n}),d=[];return n.doc.nodesBetween(i,r,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;const m=Math.max(i,h),v=Math.min(r,h+p.content.size),S=p.textBetween(m-h,v-h,void 0,"");b$(S,o.find,s).forEach(k=>{if(k.index===void 0)return;const A=m+k.index+1,w=A+k[0].length,y={from:n.tr.mapping.map(A),to:n.tr.mapping.map(w)},C=o.handler({state:n,range:y,match:k,commands:l,chain:u,can:c,pasteEvent:s,dropEvent:a});d.push(C)})}),d.every(p=>p!==null)}let rd=null;const w$=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 S$(t){const{editor:e,rules:n}=t;let i=null,r=!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 l=({state:c,from:d,to:f,rule:p,pasteEvt:h})=>{const m=c.tr,v=Jc({state:c,transaction:m});if(!(!A$({editor:e,state:v,from:Math.max(d-1,0),to:f.b-1,rule:p,pasteEvent:h,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(c=>new Wn({view(d){const f=h=>{var m;i=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(h.target)?d.dom.parentElement:null,i&&(rd=e)},p=()=>{rd&&(rd=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(o=i===d.dom.parentElement,a=f,!o){const p=rd;p&&setTimeout(()=>{const h=p.state.selection;h&&p.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(d,f)=>{var p;const h=(p=f.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=f,r=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,p)=>{const h=d[0],m=h.getMeta("uiEvent")==="paste"&&!r,v=h.getMeta("uiEvent")==="drop"&&!o,S=h.getMeta("applyPasteRules"),b=!!S;if(!m&&!v&&!b)return;if(b){let{text:w}=S;typeof w=="string"?w=w:w=xm(Ee.from(w),p.schema);const{from:y}=S,C=y+w.length,P=w$(w);return l({rule:c,state:p,from:y,to:{b:C},pasteEvt:P})}const k=f.doc.content.findDiffStart(p.doc.content),A=f.doc.content.findDiffEnd(p.doc.content);if(!(!v$(k)||!A||k===A.b))return l({rule:c,state:p,from:k,to:A,pasteEvt:s})}}))}function C$(t){const e=t.filter((n,i)=>t.indexOf(n)!==i);return Array.from(new Set(e))}class Sa{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Sa.resolve(e),this.schema=f$(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Sa.sort(Sa.flatten(e)),i=C$(n.map(r=>r.name));return i.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${i.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const i={name:n.name,options:n.options,storage:n.storage},r=tt(n,"addExtensions",i);return r?[n,...this.flatten(r())]:n}).flat(10)}static sort(e){return e.sort((i,r)=>{const o=tt(i,"priority")||100,s=tt(r,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const i={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Tm(n.name,this.schema)},r=tt(n,"addCommands",i);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this,n=Sa.sort([...this.extensions].reverse()),i=[],r=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Tm(s.name,this.schema)},l=[],u=tt(s,"addKeyboardShortcuts",a);let c={};if(s.type==="mark"&&tt(s,"exitable",a)&&(c.ArrowRight=()=>Qr.handleExit({editor:e,mark:s})),u){const m=Object.fromEntries(Object.entries(u()).map(([v,S])=>[v,()=>S({editor:e})]));c={...c,...m}}const d=jB(c);l.push(d);const f=tt(s,"addInputRules",a);mS(s,e.options.enableInputRules)&&f&&i.push(...f());const p=tt(s,"addPasteRules",a);mS(s,e.options.enablePasteRules)&&p&&r.push(...p());const h=tt(s,"addProseMirrorPlugins",a);if(h){const m=h();l.push(...m)}return l}).flat();return[m$({editor:e,rules:i}),...S$({editor:e,rules:r}),...o]}get attributes(){return dS(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Qc(this.extensions);return Object.fromEntries(n.filter(i=>!!tt(i,"addNodeView")).map(i=>{const r=this.attributes.filter(l=>l.type===i.name),o={name:i.name,options:i.options,storage:i.storage,editor:e,type:qn(i.name,this.schema)},s=tt(i,"addNodeView",o);if(!s)return[];const a=(l,u,c,d,f)=>{const p=Om(l,r);return s()({node:l,view:u,getPos:c,decorations:d,innerDecorations:f,editor:e,extension:i,HTMLAttributes:p})};return[i.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const i={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Tm(e.name,this.schema)};e.type==="mark"&&(!((n=Dt(tt(e,"keepOnSplit",i)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const r=tt(e,"onBeforeCreate",i),o=tt(e,"onCreate",i),s=tt(e,"onUpdate",i),a=tt(e,"onSelectionUpdate",i),l=tt(e,"onTransaction",i),u=tt(e,"onFocus",i),c=tt(e,"onBlur",i),d=tt(e,"onDestroy",i);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}}class Ai{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=Dt(tt(this,"addOptions",{name:this.name}))),this.storage=Dt(tt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ai(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>id(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ai({...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=Dt(tt(n,"addOptions",{name:n.name})),n.storage=Dt(tt(n,"addStorage",{name:n.name,options:n.options})),n}}function gS(t,e,n){const{from:i,to:r}=e,{blockSeparator:o=`
218
+
219
+ `,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(i,r,(l,u,c,d)=>{var f;l.isBlock&&u>i&&(a+=o);const p=s==null?void 0:s[l.type.name];if(p)return c&&(a+=p({node:l,pos:u,parent:c,index:d,range:e})),!1;l.isText&&(a+=(f=l==null?void 0:l.text)===null||f===void 0?void 0:f.slice(Math.max(i,u)-u,r-u))}),a}function Em(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const k$=Ai.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Wn({key:new ei("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:i,selection:r}=e,{ranges:o}=r,s=Math.min(...o.map(c=>c.$from.pos)),a=Math.max(...o.map(c=>c.$to.pos)),l=Em(n);return gS(i,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),O$=()=>({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),T$=(t=!1)=>({commands:e})=>e.setContent("",t),x$=()=>({state:t,tr:e,dispatch:n})=>{const{selection:i}=e,{ranges:r}=i;return n&&r.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:c}=e,d=u.resolve(c.map(l)),f=u.resolve(c.map(l+a.nodeSize)),p=d.blockRange(f);if(!p)return;const h=ca(p);if(a.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},M$=t=>e=>t(e),E$=()=>({state:t,dispatch:e})=>sS(t,e),P$=(t,e)=>({editor:n,tr:i})=>{const{state:r}=n,o=r.doc.slice(t.from,t.to);i.deleteRange(t.from,t.to);const s=i.mapping.map(e);return i.insert(s,o.content),i.setSelection(new Mt(i.doc.resolve(s-1))),!0},I$=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,i=n.$anchor.node();if(i.content.size>0)return!1;const r=t.selection.$anchor;for(let o=r.depth;o>0;o-=1)if(r.node(o).type===i.type){if(e){const a=r.before(o),l=r.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},L$=t=>({tr:e,state:n,dispatch:i})=>{const r=qn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r){if(i){const l=o.before(s),u=o.after(s);e.delete(l,u).scrollIntoView()}return!0}return!1},D$=t=>({tr:e,dispatch:n})=>{const{from:i,to:r}=t;return n&&e.delete(i,r),!0},R$=()=>({state:t,dispatch:e})=>Am(t,e),N$=()=>({commands:t})=>t.keyboardShortcut("Enter"),B$=()=>({state:t,dispatch:e})=>GB(t,e);function od(t,e,n={strict:!0}){const i=Object.keys(e);return i.length?i.every(r=>n.strict?e[r]===t[r]:Mm(e[r])?e[r].test(t[r]):e[r]===t[r]):!0}function vS(t,e,n={}){return t.find(i=>i.type===e&&od(Object.fromEntries(Object.keys(n).map(r=>[r,i.attrs[r]])),n))}function yS(t,e,n={}){return!!vS(t,e,n)}function Pm(t,e,n){var i;if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e)||(n=n||((i=r.node.marks[0])===null||i===void 0?void 0:i.attrs),!vS([...r.node.marks],e,n)))return;let s=r.index,a=t.start()+r.offset,l=s+1,u=a+r.node.nodeSize;for(;s>0&&yS([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&yS([...t.parent.child(l).marks],e,n);)u+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function jo(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 $$=(t,e={})=>({tr:n,state:i,dispatch:r})=>{const o=jo(t,i.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(r){const d=Pm(l,o,e);if(d&&d.from<=u&&d.to>=c){const f=Mt.create(s,d.from,d.to);n.setSelection(f)}}return!0},V$=t=>e=>{const n=typeof t=="function"?t(e):t;for(let i=0;i<n.length;i+=1)if(n[i](e))return!0;return!1};function Im(t){return t instanceof Mt}function eo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function bS(t,e=null){if(!e)return null;const n=Vt.atStart(t),i=Vt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return i;const r=n.from,o=i.to;return e==="all"?Mt.create(t,eo(0,r,o),eo(t.content.size,r,o)):Mt.create(t,eo(e,r,o),eo(e,r,o))}function AS(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function sd(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const z$=(t=null,e={})=>({editor:n,view:i,tr:r,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(sd()||AS())&&i.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(i.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(i.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Im(n.state.selection))return s(),!0;const a=bS(r.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||r.setSelection(a),l&&r.storedMarks&&r.setStoredMarks(r.storedMarks),s()),!0},F$=(t,e)=>n=>t.every((i,r)=>e(i,{...n,index:r})),j$=(t,e)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),wS=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const i=e[n];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?t.removeChild(i):i.nodeType===1&&wS(i)}return t};function ad(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return wS(n)}function ld(t,e,n){if(t instanceof xo||t instanceof Ee)return t;n={slice:!0,parseOptions:{},...n};const i=typeof t=="object"&&t!==null,r=typeof t=="string";if(i)try{if(Array.isArray(t)&&t.length>0)return Ee.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),ld("",e,n)}if(r){if(n.errorOnInvalidContent){let s=!1,a="";const l=new s2({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:u=>(s=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Mo.fromSchema(l).parseSlice(ad(t),n.parseOptions):Mo.fromSchema(l).parse(ad(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Mo.fromSchema(e);return n.slice?o.parseSlice(ad(t),n.parseOptions).content:o.parse(ad(t),n.parseOptions)}return ld("",e,n)}function H$(t,e,n){const i=t.steps.length-1;if(i<e)return;const r=t.steps[i];if(!(r instanceof Un||r instanceof Kn))return;const o=t.mapping.maps[i];let s=0;o.forEach((a,l,u,c)=>{s===0&&(s=c)}),t.setSelection(Vt.near(t.doc.resolve(s),n))}const U$=t=>!("type"in t),K$=(t,e,n)=>({tr:i,dispatch:r,editor:o})=>{var s;if(r){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=ld(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(h){return o.emit("contentError",{editor:o,error:h,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,d=!0;if((U$(a)?a:[a]).forEach(h=>{h.check(),c=c?h.isText&&h.marks.length===0:!1,d=d?h.isBlock:!1}),l===u&&d){const{parent:h}=i.doc.resolve(l);h.isTextblock&&!h.type.spec.code&&!h.childCount&&(l-=1,u+=1)}let p;if(c){if(Array.isArray(e))p=e.map(h=>h.text||"").join("");else if(e instanceof Ee){let h="";e.forEach(m=>{m.text&&(h+=m.text)}),p=h}else typeof e=="object"&&e&&e.text?p=e.text:p=e;i.insertText(p,l,u)}else p=a,i.replaceWith(l,u,p);n.updateSelection&&H$(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:l,text:p}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:l,text:p})}return!0},W$=()=>({state:t,dispatch:e})=>WB(t,e),q$=()=>({state:t,dispatch:e})=>qB(t,e),X$=()=>({state:t,dispatch:e})=>Qw(t,e),G$=()=>({state:t,dispatch:e})=>iS(t,e),Z$=()=>({state:t,dispatch:e,tr:n})=>{try{const i=zc(t.doc,t.selection.$from.pos,-1);return i==null?!1:(n.join(i,2),e&&e(n),!0)}catch{return!1}},_$=()=>({state:t,dispatch:e,tr:n})=>{try{const i=zc(t.doc,t.selection.$from.pos,1);return i==null?!1:(n.join(i,2),e&&e(n),!0)}catch{return!1}},J$=()=>({state:t,dispatch:e})=>UB(t,e),Y$=()=>({state:t,dispatch:e})=>KB(t,e);function SS(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Q$(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let i,r,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))sd()||SS()?s=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return i&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const eV=t=>({editor:e,view:n,tr:i,dispatch:r})=>{const o=Q$(t).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const c=u.map(i.mapping);c&&r&&i.maybeStep(c)}),!0};function lu(t,e,n={}){const{from:i,to:r,empty:o}=t.selection,s=e?qn(e,t.schema):null,a=[];t.doc.nodesBetween(i,r,(d,f)=>{if(d.isText)return;const p=Math.max(i,f),h=Math.min(r,f+d.nodeSize);a.push({node:d,from:p,to:h})});const l=r-i,u=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>od(d.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((d,f)=>d+f.to-f.from,0)>=l}const tV=(t,e={})=>({state:n,dispatch:i})=>{const r=qn(t,n.schema);return lu(n,r,e)?XB(n,i):!1},nV=()=>({state:t,dispatch:e})=>aS(t,e),iV=t=>({state:e,dispatch:n})=>{const i=qn(t,e.schema);return o$(i)(e,n)},rV=()=>({state:t,dispatch:e})=>oS(t,e);function ud(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function CS(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((i,r)=>(n.includes(r)||(i[r]=t[r]),i),{})}const oV=(t,e)=>({tr:n,state:i,dispatch:r})=>{let o=null,s=null;const a=ud(typeof t=="string"?t:t.name,i.schema);return a?(a==="node"&&(o=qn(t,i.schema)),a==="mark"&&(s=jo(t,i.schema)),r&&n.selection.ranges.forEach(l=>{i.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{o&&o===u.type&&n.setNodeMarkup(c,void 0,CS(u.attrs,e)),s&&u.marks.length&&u.marks.forEach(d=>{s===d.type&&n.addMark(c,c+u.nodeSize,s.create(CS(d.attrs,e)))})})}),!0):!1},sV=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),aV=()=>({tr:t,dispatch:e})=>{if(e){const n=new Ri(t.doc);t.setSelection(n)}return!0},lV=()=>({state:t,dispatch:e})=>tS(t,e),uV=()=>({state:t,dispatch:e})=>rS(t,e),cV=()=>({state:t,dispatch:e})=>JB(t,e),dV=()=>({state:t,dispatch:e})=>e$(t,e),fV=()=>({state:t,dispatch:e})=>QB(t,e);function Lm(t,e,n={},i={}){return ld(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:i.errorOnInvalidContent})}const pV=(t,e=!1,n={},i={})=>({editor:r,tr:o,dispatch:s,commands:a})=>{var l,u;const{doc:c}=o;if(n.preserveWhitespace!=="full"){const d=Lm(t,r.schema,n,{errorOnInvalidContent:(l=i.errorOnInvalidContent)!==null&&l!==void 0?l:r.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:(u=i.errorOnInvalidContent)!==null&&u!==void 0?u:r.options.enableContentCheck})};function kS(t,e){const n=jo(e,t.schema),{from:i,to:r,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,r,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function hV(t,e){const n=new P2(t);return e.forEach(i=>{i.steps.forEach(r=>{n.step(r)})}),n}function mV(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 gV(t,e,n){const i=[];return t.nodesBetween(e.from,e.to,(r,o)=>{n(r)&&i.push({node:r,pos:o})}),i}function vV(t,e){for(let n=t.depth;n>0;n-=1){const i=t.node(n);if(e(i))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:i}}}function Dm(t){return e=>vV(e.$from,t)}function OS(t,e){const n={from:0,to:t.content.size};return gS(t,n,e)}function yV(t,e){const n=qn(e,t.schema),{from:i,to:r}=t.selection,o=[];t.doc.nodesBetween(i,r,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function TS(t,e){const n=ud(typeof e=="string"?e:e.name,t.schema);return n==="node"?yV(t,e):n==="mark"?kS(t,e):{}}function bV(t,e=JSON.stringify){const n={};return t.filter(i=>{const r=e(i);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function AV(t){const e=bV(t);return e.length===1?e:e.filter((n,i)=>!e.filter((o,s)=>s!==i).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function wV(t){const{mapping:e,steps:n}=t,i=[];return e.maps.forEach((r,o)=>{const s=[];if(r.ranges.length)r.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const u=e.slice(o).map(a,-1),c=e.slice(o).map(l),d=e.invert().map(u,-1),f=e.invert().map(c);i.push({oldRange:{from:d,to:f},newRange:{from:u,to:c}})})}),AV(i)}function Rm(t,e,n){const i=[];return t===e?n.resolve(t).marks().forEach(r=>{const o=n.resolve(t),s=Pm(o,r.type);s&&i.push({mark:r,...s})}):n.nodesBetween(t,e,(r,o)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(s=>({from:o,to:o+r.nodeSize,mark:s})))}),i}function cd(t,e,n){return Object.fromEntries(Object.entries(n).filter(([i])=>{const r=t.find(o=>o.type===e&&o.name===i);return r?r.attribute.keepOnSplit:!1}))}function Nm(t,e,n={}){const{empty:i,ranges:r}=t.selection,o=e?jo(e,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>od(d.attrs,n,{strict:!1}));let s=0;const a=[];if(r.forEach(({$from:d,$to:f})=>{const p=d.pos,h=f.pos;t.doc.nodesBetween(p,h,(m,v)=>{if(!m.isText&&!m.marks.length)return;const S=Math.max(p,v),b=Math.min(h,v+m.nodeSize),k=b-S;s+=k,a.push(...m.marks.map(A=>({mark:A,from:S,to:b})))})}),s===0)return!1;const l=a.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>od(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),u=a.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+u:l)>=s}function SV(t,e,n={}){if(!e)return lu(t,null,n)||Nm(t,null,n);const i=ud(e,t.schema);return i==="node"?lu(t,e,n):i==="mark"?Nm(t,e,n):!1}function xS(t,e){const{nodeExtensions:n}=Qc(e),i=n.find(s=>s.name===t);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},o=Dt(tt(i,"group",r));return typeof o!="string"?!1:o.split(" ").includes("list")}function dd(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var i;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((i=t.text)!==null&&i!==void 0?i:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let r=!0;return t.content.forEach(o=>{r!==!1&&(dd(o,{ignoreWhitespace:n,checkChildren:e})||(r=!1))}),r}return!1}function CV(t){return t instanceof mt}function MS(t,e,n){const r=t.state.doc.content.size,o=eo(e,0,r),s=eo(n,0,r),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),u=Math.min(a.top,l.top),c=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),f=Math.max(a.right,l.right),p=f-d,h=c-u,S={top:u,bottom:c,left:d,right:f,width:p,height:h,x:d,y:u};return{...S,toJSON:()=>S}}function kV(t,e,n){var i;const{selection:r}=e;let o=null;if(Im(r)&&(o=r.$cursor),o){const a=(i=t.storedMarks)!==null&&i!==void 0?i:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=r;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){const p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=p&&h}return!u}),u})}const OV=(t,e={})=>({tr:n,state:i,dispatch:r})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=jo(t,i.schema);if(r)if(s){const u=kS(i,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const c=u.$from.pos,d=u.$to.pos;i.doc.nodesBetween(c,d,(f,p)=>{const h=Math.max(p,c),m=Math.min(p+f.nodeSize,d);f.marks.find(S=>S.type===l)?f.marks.forEach(S=>{l===S.type&&n.addMark(h,m,l.create({...S.attrs,...e}))}):n.addMark(h,m,l.create(e))})});return kV(i,n,l)},TV=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),xV=(t,e={})=>({state:n,dispatch:i,chain:r})=>{const o=qn(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?r().command(({commands:a})=>cS(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>cS(o,{...s,...e})(a,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},MV=t=>({tr:e,dispatch:n})=>{if(n){const{doc:i}=e,r=eo(t,0,i.content.size),o=mt.create(i,r);e.setSelection(o)}return!0},EV=t=>({tr:e,dispatch:n})=>{if(n){const{doc:i}=e,{from:r,to:o}=typeof t=="number"?{from:t,to:t}:t,s=Mt.atStart(i).from,a=Mt.atEnd(i).to,l=eo(r,s,a),u=eo(o,s,a),c=Mt.create(i,l,u);e.setSelection(c)}return!0},PV=t=>({state:e,dispatch:n})=>{const i=qn(t,e.schema);return l$(i)(e,n)};function ES(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const i=n.filter(r=>e==null?void 0:e.includes(r.type.name));t.tr.ensureMarks(i)}}const IV=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:i,editor:r})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,u=r.extensionManager.attributes,c=cd(u,a.node().type.name,a.node().attrs);if(o instanceof mt&&o.node.isBlock)return!a.parentOffset||!Gr(s,a.pos)?!1:(i&&(t&&ES(n,r.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:mV(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=d&&f?[{type:f,attrs:c}]:void 0,h=Gr(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!h&&Gr(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:c}]:void 0),i){if(h&&(o instanceof Mt&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),f&&!d&&!a.parentOffset&&a.parent.type!==f)){const m=e.mapping.map(a.before()),v=e.doc.resolve(m);a.node(-1).canReplaceWith(v.index(),v.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&ES(n,r.extensionManager.splittableMarks),e.scrollIntoView()}return h},LV=(t,e={})=>({tr:n,state:i,dispatch:r,editor:o})=>{var s;const a=qn(t,i.schema),{$from:l,$to:u}=i.selection,c=i.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==a)return!1;const f=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let S=Ee.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let P=l.depth-b;P>=l.depth-3;P-=1)S=Ee.from(l.node(P).copy(S));const k=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,A={...cd(f,l.node().type.name,l.node().attrs),...e},w=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(A))||void 0;S=S.append(Ee.from(a.createAndFill(null,w)||void 0));const y=l.before(l.depth-(b-1));n.replace(y,l.after(-k),new Xe(S,4-b,0));let C=-1;n.doc.nodesBetween(y,n.doc.content.size,(P,R)=>{if(C>-1)return!1;P.isTextblock&&P.content.size===0&&(C=R+1)}),C>-1&&n.setSelection(Mt.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const p=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,h={...cd(f,d.type.name,d.attrs),...e},m={...cd(f,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const v=p?[{type:a,attrs:h},{type:p,attrs:m}]:[{type:a,attrs:h}];if(!Gr(n.doc,l.pos,2))return!1;if(r){const{selection:S,storedMarks:b}=i,{splittableMarks:k}=o.extensionManager,A=b||S.$to.parentOffset&&S.$from.marks();if(n.split(l.pos,2,v).scrollIntoView(),!A||!r)return!0;const w=A.filter(y=>k.includes(y.type.name));n.ensureMarks(w)}return!0},Bm=(t,e)=>{const n=Dm(s=>s.type===e)(t.selection);if(!n)return!0;const i=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(i===void 0)return!0;const r=t.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Io(t.doc,n.pos)&&t.join(n.pos),!0},$m=(t,e)=>{const n=Dm(s=>s.type===e)(t.selection);if(!n)return!0;const i=t.doc.resolve(n.start).after(n.depth);if(i===void 0)return!0;const r=t.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Io(t.doc,i)&&t.join(i),!0};var DV=Object.freeze({__proto__:null,blur:O$,clearContent:T$,clearNodes:x$,command:M$,createParagraphNear:E$,cut:P$,deleteCurrentNode:I$,deleteNode:L$,deleteRange:D$,deleteSelection:R$,enter:N$,exitCode:B$,extendMarkRange:$$,first:V$,focus:z$,forEach:F$,insertContent:j$,insertContentAt:K$,joinBackward:X$,joinDown:q$,joinForward:G$,joinItemBackward:Z$,joinItemForward:_$,joinTextblockBackward:J$,joinTextblockForward:Y$,joinUp:W$,keyboardShortcut:eV,lift:tV,liftEmptyBlock:nV,liftListItem:iV,newlineInCode:rV,resetAttributes:oV,scrollIntoView:sV,selectAll:aV,selectNodeBackward:lV,selectNodeForward:uV,selectParentNode:cV,selectTextblockEnd:dV,selectTextblockStart:fV,setContent:pV,setMark:OV,setMeta:TV,setNode:xV,setNodeSelection:MV,setTextSelection:EV,sinkListItem:PV,splitBlock:IV,splitListItem:LV,toggleList:(t,e,n,i={})=>({editor:r,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{const{extensions:d,splittableMarks:f}=r.extensionManager,p=qn(t,s.schema),h=qn(e,s.schema),{selection:m,storedMarks:v}=s,{$from:S,$to:b}=m,k=S.blockRange(b),A=v||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;const w=Dm(y=>xS(y.type.name,d))(m);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===p)return u.liftListItem(h);if(xS(w.node.type.name,d)&&p.validContent(w.node.content)&&a)return l().command(()=>(o.setNodeMarkup(w.pos,p),!0)).command(()=>Bm(o,p)).command(()=>$m(o,p)).run()}return!n||!A||!a?l().command(()=>c().wrapInList(p,i)?!0:u.clearNodes()).wrapInList(p,i).command(()=>Bm(o,p)).command(()=>$m(o,p)).run():l().command(()=>{const y=c().wrapInList(p,i),C=A.filter(P=>f.includes(P.type.name));return o.ensureMarks(C),y?!0:u.clearNodes()}).wrapInList(p,i).command(()=>Bm(o,p)).command(()=>$m(o,p)).run()},toggleMark:(t,e={},n={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:o=!1}=n,s=jo(t,i.schema);return Nm(i,s,e)?r.unsetMark(s,{extendEmptyMarkRange:o}):r.setMark(s,e)},toggleNode:(t,e,n={})=>({state:i,commands:r})=>{const o=qn(t,i.schema),s=qn(e,i.schema),a=lu(i,o,n);let l;return i.selection.$anchor.sameParent(i.selection.$head)&&(l=i.selection.$anchor.parent.attrs),a?r.setNode(s,l):r.setNode(o,{...l,...n})},toggleWrap:(t,e={})=>({state:n,commands:i})=>{const r=qn(t,n.schema);return lu(n,r,e)?i.lift(r):i.wrapIn(r,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let i=0;i<n.length;i+=1){const r=n[i];let o;if(r.spec.isInputRules&&(o=r.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:i,ranges:r}=n;return i||e&&r.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:i,dispatch:r})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=jo(t,i.schema),{$from:u,empty:c,ranges:d}=a;if(!r)return!0;if(c&&s){let{from:f,to:p}=a;const h=(o=u.marks().find(v=>v.type===l))===null||o===void 0?void 0:o.attrs,m=Pm(u,l,h);m&&(f=m.from,p=m.to),n.removeMark(f,p,l)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:i,dispatch:r})=>{let o=null,s=null;const a=ud(typeof t=="string"?t:t.name,i.schema);return a?(a==="node"&&(o=qn(t,i.schema)),a==="mark"&&(s=jo(t,i.schema)),r&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;let d,f,p,h;n.selection.empty?i.doc.nodesBetween(u,c,(m,v)=>{o&&o===m.type&&(p=Math.max(v,u),h=Math.min(v+m.nodeSize,c),d=v,f=m)}):i.doc.nodesBetween(u,c,(m,v)=>{v<u&&o&&o===m.type&&(p=Math.max(v,u),h=Math.min(v+m.nodeSize,c),d=v,f=m),v>=u&&v<=c&&(o&&o===m.type&&n.setNodeMarkup(v,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(S=>{if(s===S.type){const b=Math.max(v,u),k=Math.min(v+m.nodeSize,c);n.addMark(b,k,s.create({...S.attrs,...e}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&n.addMark(p,h,s.create({...m.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:i})=>{const r=qn(t,n.schema);return t$(r,e)(n,i)},wrapInList:(t,e={})=>({state:n,dispatch:i})=>{const r=qn(t,n.schema);return n$(r,e)(n,i)}});const RV=Ai.create({name:"commands",addCommands(){return{...DV}}}),NV=Ai.create({name:"drop",addProseMirrorPlugins(){return[new Wn({key:new ei("tiptapDrop"),props:{handleDrop:(t,e,n,i)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:i})}}})]}}),BV=Ai.create({name:"editable",addProseMirrorPlugins(){return[new Wn({key:new ei("editable"),props:{editable:()=>this.editor.options.editable}})]}}),$V=new ei("focusEvents"),VV=Ai.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Wn({key:$V,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const i=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(i),!1},blur:(e,n)=>{t.isFocused=!1;const i=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(i),!1}}}})]}}),zV=Ai.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:c,$anchor:d}=l,{pos:f,parent:p}=d,h=d.parent.isTextblock&&f>0?a.doc.resolve(f-1):d,m=h.parent.type.spec.isolating,v=d.pos-d.parentOffset,S=m&&h.parent.childCount===1?v===d.pos:Vt.atStart(u).from===f;return!c||!p.type.isTextblock||p.textContent.length||!S||S&&d.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()]),i={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},o={...i,"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 sd()||SS()?o:r},addProseMirrorPlugins(){return[new Wn({key:new ei("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(m=>m.getMeta("composition")))return;const i=t.some(m=>m.docChanged)&&!e.doc.eq(n.doc),r=t.some(m=>m.getMeta("preventClearDocument"));if(!i||r)return;const{empty:o,from:s,to:a}=e.selection,l=Vt.atStart(e.doc).from,u=Vt.atEnd(e.doc).to;if(o||!(s===l&&a===u)||!dd(n.doc))return;const f=n.tr,p=Jc({state:n,transaction:f}),{commands:h}=new Yc({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),FV=Ai.create({name:"paste",addProseMirrorPlugins(){return[new Wn({key:new ei("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),jV=Ai.create({name:"tabindex",addProseMirrorPlugins(){return[new Wn({key:new ei("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class xs{get name(){return this.node.type.name}constructor(e,n,i=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=e,this.editor=n,this.currentNode=r}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,i=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,i=this.to-1}this.editor.commands.insertContentAt({from:n,to:i},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 xs(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 xs(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 xs(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,i)=>{const r=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+i+(o?0:1),a=this.resolvedPos.doc.resolve(s);if(!r&&a.depth<=this.depth)return;const l=new xs(a,this.editor,r,r?n:null);r&&(l.actualDepth=this.depth+1),e.push(new xs(a,this.editor,r,r?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 i=null,r=this.parent;for(;r&&!i;){if(r.node.type.name===e)if(Object.keys(n).length>0){const o=r.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==n[l])break}}else i=r;r=r.parent}return i}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},i=!1){let r=[];if(!this.children||this.children.length===0)return r;const o=Object.keys(n);return this.children.forEach(s=>{i&&r.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&r.push(s),!(i&&r.length>0)&&(r=r.concat(s.querySelectorAll(e,n,i))))}),r}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const HV=`.ProseMirror {
245
220
  position: relative;
246
221
  }
247
222
 
@@ -315,15 +290,40 @@ img.ProseMirror-separator {
315
290
 
316
291
  .tippy-box[data-animation=fade][data-state=hidden] {
317
292
  opacity: 0
318
- }`;function _j(t,e,n){const i=document.querySelector("style[data-tiptap-style]");if(i!==null)return i;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}let Jj=class extends gF{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:i,moved:r})=>this.options.onDrop(n,i,r)),this.on("paste",({event:n,slice:i})=>this.options.onPaste(n,i)),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=_j(Zj,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 i=T6(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:i});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let i=n;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;i=i.filter(a=>!a.key.startsWith(s))}),n.length===i.length)return;const r=this.state.reconfigure({plugins:i});return this.view.updateState(r),r}createExtensionManager(){var e,n;const r=[...this.options.enableCoreExtensions?[Uj,IF.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),jj,Wj,qj,Gj,Hj,Xj].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 xa(r,this)}createCommandManager(){this.commandManager=new dd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=ng(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=ng(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const i=D6(n,this.options.autofocus);this.view=new zz(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:ba.create({doc:n,selection:i||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),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),i=!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}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),o=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.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 F6(this.state,e)}isActive(e,n){const i=typeof e=="string"?e:null,r=typeof e=="string"?n:e;return Ej(this.state,i,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Jm(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
293
+ }`;function UV(t,e,n){const i=document.querySelector("style[data-tiptap-style]");if(i!==null)return i;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}let KV=class extends u${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:i,moved:r})=>this.options.onDrop(n,i,r)),this.on("paste",({event:n,slice:i})=>this.options.onPaste(n,i)),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=UV(HV,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 i=fS(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:i});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let i=n;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;i=i.filter(a=>!a.key.startsWith(s))}),n.length===i.length)return;const r=this.state.reconfigure({plugins:i});return this.view.updateState(r),r}createExtensionManager(){var e,n;const r=[...this.options.enableCoreExtensions?[BV,k$.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),RV,VV,zV,jV,NV,FV].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 Sa(r,this)}createCommandManager(){this.commandManager=new Yc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Lm(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=Lm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const i=bS(n,this.options.autofocus);this.view=new LB(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:ha.create({doc:n,selection:i||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),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),i=!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}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),o=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.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 TS(this.state,e)}isActive(e,n){const i=typeof e=="string"?e:null,r=typeof e=="string"?n:e;return SV(this.state,i,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return xm(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
319
294
 
320
- `,textSerializers:i={}}=e||{};return z6(this.state.doc,{blockSeparator:n,textSerializers:{...Qm(this.schema),...i}})}get isEmpty(){return kd(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 i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelector(e,n))||null}$nodes(e,n){var i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Es(n,this)}get $doc(){return this.$pos(0)}};function yu(t){return new pd({find:t.find,handler:({state:e,range:n,match:i})=>{const r=Dt(t.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:o}=e,s=i[i.length-1],a=i[0];if(s){const l=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length;if(rg(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>u).length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+l,u);const f=n.from+l+s.length;o.addMark(n.from+l,f,t.type.create(r||{})),o.removeStoredMark(t.type)}}})}function Yj(t){return new pd({find:t.find,handler:({state:e,range:n,match:i})=>{const r=Dt(t.getAttributes,void 0,i)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(r);if(i[1]){const u=i[0].lastIndexOf(i[1]);let c=s+u;c>a?c=a:a=c+i[1].length;const d=i[0][i[0].length-1];o.insertText(d,s+i[0].length-1),o.replaceWith(c,a,l)}else if(i[0]){const u=t.type.isInline?s:s-1;o.insert(u,t.type.create(r)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function Qj(t){return new pd({find:t.find,handler:({state:e,range:n,match:i})=>{const r=e.doc.resolve(n.from),o=Dt(t.getAttributes,void 0,i)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function Od(t){return new pd({find:t.find,handler:({state:e,range:n,match:i,chain:r})=>{const o=Dt(t.getAttributes,void 0,i)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),u=l&&dm(l,t.type,o);if(!u)return null;if(s.wrap(l,u),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){const m=h.filter(v=>p.includes(v.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(d,o).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&Do(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(i,c))&&s.join(n.from-1)}})}class xi{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=Dt(tt(this,"addOptions",{name:this.name}))),this.storage=Dt(tt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new xi(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>gd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new xi(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=Dt(tt(n,"addOptions",{name:n.name})),n.storage=Dt(tt(n,"addStorage",{name:n.name,options:n.options})),n}}class eH{constructor(e,n,i){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...i},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,i,r,o,s,a,l;const{view:u}=this.editor,c=e.target,d=c.nodeType===3?(n=c.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!((i=this.contentDOM)===null||i===void 0)&&i.contains(c)||!d)return;let f=0,p=0;if(this.dom!==d){const b=this.dom.getBoundingClientRect(),k=d.getBoundingClientRect(),A=(r=e.offsetX)!==null&&r!==void 0?r:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,w=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;f=k.x-b.x+A,p=k.y-b.y+w}const h=this.dom.cloneNode(!0);(l=e.dataTransfer)===null||l===void 0||l.setDragImage(h,f,p);const m=this.getPos();if(typeof m!="number")return;const v=mt.create(u.state.doc,m),S=u.state.tr.setSelection(v);u.dispatch(S)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const i=e.target;if(!(this.dom.contains(i)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(i))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(i.tagName)||i.isContentEditable)&&!s&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,d=mt.isSelectable(this.node),f=e.type==="copy",p=e.type==="paste",h=e.type==="cut",m=e.type==="mousedown";if(!c&&d&&o&&e.target===this.dom&&e.preventDefault(),c&&o&&!u&&e.target===this.dom)return e.preventDefault(),!1;if(c&&l&&!u&&m){const v=i.closest("[data-drag-handle]");v&&(this.dom===v||this.dom.contains(v))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||s||f||p||h||m&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(bd()||R6())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(i=>i.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const i=this.getPos();return typeof i!="number"?!1:(n.setNodeMarkup(i,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Ma(t){return new OF({find:t.find,handler:({state:e,range:n,match:i,pasteEvent:r})=>{const o=Dt(t.getAttributes,void 0,i,r);if(o===!1||o===null)return null;const{tr:s}=e,a=i[i.length-1],l=i[0];let u=n.to;if(a){const c=l.search(/\S/),d=n.from+l.indexOf(a),f=d+a.length;if(rg(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(v=>v===t.type&&v!==h.mark.type)).filter(h=>h.to>d).length)return null;f<n.to&&s.delete(f,n.to),d>n.from&&s.delete(n.from+c,d),u=n.from+c+a.length,s.addMark(n.from+c,u,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function tH(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const nH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,iH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,rH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,oH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,sH=to.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",$n(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[yu({find:nH,type:this.type}),yu({find:rH,type:this.type})]},addPasteRules(){return[Ma({find:iH,type:this.type}),Ma({find:oH,type:this.type})]}}),aH="listItem",K6="textStyle",W6=/^\s*([-+*])\s$/,lH=xi.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",$n(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(aH,this.editor.getAttributes(K6)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Od({find:W6,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Od({find:W6,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(K6),editor:this.editor})),[t]}}),uH=/(^|[^`])`([^`]+)`(?!`)/,cH=/(^|[^`])`([^`]+)`(?!`)/g,dH=to.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",$n(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[yu({find:uH,type:this.type})]},addPasteRules(){return[Ma({find:cH,type:this.type})]}}),fH=xi.create({name:"doc",topNode:!0,content:"block+"});var Mi="top",Gi="bottom",Zi="right",Ei="left",lg="auto",bu=[Mi,Gi,Zi,Ei],Ea="start",Au="end",pH="clippingParents",q6="viewport",wu="popper",hH="reference",X6=bu.reduce(function(t,e){return t.concat([e+"-"+Ea,e+"-"+Au])},[]),G6=[].concat(bu,[lg]).reduce(function(t,e){return t.concat([e,e+"-"+Ea,e+"-"+Au])},[]),mH="beforeRead",gH="read",vH="afterRead",yH="beforeMain",bH="main",AH="afterMain",wH="beforeWrite",SH="write",CH="afterWrite",kH=[mH,gH,vH,yH,bH,AH,wH,SH,CH];function xr(t){return t?(t.nodeName||"").toLowerCase():null}function Bi(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ps(t){var e=Bi(t).Element;return t instanceof e||t instanceof Element}function _i(t){var e=Bi(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function ug(t){if(typeof ShadowRoot>"u")return!1;var e=Bi(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function OH(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},r=e.attributes[n]||{},o=e.elements[n];!_i(o)||!xr(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function TH(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(i){var r=e.elements[i],o=e.attributes[i]||{},s=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:n[i]),a=s.reduce(function(l,u){return l[u]="",l},{});!_i(r)||!xr(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}const Z6={name:"applyStyles",enabled:!0,phase:"write",fn:OH,effect:TH,requires:["computeStyles"]};function Mr(t){return t.split("-")[0]}var Is=Math.max,Td=Math.min,Pa=Math.round;function cg(){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 _6(){return!/^((?!chrome|android).)*safari/i.test(cg())}function Ia(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),r=1,o=1;e&&_i(t)&&(r=t.offsetWidth>0&&Pa(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Pa(i.height)/t.offsetHeight||1);var s=Ps(t)?Bi(t):window,a=s.visualViewport,l=!_6()&&n,u=(i.left+(l&&a?a.offsetLeft:0))/r,c=(i.top+(l&&a?a.offsetTop:0))/o,d=i.width/r,f=i.height/o;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function dg(t){var e=Ia(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function J6(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&ug(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function io(t){return Bi(t).getComputedStyle(t)}function xH(t){return["table","td","th"].indexOf(xr(t))>=0}function Ko(t){return((Ps(t)?t.ownerDocument:t.document)||window.document).documentElement}function xd(t){return xr(t)==="html"?t:t.assignedSlot||t.parentNode||(ug(t)?t.host:null)||Ko(t)}function Y6(t){return!_i(t)||io(t).position==="fixed"?null:t.offsetParent}function MH(t){var e=/firefox/i.test(cg()),n=/Trident/i.test(cg());if(n&&_i(t)){var i=io(t);if(i.position==="fixed")return null}var r=xd(t);for(ug(r)&&(r=r.host);_i(r)&&["html","body"].indexOf(xr(r))<0;){var o=io(r);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 r;r=r.parentNode}return null}function Su(t){for(var e=Bi(t),n=Y6(t);n&&xH(n)&&io(n).position==="static";)n=Y6(n);return n&&(xr(n)==="html"||xr(n)==="body"&&io(n).position==="static")?e:n||MH(t)||e}function fg(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Cu(t,e,n){return Is(t,Td(e,n))}function EH(t,e,n){var i=Cu(t,e,n);return i>n?n:i}function Q6(){return{top:0,right:0,bottom:0,left:0}}function e3(t){return Object.assign({},Q6(),t)}function t3(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var PH=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,e3(typeof e!="number"?e:t3(e,bu))};function IH(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Mr(n.placement),l=fg(a),u=[Ei,Zi].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=PH(r.padding,n),f=dg(o),p=l==="y"?Mi:Ei,h=l==="y"?Gi:Zi,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],v=s[l]-n.rects.reference[l],S=Su(o),b=S?l==="y"?S.clientHeight||0:S.clientWidth||0:0,k=m/2-v/2,A=d[p],w=b-f[c]-d[h],y=b/2-f[c]/2+k,C=Cu(A,y,w),P=l;n.modifiersData[i]=(e={},e[P]=C,e.centerOffset=C-y,e)}}function LH(t){var e=t.state,n=t.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||J6(e.elements.popper,r)&&(e.elements.arrow=r))}const DH={name:"arrow",enabled:!0,phase:"main",fn:IH,effect:LH,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function La(t){return t.split("-")[1]}var RH={top:"auto",right:"auto",bottom:"auto",left:"auto"};function NH(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:Pa(n*r)/r||0,y:Pa(i*r)/r||0}}function n3(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,v=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=v.x,m=v.y;var S=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),k=Ei,A=Mi,w=window;if(u){var y=Su(n),C="clientHeight",P="clientWidth";if(y===Bi(n)&&(y=Ko(n),io(y).position!=="static"&&a==="absolute"&&(C="scrollHeight",P="scrollWidth")),y=y,r===Mi||(r===Ei||r===Zi)&&o===Au){A=Gi;var R=d&&y===w&&w.visualViewport?w.visualViewport.height:y[C];m-=R-i.height,m*=l?1:-1}if(r===Ei||(r===Mi||r===Gi)&&o===Au){k=Zi;var M=d&&y===w&&w.visualViewport?w.visualViewport.width:y[P];p-=M-i.width,p*=l?1:-1}}var D=Object.assign({position:a},u&&RH),$=c===!0?NH({x:p,y:m},Bi(n)):{x:p,y:m};if(p=$.x,m=$.y,l){var q;return Object.assign({},D,(q={},q[A]=b?"0":"",q[k]=S?"0":"",q.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",q))}return Object.assign({},D,(e={},e[A]=b?m+"px":"",e[k]=S?p+"px":"",e.transform="",e))}function BH(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=i===void 0?!0:i,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Mr(e.placement),variation:La(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,n3(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,n3(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const $H={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:BH,data:{}};var Md={passive:!0};function VH(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=Bi(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,Md)}),a&&l.addEventListener("resize",n.update,Md),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,Md)}),a&&l.removeEventListener("resize",n.update,Md)}}const zH={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:VH,data:{}};var FH={left:"right",right:"left",bottom:"top",top:"bottom"};function Ed(t){return t.replace(/left|right|bottom|top/g,function(e){return FH[e]})}var jH={start:"end",end:"start"};function i3(t){return t.replace(/start|end/g,function(e){return jH[e]})}function pg(t){var e=Bi(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function hg(t){return Ia(Ko(t)).left+pg(t).scrollLeft}function HH(t,e){var n=Bi(t),i=Ko(t),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var u=_6();(u||!u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+hg(t),y:l}}function UH(t){var e,n=Ko(t),i=pg(t),r=(e=t.ownerDocument)==null?void 0:e.body,o=Is(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=Is(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+hg(t),l=-i.scrollTop;return io(r||n).direction==="rtl"&&(a+=Is(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function mg(t){var e=io(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function r3(t){return["html","body","#document"].indexOf(xr(t))>=0?t.ownerDocument.body:_i(t)&&mg(t)?t:r3(xd(t))}function ku(t,e){var n;e===void 0&&(e=[]);var i=r3(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),o=Bi(i),s=r?[o].concat(o.visualViewport||[],mg(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(ku(xd(s)))}function gg(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function KH(t,e){var n=Ia(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 o3(t,e,n){return e===q6?gg(HH(t,n)):Ps(e)?KH(e,n):gg(UH(Ko(t)))}function WH(t){var e=ku(xd(t)),n=["absolute","fixed"].indexOf(io(t).position)>=0,i=n&&_i(t)?Su(t):t;return Ps(i)?e.filter(function(r){return Ps(r)&&J6(r,i)&&xr(r)!=="body"}):[]}function qH(t,e,n,i){var r=e==="clippingParents"?WH(t):[].concat(e),o=[].concat(r,[n]),s=o[0],a=o.reduce(function(l,u){var c=o3(t,u,i);return l.top=Is(c.top,l.top),l.right=Td(c.right,l.right),l.bottom=Td(c.bottom,l.bottom),l.left=Is(c.left,l.left),l},o3(t,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function s3(t){var e=t.reference,n=t.element,i=t.placement,r=i?Mr(i):null,o=i?La(i):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(r){case Mi:l={x:s,y:e.y-n.height};break;case Gi:l={x:s,y:e.y+e.height};break;case Zi:l={x:e.x+e.width,y:a};break;case Ei:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=r?fg(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Ea:l[u]=l[u]-(e[c]/2-n[c]/2);break;case Au:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function Ou(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=i===void 0?t.placement:i,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?pH:a,u=n.rootBoundary,c=u===void 0?q6:u,d=n.elementContext,f=d===void 0?wu:d,p=n.altBoundary,h=p===void 0?!1:p,m=n.padding,v=m===void 0?0:m,S=e3(typeof v!="number"?v:t3(v,bu)),b=f===wu?hH:wu,k=t.rects.popper,A=t.elements[h?b:f],w=qH(Ps(A)?A:A.contextElement||Ko(t.elements.popper),l,c,s),y=Ia(t.elements.reference),C=s3({reference:y,element:k,placement:r}),P=gg(Object.assign({},k,C)),R=f===wu?P:y,M={top:w.top-R.top+S.top,bottom:R.bottom-w.bottom+S.bottom,left:w.left-R.left+S.left,right:R.right-w.right+S.right},D=t.modifiersData.offset;if(f===wu&&D){var $=D[r];Object.keys(M).forEach(function(q){var J=[Zi,Gi].indexOf(q)>=0?1:-1,ve=[Mi,Gi].indexOf(q)>=0?"y":"x";M[q]+=$[ve]*J})}return M}function XH(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?G6:l,c=La(i),d=c?a?X6:X6.filter(function(h){return La(h)===c}):bu,f=d.filter(function(h){return u.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=Ou(t,{placement:m,boundary:r,rootBoundary:o,padding:s})[Mr(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function GH(t){if(Mr(t)===lg)return[];var e=Ed(t);return[i3(t),e,i3(e)]}function ZH(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,m=n.allowedAutoPlacements,v=e.options.placement,S=Mr(v),b=S===v,k=l||(b||!h?[Ed(v)]:GH(v)),A=[v].concat(k).reduce(function(Pe,Te){return Pe.concat(Mr(Te)===lg?XH(e,{placement:Te,boundary:c,rootBoundary:d,padding:u,flipVariations:h,allowedAutoPlacements:m}):Te)},[]),w=e.rects.reference,y=e.rects.popper,C=new Map,P=!0,R=A[0],M=0;M<A.length;M++){var D=A[M],$=Mr(D),q=La(D)===Ea,J=[Mi,Gi].indexOf($)>=0,ve=J?"width":"height",ae=Ou(e,{placement:D,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),me=J?q?Zi:Ei:q?Gi:Mi;w[ve]>y[ve]&&(me=Ed(me));var se=Ed(me),Ie=[];if(o&&Ie.push(ae[$]<=0),a&&Ie.push(ae[me]<=0,ae[se]<=0),Ie.every(function(Pe){return Pe})){R=D,P=!1;break}C.set(D,Ie)}if(P)for(var Be=h?3:1,xe=function(Te){var ue=A.find(function(Se){var Z=C.get(Se);if(Z)return Z.slice(0,Te).every(function(X){return X})});if(ue)return R=ue,"break"},de=Be;de>0;de--){var ge=xe(de);if(ge==="break")break}e.placement!==R&&(e.modifiersData[i]._skip=!0,e.placement=R,e.reset=!0)}}const _H={name:"flip",enabled:!0,phase:"main",fn:ZH,requiresIfExists:["offset"],data:{_skip:!1}};function a3(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 l3(t){return[Mi,Zi,Gi,Ei].some(function(e){return t[e]>=0})}function JH(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=Ou(e,{elementContext:"reference"}),a=Ou(e,{altBoundary:!0}),l=a3(s,i),u=a3(a,r,o),c=l3(l),d=l3(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const YH={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:JH};function QH(t,e,n){var i=Mr(t),r=[Ei,Mi].indexOf(i)>=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)*r,[Ei,Zi].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function eU(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=r===void 0?[0,0]:r,s=G6.reduce(function(c,d){return c[d]=QH(d,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[i]=s}const tU={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:eU};function nU(t){var e=t.state,n=t.name;e.modifiersData[n]=s3({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const iU={name:"popperOffsets",enabled:!0,phase:"read",fn:nU,data:{}};function rU(t){return t==="x"?"y":"x"}function oU(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,h=n.tetherOffset,m=h===void 0?0:h,v=Ou(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),S=Mr(e.placement),b=La(e.placement),k=!b,A=fg(S),w=rU(A),y=e.modifiersData.popperOffsets,C=e.rects.reference,P=e.rects.popper,R=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,M=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(y){if(o){var q,J=A==="y"?Mi:Ei,ve=A==="y"?Gi:Zi,ae=A==="y"?"height":"width",me=y[A],se=me+v[J],Ie=me-v[ve],Be=p?-P[ae]/2:0,xe=b===Ea?C[ae]:P[ae],de=b===Ea?-P[ae]:-C[ae],ge=e.elements.arrow,Pe=p&&ge?dg(ge):{width:0,height:0},Te=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Q6(),ue=Te[J],Se=Te[ve],Z=Cu(0,C[ae],Pe[ae]),X=k?C[ae]/2-Be-Z-ue-M.mainAxis:xe-Z-ue-M.mainAxis,U=k?-C[ae]/2+Be+Z+Se+M.mainAxis:de+Z+Se+M.mainAxis,Y=e.elements.arrow&&Su(e.elements.arrow),ke=Y?A==="y"?Y.clientTop||0:Y.clientLeft||0:0,Fe=(q=D==null?void 0:D[A])!=null?q:0,H=me+X-Fe-ke,he=me+U-Fe,De=Cu(p?Td(se,H):se,me,p?Is(Ie,he):Ie);y[A]=De,$[A]=De-me}if(a){var nt,St=A==="x"?Mi:Ei,lt=A==="x"?Gi:Zi,At=y[w],Ut=w==="y"?"height":"width",cn=At+v[St],dn=At-v[lt],tn=[Mi,Ei].indexOf(S)!==-1,zt=(nt=D==null?void 0:D[w])!=null?nt:0,Rt=tn?cn:At-C[Ut]-P[Ut]-zt+M.altAxis,kn=tn?At+C[Ut]+P[Ut]-zt-M.altAxis:dn,Yt=p&&tn?EH(Rt,At,kn):Cu(p?Rt:cn,At,p?kn:dn);y[w]=Yt,$[w]=Yt-At}e.modifiersData[i]=$}}const sU={name:"preventOverflow",enabled:!0,phase:"main",fn:oU,requiresIfExists:["offset"]};function aU(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function lU(t){return t===Bi(t)||!_i(t)?pg(t):aU(t)}function uU(t){var e=t.getBoundingClientRect(),n=Pa(e.width)/t.offsetWidth||1,i=Pa(e.height)/t.offsetHeight||1;return n!==1||i!==1}function cU(t,e,n){n===void 0&&(n=!1);var i=_i(e),r=_i(e)&&uU(e),o=Ko(e),s=Ia(t,r,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((xr(e)!=="body"||mg(o))&&(a=lU(e)),_i(e)?(l=Ia(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=hg(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function dU(t){var e=new Map,n=new Set,i=[];t.forEach(function(o){e.set(o.name,o)});function r(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&r(l)}}),i.push(o)}return t.forEach(function(o){n.has(o.name)||r(o)}),i}function fU(t){var e=dU(t);return kH.reduce(function(n,i){return n.concat(e.filter(function(r){return r.phase===i}))},[])}function pU(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function hU(t){var e=t.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var u3={placement:"bottom",modifiers:[],strategy:"absolute"};function c3(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function mU(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,i=n===void 0?[]:n,r=e.defaultOptions,o=r===void 0?u3:r;return function(a,l,u){u===void 0&&(u=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},u3,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:c,setOptions:function(S){var b=typeof S=="function"?S(c.options):S;m(),c.options=Object.assign({},o,c.options,b),c.scrollParents={reference:Ps(a)?ku(a):a.contextElement?ku(a.contextElement):[],popper:ku(l)};var k=fU(hU([].concat(i,c.options.modifiers)));return c.orderedModifiers=k.filter(function(A){return A.enabled}),h(),p.update()},forceUpdate:function(){if(!f){var S=c.elements,b=S.reference,k=S.popper;if(c3(b,k)){c.rects={reference:cU(b,Su(k),c.options.strategy==="fixed"),popper:dg(k)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(M){return c.modifiersData[M.name]=Object.assign({},M.data)});for(var A=0;A<c.orderedModifiers.length;A++){if(c.reset===!0){c.reset=!1,A=-1;continue}var w=c.orderedModifiers[A],y=w.fn,C=w.options,P=C===void 0?{}:C,R=w.name;typeof y=="function"&&(c=y({state:c,options:P,name:R,instance:p})||c)}}}},update:pU(function(){return new Promise(function(v){p.forceUpdate(),v(c)})}),destroy:function(){m(),f=!0}};if(!c3(a,l))return p;p.setOptions(u).then(function(v){!f&&u.onFirstUpdate&&u.onFirstUpdate(v)});function h(){c.orderedModifiers.forEach(function(v){var S=v.name,b=v.options,k=b===void 0?{}:b,A=v.effect;if(typeof A=="function"){var w=A({state:c,name:S,instance:p,options:k}),y=function(){};d.push(w||y)}})}function m(){d.forEach(function(v){return v()}),d=[]}return p}}var gU=[zH,iU,$H,Z6,tU,_H,sU,DH,YH],vU=mU({defaultModifiers:gU}),yU="tippy-box",d3="tippy-content",bU="tippy-backdrop",f3="tippy-arrow",p3="tippy-svg-arrow",Ls={passive:!0,capture:!0},h3=function(){return document.body};function vg(t,e,n){if(Array.isArray(t)){var i=t[e];return i??(Array.isArray(n)?n[e]:n)}return t}function yg(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function m3(t,e){return typeof t=="function"?t.apply(void 0,e):t}function g3(t,e){if(e===0)return t;var n;return function(i){clearTimeout(n),n=setTimeout(function(){t(i)},e)}}function AU(t){return t.split(/\s+/).filter(Boolean)}function Da(t){return[].concat(t)}function v3(t,e){t.indexOf(e)===-1&&t.push(e)}function wU(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function SU(t){return t.split("-")[0]}function Pd(t){return[].slice.call(t)}function y3(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Tu(){return document.createElement("div")}function Id(t){return["Element","Fragment"].some(function(e){return yg(t,e)})}function CU(t){return yg(t,"NodeList")}function kU(t){return yg(t,"MouseEvent")}function OU(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function TU(t){return Id(t)?[t]:CU(t)?Pd(t):Array.isArray(t)?t:Pd(document.querySelectorAll(t))}function bg(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function b3(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function xU(t){var e,n=Da(t),i=n[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function MU(t,e){var n=e.clientX,i=e.clientY;return t.every(function(r){var o=r.popperRect,s=r.popperState,a=r.props,l=a.interactiveBorder,u=SU(s.placement),c=s.modifiersData.offset;if(!c)return!0;var d=u==="bottom"?c.top.y:0,f=u==="top"?c.bottom.y:0,p=u==="right"?c.left.x:0,h=u==="left"?c.right.x:0,m=o.top-i+d>l,v=i-o.bottom-f>l,S=o.left-n+p>l,b=n-o.right-h>l;return m||v||S||b})}function Ag(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){t[i](r,n)})}function A3(t,e){for(var n=e;n;){var i;if(t.contains(n))return!0;n=n.getRootNode==null||(i=n.getRootNode())==null?void 0:i.host}return!1}var Er={isTouch:!1},w3=0;function EU(){Er.isTouch||(Er.isTouch=!0,window.performance&&document.addEventListener("mousemove",S3))}function S3(){var t=performance.now();t-w3<20&&(Er.isTouch=!1,document.removeEventListener("mousemove",S3)),w3=t}function PU(){var t=document.activeElement;if(OU(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function IU(){document.addEventListener("touchstart",EU,Ls),window.addEventListener("blur",PU)}var LU=typeof window<"u"&&typeof document<"u",DU=LU?!!window.msCrypto:!1,RU={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},NU={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},pr=Object.assign({appendTo:h3,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},RU,NU),BU=Object.keys(pr),$U=function(e){var n=Object.keys(e);n.forEach(function(i){pr[i]=e[i]})};function C3(t){var e=t.plugins||[],n=e.reduce(function(i,r){var o=r.name,s=r.defaultValue;if(o){var a;i[o]=t[o]!==void 0?t[o]:(a=pr[o])!=null?a:s}return i},{});return Object.assign({},t,n)}function VU(t,e){var n=e?Object.keys(C3(Object.assign({},pr,{plugins:e}))):BU,i=n.reduce(function(r,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return r;if(o==="content")r[o]=s;else try{r[o]=JSON.parse(s)}catch{r[o]=s}return r},{});return i}function k3(t,e){var n=Object.assign({},e,{content:m3(e.content,[t])},e.ignoreAttributes?{}:VU(t,e.plugins));return n.aria=Object.assign({},pr.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}var zU=function(){return"innerHTML"};function wg(t,e){t[zU()]=e}function O3(t){var e=Tu();return t===!0?e.className=f3:(e.className=p3,Id(t)?e.appendChild(t):wg(e,t)),e}function T3(t,e){Id(e.content)?(wg(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?wg(t,e.content):t.textContent=e.content)}function Sg(t){var e=t.firstElementChild,n=Pd(e.children);return{box:e,content:n.find(function(i){return i.classList.contains(d3)}),arrow:n.find(function(i){return i.classList.contains(f3)||i.classList.contains(p3)}),backdrop:n.find(function(i){return i.classList.contains(bU)})}}function x3(t){var e=Tu(),n=Tu();n.className=yU,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=Tu();i.className=d3,i.setAttribute("data-state","hidden"),T3(i,t.props),e.appendChild(n),n.appendChild(i),r(t.props,t.props);function r(o,s){var a=Sg(e),l=a.box,u=a.content,c=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&T3(u,t.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(O3(s.arrow))):l.appendChild(O3(s.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:r}}x3.$$tippy=!0;var FU=1,Ld=[],Cg=[];function jU(t,e){var n=k3(t,Object.assign({},pr,C3(y3(e)))),i,r,o,s=!1,a=!1,l=!1,u=!1,c,d,f,p=[],h=g3(H,n.interactiveDebounce),m,v=FU++,S=null,b=wU(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},A={id:v,reference:t,popper:Tu(),popperInstance:S,props:n,state:k,plugins:b,clearDelayTimeouts:Rt,setProps:kn,setContent:Yt,show:te,hide:Q,hideWithInteractivity:we,enable:tn,disable:zt,unmount:je,destroy:st};if(!n.render)return A;var w=n.render(A),y=w.popper,C=w.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+A.id,A.popper=y,t._tippy=A,y._tippy=A;var P=b.map(function(ie){return ie.fn(A)}),R=t.hasAttribute("aria-expanded");return Y(),Be(),me(),se("onCreate",[A]),n.showOnCreate&&cn(),y.addEventListener("mouseenter",function(){A.props.interactive&&A.state.isVisible&&A.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){A.props.interactive&&A.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",h)}),A;function M(){var ie=A.props.touch;return Array.isArray(ie)?ie:[ie,0]}function D(){return M()[0]==="hold"}function $(){var ie;return!!((ie=A.props.render)!=null&&ie.$$tippy)}function q(){return m||t}function J(){var ie=q().parentNode;return ie?xU(ie):document}function ve(){return Sg(y)}function ae(ie){return A.state.isMounted&&!A.state.isVisible||Er.isTouch||c&&c.type==="focus"?0:vg(A.props.delay,ie?0:1,pr.delay)}function me(ie){ie===void 0&&(ie=!1),y.style.pointerEvents=A.props.interactive&&!ie?"":"none",y.style.zIndex=""+A.props.zIndex}function se(ie,Ae,He){if(He===void 0&&(He=!0),P.forEach(function(rt){rt[ie]&&rt[ie].apply(rt,Ae)}),He){var ut;(ut=A.props)[ie].apply(ut,Ae)}}function Ie(){var ie=A.props.aria;if(ie.content){var Ae="aria-"+ie.content,He=y.id,ut=Da(A.props.triggerTarget||t);ut.forEach(function(rt){var gt=rt.getAttribute(Ae);if(A.state.isVisible)rt.setAttribute(Ae,gt?gt+" "+He:He);else{var Ft=gt&&gt.replace(He,"").trim();Ft?rt.setAttribute(Ae,Ft):rt.removeAttribute(Ae)}})}}function Be(){if(!(R||!A.props.aria.expanded)){var ie=Da(A.props.triggerTarget||t);ie.forEach(function(Ae){A.props.interactive?Ae.setAttribute("aria-expanded",A.state.isVisible&&Ae===q()?"true":"false"):Ae.removeAttribute("aria-expanded")})}}function xe(){J().removeEventListener("mousemove",h),Ld=Ld.filter(function(ie){return ie!==h})}function de(ie){if(!(Er.isTouch&&(l||ie.type==="mousedown"))){var Ae=ie.composedPath&&ie.composedPath()[0]||ie.target;if(!(A.props.interactive&&A3(y,Ae))){if(Da(A.props.triggerTarget||t).some(function(He){return A3(He,Ae)})){if(Er.isTouch||A.state.isVisible&&A.props.trigger.indexOf("click")>=0)return}else se("onClickOutside",[A,ie]);A.props.hideOnClick===!0&&(A.clearDelayTimeouts(),A.hide(),a=!0,setTimeout(function(){a=!1}),A.state.isMounted||ue())}}}function ge(){l=!0}function Pe(){l=!1}function Te(){var ie=J();ie.addEventListener("mousedown",de,!0),ie.addEventListener("touchend",de,Ls),ie.addEventListener("touchstart",Pe,Ls),ie.addEventListener("touchmove",ge,Ls)}function ue(){var ie=J();ie.removeEventListener("mousedown",de,!0),ie.removeEventListener("touchend",de,Ls),ie.removeEventListener("touchstart",Pe,Ls),ie.removeEventListener("touchmove",ge,Ls)}function Se(ie,Ae){X(ie,function(){!A.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&Ae()})}function Z(ie,Ae){X(ie,Ae)}function X(ie,Ae){var He=ve().box;function ut(rt){rt.target===He&&(Ag(He,"remove",ut),Ae())}if(ie===0)return Ae();Ag(He,"remove",d),Ag(He,"add",ut),d=ut}function U(ie,Ae,He){He===void 0&&(He=!1);var ut=Da(A.props.triggerTarget||t);ut.forEach(function(rt){rt.addEventListener(ie,Ae,He),p.push({node:rt,eventType:ie,handler:Ae,options:He})})}function Y(){D()&&(U("touchstart",Fe,{passive:!0}),U("touchend",he,{passive:!0})),AU(A.props.trigger).forEach(function(ie){if(ie!=="manual")switch(U(ie,Fe),ie){case"mouseenter":U("mouseleave",he);break;case"focus":U(DU?"focusout":"blur",De);break;case"focusin":U("focusout",De);break}})}function ke(){p.forEach(function(ie){var Ae=ie.node,He=ie.eventType,ut=ie.handler,rt=ie.options;Ae.removeEventListener(He,ut,rt)}),p=[]}function Fe(ie){var Ae,He=!1;if(!(!A.state.isEnabled||nt(ie)||a)){var ut=((Ae=c)==null?void 0:Ae.type)==="focus";c=ie,m=ie.currentTarget,Be(),!A.state.isVisible&&kU(ie)&&Ld.forEach(function(rt){return rt(ie)}),ie.type==="click"&&(A.props.trigger.indexOf("mouseenter")<0||s)&&A.props.hideOnClick!==!1&&A.state.isVisible?He=!0:cn(ie),ie.type==="click"&&(s=!He),He&&!ut&&dn(ie)}}function H(ie){var Ae=ie.target,He=q().contains(Ae)||y.contains(Ae);if(!(ie.type==="mousemove"&&He)){var ut=Ut().concat(y).map(function(rt){var gt,Ft=rt._tippy,on=(gt=Ft.popperInstance)==null?void 0:gt.state;return on?{popperRect:rt.getBoundingClientRect(),popperState:on,props:n}:null}).filter(Boolean);MU(ut,ie)&&(xe(),dn(ie))}}function he(ie){var Ae=nt(ie)||A.props.trigger.indexOf("click")>=0&&s;if(!Ae){if(A.props.interactive){A.hideWithInteractivity(ie);return}dn(ie)}}function De(ie){A.props.trigger.indexOf("focusin")<0&&ie.target!==q()||A.props.interactive&&ie.relatedTarget&&y.contains(ie.relatedTarget)||dn(ie)}function nt(ie){return Er.isTouch?D()!==ie.type.indexOf("touch")>=0:!1}function St(){lt();var ie=A.props,Ae=ie.popperOptions,He=ie.placement,ut=ie.offset,rt=ie.getReferenceClientRect,gt=ie.moveTransition,Ft=$()?Sg(y).arrow:null,on=rt?{getBoundingClientRect:rt,contextElement:rt.contextElement||q()}:t,fn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(fe){var Ne=fe.state;if($()){var at=ve(),Qt=at.box;["placement","reference-hidden","escaped"].forEach(function(Jt){Jt==="placement"?Qt.setAttribute("data-placement",Ne.placement):Ne.attributes.popper["data-popper-"+Jt]?Qt.setAttribute("data-"+Jt,""):Qt.removeAttribute("data-"+Jt)}),Ne.attributes.popper={}}}},gn=[{name:"offset",options:{offset:ut}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!gt}},fn];$()&&Ft&&gn.push({name:"arrow",options:{element:Ft,padding:3}}),gn.push.apply(gn,(Ae==null?void 0:Ae.modifiers)||[]),A.popperInstance=vU(on,y,Object.assign({},Ae,{placement:He,onFirstUpdate:f,modifiers:gn}))}function lt(){A.popperInstance&&(A.popperInstance.destroy(),A.popperInstance=null)}function At(){var ie=A.props.appendTo,Ae,He=q();A.props.interactive&&ie===h3||ie==="parent"?Ae=He.parentNode:Ae=m3(ie,[He]),Ae.contains(y)||Ae.appendChild(y),A.state.isMounted=!0,St()}function Ut(){return Pd(y.querySelectorAll("[data-tippy-root]"))}function cn(ie){A.clearDelayTimeouts(),ie&&se("onTrigger",[A,ie]),Te();var Ae=ae(!0),He=M(),ut=He[0],rt=He[1];Er.isTouch&&ut==="hold"&&rt&&(Ae=rt),Ae?i=setTimeout(function(){A.show()},Ae):A.show()}function dn(ie){if(A.clearDelayTimeouts(),se("onUntrigger",[A,ie]),!A.state.isVisible){ue();return}if(!(A.props.trigger.indexOf("mouseenter")>=0&&A.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ie.type)>=0&&s)){var Ae=ae(!1);Ae?r=setTimeout(function(){A.state.isVisible&&A.hide()},Ae):o=requestAnimationFrame(function(){A.hide()})}}function tn(){A.state.isEnabled=!0}function zt(){A.hide(),A.state.isEnabled=!1}function Rt(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)}function kn(ie){if(!A.state.isDestroyed){se("onBeforeUpdate",[A,ie]),ke();var Ae=A.props,He=k3(t,Object.assign({},Ae,y3(ie),{ignoreAttributes:!0}));A.props=He,Y(),Ae.interactiveDebounce!==He.interactiveDebounce&&(xe(),h=g3(H,He.interactiveDebounce)),Ae.triggerTarget&&!He.triggerTarget?Da(Ae.triggerTarget).forEach(function(ut){ut.removeAttribute("aria-expanded")}):He.triggerTarget&&t.removeAttribute("aria-expanded"),Be(),me(),C&&C(Ae,He),A.popperInstance&&(St(),Ut().forEach(function(ut){requestAnimationFrame(ut._tippy.popperInstance.forceUpdate)})),se("onAfterUpdate",[A,ie])}}function Yt(ie){A.setProps({content:ie})}function te(){var ie=A.state.isVisible,Ae=A.state.isDestroyed,He=!A.state.isEnabled,ut=Er.isTouch&&!A.props.touch,rt=vg(A.props.duration,0,pr.duration);if(!(ie||Ae||He||ut)&&!q().hasAttribute("disabled")&&(se("onShow",[A],!1),A.props.onShow(A)!==!1)){if(A.state.isVisible=!0,$()&&(y.style.visibility="visible"),me(),Te(),A.state.isMounted||(y.style.transition="none"),$()){var gt=ve(),Ft=gt.box,on=gt.content;bg([Ft,on],0)}f=function(){var gn;if(!(!A.state.isVisible||u)){if(u=!0,y.offsetHeight,y.style.transition=A.props.moveTransition,$()&&A.props.animation){var F=ve(),fe=F.box,Ne=F.content;bg([fe,Ne],rt),b3([fe,Ne],"visible")}Ie(),Be(),v3(Cg,A),(gn=A.popperInstance)==null||gn.forceUpdate(),se("onMount",[A]),A.props.animation&&$()&&Z(rt,function(){A.state.isShown=!0,se("onShown",[A])})}},At()}}function Q(){var ie=!A.state.isVisible,Ae=A.state.isDestroyed,He=!A.state.isEnabled,ut=vg(A.props.duration,1,pr.duration);if(!(ie||Ae||He)&&(se("onHide",[A],!1),A.props.onHide(A)!==!1)){if(A.state.isVisible=!1,A.state.isShown=!1,u=!1,s=!1,$()&&(y.style.visibility="hidden"),xe(),ue(),me(!0),$()){var rt=ve(),gt=rt.box,Ft=rt.content;A.props.animation&&(bg([gt,Ft],ut),b3([gt,Ft],"hidden"))}Ie(),Be(),A.props.animation?$()&&Se(ut,A.unmount):A.unmount()}}function we(ie){J().addEventListener("mousemove",h),v3(Ld,h),h(ie)}function je(){A.state.isVisible&&A.hide(),A.state.isMounted&&(lt(),Ut().forEach(function(ie){ie._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),Cg=Cg.filter(function(ie){return ie!==A}),A.state.isMounted=!1,se("onHidden",[A]))}function st(){A.state.isDestroyed||(A.clearDelayTimeouts(),A.unmount(),ke(),delete t._tippy,A.state.isDestroyed=!0,se("onDestroy",[A]))}}function Ds(t,e){e===void 0&&(e={});var n=pr.plugins.concat(e.plugins||[]);IU();var i=Object.assign({},e,{plugins:n}),r=TU(t),o=r.reduce(function(s,a){var l=a&&jU(a,i);return l&&s.push(l),s},[]);return Id(t)?o[0]:o}Ds.defaultProps=pr,Ds.setDefaultProps=$U,Ds.currentInput=Er,Object.assign({},Z6,{effect:function(e){var n=e.state,i={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,i.popper),n.styles=i,n.elements.arrow&&Object.assign(n.elements.arrow.style,i.arrow)}}),Ds.setDefaultProps({render:x3});class HU{getTextContent(e){return z6(e,{textSerializers:Qm(this.editor.schema)})}constructor({editor:e,element:n,view:i,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:l}=a,{$anchor:u,empty:c}=l,d=u.depth===1,f=u.parent.isTextblock&&!u.parent.type.spec.code&&!u.parent.textContent&&u.parent.childCount===0&&!this.getTextContent(u.parent);return!(!s.hasFocus()||!c||!d||!f||!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))||(s==null?void 0:s.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=i,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=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Ds(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 i,r,o;const{state:s}=e,{doc:a,selection:l}=s,{from:u,to:c}=l;if(n&&n.doc.eq(a)&&n.selection.eq(l))return;if(this.createTooltip(),!((i=this.shouldShow)===null||i===void 0?void 0:i.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(r=this.tippy)===null||r===void 0||r.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>H6(e,u,c))}),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 M3=t=>new qn({key:typeof t.pluginKey=="string"?new ni(t.pluginKey):t.pluginKey,view:e=>new HU({view:e,...t})}),UU=Ai.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[M3({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),KU=xi.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]}`,$n(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=>Qj({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Dd=200,Gn=function(){};Gn.prototype.append=function(e){return e.length?(e=Gn.from(e),!this.length&&e||e.length<Dd&&this.leafAppend(e)||this.length<Dd&&e.leafPrepend(this)||this.appendInner(e)):this},Gn.prototype.prepend=function(e){return e.length?Gn.from(e).append(this):this},Gn.prototype.appendInner=function(e){return new WU(this,e)},Gn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Gn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Gn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Gn.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)},Gn.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(o,s){return r.push(e(o,s))},n,i),r},Gn.from=function(e){return e instanceof Gn?e:e&&e.length?new E3(e):Gn.empty};var E3=function(t){function e(i){t.call(this),this.values=i}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(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,s,a){for(var l=o;l<s;l++)if(r(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,a){for(var l=o-1;l>=s;l--)if(r(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Dd)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Dd)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Gn);Gn.empty=new E3([]);var WU=function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.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(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,o,s){var a=this.left.length;if(r<a&&this.left.forEachInner(i,r,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(i,Math.max(r-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,o,s){var a=this.left.length;if(r>a&&this.right.forEachInvertedInner(i,r-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(i,Math.min(r,a),o,s)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(i,r):i>=o?this.right.slice(i-o,r-o):this.left.slice(i,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(Gn);const qU=500;class hr{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,o;n&&(r=this.remapping(i,this.items.length),o=r.maps.length);let s=e.tr,a,l,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){r||(r=this.remapping(i,f+1),o=r.maps.length),o--,c.push(d);return}if(r){c.push(new Pr(d.map));let p=d.step.map(r.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],u.push(new Pr(h,void 0,void 0,u.length+c.length))),o--,h&&r.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return a=r?d.selection.map(r.slice(o)):d.selection,l=new hr(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,i,r){let o=[],s=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),f=new Pr(e.mapping.maps[c],d,n),p;(p=l&&l.merge(f))&&(f=p,c?o.pop():a=a.slice(0,a.length-1)),o.push(f),n&&(s++,n=void 0),r||(l=f)}let u=s-i.depth;return u>GU&&(a=XU(a,u),s-=u),new hr(a.append(o),s)}remapping(e,n){let i=new iu;return this.items.forEach((r,o)=>{let s=r.mirrorOffset!=null&&o-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,s)},e,n),i}addMaps(e){return this.eventCount==0?this:new hr(this.items.append(e.map(n=>new Pr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},r);let l=n;this.items.forEach(f=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),v=f.selection&&f.selection.map(o.slice(l+1,p));v&&a++,i.push(new Pr(h,m,v))}else i.push(new Pr(h))},r);let u=[];for(let f=n;f<s;f++)u.push(new Pr(o.maps[f]));let c=this.items.slice(0,r).append(u).append(i),d=new hr(c,a);return d.emptyItemCount()>qU&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.maps.length,r=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)r.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(i)),u=l&&l.getMap();if(i--,u&&n.appendMap(u,i),l){let c=s.selection&&s.selection.map(n.slice(i));c&&o++;let d=new Pr(u.invert(),l,c),f,p=r.length-1;(f=r.length&&r[p].merge(d))?r[p]=f:r.push(d)}}else s.map&&i--},this.items.length,0),new hr(Gn.from(r.reverse()),o)}}hr.empty=new hr(Gn.empty,0);function XU(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class Pr{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Pr(n.getMap().invert(),n,this.selection)}}}class Wo{constructor(e,n,i,r,o){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=o}}const GU=20;function ZU(t,e,n,i){let r=n.getMeta(Rs),o;if(r)return r.historyState;n.getMeta(YU)&&(t=new Wo(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Rs))return s.getMeta(Rs).redo?new Wo(t.done.addTransform(n,void 0,i,Rd(e)),t.undone,P3(n.mapping.maps),t.prevTime,t.prevComposition):new Wo(t.done,t.undone.addTransform(n,void 0,i,Rd(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-i.newGroupDelay||!_U(n,t.prevRanges)),u=s?kg(t.prevRanges,n.mapping):P3(n.mapping.maps);return new Wo(t.done.addTransform(n,l?e.selection.getBookmark():void 0,i,Rd(e)),hr.empty,u,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Wo(t.done.rebased(n,o),t.undone.rebased(n,o),kg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Wo(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),kg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function _U(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let o=0;o<e.length;o+=2)i<=e[o+1]&&r>=e[o]&&(n=!0)}),n}function P3(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,o,s)=>e.push(o,s));return e}function kg(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),o=e.map(t[i+1],-1);r<=o&&n.push(r,o)}return n}function JU(t,e,n){let i=Rd(e),r=Rs.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,i);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),r,i),l=new Wo(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Rs,{redo:n,historyState:l})}let Og=!1,I3=null;function Rd(t){let e=t.plugins;if(I3!=e){Og=!1,I3=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Og=!0;break}}return Og}const Rs=new ni("history"),YU=new ni("closeHistory");function QU(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new qn({key:Rs,state:{init(){return new Wo(hr.empty,hr.empty,null,0,-1)},apply(e,n,i){return ZU(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?D3:i=="historyRedo"?R3:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function L3(t,e){return(n,i)=>{let r=Rs.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let o=JU(r,n,t);o&&i(e?o.scrollIntoView():o)}return!0}}const D3=L3(!1,!0),R3=L3(!0,!0),eK=Ai.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>D3(t,e),redo:()=>({state:t,dispatch:e})=>R3(t,e)}},addProseMirrorPlugins(){return[QU(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()}}}),tK=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,nK=xi.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",$n(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Yj({find:tK,type:this.type,getAttributes:t=>{const[,,e,n,i]=t;return{src:n,alt:e,title:i}}})]}}),iK=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,rK=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,oK=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,sK=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,aK=to.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",$n(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[yu({find:iK,type:this.type}),yu({find:oK,type:this.type})]},addPasteRules(){return[Ma({find:rK,type:this.type}),Ma({find:sK,type:this.type})]}}),lK="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",uK="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ra=(t,e)=>{for(const n in e)t[n]=e[n];return t},Tg="numeric",xg="ascii",Mg="alpha",xu="asciinumeric",Mu="alphanumeric",Eg="domain",N3="emoji",cK="scheme",dK="slashscheme",Pg="whitespace";function fK(t,e){return t in e||(e[t]=[]),e[t]}function Ns(t,e,n){e[Tg]&&(e[xu]=!0,e[Mu]=!0),e[xg]&&(e[xu]=!0,e[Mg]=!0),e[xu]&&(e[Mu]=!0),e[Mg]&&(e[Mu]=!0),e[Mu]&&(e[Eg]=!0),e[N3]&&(e[Eg]=!0);for(const i in e){const r=fK(i,n);r.indexOf(t)<0&&r.push(t)}}function pK(t,e){const n={};for(const i in e)e[i].indexOf(t)>=0&&(n[i]=!0);return n}function Pi(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Pi.groups={},Pi.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let i=0;i<e.jr.length;i++){const r=e.jr[i][0],o=e.jr[i][1];if(o&&r.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,i){for(let r=0;r<t.length;r++)this.tt(t[r],e,n,i)},tr(t,e,n,i){i=i||Pi.groups;let r;return e&&e.j?r=e:(r=new Pi(e),n&&i&&Ns(e,n,i)),this.jr.push([t,r]),r},ts(t,e,n,i){let r=this;const o=t.length;if(!o)return r;for(let s=0;s<o-1;s++)r=r.tt(t[s]);return r.tt(t[o-1],e,n,i)},tt(t,e,n,i){i=i||Pi.groups;const r=this;if(e&&e.j)return r.j[t]=e,e;const o=e;let s,a=r.go(t);if(a?(s=new Pi,Ra(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Pi,o){if(i)if(s.t&&typeof s.t=="string"){const l=Ra(pK(s.t,i),n);Ns(o,l,i)}else n&&Ns(o,n,i);s.t=o}return r.j[t]=s,s}};const Tt=(t,e,n,i,r)=>t.ta(e,n,i,r),Pn=(t,e,n,i,r)=>t.tr(e,n,i,r),B3=(t,e,n,i,r)=>t.ts(e,n,i,r),Le=(t,e,n,i,r)=>t.tt(e,n,i,r),ro="WORD",Ig="UWORD",$3="ASCIINUMERICAL",V3="ALPHANUMERICAL",Eu="LOCALHOST",Lg="TLD",Dg="UTLD",Nd="SCHEME",Na="SLASH_SCHEME",Rg="NUM",Ng="WS",Bg="NL",Pu="OPENBRACE",Iu="CLOSEBRACE",Bd="OPENBRACKET",$d="CLOSEBRACKET",Vd="OPENPAREN",zd="CLOSEPAREN",Fd="OPENANGLEBRACKET",jd="CLOSEANGLEBRACKET",Hd="FULLWIDTHLEFTPAREN",Ud="FULLWIDTHRIGHTPAREN",Kd="LEFTCORNERBRACKET",Wd="RIGHTCORNERBRACKET",qd="LEFTWHITECORNERBRACKET",Xd="RIGHTWHITECORNERBRACKET",Gd="FULLWIDTHLESSTHAN",Zd="FULLWIDTHGREATERTHAN",_d="AMPERSAND",$g="APOSTROPHE",Jd="ASTERISK",qo="AT",Yd="BACKSLASH",Qd="BACKTICK",ef="CARET",Xo="COLON",Vg="COMMA",tf="DOLLAR",Ir="DOT",nf="EQUALS",zg="EXCLAMATION",Ji="HYPHEN",Lu="PERCENT",rf="PIPE",of="PLUS",sf="POUND",Du="QUERY",Fg="QUOTE",z3="FULLWIDTHMIDDLEDOT",jg="SEMI",Lr="SLASH",Ru="TILDE",af="UNDERSCORE",F3="EMOJI",lf="SYM";var j3=Object.freeze({__proto__:null,WORD:ro,UWORD:Ig,ASCIINUMERICAL:$3,ALPHANUMERICAL:V3,LOCALHOST:Eu,TLD:Lg,UTLD:Dg,SCHEME:Nd,SLASH_SCHEME:Na,NUM:Rg,WS:Ng,NL:Bg,OPENBRACE:Pu,CLOSEBRACE:Iu,OPENBRACKET:Bd,CLOSEBRACKET:$d,OPENPAREN:Vd,CLOSEPAREN:zd,OPENANGLEBRACKET:Fd,CLOSEANGLEBRACKET:jd,FULLWIDTHLEFTPAREN:Hd,FULLWIDTHRIGHTPAREN:Ud,LEFTCORNERBRACKET:Kd,RIGHTCORNERBRACKET:Wd,LEFTWHITECORNERBRACKET:qd,RIGHTWHITECORNERBRACKET:Xd,FULLWIDTHLESSTHAN:Gd,FULLWIDTHGREATERTHAN:Zd,AMPERSAND:_d,APOSTROPHE:$g,ASTERISK:Jd,AT:qo,BACKSLASH:Yd,BACKTICK:Qd,CARET:ef,COLON:Xo,COMMA:Vg,DOLLAR:tf,DOT:Ir,EQUALS:nf,EXCLAMATION:zg,HYPHEN:Ji,PERCENT:Lu,PIPE:rf,PLUS:of,POUND:sf,QUERY:Du,QUOTE:Fg,FULLWIDTHMIDDLEDOT:z3,SEMI:jg,SLASH:Lr,TILDE:Ru,UNDERSCORE:af,EMOJI:F3,SYM:lf});const oo=/[a-z]/,Nu=new RegExp("\\p{L}","u"),Hg=new RegExp("\\p{Emoji}","u"),so=/\d/,Ug=/\s/,H3="\r",Kg=`
321
- `,hK="️",mK="‍",Wg="";let uf=null,cf=null;function gK(t=[]){const e={};Pi.groups=e;const n=new Pi;uf==null&&(uf=K3(lK)),cf==null&&(cf=K3(uK)),Le(n,"'",$g),Le(n,"{",Pu),Le(n,"}",Iu),Le(n,"[",Bd),Le(n,"]",$d),Le(n,"(",Vd),Le(n,")",zd),Le(n,"<",Fd),Le(n,">",jd),Le(n,"(",Hd),Le(n,")",Ud),Le(n,"「",Kd),Le(n,"」",Wd),Le(n,"『",qd),Le(n,"』",Xd),Le(n,"<",Gd),Le(n,">",Zd),Le(n,"&",_d),Le(n,"*",Jd),Le(n,"@",qo),Le(n,"`",Qd),Le(n,"^",ef),Le(n,":",Xo),Le(n,",",Vg),Le(n,"$",tf),Le(n,".",Ir),Le(n,"=",nf),Le(n,"!",zg),Le(n,"-",Ji),Le(n,"%",Lu),Le(n,"|",rf),Le(n,"+",of),Le(n,"#",sf),Le(n,"?",Du),Le(n,'"',Fg),Le(n,"/",Lr),Le(n,";",jg),Le(n,"~",Ru),Le(n,"_",af),Le(n,"\\",Yd),Le(n,"・",z3);const i=Pn(n,so,Rg,{[Tg]:!0});Pn(i,so,i);const r=Pn(i,oo,$3,{[xu]:!0}),o=Pn(i,Nu,V3,{[Mu]:!0}),s=Pn(n,oo,ro,{[xg]:!0});Pn(s,so,r),Pn(s,oo,s),Pn(r,so,r),Pn(r,oo,r);const a=Pn(n,Nu,Ig,{[Mg]:!0});Pn(a,oo),Pn(a,so,o),Pn(a,Nu,a),Pn(o,so,o),Pn(o,oo),Pn(o,Nu,o);const l=Le(n,Kg,Bg,{[Pg]:!0}),u=Le(n,H3,Ng,{[Pg]:!0}),c=Pn(n,Ug,Ng,{[Pg]:!0});Le(n,Wg,c),Le(u,Kg,l),Le(u,Wg,c),Pn(u,Ug,c),Le(c,H3),Le(c,Kg),Pn(c,Ug,c),Le(c,Wg,c);const d=Pn(n,Hg,F3,{[N3]:!0});Le(d,"#"),Pn(d,Hg,d),Le(d,hK,d);const f=Le(d,mK);Le(f,"#"),Pn(f,Hg,d);const p=[[oo,s],[so,r]],h=[[oo,null],[Nu,a],[so,o]];for(let m=0;m<uf.length;m++)Go(n,uf[m],Lg,ro,p);for(let m=0;m<cf.length;m++)Go(n,cf[m],Dg,Ig,h);Ns(Lg,{tld:!0,ascii:!0},e),Ns(Dg,{utld:!0,alpha:!0},e),Go(n,"file",Nd,ro,p),Go(n,"mailto",Nd,ro,p),Go(n,"http",Na,ro,p),Go(n,"https",Na,ro,p),Go(n,"ftp",Na,ro,p),Go(n,"ftps",Na,ro,p),Ns(Nd,{scheme:!0,ascii:!0},e),Ns(Na,{slashscheme:!0,ascii:!0},e),t=t.sort((m,v)=>m[0]>v[0]?1:-1);for(let m=0;m<t.length;m++){const v=t[m][0],b=t[m][1]?{[cK]:!0}:{[dK]:!0};v.indexOf("-")>=0?b[Eg]=!0:oo.test(v)?so.test(v)?b[xu]=!0:b[xg]=!0:b[Tg]=!0,B3(n,v,v,b)}return B3(n,"localhost",Eu,{ascii:!0}),n.jd=new Pi(lf),{start:n,tokens:Ra({groups:e},j3)}}function U3(t,e){const n=vK(e.replace(/[A-Z]/g,a=>a.toLowerCase())),i=n.length,r=[];let o=0,s=0;for(;s<i;){let a=t,l=null,u=0,c=null,d=-1,f=-1;for(;s<i&&(l=a.go(n[s]));)a=l,a.accepts()?(d=0,f=0,c=a):d>=0&&(d+=n[s].length,f++),u+=n[s].length,o+=n[s].length,s++;o-=d,s-=f,u-=d,r.push({t:c.t,v:e.slice(o-u,o),s:o-u,e:o})}return r}function vK(t){const e=[],n=t.length;let i=0;for(;i<n;){let r=t.charCodeAt(i),o,s=r<55296||r>56319||i+1===n||(o=t.charCodeAt(i+1))<56320||o>57343?t[i]:t.slice(i,i+2);e.push(s),i+=s.length}return e}function Go(t,e,n,i,r){let o;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?o=t.j[l]:(o=new Pi(i),o.jr=r.slice(),t.j[l]=o),t=o}return o=new Pi(n),o.jr=r.slice(),t.j[e[s-1]]=o,o}function K3(t){const e=[],n=[];let i=0,r="0123456789";for(;i<t.length;){let o=0;for(;r.indexOf(t[i+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(i,i+o),10);s>0;s--)n.pop();i+=o}else n.push(t[i]),i++}return e}const Bu={defaultProtocol:"http",events:null,format:W3,formatHref:W3,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function qg(t,e=null){let n=Ra({},Bu);t&&(n=Ra(n,t instanceof qg?t.o:t));const i=n.ignoreTags,r=[];for(let o=0;o<i.length;o++)r.push(i[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=r}qg.prototype={o:Bu,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const i=e!=null;let r=this.o[t];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:Bu[t],typeof r=="function"&&i&&(r=r(e,n))):typeof r=="function"&&i&&(r=r(e,n.t,n)),r)},getObj(t,e,n){let i=this.o[t];return typeof i=="function"&&e!=null&&(i=i(e,n.t,n)),i},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function W3(t){return t}function q3(t,e){this.t="token",this.v=t,this.tk=e}q3.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),i=t.get("format",e,this);return n&&i.length>n?i.substring(0,n)+"…":i},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Bu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),i=t.get("formatHref",n,this),r=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),c=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=i,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),c&&Ra(s,c),{tagName:r,attributes:s,content:o,eventListeners:d}}};function df(t,e){class n extends q3{constructor(r,o){super(r,o),this.t=t}}for(const i in e)n.prototype[i]=e[i];return n.t=t,n}const X3=df("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),G3=df("text"),yK=df("nl"),ff=df("url",{isLink:!0,toHref(t=Bu.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Eu&&t[1].t===Xo}}),Yi=t=>new Pi(t);function bK({groups:t}){const e=t.domain.concat([_d,Jd,qo,Yd,Qd,ef,tf,nf,Ji,Rg,Lu,rf,of,sf,Lr,lf,Ru,af]),n=[Xo,Vg,Ir,zg,Lu,Du,Fg,jg,Fd,jd,Pu,Iu,$d,Bd,Vd,zd,Hd,Ud,Kd,Wd,qd,Xd,Gd,Zd],i=[_d,$g,Jd,Yd,Qd,ef,tf,nf,Ji,Pu,Iu,Lu,rf,of,sf,Du,Lr,lf,Ru,af],r=Yi(),o=Le(r,Ru);Tt(o,i,o),Tt(o,t.domain,o);const s=Yi(),a=Yi(),l=Yi();Tt(r,t.domain,s),Tt(r,t.scheme,a),Tt(r,t.slashscheme,l),Tt(s,i,o),Tt(s,t.domain,s);const u=Le(s,qo);Le(o,qo,u),Le(a,qo,u),Le(l,qo,u);const c=Le(o,Ir);Tt(c,i,o),Tt(c,t.domain,o);const d=Yi();Tt(u,t.domain,d),Tt(d,t.domain,d);const f=Le(d,Ir);Tt(f,t.domain,d);const p=Yi(X3);Tt(f,t.tld,p),Tt(f,t.utld,p),Le(u,Eu,p);const h=Le(d,Ji);Le(h,Ji,h),Tt(h,t.domain,d),Tt(p,t.domain,d),Le(p,Ir,f),Le(p,Ji,h);const m=Le(p,Xo);Tt(m,t.numeric,X3);const v=Le(s,Ji),S=Le(s,Ir);Le(v,Ji,v),Tt(v,t.domain,s),Tt(S,i,o),Tt(S,t.domain,s);const b=Yi(ff);Tt(S,t.tld,b),Tt(S,t.utld,b),Tt(b,t.domain,s),Tt(b,i,o),Le(b,Ir,S),Le(b,Ji,v),Le(b,qo,u);const k=Le(b,Xo),A=Yi(ff);Tt(k,t.numeric,A);const w=Yi(ff),y=Yi();Tt(w,e,w),Tt(w,n,y),Tt(y,e,w),Tt(y,n,y),Le(b,Lr,w),Le(A,Lr,w);const C=Le(a,Xo),P=Le(l,Xo),R=Le(P,Lr),M=Le(R,Lr);Tt(a,t.domain,s),Le(a,Ir,S),Le(a,Ji,v),Tt(l,t.domain,s),Le(l,Ir,S),Le(l,Ji,v),Tt(C,t.domain,w),Le(C,Lr,w),Le(C,Du,w),Tt(M,t.domain,w),Tt(M,e,w),Le(M,Lr,w);const D=[[Pu,Iu],[Bd,$d],[Vd,zd],[Fd,jd],[Hd,Ud],[Kd,Wd],[qd,Xd],[Gd,Zd]];for(let $=0;$<D.length;$++){const[q,J]=D[$],ve=Le(w,q);Le(y,q,ve),Le(ve,J,w);const ae=Yi(ff);Tt(ve,e,ae);const me=Yi();Tt(ve,n),Tt(ae,e,ae),Tt(ae,n,me),Tt(me,e,ae),Tt(me,n,me),Le(ae,J,w),Le(me,J,w)}return Le(r,Eu,b),Le(r,Bg,yK),{start:r,tokens:j3}}function AK(t,e,n){let i=n.length,r=0,o=[],s=[];for(;r<i;){let a=t,l=null,u=null,c=0,d=null,f=-1;for(;r<i&&!(l=a.go(n[r].t));)s.push(n[r++]);for(;r<i&&(u=l||a.go(n[r].t));)l=null,a=u,a.accepts()?(f=0,d=a):f>=0&&f++,r++,c++;if(f<0)r-=c,r<i&&(s.push(n[r]),r++);else{s.length>0&&(o.push(Xg(G3,e,s)),s=[]),r-=f,c-=f;const p=d.t,h=n.slice(r-c,r);o.push(Xg(p,e,h))}}return s.length>0&&o.push(Xg(G3,e,s)),o}function Xg(t,e,n){const i=n[0].s,r=n[n.length-1].e,o=e.slice(i,r);return new t(o,n)}const wK=typeof console<"u"&&console&&console.warn||(()=>{}),SK="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",An={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function CK(){return Pi.groups={},An.scanner=null,An.parser=null,An.tokenQueue=[],An.pluginQueue=[],An.customSchemes=[],An.initialized=!1,An}function Z3(t,e=!1){if(An.initialized&&wK(`linkifyjs: already initialized - will not register custom scheme "${t}" ${SK}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
295
+ `,textSerializers:i={}}=e||{};return OS(this.state.doc,{blockSeparator:n,textSerializers:{...Em(this.schema),...i}})}get isEmpty(){return dd(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 i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelector(e,n))||null}$nodes(e,n){var i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new xs(n,this)}get $doc(){return this.$pos(0)}};function uu(t){return new ed({find:t.find,handler:({state:e,range:n,match:i})=>{const r=Dt(t.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:o}=e,s=i[i.length-1],a=i[0];if(s){const l=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length;if(Rm(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>u).length)return null;c<n.to&&o.delete(c,n.to),u>n.from&&o.delete(n.from+l,u);const f=n.from+l+s.length;o.addMark(n.from+l,f,t.type.create(r||{})),o.removeStoredMark(t.type)}}})}function WV(t){return new ed({find:t.find,handler:({state:e,range:n,match:i})=>{const r=Dt(t.getAttributes,void 0,i)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(r);if(i[1]){const u=i[0].lastIndexOf(i[1]);let c=s+u;c>a?c=a:a=c+i[1].length;const d=i[0][i[0].length-1];o.insertText(d,s+i[0].length-1),o.replaceWith(c,a,l)}else if(i[0]){const u=t.type.isInline?s:s-1;o.insert(u,t.type.create(r)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function qV(t){return new ed({find:t.find,handler:({state:e,range:n,match:i})=>{const r=e.doc.resolve(n.from),o=Dt(t.getAttributes,void 0,i)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function fd(t){return new ed({find:t.find,handler:({state:e,range:n,match:i,chain:r})=>{const o=Dt(t.getAttributes,void 0,i)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),u=l&&jh(l,t.type,o);if(!u)return null;if(s.wrap(l,u),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){const m=h.filter(v=>p.includes(v.type.name));s.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(d,o).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&Io(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(i,c))&&s.join(n.from-1)}})}class Ti{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=Dt(tt(this,"addOptions",{name:this.name}))),this.storage=Dt(tt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ti(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>id(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ti(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=Dt(tt(n,"addOptions",{name:n.name})),n.storage=Dt(tt(n,"addStorage",{name:n.name,options:n.options})),n}}class XV{constructor(e,n,i){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...i},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,i,r,o,s,a,l;const{view:u}=this.editor,c=e.target,d=c.nodeType===3?(n=c.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!((i=this.contentDOM)===null||i===void 0)&&i.contains(c)||!d)return;let f=0,p=0;if(this.dom!==d){const b=this.dom.getBoundingClientRect(),k=d.getBoundingClientRect(),A=(r=e.offsetX)!==null&&r!==void 0?r:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,w=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;f=k.x-b.x+A,p=k.y-b.y+w}const h=this.dom.cloneNode(!0);(l=e.dataTransfer)===null||l===void 0||l.setDragImage(h,f,p);const m=this.getPos();if(typeof m!="number")return;const v=mt.create(u.state.doc,m),S=u.state.tr.setSelection(v);u.dispatch(S)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const i=e.target;if(!(this.dom.contains(i)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(i))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(i.tagName)||i.isContentEditable)&&!s&&!o)return!0;const{isEditable:l}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,d=mt.isSelectable(this.node),f=e.type==="copy",p=e.type==="paste",h=e.type==="cut",m=e.type==="mousedown";if(!c&&d&&o&&e.target===this.dom&&e.preventDefault(),c&&o&&!u&&e.target===this.dom)return e.preventDefault(),!1;if(c&&l&&!u&&m){const v=i.closest("[data-drag-handle]");v&&(this.dom===v||this.dom.contains(v))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||s||f||p||h||m&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(sd()||AS())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(i=>i.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const i=this.getPos();return typeof i!="number"?!1:(n.setNodeMarkup(i,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Ca(t){return new y$({find:t.find,handler:({state:e,range:n,match:i,pasteEvent:r})=>{const o=Dt(t.getAttributes,void 0,i,r);if(o===!1||o===null)return null;const{tr:s}=e,a=i[i.length-1],l=i[0];let u=n.to;if(a){const c=l.search(/\S/),d=n.from+l.indexOf(a),f=d+a.length;if(Rm(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(v=>v===t.type&&v!==h.mark.type)).filter(h=>h.to>d).length)return null;f<n.to&&s.delete(f,n.to),d>n.from&&s.delete(n.from+c,d),u=n.from+c+a.length,s.addMark(n.from+c,u,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function GV(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const ZV=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_V=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,JV=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,YV=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,QV=Qr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",$n(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[uu({find:ZV,type:this.type}),uu({find:JV,type:this.type})]},addPasteRules(){return[Ca({find:_V,type:this.type}),Ca({find:YV,type:this.type})]}}),ez="listItem",PS="textStyle",IS=/^\s*([-+*])\s$/,tz=Ti.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",$n(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(ez,this.editor.getAttributes(PS)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=fd({find:IS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=fd({find:IS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(PS),editor:this.editor})),[t]}}),nz=/(^|[^`])`([^`]+)`(?!`)/,iz=/(^|[^`])`([^`]+)`(?!`)/g,rz=Qr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",$n(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[uu({find:nz,type:this.type})]},addPasteRules(){return[Ca({find:iz,type:this.type})]}}),oz=Ti.create({name:"doc",topNode:!0,content:"block+"});var xi="top",qi="bottom",Xi="right",Mi="left",Vm="auto",cu=[xi,qi,Xi,Mi],ka="start",du="end",sz="clippingParents",LS="viewport",fu="popper",az="reference",DS=cu.reduce(function(t,e){return t.concat([e+"-"+ka,e+"-"+du])},[]),RS=[].concat(cu,[Vm]).reduce(function(t,e){return t.concat([e,e+"-"+ka,e+"-"+du])},[]),lz="beforeRead",uz="read",cz="afterRead",dz="beforeMain",fz="main",pz="afterMain",hz="beforeWrite",mz="write",gz="afterWrite",vz=[lz,uz,cz,dz,fz,pz,hz,mz,gz];function kr(t){return t?(t.nodeName||"").toLowerCase():null}function Bi(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Ms(t){var e=Bi(t).Element;return t instanceof e||t instanceof Element}function Gi(t){var e=Bi(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function zm(t){if(typeof ShadowRoot>"u")return!1;var e=Bi(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function yz(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},r=e.attributes[n]||{},o=e.elements[n];!Gi(o)||!kr(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function bz(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(i){var r=e.elements[i],o=e.attributes[i]||{},s=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:n[i]),a=s.reduce(function(l,u){return l[u]="",l},{});!Gi(r)||!kr(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}const NS={name:"applyStyles",enabled:!0,phase:"write",fn:yz,effect:bz,requires:["computeStyles"]};function Or(t){return t.split("-")[0]}var Es=Math.max,pd=Math.min,Oa=Math.round;function Fm(){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 BS(){return!/^((?!chrome|android).)*safari/i.test(Fm())}function Ta(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),r=1,o=1;e&&Gi(t)&&(r=t.offsetWidth>0&&Oa(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Oa(i.height)/t.offsetHeight||1);var s=Ms(t)?Bi(t):window,a=s.visualViewport,l=!BS()&&n,u=(i.left+(l&&a?a.offsetLeft:0))/r,c=(i.top+(l&&a?a.offsetTop:0))/o,d=i.width/r,f=i.height/o;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function jm(t){var e=Ta(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function $S(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&zm(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function to(t){return Bi(t).getComputedStyle(t)}function Az(t){return["table","td","th"].indexOf(kr(t))>=0}function Ho(t){return((Ms(t)?t.ownerDocument:t.document)||window.document).documentElement}function hd(t){return kr(t)==="html"?t:t.assignedSlot||t.parentNode||(zm(t)?t.host:null)||Ho(t)}function VS(t){return!Gi(t)||to(t).position==="fixed"?null:t.offsetParent}function wz(t){var e=/firefox/i.test(Fm()),n=/Trident/i.test(Fm());if(n&&Gi(t)){var i=to(t);if(i.position==="fixed")return null}var r=hd(t);for(zm(r)&&(r=r.host);Gi(r)&&["html","body"].indexOf(kr(r))<0;){var o=to(r);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 r;r=r.parentNode}return null}function pu(t){for(var e=Bi(t),n=VS(t);n&&Az(n)&&to(n).position==="static";)n=VS(n);return n&&(kr(n)==="html"||kr(n)==="body"&&to(n).position==="static")?e:n||wz(t)||e}function Hm(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function hu(t,e,n){return Es(t,pd(e,n))}function Sz(t,e,n){var i=hu(t,e,n);return i>n?n:i}function zS(){return{top:0,right:0,bottom:0,left:0}}function FS(t){return Object.assign({},zS(),t)}function jS(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var Cz=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,FS(typeof e!="number"?e:jS(e,cu))};function kz(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Or(n.placement),l=Hm(a),u=[Mi,Xi].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=Cz(r.padding,n),f=jm(o),p=l==="y"?xi:Mi,h=l==="y"?qi:Xi,m=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],v=s[l]-n.rects.reference[l],S=pu(o),b=S?l==="y"?S.clientHeight||0:S.clientWidth||0:0,k=m/2-v/2,A=d[p],w=b-f[c]-d[h],y=b/2-f[c]/2+k,C=hu(A,y,w),P=l;n.modifiersData[i]=(e={},e[P]=C,e.centerOffset=C-y,e)}}function Oz(t){var e=t.state,n=t.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||$S(e.elements.popper,r)&&(e.elements.arrow=r))}const Tz={name:"arrow",enabled:!0,phase:"main",fn:kz,effect:Oz,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xa(t){return t.split("-")[1]}var xz={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mz(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:Oa(n*r)/r||0,y:Oa(i*r)/r||0}}function HS(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,v=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=v.x,m=v.y;var S=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),k=Mi,A=xi,w=window;if(u){var y=pu(n),C="clientHeight",P="clientWidth";if(y===Bi(n)&&(y=Ho(n),to(y).position!=="static"&&a==="absolute"&&(C="scrollHeight",P="scrollWidth")),y=y,r===xi||(r===Mi||r===Xi)&&o===du){A=qi;var R=d&&y===w&&w.visualViewport?w.visualViewport.height:y[C];m-=R-i.height,m*=l?1:-1}if(r===Mi||(r===xi||r===qi)&&o===du){k=Xi;var M=d&&y===w&&w.visualViewport?w.visualViewport.width:y[P];p-=M-i.width,p*=l?1:-1}}var D=Object.assign({position:a},u&&xz),$=c===!0?Mz({x:p,y:m},Bi(n)):{x:p,y:m};if(p=$.x,m=$.y,l){var q;return Object.assign({},D,(q={},q[A]=b?"0":"",q[k]=S?"0":"",q.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",q))}return Object.assign({},D,(e={},e[A]=b?m+"px":"",e[k]=S?p+"px":"",e.transform="",e))}function Ez(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=i===void 0?!0:i,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Or(e.placement),variation:xa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,HS(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,HS(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Pz={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ez,data:{}};var md={passive:!0};function Iz(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=Bi(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,md)}),a&&l.addEventListener("resize",n.update,md),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,md)}),a&&l.removeEventListener("resize",n.update,md)}}const Lz={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Iz,data:{}};var Dz={left:"right",right:"left",bottom:"top",top:"bottom"};function gd(t){return t.replace(/left|right|bottom|top/g,function(e){return Dz[e]})}var Rz={start:"end",end:"start"};function US(t){return t.replace(/start|end/g,function(e){return Rz[e]})}function Um(t){var e=Bi(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Km(t){return Ta(Ho(t)).left+Um(t).scrollLeft}function Nz(t,e){var n=Bi(t),i=Ho(t),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var u=BS();(u||!u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+Km(t),y:l}}function Bz(t){var e,n=Ho(t),i=Um(t),r=(e=t.ownerDocument)==null?void 0:e.body,o=Es(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=Es(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Km(t),l=-i.scrollTop;return to(r||n).direction==="rtl"&&(a+=Es(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Wm(t){var e=to(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function KS(t){return["html","body","#document"].indexOf(kr(t))>=0?t.ownerDocument.body:Gi(t)&&Wm(t)?t:KS(hd(t))}function mu(t,e){var n;e===void 0&&(e=[]);var i=KS(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),o=Bi(i),s=r?[o].concat(o.visualViewport||[],Wm(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(mu(hd(s)))}function qm(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function $z(t,e){var n=Ta(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 WS(t,e,n){return e===LS?qm(Nz(t,n)):Ms(e)?$z(e,n):qm(Bz(Ho(t)))}function Vz(t){var e=mu(hd(t)),n=["absolute","fixed"].indexOf(to(t).position)>=0,i=n&&Gi(t)?pu(t):t;return Ms(i)?e.filter(function(r){return Ms(r)&&$S(r,i)&&kr(r)!=="body"}):[]}function zz(t,e,n,i){var r=e==="clippingParents"?Vz(t):[].concat(e),o=[].concat(r,[n]),s=o[0],a=o.reduce(function(l,u){var c=WS(t,u,i);return l.top=Es(c.top,l.top),l.right=pd(c.right,l.right),l.bottom=pd(c.bottom,l.bottom),l.left=Es(c.left,l.left),l},WS(t,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function qS(t){var e=t.reference,n=t.element,i=t.placement,r=i?Or(i):null,o=i?xa(i):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(r){case xi:l={x:s,y:e.y-n.height};break;case qi:l={x:s,y:e.y+e.height};break;case Xi:l={x:e.x+e.width,y:a};break;case Mi:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=r?Hm(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case ka:l[u]=l[u]-(e[c]/2-n[c]/2);break;case du:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function gu(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=i===void 0?t.placement:i,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?sz:a,u=n.rootBoundary,c=u===void 0?LS:u,d=n.elementContext,f=d===void 0?fu:d,p=n.altBoundary,h=p===void 0?!1:p,m=n.padding,v=m===void 0?0:m,S=FS(typeof v!="number"?v:jS(v,cu)),b=f===fu?az:fu,k=t.rects.popper,A=t.elements[h?b:f],w=zz(Ms(A)?A:A.contextElement||Ho(t.elements.popper),l,c,s),y=Ta(t.elements.reference),C=qS({reference:y,element:k,placement:r}),P=qm(Object.assign({},k,C)),R=f===fu?P:y,M={top:w.top-R.top+S.top,bottom:R.bottom-w.bottom+S.bottom,left:w.left-R.left+S.left,right:R.right-w.right+S.right},D=t.modifiersData.offset;if(f===fu&&D){var $=D[r];Object.keys(M).forEach(function(q){var J=[Xi,qi].indexOf(q)>=0?1:-1,ve=[xi,qi].indexOf(q)>=0?"y":"x";M[q]+=$[ve]*J})}return M}function Fz(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?RS:l,c=xa(i),d=c?a?DS:DS.filter(function(h){return xa(h)===c}):cu,f=d.filter(function(h){return u.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=gu(t,{placement:m,boundary:r,rootBoundary:o,padding:s})[Or(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function jz(t){if(Or(t)===Vm)return[];var e=gd(t);return[US(t),e,US(e)]}function Hz(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,m=n.allowedAutoPlacements,v=e.options.placement,S=Or(v),b=S===v,k=l||(b||!h?[gd(v)]:jz(v)),A=[v].concat(k).reduce(function(Pe,Te){return Pe.concat(Or(Te)===Vm?Fz(e,{placement:Te,boundary:c,rootBoundary:d,padding:u,flipVariations:h,allowedAutoPlacements:m}):Te)},[]),w=e.rects.reference,y=e.rects.popper,C=new Map,P=!0,R=A[0],M=0;M<A.length;M++){var D=A[M],$=Or(D),q=xa(D)===ka,J=[xi,qi].indexOf($)>=0,ve=J?"width":"height",ae=gu(e,{placement:D,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),me=J?q?Xi:Mi:q?qi:xi;w[ve]>y[ve]&&(me=gd(me));var se=gd(me),Ie=[];if(o&&Ie.push(ae[$]<=0),a&&Ie.push(ae[me]<=0,ae[se]<=0),Ie.every(function(Pe){return Pe})){R=D,P=!1;break}C.set(D,Ie)}if(P)for(var Be=h?3:1,xe=function(Te){var ue=A.find(function(Se){var Z=C.get(Se);if(Z)return Z.slice(0,Te).every(function(X){return X})});if(ue)return R=ue,"break"},de=Be;de>0;de--){var ge=xe(de);if(ge==="break")break}e.placement!==R&&(e.modifiersData[i]._skip=!0,e.placement=R,e.reset=!0)}}const Uz={name:"flip",enabled:!0,phase:"main",fn:Hz,requiresIfExists:["offset"],data:{_skip:!1}};function XS(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 GS(t){return[xi,Xi,qi,Mi].some(function(e){return t[e]>=0})}function Kz(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=gu(e,{elementContext:"reference"}),a=gu(e,{altBoundary:!0}),l=XS(s,i),u=XS(a,r,o),c=GS(l),d=GS(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const Wz={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kz};function qz(t,e,n){var i=Or(t),r=[Mi,xi].indexOf(i)>=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)*r,[Mi,Xi].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function Xz(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=r===void 0?[0,0]:r,s=RS.reduce(function(c,d){return c[d]=qz(d,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[i]=s}const Gz={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Xz};function Zz(t){var e=t.state,n=t.name;e.modifiersData[n]=qS({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const _z={name:"popperOffsets",enabled:!0,phase:"read",fn:Zz,data:{}};function Jz(t){return t==="x"?"y":"x"}function Yz(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,h=n.tetherOffset,m=h===void 0?0:h,v=gu(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),S=Or(e.placement),b=xa(e.placement),k=!b,A=Hm(S),w=Jz(A),y=e.modifiersData.popperOffsets,C=e.rects.reference,P=e.rects.popper,R=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,M=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(y){if(o){var q,J=A==="y"?xi:Mi,ve=A==="y"?qi:Xi,ae=A==="y"?"height":"width",me=y[A],se=me+v[J],Ie=me-v[ve],Be=p?-P[ae]/2:0,xe=b===ka?C[ae]:P[ae],de=b===ka?-P[ae]:-C[ae],ge=e.elements.arrow,Pe=p&&ge?jm(ge):{width:0,height:0},Te=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:zS(),ue=Te[J],Se=Te[ve],Z=hu(0,C[ae],Pe[ae]),X=k?C[ae]/2-Be-Z-ue-M.mainAxis:xe-Z-ue-M.mainAxis,U=k?-C[ae]/2+Be+Z+Se+M.mainAxis:de+Z+Se+M.mainAxis,Y=e.elements.arrow&&pu(e.elements.arrow),ke=Y?A==="y"?Y.clientTop||0:Y.clientLeft||0:0,Fe=(q=D==null?void 0:D[A])!=null?q:0,H=me+X-Fe-ke,he=me+U-Fe,De=hu(p?pd(se,H):se,me,p?Es(Ie,he):Ie);y[A]=De,$[A]=De-me}if(a){var nt,St=A==="x"?xi:Mi,lt=A==="x"?qi:Xi,At=y[w],Ut=w==="y"?"height":"width",cn=At+v[St],dn=At-v[lt],tn=[xi,Mi].indexOf(S)!==-1,zt=(nt=D==null?void 0:D[w])!=null?nt:0,Rt=tn?cn:At-C[Ut]-P[Ut]-zt+M.altAxis,kn=tn?At+C[Ut]+P[Ut]-zt-M.altAxis:dn,Yt=p&&tn?Sz(Rt,At,kn):hu(p?Rt:cn,At,p?kn:dn);y[w]=Yt,$[w]=Yt-At}e.modifiersData[i]=$}}const Qz={name:"preventOverflow",enabled:!0,phase:"main",fn:Yz,requiresIfExists:["offset"]};function eF(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function tF(t){return t===Bi(t)||!Gi(t)?Um(t):eF(t)}function nF(t){var e=t.getBoundingClientRect(),n=Oa(e.width)/t.offsetWidth||1,i=Oa(e.height)/t.offsetHeight||1;return n!==1||i!==1}function iF(t,e,n){n===void 0&&(n=!1);var i=Gi(e),r=Gi(e)&&nF(e),o=Ho(e),s=Ta(t,r,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((kr(e)!=="body"||Wm(o))&&(a=tF(e)),Gi(e)?(l=Ta(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Km(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function rF(t){var e=new Map,n=new Set,i=[];t.forEach(function(o){e.set(o.name,o)});function r(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&r(l)}}),i.push(o)}return t.forEach(function(o){n.has(o.name)||r(o)}),i}function oF(t){var e=rF(t);return vz.reduce(function(n,i){return n.concat(e.filter(function(r){return r.phase===i}))},[])}function sF(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function aF(t){var e=t.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var ZS={placement:"bottom",modifiers:[],strategy:"absolute"};function _S(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function lF(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,i=n===void 0?[]:n,r=e.defaultOptions,o=r===void 0?ZS:r;return function(a,l,u){u===void 0&&(u=o);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},ZS,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:c,setOptions:function(S){var b=typeof S=="function"?S(c.options):S;m(),c.options=Object.assign({},o,c.options,b),c.scrollParents={reference:Ms(a)?mu(a):a.contextElement?mu(a.contextElement):[],popper:mu(l)};var k=oF(aF([].concat(i,c.options.modifiers)));return c.orderedModifiers=k.filter(function(A){return A.enabled}),h(),p.update()},forceUpdate:function(){if(!f){var S=c.elements,b=S.reference,k=S.popper;if(_S(b,k)){c.rects={reference:iF(b,pu(k),c.options.strategy==="fixed"),popper:jm(k)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(M){return c.modifiersData[M.name]=Object.assign({},M.data)});for(var A=0;A<c.orderedModifiers.length;A++){if(c.reset===!0){c.reset=!1,A=-1;continue}var w=c.orderedModifiers[A],y=w.fn,C=w.options,P=C===void 0?{}:C,R=w.name;typeof y=="function"&&(c=y({state:c,options:P,name:R,instance:p})||c)}}}},update:sF(function(){return new Promise(function(v){p.forceUpdate(),v(c)})}),destroy:function(){m(),f=!0}};if(!_S(a,l))return p;p.setOptions(u).then(function(v){!f&&u.onFirstUpdate&&u.onFirstUpdate(v)});function h(){c.orderedModifiers.forEach(function(v){var S=v.name,b=v.options,k=b===void 0?{}:b,A=v.effect;if(typeof A=="function"){var w=A({state:c,name:S,instance:p,options:k}),y=function(){};d.push(w||y)}})}function m(){d.forEach(function(v){return v()}),d=[]}return p}}var uF=[Lz,_z,Pz,NS,Gz,Uz,Qz,Tz,Wz],cF=lF({defaultModifiers:uF}),dF="tippy-box",JS="tippy-content",fF="tippy-backdrop",YS="tippy-arrow",QS="tippy-svg-arrow",Ps={passive:!0,capture:!0},e6=function(){return document.body};function Xm(t,e,n){if(Array.isArray(t)){var i=t[e];return i??(Array.isArray(n)?n[e]:n)}return t}function Gm(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function t6(t,e){return typeof t=="function"?t.apply(void 0,e):t}function n6(t,e){if(e===0)return t;var n;return function(i){clearTimeout(n),n=setTimeout(function(){t(i)},e)}}function pF(t){return t.split(/\s+/).filter(Boolean)}function Ma(t){return[].concat(t)}function i6(t,e){t.indexOf(e)===-1&&t.push(e)}function hF(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function mF(t){return t.split("-")[0]}function vd(t){return[].slice.call(t)}function r6(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function vu(){return document.createElement("div")}function yd(t){return["Element","Fragment"].some(function(e){return Gm(t,e)})}function gF(t){return Gm(t,"NodeList")}function vF(t){return Gm(t,"MouseEvent")}function yF(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function bF(t){return yd(t)?[t]:gF(t)?vd(t):Array.isArray(t)?t:vd(document.querySelectorAll(t))}function Zm(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function o6(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function AF(t){var e,n=Ma(t),i=n[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function wF(t,e){var n=e.clientX,i=e.clientY;return t.every(function(r){var o=r.popperRect,s=r.popperState,a=r.props,l=a.interactiveBorder,u=mF(s.placement),c=s.modifiersData.offset;if(!c)return!0;var d=u==="bottom"?c.top.y:0,f=u==="top"?c.bottom.y:0,p=u==="right"?c.left.x:0,h=u==="left"?c.right.x:0,m=o.top-i+d>l,v=i-o.bottom-f>l,S=o.left-n+p>l,b=n-o.right-h>l;return m||v||S||b})}function _m(t,e,n){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){t[i](r,n)})}function s6(t,e){for(var n=e;n;){var i;if(t.contains(n))return!0;n=n.getRootNode==null||(i=n.getRootNode())==null?void 0:i.host}return!1}var Tr={isTouch:!1},a6=0;function SF(){Tr.isTouch||(Tr.isTouch=!0,window.performance&&document.addEventListener("mousemove",l6))}function l6(){var t=performance.now();t-a6<20&&(Tr.isTouch=!1,document.removeEventListener("mousemove",l6)),a6=t}function CF(){var t=document.activeElement;if(yF(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function kF(){document.addEventListener("touchstart",SF,Ps),window.addEventListener("blur",CF)}var OF=typeof window<"u"&&typeof document<"u",TF=OF?!!window.msCrypto:!1,xF={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},MF={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},fr=Object.assign({appendTo:e6,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},xF,MF),EF=Object.keys(fr),PF=function(e){var n=Object.keys(e);n.forEach(function(i){fr[i]=e[i]})};function u6(t){var e=t.plugins||[],n=e.reduce(function(i,r){var o=r.name,s=r.defaultValue;if(o){var a;i[o]=t[o]!==void 0?t[o]:(a=fr[o])!=null?a:s}return i},{});return Object.assign({},t,n)}function IF(t,e){var n=e?Object.keys(u6(Object.assign({},fr,{plugins:e}))):EF,i=n.reduce(function(r,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return r;if(o==="content")r[o]=s;else try{r[o]=JSON.parse(s)}catch{r[o]=s}return r},{});return i}function c6(t,e){var n=Object.assign({},e,{content:t6(e.content,[t])},e.ignoreAttributes?{}:IF(t,e.plugins));return n.aria=Object.assign({},fr.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}var LF=function(){return"innerHTML"};function Jm(t,e){t[LF()]=e}function d6(t){var e=vu();return t===!0?e.className=YS:(e.className=QS,yd(t)?e.appendChild(t):Jm(e,t)),e}function f6(t,e){yd(e.content)?(Jm(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Jm(t,e.content):t.textContent=e.content)}function Ym(t){var e=t.firstElementChild,n=vd(e.children);return{box:e,content:n.find(function(i){return i.classList.contains(JS)}),arrow:n.find(function(i){return i.classList.contains(YS)||i.classList.contains(QS)}),backdrop:n.find(function(i){return i.classList.contains(fF)})}}function p6(t){var e=vu(),n=vu();n.className=dF,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=vu();i.className=JS,i.setAttribute("data-state","hidden"),f6(i,t.props),e.appendChild(n),n.appendChild(i),r(t.props,t.props);function r(o,s){var a=Ym(e),l=a.box,u=a.content,c=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&f6(u,t.props),s.arrow?c?o.arrow!==s.arrow&&(l.removeChild(c),l.appendChild(d6(s.arrow))):l.appendChild(d6(s.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:r}}p6.$$tippy=!0;var DF=1,bd=[],Qm=[];function RF(t,e){var n=c6(t,Object.assign({},fr,u6(r6(e)))),i,r,o,s=!1,a=!1,l=!1,u=!1,c,d,f,p=[],h=n6(H,n.interactiveDebounce),m,v=DF++,S=null,b=hF(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},A={id:v,reference:t,popper:vu(),popperInstance:S,props:n,state:k,plugins:b,clearDelayTimeouts:Rt,setProps:kn,setContent:Yt,show:te,hide:Q,hideWithInteractivity:we,enable:tn,disable:zt,unmount:je,destroy:st};if(!n.render)return A;var w=n.render(A),y=w.popper,C=w.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+A.id,A.popper=y,t._tippy=A,y._tippy=A;var P=b.map(function(ie){return ie.fn(A)}),R=t.hasAttribute("aria-expanded");return Y(),Be(),me(),se("onCreate",[A]),n.showOnCreate&&cn(),y.addEventListener("mouseenter",function(){A.props.interactive&&A.state.isVisible&&A.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){A.props.interactive&&A.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",h)}),A;function M(){var ie=A.props.touch;return Array.isArray(ie)?ie:[ie,0]}function D(){return M()[0]==="hold"}function $(){var ie;return!!((ie=A.props.render)!=null&&ie.$$tippy)}function q(){return m||t}function J(){var ie=q().parentNode;return ie?AF(ie):document}function ve(){return Ym(y)}function ae(ie){return A.state.isMounted&&!A.state.isVisible||Tr.isTouch||c&&c.type==="focus"?0:Xm(A.props.delay,ie?0:1,fr.delay)}function me(ie){ie===void 0&&(ie=!1),y.style.pointerEvents=A.props.interactive&&!ie?"":"none",y.style.zIndex=""+A.props.zIndex}function se(ie,Ae,He){if(He===void 0&&(He=!0),P.forEach(function(rt){rt[ie]&&rt[ie].apply(rt,Ae)}),He){var ut;(ut=A.props)[ie].apply(ut,Ae)}}function Ie(){var ie=A.props.aria;if(ie.content){var Ae="aria-"+ie.content,He=y.id,ut=Ma(A.props.triggerTarget||t);ut.forEach(function(rt){var gt=rt.getAttribute(Ae);if(A.state.isVisible)rt.setAttribute(Ae,gt?gt+" "+He:He);else{var Ft=gt&&gt.replace(He,"").trim();Ft?rt.setAttribute(Ae,Ft):rt.removeAttribute(Ae)}})}}function Be(){if(!(R||!A.props.aria.expanded)){var ie=Ma(A.props.triggerTarget||t);ie.forEach(function(Ae){A.props.interactive?Ae.setAttribute("aria-expanded",A.state.isVisible&&Ae===q()?"true":"false"):Ae.removeAttribute("aria-expanded")})}}function xe(){J().removeEventListener("mousemove",h),bd=bd.filter(function(ie){return ie!==h})}function de(ie){if(!(Tr.isTouch&&(l||ie.type==="mousedown"))){var Ae=ie.composedPath&&ie.composedPath()[0]||ie.target;if(!(A.props.interactive&&s6(y,Ae))){if(Ma(A.props.triggerTarget||t).some(function(He){return s6(He,Ae)})){if(Tr.isTouch||A.state.isVisible&&A.props.trigger.indexOf("click")>=0)return}else se("onClickOutside",[A,ie]);A.props.hideOnClick===!0&&(A.clearDelayTimeouts(),A.hide(),a=!0,setTimeout(function(){a=!1}),A.state.isMounted||ue())}}}function ge(){l=!0}function Pe(){l=!1}function Te(){var ie=J();ie.addEventListener("mousedown",de,!0),ie.addEventListener("touchend",de,Ps),ie.addEventListener("touchstart",Pe,Ps),ie.addEventListener("touchmove",ge,Ps)}function ue(){var ie=J();ie.removeEventListener("mousedown",de,!0),ie.removeEventListener("touchend",de,Ps),ie.removeEventListener("touchstart",Pe,Ps),ie.removeEventListener("touchmove",ge,Ps)}function Se(ie,Ae){X(ie,function(){!A.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&Ae()})}function Z(ie,Ae){X(ie,Ae)}function X(ie,Ae){var He=ve().box;function ut(rt){rt.target===He&&(_m(He,"remove",ut),Ae())}if(ie===0)return Ae();_m(He,"remove",d),_m(He,"add",ut),d=ut}function U(ie,Ae,He){He===void 0&&(He=!1);var ut=Ma(A.props.triggerTarget||t);ut.forEach(function(rt){rt.addEventListener(ie,Ae,He),p.push({node:rt,eventType:ie,handler:Ae,options:He})})}function Y(){D()&&(U("touchstart",Fe,{passive:!0}),U("touchend",he,{passive:!0})),pF(A.props.trigger).forEach(function(ie){if(ie!=="manual")switch(U(ie,Fe),ie){case"mouseenter":U("mouseleave",he);break;case"focus":U(TF?"focusout":"blur",De);break;case"focusin":U("focusout",De);break}})}function ke(){p.forEach(function(ie){var Ae=ie.node,He=ie.eventType,ut=ie.handler,rt=ie.options;Ae.removeEventListener(He,ut,rt)}),p=[]}function Fe(ie){var Ae,He=!1;if(!(!A.state.isEnabled||nt(ie)||a)){var ut=((Ae=c)==null?void 0:Ae.type)==="focus";c=ie,m=ie.currentTarget,Be(),!A.state.isVisible&&vF(ie)&&bd.forEach(function(rt){return rt(ie)}),ie.type==="click"&&(A.props.trigger.indexOf("mouseenter")<0||s)&&A.props.hideOnClick!==!1&&A.state.isVisible?He=!0:cn(ie),ie.type==="click"&&(s=!He),He&&!ut&&dn(ie)}}function H(ie){var Ae=ie.target,He=q().contains(Ae)||y.contains(Ae);if(!(ie.type==="mousemove"&&He)){var ut=Ut().concat(y).map(function(rt){var gt,Ft=rt._tippy,on=(gt=Ft.popperInstance)==null?void 0:gt.state;return on?{popperRect:rt.getBoundingClientRect(),popperState:on,props:n}:null}).filter(Boolean);wF(ut,ie)&&(xe(),dn(ie))}}function he(ie){var Ae=nt(ie)||A.props.trigger.indexOf("click")>=0&&s;if(!Ae){if(A.props.interactive){A.hideWithInteractivity(ie);return}dn(ie)}}function De(ie){A.props.trigger.indexOf("focusin")<0&&ie.target!==q()||A.props.interactive&&ie.relatedTarget&&y.contains(ie.relatedTarget)||dn(ie)}function nt(ie){return Tr.isTouch?D()!==ie.type.indexOf("touch")>=0:!1}function St(){lt();var ie=A.props,Ae=ie.popperOptions,He=ie.placement,ut=ie.offset,rt=ie.getReferenceClientRect,gt=ie.moveTransition,Ft=$()?Ym(y).arrow:null,on=rt?{getBoundingClientRect:rt,contextElement:rt.contextElement||q()}:t,fn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(fe){var Ne=fe.state;if($()){var at=ve(),Qt=at.box;["placement","reference-hidden","escaped"].forEach(function(Jt){Jt==="placement"?Qt.setAttribute("data-placement",Ne.placement):Ne.attributes.popper["data-popper-"+Jt]?Qt.setAttribute("data-"+Jt,""):Qt.removeAttribute("data-"+Jt)}),Ne.attributes.popper={}}}},gn=[{name:"offset",options:{offset:ut}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!gt}},fn];$()&&Ft&&gn.push({name:"arrow",options:{element:Ft,padding:3}}),gn.push.apply(gn,(Ae==null?void 0:Ae.modifiers)||[]),A.popperInstance=cF(on,y,Object.assign({},Ae,{placement:He,onFirstUpdate:f,modifiers:gn}))}function lt(){A.popperInstance&&(A.popperInstance.destroy(),A.popperInstance=null)}function At(){var ie=A.props.appendTo,Ae,He=q();A.props.interactive&&ie===e6||ie==="parent"?Ae=He.parentNode:Ae=t6(ie,[He]),Ae.contains(y)||Ae.appendChild(y),A.state.isMounted=!0,St()}function Ut(){return vd(y.querySelectorAll("[data-tippy-root]"))}function cn(ie){A.clearDelayTimeouts(),ie&&se("onTrigger",[A,ie]),Te();var Ae=ae(!0),He=M(),ut=He[0],rt=He[1];Tr.isTouch&&ut==="hold"&&rt&&(Ae=rt),Ae?i=setTimeout(function(){A.show()},Ae):A.show()}function dn(ie){if(A.clearDelayTimeouts(),se("onUntrigger",[A,ie]),!A.state.isVisible){ue();return}if(!(A.props.trigger.indexOf("mouseenter")>=0&&A.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ie.type)>=0&&s)){var Ae=ae(!1);Ae?r=setTimeout(function(){A.state.isVisible&&A.hide()},Ae):o=requestAnimationFrame(function(){A.hide()})}}function tn(){A.state.isEnabled=!0}function zt(){A.hide(),A.state.isEnabled=!1}function Rt(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)}function kn(ie){if(!A.state.isDestroyed){se("onBeforeUpdate",[A,ie]),ke();var Ae=A.props,He=c6(t,Object.assign({},Ae,r6(ie),{ignoreAttributes:!0}));A.props=He,Y(),Ae.interactiveDebounce!==He.interactiveDebounce&&(xe(),h=n6(H,He.interactiveDebounce)),Ae.triggerTarget&&!He.triggerTarget?Ma(Ae.triggerTarget).forEach(function(ut){ut.removeAttribute("aria-expanded")}):He.triggerTarget&&t.removeAttribute("aria-expanded"),Be(),me(),C&&C(Ae,He),A.popperInstance&&(St(),Ut().forEach(function(ut){requestAnimationFrame(ut._tippy.popperInstance.forceUpdate)})),se("onAfterUpdate",[A,ie])}}function Yt(ie){A.setProps({content:ie})}function te(){var ie=A.state.isVisible,Ae=A.state.isDestroyed,He=!A.state.isEnabled,ut=Tr.isTouch&&!A.props.touch,rt=Xm(A.props.duration,0,fr.duration);if(!(ie||Ae||He||ut)&&!q().hasAttribute("disabled")&&(se("onShow",[A],!1),A.props.onShow(A)!==!1)){if(A.state.isVisible=!0,$()&&(y.style.visibility="visible"),me(),Te(),A.state.isMounted||(y.style.transition="none"),$()){var gt=ve(),Ft=gt.box,on=gt.content;Zm([Ft,on],0)}f=function(){var gn;if(!(!A.state.isVisible||u)){if(u=!0,y.offsetHeight,y.style.transition=A.props.moveTransition,$()&&A.props.animation){var F=ve(),fe=F.box,Ne=F.content;Zm([fe,Ne],rt),o6([fe,Ne],"visible")}Ie(),Be(),i6(Qm,A),(gn=A.popperInstance)==null||gn.forceUpdate(),se("onMount",[A]),A.props.animation&&$()&&Z(rt,function(){A.state.isShown=!0,se("onShown",[A])})}},At()}}function Q(){var ie=!A.state.isVisible,Ae=A.state.isDestroyed,He=!A.state.isEnabled,ut=Xm(A.props.duration,1,fr.duration);if(!(ie||Ae||He)&&(se("onHide",[A],!1),A.props.onHide(A)!==!1)){if(A.state.isVisible=!1,A.state.isShown=!1,u=!1,s=!1,$()&&(y.style.visibility="hidden"),xe(),ue(),me(!0),$()){var rt=ve(),gt=rt.box,Ft=rt.content;A.props.animation&&(Zm([gt,Ft],ut),o6([gt,Ft],"hidden"))}Ie(),Be(),A.props.animation?$()&&Se(ut,A.unmount):A.unmount()}}function we(ie){J().addEventListener("mousemove",h),i6(bd,h),h(ie)}function je(){A.state.isVisible&&A.hide(),A.state.isMounted&&(lt(),Ut().forEach(function(ie){ie._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),Qm=Qm.filter(function(ie){return ie!==A}),A.state.isMounted=!1,se("onHidden",[A]))}function st(){A.state.isDestroyed||(A.clearDelayTimeouts(),A.unmount(),ke(),delete t._tippy,A.state.isDestroyed=!0,se("onDestroy",[A]))}}function Is(t,e){e===void 0&&(e={});var n=fr.plugins.concat(e.plugins||[]);kF();var i=Object.assign({},e,{plugins:n}),r=bF(t),o=r.reduce(function(s,a){var l=a&&RF(a,i);return l&&s.push(l),s},[]);return yd(t)?o[0]:o}Is.defaultProps=fr,Is.setDefaultProps=PF,Is.currentInput=Tr,Object.assign({},NS,{effect:function(e){var n=e.state,i={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,i.popper),n.styles=i,n.elements.arrow&&Object.assign(n.elements.arrow.style,i.arrow)}}),Is.setDefaultProps({render:p6});class NF{getTextContent(e){return OS(e,{textSerializers:Em(this.editor.schema)})}constructor({editor:e,element:n,view:i,tippyOptions:r={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:l}=a,{$anchor:u,empty:c}=l,d=u.depth===1,f=u.parent.isTextblock&&!u.parent.type.spec.code&&!u.parent.textContent&&u.parent.childCount===0&&!this.getTextContent(u.parent);return!(!s.hasFocus()||!c||!d||!f||!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))||(s==null?void 0:s.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=i,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=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Is(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 i,r,o;const{state:s}=e,{doc:a,selection:l}=s,{from:u,to:c}=l;if(n&&n.doc.eq(a)&&n.selection.eq(l))return;if(this.createTooltip(),!((i=this.shouldShow)===null||i===void 0?void 0:i.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(r=this.tippy)===null||r===void 0||r.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>MS(e,u,c))}),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 h6=t=>new Wn({key:typeof t.pluginKey=="string"?new ei(t.pluginKey):t.pluginKey,view:e=>new NF({view:e,...t})}),BF=Ai.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[h6({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),$F=Ti.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]}`,$n(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=>qV({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Ad=200,Xn=function(){};Xn.prototype.append=function(e){return e.length?(e=Xn.from(e),!this.length&&e||e.length<Ad&&this.leafAppend(e)||this.length<Ad&&e.leafPrepend(this)||this.appendInner(e)):this},Xn.prototype.prepend=function(e){return e.length?Xn.from(e).append(this):this},Xn.prototype.appendInner=function(e){return new VF(this,e)},Xn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Xn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Xn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Xn.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)},Xn.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(o,s){return r.push(e(o,s))},n,i),r},Xn.from=function(e){return e instanceof Xn?e:e&&e.length?new m6(e):Xn.empty};var m6=function(t){function e(i){t.call(this),this.values=i}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(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,s,a){for(var l=o;l<s;l++)if(r(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,a){for(var l=o-1;l>=s;l--)if(r(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Ad)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Ad)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Xn);Xn.empty=new m6([]);var VF=function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.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(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,o,s){var a=this.left.length;if(r<a&&this.left.forEachInner(i,r,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(i,Math.max(r-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,o,s){var a=this.left.length;if(r>a&&this.right.forEachInvertedInner(i,r-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(i,Math.min(r,a),o,s)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(i,r):i>=o?this.right.slice(i-o,r-o):this.left.slice(i,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e}(Xn);const zF=500;class pr{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,o;n&&(r=this.remapping(i,this.items.length),o=r.maps.length);let s=e.tr,a,l,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){r||(r=this.remapping(i,f+1),o=r.maps.length),o--,c.push(d);return}if(r){c.push(new xr(d.map));let p=d.step.map(r.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],u.push(new xr(h,void 0,void 0,u.length+c.length))),o--,h&&r.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return a=r?d.selection.map(r.slice(o)):d.selection,l=new pr(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,i,r){let o=[],s=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d=e.steps[c].invert(e.docs[c]),f=new xr(e.mapping.maps[c],d,n),p;(p=l&&l.merge(f))&&(f=p,c?o.pop():a=a.slice(0,a.length-1)),o.push(f),n&&(s++,n=void 0),r||(l=f)}let u=s-i.depth;return u>jF&&(a=FF(a,u),s-=u),new pr(a.append(o),s)}remapping(e,n){let i=new Gl;return this.items.forEach((r,o)=>{let s=r.mirrorOffset!=null&&o-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,s)},e,n),i}addMaps(e){return this.eventCount==0?this:new pr(this.items.append(e.map(n=>new xr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},r);let l=n;this.items.forEach(f=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),v=f.selection&&f.selection.map(o.slice(l+1,p));v&&a++,i.push(new xr(h,m,v))}else i.push(new xr(h))},r);let u=[];for(let f=n;f<s;f++)u.push(new xr(o.maps[f]));let c=this.items.slice(0,r).append(u).append(i),d=new pr(c,a);return d.emptyItemCount()>zF&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.maps.length,r=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)r.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(i)),u=l&&l.getMap();if(i--,u&&n.appendMap(u,i),l){let c=s.selection&&s.selection.map(n.slice(i));c&&o++;let d=new xr(u.invert(),l,c),f,p=r.length-1;(f=r.length&&r[p].merge(d))?r[p]=f:r.push(d)}}else s.map&&i--},this.items.length,0),new pr(Xn.from(r.reverse()),o)}}pr.empty=new pr(Xn.empty,0);function FF(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}class xr{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new xr(n.getMap().invert(),n,this.selection)}}}class Uo{constructor(e,n,i,r,o){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=o}}const jF=20;function HF(t,e,n,i){let r=n.getMeta(Ls),o;if(r)return r.historyState;n.getMeta(WF)&&(t=new Uo(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Ls))return s.getMeta(Ls).redo?new Uo(t.done.addTransform(n,void 0,i,wd(e)),t.undone,g6(n.mapping.maps),t.prevTime,t.prevComposition):new Uo(t.done,t.undone.addTransform(n,void 0,i,wd(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-i.newGroupDelay||!UF(n,t.prevRanges)),u=s?eg(t.prevRanges,n.mapping):g6(n.mapping.maps);return new Uo(t.done.addTransform(n,l?e.selection.getBookmark():void 0,i,wd(e)),pr.empty,u,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Uo(t.done.rebased(n,o),t.undone.rebased(n,o),eg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Uo(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),eg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function UF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let o=0;o<e.length;o+=2)i<=e[o+1]&&r>=e[o]&&(n=!0)}),n}function g6(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,o,s)=>e.push(o,s));return e}function eg(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),o=e.map(t[i+1],-1);r<=o&&n.push(r,o)}return n}function KF(t,e,n){let i=wd(e),r=Ls.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,i);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),r,i),l=new Uo(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Ls,{redo:n,historyState:l})}let tg=!1,v6=null;function wd(t){let e=t.plugins;if(v6!=e){tg=!1,v6=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){tg=!0;break}}return tg}const Ls=new ei("history"),WF=new ei("closeHistory");function qF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Wn({key:Ls,state:{init(){return new Uo(pr.empty,pr.empty,null,0,-1)},apply(e,n,i){return HF(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?b6:i=="historyRedo"?A6:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function y6(t,e){return(n,i)=>{let r=Ls.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let o=KF(r,n,t);o&&i(e?o.scrollIntoView():o)}return!0}}const b6=y6(!1,!0),A6=y6(!0,!0),XF=Ai.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>b6(t,e),redo:()=>({state:t,dispatch:e})=>A6(t,e)}},addProseMirrorPlugins(){return[qF(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()}}}),GF=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ZF=Ti.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",$n(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[WV({find:GF,type:this.type,getAttributes:t=>{const[,,e,n,i]=t;return{src:n,alt:e,title:i}}})]}}),_F=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,JF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,YF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,QF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ej=Qr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",$n(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[uu({find:_F,type:this.type}),uu({find:YF,type:this.type})]},addPasteRules(){return[Ca({find:JF,type:this.type}),Ca({find:QF,type:this.type})]}}),tj="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",nj="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ea=(t,e)=>{for(const n in e)t[n]=e[n];return t},ng="numeric",ig="ascii",rg="alpha",yu="asciinumeric",bu="alphanumeric",og="domain",w6="emoji",ij="scheme",rj="slashscheme",sg="whitespace";function oj(t,e){return t in e||(e[t]=[]),e[t]}function Ds(t,e,n){e[ng]&&(e[yu]=!0,e[bu]=!0),e[ig]&&(e[yu]=!0,e[rg]=!0),e[yu]&&(e[bu]=!0),e[rg]&&(e[bu]=!0),e[bu]&&(e[og]=!0),e[w6]&&(e[og]=!0);for(const i in e){const r=oj(i,n);r.indexOf(t)<0&&r.push(t)}}function sj(t,e){const n={};for(const i in e)e[i].indexOf(t)>=0&&(n[i]=!0);return n}function Ei(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Ei.groups={},Ei.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let i=0;i<e.jr.length;i++){const r=e.jr[i][0],o=e.jr[i][1];if(o&&r.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,i){for(let r=0;r<t.length;r++)this.tt(t[r],e,n,i)},tr(t,e,n,i){i=i||Ei.groups;let r;return e&&e.j?r=e:(r=new Ei(e),n&&i&&Ds(e,n,i)),this.jr.push([t,r]),r},ts(t,e,n,i){let r=this;const o=t.length;if(!o)return r;for(let s=0;s<o-1;s++)r=r.tt(t[s]);return r.tt(t[o-1],e,n,i)},tt(t,e,n,i){i=i||Ei.groups;const r=this;if(e&&e.j)return r.j[t]=e,e;const o=e;let s,a=r.go(t);if(a?(s=new Ei,Ea(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Ei,o){if(i)if(s.t&&typeof s.t=="string"){const l=Ea(sj(s.t,i),n);Ds(o,l,i)}else n&&Ds(o,n,i);s.t=o}return r.j[t]=s,s}};const Tt=(t,e,n,i,r)=>t.ta(e,n,i,r),Pn=(t,e,n,i,r)=>t.tr(e,n,i,r),S6=(t,e,n,i,r)=>t.ts(e,n,i,r),Le=(t,e,n,i,r)=>t.tt(e,n,i,r),no="WORD",ag="UWORD",C6="ASCIINUMERICAL",k6="ALPHANUMERICAL",Au="LOCALHOST",lg="TLD",ug="UTLD",Sd="SCHEME",Pa="SLASH_SCHEME",cg="NUM",dg="WS",fg="NL",wu="OPENBRACE",Su="CLOSEBRACE",Cd="OPENBRACKET",kd="CLOSEBRACKET",Od="OPENPAREN",Td="CLOSEPAREN",xd="OPENANGLEBRACKET",Md="CLOSEANGLEBRACKET",Ed="FULLWIDTHLEFTPAREN",Pd="FULLWIDTHRIGHTPAREN",Id="LEFTCORNERBRACKET",Ld="RIGHTCORNERBRACKET",Dd="LEFTWHITECORNERBRACKET",Rd="RIGHTWHITECORNERBRACKET",Nd="FULLWIDTHLESSTHAN",Bd="FULLWIDTHGREATERTHAN",$d="AMPERSAND",pg="APOSTROPHE",Vd="ASTERISK",Ko="AT",zd="BACKSLASH",Fd="BACKTICK",jd="CARET",Wo="COLON",hg="COMMA",Hd="DOLLAR",Mr="DOT",Ud="EQUALS",mg="EXCLAMATION",Zi="HYPHEN",Cu="PERCENT",Kd="PIPE",Wd="PLUS",qd="POUND",ku="QUERY",gg="QUOTE",O6="FULLWIDTHMIDDLEDOT",vg="SEMI",Er="SLASH",Ou="TILDE",Xd="UNDERSCORE",T6="EMOJI",Gd="SYM";var x6=Object.freeze({__proto__:null,WORD:no,UWORD:ag,ASCIINUMERICAL:C6,ALPHANUMERICAL:k6,LOCALHOST:Au,TLD:lg,UTLD:ug,SCHEME:Sd,SLASH_SCHEME:Pa,NUM:cg,WS:dg,NL:fg,OPENBRACE:wu,CLOSEBRACE:Su,OPENBRACKET:Cd,CLOSEBRACKET:kd,OPENPAREN:Od,CLOSEPAREN:Td,OPENANGLEBRACKET:xd,CLOSEANGLEBRACKET:Md,FULLWIDTHLEFTPAREN:Ed,FULLWIDTHRIGHTPAREN:Pd,LEFTCORNERBRACKET:Id,RIGHTCORNERBRACKET:Ld,LEFTWHITECORNERBRACKET:Dd,RIGHTWHITECORNERBRACKET:Rd,FULLWIDTHLESSTHAN:Nd,FULLWIDTHGREATERTHAN:Bd,AMPERSAND:$d,APOSTROPHE:pg,ASTERISK:Vd,AT:Ko,BACKSLASH:zd,BACKTICK:Fd,CARET:jd,COLON:Wo,COMMA:hg,DOLLAR:Hd,DOT:Mr,EQUALS:Ud,EXCLAMATION:mg,HYPHEN:Zi,PERCENT:Cu,PIPE:Kd,PLUS:Wd,POUND:qd,QUERY:ku,QUOTE:gg,FULLWIDTHMIDDLEDOT:O6,SEMI:vg,SLASH:Er,TILDE:Ou,UNDERSCORE:Xd,EMOJI:T6,SYM:Gd});const io=/[a-z]/,Tu=new RegExp("\\p{L}","u"),yg=new RegExp("\\p{Emoji}","u"),ro=/\d/,bg=/\s/,M6="\r",Ag=`
296
+ `,aj="️",lj="‍",wg="";let Zd=null,_d=null;function uj(t=[]){const e={};Ei.groups=e;const n=new Ei;Zd==null&&(Zd=P6(tj)),_d==null&&(_d=P6(nj)),Le(n,"'",pg),Le(n,"{",wu),Le(n,"}",Su),Le(n,"[",Cd),Le(n,"]",kd),Le(n,"(",Od),Le(n,")",Td),Le(n,"<",xd),Le(n,">",Md),Le(n,"(",Ed),Le(n,")",Pd),Le(n,"「",Id),Le(n,"」",Ld),Le(n,"『",Dd),Le(n,"』",Rd),Le(n,"<",Nd),Le(n,">",Bd),Le(n,"&",$d),Le(n,"*",Vd),Le(n,"@",Ko),Le(n,"`",Fd),Le(n,"^",jd),Le(n,":",Wo),Le(n,",",hg),Le(n,"$",Hd),Le(n,".",Mr),Le(n,"=",Ud),Le(n,"!",mg),Le(n,"-",Zi),Le(n,"%",Cu),Le(n,"|",Kd),Le(n,"+",Wd),Le(n,"#",qd),Le(n,"?",ku),Le(n,'"',gg),Le(n,"/",Er),Le(n,";",vg),Le(n,"~",Ou),Le(n,"_",Xd),Le(n,"\\",zd),Le(n,"・",O6);const i=Pn(n,ro,cg,{[ng]:!0});Pn(i,ro,i);const r=Pn(i,io,C6,{[yu]:!0}),o=Pn(i,Tu,k6,{[bu]:!0}),s=Pn(n,io,no,{[ig]:!0});Pn(s,ro,r),Pn(s,io,s),Pn(r,ro,r),Pn(r,io,r);const a=Pn(n,Tu,ag,{[rg]:!0});Pn(a,io),Pn(a,ro,o),Pn(a,Tu,a),Pn(o,ro,o),Pn(o,io),Pn(o,Tu,o);const l=Le(n,Ag,fg,{[sg]:!0}),u=Le(n,M6,dg,{[sg]:!0}),c=Pn(n,bg,dg,{[sg]:!0});Le(n,wg,c),Le(u,Ag,l),Le(u,wg,c),Pn(u,bg,c),Le(c,M6),Le(c,Ag),Pn(c,bg,c),Le(c,wg,c);const d=Pn(n,yg,T6,{[w6]:!0});Le(d,"#"),Pn(d,yg,d),Le(d,aj,d);const f=Le(d,lj);Le(f,"#"),Pn(f,yg,d);const p=[[io,s],[ro,r]],h=[[io,null],[Tu,a],[ro,o]];for(let m=0;m<Zd.length;m++)qo(n,Zd[m],lg,no,p);for(let m=0;m<_d.length;m++)qo(n,_d[m],ug,ag,h);Ds(lg,{tld:!0,ascii:!0},e),Ds(ug,{utld:!0,alpha:!0},e),qo(n,"file",Sd,no,p),qo(n,"mailto",Sd,no,p),qo(n,"http",Pa,no,p),qo(n,"https",Pa,no,p),qo(n,"ftp",Pa,no,p),qo(n,"ftps",Pa,no,p),Ds(Sd,{scheme:!0,ascii:!0},e),Ds(Pa,{slashscheme:!0,ascii:!0},e),t=t.sort((m,v)=>m[0]>v[0]?1:-1);for(let m=0;m<t.length;m++){const v=t[m][0],b=t[m][1]?{[ij]:!0}:{[rj]:!0};v.indexOf("-")>=0?b[og]=!0:io.test(v)?ro.test(v)?b[yu]=!0:b[ig]=!0:b[ng]=!0,S6(n,v,v,b)}return S6(n,"localhost",Au,{ascii:!0}),n.jd=new Ei(Gd),{start:n,tokens:Ea({groups:e},x6)}}function E6(t,e){const n=cj(e.replace(/[A-Z]/g,a=>a.toLowerCase())),i=n.length,r=[];let o=0,s=0;for(;s<i;){let a=t,l=null,u=0,c=null,d=-1,f=-1;for(;s<i&&(l=a.go(n[s]));)a=l,a.accepts()?(d=0,f=0,c=a):d>=0&&(d+=n[s].length,f++),u+=n[s].length,o+=n[s].length,s++;o-=d,s-=f,u-=d,r.push({t:c.t,v:e.slice(o-u,o),s:o-u,e:o})}return r}function cj(t){const e=[],n=t.length;let i=0;for(;i<n;){let r=t.charCodeAt(i),o,s=r<55296||r>56319||i+1===n||(o=t.charCodeAt(i+1))<56320||o>57343?t[i]:t.slice(i,i+2);e.push(s),i+=s.length}return e}function qo(t,e,n,i,r){let o;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?o=t.j[l]:(o=new Ei(i),o.jr=r.slice(),t.j[l]=o),t=o}return o=new Ei(n),o.jr=r.slice(),t.j[e[s-1]]=o,o}function P6(t){const e=[],n=[];let i=0,r="0123456789";for(;i<t.length;){let o=0;for(;r.indexOf(t[i+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(i,i+o),10);s>0;s--)n.pop();i+=o}else n.push(t[i]),i++}return e}const xu={defaultProtocol:"http",events:null,format:I6,formatHref:I6,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Sg(t,e=null){let n=Ea({},xu);t&&(n=Ea(n,t instanceof Sg?t.o:t));const i=n.ignoreTags,r=[];for(let o=0;o<i.length;o++)r.push(i[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=r}Sg.prototype={o:xu,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const i=e!=null;let r=this.o[t];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:xu[t],typeof r=="function"&&i&&(r=r(e,n))):typeof r=="function"&&i&&(r=r(e,n.t,n)),r)},getObj(t,e,n){let i=this.o[t];return typeof i=="function"&&e!=null&&(i=i(e,n.t,n)),i},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function I6(t){return t}function L6(t,e){this.t="token",this.v=t,this.tk=e}L6.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),i=t.get("format",e,this);return n&&i.length>n?i.substring(0,n)+"…":i},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=xu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),i=t.get("formatHref",n,this),r=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),c=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=i,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),c&&Ea(s,c),{tagName:r,attributes:s,content:o,eventListeners:d}}};function Jd(t,e){class n extends L6{constructor(r,o){super(r,o),this.t=t}}for(const i in e)n.prototype[i]=e[i];return n.t=t,n}const D6=Jd("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),R6=Jd("text"),dj=Jd("nl"),Yd=Jd("url",{isLink:!0,toHref(t=xu.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Au&&t[1].t===Wo}}),_i=t=>new Ei(t);function fj({groups:t}){const e=t.domain.concat([$d,Vd,Ko,zd,Fd,jd,Hd,Ud,Zi,cg,Cu,Kd,Wd,qd,Er,Gd,Ou,Xd]),n=[Wo,hg,Mr,mg,Cu,ku,gg,vg,xd,Md,wu,Su,kd,Cd,Od,Td,Ed,Pd,Id,Ld,Dd,Rd,Nd,Bd],i=[$d,pg,Vd,zd,Fd,jd,Hd,Ud,Zi,wu,Su,Cu,Kd,Wd,qd,ku,Er,Gd,Ou,Xd],r=_i(),o=Le(r,Ou);Tt(o,i,o),Tt(o,t.domain,o);const s=_i(),a=_i(),l=_i();Tt(r,t.domain,s),Tt(r,t.scheme,a),Tt(r,t.slashscheme,l),Tt(s,i,o),Tt(s,t.domain,s);const u=Le(s,Ko);Le(o,Ko,u),Le(a,Ko,u),Le(l,Ko,u);const c=Le(o,Mr);Tt(c,i,o),Tt(c,t.domain,o);const d=_i();Tt(u,t.domain,d),Tt(d,t.domain,d);const f=Le(d,Mr);Tt(f,t.domain,d);const p=_i(D6);Tt(f,t.tld,p),Tt(f,t.utld,p),Le(u,Au,p);const h=Le(d,Zi);Le(h,Zi,h),Tt(h,t.domain,d),Tt(p,t.domain,d),Le(p,Mr,f),Le(p,Zi,h);const m=Le(p,Wo);Tt(m,t.numeric,D6);const v=Le(s,Zi),S=Le(s,Mr);Le(v,Zi,v),Tt(v,t.domain,s),Tt(S,i,o),Tt(S,t.domain,s);const b=_i(Yd);Tt(S,t.tld,b),Tt(S,t.utld,b),Tt(b,t.domain,s),Tt(b,i,o),Le(b,Mr,S),Le(b,Zi,v),Le(b,Ko,u);const k=Le(b,Wo),A=_i(Yd);Tt(k,t.numeric,A);const w=_i(Yd),y=_i();Tt(w,e,w),Tt(w,n,y),Tt(y,e,w),Tt(y,n,y),Le(b,Er,w),Le(A,Er,w);const C=Le(a,Wo),P=Le(l,Wo),R=Le(P,Er),M=Le(R,Er);Tt(a,t.domain,s),Le(a,Mr,S),Le(a,Zi,v),Tt(l,t.domain,s),Le(l,Mr,S),Le(l,Zi,v),Tt(C,t.domain,w),Le(C,Er,w),Le(C,ku,w),Tt(M,t.domain,w),Tt(M,e,w),Le(M,Er,w);const D=[[wu,Su],[Cd,kd],[Od,Td],[xd,Md],[Ed,Pd],[Id,Ld],[Dd,Rd],[Nd,Bd]];for(let $=0;$<D.length;$++){const[q,J]=D[$],ve=Le(w,q);Le(y,q,ve),Le(ve,J,w);const ae=_i(Yd);Tt(ve,e,ae);const me=_i();Tt(ve,n),Tt(ae,e,ae),Tt(ae,n,me),Tt(me,e,ae),Tt(me,n,me),Le(ae,J,w),Le(me,J,w)}return Le(r,Au,b),Le(r,fg,dj),{start:r,tokens:x6}}function pj(t,e,n){let i=n.length,r=0,o=[],s=[];for(;r<i;){let a=t,l=null,u=null,c=0,d=null,f=-1;for(;r<i&&!(l=a.go(n[r].t));)s.push(n[r++]);for(;r<i&&(u=l||a.go(n[r].t));)l=null,a=u,a.accepts()?(f=0,d=a):f>=0&&f++,r++,c++;if(f<0)r-=c,r<i&&(s.push(n[r]),r++);else{s.length>0&&(o.push(Cg(R6,e,s)),s=[]),r-=f,c-=f;const p=d.t,h=n.slice(r-c,r);o.push(Cg(p,e,h))}}return s.length>0&&o.push(Cg(R6,e,s)),o}function Cg(t,e,n){const i=n[0].s,r=n[n.length-1].e,o=e.slice(i,r);return new t(o,n)}const hj=typeof console<"u"&&console&&console.warn||(()=>{}),mj="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",An={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function gj(){return Ei.groups={},An.scanner=null,An.parser=null,An.tokenQueue=[],An.pluginQueue=[],An.customSchemes=[],An.initialized=!1,An}function N6(t,e=!1){if(An.initialized&&hj(`linkifyjs: already initialized - will not register custom scheme "${t}" ${mj}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
322
297
  1. Must only contain digits, lowercase ASCII letters or "-"
323
298
  2. Cannot start or end with "-"
324
- 3. "-" cannot repeat`);An.customSchemes.push([t,e])}function kK(){An.scanner=gK(An.customSchemes);for(let t=0;t<An.tokenQueue.length;t++)An.tokenQueue[t][1]({scanner:An.scanner});An.parser=bK(An.scanner.tokens);for(let t=0;t<An.pluginQueue.length;t++)An.pluginQueue[t][1]({scanner:An.scanner,parser:An.parser});return An.initialized=!0,An}function Gg(t){return An.initialized||kK(),AK(An.parser.start,t,U3(An.scanner.start,t))}Gg.scan=U3;function _3(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const i=new qg(n),r=Gg(t),o=[];for(let s=0;s<r.length;s++){const a=r[s];a.isLink&&(!e||a.t===e)&&i.check(a)&&o.push(a.toFormattedObject(i))}return o}function OK(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function TK(t){return new qn({key:new ni("autolink"),appendTransaction:(e,n,i)=>{const r=e.some(u=>u.docChanged)&&!n.doc.eq(i.doc),o=e.some(u=>u.getMeta("preventAutolink"));if(!r||o)return;const{tr:s}=i,a=wj(n.doc,[...e]);if(Mj(a).forEach(({newRange:u})=>{const c=Cj(i.doc,u,p=>p.isTextblock);let d,f;if(c.length>1?(d=c[0],f=i.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):c.length&&i.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(d=c[0],f=i.doc.textBetween(d.pos,u.to,void 0," ")),d&&f){const p=f.split(" ").filter(S=>S!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;const v=Gg(h).map(S=>S.toObject(t.defaultProtocol));if(!OK(v))return!1;v.filter(S=>S.isLink).map(S=>({...S,from:m+S.start+1,to:m+S.end+1})).filter(S=>i.schema.marks.code?!i.doc.rangeHasMark(S.from,S.to,i.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{rg(S.from,S.to,i.doc).some(b=>b.mark.type===t.type)||s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function xK(t){return new qn({key:new ni("handleClickLink"),props:{handleClick:(e,n,i)=>{var r,o;if(i.button!==0||!e.editable)return!1;let s=i.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(f=>f.nodeName==="A"))return!1;const l=F6(e.state,t.type.name),u=i.target,c=(r=u==null?void 0:u.href)!==null&&r!==void 0?r:l.href,d=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&c?(window.open(c,d),!0):!1}}})}function MK(t){return new qn({key:new ni("handlePasteLink"),props:{handlePaste:(e,n,i)=>{const{state:r}=e,{selection:o}=r,{empty:s}=o;if(s)return!1;let a="";i.content.forEach(u=>{a+=u.textContent});const l=_3(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}const EK=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Bs(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(i=>{const r=typeof i=="string"?i:i.scheme;r&&n.push(r)}),!t||t.replace(EK,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const PK=to.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Z3(t);return}Z3(t.scheme,t.optionalSlashes)})},onDestroy(){CK()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Bs(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Bs(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Bs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$n(this.options.HTMLAttributes,t),0]:["a",$n(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:i=>!!Bs(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:i=>!!Bs(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Ma({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:i}=this.options,r=_3(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!Bs(s,n),protocols:n,defaultProtocol:i}));r.length&&r.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(TK({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:r=>!!Bs(r,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(xK({type:this.type})),this.options.linkOnPaste&&t.push(MK({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),IK=xi.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",$n(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)}}});function LK(t){var e;const{char:n,allowSpaces:i,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:s,$position:a}=t,l=i&&!r,u=tH(n),c=new RegExp(`\\s${u}$`),d=s?"^":"",f=r?"":u,p=l?new RegExp(`${d}${u}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${d}(?:^)?${u}[^\\s${f}]*`,"gm"),h=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!h)return null;const m=a.pos-h.length,v=Array.from(h.matchAll(p)).pop();if(!v||v.input===void 0||v.index===void 0)return null;const S=v.input.slice(Math.max(0,v.index-1),v.index),b=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(S);if(o!==null&&!b)return null;const k=m+v.index;let A=k+v[0].length;return l&&c.test(h.slice(A-1,A+1))&&(v[0]+=" ",A+=1),k<a.pos&&A>=a.pos?{range:{from:k,to:A},query:v[0].slice(n.length),text:v[0]}:null}const DK=new ni("suggestion");function RK({pluginKey:t=DK,editor:e,char:n="@",allowSpaces:i=!1,allowToIncludeChar:r=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",command:u=()=>null,items:c=()=>[],render:d=()=>({}),allow:f=()=>!0,findSuggestionMatch:p=LK}){let h;const m=d==null?void 0:d(),v=new qn({key:t,view(){return{update:async(S,b)=>{var k,A,w,y,C,P,R;const M=(k=this.key)===null||k===void 0?void 0:k.getState(b),D=(A=this.key)===null||A===void 0?void 0:A.getState(S.state),$=M.active&&D.active&&M.range.from!==D.range.from,q=!M.active&&D.active,J=M.active&&!D.active,ve=!q&&!J&&M.query!==D.query,ae=q||$&&ve,me=ve||$,se=J||$&&ve;if(!ae&&!me&&!se)return;const Ie=se&&!ae?M:D,Be=S.dom.querySelector(`[data-decoration-id="${Ie.decorationId}"]`);h={editor:e,range:Ie.range,query:Ie.query,text:Ie.text,items:[],command:xe=>u({editor:e,range:Ie.range,props:xe}),decorationNode:Be,clientRect:Be?()=>{var xe;const{decorationId:de}=(xe=this.key)===null||xe===void 0?void 0:xe.getState(e.state),ge=S.dom.querySelector(`[data-decoration-id="${de}"]`);return(ge==null?void 0:ge.getBoundingClientRect())||null}:null},ae&&((w=m==null?void 0:m.onBeforeStart)===null||w===void 0||w.call(m,h)),me&&((y=m==null?void 0:m.onBeforeUpdate)===null||y===void 0||y.call(m,h)),(me||ae)&&(h.items=await c({editor:e,query:Ie.query})),se&&((C=m==null?void 0:m.onExit)===null||C===void 0||C.call(m,h)),me&&((P=m==null?void 0:m.onUpdate)===null||P===void 0||P.call(m,h)),ae&&((R=m==null?void 0:m.onStart)===null||R===void 0||R.call(m,h))},destroy:()=>{var S;h&&((S=m==null?void 0:m.onExit)===null||S===void 0||S.call(m,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,b,k,A){const{isEditable:w}=e,{composing:y}=e.view,{selection:C}=S,{empty:P,from:R}=C,M={...b};if(M.composing=y,w&&(P||e.view.composing)){(R<b.range.from||R>b.range.to)&&!y&&!b.composing&&(M.active=!1);const D=p({char:n,allowSpaces:i,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:s,$position:C.$from}),$=`id_${Math.floor(Math.random()*4294967295)}`;D&&f({editor:e,state:A,range:D.range,isActive:b.active})?(M.active=!0,M.decorationId=b.decorationId?b.decorationId:$,M.range=D.range,M.query=D.query,M.text=D.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(S,b){var k;const{active:A,range:w}=v.getState(S.state);return A&&((k=m==null?void 0:m.onKeyDown)===null||k===void 0?void 0:k.call(m,{view:S,event:b,range:w}))||!1},decorations(S){const{active:b,range:k,decorationId:A}=v.getState(S);return b?Bn.create(S.doc,[Ni.inline(k.from,k.to,{nodeName:a,class:l,"data-decoration-id":A})]):null}}});return v}const NK=new ni("mention"),BK=xi.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",$n(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:NK,command:({editor:t,range:e,props:n})=>{var i,r,o;const s=t.view.state.selection.$to.nodeAfter;((i=s==null?void 0:s.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(o=(r=t.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||o===void 0||o.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",$n({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=$n({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t});return typeof i=="string"?["span",$n({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:i}=e,{empty:r,anchor:o}=i;return r?(e.doc.nodesBetween(o-1,o,(s,a)=>{if(s.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",a,a+s.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[RK({editor:this.editor,...this.options.suggestion})]}}),$K="listItem",J3="textStyle",Y3=/^(\d+)\.\s$/,VK=xi.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",$n(this.options.HTMLAttributes,n),0]:["ol",$n(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($K,this.editor.getAttributes(J3)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Od({find:Y3,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=Od({find:Y3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(J3)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),zK=xi.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",$n(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),FK=Ai.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new qn({key:new ni("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,r=[];if(!n)return null;const o=this.editor.isEmpty;return t.descendants((s,a)=>{const l=i>=a&&i<=a+s.nodeSize,u=!s.isLeaf&&kd(s);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];o&&c.push(this.options.emptyEditorClass);const d=Ni.node(a,a+s.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});r.push(d)}return this.options.includeChildren}),Bn.create(t,r)}}})]}}),jK=xi.create({name:"text",group:"inline"}),HK=to.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",$n(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()}}});class UK{constructor({editor:e,element:n,view:i,tippyOptions:r={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:u,to:c})=>{const{doc:d,selection:f}=l,{empty:p}=f,h=!d.textBetween(u,c).length&&tg(l.selection),m=this.element.contains(document.activeElement);return!(!(a.hasFocus()||m)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const u=!(l!=null&&l.selection.eq(a.state.selection)),c=!(l!=null&&l.doc.eq(a.state.doc));!u&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,u,c,l)},this.updateDelay))},this.updateHandler=(a,l,u,c)=>{var d,f,p;const{state:h,composing:m}=a,{selection:v}=h;if(m||!l&&!u)return;this.createTooltip();const{ranges:b}=v,k=Math.min(...b.map(y=>y.$from.pos)),A=Math.max(...b.map(y=>y.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,element:this.element,view:a,state:h,oldState:c,from:k,to:A}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(Pj(h.selection)){let y=a.nodeDOM(k);if(y){const C=y.dataset.nodeViewWrapper?y:y.querySelector("[data-node-view-wrapper]");if(C&&(y=C.firstChild),y)return y.getBoundingClientRect()}}return H6(a,k,A)})}),this.show()},this.editor=e,this.element=n,this.view=i,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=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Ds(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:i}=e,r=i.selection.from!==i.selection.to;if(this.updateDelay>0&&r){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 Q3=t=>new qn({key:typeof t.pluginKey=="string"?new ni(t.pluginKey):t.pluginKey,view:e=>new UK({view:e,...t})});Ai.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Q3({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}}),ye({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=re(null);return bt(()=>{const{updateDelay:i,editor:r,pluginKey:o,shouldShow:s,tippyOptions:a}=t;r.registerPlugin(Q3({updateDelay:i,editor:r,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),Vi(()=>{const{pluginKey:i,editor:r}=t;r.unregisterPlugin(i)}),()=>{var i;return er("div",{ref:n},(i=e.default)===null||i===void 0?void 0:i.call(e))}}});function eC(t){return xv((e,n)=>({get(){return e(),t},set(i){t=i,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class KK extends Jj{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=eC(this.view.state),this.reactiveExtensionStorage=eC(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),kf(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){const i=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=i),i}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const WK=ye({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=re(),n=$r();return Fa(()=>{const i=t.editor;i&&i.options.element&&e.value&&Pt(()=>{if(!e.value||!i.options.element.firstChild)return;const r=x(e.value);e.value.append(...i.options.element.childNodes),i.contentComponent=n.ctx._,n&&(i.appContext={...n.appContext,provides:n.provides}),i.setOptions({element:r}),i.createNodeViews()})}),Vi(()=>{const i=t.editor;i&&(i.contentComponent=null,i.appContext=null)}),{rootEl:e}},render(){return er("div",{ref:t=>{this.rootEl=t}})}}),Zg=ye({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=re(null);return bt(()=>{const{pluginKey:i,editor:r,tippyOptions:o,shouldShow:s}=t;r.registerPlugin(M3({pluginKey:i,editor:r,element:n.value,tippyOptions:o,shouldShow:s}))}),Vi(()=>{const{pluginKey:i,editor:r}=t;r.unregisterPlugin(i)}),()=>{var i;return er("div",{ref:n},(i=e.default)===null||i===void 0?void 0:i.call(e))}}});ye({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return er(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const tC=ye({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return er(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))}}),qK=(t={})=>{const e=oe();return bt(()=>{e.value=new KK(t)}),Vi(()=>{var n,i,r;const o=(n=e.value)===null||n===void 0?void 0:n.options.element,s=o==null?void 0:o.cloneNode(!0);(i=o==null?void 0:o.parentNode)===null||i===void 0||i.replaceChild(s,o),(r=e.value)===null||r===void 0||r.destroy()}),e};class nC{constructor(e,{props:n={},editor:i}){this.editor=i,this.component=kf(e),this.el=document.createElement("div"),this.props=sn(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,n,i,r;return!((n=(e=this.renderedComponent.vNode)===null||e===void 0?void 0:e.component)===null||n===void 0)&&n.exposed?this.renderedComponent.vNode.component.exposed:(r=(i=this.renderedComponent.vNode)===null||i===void 0?void 0:i.component)===null||r===void 0?void 0:r.proxy}renderComponent(){let e=er(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&Of(e,this.el),{vNode:e,destroy:()=>{this.el&&Of(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([n,i])=>{this.props[n]=i}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const iC={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class XK extends eH{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(r={})=>this.updateAttributes(r),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=re(this.getDecorationClasses());const i=ye({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:r=>{var o,s;return Ks("onDragStart",n),Ks("decorationClasses",this.decorationClasses),(s=(o=this.component).setup)===null||s===void 0?void 0:s.call(o,r,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new nC(i,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,i=this.getPos();if(typeof i=="number")if(e<=i&&n>=i+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,i){const r=o=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(o)};if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=i,this.options.update({oldNode:o,oldDecorations:s,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:i,updateProps:()=>r({node:e,decorations:n,innerDecorations:i})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===n&&this.innerDecorations===i||(this.node=e,this.decorations=n,this.innerDecorations=i,r({node:e,decorations:n,innerDecorations:i})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function rC(t,e){return n=>{if(!n.editor.contentComponent)return{};const i=typeof t=="function"&&"__vccOpts"in t?t.__vccOpts:t;return new XK(i,n,e)}}const GK=ye({__name:"CodeSnippetAdapter",props:iC,setup(t){const e=t,n=re(e.node.attrs.code);return Re(n,()=>{e.updateAttributes({code:n.value})}),(i,r)=>(g(),L(x(tC),null,{default:z(()=>[I(tw,{code:n.value,"onUpdate:code":r[0]||(r[0]=o=>n.value=o),readonly:!e.editor.isEditable,placeholder:"Masukan Code"},null,8,["code","readonly"])]),_:1}))}}),ZK=xi.create({name:"codeSnippet",group:"block",atom:!0,addAttributes(){return{code:{default:""}}},parseHTML(){return[{tag:"codeSnippet"}]},renderHTML({HTMLAttributes:t}){return["codeSnippet",$n(t)]},addNodeView(){return rC(GK)},addCommands(){return{insertCodeSnippet:()=>({commands:t})=>t.insertContent({type:"codeSnippet",attrs:{code:""}}),deleteCodeSnippet:()=>({commands:t})=>t.deleteSelection()}}}),_K={class:"flex flex-col gap-1 border-primary-400 border-[2px] rounded-md relative my-4"},JK={class:"!font-semibold !text-sm absolute -top-[10px] ml-2 bg-white border-primary-400 border-[2px] px-4 rounded-md"},YK={key:0,class:"absolute top-[45%] px-4 text-gray-400"},QK=["contenteditable"],eW=ye({__name:"MentionSection",props:iC,setup(t){const e=t;bt(()=>{r.value=e.editor.isEditable});const n=re(e.node.attrs.title),i=re(e.node.attrs.bodyText),r=oe(!0);return Re(n,()=>{e.updateAttributes({title:n.value})}),Re(i,()=>{e.updateAttributes({bodyText:i.value})}),(o,s)=>(g(),L(x(tC),null,{default:z(()=>[E("div",_K,[E("p",JK,[s[3]||(s[3]=E("span",{class:"text-xs"},"#",-1)),ht(_(n.value),1)]),r.value?(g(),T("span",YK," Tuliskan sebuah pesan ")):N("",!0),E("span",{class:pe(["p-4 pt-6 caret-primary-500 focus:caret-primary-500 relative "]),contenteditable:e.editor.isEditable,onBlur:s[0]||(s[0]=a=>{const l=a.target.innerText;i.value=l,r.value=l===""||l===`
299
+ 3. "-" cannot repeat`);An.customSchemes.push([t,e])}function vj(){An.scanner=uj(An.customSchemes);for(let t=0;t<An.tokenQueue.length;t++)An.tokenQueue[t][1]({scanner:An.scanner});An.parser=fj(An.scanner.tokens);for(let t=0;t<An.pluginQueue.length;t++)An.pluginQueue[t][1]({scanner:An.scanner,parser:An.parser});return An.initialized=!0,An}function kg(t){return An.initialized||vj(),pj(An.parser.start,t,E6(An.scanner.start,t))}kg.scan=E6;function B6(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const i=new Sg(n),r=kg(t),o=[];for(let s=0;s<r.length;s++){const a=r[s];a.isLink&&(!e||a.t===e)&&i.check(a)&&o.push(a.toFormattedObject(i))}return o}function yj(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function bj(t){return new Wn({key:new ei("autolink"),appendTransaction:(e,n,i)=>{const r=e.some(u=>u.docChanged)&&!n.doc.eq(i.doc),o=e.some(u=>u.getMeta("preventAutolink"));if(!r||o)return;const{tr:s}=i,a=hV(n.doc,[...e]);if(wV(a).forEach(({newRange:u})=>{const c=gV(i.doc,u,p=>p.isTextblock);let d,f;if(c.length>1?(d=c[0],f=i.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):c.length&&i.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(d=c[0],f=i.doc.textBetween(d.pos,u.to,void 0," ")),d&&f){const p=f.split(" ").filter(S=>S!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;const v=kg(h).map(S=>S.toObject(t.defaultProtocol));if(!yj(v))return!1;v.filter(S=>S.isLink).map(S=>({...S,from:m+S.start+1,to:m+S.end+1})).filter(S=>i.schema.marks.code?!i.doc.rangeHasMark(S.from,S.to,i.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{Rm(S.from,S.to,i.doc).some(b=>b.mark.type===t.type)||s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function Aj(t){return new Wn({key:new ei("handleClickLink"),props:{handleClick:(e,n,i)=>{var r,o;if(i.button!==0||!e.editable)return!1;let s=i.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(f=>f.nodeName==="A"))return!1;const l=TS(e.state,t.type.name),u=i.target,c=(r=u==null?void 0:u.href)!==null&&r!==void 0?r:l.href,d=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&c?(window.open(c,d),!0):!1}}})}function wj(t){return new Wn({key:new ei("handlePasteLink"),props:{handlePaste:(e,n,i)=>{const{state:r}=e,{selection:o}=r,{empty:s}=o;if(s)return!1;let a="";i.content.forEach(u=>{a+=u.textContent});const l=B6(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}const Sj=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Rs(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(i=>{const r=typeof i=="string"?i:i.scheme;r&&n.push(r)}),!t||t.replace(Sj,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Cj=Qr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){N6(t);return}N6(t.scheme,t.optionalSlashes)})},onDestroy(){gj()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Rs(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Rs(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Rs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$n(this.options.HTMLAttributes,t),0]:["a",$n(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:i=>!!Rs(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:i=>!!Rs(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Ca({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:i}=this.options,r=B6(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!Rs(s,n),protocols:n,defaultProtocol:i}));r.length&&r.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(bj({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:r=>!!Rs(r,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(Aj({type:this.type})),this.options.linkOnPaste&&t.push(wj({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),kj=Ti.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",$n(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)}}});function Oj(t){var e;const{char:n,allowSpaces:i,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:s,$position:a}=t,l=i&&!r,u=GV(n),c=new RegExp(`\\s${u}$`),d=s?"^":"",f=r?"":u,p=l?new RegExp(`${d}${u}.*?(?=\\s${f}|$)`,"gm"):new RegExp(`${d}(?:^)?${u}[^\\s${f}]*`,"gm"),h=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!h)return null;const m=a.pos-h.length,v=Array.from(h.matchAll(p)).pop();if(!v||v.input===void 0||v.index===void 0)return null;const S=v.input.slice(Math.max(0,v.index-1),v.index),b=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(S);if(o!==null&&!b)return null;const k=m+v.index;let A=k+v[0].length;return l&&c.test(h.slice(A-1,A+1))&&(v[0]+=" ",A+=1),k<a.pos&&A>=a.pos?{range:{from:k,to:A},query:v[0].slice(n.length),text:v[0]}:null}const Tj=new ei("suggestion");function xj({pluginKey:t=Tj,editor:e,char:n="@",allowSpaces:i=!1,allowToIncludeChar:r=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",command:u=()=>null,items:c=()=>[],render:d=()=>({}),allow:f=()=>!0,findSuggestionMatch:p=Oj}){let h;const m=d==null?void 0:d(),v=new Wn({key:t,view(){return{update:async(S,b)=>{var k,A,w,y,C,P,R;const M=(k=this.key)===null||k===void 0?void 0:k.getState(b),D=(A=this.key)===null||A===void 0?void 0:A.getState(S.state),$=M.active&&D.active&&M.range.from!==D.range.from,q=!M.active&&D.active,J=M.active&&!D.active,ve=!q&&!J&&M.query!==D.query,ae=q||$&&ve,me=ve||$,se=J||$&&ve;if(!ae&&!me&&!se)return;const Ie=se&&!ae?M:D,Be=S.dom.querySelector(`[data-decoration-id="${Ie.decorationId}"]`);h={editor:e,range:Ie.range,query:Ie.query,text:Ie.text,items:[],command:xe=>u({editor:e,range:Ie.range,props:xe}),decorationNode:Be,clientRect:Be?()=>{var xe;const{decorationId:de}=(xe=this.key)===null||xe===void 0?void 0:xe.getState(e.state),ge=S.dom.querySelector(`[data-decoration-id="${de}"]`);return(ge==null?void 0:ge.getBoundingClientRect())||null}:null},ae&&((w=m==null?void 0:m.onBeforeStart)===null||w===void 0||w.call(m,h)),me&&((y=m==null?void 0:m.onBeforeUpdate)===null||y===void 0||y.call(m,h)),(me||ae)&&(h.items=await c({editor:e,query:Ie.query})),se&&((C=m==null?void 0:m.onExit)===null||C===void 0||C.call(m,h)),me&&((P=m==null?void 0:m.onUpdate)===null||P===void 0||P.call(m,h)),ae&&((R=m==null?void 0:m.onStart)===null||R===void 0||R.call(m,h))},destroy:()=>{var S;h&&((S=m==null?void 0:m.onExit)===null||S===void 0||S.call(m,h))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,b,k,A){const{isEditable:w}=e,{composing:y}=e.view,{selection:C}=S,{empty:P,from:R}=C,M={...b};if(M.composing=y,w&&(P||e.view.composing)){(R<b.range.from||R>b.range.to)&&!y&&!b.composing&&(M.active=!1);const D=p({char:n,allowSpaces:i,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:s,$position:C.$from}),$=`id_${Math.floor(Math.random()*4294967295)}`;D&&f({editor:e,state:A,range:D.range,isActive:b.active})?(M.active=!0,M.decorationId=b.decorationId?b.decorationId:$,M.range=D.range,M.query=D.query,M.text=D.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(S,b){var k;const{active:A,range:w}=v.getState(S.state);return A&&((k=m==null?void 0:m.onKeyDown)===null||k===void 0?void 0:k.call(m,{view:S,event:b,range:w}))||!1},decorations(S){const{active:b,range:k,decorationId:A}=v.getState(S);return b?Bn.create(S.doc,[Ni.inline(k.from,k.to,{nodeName:a,class:l,"data-decoration-id":A})]):null}}});return v}const Mj=new ei("mention"),Ej=Ti.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",$n(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:Mj,command:({editor:t,range:e,props:n})=>{var i,r,o;const s=t.view.state.selection.$to.nodeAfter;((i=s==null?void 0:s.text)===null||i===void 0?void 0:i.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(o=(r=t.view.dom.ownerDocument.defaultView)===null||r===void 0?void 0:r.getSelection())===null||o===void 0||o.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),i=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(i)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",$n({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=$n({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:n,node:t});return typeof i=="string"?["span",$n({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:i}=e,{empty:r,anchor:o}=i;return r?(e.doc.nodesBetween(o-1,o,(s,a)=>{if(s.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",a,a+s.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[xj({editor:this.editor,...this.options.suggestion})]}}),Pj="listItem",$6="textStyle",V6=/^(\d+)\.\s$/,Ij=Ti.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",$n(this.options.HTMLAttributes,n),0]:["ol",$n(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(Pj,this.editor.getAttributes($6)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=fd({find:V6,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=fd({find:V6,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($6)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),Lj=Ti.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",$n(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Dj=Ai.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Wn({key:new ei("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,r=[];if(!n)return null;const o=this.editor.isEmpty;return t.descendants((s,a)=>{const l=i>=a&&i<=a+s.nodeSize,u=!s.isLeaf&&dd(s);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];o&&c.push(this.options.emptyEditorClass);const d=Ni.node(a,a+s.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});r.push(d)}return this.options.includeChildren}),Bn.create(t,r)}}})]}}),Rj=Ti.create({name:"text",group:"inline"}),Nj=Qr.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",$n(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()}}});class Bj{constructor({editor:e,element:n,view:i,tippyOptions:r={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:u,to:c})=>{const{doc:d,selection:f}=l,{empty:p}=f,h=!d.textBetween(u,c).length&&Im(l.selection),m=this.element.contains(document.activeElement);return!(!(a.hasFocus()||m)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const u=!(l!=null&&l.selection.eq(a.state.selection)),c=!(l!=null&&l.doc.eq(a.state.doc));!u&&!c||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,u,c,l)},this.updateDelay))},this.updateHandler=(a,l,u,c)=>{var d,f,p;const{state:h,composing:m}=a,{selection:v}=h;if(m||!l&&!u)return;this.createTooltip();const{ranges:b}=v,k=Math.min(...b.map(y=>y.$from.pos)),A=Math.max(...b.map(y=>y.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,element:this.element,view:a,state:h,oldState:c,from:k,to:A}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(CV(h.selection)){let y=a.nodeDOM(k);if(y){const C=y.dataset.nodeViewWrapper?y:y.querySelector("[data-node-view-wrapper]");if(C&&(y=C.firstChild),y)return y.getBoundingClientRect()}}return MS(a,k,A)})}),this.show()},this.editor=e,this.element=n,this.view=i,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=r,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Is(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:i}=e,r=i.selection.from!==i.selection.to;if(this.updateDelay>0&&r){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 z6=t=>new Wn({key:typeof t.pluginKey=="string"?new ei(t.pluginKey):t.pluginKey,view:e=>new Bj({view:e,...t})});Ai.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[z6({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}}),ye({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=re(null);return bt(()=>{const{updateDelay:i,editor:r,pluginKey:o,shouldShow:s,tippyOptions:a}=t;r.registerPlugin(z6({updateDelay:i,editor:r,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),Vi(()=>{const{pluginKey:i,editor:r}=t;r.unregisterPlugin(i)}),()=>{var i;return er("div",{ref:n},(i=e.default)===null||i===void 0?void 0:i.call(e))}}});function F6(t){return xv((e,n)=>({get(){return e(),t},set(i){t=i,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class $j extends KV{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=F6(this.view.state),this.reactiveExtensionStorage=F6(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),Cf(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){const i=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=i),i}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const Vj=ye({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=re(),n=$r();return Fa(()=>{const i=t.editor;i&&i.options.element&&e.value&&Pt(()=>{if(!e.value||!i.options.element.firstChild)return;const r=x(e.value);e.value.append(...i.options.element.childNodes),i.contentComponent=n.ctx._,n&&(i.appContext={...n.appContext,provides:n.provides}),i.setOptions({element:r}),i.createNodeViews()})}),Vi(()=>{const i=t.editor;i&&(i.contentComponent=null,i.appContext=null)}),{rootEl:e}},render(){return er("div",{ref:t=>{this.rootEl=t}})}}),Og=ye({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=re(null);return bt(()=>{const{pluginKey:i,editor:r,tippyOptions:o,shouldShow:s}=t;r.registerPlugin(h6({pluginKey:i,editor:r,element:n.value,tippyOptions:o,shouldShow:s}))}),Vi(()=>{const{pluginKey:i,editor:r}=t;r.unregisterPlugin(i)}),()=>{var i;return er("div",{ref:n},(i=e.default)===null||i===void 0?void 0:i.call(e))}}});ye({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return er(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const j6=ye({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return er(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))}}),zj=(t={})=>{const e=oe();return bt(()=>{e.value=new $j(t)}),Vi(()=>{var n,i,r;const o=(n=e.value)===null||n===void 0?void 0:n.options.element,s=o==null?void 0:o.cloneNode(!0);(i=o==null?void 0:o.parentNode)===null||i===void 0||i.replaceChild(s,o),(r=e.value)===null||r===void 0||r.destroy()}),e};class H6{constructor(e,{props:n={},editor:i}){this.editor=i,this.component=Cf(e),this.el=document.createElement("div"),this.props=sn(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,n,i,r;return!((n=(e=this.renderedComponent.vNode)===null||e===void 0?void 0:e.component)===null||n===void 0)&&n.exposed?this.renderedComponent.vNode.component.exposed:(r=(i=this.renderedComponent.vNode)===null||i===void 0?void 0:i.component)===null||r===void 0?void 0:r.proxy}renderComponent(){let e=er(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&kf(e,this.el),{vNode:e,destroy:()=>{this.el&&kf(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([n,i])=>{this.props[n]=i}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const U6={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class Fj extends XV{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(r={})=>this.updateAttributes(r),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=re(this.getDecorationClasses());const i=ye({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:r=>{var o,s;return Ks("onDragStart",n),Ks("decorationClasses",this.decorationClasses),(s=(o=this.component).setup)===null||s===void 0?void 0:s.call(o,r,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new H6(i,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,i=this.getPos();if(typeof i=="number")if(e<=i&&n>=i+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,i){const r=o=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(o)};if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=i,this.options.update({oldNode:o,oldDecorations:s,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:i,updateProps:()=>r({node:e,decorations:n,innerDecorations:i})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===n&&this.innerDecorations===i||(this.node=e,this.decorations=n,this.innerDecorations=i,r({node:e,decorations:n,innerDecorations:i})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function K6(t,e){return n=>{if(!n.editor.contentComponent)return{};const i=typeof t=="function"&&"__vccOpts"in t?t.__vccOpts:t;return new Fj(i,n,e)}}var Tg,W6;function jj(){if(W6)return Tg;W6=1;function t(F){return F instanceof Map?F.clear=F.delete=F.set=function(){throw new Error("map is read-only")}:F instanceof Set&&(F.add=F.clear=F.delete=function(){throw new Error("set is read-only")}),Object.freeze(F),Object.getOwnPropertyNames(F).forEach(fe=>{const Ne=F[fe],at=typeof Ne;(at==="object"||at==="function")&&!Object.isFrozen(Ne)&&t(Ne)}),F}class e{constructor(fe){fe.data===void 0&&(fe.data={}),this.data=fe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(F){return F.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(F,...fe){const Ne=Object.create(null);for(const at in F)Ne[at]=F[at];return fe.forEach(function(at){for(const Qt in at)Ne[Qt]=at[Qt]}),Ne}const r="</span>",o=F=>!!F.scope,s=(F,{prefix:fe})=>{if(F.startsWith("language:"))return F.replace("language:","language-");if(F.includes(".")){const Ne=F.split(".");return[`${fe}${Ne.shift()}`,...Ne.map((at,Qt)=>`${at}${"_".repeat(Qt+1)}`)].join(" ")}return`${fe}${F}`};class a{constructor(fe,Ne){this.buffer="",this.classPrefix=Ne.classPrefix,fe.walk(this)}addText(fe){this.buffer+=n(fe)}openNode(fe){if(!o(fe))return;const Ne=s(fe.scope,{prefix:this.classPrefix});this.span(Ne)}closeNode(fe){o(fe)&&(this.buffer+=r)}value(){return this.buffer}span(fe){this.buffer+=`<span class="${fe}">`}}const l=(F={})=>{const fe={children:[]};return Object.assign(fe,F),fe};class u{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(fe){this.top.children.push(fe)}openNode(fe){const Ne=l({scope:fe});this.add(Ne),this.stack.push(Ne)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(fe){return this.constructor._walk(fe,this.rootNode)}static _walk(fe,Ne){return typeof Ne=="string"?fe.addText(Ne):Ne.children&&(fe.openNode(Ne),Ne.children.forEach(at=>this._walk(fe,at)),fe.closeNode(Ne)),fe}static _collapse(fe){typeof fe!="string"&&fe.children&&(fe.children.every(Ne=>typeof Ne=="string")?fe.children=[fe.children.join("")]:fe.children.forEach(Ne=>{u._collapse(Ne)}))}}class c extends u{constructor(fe){super(),this.options=fe}addText(fe){fe!==""&&this.add(fe)}startScope(fe){this.openNode(fe)}endScope(){this.closeNode()}__addSublanguage(fe,Ne){const at=fe.root;Ne&&(at.scope=`language:${Ne}`),this.add(at)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(F){return F?typeof F=="string"?F:F.source:null}function f(F){return m("(?=",F,")")}function p(F){return m("(?:",F,")*")}function h(F){return m("(?:",F,")?")}function m(...F){return F.map(Ne=>d(Ne)).join("")}function v(F){const fe=F[F.length-1];return typeof fe=="object"&&fe.constructor===Object?(F.splice(F.length-1,1),fe):{}}function S(...F){return"("+(v(F).capture?"":"?:")+F.map(at=>d(at)).join("|")+")"}function b(F){return new RegExp(F.toString()+"|").exec("").length-1}function k(F,fe){const Ne=F&&F.exec(fe);return Ne&&Ne.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function w(F,{joinWith:fe}){let Ne=0;return F.map(at=>{Ne+=1;const Qt=Ne;let Jt=d(at),Je="";for(;Jt.length>0;){const Ge=A.exec(Jt);if(!Ge){Je+=Jt;break}Je+=Jt.substring(0,Ge.index),Jt=Jt.substring(Ge.index+Ge[0].length),Ge[0][0]==="\\"&&Ge[1]?Je+="\\"+String(Number(Ge[1])+Qt):(Je+=Ge[0],Ge[0]==="("&&Ne++)}return Je}).map(at=>`(${at})`).join(fe)}const y=/\b\B/,C="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",R="\\b\\d+(\\.\\d+)?",M="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",D="\\b(0b[01]+)",$="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",q=(F={})=>{const fe=/^#![ ]*\//;return F.binary&&(F.begin=m(fe,/.*\b/,F.binary,/\b.*/)),i({scope:"meta",begin:fe,end:/$/,relevance:0,"on:begin":(Ne,at)=>{Ne.index!==0&&at.ignoreMatch()}},F)},J={begin:"\\\\[\\s\\S]",relevance:0},ve={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[J]},ae={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[J]},me={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},se=function(F,fe,Ne={}){const at=i({scope:"comment",begin:F,end:fe,contains:[]},Ne);at.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Qt=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return at.contains.push({begin:m(/[ ]+/,"(",Qt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),at},Ie=se("//","$"),Be=se("/\\*","\\*/"),xe=se("#","$"),de={scope:"number",begin:R,relevance:0},ge={scope:"number",begin:M,relevance:0},Pe={scope:"number",begin:D,relevance:0},Te={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[J,{begin:/\[/,end:/\]/,relevance:0,contains:[J]}]},ue={scope:"title",begin:C,relevance:0},Se={scope:"title",begin:P,relevance:0},Z={begin:"\\.\\s*"+P,relevance:0};var U=Object.freeze({__proto__:null,APOS_STRING_MODE:ve,BACKSLASH_ESCAPE:J,BINARY_NUMBER_MODE:Pe,BINARY_NUMBER_RE:D,COMMENT:se,C_BLOCK_COMMENT_MODE:Be,C_LINE_COMMENT_MODE:Ie,C_NUMBER_MODE:ge,C_NUMBER_RE:M,END_SAME_AS_BEGIN:function(F){return Object.assign(F,{"on:begin":(fe,Ne)=>{Ne.data._beginMatch=fe[1]},"on:end":(fe,Ne)=>{Ne.data._beginMatch!==fe[1]&&Ne.ignoreMatch()}})},HASH_COMMENT_MODE:xe,IDENT_RE:C,MATCH_NOTHING_RE:y,METHOD_GUARD:Z,NUMBER_MODE:de,NUMBER_RE:R,PHRASAL_WORDS_MODE:me,QUOTE_STRING_MODE:ae,REGEXP_MODE:Te,RE_STARTERS_RE:$,SHEBANG:q,TITLE_MODE:ue,UNDERSCORE_IDENT_RE:P,UNDERSCORE_TITLE_MODE:Se});function Y(F,fe){F.input[F.index-1]==="."&&fe.ignoreMatch()}function ke(F,fe){F.className!==void 0&&(F.scope=F.className,delete F.className)}function Fe(F,fe){fe&&F.beginKeywords&&(F.begin="\\b("+F.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",F.__beforeBegin=Y,F.keywords=F.keywords||F.beginKeywords,delete F.beginKeywords,F.relevance===void 0&&(F.relevance=0))}function H(F,fe){Array.isArray(F.illegal)&&(F.illegal=S(...F.illegal))}function he(F,fe){if(F.match){if(F.begin||F.end)throw new Error("begin & end are not supported with match");F.begin=F.match,delete F.match}}function De(F,fe){F.relevance===void 0&&(F.relevance=1)}const nt=(F,fe)=>{if(!F.beforeMatch)return;if(F.starts)throw new Error("beforeMatch cannot be used with starts");const Ne=Object.assign({},F);Object.keys(F).forEach(at=>{delete F[at]}),F.keywords=Ne.keywords,F.begin=m(Ne.beforeMatch,f(Ne.begin)),F.starts={relevance:0,contains:[Object.assign(Ne,{endsParent:!0})]},F.relevance=0,delete Ne.beforeMatch},St=["of","and","for","in","not","or","if","then","parent","list","value"],lt="keyword";function At(F,fe,Ne=lt){const at=Object.create(null);return typeof F=="string"?Qt(Ne,F.split(" ")):Array.isArray(F)?Qt(Ne,F):Object.keys(F).forEach(function(Jt){Object.assign(at,At(F[Jt],fe,Jt))}),at;function Qt(Jt,Je){fe&&(Je=Je.map(Ge=>Ge.toLowerCase())),Je.forEach(function(Ge){const vt=Ge.split("|");at[vt[0]]=[Jt,Ut(vt[0],vt[1])]})}}function Ut(F,fe){return fe?Number(fe):cn(F)?0:1}function cn(F){return St.includes(F.toLowerCase())}const dn={},tn=F=>{console.error(F)},zt=(F,...fe)=>{console.log(`WARN: ${F}`,...fe)},Rt=(F,fe)=>{dn[`${F}/${fe}`]||(console.log(`Deprecated as of ${F}. ${fe}`),dn[`${F}/${fe}`]=!0)},kn=new Error;function Yt(F,fe,{key:Ne}){let at=0;const Qt=F[Ne],Jt={},Je={};for(let Ge=1;Ge<=fe.length;Ge++)Je[Ge+at]=Qt[Ge],Jt[Ge+at]=!0,at+=b(fe[Ge-1]);F[Ne]=Je,F[Ne]._emit=Jt,F[Ne]._multi=!0}function te(F){if(Array.isArray(F.begin)){if(F.skip||F.excludeBegin||F.returnBegin)throw tn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),kn;if(typeof F.beginScope!="object"||F.beginScope===null)throw tn("beginScope must be object"),kn;Yt(F,F.begin,{key:"beginScope"}),F.begin=w(F.begin,{joinWith:""})}}function Q(F){if(Array.isArray(F.end)){if(F.skip||F.excludeEnd||F.returnEnd)throw tn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),kn;if(typeof F.endScope!="object"||F.endScope===null)throw tn("endScope must be object"),kn;Yt(F,F.end,{key:"endScope"}),F.end=w(F.end,{joinWith:""})}}function we(F){F.scope&&typeof F.scope=="object"&&F.scope!==null&&(F.beginScope=F.scope,delete F.scope)}function je(F){we(F),typeof F.beginScope=="string"&&(F.beginScope={_wrap:F.beginScope}),typeof F.endScope=="string"&&(F.endScope={_wrap:F.endScope}),te(F),Q(F)}function st(F){function fe(Je,Ge){return new RegExp(d(Je),"m"+(F.case_insensitive?"i":"")+(F.unicodeRegex?"u":"")+(Ge?"g":""))}class Ne{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ge,vt){vt.position=this.position++,this.matchIndexes[this.matchAt]=vt,this.regexes.push([vt,Ge]),this.matchAt+=b(Ge)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ge=this.regexes.map(vt=>vt[1]);this.matcherRe=fe(w(Ge,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ge){this.matcherRe.lastIndex=this.lastIndex;const vt=this.matcherRe.exec(Ge);if(!vt)return null;const Mn=vt.findIndex((Rr,Qi)=>Qi>0&&Rr!==void 0),wn=this.matchIndexes[Mn];return vt.splice(0,Mn),Object.assign(vt,wn)}}class at{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ge){if(this.multiRegexes[Ge])return this.multiRegexes[Ge];const vt=new Ne;return this.rules.slice(Ge).forEach(([Mn,wn])=>vt.addRule(Mn,wn)),vt.compile(),this.multiRegexes[Ge]=vt,vt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ge,vt){this.rules.push([Ge,vt]),vt.type==="begin"&&this.count++}exec(Ge){const vt=this.getMatcher(this.regexIndex);vt.lastIndex=this.lastIndex;let Mn=vt.exec(Ge);if(this.resumingScanAtSamePosition()&&!(Mn&&Mn.index===this.lastIndex)){const wn=this.getMatcher(0);wn.lastIndex=this.lastIndex+1,Mn=wn.exec(Ge)}return Mn&&(this.regexIndex+=Mn.position+1,this.regexIndex===this.count&&this.considerAll()),Mn}}function Qt(Je){const Ge=new at;return Je.contains.forEach(vt=>Ge.addRule(vt.begin,{rule:vt,type:"begin"})),Je.terminatorEnd&&Ge.addRule(Je.terminatorEnd,{type:"end"}),Je.illegal&&Ge.addRule(Je.illegal,{type:"illegal"}),Ge}function Jt(Je,Ge){const vt=Je;if(Je.isCompiled)return vt;[ke,he,je,nt].forEach(wn=>wn(Je,Ge)),F.compilerExtensions.forEach(wn=>wn(Je,Ge)),Je.__beforeBegin=null,[Fe,H,De].forEach(wn=>wn(Je,Ge)),Je.isCompiled=!0;let Mn=null;return typeof Je.keywords=="object"&&Je.keywords.$pattern&&(Je.keywords=Object.assign({},Je.keywords),Mn=Je.keywords.$pattern,delete Je.keywords.$pattern),Mn=Mn||/\w+/,Je.keywords&&(Je.keywords=At(Je.keywords,F.case_insensitive)),vt.keywordPatternRe=fe(Mn,!0),Ge&&(Je.begin||(Je.begin=/\B|\b/),vt.beginRe=fe(vt.begin),!Je.end&&!Je.endsWithParent&&(Je.end=/\B|\b/),Je.end&&(vt.endRe=fe(vt.end)),vt.terminatorEnd=d(vt.end)||"",Je.endsWithParent&&Ge.terminatorEnd&&(vt.terminatorEnd+=(Je.end?"|":"")+Ge.terminatorEnd)),Je.illegal&&(vt.illegalRe=fe(Je.illegal)),Je.contains||(Je.contains=[]),Je.contains=[].concat(...Je.contains.map(function(wn){return Ae(wn==="self"?Je:wn)})),Je.contains.forEach(function(wn){Jt(wn,vt)}),Je.starts&&Jt(Je.starts,Ge),vt.matcher=Qt(vt),vt}if(F.compilerExtensions||(F.compilerExtensions=[]),F.contains&&F.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return F.classNameAliases=i(F.classNameAliases||{}),Jt(F)}function ie(F){return F?F.endsWithParent||ie(F.starts):!1}function Ae(F){return F.variants&&!F.cachedVariants&&(F.cachedVariants=F.variants.map(function(fe){return i(F,{variants:null},fe)})),F.cachedVariants?F.cachedVariants:ie(F)?i(F,{starts:F.starts?i(F.starts):null}):Object.isFrozen(F)?i(F):F}var He="11.10.0";class ut extends Error{constructor(fe,Ne){super(fe),this.name="HTMLInjectionError",this.html=Ne}}const rt=n,gt=i,Ft=Symbol("nomatch"),on=7,fn=function(F){const fe=Object.create(null),Ne=Object.create(null),at=[];let Qt=!0;const Jt="Could not find the language '{}', did you forget to load/include a language module?",Je={disableAutodetect:!0,name:"Plain text",contains:[]};let Ge={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function vt($e){return Ge.noHighlightRe.test($e)}function Mn($e){let ct=$e.className+" ";ct+=$e.parentNode?$e.parentNode.className:"";const Bt=Ge.languageDetectRe.exec(ct);if(Bt){const nn=Ht(Bt[1]);return nn||(zt(Jt.replace("{}",Bt[1])),zt("Falling back to no-highlight mode for this block.",$e)),nn?Bt[1]:"no-highlight"}return ct.split(/\s+/).find(nn=>vt(nn)||Ht(nn))}function wn($e,ct,Bt){let nn="",In="";typeof ct=="object"?(nn=$e,Bt=ct.ignoreIllegals,In=ct.language):(Rt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Rt("10.7.0",`Please use highlight(code, options) instead.
300
+ https://github.com/highlightjs/highlight.js/issues/2277`),In=$e,nn=ct),Bt===void 0&&(Bt=!0);const Ii={code:nn,language:In};Nr("before:highlight",Ii);const mr=Ii.result?Ii.result:Rr(Ii.language,Ii.code,Bt);return mr.code=Ii.code,Nr("after:highlight",mr),mr}function Rr($e,ct,Bt,nn){const In=Object.create(null);function Ii(ze,ot){return ze.keywords[ot]}function mr(){if(!wt.keywords){Vn.addText(en);return}let ze=0;wt.keywordPatternRe.lastIndex=0;let ot=wt.keywordPatternRe.exec(en),Et="";for(;ot;){Et+=en.substring(ze,ot.index);const rn=$i.case_insensitive?ot[0].toLowerCase():ot[0],fi=Ii(wt,rn);if(fi){const[lo,_G]=fi;if(Vn.addText(Et),Et="",In[rn]=(In[rn]||0)+1,In[rn]<=on&&(Us+=_G),lo.startsWith("_"))Et+=ot[0];else{const JG=$i.classNameAliases[lo]||lo;Oe(ot[0],JG)}}else Et+=ot[0];ze=wt.keywordPatternRe.lastIndex,ot=wt.keywordPatternRe.exec(en)}Et+=en.substring(ze),Vn.addText(Et)}function js(){if(en==="")return;let ze=null;if(typeof wt.subLanguage=="string"){if(!fe[wt.subLanguage]){Vn.addText(en);return}ze=Rr(wt.subLanguage,en,!0,ju[wt.subLanguage]),ju[wt.subLanguage]=ze._top}else ze=B(en,wt.subLanguage.length?wt.subLanguage:null);wt.relevance>0&&(Us+=ze.relevance),Vn.__addSublanguage(ze._emitter,ze.language)}function di(){wt.subLanguage!=null?js():mr(),en=""}function Oe(ze,ot){ze!==""&&(Vn.startScope(ot),Vn.addText(ze),Vn.endScope())}function gr(ze,ot){let Et=1;const rn=ot.length-1;for(;Et<=rn;){if(!ze._emit[Et]){Et++;continue}const fi=$i.classNameAliases[ze[Et]]||ze[Et],lo=ot[Et];fi?Oe(lo,fi):(en=lo,mr(),en=""),Et++}}function _o(ze,ot){return ze.scope&&typeof ze.scope=="string"&&Vn.openNode($i.classNameAliases[ze.scope]||ze.scope),ze.beginScope&&(ze.beginScope._wrap?(Oe(en,$i.classNameAliases[ze.beginScope._wrap]||ze.beginScope._wrap),en=""):ze.beginScope._multi&&(gr(ze.beginScope,ot),en="")),wt=Object.create(ze,{parent:{value:wt}}),wt}function zu(ze,ot,Et){let rn=k(ze.endRe,Et);if(rn){if(ze["on:end"]){const fi=new e(ze);ze["on:end"](ot,fi),fi.isMatchIgnored&&(rn=!1)}if(rn){for(;ze.endsParent&&ze.parent;)ze=ze.parent;return ze}}if(ze.endsWithParent)return zu(ze.parent,ot,Et)}function gf(ze){return wt.matcher.regexIndex===0?(en+=ze[0],1):(oi=!0,0)}function vf(ze){const ot=ze[0],Et=ze.rule,rn=new e(Et),fi=[Et.__beforeBegin,Et["on:begin"]];for(const lo of fi)if(lo&&(lo(ze,rn),rn.isMatchIgnored))return gf(ot);return Et.skip?en+=ot:(Et.excludeBegin&&(en+=ot),di(),!Et.returnBegin&&!Et.excludeBegin&&(en=ot)),_o(Et,ze),Et.returnBegin?0:ot.length}function yf(ze){const ot=ze[0],Et=ct.substring(ze.index),rn=zu(wt,ze,Et);if(!rn)return Ft;const fi=wt;wt.endScope&&wt.endScope._wrap?(di(),Oe(ot,wt.endScope._wrap)):wt.endScope&&wt.endScope._multi?(di(),gr(wt.endScope,ze)):fi.skip?en+=ot:(fi.returnEnd||fi.excludeEnd||(en+=ot),di(),fi.excludeEnd&&(en=ot));do wt.scope&&Vn.closeNode(),!wt.skip&&!wt.subLanguage&&(Us+=wt.relevance),wt=wt.parent;while(wt!==rn.parent);return rn.starts&&_o(rn.starts,ze),fi.returnEnd?0:ot.length}function bf(){const ze=[];for(let ot=wt;ot!==$i;ot=ot.parent)ot.scope&&ze.unshift(ot.scope);ze.forEach(ot=>Vn.openNode(ot))}let Hs={};function Fu(ze,ot){const Et=ot&&ot[0];if(en+=ze,Et==null)return di(),0;if(Hs.type==="begin"&&ot.type==="end"&&Hs.index===ot.index&&Et===""){if(en+=ct.slice(ot.index,ot.index+1),!Qt){const rn=new Error(`0 width match regex (${$e})`);throw rn.languageName=$e,rn.badRule=Hs.rule,rn}return 1}if(Hs=ot,ot.type==="begin")return vf(ot);if(ot.type==="illegal"&&!Bt){const rn=new Error('Illegal lexeme "'+Et+'" for mode "'+(wt.scope||"<unnamed>")+'"');throw rn.mode=wt,rn}else if(ot.type==="end"){const rn=yf(ot);if(rn!==Ft)return rn}if(ot.type==="illegal"&&Et==="")return 1;if(Sn>1e5&&Sn>ot.index*3)throw new Error("potential infinite loop, way more iterations than matches");return en+=Et,Et.length}const $i=Ht($e);if(!$i)throw tn(Jt.replace("{}",$e)),new Error('Unknown language: "'+$e+'"');const Af=st($i);let Va="",wt=nn||Af;const ju={},Vn=new Ge.__emitter(Ge);bf();let en="",Us=0,Br=0,Sn=0,oi=!1;try{if($i.__emitTokens)$i.__emitTokens(ct,Vn);else{for(wt.matcher.considerAll();;){Sn++,oi?oi=!1:wt.matcher.considerAll(),wt.matcher.lastIndex=Br;const ze=wt.matcher.exec(ct);if(!ze)break;const ot=ct.substring(Br,ze.index),Et=Fu(ot,ze);Br=ze.index+Et}Fu(ct.substring(Br))}return Vn.finalize(),Va=Vn.toHTML(),{language:$e,value:Va,relevance:Us,illegal:!1,_emitter:Vn,_top:wt}}catch(ze){if(ze.message&&ze.message.includes("Illegal"))return{language:$e,value:rt(ct),illegal:!0,relevance:0,_illegalBy:{message:ze.message,index:Br,context:ct.slice(Br-100,Br+100),mode:ze.mode,resultSoFar:Va},_emitter:Vn};if(Qt)return{language:$e,value:rt(ct),illegal:!1,relevance:0,errorRaised:ze,_emitter:Vn,_top:wt};throw ze}}function Qi($e){const ct={value:rt($e),illegal:!1,relevance:0,_top:Je,_emitter:new Ge.__emitter(Ge)};return ct._emitter.addText($e),ct}function B($e,ct){ct=ct||Ge.languages||Object.keys(fe);const Bt=Qi($e),nn=ct.filter(Ht).filter(On).map(di=>Rr(di,$e,!1));nn.unshift(Bt);const In=nn.sort((di,Oe)=>{if(di.relevance!==Oe.relevance)return Oe.relevance-di.relevance;if(di.language&&Oe.language){if(Ht(di.language).supersetOf===Oe.language)return 1;if(Ht(Oe.language).supersetOf===di.language)return-1}return 0}),[Ii,mr]=In,js=Ii;return js.secondBest=mr,js}function j($e,ct,Bt){const nn=ct&&Ne[ct]||Bt;$e.classList.add("hljs"),$e.classList.add(`language-${nn}`)}function K($e){let ct=null;const Bt=Mn($e);if(vt(Bt))return;if(Nr("before:highlightElement",{el:$e,language:Bt}),$e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",$e);return}if($e.children.length>0&&(Ge.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn($e)),Ge.throwUnescapedHTML))throw new ut("One of your code blocks includes unescaped HTML.",$e.innerHTML);ct=$e;const nn=ct.textContent,In=Bt?wn(nn,{language:Bt,ignoreIllegals:!0}):B(nn);$e.innerHTML=In.value,$e.dataset.highlighted="yes",j($e,Bt,In.language),$e.result={language:In.language,re:In.relevance,relevance:In.relevance},In.secondBest&&($e.secondBest={language:In.secondBest.language,relevance:In.secondBest.relevance}),Nr("after:highlightElement",{el:$e,result:In,text:nn})}function Ue($e){Ge=gt(Ge,$e)}const Ze=()=>{ne(),Rt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Kt(){ne(),Rt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let V=!1;function ne(){if(document.readyState==="loading"){V=!0;return}document.querySelectorAll(Ge.cssSelector).forEach(K)}function Ve(){V&&ne()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",Ve,!1);function qe($e,ct){let Bt=null;try{Bt=ct(F)}catch(nn){if(tn("Language definition for '{}' could not be registered.".replace("{}",$e)),Qt)tn(nn);else throw nn;Bt=Je}Bt.name||(Bt.name=$e),fe[$e]=Bt,Bt.rawDefinition=ct.bind(null,F),Bt.aliases&&Nt(Bt.aliases,{languageName:$e})}function Wt($e){delete fe[$e];for(const ct of Object.keys(Ne))Ne[ct]===$e&&delete Ne[ct]}function Qe(){return Object.keys(fe)}function Ht($e){return $e=($e||"").toLowerCase(),fe[$e]||fe[Ne[$e]]}function Nt($e,{languageName:ct}){typeof $e=="string"&&($e=[$e]),$e.forEach(Bt=>{Ne[Bt.toLowerCase()]=ct})}function On($e){const ct=Ht($e);return ct&&!ct.disableAutodetect}function En($e){$e["before:highlightBlock"]&&!$e["before:highlightElement"]&&($e["before:highlightElement"]=ct=>{$e["before:highlightBlock"](Object.assign({block:ct.el},ct))}),$e["after:highlightBlock"]&&!$e["after:highlightElement"]&&($e["after:highlightElement"]=ct=>{$e["after:highlightBlock"](Object.assign({block:ct.el},ct))})}function be($e){En($e),at.push($e)}function Tn($e){const ct=at.indexOf($e);ct!==-1&&at.splice(ct,1)}function Nr($e,ct){const Bt=$e;at.forEach(function(nn){nn[Bt]&&nn[Bt](ct)})}function mf($e){return Rt("10.7.0","highlightBlock will be removed entirely in v12.0"),Rt("10.7.0","Please use highlightElement now."),K($e)}Object.assign(F,{highlight:wn,highlightAuto:B,highlightAll:ne,highlightElement:K,highlightBlock:mf,configure:Ue,initHighlighting:Ze,initHighlightingOnLoad:Kt,registerLanguage:qe,unregisterLanguage:Wt,listLanguages:Qe,getLanguage:Ht,registerAliases:Nt,autoDetection:On,inherit:gt,addPlugin:be,removePlugin:Tn}),F.debugMode=function(){Qt=!1},F.safeMode=function(){Qt=!0},F.versionString=He,F.regex={concat:m,lookahead:f,either:S,optional:h,anyNumberOfTimes:p};for(const $e in U)typeof U[$e]=="object"&&t(U[$e]);return Object.assign(F,U),F},gn=fn({});return gn.newInstance=()=>fn({}),Tg=gn,gn.HighlightJS=gn,gn.default=gn,Tg}var Hj=jj();const Mu=Vl(Hj),q6="[A-Za-z$_][0-9A-Za-z$_]*",Uj=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Kj=["true","false","null","undefined","NaN","Infinity"],X6=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],G6=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Z6=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qj=[].concat(Z6,X6,G6);function Xj(t){const e=t.regex,n=(se,{after:Ie})=>{const Be="</"+se[0].slice(1);return se.input.indexOf(Be,Ie)!==-1},i=q6,r={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(se,Ie)=>{const Be=se[0].length+se.index,xe=se.input[Be];if(xe==="<"||xe===","){Ie.ignoreMatch();return}xe===">"&&(n(se,{after:Be})||Ie.ignoreMatch());let de;const ge=se.input.substring(Be);if(de=ge.match(/^\s*=/)){Ie.ignoreMatch();return}if((de=ge.match(/^\s+extends\s+/))&&de.index===0){Ie.ignoreMatch();return}}},a={$pattern:q6,keyword:Uj,literal:Kj,built_in:qj,"variable.language":Wj},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,v,{match:/\$\d+/},d];f.contains=k.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(k)});const A=[].concat(b,f.contains),w=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(A)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:w},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...X6,...G6]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(se){return e.concat("(?!",se.join("|"),")")}const q={match:e.concat(/\b/,$([...Z6,"super","import"].map(se=>`${se}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ve={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",me={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,v,b,{match:/\$\d+/},d,P,{className:"attr",begin:i+e.lookahead(":"),relevance:0},me,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},q,D,C,ve,{match:/\$[(.]/}]}}function Gj(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[e,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}const Qd="[A-Za-z$_][0-9A-Za-z$_]*",_6=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],J6=["true","false","null","undefined","NaN","Infinity"],Y6=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Q6=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],e3=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],t3=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],n3=[].concat(e3,Y6,Q6);function Zj(t){const e=t.regex,n=(se,{after:Ie})=>{const Be="</"+se[0].slice(1);return se.input.indexOf(Be,Ie)!==-1},i=Qd,r={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(se,Ie)=>{const Be=se[0].length+se.index,xe=se.input[Be];if(xe==="<"||xe===","){Ie.ignoreMatch();return}xe===">"&&(n(se,{after:Be})||Ie.ignoreMatch());let de;const ge=se.input.substring(Be);if(de=ge.match(/^\s*=/)){Ie.ignoreMatch();return}if((de=ge.match(/^\s+extends\s+/))&&de.index===0){Ie.ignoreMatch();return}}},a={$pattern:Qd,keyword:_6,literal:J6,built_in:n3,"variable.language":t3},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,v,{match:/\$\d+/},d];f.contains=k.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(k)});const A=[].concat(b,f.contains),w=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(A)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:w},C={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Y6,...Q6]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(se){return e.concat("(?!",se.join("|"),")")}const q={match:e.concat(/\b/,$([...e3,"super","import"].map(se=>`${se}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ve={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},ae="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",me={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ae)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:w,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,v,b,{match:/\$\d+/},d,P,{className:"attr",begin:i+e.lookahead(":"),relevance:0},me,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:ae,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},q,D,C,ve,{match:/\$[(.]/}]}}function _j(t){const e=Zj(t),n=Qd,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],r={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],l={$pattern:Qd,keyword:_6.concat(a),literal:J6,built_in:n3.concat(i),"variable.language":t3},u={className:"meta",begin:"@"+n},c=(p,h,m)=>{const v=p.contains.findIndex(S=>S.label===h);if(v===-1)throw new Error("can not find mode to replace");p.contains.splice(v,1,m)};Object.assign(e.keywords,l),e.exports.PARAMS_CONTAINS.push(u);const d=e.contains.find(p=>p.className==="attr");e.exports.PARAMS_CONTAINS.push([e.exports.CLASS_REFERENCE,d]),e.contains=e.contains.concat([u,r,o]),c(e,"shebang",t.SHEBANG()),c(e,"use_strict",s);const f=e.contains.find(p=>p.label==="func.def");return f.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Jj(t){return{name:"VBScript in HTML",subLanguage:"xml",contains:[{begin:"<%",end:"%>",subLanguage:"vbscript"}]}}const Yj={class:"relative w-full overflow-hidden"},Qj=["placeholder"],eH={class:"relative"},tH=["innerHTML"],i3=ye({__name:"CodeSnippet",props:Cn({code:{},lang:{default:"json"},readonly:{type:Boolean},placeholder:{}},{code:{default:""},codeModifiers:{}}),emits:["update:code"],setup(t){Mu.registerLanguage("javascript",Xj),Mu.registerLanguage("typescript",_j),Mu.registerLanguage("json",Gj),Mu.registerLanguage("html",Jj);const e=t,n=si(t,"code"),i=dt("preset",{}).codesnippet,r=re(),o=re(),s=oe(0),a=oe(!1),l=W(()=>n.value.split(`
301
+ `).map((f,p)=>{const h=Mu.highlight(f,{language:e.lang}).value;return{line:p+1,code:h}})),u=()=>{var d;(d=navigator.clipboard)==null||d.writeText(n.value),a.value=!0,setTimeout(()=>{a.value=!1},1500)};bt(()=>{c()});const c=()=>{if(o.value){const d=o.value.querySelector("[data-wv-section=linenumber]");s.value=d.offsetWidth}};return Re(l,()=>{c()}),(d,f)=>{var p,h,m;return g(),T("div",Yj,[n.value.length&&d.readonly?(g(),L(We,O({key:0},(p=x(i))==null?void 0:p.copybutton,{icon:a.value?"check":"file-copy",onClick:u,size:"small",text:""}),null,16,["icon"])):N("",!0),E("div",O((h=x(i))==null?void 0:h.body,{style:{"scrollbar-width":"none"}}),[d.readonly?N("",!0):ft((g(),T("textarea",O({key:0,ref_key:"textarea",ref:r},(m=x(i))==null?void 0:m.textarea,{"onUpdate:modelValue":f[0]||(f[0]=v=>n.value=v),placeholder:d.placeholder,spellcheck:!1,style:`left: ${s.value}px; width: calc(100% - ${s.value+6}px); scrollbar-width: none;`}),null,16,Qj)),[[Of,n.value]]),E("table",{ref_key:"codesnippet",ref:o,class:"relative"},[E("tbody",eH,[(g(!0),T(le,null,_e(l.value,({line:v,code:S})=>{var b;return g(),T("tr",{key:v,class:"h-5"},[E("td",O({ref_for:!0},(b=x(i))==null?void 0:b.linenumber,{class:[{"pt-1.5":v===1,"pb-1.5":v===l.value.length}],"data-wv-section":"linenumber"}),_(v),17),E("td",{class:pe(["px-1.5",{"pt-1.5":v==1,"pb-1.5":v===l.value.length}])},[E("pre",{innerHTML:S,class:"font-poppins"},null,8,tH)],2)])}),128))])],512)],16)])}}}),nH=ye({__name:"CodeSnippetAdapter",props:U6,setup(t){const e=t,n=re(e.node.attrs.code);return Re(n,()=>{e.updateAttributes({code:n.value})}),(i,r)=>(g(),L(x(j6),null,{default:z(()=>[I(i3,{code:n.value,"onUpdate:code":r[0]||(r[0]=o=>n.value=o),readonly:!e.editor.isEditable,placeholder:"Masukan Code"},null,8,["code","readonly"])]),_:1}))}}),iH=Ti.create({name:"codeSnippet",group:"block",atom:!0,addAttributes(){return{code:{default:""}}},parseHTML(){return[{tag:"codeSnippet"}]},renderHTML({HTMLAttributes:t}){return["codeSnippet",$n(t)]},addNodeView(){return K6(nH)},addCommands(){return{insertCodeSnippet:()=>({commands:t})=>t.insertContent({type:"codeSnippet",attrs:{code:""}}),deleteCodeSnippet:()=>({commands:t})=>t.deleteSelection()}}}),rH={class:"flex flex-col gap-1 border-primary-400 border-[2px] rounded-md relative my-4"},oH={class:"!font-semibold !text-sm absolute -top-[10px] ml-2 bg-white border-primary-400 border-[2px] px-4 rounded-md"},sH={key:0,class:"absolute top-[45%] px-4 text-gray-400"},aH=["contenteditable"],lH=ye({__name:"MentionSection",props:U6,setup(t){const e=t;bt(()=>{r.value=e.editor.isEditable});const n=re(e.node.attrs.title),i=re(e.node.attrs.bodyText),r=oe(!0);return Re(n,()=>{e.updateAttributes({title:n.value})}),Re(i,()=>{e.updateAttributes({bodyText:i.value})}),(o,s)=>(g(),L(x(j6),null,{default:z(()=>[E("div",rH,[E("p",oH,[s[3]||(s[3]=E("span",{class:"text-xs"},"#",-1)),ht(_(n.value),1)]),r.value?(g(),T("span",sH," Tuliskan sebuah pesan ")):N("",!0),E("span",{class:pe(["p-4 pt-6 caret-primary-500 focus:caret-primary-500 relative "]),contenteditable:e.editor.isEditable,onBlur:s[0]||(s[0]=a=>{const l=a.target.innerText;i.value=l,r.value=l===""||l===`
325
302
  `}),onFocus:s[1]||(s[1]=a=>r.value=!1),onKeyup:s[2]||(s[2]=a=>{const l=a.target.innerText;console.log(l),r.value=l===""||l===`
326
- `})},_(i.value),41,QK)])]),_:1}))}}),tW=xi.create({name:"mentionSection",group:"block",atom:!0,addAttributes(){return{title:{default:""},bodyText:{default:""}}},parseHTML(){return[{tag:"mentionSection"}]},renderHTML({HTMLAttributes:t}){return["mentionSection",$n(t)]},addNodeView(){return rC(eW)},addCommands(){return{insertMentionSection:t=>({commands:e})=>e.insertContent({type:"mentionSection",attrs:{title:t,bodyText:null}}),deleteMentionSection:()=>({commands:t})=>t.deleteSelection()}}}),nW={class:"bg-white border border-gray-200 rounded-lg shadow-md flex flex-col max-h-72 overflow-y-scroll w-fit gap-1 p-2 relative"},iW=["onClick"],rW={class:"flex flex-col gap-[1px]"},oW={class:"!text-[10px] !font-light"},sW={key:1,class:"text-xs font-semibold"},aW=ye({__name:"MentionList",props:{items:{},command:{type:Function}},setup(t,{expose:e}){const n=t,i=oe(0),r=u=>u.key==="ArrowUp"?(o(),!0):u.key==="ArrowDown"?(s(),!0):u.key==="Enter"?(a(),!0):!1,o=()=>{i.value=(i.value+n.items.length-1)%n.items.length},s=()=>{i.value=(i.value+1)%n.items.length},a=()=>{l(i.value)},l=u=>{const c=n.items[u];c&&n.command({id:c.id,label:c.label})};return e({onKeyDown:r}),Re(()=>n.items,()=>{i.value=0}),(u,c)=>(g(),T("div",nW,[u.items.length?(g(!0),T(le,{key:0},_e(u.items,(d,f)=>(g(),T("div",{key:f,class:pe({"hover:bg-gray-100 flex":!0,"!bg-gray-100 ":f===i.value}),onClick:p=>l(f)},[I(Yl,{user:{profilePicture:d.profilePicture},"profile-picture-field":"profilePicture"},null,8,["user"]),E("div",rW,[E("p",null,_(d.label),1),E("p",oW,_(d.nickName),1)])],10,iW))),128)):(g(),T("div",sW,"No result"))]))}}),lW=()=>({render:()=>{let t,e;return{onStart(n){t=new nC(aW,{props:{items:n.items,command:n.command},editor:n.editor}),n.clientRect&&(e=Ds("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(n){t.updateProps(n),n.clientRect&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){return n.event.key==="Escape"?(e[0].hide(),!0):t.ref.onKeyDown(n.event)},onExit(){e[0].destroy(),t.destroy()}}}}),uW=1*1024*1024,cW=10*1024*1024,dW=t=>t.startsWith("image/")?"image":t.includes("mp4")?"mp4":t==="video/x-matroska"?"mkv":t==="text/plain"?"txt":t==="text/csv"?"csv":t==="text/html"?"html":t==="application/json"?"json":t==="application/pdf"?"pdf":t==="application/vnd.ms-excel"||t==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"xls":t==="application/msword"||t==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?"doc":t.startsWith("application/x-url")?"link":t.includes("application/x-zip-compressed")||t.includes("application/x-compressed")?"compressed":"unknown",fW=(t,e=1)=>{var i;if(e*=uW,!((i=t.type)!=null&&i.length))return!1;const n=dW(t.type);return t.size<=(n==="mp4"||n==="mkv"?cW:e)},$s=ye({__name:"EditorButton",props:{classButton:{}},setup(t){return(e,n)=>(g(),L(We,{class:pe([e.classButton,"!rounded h-6 w-6 p-1"]),tooltip:{pt:{text:{style:"font-size: 9px !important; padding: 2px 6px; border-radius: 8px"}},value:e.$attrs.tooltipText??e.$attrs["tooltip-text"]},"icon-class":"!w-4 !h-4",severity:"secondary",text:"","tooltip-pos":"top"},null,8,["class","tooltip"]))}}),pW=["title","onClick"],hW={class:"!text-[9px] !leading-3 !h-max !font-normal"},mW={class:pe(["flex gap-2 bg-white border-[0.5px] px-2 py-1 rounded-sm","[&_.separator::after]:content-['|']","[&_.separator::after]:text-xl","[&_.separator::after]:font-thin","[&_.separator]:h-6"])},gW={class:pe(["flex gap-2 bg-white border-[0.5px] px-2 py-1 rounded-sm","[&_.separator::after]:content-['|']","[&_.separator::after]:text-xl","[&_.separator::after]:font-thin","[&_.separator]:h-6"])},vW={class:"flex flex-col gap-4"},yW={class:"flex gap-2"},bW={class:"flex-1"},AW={class:"flex items-end"},wW={class:"flex flex-wrap justify-center gap-2"},SW=["src"],CW={class:"flex flex-col justify-center w-28 h-28 items-center"},kW={class:"relative py-[7px] px-3"},OW={class:pe(["flex gap-2 bg-white border-[0.5px] px-2 py-1 rounded-sm","[&_.separator::after]:content-['|']","[&_.separator::after]:text-xl","[&_.separator::after]:font-thin","[&_.separator]:h-6"])},TW=ye({__name:"Editor",props:Cn({modelValue:{},initialValue:{},placeholder:{default:"Tulis"},editorState:{default:"editable"},borderLess:{type:Boolean,default:!1},label:{},useValidator:{type:Boolean},fieldName:{},labelClass:{},fieldInfo:{},validatorMessageClass:{},validatorMessage:{},mandatory:{type:Boolean},invalid:{type:Boolean},showOptionalText:{type:Boolean,default:void 0},isImageUploadBase64:{type:Boolean,default:!1},fetchMentionSuggestionFunction:{},mentionedList:{},editorWrapperClass:{},toolbarWrapperClass:{},contentWrapperClass:{}},{modelValue:{},modelModifiers:{},mentionedList:{},mentionedListModifiers:{}}),emits:Cn(["update:modelValue","postImageLocal","deleteImageLocal","blur","focus","update:mentionedList"],["update:modelValue","update:mentionedList"]),setup(t,{expose:e,emit:n}){const i=dt("preset",{}).menu,r=t,o=n;si(t,"modelValue");const s=si(t,"mentionedList");bt(()=>{r.useValidator&&(Object.assign(v,Ln(()=>r.fieldName??"editorInput",Z=>Pt(()=>me(Z)))),r.initialValue!=null&&(v.value=r.initialValue),r.modelValue!=null&&(v.value=r.modelValue)),ge()});const a=oe(!1),l=re(),u=re(),c=re(),d=re([]),f=oe(!1),p=oe(),h=oe(),m=oe(),v=sn({value:r.modelValue}),S=oe(!1),b=re([]),k=oe(),A=W(()=>{var Z;return r.placeholder??"Tulis "+(r.label?(Z=r.label)==null?void 0:Z.toLowerCase():"")}),w=qK({content:r.initialValue??r.modelValue,onBlur:Z=>o("blur",Z),onFocus:Z=>o("focus",Z),onUpdate:()=>{var Z,X;o("update:modelValue",((Z=w.value)==null?void 0:Z.getJSON())??{}),v.value=((X=w.value)==null?void 0:X.getJSON())??{}},onPaste:async Z=>{let X=[];const{items:U}=Z.clipboardData,Y=ke=>new Promise(Fe=>{if(ke.kind==="file"){const H=ke.getAsFile();H&&X.push(H),Fe()}else Fe()});await Promise.all(Array.from(U).map(Y));try{if(X.length){const ke=X.filter(Fe=>Fe.type.startsWith("image/")).filter(Fe=>fW(Fe,10));await ve(ke)}}catch(ke){console.error("Error pasting images:",ke)}finally{X=[]}},onSelectionUpdate(Z){var U;const X=Z.editor.getAttributes("image");(U=w.value)==null||U.state.doc.descendants(Y=>{Y.type.name==="mention"&&b.value.push(Y.attrs.id)}),b.value=Array.from(new Set(b.value)),X.title==="localImage"?h.value=X:h.value=void 0},editable:r.editorState==="editable",extensions:[FK.configure({emptyEditorClass:"is-editor-empty !text-general-200 !font-light",placeholder:A.value,includeChildren:!1}),fH.extend({addKeyboardShortcuts(){return{"Mod-\\":()=>(this.editor.commands.clearNodes(),this.editor.commands.unsetAllMarks())}}}),KU,zK,jK,nK.extend({addKeyboardShortcuts(){const Z=()=>{const{node:X}=this.editor.state.selection;return X&&X.type.name==="image"&&X.attrs.title==="localImage"?(xe(),!0):!1};return{Insert:()=>J(),Backspace:Z,Delete:Z}}}).configure({HTMLAttributes:{class:"w-fit max-h-[300px] object-contain"}}),ZK.extend({addKeyboardShortcuts(){return{"Mod-alt-c":Pe}}}),tW,VK.configure({HTMLAttributes:{class:"list-decimal px-3 py-1"}}),lH.configure({HTMLAttributes:{class:"list-disc px-3 py-1"}}),IK,sH,aK,HK,dH,PK.extend({addKeyboardShortcuts(){return{"Mod-k":()=>se()}}}).configure({openOnClick:!1}),eK,BK.configure({HTMLAttributes:{class:"bg-primary-200 text-primary-800 rounded-[50px] px-1"},suggestion:{items({query:Z}){return((m==null?void 0:m.value)??[]).filter(X=>X==null?void 0:X.fullName.toLowerCase().includes(Z.toLowerCase())).map(X=>({id:X==null?void 0:X._id,label:X==null?void 0:X.fullName,nickName:X.nickName,profilePicture:X.profilePicture}))},...lW()}}),UU]}),y=W(()=>{var St,lt,At,Ut,cn,dn,tn,zt,Rt,kn,Yt,te,Q,we,je,st;if(!w.value)return[];const{toggleBold:Z,focus:X,toggleItalic:U,toggleUnderline:Y,toggleBulletList:ke,toggleCode:Fe,toggleOrderedList:H,unsetAllMarks:he,clearNodes:De}=w.value.commands,nt=(St=w.value)==null?void 0:St.isActive("code");return[{label:"Aa",iconPos:"right",icon:"arrow-down",class:"!gap-0 !w-[50px] !p-0 !m-0 [&_span]:leading-[22px]",onClick:(lt=l.value)==null?void 0:lt.toggle},{icon:"bold",tooltipText:"Bold | Ctrl + B",active:(At=w.value)==null?void 0:At.isActive("bold"),disabled:nt,onClick:()=>{X(),Z()}},{icon:"italic",tooltipText:"Italic | Ctrl + I",active:(Ut=w.value)==null?void 0:Ut.isActive("italic"),disabled:nt,onClick:()=>{X(),U()}},{icon:"underline",class:"mr-3",active:(cn=w.value)==null?void 0:cn.isActive("underline"),tooltipText:"Underline | Ctrl + U",disabled:nt,onClick:()=>{X(),Y()}},{icon:"list-unordered",tooltipText:"Bullet List | Ctrl + 7",active:(dn=w.value)==null?void 0:dn.isActive("bullet-list"),onClick:()=>{X(),ke()}},{icon:"list-ordered",tooltipText:"Numbered List | Ctrl + 8",active:(tn=w.value)==null?void 0:tn.isActive("ordered-list"),class:"mr-3",onClick:()=>{X(),H()}},{icon:"link-m",tooltipText:"Link | Ctrl + K",disabled:((zt=w.value)==null?void 0:zt.isActive("link"))||a.value,onClick:se},{icon:"image-add",active:(Rt=w.value)==null?void 0:Rt.isActive("image"),tooltipText:"Image | Insert",onClick:()=>J()},{icon:"code-line",active:(kn=w.value)==null?void 0:kn.isActive("code"),tooltipText:"Inline Code | Ctrl + E",onClick:()=>{X(),Fe()}},{icon:"code-box-line",active:(Yt=w.value)==null?void 0:Yt.isActive("codeSnippet"),tooltipText:"Code Block | Ctrl + Alt + C",onClick:()=>{Pe()}},{icon:"format-clear",tooltipText:"Clear Formatting Ctrl + \\",disabled:!((te=w.value)!=null&&te.isActive("bold"))&&!((Q=w.value)!=null&&Q.isActive("underline"))&&!((we=w.value)!=null&&we.isActive("italic"))&&!((je=w.value)!=null&&je.isActive("code"))&&!((st=w.value)!=null&&st.isActive("heading")),onClick:()=>{X(),De(),he()}}]}),C=oe([{label:"Paragraf",class:"p",shortCut:"Ctrl+Alt+P",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setParagraph()}},{label:"Heading 1",class:"heading-1",shortCut:"Ctrl+Alt+1",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:1})}},{label:"Heading 2",class:"heading-2",shortCut:"Ctrl+Alt+2",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:2})}},{class:"heading-3",label:"Heading 3",shortCut:"Ctrl+Alt+3",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:3})}},{label:"Heading 4",class:"heading-4",shortCut:"Ctrl+Alt+4",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:4})}},{label:"Heading 5",class:"heading-5",shortCut:"Ctrl+Alt+5",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:5})}},{label:"Heading 6",class:"heading-6",shortCut:"Ctrl+Alt+6",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:6})}}]),P=W(()=>{var Z;return(Z=w.value)==null?void 0:Z.getAttributes("link")}),R=()=>{var U;const{href:Z}=P.value,X=(U=w.value)==null?void 0:U.view.dom.querySelector(`[href="${Z}"]`);return q()||X&&(X==null?void 0:X.textContent)!==Z&&X.textContent||void 0},M=()=>{var Z;window.open((Z=P.value)==null?void 0:Z.href,"_blank")},D=()=>{var Z;window.navigator.clipboard.writeText((Z=P.value)==null?void 0:Z.href)},$=()=>{var Z;if(w.value){const{unsetLink:X,focus:U}=((Z=w.value)==null?void 0:Z.commands)??{};U(),X()}},q=()=>{if(w.value){const{state:Z}=w.value,{from:X,to:U}=Z.selection;return Z==null?void 0:Z.doc.textBetween(X,U," ")}},J=()=>(f.value=!0,!1),ve=async Z=>{if(r.isImageUploadBase64){const X=await de(Z[0]);Be(X)}else o("postImageLocal",{image:Z[0],setImageCb:Be})},ae=Z=>{const{files:X}=Z.target;ve(X)},me=(Z={})=>{if(typeof r.validatorMessage=="string"&&r.invalid)return r.validatorMessage;if(typeof r.validatorMessage!="string"){const{empty:X}=r.validatorMessage??{};if(Z.content===void 0&&r.mandatory&&X)return X??!0}return!0},se=Z=>{var Y,ke,Fe,H;const X=Z??{currentTarget:(ke=(Y=c.value)==null?void 0:Y.querySelector(".ic-link-m"))==null?void 0:ke.closest("button")},{dom:U}=((Fe=w.value)==null?void 0:Fe.view)??{};return(H=u.value)==null||H.toggle(X,U),!0},Ie=({formValues:Z})=>{var he,De;if(!w.value)return!1;const{setLink:X,insertContent:U,focus:Y}=w.value.commands,{url:ke,text:Fe}=Z,{state:H}=w.value;return Y(),X({href:ke,target:"_blank",rel:"nofollow"}),(he=w.value)!=null&&he.isActive("link")?w.value.chain().focus().command(({tr:nt,state:St})=>{const{$from:lt,$to:At}=St.selection,Ut=H.schema.marks.link;let cn=lt.start(),dn=At.end();return H.doc.nodesBetween(lt.pos,At.pos,(tn,zt)=>{tn.isText&&tn.marks.some(Rt=>Rt.type===Ut)&&(cn=Math.min(cn,zt),dn=Math.max(dn,zt+tn.nodeSize))}),nt.insertText(Fe||ke,cn,dn),!0}).run():H.selection.empty&&U(Fe||ke),(De=u.value)==null||De.hide(),a.value=!1,!0},Be=Z=>{var X,U,Y,ke;(X=w.value)==null||X.commands.focus(),Z&&(r.isImageUploadBase64?(U=w.value)==null||U.commands.setImage({src:Z,title:"localImageBase64"}):(Y=w.value)==null||Y.commands.setImage({src:Z,title:"localImage"}),d.value=Array.from(new Set([...d.value,Z]))),p.value&&((ke=w.value)==null||ke.commands.setImage({src:p.value}),d.value=Array.from(new Set([...d.value,p.value]))),p.value=void 0,Te()},xe=()=>{var Z;h.value&&h.value.title==="localImage"&&o("deleteImageLocal",h.value),(Z=w.value)==null||Z.commands.deleteSelection()},de=Z=>new Promise((X,U)=>{const Y=new FileReader;Y.readAsDataURL(Z),Y.onload=()=>{X(Y.result)},Y.onerror=ke=>{U(ke)}}),ge=async()=>{if(r.fetchMentionSuggestionFunction){S.value=!S.value;try{const{data:Z}=await r.fetchMentionSuggestionFunction()??{};m.value=Z,S.value=!S.value}catch(Z){console.error(Z)}}},Pe=()=>{var U,Y;const{insertCodeSnippet:Z,deleteCodeSnippet:X}=(U=w.value)==null?void 0:U.commands;return(Y=w.value)!=null&&Y.isActive("codeSnippet")?X():Z(),!1},Te=()=>{w.value.commands.createParagraphNear()},ue=Z=>{var X;try{const{insertMentionSection:U}=(X=w.value)==null?void 0:X.commands;U(Z),k.value!==Z&&k.value!==void 0&&Se(),k.value=Z}catch(U){console.error(U)}},Se=()=>{S.value=!0,setTimeout(()=>{S.value=!1},100)};return e({mentionSectionTrigger:ue}),Re(()=>r.invalid,()=>{var Z;(Z=v.validate)==null||Z.call(v)}),Re(b,()=>{s.value=b.value}),(Z,X)=>{const U=an("focus");return g(),T(le,null,[I(Yn,{info:Z.fieldInfo,label:r.label,"label-class":r.labelClass,mandatory:r.mandatory,"show-optional-text":r.showOptionalText},{default:z(()=>[E("div",{ref_key:"root",ref:c,class:pe(["rounded-b text-grayscale-900 w-full","[&:has(:focus)]:border-general-200 border-general-100",`${Z.borderLess||Z.editorState==="readonly"?"border-none":"border-[0.5px]"}`,"[&_code]:bg-primary-100","[&_code]:rounded-md","[&_code]:p-[0.25em_0.3em]","[&_code]:text-[0.85rem]","[&_code]:!font-source-code-pro",`${r.editorWrapperClass}`]),"data-wv-name":"editor"},[r.editorState==="editable"?(g(),T("div",{key:0,class:pe(["border-b-[0.5px] border-inherit px-3 py-1 flex gap-1 bg-general-50",`${r.toolbarWrapperClass}`]),"data-wv-section":"toolbar"},[(g(!0),T(le,null,_e(y.value,Y=>(g(),L($s,O({ref_for:!0},Y,{key:Y.icon,class:[{"!bg-primary-50 ":Y.active},Y.class]}),null,16,["class"]))),128))],2)):N("",!0),S.value?N("",!0):(g(),L(x(WK),{key:1,class:pe([`${r.editorState==="editable"?"px-3 py-2":""} [&_*]:outline-none`,"[&_.is-editor-empty:first-child::before]:text-general-200","[&_.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.is-editor-empty:first-child::before]:font-normal","[&_.is-editor-empty:first-child::before]:pointer-events-none","[&_.is-editor-empty:first-child::before]:float-left","[&_.is-editor-empty:first-child::before]:h-0","[&_a]:hover:underline transition-transform duration-75","[&_a]:text-link","[&_a]:cursor-pointer","[&_b]:font-bold","[&_strong]:font-bold","[&_img.ProseMirror-selectednode]:!outline-[0.5px]","[&_img.ProseMirror-selectednode]:!outline-link","[&_img.ProseMirror-selectednode]:!outline-offset-1","[&_img.ProseMirror-selectednode]:!rounded-sm","[&_img]:my-2","[&_*:has(code)]:my-[0.25rem]",`${r.contentWrapperClass}`]),editor:x(w),spellcheck:"false"},null,8,["class","editor"])),I(x(wc),{ref_key:"headingMenu",ref:l,model:C.value,popup:""},{item:z(({item:Y})=>{var ke,Fe,H,he,De,nt,St,lt;return[E("a",{class:pe([...(ke=x(i))==null?void 0:ke.action.class,Y.class,"flex items-center !justify-between h-[30px]",{"bg-primary-50":((Fe=x(w))==null?void 0:Fe.isActive("heading",{level:1}))&&Y.label==="Heading 1"||((H=x(w))==null?void 0:H.isActive("heading",{level:2}))&&Y.label==="Heading 2"||((he=x(w))==null?void 0:he.isActive("heading",{level:3}))&&Y.label==="Heading 3"||((De=x(w))==null?void 0:De.isActive("heading",{level:4}))&&Y.label==="Heading 4"||((nt=x(w))==null?void 0:nt.isActive("heading",{level:5}))&&Y.label==="Heading 5"||((St=x(w))==null?void 0:St.isActive("heading",{level:6}))&&Y.label==="Heading 6"||((lt=x(w))==null?void 0:lt.isActive("paragraph"))&&Y.label==="Paragraf"}]),title:Y.label,onClick:At=>{var Ut;return(Ut=Y.command)==null?void 0:Ut.call(Y,{item:Y,originalEvent:At})}},[ht(_(Y.label)+" ",1),E("code",hW,_(Y.shortCut),1)],10,pW)]}),_:1},8,["model"]),x(w)&&r.editorState==="editable"?(g(),L(x(Zg),{key:2,editor:x(w),"should-show":()=>{var Y,ke;return((Y=x(w))==null?void 0:Y.isActive("codeSnippet"))||((ke=x(w))==null?void 0:ke.isActive("mentionSection"))},"tippy-options":{placement:"top",zIndex:9},class:"-mt-1.5 shadow-panel","plugin-key":"editLinkToolbar"},{default:z(()=>[E("div",mW,[I($s,{onClick:Te,icon:"close",severity:"secondary",text:"","tooltip-text":"Buat text baru dibawah"})])]),_:1},8,["editor","should-show"])):N("",!0),x(w)&&!a.value&&r.editorState==="editable"?(g(),L(x(Zg),{key:3,editor:x(w),"should-show":()=>{var Y;return(Y=x(w))==null?void 0:Y.isActive("link")},"tippy-options":{placement:"bottom",zIndex:9},class:"-mt-1.5 shadow-panel","plugin-key":"editLinkToolbar"},{default:z(()=>[E("div",gW,[I($s,{onClick:se,class:"!w-max",label:"Edit Tautan",severity:"secondary",text:""}),X[4]||(X[4]=E("span",{class:"separator"},null,-1)),I($s,{onClick:M,icon:"external-link",severity:"secondary",text:"","tooltip-text":"Buka di tab baru"}),X[5]||(X[5]=E("span",{class:"separator"},null,-1)),I($s,{onClick:$,icon:"link-unlink-m",severity:"secondary",text:"","tooltip-text":"Lepas tautan"}),X[6]||(X[6]=E("span",{class:"separator"},null,-1)),I($s,{onClick:D,icon:"file-copy",severity:"secondary",text:"","tooltip-text":"Salin tautan"})])]),_:1},8,["editor","should-show"])):N("",!0),I(ur,{visible:f.value,"onUpdate:visible":X[2]||(X[2]=Y=>f.value=Y),class:"w-[400px]",header:"Pilih Gambar"},{default:z(()=>[E("div",vW,[E("div",yW,[E("div",bW,[I(I2,{"model-value":p.value,"onUpdate:modelValue":X[0]||(X[0]=Y=>p.value=Y),class:"w-[269px]",label:"URL Gambar"},null,8,["model-value"])]),E("div",AW,[I(We,{onClick:X[1]||(X[1]=Y=>Be()),label:"Simpan",severity:"secondary"})])]),E("div",null,[X[8]||(X[8]=E("p",null,"Baru Saja Ditambahkan",-1)),E("div",wW,[(g(!0),T(le,null,_e(d.value,(Y,ke)=>(g(),T("img",{key:ke,src:Y,alt:"preview",class:"w-28 h-28 object-scale-down rounded-lg"},null,8,SW))),128)),E("div",CW,[I(Me,{class:"!w-[70px] !h-[70px]",icon:"upload-2",severity:"primary"}),I(We,{severity:"secondary"},{default:z(()=>[E("div",kW,[X[7]||(X[7]=E("p",null,"Cari Gambar",-1)),E("input",{onChange:ae,class:"opacity-0 absolute top-0 bottom-0 left-0 right-0",type:"file"},null,32)])]),_:1})])])])])]),_:1},8,["visible"]),x(w)&&r.editorState==="editable"?(g(),L(x(Zg),{key:4,editor:x(w),"should-show":()=>{var Y;return!!((Y=x(w))!=null&&Y.isActive("image"))},"tippy-options":{placement:"top",zIndex:9},class:"-mt-1.5 shadow-panel","plugin-key":"editImageToolbar"},{default:z(()=>[E("div",OW,[I($s,{onClick:xe,icon:"delete-bin",severity:"secondary",text:"","tooltip-text":"Unset Image"})])]),_:1},8,["editor","should-show"])):N("",!0)],2),I(Rn,{class:pe(Z.validatorMessageClass),message:v.errorMessage},null,8,["class","message"])]),_:1},8,["info","label","label-class","mandatory","show-optional-text"]),I(Oc,{ref_key:"editLinkOverlay",ref:u,pt:{content:{class:""}},onHide:X[3]||(X[3]=Y=>a.value=!1),"append-to":"self",class:"w-[342px] bg-white p-4"},{default:z(()=>[I(jA,{onSubmit:Ie,class:"!gap-0","hide-stay-checkbox":""},{fields:z(()=>{var Y,ke;return[ft(I(I2,{"validator-message":{empty:"Masukan tautan yang valid"},value:(Y=P.value)==null?void 0:Y.href,"field-name":"url",label:"Tempel Tautan",mandatory:"",placeholder:"Tempel tautan baru","use-validator":""},null,8,["value"]),[[U]]),I(ca,{value:R(),"field-name":"text",label:"Teks Tampilan",placeholder:"Teks untuk ditampilkan","use-validator":""},null,8,["value"]),I(We,{label:(ke=x(w))!=null&&ke.isActive("link")?"Simpan":"Tambahkan",class:"w-max ml-auto",severity:"secondary",type:"submit"},null,8,["label"])]}),_:1})]),_:1},512)],64)}}}),xW={key:0},MW={key:2},EW={class:"flex items-center gap-1"},PW={key:3,class:"list-none"},IW={key:5,class:"grid"},LW=["href"],DW={key:6,class:"w-[520px] overflow-auto",style:{"scrollbar-width":"none"}},RW={key:7,class:"grid grid-cols-[max-content,1fr] gap-2 items-center"},NW=["alt","src"],BW=["href"],pf=ye({__name:"TimelineContentByType",props:{detail:{}},setup(t){const e=i=>({pdf:GB,csv:WB,doc:XB,xls:ZB,data:qB})[i],n=i=>{var r,o;return(o=i.filePath)==null?void 0:o.slice((((r=i.filePath)==null?void 0:r.lastIndexOf("/"))??0)+1)};return(i,r)=>i.detail.type==="text"?(g(),T("p",xW,_(i.detail.value),1)):i.detail.type==="badge"?(g(),L(Lt,{key:1,format:i.detail.format,label:i.detail.label,tooltip:i.detail.tooltip},null,8,["format","label","tooltip"])):i.detail.type==="userText"?(g(),T("span",MW,[E("span",EW,[ht(_(i.detail.text)+" ",1),I(Yl,{user:i.detail.user,type:"icon","user-name-field":"nickName"},null,8,["user"])])])):i.detail.type==="bullet"?(g(),T("ul",PW,[(g(!0),T(le,null,_e(i.detail.value,(o,s)=>(g(),T("li",{key:s,class:"flex items-center gap-1 before:content-['•'] before:mr-1 before:ml-1"},[ht(_(typeof o=="object"?o.text:o)+" ",1),typeof o=="object"?(g(),L(Yl,{key:0,user:o.user,type:"icon","user-name-field":"nickName"},null,8,["user"])):N("",!0)]))),128))])):i.detail.type==="json"?(g(),L(TW,{key:4,"model-value":i.detail.value,"editor-state":"readonly"},null,8,["model-value"])):i.detail.type==="taskUrl"?(g(),T("span",IW,[E("a",{class:pe(["w-full truncate hover:underline text-[#0000EE]"]),href:i.detail.url,style:{"scrollbar-width":"none"},target:"_blank",title:"Buka Link di Tab Baru"},_(i.detail.url),9,LW)])):i.detail.type=="embed"?(g(),T("div",DW,[I(tw,{code:i.detail.code,readonly:""},null,8,["code"])])):(g(),T("div",RW,[i.detail.type==="image"?(g(),L(Ar,{key:0,src:i.detail.filePath,class:"!w-6 !h-6 shrink-0"},null,8,["src"])):i.detail.type==="link"?(g(),L(Me,{key:1,class:"shrink-0 w-6 h-6",icon:"link"})):["pdf","csv","doc","xls","data"].includes(i.detail.type)?(g(),T("img",{key:2,alt:i.detail.type,src:e(i.detail.type),class:"shrink-0 w-6 h-6"},null,8,NW)):N("",!0),i.detail.type==="link"?(g(),T("a",{key:3,class:pe(["w-full truncate hover:underline"]),href:i.detail.url,style:{"scrollbar-width":"none"},target:"_blank",title:"Buka Link di Tab Baru"},_(i.detail.url),9,BW)):i.detail.type!=="video"?(g(),T(le,{key:4},[ht(_(n(i.detail)),1)],64)):N("",!0)]))}}),$W=["onClick"],VW={class:"flex justify-between items-center"},zW={class:"flex gap-1 py-0.5","data-wv-section":"itemheader"},FW=["innerHTML","onClick"],jW={key:1,class:"flex flex-col gap-1","data-wv-section":"itemdetail"},HW={key:0,class:"grid grid-cols-[max-content,max-content,auto] gap-2 py-1.5 items-start"},UW={class:"font-semibold whitespace-nowrap"},KW={key:0,class:"text-xs"},WW={key:0,class:"grid grid-cols-[max-content,max-content,auto] gap-1 items-start"},qW={key:1,class:"grid grid-rows-[max-content,auto] gap-1"},XW={class:"font-semibold whitespace-nowrap"},_g=ce("Timeline",ye({__name:"Timeline",props:{value:{},alignDetail:{type:Boolean},noScroll:{type:Boolean},noFormatDate:{type:Boolean}},setup(t){const e=dt("preset",{}).timeline,n=r=>{const o=r.user??r.username;return typeof o!="string"?o:{nickName:o}},i=r=>r.replace(/`([^`]*)`/g,"<b>$1</b>");return(r,o)=>(g(),L(x(H2),{class:pe([{"overflow-auto":!r.noScroll}]),value:re(r.value).value,style:{"scrollbar-width":"none"}},{marker:z(({item:s})=>{var a,l,u;return[E("div",O({onClick:c=>s.showDetail=!s.showDetail},(a=x(e))==null?void 0:a.marker,{"data-wv-section":"timelinemarker"}),[I(Me,O((l=x(e))==null?void 0:l.markerArrow(s),{icon:"arrow-down"}),null,16),E("div",it(Ot((u=x(e))==null?void 0:u.markerDot(s))),null,16)],16,$W)]}),content:z(({item:s})=>{var a,l,u;return[E("div",VW,[E("div",zW,[E("h3",O({innerHTML:i(s.action)},(a=x(e))==null?void 0:a.contentHeader,{onClick:c=>s.showDetail=!s.showDetail}),null,16,FW),s.user||s.username?(g(),L(Yl,{key:0,user:n(s),type:"icon","user-name-field":"nickName"},null,8,["user"])):N("",!0)]),E("span",it(Ot((l=x(e))==null?void 0:l.contentDate)),_(r.noFormatDate?s.createdAt:x(L4)(s.createdAt)),17)]),s.showDetail&&s.detail?(g(),T(le,{key:0},["type"in s.detail?(g(),L(pf,{key:0,detail:s.detail},null,8,["detail"])):(u=Object.keys(s.detail??{}))!=null&&u.length?(g(),T("div",jW,[r.$props.alignDetail?(g(),T("div",HW,[(g(!0),T(le,null,_e(Object.entries(s.detail),([c,d])=>(g(),T(le,{key:c},[E("span",UW,_(c),1),o[0]||(o[0]=E("span",{class:"font-semibold whitespace-nowrap"}," : ",-1)),typeof d=="string"?(g(),T("span",KW,_(d),1)):"type"in d?(g(),L(pf,{key:1,detail:d},null,8,["detail"])):N("",!0)],64))),128))])):(g(!0),T(le,{key:1},_e(Object.entries(s.detail),([c,d])=>ee(r.$slots,"detail",O({key:c,ref_for:!0},{key:c,value:d}),()=>{var f,p;return[typeof d=="string"?(g(),T("div",WW,[E("span",O({ref_for:!0},(f=x(e))==null?void 0:f.contentDetailKey),_(c)+": ",17),E("span",O({ref_for:!0},(p=x(e))==null?void 0:p.contentDetailValue),_(d),17)])):"type"in d?(g(),T("div",qW,[E("span",{class:pe(["flex gap-1",{"flex-col":d.type==="embed"}])},[E("span",XW,_(c)+": ",1),d.type!=="json"?(g(),L(pf,{key:0,detail:d},null,8,["detail"])):N("",!0)],2),d.type==="json"?(g(),L(pf,{key:0,detail:d},null,8,["detail"])):N("",!0)])):N("",!0)]})),128))])):N("",!0)],64)):N("",!0)]}),_:3},8,["class","value"]))}})),GW={class:"flex justify-between gap-[18px] dark:text-general-100"},ZW={class:"w-full flex flex-col gap-[6px]"},_W={class:"flex justify-between"},JW={class:""},YW={class:"text-[16px] font-bold leading-[19.12px]"},QW={class:"flex items-center gap-[6px]"},eq={class:"text-general-400 leading-[16.39px]"},tq=["href"],nq={class:"flex flex-col gap-1"},iq={key:0,class:"flex gap-3"},rq={key:1,class:"flex gap-3"},oq={key:2,class:"flex gap-3"},sq={key:3,class:"flex gap-3"},$u=ce("AssetInfo",ye({__name:"AssetInfo",props:{id:{},fields:{},transactionDetail:{},useNfc:{type:Boolean,default:!0},useTagType:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=t;bt(async()=>{n.transactionDetail?s.value=n.transactionDetail:await p()});const i=sr(),{setLoading:r}=Fi(),o=JSON.parse(localStorage.getItem("user")??"{}"),s=oe(),a=W(()=>{var h;return(h=n.fields)==null?void 0:h.includes("status")}),l=W(()=>{const{setDefault:h,firstImageBig:m,secondImageBig:v,assetImageBig:S,assetImage:b,firstImage:k,secondImage:A}=s.value??{},w=h==="firstImage";return n.transactionDetail?b??S:w?k??m:A??v}),u=W(()=>{var h,m,v,S,b,k,A,w,y,C;return n.transactionDetail?(v=(m=(h=s.value)==null?void 0:h.assetName)==null?void 0:m.aliasCode)!=null&&v.length?`(${(b=(S=s.value)==null?void 0:S.assetName)==null?void 0:b.aliasCode})`:"":(w=(A=(k=s.value)==null?void 0:k.name)==null?void 0:A.aliasCode)!=null&&w.length?`(${(C=(y=s.value)==null?void 0:y.name)==null?void 0:C.aliasCode})`:""}),c=W(()=>{var h,m;return((h=s.value)==null?void 0:h.assetTagType)??((m=s.value)==null?void 0:m.tagType)}),d=W(()=>{var h,m;return((h=s.value)==null?void 0:h.assetName)??((m=s.value)==null?void 0:m.name)}),f=W(()=>[{"w-[69px]":!a.value,"w-[76px]":a.value}]),p=async()=>{try{r(!0);const{data:h}=await uo.getAssetDetail(n.id);h&&(s.value=h.data)}catch(h){i.add({error:h,message:"Error, failed to load asset details."})}finally{r(!1)}};return Re(()=>n.transactionDetail,h=>{s.value=h},{deep:!0}),e({asset:s}),(h,m)=>{var v,S,b,k,A,w,y,C,P,R,M,D,$,q,J,ve,ae,me,se,Ie,Be,xe;return g(),T("div",GW,[I(Ar,{src:l.value},null,8,["src"]),E("div",ZW,[E("div",_W,[E("div",JW,[E("div",YW,_(((v=d.value)==null?void 0:v.nameWithSequence)??"-"),1),E("div",QW,[E("span",eq,_(((S=s.value)==null?void 0:S.assetId)??"-")+" "+_(u.value),1),h.useTagType?(g(),T(le,{key:0},[m[0]||(m[0]=E("div",{class:"w-[6px] h-[6px] rounded-full bg-general-100"},null,-1)),I(F2,{type:c.value,"use-nfc":h.useNfc},null,8,["type","use-nfc"])],64)):N("",!0)])]),x(o).userType!=="Basic"?(g(),T("a",{key:0,href:`/assets/detail/${((b=s.value)==null?void 0:b.asset)??((k=s.value)==null?void 0:k._id)}`,class:"text-primary-500",target:"_blank"}," Asset Detail > ",8,tq)):N("",!0)]),E("div",nq,[!n.fields||(A=n.fields)!=null&&A.includes("brand")?(g(),T("div",iq,[E("span",{class:pe(f.value)}," Brand ",2),m[1]||(m[1]=E("span",null,":",-1)),I(Lt,{label:((y=(w=s.value)==null?void 0:w.assetBrand)==null?void 0:y.name)??((P=(C=s.value)==null?void 0:C.brand)==null?void 0:P.name)??"-",severity:"dark"},null,8,["label"])])):N("",!0),!n.fields||(R=n.fields)!=null&&R.includes("model")?(g(),T("div",rq,[E("span",{class:pe(f.value)}," Model/Type ",2),m[2]||(m[2]=E("span",null,":",-1)),I(Lt,{label:((D=(M=s.value)==null?void 0:M.assetModel)==null?void 0:D.name)??((q=($=s.value)==null?void 0:$.model)==null?void 0:q.name)??"-",severity:"dark"},null,8,["label"])])):N("",!0),!n.fields||(J=n.fields)!=null&&J.includes("group")?(g(),T("div",oq,[E("span",{class:pe(f.value)}," Group ",2),m[3]||(m[3]=E("span",null,":",-1)),I(Lt,{label:((ae=(ve=s.value)==null?void 0:ve.assetGroup)==null?void 0:ae.name)??((se=(me=s.value)==null?void 0:me.group)==null?void 0:se.name)??"-"},null,8,["label"])])):N("",!0),(Ie=n.fields)!=null&&Ie.includes("status")?(g(),T("div",sq,[E("span",{class:pe(f.value)}," Asset Status ",2),m[4]||(m[4]=E("span",null,":",-1)),I(Lt,{label:((Be=s.value)==null?void 0:Be.status)??"-",severity:x(Iy)((xe=s.value)==null?void 0:xe.status),format:"nowrap"},null,8,["label","severity"])])):N("",!0)])])])}}})),$ie=ce("ButtonAddByScan",ye({__name:"ButtonAddByScan",props:{modelValue:{},reportedDisposalAssets:{type:Boolean},noDisposalAssets:{type:Boolean},queryParams:{}},emits:["update:modelValue","scan"],setup(t,{emit:e}){const n=sr(),{setLoading:i}=Fi(),r=t,o=e,s=async c=>{var d,f,p,h;try{i(!0);const m={...r.queryParams,tag:c.code,page:1,limit:1},{data:v}=await uo.getAvailableAssets(m);if((f=(d=v==null?void 0:v.data)==null?void 0:d.data)!=null&&f.length){const S=(p=v==null?void 0:v.data)==null?void 0:p.data[0];if((h=r.modelValue)==null?void 0:h.some(k=>k._id===S._id))n.add({severity:"error",message:"Error, this asset already exists in the list.",group:"add-by-scan-error"});else{const k=[S,...r.modelValue];o("update:modelValue",k),o("scan",{...c,asset:S})}}else n.add({severity:"error",message:"Error, this asset is not available",group:"add-by-scan-error"})}catch(m){n.add({error:m,message:"Error, failed to scan asset.",group:"add-by-scan-error"})}finally{i(!1)}},a=async c=>{var d,f,p,h;try{i(!0);const m={...r.queryParams,tag:c.code,excludeId:(d=r.modelValue)!=null&&d.length?JSON.stringify(r.modelValue.map(S=>S._id)):void 0,page:1,limit:1},{data:v}=await uo.getAllAssets(m);if((p=(f=v==null?void 0:v.data)==null?void 0:f.data)!=null&&p.length){const S=(h=v==null?void 0:v.data)==null?void 0:h.data[0];if(["On Disposal Process","Reported Disposal"].includes(S.status)){n.add({severity:"error",message:"Error, cannot add asset that is in the disposal process.",group:"add-by-scan-error"});return}const k=[S,...r.modelValue];o("update:modelValue",k),o("scan",{...c,asset:S})}else n.add({severity:"error",message:"Error, asset not found.",group:"add-by-scan-error"})}catch(m){n.add({error:m,message:"Error, failed to scan asset.",group:"add-by-scan-error"})}finally{i(!1)}},l=async c=>{var d,f,p,h;try{i(!0);const m={...r.queryParams,tag:c.code,excludeId:(d=r.modelValue)!=null&&d.length?JSON.stringify(r.modelValue.map(S=>S.asset)):void 0,page:1,limit:1},{data:v}=await Tf.getReportedDisposal(m);if((p=(f=v==null?void 0:v.data)==null?void 0:f.data)!=null&&p.length){const S=(h=v==null?void 0:v.data)==null?void 0:h.data[0],b=[S,...r.modelValue];o("update:modelValue",b),o("scan",{...c,asset:S})}else n.add({severity:"error",message:`Error, this asset is not on Reported Disposal - ${r.queryParams.reason} list.`,group:"add-by-scan-error"})}catch(m){n.add({error:m,message:"Error, failed to scan asset.",group:"add-by-scan-error"})}finally{i(!1)}},u=async c=>{r.reportedDisposalAssets?await l(c):r.noDisposalAssets?await a(c):await s(c)};return(c,d)=>(g(),T(le,null,[I(aa,{"base-z-index":9997,class:"!absolute !bottom-[80px] !h-max",group:"add-by-scan-error"}),I(TP,{onScan:u,bulk:"",label:"Add By Scan"})],64))}})),aq=()=>re([{field:"profilePictureSmall",header:"Photo",sortable:!0,bodyComponent(t){return{component:Ar,props:{src:xf(t.profilePictureBig),size:"small"}}}},{field:"fullName",header:"Name",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.fullName)??(t==null?void 0:t.name)}},{field:"employeeId",header:"Empolyee ID",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.employeeId)??"-"}},{field:"email",header:"Email",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.email)??"-"}},{field:"phoneNumber",header:"Phone",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.phoneNumber)??"-"}},{field:"position",header:"Position",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.position)??"-"}},{field:"division",header:"Division",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.division)??"-"}}]),oC=t=>{if(Array.isArray(t)){const[e,n]=t;return[new Date(e).setHours(0,0,0),new Date(n??e).setHours(23,59,59)]}},lq=(t,e,n)=>{const i=Object.keys(t),r={};Ye.emit("multi-select:hide-overlay"),i.forEach(o=>{var u;const s=Array.isArray(t[o]),a=typeof t[o]=="string",l=s?(u=t[o])==null?void 0:u.filter(c=>c!=null):t[o];if((l!=null&&!s||s&&l.length)&&!a){if(Array.isArray(l)&&l.every(d=>typeof d=="number"&&d>9466848e5&&!isNaN(new Date(d).getTime()))){r[o]=JSON.stringify(oC(l));return}r[o]=l!=null&&l.length?JSON.stringify(t[o]):JSON.stringify(l)}else r[o]=t[o]}),Ye.emit("data-table:apply-filter",{tableName:e,filter:r}),Ye.emit("data-table:clear-selected-data",{tableName:e}),n==null||n("apply",r)},uq=(t,e,n,i)=>{const r={};Ye.emit("multi-select:hide-overlay"),n.forEach(o=>{if("field"in o){const s=Hn(t,o.field);"value"in s&&s.value!=null&&(r[o.field]=s,"matchMode"in s&&s.matchMode=="DATE_BETWEEN"&&(r[o.field].value=oC(s.value)),Array.isArray(s.value)&&!s.value.filter(Boolean).length&&delete r[o.field])}}),Ye.emit("data-table:apply-filter",{tableName:e,filter:r}),Ye.emit("data-table:clear-selected-data",{tableName:e}),i==null||i("apply",r)},cq={class:"flex items-end justify-end gap-2","data-wv-section":"filteractionbuttons"},dq=ye({inheritAttrs:!1,__name:"FilterContainer",props:{tableName:{default:"datatable"},fieldsPerRow:{default:4},fields:{},static:{type:Boolean}},emits:["apply"],setup(t,{emit:e}){const n=t,i=e,{locale:r}=_t("FilterContainer"),{resetForm:o,handleSubmit:s,setValues:a}=Tp(),l=re({}),u=re({}),c=oe(),d=re(null),f=oe(!1),p=oe(0);bt(()=>{k(),Ye.on("show-filter",m),Ye.on("data-table:updated",v),P()}),Vi(()=>{Ye.off("show-filter",m),Ye.off("data-table:updated",v)});const h=n.fields.filter(M=>M.visible!==!1),m=M=>{M.tableName===n.tableName&&(f.value=M.show)},v=M=>{M.tableName===n.tableName&&(c.value=M.data)},S=async(M,D,$={})=>{if(n.static&&!M)u.value[D]=b(D);else try{l.value[D]=!0;const q={[D]:!0,...$},J=await(M==null?void 0:M(q));if("data"in J){const{data:ve}=J;u.value[D]=ve.data[D]}else Array.isArray(J)&&(u.value[D]=J)}catch(q){console.error(q)}finally{l.value[D]=!1}},b=M=>{const D=new Set;if(c.value)for(let $=0;$<c.value.length;$++){const q=Hn(c.value[$],M);D.add(q)}return Array.from(D).map($=>({label:$,value:$}))},k=()=>{if(d.value){const{children:M}=d.value,D=d.value.childElementCount,$=D%n.fieldsPerRow;let[q,J]=[1,1];for(const ve in Array.from({length:D})){const ae=Number(ve)===D-1;M[ve].setAttribute("style",`grid-area: ${q}/${ae&&$?n.fieldsPerRow:J}`),++J>n.fieldsPerRow&&(J=1,q++)}}},A=()=>{o(),p.value++},w=s(M=>{n.static?uq(M,n.tableName,h,i):lq(M,n.tableName,i)}),y=(M,D)=>{var $;switch(M.type){case"rangenumber":return M.field?`${M.field}.matchMode`:`${($=M.fields)==null?void 0:$[D]}.matchMode`;case"multiselect":case"dropdown":case"calendar":case"category":case"group":return`${M.field}.matchMode`}},C=M=>(()=>{switch(M.type){case"rangenumber":return"BETWEEN";case"multiselect":case"category":case"group":return"IN";case"dropdown":return"EQUALS";case"calendar":return"DATE_BETWEEN"}})(),P=()=>{if(n.static){const M={};h.forEach(D=>{ea(M,y(D),C(D))}),a(M)}},R=(M,D)=>{switch(M.type){case"rangenumber":return M.field?n.static?`${M.field}.value.${D}`:`${M.field}.${D}`:n.static?`${M.fields[D]}.value`:M.fields[D];case"multiselect":case"dropdown":case"calendar":case"category":case"group":return n.static?`${M.field}.value`:`${M.field}`}};return Re(()=>n.fields,k),(M,D)=>ft((g(),T("form",O({ref_key:"container",ref:d},M.$preset.filtercontainer.root,{style:`grid-template-columns: repeat(${M.fieldsPerRow}, 1fr)`,onSubmit:D[0]||(D[0]=xt((...$)=>x(w)&&x(w)(...$),["prevent"])),"data-wv-name":"filtercontainer"}),[(g(!0),T(le,null,_e(x(h),$=>(g(),T(le,{key:JSON.stringify($)+p.value},[$.type=="rangenumber"?(g(),L(_N,O({key:0,ref_for:!0},$,{mandatory:!1,"max-field-name":R($,1),"min-field-name":R($,0),"show-optional-text":!1,"use-validator":""}),null,16,["max-field-name","min-field-name"])):$.type=="multiselect"?(g(),L(LB,O({key:1,ref_for:!0},$,{"field-name":R($),loading:l.value[$.optionField??$.field],mandatory:!1,options:u.value[$.optionField??$.field],"show-optional-text":!1,onShow:q=>S($.fetchOptionFn,$.optionField??$.field,$.params),"option-label":"label","option-value":"value","use-validator":""}),null,16,["field-name","loading","options","onShow"])):$.type=="dropdown"?(g(),L(xl,O({key:2,ref_for:!0},$,{"field-name":R($),loading:l.value[$.field],mandatory:!1,options:u.value[$.optionField??$.field],"show-optional-text":!1,onShow:q=>S($.fetchOptionFn,$.optionField??$.field,$.params),"option-label":"label","option-value":"value","use-validator":""}),null,16,["field-name","loading","options","onShow"])):$.type==="calendar"?(g(),L(CI,O({key:3,ref_for:!0},$,{"field-name":R($),mandatory:!1,"show-optional-text":!1,"selection-mode":"range","use-validator":""}),null,16,["field-name"])):ee(M.$slots,"field",{key:4,field:$,fieldName:R($)})],64))),128)),E("div",cq,[I(We,{label:x(r).clearFieldText,onClick:A,"data-wv-section":"clearbutton",text:""},null,8,["label"]),I(We,{label:x(r).applyText,onClick:x(w),"data-wv-section":"applybutton",severity:"success"},null,8,["label","onClick"])])],16)),[[Zn,f.value]])}}),Jg=ce("FilterContainer",ye({__name:"FilterContainer",setup(t){return(e,n)=>(g(),L(dq,O({fields:e.$attrs.fields},e.$attrs),{field:z(({field:i,fieldName:r})=>[I(FP,O(i,{"field-data-key":i.fieldDataKey??"key","field-label":i.label,"field-name":r,label:i.buttonLabel,mandatory:!1,params:i.params,"show-optional-text":!1,"use-validator":""}),null,16,["field-data-key","field-label","field-name","label","params"])]),_:1},16,["fields"]))}})),fq=ye({__name:"DialogSelectUserFilter",props:{tableName:{},filterOptions:{}},setup(t){const e=t,n=W(()=>[{type:"multiselect",field:"position",label:"Position",placeholder:"Select position",fetchOptionFn:()=>{var i;return(i=e.filterOptions)==null?void 0:i.positionOptions}},{type:"multiselect",field:"division",label:"Division",placeholder:"Select division",fetchOptionFn:()=>{var i;return(i=e.filterOptions)==null?void 0:i.divisionOptions}}]);return(i,r)=>(g(),L(Jg,{fields:n.value,"table-name":i.tableName},null,8,["fields","table-name"]))}}),pq={class:"flex flex-col gap-2"},hq={key:0,class:"overflow-auto max-h-20 list-inside list-disc h-auto ml-2"},mq={class:"flex justify-between items-center gap-1","data-ts-section":"dialog-asset-name-detail-action-group"},gq={class:""},vq={class:"flex justify-end items-center gap-1"},yq={class:"flex flex-col justify-end gap-1"},bq={key:0,class:"text-danger-500 text-[12px] font-light","data-ts-section":"warning-message"},Aq=ce("DialogSelectUser",ye({__name:"DialogSelectUser",props:{header:{default:"Select User"},description:{default:"Select user"},selectionType:{},visible:{type:Boolean},list:{},selectButtonLabel:{default:"Select"},fetchFunction:{},fetchOptionFunction:{}},emits:["update:visible","selected"],setup(t,{emit:e}){const n=t,i=e,r=W(()=>n.visible),o=re(!1),s=re(),a=re([]),l=re(),u=aq(),c=()=>{!a.value.length&&!l.value?o.value=!0:(n.selectionType==="checkbox"?i("selected",a.value):i("selected",l.value),i("update:visible",!1))},d=()=>{a.value=[],l.value=void 0,o.value=!1},f=async p=>{if(n.fetchFunction)return await n.fetchFunction(p)};return Re(r,async p=>{d(),p&&n.fetchOptionFunction&&(s.value=await n.fetchOptionFunction())},{immediate:!0}),(p,h)=>(g(),L(ur,{visible:r.value,"onUpdate:visible":[h[3]||(h[3]=m=>r.value=m),h[4]||(h[4]=m=>i("update:visible",!!m))],draggable:!1,header:n.header,class:"w-[800px]",closable:"","data-ts-name":"dialog-asset-name-detail",modal:""},{footer:z(()=>[ee(p.$slots,"footer",{},()=>[E("div",yq,[o.value?(g(),T("span",bq," You must pick a user ")):N("",!0),E("div",null,[I(We,{onClick:h[2]||(h[2]=m=>p.$emit("update:visible",!1)),label:"Cancel",severity:"dark",text:""}),I(We,{label:n.selectButtonLabel,onClick:c,"data-ts-section":"select-button",severity:"success"},null,8,["label"])])])])]),default:z(()=>[E("div",pq,[n.list&&n.list.length?(g(),T("ul",hq,[(g(!0),T(le,null,_e(n.list,(m,v)=>(g(),T("li",{key:v},_(m),1))),128))])):N("",!0),E("div",mq,[E("div",gq,_(p.description),1),E("div",vq,[I(ih,{"table-name":"dialog-select-user-table"}),I(eh,{"table-name":"dialog-select-user-table"})])]),I(fq,{"filter-options":s.value,"table-name":"dialog-select-user-table"},null,8,["filter-options"]),I(Ph,{"selected-data":a.value,"onUpdate:selectedData":h[0]||(h[0]=m=>a.value=m),columns:x(u),"fetch-function":f,rows:10,"selection-type":n.selectionType,"use-option":!1,onRowSelect:h[1]||(h[1]=m=>{o.value=!1,l.value=l.value?void 0:m.data}),"data-key":"_id","disable-key":"",lazy:"","table-name":"dialog-select-user-table","use-paginator":""},null,8,["selected-data","columns","selection-type"])])]),_:3},8,["visible","header"]))}})),wq={key:0,class:"flex gap-1 items-center"},Sq={class:"text-primary-500 text-xs font-medium"},Vie=ce("ButtonSelectUser",ye({__name:"ButtonSelectUser",props:{fetchFunction:{type:Function},fetchOptionFunction:{type:Function},modelValue:{},list:{},header:{},description:{},useBadge:{type:Boolean},confirmBeforeReselect:{type:Boolean},confirmHeader:{},confirmBody:{}},emits:["update:modelValue","confirm"],setup(t,{emit:e}){const n=t,i=e,r=W(()=>n.modelValue??void 0),o=re(!1),s=re(!1),a=async d=>{if(n.fetchFunction)return await n.fetchFunction(d)},l=async()=>{if(n.fetchOptionFunction)return await n.fetchOptionFunction()},u=()=>{n.confirmBeforeReselect?s.value=!0:o.value=!0},c=()=>{i("confirm"),o.value=!0};return(d,f)=>{var p,h,m;return g(),T(le,null,[r.value?(g(),T("div",wq,[n.useBadge?(g(),L(Lt,{key:0,label:((p=r.value)==null?void 0:p.fullName)??((h=r.value)==null?void 0:h.name),format:"username"},null,8,["label"])):(g(),T(le,{key:1},[I(Me,{class:"!text-general-200",icon:"user"}),E("span",Sq,_(r.value.fullName??((m=r.value)==null?void 0:m.name)),1)],64)),I(We,{onClick:u,class:"p-0 m-0 !min-w-0 !min-h-0 !h-max !w-max",text:""},{default:z(()=>[I(Me,{icon:"pencil",severity:"primary"})]),_:1})])):(g(),L(We,{key:1,onClick:f[0]||(f[0]=v=>o.value=!0),label:"Select User"})),I(Aq,{visible:o.value,"onUpdate:visible":f[1]||(f[1]=v=>o.value=v),description:n.description,"fetch-function":a,"fetch-option-function":l,header:n.header,list:n.list,onSelected:f[2]||(f[2]=v=>d.$emit("update:modelValue",v)),"selection-type":"single"},null,8,["visible","description","header","list"]),I(cr,{visible:s.value,"onUpdate:visible":f[3]||(f[3]=v=>s.value=v),header:n.confirmHeader??"-",onConfirm:c,"confirm-label":"Continue",severity:"danger"},{body:z(()=>[E("p",null,_(n.confirmBody),1),f[4]||(f[4]=E("p",null,"Are you sure you want to continue?",-1))]),_:1},8,["visible","header"])],64)}}})),zie=ce("ButtonViewLog",ye({__name:"ButtonViewLog",props:{showLog:{type:Boolean}},emits:["update:showLog"],setup(t){return(e,n)=>(g(),L(We,{outlined:!e.$props.showLog,onClick:n[0]||(n[0]=i=>e.$emit("update:showLog",!e.$props.showLog)),icon:"file-lines",severity:"secondary",tooltip:"Changelog"},null,8,["outlined"]))}})),Cq={class:"flex flex-col gap-3 justify-between"},kq={class:"flex flex-col max-h-20 overflow-y-auto"},Oq={class:"text-general-800 font-medium","data-ts-section":"assetparent"},Tq={class:"flex flex-col max-h-20","data-ts-section":"linked-asset-family"},xq={key:3,class:"text-general-800 font-medium","data-ts-section":"confirmbody"},Fie=ce("DialogLinkedAsset",ye({__name:"DialogLinkedAsset",props:{header:{},list:{},lists:{},label:{},confirmBody:{},headerIcon:{},type:{default:"confirmation"},severity:{},confirmButtonSeverity:{},visible:{type:Boolean},closeAfterConfirm:{type:Boolean,default:!0},closeLabel:{},actionable:{type:Boolean,default:!0},confirmLabel:{},disableConfirmButton:{type:Boolean},listLabel:{},message:{},showIcon:{type:Boolean},showCloseButton:{type:Boolean},contentClass:{}},emits:["confirm","update:visible"],setup(t){var c;const e=sr(),n=t,i=W(()=>n.confirmLabel?n.confirmLabel:n.severity==="danger"?"Remove":"Submit"),r=W(()=>n.confirmBody?n.confirmBody:n.severity==="success"?"All related data will be transacted. Are you sure want to submit?":"All related data will be removed from the list. Are you want to remove it?"),o=W(()=>!!n.headerIcon||n.severity==="danger"),s=re(!1),a=re([]),l=re(!!((c=n.list)!=null&&c.length));Re(()=>n.list,()=>{l.value=!0});const u=async()=>{var d;try{if(!l.value)return;s.value=!0;const f=[],p=m=>m.family.length>1,h=({parent:m,children:v,family:S},b)=>{const k=y=>y.map(C=>({_id:C._id,name:C.name})),{_id:A,name:w}=m??b;return{parent:{_id:A,name:w},children:v.length?k(v):k(S.filter(y=>y._id!==A))}};if((d=n.list)!=null&&d.length){const{data:m}=await uo.getLinkedAssetFamily(JSON.stringify(n.list.map(v=>v._id)));m.data&&m.data.forEach(v=>{const S=v.family.find(b=>b._id===v._id);if(p(v)&&S){const b=h(v,S);f.some(A=>A.parent._id===b.parent._id)||f.push(b)}})}a.value=f}catch(f){e.removeGroup("linkedasset"),e.add({error:f,message:"Error, failed to fetch linked assets.",group:"linkedasset"})}finally{s.value=!1,l.value=!1}};return(d,f)=>(g(),L(cr,O(d.$props,{"confirm-label":i.value,list:void 0,"show-icon":o.value,onConfirm:f[1]||(f[1]=p=>d.$emit("confirm",a.value)),onShow:u,"onUpdate:visible":f[2]||(f[2]=p=>d.$emit("update:visible",p)),"data-ts-name":"dialoglinkedasset"}),Dn({body:z(()=>[E("div",Cq,[d.type==="confirmation"?(g(),T(le,{key:0},[E("ul",kq,[(g(!0),T(le,null,_e(d.list,p=>(g(),T("li",{key:p._id,class:"text-general-800 font-medium","data-ts-section":"assetlistitem"},_(p.name.nameWithSequence),1))),128))]),f[3]||(f[3]=E("p",{class:"text-general-800 font-medium"}," The following assets have other assets linked to them: ",-1))],64)):N("",!0),s.value?(g(),L(Me,{key:1,class:"animate-spin h-6 w-6 self-center cursor-default !text-general-200 py-4",icon:"loader-4"})):(g(!0),T(le,{key:2},_e(a.value,p=>(g(),T("div",{key:p.parent._id,class:"flex flex-col gap-0.5"},[E("span",Oq,_(p.parent.name.nameWithSequence)+": ",1),E("ul",Tq,[(g(!0),T(le,null,_e(p.children,h=>(g(),T("li",{key:h._id,class:"text-general-800 font-medium","data-ts-section":"assetchild"},_(h.name.nameWithSequence),1))),128))])]))),128)),d.type==="confirmation"?(g(),T("p",xq,_(r.value),1)):N("",!0)]),I(aa,{group:"linkedasset"})]),_:2},[n.type==="detail"?{name:"footer",fn:z(()=>[I(We,{onClick:f[0]||(f[0]=p=>d.$emit("update:visible",!1)),"data-ts-section":"closebutton",label:"Close",outlined:""})]),key:"0"}:void 0]),1040,["confirm-label","show-icon"]))}})),sC=ce("UserWithIcon",ye({__name:"UserWithIcon",props:{user:{}},setup(t){return(e,n)=>(g(),L(Yl,{user:e.user,type:"icon","user-name-field":"fullName"},null,8,["user"]))}})),Mq={class:"w-full"},jie=ce("InputSearch",ye({__name:"InputSearch",emits:["search"],setup(t,{emit:e}){const n=e,i=oe(),r=oe(),o=s=>{i.value=s.target.value||void 0,r.value=s.target.value||void 0};return(s,a)=>{var l,u;return g(),T("form",{class:pe(["text-xs flex gap-1 h-[34px] px-[21px] items-center","rounded-[18px] bg-general-50"]),onSubmit:a[1]||(a[1]=xt(c=>n("search",i.value),["prevent"]))},[E("div",Mq,[I(x(Xr),{class:pe(["h-auto !shadow-none !p-0 !text-general-500 placeholder:text-general-200 !bg-general-50"]),"model-value":r.value,onInput:o,autocomplete:"off",placeholder:"Search asset"},null,8,["model-value"])]),I(Me,{class:pe(["text-md !text-general-400 !w-4 !h-4",{hidden:(l=r.value)==null?void 0:l.length}]),icon:"search"},null,8,["class"]),I(Me,{class:pe(["text-md !text-general-400 !w-4 !h-4",{hidden:!((u=r.value)!=null&&u.length)}]),onClick:a[0]||(a[0]=c=>r.value=void 0),"data-ts-section":"reset-filter-icon",icon:"close"},null,8,["class"])],32)}}})),Eq={class:"flex gap-1 items-center text-placeholder","data-section-name":"transaction-role-lists"},Hie=ce("TransactionRoles",ye({__name:"TransactionRoles",props:{asset:{},user:{},type:{default:"transaction"}},setup(t){const e=t,n=W(()=>e.user?"user":"asset"),i=W(()=>{const m=e.user??e.asset;if(!m)return[];const S=JSON.parse(localStorage.user??"{}").addOn,b=[{label:"Borrowing",icon:"borrow",info:h(m,"borrowing"),severity:p(m,"borrowing")},{label:"Assignment",icon:"assignment",info:h(m,"assignment"),severity:p(m,"assignment")},{label:"Transfer",icon:"exchange",info:h(m,"transfer"),severity:p(m,"transfer")},{label:"Disposal",icon:"disposal",info:h(m,"disposal"),severity:p(m,"disposal")}];if(e.type==="transaction-policy")return b;const k=n.value==="asset"?[{label:"Asset Control",icon:"gate",info:h(m,"assetControl"),severity:p(m,"assetControl"),visible:S.assetControl}]:[],A=[{label:"Audit",icon:"audit",info:h(m,"audit"),severity:p(m,"audit"),visible:S.audit},...k,{label:"Maintenance",icon:"file-settings",info:h(m,"maintenance"),severity:p(m,"maintenance"),visible:S.maintenance},{label:"Repair Ticketing",icon:"repair-ticketing",info:h(m,"repairTicketing"),severity:p(m,"repairTicketing"),visible:S.repairTicketing},{label:"Tracking",icon:"tracking",info:h(m,"tracking"),severity:p(m,"tracking"),visible:S.tracking}].filter(w=>w.visible);return[...e.type==="transaction"?b:[],...A]}),r=(m,v)=>e.type==="transaction-policy"?m?s(v):a(v):m?n.value==="user"?o(v):l(v):n.value==="user"?u(v):c(v),o=m=>{switch(m){case"borrowing":return"This user has borrowing role";case"assignment":return"This user has assignment role";case"disposal":return"This user has disposal role";case"audit":return"This user has audit role";case"repairTicketing":return"This user has repair ticketing role";case"transfer":return"This user has transfer role";case"maintenance":return"This user has maintenance routine role";case"tracking":return"This user has tracking role";default:return"This user doesn't have role"}},s=m=>{switch(m){case"borrowing":return"This asset can be borrowed";case"assignment":return"This asset can be assigned";case"disposal":return"This asset can be disposed";case"transfer":return"This asset can be transferred";default:return"This asset can be transacted"}},a=m=>{switch(m){case"borrowing":return"This asset cannot be borrowed";case"assignment":return"This asset cannot be assigned";case"disposal":return"This asset cannot be disposed";case"transfer":return"This asset cannot be transferred";default:return"This asset cannot be transacted"}},l=m=>{switch(m){case"borrowing":case"assignment":case"disposal":case"transfer":return s(m);case"audit":return"This asset has Audit Addon";case"assetControl":return"This asset has Asset Control Addon";case"maintenance":return"This asset has Maintenance Routine Addon";case"repairTicketing":return"This asset has Repair Ticketing Addon";case"tracking":return"This asset has Tracking Addon"}},u=m=>{switch(m){case"borrowing":return"This user doesn't have borrowing role";case"assignment":return"This user doesn't have assignment role";case"disposal":return"This user doesn't have disposal role";case"audit":return"This user doesn't have audit role";case"repairTicketing":return"This user doesn't have repair ticketing role";case"transfer":return"This user doesn't have transfer role";case"maintenance":return"This user doesn't have maintenance routine role";case"tracking":return"This user doesn't have tracking role";default:return"This user doesn't have role"}},c=m=>{switch(m){case"borrowing":case"assignment":case"disposal":case"transfer":return a(m);case"audit":return"This asset doesn't have Audit Addon";case"assetControl":return"This asset doesn't have Asset Control Addon";case"maintenance":return"This asset doesn't have Maintenance Routine Addon";case"repairTicketing":return"This asset doesn't have Repair Ticketing Addon";case"tracking":return"This asset doesn't have Tracking Addon"}},d=(m,v)=>{var w;if(e.type==="transaction-policy")return!!((w=m.transactions)!=null&&w[v]);const S=e.type==="addon"?m.addOn:n.value==="user"?m.transactionRoles:m.transactions,b=f(m,v),k=!!(S!=null&&S[v]),A=!!(S!=null&&S[v]);return(e.type==="addon"?k:A)&&b},f=(m,v)=>{if(["repairTicketing","maintenance","tracking","audit","assetControl"].includes(v)&&m.licenseStatuses){const S=m.licenseStatuses[v];return n.value==="asset"?!!S&&["Managed","Active"].includes(S):!0}return!0},p=(m,v)=>d(m,v)?"primary":void 0,h=(m,v)=>r(d(m,v),v);return(m,v)=>(g(),T("div",Eq,[(g(!0),T(le,null,_e(i.value,S=>(g(),L(Me,{key:S.label,class:pe(["text-xs",{"text-general-200":!S.severity}]),"data-role-name":S.label,icon:S.icon,info:S.info,severity:S.severity},null,8,["class","data-role-name","icon","info","severity"]))),128))]))}})),Pq=["aria-selected","data-in-range","onClick"],Uie=ce("DatePicker",ye({__name:"DatePicker",props:{modelValue:{},initialValue:{},label:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},errorMessage:{}},emits:["update:modelValue"],setup(t){const e=t;bt(()=>{e.useValidator&&Object.assign(i,Ln(e.fieldName??"date",d=>{var f;return!(d!=null&&d.length)&&e.mandatory?n(((f=e.errorMessage)==null?void 0:f.empty)??"You must pick a date"):!0},{initialValue:e.initialValue??[]}))});const{t:n}=ls(),i=sn({value:[]}),r=oe(),o=oe(),s=W(()=>{const d=i.value[0],f=i.value[1];return f&&d!==f?d+" - "+f:d==null?void 0:d.toString()}),a=Array.from({length:31},(d,f)=>f+1),l=d=>{var h;const f=i.value[0],p=i.value[1];f!=null&&p!=null&&f===p?(i.value[1]=d,(h=r.value)==null||h.hide()):i.value=[d,d],i.value.sort((m,v)=>m-v)},u=d=>{var p,h;const f=((p=o.value)==null?void 0:p.$el)||null;f&&r.value&&f.focus(),(h=r.value)==null||h.toggle(d)},c=d=>{var f;if(d.key==="Enter"||d.key===" "){d.preventDefault();const p=(f=d.target)==null?void 0:f.parentElement,h={...d,target:p,currentTarget:p};u(h)}};return Re(()=>e.initialValue,()=>{var d;(d=e.initialValue)!=null&&d.length&&(i.value=e.initialValue)},{once:!0}),Re(()=>e.modelValue,d=>{i.value=d??[]}),(d,f)=>(g(),T(le,null,[I(Yn,{label:d.label?x(n)(d.label):void 0,mandatory:d.mandatory},{default:z(()=>[I(br,{invalid:!!i.errorMessage,onClick:u,class:"grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1"},{default:z(()=>[I(x(Xr),{ref_key:"inputtext",ref:o,"model-value":s.value,placeholder:x(n)("Select date"),onKeydown:c,class:"!p-0",readonly:""},null,8,["model-value","placeholder"]),I(Me,{class:"w-4 h-4 shrink-0 !text-general-500","data-ts-section":"inputtrigger",icon:"calendar"})]),_:1},8,["invalid"]),I(Rn,{message:i.errorMessage,"data-test":"datepicker-validator-message"},null,8,["message"])]),_:1},8,["label","mandatory"]),I(x(Rl),{ref_key:"panel",ref:r,pt:{content:{class:"grid grid-cols-7 grid-rows-[repeat(5,max-content)] p-6"}},class:"border-none !mt-0 !shadow-panel"},{default:z(()=>[(g(!0),T(le,null,_e(x(a),p=>(g(),T("span",{key:p,"aria-selected":i.value.includes(p),"data-in-range":i.value[0]<p&&p<i.value[1],onClick:h=>l(p),class:"text-xs text-general-800 bg-white hover:bg-primary-100 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 [&[data-in-range='true']]:text-general-800 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 [&[aria-selected='true']]:text-white text-center p-2 cursor-pointer","data-ts-section":"date"},_(p),9,Pq))),128))]),_:1},512)],64))}})),Iq=["aria-selected","data-in-range","onClick"],Kie=ce("DayPicker",ye({__name:"DayPicker",props:{modelValue:{},initialValue:{},label:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},errorMessage:{}},emits:["update:modelValue"],setup(t){const e=t;bt(()=>{e.useValidator&&Object.assign(r,Ln(e.fieldName??"day",c=>{var d;return!(c!=null&&c.length)&&e.mandatory?i(((d=e.errorMessage)==null?void 0:d.empty)??"You must pick a day"):!0},{initialValue:e.initialValue??[]}))});const n=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],{t:i}=ls(),r=sn({value:[]}),o=oe(),s=oe(),a=W(()=>{const c=n[r.value[0]],d=n[r.value[1]];return d&&c!==d?c+" - "+d:c}),l=(c,d)=>{var h;const f=r.value[0],p=r.value[1];f!=null&&p!=null&&f===p?(r.value[1]=d,(h=o.value)==null||h.hide()):r.value=[d,d],r.value.sort((m,v)=>m-v)},u=c=>{var f,p;const d=((f=s.value)==null?void 0:f.$el)||null;d&&o.value&&d.focus(),(p=o.value)==null||p.toggle(c)};return Re(()=>e.initialValue,()=>{var c;(c=e.initialValue)!=null&&c.length&&(r.value=e.initialValue)},{once:!0}),Re(()=>e.modelValue,c=>{r.value=c??[]}),(c,d)=>(g(),T(le,null,[I(Yn,{label:c.label?x(i)(c.label):void 0,mandatory:c.mandatory},{default:z(()=>[I(br,{invalid:!!r.errorMessage,onClick:u,class:"grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1"},{default:z(()=>[I(x(Xr),{ref_key:"inputtext",ref:s,"model-value":a.value,placeholder:x(i)("Select day"),class:"!p-0",readonly:""},null,8,["model-value","placeholder"]),I(Me,{class:"w-4 h-4 shrink-0 !text-general-500","data-ts-section":"inputtrigger",icon:"calendar"})]),_:1},8,["invalid"]),I(Rn,{message:r.errorMessage,"data-test":"daypicker-validator-message"},null,8,["message"])]),_:1},8,["label","mandatory"]),I(x(Rl),{ref_key:"panel",ref:o,pt:{content:{class:"grid grid-cols-3 p-6 gap-y-4"}},class:"border-none !mt-0 !shadow-panel"},{default:z(()=>[(g(),T(le,null,_e(n,(f,p)=>E("span",{key:f,"aria-selected":r.value.includes(p),class:pe([{"col-start-2":f==="Sunday"},"text-xs text-general-800 bg-white hover:bg-primary-100 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 [&[data-in-range='true']]:text-general-800 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 [&[aria-selected='true']]:text-white text-center p-2 cursor-pointer"]),"data-in-range":r.value[0]<p&&p<r.value[1],onClick:h=>l(f,p),"data-ts-section":"day"},_(x(i)(f)),11,Iq)),64))]),_:1},512)],64))}}));var Ba={},Yg,aC;function Lq(){return aC||(aC=1,Yg=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Yg}var Qg={},Zo={},lC;function Vs(){if(lC)return Zo;lC=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Zo.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},Zo.getSymbolTotalCodewords=function(i){return e[i]},Zo.getBCHDigit=function(n){let i=0;for(;n!==0;)i++,n>>>=1;return i},Zo.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');t=i},Zo.isKanjiModeEnabled=function(){return typeof t<"u"},Zo.toSJIS=function(i){return t(i)},Zo}var ev={},uC;function tv(){return uC||(uC=1,function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,r){if(t.isValid(i))return i;try{return e(i)}catch{return r}}}(ev)),ev}var nv,cC;function Dq(){if(cC)return nv;cC=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const n=Math.floor(e/8);return(this.buffer[n]>>>7-e%8&1)===1},put:function(e,n){for(let i=0;i<n;i++)this.putBit((e>>>n-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),e&&(this.buffer[n]|=128>>>this.length%8),this.length++}},nv=t,nv}var iv,dC;function Rq(){if(dC)return iv;dC=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,n,i,r){const o=e*this.size+n;this.data[o]=i,r&&(this.reservedBit[o]=!0)},t.prototype.get=function(e,n){return this.data[e*this.size+n]},t.prototype.xor=function(e,n,i){this.data[e*this.size+n]^=i},t.prototype.isReserved=function(e,n){return this.reservedBit[e*this.size+n]},iv=t,iv}var rv={},fC;function Nq(){return fC||(fC=1,function(t){const e=Vs().getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const r=Math.floor(i/7)+2,o=e(i),s=o===145?26:Math.ceil((o-13)/(2*r-2))*2,a=[o-7];for(let l=1;l<r-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},t.getPositions=function(i){const r=[],o=t.getRowColCoords(i),s=o.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||r.push([o[a],o[l]]);return r}}(rv)),rv}var ov={},pC;function Bq(){if(pC)return ov;pC=1;const t=Vs().getSymbolSize,e=7;return ov.getPositions=function(i){const r=t(i);return[[0,0],[r-e,0],[0,r-e]]},ov}var sv={},hC;function $q(){return hC||(hC=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(r){const o=r.size;let s=0,a=0,l=0,u=null,c=null;for(let d=0;d<o;d++){a=l=0,u=c=null;for(let f=0;f<o;f++){let p=r.get(d,f);p===u?a++:(a>=5&&(s+=e.N1+(a-5)),u=p,a=1),p=r.get(f,d),p===c?l++:(l>=5&&(s+=e.N1+(l-5)),c=p,l=1)}a>=5&&(s+=e.N1+(a-5)),l>=5&&(s+=e.N1+(l-5))}return s},t.getPenaltyN2=function(r){const o=r.size;let s=0;for(let a=0;a<o-1;a++)for(let l=0;l<o-1;l++){const u=r.get(a,l)+r.get(a,l+1)+r.get(a+1,l)+r.get(a+1,l+1);(u===4||u===0)&&s++}return s*e.N2},t.getPenaltyN3=function(r){const o=r.size;let s=0,a=0,l=0;for(let u=0;u<o;u++){a=l=0;for(let c=0;c<o;c++)a=a<<1&2047|r.get(u,c),c>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|r.get(c,u),c>=10&&(l===1488||l===93)&&s++}return s*e.N3},t.getPenaltyN4=function(r){let o=0;const s=r.data.length;for(let l=0;l<s;l++)o+=r.data[l];return Math.abs(Math.ceil(o*100/s/5)-10)*e.N4};function n(i,r,o){switch(i){case t.Patterns.PATTERN000:return(r+o)%2===0;case t.Patterns.PATTERN001:return r%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(r+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return r*o%2+r*o%3===0;case t.Patterns.PATTERN110:return(r*o%2+r*o%3)%2===0;case t.Patterns.PATTERN111:return(r*o%3+(r+o)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(r,o){const s=o.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)o.isReserved(l,a)||o.xor(l,a,n(r,l,a))},t.getBestMask=function(r,o){const s=Object.keys(t.Patterns).length;let a=0,l=1/0;for(let u=0;u<s;u++){o(u),t.applyMask(u,r);const c=t.getPenaltyN1(r)+t.getPenaltyN2(r)+t.getPenaltyN3(r)+t.getPenaltyN4(r);t.applyMask(u,r),c<l&&(l=c,a=u)}return a}}(sv)),sv}var hf={},mC;function gC(){if(mC)return hf;mC=1;const t=tv(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return hf.getBlocksCount=function(r,o){switch(o){case t.L:return e[(r-1)*4+0];case t.M:return e[(r-1)*4+1];case t.Q:return e[(r-1)*4+2];case t.H:return e[(r-1)*4+3];default:return}},hf.getTotalCodewordsCount=function(r,o){switch(o){case t.L:return n[(r-1)*4+0];case t.M:return n[(r-1)*4+1];case t.Q:return n[(r-1)*4+2];case t.H:return n[(r-1)*4+3];default:return}},hf}var av={},Vu={},vC;function Vq(){if(vC)return Vu;vC=1;const t=new Uint8Array(512),e=new Uint8Array(256);return function(){let i=1;for(let r=0;r<255;r++)t[r]=i,e[i]=r,i<<=1,i&256&&(i^=285);for(let r=255;r<512;r++)t[r]=t[r-255]}(),Vu.log=function(i){if(i<1)throw new Error("log("+i+")");return e[i]},Vu.exp=function(i){return t[i]},Vu.mul=function(i,r){return i===0||r===0?0:t[e[i]+e[r]]},Vu}var yC;function zq(){return yC||(yC=1,function(t){const e=Vq();t.mul=function(i,r){const o=new Uint8Array(i.length+r.length-1);for(let s=0;s<i.length;s++)for(let a=0;a<r.length;a++)o[s+a]^=e.mul(i[s],r[a]);return o},t.mod=function(i,r){let o=new Uint8Array(i);for(;o.length-r.length>=0;){const s=o[0];for(let l=0;l<r.length;l++)o[l]^=e.mul(r[l],s);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o},t.generateECPolynomial=function(i){let r=new Uint8Array([1]);for(let o=0;o<i;o++)r=t.mul(r,new Uint8Array([1,e.exp(o)]));return r}}(av)),av}var lv,bC;function Fq(){if(bC)return lv;bC=1;const t=zq();function e(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(i){this.degree=i,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(i.length+this.degree);r.set(i);const o=t.mod(r,this.genPoly),s=this.degree-o.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(o,s),a}return o},lv=e,lv}var uv={},cv={},dv={},AC;function wC(){return AC||(AC=1,dv.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),dv}var Dr={},SC;function CC(){if(SC)return Dr;SC=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
303
+ `})},_(i.value),41,aH)])]),_:1}))}}),uH=Ti.create({name:"mentionSection",group:"block",atom:!0,addAttributes(){return{title:{default:""},bodyText:{default:""}}},parseHTML(){return[{tag:"mentionSection"}]},renderHTML({HTMLAttributes:t}){return["mentionSection",$n(t)]},addNodeView(){return K6(lH)},addCommands(){return{insertMentionSection:t=>({commands:e})=>e.insertContent({type:"mentionSection",attrs:{title:t,bodyText:null}}),deleteMentionSection:()=>({commands:t})=>t.deleteSelection()}}}),cH={key:0},Eu=ce("UserName",ye({__name:"UserName",props:{user:{},fetchDetailOnPanelShow:{type:Boolean,default:!0},detailUserPath:{},type:{},showUserName:{type:Boolean,default:void 0},formatUserName:{type:Boolean,default:void 0},userNameField:{},profilePictureField:{},getUserDetail:{}},setup(t){const e=t,{locale:n,defaultProps:i}=_t("UserName"),r=W(()=>Hi(e,i)),o=oe(!1),s=oe(),a=oe(!1),l=re(),u=W(()=>Hn(e.user??{},r.value.userNameField)),c=W(()=>r.value.formatUserName?My(u.value):u.value),d=async()=>{var f,p,h;if(!s.value&&e.fetchDetailOnPanelShow)try{o.value=!0;const m=await((h=(p=r.value).getUserDetail)==null?void 0:h.call(p,(f=e.user)==null?void 0:f._id));s.value=m}catch(m){console.error(m)}finally{o.value=!1}else e.fetchDetailOnPanelShow||(s.value=e.user)};return(f,p)=>{const h=an("tooltip");return Object.keys(e.user??{}).length<1?(g(),T("span",cH," - ")):(g(),T("span",O({key:1,onClick:p[4]||(p[4]=(...m)=>{var v,S;return((v=l.value)==null?void 0:v.toggle)&&((S=l.value)==null?void 0:S.toggle(...m))})},f.$preset.username.root,{"data-wv-name":"username","data-wv-section":"root"}),[r.value.type=="picture"?(g(),L(Ar,{key:0,preview:u.value!==void 0,src:x(Hn)(e.user??{},r.value.profilePictureField),onClick:p[0]||(p[0]=xt(m=>{var v;u.value||(v=l.value)==null||v.toggle(m)},["stop"])),rounded:"",size:"small"},null,8,["preview","src"])):(g(),L(Me,{key:1,class:"text-general-300 text-base",icon:"user"})),r.value.showUserName?ft((g(),T("span",O({key:2},f.$preset.username.displayname({props:e}),{"data-wv-section":"displayname"}),[ht(_(c.value),1)],16)),[[h,c.value===u.value?void 0:u.value,void 0,{top:!0}]]):N("",!0),Object.keys(e.user??{}).length>1?(g(),L(Oc,{key:3,ref_key:"miniProfile",ref:l,dismissable:!a.value,onShow:d},{default:z(()=>{var m,v,S,b,k,A,w,y;return[E("div",O(f.$preset.username.panel.contentwrapper,{"data-wv-section":"contentwrapper"}),[E("div",O(f.$preset.username.panel.background,{"data-wv-section":"background"}),null,16),I(Ar,{src:((m=s.value)==null?void 0:m.profilePicture)??((v=s.value)==null?void 0:v.profilePictureBig),width:60,onHide:p[1]||(p[1]=C=>a.value=!1),onShow:p[2]||(p[2]=C=>a.value=!0),class:"w-[60px] h-[60px]",rounded:""},null,8,["src"]),o.value?(g(),L(x(Nl),{key:1,height:"29px",width:"100px"})):(g(),T("div",it(O({key:0},f.$preset.username.panel.detailwrapper)),[E("h4",O(f.$preset.username.panel.username,{"data-wv-section":"username"}),[ht(_((S=s.value)==null?void 0:S.fullName)+" ",1),(b=s.value)!=null&&b.nickName?(g(),T(le,{key:0},[ht(" ("+_((k=s.value)==null?void 0:k.nickName)+") ",1)],64)):N("",!0)],16),E("span",O(f.$preset.username.panel.useremail,{"data-wv-section":"useremail"}),_((A=s.value)==null?void 0:A.email),17)],16)),o.value?(g(),L(x(Nl),{key:3,height:"12px",width:"60px"})):(g(),T("span",O({key:2},f.$preset.username.panel.positiondivision,{"data-wv-section":"positiondivision"}),_((w=s.value)==null?void 0:w.division)+" / "+_((y=s.value)==null?void 0:y.position),17)),o.value?(g(),L(x(Nl),{key:5,width:"75px"})):(g(),T("a",O({key:4,onClick:p[3]||(p[3]=xt(C=>{var P;return x(Js)(r.value.detailUserPath.replace("{userId}",(P=e.user)==null?void 0:P._id))},["stop"]))},f.$preset.username.panel.userdetaillink,{"data-wv-section":"userdetaillink"}),_(x(n).detailUserAnchorText),17))],16)]}),_:1},8,["dismissable"])):N("",!0)],16))}}})),dH={class:"bg-white border border-gray-200 rounded-lg shadow-md flex flex-col max-h-72 overflow-y-scroll w-fit gap-1 p-2 relative"},fH=["onClick"],pH={class:"flex flex-col gap-[1px]"},hH={class:"!text-[10px] !font-light"},mH={key:1,class:"text-xs font-semibold"},gH=ye({__name:"MentionList",props:{items:{},command:{type:Function}},setup(t,{expose:e}){const n=t,i=oe(0),r=u=>u.key==="ArrowUp"?(o(),!0):u.key==="ArrowDown"?(s(),!0):u.key==="Enter"?(a(),!0):!1,o=()=>{i.value=(i.value+n.items.length-1)%n.items.length},s=()=>{i.value=(i.value+1)%n.items.length},a=()=>{l(i.value)},l=u=>{const c=n.items[u];c&&n.command({id:c.id,label:c.label})};return e({onKeyDown:r}),Re(()=>n.items,()=>{i.value=0}),(u,c)=>(g(),T("div",dH,[u.items.length?(g(!0),T(le,{key:0},_e(u.items,(d,f)=>(g(),T("div",{key:f,class:pe({"hover:bg-gray-100 flex":!0,"!bg-gray-100 ":f===i.value}),onClick:p=>l(f)},[I(Eu,{user:{profilePicture:d.profilePicture},"profile-picture-field":"profilePicture"},null,8,["user"]),E("div",pH,[E("p",null,_(d.label),1),E("p",hH,_(d.nickName),1)])],10,fH))),128)):(g(),T("div",mH,"No result"))]))}}),vH=()=>({render:()=>{let t,e;return{onStart(n){t=new H6(gH,{props:{items:n.items,command:n.command},editor:n.editor}),n.clientRect&&(e=Is("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(n){t.updateProps(n),n.clientRect&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){return n.event.key==="Escape"?(e[0].hide(),!0):t.ref.onKeyDown(n.event)},onExit(){e[0].destroy(),t.destroy()}}}}),yH=1*1024*1024,bH=10*1024*1024,AH=t=>t.startsWith("image/")?"image":t.includes("mp4")?"mp4":t==="video/x-matroska"?"mkv":t==="text/plain"?"txt":t==="text/csv"?"csv":t==="text/html"?"html":t==="application/json"?"json":t==="application/pdf"?"pdf":t==="application/vnd.ms-excel"||t==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"xls":t==="application/msword"||t==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"?"doc":t.startsWith("application/x-url")?"link":t.includes("application/x-zip-compressed")||t.includes("application/x-compressed")?"compressed":"unknown",wH=(t,e=1)=>{var i;if(e*=yH,!((i=t.type)!=null&&i.length))return!1;const n=AH(t.type);return t.size<=(n==="mp4"||n==="mkv"?bH:e)},ef="Checking availability...",Ia=ce("InputText",ye({__name:"InputText",props:{allowedCharacters:{},autoUppercase:{type:Boolean,default:!1},modelValue:{},value:{},existingValues:{},checkAvailability:{},maxLength:{},label:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},manualInvalidContainer:{type:Boolean,default:!1},validatorMessage:{},validatorMessageClass:{},placeholder:{},type:{default:"text"},disabled:{type:Boolean},fieldInfo:{},inputClass:{},inputContainerClass:{},labelClass:{},blurOnReachMaxLength:{type:Boolean},preventInputOnMaxLength:{type:Boolean},validateOnBlur:{type:Boolean,default:!1},useProtocol:{type:Boolean,default:!0},allowSpecialCharacters:{type:Boolean,default:!0},useInputGroup:{type:Boolean,default:!0},inputId:{}},emits:["update:modelValue","blur","input"],setup(t,{emit:e}){const n=t,i=e,{defaultProps:r}=_t(n.type==="email"?"InputEmail":n.type==="url"?"InputURL":"InputText"),{locale:o}=_t("InputText"),s=Hi(n,r),a=dt("preset",{}).inputgroupaddon,l=sn({value:void 0}),u=dt("isSubmitting"),c=W(()=>n.invalid||!!l.errorMessage),d=oe(0),f=oe(n.value||n.modelValue);bt(()=>{var M;n.useValidator&&(Object.assign(l,Ln(n.fieldName??"textInput",D=>Pt(()=>m(D==null?void 0:D.trim())))),n.value!=null&&R(n.value)),n.modelValue!=null&&(l.value=(M=n.modelValue)==null?void 0:M.trim()),n.invalid&&n.useValidator&&l.validate()}),Vi(()=>{n.useValidator&&l.handleReset()});const p=W(()=>{var M,D;return n.placeholder??((D=o.defaultPlaceholder)==null?void 0:D.replace("{label}",n.label?(M=n.label)==null?void 0:M.toLowerCase():""))}),h=W(()=>{var M,D;return typeof n.validatorMessage=="object"&&"exist"in n.validatorMessage?(M=n.validatorMessage)==null?void 0:M.exist:(D=o.alreadyExistInvalidText)==null?void 0:D.replace("{label}",n.label)}),m=M=>{var D,$,q,J;if(typeof n.validatorMessage=="string"&&n.invalid)return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{invalidFormat:ve,empty:ae,exceed:me}=n.validatorMessage??{};if(!M&&n.mandatory)return ae??o.emptyInvalidText.replace("{label}",n.label);if((M==null?void 0:M.length)>s.maxLength)return me??((D=o.exceedMaxLengthInvalidText)==null?void 0:D.replace("{maxLength}",s.maxLength.toString()));if(($=(n.existingValues??[]).filter(se=>se!=n.value))!=null&&$.includes(M))return((q=n.validatorMessage)==null?void 0:q.exist)??((J=o.alreadyExistInvalidText)==null?void 0:J.replace("{label}",n.label));if(M&&n.type==="email")return S(M,ve??o.emailFormatInvalidText);if(M&&n.type==="url")return v(M,ve??o.urlFormatInvalidText)}else if(!n.allowSpecialCharacters)return/[^A-Za-z0-9 ]/.test(M)?o.includeSpecialCharsInvalidText:!0;return n.checkAvailability?C():!0},v=(M,D)=>{const $=new RegExp(`^(https?:\\/\\/)${n.useProtocol?"":"?"}((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+:@!$&'()*+,;=]*)*(\\?[;&a-z\\d%_.~+=:@!$&'()*+,;=-]*)?(\\#[-a-z\\d_:@!$&'()*+,;=]*)?$`,"i");return D==null||$.test(M)?!0:D},S=(M,D)=>{const $=/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;return D==null||$.test(M)?!n.checkAvailability||!!n.checkAvailability&&C():D},b=()=>{n.validateOnBlur&&(l.value=f.value),i("blur",f.value)},k=M=>{var q;const D=s.maxLength&&s.maxLength===((q=f.value)==null?void 0:q.length);(n.allowedCharacters&&!n.allowedCharacters.test(M.key)||D&&(n.preventInputOnMaxLength||n.blurOnReachMaxLength))&&(M.preventDefault(),n.blurOnReachMaxLength&&D&&d.value++)},A=M=>{var q,J,ve;const D=(q=M.clipboardData)==null?void 0:q.getData("text"),$=s.maxLength&&s.maxLength===((J=f.value)==null?void 0:J.length)||((ve=f.value)==null?void 0:ve.length)+(D==null?void 0:D.length)>s.maxLength||(D==null?void 0:D.length)>s.maxLength;(n.allowedCharacters&&!n.allowedCharacters.test(D)||$&&(n.preventInputOnMaxLength||n.blurOnReachMaxLength))&&(M.preventDefault(),n.blurOnReachMaxLength&&$&&d.value++)},w=M=>{M===""&&(M=void 0),n.autoUppercase&&M&&(M=M.replace(/[a-z]/g,D=>D.toUpperCase())),f.value=M,(!n.validateOnBlur&&n.useValidator||!n.useValidator)&&(l.value=f.value),i("update:modelValue",f.value)},y=M=>{i("input",M.target.value||void 0)},C=()=>{if(u!=null&&u.value){if(l.errorMessage===h.value||l.errorMessage===ef)return l.errorMessage}else return P(),ef;return!0},P=X7(async()=>{var M;if(l.value!=n.value&&(M=l.value)!=null&&M.length&&!await n.checkAvailability(l.value))return l.setErrors(h.value);l.errorMessage===ef&&l.setErrors("")},300),R=M=>{n.useValidator?l.setValue(M==null?void 0:M.trim(),!1):l.value=M==null?void 0:M.trim()};return Re(()=>n.value,M=>{R(M),f.value=M==null?void 0:M.trim()},{once:!0}),Re(()=>n.modelValue,M=>{f.value=M==null?void 0:M.trim(),n.validateOnBlur||(l.value=f.value)}),Re(()=>n.invalid,()=>{var M;(M=l.validate)==null||M.call(l)}),(M,D)=>(g(),L(Yn,{info:M.fieldInfo,label:n.label,"label-class":n.labelClass,mandatory:n.mandatory},{default:z(()=>[I(br,{class:pe(n.inputContainerClass??["grid ",{"grid-cols-[max-content,1fr,max-content]":M.$slots["addon-left"]&&M.$slots["addon-right"],"grid-cols-[1fr,max-content]":!M.$slots["addon-left"]&&M.$slots["addon-right"],"grid-cols-[max-content,1fr]":M.$slots["addon-left"]&&!M.$slots["addon-right"]}]),disabled:n.disabled,invalid:c.value&&!n.manualInvalidContainer,"use-input-group":M.useInputGroup},{default:z(()=>[M.$slots["addon-left"]?(g(),L(x(ps),{key:0,disabled:n.disabled},{default:z(()=>[ee(M.$slots,"addon-left")]),_:3},8,["disabled"])):N("",!0),(g(),L(x(Xr),{id:M.inputId,key:d.value,class:pe(M.inputClass),disabled:M.disabled,invalid:c.value,"model-value":l.value,placeholder:p.value,onBlur:b,onInput:y,onKeypress:k,onPaste:A,"onUpdate:modelValue":w},null,8,["id","class","disabled","invalid","model-value","placeholder"])),M.$slots["addon-right"]?(g(),L(x(ps),{key:1,pt:{root:x(a).root({props:{class:[{"!text-general-200":n.disabled}]}})}},{default:z(()=>[ee(M.$slots,"addon-right")]),_:3},8,["pt"])):N("",!0)]),_:3},8,["class","disabled","invalid","use-input-group"]),l.errorMessage==ef?(g(),T("span",O({key:0},M.$preset.validatormessage.root,{class:"text-general-800","data-wv-section":"checking-availability"})," Checking availability... ",16)):(g(),L(Rn,{key:1,class:pe(M.validatorMessageClass),message:l.errorMessage},null,8,["class","message"]))]),_:3},8,["info","label","label-class","mandatory"]))}})),r3=ce("InputURL",ye({__name:"InputURL",props:{allowedCharacters:{},autoUppercase:{type:Boolean},modelValue:{},value:{},existingValues:{},checkAvailability:{},maxLength:{},label:{},useValidator:{type:Boolean,default:!0},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},manualInvalidContainer:{type:Boolean},validatorMessage:{},validatorMessageClass:{},placeholder:{},disabled:{type:Boolean},fieldInfo:{},inputClass:{},inputContainerClass:{},labelClass:{},blurOnReachMaxLength:{type:Boolean},preventInputOnMaxLength:{type:Boolean},validateOnBlur:{type:Boolean},useProtocol:{type:Boolean,default:!0},allowSpecialCharacters:{type:Boolean,default:!0},useInputGroup:{type:Boolean,default:!0},inputId:{}},emits:["update:modelValue","blur","input"],setup(t){return(e,n)=>(g(),L(Ia,O({onBlur:n[0]||(n[0]=i=>e.$emit("blur",i)),onInput:n[1]||(n[1]=i=>e.$emit("input",i)),"onUpdate:modelValue":n[2]||(n[2]=i=>e.$emit("update:modelValue",i))},e.$props,{type:"url"}),Dn({_:2},[e.$slots["addon-left"]?{name:"addon-left",fn:z(()=>[ee(e.$slots,"addon-left")]),key:"0"}:void 0,e.$slots["addon-right"]?{name:"addon-right",fn:z(()=>[ee(e.$slots,"addon-right")]),key:"1"}:void 0]),1040))}})),Ns=ye({__name:"EditorButton",props:{classButton:{}},setup(t){return(e,n)=>(g(),L(We,{class:pe([e.classButton,"!rounded h-6 w-6 p-1"]),tooltip:{pt:{text:{style:"font-size: 9px !important; padding: 2px 6px; border-radius: 8px"}},value:e.$attrs.tooltipText??e.$attrs["tooltip-text"]},"icon-class":"!w-4 !h-4",severity:"secondary",text:"","tooltip-pos":"top"},null,8,["class","tooltip"]))}}),SH=["title","onClick"],CH={class:"!text-[9px] !leading-3 !h-max !font-normal"},kH={class:pe(["flex gap-2 bg-white border-[0.5px] px-2 py-1 rounded-sm","[&_.separator::after]:content-['|']","[&_.separator::after]:text-xl","[&_.separator::after]:font-thin","[&_.separator]:h-6"])},OH={class:pe(["flex gap-2 bg-white border-[0.5px] px-2 py-1 rounded-sm","[&_.separator::after]:content-['|']","[&_.separator::after]:text-xl","[&_.separator::after]:font-thin","[&_.separator]:h-6"])},TH={class:"flex flex-col gap-4"},xH={class:"flex gap-2"},MH={class:"flex-1"},EH={class:"flex items-end"},PH={class:"flex flex-wrap justify-center gap-2"},IH=["src"],LH={class:"flex flex-col justify-center w-28 h-28 items-center"},DH={class:"relative py-[7px] px-3"},RH={class:pe(["flex gap-2 bg-white border-[0.5px] px-2 py-1 rounded-sm","[&_.separator::after]:content-['|']","[&_.separator::after]:text-xl","[&_.separator::after]:font-thin","[&_.separator]:h-6"])},NH=ce("Editor",ye({__name:"Editor",props:Cn({modelValue:{},initialValue:{},placeholder:{default:"Tulis"},editorState:{default:"editable"},borderLess:{type:Boolean,default:!1},label:{},useValidator:{type:Boolean},fieldName:{},labelClass:{},fieldInfo:{},validatorMessageClass:{},validatorMessage:{},mandatory:{type:Boolean},invalid:{type:Boolean},showOptionalText:{type:Boolean,default:void 0},isImageUploadBase64:{type:Boolean,default:!1},fetchMentionSuggestionFunction:{},mentionedList:{},editorWrapperClass:{},toolbarWrapperClass:{},contentWrapperClass:{}},{modelValue:{},modelModifiers:{},mentionedList:{},mentionedListModifiers:{}}),emits:Cn(["update:modelValue","postImageLocal","deleteImageLocal","blur","focus","update:mentionedList"],["update:modelValue","update:mentionedList"]),setup(t,{expose:e,emit:n}){const i=dt("preset",{}).menu,r=t,o=n;si(t,"modelValue");const s=si(t,"mentionedList");bt(()=>{r.useValidator&&(Object.assign(v,Ln(()=>r.fieldName??"editorInput",Z=>Pt(()=>me(Z)))),r.initialValue!=null&&(v.value=r.initialValue),r.modelValue!=null&&(v.value=r.modelValue)),ge()});const a=oe(!1),l=re(),u=re(),c=re(),d=re([]),f=oe(!1),p=oe(),h=oe(),m=oe(),v=sn({value:r.modelValue}),S=oe(!1),b=re([]),k=oe(),A=W(()=>{var Z;return r.placeholder??"Tulis "+(r.label?(Z=r.label)==null?void 0:Z.toLowerCase():"")}),w=zj({content:r.initialValue??r.modelValue,onBlur:Z=>o("blur",Z),onFocus:Z=>o("focus",Z),onUpdate:()=>{var Z,X;o("update:modelValue",((Z=w.value)==null?void 0:Z.getJSON())??{}),v.value=((X=w.value)==null?void 0:X.getJSON())??{}},onPaste:async Z=>{let X=[];const{items:U}=Z.clipboardData,Y=ke=>new Promise(Fe=>{if(ke.kind==="file"){const H=ke.getAsFile();H&&X.push(H),Fe()}else Fe()});await Promise.all(Array.from(U).map(Y));try{if(X.length){const ke=X.filter(Fe=>Fe.type.startsWith("image/")).filter(Fe=>wH(Fe,10));await ve(ke)}}catch(ke){console.error("Error pasting images:",ke)}finally{X=[]}},onSelectionUpdate(Z){var U;const X=Z.editor.getAttributes("image");(U=w.value)==null||U.state.doc.descendants(Y=>{Y.type.name==="mention"&&b.value.push(Y.attrs.id)}),b.value=Array.from(new Set(b.value)),X.title==="localImage"?h.value=X:h.value=void 0},editable:r.editorState==="editable",extensions:[Dj.configure({emptyEditorClass:"is-editor-empty !text-general-200 !font-light",placeholder:A.value,includeChildren:!1}),oz.extend({addKeyboardShortcuts(){return{"Mod-\\":()=>(this.editor.commands.clearNodes(),this.editor.commands.unsetAllMarks())}}}),$F,Lj,Rj,ZF.extend({addKeyboardShortcuts(){const Z=()=>{const{node:X}=this.editor.state.selection;return X&&X.type.name==="image"&&X.attrs.title==="localImage"?(xe(),!0):!1};return{Insert:()=>J(),Backspace:Z,Delete:Z}}}).configure({HTMLAttributes:{class:"w-fit max-h-[300px] object-contain"}}),iH.extend({addKeyboardShortcuts(){return{"Mod-alt-c":Pe}}}),uH,Ij.configure({HTMLAttributes:{class:"list-decimal px-3 py-1"}}),tz.configure({HTMLAttributes:{class:"list-disc px-3 py-1"}}),kj,QV,ej,Nj,rz,Cj.extend({addKeyboardShortcuts(){return{"Mod-k":()=>se()}}}).configure({openOnClick:!1}),XF,Ej.configure({HTMLAttributes:{class:"bg-primary-200 text-primary-800 rounded-[50px] px-1"},suggestion:{items({query:Z}){return((m==null?void 0:m.value)??[]).filter(X=>X==null?void 0:X.fullName.toLowerCase().includes(Z.toLowerCase())).map(X=>({id:X==null?void 0:X._id,label:X==null?void 0:X.fullName,nickName:X.nickName,profilePicture:X.profilePicture}))},...vH()}}),BF]}),y=W(()=>{var St,lt,At,Ut,cn,dn,tn,zt,Rt,kn,Yt,te,Q,we,je,st;if(!w.value)return[];const{toggleBold:Z,focus:X,toggleItalic:U,toggleUnderline:Y,toggleBulletList:ke,toggleCode:Fe,toggleOrderedList:H,unsetAllMarks:he,clearNodes:De}=w.value.commands,nt=(St=w.value)==null?void 0:St.isActive("code");return[{label:"Aa",iconPos:"right",icon:"arrow-down",class:"!gap-0 !w-[50px] !p-0 !m-0 [&_span]:leading-[22px]",onClick:(lt=l.value)==null?void 0:lt.toggle},{icon:"bold",tooltipText:"Bold | Ctrl + B",active:(At=w.value)==null?void 0:At.isActive("bold"),disabled:nt,onClick:()=>{X(),Z()}},{icon:"italic",tooltipText:"Italic | Ctrl + I",active:(Ut=w.value)==null?void 0:Ut.isActive("italic"),disabled:nt,onClick:()=>{X(),U()}},{icon:"underline",class:"mr-3",active:(cn=w.value)==null?void 0:cn.isActive("underline"),tooltipText:"Underline | Ctrl + U",disabled:nt,onClick:()=>{X(),Y()}},{icon:"list-unordered",tooltipText:"Bullet List | Ctrl + 7",active:(dn=w.value)==null?void 0:dn.isActive("bullet-list"),onClick:()=>{X(),ke()}},{icon:"list-ordered",tooltipText:"Numbered List | Ctrl + 8",active:(tn=w.value)==null?void 0:tn.isActive("ordered-list"),class:"mr-3",onClick:()=>{X(),H()}},{icon:"link-m",tooltipText:"Link | Ctrl + K",disabled:((zt=w.value)==null?void 0:zt.isActive("link"))||a.value,onClick:se},{icon:"image-add",active:(Rt=w.value)==null?void 0:Rt.isActive("image"),tooltipText:"Image | Insert",onClick:()=>J()},{icon:"code-line",active:(kn=w.value)==null?void 0:kn.isActive("code"),tooltipText:"Inline Code | Ctrl + E",onClick:()=>{X(),Fe()}},{icon:"code-box-line",active:(Yt=w.value)==null?void 0:Yt.isActive("codeSnippet"),tooltipText:"Code Block | Ctrl + Alt + C",onClick:()=>{Pe()}},{icon:"format-clear",tooltipText:"Clear Formatting Ctrl + \\",disabled:!((te=w.value)!=null&&te.isActive("bold"))&&!((Q=w.value)!=null&&Q.isActive("underline"))&&!((we=w.value)!=null&&we.isActive("italic"))&&!((je=w.value)!=null&&je.isActive("code"))&&!((st=w.value)!=null&&st.isActive("heading")),onClick:()=>{X(),De(),he()}}]}),C=oe([{label:"Paragraf",class:"p",shortCut:"Ctrl+Alt+P",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setParagraph()}},{label:"Heading 1",class:"heading-1",shortCut:"Ctrl+Alt+1",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:1})}},{label:"Heading 2",class:"heading-2",shortCut:"Ctrl+Alt+2",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:2})}},{class:"heading-3",label:"Heading 3",shortCut:"Ctrl+Alt+3",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:3})}},{label:"Heading 4",class:"heading-4",shortCut:"Ctrl+Alt+4",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:4})}},{label:"Heading 5",class:"heading-5",shortCut:"Ctrl+Alt+5",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:5})}},{label:"Heading 6",class:"heading-6",shortCut:"Ctrl+Alt+6",command:()=>{var Z,X;(Z=w.value)==null||Z.commands.focus(),(X=w.value)==null||X.commands.setHeading({level:6})}}]),P=W(()=>{var Z;return(Z=w.value)==null?void 0:Z.getAttributes("link")}),R=()=>{var U;const{href:Z}=P.value,X=(U=w.value)==null?void 0:U.view.dom.querySelector(`[href="${Z}"]`);return q()||X&&(X==null?void 0:X.textContent)!==Z&&X.textContent||void 0},M=()=>{var Z;window.open((Z=P.value)==null?void 0:Z.href,"_blank")},D=()=>{var Z;window.navigator.clipboard.writeText((Z=P.value)==null?void 0:Z.href)},$=()=>{var Z;if(w.value){const{unsetLink:X,focus:U}=((Z=w.value)==null?void 0:Z.commands)??{};U(),X()}},q=()=>{if(w.value){const{state:Z}=w.value,{from:X,to:U}=Z.selection;return Z==null?void 0:Z.doc.textBetween(X,U," ")}},J=()=>(f.value=!0,!1),ve=async Z=>{if(r.isImageUploadBase64){const X=await de(Z[0]);Be(X)}else o("postImageLocal",{image:Z[0],setImageCb:Be})},ae=Z=>{const{files:X}=Z.target;ve(X)},me=(Z={})=>{if(typeof r.validatorMessage=="string"&&r.invalid)return r.validatorMessage;if(typeof r.validatorMessage!="string"){const{empty:X}=r.validatorMessage??{};if(Z.content===void 0&&r.mandatory&&X)return X??!0}return!0},se=Z=>{var Y,ke,Fe,H;const X=Z??{currentTarget:(ke=(Y=c.value)==null?void 0:Y.querySelector(".ic-link-m"))==null?void 0:ke.closest("button")},{dom:U}=((Fe=w.value)==null?void 0:Fe.view)??{};return(H=u.value)==null||H.toggle(X,U),!0},Ie=({formValues:Z})=>{var he,De;if(!w.value)return!1;const{setLink:X,insertContent:U,focus:Y}=w.value.commands,{url:ke,text:Fe}=Z,{state:H}=w.value;return Y(),X({href:ke,target:"_blank",rel:"nofollow"}),(he=w.value)!=null&&he.isActive("link")?w.value.chain().focus().command(({tr:nt,state:St})=>{const{$from:lt,$to:At}=St.selection,Ut=H.schema.marks.link;let cn=lt.start(),dn=At.end();return H.doc.nodesBetween(lt.pos,At.pos,(tn,zt)=>{tn.isText&&tn.marks.some(Rt=>Rt.type===Ut)&&(cn=Math.min(cn,zt),dn=Math.max(dn,zt+tn.nodeSize))}),nt.insertText(Fe||ke,cn,dn),!0}).run():H.selection.empty&&U(Fe||ke),(De=u.value)==null||De.hide(),a.value=!1,!0},Be=Z=>{var X,U,Y,ke;(X=w.value)==null||X.commands.focus(),Z&&(r.isImageUploadBase64?(U=w.value)==null||U.commands.setImage({src:Z,title:"localImageBase64"}):(Y=w.value)==null||Y.commands.setImage({src:Z,title:"localImage"}),d.value=Array.from(new Set([...d.value,Z]))),p.value&&((ke=w.value)==null||ke.commands.setImage({src:p.value}),d.value=Array.from(new Set([...d.value,p.value]))),p.value=void 0,Te()},xe=()=>{var Z;h.value&&h.value.title==="localImage"&&o("deleteImageLocal",h.value),(Z=w.value)==null||Z.commands.deleteSelection()},de=Z=>new Promise((X,U)=>{const Y=new FileReader;Y.readAsDataURL(Z),Y.onload=()=>{X(Y.result)},Y.onerror=ke=>{U(ke)}}),ge=async()=>{if(r.fetchMentionSuggestionFunction){S.value=!S.value;try{const{data:Z}=await r.fetchMentionSuggestionFunction()??{};m.value=Z,S.value=!S.value}catch(Z){console.error(Z)}}},Pe=()=>{var U,Y;const{insertCodeSnippet:Z,deleteCodeSnippet:X}=(U=w.value)==null?void 0:U.commands;return(Y=w.value)!=null&&Y.isActive("codeSnippet")?X():Z(),!1},Te=()=>{w.value.commands.createParagraphNear()},ue=Z=>{var X;try{const{insertMentionSection:U}=(X=w.value)==null?void 0:X.commands;U(Z),k.value!==Z&&k.value!==void 0&&Se(),k.value=Z}catch(U){console.error(U)}},Se=()=>{S.value=!0,setTimeout(()=>{S.value=!1},100)};return e({mentionSectionTrigger:ue}),Re(()=>r.invalid,()=>{var Z;(Z=v.validate)==null||Z.call(v)}),Re(b,()=>{s.value=b.value}),(Z,X)=>{const U=an("focus");return g(),T(le,null,[I(Yn,{info:Z.fieldInfo,label:r.label,"label-class":r.labelClass,mandatory:r.mandatory,"show-optional-text":r.showOptionalText},{default:z(()=>[E("div",{ref_key:"root",ref:c,class:pe(["rounded-b text-grayscale-900 w-full","[&:has(:focus)]:border-general-200 border-general-100",`${Z.borderLess||Z.editorState==="readonly"?"border-none":"border-[0.5px]"}`,"[&_code]:bg-primary-100","[&_code]:rounded-md","[&_code]:p-[0.25em_0.3em]","[&_code]:text-[0.85rem]","[&_code]:!font-source-code-pro",`${r.editorWrapperClass}`]),"data-wv-name":"editor"},[r.editorState==="editable"?(g(),T("div",{key:0,class:pe(["border-b-[0.5px] border-inherit px-3 py-1 flex gap-1 bg-general-50",`${r.toolbarWrapperClass}`]),"data-wv-section":"toolbar"},[(g(!0),T(le,null,_e(y.value,Y=>(g(),L(Ns,O({ref_for:!0},Y,{key:Y.icon,class:[{"!bg-primary-50 ":Y.active},Y.class]}),null,16,["class"]))),128))],2)):N("",!0),S.value?N("",!0):(g(),L(x(Vj),{key:1,class:pe([`${r.editorState==="editable"?"px-3 py-2":""} [&_*]:outline-none`,"[&_.is-editor-empty:first-child::before]:text-general-200","[&_.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.is-editor-empty:first-child::before]:font-normal","[&_.is-editor-empty:first-child::before]:pointer-events-none","[&_.is-editor-empty:first-child::before]:float-left","[&_.is-editor-empty:first-child::before]:h-0","[&_a]:hover:underline transition-transform duration-75","[&_a]:text-link","[&_a]:cursor-pointer","[&_b]:font-bold","[&_strong]:font-bold","[&_img.ProseMirror-selectednode]:!outline-[0.5px]","[&_img.ProseMirror-selectednode]:!outline-link","[&_img.ProseMirror-selectednode]:!outline-offset-1","[&_img.ProseMirror-selectednode]:!rounded-sm","[&_img]:my-2","[&_*:has(code)]:my-[0.25rem]",`${r.contentWrapperClass}`]),editor:x(w),spellcheck:"false"},null,8,["class","editor"])),I(x(wc),{ref_key:"headingMenu",ref:l,model:C.value,popup:""},{item:z(({item:Y})=>{var ke,Fe,H,he,De,nt,St,lt;return[E("a",{class:pe([...(ke=x(i))==null?void 0:ke.action.class,Y.class,"flex items-center !justify-between h-[30px]",{"bg-primary-50":((Fe=x(w))==null?void 0:Fe.isActive("heading",{level:1}))&&Y.label==="Heading 1"||((H=x(w))==null?void 0:H.isActive("heading",{level:2}))&&Y.label==="Heading 2"||((he=x(w))==null?void 0:he.isActive("heading",{level:3}))&&Y.label==="Heading 3"||((De=x(w))==null?void 0:De.isActive("heading",{level:4}))&&Y.label==="Heading 4"||((nt=x(w))==null?void 0:nt.isActive("heading",{level:5}))&&Y.label==="Heading 5"||((St=x(w))==null?void 0:St.isActive("heading",{level:6}))&&Y.label==="Heading 6"||((lt=x(w))==null?void 0:lt.isActive("paragraph"))&&Y.label==="Paragraf"}]),title:Y.label,onClick:At=>{var Ut;return(Ut=Y.command)==null?void 0:Ut.call(Y,{item:Y,originalEvent:At})}},[ht(_(Y.label)+" ",1),E("code",CH,_(Y.shortCut),1)],10,SH)]}),_:1},8,["model"]),x(w)&&r.editorState==="editable"?(g(),L(x(Og),{key:2,editor:x(w),"should-show":()=>{var Y,ke;return((Y=x(w))==null?void 0:Y.isActive("codeSnippet"))||((ke=x(w))==null?void 0:ke.isActive("mentionSection"))},"tippy-options":{placement:"top",zIndex:9},class:"-mt-1.5 shadow-panel","plugin-key":"editLinkToolbar"},{default:z(()=>[E("div",kH,[I(Ns,{onClick:Te,icon:"close",severity:"secondary",text:"","tooltip-text":"Buat text baru dibawah"})])]),_:1},8,["editor","should-show"])):N("",!0),x(w)&&!a.value&&r.editorState==="editable"?(g(),L(x(Og),{key:3,editor:x(w),"should-show":()=>{var Y;return(Y=x(w))==null?void 0:Y.isActive("link")},"tippy-options":{placement:"bottom",zIndex:9},class:"-mt-1.5 shadow-panel","plugin-key":"editLinkToolbar"},{default:z(()=>[E("div",OH,[I(Ns,{onClick:se,class:"!w-max",label:"Edit Tautan",severity:"secondary",text:""}),X[4]||(X[4]=E("span",{class:"separator"},null,-1)),I(Ns,{onClick:M,icon:"external-link",severity:"secondary",text:"","tooltip-text":"Buka di tab baru"}),X[5]||(X[5]=E("span",{class:"separator"},null,-1)),I(Ns,{onClick:$,icon:"link-unlink-m",severity:"secondary",text:"","tooltip-text":"Lepas tautan"}),X[6]||(X[6]=E("span",{class:"separator"},null,-1)),I(Ns,{onClick:D,icon:"file-copy",severity:"secondary",text:"","tooltip-text":"Salin tautan"})])]),_:1},8,["editor","should-show"])):N("",!0),I(ur,{visible:f.value,"onUpdate:visible":X[2]||(X[2]=Y=>f.value=Y),class:"w-[400px]",header:"Pilih Gambar"},{default:z(()=>[E("div",TH,[E("div",xH,[E("div",MH,[I(r3,{"model-value":p.value,"onUpdate:modelValue":X[0]||(X[0]=Y=>p.value=Y),class:"w-[269px]",label:"URL Gambar"},null,8,["model-value"])]),E("div",EH,[I(We,{onClick:X[1]||(X[1]=Y=>Be()),label:"Simpan",severity:"secondary"})])]),E("div",null,[X[8]||(X[8]=E("p",null,"Baru Saja Ditambahkan",-1)),E("div",PH,[(g(!0),T(le,null,_e(d.value,(Y,ke)=>(g(),T("img",{key:ke,src:Y,alt:"preview",class:"w-28 h-28 object-scale-down rounded-lg"},null,8,IH))),128)),E("div",LH,[I(Me,{class:"!w-[70px] !h-[70px]",icon:"upload-2",severity:"primary"}),I(We,{severity:"secondary"},{default:z(()=>[E("div",DH,[X[7]||(X[7]=E("p",null,"Cari Gambar",-1)),E("input",{onChange:ae,class:"opacity-0 absolute top-0 bottom-0 left-0 right-0",type:"file"},null,32)])]),_:1})])])])])]),_:1},8,["visible"]),x(w)&&r.editorState==="editable"?(g(),L(x(Og),{key:4,editor:x(w),"should-show":()=>{var Y;return!!((Y=x(w))!=null&&Y.isActive("image"))},"tippy-options":{placement:"top",zIndex:9},class:"-mt-1.5 shadow-panel","plugin-key":"editImageToolbar"},{default:z(()=>[E("div",RH,[I(Ns,{onClick:xe,icon:"delete-bin",severity:"secondary",text:"","tooltip-text":"Unset Image"})])]),_:1},8,["editor","should-show"])):N("",!0)],2),I(Rn,{class:pe(Z.validatorMessageClass),message:v.errorMessage},null,8,["class","message"])]),_:1},8,["info","label","label-class","mandatory","show-optional-text"]),I(Oc,{ref_key:"editLinkOverlay",ref:u,pt:{content:{class:""}},onHide:X[3]||(X[3]=Y=>a.value=!1),"append-to":"self",class:"w-[342px] bg-white p-4"},{default:z(()=>[I(jA,{onSubmit:Ie,class:"!gap-0","hide-stay-checkbox":""},{fields:z(()=>{var Y,ke;return[ft(I(r3,{"validator-message":{empty:"Masukan tautan yang valid"},value:(Y=P.value)==null?void 0:Y.href,"field-name":"url",label:"Tempel Tautan",mandatory:"",placeholder:"Tempel tautan baru","use-validator":""},null,8,["value"]),[[U]]),I(Ia,{value:R(),"field-name":"text",label:"Teks Tampilan",placeholder:"Teks untuk ditampilkan","use-validator":""},null,8,["value"]),I(We,{label:(ke=x(w))!=null&&ke.isActive("link")?"Simpan":"Tambahkan",class:"w-max ml-auto",severity:"secondary",type:"submit"},null,8,["label"])]}),_:1})]),_:1},512)],64)}}}));var o3={name:"PlusIcon",extends:bn},BH=E("path",{d:"M7.67742 6.32258V0.677419C7.67742 0.497757 7.60605 0.325452 7.47901 0.198411C7.35197 0.0713707 7.17966 0 7 0C6.82034 0 6.64803 0.0713707 6.52099 0.198411C6.39395 0.325452 6.32258 0.497757 6.32258 0.677419V6.32258H0.677419C0.497757 6.32258 0.325452 6.39395 0.198411 6.52099C0.0713707 6.64803 0 6.82034 0 7C0 7.17966 0.0713707 7.35197 0.198411 7.47901C0.325452 7.60605 0.497757 7.67742 0.677419 7.67742H6.32258V13.3226C6.32492 13.5015 6.39704 13.6725 6.52358 13.799C6.65012 13.9255 6.82106 13.9977 7 14C7.17966 14 7.35197 13.9286 7.47901 13.8016C7.60605 13.6745 7.67742 13.5022 7.67742 13.3226V7.67742H13.3226C13.5022 7.67742 13.6745 7.60605 13.8016 7.47901C13.9286 7.35197 14 7.17966 14 7C13.9977 6.82106 13.9255 6.65012 13.799 6.52358C13.6725 6.39704 13.5015 6.32492 13.3226 6.32258H7.67742Z",fill:"currentColor"},null,-1),$H=[BH];function VH(t,e,n,i,r,o){return g(),T("svg",O({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),$H,16)}o3.render=VH;var s3={name:"UploadIcon",extends:bn},zH=E("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.58942 9.82197C6.70165 9.93405 6.85328 9.99793 7.012 10C7.17071 9.99793 7.32234 9.93405 7.43458 9.82197C7.54681 9.7099 7.61079 9.55849 7.61286 9.4V2.04798L9.79204 4.22402C9.84752 4.28011 9.91365 4.32457 9.98657 4.35479C10.0595 4.38502 10.1377 4.40039 10.2167 4.40002C10.2956 4.40039 10.3738 4.38502 10.4467 4.35479C10.5197 4.32457 10.5858 4.28011 10.6413 4.22402C10.7538 4.11152 10.817 3.95902 10.817 3.80002C10.817 3.64102 10.7538 3.48852 10.6413 3.37602L7.45127 0.190618C7.44656 0.185584 7.44176 0.180622 7.43687 0.175736C7.32419 0.063214 7.17136 0 7.012 0C6.85264 0 6.69981 0.063214 6.58712 0.175736C6.58181 0.181045 6.5766 0.186443 6.5715 0.191927L3.38282 3.37602C3.27669 3.48976 3.2189 3.6402 3.22165 3.79564C3.2244 3.95108 3.28746 4.09939 3.39755 4.20932C3.50764 4.31925 3.65616 4.38222 3.81182 4.38496C3.96749 4.3877 4.11814 4.33001 4.23204 4.22402L6.41113 2.04807V9.4C6.41321 9.55849 6.47718 9.7099 6.58942 9.82197ZM11.9952 14H2.02883C1.751 13.9887 1.47813 13.9228 1.22584 13.8061C0.973545 13.6894 0.746779 13.5241 0.558517 13.3197C0.370254 13.1154 0.22419 12.876 0.128681 12.6152C0.0331723 12.3545 -0.00990605 12.0775 0.0019109 11.8V9.40005C0.0019109 9.24092 0.065216 9.08831 0.1779 8.97579C0.290584 8.86326 0.443416 8.80005 0.602775 8.80005C0.762134 8.80005 0.914966 8.86326 1.02765 8.97579C1.14033 9.08831 1.20364 9.24092 1.20364 9.40005V11.8C1.18295 12.0376 1.25463 12.274 1.40379 12.4602C1.55296 12.6463 1.76817 12.7681 2.00479 12.8H11.9952C12.2318 12.7681 12.447 12.6463 12.5962 12.4602C12.7453 12.274 12.817 12.0376 12.7963 11.8V9.40005C12.7963 9.24092 12.8596 9.08831 12.9723 8.97579C13.085 8.86326 13.2378 8.80005 13.3972 8.80005C13.5565 8.80005 13.7094 8.86326 13.8221 8.97579C13.9347 9.08831 13.998 9.24092 13.998 9.40005V11.8C14.022 12.3563 13.8251 12.8996 13.45 13.3116C13.0749 13.7236 12.552 13.971 11.9952 14Z",fill:"currentColor"},null,-1),FH=[zH];function jH(t,e,n,i,r,o){return g(),T("svg",O({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),FH,16)}s3.render=jH;var HH={root:function(e){var n=e.props;return"p-message p-component p-message-"+n.severity},wrapper:"p-message-wrapper",icon:"p-message-icon",text:"p-message-text",closeButton:"p-message-close p-link",closeIcon:"p-message-close-icon"},UH=Xt.extend({name:"message",classes:HH}),KH={name:"BaseMessage",extends:It,props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:void 0},closeIcon:{type:String,default:void 0},closeButtonProps:{type:null,default:null}},style:UH,provide:function(){return{$parentInstance:this}}},a3={name:"Message",extends:KH,inheritAttrs:!1,emits:["close","life-end"],timeout:null,data:function(){return{visible:!0}},watch:{sticky:function(e){e||this.closeAfterDelay()}},mounted:function(){this.sticky||this.closeAfterDelay()},methods:{close:function(e){this.visible=!1,this.$emit("close",e)},closeAfterDelay:function(){var e=this;setTimeout(function(){e.visible=!1,e.$emit("life-end")},this.life)}},computed:{iconComponent:function(){return{info:Pl,success:Co,warn:El,error:sa}[this.severity]},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{ripple:gi},components:{TimesIcon:vr,InfoCircleIcon:Pl,CheckIcon:Co,ExclamationTriangleIcon:El,TimesCircleIcon:sa}};function Pu(t){"@babel/helpers - typeof";return Pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pu(t)}function l3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Bs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?l3(Object(n),!0).forEach(function(i){WH(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l3(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function WH(t,e,n){return e=qH(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qH(t){var e=XH(t,"string");return Pu(e)=="symbol"?e:String(e)}function XH(t,e){if(Pu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Pu(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var GH=["aria-label"];function ZH(t,e,n,i,r,o){var s=et("TimesIcon"),a=an("ripple");return g(),L(Vr,O({name:"p-message",appear:""},t.ptmi("transition")),{default:z(function(){return[ft(E("div",O({class:t.cx("root"),role:"alert","aria-live":"assertive","aria-atomic":"true"},t.ptm("root")),[t.$slots.container?ee(t.$slots,"container",{key:0,onClose:o.close,closeCallback:o.close}):(g(),T("div",O({key:1,class:t.cx("wrapper")},t.ptm("wrapper")),[ee(t.$slots,"messageicon",{class:"p-message-icon"},function(){return[(g(),L(yt(t.icon?"span":o.iconComponent),O({class:[t.cx("icon"),t.icon]},t.ptm("icon")),null,16,["class"]))]}),E("div",O({class:["p-message-text",t.cx("text")]},t.ptm("text")),[ee(t.$slots,"default")],16),t.closable?ft((g(),T("button",O({key:0,class:t.cx("closeButton"),"aria-label":o.closeAriaLabel,type:"button",onClick:e[0]||(e[0]=function(l){return o.close(l)})},Bs(Bs(Bs({},t.closeButtonProps),t.ptm("button")),t.ptm("closeButton"))),[ee(t.$slots,"closeicon",{},function(){return[t.closeIcon?(g(),T("i",O({key:0,class:[t.cx("closeIcon"),t.closeIcon]},Bs(Bs({},t.ptm("buttonIcon")),t.ptm("closeIcon"))),null,16)):(g(),L(s,O({key:1,class:[t.cx("closeIcon"),t.closeIcon]},Bs(Bs({},t.ptm("buttonIcon")),t.ptm("closeIcon"))),null,16,["class"]))]})],16,GH)),[[a]]):N("",!0)],16))],16),[[Zn,r.visible]])]}),_:3},16)}a3.render=ZH;var _H={root:function(e){var n=e.instance;return["p-progressbar p-component",{"p-progressbar-determinate":n.determinate,"p-progressbar-indeterminate":n.indeterminate}]},container:"p-progressbar-indeterminate-container",value:"p-progressbar-value p-progressbar-value-animate",label:"p-progressbar-label"},JH=Xt.extend({name:"progressbar",classes:_H}),YH={name:"BaseProgressBar",extends:It,props:{value:{type:Number,default:null},mode:{type:String,default:"determinate"},showValue:{type:Boolean,default:!0}},style:JH,provide:function(){return{$parentInstance:this}}},u3={name:"ProgressBar",extends:YH,inheritAttrs:!1,computed:{progressStyle:function(){return{width:this.value+"%",display:"flex"}},indeterminate:function(){return this.mode==="indeterminate"},determinate:function(){return this.mode==="determinate"}}},QH=["aria-valuenow"];function eU(t,e,n,i,r,o){return g(),T("div",O({role:"progressbar",class:t.cx("root"),"aria-valuemin":"0","aria-valuenow":t.value,"aria-valuemax":"100"},t.ptmi("root")),[o.determinate?(g(),T("div",O({key:0,class:t.cx("value"),style:o.progressStyle},t.ptm("value")),[t.value!=null&&t.value!==0&&t.showValue?(g(),T("div",O({key:0,class:t.cx("label")},t.ptm("label")),[ee(t.$slots,"default",{},function(){return[ht(_(t.value+"%"),1)]})],16)):N("",!0)],16)):N("",!0),o.indeterminate?(g(),T("div",O({key:1,class:t.cx("container")},t.ptm("container")),[E("div",O({class:t.cx("value")},t.ptm("value")),null,16)],16)):N("",!0)],16,QH)}u3.render=eU;var tU={root:function(e){var n=e.props;return["p-fileupload p-fileupload-".concat(n.mode," p-component")]},buttonbar:"p-fileupload-buttonbar",chooseButton:function(e){var n=e.instance,i=e.props;return["p-button p-component p-fileupload-choose",{"p-fileupload-choose-selected":i.mode==="basic"&&n.hasFiles,"p-disabled":i.disabled,"p-focus":n.focused}]},chooseIcon:"p-button-icon p-button-icon-left",chooseButtonLabel:"p-button-label",content:"p-fileupload-content",empty:"p-fileupload-empty",uploadIcon:"p-button-icon p-button-icon-left",label:"p-button-label",file:"p-fileupload-file",thumbnail:"p-fileupload-file-thumbnail",details:"p-fileupload-file-details",fileName:"p-fileupload-file-name",fileSize:"p-fileupload-file-size",badge:"p-fileupload-file-badge",actions:"p-fileupload-file-actions",removeButton:"p-fileupload-file-remove"},nU=Xt.extend({name:"fileupload",classes:tU}),iU={name:"BaseFileUpload",extends:It,props:{name:{type:String,default:null},url:{type:String,default:null},mode:{type:String,default:"advanced"},multiple:{type:Boolean,default:!1},accept:{type:String,default:null},disabled:{type:Boolean,default:!1},auto:{type:Boolean,default:!1},maxFileSize:{type:Number,default:null},invalidFileSizeMessage:{type:String,default:"{0}: Invalid file size, file size should be smaller than {1}."},invalidFileTypeMessage:{type:String,default:"{0}: Invalid file type, allowed file types: {1}."},fileLimit:{type:Number,default:null},invalidFileLimitMessage:{type:String,default:"Maximum number of files exceeded, limit is {0} at most."},withCredentials:{type:Boolean,default:!1},previewWidth:{type:Number,default:50},chooseLabel:{type:String,default:null},uploadLabel:{type:String,default:null},cancelLabel:{type:String,default:null},customUpload:{type:Boolean,default:!1},showUploadButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},chooseIcon:{type:String,default:void 0},uploadIcon:{type:String,default:void 0},cancelIcon:{type:String,default:void 0},style:null,class:null},style:nU,provide:function(){return{$parentInstance:this}}},c3={name:"FileContent",hostName:"FileUpload",extends:It,emits:["remove"],props:{files:{type:Array,default:function(){return[]}},badgeSeverity:{type:String,default:"warning"},badgeValue:{type:String,default:null},previewWidth:{type:Number,default:50},templates:{type:null,default:null}},methods:{formatSize:function(e){var n,i=1024,r=3,o=((n=this.$primevue.config.locale)===null||n===void 0?void 0:n.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e===0)return"0 ".concat(o[0]);var s=Math.floor(Math.log(e)/Math.log(i)),a=parseFloat((e/Math.pow(i,s)).toFixed(r));return"".concat(a," ").concat(o[s])}},components:{FileUploadButton:wo,FileUploadBadge:Wp,TimesIcon:vr}},rU=["alt","src","width"];function oU(t,e,n,i,r,o){var s=et("FileUploadBadge"),a=et("TimesIcon"),l=et("FileUploadButton");return g(!0),T(le,null,_e(n.files,function(u,c){return g(),T("div",O({key:u.name+u.type+u.size,class:t.cx("file")},t.ptm("file")),[E("img",O({role:"presentation",class:t.cx("thumbnail"),alt:u.name,src:u.objectURL,width:n.previewWidth},t.ptm("thumbnail")),null,16,rU),E("div",O({class:t.cx("details")},t.ptm("details")),[E("div",O({class:t.cx("fileName")},t.ptm("fileName")),_(u.name),17),E("span",O({class:t.cx("fileSize")},t.ptm("fileSize")),_(o.formatSize(u.size)),17),I(s,{value:n.badgeValue,class:pe(t.cx("badge")),severity:n.badgeSeverity,unstyled:t.unstyled,pt:t.ptm("badge")},null,8,["value","class","severity","unstyled","pt"])],16),E("div",O({class:t.cx("actions")},t.ptm("actions")),[I(l,{onClick:function(f){return t.$emit("remove",c)},text:"",rounded:"",severity:"danger",class:pe(t.cx("removeButton")),unstyled:t.unstyled,pt:t.ptm("removeButton")},{icon:z(function(d){return[n.templates.fileremoveicon?(g(),L(yt(n.templates.fileremoveicon),{key:0,class:pe(d.class),file:u,index:c},null,8,["class","file","index"])):(g(),L(a,O({key:1,class:d.class,"aria-hidden":"true"},t.ptm("removeButton").icon),null,16,["class"]))]}),_:2},1032,["onClick","class","unstyled","pt"])],16)],16)}),128)}c3.render=oU;function xg(t){return lU(t)||aU(t)||d3(t)||sU()}function sU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
304
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aU(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function lU(t){if(Array.isArray(t))return Mg(t)}function tf(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=d3(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(u){throw u},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
305
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var u=n.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function d3(t,e){if(t){if(typeof t=="string")return Mg(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mg(t,e)}}function Mg(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var f3={name:"FileUpload",extends:iU,inheritAttrs:!1,emits:["select","uploader","before-upload","progress","upload","error","before-send","clear","remove","remove-uploaded-file"],duplicateIEEvent:!1,data:function(){return{uploadedFileCount:0,files:[],messages:[],focused:!1,progress:null,uploadedFiles:[]}},methods:{onFileSelect:function(e){if(e.type!=="drop"&&this.isIE11()&&this.duplicateIEEvent){this.duplicateIEEvent=!1;return}this.messages=[],this.files=this.files||[];var n=e.dataTransfer?e.dataTransfer.files:e.target.files,i=tf(n),r;try{for(i.s();!(r=i.n()).done;){var o=r.value;this.isFileSelected(o)||this.validate(o)&&(this.isImage(o)&&(o.objectURL=window.URL.createObjectURL(o)),this.files.push(o))}}catch(s){i.e(s)}finally{i.f()}this.$emit("select",{originalEvent:e,files:this.files}),this.fileLimit&&this.checkFileLimit(),this.auto&&this.hasFiles&&!this.isFileLimitExceeded()&&this.upload(),e.type!=="drop"&&this.isIE11()?this.clearIEInput():this.clearInputElement()},choose:function(){this.$refs.fileInput.click()},upload:function(){var e=this;if(this.customUpload)this.fileLimit&&(this.uploadedFileCount+=this.files.length),this.$emit("uploader",{files:this.files}),this.clear();else{var n=new XMLHttpRequest,i=new FormData;this.$emit("before-upload",{xhr:n,formData:i});var r=tf(this.files),o;try{for(r.s();!(o=r.n()).done;){var s=o.value;i.append(this.name,s,s.name)}}catch(a){r.e(a)}finally{r.f()}n.upload.addEventListener("progress",function(a){a.lengthComputable&&(e.progress=Math.round(a.loaded*100/a.total)),e.$emit("progress",{originalEvent:a,progress:e.progress})}),n.onreadystatechange=function(){if(n.readyState===4){var a;e.progress=0,n.status>=200&&n.status<300?(e.fileLimit&&(e.uploadedFileCount+=e.files.length),e.$emit("upload",{xhr:n,files:e.files})):e.$emit("error",{xhr:n,files:e.files}),(a=e.uploadedFiles).push.apply(a,xg(e.files)),e.clear()}},n.open("POST",this.url,!0),this.$emit("before-send",{xhr:n,formData:i}),n.withCredentials=this.withCredentials,n.send(i)}},clear:function(){this.files=[],this.messages=null,this.$emit("clear"),this.isAdvanced&&this.clearInputElement()},onFocus:function(){this.focused=!0},onBlur:function(){this.focused=!1},isFileSelected:function(e){if(this.files&&this.files.length){var n=tf(this.files),i;try{for(n.s();!(i=n.n()).done;){var r=i.value;if(r.name+r.type+r.size===e.name+e.type+e.size)return!0}}catch(o){n.e(o)}finally{n.f()}}return!1},isIE11:function(){return!!window.MSInputMethodContext&&!!document.documentMode},validate:function(e){return this.accept&&!this.isFileTypeValid(e)?(this.messages.push(this.invalidFileTypeMessage.replace("{0}",e.name).replace("{1}",this.accept)),!1):this.maxFileSize&&e.size>this.maxFileSize?(this.messages.push(this.invalidFileSizeMessage.replace("{0}",e.name).replace("{1}",this.formatSize(this.maxFileSize))),!1):!0},isFileTypeValid:function(e){var n=this.accept.split(",").map(function(a){return a.trim()}),i=tf(n),r;try{for(i.s();!(r=i.n()).done;){var o=r.value,s=this.isWildcard(o)?this.getTypeClass(e.type)===this.getTypeClass(o):e.type==o||this.getFileExtension(e).toLowerCase()===o.toLowerCase();if(s)return!0}}catch(a){i.e(a)}finally{i.f()}return!1},getTypeClass:function(e){return e.substring(0,e.indexOf("/"))},isWildcard:function(e){return e.indexOf("*")!==-1},getFileExtension:function(e){return"."+e.name.split(".").pop()},isImage:function(e){return/^image\//.test(e.type)},onDragEnter:function(e){this.disabled||(e.stopPropagation(),e.preventDefault())},onDragOver:function(e){this.disabled||(!this.isUnstyled&&G.addClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!0),e.stopPropagation(),e.preventDefault())},onDragLeave:function(){this.disabled||(!this.isUnstyled&&G.removeClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1))},onDrop:function(e){if(!this.disabled){!this.isUnstyled&&G.removeClass(this.$refs.content,"p-fileupload-highlight"),this.$refs.content.setAttribute("data-p-highlight",!1),e.stopPropagation(),e.preventDefault();var n=e.dataTransfer?e.dataTransfer.files:e.target.files,i=this.multiple||n&&n.length===1;i&&this.onFileSelect(e)}},onBasicUploaderClick:function(e){this.hasFiles?this.upload():e.button===0&&this.$refs.fileInput.click()},remove:function(e){this.clearInputElement();var n=this.files.splice(e,1)[0];this.files=xg(this.files),this.$emit("remove",{file:n,files:this.files})},removeUploadedFile:function(e){var n=this.uploadedFiles.splice(e,1)[0];this.uploadedFiles=xg(this.uploadedFiles),this.$emit("remove-uploaded-file",{file:n,files:this.uploadedFiles})},clearInputElement:function(){this.$refs.fileInput.value=""},clearIEInput:function(){this.$refs.fileInput&&(this.duplicateIEEvent=!0,this.$refs.fileInput.value="")},formatSize:function(e){var n,i=1024,r=3,o=((n=this.$primevue.config.locale)===null||n===void 0?void 0:n.fileSizeTypes)||["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e===0)return"0 ".concat(o[0]);var s=Math.floor(Math.log(e)/Math.log(i)),a=parseFloat((e/Math.pow(i,s)).toFixed(r));return"".concat(a," ").concat(o[s])},isFileLimitExceeded:function(){return this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount&&this.focused&&(this.focused=!1),this.fileLimit&&this.fileLimit<this.files.length+this.uploadedFileCount},checkFileLimit:function(){this.isFileLimitExceeded()&&this.messages.push(this.invalidFileLimitMessage.replace("{0}",this.fileLimit.toString()))},onMessageClose:function(){this.messages=null}},computed:{isAdvanced:function(){return this.mode==="advanced"},isBasic:function(){return this.mode==="basic"},chooseButtonClass:function(){return[this.cx("chooseButton"),this.class]},basicChooseButtonLabel:function(){return this.auto?this.chooseButtonLabel:this.hasFiles?this.files.map(function(e){return e.name}).join(", "):this.chooseButtonLabel},hasFiles:function(){return this.files&&this.files.length>0},hasUploadedFiles:function(){return this.uploadedFiles&&this.uploadedFiles.length>0},chooseDisabled:function(){return this.disabled||this.fileLimit&&this.fileLimit<=this.files.length+this.uploadedFileCount},uploadDisabled:function(){return this.disabled||!this.hasFiles||this.fileLimit&&this.fileLimit<this.files.length},cancelDisabled:function(){return this.disabled||!this.hasFiles},chooseButtonLabel:function(){return this.chooseLabel||this.$primevue.config.locale.choose},uploadButtonLabel:function(){return this.uploadLabel||this.$primevue.config.locale.upload},cancelButtonLabel:function(){return this.cancelLabel||this.$primevue.config.locale.cancel},completedLabel:function(){return this.$primevue.config.locale.completed},pendingLabel:function(){return this.$primevue.config.locale.pending}},components:{FileUploadButton:wo,FileUploadProgressBar:u3,FileUploadMessage:a3,FileContent:c3,PlusIcon:o3,UploadIcon:s3,TimesIcon:vr},directives:{ripple:gi}},uU=["multiple","accept","disabled"],cU=["accept","disabled","multiple"];function dU(t,e,n,i,r,o){var s=et("FileUploadButton"),a=et("FileUploadProgressBar"),l=et("FileContent"),u=et("FileUploadMessage"),c=an("ripple");return o.isAdvanced?(g(),T("div",O({key:0,class:t.cx("root")},t.ptmi("root")),[E("input",O({ref:"fileInput",type:"file",onChange:e[0]||(e[0]=function(){return o.onFileSelect&&o.onFileSelect.apply(o,arguments)}),multiple:t.multiple,accept:t.accept,disabled:o.chooseDisabled},t.ptm("input")),null,16,uU),E("div",O({class:t.cx("buttonbar")},t.ptm("buttonbar")),[ee(t.$slots,"header",{files:r.files,uploadedFiles:r.uploadedFiles,chooseCallback:o.choose,uploadCallback:o.upload,clearCallback:o.clear},function(){return[ft((g(),T("span",O({class:o.chooseButtonClass,style:t.style,onClick:e[1]||(e[1]=function(){return o.choose&&o.choose.apply(o,arguments)}),onKeydown:e[2]||(e[2]=zn(function(){return o.choose&&o.choose.apply(o,arguments)},["enter"])),onFocus:e[3]||(e[3]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[4]||(e[4]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),tabindex:"0"},t.ptm("chooseButton")),[ee(t.$slots,"chooseicon",{class:pe(t.cx("chooseIcon"))},function(){return[(g(),L(yt(t.chooseIcon?"span":"PlusIcon"),O({class:[t.cx("chooseIcon"),t.chooseIcon],"aria-hidden":"true"},t.ptm("chooseIcon")),null,16,["class"]))]}),E("span",O({class:t.cx("chooseButtonLabel")},t.ptm("chooseButtonLabel")),_(o.chooseButtonLabel),17)],16)),[[c]]),t.showUploadButton?(g(),L(s,{key:0,label:o.uploadButtonLabel,onClick:o.upload,disabled:o.uploadDisabled,unstyled:t.unstyled,pt:t.ptm("uploadButton")},{icon:z(function(d){return[ee(t.$slots,"uploadicon",{},function(){return[(g(),L(yt(t.uploadIcon?"span":"UploadIcon"),O({class:[d.class,t.uploadIcon],"aria-hidden":"true"},t.ptm("uploadButton").icon,{"data-pc-section":"uploadbuttonicon"}),null,16,["class"]))]})]}),_:3},8,["label","onClick","disabled","unstyled","pt"])):N("",!0),t.showCancelButton?(g(),L(s,{key:1,label:o.cancelButtonLabel,onClick:o.clear,disabled:o.cancelDisabled,unstyled:t.unstyled,pt:t.ptm("cancelButton")},{icon:z(function(d){return[ee(t.$slots,"cancelicon",{},function(){return[(g(),L(yt(t.cancelIcon?"span":"TimesIcon"),O({class:[d.class,t.cancelIcon],"aria-hidden":"true"},t.ptm("cancelButton").icon,{"data-pc-section":"cancelbuttonicon"}),null,16,["class"]))]})]}),_:3},8,["label","onClick","disabled","unstyled","pt"])):N("",!0)]})],16),E("div",O({ref:"content",class:t.cx("content"),onDragenter:e[5]||(e[5]=function(){return o.onDragEnter&&o.onDragEnter.apply(o,arguments)}),onDragover:e[6]||(e[6]=function(){return o.onDragOver&&o.onDragOver.apply(o,arguments)}),onDragleave:e[7]||(e[7]=function(){return o.onDragLeave&&o.onDragLeave.apply(o,arguments)}),onDrop:e[8]||(e[8]=function(){return o.onDrop&&o.onDrop.apply(o,arguments)})},t.ptm("content"),{"data-p-highlight":!1}),[ee(t.$slots,"content",{files:r.files,uploadedFiles:r.uploadedFiles,removeUploadedFileCallback:o.removeUploadedFile,removeFileCallback:o.remove,progress:r.progress,messages:r.messages},function(){return[o.hasFiles?(g(),T(le,{key:0},[I(a,{value:r.progress,showValue:!1,unstyled:t.unstyled,pt:t.ptm("progressbar")},null,8,["value","unstyled","pt"]),I(l,{files:r.files,onRemove:o.remove,badgeValue:o.pendingLabel,previewWidth:t.previewWidth,templates:t.$slots,unstyled:t.unstyled,pt:t.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])],64)):N("",!0),(g(!0),T(le,null,_e(r.messages,function(d){return g(),L(u,{key:d,severity:"error",onClose:o.onMessageClose,unstyled:t.unstyled,pt:t.ptm("message")},{default:z(function(){return[ht(_(d),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),I(l,{files:r.uploadedFiles,onRemove:o.removeUploadedFile,badgeValue:o.completedLabel,badgeSeverity:"success",previewWidth:t.previewWidth,templates:t.$slots,unstyled:t.unstyled,pt:t.pt},null,8,["files","onRemove","badgeValue","previewWidth","templates","unstyled","pt"])]}),t.$slots.empty&&!o.hasFiles&&!o.hasUploadedFiles?(g(),T("div",O({key:0,class:t.cx("empty")},t.ptm("empty")),[ee(t.$slots,"empty")],16)):N("",!0)],16)],16)):o.isBasic?(g(),T("div",O({key:1,class:t.cx("root")},t.ptmi("root")),[(g(!0),T(le,null,_e(r.messages,function(d){return g(),L(u,{key:d,severity:"error",onClose:o.onMessageClose,unstyled:t.unstyled,pt:t.ptm("messages")},{default:z(function(){return[ht(_(d),1)]}),_:2},1032,["onClose","unstyled","pt"])}),128)),ft((g(),T("span",O({class:o.chooseButtonClass,style:t.style,onMouseup:e[12]||(e[12]=function(){return o.onBasicUploaderClick&&o.onBasicUploaderClick.apply(o,arguments)}),onKeydown:e[13]||(e[13]=zn(function(){return o.choose&&o.choose.apply(o,arguments)},["enter"])),onFocus:e[14]||(e[14]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[15]||(e[15]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),tabindex:"0"},t.ptm("chooseButton")),[!o.hasFiles||t.auto?ee(t.$slots,"uploadicon",{key:0,class:pe(t.cx("uploadIcon"))},function(){return[(g(),L(yt(t.uploadIcon?"span":"UploadIcon"),O({class:[t.cx("uploadIcon"),t.uploadIcon],"aria-hidden":"true"},t.ptm("uploadIcon")),null,16,["class"]))]}):ee(t.$slots,"chooseicon",{key:1,class:pe(t.cx("chooseIcon"))},function(){return[(g(),L(yt(t.chooseIcon?"span":"PlusIcon"),O({class:[t.cx("chooseIcon"),t.chooseIcon],"aria-hidden":"true"},t.ptm("chooseIcon")),null,16,["class"]))]}),E("span",O({class:t.cx("label")},t.ptm("label")),_(o.basicChooseButtonLabel),17),o.hasFiles?N("",!0):(g(),T("input",O({key:2,ref:"fileInput",type:"file",accept:t.accept,disabled:t.disabled,multiple:t.multiple,onChange:e[9]||(e[9]=function(){return o.onFileSelect&&o.onFileSelect.apply(o,arguments)}),onFocus:e[10]||(e[10]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[11]||(e[11]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)})},t.ptm("input")),null,16,cU))],16)),[[c]])],16)):N("",!0)}f3.render=dU;const fU={class:"'!mt-0 font-light text-xs text-general-500'"},pU=1048576,HZ=ce("FileUpload",ye({__name:"FileUpload",props:Cn({accept:{},disabled:{type:Boolean},maxFileSize:{},modelValue:{},multiple:{type:Boolean,default:!1},invalidFileSizeMessage:{},invalidFileTypeMessage:{},label:{default:"Upload File"},withUpload:{type:Boolean,default:!0},uploadLabel:{default:"Upload"},placeholder:{default:"Select File"},fileExtensions:{},fileRequirements:{},uploadFunction:{},useValidator:{type:Boolean},fieldName:{default:"fileUpload"},mandatory:{type:Boolean},useErrorToast:{type:Boolean,default:!0},validatorMessage:{},validatorMessageClass:{}},{modelValue:{},modelModifiers:{}}),emits:Cn(["select","update:modelValue","upload","error"],["update:modelValue"]),setup(t,{emit:e}){const n=vo(),i=si(t,"modelValue"),r=t,o=e,{fileupload:s={}}=dt("preset",{}),a=oe(),l=oe(),u=oe(),c=re(),d=sn({value:void 0}),f=W(()=>!!d.errorMessage||(k.value?k.value.length>0:!1)),p=oe(!1);bt(()=>{r.useValidator&&Object.assign(d,Ln(r.fieldName,y=>h(y))),i.value&&(Array.isArray(i.value)&&r.multiple?(u.value=i.value,a.value=i.value.map(y=>y.name)):i.value instanceof File&&(u.value=i.value,a.value=i.value.name))});const h=y=>{if(typeof r.validatorMessage=="string")return r.validatorMessage;if(typeof r.validatorMessage!="string"){const{empty:C}=r.validatorMessage??{};if(!y&&r.mandatory&&!u.value)return C??!0}return!0},m=y=>{if(!r.useErrorToast&&typeof r.validatorMessage!="string"){const{exceed:C,invalidFormat:P}=r.validatorMessage;y.includes("Invalid file size")&&C?l.value=C:y.includes("Invalid file type")?l.value=P:l.value=void 0}},v=y=>{var C;try{if(!y.files||y.files.length===0)return;r.multiple?(u.value=y.files,a.value=y.files.map(P=>P.name),o("select",y.files)):(u.value=y.files[0],a.value=(C=y.files[0])==null?void 0:C.name,o("select",y.files[0]))}catch(P){console.error(P)}},S=(y,C)=>{r.disabled||p.value||(k.value=void 0,new Promise((P,R)=>{try{C(),P()}catch(M){R(M)}}).then(()=>{y()}))},b=async(y,C)=>{try{p.value=!0,r.uploadFunction&&await r.uploadFunction(y),u.value=void 0,a.value=void 0,C(),p.value=!1}catch(P){throw p.value=!1,P}},k=re(),A=y=>{k.value=y},w=(y,C,P)=>{(y.key==="Enter"||y.key===" ")&&S(C,P)};return Re(u,y=>{d.value=y,i.value=y,k.value=void 0,l.value=void 0}),Re(i,y=>{Array.isArray(y)&&r.multiple?(u.value=y,a.value=y.map(C=>C.name)):y instanceof File?(u.value=y,a.value=y.name):(u.value=void 0,a.value=void 0),d.value=y,"messages"in c.value&&(c.value.messages=[]),k.value=void 0,l.value=void 0}),Re(k,y=>{if(y&&y.length>0){const C=y[0].replace("{2}",r.accept||"").replace("{2.1}",r.fileExtensions||"");C.includes("Invalid file size")&&o("error","FILE_SIZE_TOO_LARGE"),m(C),r.useErrorToast&&n.add({message:C,severity:"error"}),u.value=void 0,a.value=void 0}else l.value=void 0}),(y,C)=>(g(),L(x(f3),O(r,{ref_key:"fileUpload",ref:c,"file-limit":y.multiple?void 0:1,pt:{input:{style:"display: none"}},onSelect:v,onUpload:C[0]||(C[0]=P=>y.$emit("upload",P))}),{header:z(({files:P,chooseCallback:R,clearCallback:M})=>[E("div",{class:pe([{"grid-cols-[auto,max-content]":r.withUpload},"grid gap-3 items-end"])},[I(Yn,O(x(s).wrapper,{"error-messages":k.value,label:r.label,mandatory:r.mandatory}),{default:z(()=>[I(Ia,{disabled:r.disabled||p.value,"input-class":x(s).input({state:{fileName:a.value}}).class,invalid:f.value,"model-value":Array.isArray(a.value)?a.value.join(", "):a.value,placeholder:r.placeholder,onClick:D=>S(R,M),onKeydown:xt(D=>w(D,R,M),["prevent"])},{"addon-left":z(()=>C[1]||(C[1]=[ht(" Browse")])),_:2},1032,["disabled","input-class","invalid","model-value","placeholder","onClick","onKeydown"]),r.fileExtensions||r.fileRequirements||d.errorMessage||l.value||r.validatorMessage?(g(),T("div",{key:0,class:pe([{"justify-between":d.errorMessage||l.value,"justify-end":(!d.errorMessage||!l.value)&&r.validatorMessage},"flex w-full"])},[I(Rn,{class:pe(r.validatorMessageClass),message:l.value??d.errorMessage},null,8,["class","message"]),r.fileExtensions||r.fileRequirements?(g(),T("div",it(O({key:0},x(s).requirements)),[E("small",fU,[y.fileRequirements?(g(),T(le,{key:0},[ht(_(y.fileRequirements),1)],64)):(g(),T(le,{key:1},[ht(_(r.maxFileSize?`${r.fileExtensions}. max file ${Math.round(r.maxFileSize/pU)} MB`:`${r.fileExtensions} file`),1)],64))])],16)):N("",!0)],2)):N("",!0)]),_:2},1040,["error-messages","label","mandatory"]),r.withUpload?(g(),L(We,O({key:0},x(s).buttonupload({props:r}),{disabled:r.disabled||p.value||!u.value,label:r.uploadLabel,onClick:D=>b(P,M),severity:"success",type:"button"}),null,16,["disabled","label","onClick"])):N("",!0)],2)]),content:z(({messages:P})=>[ht(_(A(P)),1)]),_:1},16,["file-limit"]))}}));var Iu={exports:{}},hU=Iu.exports,p3;function mU(){return p3||(p3=1,function(t,e){(function(){function n(i,r){r=r||"";for(var o=1024,s=window.atob(i),a=[],l=0,u=s.length;l<u;l+=o){for(var c=s.slice(l,l+o),d=new Array(c.length),f=0;f<c.length;f++)d[f]=c.charCodeAt(f);var p=new Uint8Array(d);a.push(p)}return new Blob(a,{type:r})}t.exports&&(e=t.exports=n),e.base64ToBlob=n}).call(hU)}(Iu,Iu.exports)),Iu.exports}var gU=mU();const vU=Vl(gU);function h3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Gt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?h3(Object(n),!0).forEach(function(i){Ji(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h3(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Ji(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yU(t,e){if(t==null)return{};var n,i,r=function(s,a){if(s==null)return{};var l,u,c={},d=Object.keys(s);for(u=0;u<d.length;u++)l=d[u],a.indexOf(l)>=0||(c[l]=s[l]);return c}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function $s(t){return function(e){if(Array.isArray(e))return Eg(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,n){if(e){if(typeof e=="string")return Eg(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Eg(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
306
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Eg(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var m3,bU,nf,Fn=(m3=function(t){/*!
307
+ Copyright (c) 2018 Jed Watson.
308
+ Licensed under the MIT License (MIT), see
309
+ http://jedwatson.github.io/classnames
310
+ */(function(){var e={}.hasOwnProperty;function n(){for(var i=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var s=typeof o;if(s==="string"||s==="number")i.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&i.push(a)}}else if(s==="object")if(o.toString===Object.prototype.toString)for(var l in o)e.call(o,l)&&o[l]&&i.push(l);else i.push(o.toString())}}return i.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()},m3(nf={path:bU,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e==null&&nf.path)}},nf.exports),nf.exports),hr=function(t){return function(e,n){if(!e)return t;var i;typeof e=="string"?i=e:n=e;var r=t;return i&&(r+="__"+i),r+(n?Object.keys(n).reduce(function(o,s){var a=n[s];return a&&(o+=" "+(typeof a=="boolean"?r+"--"+s:r+"--"+s+"_"+a)),o},""):"")}};function Pg(t,e,n){var i,r,o,s,a;function l(){var c=Date.now()-s;c<e&&c>=0?i=setTimeout(l,e-c):(i=null,n||(a=t.apply(o,r),o=r=null))}e==null&&(e=100);var u=function(){o=this,r=arguments,s=Date.now();var c=n&&!i;return i||(i=setTimeout(l,e)),c&&(a=t.apply(o,r),o=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=t.apply(o,r),o=r=null,clearTimeout(i),i=null)},u}Pg.debounce=Pg;var Ig=Pg,pt=function(){return pt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pt.apply(this,arguments)};/*! *****************************************************************************
311
+ Copyright (c) Microsoft Corporation.
312
+
313
+ Permission to use, copy, modify, and/or distribute this software for any
314
+ purpose with or without fee is hereby granted.
315
+
316
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
317
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
318
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
319
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
320
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
321
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
322
+ PERFORMANCE OF THIS SOFTWARE.
323
+ ***************************************************************************** */function g3(t,e){var n,i;return t&&e?(n=""+t+e[0].toUpperCase()+e.slice(1),i=t+"-"+e):(n=t||e,i=t||e),{name:n,classname:i}}function v3(t){return/^blob:/.test(t)}function y3(t){return v3(t)||function(e){return/^data:/.test(e)}(t)}function La(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Gn(t){return t===void 0}function rf(t){return typeof t=="object"&&t!==null}function Lg(t,e,n){var i={};return rf(t)?(Object.keys(e).forEach(function(r){Gn(t[r])?i[r]=e[r]:rf(e[r])?rf(t[r])?i[r]=Lg(t[r],e[r],n[r]):i[r]=t[r]?e[r]:n[r]:e[r]===!0||e[r]===!1?i[r]=!!t[r]:i[r]=t[r]}),i):t?e:n}function of(t){var e=Number(t);return Number.isNaN(e)?t:e}function b3(t){return typeof(t=="number"||function(e){return typeof e=="object"&&e!==null}(t)&&toString.call(t)=="[object Number]")&&!A3(t)}function A3(t){return t!=t}function w3(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var Lu=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},AU=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},Dg=function(t){this.type="move",this.directions=t},wU=function(){function t(e,n,i,r,o){this.type="drag",this.nativeEvent=e,this.position=i,this.previousPosition=r,this.element=n,this.anchor=o}return t.prototype.shift=function(){var e=this,n=e.element,i=e.anchor,r=e.position;if(n){var o=n.getBoundingClientRect(),s=o.left,a=o.top;return{left:r.left-s-i.left,top:r.top-a-i.top}}return{left:0,top:0}},t}(),Rg={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=$s(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,n){return{clientX:e.clientX+n.clientX/t.touches.length,clientY:e.clientY+n.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),n=e.left,i=e.right,r=e.bottom,o=e.top;this.anchor={left:t.clientX-n,top:t.clientY-o,bottom:r-t.clientY,right:i-t.clientX}},processMove:function(t,e){var n=$s(e);if(this.touches.length){if(this.touches.length===1&&n.length===1){var i=this.$refs.draggable;this.$emit("drag",new wU(t,i,{left:n[0].clientX,top:n[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=n}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};Rg.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"draggable",class:n.classname,onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)}),onMouseover:e[3]||(e[3]=function(){return o.onMouseOver&&o.onMouseOver.apply(o,arguments)}),onMouseleave:e[4]||(e[4]=function(){return o.onMouseLeave&&o.onMouseLeave.apply(o,arguments)})},[ee(t.$slots,"default")],34)};var Ng=hr("vue-handler-wrapper"),S3={name:"HandlerWrapper",components:{DraggableElement:Rg},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,n=g3(this.horizontalPosition,this.verticalPosition);t=Ng((Ji(e={},n.classname,!0),Ji(e,"disabled",this.disabled),e))}else t=Ng({disabled:this.disabled});return{root:t,draggable:Ng("draggable")}}},emits:["leave","enter","drag","drag-end"]};S3.render=function(t,e,n,i,r,o){var s=et("DraggableElement");return g(),L("div",{class:o.classes.root},[I(s,{class:o.classes.draggable,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:z(function(){return[ee(t.$slots,"default")]}),_:3},8,["class"])],2)};var SU=hr("vue-line-wrapper"),C3={name:"LineWrapper",components:{DraggableElement:Rg},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return SU((Ji(t={},this.position,!0),Ji(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"]};C3.render=function(t,e,n,i,r,o){var s=et("DraggableElement");return g(),L(s,{class:o.classname,onDrag:e[1]||(e[1]=function(a){return t.$emit("drag",a)}),onDragEnd:e[2]||(e[2]=function(a){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(a){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(a){return t.$emit("enter")})},{default:z(function(){return[ee(t.$slots,"default")]}),_:3},8,["class"])};var Pr=["left","right","top","bottom"],CU=["left","right"],kU=["top","bottom"],OU=["left","top"],TU=["fill-area","fit-area","stencil","none"],k3={left:0,top:0,width:0,height:0};function O3(t,e,n){return!(n=n||["width","height","left","top"]).some(function(i){return t[i]!==e[i]})}function Ir(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function Da(t,e){return{left:t.left-e.left,top:t.top-e.top}}function ii(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function Du(t,e){var n={left:0,top:0,right:0,bottom:0};return Pr.forEach(function(i){var r=e[i],o=Ir(t)[i];n[i]=r!==void 0&&o!==void 0?i==="left"||i==="top"?Math.max(0,r-o):Math.max(0,o-r):0}),n}function Lr(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function sf(t){return{left:-t.left,top:-t.top}}function Pi(t,e){return pt(pt({},t),{left:t.left+e.left,top:t.top+e.top})}function Yi(t,e,n,i){if(e!==1){if(n){var r=ii(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(n.left-r.left)*(1-e),top:t.top+t.height*(1-e)/2+(n.top-r.top)*(1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function Zt(t){return t.width/t.height}function Ra(t,e){return Math.min(e.right!==void 0&&e.left!==void 0?(e.right-e.left)/t.width:1/0,e.bottom!==void 0&&e.top!==void 0?(e.bottom-e.top)/t.height:1/0)}function Na(t,e){var n={left:0,top:0},i=Du(t,e);return i.left&&i.left>0?n.left=i.left:i.right&&i.right>0&&(n.left=-i.right),i.top&&i.top>0?n.top=i.top:i.bottom&&i.bottom>0&&(n.top=-i.bottom),n}function Bg(t,e){var n;return e.minimum&&t<e.minimum?n=e.minimum:e.maximum&&t>e.maximum&&(n=e.maximum),n}function T3(t,e){var n=Zt(t),i=Zt(e);return e.width<1/0&&e.height<1/0?n>i?{width:e.width,height:e.width/n}:{width:e.height*n,height:e.height}:e.width<1/0?{width:e.width,height:e.width/n}:e.height<1/0?{width:e.height*n,height:e.height}:t}function x3(t,e){var n=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(n))+Math.abs(t.height*Math.sin(n)),height:Math.abs(t.width*Math.sin(n))+Math.abs(t.height*Math.cos(n))}}function Xo(t,e){var n=e*Math.PI/180;return{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function af(t,e){var n=Du(ri(t,e),e);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((t.width+n.left+n.right)/t.width,Ra(t,e)):Math.min((t.height+n.top+n.bottom)/t.height,Ra(t,e)):1}function ri(t,e,n){n===void 0&&(n=!1);var i=Na(t,e);return Pi(t,n?sf(i):i)}function $g(t){return{width:t.right!==void 0&&t.left!==void 0?t.right-t.left:1/0,height:t.bottom!==void 0&&t.top!==void 0?t.bottom-t.top:1/0}}function xU(t,e){return pt(pt({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function M3(t,e,n){n===void 0&&(n=!0);var i={};return Pr.forEach(function(r){var o=t[r],s=e[r];o!==void 0&&s!==void 0?i[r]=r==="left"||r==="top"?n?Math.max(o,s):Math.min(o,s):n?Math.min(o,s):Math.max(o,s):s!==void 0?i[r]=s:o!==void 0&&(i[r]=o)}),i}function lf(t,e){return M3(t,e,!0)}function E3(t){var e=t.size,n=t.aspectRatio,i=t.ignoreMinimum,r=t.sizeRestrictions;return!!((e.correctRatio||Zt(e)>=n.minimum&&Zt(e)<=n.maximum)&&e.height<=r.maxHeight&&e.width<=r.maxWidth&&e.width&&e.height&&(i||e.height>=r.minHeight&&e.width>=r.minWidth))}function P3(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function oo(t){var e=t.width,n=t.height,i=t.sizeRestrictions,r={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},o={width:Math.max(i.minWidth,Math.min(i.maxWidth,e)),height:Math.max(i.minHeight,Math.min(i.maxHeight,n))};function s(u,c){return c===void 0&&(c=!1),u.reduce(function(d,f){return E3({size:f,aspectRatio:r,sizeRestrictions:i,ignoreMinimum:c})&&(!d||P3(f,{width:e,height:n})<P3(d,{width:e,height:n}))?f:d},null)}var a=[];r&&[r.minimum,r.maximum].forEach(function(u){u&&a.push({width:o.width,height:o.width/u,correctRatio:!0},{width:o.height*u,height:o.height,correctRatio:!0})}),E3({size:o,aspectRatio:r,sizeRestrictions:i})&&a.push(o);var l=s(a)||s(a,!0);return l&&{width:l.width,height:l.height}}function Vg(t){var e=t.event,n=t.coordinates,i=t.positionRestrictions,r=i===void 0?{}:i,o=Pi(n,e.directions);return Pi(o,Na(o,r))}function MU(t){var e=t.coordinates,n=t.transform,i=t.imageSize,r=t.sizeRestrictions,o=t.positionRestrictions,s=t.aspectRatio,a=t.visibleArea,l=function(c,d){return Vg({coordinates:c,positionRestrictions:o,event:new Dg({left:d.left-c.left,top:d.top-c.top})})},u=pt({},e);return(Array.isArray(n)?n:[n]).forEach(function(c){var d={};Gn((d=typeof c=="function"?c({coordinates:u,imageSize:i,visibleArea:a}):c).width)&&Gn(d.height)||(u=function(f,p){var h=pt(pt(pt({},f),oo({width:p.width,height:p.height,sizeRestrictions:r,aspectRatio:s})),{left:0,top:0});return l(h,{left:f.left,top:f.top})}(u,pt(pt({},u),d))),Gn(d.left)&&Gn(d.top)||(u=l(u,pt(pt({},u),d)))}),u}function EU(t){t.event;var e=t.getAreaRestrictions,n=t.boundaries,i=t.coordinates,r=t.visibleArea;t.aspectRatio;var o=t.stencilSize,s=t.sizeRestrictions,a=t.positionRestrictions;t.stencilReference;var l,u,c,d=pt({},i),f=pt({},r),p=pt({},o);l=Zt(p),u=Zt(d),c===void 0&&(c=.001),(l===0||u===0?Math.abs(u-l)<c:Math.abs(u/l)<1+c&&Math.abs(u/l)>1-c)||(d=pt(pt({},d),oo({sizeRestrictions:s,width:d.width,height:d.height,aspectRatio:{minimum:Zt(p),maximum:Zt(p)}})));var h=af(f=Yi(f,d.width*n.width/(f.width*p.width)),e({visibleArea:f,type:"resize"}));return h!==1&&(f=Yi(f,h),d=Yi(d,h)),f=ri(f=Pi(f,Da(ii(d),ii(f))),e({visibleArea:f,type:"move"})),{coordinates:d=ri(d,lf(Ir(f),a)),visibleArea:f}}function PU(t){var e=t.event,n=t.getAreaRestrictions,i=t.boundaries,r=t.coordinates,o=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var s=t.positionRestrictions;t.stencilReference;var a=pt({},r),l=pt({},o);if(r&&o&&e.type!=="manipulateImage"){var u={width:0,height:0};l.width,i.width,Zt(i)>Zt(a)?(u.height=.8*i.height,u.width=u.height*Zt(a)):(u.width=.8*i.width,u.height=u.width*Zt(a));var c=af(l=Yi(l,a.width*i.width/(l.width*u.width)),n({visibleArea:l,type:"resize"}));l=Yi(l,c),c!==1&&(u.height/=c,u.width/=c),l=ri(l=Pi(l,Da(ii(a),ii(l))),n({visibleArea:l,type:"move"})),a=ri(a,lf(Ir(l),s))}return{coordinates:a,visibleArea:l}}function IU(t){var e=t.event,n=t.coordinates,i=t.visibleArea,r=t.getAreaRestrictions,o=pt({},i),s=pt({},n);if(e.type==="setCoordinates"){var a=Math.max(0,s.width-o.width),l=Math.max(0,s.height-o.height);a>l?o=Yi(o,Math.min(s.width/o.width,Ra(o,r({visibleArea:o,type:"resize"})))):l>a&&(o=Yi(o,Math.min(s.height/o.height,Ra(o,r({visibleArea:o,type:"resize"}))))),o=ri(o=Pi(o,sf(Na(s,Ir(o)))),r({visibleArea:o,type:"move"}))}return{visibleArea:o,coordinates:s}}function LU(t){var e=t.imageSize,n=t.visibleArea,i=t.coordinates,r=n||e;return{left:(n?n.left:0)+r.width/2-i.width/2,top:(n?n.top:0)+r.height/2-i.height/2}}function DU(t){var e=t.imageSize,n=t.visibleArea,i=t.aspectRatio,r=t.sizeRestrictions,o=n||e,s=Math.min(i.maximum||1/0,Math.max(i.minimum||0,Zt(o))),a=o.width<o.height?{width:.8*o.width,height:.8*o.width/s}:{height:.8*o.height,width:.8*o.height*s};return oo(pt(pt({},a),{aspectRatio:i,sizeRestrictions:r}))}function RU(t){var e,n,i=t.imageSize,r=t.visibleArea,o=t.boundaries,s=t.aspectRatio,a=t.sizeRestrictions,l=t.stencilSize,u=r||i;return Zt(u)>Zt(o)?n=(e=l.height*u.height/o.height)*Zt(l):e=(n=l.width*u.width/o.width)/Zt(l),oo({width:n,height:e,aspectRatio:s,sizeRestrictions:a})}function NU(t){var e=t.getAreaRestrictions,n=t.coordinates,i=t.imageSize,r=Zt(t.boundaries);if(n){var o={height:Math.max(n.height,i.height),width:Math.max(n.width,i.width)},s=T3({width:Zt(o)>r?o.width:o.height*r,height:Zt(o)>r?o.width/r:o.height},$g(e())),a={left:n.left+n.width/2-s.width/2,top:n.top+n.height/2-s.height/2,width:s.width,height:s.height},l=Du(n,Ir(pt({left:0,top:0},i))),u={};return!l.left&&!l.right&&a.width<=i.width&&(u.left=0,u.right=i.width),!l.top&&!l.bottom&&a.height<=i.height&&(u.top=0,u.bottom=i.height),ri(a,u)}var c=Zt(i);return s={height:c>r?i.height:i.width/r,width:c>r?i.height*r:i.width},{left:i.width/2-s.width/2,top:i.height/2-s.height/2,width:s.width,height:s.height}}function uf(t,e){return M3(t,Ir(e))}function BU(t){var e=t.event,n=t.coordinates,i=t.visibleArea,r=t.sizeRestrictions,o=t.getAreaRestrictions,s=t.positionRestrictions,a=t.adjustStencil,l=e.scale,u=e.move,c=pt({},i),d=pt({},n),f=1,p=1,h=l.factor&&Math.abs(l.factor-1)>.001;c=Pi(c,{left:u.left||0,top:u.top||0});var m={stencil:{minimum:Math.max(r.minWidth?r.minWidth/d.width:0,r.minHeight?r.minHeight/d.height:0),maximum:Math.min(r.maxWidth?r.maxWidth/d.width:1/0,r.maxHeight?r.maxHeight/d.height:1/0,Ra(d,s))},area:{maximum:Ra(c,o({visibleArea:c,type:"resize"}))}};l.factor&&h&&(l.factor<1?(p=Math.max(l.factor,m.stencil.minimum))>1&&(p=1):l.factor>1&&(p=Math.min(l.factor,Math.min(m.area.maximum,m.stencil.maximum)))<1&&(p=1)),p&&(c=Yi(c,p,l.center));var v=n.left-i.left,S=i.width+i.left-(n.width+n.left),b=n.top-i.top,k=i.height+i.top-(n.height+n.top);return c=ri(c=Pi(c,Na(c,{left:s.left!==void 0?s.left-v*p:void 0,top:s.top!==void 0?s.top-b*p:void 0,bottom:s.bottom!==void 0?s.bottom+k*p:void 0,right:s.right!==void 0?s.right+S*p:void 0})),o({visibleArea:c,type:"move"})),d.width=d.width*p,d.height=d.height*p,d.left=c.left+v*p,d.top=c.top+b*p,d=ri(d,lf(Ir(c),s)),l.factor&&h&&a&&(l.factor>1?f=Math.min(m.area.maximum,l.factor)/p:l.factor<1&&(f=Math.max(d.height/c.height,d.width/c.width,l.factor/p)),f!==1&&(c=Pi(c=ri(c=Yi(c,f,l.factor>1?l.center:ii(d)),o({visibleArea:c,type:"move"})),sf(Na(d,Ir(c)))))),{coordinates:d,visibleArea:c}}function $U(t){var e=t.aspectRatio,n=t.getAreaRestrictions,i=t.coordinates,r=t.visibleArea,o=t.sizeRestrictions,s=t.positionRestrictions,a=t.imageSize,l=t.previousImageSize,u=t.angle,c=pt({},i),d=pt({},r),f=Xo(ii(pt({left:0,top:0},l)),u);return(c=pt(pt({},oo({sizeRestrictions:o,aspectRatio:e,width:c.width,height:c.height})),Xo(ii(c),u))).left-=f.left-a.width/2+c.width/2,c.top-=f.top-a.height/2+c.height/2,d=Yi(d,af(d,n({visibleArea:d,type:"resize"}))),{coordinates:c=ri(c,s),visibleArea:d=ri(d=Pi(d,Da(ii(c),ii(i))),n({visibleArea:d,type:"move"}))}}function VU(t){var e=t.flip,n=t.previousFlip,i=t.rotate,r=t.getAreaRestrictions,o=t.coordinates,s=t.visibleArea,a=t.imageSize,l=pt({},o),u=pt({},s),c=n.horizontal!==e.horizontal,d=n.vertical!==e.vertical;if(c||d){var f=Xo({left:a.width/2,top:a.height/2},-i),p=Xo(ii(l),-i),h=Xo({left:c?f.left-(p.left-f.left):p.left,top:d?f.top-(p.top-f.top):p.top},i);l=Pi(l,Da(h,ii(l))),p=Xo(ii(u),-i),u=ri(u=Pi(u,Da(h=Xo({left:c?f.left-(p.left-f.left):p.left,top:d?f.top-(p.top-f.top):p.top},i),ii(u))),r({visibleArea:u,type:"move"}))}return{coordinates:l,visibleArea:u}}function I3(t){var e=t.directions,n=t.coordinates,i=t.positionRestrictions,r=i===void 0?{}:i,o=t.sizeRestrictions,s=t.preserveRatio,a=t.compensate,l=pt({},e),u=Lr(n,l).width,c=Lr(n,l).height;u<0&&(l.left<0&&l.right<0?(l.left=-(n.width-o.minWidth)/(l.left/l.right),l.right=-(n.width-o.minWidth)/(l.right/l.left)):l.left<0?l.left=-(n.width-o.minWidth):l.right<0&&(l.right=-(n.width-o.minWidth))),c<0&&(l.top<0&&l.bottom<0?(l.top=-(n.height-o.minHeight)/(l.top/l.bottom),l.bottom=-(n.height-o.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(n.height-o.minHeight):l.bottom<0&&(l.bottom=-(n.height-o.minHeight)));var d=Du(Lr(n,l),r);a&&(d.left&&d.left>0&&d.right===0?(l.right+=d.left,l.left-=d.left):d.right&&d.right>0&&d.left===0&&(l.left+=d.right,l.right-=d.right),d.top&&d.top>0&&d.bottom===0?(l.bottom+=d.top,l.top-=d.top):d.bottom&&d.bottom>0&&d.top===0&&(l.top+=d.bottom,l.bottom-=d.bottom),d=Du(Lr(n,l),r));var f={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(Pr.forEach(function(m){var v=d[m];v&&l[m]&&(f[m]=Math.max(0,1-v/l[m]))}),s){var p=Math.min.apply(null,Pr.map(function(m){return f[m]}));p!==1/0&&Pr.forEach(function(m){l[m]*=p})}else Pr.forEach(function(m){f[m]!==1/0&&(l[m]*=f[m])});if(u=Lr(n,l).width,c=Lr(n,l).height,l.right+l.left&&(u>o.maxWidth?f.width=(o.maxWidth-n.width)/(l.right+l.left):u<o.minWidth&&(f.width=(o.minWidth-n.width)/(l.right+l.left))),l.bottom+l.top&&(c>o.maxHeight?f.height=(o.maxHeight-n.height)/(l.bottom+l.top):c<o.minHeight&&(f.height=(o.minHeight-n.height)/(l.bottom+l.top))),s){var h=Math.min(f.width,f.height);h!==1/0&&Pr.forEach(function(m){l[m]*=h})}else f.width!==1/0&&CU.forEach(function(m){l[m]*=f.width}),f.height!==1/0&&kU.forEach(function(m){l[m]*=f.height});return l}function cf(t,e,n){return e==0&&n==0?t/2:e==0?0:n==0?t:t*Math.abs(e/(e+n))}var zU=hr("vue-simple-handler"),FU=hr("vue-simple-handler-wrapper"),zg={name:"SimpleHandler",components:{HandlerWrapper:S3},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(Ji(t={},this.horizontalPosition,!!this.horizontalPosition),Ji(t,this.verticalPosition,!!this.verticalPosition),Ji(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),Ji(t,"hover",this.hover),t);return{default:Fn(zU(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:Fn(FU(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};zg.render=function(t,e,n,i,r,o){var s=et("HandlerWrapper");return g(),L(s,{class:o.classes.wrapper,"vertical-position":n.verticalPosition,"horizontal-position":n.horizontalPosition,disabled:n.disabled,onDrag:o.onDrag,onDragEnd:o.onDragEnd,onEnter:o.onEnter,onLeave:o.onLeave},{default:z(function(){return[I("div",{class:o.classes.default},null,2)]}),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var jU=hr("vue-simple-line"),HU=hr("vue-simple-line-wrapper"),Fg={name:"SimpleLine",components:{LineWrapper:C3},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:Fn(jU(Ji({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:Fn(HU(Ji({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Fg.render=function(t,e,n,i,r,o){var s=et("LineWrapper");return g(),L(s,{class:o.classes.wrapper,position:n.position,disabled:n.disabled,onDrag:o.onDrag,onDragEnd:o.onDragEnd,onEnter:o.onEnter,onLeave:o.onLeave},{default:z(function(){return[I("div",{class:o.classes.root},null,2)]}),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var jg=hr("vue-bounding-box"),UU=["east","west",null],KU=["south","north",null],L3={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return zg}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return Fg}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return UU.forEach(function(e){KU.forEach(function(n){if(e!==n){var i=g3(e,n),r=i.name,o=i.classname;t.push({name:r,classname:o,verticalDirection:n,horizontalDirection:e})}})}),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,n=this.linesClasses,i=this.linesWrappersClasses;return{root:jg(),handlers:t,handlersWrappers:e,lines:n,linesWrappers:i}},lineNodes:function(){var t=this,e=[];return this.points.forEach(function(n){n.horizontalDirection&&n.verticalDirection||!t.lines[n.name]||e.push({name:n.name,component:t.linesComponent,class:Fn(t.classes.lines.default,t.classes.lines[n.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:Fn(t.classes.linesWrappers.default,t.classes.linesWrappers[n.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!t.resizable})}),e},handlerNodes:function(){var t=this,e=[],n=this.width,i=this.height;return this.points.forEach(function(r){if(t.handlers[r.name]){var o={name:r.name,component:t.handlersComponent,class:Fn(t.classes.handlers.default,t.classes.handlers[r.name]),wrapperClass:Fn(t.classes.handlersWrappers.default,t.classes.handlersWrappers[r.name]),hoverClass:t.classes.handlers.hover,verticalDirection:r.verticalDirection,horizontalDirection:r.horizontalDirection,disabled:!t.resizable};if(n&&i){var s=r.horizontalDirection,a=r.verticalDirection,l=s==="east"?n:s==="west"?0:n/2,u=a==="south"?i:a==="north"?0:i/2;o.wrapperClass=jg("handler"),o.wrapperStyle={transform:"translate(".concat(l,"px, ").concat(u,"px)")},t.transitions&&t.transitions.enabled&&(o.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else o.wrapperClass=jg("handler",Ji({},r.classname,!0));e.push(o)}}),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,n){var i,r=t.shift(),o=r.left,s=r.top,a={left:0,right:0,top:0,bottom:0};e==="west"?a.left-=o:e==="east"&&(a.right+=o),n==="north"?a.top-=s:n==="south"&&(a.bottom+=s),!n&&e?i="width":n&&!e&&(i="height"),this.resizable&&this.$emit("resize",new AU(a,{allowedDirections:{left:e==="west"||!e,right:e==="east"||!e,bottom:n==="south"||!n,top:n==="north"||!n},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:i}))}},emits:["resize","resize-end"]};L3.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"box",class:o.classes.root,style:o.style},[ee(t.$slots,"default"),I("div",null,[(g(!0),L(le,null,_e(o.lineNodes,function(s){return g(),L(yt(s.component),{key:s.name,"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,position:s.name,disabled:s.disabled,onDrag:function(a){return o.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[1]||(e[1]=function(a){return o.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])}),128))]),(g(!0),L(le,null,_e(o.handlerNodes,function(s){return g(),L("div",{key:s.name,style:s.wrapperStyle,class:s.wrapperClass},[(g(),L(yt(s.component),{"default-class":s.class,"hover-class":s.hoverClass,"wrapper-class":s.wrapperClass,"horizontal-position":s.horizontalDirection,"vertical-position":s.verticalDirection,disabled:s.disabled,onDrag:function(a){return o.onHandlerDrag(a,s.horizontalDirection,s.verticalDirection)},onDragEnd:e[2]||(e[2]=function(a){return o.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)}),128))],6)};var WU=hr("vue-draggable-area"),D3={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:WU()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&t.touches.length===1;e&&(this.touches=$s(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):w3({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&t.button===0){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top;this.anchor={x:t.clientX-n,y:t.clientY-i}},processMove:function(t,e){var n=$s(e);if(this.touches.length){var i=this.$refs.container.getBoundingClientRect(),r=i.left,o=i.top;this.touches.length===1&&n.length===1&&this.$emit("move",new Dg({left:n[0].clientX-(r+this.anchor.x),top:n[0].clientY-(o+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};D3.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)})},[ee(t.$slots,"default")],544)};function Hg(t){var e,n;return{rotate:t.rotate||0,flip:{horizontal:((e=t==null?void 0:t.flip)===null||e===void 0?void 0:e.horizontal)||!1,vertical:((n=t==null?void 0:t.flip)===null||n===void 0?void 0:n.vertical)||!1}}}function qU(t){return new Promise(function(e,n){try{if(t)if(/^data:/i.test(t))e(function(l){l=l.replace(/^data:([^;]+);base64,/gim,"");for(var u=atob(l),c=u.length,d=new ArrayBuffer(c),f=new Uint8Array(d),p=0;p<c;p++)f[p]=u.charCodeAt(p);return d}(t));else if(/^blob:/i.test(t)){var i=new FileReader;i.onload=function(l){e(l.target.result)},o=t,s=function(l){i.readAsArrayBuffer(l)},(a=new XMLHttpRequest).open("GET",o,!0),a.responseType="blob",a.onload=function(){this.status!=200&&this.status!==0||s(this.response)},a.send()}else{var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState===4&&(r.status===200||r.status===0?e(r.response):n("Warning: could not load an image to parse its orientation"),r=null)},r.onprogress=function(){r.getResponseHeader("content-type")!=="image/jpeg"&&r.abort()},r.withCredentials=!1,r.open("GET",t,!0),r.responseType="arraybuffer",r.send(null)}else n("Error: the image is empty")}catch(l){n(l)}var o,s,a})}function R3(t){var e=t.rotate,n=t.flip,i=t.scaleX,r=t.scaleY,o="";return o+=" rotate("+e+"deg) ",o+=" scaleX("+i*(n.horizontal?-1:1)+") ",o+=" scaleY("+r*(n.vertical?-1:1)+") "}function XU(t){try{var e,n=new DataView(t),i=void 0,r=void 0,o=void 0,s=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var a=n.byteLength,l=2;l+1<a;){if(n.getUint8(l)===255&&n.getUint8(l+1)===225){o=l;break}l++}if(o&&(i=o+10,function(p,h,m){var v,S="";for(v=h,m+=h;v<m;v++)S+=String.fromCharCode(p.getUint8(v));return S}(n,o+4,4)==="Exif")){var u=n.getUint16(i);if(((r=u===18761)||u===19789)&&n.getUint16(i+2,r)===42){var c=n.getUint32(i+4,r);c>=8&&(s=i+c)}}if(s){for(var d=n.getUint16(s,r),f=0;f<d;f++)if(l=s+12*f+2,n.getUint16(l,r)===274){l+=8,e=n.getUint16(l,r),n.setUint16(l,1,r);break}}return e}catch{return null}}function N3(t,e){var n=e.getBoundingClientRect(),i=n.left,r=n.top,o={left:0,top:0},s=0;return t.forEach(function(a){o.left+=(a.clientX-i)/t.length,o.top+=(a.clientY-r)/t.length}),t.forEach(function(a){s+=w3({x:o.left,y:o.top},{x:a.clientX-i,y:a.clientY-r})}),{centerMass:o,spread:s,count:t.length}}var Ug={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=Ig(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(this.touches.length===1&&e.length===1)this.$emit("move",new Lu({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=N3(e,this.$refs.container),i=this.oldGeometricProperties;i.count===n.count&&i.count>1&&this.$emit("resize",new Lu({left:i.centerMass.left-n.centerMass.left,top:i.centerMass.top-n.centerMass.top},{factor:i.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?this.eventsFilter(t,this.transforming)!==!1:(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,n=e.getBoundingClientRect(),i=n.left,r=n.top,o=n.bottom,s=n.right;this.touches=$s(t.touches).filter(function(a){return a.clientX>i&&a.clientX<s&&a.clientY>r&&a.clientY<o}),this.oldGeometricProperties=N3(this.touches,e)}},onTouchEnd:function(t){t.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var n=$s(t.touches).filter(function(i){return!i.identifier||e.touches.find(function(r){return r.identifier===i.identifier})});this.processEvent(t)&&(this.processMove(t,n),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&t.buttons===1&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),n=e.left,i=e.top,r=1+this.wheelResize.ratio*(s=t.deltaY||t.detail||t.wheelDelta,(a=+s)==0||A3(a)?a:a>0?1:-1),o={left:t.clientX-n,top:t.clientY-i};this.$emit("resize",new Lu({},{factor:r,center:o})),this.touches.length||this.debouncedProcessEnd()}var s,a}},emits:["resize","move","transform-end"]};Ug.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)}),onWheel:e[3]||(e[3]=function(){return o.onWheel&&o.onWheel.apply(o,arguments)})},[ee(t.$slots,"default")],544)};var Kg={components:{TransformableImage:Ug},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};Kg.render=function(t,e,n,i,r,o){var s=et("transformable-image");return g(),L(s,{"touch-move":n.touchMove,"touch-resize":n.touchResize,"mouse-move":n.mouseMove,"wheel-resize":n.wheelResize,onMove:e[1]||(e[1]=function(a){return t.$emit("move",a)}),onResize:e[2]||(e[2]=function(a){return t.$emit("resize",a)})},{default:z(function(){return[ee(t.$slots,"default")]}),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var df=hr("vue-preview"),B3={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:df({fill:this.fill}),wrapper:df("wrapper"),imageWrapper:df("image-wrapper"),image:Fn(df("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=Gt(Gt({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),n=this.imageSize.width,i=this.imageSize.height,r=x3({width:n,height:i},e.rotate),o={width:"".concat(n,"px"),height:"".concat(i,"px"),left:"0px",top:"0px"},s={rotate:{left:(n-r.width)*e.scaleX/2,top:(i-r.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*n/2,top:(1-e.scaleY)*i/2}};return o.transform=`translate(
324
+ `.concat(-this.coordinates.left/t-s.rotate.left-s.scale.left,"px,").concat(-this.coordinates.top/t-s.rotate.top-s.scale.top,"px) ")+R3(e),this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",function(){t.refreshImage()}),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};B3.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"root",class:o.classes.root,style:o.style},[I("div",{ref:"wrapper",class:o.classes.wrapper,style:o.wrapperStyle},[ft(I("img",{ref:"image",src:n.image&&n.image.src,class:o.classes.image,style:o.imageStyle},null,14,["src"]),[[Zn,n.image&&n.image.src]])],6)],6)};var $3={components:{Preview:B3},inheritAttrs:!1};$3.render=function(t,e,n,i,r,o){var s=et("preview");return g(),L(s,O(t.$attrs,{fill:!0}),null,16)};var Wg=hr("vue-rectangle-stencil"),V3={name:"RectangleStencil",components:{StencilPreview:$3,BoundingBox:L3,DraggableArea:D3},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return zg}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return Fg}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:Fn(Wg({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:Fn(Wg("preview"),this.previewClass),boundingBox:Fn(Wg("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,i=t.left,r=t.top,o={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(i,"px, ").concat(r,"px)")};return this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};V3.render=function(t,e,n,i,r,o){var s=et("stencil-preview"),a=et("draggable-area"),l=et("bounding-box");return g(),L("div",{class:o.classes.stencil,style:o.style},[I(l,{width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,transitions:n.transitions,class:o.classes.boundingBox,handlers:n.handlers,"handlers-component":n.handlersComponent,"handlers-classes":n.handlersClasses,"handlers-wrappers-classes":n.handlersWrappersClasses,lines:n.lines,"lines-component":n.linesComponent,"lines-classes":n.linesClasses,"lines-wrappers-classes":n.linesWrappersClasses,resizable:n.resizable,onResize:o.onResize,onResizeEnd:o.onResizeEnd},{default:z(function(){return[I(a,{movable:n.movable,onMove:o.onMove,onMoveEnd:o.onMoveEnd},{default:z(function(){return[I(s,{image:n.image,coordinates:n.coordinates,width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,class:o.classes.preview,transitions:n.transitions},null,8,["image","coordinates","width","height","class","transitions"])]}),_:1},8,["movable","onMove","onMoveEnd"])]}),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var GU=["transitions"],so=hr("vue-advanced-cropper"),z3={name:"Cropper",components:{BackgroundWrapper:Kg},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return V3}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Kg}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return TU.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,i=t.aspectRatio,r=t.positionRestrictions,o=t.sizeRestrictions,s=pt(pt({},n),{right:n.left+n.width,bottom:n.top+n.height}),a=e.params||{},l=pt({},e.directions),u=a.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};o.widthFrozen&&(l.left=0,l.right=0),o.heightFrozen&&(l.top=0,l.bottom=0),Pr.forEach(function(A){u[A]||(l[A]=0)});var c=Lr(s,l=I3({coordinates:s,directions:l,sizeRestrictions:o,positionRestrictions:r})).width,d=Lr(s,l).height,f=a.preserveRatio?Zt(s):Bg(c/d,i);if(f){var p=a.respectDirection;if(p||(p=s.width>=s.height||f===1?"width":"height"),p==="width"){var h=c/f-s.height;if(u.top&&u.bottom){var m=l.top,v=l.bottom;l.bottom=cf(h,v,m),l.top=cf(h,m,v)}else u.bottom?l.bottom=h:u.top?l.top=h:u.right?l.right=0:u.left&&(l.left=0)}else if(p==="height"){var S=s.width-d*f;if(u.left&&u.right){var b=l.left,k=l.right;l.left=-cf(S,b,k),l.right=-cf(S,k,b)}else u.left?l.left=-S:u.right?l.right=-S:u.top?l.top=0:u.bottom&&(l.bottom=0)}l=I3({directions:l,coordinates:s,sizeRestrictions:o,positionRestrictions:r,preserveRatio:!0,compensate:a.compensate})}return c=Lr(s,l).width,d=Lr(s,l).height,(f=a.preserveRatio?Zt(s):Bg(c/d,i))&&Math.abs(f-c/d)>.001&&Pr.forEach(function(A){u[A]||(l[A]=0)}),Vg({event:new Dg({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:r})}},moveAlgorithm:{type:Function,default:Vg},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,i=Zt(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/i+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,i=t.aspectRatio,r=t.sizeRestrictions,o=t.positionRestrictions,s=pt(pt({},n),oo({width:n.width,height:n.height,aspectRatio:i,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,r.minHeight),minWidth:Math.min(e.width,r.minWidth)}}));return s=ri(s=Pi(s,Da(ii(n),ii(s))),lf(Ir(e),o))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.getAreaRestrictions,r=t.coordinates,o=pt({},e);o.height=o.width/Zt(n),o.top+=(e.height-o.height)/2,(r.height-o.height>0||r.width-o.width>0)&&(o=Yi(o,Math.max(r.height/o.height,r.width/o.width)));var s=sf(Na(r,Ir(o=Yi(o,af(o,i({visibleArea:o,type:"resize"}))))));return o.width<r.width&&(s.left=0),o.height<r.height&&(s.top=0),o=ri(o=Pi(o,s),i({visibleArea:o,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,i=t.imageSize,r=t.imageRestriction,o=t.type,s={};return r==="fill-area"?s={left:0,top:0,right:i.width,bottom:i.height}:r==="fit-area"&&(Zt(n)>Zt(i)?(s={top:0,bottom:i.height},e&&o==="move"&&(e.width>i.width?(s.left=-(e.width-i.width)/2,s.right=i.width-s.left):(s.left=0,s.right=i.width))):(s={left:0,right:i.width},e&&o==="move"&&(e.height>i.height?(s.top=-(e.height-i.height)/2,s.bottom=i.height-s.top):(s.top=0,s.bottom=i.height)))),s}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return t.imageRestriction!=="none"&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:Gt({},k3)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=function(e){return e*Math.PI/180}(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=Lg(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:Lg(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:Gn(this.minWidth)?0:of(this.minWidth),minHeight:Gn(this.minHeight)?0:of(this.minHeight),maxWidth:Gn(this.maxWidth)?1/0:of(this.maxWidth),maxHeight:Gn(this.maxHeight)?1/0:of(this.maxHeight)});if(t=function(i){var r=i.areaRestrictions,o=i.sizeRestrictions,s=i.boundaries,a=i.positionRestrictions,l=pt(pt({},o),{minWidth:o.minWidth!==void 0?o.minWidth:0,minHeight:o.minHeight!==void 0?o.minHeight:0,maxWidth:o.maxWidth!==void 0?o.maxWidth:1/0,maxHeight:o.maxHeight!==void 0?o.maxHeight:1/0});a.left!==void 0&&a.right!==void 0&&(l.maxWidth=Math.min(l.maxWidth,a.right-a.left)),a.bottom!==void 0&&a.top!==void 0&&(l.maxHeight=Math.min(l.maxHeight,a.bottom-a.top));var u=$g(r),c=T3(s,u);return u.width<1/0&&(!l.maxWidth||l.maxWidth>c.width)&&(l.maxWidth=Math.min(l.maxWidth,c.width)),u.height<1/0&&(!l.maxHeight||l.maxHeight>c.height)&&(l.maxHeight=Math.min(l.maxHeight,c.height)),l.minWidth>l.maxWidth&&(l.minWidth=l.maxWidth,l.widthFrozen=!0),l.minHeight>l.maxHeight&&(l.minHeight=l.maxHeight,l.heightFrozen=!0),l}({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=$g(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:so(),image:Fn(so("image"),this.imageClass),stencil:so("stencil"),boundaries:Fn(so("boundaries"),this.boundariesClass),stretcher:Fn(so("stretcher")),background:Fn(so("background"),this.backgroundClass),foreground:Fn(so("foreground"),this.foregroundClass),imageWrapper:Fn(so("image-wrapper")),cropperWrapper:Fn(so("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,n=t.height,i=t.left,r=t.top;return{width:e/this.coefficient,height:n/this.coefficient,left:(i-this.visibleArea.left)/this.coefficient,top:(r-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},i=Gt(Gt({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),r={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-n.left-this.imageTransforms.translateX,"px, ").concat(-e.top-n.top-this.imageTransforms.translateY,"px)")+R3(i)};return this.transitionsOptions.enabled&&(r.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),r}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick(function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()})},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find(function(n){return t[n]!==e[n]})&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=Ig(this.update,this.debounce),this.debouncedDisableTransitions=Ig(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(Gt({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:Gt({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Gt({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?Gt({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,r=i===void 0||i;this.onManipulateImage(new Lu({},{factor:1/t,center:e}),{normalize:!1,transitions:r})},move:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,r=i===void 0||i;this.onManipulateImage(new Lu({left:t||0,top:e||0}),{normalize:!1,transitions:r})},setCoordinates:function(t){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.autoZoom,r=i===void 0||i,o=n.transitions,s=o===void 0||o;this.$nextTick(function(){e.imageLoaded?(e.transitionsActive||(s&&e.enableTransitions(),e.coordinates=e.applyTransform(t),r&&e.runAutoZoom("setCoordinates"),s&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t})},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then(function(){t.onChange()}):this.resetVisibleArea().then(function(){t.onChange()})},reset:function(){var t=this;return this.resetVisibleArea().then(function(){t.onChange(!1)})},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick(function(){t(),e.awaiting=!1}))},prepareResult:function(t){return this.roundResult?function(e){var n=e.coordinates,i=e.sizeRestrictions,r=e.positionRestrictions,o={width:Math.round(n.width),height:Math.round(n.height),left:Math.round(n.left),top:Math.round(n.top)};return o.width>i.maxWidth?o.width=Math.floor(n.width):o.width<i.minWidth&&(o.width=Math.ceil(n.width)),o.height>i.maxHeight?o.height=Math.floor(n.height):o.height<i.minHeight&&(o.height=Math.ceil(n.height)),ri(o,r)}(Gt(Gt({},this.getPublicProperties()),{},{positionRestrictions:uf(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,n,i){var r=this.autoZoomAlgorithm;r||(r=this.stencilSize?EU:this.autoZoom?PU:IU);var o=r({event:{type:t,params:i},visibleArea:e,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return Gt(Gt({},o),{},{changed:!O3(o.visibleArea,e)||!O3(o.coordinates,n)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n!==void 0&&n,r=yU(e,GU),o=this.processAutoZoom(t,this.visibleArea,this.coordinates,r),s=o.visibleArea,a=o.coordinates,l=o.changed;i&&l&&this.enableTransitions(),this.visibleArea=s,this.coordinates=a,i&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return function(e){var n=e.event,i=e.visibleArea,r=e.coefficient;if(n.type==="manipulateImage")return pt(pt({},n),{move:{left:n.move&&n.move.left?r*n.move.left:0,top:n.move&&n.move.top?r*n.move.top:0},scale:{factor:n.scale&&n.scale.factor?n.scale.factor:1,center:n.scale&&n.scale.center?{left:n.scale.center.left*r+i.left,top:n.scale.center.top*r+i.top}:null}});if(n.type==="resize"){var o=pt(pt({},n),{directions:pt({},n.directions)});return Pr.forEach(function(a){o.directions[a]*=r}),o}if(n.type==="move"){var s=pt(pt({},n),{directions:pt({},n.directions)});return OU.forEach(function(a){s.directions[a]*=r}),s}return n}(Gt(Gt({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?function(a,l,u){var c=u.rotate,d=u.flip,f={width:l.naturalWidth,height:l.naturalHeight},p=x3(f,c),h=a.getContext("2d");a.height=p.height,a.width=p.width,h.save();var m=Xo(ii(pt({left:0,top:0},f)),c);return h.translate(-(m.left-p.width/2),-(m.top-p.height/2)),h.rotate(c*Math.PI/180),h.translate(d.horizontal?f.width:0,d.vertical?f.height:0),h.scale(d.horizontal?-1:1,d.vertical?-1:1),h.drawImage(l,0,0,f.width,f.height),h.restore(),a}(this.$refs.sourceCanvas,e,this.imageTransforms):e,i=Gt({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),r=function(a){return a.find(function(l){return u=l,!Number.isNaN(parseFloat(u))&&isFinite(u);var u})},o=oo({sizeRestrictions:{minWidth:r([i.width,i.minWidth])||0,minHeight:r([i.height,i.minHeight])||0,maxWidth:r([i.width,i.maxWidth])||1/0,maxHeight:r([i.height,i.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(i.maxArea&&o.width*o.height>i.maxArea){var s=Math.sqrt(i.maxArea/(o.width*o.height));o={width:Math.round(s*o.width),height:Math.round(s*o.height)}}return function(a,l,u,c,d){a.width=c?c.width:u.width,a.height=c?c.height:u.height;var f=a.getContext("2d");f.clearRect(0,0,a.width,a.height),d&&(d.imageSmoothingEnabled&&(f.imageSmoothingEnabled=d.imageSmoothingEnabled),d.imageSmoothingQuality&&(f.imageSmoothingQuality=d.imageSmoothingQuality),d.fillColor&&(f.fillStyle=d.fillColor,f.fillRect(0,0,a.width,a.height),f.save()));var p=u.left<0?-u.left:0,h=u.top<0?-u.top:0;f.drawImage(l,u.left+p,u.top+h,u.width,u.height,p*(a.width/u.width),h*(a.height/u.height),a.width,a.height)}(t,n,this.coordinates,o,i),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&e?xU(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,i=this.visibleArea&&e?uf(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return MU({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:i,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?RU:DU);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var i=La(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,r=this.defaultPosition||LU,o=[i,function(s){var a=s.coordinates;return Gt({},La(r)?r({coordinates:a,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&o.push.apply(o,$s(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(o,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout(function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}},this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then(function(){var i={cropper:n,imageSize:t.imageSize};if(La(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(i):t.defaultBoundaries==="fit"?t.boundaries=function(r){var o=r.cropper,s=r.imageSize,a=o.clientHeight,l=o.clientWidth,u=a,c=s.width*a/s.height;return c>l&&(c=l,u=s.height*l/s.width),{width:c,height:u}}(i):t.boundaries=function(r){var o=r.cropper;return{width:o.clientWidth,height:o.clientHeight}}(i),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")})},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=Gt(Gt({},this.defaultImageTransforms),{},{flip:Gt({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then(function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,n,i,r,o,s,a=t.defaultVisibleArea||NU;t.visibleArea=La(a)?a({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},n=e.visibleArea,i=e.boundaries,r=e.getAreaRestrictions,o=pt({},n),s=Zt(i),o.width/o.height!==s&&(o.height=o.width/s),ri(o,r({visibleArea:o,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")}).catch(function(){t.visibleArea=null})},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then(function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")}).catch(function(){t.visibleArea=null})},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(r){if(y3(r))return!1;var o=window.location,s=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(r)||[],a={protocol:s[1]||"",host:s[2]||"",port:s[3]||""},l=function(u){return u.port||((u.protocol||o.protocol)==="http"?80:433)};return!(!a.protocol&&!a.host&&!a.port||a.protocol&&a.protocol==o.protocol&&a.host&&a.host==o.host&&a.host&&l(a)==l(o))}(this.src)){var n=Gn(this.crossOrigin)?this.canvas:this.crossOrigin;n===!0&&(n="anonymous"),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var i=(t=this.src,new Promise(function(r){qU(t).then(function(o){var s=XU(o);r(o?{source:t,arrayBuffer:o,orientation:s}:{source:t,arrayBuffer:null,orientation:null})}).catch(function(o){console.warn(o),r({source:t,arrayBuffer:null,orientation:null})})}));setTimeout(function(){i.then(e.onParseImage)},this.transitionTime)}else setTimeout(function(){e.onParseImage({source:e.src})},this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then(function(){t.$emit("ready"),t.onChange(!1)}))},onParseImage:function(t){var e=this,n=t.source,i=t.arrayBuffer,r=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,i&&r&&r>1?v3(n)||!y3(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([i])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(o){for(var s=[],a=new Uint8Array(o);a.length>0;){var l=a.subarray(0,8192);s.push(String.fromCharCode.apply(null,Array.from?Array.from(l):l.slice())),a=a.subarray(8192)}return"data:image/jpeg;base64,"+btoa(s.join(""))}(i):this.imageAttributes.src=n,La(this.defaultTransforms)?this.appliedImageTransforms=Hg(this.defaultTransforms()):rf(this.defaultTransforms)?this.appliedImageTransforms=Hg(this.defaultTransforms):this.appliedImageTransforms=function(o){var s=Hg({});if(o)switch(o){case 2:s.flip.horizontal=!0;break;case 3:s.rotate=-180;break;case 4:s.flip.vertical=!0;break;case 5:s.rotate=90,s.flip.vertical=!0;break;case 6:s.rotate=90;break;case 7:s.rotate=90,s.flip.horizontal=!0;break;case 8:s.rotate=-90}return s}(r),this.defaultImageTransforms=Gt(Gt({},this.appliedImageTransforms),{},{flip:Gt({},this.appliedImageTransforms.flip)}),this.$nextTick(function(){var o=e.$refs.image;o&&o.complete&&(function(s){return!!s.naturalWidth}(o)?e.onSuccessLoadImage():e.onFailLoadImage())})},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender(function(){e.coordinates=e.moveAlgorithm(Gt(Gt({},e.getPublicProperties()),{},{positionRestrictions:uf(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()})},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender(function(){var n=e.sizeRestrictions,i=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(Gt(Gt({},e.getPublicProperties()),{},{positionRestrictions:uf(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,i),minHeight:Math.max(n.minHeight,i)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1})},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,i=n!==void 0&&n,r=e.normalize,o=r===void 0||r;i&&this.enableTransitions();var s=BU(Gt(Gt({},this.getPublicProperties()),{},{event:o?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),a=s.visibleArea,l=s.coordinates;this.visibleArea=a,this.coordinates=l,this.runAutoZoom("manipulateImage"),this.onChange(),i&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,n=t.type,i=n===void 0?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:i})},getAspectRatio:function(t){var e,n,i=this.stencilProps,r=i.aspectRatio,o=i.minAspectRatio,s=i.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var a=this.$refs.stencil.aspectRatios();e=a.minimum,n=a.maximum}if(Gn(e)&&(e=Gn(r)?o:r),Gn(n)&&(n=Gn(r)?s:r),!t&&(Gn(e)||Gn(n))){var l=this.getStencilSize(),u=l?Zt(l):null;Gn(e)&&(e=b3(u)?u:void 0),Gn(n)&&(n=b3(u)?u:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,n=t.stencilSize,i=t.aspectRatio,Bg(Zt(r=La(n)?n({boundaries:e,aspectRatio:i}):n),i)&&(r=oo({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:r.width,height:r.height,aspectRatio:{minimum:i.minimum,maximum:i.maximum}})),(r.width>e.width||r.height>e.height)&&(r=oo({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:r.width,height:r.height,aspectRatio:{minimum:Zt(r),maximum:Zt(r)}})),r;var t,e,n,i,r},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return Gt({},k3)},flip:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.transitions,r=i===void 0||i;if(!this.transitionsActive){r&&this.enableTransitions();var o=Gt({},this.imageTransforms.flip),s=VU({flip:{horizontal:t?!o.horizontal:o.horizontal,vertical:e?!o.vertical:o.vertical},previousFlip:o,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=s.visibleArea,l=s.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=a,this.coordinates=l,this.onChange(),r&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,i=n===void 0||n;if(!this.transitionsActive){i&&this.enableTransitions();var r=Gt({},this.imageSize);this.appliedImageTransforms.rotate+=t;var o=$U({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:r,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),s=o.visibleArea,a=o.coordinates,l=this.processAutoZoom("rotateImage",s,a);s=l.visibleArea,a=l.coordinates,this.visibleArea=s,this.coordinates=a,this.onChange(),i&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},ZU={key:0,ref:"canvas",style:{display:"none"}},_U={key:1,ref:"sourceCanvas",style:{display:"none"}};z3.render=function(t,e,n,i,r,o){return g(),L("div",{ref:"cropper",class:o.classes.cropper},[I("div",{ref:"stretcher",class:o.classes.stretcher},null,2),I("div",{class:o.classes.boundaries,style:o.boundariesStyle},[(g(),L(yt(n.backgroundWrapperComponent),{class:o.classes.cropperWrapper,"wheel-resize":o.settings.resizeImage.wheel,"touch-resize":o.settings.resizeImage.touch,"touch-move":o.settings.moveImage.touch,"mouse-move":o.settings.moveImage.mouse,onMove:o.onManipulateImage,onResize:o.onManipulateImage},{default:z(function(){return[I("div",{class:o.classes.background,style:o.boundariesStyle},null,6),I("div",{class:o.classes.imageWrapper},[I("img",{ref:"image",crossorigin:r.imageAttributes.crossOrigin,src:r.imageAttributes.src,class:o.classes.image,style:o.imageStyle,onMousedown:e[1]||(e[1]=xt(function(){},["prevent"]))},null,46,["crossorigin","src"])],2),I("div",{class:o.classes.foreground,style:o.boundariesStyle},null,6),ft((g(),L(yt(n.stencilComponent),O({ref:"stencil",image:o.image,coordinates:r.coordinates,"stencil-coordinates":o.stencilCoordinates,transitions:o.transitionsOptions},n.stencilProps,{onResize:o.onResize,onResizeEnd:o.onResizeEnd,onMove:o.onMove,onMoveEnd:o.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[Zn,r.imageLoaded]]),n.canvas?(g(),L("canvas",ZU,null,512)):N("",!0),n.canvas?(g(),L("canvas",_U,null,512)):N("",!0)]}),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const F3=["#57291F","#C0413B","#D77B5F","#FF9200","#C87505","#F18E3F","#C14C32","#80003A","#506432","#B30019","#EC410B","#8CB5B5","#6C3400","#FFA400","#41222A","#FFB27B","#BC7576"],j3=()=>{const t=Math.floor(Math.random()*F3.length);return F3[t]},JU=(t,e,n,i)=>{const r=n??j3(),o=document.createElement("canvas");o.style.background=r,o.width=e,o.height=e;const s=o.getContext("2d");if(s){const a="Poppins",l="600",c="#fff";s.font=`${l} 48px/48px ${a}`,s.textAlign="center",s.textBaseline="middle";const d=o.width/2,f=(o.height+8)/2;s.fillStyle=r,s.fillRect(0,0,o.width,o.height),s.fillStyle=c,s.fillText(t,d,f)}return o},YU={class:"!hidden"},QU=ce("InvisibleField",ye({__name:"InvisibleField",props:{value:{type:[String,Array,Number,Boolean,null,Object],default:void 0},fieldName:{default:"invisibleinput"}},setup(t){var i;const e=t,n=sn({value:typeof e.value=="string"?(i=e.value)==null?void 0:i.trim():e.value});return bt(()=>{var r;Object.assign(n,Ln(e.fieldName??"invisibleinput")),e.value!=null&&(n.value=typeof e.value=="string"?(r=e.value)==null?void 0:r.trim():e.value)}),Re(()=>e.value,r=>{n.value=r}),(r,o)=>(g(),T("div",YU))}})),eK=FA(ye({__name:"BackgroundImageCropper",props:{touchMove:{},mouseMove:{},touchResize:{},wheelResize:{}},emits:["move","resize"],setup(t){const e=t,{locale:n}=_t("ImageCompressor"),i=oe(!1),r=re(),o=(a,l)=>{if(a.type==="touchstart"||a.type==="touchmove"){if(a.touches.length===1&&!l)return i.value=!0,r.value="touch",s(),!1;i.value=!1}else if(a.type==="wheel"){if(!l&&!a.ctrlKey)return i.value=!0,r.value="wheel",s(),!1;i.value=!1}a.preventDefault(),a.stopPropagation()},s=()=>{setTimeout(()=>{i.value=!1},1e3)};return(a,l)=>(g(),L(x(Ug),{"events-filter":o,"mouse-move":e.mouseMove,"touch-move":e.touchMove,"touch-resize":e.touchResize,"wheel-resize":e.wheelResize,onMove:l[0]||(l[0]=u=>a.$emit("move",u)),onResize:l[1]||(l[1]=u=>a.$emit("resize",u))},{default:z(()=>[ee(a.$slots,"default",{},void 0,!0),E("div",{class:pe([{"cropper-event-notification--visible":i.value},"cropper-event-notification"])},_(r.value==="wheel"?x(n).cropperCtrlScrollInfo:x(n).cropperTwoFingerInfo),3)]),_:3},8,["mouse-move","touch-move","touch-resize","wheel-resize"]))}}),[["__scopeId","data-v-9031c32d"]]),tK={class:"flex flex-col gap-y-4"},nK={key:0,class:pe(["text-xs font-normal text-grayscale-900","[&_li]:before:content-['•']","[&_li]:before:inline-block [&_li]:before:w-[12px] [&_li]:before:ml-[-12px] pl-3","max-w-[121px] [&_li]:pl-0.5"]),"data-wv-section":"image-requirements-info"},H3=ye({__name:"ImageInputInfo",props:{customRequirements:{},showInfo:{type:Boolean},showAddButton:{type:Boolean}},emits:["addPhoto"],setup(t){const{locale:e}=_t("ImageCompressor");return(n,i)=>{var r;return g(),T("div",tK,[n.showInfo?(g(),T("ul",nK,[(r=n.customRequirements)!=null&&r.length?(g(!0),T(le,{key:0},_e(n.customRequirements,o=>(g(),T("li",{key:o},_(o),1))),128)):(g(),T(le,{key:1},[E("li",null,_(x(e).maxSizeRequirement),1),E("li",null,_(x(e).imageTypeRequirement),1)],64))])):N("",!0),n.showAddButton?(g(),L(We,{key:1,onClick:i[0]||(i[0]=o=>n.$emit("addPhoto")),icon:"add",label:"Add Photo",text:""})):N("",!0),ee(n.$slots,"default")])}}}),iK={key:1,class:"flex gap-1 items-start"},rK=["id","multiple"],oK=["for"],sK=ce("ImageCompressor",ye({__name:"ImageCompressor",props:Cn({initialName:{},multiple:{type:Boolean},defaultImage:{},disabled:{type:Boolean,default:!1},compressedBlob:{default:void 0},imagePreviewUrl:{default:void 0},imagePreviewSize:{default:"big"},rounded:{type:Boolean,default:!1},useDeleteButton:{type:Boolean,default:!0},useValidator:{type:Boolean,default:!1},mandatory:{type:Boolean,default:!1},invalid:{type:Boolean},validatorMessage:{default:"Photo must be uploaded"},label:{default:void 0},fieldName:{default:"imageInput"},fieldInfo:{default:void 0},showInfo:{type:Boolean,default:!0},customRequirements:{default:void 0},confirmOnDelete:{type:Boolean},emitDeleteFn:{type:Boolean},showValidatorMessage:{type:Boolean,default:!0},fileType:{default:"webp"},type:{default:"normal"}},{defaultImage:{default:0},defaultImageModifiers:{}}),emits:Cn(["apply","applyProp","update:defaultImage","update:fieldValue","delete"],["update:defaultImage"]),setup(t,{expose:e,emit:n}){const i=dt("preset",{}).image,r=t,o=n,{locale:s}=_t("ImageCompressor");bt(async()=>{ve(),M()}),Jo(()=>{Pe(0),Pe(1)});const a=re([{src:null,type:null},{src:null,type:null}]),l=j3(),u=re(),c=re(),d=re([]),f=re(),p=oe(0),h=re(),m=re(),v=oe(),S=si(t,"defaultImage"),b=sn({value:r.multiple?[]:void 0}),k=oe(!1),A=oe(),w=oe(0),y=oe(!1),C=re([!1,!1]),P=W(()=>`image/${r.fileType}`),R=U=>typeof d.value[U]=="string"&&d.value[U].includes("data:image/png;base64"),M=async()=>{var U,Y;(U=r.imagePreviewUrl)!=null&&U.length?d.value=Array.isArray(r.imagePreviewUrl)?r.imagePreviewUrl:[r.imagePreviewUrl]:Array.isArray(r.compressedBlob)?d.value=r.compressedBlob:r.compressedBlob?d.value=[r.compressedBlob]:r.initialName?(u.value=JU(r.initialName,125,l),d.value=[(Y=u.value)==null?void 0:Y.toDataURL()]):d.value=[],r.imagePreviewUrl?b.value=r.imagePreviewUrl:r.initialName&&(b.value=await D()),o("applyProp")},D=async()=>new Promise(U=>{var Y;(Y=u.value)==null||Y.toBlob(ke=>{U(new File([ke??new Blob],Date.now()+".png",{type:"image/png"}))})}),$=(U=!1)=>{var Y;r.disabled||(U&&(v.value=1),(Y=f.value)==null||Y.click())},q=async U=>{const{files:Y}=U.target,ke=Array.from(Y??[]).slice(0,d.value.length?1:2);for(const[Fe,H]of ke.entries())try{const he=v.value??Fe;await J(H,he)}catch(he){console.error("Error loading image:",he)}finally{v.value=void 0}},J=async(U,Y)=>{const ke=H=>H.includes("image"),Fe=H=>H>1e6;return new Promise((H,he)=>{var De,nt;if(U)if(ae(Y),!ke(U.type))k.value=!0,A.value=typeof r.validatorMessage!="string"&&((De=r.validatorMessage)!=null&&De.invalidFormat)?r.validatorMessage.invalidFormat:"Tipe file harus berupa gambar!",M(),y.value=!1,Pe(Y),he("Tipe file harus berupa gambar!");else if(Fe(U.size))k.value=!0,A.value=typeof r.validatorMessage!="string"&&((nt=r.validatorMessage)!=null&&nt.exceed)?r.validatorMessage.exceed:"Ukuran gambar terlalu besar! Maks. 1 MB",M(),y.value=!1,Pe(Y),he("Ukuran gambar terlalu besar! Maks. 1 MB");else{Pe(Y);const St=URL.createObjectURL(U),lt=new FileReader;lt.onload=At=>{var Ut;a.value[Y].src=St,a.value[Y].type=me((Ut=At==null?void 0:At.target)==null?void 0:Ut.result,U.type)},lt.onerror=At=>{console.error("🚀 ~ returnnewPromise ~ e:",At)},lt.readAsArrayBuffer(U),v.value==null&&(v.value=Y),y.value||(y.value=!0),k.value=!1,A.value=void 0}w.value+=1,m.value=H})},ve=()=>{r.useValidator&&Object.assign(b,Ln(r.fieldName,U=>{var Y;return!U&&r.mandatory?typeof r.validatorMessage!="string"&&((Y=r.validatorMessage)!=null&&Y.empty)?r.validatorMessage.empty:(r.label??"Photo")+" must be uploaded":r.invalid&&r.validatorMessage?r.validatorMessage:A.value?A.value:!0}))},ae=U=>{a.value[U]={src:null,type:null}},me=(U,Y=null)=>{if(U){const ke=new Uint8Array(U).subarray(0,4);let Fe="";for(const H of ke)Fe+=H.toString(16);switch(Fe){case"89504e47":return"image/png";case"47494638":return"image/gif";case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":return P.value;default:return Y}}return null},se=U=>{const Y=vU(U.split(",")[1],P.value);return window.URL.createObjectURL(Y)},Ie=async(U,Y)=>{const ke=await fetch(U).then(Fe=>Fe.blob());return new File([ke],Y,{type:P.value})},Be=async()=>{const U=v.value??0;try{await de(U)}catch(Y){console.error(Y)}xe()},xe=()=>{var U;y.value=!1,(U=m.value)==null||U.call(m),m.value=void 0},de=async U=>{if(h.value){const Y=h.value.getResult();if(Y.canvas){const ke=Y.canvas.toDataURL(P.value);await ge(ke,U)}}},ge=async(U,Y)=>{try{c.value=document.createElement("canvas");const ke=c.value.getContext("2d"),Fe=new Image;Fe.src=U,await Fe.decode();const H=80/100,he=Fe.width*H,De=Fe.height*H;c.value.setAttribute("width",he.toString()),c.value.setAttribute("height",De.toString()),ke&&ke.drawImage(Fe,0,0,he,De);const nt=c.value.toDataURL(P.value,.95),St=Date.now()+`.${r.fileType}`,lt={canvas:c.value,compressed:{blob:se(nt),base64:nt,fileName:St,file:await Ie(se(nt),St),size:"",type:P.value},message:"File has been compressed."};lt.compressed.size=Math.round(lt.compressed.file.size/1e3)+"KB",d.value[Y]=lt.compressed.blob,r.multiple?b.value&&Array.isArray(b.value)?b.value[Y]=lt.compressed.file:b.value=[lt.compressed.file]:b.value=lt.compressed.file,o("apply",lt)}catch(ke){console.error(ke)}},Pe=U=>{a.value[U].src&&URL.revokeObjectURL(a.value[U].src)},Te=U=>{r.confirmOnDelete?C.value[U]=!0:r.emitDeleteFn?o("delete",ue,U):ue(U)},ue=(U=0)=>{k.value=!1,A.value=void 0,d.value=d.value.toSpliced(U,1),Pe(U),a.value[U]={src:null,type:null},a.value=[a.value[+!U],a.value[U]],v.value=0,S.value=0,r.confirmOnDelete||o("delete"),r.multiple&&Array.isArray(b.value)?b.value=b.value.toSpliced(U,1):b.handleReset&&b.handleReset()},Se=U=>{var ke;const Y=(ke=d.value[U])==null?void 0:ke.toString();v.value=U,Y!=null&&Y.includes("blob")?(v.value=U,y.value=!0):(ae(U),$())},Z=()=>{$()},X=W(()=>navigator.userAgent.includes("Firefox"));return Re(()=>b.value,U=>{(U instanceof File||Array.isArray(U)&&U.some(Y=>Y instanceof File))&&o("update:fieldValue",U)}),Re(A,U=>{U&&b.setErrors&&b.setErrors(U)}),Re(y,U=>{U||p.value++}),Re(()=>r.initialName,()=>{M()}),Re(()=>r.imagePreviewUrl,()=>{M()},{once:!0}),e({assignPreviewImagesFromProp:M}),(U,Y)=>(g(),T(le,null,[I(Yn,{class:pe([{"!w-max":!r.multiple,"!w-full":r.multiple}]),info:r.fieldInfo,label:r.label,mandatory:r.mandatory,"data-wv-name":"image-compressor","data-wv-section":"root"},{default:z(()=>[E("div",{class:pe(["w-full",{"grid gap-6 items-start grid-cols-2":U.multiple&&U.type==="normal"},{"grid gap-3 items-start grid-cols-[max-content,max-content]":U.multiple&&U.type==="inline-table"}]),"data-wv-section":"wrapper"},[d.value.length?(g(!0),T(le,{key:0},_e(d.value,(ke,Fe)=>{var H;return g(),T("div",{key:Fe,class:pe([[{"items-start":U.type==="normal"},{"items-center":U.type==="inline-table"}],"flex gap-1"]),"data-wv-section":"preview"},[E("div",{class:pe(["flex gap-1 items-center",{"max-w-[80px]":U.imagePreviewSize==="medium"},{"max-w-[125px]":U.imagePreviewSize==="big"},{"flex-col":U.type==="normal"}]),"data-wv-section":"preview-image-wrapper"},[E("div",{class:pe([{"[&>span]:hover:opacity-30 [&>[data-wv-section=input-image-trigger]]:hover:opacity-100":R(Fe)},"relative",{"w-[125px] h-[125px]":U.imagePreviewSize==="big"&&U.type==="normal","w-[30px] h-[30px]":U.imagePreviewSize==="small"||U.type==="inline-table","w-[80px] h-[80px]":U.imagePreviewSize==="medium"&&U.type==="normal"}]),"data-wv-section":"image-wrapper"},[I(Ar,{class:pe([{"w-[30px] h-[30px]":U.type==="inline-table"},"transition-opacity duration-300"]),rounded:U.rounded,size:U.type==="normal"?U.imagePreviewSize:"small",src:ke,"data-wv-section":"preview-image"},null,8,["class","rounded","size","src"]),R(Fe)?(g(),T("button",{key:0,class:pe([(H=x(i))==null?void 0:H.button.class,"hover:bg-opacity-0 rounded-lg opacity-0"]),onClick:Y[0]||(Y[0]=he=>$(!1)),"data-wv-section":"input-image-trigger",type:"button"},[I(Me,{class:"w-6 h-6","data-wv-section":"trigger-icon",icon:"image-add",severity:"primary"})],2)):N("",!0)],2),!r.disabled&&!R(Fe)?(g(),T(le,{key:0},[E("div",{class:pe(["flex gap-0.5 justify-center",{"scale-75":U.imagePreviewSize==="medium"}]),"data-wv-section":"preview-buttons"},[U.type==="normal"?(g(),T(le,{key:0},[I(We,{onClick:he=>Se(Fe),class:"!py-0 !px-1 !h-max",icon:"pencil",label:"Edit",text:""},null,8,["onClick"]),U.useDeleteButton?(g(),L(We,{key:0,onClick:he=>Te(Fe),class:"!py-0 !px-1 !h-max",icon:"delete-bin",label:"Delete",severity:"danger",text:""},null,8,["onClick"])):N("",!0)],64)):(g(),T(le,{key:1},[I(Me,{onClick:he=>Se(Fe),class:"text-xs p-0.5 rounded-xs mr-1",icon:"pencil",severity:"primary"},null,8,["onClick"]),I(Me,{onClick:he=>Te(Fe),class:"text-xs p-0.5 rounded-xs",icon:"delete-bin",severity:"danger"},null,8,["onClick"])],64))],2),I(cr,{visible:C.value[Fe],"onUpdate:visible":he=>C.value[Fe]=he,closable:!1,onConfirm:he=>o("delete",ue,Fe),body:"Are you sure you want to delete it?","confirm-label":"Delete",header:"Delete Photo",severity:"danger"},null,8,["visible","onUpdate:visible","onConfirm"])],64)):N("",!0)],2),U.type==="normal"?(g(),L(H3,{key:0,"custom-requirements":U.customRequirements,"show-add-button":d.value.length===1&&r.multiple,"show-info":U.showInfo,onAddPhoto:Y[2]||(Y[2]=he=>$(!0))},{default:z(()=>[d.value.length===2&&r.multiple?(g(),L(vE,{key:0,modelValue:S.value,"onUpdate:modelValue":Y[1]||(Y[1]=he=>S.value=he),"label-id":"default-"+Fe,value:Fe,label:"Set as default"},null,8,["modelValue","label-id","value"])):N("",!0)]),_:2},1032,["custom-requirements","show-add-button","show-info"])):N("",!0),U.multiple&&d.value.length==1&&U.type==="inline-table"?(g(),L(We,{key:1,onClick:Y[3]||(Y[3]=he=>$(!0)),icon:"add",label:"Photo",text:""})):N("",!0)],2)}),128)):U.type!="inline-table"?(g(),T("div",iK,[E("button",{class:pe([{"w-[125px] h-[125px]":U.imagePreviewSize==="big","w-[30px] h-[30px]":U.imagePreviewSize==="small","w-[80px] h-[80px]":U.imagePreviewSize==="medium"},"flex items-center justify-center","ring-inset","cursor-pointer",{"ring-1":X.value,"ring-[0.5px]":!X.value},{"rounded-full":U.rounded,"rounded-lg":!U.rounded},{"ring-general-400 focus-visible:ring-primary-500":!k.value&&!b.errorMessage,"ring-danger-500":k.value||b.errorMessage},{"bg-white":!r.disabled,"bg-general-50":r.disabled}]),onClick:Y[4]||(Y[4]=ke=>$(!1)),"data-wv-section":"input-image-trigger",type:"button"},[I(Me,{class:"w-6 h-6","data-wv-section":"trigger-icon",icon:"image-add",severity:"primary"})],2),I(H3,{"custom-requirements":U.customRequirements,"show-info":U.showInfo},null,8,["custom-requirements","show-info"])])):N("",!0)],2),(g(),T("input",{id:U.fieldName,key:p.value,ref_key:"inputImageFile",ref:f,multiple:r.multiple&&!d.value.length,onChange:q,accept:"image/*",class:"hidden","data-wv-section":"hidden-image-input",type:"file"},null,40,rK)),U.type==="inline-table"&&!d.value.length?(g(),T("label",{key:0,for:U.fieldName,class:"inline-flex items-center cursor-pointer"},Y[6]||(Y[6]=[E("span",{class:"inline-flex items-center text-body-medium rounded-bl rounded-tl bg-general-50 px-3 h-[26px] border-[0.5px] border-general-200"}," Browse ",-1),E("span",{class:"inline-flex items-center text-body-medium !text-general-200 !font-light rounded-br rounded-tr px-3 h-[26px] leading-4 border-[0.5px] border-l-0 border-general-200"}," Select File ",-1)]),8,oK)):N("",!0),U.showValidatorMessage?(g(),L(Rn,{key:1,format:!1,message:b.errorMessage??A.value},null,8,["message"])):N("",!0),r.multiple?(g(),L(QU,{key:2,value:S.value?"secondImage":"firstImage","field-name":"defaultImage"},null,8,["value"])):N("",!0)]),_:1},8,["class","info","label","mandatory"]),I(ur,{visible:y.value,"onUpdate:visible":Y[5]||(Y[5]=ke=>y.value=ke),draggable:!1,header:x(s).cropDialogHeader,class:"w-max max-w-[98vw] min-w-[min(500px,98vw)] !max-h-[94vh]","content-class":"overflow-hidden overflow-y-auto min-h-[100px]","data-wv-section":"dialog-cropper","footer-class":"!gap-1",modal:""},{footer:z(()=>[I(We,{label:x(s).cancelCropLabel,onClick:xe,"data-wv-section":"cancel-crop",severity:"secondary",text:"",type:"button"},null,8,["label"]),I(We,{label:x(s).changeImageLabel,onClick:Z,"data-wv-section":"change-image-button",text:"",type:"button"},null,8,["label"]),I(We,{label:x(s).applyCropLabel,onClick:Be,"data-wv-section":"apply-image-button",severity:"success",type:"button"},null,8,["label"])]),default:z(()=>[v.value!=null?(g(),L(x(z3),{key:0,ref_key:"vueAdvanceCropper",ref:h,"auto-zoom":!1,"background-wrapper-component":eK,src:a.value[v.value].src,class:"upload-example-cropper h-400","foreground-class":"h-400","image-class":"h-400"},null,8,["src"])):N("",!0)]),_:1},8,["visible","header"])],64))}})),aK=["id","disabled","placeholder"],KZ=ce("InputBadge",ye({__name:"InputBadge",props:{type:{default:"text"},modelValue:{},initialValue:{},useValidator:{type:Boolean},existingValues:{},mandatory:{type:Boolean},validatorMessage:{},showValidatorMessage:{type:Boolean,default:!0},invalid:{type:Boolean},fieldName:{default:"inputBadge"},placeholder:{},disabled:{type:Boolean},label:{},fieldInfo:{},preserveDeletedIndex:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e;bt(()=>{var w,y;n.useValidator&&(Object.assign(l,Ln(n.fieldName,C=>Pt(()=>f(C)))),(w=n.initialValue)!=null&&w.length?l.value=n.initialValue:(y=n.modelValue)!=null&&y.length&&(l.value=n.modelValue))}),Vi(()=>{n.useValidator&&l.handleReset()});const r=dt("preset",{}).inputbadge,o=re(null),s=re(),a=oe(),l=sn({value:n.initialValue??n.modelValue??[]}),u=W(()=>{var w;return((w=n.label)==null?void 0:w.toLowerCase)+"-badge-input"}),c=W(()=>n.invalid&&typeof n.validatorMessage=="string"?n.validatorMessage:l.errorMessage),d=W(()=>n.placeholder?n.placeholder:n.type==="email"?"Enter valid email":"Enter value"),f=w=>{var y;if(typeof n.validatorMessage=="string"&&n.invalid)return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{empty:C,exist:P}=n.validatorMessage??{};if(!(w!=null&&w.length)&&n.mandatory)return C??!0;if((y=n.existingValues)!=null&&y.length||P){let R=!0;return w.forEach(M=>{const D=w.filter($=>$===M);(n.existingValues.includes(M)||D.length>1)&&(R=P)}),R}}return!0},p=W(()=>{var w;return n.invalid||!!l.errorMessage||!((w=l.value)!=null&&w.length)&&typeof a.value=="string"&&!a.value.length}),h=W(()=>{var w,y;return!!((y=(w=l.value)==null?void 0:w.filter(Boolean))!=null&&y.length)}),m=w=>/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/.test(w),v=()=>{a.value&&(l.value=[...l.value??[],a.value],a.value=void 0,i("update:modelValue",l.value))},S=w=>{if(n.type==="email"&&o.value&&s.value&&a.value&&!m(a.value)){s.value.show(w,o.value);return}v()},b=w=>{var y;(y=l.value)==null||y.splice(w,1,...n.preserveDeletedIndex?[null]:[]),l.value=go(l.value)},k=w=>{var y,C;w.key==="Backspace"&&!a.value&&(w.preventDefault(),n.type==="text"?a.value=(y=l.value)==null?void 0:y.pop():(C=l.value)==null||C.pop(),l.value=go(l.value))},A=(w,y)=>{l.value&&w&&(l.value[y]=w,l.value=go(l.value),i("update:modelValue",l.value))};return Re(()=>n.initialValue,w=>{w&&(l.value=w)},{once:!0}),Re(()=>n.modelValue,w=>{w&&(l.value=w)}),n.preserveDeletedIndex&&Fa(()=>{var w,y;(w=l.value)!=null&&w.length&&((y=l.value)!=null&&y.every(C=>C==null))&&(l.value=[])}),(w,y)=>(g(),L(Yn,{info:w.fieldInfo,label:n.label,mandatory:n.mandatory},{default:z(()=>{var C,P;return[E("div",O((C=x(r))==null?void 0:C.root({context:{invalidInput:p.value,disabled:w.disabled}}),{"data-wv-name":"inputbadge","data-wv-section":"root"}),[(g(!0),T(le,null,_e(l.value,(R,M)=>(g(),T(le,{key:R},[R?(g(),L(Lt,{key:0,label:R,onRemove:()=>{var D;(D=o.value)==null||D.focus(),b(M)},"onUpdate:label":D=>A(D,M),editable:"",format:"nowrap",removable:"",severity:"dark"},null,8,["label","onRemove","onUpdate:label"])):N("",!0)],64))),128)),E("form",{onSubmit:xt(S,["prevent"]),class:"flex-1","data-wv-section":"form-input"},[ft(E("input",O({id:u.value,ref_key:"badgeInput",ref:o,"onUpdate:modelValue":y[0]||(y[0]=R=>a.value=R)},(P=x(r))==null?void 0:P.input({context:{disabled:w.disabled,value:l.value,showPlaceholder:h.value},parent:w.$parent,props:n}),{disabled:w.disabled,placeholder:d.value,onBlur:S,onFocus:y[1]||(y[1]=R=>{var M;return(M=s.value)==null?void 0:M.hide()}),onInput:y[2]||(y[2]=R=>{var M;return(M=s.value)==null?void 0:M.hide()}),onKeydown:k,"data-wv-section":"input",type:"text"}),null,16,aK),[[Of,a.value]]),I(Oc,O({ref_key:"op",ref:s},x(r).erroroverlaypanel,{dismissable:!1}),{default:z(()=>[I(Me,O(x(r).erroricon,{icon:"error"}),null,16),y[3]||(y[3]=ht(" Email format is incorrect "))]),_:1,__:[3]},16)],32)],16),n.showValidatorMessage?(g(),L(Rn,{key:0,message:c.value},null,8,["message"])):N("",!0)]}),_:1},8,["info","label","mandatory"]))}})),U3=ce("InputNumber",ye({__name:"InputNumber",props:{modelValue:{},value:{},existingValues:{},label:{},min:{},max:{},maxDigit:{default:16},padStart:{default:0},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},validatorMessage:{},showValidatorMessage:{type:Boolean,default:!0},placeholder:{},disabled:{type:Boolean},invalid:{type:Boolean},showButtons:{type:Boolean},size:{},mode:{},currency:{},locale:{},prefix:{},suffix:{},minFractionDigits:{default:0},maxFractionDigits:{default:2},useGrouping:{type:Boolean},fieldInfo:{},tooltipPos:{},addonVariant:{default:"filled"},addonLeftClass:{},addonRightClass:{},inputGroupClass:{},inputNumberClass:{},inputId:{},autoResize:{type:Boolean},allowEmptyValue:{type:Boolean,default:!0}},emits:["update:modelValue","input"],setup(t,{emit:e}){const n=t,i=e,r=ja(),o=dt("preset",{}).inputgroupaddon,{locale:s}=_t("InputNumber"),a=dt("preset",{}).inputnumber,l=oe(0),u=re(),c=sn({value:n.value??n.modelValue}),d=W(()=>{var y,C;return n.placeholder??((C=s.defaultPlaceholder)==null?void 0:C.replace("{label}",n.label?(y=n.label)==null?void 0:y.toLowerCase():""))});bt(()=>{n.useValidator&&Object.assign(c,Ln(n.fieldName??"numberInput",P=>Pt(()=>h(P))));const y=n.value??n.modelValue,C=y!=null?w(y):y;C!=null&&n.allowEmptyValue?c.value=C:n.allowEmptyValue||(c.value=C??n.min??0),n.invalid&&n.useValidator&&c.validate()});const f=W(()=>n.invalid||!!c.errorMessage),p=W(()=>n.inputId?n.inputId:(n.label??n.fieldName??"input-number").toLowerCase().trim().replaceAll(" ","-")+"-inputnumber"),h=y=>{var P,R;const C=y!=null&&typeof y=="number";if(n.invalid&&typeof n.validatorMessage=="string")return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{empty:M,exist:D}=n.validatorMessage??{};if(y==null&&n.mandatory)return M??s.emptyInvalidText.replace("{label}",n.label);if(C&&((P=n.existingValues)!=null&&P.includes(y)))return D??((R=s.alreadyExistInvalidText)==null?void 0:R.replace("{label}",n.label))}return!0},m=()=>{l.value++,Pt(()=>{var P;const y=(P=u.value)==null?void 0:P.$el,C=y==null?void 0:y.querySelector("input");C==null||C.focus()})},v=(y,C)=>{const P=C==="input"?y.value:y;let M=(()=>{if(P!=null)return P!=="-"?+P:P})();if(M!=null&&!isNaN(+M))M=P!=null?+P:void 0,S(C,M);else if(M==null&&typeof M!="string"){const D=n.allowEmptyValue?M:M??n.min??0;c.value=D,C==="input"?(!n.allowEmptyValue&&u.value&&m(),i("input",D)):i("update:modelValue",D)}},S=(y,C)=>{const P=typeof C=="number"?b(C):!1;let R=C==null?void 0:C.toString().slice(0,C<0?n.maxDigit+1:n.maxDigit);R!=null&&(R=+(R??0)),c.value=P?+(R??0):C,P&&m(),i(y==="input"?"input":"update:modelValue",P?+(R??0):C)},b=y=>y!=null&&y.toString().length>(n.maxDigit>16?16:n.maxDigit),k=()=>{const y=+(c.value??0)+1;(n.max&&n.max>=y||n.max==null)&&v(y,"modelValue")},A=()=>{const y=+(c.value??0)-1;(n.min&&n.min<=y||n.min==null)&&v(y,"modelValue")},w=y=>n.min&&y<n.min?n.min:n.max&&y>n.max?n.max:y;return Re(()=>n.value,y=>{const C=y!=null?w(y):y;b(C)||(c.value=C)},{once:!0}),Re(()=>n.modelValue,y=>{const C=y!=null?w(y):y;b(C)||(c.value=C)}),(y,C)=>(g(),L(Yn,{info:y.fieldInfo,label:n.label,mandatory:n.mandatory,"tooltip-pos":y.tooltipPos},Dn({default:z(()=>[I(br,{class:pe(["grid ",{"grid-cols-[max-content,1fr,max-content]":r["addon-left"]&&r["addon-right"]||y.showButtons,"grid-cols-[1fr,max-content]":!r["addon-left"]&&r["addon-right"],"grid-cols-[max-content,1fr]":r["addon-left"]&&!r["addon-right"]},{"w-max":y.autoResize},y.inputGroupClass]),disabled:n.disabled,invalid:f.value},{default:z(()=>[r["addon-left"]||n.showButtons?(g(),L(x(ps),{key:0,class:pe([y.addonLeftClass,{"cursor-pointer":n.showButtons}]),disabled:y.disabled,pt:{root:x(o).root({props:n})},onClick:C[0]||(C[0]=P=>n.showButtons&&!n.disabled?A():void 0)},{default:z(()=>[ee(y.$slots,"addon-left",{},()=>[I(Me,O(x(a).decrementicon({props:n}),{icon:"subtract"}),null,16)])]),_:3},8,["class","disabled","pt"])):N("",!0),E("span",{class:pe(["relative",{"w-max":y.autoResize}]),"data-wv-section":"autoresizeinputwrapper"},[y.autoResize?(g(),T("span",O({key:0,"data-wv-section":"inputresizer"},x(a).inputresizer),_((c.value??"").toString().padStart(y.padStart,"0")),17)):N("",!0),(g(),L(x(Ul),O({key:l.value,ref_key:"inputNumber",ref:u},n,{class:[y.inputNumberClass,{"absolute left-0 top-0":y.autoResize}],"input-id":p.value,"model-value":c.value,placeholder:y.autoResize?"":d.value,"show-buttons":!1,onInput:C[1]||(C[1]=P=>v(P,"input")),"onUpdate:modelValue":C[2]||(C[2]=P=>v(P,"modelValue"))}),null,16,["class","input-id","model-value","placeholder"]))],2),r["addon-right"]||n.showButtons?(g(),L(x(ps),{key:1,class:pe([y.addonRightClass,{"cursor-pointer":n.showButtons}]),disabled:y.disabled,pt:{root:x(o).root({props:n})},onClick:C[3]||(C[3]=P=>n.showButtons&&!y.disabled?k():void 0)},{default:z(()=>[ee(y.$slots,"addon-right",{},()=>[I(Me,O(x(a).incrementicon({props:n}),{icon:"add"}),null,16)])]),_:3},8,["class","disabled","pt"])):N("",!0)]),_:3},8,["class","disabled","invalid"]),ee(y.$slots,"validatormessage",{},()=>[n.showValidatorMessage?(g(),L(Rn,{key:0,message:c.errorMessage},null,8,["message"])):N("",!0)])]),_:2},[r["field-label-addon"]?{name:"label-addon",fn:z(()=>[ee(y.$slots,"field-label-addon")]),key:"0"}:void 0]),1032,["info","label","mandatory","tooltip-pos"]))}})),WZ=ce("InputCurrency",ye({__name:"InputCurrency",props:{modelValue:{},value:{},label:{},max:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},validatorMessage:{},invalid:{type:Boolean},placeholder:{},disabled:{type:Boolean},showButtons:{type:Boolean},size:{},mode:{},useGrouping:{type:Boolean},fieldInfo:{},inputnNumberId:{}},emits:["update:modelValue","input"],setup(t,{emit:e}){var k,A;const n=t,i=e;bt(()=>{n.useValidator&&(Object.assign(f,Ln(n.fieldName??"currencyInput",w=>{var y;return!(w!=null&&w.value)&&n.mandatory?typeof n.validatorMessage=="object"&&"empty"in n.validatorMessage?n.validatorMessage.empty.replace("{label}",n.label):(y=r.emptyInputErrorMessage)==null?void 0:y.replace("{label}",n.label):!0})),n.modelValue&&(f.value=n.modelValue))});const{locale:r}=_t("InputCurrency"),{locale:o}=_t("Dropdown"),{dropdown:s={},inputcurrency:a={}}=dt("preset",{}),l=oe(!1),u=oe((k=n.modelValue)==null?void 0:k.value),c=navigator.userAgent.includes("Firefox"),d=oe(hp((A=n.modelValue)==null?void 0:A.currency)),f=sn({value:n.modelValue}),p=oe(w1),h=W(()=>{var w;return(w=d.value)==null?void 0:w.locale}),m=W(()=>n.inputnNumberId?n.inputnNumberId:(n.label??n.fieldName??"input-number").toLowerCase().trim().replaceAll(" ","-")+"-inputnumber"),v=W(()=>n.invalid||!!f.errorMessage),S=({currency:w},y)=>{const C={currency:w,value:y};i("update:modelValue",C),f.value=C},b=()=>{Pt(()=>{const w=document.getElementById(m.value);w&&w.focus()})};return Re(()=>n.modelValue,()=>{var w,y,C;d.value=(w=n.modelValue)!=null&&w.currency?hp((y=n.modelValue)==null?void 0:y.currency):d.value,f.value=n.modelValue,u.value=(C=n.modelValue)==null?void 0:C.value}),(w,y)=>(g(),L(U3,O(n,{modelValue:u.value,"onUpdate:modelValue":[y[4]||(y[4]=C=>u.value=C),y[5]||(y[5]=C=>S(d.value,C))],"input-id":m.value,"input-number-class":x(a).value({isFirefoxBased:x(c),invalidInput:v.value}).class,locale:h.value,"min-fraction-digits":0,"use-validator":!1,"addon-left-class":"!p-0 !bg-transparent","input-group-class":"!ring-0",mode:"decimal","use-grouping":""}),{"addon-left":z(()=>[I(x(qr),{modelValue:d.value,"onUpdate:modelValue":[y[0]||(y[0]=C=>d.value=C),y[3]||(y[3]=C=>S(C,u.value))],class:pe(x(a).currency({isFirefoxBased:x(c),invalidInput:v.value}).class),"filter-fields":["label","currency"],"filter-placeholder":x(o).filterPlaceholder,options:p.value,pt:{input:{class:["py-1 pl-3 pr-0.5",x(s).input({props:{modelValue:d.value}}).class]}},onHide:y[1]||(y[1]=C=>(l.value=!1,b())),onShow:y[2]||(y[2]=C=>l.value=!0),"data-key":"currency",filter:"","option-label":"symbol"},{dropdownicon:z(()=>[I(Me,it(Ot(x(s).dropdownicon({state:{isShowOverlay:l.value}}))),null,16)]),option:z(({option:C})=>[ht(_(C.label),1)]),_:1},8,["modelValue","class","filter-placeholder","options","pt"])]),validatormessage:z(()=>[I(Rn,{message:f.errorMessage},null,8,["message"])]),_:1},16,["modelValue","input-id","input-number-class","locale"]))}})),qZ=ce("InputEmail",ye({__name:"InputEmail",props:{allowedCharacters:{},autoUppercase:{type:Boolean},modelValue:{},value:{},existingValues:{},checkAvailability:{},maxLength:{},label:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},manualInvalidContainer:{type:Boolean},validatorMessage:{},validatorMessageClass:{},placeholder:{},disabled:{type:Boolean},fieldInfo:{},inputClass:{},inputContainerClass:{},labelClass:{},blurOnReachMaxLength:{type:Boolean},preventInputOnMaxLength:{type:Boolean},validateOnBlur:{type:Boolean},useProtocol:{type:Boolean,default:!0},allowSpecialCharacters:{type:Boolean,default:!0},useInputGroup:{type:Boolean,default:!0},inputId:{}},emits:["update:modelValue","blur","input"],setup(t){return(e,n)=>(g(),L(Ia,O({onBlur:n[0]||(n[0]=i=>e.$emit("blur",i)),onInput:n[1]||(n[1]=i=>e.$emit("input",i)),"onUpdate:modelValue":n[2]||(n[2]=i=>e.$emit("update:modelValue",i))},e.$props,{type:"email","validate-on-blur":""}),null,16))}})),XZ=ce("InputOtp",ye({__name:"InputOtp",props:{disabled:{type:Boolean},integerOnly:{type:Boolean},invalid:{type:Boolean},length:{},mask:{type:Boolean},modelValue:{},onBlur:{type:Function},onChange:{type:Function},onCompleted:{type:Function},onFocus:{type:Function},"onUpdate:modelValue":{type:Function},pt:{},readonly:{type:Boolean},variant:{}},setup(t){return(e,n)=>(g(),L(x(vT),O(e.$props,{onVnodeBeforeMount:n[0]||(n[0]=i=>x(Rb)("WANGS-INPUT-OTP",e.$preset.inputotp))}),null,16))}}));var K3={name:"EyeSlashIcon",extends:bn},lK=E("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.9414 6.74792C13.9437 6.75295 13.9455 6.757 13.9469 6.76003C13.982 6.8394 14.0001 6.9252 14.0001 7.01195C14.0001 7.0987 13.982 7.1845 13.9469 7.26386C13.6004 8.00059 13.1711 8.69549 12.6674 9.33515C12.6115 9.4071 12.54 9.46538 12.4582 9.50556C12.3765 9.54574 12.2866 9.56678 12.1955 9.56707C12.0834 9.56671 11.9737 9.53496 11.8788 9.47541C11.7838 9.41586 11.7074 9.3309 11.6583 9.23015C11.6092 9.12941 11.5893 9.01691 11.6008 8.90543C11.6124 8.79394 11.6549 8.68793 11.7237 8.5994C12.1065 8.09726 12.4437 7.56199 12.7313 6.99995C12.2595 6.08027 10.3402 2.8014 6.99732 2.8014C6.63723 2.80218 6.27816 2.83969 5.92569 2.91336C5.77666 2.93304 5.62568 2.89606 5.50263 2.80972C5.37958 2.72337 5.29344 2.59398 5.26125 2.44714C5.22907 2.30031 5.2532 2.14674 5.32885 2.01685C5.40451 1.88696 5.52618 1.79021 5.66978 1.74576C6.10574 1.64961 6.55089 1.60134 6.99732 1.60181C11.5916 1.60181 13.7864 6.40856 13.9414 6.74792ZM2.20333 1.61685C2.35871 1.61411 2.5091 1.67179 2.6228 1.77774L12.2195 11.3744C12.3318 11.4869 12.3949 11.6393 12.3949 11.7983C12.3949 11.9572 12.3318 12.1097 12.2195 12.2221C12.107 12.3345 11.9546 12.3976 11.7956 12.3976C11.6367 12.3976 11.4842 12.3345 11.3718 12.2221L10.5081 11.3584C9.46549 12.0426 8.24432 12.4042 6.99729 12.3981C2.403 12.3981 0.208197 7.59135 0.0532336 7.25198C0.0509364 7.24694 0.0490875 7.2429 0.0476856 7.23986C0.0162332 7.16518 3.05176e-05 7.08497 3.05176e-05 7.00394C3.05176e-05 6.92291 0.0162332 6.8427 0.0476856 6.76802C0.631261 5.47831 1.46902 4.31959 2.51084 3.36119L1.77509 2.62545C1.66914 2.51175 1.61146 2.36136 1.61421 2.20597C1.61695 2.05059 1.6799 1.90233 1.78979 1.79244C1.89968 1.68254 2.04794 1.6196 2.20333 1.61685ZM7.45314 8.35147L5.68574 6.57609V6.5361C5.5872 6.78938 5.56498 7.06597 5.62183 7.33173C5.67868 7.59749 5.8121 7.84078 6.00563 8.03158C6.19567 8.21043 6.43052 8.33458 6.68533 8.39089C6.94014 8.44721 7.20543 8.43359 7.45314 8.35147ZM1.26327 6.99994C1.7351 7.91163 3.64645 11.1985 6.99729 11.1985C7.9267 11.2048 8.8408 10.9618 9.64438 10.4947L8.35682 9.20718C7.86027 9.51441 7.27449 9.64491 6.69448 9.57752C6.11446 9.51014 5.57421 9.24881 5.16131 8.83592C4.74842 8.42303 4.4871 7.88277 4.41971 7.30276C4.35232 6.72274 4.48282 6.13697 4.79005 5.64041L3.35855 4.2089C2.4954 5.00336 1.78523 5.94935 1.26327 6.99994Z",fill:"currentColor"},null,-1),uK=[lK];function cK(t,e,n,i,r,o){return g(),T("svg",O({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.pti()),uK,16)}K3.render=cK;var dK={root:function(e){var n=e.props;return{position:n.appendTo==="self"?"relative":void 0}}},fK={root:function(e){var n=e.instance,i=e.props;return["p-password p-component p-inputwrapper",{"p-inputwrapper-filled":n.filled,"p-inputwrapper-focus":n.focused,"p-icon-field p-icon-field-right":i.toggleMask}]},input:function(e){var n=e.props;return["p-password-input",{"p-disabled":n.disabled}]},hideIcon:"p-input-icon",showIcon:"p-input-icon",panel:function(e){var n=e.instance;return["p-password-panel p-component",{"p-ripple-disabled":n.$primevue.config.ripple===!1}]},meter:"p-password-meter",meterLabel:function(e){var n=e.instance;return"p-password-strength ".concat(n.meter?n.meter.strength:"")},info:"p-password-info"},pK=Xt.extend({name:"password",classes:fK,inlineStyles:dK}),hK={name:"BasePassword",extends:It,props:{modelValue:String,promptLabel:{type:String,default:null},mediumRegex:{type:[String,RegExp],default:"^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})"},strongRegex:{type:[String,RegExp],default:"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})"},weakLabel:{type:String,default:null},mediumLabel:{type:String,default:null},strongLabel:{type:String,default:null},feedback:{type:Boolean,default:!0},appendTo:{type:[String,Object],default:"body"},toggleMask:{type:Boolean,default:!1},hideIcon:{type:String,default:void 0},showIcon:{type:String,default:void 0},variant:{type:String,default:null},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},required:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelId:{type:String,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:pK,provide:function(){return{$parentInstance:this}}},W3={name:"Password",extends:hK,inheritAttrs:!1,emits:["update:modelValue","change","focus","blur","invalid"],data:function(){return{id:this.$attrs.id,overlayVisible:!1,meter:null,infoText:null,focused:!1,unmasked:!1}},watch:{"$attrs.id":function(e){this.id=e||jn()}},mediumCheckRegExp:null,strongCheckRegExp:null,resizeListener:null,scrollHandler:null,overlay:null,mounted:function(){this.id=this.id||jn(),this.infoText=this.promptText,this.mediumCheckRegExp=new RegExp(this.mediumRegex),this.strongCheckRegExp=new RegExp(this.strongRegex)},beforeUnmount:function(){this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(pn.clear(this.overlay),this.overlay=null)},methods:{onOverlayEnter:function(e){pn.set("overlay",e,this.$primevue.config.zIndex.overlay),G.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.bindScrollListener(),this.bindResizeListener()},onOverlayLeave:function(){this.unbindScrollListener(),this.unbindResizeListener(),this.overlay=null},onOverlayAfterLeave:function(e){pn.clear(e)},alignOverlay:function(){this.appendTo==="self"?G.relativePosition(this.overlay,this.$refs.input.$el):(this.overlay.style.minWidth=G.getOuterWidth(this.$refs.input.$el)+"px",G.absolutePosition(this.overlay,this.$refs.input.$el))},testStrength:function(e){var n=0;return this.strongCheckRegExp.test(e)?n=3:this.mediumCheckRegExp.test(e)?n=2:e.length&&(n=1),n},onInput:function(e){this.$emit("update:modelValue",e.target.value),this.$emit("change",e)},onFocus:function(e){this.focused=!0,this.feedback&&(this.setPasswordMeter(this.modelValue),this.overlayVisible=!0),this.$emit("focus",e)},onBlur:function(e){this.focused=!1,this.feedback&&(this.overlayVisible=!1),this.$emit("blur",e)},onKeyUp:function(e){if(this.feedback){var n=e.target.value,i=this.checkPasswordStrength(n),r=i.meter,o=i.label;if(this.meter=r,this.infoText=o,e.code==="Escape"){this.overlayVisible&&(this.overlayVisible=!1);return}this.overlayVisible||(this.overlayVisible=!0)}},setPasswordMeter:function(){if(!this.modelValue){this.meter=null,this.infoText=this.promptText;return}var e=this.checkPasswordStrength(this.modelValue),n=e.meter,i=e.label;this.meter=n,this.infoText=i,this.overlayVisible||(this.overlayVisible=!0)},checkPasswordStrength:function(e){var n=null,i=null;switch(this.testStrength(e)){case 1:n=this.weakText,i={strength:"weak",width:"33.33%"};break;case 2:n=this.mediumText,i={strength:"medium",width:"66.66%"};break;case 3:n=this.strongText,i={strength:"strong",width:"100%"};break;default:n=this.promptText,i=null;break}return{label:n,meter:i}},onInvalid:function(e){this.$emit("invalid",e)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new Ws(this.$refs.input.$el,function(){e.overlayVisible&&(e.overlayVisible=!1)})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!G.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},overlayRef:function(e){this.overlay=e},onMaskToggle:function(){this.unmasked=!this.unmasked},onOverlayClick:function(e){So.emit("overlay-click",{originalEvent:e,target:this.$el})}},computed:{inputType:function(){return this.unmasked?"text":"password"},filled:function(){return this.modelValue!=null&&this.modelValue.toString().length>0},weakText:function(){return this.weakLabel||this.$primevue.config.locale.weak},mediumText:function(){return this.mediumLabel||this.$primevue.config.locale.medium},strongText:function(){return this.strongLabel||this.$primevue.config.locale.strong},promptText:function(){return this.promptLabel||this.$primevue.config.locale.passwordPrompt},panelUniqueId:function(){return this.id+"_panel"}},components:{PInputText:Xr,Portal:Wr,EyeSlashIcon:K3,EyeIcon:oh}};function Ru(t){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ru(t)}function q3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function X3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?q3(Object(n),!0).forEach(function(i){mK(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):q3(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function mK(t,e,n){return e=gK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gK(t){var e=vK(t,"string");return Ru(e)=="symbol"?e:String(e)}function vK(t,e){if(Ru(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Ru(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yK=["id"];function bK(t,e,n,i,r,o){var s=et("PInputText"),a=et("Portal");return g(),T("div",O({class:t.cx("root"),style:t.sx("root")},t.ptmi("root")),[I(s,O({ref:"input",id:t.inputId,type:o.inputType,class:[t.cx("input"),t.inputClass],style:t.inputStyle,value:t.modelValue,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-controls":t.panelProps&&t.panelProps.id||t.panelId||o.panelUniqueId,"aria-expanded":r.overlayVisible,"aria-haspopup":!0,placeholder:t.placeholder,required:t.required,disabled:t.disabled,variant:t.variant,invalid:t.invalid,onInput:o.onInput,onFocus:o.onFocus,onBlur:o.onBlur,onKeyup:o.onKeyUp,onInvalid:o.onInvalid},t.inputProps,{pt:t.ptm("input"),unstyled:t.unstyled}),null,16,["id","type","class","style","value","aria-labelledby","aria-label","aria-controls","aria-expanded","placeholder","required","disabled","variant","invalid","onInput","onFocus","onBlur","onKeyup","onInvalid","pt","unstyled"]),t.toggleMask&&r.unmasked?ee(t.$slots,"hideicon",{key:0,onClick:o.onMaskToggle,toggleCallback:o.onMaskToggle},function(){return[(g(),L(yt(t.hideIcon?"i":"EyeSlashIcon"),O({class:[t.cx("hideIcon"),t.hideIcon],onClick:o.onMaskToggle},t.ptm("hideIcon")),null,16,["class","onClick"]))]}):N("",!0),t.toggleMask&&!r.unmasked?ee(t.$slots,"showicon",{key:1,onClick:o.onMaskToggle,toggleCallback:o.onMaskToggle},function(){return[(g(),L(yt(t.showIcon?"i":"EyeIcon"),O({class:[t.cx("showIcon"),t.showIcon],onClick:o.onMaskToggle},t.ptm("showIcon")),null,16,["class","onClick"]))]}):N("",!0),E("span",O({class:"p-hidden-accessible","aria-live":"polite"},t.ptm("hiddenAccesible"),{"data-p-hidden-accessible":!0}),_(r.infoText),17),I(a,{appendTo:t.appendTo},{default:z(function(){return[I(Vr,O({name:"p-connected-overlay",onEnter:o.onOverlayEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},t.ptm("transition")),{default:z(function(){return[r.overlayVisible?(g(),T("div",O({key:0,ref:o.overlayRef,id:t.panelId||o.panelUniqueId,class:[t.cx("panel"),t.panelClass],style:t.panelStyle,onClick:e[0]||(e[0]=function(){return o.onOverlayClick&&o.onOverlayClick.apply(o,arguments)})},X3(X3({},t.panelProps),t.ptm("panel"))),[ee(t.$slots,"header"),ee(t.$slots,"content",{},function(){return[E("div",O({class:t.cx("meter")},t.ptm("meter")),[E("div",O({class:t.cx("meterLabel"),style:{width:r.meter?r.meter.width:""}},t.ptm("meterLabel")),null,16)],16),E("div",O({class:t.cx("info")},t.ptm("info")),_(r.infoText),17)]}),ee(t.$slots,"footer")],16,yK)):N("",!0)]}),_:3},16,["onEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo"])],16)}W3.render=bK;const AK=["onClick"],wK=["onClick"],GZ=ce("InputPassword",ye({__name:"InputPassword",props:{modelValue:{},label:{},labelClass:{},inputContainerClass:{},mandatory:{type:Boolean},placeholder:{},feedback:{type:Boolean},fieldName:{},useValidator:{type:Boolean},invalid:{type:Boolean},validatorMessage:{},validatorMessageClass:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=dt("preset",{}).password,i=t,r=e,o=re(i.modelValue),s=sn({value:void 0}),a=W(()=>i.invalid||!!s.errorMessage);bt(()=>{i.useValidator&&(Object.assign(s,Ln(i.fieldName??"password",d=>Pt(()=>l(d==null?void 0:d.trim())))),i.modelValue!=null&&(s.value=i.modelValue))});const l=d=>{if(typeof i.validatorMessage=="string"&&i.invalid)return i.validatorMessage;if(typeof i.validatorMessage!="string"){const{empty:f}=i.validatorMessage??{};if(!d&&i.mandatory)return f??!0}return!0},u=d=>{r("update:modelValue",d),i.useValidator&&(s.value=d)},c=d=>{const f=d.target;f.previousElementSibling&&f.previousElementSibling.tagName==="INPUT"&&f.previousElementSibling.focus()};return Re(()=>i.modelValue,d=>{o.value=d,s.value=d}),Re(()=>i.invalid,()=>{var d;(d=s.validate)==null||d.call(s)}),(d,f)=>(g(),L(Yn,{label:i.label,"label-class":i.labelClass,mandatory:i.mandatory},{default:z(()=>[I(br,{class:pe(i.inputContainerClass),invalid:a.value},{default:z(()=>[I(x(W3),{modelValue:o.value,"onUpdate:modelValue":[f[0]||(f[0]=p=>o.value=p),u],feedback:i.feedback,invalid:a.value,placeholder:i.placeholder,"toggle-mask":""},{showicon:z(({toggleCallback:p})=>{var h;return[E("button",{class:pe([(h=x(n))==null?void 0:h.showicon.class,"unset"]),onClick:m=>(p(),c(m))},[I(Me,{icon:"eye"})],10,AK)]}),hideicon:z(({toggleCallback:p})=>{var h;return[E("button",{class:pe([(h=x(n))==null?void 0:h.showicon.class,"unset"]),onClick:m=>(p(),c(m))},[I(Me,{icon:"eye-off"})],10,wK)]}),_:1},8,["modelValue","feedback","invalid","placeholder"])]),_:1},8,["class","invalid"]),I(Rn,{class:pe(i.validatorMessageClass),message:s.errorMessage},null,8,["class","message"])]),_:1},8,["label","label-class","mandatory"]))}})),SK={Andorra:"Andorra",Dubai:"United Arab Emirates",Kabul:"Afghanistan",Tirane:"Albania",Yerevan:"Armenia",Casey:"Antarctica",Davis:"Antarctica",Mawson:"Antarctica",Palmer:"Antarctica",Rothera:"Antarctica",Troll:"Antarctica",Vostok:"Antarctica",Buenos_Aires:"Argentina",Cordoba:"Argentina",Salta:"Argentina",Jujuy:"Argentina",Tucuman:"Argentina",Catamarca:"Argentina",La_Rioja:"Argentina",San_Juan:"Argentina",Mendoza:"Argentina",San_Luis:"Argentina",Rio_Gallegos:"Argentina",Ushuaia:"Argentina",Pago_Pago:"Samoa (American)",Vienna:"Austria",Lord_Howe:"Australia",Macquarie:"Australia",Hobart:"Australia",Melbourne:"Australia",Sydney:"Australia",Broken_Hill:"Australia",Brisbane:"Australia",Lindeman:"Australia",Adelaide:"Australia",Darwin:"Australia",Perth:"Australia",Eucla:"Australia",Baku:"Azerbaijan",Barbados:"Barbados",Dhaka:"Bangladesh",Brussels:"Belgium",Sofia:"Bulgaria",Bermuda:"Bermuda",La_Paz:"Bolivia",Noronha:"Brazil",Belem:"Brazil",Fortaleza:"Brazil",Recife:"Brazil",Araguaina:"Brazil",Maceio:"Brazil",Bahia:"Brazil",Sao_Paulo:"Brazil",Campo_Grande:"Brazil",Cuiaba:"Brazil",Santarem:"Brazil",Porto_Velho:"Brazil",Boa_Vista:"Brazil",Manaus:"Brazil",Eirunepe:"Brazil",Rio_Branco:"Brazil",Thimphu:"Bhutan",Minsk:"Belarus",Belize:"Belize",St_Johns:"Canada",Halifax:"Canada",Glace_Bay:"Canada",Moncton:"Canada",Goose_Bay:"Canada",Toronto:"Canada",Iqaluit:"Canada",Winnipeg:"Canada",Resolute:"Canada",Rankin_Inlet:"Canada",Regina:"Canada",Swift_Current:"Canada",Edmonton:"Canada",Cambridge_Bay:"Canada",Inuvik:"Canada",Dawson_Creek:"Canada",Fort_Nelson:"Canada",Whitehorse:"Canada",Dawson:"Canada",Vancouver:"Canada",Zurich:"Switzerland",Abidjan:"Côte d'Ivoire",Rarotonga:"Cook Islands",Santiago:"Chile",Coyhaique:"Chile",Punta_Arenas:"Chile",Easter:"Chile",Shanghai:"China",Urumqi:"China",Bogota:"Colombia",Costa_Rica:"Costa Rica",Havana:"Cuba",Cape_Verde:"Cape Verde",Nicosia:"Cyprus",Famagusta:"Cyprus",Prague:"Czech Republic",Berlin:"Germany",Santo_Domingo:"Dominican Republic",Algiers:"Algeria",Guayaquil:"Ecuador",Galapagos:"Ecuador",Tallinn:"Estonia",Cairo:"Egypt",El_Aaiun:"Western Sahara",Madrid:"Spain",Ceuta:"Spain",Canary:"Spain",Helsinki:"Finland",Fiji:"Fiji",Stanley:"Falkland Islands",Kosrae:"Micronesia",Faroe:"Faroe Islands",Paris:"France",London:"Britain (UK)",Tbilisi:"Georgia",Cayenne:"French Guiana",Gibraltar:"Gibraltar",Nuuk:"Greenland",Danmarkshavn:"Greenland",Scoresbysund:"Greenland",Thule:"Greenland",Athens:"Greece",South_Georgia:"South Georgia & the South Sandwich Islands",Guatemala:"Guatemala",Guam:"Guam",Bissau:"Guinea-Bissau",Guyana:"Guyana",Hong_Kong:"Hong Kong",Tegucigalpa:"Honduras","Port-au-Prince":"Haiti",Budapest:"Hungary",Jakarta:"Indonesia",Pontianak:"Indonesia",Makassar:"Indonesia",Jayapura:"Indonesia",Dublin:"Ireland",Jerusalem:"Israel",Kolkata:"India",Chagos:"British Indian Ocean Territory",Baghdad:"Iraq",Tehran:"Iran",Rome:"Italy",Jamaica:"Jamaica",Amman:"Jordan",Tokyo:"Japan",Nairobi:"Kenya",Bishkek:"Kyrgyzstan",Tarawa:"Kiribati",Kanton:"Kiribati",Kiritimati:"Kiribati",Pyongyang:"Korea (North)",Seoul:"Korea (South)",Almaty:"Kazakhstan",Qyzylorda:"Kazakhstan",Qostanay:"Kazakhstan",Aqtobe:"Kazakhstan",Aqtau:"Kazakhstan",Atyrau:"Kazakhstan",Oral:"Kazakhstan",Beirut:"Lebanon",Colombo:"Sri Lanka",Monrovia:"Liberia",Vilnius:"Lithuania",Riga:"Latvia",Tripoli:"Libya",Casablanca:"Morocco",Chisinau:"Moldova",Kwajalein:"Marshall Islands",Yangon:"Myanmar (Burma)",Ulaanbaatar:"Mongolia",Hovd:"Mongolia",Macau:"Macau",Martinique:"Martinique",Malta:"Malta",Mauritius:"Mauritius",Maldives:"Maldives",Mexico_City:"Mexico",Cancun:"Mexico",Merida:"Mexico",Monterrey:"Mexico",Matamoros:"Mexico",Chihuahua:"Mexico",Ciudad_Juarez:"Mexico",Ojinaga:"Mexico",Mazatlan:"Mexico",Bahia_Banderas:"Mexico",Hermosillo:"Mexico",Tijuana:"Mexico",Kuching:"Malaysia",Maputo:"Mozambique",Windhoek:"Namibia",Noumea:"New Caledonia",Norfolk:"Norfolk Island",Lagos:"Nigeria",Managua:"Nicaragua",Kathmandu:"Nepal",Nauru:"Nauru",Niue:"Niue",Auckland:"New Zealand",Chatham:"New Zealand",Panama:"Panama",Lima:"Peru",Tahiti:"French Polynesia",Marquesas:"French Polynesia",Gambier:"French Polynesia",Port_Moresby:"Papua New Guinea",Bougainville:"Papua New Guinea",Manila:"Philippines",Karachi:"Pakistan",Warsaw:"Poland",Miquelon:"St Pierre & Miquelon",Pitcairn:"Pitcairn",Puerto_Rico:"Puerto Rico",Gaza:"Palestine",Hebron:"Palestine",Lisbon:"Portugal",Madeira:"Portugal",Azores:"Portugal",Palau:"Palau",Asuncion:"Paraguay",Qatar:"Qatar",Bucharest:"Romania",Belgrade:"Serbia",Kaliningrad:"Russia",Moscow:"Russia",Simferopol:"Russia",Kirov:"Russia",Volgograd:"Russia",Astrakhan:"Russia",Saratov:"Russia",Ulyanovsk:"Russia",Samara:"Russia",Yekaterinburg:"Russia",Omsk:"Russia",Novosibirsk:"Russia",Barnaul:"Russia",Tomsk:"Russia",Novokuznetsk:"Russia",Krasnoyarsk:"Russia",Irkutsk:"Russia",Chita:"Russia",Yakutsk:"Russia",Khandyga:"Russia",Vladivostok:"Russia","Ust-Nera":"Russia",Magadan:"Russia",Sakhalin:"Russia",Srednekolymsk:"Russia",Kamchatka:"Russia",Anadyr:"Russia",Riyadh:"Saudi Arabia",Guadalcanal:"Solomon Islands",Khartoum:"Sudan",Singapore:"Singapore",Paramaribo:"Suriname",Juba:"South Sudan",Sao_Tome:"Sao Tome & Principe",El_Salvador:"El Salvador",Damascus:"Syria",Grand_Turk:"Turks & Caicos Is",Ndjamena:"Chad",Bangkok:"Thailand",Dushanbe:"Tajikistan",Fakaofo:"Tokelau",Dili:"East Timor",Ashgabat:"Turkmenistan",Tunis:"Tunisia",Tongatapu:"Tonga",Istanbul:"Turkey",Taipei:"Taiwan",Kyiv:"Ukraine",New_York:"United States",Detroit:"United States",Louisville:"United States",Monticello:"United States",Indianapolis:"United States",Vincennes:"United States",Winamac:"United States",Marengo:"United States",Petersburg:"United States",Vevay:"United States",Chicago:"United States",Tell_City:"United States",Knox:"United States",Menominee:"United States",Center:"United States",New_Salem:"United States",Beulah:"United States",Denver:"United States",Boise:"United States",Phoenix:"United States",Los_Angeles:"United States",Anchorage:"United States",Juneau:"United States",Sitka:"United States",Metlakatla:"United States",Yakutat:"United States",Nome:"United States",Adak:"United States",Honolulu:"United States",Montevideo:"Uruguay",Samarkand:"Uzbekistan",Tashkent:"Uzbekistan",Caracas:"Venezuela",Ho_Chi_Minh:"Vietnam",Efate:"Vanuatu",Apia:"Samoa (western)",Johannesburg:"South Africa",Antigua:"Antigua & Barbuda",Anguilla:"Anguilla",Luanda:"Angola",McMurdo:"Antarctica",DumontDUrville:"Antarctica",Syowa:"Antarctica",Aruba:"Aruba",Mariehamn:"Åland Islands",Sarajevo:"Bosnia & Herzegovina",Ouagadougou:"Burkina Faso",Bahrain:"Bahrain",Bujumbura:"Burundi","Porto-Novo":"Benin",St_Barthelemy:"St Barthelemy",Brunei:"Brunei",Kralendijk:"Caribbean NL",Nassau:"Bahamas",Gaborone:"Botswana","Blanc-Sablon":"Canada",Atikokan:"Canada",Creston:"Canada",Cocos:"Cocos (Keeling) Islands",Kinshasa:"Congo (Dem. Rep.)",Lubumbashi:"Congo (Dem. Rep.)",Bangui:"Central African Rep.",Brazzaville:"Congo (Rep.)",Douala:"Cameroon",Curacao:"Curaçao",Christmas:"Christmas Island",Busingen:"Germany",Djibouti:"Djibouti",Copenhagen:"Denmark",Dominica:"Dominica",Asmara:"Eritrea",Addis_Ababa:"Ethiopia",Chuuk:"Micronesia",Pohnpei:"Micronesia",Libreville:"Gabon",Grenada:"Grenada",Guernsey:"Guernsey",Accra:"Ghana",Banjul:"Gambia",Conakry:"Guinea",Guadeloupe:"Guadeloupe",Malabo:"Equatorial Guinea",Zagreb:"Croatia",Isle_of_Man:"Isle of Man",Reykjavik:"Iceland",Jersey:"Jersey",Phnom_Penh:"Cambodia",Comoro:"Comoros",St_Kitts:"St Kitts & Nevis",Kuwait:"Kuwait",Cayman:"Cayman Islands",Vientiane:"Laos",St_Lucia:"St Lucia",Vaduz:"Liechtenstein",Maseru:"Lesotho",Luxembourg:"Luxembourg",Monaco:"Monaco",Podgorica:"Montenegro",Marigot:"St Martin (French)",Antananarivo:"Madagascar",Majuro:"Marshall Islands",Skopje:"North Macedonia",Bamako:"Mali",Saipan:"Northern Mariana Islands",Nouakchott:"Mauritania",Montserrat:"Montserrat",Blantyre:"Malawi",Kuala_Lumpur:"Malaysia",Niamey:"Niger",Amsterdam:"Netherlands",Oslo:"Norway",Muscat:"Oman",Reunion:"Réunion",Kigali:"Rwanda",Mahe:"Seychelles",Stockholm:"Sweden",St_Helena:"St Helena",Ljubljana:"Slovenia",Longyearbyen:"Svalbard & Jan Mayen",Bratislava:"Slovakia",Freetown:"Sierra Leone",San_Marino:"San Marino",Dakar:"Senegal",Mogadishu:"Somalia",Lower_Princes:"St Maarten (Dutch)",Mbabane:"Eswatini (Swaziland)",Kerguelen:"French S. Terr.",Lome:"Togo",Port_of_Spain:"Trinidad & Tobago",Funafuti:"Tuvalu",Dar_es_Salaam:"Tanzania",Kampala:"Uganda",Midway:"US minor outlying islands",Wake:"US minor outlying islands",Vatican:"Vatican City",St_Vincent:"St Vincent",Tortola:"Virgin Islands (UK)",St_Thomas:"Virgin Islands (US)",Wallis:"Wallis & Futuna",Aden:"Yemen",Mayotte:"Mayotte",Lusaka:"Zambia",Harare:"Zimbabwe"};function CK(){let t=Intl.DateTimeFormat().resolvedOptions().timeZone;t==="Asia/Bangkok"&&(t="Asia/Jakarta");const[e,...n]=t.split("/"),i=n.join("/");return{timezone:t,region:e,city:i,country:SK[i]||"Unknown"}}const kK={class:"grid grid-cols-[max-content,auto] w-full","data-wv-section":"phone-number-input-wrapper"},OK={class:"flex gap-2"},TK=["src"],Lie=ce("InputPhoneNumber",ye({__name:"InputPhoneNumber",props:{modelValue:{},value:{},label:{},placeholder:{},disabled:{type:Boolean},maxDigit:{default:14},invalid:{type:Boolean},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},validatorMessage:{},fieldInfo:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e;Sf(async()=>{c.value=await m(),n.value||(d.value=A())}),bt(async()=>{h.value=n.modelValue,n.useValidator&&Object.assign(h,Ln(n.fieldName??"numberInput",async w=>await Pt(()=>u(w)))),n.value!=null&&k(n.value),n.modelValue!=null&&k(n.modelValue)});const{locale:r}=_t("InputPhoneNumber"),o=dt("preset",{}).inputphonenumber,s=oe(!1),a=W(()=>n.invalid||!!h.errorMessage),l=navigator.userAgent.includes("Firefox"),u=w=>n.invalid&&n.validatorMessage?n.validatorMessage:w==null&&n.mandatory?n.validatorMessage??`${n.label} harus diisi.`:!0,c=oe(),d=oe(),f=oe(),p=oe(0),h=sn({value:null}),m=async()=>{const{data:w}=await Rv.get("https://assets.tagsamurai.com/json/country-dial-code.json");return w.filter(y=>y.dial_code)??[]},v=()=>{h.value=f.value?`${d.value} ${f.value}`:void 0,i("update:modelValue",h.value)},S=()=>{Pt(()=>{const w=document.getElementById("phone-number-input");w&&w.focus()})},b=(w,y)=>{d.value=w,f.value=y},k=w=>{const y=w==null?void 0:w.split(" ");y!=null&&y.length?(b(y[0],y[1]),h.value=f.value?`${d.value} ${f.value}`:void 0):h.value=void 0},A=()=>{if(c.value){const{country:w}=CK(),y=c.value.find(C=>C.name===w);return y?y.dial_code:"+62"}return"+62"};return Re(()=>n.value,w=>{k(w)},{once:!0}),Re(()=>h.value,()=>{var C;const[w,y]=((C=h.value)==null?void 0:C.split(" "))??[];w&&y&&b(w,y)}),Re(()=>n.modelValue,w=>{k(w)}),(w,y)=>(g(),L(Yn,{info:n.fieldInfo,label:n.label,mandatory:n.mandatory},{default:z(()=>{var C,P;return[E("div",kK,[I(x(qr),{modelValue:d.value,"onUpdate:modelValue":y[0]||(y[0]=R=>d.value=R),class:pe((C=x(o))==null?void 0:C.dialcode.root({isFirefoxBased:x(l),invalidInput:a.value}).class),disabled:n.disabled,"filter-fields":["dial_code","name"],options:c.value,onChange:v,onHide:y[1]||(y[1]=()=>{S(),s.value=!1}),onShow:y[2]||(y[2]=R=>s.value=!0),"data-wv-section":"dialcode",filter:"","filter-placeholder":"Search","option-label":"dial_code","option-value":"dial_code"},{dropdownicon:z(()=>[I(Me,it(Ot(x(o).dialcode.dropdownicon({state:{isShowOverlay:s.value}}))),null,16)]),option:z(({option:R})=>[E("div",OK,[E("img",{src:R.image,alt:"country-img",style:{height:"16px"}},null,8,TK),E("span",null,_(R.name),1),E("span",null,_(R.dial_code),1)])]),_:1},8,["modelValue","class","disabled","options"]),(g(),L(Ia,{key:p.value,modelValue:f.value,"onUpdate:modelValue":y[3]||(y[3]=R=>f.value=R),"allowed-characters":/\d/,disabled:w.disabled,"input-class":(P=x(o))==null?void 0:P.input({isFirefoxBased:x(l),invalidInput:a.value}).class,"max-length":w.maxDigit,placeholder:w.placeholder??x(r).defaultPlaceholder,"use-field-wrapper":!1,"use-input-group":!1,"use-validator":!1,onBlur:v,"data-wv-section":"phoneinput","input-id":"phone-number-input","prevent-input-on-max-length":""},null,8,["modelValue","disabled","input-class","max-length","placeholder"]))]),ft(I(Rn,{message:h.errorMessage},null,8,["message"]),[[Zn,h.errorMessage]])]}),_:1},8,["info","label","mandatory"]))}})),xK={class:"flex gap-2 w-full items-center","data-wv-section":"inputwrapper"},MK=ce("InputRangeNumber",ye({__name:"InputRangeNumber",props:{modelValue:{},value:{},label:{},placeholder:{},minPlaceholder:{},maxPlaceholder:{},disabled:{type:Boolean},invalid:{type:Boolean},showOptionalText:{type:Boolean},useValidator:{type:Boolean},mandatory:{type:Boolean},validatorMessage:{},minFieldName:{},maxFieldName:{}},emits:["update:modelValue","submit"],setup(t,{emit:e}){const n=t,i=e,{locale:r}=_t("InputRangeNumber"),o=sn({value:void 0}),s=sn({value:void 0});bt(()=>{n.useValidator&&(Object.assign(o,Ln(n.minFieldName??"minNumberInput",c=>u(c),{initialValue:void 0})),Object.assign(s,Ln(n.maxFieldName??"maxNumberInput",c=>u(c),{initialValue:void 0})),n.value&&(o.value=n.value[0],s.value=n.value[1])),n.invalid&&n.useValidator&&(o.validate(),s.validate())});const a=W(()=>n.invalid||!!o.errorMessage||!!s.errorMessage),l=c=>{c.key==="Enter"&&i("submit")},u=async c=>{if(await Pt(),typeof n.validatorMessage=="string"&&n.invalid)return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{empty:d}=n.validatorMessage??{};if(c==null&&n.mandatory)return d??!0}return!0};return Re([()=>o.value,()=>s.value],([c,d])=>{i("update:modelValue",[c,d])}),Re(()=>n.value,c=>{o.value=c?c[0]:void 0,s.value=c?c[1]:void 0},{once:!0}),Re(()=>n.modelValue,c=>{o.value=c?c[0]:void 0,s.value=c?c[1]:void 0}),(c,d)=>(g(),L(Yn,{label:n.label,"show-optional-text":c.showOptionalText},{default:z(()=>[E("div",xK,[I(br,{invalid:a.value},{default:z(()=>[I(x(Ul),O(c.$props,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=f=>o.value=f),max:s.value,placeholder:c.placeholder??c.minPlaceholder??x(r).minPlaceholder,"use-grouping":!1,onKeydown:l,class:"w-full","input-id":"range-start"}),null,16,["modelValue","max","placeholder"])]),_:1},8,["invalid"]),d[2]||(d[2]=ht(" - ")),I(br,{invalid:a.value},{default:z(()=>[I(x(Ul),O(c.$props,{modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=f=>s.value=f),min:o.value,placeholder:c.placeholder??c.maxPlaceholder??x(r).maxPlaceholder,"use-grouping":!1,onKeydown:l,class:"w-full","input-id":"range-end"}),null,16,["modelValue","min","placeholder"])]),_:1},8,["invalid"])]),I(Rn,{message:o.errorMessage??s.errorMessage},null,8,["message"])]),_:1},8,["label","show-optional-text"]))}})),Die=ce("LiteDropdown",ye({__name:"LiteDropdown",props:Cn({modelValue:{type:[String,Number,Boolean,Object]},options:{},optionLabel:{},optionValue:{},mandatory:{type:Boolean},placeholder:{default:"Pilih data"},loading:{type:Boolean},disabled:{type:Boolean},filter:{type:Boolean,default:!0},filterPlaceholder:{default:"Cari"}},{modelValue:{type:[String,Number,Boolean,Object],required:!0},modelModifiers:{}}),emits:Cn(["update:modelValue","show","change"],["update:modelValue"]),setup(t){const e=dt("preset",{}).dropdown,n=si(t,"modelValue"),i=t,r=oe(!1);return(o,s)=>(g(),L(Yn,{mandatory:i.mandatory},{default:z(()=>[I(x(qr),O(i,{modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=a=>n.value=a),placeholder:i.loading?"Loading...":i.placeholder,pt:{root:({state:a,props:l})=>{var u;return{class:[...(u=x(e))==null?void 0:u.root({state:a,props:l}).class,"text-base",{"cursor-pointer":!l.disabled}],"data-wv-name":"litedropdown"}},input:({props:a})=>({class:["!font-semibold",{"!text-general-200":a.modelValue==null,"!text-grayscale-900":a.modelValue!=null}]})},onChange:s[1]||(s[1]=a=>o.$emit("change",a)),onHide:s[2]||(s[2]=a=>r.value=!1),onShow:s[3]||(s[3]=()=>{o.$emit("show"),r.value=!0}),class:"!w-fit"}),Dn({dropdownicon:z(()=>[I(Me,{class:pe(["!w-6 !h-6 !transition-transform !text-general-500",{"rotate-180":r.value}]),icon:"arrow-drop-down"},null,8,["class"])]),loadingicon:z(()=>[I(Me,{class:"text-xs animate-spin duration-200",icon:"spinner"})]),filtericon:z(()=>[I(Me,{class:"text-xs w-6 h-6",icon:"search-line"})]),_:2},[o.$slots.option?{name:"option",fn:z(({option:a})=>[ee(o.$slots,"option",{option:a})]),key:"0"}:void 0]),1040,["modelValue","placeholder","pt"])]),_:3},8,["mandatory"]))}})),EK=["data-user-lang"],PK=["alt","src"],IK={key:1,class:"flex items-center gap-0.5 text-xs text-general-800"},LK={key:2},G3=ye({__name:"LanguageDropdownOption",props:{option:{},iconOnly:{type:Boolean}},setup(t){return(e,n)=>{const i=an("tooltip");return g(),T("div",{"data-user-lang":e.option.isoCode,class:"flex gap-2 items-center"},[e.option.flag?ft((g(),T("img",{key:0,alt:"Country Flag of "+e.option.name,class:pe(["cursor-pointer aspect-square rounded-full ring-general-100 ring-[0.5px] outline-none",{"w-4 h-4":!e.iconOnly,"w-6 h-6":e.iconOnly}]),src:e.option.flag},null,10,PK)),[[i,e.iconOnly?`${e.option.name} (${e.option.isoCode.toUpperCase()})`:void 0,void 0,{left:!0}]]):e.iconOnly?(g(),T("span",IK,[I(Me,{class:"!text-base",icon:"global-line"}),ht(" "+_(e.option.isoCode.toUpperCase()),1)])):N("",!0),e.iconOnly?N("",!0):(g(),T("span",LK,_(e.option.name)+" ("+_(e.option.isoCode.toUpperCase())+") ",1))],8,EK)}}}),Rie=ce("LanguageSwitcher",ye({__name:"LanguageSwitcher",setup(t){bt(async()=>{i.value=await s()});const{service:e,setLocale:n}=ls(),i=oe(),r=oe([]),o=oe(!1),s=async()=>{const l=localStorage.getItem("lang")||navigator.language.split("-")[0];if(!r.value.length)try{const u=await e.getLanguageOptionMeta(l);if(u.isoCode)return r.value[0]=u,u}catch(u){console.error("Ups! Something error while fetching Language Option Meta.",u)}return r.value.find(u=>u.isoCode===l)||r.value[0]},a=async()=>{if(!(!e||r.value.length>1))try{o.value=!0;const l=await e.getLanguageOptions();r.value=l}catch(l){console.error("Ups! Something error while fetching language options.",l)}finally{o.value=!1}};return Re(i,l=>{n(l.isoCode)}),(l,u)=>(g(),L(x(qr),{modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c),"filter-fields":["language","name"],loading:o.value,options:r.value,pt:{root:{class:"flex items-center gap-1 gap-1"},input:{class:"p-0 outline-none"},trigger:{class:"w-max hover:bg-primary-50 rounded-full"}},onShow:a,class:"w-max","data-key":"language",filter:"","filter-placeholder":"Search language"},{dropdownicon:z(()=>[I(Me,{class:"w-4 h-4 rotate-180 text-general-800 transition-transform",icon:"arrow-up-s"})]),value:z(({value:c})=>[c?(g(),L(G3,{key:0,option:c,"icon-only":""},null,8,["option"])):N("",!0)]),option:z(({option:c})=>[I(G3,{option:c},null,8,["option"])]),_:1},8,["modelValue","loading","options"]))}})),Nie=ce("Loading",ye({__name:"Loading",setup(t){const{loading:e,message:n}=Fi();return(i,r)=>x(e)?(g(),L(Hu,{key:0,to:"body"},[E("div",O(i.$preset.loading.root,{"data-wv-name":"loading-overlay","data-wv-section":"overlay"}),[I(Kl,O({animation:"loading-page"},i.$preset.loading.animation),null,16),ht(" "+_(x(n)),1)],16)])):N("",!0)}}));var DK={root:function(e){var n=e.instance,i=e.props;return["p-checkbox p-component",{"p-highlight":n.checked,"p-disabled":i.disabled,"p-invalid":i.invalid,"p-variant-filled":i.variant?i.variant==="filled":n.$primevue.config.inputStyle==="filled"}]},box:"p-checkbox-box",input:"p-checkbox-input",icon:"p-checkbox-icon"},RK=Xt.extend({name:"checkbox",classes:DK}),NK={name:"BaseCheckbox",extends:It,props:{value:null,modelValue:null,binary:Boolean,name:{type:String,default:null},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},variant:{type:String,default:null},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:RK,provide:function(){return{$parentInstance:this}}};function BK(t){return FK(t)||zK(t)||VK(t)||$K()}function $K(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
325
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VK(t,e){if(t){if(typeof t=="string")return qg(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qg(t,e)}}function zK(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function FK(t){if(Array.isArray(t))return qg(t)}function qg(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Z3={name:"Checkbox",extends:NK,inheritAttrs:!1,emits:["update:modelValue","change","focus","blur"],methods:{getPTOptions:function(e){var n=e==="root"?this.ptmi:this.ptm;return n(e,{context:{checked:this.checked,disabled:this.disabled}})},onChange:function(e){var n=this;if(!this.disabled&&!this.readonly){var i;this.binary?i=this.checked?this.falseValue:this.trueValue:this.checked?i=this.modelValue.filter(function(r){return!Ce.equals(r,n.value)}):i=this.modelValue?[].concat(BK(this.modelValue),[this.value]):[this.value],this.$emit("update:modelValue",i),this.$emit("change",e)}},onFocus:function(e){this.$emit("focus",e)},onBlur:function(e){this.$emit("blur",e)}},computed:{checked:function(){return this.binary?this.modelValue===this.trueValue:Ce.contains(this.value,this.modelValue)}},components:{CheckIcon:Co}},jK=["data-p-highlight","data-p-disabled"],HK=["id","value","name","checked","tabindex","disabled","readonly","required","aria-labelledby","aria-label","aria-invalid"];function UK(t,e,n,i,r,o){var s=et("CheckIcon");return g(),T("div",O({class:t.cx("root")},o.getPTOptions("root"),{"data-p-highlight":o.checked,"data-p-disabled":t.disabled}),[E("input",O({id:t.inputId,type:"checkbox",class:[t.cx("input"),t.inputClass],style:t.inputStyle,value:t.value,name:t.name,checked:o.checked,tabindex:t.tabindex,disabled:t.disabled,readonly:t.readonly,required:t.required,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-invalid":t.invalid||void 0,onFocus:e[0]||(e[0]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[1]||(e[1]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),onChange:e[2]||(e[2]=function(){return o.onChange&&o.onChange.apply(o,arguments)})},o.getPTOptions("input")),null,16,HK),E("div",O({class:t.cx("box")},o.getPTOptions("box")),[ee(t.$slots,"icon",{checked:o.checked,class:pe(t.cx("icon"))},function(){return[o.checked?(g(),L(s,O({key:0,class:t.cx("icon")},o.getPTOptions("icon")),null,16,["class"])):N("",!0)]})],16)],16,jK)}Z3.render=UK;var KK={root:function(e){var n=e.props;return{position:n.appendTo==="self"?"relative":void 0}}},WK={root:function(e){var n=e.instance,i=e.props;return["p-multiselect p-component p-inputwrapper",{"p-multiselect-chip":i.display==="chip","p-disabled":i.disabled,"p-invalid":i.invalid,"p-variant-filled":i.variant?i.variant==="filled":n.$primevue.config.inputStyle==="filled","p-focus":n.focused,"p-inputwrapper-filled":i.modelValue&&i.modelValue.length,"p-inputwrapper-focus":n.focused||n.overlayVisible,"p-overlay-open":n.overlayVisible}]},labelContainer:"p-multiselect-label-container",label:function(e){var n=e.instance,i=e.props;return["p-multiselect-label",{"p-placeholder":n.label===i.placeholder,"p-multiselect-label-empty":!i.placeholder&&(!i.modelValue||i.modelValue.length===0)}]},token:"p-multiselect-token",tokenLabel:"p-multiselect-token-label",removeTokenIcon:"p-multiselect-token-icon",trigger:"p-multiselect-trigger",loadingIcon:"p-multiselect-trigger-icon",dropdownIcon:"p-multiselect-trigger-icon",panel:function(e){e.props;var n=e.instance;return["p-multiselect-panel p-component",{"p-ripple-disabled":n.$primevue.config.ripple===!1}]},header:"p-multiselect-header",filterContainer:"p-multiselect-filter-container",filterInput:function(e){var n=e.props,i=e.instance;return["p-multiselect-filter p-inputtext p-component",{"p-variant-filled":n.variant?n.variant==="filled":i.$primevue.config.inputStyle==="filled"}]},filterIcon:"p-multiselect-filter-icon",closeButton:"p-multiselect-close p-link",closeIcon:"p-multiselect-close-icon",wrapper:"p-multiselect-items-wrapper",list:"p-multiselect-items p-component",itemGroup:"p-multiselect-item-group",item:function(e){var n=e.instance,i=e.option,r=e.index,o=e.getItemOptions,s=e.props;return["p-multiselect-item",{"p-highlight":n.isSelected(i)&&s.highlightOnSelect,"p-focus":n.focusedOptionIndex===n.getOptionIndex(r,o),"p-disabled":n.isOptionDisabled(i)}]},emptyMessage:"p-multiselect-empty-message"},qK=Xt.extend({name:"multiselect",classes:WK,inlineStyles:KK}),XK={name:"BaseMultiSelect",extends:It,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,variant:{type:String,default:null},invalid:{type:Boolean,default:!1},disabled:Boolean,inputId:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default:null},dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},appendTo:{type:[String,Object],default:"body"},display:{type:String,default:"comma"},selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},checkboxIcon:{type:String,default:void 0},closeIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},removeTokenIcon:{type:String,default:void 0},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!1},autoFilterFocus:{type:Boolean,default:!1},focusOnHover:{type:Boolean,default:!0},highlightOnSelect:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:qK,provide:function(){return{$parentInstance:this}}};function Nu(t){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nu(t)}function _3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function J3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_3(Object(n),!0).forEach(function(i){Y3(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_3(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Y3(t,e,n){return e=GK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GK(t){var e=ZK(t,"string");return Nu(e)=="symbol"?e:String(e)}function ZK(t,e){if(Nu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Nu(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Q3(t){return QK(t)||YK(t)||JK(t)||_K()}function _K(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
326
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JK(t,e){if(t){if(typeof t=="string")return Xg(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xg(t,e)}}function YK(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function QK(t){if(Array.isArray(t))return Xg(t)}function Xg(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var eC={name:"MultiSelect",extends:XK,inheritAttrs:!1,emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter","selectall-change"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,startRangeIndex:-1,searchTimeout:null,searchValue:"",selectOnFocus:!1,data:function(){return{id:this.$attrs.id,clicked:!1,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||jn()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||jn(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(pn.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,n){return this.virtualScrollerDisabled?e:n&&n(e).index},getOptionLabel:function(e){return this.optionLabel?Ce.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?Ce.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e,n){return this.dataKey?Ce.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)+"_".concat(n)},getHeaderCheckboxPTOptions:function(e){return this.ptm(e,{context:{selected:this.allSelected}})},getCheckboxPTOptions:function(e,n,i,r){return this.ptm(r,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,n),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return this.maxSelectionLimitReached&&!this.isSelected(e)?!0:this.optionDisabled?Ce.resolveFieldData(e,this.optionDisabled):!1},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return Ce.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return Ce.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var n=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter(function(i){return n.isOptionGroup(i)}).length:e)+1},show:function(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),e&&G.focus(this.$refs.focusInput)},hide:function(e){var n=this,i=function(){n.$emit("before-hide"),n.overlayVisible=!1,n.clicked=!1,n.focusedOptionIndex=-1,n.searchValue="",n.resetFilterOnHide&&(n.filterValue=null),e&&G.focus(n.$refs.focusInput)};setTimeout(function(){i()},0)},onFocus:function(e){this.disabled||(this.focused=!0,this.overlayVisible&&(this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():this.findSelectedOptionIndex(),this.scrollInView(this.focusedOptionIndex)),this.$emit("focus",e))},onBlur:function(e){this.clicked=!1,this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){var n=this;if(this.disabled){e.preventDefault();return}var i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if(e.code==="KeyA"&&i){var r=this.visibleOptions.filter(function(o){return n.isValidOption(o)}).map(function(o){return n.getOptionValue(o)});this.updateModel(e,r),e.preventDefault();break}!i&&Ce.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault());break}this.clicked=!1},onContainerClick:function(e){this.disabled||this.loading||((!this.overlay||!this.overlay.contains(e.target))&&(this.overlayVisible?this.hide(!0):this.show(!0)),this.clicked=!0)},onFirstHiddenFocus:function(e){var n=e.relatedTarget===this.$refs.focusInput?G.getFirstFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;G.focus(n)},onLastHiddenFocus:function(e){var n=e.relatedTarget===this.$refs.focusInput?G.getLastFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;G.focus(n)},onCloseClick:function(){this.hide(!0)},onOptionSelect:function(e,n){var i=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!(this.disabled||this.isOptionDisabled(n))){var s=this.isSelected(n),a=null;s?a=this.modelValue.filter(function(l){return!Ce.equals(l,i.getOptionValue(n),i.equalityKey)}):a=[].concat(Q3(this.modelValue||[]),[this.getOptionValue(n)]),this.updateModel(e,a),r!==-1&&(this.focusedOptionIndex=r),o&&G.focus(this.$refs.focusInput)}},onOptionMouseMove:function(e,n){this.focusOnHover&&this.changeFocusedOptionIndex(e,n)},onOptionSelectRange:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(i===-1&&(i=this.findNearestSelectedOptionIndex(r,!0)),r===-1&&(r=this.findNearestSelectedOptionIndex(i)),i!==-1&&r!==-1){var o=Math.min(i,r),s=Math.max(i,r),a=this.visibleOptions.slice(o,s+1).filter(function(l){return n.isValidOption(l)}).map(function(l){return n.getOptionValue(l)});this.updateModel(e,a)}},onFilterChange:function(e){var n=e.target.value;this.filterValue=n,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:n}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0);break}},onFilterBlur:function(){this.focusedOptionIndex=-1},onFilterUpdated:function(){this.overlayVisible&&this.alignOverlay()},onOverlayClick:function(e){So.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){switch(e.code){case"Escape":this.onEscapeKey(e);break}},onArrowDownKey:function(e){if(!this.overlayVisible)this.show();else{var n=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.clicked?this.findFirstOptionIndex():this.findFirstFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,n),this.changeFocusedOptionIndex(e,n)}e.preventDefault()},onArrowUpKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.altKey&&!n)this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var i=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.clicked?this.findLastOptionIndex():this.findLastFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,i,this.startRangeIndex),this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;n&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n){var i=e.currentTarget;e.shiftKey?i.setSelectionRange(0,e.target.selectionStart):(i.setSelectionRange(0,0),this.focusedOptionIndex=-1)}else{var r=e.metaKey||e.ctrlKey,o=this.findFirstOptionIndex();e.shiftKey&&r&&this.onOptionSelectRange(e,o,this.startRangeIndex),this.changeFocusedOptionIndex(e,o),!this.overlayVisible&&this.show()}e.preventDefault()},onEndKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n){var i=e.currentTarget;if(e.shiftKey)i.setSelectionRange(e.target.selectionStart,i.value.length);else{var r=i.value.length;i.setSelectionRange(r,r),this.focusedOptionIndex=-1}}else{var o=e.metaKey||e.ctrlKey,s=this.findLastOptionIndex();e.shiftKey&&o&&this.onOptionSelectRange(e,this.startRangeIndex,s),this.changeFocusedOptionIndex(e,s),!this.overlayVisible&&this.show()}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.overlayVisible?this.focusedOptionIndex!==-1&&(e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])):(this.focusedOptionIndex=-1,this.onArrowDownKey(e)),e.preventDefault()},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;n||(this.overlayVisible&&this.hasFocusableElements()?(G.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(this.focusedOptionIndex!==-1&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter:function(e){pn.set("overlay",e,this.$primevue.config.zIndex.overlay),G.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&G.focus(this.$refs.filterInput)},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){pn.clear(e)},alignOverlay:function(){this.appendTo==="self"?G.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=G.getOuterWidth(this.$el)+"px",G.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){e.overlayVisible&&e.isOutsideClicked(n)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new Ws(this.$refs.container,function(){e.overlayVisible&&e.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!G.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked:function(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue:function(e){var n=this,i=this.optionGroupLabel?this.flatOptions(this.options):this.options||[],r=i.find(function(o){return!n.isOptionGroup(o)&&Ce.equals(n.getOptionValue(o),e,n.equalityKey)});return r?this.getOptionLabel(r):null},getSelectedItemsLabel:function(){var e=/{(.*?)}/,n=this.selectedItemsLabel||this.$primevue.config.locale.selectionMessage;return e.test(n)?n.replace(n.match(e)[0],this.modelValue.length+""):n},onToggleAll:function(e){var n=this;if(this.selectAll!==null)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{var i=this.allSelected?[]:this.visibleOptions.filter(function(r){return n.isValidOption(r)}).map(function(r){return n.getOptionValue(r)});this.updateModel(e,i)}},removeOption:function(e,n){var i=this,r=this.modelValue.filter(function(o){return!Ce.equals(o,n,i.equalityKey)});this.updateModel(e,r)},clearFilter:function(){this.filterValue=null},hasFocusableElements:function(){return G.getFocusableElements(this.overlay,':not([data-p-hidden-focusable="true"])').length>0},isOptionMatched:function(e){var n;return this.isValidOption(e)&&((n=this.getOptionLabel(e))===null||n===void 0?void 0:n.toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale)))},isValidOption:function(e){return Ce.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isEquals:function(e,n){return Ce.equals(e,n,this.equalityKey)},isSelected:function(e){var n=this,i=this.getOptionValue(e);return(this.modelValue||[]).some(function(r){return n.isEquals(r,i)})},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex(function(n){return e.isValidOption(n)})},findLastOptionIndex:function(){var e=this;return Ce.findLastIndex(this.visibleOptions,function(n){return e.isValidOption(n)})},findNextOptionIndex:function(e){var n=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(r){return n.isValidOption(r)}):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var n=this,i=e>0?Ce.findLastIndex(this.visibleOptions.slice(0,e),function(r){return n.isValidOption(r)}):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;if(this.hasSelectedOption){for(var n=function(){var s=e.modelValue[r],a=e.visibleOptions.findIndex(function(l){return e.isValidSelectedOption(l)&&e.isEquals(s,e.getOptionValue(l))});if(a>-1)return{v:a}},i,r=this.modelValue.length-1;r>=0;r--)if(i=n(),i)return i.v}return-1},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex(function(n){return e.isValidSelectedOption(n)}):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?Ce.findLastIndex(this.visibleOptions,function(n){return e.isValidSelectedOption(n)}):-1},findNextSelectedOptionIndex:function(e){var n=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex(function(r){return n.isValidSelectedOption(r)}):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var n=this,i=this.hasSelectedOption&&e>0?Ce.findLastIndex(this.visibleOptions.slice(0,e),function(r){return n.isValidSelectedOption(r)}):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=-1;return this.hasSelectedOption&&(n?(i=this.findPrevSelectedOptionIndex(e),i=i===-1?this.findNextSelectedOptionIndex(e):i):(i=this.findNextSelectedOptionIndex(e),i=i===-1?this.findPrevSelectedOptionIndex(e):i)),i>-1?i:e},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e){var n=this;this.searchValue=(this.searchValue||"")+e.key;var i=-1;Ce.isNotEmpty(this.searchValue)&&(this.focusedOptionIndex!==-1?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex(function(r){return n.isOptionMatched(r)}),i=i===-1?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex(function(r){return n.isOptionMatched(r)}):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex(function(r){return n.isOptionMatched(r)}),i===-1&&this.focusedOptionIndex===-1&&(i=this.findFirstFocusedOptionIndex()),i!==-1&&this.changeFocusedOptionIndex(e,i)),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(function(){n.searchValue="",n.searchTimeout=null},500)},changeFocusedOptionIndex:function(e,n){this.focusedOptionIndex!==n&&(this.focusedOptionIndex=n,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(e,this.visibleOptions[n]))},scrollInView:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:-1;this.$nextTick(function(){var i=n!==-1?"".concat(e.id,"_").concat(n):e.focusedOptionId,r=G.findSingle(e.list,'li[id="'.concat(i,'"]'));r?r.scrollIntoView&&r.scrollIntoView({block:"nearest",inline:"nearest"}):e.virtualScrollerDisabled||e.virtualScroller&&e.virtualScroller.scrollToIndex(n!==-1?n:e.focusedOptionIndex)})},autoUpdateModel:function(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();var e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,[e])}},updateModel:function(e,n){this.$emit("update:modelValue",n),this.$emit("change",{originalEvent:e,value:n})},flatOptions:function(e){var n=this;return(e||[]).reduce(function(i,r,o){i.push({optionGroup:r,group:!0,index:o});var s=n.getOptionGroupChildren(r);return s&&s.forEach(function(a){return i.push(a)}),i},[])},overlayRef:function(e){this.overlay=e},listRef:function(e,n){this.list=e,n&&n(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var e=this,n=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){var i=jb.filter(n,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){var r=this.options||[],o=[];return r.forEach(function(s){var a=e.getOptionGroupChildren(s),l=a.filter(function(u){return i.includes(u)});l.length>0&&o.push(J3(J3({},s),{},Y3({},typeof e.optionGroupChildren=="string"?e.optionGroupChildren:"items",Q3(l))))}),this.flatOptions(o)}return i}return n},label:function(){var e;if(this.modelValue&&this.modelValue.length){if(Ce.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(var n=0;n<this.modelValue.length;n++)n!==0&&(e+=", "),e+=this.getLabelByValue(this.modelValue[n])}else e=this.placeholder;return e},chipSelectedItems:function(){return Ce.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected:function(){var e=this;return this.selectAll!==null?this.selectAll:Ce.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every(function(n){return e.isOptionGroup(n)||e.isOptionDisabled(n)||e.isSelected(n)})},hasSelectedOption:function(){return Ce.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},maxSelectionLimitReached:function(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},filterResultMessageText:function(){return Ce.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.modelValue.length):this.emptySelectionMessageText},focusedOptionId:function(){return this.focusedOptionIndex!==-1?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter(function(n){return!e.isOptionGroup(n)}).length},toggleAllAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[this.allSelected?"selectAll":"unselectAll"]:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},listAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.listLabel:void 0},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:gi},components:{Checkbox:Z3,VirtualScroller:Yp,Portal:Wr,TimesIcon:vr,SearchIcon:Jp,TimesCircleIcon:sa,ChevronDownIcon:_p,SpinnerIcon:yl,CheckIcon:Co}};function Bu(t){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bu(t)}function tC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Go(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tC(Object(n),!0).forEach(function(i){Gg(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tC(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Gg(t,e,n){return e=eW(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eW(t){var e=tW(t,"string");return Bu(e)=="symbol"?e:String(e)}function tW(t,e){if(Bu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(Bu(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var nW=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-invalid"],iW=["onClick"],rW=["value","placeholder","aria-owns","aria-activedescendant"],oW=["aria-label"],sW=["id","aria-label"],aW=["id"],lW=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"];function uW(t,e,n,i,r,o){var s=et("TimesCircleIcon"),a=et("SpinnerIcon"),l=et("Checkbox"),u=et("VirtualScroller"),c=et("Portal"),d=an("ripple");return g(),T("div",O({ref:"container",class:t.cx("root"),style:t.sx("root"),onClick:e[13]||(e[13]=function(){return o.onContainerClick&&o.onContainerClick.apply(o,arguments)})},t.ptmi("root")),[E("div",O({class:"p-hidden-accessible"},t.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[E("input",O({ref:"focusInput",id:t.inputId,type:"text",readonly:"",disabled:t.disabled,placeholder:t.placeholder,tabindex:t.disabled?-1:t.tabindex,role:"combobox","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":r.overlayVisible,"aria-controls":r.id+"_list","aria-activedescendant":r.focused?o.focusedOptionId:void 0,"aria-invalid":t.invalid||void 0,onFocus:e[0]||(e[0]=function(){return o.onFocus&&o.onFocus.apply(o,arguments)}),onBlur:e[1]||(e[1]=function(){return o.onBlur&&o.onBlur.apply(o,arguments)}),onKeydown:e[2]||(e[2]=function(){return o.onKeyDown&&o.onKeyDown.apply(o,arguments)})},Go(Go({},t.inputProps),t.ptm("hiddenInput"))),null,16,nW)],16),E("div",O({class:t.cx("labelContainer")},t.ptm("labelContainer")),[E("div",O({class:t.cx("label")},t.ptm("label")),[ee(t.$slots,"value",{value:t.modelValue,placeholder:t.placeholder},function(){return[t.display==="comma"?(g(),T(le,{key:0},[ht(_(o.label||"empty"),1)],64)):t.display==="chip"?(g(),T(le,{key:1},[(g(!0),T(le,null,_e(o.chipSelectedItems,function(f){return g(),T("div",O({key:o.getLabelByValue(f),class:t.cx("token")},t.ptm("token")),[ee(t.$slots,"chip",{value:f},function(){return[E("span",O({class:t.cx("tokenLabel")},t.ptm("tokenLabel")),_(o.getLabelByValue(f)),17)]}),t.disabled?N("",!0):ee(t.$slots,"removetokenicon",{key:0,class:pe(t.cx("removeTokenIcon")),item:f,onClick:function(h){return o.removeOption(h,f)},removeCallback:function(h){return o.removeOption(h,f)}},function(){return[t.removeTokenIcon?(g(),T("span",O({key:0,class:[t.cx("removeTokenIcon"),t.removeTokenIcon],onClick:xt(function(p){return o.removeOption(p,f)},["stop"])},t.ptm("removeTokenIcon")),null,16,iW)):(g(),L(s,O({key:1,class:t.cx("removeTokenIcon"),onClick:xt(function(p){return o.removeOption(p,f)},["stop"])},t.ptm("removeTokenIcon")),null,16,["class","onClick"]))]})],16)}),128)),!t.modelValue||t.modelValue.length===0?(g(),T(le,{key:0},[ht(_(t.placeholder||"empty"),1)],64)):N("",!0)],64)):N("",!0)]})],16)],16),E("div",O({class:t.cx("trigger")},t.ptm("trigger")),[t.loading?ee(t.$slots,"loadingicon",{key:0,class:pe(t.cx("loadingIcon"))},function(){return[t.loadingIcon?(g(),T("span",O({key:0,class:[t.cx("loadingIcon"),"pi-spin",t.loadingIcon],"aria-hidden":"true"},t.ptm("loadingIcon")),null,16)):(g(),L(a,O({key:1,class:t.cx("loadingIcon"),spin:"","aria-hidden":"true"},t.ptm("loadingIcon")),null,16,["class"]))]}):ee(t.$slots,"dropdownicon",{key:1,class:pe(t.cx("dropdownIcon"))},function(){return[(g(),L(yt(t.dropdownIcon?"span":"ChevronDownIcon"),O({class:[t.cx("dropdownIcon"),t.dropdownIcon],"aria-hidden":"true"},t.ptm("dropdownIcon")),null,16,["class"]))]})],16),I(c,{appendTo:t.appendTo},{default:z(function(){return[I(Vr,O({name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},t.ptm("transition")),{default:z(function(){return[r.overlayVisible?(g(),T("div",O({key:0,ref:o.overlayRef,style:t.panelStyle,class:[t.cx("panel"),t.panelClass],onClick:e[11]||(e[11]=function(){return o.onOverlayClick&&o.onOverlayClick.apply(o,arguments)}),onKeydown:e[12]||(e[12]=function(){return o.onOverlayKeyDown&&o.onOverlayKeyDown.apply(o,arguments)})},Go(Go({},t.panelProps),t.ptm("panel"))),[E("span",O({ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:e[3]||(e[3]=function(){return o.onFirstHiddenFocus&&o.onFirstHiddenFocus.apply(o,arguments)})},t.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16),ee(t.$slots,"header",{value:t.modelValue,options:o.visibleOptions}),t.showToggleAll&&t.selectionLimit==null||t.filter?(g(),T("div",O({key:0,class:t.cx("header")},t.ptm("header")),[t.showToggleAll&&t.selectionLimit==null?(g(),L(l,{key:0,modelValue:o.allSelected,binary:!0,disabled:t.disabled,variant:t.variant,"aria-label":o.toggleAllAriaLabel,onChange:o.onToggleAll,unstyled:t.unstyled,pt:o.getHeaderCheckboxPTOptions("headerCheckbox")},{icon:z(function(f){return[t.$slots.headercheckboxicon?(g(),L(yt(t.$slots.headercheckboxicon),{key:0,checked:f.checked,class:pe(f.class)},null,8,["checked","class"])):f.checked?(g(),L(yt(t.checkboxIcon?"span":"CheckIcon"),O({key:1,class:[f.class,Gg({},t.checkboxIcon,f.checked)]},o.getHeaderCheckboxPTOptions("headerCheckbox.icon")),null,16,["class"])):N("",!0)]}),_:1},8,["modelValue","disabled","variant","aria-label","onChange","unstyled","pt"])):N("",!0),t.filter?(g(),T("div",O({key:1,class:t.cx("filterContainer")},t.ptm("filterContainer")),[E("input",O({ref:"filterInput",type:"text",value:r.filterValue,onVnodeMounted:e[4]||(e[4]=function(){return o.onFilterUpdated&&o.onFilterUpdated.apply(o,arguments)}),onVnodeUpdated:e[5]||(e[5]=function(){return o.onFilterUpdated&&o.onFilterUpdated.apply(o,arguments)}),class:t.cx("filterInput"),placeholder:t.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":r.id+"_list","aria-activedescendant":o.focusedOptionId,onKeydown:e[6]||(e[6]=function(){return o.onFilterKeyDown&&o.onFilterKeyDown.apply(o,arguments)}),onBlur:e[7]||(e[7]=function(){return o.onFilterBlur&&o.onFilterBlur.apply(o,arguments)}),onInput:e[8]||(e[8]=function(){return o.onFilterChange&&o.onFilterChange.apply(o,arguments)})},Go(Go({},t.filterInputProps),t.ptm("filterInput"))),null,16,rW),ee(t.$slots,"filtericon",{class:pe(t.cx("filterIcon"))},function(){return[(g(),L(yt(t.filterIcon?"span":"SearchIcon"),O({class:[t.cx("filterIcon"),t.filterIcon]},t.ptm("filterIcon")),null,16,["class"]))]})],16)):N("",!0),t.filter?(g(),T("span",O({key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),_(o.filterResultMessageText),17)):N("",!0),ft((g(),T("button",O({class:t.cx("closeButton"),"aria-label":o.closeAriaLabel,onClick:e[9]||(e[9]=function(){return o.onCloseClick&&o.onCloseClick.apply(o,arguments)}),type:"button"},Go(Go({},t.closeButtonProps),t.ptm("closeButton"))),[ee(t.$slots,"closeicon",{class:pe(t.cx("closeIcon"))},function(){return[(g(),L(yt(t.closeIcon?"span":"TimesIcon"),O({class:[t.cx("closeIcon"),t.closeIcon]},t.ptm("closeIcon")),null,16,["class"]))]})],16,oW)),[[d]])],16)):N("",!0),E("div",O({class:t.cx("wrapper"),style:{"max-height":o.virtualScrollerDisabled?t.scrollHeight:""}},t.ptm("wrapper")),[I(u,O({ref:o.virtualScrollerRef},t.virtualScrollerOptions,{items:o.visibleOptions,style:{height:t.scrollHeight},tabindex:-1,disabled:o.virtualScrollerDisabled,pt:t.ptm("virtualScroller")}),Dn({content:z(function(f){var p=f.styleClass,h=f.contentRef,m=f.items,v=f.getItemOptions,S=f.contentStyle,b=f.itemSize;return[E("ul",O({ref:function(A){return o.listRef(A,h)},id:r.id+"_list",class:[t.cx("list"),p],style:S,role:"listbox","aria-multiselectable":"true","aria-label":o.listAriaLabel},t.ptm("list")),[(g(!0),T(le,null,_e(m,function(k,A){return g(),T(le,{key:o.getOptionRenderKey(k,o.getOptionIndex(A,v))},[o.isOptionGroup(k)?(g(),T("li",O({key:0,id:r.id+"_"+o.getOptionIndex(A,v),style:{height:b?b+"px":void 0},class:t.cx("itemGroup"),role:"option"},t.ptm("itemGroup")),[ee(t.$slots,"optiongroup",{option:k.optionGroup,index:o.getOptionIndex(A,v)},function(){return[ht(_(o.getOptionGroupLabel(k.optionGroup)),1)]})],16,aW)):ft((g(),T("li",O({key:1,id:r.id+"_"+o.getOptionIndex(A,v),style:{height:b?b+"px":void 0},class:t.cx("item",{option:k,index:A,getItemOptions:v}),role:"option","aria-label":o.getOptionLabel(k),"aria-selected":o.isSelected(k),"aria-disabled":o.isOptionDisabled(k),"aria-setsize":o.ariaSetSize,"aria-posinset":o.getAriaPosInset(o.getOptionIndex(A,v)),onClick:function(y){return o.onOptionSelect(y,k,o.getOptionIndex(A,v),!0)},onMousemove:function(y){return o.onOptionMouseMove(y,o.getOptionIndex(A,v))}},o.getCheckboxPTOptions(k,v,A,"item"),{"data-p-highlight":o.isSelected(k),"data-p-focused":r.focusedOptionIndex===o.getOptionIndex(A,v),"data-p-disabled":o.isOptionDisabled(k)}),[I(l,{modelValue:o.isSelected(k),binary:!0,tabindex:-1,variant:t.variant,unstyled:t.unstyled,pt:o.getCheckboxPTOptions(k,v,A,"itemCheckbox")},{icon:z(function(w){return[t.$slots.itemcheckboxicon?(g(),L(yt(t.$slots.itemcheckboxicon),{key:0,checked:w.checked,class:pe(w.class)},null,8,["checked","class"])):w.checked?(g(),L(yt(t.checkboxIcon?"span":"CheckIcon"),O({key:1,class:[w.class,Gg({},t.checkboxIcon,w.checked)]},o.getCheckboxPTOptions(k,v,A,"itemCheckbox.icon")),null,16,["class"])):N("",!0)]}),_:2},1032,["modelValue","variant","unstyled","pt"]),ee(t.$slots,"option",{option:k,index:o.getOptionIndex(A,v)},function(){return[E("span",it(Ot(t.ptm("option"))),_(o.getOptionLabel(k)),17)]})],16,lW)),[[d]])],64)}),128)),r.filterValue&&(!m||m&&m.length===0)?(g(),T("li",O({key:0,class:t.cx("emptyMessage"),role:"option"},t.ptm("emptyMessage")),[ee(t.$slots,"emptyfilter",{},function(){return[ht(_(o.emptyFilterMessageText),1)]})],16)):!t.options||t.options&&t.options.length===0?(g(),T("li",O({key:1,class:t.cx("emptyMessage"),role:"option"},t.ptm("emptyMessage")),[ee(t.$slots,"empty",{},function(){return[ht(_(o.emptyMessageText),1)]})],16)):N("",!0)],16,sW)]}),_:2},[t.$slots.loader?{name:"loader",fn:z(function(f){var p=f.options;return[ee(t.$slots,"loader",{options:p})]}),key:"0"}:void 0]),1040,["items","style","disabled","pt"])],16),ee(t.$slots,"footer",{value:t.modelValue,options:o.visibleOptions}),!t.options||t.options&&t.options.length===0?(g(),T("span",O({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),_(o.emptyMessageText),17)):N("",!0),E("span",O({role:"status","aria-live":"polite",class:"p-hidden-accessible"},t.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),_(o.selectedMessageText),17),E("span",O({ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:e[10]||(e[10]=function(){return o.onLastHiddenFocus&&o.onLastHiddenFocus.apply(o,arguments)})},t.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16)],16)):N("",!0)]}),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo"])],16)}eC.render=uW;const cW=ce("MultiSelect",ye({__name:"MultiSelect",props:{modelValue:{},initialValue:{},label:{},options:{},optionLabel:{},optionValue:{},useValidator:{type:Boolean},mandatory:{type:Boolean},showOptionalText:{type:Boolean,default:void 0},validatorMessage:{},fieldName:{},placeholder:{},loading:{type:Boolean},fieldInfo:{},controls:{type:Boolean},disabled:{type:Boolean},filter:{type:Boolean,default:!0},filterPlaceholder:{},display:{default:"chip"},selectedItemsLabel:{},maxSelectedLabels:{}},emits:["update:modelValue","show","hide"],setup(t,{expose:e,emit:n}){const i=t,r=n;bt(()=>{p(),Ye.on("multi-select:hide-overlay",m)}),Jo(()=>{Ye.off("multi-select:hide-overlay")});const{locale:o}=_t("MultiSelect"),s=dt("preset",{}).multiselect,a=oe(!1),l=re(),u=sn({value:i.initialValue?i.initialValue:i.modelValue}),c=W(()=>x0(i.options)),d=W(()=>{var S;return o.emptySelectionErrorMessage.replace("{label}",i.label).replace("{formattedLabel}",(S=Qf(i.label))==null?void 0:S.toLowerCase())}),f=W(()=>{var S;return i.loading?o.loadingPlaceholder:i.placeholder??((S=o.inputPlaceholder)==null?void 0:S.replace("{label}",i.label??"").replace("{lowercaseLabel}",(i.label??"").toLowerCase()))}),p=()=>{var S;i.useValidator&&(Object.assign(u,Ln(i.fieldName??"multiSelect",b=>!(Array.isArray(b)&&b.length)&&i.mandatory?typeof i.validatorMessage=="object"&&"empty"in i.validatorMessage?i.validatorMessage.empty:i.validatorMessage??d.value:!0)),(S=i.initialValue)!=null&&S.length&&(u.value=i.initialValue))},h=()=>{l.value&&l.value.show()},m=()=>{l.value&&l.value.hide()},v=S=>{const b=S!=null&&S.length?S:void 0;r("update:modelValue",b)};return Re(()=>u.value,()=>{v(u.value)}),Re(()=>i.modelValue,S=>{u.value=S}),Re(()=>i.initialValue,S=>{u.value=S},{once:!0}),e({isShowOverlay:a,showOverlay:h,hideOverlay:m}),(S,b)=>(g(),L(Yn,{info:S.fieldInfo,label:i.label,mandatory:i.mandatory,"show-optional-text":S.showOptionalText},{default:z(()=>[I(br,{class:pe({"rounded-none !ring-0 !w-max":S.controls}),disabled:i.disabled,invalid:!!u.errorMessage},{default:z(()=>{var k;return[I(x(eC),O(i,{ref_key:"multiselect",ref:l,modelValue:u.value,"onUpdate:modelValue":b[0]||(b[0]=A=>u.value=A),"aria-describedby":i.label+"error",class:[{"invisible !w-0":S.controls}],display:i.display,"filter-placeholder":i.filterPlaceholder||x(o).filterPlaceholder,"max-selected-labels":i.maxSelectedLabels,options:c.value,placeholder:f.value,"selected-items-label":i.selectedItemsLabel,"show-toggle-all":i.filter,"virtual-scroller-options":(((k=S.options)==null?void 0:k.length)??0)>10?{itemSize:32}:void 0,onHide:b[1]||(b[1]=A=>(a.value=!1,S.$emit("hide"))),onShow:b[2]||(b[2]=A=>(S.$emit("show"),a.value=!0))}),Dn({dropdownicon:z(()=>[I(Me,it(Ot(x(s).dropdownicon({state:{isShowOverlay:a.value}}))),null,16)]),headercheckboxicon:z(()=>[I(Me,{icon:"check"})]),itemcheckboxicon:z(()=>[I(Me,{icon:"check"})]),filtericon:z(()=>[I(Me,it(Ot(x(s).filtericon)),null,16)]),removetokenicon:z(({removeCallback:A,item:w})=>[I(We,O({onClick:xt(y=>A(y,w),["stop"])},x(s).removeTokenIcon,{icon:"close",rounded:"",severity:"dark",text:""}),null,16,["onClick"])]),loadingicon:z(()=>[I(Me,it(Ot(x(s).loadingicon)),null,16)]),_:2},[S.loading?{name:"value",fn:z(({placeholder:A})=>[E("span",it(Ot(x(s).loadingplaceholder)),_(A),17)]),key:"0"}:void 0]),1040,["modelValue","aria-describedby","class","display","filter-placeholder","max-selected-labels","options","placeholder","selected-items-label","show-toggle-all","virtual-scroller-options"]),ee(S.$slots,"trigger",{disabled:i.disabled},()=>[S.controls?(g(),L(We,{key:0,disabled:i.disabled,onClick:h,class:"!rounded !ring-0",icon:"add"},null,8,["disabled"])):N("",!0)])]}),_:3},8,["class","disabled","invalid"]),I(Rn,{id:i.label+"error",message:u.errorMessage},null,8,["id","message"])]),_:3},8,["info","label","mandatory","show-optional-text"]))}})),Bie=ce("Paginator",ye({__name:"Paginator",props:Cn({totalRecords:{},rows:{},first:{},pageLinkSize:{},rowsPerPageOptions:{},template:{},currentPageReportTemplate:{},alwaysShow:{type:Boolean},pt:{},ptOptions:{}},{rows:{},rowsModifiers:{}}),emits:Cn(["page","update:rows"],["update:rows"]),setup(t){const e=si(t,"rows"),n=dt("preset",{}).datatable;return(i,r)=>(g(),L(x(Eh),O({rows:e.value,"onUpdate:rows":r[0]||(r[0]=o=>e.value=o)},x(n).paginator({context:{totalRecords:i.totalRecords}}),{template:i.template,"total-records":i.totalRecords,onPage:r[1]||(r[1]=o=>i.$emit("page",o))}),{firstpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-double-arrow-left"})]),lastpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-double-arrow-right"})]),prevpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-arrow-left"})]),nextpagelinkicon:z(()=>[I(Me,{icon:"round-keyboard-arrow-right"})]),_:1},16,["rows","template","total-records"]))}})),Zg=ce("TabMenu",ye({__name:"TabMenu",props:{menu:{},type:{default:"tab"},activeIndex:{default:0},useTrailingLine:{type:Boolean,default:!0},model:{},pt:{}},emits:["tabChange","update:activeIndex"],setup(t){return(e,n)=>(g(),L(x(yT),{"active-index":e.activeIndex,model:e.model||e.menu,type:e.type,"use-trailing-line":e.useTrailingLine,onTabChange:n[0]||(n[0]=i=>e.$emit("tabChange",i)),"onUpdate:activeIndex":n[1]||(n[1]=i=>e.$emit("update:activeIndex",i)),onVnodeBeforeMount:n[2]||(n[2]=i=>x(Rb)("WANGS-TAB-MENU",e.$preset.tabmenu))},null,8,["active-index","model","type","use-trailing-line"]))}})),dW={class:"text-[10px] leading-3 tracking-[0.03em] flex gap-1","data-wv-name":"tagtype"},fW=["data-wv-section"],nC=ce("TagType",ye({__name:"TagType",props:{type:{},useNfc:{type:Boolean,default:void 0}},setup(t){const e=t,{defaultProps:n}=_t("TagType"),i=W(()=>Hi(e,n)),r=W(()=>[{tag:"rfid",active:i.value.type.includes("RFID")},{tag:"nfc",active:i.value.type.includes("NFC"),visible:i.value.useNfc},{tag:"qr",active:i.value.type.includes("QR")}].filter(o=>o.visible!==!1));return(o,s)=>(g(),T("span",dW,[(g(!0),T(le,null,_e(r.value,a=>(g(),T("span",{key:a.tag,class:pe(["inline-flex items-center gap-[1px]",{"text-primary-700":a.active,"text-general-200":!a.active}]),"data-wv-section":a.tag},[I(Me,{class:pe({"!w-[14px]":a.tag==="rfid"}),icon:a.tag},null,8,["class","icon"]),ht(" "+_(a.tag.toUpperCase()),1)],10,fW))),128))]))}}));var pW={root:function(e){var n=e.instance,i=e.props;return["p-inputtextarea p-inputtext p-component",{"p-filled":n.filled,"p-inputtextarea-resizable ":i.autoResize,"p-invalid":i.invalid,"p-variant-filled":i.variant?i.variant==="filled":n.$primevue.config.inputStyle==="filled"}]}},hW=Xt.extend({name:"textarea",classes:pW}),mW={name:"BaseTextarea",extends:It,props:{modelValue:null,autoResize:Boolean,invalid:{type:Boolean,default:!1},variant:{type:String,default:null}},style:hW,provide:function(){return{$parentInstance:this}}},iC={name:"Textarea",extends:mW,inheritAttrs:!1,emits:["update:modelValue"],mounted:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},updated:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},methods:{resize:function(){this.$el.style.height="auto",this.$el.style.height=this.$el.scrollHeight+"px",parseFloat(this.$el.style.height)>=parseFloat(this.$el.style.maxHeight)?(this.$el.style.overflowY="scroll",this.$el.style.height=this.$el.style.maxHeight):this.$el.style.overflow="hidden"},onInput:function(e){this.autoResize&&this.resize(),this.$emit("update:modelValue",e.target.value)}},computed:{filled:function(){return this.modelValue!=null&&this.modelValue.toString().length>0},ptmParams:function(){return{context:{disabled:this.$attrs.disabled||this.$attrs.disabled===""}}}}},gW=["value","aria-invalid"];function vW(t,e,n,i,r,o){return g(),T("textarea",O({class:t.cx("root"),value:t.modelValue,"aria-invalid":t.invalid||void 0,onInput:e[0]||(e[0]=function(){return o.onInput&&o.onInput.apply(o,arguments)})},t.ptmi("root",o.ptmParams)),null,16,gW)}iC.render=vW;const ff=ce("Textarea",ye({__name:"Textarea",props:{modelValue:{},value:{},invalid:{type:Boolean},disabled:{type:Boolean},autoResize:{type:Boolean,default:!0},variant:{},useValidator:{type:Boolean},validatorMessage:{},fieldName:{default:"textareaInput"},fieldInfo:{},mandatory:{type:Boolean},maxInput:{default:void 0},maxlength:{},preventInputOnMaxLength:{type:Boolean,default:!0},inputClass:{},rows:{default:5},placeholder:{},label:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e;bt(()=>{u()});const{locale:r}=_t("TextArea"),o=dt("preset",{}).textarea,s=sn({value:void 0}),a=W(()=>n.invalid||!!s.errorMessage),l=W(()=>{var f,p;return n.placeholder??((p=r.defaultPlaceholder)==null?void 0:p.replace("{label}",((f=n.label)==null?void 0:f.toLowerCase())??""))}),u=()=>{var f,p;n.useValidator&&Object.assign(s,Ln(n.fieldName,h=>Pt(()=>c(h)))),(n.value??n.modelValue)&&(s.value=((f=n.value)==null?void 0:f.trim())??((p=n.modelValue)==null?void 0:p.trim())),n.invalid&&n.useValidator&&s.validate()},c=f=>{if(typeof n.validatorMessage=="string"&&n.invalid)return n.validatorMessage;if(typeof n.validatorMessage!="string"){const{empty:p,exceed:h}=n.validatorMessage??{};if(!f&&n.mandatory)return p??r.emptyInvalidText.replace("{label}",n.label);if(n.maxInput&&((f==null?void 0:f.length)??0)>n.maxInput||n.maxlength&&((f==null?void 0:f.length)??0)>n.maxlength)return h??r.exceedMaxLengthInvalidText.replace("{maxLength}",(n.maxInput??n.maxlength).toString())}return!0},d=()=>{var f;s.value=(f=s.value)==null?void 0:f.trim(),i("update:modelValue",s.value)};return Re(()=>n.value,f=>{s.value=f==null?void 0:f.trim()},{once:!0}),Re(()=>n.modelValue,f=>{s.value=f}),(f,p)=>(g(),L(Yn,{info:f.fieldInfo,label:n.label,mandatory:n.mandatory},{default:z(()=>[I(x(iC),O({modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=h=>s.value=h)},x(o).root({props:n,context:{disabled:f.disabled,invalidInput:a.value}}),{"auto-resize":f.autoResize,disabled:f.disabled,maxlength:f.preventInputOnMaxLength?f.maxlength:void 0,placeholder:l.value,rows:f.rows,onBlur:d,"onUpdate:modelValue":p[1]||(p[1]=h=>i("update:modelValue",h))}),null,16,["modelValue","auto-resize","disabled","maxlength","placeholder","rows"]),I(Rn,{message:s.errorMessage},null,8,["message"])]),_:1},8,["info","label","mandatory"]))}}));var yW={root:function(e){var n=e.props;return["p-timeline p-component","p-timeline-"+n.align,"p-timeline-"+n.layout]},event:"p-timeline-event",opposite:"p-timeline-event-opposite",separator:"p-timeline-event-separator",marker:"p-timeline-event-marker",connector:"p-timeline-event-connector",content:"p-timeline-event-content"},bW=Xt.extend({name:"timeline",classes:yW}),AW={name:"BaseTimeline",extends:It,props:{value:null,align:{mode:String,default:"left"},layout:{mode:String,default:"vertical"},dataKey:null},style:bW,provide:function(){return{$parentInstance:this}}},rC={name:"Timeline",extends:AW,inheritAttrs:!1,methods:{getKey:function(e,n){return this.dataKey?Ce.resolveFieldData(e,this.dataKey):n},getPTOptions:function(e,n){return this.ptm(e,{context:{index:n,count:this.value.length}})}}};function wW(t,e,n,i,r,o){return g(),T("div",O({class:t.cx("root")},t.ptmi("root")),[(g(!0),T(le,null,_e(t.value,function(s,a){return g(),T("div",O({key:o.getKey(s,a),class:t.cx("event")},o.getPTOptions("event",a)),[E("div",O({class:t.cx("opposite",{index:a})},o.getPTOptions("opposite",a)),[ee(t.$slots,"opposite",{item:s,index:a})],16),E("div",O({class:t.cx("separator")},o.getPTOptions("separator",a)),[ee(t.$slots,"marker",{item:s,index:a},function(){return[E("div",O({class:t.cx("marker")},o.getPTOptions("marker",a)),null,16)]}),a!==t.value.length-1?ee(t.$slots,"connector",{key:0,item:s,index:a},function(){return[E("div",O({class:t.cx("connector")},o.getPTOptions("connector",a)),null,16)]}):N("",!0)],16),E("div",O({class:t.cx("content")},o.getPTOptions("content",a)),[ee(t.$slots,"content",{item:s,index:a})],16)],16)}),128))],16)}rC.render=wW;const SW="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%2353C26F'/%3e%3cpath%20d='M8.38742%2017.7024C8.01617%2017.7024%207.69563%2017.6216%207.42578%2017.46C7.15766%2017.2985%206.95055%2017.0725%206.80445%2016.782C6.66008%2016.4915%206.58789%2016.1538%206.58789%2015.7688C6.58789%2015.3838%206.66008%2015.0461%206.80445%2014.7556C6.95055%2014.4651%207.15766%2014.2391%207.42578%2014.0775C7.69563%2013.916%208.01617%2013.8352%208.38742%2013.8352C8.81367%2013.8352%209.17117%2013.9409%209.45992%2014.1523C9.75039%2014.3637%209.95492%2014.6499%2010.0735%2015.0108L9.36711%2015.2068C9.29836%2014.9816%209.18234%2014.8072%209.01906%2014.6834C8.85578%2014.5579%208.64523%2014.4952%208.38742%2014.4952C8.15195%2014.4952%207.95516%2014.5476%207.79703%2014.6525C7.64062%2014.7573%207.52289%2014.9051%207.44383%2015.0959C7.36477%2015.2867%207.32523%2015.511%207.32523%2015.7688C7.32523%2016.0266%207.36477%2016.2509%207.44383%2016.4417C7.52289%2016.6325%207.64062%2016.7803%207.79703%2016.8851C7.95516%2016.99%208.15195%2017.0424%208.38742%2017.0424C8.64523%2017.0424%208.85578%2016.9797%209.01906%2016.8542C9.18234%2016.7287%209.29836%2016.5543%209.36711%2016.3308L10.0735%2016.5268C9.95492%2016.8877%209.75039%2017.1739%209.45992%2017.3853C9.17117%2017.5967%208.81367%2017.7024%208.38742%2017.7024Z'%20fill='white'/%3e%3cpath%20d='M12.3545%2017.7024C12.0795%2017.7024%2011.8311%2017.6543%2011.6094%2017.558C11.3894%2017.46%2011.2081%2017.3208%2011.0654%2017.1404C10.9245%2016.9582%2010.8351%2016.7416%2010.7973%2016.4907L11.5295%2016.3824C11.581%2016.5955%2011.6876%2016.7597%2011.8492%2016.8748C12.0107%2016.99%2012.1946%2017.0475%2012.4009%2017.0475C12.516%2017.0475%2012.6278%2017.0295%2012.736%2016.9934C12.8443%2016.9573%2012.9328%2016.904%2013.0016%2016.8336C13.072%2016.7631%2013.1073%2016.6763%2013.1073%2016.5732C13.1073%2016.5354%2013.1013%2016.4993%2013.0892%2016.4649C13.0789%2016.4288%2013.0609%2016.3953%2013.0351%2016.3643C13.0093%2016.3334%2012.9724%2016.3042%2012.9242%2016.2767C12.8778%2016.2492%2012.8185%2016.2243%2012.7463%2016.2019L11.7821%2015.9183C11.7099%2015.8977%2011.6257%2015.8685%2011.5295%2015.8307C11.4349%2015.7929%2011.343%2015.7387%2011.2536%2015.6683C11.1642%2015.5978%2011.0895%2015.505%2011.0293%2015.3898C10.9709%2015.2729%2010.9417%2015.126%2010.9417%2014.949C10.9417%2014.6997%2011.0044%2014.4926%2011.1299%2014.3276C11.2553%2014.1626%2011.4229%2014.0397%2011.6326%2013.959C11.8423%2013.8782%2012.0743%2013.8386%2012.3287%2013.8404C12.5848%2013.8438%2012.8134%2013.8876%2013.0145%2013.9718C13.2156%2014.0561%2013.384%2014.179%2013.5198%2014.3405C13.6556%2014.5004%2013.7535%2014.6963%2013.8137%2014.9283L13.0557%2015.0572C13.0282%2014.9369%2012.9775%2014.8355%2012.9036%2014.753C12.8297%2014.6705%2012.7412%2014.6078%2012.6381%2014.5648C12.5367%2014.5218%2012.4301%2014.4986%2012.3184%2014.4952C12.2084%2014.4918%2012.1044%2014.5072%2012.0064%2014.5416C11.9102%2014.5743%2011.8311%2014.6224%2011.7692%2014.686C11.7091%2014.7496%2011.679%2014.8252%2011.679%2014.9129C11.679%2014.9936%2011.7039%2015.0598%2011.7538%2015.1114C11.8036%2015.1612%2011.8663%2015.2016%2011.942%2015.2325C12.0176%2015.2635%2012.0949%2015.2893%2012.174%2015.3099L12.8185%2015.4852C12.9148%2015.511%2013.0213%2015.5454%2013.1382%2015.5883C13.2551%2015.6296%2013.3668%2015.688%2013.4734%2015.7636C13.5817%2015.8375%2013.6702%2015.9355%2013.7389%2016.0575C13.8094%2016.1796%2013.8446%2016.3343%2013.8446%2016.5216C13.8446%2016.721%2013.8025%2016.8954%2013.7183%2017.045C13.6358%2017.1928%2013.5241%2017.3157%2013.3831%2017.4136C13.2422%2017.5099%2013.0824%2017.5821%2012.9036%2017.6302C12.7266%2017.6783%2012.5435%2017.7024%2012.3545%2017.7024Z'%20fill='white'/%3e%3cpath%20d='M15.2645%2017.625L14.1301%2013.9125H14.852L15.7801%2016.965L16.7237%2013.9125H17.4456L16.3112%2017.625H15.2645Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",CW="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%234E4B66'/%3e%3cpath%20d='M5.43604%2017.6251V13.9126H6.63744C6.66666%2013.9126%206.72682%2013.9135%206.81791%2013.9152C6.909%2013.9169%206.99666%2013.9229%207.08088%2013.9332C7.37994%2013.9693%207.63346%2014.0733%207.84143%2014.2452C8.04939%2014.4171%208.20752%2014.6353%208.3158%2014.9C8.42408%2015.1647%208.47822%2015.4543%208.47822%2015.7688C8.47822%2016.0834%208.42408%2016.373%208.3158%2016.6377C8.20752%2016.9024%208.04939%2017.1206%207.84143%2017.2925C7.63346%2017.4644%207.37994%2017.5684%207.08088%2017.6045C6.99666%2017.6148%206.909%2017.6208%206.81791%2017.6225C6.72682%2017.6242%206.66666%2017.6251%206.63744%2017.6251H5.43604ZM6.1476%2016.9651H6.63744C6.68385%2016.9651%206.74658%2016.9642%206.82564%2016.9625C6.90471%2016.9591%206.97604%2016.9513%207.03963%2016.9393C7.20119%2016.9067%207.33268%2016.831%207.43408%2016.7124C7.53721%2016.5938%207.61283%2016.4512%207.66096%2016.2845C7.7108%2016.1178%207.73572%2015.9459%207.73572%2015.7688C7.73572%2015.5832%207.70994%2015.4071%207.65838%2015.2403C7.60854%2015.0736%207.53205%2014.9327%207.42893%2014.8175C7.3258%2014.7024%207.19604%2014.6293%207.03963%2014.5984C6.97604%2014.5846%206.90471%2014.5769%206.82564%2014.5752C6.74658%2014.5735%206.68385%2014.5726%206.63744%2014.5726H6.1476V16.9651Z'%20fill='white'/%3e%3cpath%20d='M8.89294%2017.6251L10.0273%2013.9126H11.074L12.2084%2017.6251H11.4865L10.4759%2014.3509H10.61L9.61481%2017.6251H8.89294ZM9.57356%2016.8517V16.1968H11.5329V16.8517H9.57356Z'%20fill='white'/%3e%3cpath%20d='M13.3791%2017.6251V14.5674H12.2086V13.9126H15.2508V14.5674H14.0804V17.6251H13.3791Z'%20fill='white'/%3e%3cpath%20d='M15.4613%2017.6251L16.5957%2013.9126H17.6424L18.7768%2017.6251H18.0549L17.0443%2014.3509H17.1783L16.1832%2017.6251H15.4613ZM16.1419%2016.8517V16.1968H18.1013V16.8517H16.1419Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",kW="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%232A61CA'/%3e%3cpath%20d='M6.47522%2017.625V13.9125H7.67663C7.70584%2013.9125%207.766%2013.9134%207.85709%2013.9151C7.94819%2013.9168%208.03584%2013.9229%208.12006%2013.9332C8.41913%2013.9693%208.67264%2014.0733%208.88061%2014.2451C9.08858%2014.417%209.2467%2014.6353%209.35499%2014.9C9.46327%2015.1647%209.51741%2015.4543%209.51741%2015.7688C9.51741%2016.0833%209.46327%2016.3729%209.35499%2016.6376C9.2467%2016.9023%209.08858%2017.1206%208.88061%2017.2925C8.67264%2017.4643%208.41913%2017.5683%208.12006%2017.6044C8.03584%2017.6147%207.94819%2017.6208%207.85709%2017.6225C7.766%2017.6242%207.70584%2017.625%207.67663%2017.625H6.47522ZM7.18678%2016.965H7.67663C7.72303%2016.965%207.78577%2016.9642%207.86483%2016.9625C7.94389%2016.959%208.01522%2016.9513%208.07881%2016.9393C8.24038%2016.9066%208.37186%2016.831%208.47327%2016.7124C8.57639%2016.5938%208.65202%2016.4511%208.70014%2016.2844C8.74999%2016.1177%208.77491%2015.9458%208.77491%2015.7688C8.77491%2015.5832%208.74913%2015.407%208.69756%2015.2403C8.64772%2015.0736%208.57124%2014.9326%208.46811%2014.8175C8.36499%2014.7023%208.23522%2014.6293%208.07881%2014.5983C8.01522%2014.5846%207.94389%2014.5768%207.86483%2014.5751C7.78577%2014.5734%207.72303%2014.5725%207.67663%2014.5725H7.18678V16.965Z'%20fill='white'/%3e%3cpath%20d='M11.8839%2017.7024C11.5127%2017.7024%2011.1921%2017.6216%2010.9223%2017.46C10.6542%2017.2985%2010.447%2017.0725%2010.301%2016.782C10.1566%2016.4915%2010.0844%2016.1538%2010.0844%2015.7688C10.0844%2015.3838%2010.1566%2015.0461%2010.301%2014.7556C10.447%2014.4651%2010.6542%2014.2391%2010.9223%2014.0775C11.1921%2013.916%2011.5127%2013.8352%2011.8839%2013.8352C12.2552%2013.8352%2012.5749%2013.916%2012.843%2014.0775C13.1128%2014.2391%2013.3199%2014.4651%2013.4643%2014.7556C13.6104%2015.0461%2013.6835%2015.3838%2013.6835%2015.7688C13.6835%2016.1538%2013.6104%2016.4915%2013.4643%2016.782C13.3199%2017.0725%2013.1128%2017.2985%2012.843%2017.46C12.5749%2017.6216%2012.2552%2017.7024%2011.8839%2017.7024ZM11.8839%2017.0424C12.1194%2017.0458%2012.3153%2016.9951%2012.4717%2016.8903C12.6281%2016.7854%2012.745%2016.6368%2012.8224%2016.4443C12.9014%2016.2518%2012.941%2016.0266%2012.941%2015.7688C12.941%2015.511%2012.9014%2015.2875%2012.8224%2015.0985C12.745%2014.9094%2012.6281%2014.7625%2012.4717%2014.6576C12.3153%2014.5528%2012.1194%2014.4986%2011.8839%2014.4952C11.6485%2014.4918%2011.4525%2014.5425%2011.2961%2014.6473C11.1397%2014.7522%2011.022%2014.9008%2010.9429%2015.0933C10.8656%2015.2858%2010.8269%2015.511%2010.8269%2015.7688C10.8269%2016.0266%2010.8656%2016.25%2010.9429%2016.4391C11.022%2016.6282%2011.1397%2016.7751%2011.2961%2016.88C11.4525%2016.9848%2011.6485%2017.039%2011.8839%2017.0424Z'%20fill='white'/%3e%3cpath%20d='M15.9461%2017.7024C15.5748%2017.7024%2015.2543%2017.6216%2014.9844%2017.46C14.7163%2017.2985%2014.5092%2017.0725%2014.3631%2016.782C14.2187%2016.4915%2014.1466%2016.1538%2014.1466%2015.7688C14.1466%2015.3838%2014.2187%2015.0461%2014.3631%2014.7556C14.5092%2014.4651%2014.7163%2014.2391%2014.9844%2014.0775C15.2543%2013.916%2015.5748%2013.8352%2015.9461%2013.8352C16.3723%2013.8352%2016.7298%2013.9409%2017.0186%2014.1523C17.3091%2014.3637%2017.5136%2014.6499%2017.6322%2015.0108L16.9258%2015.2068C16.857%2014.9816%2016.741%2014.8072%2016.5777%2014.6834C16.4144%2014.5579%2016.2039%2014.4952%2015.9461%2014.4952C15.7106%2014.4952%2015.5138%2014.5476%2015.3557%2014.6525C15.1993%2014.7573%2015.0816%2014.9051%2015.0025%2015.0959C14.9234%2015.2867%2014.8839%2015.511%2014.8839%2015.7688C14.8839%2016.0266%2014.9234%2016.2509%2015.0025%2016.4417C15.0816%2016.6325%2015.1993%2016.7803%2015.3557%2016.8851C15.5138%2016.99%2015.7106%2017.0424%2015.9461%2017.0424C16.2039%2017.0424%2016.4144%2016.9797%2016.5777%2016.8542C16.741%2016.7287%2016.857%2016.5543%2016.9258%2016.3308L17.6322%2016.5268C17.5136%2016.8877%2017.3091%2017.1739%2017.0186%2017.3853C16.7298%2017.5967%2016.3723%2017.7024%2015.9461%2017.7024Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",OW="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%23E5252A'/%3e%3cpath%20d='M7.30859%2017.6251V13.9126H8.87609C8.91219%2013.9126%208.96031%2013.9143%209.02047%2013.9178C9.08234%2013.9195%209.13734%2013.9246%209.18547%2013.9332C9.40719%2013.9676%209.58852%2014.0406%209.72945%2014.1524C9.87211%2014.2641%209.97695%2014.405%2010.044%2014.5752C10.111%2014.7436%2010.1445%2014.9318%2010.1445%2015.1398C10.1445%2015.3478%2010.1102%2015.5368%2010.0414%2015.707C9.97438%2015.8754%209.86953%2016.0155%209.72688%2016.1272C9.58594%2016.2389%209.40547%2016.312%209.18547%2016.3463C9.13734%2016.3532%209.08234%2016.3584%209.02047%2016.3618C8.95859%2016.3653%208.91047%2016.367%208.87609%2016.367H8.00984V17.6251H7.30859ZM8.00984%2015.7121H8.84516C8.88125%2015.7121%208.92078%2015.7104%208.96375%2015.707C9.00672%2015.7035%209.04625%2015.6967%209.08234%2015.6863C9.17688%2015.6606%209.24992%2015.6176%209.30148%2015.5574C9.35305%2015.4956%209.38828%2015.4277%209.40719%2015.3538C9.42781%2015.2781%209.43813%2015.2068%209.43813%2015.1398C9.43813%2015.0728%209.42781%2015.0023%209.40719%2014.9284C9.38828%2014.8528%209.35305%2014.7849%209.30148%2014.7247C9.24992%2014.6628%209.17688%2014.619%209.08234%2014.5932C9.04625%2014.5829%209.00672%2014.576%208.96375%2014.5726C8.92078%2014.5692%208.88125%2014.5674%208.84516%2014.5674H8.00984V15.7121Z'%20fill='white'/%3e%3cpath%20d='M10.8169%2017.6251V13.9126H12.0183C12.0475%2013.9126%2012.1076%2013.9135%2012.1987%2013.9152C12.2898%2013.9169%2012.3775%2013.9229%2012.4617%2013.9332C12.7608%2013.9693%2013.0143%2014.0733%2013.2222%2014.2452C13.4302%2014.4171%2013.5883%2014.6353%2013.6966%2014.9C13.8049%2015.1647%2013.859%2015.4543%2013.859%2015.7688C13.859%2016.0834%2013.8049%2016.373%2013.6966%2016.6377C13.5883%2016.9024%2013.4302%2017.1206%2013.2222%2017.2925C13.0143%2017.4644%2012.7608%2017.5684%2012.4617%2017.6045C12.3775%2017.6148%2012.2898%2017.6208%2012.1987%2017.6225C12.1076%2017.6242%2012.0475%2017.6251%2012.0183%2017.6251H10.8169ZM11.5284%2016.9651H12.0183C12.0647%2016.9651%2012.1274%2016.9642%2012.2065%2016.9625C12.2855%2016.9591%2012.3569%2016.9513%2012.4205%2016.9393C12.582%2016.9067%2012.7135%2016.831%2012.8149%2016.7124C12.918%2016.5938%2012.9937%2016.4512%2013.0418%2016.2845C13.0916%2016.1178%2013.1165%2015.9459%2013.1165%2015.7688C13.1165%2015.5832%2013.0908%2015.4071%2013.0392%2015.2403C12.9894%2015.0736%2012.9129%2014.9327%2012.8097%2014.8175C12.7066%2014.7024%2012.5769%2014.6293%2012.4205%2014.5984C12.3569%2014.5846%2012.2855%2014.5769%2012.2065%2014.5752C12.1274%2014.5735%2012.0647%2014.5726%2012.0183%2014.5726H11.5284V16.9651Z'%20fill='white'/%3e%3cpath%20d='M14.6323%2017.6251V13.9126H16.901V14.6138H15.3335V15.4182H16.5917V16.1195H15.3335V17.6251H14.6323Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",TW="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.14994%200H14.1739L20.9745%207.08846V20.8756C20.9745%2022.6027%2019.5772%2024%2017.8561%2024H6.14994C4.42281%2024%203.02551%2022.6027%203.02551%2020.8756V3.12443C3.02548%201.3973%204.42278%200%206.14994%200Z'%20fill='%23317141'/%3e%3cpath%20d='M6.99329%2017.6251L8.2411%2015.7482L7.02938%2013.9126H7.89047L8.67938%2015.1501L9.45797%2013.9126H10.3242L9.1125%2015.7482L10.3552%2017.6251H9.49407L8.67938%2016.3463L7.85954%2017.6251H6.99329Z'%20fill='white'/%3e%3cpath%20d='M10.9733%2017.6251V13.9126H11.6745V16.9702H13.273V17.6251H10.9733Z'%20fill='white'/%3e%3cpath%20d='M15.2685%2017.7024C14.9935%2017.7024%2014.7451%2017.6543%2014.5234%2017.558C14.3034%2017.4601%2014.1221%2017.3209%2013.9794%2017.1404C13.8385%2016.9582%2013.7491%2016.7416%2013.7113%2016.4907L14.4435%2016.3824C14.4951%2016.5955%2014.6016%2016.7597%2014.7632%2016.8748C14.9248%2016.99%2015.1087%2017.0476%2015.3149%2017.0476C15.4301%2017.0476%2015.5418%2017.0295%2015.6501%2016.9934C15.7583%2016.9573%2015.8469%2016.9041%2015.9156%2016.8336C15.9861%2016.7631%2016.0213%2016.6763%2016.0213%2016.5732C16.0213%2016.5354%2016.0153%2016.4993%2016.0033%2016.4649C15.993%2016.4288%2015.9749%2016.3953%2015.9491%2016.3644C15.9233%2016.3334%2015.8864%2016.3042%2015.8383%2016.2767C15.7919%2016.2492%2015.7326%2016.2243%2015.6604%2016.2019L14.6962%2015.9184C14.624%2015.8977%2014.5398%2015.8685%2014.4435%2015.8307C14.349%2015.7929%2014.257%2015.7387%2014.1676%2015.6683C14.0783%2015.5978%2014.0035%2015.505%2013.9433%2015.3898C13.8849%2015.273%2013.8557%2015.126%2013.8557%2014.949C13.8557%2014.6998%2013.9184%2014.4927%2014.0439%2014.3277C14.1694%2014.1627%2014.3369%2014.0398%2014.5466%2013.959C14.7563%2013.8782%2014.9883%2013.8387%2015.2427%2013.8404C15.4988%2013.8438%2015.7274%2013.8877%2015.9285%2013.9719C16.1296%2014.0561%2016.298%2014.179%2016.4338%2014.3405C16.5696%2014.5004%2016.6676%2014.6963%2016.7277%2014.9284L15.9698%2015.0573C15.9423%2014.9369%2015.8916%2014.8355%2015.8176%2014.753C15.7437%2014.6705%2015.6552%2014.6078%2015.5521%2014.5648C15.4507%2014.5219%2015.3441%2014.4987%2015.2324%2014.4952C15.1224%2014.4918%2015.0184%2014.5073%2014.9205%2014.5416C14.8242%2014.5743%2014.7451%2014.6224%2014.6833%2014.686C14.6231%2014.7496%2014.593%2014.8252%2014.593%2014.9129C14.593%2014.9937%2014.618%2015.0598%2014.6678%2015.1114C14.7176%2015.1612%2014.7804%2015.2016%2014.856%2015.2326C14.9316%2015.2635%2015.009%2015.2893%2015.088%2015.3099L15.7326%2015.4852C15.8288%2015.511%2015.9354%2015.5454%2016.0523%2015.5884C16.1691%2015.6296%2016.2808%2015.688%2016.3874%2015.7637C16.4957%2015.8376%2016.5842%2015.9355%2016.653%2016.0576C16.7234%2016.1796%2016.7587%2016.3343%2016.7587%2016.5216C16.7587%2016.721%2016.7165%2016.8955%2016.6323%2017.045C16.5498%2017.1928%2016.4381%2017.3157%2016.2972%2017.4137C16.1562%2017.5099%2015.9964%2017.5821%2015.8176%2017.6302C15.6406%2017.6784%2015.4576%2017.7024%2015.2685%2017.7024Z'%20fill='white'/%3e%3cpath%20opacity='0.302'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.168%200V7.03449H20.9746L14.168%200Z'%20fill='white'/%3e%3c/svg%3e",xW={key:0},MW={key:2},EW={class:"flex items-center gap-1"},PW={key:3,class:"list-none"},IW={key:5,class:"grid"},LW=["href"],DW={key:6,class:"w-[520px] overflow-auto",style:{"scrollbar-width":"none"}},RW={key:7,class:"grid grid-cols-[max-content,1fr] gap-2 items-center"},NW=["alt","src"],BW=["href"],pf=ye({__name:"TimelineContentByType",props:{detail:{}},setup(t){const e=i=>({pdf:OW,csv:SW,doc:kW,xls:TW,data:CW})[i],n=i=>{var r,o;return(o=i.filePath)==null?void 0:o.slice((((r=i.filePath)==null?void 0:r.lastIndexOf("/"))??0)+1)};return(i,r)=>i.detail.type==="text"?(g(),T("p",xW,_(i.detail.value),1)):i.detail.type==="badge"?(g(),L(Lt,{key:1,format:i.detail.format,label:i.detail.label,tooltip:i.detail.tooltip},null,8,["format","label","tooltip"])):i.detail.type==="userText"?(g(),T("span",MW,[E("span",EW,[ht(_(i.detail.text)+" ",1),I(Eu,{user:i.detail.user,type:"icon","user-name-field":"nickName"},null,8,["user"])])])):i.detail.type==="bullet"?(g(),T("ul",PW,[(g(!0),T(le,null,_e(i.detail.value,(o,s)=>(g(),T("li",{key:s,class:"flex items-center gap-1 before:content-['•'] before:mr-1 before:ml-1"},[ht(_(typeof o=="object"?o.text:o)+" ",1),typeof o=="object"?(g(),L(Eu,{key:0,user:o.user,type:"icon","user-name-field":"nickName"},null,8,["user"])):N("",!0)]))),128))])):i.detail.type==="json"?(g(),L(NH,{key:4,"model-value":i.detail.value,"editor-state":"readonly"},null,8,["model-value"])):i.detail.type==="taskUrl"?(g(),T("span",IW,[E("a",{class:pe(["w-full truncate hover:underline text-[#0000EE]"]),href:i.detail.url,style:{"scrollbar-width":"none"},target:"_blank",title:"Buka Link di Tab Baru"},_(i.detail.url),9,LW)])):i.detail.type=="embed"?(g(),T("div",DW,[I(i3,{code:i.detail.code,readonly:""},null,8,["code"])])):(g(),T("div",RW,[i.detail.type==="image"?(g(),L(Ar,{key:0,src:i.detail.filePath,class:"!w-6 !h-6 shrink-0"},null,8,["src"])):i.detail.type==="link"?(g(),L(Me,{key:1,class:"shrink-0 w-6 h-6",icon:"link"})):["pdf","csv","doc","xls","data"].includes(i.detail.type)?(g(),T("img",{key:2,alt:i.detail.type,src:e(i.detail.type),class:"shrink-0 w-6 h-6"},null,8,NW)):N("",!0),i.detail.type==="link"?(g(),T("a",{key:3,class:pe(["w-full truncate hover:underline"]),href:i.detail.url,style:{"scrollbar-width":"none"},target:"_blank",title:"Buka Link di Tab Baru"},_(i.detail.url),9,BW)):i.detail.type!=="video"?(g(),T(le,{key:4},[ht(_(n(i.detail)),1)],64)):N("",!0)]))}}),$W=["onClick"],VW={class:"flex justify-between items-center"},zW={class:"flex gap-1 py-0.5","data-wv-section":"itemheader"},FW=["innerHTML","onClick"],jW={key:1,class:"flex flex-col gap-1","data-wv-section":"itemdetail"},HW={key:0,class:"grid grid-cols-[max-content,max-content,auto] gap-2 py-1.5 items-start"},UW={class:"font-semibold whitespace-nowrap"},KW={key:0,class:"text-xs"},WW={key:0,class:"grid grid-cols-[max-content,max-content,auto] gap-1 items-start"},qW={key:1,class:"grid grid-rows-[max-content,auto] gap-1"},XW={class:"font-semibold whitespace-nowrap"},_g=ce("Timeline",ye({__name:"Timeline",props:{value:{},alignDetail:{type:Boolean},noScroll:{type:Boolean},noFormatDate:{type:Boolean}},setup(t){const e=dt("preset",{}).timeline,n=r=>{const o=r.user??r.username;return typeof o!="string"?o:{nickName:o}},i=r=>r.replace(/`([^`]*)`/g,"<b>$1</b>");return(r,o)=>(g(),L(x(rC),{class:pe([{"overflow-auto":!r.noScroll}]),value:re(r.value).value,style:{"scrollbar-width":"none"}},{marker:z(({item:s})=>{var a,l,u;return[E("div",O({onClick:c=>s.showDetail=!s.showDetail},(a=x(e))==null?void 0:a.marker,{"data-wv-section":"timelinemarker"}),[I(Me,O((l=x(e))==null?void 0:l.markerArrow(s),{icon:"arrow-down"}),null,16),E("div",it(Ot((u=x(e))==null?void 0:u.markerDot(s))),null,16)],16,$W)]}),content:z(({item:s})=>{var a,l,u;return[E("div",VW,[E("div",zW,[E("h3",O({innerHTML:i(s.action)},(a=x(e))==null?void 0:a.contentHeader,{onClick:c=>s.showDetail=!s.showDetail}),null,16,FW),s.user||s.username?(g(),L(Eu,{key:0,user:n(s),type:"icon","user-name-field":"nickName"},null,8,["user"])):N("",!0)]),E("span",it(Ot((l=x(e))==null?void 0:l.contentDate)),_(r.noFormatDate?s.createdAt:x(L4)(s.createdAt)),17)]),s.showDetail&&s.detail?(g(),T(le,{key:0},["type"in s.detail?(g(),L(pf,{key:0,detail:s.detail},null,8,["detail"])):(u=Object.keys(s.detail??{}))!=null&&u.length?(g(),T("div",jW,[r.$props.alignDetail?(g(),T("div",HW,[(g(!0),T(le,null,_e(Object.entries(s.detail),([c,d])=>(g(),T(le,{key:c},[E("span",UW,_(c),1),o[0]||(o[0]=E("span",{class:"font-semibold whitespace-nowrap"}," : ",-1)),typeof d=="string"?(g(),T("span",KW,_(d),1)):"type"in d?(g(),L(pf,{key:1,detail:d},null,8,["detail"])):N("",!0)],64))),128))])):(g(!0),T(le,{key:1},_e(Object.entries(s.detail),([c,d])=>ee(r.$slots,"detail",O({key:c,ref_for:!0},{key:c,value:d}),()=>{var f,p;return[typeof d=="string"?(g(),T("div",WW,[E("span",O({ref_for:!0},(f=x(e))==null?void 0:f.contentDetailKey),_(c)+": ",17),E("span",O({ref_for:!0},(p=x(e))==null?void 0:p.contentDetailValue),_(d),17)])):"type"in d?(g(),T("div",qW,[E("span",{class:pe(["flex gap-1",{"flex-col":d.type==="embed"}])},[E("span",XW,_(c)+": ",1),d.type!=="json"?(g(),L(pf,{key:0,detail:d},null,8,["detail"])):N("",!0)],2),d.type==="json"?(g(),L(pf,{key:0,detail:d},null,8,["detail"])):N("",!0)])):N("",!0)]})),128))])):N("",!0)],64)):N("",!0)]}),_:3},8,["class","value"]))}})),GW={class:"flex justify-between gap-[18px] dark:text-general-100"},ZW={class:"w-full flex flex-col gap-[6px]"},_W={class:"flex justify-between"},JW={class:""},YW={class:"text-[16px] font-bold leading-[19.12px]"},QW={class:"flex items-center gap-[6px]"},eq={class:"text-general-400 leading-[16.39px]"},tq=["href"],nq={class:"flex flex-col gap-1"},iq={key:0,class:"flex gap-3"},rq={key:1,class:"flex gap-3"},oq={key:2,class:"flex gap-3"},sq={key:3,class:"flex gap-3"},$u=ce("AssetInfo",ye({__name:"AssetInfo",props:{id:{},fields:{},transactionDetail:{},useNfc:{type:Boolean,default:!0},useTagType:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=t;bt(async()=>{n.transactionDetail?s.value=n.transactionDetail:await p()});const i=sr(),{setLoading:r}=Fi(),o=JSON.parse(localStorage.getItem("user")??"{}"),s=oe(),a=W(()=>{var h;return(h=n.fields)==null?void 0:h.includes("status")}),l=W(()=>{const{setDefault:h,firstImageBig:m,secondImageBig:v,assetImageBig:S,assetImage:b,firstImage:k,secondImage:A}=s.value??{},w=h==="firstImage";return n.transactionDetail?b??S:w?k??m:A??v}),u=W(()=>{var h,m,v,S,b,k,A,w,y,C;return n.transactionDetail?(v=(m=(h=s.value)==null?void 0:h.assetName)==null?void 0:m.aliasCode)!=null&&v.length?`(${(b=(S=s.value)==null?void 0:S.assetName)==null?void 0:b.aliasCode})`:"":(w=(A=(k=s.value)==null?void 0:k.name)==null?void 0:A.aliasCode)!=null&&w.length?`(${(C=(y=s.value)==null?void 0:y.name)==null?void 0:C.aliasCode})`:""}),c=W(()=>{var h,m;return((h=s.value)==null?void 0:h.assetTagType)??((m=s.value)==null?void 0:m.tagType)}),d=W(()=>{var h,m;return((h=s.value)==null?void 0:h.assetName)??((m=s.value)==null?void 0:m.name)}),f=W(()=>[{"w-[69px]":!a.value,"w-[76px]":a.value}]),p=async()=>{try{r(!0);const{data:h}=await uo.getAssetDetail(n.id);h&&(s.value=h.data)}catch(h){i.add({error:h,message:"Error, failed to load asset details."})}finally{r(!1)}};return Re(()=>n.transactionDetail,h=>{s.value=h},{deep:!0}),e({asset:s}),(h,m)=>{var v,S,b,k,A,w,y,C,P,R,M,D,$,q,J,ve,ae,me,se,Ie,Be,xe;return g(),T("div",GW,[I(Ar,{src:l.value},null,8,["src"]),E("div",ZW,[E("div",_W,[E("div",JW,[E("div",YW,_(((v=d.value)==null?void 0:v.nameWithSequence)??"-"),1),E("div",QW,[E("span",eq,_(((S=s.value)==null?void 0:S.assetId)??"-")+" "+_(u.value),1),h.useTagType?(g(),T(le,{key:0},[m[0]||(m[0]=E("div",{class:"w-[6px] h-[6px] rounded-full bg-general-100"},null,-1)),I(nC,{type:c.value,"use-nfc":h.useNfc},null,8,["type","use-nfc"])],64)):N("",!0)])]),x(o).userType!=="Basic"?(g(),T("a",{key:0,href:`/assets/detail/${((b=s.value)==null?void 0:b.asset)??((k=s.value)==null?void 0:k._id)}`,class:"text-primary-500",target:"_blank"}," Asset Detail > ",8,tq)):N("",!0)]),E("div",nq,[!n.fields||(A=n.fields)!=null&&A.includes("brand")?(g(),T("div",iq,[E("span",{class:pe(f.value)}," Brand ",2),m[1]||(m[1]=E("span",null,":",-1)),I(Lt,{label:((y=(w=s.value)==null?void 0:w.assetBrand)==null?void 0:y.name)??((P=(C=s.value)==null?void 0:C.brand)==null?void 0:P.name)??"-",severity:"dark"},null,8,["label"])])):N("",!0),!n.fields||(R=n.fields)!=null&&R.includes("model")?(g(),T("div",rq,[E("span",{class:pe(f.value)}," Model/Type ",2),m[2]||(m[2]=E("span",null,":",-1)),I(Lt,{label:((D=(M=s.value)==null?void 0:M.assetModel)==null?void 0:D.name)??((q=($=s.value)==null?void 0:$.model)==null?void 0:q.name)??"-",severity:"dark"},null,8,["label"])])):N("",!0),!n.fields||(J=n.fields)!=null&&J.includes("group")?(g(),T("div",oq,[E("span",{class:pe(f.value)}," Group ",2),m[3]||(m[3]=E("span",null,":",-1)),I(Lt,{label:((ae=(ve=s.value)==null?void 0:ve.assetGroup)==null?void 0:ae.name)??((se=(me=s.value)==null?void 0:me.group)==null?void 0:se.name)??"-"},null,8,["label"])])):N("",!0),(Ie=n.fields)!=null&&Ie.includes("status")?(g(),T("div",sq,[E("span",{class:pe(f.value)}," Asset Status ",2),m[4]||(m[4]=E("span",null,":",-1)),I(Lt,{label:((Be=s.value)==null?void 0:Be.status)??"-",severity:x(Iy)((xe=s.value)==null?void 0:xe.status),format:"nowrap"},null,8,["label","severity"])])):N("",!0)])])])}}})),$ie=ce("ButtonAddByScan",ye({__name:"ButtonAddByScan",props:{modelValue:{},reportedDisposalAssets:{type:Boolean},noDisposalAssets:{type:Boolean},queryParams:{}},emits:["update:modelValue","scan"],setup(t,{emit:e}){const n=sr(),{setLoading:i}=Fi(),r=t,o=e,s=async c=>{var d,f,p,h;try{i(!0);const m={...r.queryParams,tag:c.code,page:1,limit:1},{data:v}=await uo.getAvailableAssets(m);if((f=(d=v==null?void 0:v.data)==null?void 0:d.data)!=null&&f.length){const S=(p=v==null?void 0:v.data)==null?void 0:p.data[0];if((h=r.modelValue)==null?void 0:h.some(k=>k._id===S._id))n.add({severity:"error",message:"Error, this asset already exists in the list.",group:"add-by-scan-error"});else{const k=[S,...r.modelValue];o("update:modelValue",k),o("scan",{...c,asset:S})}}else n.add({severity:"error",message:"Error, this asset is not available",group:"add-by-scan-error"})}catch(m){n.add({error:m,message:"Error, failed to scan asset.",group:"add-by-scan-error"})}finally{i(!1)}},a=async c=>{var d,f,p,h;try{i(!0);const m={...r.queryParams,tag:c.code,excludeId:(d=r.modelValue)!=null&&d.length?JSON.stringify(r.modelValue.map(S=>S._id)):void 0,page:1,limit:1},{data:v}=await uo.getAllAssets(m);if((p=(f=v==null?void 0:v.data)==null?void 0:f.data)!=null&&p.length){const S=(h=v==null?void 0:v.data)==null?void 0:h.data[0];if(["On Disposal Process","Reported Disposal"].includes(S.status)){n.add({severity:"error",message:"Error, cannot add asset that is in the disposal process.",group:"add-by-scan-error"});return}const k=[S,...r.modelValue];o("update:modelValue",k),o("scan",{...c,asset:S})}else n.add({severity:"error",message:"Error, asset not found.",group:"add-by-scan-error"})}catch(m){n.add({error:m,message:"Error, failed to scan asset.",group:"add-by-scan-error"})}finally{i(!1)}},l=async c=>{var d,f,p,h;try{i(!0);const m={...r.queryParams,tag:c.code,excludeId:(d=r.modelValue)!=null&&d.length?JSON.stringify(r.modelValue.map(S=>S.asset)):void 0,page:1,limit:1},{data:v}=await Tf.getReportedDisposal(m);if((p=(f=v==null?void 0:v.data)==null?void 0:f.data)!=null&&p.length){const S=(h=v==null?void 0:v.data)==null?void 0:h.data[0],b=[S,...r.modelValue];o("update:modelValue",b),o("scan",{...c,asset:S})}else n.add({severity:"error",message:`Error, this asset is not on Reported Disposal - ${r.queryParams.reason} list.`,group:"add-by-scan-error"})}catch(m){n.add({error:m,message:"Error, failed to scan asset.",group:"add-by-scan-error"})}finally{i(!1)}},u=async c=>{r.reportedDisposalAssets?await l(c):r.noDisposalAssets?await a(c):await s(c)};return(c,d)=>(g(),T(le,null,[I(aa,{"base-z-index":9997,class:"!absolute !bottom-[80px] !h-max",group:"add-by-scan-error"}),I(TP,{onScan:u,bulk:"",label:"Add By Scan"})],64))}})),aq=()=>re([{field:"profilePictureSmall",header:"Photo",sortable:!0,bodyComponent(t){return{component:Ar,props:{src:xf(t.profilePictureBig),size:"small"}}}},{field:"fullName",header:"Name",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.fullName)??(t==null?void 0:t.name)}},{field:"employeeId",header:"Empolyee ID",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.employeeId)??"-"}},{field:"email",header:"Email",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.email)??"-"}},{field:"phoneNumber",header:"Phone",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.phoneNumber)??"-"}},{field:"position",header:"Position",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.position)??"-"}},{field:"division",header:"Division",sortable:!0,bodyTemplate(t){return(t==null?void 0:t.division)??"-"}}]),oC=t=>{if(Array.isArray(t)){const[e,n]=t;return[new Date(e).setHours(0,0,0),new Date(n??e).setHours(23,59,59)]}},lq=(t,e,n)=>{const i=Object.keys(t),r={};Ye.emit("multi-select:hide-overlay"),i.forEach(o=>{var u;const s=Array.isArray(t[o]),a=typeof t[o]=="string",l=s?(u=t[o])==null?void 0:u.filter(c=>c!=null):t[o];if((l!=null&&!s||s&&l.length)&&!a){if(Array.isArray(l)&&l.every(d=>typeof d=="number"&&d>9466848e5&&!isNaN(new Date(d).getTime()))){r[o]=JSON.stringify(oC(l));return}r[o]=l!=null&&l.length?JSON.stringify(t[o]):JSON.stringify(l)}else r[o]=t[o]}),Ye.emit("data-table:apply-filter",{tableName:e,filter:r}),Ye.emit("data-table:clear-selected-data",{tableName:e}),n==null||n("apply",r)},uq=(t,e,n,i)=>{const r={};Ye.emit("multi-select:hide-overlay"),n.forEach(o=>{if("field"in o){const s=Hn(t,o.field);"value"in s&&s.value!=null&&(r[o.field]=s,"matchMode"in s&&s.matchMode=="DATE_BETWEEN"&&(r[o.field].value=oC(s.value)),Array.isArray(s.value)&&!s.value.filter(Boolean).length&&delete r[o.field])}}),Ye.emit("data-table:apply-filter",{tableName:e,filter:r}),Ye.emit("data-table:clear-selected-data",{tableName:e}),i==null||i("apply",r)},cq={class:"flex items-end justify-end gap-2","data-wv-section":"filteractionbuttons"},dq=ye({inheritAttrs:!1,__name:"FilterContainer",props:{tableName:{default:"datatable"},fieldsPerRow:{default:4},fields:{},static:{type:Boolean}},emits:["apply"],setup(t,{emit:e}){const n=t,i=e,{locale:r}=_t("FilterContainer"),{resetForm:o,handleSubmit:s,setValues:a}=Tp(),l=re({}),u=re({}),c=oe(),d=re(null),f=oe(!1),p=oe(0);bt(()=>{k(),Ye.on("show-filter",m),Ye.on("data-table:updated",v),P()}),Vi(()=>{Ye.off("show-filter",m),Ye.off("data-table:updated",v)});const h=n.fields.filter(M=>M.visible!==!1),m=M=>{M.tableName===n.tableName&&(f.value=M.show)},v=M=>{M.tableName===n.tableName&&(c.value=M.data)},S=async(M,D,$={})=>{if(n.static&&!M)u.value[D]=b(D);else try{l.value[D]=!0;const q={[D]:!0,...$},J=await(M==null?void 0:M(q));if("data"in J){const{data:ve}=J;u.value[D]=ve.data[D]}else Array.isArray(J)&&(u.value[D]=J)}catch(q){console.error(q)}finally{l.value[D]=!1}},b=M=>{const D=new Set;if(c.value)for(let $=0;$<c.value.length;$++){const q=Hn(c.value[$],M);D.add(q)}return Array.from(D).map($=>({label:$,value:$}))},k=()=>{if(d.value){const{children:M}=d.value,D=d.value.childElementCount,$=D%n.fieldsPerRow;let[q,J]=[1,1];for(const ve in Array.from({length:D})){const ae=Number(ve)===D-1;M[ve].setAttribute("style",`grid-area: ${q}/${ae&&$?n.fieldsPerRow:J}`),++J>n.fieldsPerRow&&(J=1,q++)}}},A=()=>{o(),p.value++},w=s(M=>{n.static?uq(M,n.tableName,h,i):lq(M,n.tableName,i)}),y=(M,D)=>{var $;switch(M.type){case"rangenumber":return M.field?`${M.field}.matchMode`:`${($=M.fields)==null?void 0:$[D]}.matchMode`;case"multiselect":case"dropdown":case"calendar":case"category":case"group":return`${M.field}.matchMode`}},C=M=>(()=>{switch(M.type){case"rangenumber":return"BETWEEN";case"multiselect":case"category":case"group":return"IN";case"dropdown":return"EQUALS";case"calendar":return"DATE_BETWEEN"}})(),P=()=>{if(n.static){const M={};h.forEach(D=>{ea(M,y(D),C(D))}),a(M)}},R=(M,D)=>{switch(M.type){case"rangenumber":return M.field?n.static?`${M.field}.value.${D}`:`${M.field}.${D}`:n.static?`${M.fields[D]}.value`:M.fields[D];case"multiselect":case"dropdown":case"calendar":case"category":case"group":return n.static?`${M.field}.value`:`${M.field}`}};return Re(()=>n.fields,k),(M,D)=>ft((g(),T("form",O({ref_key:"container",ref:d},M.$preset.filtercontainer.root,{style:`grid-template-columns: repeat(${M.fieldsPerRow}, 1fr)`,onSubmit:D[0]||(D[0]=xt((...$)=>x(w)&&x(w)(...$),["prevent"])),"data-wv-name":"filtercontainer"}),[(g(!0),T(le,null,_e(x(h),$=>(g(),T(le,{key:JSON.stringify($)+p.value},[$.type=="rangenumber"?(g(),L(MK,O({key:0,ref_for:!0},$,{mandatory:!1,"max-field-name":R($,1),"min-field-name":R($,0),"show-optional-text":!1,"use-validator":""}),null,16,["max-field-name","min-field-name"])):$.type=="multiselect"?(g(),L(cW,O({key:1,ref_for:!0},$,{"field-name":R($),loading:l.value[$.optionField??$.field],mandatory:!1,options:u.value[$.optionField??$.field],"show-optional-text":!1,onShow:q=>S($.fetchOptionFn,$.optionField??$.field,$.params),"option-label":"label","option-value":"value","use-validator":""}),null,16,["field-name","loading","options","onShow"])):$.type=="dropdown"?(g(),L(xl,O({key:2,ref_for:!0},$,{"field-name":R($),loading:l.value[$.field],mandatory:!1,options:u.value[$.optionField??$.field],"show-optional-text":!1,onShow:q=>S($.fetchOptionFn,$.optionField??$.field,$.params),"option-label":"label","option-value":"value","use-validator":""}),null,16,["field-name","loading","options","onShow"])):$.type==="calendar"?(g(),L(CI,O({key:3,ref_for:!0},$,{"field-name":R($),mandatory:!1,"show-optional-text":!1,"selection-mode":"range","use-validator":""}),null,16,["field-name"])):ee(M.$slots,"field",{key:4,field:$,fieldName:R($)})],64))),128)),E("div",cq,[I(We,{label:x(r).clearFieldText,onClick:A,"data-wv-section":"clearbutton",text:""},null,8,["label"]),I(We,{label:x(r).applyText,onClick:x(w),"data-wv-section":"applybutton",severity:"success"},null,8,["label","onClick"])])],16)),[[Zn,f.value]])}}),Jg=ce("FilterContainer",ye({__name:"FilterContainer",setup(t){return(e,n)=>(g(),L(dq,O({fields:e.$attrs.fields},e.$attrs),{field:z(({field:i,fieldName:r})=>[I(FP,O(i,{"field-data-key":i.fieldDataKey??"key","field-label":i.label,"field-name":r,label:i.buttonLabel,mandatory:!1,params:i.params,"show-optional-text":!1,"use-validator":""}),null,16,["field-data-key","field-label","field-name","label","params"])]),_:1},16,["fields"]))}})),fq=ye({__name:"DialogSelectUserFilter",props:{tableName:{},filterOptions:{}},setup(t){const e=t,n=W(()=>[{type:"multiselect",field:"position",label:"Position",placeholder:"Select position",fetchOptionFn:()=>{var i;return(i=e.filterOptions)==null?void 0:i.positionOptions}},{type:"multiselect",field:"division",label:"Division",placeholder:"Select division",fetchOptionFn:()=>{var i;return(i=e.filterOptions)==null?void 0:i.divisionOptions}}]);return(i,r)=>(g(),L(Jg,{fields:n.value,"table-name":i.tableName},null,8,["fields","table-name"]))}}),pq={class:"flex flex-col gap-2"},hq={key:0,class:"overflow-auto max-h-20 list-inside list-disc h-auto ml-2"},mq={class:"flex justify-between items-center gap-1","data-ts-section":"dialog-asset-name-detail-action-group"},gq={class:""},vq={class:"flex justify-end items-center gap-1"},yq={class:"flex flex-col justify-end gap-1"},bq={key:0,class:"text-danger-500 text-[12px] font-light","data-ts-section":"warning-message"},Aq=ce("DialogSelectUser",ye({__name:"DialogSelectUser",props:{header:{default:"Select User"},description:{default:"Select user"},selectionType:{},visible:{type:Boolean},list:{},selectButtonLabel:{default:"Select"},fetchFunction:{},fetchOptionFunction:{}},emits:["update:visible","selected"],setup(t,{emit:e}){const n=t,i=e,r=W(()=>n.visible),o=re(!1),s=re(),a=re([]),l=re(),u=aq(),c=()=>{!a.value.length&&!l.value?o.value=!0:(n.selectionType==="checkbox"?i("selected",a.value):i("selected",l.value),i("update:visible",!1))},d=()=>{a.value=[],l.value=void 0,o.value=!1},f=async p=>{if(n.fetchFunction)return await n.fetchFunction(p)};return Re(r,async p=>{d(),p&&n.fetchOptionFunction&&(s.value=await n.fetchOptionFunction())},{immediate:!0}),(p,h)=>(g(),L(ur,{visible:r.value,"onUpdate:visible":[h[3]||(h[3]=m=>r.value=m),h[4]||(h[4]=m=>i("update:visible",!!m))],draggable:!1,header:n.header,class:"w-[800px]",closable:"","data-ts-name":"dialog-asset-name-detail",modal:""},{footer:z(()=>[ee(p.$slots,"footer",{},()=>[E("div",yq,[o.value?(g(),T("span",bq," You must pick a user ")):N("",!0),E("div",null,[I(We,{onClick:h[2]||(h[2]=m=>p.$emit("update:visible",!1)),label:"Cancel",severity:"dark",text:""}),I(We,{label:n.selectButtonLabel,onClick:c,"data-ts-section":"select-button",severity:"success"},null,8,["label"])])])])]),default:z(()=>[E("div",pq,[n.list&&n.list.length?(g(),T("ul",hq,[(g(!0),T(le,null,_e(n.list,(m,v)=>(g(),T("li",{key:v},_(m),1))),128))])):N("",!0),E("div",mq,[E("div",gq,_(p.description),1),E("div",vq,[I(ih,{"table-name":"dialog-select-user-table"}),I(eh,{"table-name":"dialog-select-user-table"})])]),I(fq,{"filter-options":s.value,"table-name":"dialog-select-user-table"},null,8,["filter-options"]),I(Ph,{"selected-data":a.value,"onUpdate:selectedData":h[0]||(h[0]=m=>a.value=m),columns:x(u),"fetch-function":f,rows:10,"selection-type":n.selectionType,"use-option":!1,onRowSelect:h[1]||(h[1]=m=>{o.value=!1,l.value=l.value?void 0:m.data}),"data-key":"_id","disable-key":"",lazy:"","table-name":"dialog-select-user-table","use-paginator":""},null,8,["selected-data","columns","selection-type"])])]),_:3},8,["visible","header"]))}})),wq={key:0,class:"flex gap-1 items-center"},Sq={class:"text-primary-500 text-xs font-medium"},Vie=ce("ButtonSelectUser",ye({__name:"ButtonSelectUser",props:{fetchFunction:{type:Function},fetchOptionFunction:{type:Function},modelValue:{},list:{},header:{},description:{},useBadge:{type:Boolean},confirmBeforeReselect:{type:Boolean},confirmHeader:{},confirmBody:{}},emits:["update:modelValue","confirm"],setup(t,{emit:e}){const n=t,i=e,r=W(()=>n.modelValue??void 0),o=re(!1),s=re(!1),a=async d=>{if(n.fetchFunction)return await n.fetchFunction(d)},l=async()=>{if(n.fetchOptionFunction)return await n.fetchOptionFunction()},u=()=>{n.confirmBeforeReselect?s.value=!0:o.value=!0},c=()=>{i("confirm"),o.value=!0};return(d,f)=>{var p,h,m;return g(),T(le,null,[r.value?(g(),T("div",wq,[n.useBadge?(g(),L(Lt,{key:0,label:((p=r.value)==null?void 0:p.fullName)??((h=r.value)==null?void 0:h.name),format:"username"},null,8,["label"])):(g(),T(le,{key:1},[I(Me,{class:"!text-general-200",icon:"user"}),E("span",Sq,_(r.value.fullName??((m=r.value)==null?void 0:m.name)),1)],64)),I(We,{onClick:u,class:"p-0 m-0 !min-w-0 !min-h-0 !h-max !w-max",text:""},{default:z(()=>[I(Me,{icon:"pencil",severity:"primary"})]),_:1})])):(g(),L(We,{key:1,onClick:f[0]||(f[0]=v=>o.value=!0),label:"Select User"})),I(Aq,{visible:o.value,"onUpdate:visible":f[1]||(f[1]=v=>o.value=v),description:n.description,"fetch-function":a,"fetch-option-function":l,header:n.header,list:n.list,onSelected:f[2]||(f[2]=v=>d.$emit("update:modelValue",v)),"selection-type":"single"},null,8,["visible","description","header","list"]),I(cr,{visible:s.value,"onUpdate:visible":f[3]||(f[3]=v=>s.value=v),header:n.confirmHeader??"-",onConfirm:c,"confirm-label":"Continue",severity:"danger"},{body:z(()=>[E("p",null,_(n.confirmBody),1),f[4]||(f[4]=E("p",null,"Are you sure you want to continue?",-1))]),_:1},8,["visible","header"])],64)}}})),zie=ce("ButtonViewLog",ye({__name:"ButtonViewLog",props:{showLog:{type:Boolean}},emits:["update:showLog"],setup(t){return(e,n)=>(g(),L(We,{outlined:!e.$props.showLog,onClick:n[0]||(n[0]=i=>e.$emit("update:showLog",!e.$props.showLog)),icon:"file-lines",severity:"secondary",tooltip:"Changelog"},null,8,["outlined"]))}})),Cq={class:"flex flex-col gap-3 justify-between"},kq={class:"flex flex-col max-h-20 overflow-y-auto"},Oq={class:"text-general-800 font-medium","data-ts-section":"assetparent"},Tq={class:"flex flex-col max-h-20","data-ts-section":"linked-asset-family"},xq={key:3,class:"text-general-800 font-medium","data-ts-section":"confirmbody"},Fie=ce("DialogLinkedAsset",ye({__name:"DialogLinkedAsset",props:{header:{},list:{},lists:{},label:{},confirmBody:{},headerIcon:{},type:{default:"confirmation"},severity:{},confirmButtonSeverity:{},visible:{type:Boolean},closeAfterConfirm:{type:Boolean,default:!0},closeLabel:{},actionable:{type:Boolean,default:!0},confirmLabel:{},disableConfirmButton:{type:Boolean},listLabel:{},message:{},showIcon:{type:Boolean},showCloseButton:{type:Boolean},contentClass:{}},emits:["confirm","update:visible"],setup(t){var c;const e=sr(),n=t,i=W(()=>n.confirmLabel?n.confirmLabel:n.severity==="danger"?"Remove":"Submit"),r=W(()=>n.confirmBody?n.confirmBody:n.severity==="success"?"All related data will be transacted. Are you sure want to submit?":"All related data will be removed from the list. Are you want to remove it?"),o=W(()=>!!n.headerIcon||n.severity==="danger"),s=re(!1),a=re([]),l=re(!!((c=n.list)!=null&&c.length));Re(()=>n.list,()=>{l.value=!0});const u=async()=>{var d;try{if(!l.value)return;s.value=!0;const f=[],p=m=>m.family.length>1,h=({parent:m,children:v,family:S},b)=>{const k=y=>y.map(C=>({_id:C._id,name:C.name})),{_id:A,name:w}=m??b;return{parent:{_id:A,name:w},children:v.length?k(v):k(S.filter(y=>y._id!==A))}};if((d=n.list)!=null&&d.length){const{data:m}=await uo.getLinkedAssetFamily(JSON.stringify(n.list.map(v=>v._id)));m.data&&m.data.forEach(v=>{const S=v.family.find(b=>b._id===v._id);if(p(v)&&S){const b=h(v,S);f.some(A=>A.parent._id===b.parent._id)||f.push(b)}})}a.value=f}catch(f){e.removeGroup("linkedasset"),e.add({error:f,message:"Error, failed to fetch linked assets.",group:"linkedasset"})}finally{s.value=!1,l.value=!1}};return(d,f)=>(g(),L(cr,O(d.$props,{"confirm-label":i.value,list:void 0,"show-icon":o.value,onConfirm:f[1]||(f[1]=p=>d.$emit("confirm",a.value)),onShow:u,"onUpdate:visible":f[2]||(f[2]=p=>d.$emit("update:visible",p)),"data-ts-name":"dialoglinkedasset"}),Dn({body:z(()=>[E("div",Cq,[d.type==="confirmation"?(g(),T(le,{key:0},[E("ul",kq,[(g(!0),T(le,null,_e(d.list,p=>(g(),T("li",{key:p._id,class:"text-general-800 font-medium","data-ts-section":"assetlistitem"},_(p.name.nameWithSequence),1))),128))]),f[3]||(f[3]=E("p",{class:"text-general-800 font-medium"}," The following assets have other assets linked to them: ",-1))],64)):N("",!0),s.value?(g(),L(Me,{key:1,class:"animate-spin h-6 w-6 self-center cursor-default !text-general-200 py-4",icon:"loader-4"})):(g(!0),T(le,{key:2},_e(a.value,p=>(g(),T("div",{key:p.parent._id,class:"flex flex-col gap-0.5"},[E("span",Oq,_(p.parent.name.nameWithSequence)+": ",1),E("ul",Tq,[(g(!0),T(le,null,_e(p.children,h=>(g(),T("li",{key:h._id,class:"text-general-800 font-medium","data-ts-section":"assetchild"},_(h.name.nameWithSequence),1))),128))])]))),128)),d.type==="confirmation"?(g(),T("p",xq,_(r.value),1)):N("",!0)]),I(aa,{group:"linkedasset"})]),_:2},[n.type==="detail"?{name:"footer",fn:z(()=>[I(We,{onClick:f[0]||(f[0]=p=>d.$emit("update:visible",!1)),"data-ts-section":"closebutton",label:"Close",outlined:""})]),key:"0"}:void 0]),1040,["confirm-label","show-icon"]))}})),sC=ce("UserWithIcon",ye({__name:"UserWithIcon",props:{user:{}},setup(t){return(e,n)=>(g(),L(Eu,{user:e.user,type:"icon","user-name-field":"fullName"},null,8,["user"]))}})),Mq={class:"w-full"},jie=ce("InputSearch",ye({__name:"InputSearch",emits:["search"],setup(t,{emit:e}){const n=e,i=oe(),r=oe(),o=s=>{i.value=s.target.value||void 0,r.value=s.target.value||void 0};return(s,a)=>{var l,u;return g(),T("form",{class:pe(["text-xs flex gap-1 h-[34px] px-[21px] items-center","rounded-[18px] bg-general-50"]),onSubmit:a[1]||(a[1]=xt(c=>n("search",i.value),["prevent"]))},[E("div",Mq,[I(x(Xr),{class:pe(["h-auto !shadow-none !p-0 !text-general-500 placeholder:text-general-200 !bg-general-50"]),"model-value":r.value,onInput:o,autocomplete:"off",placeholder:"Search asset"},null,8,["model-value"])]),I(Me,{class:pe(["text-md !text-general-400 !w-4 !h-4",{hidden:(l=r.value)==null?void 0:l.length}]),icon:"search"},null,8,["class"]),I(Me,{class:pe(["text-md !text-general-400 !w-4 !h-4",{hidden:!((u=r.value)!=null&&u.length)}]),onClick:a[0]||(a[0]=c=>r.value=void 0),"data-ts-section":"reset-filter-icon",icon:"close"},null,8,["class"])],32)}}})),Eq={class:"flex gap-1 items-center text-placeholder","data-section-name":"transaction-role-lists"},Hie=ce("TransactionRoles",ye({__name:"TransactionRoles",props:{asset:{},user:{},type:{default:"transaction"}},setup(t){const e=t,n=W(()=>e.user?"user":"asset"),i=W(()=>{const m=e.user??e.asset;if(!m)return[];const S=JSON.parse(localStorage.user??"{}").addOn,b=[{label:"Borrowing",icon:"borrow",info:h(m,"borrowing"),severity:p(m,"borrowing")},{label:"Assignment",icon:"assignment",info:h(m,"assignment"),severity:p(m,"assignment")},{label:"Transfer",icon:"exchange",info:h(m,"transfer"),severity:p(m,"transfer")},{label:"Disposal",icon:"disposal",info:h(m,"disposal"),severity:p(m,"disposal")}];if(e.type==="transaction-policy")return b;const k=n.value==="asset"?[{label:"Asset Control",icon:"gate",info:h(m,"assetControl"),severity:p(m,"assetControl"),visible:S.assetControl}]:[],A=[{label:"Audit",icon:"audit",info:h(m,"audit"),severity:p(m,"audit"),visible:S.audit},...k,{label:"Maintenance",icon:"file-settings",info:h(m,"maintenance"),severity:p(m,"maintenance"),visible:S.maintenance},{label:"Repair Ticketing",icon:"repair-ticketing",info:h(m,"repairTicketing"),severity:p(m,"repairTicketing"),visible:S.repairTicketing},{label:"Tracking",icon:"tracking",info:h(m,"tracking"),severity:p(m,"tracking"),visible:S.tracking}].filter(w=>w.visible);return[...e.type==="transaction"?b:[],...A]}),r=(m,v)=>e.type==="transaction-policy"?m?s(v):a(v):m?n.value==="user"?o(v):l(v):n.value==="user"?u(v):c(v),o=m=>{switch(m){case"borrowing":return"This user has borrowing role";case"assignment":return"This user has assignment role";case"disposal":return"This user has disposal role";case"audit":return"This user has audit role";case"repairTicketing":return"This user has repair ticketing role";case"transfer":return"This user has transfer role";case"maintenance":return"This user has maintenance routine role";case"tracking":return"This user has tracking role";default:return"This user doesn't have role"}},s=m=>{switch(m){case"borrowing":return"This asset can be borrowed";case"assignment":return"This asset can be assigned";case"disposal":return"This asset can be disposed";case"transfer":return"This asset can be transferred";default:return"This asset can be transacted"}},a=m=>{switch(m){case"borrowing":return"This asset cannot be borrowed";case"assignment":return"This asset cannot be assigned";case"disposal":return"This asset cannot be disposed";case"transfer":return"This asset cannot be transferred";default:return"This asset cannot be transacted"}},l=m=>{switch(m){case"borrowing":case"assignment":case"disposal":case"transfer":return s(m);case"audit":return"This asset has Audit Addon";case"assetControl":return"This asset has Asset Control Addon";case"maintenance":return"This asset has Maintenance Routine Addon";case"repairTicketing":return"This asset has Repair Ticketing Addon";case"tracking":return"This asset has Tracking Addon"}},u=m=>{switch(m){case"borrowing":return"This user doesn't have borrowing role";case"assignment":return"This user doesn't have assignment role";case"disposal":return"This user doesn't have disposal role";case"audit":return"This user doesn't have audit role";case"repairTicketing":return"This user doesn't have repair ticketing role";case"transfer":return"This user doesn't have transfer role";case"maintenance":return"This user doesn't have maintenance routine role";case"tracking":return"This user doesn't have tracking role";default:return"This user doesn't have role"}},c=m=>{switch(m){case"borrowing":case"assignment":case"disposal":case"transfer":return a(m);case"audit":return"This asset doesn't have Audit Addon";case"assetControl":return"This asset doesn't have Asset Control Addon";case"maintenance":return"This asset doesn't have Maintenance Routine Addon";case"repairTicketing":return"This asset doesn't have Repair Ticketing Addon";case"tracking":return"This asset doesn't have Tracking Addon"}},d=(m,v)=>{var w;if(e.type==="transaction-policy")return!!((w=m.transactions)!=null&&w[v]);const S=e.type==="addon"?m.addOn:n.value==="user"?m.transactionRoles:m.transactions,b=f(m,v),k=!!(S!=null&&S[v]),A=!!(S!=null&&S[v]);return(e.type==="addon"?k:A)&&b},f=(m,v)=>{if(["repairTicketing","maintenance","tracking","audit","assetControl"].includes(v)&&m.licenseStatuses){const S=m.licenseStatuses[v];return n.value==="asset"?!!S&&["Managed","Active"].includes(S):!0}return!0},p=(m,v)=>d(m,v)?"primary":void 0,h=(m,v)=>r(d(m,v),v);return(m,v)=>(g(),T("div",Eq,[(g(!0),T(le,null,_e(i.value,S=>(g(),L(Me,{key:S.label,class:pe(["text-xs",{"text-general-200":!S.severity}]),"data-role-name":S.label,icon:S.icon,info:S.info,severity:S.severity},null,8,["class","data-role-name","icon","info","severity"]))),128))]))}})),Pq=["aria-selected","data-in-range","onClick"],Uie=ce("DatePicker",ye({__name:"DatePicker",props:{modelValue:{},initialValue:{},label:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},errorMessage:{}},emits:["update:modelValue"],setup(t){const e=t;bt(()=>{e.useValidator&&Object.assign(i,Ln(e.fieldName??"date",d=>{var f;return!(d!=null&&d.length)&&e.mandatory?n(((f=e.errorMessage)==null?void 0:f.empty)??"You must pick a date"):!0},{initialValue:e.initialValue??[]}))});const{t:n}=ls(),i=sn({value:[]}),r=oe(),o=oe(),s=W(()=>{const d=i.value[0],f=i.value[1];return f&&d!==f?d+" - "+f:d==null?void 0:d.toString()}),a=Array.from({length:31},(d,f)=>f+1),l=d=>{var h;const f=i.value[0],p=i.value[1];f!=null&&p!=null&&f===p?(i.value[1]=d,(h=r.value)==null||h.hide()):i.value=[d,d],i.value.sort((m,v)=>m-v)},u=d=>{var p,h;const f=((p=o.value)==null?void 0:p.$el)||null;f&&r.value&&f.focus(),(h=r.value)==null||h.toggle(d)},c=d=>{var f;if(d.key==="Enter"||d.key===" "){d.preventDefault();const p=(f=d.target)==null?void 0:f.parentElement,h={...d,target:p,currentTarget:p};u(h)}};return Re(()=>e.initialValue,()=>{var d;(d=e.initialValue)!=null&&d.length&&(i.value=e.initialValue)},{once:!0}),Re(()=>e.modelValue,d=>{i.value=d??[]}),(d,f)=>(g(),T(le,null,[I(Yn,{label:d.label?x(n)(d.label):void 0,mandatory:d.mandatory},{default:z(()=>[I(br,{invalid:!!i.errorMessage,onClick:u,class:"grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1"},{default:z(()=>[I(x(Xr),{ref_key:"inputtext",ref:o,"model-value":s.value,placeholder:x(n)("Select date"),onKeydown:c,class:"!p-0",readonly:""},null,8,["model-value","placeholder"]),I(Me,{class:"w-4 h-4 shrink-0 !text-general-500","data-ts-section":"inputtrigger",icon:"calendar"})]),_:1},8,["invalid"]),I(Rn,{message:i.errorMessage,"data-test":"datepicker-validator-message"},null,8,["message"])]),_:1},8,["label","mandatory"]),I(x(Rl),{ref_key:"panel",ref:r,pt:{content:{class:"grid grid-cols-7 grid-rows-[repeat(5,max-content)] p-6"}},class:"border-none !mt-0 !shadow-panel"},{default:z(()=>[(g(!0),T(le,null,_e(x(a),p=>(g(),T("span",{key:p,"aria-selected":i.value.includes(p),"data-in-range":i.value[0]<p&&p<i.value[1],onClick:h=>l(p),class:"text-xs text-general-800 bg-white hover:bg-primary-100 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 [&[data-in-range='true']]:text-general-800 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 [&[aria-selected='true']]:text-white text-center p-2 cursor-pointer","data-ts-section":"date"},_(p),9,Pq))),128))]),_:1},512)],64))}})),Iq=["aria-selected","data-in-range","onClick"],Kie=ce("DayPicker",ye({__name:"DayPicker",props:{modelValue:{},initialValue:{},label:{},useValidator:{type:Boolean},fieldName:{},mandatory:{type:Boolean},invalid:{type:Boolean},errorMessage:{}},emits:["update:modelValue"],setup(t){const e=t;bt(()=>{e.useValidator&&Object.assign(r,Ln(e.fieldName??"day",c=>{var d;return!(c!=null&&c.length)&&e.mandatory?i(((d=e.errorMessage)==null?void 0:d.empty)??"You must pick a day"):!0},{initialValue:e.initialValue??[]}))});const n=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],{t:i}=ls(),r=sn({value:[]}),o=oe(),s=oe(),a=W(()=>{const c=n[r.value[0]],d=n[r.value[1]];return d&&c!==d?c+" - "+d:c}),l=(c,d)=>{var h;const f=r.value[0],p=r.value[1];f!=null&&p!=null&&f===p?(r.value[1]=d,(h=o.value)==null||h.hide()):r.value=[d,d],r.value.sort((m,v)=>m-v)},u=c=>{var f,p;const d=((f=s.value)==null?void 0:f.$el)||null;d&&o.value&&d.focus(),(p=o.value)==null||p.toggle(c)};return Re(()=>e.initialValue,()=>{var c;(c=e.initialValue)!=null&&c.length&&(r.value=e.initialValue)},{once:!0}),Re(()=>e.modelValue,c=>{r.value=c??[]}),(c,d)=>(g(),T(le,null,[I(Yn,{label:c.label?x(i)(c.label):void 0,mandatory:c.mandatory},{default:z(()=>[I(br,{invalid:!!r.errorMessage,onClick:u,class:"grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1"},{default:z(()=>[I(x(Xr),{ref_key:"inputtext",ref:s,"model-value":a.value,placeholder:x(i)("Select day"),class:"!p-0",readonly:""},null,8,["model-value","placeholder"]),I(Me,{class:"w-4 h-4 shrink-0 !text-general-500","data-ts-section":"inputtrigger",icon:"calendar"})]),_:1},8,["invalid"]),I(Rn,{message:r.errorMessage,"data-test":"daypicker-validator-message"},null,8,["message"])]),_:1},8,["label","mandatory"]),I(x(Rl),{ref_key:"panel",ref:o,pt:{content:{class:"grid grid-cols-3 p-6 gap-y-4"}},class:"border-none !mt-0 !shadow-panel"},{default:z(()=>[(g(),T(le,null,_e(n,(f,p)=>E("span",{key:f,"aria-selected":r.value.includes(p),class:pe([{"col-start-2":f==="Sunday"},"text-xs text-general-800 bg-white hover:bg-primary-100 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 [&[data-in-range='true']]:text-general-800 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 [&[aria-selected='true']]:text-white text-center p-2 cursor-pointer"]),"data-in-range":r.value[0]<p&&p<r.value[1],onClick:h=>l(f,p),"data-ts-section":"day"},_(x(i)(f)),11,Iq)),64))]),_:1},512)],64))}}));var Ba={},Yg,aC;function Lq(){return aC||(aC=1,Yg=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Yg}var Qg={},Zo={},lC;function Vs(){if(lC)return Zo;lC=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Zo.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},Zo.getSymbolTotalCodewords=function(i){return e[i]},Zo.getBCHDigit=function(n){let i=0;for(;n!==0;)i++,n>>>=1;return i},Zo.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');t=i},Zo.isKanjiModeEnabled=function(){return typeof t<"u"},Zo.toSJIS=function(i){return t(i)},Zo}var ev={},uC;function tv(){return uC||(uC=1,function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,r){if(t.isValid(i))return i;try{return e(i)}catch{return r}}}(ev)),ev}var nv,cC;function Dq(){if(cC)return nv;cC=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const n=Math.floor(e/8);return(this.buffer[n]>>>7-e%8&1)===1},put:function(e,n){for(let i=0;i<n;i++)this.putBit((e>>>n-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),e&&(this.buffer[n]|=128>>>this.length%8),this.length++}},nv=t,nv}var iv,dC;function Rq(){if(dC)return iv;dC=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,n,i,r){const o=e*this.size+n;this.data[o]=i,r&&(this.reservedBit[o]=!0)},t.prototype.get=function(e,n){return this.data[e*this.size+n]},t.prototype.xor=function(e,n,i){this.data[e*this.size+n]^=i},t.prototype.isReserved=function(e,n){return this.reservedBit[e*this.size+n]},iv=t,iv}var rv={},fC;function Nq(){return fC||(fC=1,function(t){const e=Vs().getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const r=Math.floor(i/7)+2,o=e(i),s=o===145?26:Math.ceil((o-13)/(2*r-2))*2,a=[o-7];for(let l=1;l<r-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},t.getPositions=function(i){const r=[],o=t.getRowColCoords(i),s=o.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||r.push([o[a],o[l]]);return r}}(rv)),rv}var ov={},pC;function Bq(){if(pC)return ov;pC=1;const t=Vs().getSymbolSize,e=7;return ov.getPositions=function(i){const r=t(i);return[[0,0],[r-e,0],[0,r-e]]},ov}var sv={},hC;function $q(){return hC||(hC=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(r){const o=r.size;let s=0,a=0,l=0,u=null,c=null;for(let d=0;d<o;d++){a=l=0,u=c=null;for(let f=0;f<o;f++){let p=r.get(d,f);p===u?a++:(a>=5&&(s+=e.N1+(a-5)),u=p,a=1),p=r.get(f,d),p===c?l++:(l>=5&&(s+=e.N1+(l-5)),c=p,l=1)}a>=5&&(s+=e.N1+(a-5)),l>=5&&(s+=e.N1+(l-5))}return s},t.getPenaltyN2=function(r){const o=r.size;let s=0;for(let a=0;a<o-1;a++)for(let l=0;l<o-1;l++){const u=r.get(a,l)+r.get(a,l+1)+r.get(a+1,l)+r.get(a+1,l+1);(u===4||u===0)&&s++}return s*e.N2},t.getPenaltyN3=function(r){const o=r.size;let s=0,a=0,l=0;for(let u=0;u<o;u++){a=l=0;for(let c=0;c<o;c++)a=a<<1&2047|r.get(u,c),c>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|r.get(c,u),c>=10&&(l===1488||l===93)&&s++}return s*e.N3},t.getPenaltyN4=function(r){let o=0;const s=r.data.length;for(let l=0;l<s;l++)o+=r.data[l];return Math.abs(Math.ceil(o*100/s/5)-10)*e.N4};function n(i,r,o){switch(i){case t.Patterns.PATTERN000:return(r+o)%2===0;case t.Patterns.PATTERN001:return r%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(r+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return r*o%2+r*o%3===0;case t.Patterns.PATTERN110:return(r*o%2+r*o%3)%2===0;case t.Patterns.PATTERN111:return(r*o%3+(r+o)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(r,o){const s=o.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)o.isReserved(l,a)||o.xor(l,a,n(r,l,a))},t.getBestMask=function(r,o){const s=Object.keys(t.Patterns).length;let a=0,l=1/0;for(let u=0;u<s;u++){o(u),t.applyMask(u,r);const c=t.getPenaltyN1(r)+t.getPenaltyN2(r)+t.getPenaltyN3(r)+t.getPenaltyN4(r);t.applyMask(u,r),c<l&&(l=c,a=u)}return a}}(sv)),sv}var hf={},mC;function gC(){if(mC)return hf;mC=1;const t=tv(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],n=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return hf.getBlocksCount=function(r,o){switch(o){case t.L:return e[(r-1)*4+0];case t.M:return e[(r-1)*4+1];case t.Q:return e[(r-1)*4+2];case t.H:return e[(r-1)*4+3];default:return}},hf.getTotalCodewordsCount=function(r,o){switch(o){case t.L:return n[(r-1)*4+0];case t.M:return n[(r-1)*4+1];case t.Q:return n[(r-1)*4+2];case t.H:return n[(r-1)*4+3];default:return}},hf}var av={},Vu={},vC;function Vq(){if(vC)return Vu;vC=1;const t=new Uint8Array(512),e=new Uint8Array(256);return function(){let i=1;for(let r=0;r<255;r++)t[r]=i,e[i]=r,i<<=1,i&256&&(i^=285);for(let r=255;r<512;r++)t[r]=t[r-255]}(),Vu.log=function(i){if(i<1)throw new Error("log("+i+")");return e[i]},Vu.exp=function(i){return t[i]},Vu.mul=function(i,r){return i===0||r===0?0:t[e[i]+e[r]]},Vu}var yC;function zq(){return yC||(yC=1,function(t){const e=Vq();t.mul=function(i,r){const o=new Uint8Array(i.length+r.length-1);for(let s=0;s<i.length;s++)for(let a=0;a<r.length;a++)o[s+a]^=e.mul(i[s],r[a]);return o},t.mod=function(i,r){let o=new Uint8Array(i);for(;o.length-r.length>=0;){const s=o[0];for(let l=0;l<r.length;l++)o[l]^=e.mul(r[l],s);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o},t.generateECPolynomial=function(i){let r=new Uint8Array([1]);for(let o=0;o<i;o++)r=t.mul(r,new Uint8Array([1,e.exp(o)]));return r}}(av)),av}var lv,bC;function Fq(){if(bC)return lv;bC=1;const t=zq();function e(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(i){this.degree=i,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(i.length+this.degree);r.set(i);const o=t.mod(r,this.genPoly),s=this.degree-o.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(o,s),a}return o},lv=e,lv}var uv={},cv={},dv={},AC;function wC(){return AC||(AC=1,dv.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),dv}var Dr={},SC;function CC(){if(SC)return Dr;SC=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
327
327
  ]))+`;Dr.KANJI=new RegExp(n,"g"),Dr.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Dr.BYTE=new RegExp(i,"g"),Dr.NUMERIC=new RegExp(t,"g"),Dr.ALPHANUMERIC=new RegExp(e,"g");const r=new RegExp("^"+n+"$"),o=new RegExp("^"+t+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Dr.testKanji=function(l){return r.test(l)},Dr.testNumeric=function(l){return o.test(l)},Dr.testAlphanumeric=function(l){return s.test(l)},Dr}var kC;function zs(){return kC||(kC=1,function(t){const e=wC(),n=CC();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return n.testNumeric(o)?t.NUMERIC:n.testAlphanumeric(o)?t.ALPHANUMERIC:n.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function i(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+r)}}t.from=function(o,s){if(t.isValid(o))return o;try{return i(o)}catch{return s}}}(cv)),cv}var OC;function jq(){return OC||(OC=1,function(t){const e=Vs(),n=gC(),i=tv(),r=zs(),o=wC(),s=7973,a=e.getBCHDigit(s);function l(f,p,h){for(let m=1;m<=40;m++)if(p<=t.getCapacity(m,h,f))return m}function u(f,p){return r.getCharCountIndicator(f,p)+4}function c(f,p){let h=0;return f.forEach(function(m){const v=u(m.mode,p);h+=v+m.getBitsLength()}),h}function d(f,p){for(let h=1;h<=40;h++)if(c(f,h)<=t.getCapacity(h,p,r.MIXED))return h}t.from=function(p,h){return o.isValid(p)?parseInt(p,10):h},t.getCapacity=function(p,h,m){if(!o.isValid(p))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=r.BYTE);const v=e.getSymbolTotalCodewords(p),S=n.getTotalCodewordsCount(p,h),b=(v-S)*8;if(m===r.MIXED)return b;const k=b-u(m,p);switch(m){case r.NUMERIC:return Math.floor(k/10*3);case r.ALPHANUMERIC:return Math.floor(k/11*2);case r.KANJI:return Math.floor(k/13);case r.BYTE:default:return Math.floor(k/8)}},t.getBestVersionForData=function(p,h){let m;const v=i.from(h,i.M);if(Array.isArray(p)){if(p.length>1)return d(p,v);if(p.length===0)return 1;m=p[0]}else m=p;return l(m.mode,m.getLength(),v)},t.getEncodedBits=function(p){if(!o.isValid(p)||p<7)throw new Error("Invalid QR Code version");let h=p<<12;for(;e.getBCHDigit(h)-a>=0;)h^=s<<e.getBCHDigit(h)-a;return p<<12|h}}(uv)),uv}var fv={},TC;function Hq(){if(TC)return fv;TC=1;const t=Vs(),e=1335,n=21522,i=t.getBCHDigit(e);return fv.getEncodedBits=function(o,s){const a=o.bit<<3|s;let l=a<<10;for(;t.getBCHDigit(l)-i>=0;)l^=e<<t.getBCHDigit(l)-i;return(a<<10|l)^n},fv}var pv={},hv,xC;function Uq(){if(xC)return hv;xC=1;const t=zs();function e(n){this.mode=t.NUMERIC,this.data=n.toString()}return e.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(i){let r,o,s;for(r=0;r+3<=this.data.length;r+=3)o=this.data.substr(r,3),s=parseInt(o,10),i.put(s,10);const a=this.data.length-r;a>0&&(o=this.data.substr(r),s=parseInt(o,10),i.put(s,a*3+1))},hv=e,hv}var mv,MC;function Kq(){if(MC)return mv;MC=1;const t=zs(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(i){this.mode=t.ALPHANUMERIC,this.data=i}return n.getBitsLength=function(r){return 11*Math.floor(r/2)+6*(r%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let o;for(o=0;o+2<=this.data.length;o+=2){let s=e.indexOf(this.data[o])*45;s+=e.indexOf(this.data[o+1]),r.put(s,11)}this.data.length%2&&r.put(e.indexOf(this.data[o]),6)},mv=n,mv}var gv,EC;function Wq(){if(EC)return gv;EC=1;const t=zs();function e(n){this.mode=t.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}return e.getBitsLength=function(i){return i*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(n){for(let i=0,r=this.data.length;i<r;i++)n.put(this.data[i],8)},gv=e,gv}var vv,PC;function qq(){if(PC)return vv;PC=1;const t=zs(),e=Vs();function n(i){this.mode=t.KANJI,this.data=i}return n.getBitsLength=function(r){return r*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(i){let r;for(r=0;r<this.data.length;r++){let o=e.toSJIS(this.data[r]);if(o>=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[r]+`
328
328
  Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),i.put(o,13)}},vv=n,vv}var yv={exports:{}},IC;function Xq(){return IC||(IC=1,function(t){var e={single_source_shortest_paths:function(n,i,r){var o={},s={};s[i]=0;var a=e.PriorityQueue.make();a.push(i,0);for(var l,u,c,d,f,p,h,m,v;!a.empty();){l=a.pop(),u=l.value,d=l.cost,f=n[u]||{};for(c in f)f.hasOwnProperty(c)&&(p=f[c],h=d+p,m=s[c],v=typeof s[c]>"u",(v||m>h)&&(s[c]=h,a.push(c,h),o[c]=u))}if(typeof r<"u"&&typeof s[r]>"u"){var S=["Could not find a path from ",i," to ",r,"."].join("");throw new Error(S)}return o},extract_shortest_path_from_predecessor_list:function(n,i){for(var r=[],o=i;o;)r.push(o),n[o],o=n[o];return r.reverse(),r},find_path:function(n,i,r){var o=e.single_source_shortest_paths(n,i,r);return e.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(n){var i=e.PriorityQueue,r={},o;n=n||{};for(o in i)i.hasOwnProperty(o)&&(r[o]=i[o]);return r.queue=[],r.sorter=n.sorter||i.default_sorter,r},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var r={value:n,cost:i};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e}(yv)),yv.exports}var LC;function Gq(){return LC||(LC=1,function(t){const e=zs(),n=Uq(),i=Kq(),r=Wq(),o=qq(),s=CC(),a=Vs(),l=Xq();function u(S){return unescape(encodeURIComponent(S)).length}function c(S,b,k){const A=[];let w;for(;(w=S.exec(k))!==null;)A.push({data:w[0],index:w.index,mode:b,length:w[0].length});return A}function d(S){const b=c(s.NUMERIC,e.NUMERIC,S),k=c(s.ALPHANUMERIC,e.ALPHANUMERIC,S);let A,w;return a.isKanjiModeEnabled()?(A=c(s.BYTE,e.BYTE,S),w=c(s.KANJI,e.KANJI,S)):(A=c(s.BYTE_KANJI,e.BYTE,S),w=[]),b.concat(k,A,w).sort(function(C,P){return C.index-P.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function f(S,b){switch(b){case e.NUMERIC:return n.getBitsLength(S);case e.ALPHANUMERIC:return i.getBitsLength(S);case e.KANJI:return o.getBitsLength(S);case e.BYTE:return r.getBitsLength(S)}}function p(S){return S.reduce(function(b,k){const A=b.length-1>=0?b[b.length-1]:null;return A&&A.mode===k.mode?(b[b.length-1].data+=k.data,b):(b.push(k),b)},[])}function h(S){const b=[];for(let k=0;k<S.length;k++){const A=S[k];switch(A.mode){case e.NUMERIC:b.push([A,{data:A.data,mode:e.ALPHANUMERIC,length:A.length},{data:A.data,mode:e.BYTE,length:A.length}]);break;case e.ALPHANUMERIC:b.push([A,{data:A.data,mode:e.BYTE,length:A.length}]);break;case e.KANJI:b.push([A,{data:A.data,mode:e.BYTE,length:u(A.data)}]);break;case e.BYTE:b.push([{data:A.data,mode:e.BYTE,length:u(A.data)}])}}return b}function m(S,b){const k={},A={start:{}};let w=["start"];for(let y=0;y<S.length;y++){const C=S[y],P=[];for(let R=0;R<C.length;R++){const M=C[R],D=""+y+R;P.push(D),k[D]={node:M,lastCount:0},A[D]={};for(let $=0;$<w.length;$++){const q=w[$];k[q]&&k[q].node.mode===M.mode?(A[q][D]=f(k[q].lastCount+M.length,M.mode)-f(k[q].lastCount,M.mode),k[q].lastCount+=M.length):(k[q]&&(k[q].lastCount=M.length),A[q][D]=f(M.length,M.mode)+4+e.getCharCountIndicator(M.mode,b))}}w=P}for(let y=0;y<w.length;y++)A[w[y]].end=0;return{map:A,table:k}}function v(S,b){let k;const A=e.getBestModeForData(S);if(k=e.from(b,A),k!==e.BYTE&&k.bit<A.bit)throw new Error('"'+S+'" cannot be encoded with mode '+e.toString(k)+`.
329
329
  Suggested mode is: `+e.toString(A));switch(k===e.KANJI&&!a.isKanjiModeEnabled()&&(k=e.BYTE),k){case e.NUMERIC:return new n(S);case e.ALPHANUMERIC:return new i(S);case e.KANJI:return new o(S);case e.BYTE:return new r(S)}}t.fromArray=function(b){return b.reduce(function(k,A){return typeof A=="string"?k.push(v(A,null)):A.data&&k.push(v(A.data,A.mode)),k},[])},t.fromString=function(b,k){const A=d(b,a.isKanjiModeEnabled()),w=h(A),y=m(w,k),C=l.find_path(y.map,"start","end"),P=[];for(let R=1;R<C.length-1;R++)P.push(y.table[C[R]].node);return t.fromArray(p(P))},t.rawSplit=function(b){return t.fromArray(d(b,a.isKanjiModeEnabled()))}}(pv)),pv}var DC;function Zq(){if(DC)return Qg;DC=1;const t=Vs(),e=tv(),n=Dq(),i=Rq(),r=Nq(),o=Bq(),s=$q(),a=gC(),l=Fq(),u=jq(),c=Hq(),d=zs(),f=Gq();function p(y,C){const P=y.size,R=o.getPositions(C);for(let M=0;M<R.length;M++){const D=R[M][0],$=R[M][1];for(let q=-1;q<=7;q++)if(!(D+q<=-1||P<=D+q))for(let J=-1;J<=7;J++)$+J<=-1||P<=$+J||(q>=0&&q<=6&&(J===0||J===6)||J>=0&&J<=6&&(q===0||q===6)||q>=2&&q<=4&&J>=2&&J<=4?y.set(D+q,$+J,!0,!0):y.set(D+q,$+J,!1,!0))}}function h(y){const C=y.size;for(let P=8;P<C-8;P++){const R=P%2===0;y.set(P,6,R,!0),y.set(6,P,R,!0)}}function m(y,C){const P=r.getPositions(C);for(let R=0;R<P.length;R++){const M=P[R][0],D=P[R][1];for(let $=-2;$<=2;$++)for(let q=-2;q<=2;q++)$===-2||$===2||q===-2||q===2||$===0&&q===0?y.set(M+$,D+q,!0,!0):y.set(M+$,D+q,!1,!0)}}function v(y,C){const P=y.size,R=u.getEncodedBits(C);let M,D,$;for(let q=0;q<18;q++)M=Math.floor(q/3),D=q%3+P-8-3,$=(R>>q&1)===1,y.set(M,D,$,!0),y.set(D,M,$,!0)}function S(y,C,P){const R=y.size,M=c.getEncodedBits(C,P);let D,$;for(D=0;D<15;D++)$=(M>>D&1)===1,D<6?y.set(D,8,$,!0):D<8?y.set(D+1,8,$,!0):y.set(R-15+D,8,$,!0),D<8?y.set(8,R-D-1,$,!0):D<9?y.set(8,15-D-1+1,$,!0):y.set(8,15-D-1,$,!0);y.set(R-8,8,1,!0)}function b(y,C){const P=y.size;let R=-1,M=P-1,D=7,$=0;for(let q=P-1;q>0;q-=2)for(q===6&&q--;;){for(let J=0;J<2;J++)if(!y.isReserved(M,q-J)){let ve=!1;$<C.length&&(ve=(C[$]>>>D&1)===1),y.set(M,q-J,ve),D--,D===-1&&($++,D=7)}if(M+=R,M<0||P<=M){M-=R,R=-R;break}}}function k(y,C,P){const R=new n;P.forEach(function(J){R.put(J.mode.bit,4),R.put(J.getLength(),d.getCharCountIndicator(J.mode,y)),J.write(R)});const M=t.getSymbolTotalCodewords(y),D=a.getTotalCodewordsCount(y,C),$=(M-D)*8;for(R.getLengthInBits()+4<=$&&R.put(0,4);R.getLengthInBits()%8!==0;)R.putBit(0);const q=($-R.getLengthInBits())/8;for(let J=0;J<q;J++)R.put(J%2?17:236,8);return A(R,y,C)}function A(y,C,P){const R=t.getSymbolTotalCodewords(C),M=a.getTotalCodewordsCount(C,P),D=R-M,$=a.getBlocksCount(C,P),q=R%$,J=$-q,ve=Math.floor(R/$),ae=Math.floor(D/$),me=ae+1,se=ve-ae,Ie=new l(se);let Be=0;const xe=new Array($),de=new Array($);let ge=0;const Pe=new Uint8Array(y.buffer);for(let X=0;X<$;X++){const U=X<J?ae:me;xe[X]=Pe.slice(Be,Be+U),de[X]=Ie.encode(xe[X]),Be+=U,ge=Math.max(ge,U)}const Te=new Uint8Array(R);let ue=0,Se,Z;for(Se=0;Se<ge;Se++)for(Z=0;Z<$;Z++)Se<xe[Z].length&&(Te[ue++]=xe[Z][Se]);for(Se=0;Se<se;Se++)for(Z=0;Z<$;Z++)Te[ue++]=de[Z][Se];return Te}function w(y,C,P,R){let M;if(Array.isArray(y))M=f.fromArray(y);else if(typeof y=="string"){let ve=C;if(!ve){const ae=f.rawSplit(y);ve=u.getBestVersionForData(ae,P)}M=f.fromString(y,ve||40)}else throw new Error("Invalid data");const D=u.getBestVersionForData(M,P);if(!D)throw new Error("The amount of data is too big to be stored in a QR Code");if(!C)C=D;else if(C<D)throw new Error(`
@@ -422,6 +422,6 @@ Minimum version required to store current data is: `+D+`.
422
422
  background-size: 120%;
423
423
  }
424
424
  }
425
- `,kX="Q*2D1AB4",Wie=ce("DialogPrintQR",ye({__name:"DialogPrintQR",props:{visible:{type:Boolean}},emits:["printed","update:visible"],setup(t,{emit:e}){const{setLoading:n}=Fi(),i=sr(),r=$r(),o=r==null?void 0:r.appContext.config.globalProperties.$htmlToPaper;bt(async()=>{d.value=await zC.toDataURL(kX)});const s=t,a=e,l=oe(),u=[{label:"Left (Default)",value:"left"},{label:"Right",value:"right"}],c=oe("left"),d=oe(""),f=re([]),p=W(()=>!l.value||l.value<1),h=W(()=>c.value==="left"?l.value&&l.value>2?4:2:l.value&&l.value>=2?4:2),m=async()=>{try{if(p.value)return;n(!0);const{data:k}=await Mf.postCreateQr(l.value);if(k){const A=k.data;for(const w of A){const y=w,C={code:y,url:await zC.toDataURL(y)};f.value.push(C)}setTimeout(()=>{v()},0)}}catch(k){i.add({error:k,message:"Error, failed to generate QR"})}finally{n(!1)}},v=async()=>{var w;const k=document.getElementById("print-container");if(k){const y=document.createElement("style");y.textContent=SX,k.appendChild(y),S("print-container")}await o("print-container",{specs:["fullscreen=yes","titlebar=no","scrollbars=no"],styles:["https://fonts.googleapis.com/css2?family=Manrope:wght@400&display=swap"],timeout:0,autoClose:!0}),a("printed"),b(),(w=k.querySelector("style"))==null||w.remove()},S=(k,A=!0)=>{const w=document.getElementById(k),y=w==null?void 0:w.querySelector('[data-style-name="print-qr-layout"]');if(A&&!y){const C=document.createElement("style");C.textContent=CX,C.setAttribute("data-style-name","print-qr-layout"),w==null||w.appendChild(C)}},b=()=>a("update:visible",!1);return Re(()=>s.visible,k=>{l.value=void 0,c.value="left",f.value=[],Pt(()=>{setTimeout(()=>{S("dialog-print-qr",k)},300)})}),(k,A)=>(g(),L(ur,{id:"dialog-print-qr",draggable:!1,visible:k.visible,"onUpdate:visible":A[3]||(A[3]=w=>a("update:visible",!!w)),class:"w-[400px]",closable:"","data-ts-name":"dialog-print-qr",header:"Print Label QR",modal:""},{default:z(()=>[I(T2,{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=w=>l.value=w),max:100,min:1,onInput:A[1]||(A[1]=w=>l.value=w),label:"Amount",mandatory:"",placeholder:"Input amount of label"},null,8,["modelValue"]),I(xl,{modelValue:c.value,"onUpdate:modelValue":A[2]||(A[2]=w=>c.value=w),options:u,label:"Start Print From","option-label":"label","option-value":"value"},null,8,["modelValue"]),p.value?N("",!0):(g(),T("div",tX,[E("div",nX,[A[4]||(A[4]=E("span",null,"Preview",-1)),I(Me,{icon:"info",info:`This preview is only for showing the side of the\r
425
+ `,kX="Q*2D1AB4",Wie=ce("DialogPrintQR",ye({__name:"DialogPrintQR",props:{visible:{type:Boolean}},emits:["printed","update:visible"],setup(t,{emit:e}){const{setLoading:n}=Fi(),i=sr(),r=$r(),o=r==null?void 0:r.appContext.config.globalProperties.$htmlToPaper;bt(async()=>{d.value=await zC.toDataURL(kX)});const s=t,a=e,l=oe(),u=[{label:"Left (Default)",value:"left"},{label:"Right",value:"right"}],c=oe("left"),d=oe(""),f=re([]),p=W(()=>!l.value||l.value<1),h=W(()=>c.value==="left"?l.value&&l.value>2?4:2:l.value&&l.value>=2?4:2),m=async()=>{try{if(p.value)return;n(!0);const{data:k}=await Mf.postCreateQr(l.value);if(k){const A=k.data;for(const w of A){const y=w,C={code:y,url:await zC.toDataURL(y)};f.value.push(C)}setTimeout(()=>{v()},0)}}catch(k){i.add({error:k,message:"Error, failed to generate QR"})}finally{n(!1)}},v=async()=>{var w;const k=document.getElementById("print-container");if(k){const y=document.createElement("style");y.textContent=SX,k.appendChild(y),S("print-container")}await o("print-container",{specs:["fullscreen=yes","titlebar=no","scrollbars=no"],styles:["https://fonts.googleapis.com/css2?family=Manrope:wght@400&display=swap"],timeout:0,autoClose:!0}),a("printed"),b(),(w=k.querySelector("style"))==null||w.remove()},S=(k,A=!0)=>{const w=document.getElementById(k),y=w==null?void 0:w.querySelector('[data-style-name="print-qr-layout"]');if(A&&!y){const C=document.createElement("style");C.textContent=CX,C.setAttribute("data-style-name","print-qr-layout"),w==null||w.appendChild(C)}},b=()=>a("update:visible",!1);return Re(()=>s.visible,k=>{l.value=void 0,c.value="left",f.value=[],Pt(()=>{setTimeout(()=>{S("dialog-print-qr",k)},300)})}),(k,A)=>(g(),L(ur,{id:"dialog-print-qr",draggable:!1,visible:k.visible,"onUpdate:visible":A[3]||(A[3]=w=>a("update:visible",!!w)),class:"w-[400px]",closable:"","data-ts-name":"dialog-print-qr",header:"Print Label QR",modal:""},{default:z(()=>[I(U3,{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=w=>l.value=w),max:100,min:1,onInput:A[1]||(A[1]=w=>l.value=w),label:"Amount",mandatory:"",placeholder:"Input amount of label"},null,8,["modelValue"]),I(xl,{modelValue:c.value,"onUpdate:modelValue":A[2]||(A[2]=w=>c.value=w),options:u,label:"Start Print From","option-label":"label","option-value":"value"},null,8,["modelValue"]),p.value?N("",!0):(g(),T("div",tX,[E("div",nX,[A[4]||(A[4]=E("span",null,"Preview",-1)),I(Me,{icon:"info",info:`This preview is only for showing the side of the\r
426
426
  label that printed or not. It does not show the\r
427
- exact amount you entered.`,severity:"primary"})]),E("div",iX,[E("div",rX,[(g(!0),T(le,null,_e(h.value,w=>(g(),T(le,{key:w},[c.value==="left"?(g(),T(le,{key:0},[l.value<w?(g(),T("img",{key:0,src:x(FC),alt:""},null,8,oX)):(g(),T("div",sX,[E("img",{src:x(Sv),alt:"",class:"logo",height:"14",width:"77"},null,8,aX),E("div",lX,[A[5]||(A[5]=E("span",{class:"text-code"},"Q*2D1AB4",-1)),E("span",{style:tr(`background-image: url(${d.value});`),class:"qr-code-wrapper"},null,4)])]))],64)):(g(),T(le,{key:1},[w===1||l.value<w-1?(g(),T("img",{key:0,src:x(FC),alt:""},null,8,uX)):(g(),T("div",cX,[E("img",{src:x(Sv),alt:"",class:"logo",height:"14",width:"77"},null,8,dX),E("div",fX,[A[6]||(A[6]=E("div",{class:"text-code"},"Q*2D1AB4",-1)),E("span",{style:tr(`background-image: url(${d.value});`),class:"qr-code-wrapper"},null,4)])]))],64))],64))),128))])]),A[7]||(A[7]=E("div",{class:"mt-3 flex w-100 h-[26px] bg-general-800 text-white text-xs font-medium justify-center items-center"}," Printer Side ",-1))])),E("div",pX,[E("div",hX," Label: "+_(l.value||0)+" pcs ",1),I(We,{disabled:!l.value||l.value<0,onClick:m,label:"Start Print"},null,8,["disabled"])]),E("div",mX,[E("div",gX,[E("div",vX,[c.value==="right"?(g(),T("div",yX)):N("",!0),(g(!0),T(le,null,_e(f.value,(w,y)=>(g(),T("div",{key:y,class:"box"},[E("img",{src:x(Sv),alt:"",class:"logo",height:"14",width:"77"},null,8,bX),E("div",AX,[E("span",wX,_(x(eX)(w.code)),1),E("span",{style:tr(`background-image: url(${w.url});`),class:"qr-code-wrapper"},null,4)])]))),128))])])])]),_:1},8,["visible"]))}})),OX=()=>[{field:"assets.name.nameWithSequence",header:"Name",sortable:!0,fixed:!0,bodyTemplate(t){var e,n;return((n=(e=t==null?void 0:t.assets)==null?void 0:e.name)==null?void 0:n.nameWithSequence)??"-"}},{field:"assets.group.name",header:"Group",sortable:!0,fixed:!0,bodyComponent(t){var e,n;return{component:Lt,props:{label:((n=(e=t==null?void 0:t.assets)==null?void 0:e.group)==null?void 0:n.name)??"-",severity:"primary",format:"nowrap"}}}},{field:"assets.status",header:"Asset Status",sortable:!0,fixed:!0,bodyComponent(t){var n,i;let e;switch((n=t==null?void 0:t.assets)==null?void 0:n.status){case"Available":e="success";break;case"On Disposal Process":case"Reported Disposal":e="secondary";break;case"Damaged":case"Missing":case"Not Paired Yet":case"TAG Reported":e="danger";break;case"On Borrowing Process":case"On Assign Process":case"Borrowed":case"Assigned":e="primary";break;case"On Transfer":e="warning";break;default:e="primary";break}return{component:Lt,props:{severity:e,format:"nowrap",label:((i=t==null?void 0:t.assets)==null?void 0:i.status)??"-"}}}},{field:"assets.maintenanceStatus",header:"Maintenance",sortable:!0,fixed:!1,bodyComponent(t){var e;return{component:Lt,props:{severity:"warning",format:"nowrap",label:(e=t==null?void 0:t.assets)==null?void 0:e.maintenanceStatus}}}},{field:"assets.auditStatus",header:"Audit",sortable:!0,fixed:!1,bodyComponent(t){var e;return{component:Lt,props:{severity:"warning",format:"nowrap",label:(e=t==null?void 0:t.assets)==null?void 0:e.auditStatus}}}}],TX=["Available","Borrowed","On Borrowing Process","Assigned","On Assign Process","On Transfer","Damaged","Missing","On Disposal Process","Reported Disposal","Not Paired Yet","TAG Reported"],xX=["In Maintenance","In Audit","None"],MX=[{label:"Group",field:"group",type:"group"},{type:"multiselect",field:"status",label:"Asset Status",placeholder:"Select status",fetchOptionFn:()=>TX.map(t=>({label:t,value:t}))},{type:"multiselect",field:"maintenanceAuditStatus",label:"In Maintenance / Audit",placeholder:"Select status",fetchOptionFn:()=>xX.map(t=>({label:t,value:t}))}],EX={class:"flex flex-col gap-2"},PX={class:"flex items-center gap-1","data-ts-section":"dialog-asset-name-detail-action-group"},IX={class:"flex items-center gap-3 text-body-medium mr-auto"},LX={class:"font-bold"},qie=ce("DialogAssetNameDetail",ye({__name:"DialogAssetNameDetail",props:{header:{default:"Asset Name Detail"},id:{},params:{},visible:{type:Boolean}},emits:["update:visible"],setup(t,{emit:e}){const n=sr(),i=t,r=e,o=OX(),s=W(()=>i.visible),a=oe("dialog-asset-name-detail-table"),l=re(),u=async()=>{try{const{data:d}=await Ef.getAssetNameDetail(i.id);l.value=d.data}catch(d){n.add({error:d,message:"Error, failed to load asset name detail"})}},c=async d=>{var f,p;try{const h=i.params?{...d,...i.params}:d,{data:m}=await Ef.getAssetsByAssetName(i.id,{...h,maintenanceAuditStatus:h!=null&&h.maintenanceAuditStatus?h==null?void 0:h.maintenanceAuditStatus:JSON.stringify(["In Maintenance","In Audit","None"])});if(m){const v=(p=(f=m==null?void 0:m.data)==null?void 0:f.data)==null?void 0:p.map((S,b)=>({...S,index:b}));return{message:m.message,data:{data:v,totalRecords:m.data.totalRecords}}}}catch(h){n.add({error:h,message:"Error, failed to load assets"})}};return(d,f)=>(g(),L(ur,{visible:s.value,"onUpdate:visible":[f[0]||(f[0]=p=>s.value=p),f[1]||(f[1]=p=>r("update:visible",!!p))],draggable:!1,header:d.header,onShow:u,class:"w-[800px]",closable:"","data-ts-name":"dialog-asset-name-detail",modal:""},{default:z(()=>{var p,h;return[E("div",EX,[E("div",PX,[E("div",IX,[E("span",LX,_(((p=l.value)==null?void 0:p.name)??"-"),1),E("span",null,"TAG: "+_(((h=l.value)==null?void 0:h.tagType)??"-")+" TAG",1)]),I(ih,{"table-name":a.value},null,8,["table-name"]),I(eh,{"table-name":a.value},null,8,["table-name"])]),I(Jg,{fields:x(MX),"table-name":a.value},null,8,["fields","table-name"]),I(Ph,{columns:x(o),"fetch-function":c,rows:10,"table-name":a.value,"use-option":!1,"data-key":"index",lazy:"","selection-type":"none","use-paginator":""},null,8,["columns","table-name"])])]}),_:1},8,["visible","header"]))}})),DX={class:"flex flex-col gap-3"},RX=ce("DialogReportTag",ye({__name:"DialogReportTag",props:{id:{},tagReported:{},visible:{type:Boolean},successMessage:{},submitLabel:{},submitWithoutApi:{type:Boolean},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(t,{emit:e}){const{setLoading:n}=Fi(),i=sr(),r=t,o=e,s=W(()=>r.visible),a=W(()=>{var p,h,m,v,S,b,k,A,w,y,C,P,R,M,D,$,q,J,ve,ae,me,se;const d=(p=r.tagReported)==null?void 0:p.rfid,f=(h=r.tagReported)==null?void 0:h.qr;return[{label:"RFID TAG",value:"RFID",visible:((v=(m=l.value)==null?void 0:m.asset)==null?void 0:v.rfid)&&!d&&!((k=(b=(S=l.value)==null?void 0:S.asset)==null?void 0:b.tagReported)!=null&&k.rfid)},{label:"QR TAG",value:"QR",visible:((w=(A=l.value)==null?void 0:A.asset)==null?void 0:w.qr)&&!f&&!((P=(C=(y=l.value)==null?void 0:y.asset)==null?void 0:C.tagReported)!=null&&P.qr)},{label:"RFID & QR TAG",value:"RFID & QR",visible:((M=(R=l.value)==null?void 0:R.asset)==null?void 0:M.rfid)&&(($=(D=l.value)==null?void 0:D.asset)==null?void 0:$.qr)&&!d&&!((ve=(J=(q=l.value)==null?void 0:q.asset)==null?void 0:J.tagReported)!=null&&ve.rfid)&&!f&&!((se=(me=(ae=l.value)==null?void 0:ae.asset)==null?void 0:me.tagReported)!=null&&se.qr)}].filter(Ie=>Ie.visible)}),l=re(),u=async d=>{try{n(!0);const p={RFID:{qr:!1,rfid:!0},QR:{qr:!0,rfid:!1},"RFID & QR":{qr:!0,rfid:!0}}[d.formValues.tagType],h="Success, TAG has been reported.";if(r.submitWithoutApi)i.add({message:r.successMessage??h}),o("reported",p),o("update:visible",!1);else if(r.submitFunction)await r.submitFunction(p)&&(i.add({message:r.successMessage??h}),o("reported",p),o("update:visible",!1));else{const{data:m}=await Mf.putReportTAG(r.id,p);m&&(i.add({message:r.successMessage??h}),o("reported",p),o("update:visible",!1))}}catch(f){i.add({error:f,message:"Error, failed to report TAG."})}finally{n(!1)}},c=W(()=>{var d,f,p,h,m;return((d=a.value)==null?void 0:d.length)>1&&((p=(f=l.value)==null?void 0:f.asset)==null?void 0:p.tagType)==="RFID & QR"?"RFID & QR":(m=(h=a.value)==null?void 0:h[0])==null?void 0:m.value});return(d,f)=>(g(),L(Ih,{visible:s.value,"onUpdate:visible":f[0]||(f[0]=p=>s.value=p),"action-label":r.submitLabel??"Submit","buttons-template":["cancel","submit"],"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:f[1]||(f[1]=p=>o("update:visible",!1)),action:"Submit",closable:"","data-ts-name":"report-tag",header:"Report TAG",width:"large"},{confirm:z(p=>{var h,m,v;return[I(cr,{lists:[(v=(m=(h=l.value)==null?void 0:h.asset)==null?void 0:m.name)==null?void 0:v.nameWithSequence],visible:p.visible,onConfirm:S=>p.submit(u),"onUpdate:visible":S=>!S&&p.hide(),body:"Are you sure want to report it?","confirm-label":"Report","data-ts-section":"confirm-dialog",header:"Report TAG",severity:"danger"},null,8,["lists","visible","onConfirm","onUpdate:visible"])]}),fields:z(()=>{var p;return[E("div",DX,[I($u,{id:r.id,ref_key:"assetInfo",ref:l},null,8,["id"]),(p=l.value)!=null&&p.asset?(g(),L(xl,{key:0,disabled:a.value.length<=1,"initial-value":c.value,options:a.value,"data-ts-section":"reported-tag-dropdown","field-info":"Reported TAG will be mark a damaged / missing TAG","field-name":"tagType",label:"Reported TAG",mandatory:"","option-label":"label","option-value":"value",placeholder:"Select TAG","use-validator":""},null,8,["disabled","initial-value","options"])):N("",!0)])]}),_:1},8,["visible","action-label"]))}})),NX={class:"font-bold"},BX={class:"flex flex-col gap-3"},$X={key:0,class:"flex flex-col gap-3"},VX={key:0,class:"flex items-center gap-3"},zX={class:"flex"},FX={key:0,class:"flex mr-1"},Xie=ce("DialogReportDamage",ye({__name:"DialogReportDamage",props:{id:{},reportSource:{},visible:{type:Boolean},byUser:{type:Boolean},successMessage:{},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(t,{emit:e}){const n=t,i=e,{plan:r}=JSON.parse(localStorage.getItem("user")??"{}"),{setLoading:o}=Fi(),s=sr(),a=W(()=>n.visible),l=W(()=>{var w,y,C,P;return((y=(w=c.value)==null?void 0:w.asset)==null?void 0:y.rfid)||((P=(C=c.value)==null?void 0:C.asset)==null?void 0:P.qr)}),u=re(),c=re(),d=oe(!1),f=oe(!1),p=oe(),h=W(()=>{var w,y;return((y=(w=c.value)==null?void 0:w.asset)==null?void 0:y.tagReported)??{}}),m=W(()=>{var R,M,D,$,q,J;const w=(R=h.value)==null?void 0:R.qr,y=(M=h.value)==null?void 0:M.rfid,C=!!(($=(D=c.value)==null?void 0:D.asset)!=null&&$.qr),P=!!((J=(q=c.value)==null?void 0:q.asset)!=null&&J.rfid);return(!y&&!w||!w&&C||!y&&P)&&!f.value}),v=W(()=>{const{qr:w,rfid:y}=h.value??{};return w&&y?"RFID & QR Reported":y?"RFID Reported":w?"QR Reported":""}),S=async w=>{try{o(!0);const y={notes:w.formValues.notes,image:w.formValues.image,reportSource:n.reportSource,serialNumber:p.value},C="Success, damaged asset report has been submitted.";if(n.submitFunction)await n.submitFunction(y)&&(s.add({message:n.successMessage??C}),i("reported"),A());else{const{data:P}=await Pf.putReportDamage(n.id,y);P&&(s.add({message:n.successMessage??C}),i("reported"),A())}}catch(y){s.add({error:y,message:"Error, failed to report damaged asset."})}finally{o(!1)}},b=async(w,y,C)=>{var P;try{const{data:R}=await uo.matchAssetWithTag(n.id,y);return p.value=C,(P=R==null?void 0:R.data)!=null&&P.totalRecords?!0:(s.add({severity:"error",message:"Error, failed to verify. TAG doesn't match.",group:"scan-error-validation"}),!1)}catch(R){s.add({error:R,message:"Error, failed to verify. TAG doesn't match.",group:"scan-error-validation"})}return!1},k=()=>{d.value=!0,A()},A=()=>{i("update:visible",!1)};return Re(a,()=>{f.value=!!n.byUser,p.value=void 0}),Re(f,w=>{var y;w||(y=u.value.form)==null||y.clearField()}),(w,y)=>(g(),T(le,null,[I(Ih,{ref_key:"dialogForm",ref:u,visible:a.value,"onUpdate:visible":y[2]||(y[2]=C=>a.value=C),"buttons-template":["cancel","submit"],"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:A,action:"Submit",closable:"","data-ts-name":"report-damage",header:"Report Damage",width:"large"},{confirm:z(C=>[I(cr,{visible:C.visible,onConfirm:P=>C.submit(S),"onUpdate:visible":P=>!P&&C.hide(),body:"Are you sure want to continue?","confirm-label":"Continue","data-ts-section":"confirm-dialog",header:"Report Damaged Asset",severity:"danger"},{body:z(()=>{var P,R,M;return[E("p",null,[E("span",NX,_(((M=(R=(P=c.value)==null?void 0:P.asset)==null?void 0:R.name)==null?void 0:M.nameWithSequence)??"-"),1),y[5]||(y[5]=ht(" will be reported as damaged asset. "))]),y[6]||(y[6]=E("p",null,"Are you sure want to continue?",-1))]}),_:2},1032,["visible","onConfirm","onUpdate:visible"])]),fields:z(()=>{var C,P,R,M,D;return[E("div",BX,[I($u,{id:n.id,ref_key:"assetInfo",ref:c,"use-tag-type":x(Jf)()!=="Basic"},null,8,["id","use-tag-type"]),(C=c.value)!=null&&C.asset?(g(),T("div",$X,[!n.byUser&&l.value&&x(r)!=="Basic"?(g(),T("div",VX,[E("div",zX,[(R=(P=c.value)==null?void 0:P.asset)!=null&&R.rfid?(g(),T("div",FX,[I(kc,{disabled:h.value.rfid,"scan-validation":b,onScan:y[0]||(y[0]=$=>f.value=!0),size:"small"},null,8,["disabled"]),I(Me,{class:"w-[13.33px] h-[13.33px]",icon:"info",info:"Use short range scanner to verify asset",severity:"primary"})])):N("",!0),(D=(M=c.value)==null?void 0:M.asset)!=null&&D.qr?(g(),L(kc,{key:1,disabled:h.value.qr,"scan-validation":b,onScan:y[1]||(y[1]=$=>f.value=!0),size:"small",type:"QR"},null,8,["disabled"])):N("",!0)]),I(Lt,{label:f.value?"Verified":"Unverified",severity:f.value?"success":"warning"},null,8,["label","severity"]),v.value?(g(),L(Lt,{key:0,label:v.value,format:"nowrap",severity:"danger"},null,8,["label"])):N("",!0),m.value?(g(),L(We,{key:1,onClick:k,label:"Report TAG",text:""})):N("",!0)])):N("",!0),I(ca,{"data-ts-section":"condition-input",disabled:"",label:"Condition",mandatory:"","use-validator":"",value:"Damaged"}),I(MN,{disabled:!f.value&&l.value,"data-ts-section":"photo-input","field-name":"image","file-type":"jpeg",label:"Photo",mandatory:"","use-validator":""},null,8,["disabled"]),I(zc,{"custom-validation":{empty:"Note must not be empty"},disabled:!f.value&&l.value,"max-input":120,rows:3,"data-ts-section":"notes-input","field-name":"notes","input-class":"!min-h-[67px]",label:"Note",mandatory:"",placeholder:"Enter note","use-validator":""},null,8,["disabled"])])):N("",!0)])]}),_:1},8,["visible"]),I(RX,{id:n.id,visible:d.value,"onUpdate:visible":y[3]||(y[3]=C=>d.value=C),onReported:y[4]||(y[4]=C=>i("reported"))},null,8,["id","visible"])],64))}})),jX={class:"font-bold"},HX={class:"flex flex-col gap-3"},Gie=ce("DialogReportMissing",ye({__name:"DialogReportMissing",props:{id:{},reportSource:{},trackingId:{},visible:{type:Boolean},permanentlyMissing:{type:Boolean},successMessage:{},submitWithoutApi:{type:Boolean},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(t,{emit:e}){const n=t,i=e,{setLoading:r}=Fi(),o=sr(),s=W(()=>n.visible),a=W(()=>n.permanentlyMissing?"Report Permanently Missing":"Report Missing"),l=W(()=>n.permanentlyMissing?"Report as Permanenly Missing":"Report Missing Asset"),u=re(),c=async d=>{try{r(!0);const f={notes:d.formValues.notes,reportSource:n.reportSource},p=n.permanentlyMissing?"Success, asset has been reported as permanently missing.":"Success, missing asset has been reported.";if(n.submitWithoutApi)o.add({message:n.successMessage??p}),i("reported",f),i("update:visible",!1);else if(n.submitFunction)await n.submitFunction(f)&&(o.add({message:n.successMessage??p}),i("reported"),i("update:visible",!1));else{const{data:h}=n.permanentlyMissing?await Pv.putReportPermanentlyMissing(n.trackingId??"",f):await Iv.putReportMissing(n.id,f);h&&(o.add({message:n.successMessage??p}),i("reported"),i("update:visible",!1))}}catch(f){const p=n.permanentlyMissing?"Error, failed to report asset as permanently missing.":"Error, failed to report missing asset.";o.add({error:f,message:p})}finally{r(!1)}};return(d,f)=>(g(),L(Ih,{visible:s.value,"onUpdate:visible":f[0]||(f[0]=p=>s.value=p),"buttons-template":["cancel","submit"],header:a.value,"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:f[1]||(f[1]=p=>i("update:visible",!1)),action:"Submit",closable:"","data-ts-name":"report-missing",width:"large"},{confirm:z(p=>[I(cr,{header:l.value,visible:p.visible,onConfirm:h=>p.submit(c),"onUpdate:visible":h=>!h&&p.hide(),"confirm-label":"Report","data-ts-section":"confirm-dialog",severity:"danger"},{body:z(()=>{var h,m,v;return[E("p",null,[E("span",jX,_(((v=(m=(h=u.value)==null?void 0:h.asset)==null?void 0:m.name)==null?void 0:v.nameWithSequence)??"-"),1),ht(" will be reported as "+_(n.permanentlyMissing?"permanently missing asset":"missing asset")+". ",1)]),f[2]||(f[2]=E("p",null,"Are you sure you want to report it?",-1))]}),_:2},1032,["header","visible","onConfirm","onUpdate:visible"])]),fields:z(()=>[E("div",HX,[(g(),L($u,{id:n.id,key:n.id,ref_key:"assetInfo",ref:u,"use-tag-type":x(Jf)()!=="Basic"},null,8,["id","use-tag-type"])),I(zc,{"custom-validation":{empty:"Note must not be empty"},"max-input":120,rows:3,"data-ts-section":"notes-input","field-name":"notes","input-class":"!min-h-[67px]",label:"Note",mandatory:"",placeholder:"Enter note","use-validator":""})])]),_:1},8,["visible","header"]))}})),{plan:UX}=JSON.parse(localStorage.getItem("user")??"{}"),KX=()=>UX==="Basic",WX={class:"w-full flex items-center justify-between pr-4"},qX={class:"flex items-center gap-2"},XX={key:0,class:"flex flex-col gap-3"},GX={class:"flex justify-between items-center"},ZX={class:"flex items-center gap-1"},_X={class:"flex items-center gap-0.5"},JX={class:"flex items-center gap-0.5"},YX={class:"flex items-center gap-2"},QX={key:0,class:"flex flex-row items-center gap-1"},eG={key:1,class:"flex flex-col gap-1"},tG={class:"flex flex-row items-center gap-1"},nG={key:2,class:"flex flex-row items-center gap-1"},iG={class:"text-xs font-medium text-general-400"},rG={key:1,class:"text-xs font-medium"},oG=ye({__name:"DialogBasicTransferLog",props:Cn({id:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const e=t,n=si(t,"visible"),i=vo(),r=re(),o=re(),s=re(),a=re(0),l=dt("requestIds")??re([]),u=W(()=>{var S;return(S=l.value)!=null&&S.length?l.value.findIndex(b=>s.value===b):-1}),c=W(()=>{var S,b;return(S=l.value)!=null&&S.length?s.value===((b=l.value)==null?void 0:b[0]):!1}),d=W(()=>{var S,b,k;return(S=l.value)!=null&&S.length?s.value===((k=l.value)==null?void 0:k[((b=l.value)==null?void 0:b.length)-1]):!1}),f=W(()=>{var S;return(S=o.value)==null?void 0:S.map(b=>({_id:b.id,action:b.action,createdAt:b.updatedAt,title:b.action+" by",date:b.updatedAt,username:b.userFullName,body:b.action==="Handed over"?void 0:h(b.detail),detail:b.action==="Handed over"?void 0:h(b.detail)}))}),p=S=>{switch(S){case"Rejected":case"Reported Missing":return"danger";case"Waiting for Approval":case"Waiting for Handover":return"warning";case"Completed":case"Approved":return"success";default:return"primary"}},h=S=>{if(!S||!Object.keys(S).length)return;const b={},k=Object.keys(S);for(const A of k){const w=A.replace(/([A-Z])/g," $1"),y=w.charAt(0).toUpperCase()+w.slice(1);b[y==="Notes"?"Note":y]=S[A]??"-"}return b},m=async()=>{var S;if((S=s.value)!=null&&S.length)try{const{data:b}=await If.getTransactionLog(s.value);b&&(r.value=b.data.request,o.value=b.data.logs,a.value++)}catch(b){i.add({error:b,message:"Error, failed to load transfer transaction log"})}},v=S=>{if(u.value===-1||S==="prev"&&c.value||S==="next"&&d.value)return;const b=S==="prev"?u.value-1:u.value+1;s.value=l.value[b]};return Re(n,S=>{S&&(s.value=e.id)}),Re(s,S=>{S&&m()}),(S,b)=>(g(),L(ur,{visible:n.value,"onUpdate:visible":b[2]||(b[2]=k=>n.value=k),draggable:!1,class:"!w-[600px]","footer-class":"flex items-end justify-end gap-1",header:"Transfer Log",modal:""},{header:z(()=>[E("div",WX,[b[3]||(b[3]=E("div",{class:"flex gap-3 items-center"},[E("span",{class:"text-sm font-bold"},"Transfer Log")],-1)),E("div",qX,[I(We,{disabled:c.value,onClick:b[0]||(b[0]=k=>v("prev")),class:"!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",label:"<Prev",text:""},null,8,["disabled"]),I(We,{disabled:d.value,onClick:b[1]||(b[1]=k=>v("next")),class:"!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",label:"Next>",text:""},null,8,["disabled"])])])]),default:z(()=>{var k,A,w;return[r.value?(g(),T("div",XX,[(g(),L($u,{id:r.value.asset,key:r.value.asset,fields:["brand","model","group"],"use-nfc":!1,"use-tag-type":!1},null,8,["id"])),E("div",GX,[E("div",ZX,[E("div",_X,[b[4]||(b[4]=E("span",null,"Origin:",-1)),I(Lt,{label:(k=r.value.originGroup)==null?void 0:k.name},null,8,["label"])]),I(sC,{user:{...r.value.manager,fullName:(A=r.value.manager)==null?void 0:A.fullName}},null,8,["user"])]),E("div",JX,[b[5]||(b[5]=E("span",null,"Destination:",-1)),I(Lt,{label:(w=r.value.destinationGroup)==null?void 0:w.name},null,8,["label"])])]),E("div",YX,[b[6]||(b[6]=E("span",null,"Status:",-1)),I(Lt,{label:r.value.status,severity:p(r.value.status),format:"nowrap"},null,8,["label","severity"])]),I(em,{"active-index":0,menu:[{label:"Transfer Log"}],type:"tab"}),(g(),L(_g,{key:a.value,value:f.value},{detail:z(y=>[y.key==="To"?(g(),T("div",QX,[b[7]||(b[7]=E("span",{class:"text-xs font-medium text-general-400"}," Destination Group: ",-1)),I(Lt,{label:y.value},null,8,["label"])])):y.key==="From"?(g(),T("div",eG,[E("div",tG,[b[8]||(b[8]=E("span",{class:"text-xs font-medium text-general-400"}," Destination Group: ",-1)),I(Lt,{label:y.value},null,8,["label"])]),I(Me,{class:"!text-general-800 !text-xs -rotate-90",icon:"arrow-left"})])):(g(),T("div",nG,[E("span",iG,_(y.key)+": ",1),y.key.includes("Group")?(g(),L(Lt,{key:0,label:y.value},null,8,["label"])):(g(),T("span",rG,_(y.value),1))]))]),_:1},8,["value"]))])):N("",!0)]}),_:1},8,["visible"]))}}),sG={class:"w-full flex items-center justify-between pr-4"},aG={class:"flex gap-3 items-center"},lG={class:"flex gap-1 items-center"},uG={class:"text-xs font-medium"},cG={class:"flex items-center gap-2"},dG={key:0,class:"flex flex-col gap-3"},fG={class:"flex justify-between items-center"},pG={class:"flex items-center gap-1"},hG={class:"flex items-center gap-0.5"},mG={class:"flex items-center gap-0.5"},gG={class:"flex items-center gap-2"},vG={key:0,class:"flex flex-row items-center gap-1"},yG={key:1,class:"flex flex-col gap-1"},bG={class:"flex flex-row items-center gap-1"},AG={key:2,class:"flex flex-row items-center gap-1"},wG={class:"text-xs font-medium text-general-400"},SG={key:1,class:"text-xs font-medium"},CG=ye({__name:"DialogFullTransferLog",props:Cn({id:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const e=t,n=si(t,"visible"),i=vo();bt(()=>{window.Cypress&&(l.value=["66406b090d664c625212ac1a","66406b090d664c625212ac22"])});const r=re(),o=re(),s=re(),a=re(0),l=dt("requestIds")??re([]),u=W(()=>{var S;return(S=l.value)!=null&&S.length?l.value.findIndex(b=>s.value===b):-1}),c=W(()=>{var S,b;return(S=l.value)!=null&&S.length?s.value===((b=l.value)==null?void 0:b[0]):!1}),d=W(()=>{var S,b,k;return(S=l.value)!=null&&S.length?s.value===((k=l.value)==null?void 0:k[((b=l.value)==null?void 0:b.length)-1]):!1}),f=W(()=>{var S;return(S=o.value)==null?void 0:S.map(b=>({_id:b._id,action:b.action,createdAt:b.updatedAt,title:b.action+" by",date:b.updatedAt,username:b.userFullName,body:b.action==="Handed over"?void 0:h(b.detail),detail:b.action==="Handed over"?void 0:h(b.detail)}))}),p=S=>{switch(S){case"Rejected":case"Reported Missing":return"danger";case"Waiting for Approval":case"Waiting for Handover":return"warning";case"Completed":case"Approved":return"success";default:return"primary"}},h=S=>{if(!S||!Object.keys(S).length)return;const b={},k=Object.keys(S);for(const A of k){const w=A.replace(/([A-Z])/g," $1"),y=w.charAt(0).toUpperCase()+w.slice(1);b[y==="Notes"?"Note":y]=S[A]??"-"}return b},m=async()=>{var S;if((S=s.value)!=null&&S.length)try{const{data:b}=await If.getTransactionLog(s.value);b&&(r.value=b.data.request,o.value=b.data.logs,a.value++)}catch(b){i.add({error:b,message:"Error, failed to load transfer transaction log"})}},v=S=>{if(u.value===-1||S==="prev"&&c.value||S==="next"&&d.value)return;const b=S==="prev"?u.value-1:u.value+1;s.value=l.value[b]};return Re(n,S=>{S&&(s.value=e.id)}),Re(s,S=>{S&&m()}),(S,b)=>(g(),L(ur,{visible:n.value,"onUpdate:visible":b[2]||(b[2]=k=>n.value=k),draggable:!1,class:"!w-[600px]","footer-class":"flex items-end justify-end gap-1",header:"Transfer Log",modal:""},{header:z(()=>{var k,A;return[E("div",sG,[E("div",aG,[b[3]||(b[3]=E("span",{class:"text-sm font-bold"},"Transfer Log",-1)),E("div",lG,[E("span",uG,_(((k=r.value)==null?void 0:k.transactionId)??"-"),1),I(pE,{text:((A=r.value)==null?void 0:A.transactionId)??""},null,8,["text"])])]),E("div",cG,[I(We,{disabled:c.value,onClick:b[0]||(b[0]=w=>v("prev")),class:"!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",label:"<Prev",text:""},null,8,["disabled"]),I(We,{disabled:d.value,onClick:b[1]||(b[1]=w=>v("next")),class:"!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",label:"Next>",text:""},null,8,["disabled"])])])]}),default:z(()=>{var k,A,w;return[r.value?(g(),T("div",dG,[(g(),L($u,{id:r.value.asset,key:r.value.asset,fields:["brand","model"]},null,8,["id"])),E("div",fG,[E("div",pG,[E("div",hG,[b[4]||(b[4]=E("span",null,"Origin:",-1)),I(Lt,{label:(k=r.value.originGroup)==null?void 0:k.name},null,8,["label"])]),I(sC,{user:{...r.value.manager,fullName:(A=r.value.manager)==null?void 0:A.fullName}},null,8,["user"])]),E("div",mG,[b[5]||(b[5]=E("span",null,"Destination:",-1)),I(Lt,{label:(w=r.value.destinationGroup)==null?void 0:w.name},null,8,["label"])])]),E("div",gG,[b[6]||(b[6]=E("span",null,"Status:",-1)),I(Lt,{label:r.value.status,severity:p(r.value.status),format:"nowrap"},null,8,["label","severity"])]),I(em,{"active-index":0,menu:[{label:"Transfer Log"}],type:"tab"}),(g(),L(_g,{key:a.value,value:f.value},{detail:z(y=>[y.key==="To"?(g(),T("div",vG,[b[7]||(b[7]=E("span",{class:"text-xs font-medium text-general-400"}," Destination Group: ",-1)),I(Lt,{label:y.value},null,8,["label"])])):y.key==="From"?(g(),T("div",yG,[E("div",bG,[b[8]||(b[8]=E("span",{class:"text-xs font-medium text-general-400"}," Destination Group: ",-1)),I(Lt,{label:y.value},null,8,["label"])]),I(Me,{class:"!text-general-800 !text-xs -rotate-90",icon:"arrow-left"})])):(g(),T("div",AG,[E("span",wG,_(y.key)+": ",1),y.key.includes("Group")?(g(),L(Lt,{key:0,label:y.value},null,8,["label"])):(g(),T("span",SG,_(y.value),1))]))]),_:1},8,["value"]))])):N("",!0)]}),_:1},8,["visible"]))}}),Zie=ce("DialogTransferLog",ye({__name:"DialogTransferLog",props:Cn({id:{},visible:{type:Boolean}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const e=si(t,"visible");return(n,i)=>x(KX)()?(g(),L(oG,{key:0,id:n.id,visible:e.value,"onUpdate:visible":i[0]||(i[0]=r=>e.value=r)},null,8,["id","visible"])):(g(),L(CG,{key:1,id:n.id,visible:e.value,"onUpdate:visible":i[1]||(i[1]=r=>e.value=r)},null,8,["id","visible"]))}})),kG={class:"w-full flex items-center justify-between"},OG={class:"flex items-center gap-2"},TG=["disabled"],xG=["disabled"],MG={class:"flex items-start gap-[18px]"},EG={class:"flex flex-col w-full"},PG={class:"w-full flex items-center justify-between"},IG={class:"text-body-medium !font-bold"},LG={class:"flex items-center gap-[6px] text-general-400"},DG={class:"flex gap-3 w-full mt-[6px]"},RG={class:"flex flex-col gap-1 items-start self-stretch"},NG={class:"flex gap-2"},BG=["data-wv-section"],$G={class:"text-body-medium text-general-400","data-wv-section":"key"},VG={key:1,class:"text-body-medium"},_ie=ce("DialogDamageLog",ye({__name:"DialogDamageLog",props:Cn({id:{},listId:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:Cn(["prev","next"],["update:modelValue"]),setup(t,{emit:e}){const n=t,i=e,r=si(t,"modelValue"),o=sr(),{setLoading:s}=Fi(),a=re(),l=re(0),u=re(0),c=W(()=>n.listId),d=[{label:"Damage Log"}],f=re([]),p=W(()=>{var C,P;switch((P=(C=a.value)==null?void 0:C.request)==null?void 0:P.status){case"Damaged":return"danger";case"Repaired":return"success";default:return"dark"}}),h=async C=>(k(C),await m(l.value)),m=async C=>{var P;try{s(!0);const{data:R}=await Pf.getDamageReportDetail(c.value[C]);a.value=R.data,f.value=b((P=a.value)==null?void 0:P.logs),u.value++}catch(R){o.add({error:R,message:"Error, failed to fetch damage detail."})}finally{s(!1)}},v=C=>{switch(C){case"Reported Damaged":return"Reported damaged by";case"Reported Disposal":return"Reported disposal by";case"Repaired":return"Marked as repaired asset by";case"Disposal Report Canceled":return"Reported disposal canceled by";case"Disposal Report Declined":return"Reported disposal declined by";case"Disposed":return"Asset has been disposed";default:return""}},S=(C,P)=>{switch(C){case"Reported Damaged":return{Note:(P==null?void 0:P.notes)??"-","Damaged Photo":(P==null?void 0:P.damagedPhotoBig)??(P==null?void 0:P.damagedPhoto),Source:(P==null?void 0:P.reportSource)??"-"};case"Reported Disposal":return{Note:(P==null?void 0:P.notes)??"-"}}},b=C=>C.map(P=>({_id:P._id,action:v(P.action),date:P.createdAt,username:P.userFullName,danger:!1,detail:S(P.action,P.detail),createdAt:P.createdAt})),k=C=>{var R;const P=(R=n.listId)==null?void 0:R.findIndex(M=>M===C);l.value=P},A=()=>{l.value++,i("next",l.value)},w=()=>{l.value--,i("prev",l.value)},y=()=>{var C,P;Js(`/assets/detail/${(P=(C=a.value)==null?void 0:C.request)==null?void 0:P.asset}`)};return Re(()=>l.value,C=>{m(C)}),(C,P)=>(g(),L(ur,{visible:r.value,"onUpdate:visible":P[0]||(P[0]=R=>r.value=R),onShow:P[1]||(P[1]=R=>h(C.id)),class:"w-[600px]",modal:""},{header:z(()=>[E("div",kG,[P[2]||(P[2]=E("h1",{class:"!text-base font-bold"},"Damage Log",-1)),E("div",OG,[E("button",{class:pe([l.value===0?"text-general-100":"text-primary","text-xs font-medium"]),disabled:l.value===0,onClick:w,"data-wv-section":"prev-button"}," <Prev ",10,TG),E("button",{class:pe([l.value===c.value.length-1||c.value.length===1?"text-general-100":"text-primary","text-xs font-medium"]),disabled:l.value===c.value.length-1||c.value.length===1,onClick:A,"data-wv-section":"next-button"}," Next> ",10,xG)])])]),default:z(()=>{var R,M,D,$,q,J,ve,ae,me,se,Ie,Be,xe,de,ge,Pe,Te,ue,Se,Z,X,U,Y,ke,Fe,H,he,De,nt;return[E("div",MG,[I(Ar,{src:(M=(R=a.value)==null?void 0:R.request)==null?void 0:M.assetImageBig,size:"big"},null,8,["src"]),E("div",EG,[E("div",PG,[E("p",IG,_((q=($=(D=a.value)==null?void 0:D.request)==null?void 0:$.assetName)==null?void 0:q.nameWithSequence),1),E("button",{onClick:y,class:"!text-xs font-medium !text-primary-500","data-wv-section":"detail-button"}," Asset Detail > ")]),E("div",LG,[E("p",null,_(((ve=(J=a.value)==null?void 0:J.request)==null?void 0:ve.assetId)??"-")+" "+_((Ie=(se=(me=(ae=a.value)==null?void 0:ae.request)==null?void 0:me.assetName)==null?void 0:se.aliasCode)!=null&&Ie.length?`(${(de=(xe=(Be=a.value)==null?void 0:Be.request)==null?void 0:xe.assetName)==null?void 0:de.aliasCode})`:""),1),x(Jf)()==="Enterprise"?(g(),T(le,{key:0},[P[3]||(P[3]=E("div",{class:"w-[6px] h-[6px] bg-general-100 rounded"},null,-1)),(Pe=(ge=a.value)==null?void 0:ge.request)!=null&&Pe.tagType?(g(),L(F2,{key:0,type:(ue=(Te=a.value)==null?void 0:Te.request)==null?void 0:ue.tagType},null,8,["type"])):N("",!0)],64)):N("",!0)]),E("div",DG,[P[4]||(P[4]=E("div",{class:"flex flex-col justify-between items-start self-stretch"},[E("p",null,"Brand"),E("p",null,"Model/Type"),E("p",null,"Group")],-1)),P[5]||(P[5]=E("div",{class:"flex flex-col justify-between items-start self-stretch"},[E("p",null,":"),E("p",null,":"),E("p",null,":")],-1)),E("div",RG,[I(Lt,{label:(X=(Z=(Se=a.value)==null?void 0:Se.request)==null?void 0:Z.assetBrand)==null?void 0:X.name,format:"nowrap",severity:"dark"},null,8,["label"]),I(Lt,{label:(ke=(Y=(U=a.value)==null?void 0:U.request)==null?void 0:Y.assetModel)==null?void 0:ke.name,format:"nowrap",severity:"dark"},null,8,["label"]),I(Lt,{label:(he=(H=(Fe=a.value)==null?void 0:Fe.request)==null?void 0:H.assetGroup)==null?void 0:he.name,format:"nowrap",severity:"primary"},null,8,["label"])])])])]),E("div",NG,[P[6]||(P[6]=E("p",{class:"text-xs font-medium tracking-tight"},"Status:",-1)),I(Lt,{label:(nt=(De=a.value)==null?void 0:De.request)==null?void 0:nt.status,severity:p.value,format:"nowrap"},null,8,["label","severity"])]),I(em,{"active-index":0,menu:d,type:"tab"}),f.value.length?(g(),L(_g,{key:u.value,value:f.value},{detail:z(({key:St,value:lt})=>[E("div",{class:pe(["flex gap-1 items-baseline",{"flex-col":St==="Damaged Photo"}]),"data-wv-section":St},[E("span",$G,_(St)+": ",1),St==="Damaged Photo"?(g(),L(Ar,{key:0,src:lt,width:36},null,8,["src"])):(g(),T("span",VG,_(lt),1))],10,BG)]),_:1},8,["value"])):N("",!0)]}),_:1},8,["visible"]))}})),zG=ye({__name:"DisposalReportBulkAction",props:{tableName:{}},emits:["noted","removed"],setup(t,{emit:e}){const{t:n}=ls(),i=t,r=e,o=re([]),s=oe(!1),a=oe(),l=[{label:n("Note"),icon:"note",useAdditionSlot:!0,command:()=>{r("noted",o.value,a.value),Ye.emit("data-table:clear-selected-data",{tableName:i.tableName}),a.value=void 0}},{label:n("Remove from List"),icon:"delete-bin",danger:!0,command:()=>{s.value=!0}}],u=()=>{r("removed",o.value),Ye.emit("data-table:clear-selected-data",{tableName:i.tableName})};return(c,d)=>(g(),T(le,null,[I(fE,O({"selected-data":o.value,"onUpdate:selectedData":d[1]||(d[1]=f=>o.value=f)},c.$attrs,{options:l,"table-name":c.tableName,naming:"Asset(s)"}),{addition:z(({selectedOption:f})=>[(f==null?void 0:f.label)===x(n)("Note")?(g(),L(zc,{key:0,modelValue:a.value,"onUpdate:modelValue":d[0]||(d[0]=p=>a.value=p),placeholder:x(n)("Enter note"),rows:1,"textarea-pt":{root:{maxlength:30}},class:"!max-w-[250px]"},null,8,["modelValue","placeholder"])):N("",!0)]),_:1},16,["selected-data","table-name"]),I(cr,{visible:s.value,"onUpdate:visible":d[2]||(d[2]=f=>s.value=f),"confirm-label":x(n)("Remove"),header:x(n)("Remove from List"),list:o.value,message:x(n)("Are you sure you want to remove it?"),onConfirm:u,"list-label":"name.nameWithSequence",severity:"danger"},null,8,["visible","confirm-label","header","list","message"])],64))}}),FG=ye({__name:"DisposalReportTableFilter",props:{assets:{},tableName:{}},setup(t){const e=t,n=sr(),{t:i}=ls(),r=oe([{label:i("Name"),placeholder:i("Select asset name"),field:"name.key",type:"multiselect",fetchOptionFn:async()=>a("nameOptions")},{label:i("Brand"),placeholder:i("Select brand"),field:"brand.key",type:"multiselect",fetchOptionFn:async()=>a("brandOptions")},{label:i("Model/Type"),placeholder:i("Select model/type"),field:"model.key",type:"multiselect",fetchOptionFn:async()=>a("modelOptions")},{label:i("Group"),field:"group.key",type:"group"}]),o=oe(e.assets.length),s=re({}),a=async l=>{var u;try{s.value[l]=!0;const c=e.assets.map(p=>p._id??"");o.value=c.length;const d={_id:JSON.stringify(c),[l]:!0},{data:f}=await uo.getAllAssetsOptions(d);return(u=f.data)==null?void 0:u[l]}catch(c){return console.error(c),n.add({error:c,message:"Error, failed to get filter option."}),[]}finally{s.value[l]=!1}};return(l,u)=>(g(),L(Jg,{fields:r.value,"table-name":l.tableName,class:"!gap-x-3 !gap-y-4 !p-3","data-ts-name":"diposalreportfilter",static:""},null,8,["fields","table-name"]))}}),jG={class:"flex flex-col gap-2","data-ts-section":"disposalreporttablewrapper"},HG={class:"flex gap-1 justify-end"},UG={class:"flex gap-1 justify-end"},KG=ye({__name:"DisposalReportTable",props:{treeTable:{type:Boolean},childTableProps:{},tableName:{},tableTitle:{},useOption:{type:Boolean},data:{},disableKey:{},includeCheckDisabledRows:{type:Boolean},highlightKey:{},disableAllRows:{type:Boolean},search:{},tag:{},defaultQueryParams:{},fetchFunction:{type:Function},rows:{},isSelectedAll:{type:Boolean},filters:{},lazy:{type:Boolean},loading:{type:Boolean},selectionType:{},useSelection:{type:Boolean},selectedData:{},expandedRows:{},usePaginator:{type:Boolean},options:{},singleSelect:{type:Boolean},customColumn:{type:Boolean},scrollHeight:{},rowHeight:{},reorderable:{type:Boolean},globalFilterFields:{},totalDisabledRows:{},excelToastErrorMessage:{},emptyTableMessage:{},singleSelection:{},router:{},reason:{}},setup(t){const e=t;bt(()=>{p()});const n=sr(),{t:i}=ls(),{setLoading:r}=Fi(),o=oe(!1),s=oe(!1),a=oe(0),l=oe([]),u=oe(),c=oe([]),d=re(new Map),f=[{field:"assetImageSmall",header:"Photo",style:"min-width: 72px",fixed:!0,sortable:!0,excluded:!0,bodyComponent:A=>({component:Ar,props:{src:A.assetImageBig,description:"asset-report-photo",size:"small"}})},{header:"Name",field:"name.nameWithSequence",sortable:!0,fixed:!0,bodyTemplate:A=>{var w;return((w=A.name)==null?void 0:w.nameWithSequence)??"-"}},{header:"Brand",field:"brand.name",sortable:!0,fixed:!1,bodyComponent:A=>{var w;return{component:Lt,props:{label:(w=A.brand)==null?void 0:w.name,severity:"dark",format:"nowrap"}}}},{header:"Model/Type",field:"model.name",sortable:!0,fixed:!1,bodyComponent:A=>{var w;return{component:Lt,props:{label:(w=A.model)==null?void 0:w.name,severity:"dark",format:"nowrap"}}}},{header:"Group",field:"group.name",sortable:!0,fixed:!1,bodyComponent:A=>{var w;return{component:Lt,props:{label:(w=A.group)==null?void 0:w.name,format:"nowrap"}}}},{header:"Note",field:"note",fixed:!0,bodyComponent:A=>({component:zc,props:{modelValue:d.value.get(A._id??"assetId").notes,placeholder:i("Enter note"),rows:1,textareaPt:{root:{maxlength:30}}},events:{"update:modelValue":w=>{const y=d.value.get(A._id??"assetId");d.value.set(A._id??"assetId",{...y,notes:w}),A.note=w}}})}],p=async()=>{try{r(!0);const A=sessionStorage.getItem("assetsDisposalReport")??"[]",{data:w}=await uo.getAllAssets({_id:A});w.data.data.forEach(y=>{d.value.set(y._id??"",{notes:null,reason:["Damaged","Missing"].includes(y.status)?y.status:e.reason})}),c.value=w.data.data,a.value=w.data.totalRecords}catch(A){console.error(A),n.add({error:A,message:"Error, failed to get assets. "})}finally{r(!1)}},h=[{label:i("Remove from List"),icon:"delete-bin",danger:!0,command:()=>{o.value=!0}}],m=A=>{c.value=c.value.filter(w=>!A.some(y=>w._id===y._id)),v(A)},v=A=>{A.forEach(w=>{d.value.delete(w._id??"")}),c.value.length||b(),n.add({message:i("Success, asset has been removed from the list."),severity:"success"})},S=(A,w)=>{A.forEach(y=>{d.value.set(y._id??"",{notes:w??null,reason:["Damaged","Missing"].includes(y.status)?y.status:e.reason})})},b=()=>{const A=window.location.pathname,w=A.slice(0,A.lastIndexOf("/"));e.router.replace(w),sessionStorage.removeItem("assetsDisposalReport")},k=async()=>{const A=[];d.value.forEach((w,y)=>{const C={asset:y,notes:w.notes,reason:w.reason};A.push(C)});try{r(!0),await Tf.postReportDisposal({data:A}),n.add({message:i("Success, disposal report has been submitted.")}),b()}catch(w){console.error(w),n.add({error:w,message:i("Error, failed to submit disposal report.")})}finally{r(!1)}};return(A,w)=>(g(),T(le,null,[E("div",jG,[E("div",HG,[I(zG,{"assets-to-report":c.value,"onUpdate:assetsToReport":w[0]||(w[0]=y=>c.value=y),"selected-data":l.value,"onUpdate:selectedData":w[1]||(w[1]=y=>l.value=y),onNoted:S,onRemoved:w[2]||(w[2]=y=>m(y)),"table-name":"disposal-report-page-table"},null,8,["assets-to-report","selected-data"]),I(ih,{class:"ml-auto","table-name":"disposal-report-page-table"}),I(eh,{"table-name":"disposal-report-page-table"})]),I(FG,{assets:c.value,"table-name":"disposal-report-page-table"},null,8,["assets"]),I(Ph,O(A.$props,{columns:f,data:c.value,lazy:!1,options:h,rows:10,onToggleOption:w[3]||(w[3]=y=>u.value=y),"data-key":"_id","rounded-header":"","selection-type":"checkbox","table-name":"disposal-report-page-table","use-option":"","use-paginator":""}),null,16,["data"])]),I(cr,{visible:o.value,"onUpdate:visible":w[4]||(w[4]=y=>o.value=y),body:x(i)("Are you sure you want to remove it?"),"confirm-label":x(i)("Remove"),header:x(i)("Remove from List"),lists:[u.value],onConfirm:w[5]||(w[5]=y=>m([u.value])),"list-label":"name.nameWithSequence",severity:"danger"},null,8,["visible","body","confirm-label","header","lists"]),I(cr,{visible:s.value,"onUpdate:visible":w[6]||(w[6]=y=>s.value=y),"confirm-label":x(i)("Continue"),header:x(i)("Cancel Report"),onConfirm:b,severity:"danger"},{body:z(()=>[E("p",null,_(x(i)("This action will cancel the disposal report.")),1),E("p",null,_(x(i)("Are you sure you want to continue?")),1)]),_:1},8,["visible","confirm-label","header"]),E("div",UG,[I(We,{label:x(i)("Cancel"),onClick:w[7]||(w[7]=y=>s.value=!0),severity:"dark",text:""},null,8,["label"]),I(We,{label:x(i)("Submit"),onClick:k,severity:"success"},null,8,["label"])])],64))}}),WG={class:"flex flex-col gap-3","data-ts-name":"disposalreport"},qG={class:"text-general-800 font-bold text-base leading-[21.86px] tracking-[0.02em]","data-ts-section":"pagetitle"},Jie=ce("DisposalReport",ye({__name:"DisposalReport",props:{router:{},reason:{}},setup(t){const{t:e}=ls();return(n,i)=>(g(),L(MI,null,{content:z(()=>[E("div",WG,[E("h2",qG,_(x(e)("Asset Disposal")),1),I(KG,it(Ot(n.$props)),null,16)])]),_:1}))}})),XG={class:"flex gap-3 items-center","data-ts-name":"steps","data-ts-section":"root"},Yie=ce("Steps",ye({__name:"Steps",props:{steps:{},currentStep:{}},setup(t){return(e,n)=>(g(),T("div",XG,[(g(!0),T(le,null,_e(e.steps,(i,r)=>(g(),T("div",{key:i.toString(),class:pe(["flex gap-1 items-center text-general-300 text-xs font-semibold",{"!text-primary-500":r+1===e.currentStep}]),"data-ts-section":"stepitem"},[E("span",{class:pe(["flex items-center justify-center","rounded-full border-2 w-5 h-5 tracking-[0.03em]","bg-general-50","border-general-300",{"!bg-primary-50 !border-primary-500":r+1===e.currentStep}]),"data-ts-section":"stepnumber"},_(r+1),3),ht(" "+_(typeof i=="string"?i:i.label),1)],2))),128))]))}})),GG="data:image/svg+xml,%3csvg%20width='125'%20height='125'%20viewBox='0%200%20125%20125'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20x='0.25'%20y='0.25'%20width='124.5'%20height='124.5'%20rx='7.75'%20fill='%23EBEAF0'/%3e%3crect%20x='0.25'%20y='0.25'%20width='124.5'%20height='124.5'%20rx='7.75'%20stroke='%23D9DBE9'%20stroke-width='0.5'/%3e%3crect%20x='26'%20y='32'%20width='74'%20height='62'%20fill='url(%23pattern0_7801_14173)'%20fill-opacity='0.25'/%3e%3cdefs%3e%3cpattern%20id='pattern0_7801_14173'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_7801_14173'%20transform='matrix(0.00382482%200%200%200.00458979%200.0059523%200)'/%3e%3c/pattern%3e%3cimage%20id='image0_7801_14173'%20width='747'%20height='215'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAusAAADXCAMAAACUAO/wAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAADNQTFRFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAowVGyQAAABF0Uk5TAECAIBBw/7DAYJDgMKDw0FBIfQQ/AAAbK0lEQVR4nO1d6bqjIAy9Lm1ttbbv/7Qz1g1IAgFxQXN+zTf1KuIxHkKWv78ZWU4gK/5SQ3mjbua299AEB8CdRL730LyR0TeT7T02wf4QrguuApoej72H5g3husAGmh7V3kPzxlO4LrDgTFzPhesCC2h63PcemjeE6wIbXtV5uP6i7qR+pOdAFayB5o0zpNx7YL7AX9vqmdyNCNZD8TjFdx/jep3cXQhWxu0MXG/hPTzEpgtMIP665DbW4S289x6S4IiAoj21jVO4lfQRqy5AUAIFkJqD/Zu+ChNsA6BiPnuPyBPAvZ7ayyrYCiUwi3uPyBPAmfTde0SCowJwJTEJUCf+rgq2A9AAaTliwHdJJIyAAvBjpBXVC4b/2ntEgsOiMMlS7z0iL4DP0nPvEQmOC+B1TCpiCkQINHuPSHBcALYkZRnNwcvSVEADqICUttiBXJelqYAGoEtKgh0Er8vSVEAD7iYlJHk/SQswwdYAfEnHww6cSGktrAVbA+iAdEJiQAB+SvpLsD1gpGAyxhF8klJaVwu2BxTsqYgYKGFErgusANYxFREDcwglTUNgBaywkognBsQ4pvKSCvZCA7iehuyF405FfAl2A7CP7d4jYgEmyybyPRLsB1g6K4U1HsyVFY+jwAUoBlIQvnBlKgECAieAiElBDcBBJ7MvINgPUMQcf3UK6zil8DES7A24KXN8GwnrOIoXRsAA2E46vGFHWsfIRpKAAaSw48ENOzTrR387N8Auq6wyMRsD/XcHpw5i1hMrbBMPRZbl+bv6bDoHZZbd8up30dRKgCKdBw5t2KFZv6xzXfUYb8d1xTimxnVkdXpkw36GYtqxoH7ituO6ctHUuI61pziwKIC+9TYx1RgPTq5n2XdsW//MYj3UlLmOCODj5uQjve+uu2dKcz175g9ow9oqj1DfNWWuY4b9qCVvC6RvzKFXF/4obzkX6oObuN4839CPrOBB9E4rnryLqiVv0+M6IoHrg+oCpKnZkRcXIbB0nrfhx/Xy+UCMgYn2hZkHojuiFelxHdHAsYRBGdfoYjw4mVlfxHW6ea2ONoe2jPu3KhLkOmLY4yxPs7qfjaKN4ispkZfybGZ9EdctnbwNwN6YF+E6dp8R+myVj3E2/j+/T4SXB2tUfTazvojriP+YhGl9rsJ1bH4Xq5hbe1e4/v+ES98ebJSnM+tISgELvSnxEd3G1F2F6+iNLjPETaXMRs/SdlnOE6Zg2tOZdaxtKwf90/L6KOhkvwzXMWOyZI+mfGmzMT6Cagk1scbySU62AwGcu0+WyepuNKHJmMtwHf34he8ofWt9NrIIs4MtoI/qGl0EbFXixGcIdDRnqa0GoH+lRkeGcD2F5GQIJNwxmJjlwzyF8mmFDgAeGmyAac61N4o3/6b7aWqrd37TowLK7AVEoGrNNK5/MwYSyNbEAfOV76GSXZ01wPXAqERMrB84lCEyNF+i/aF88/xLHpGZxlt5b7Sfoo38mMC+YZ5LvywvzDNBrvfzmGV+8gMT6+fzN1Lw4LoDT/3zqFiLK3Ed9XXxvez99vSP2gyud47g6sbnKqph01wZhSAe100tOD+CK3Ed33Rj9jz9PhT6Mbg+/MeHiEMyga1Lr1Q8ICLXjbmcXTGX4jrur2Js1hSvyVZ4cr07P+PRwTrxHZJdGvkjJtd1Ulf4fy+8xPGB79i5lEIGgjy9uN4Zd9e40Ni96yiYyFzXLMdcv/NaXCdCh6xUfOpL2hCu42F3M3CqX0jBROa63sN5mvmLcZ3YT6DJ/jQ9gWFct7Idp3p7IQUTm+sVejaS63lF4qgpPRxgaT802TMo8EO53rEdvwhO9avsIg2Iy/UXejaS65YN1aR1JL4KRJnVYHMQzvX7vUavglP9fOGNVvC4ztnr7PBAz3Y5rlPBGICGJX7gEq7f7xUQJgTVIwTXJwUO1wkz5QJDw9B/nDbXqbfYiOx/EmmNy7j+/3CdxATVryXW/3hc5+ckaXBz3RJQnzjX0cCTu64aCvKztpTremgY9UYduHzNOtiV63h8xg+Jc52ypffHZHIpCt4jcF1NX0LD0e5XW5d22JfrJRkUnzrXSeH36WMnSvo1j8L1KRSbyie72Lq0w75cp8mePNfx6JP/aLt5aQiNo9z8Qq73uXrk/F6Q6ntz/a8kTp4+1+nMmBupK9SbZ8Y5WvAuKSV1ORfMD3tzvatG9ui3jzQTdAKu0+noVqM+FsbgxK878iLJ61yS6gfgOn6dM3A9qOBZ/RrmjcP1vwJmhDFwTar7c72yJdF90LNdluv+ZH/PsREsrv9H82IUH9RwUar7c91KQvxs1+W6H9n10C0u1/9AmKQDV6W6cH1l8Mlu1jjy4DqS7kvjslQXrq8NLtlBOK4X17sCp7zrXJfqwvXVwSI7UsrLk+tUHJmBC1NduL4+HM70DtjOji/X6d0rBY8LU124vgGcHEQ3Mf25Tgbh2C90GQjXN0Bm5yAeXBvAdZdeumxbxx6bc91Suee0XP9rHBucb2RWvLle3uzL0zblvMYY2JzrOS+r6Vxct4c1dnhYu5EwuF64tpTqq6VmAHhzvX5ZuufV6NmuU5PaAmegRW0Uq/Piuns36dKr0h5bxMOEhIWcT1o6RHsHrWkmn+vft/vU55tPf2yRb8rwhQGcsHisU8d0eEzWncf1kkN00S8/cLi+qM/SH1GB345z1gRneNrvnUr8duadk6uR8+Sh6JcfWDUzQuJG1bN5G/YzNqv68zEa9TtXJx3hev7iL4Oul1qKgsX1EBGinc1TsZ+1mkOgGES57oNI7bNTB68WEkdpAnDqNqBY1OftyAhc5C/m+jkVoTc0CUlynbWsMqGdreAsofoHc94vbojz9YeFXL9CwVgGyu/sHre1ZwgwSeabk2VPxRd/IzaUzryMClv33Jdz/aSacC0UL68Gp/cL1pVyoQzm6lKui3fdGw23hukPe4/2cAjn6lKuXzu+UbA9gpemi7l+qfYZggMALPDZ+t2T6y3wA+x854KrAVC7cAYnhnC9yuB+hghKwZYAFek6t3cJmiUt43r7C4UHwQinCxsVHBpg13QgYObeeuByvRrcxuBIZjNhgSAKwNJ0yhMqn469OhbX1QB487cWDkcgWA1g11TdNrPT3c31T95Yr3XWsAvBIQHssPF7+X1T2t3B9cfNpDKoFXP1XFPBqijfmvcDBPRiGrq5PTDxbuF6lWM+FhCZqi1Oi1yCBgQx8eiajc46BfhGqI375glC03Guf943ypcIXiwl1LHLYa/PHHYk2Bo9M9vXKC/8fN5Flr/nVPWe65PTsq0e+ddumqndpNHHKSHtgniYiDpIGaDFWWf5BYc+h/fl+QsPZS0zweL092ooe1eiYgSxoHoYu5B8EOS4bowKcHDeOkf+ZpcXXAjGJmmdA/KtqyLAxlVllpDZOs43y275q6okWuF0cKcgrZt+5WiRd98yfz2vlCJZEq1wNjCyqFcWzO4wm83iBrSrCtdPhtLNtLV37RkZwhvJCf0TI1w/GRhZGWvn9jOGYG7crgR9W8DJ9SbLvkpO8hYjPBfKrFsa9Vg/gdstlte3b5wA4G1sLJPr5f8HVGHLnM8D3RoWGLBO4GqM59TGWD1AhTGGTZanpb6JhnG9zPKHQ/VVIOTn/0v0qlDEfjWeOX4dBn+KbUpj/J/AyhEYjk3gPEy93rbHgFnlvVanGafsQ2jOtXf74Bkm14snGfFmABQOok1K6/O4RjyNUKRJ4lEz6XqlMvxwr7pgCIydkf8TyKzwQVdeMgSvh4uQ8+zW18qsuoKBFjC4qJPB9TL3KplTP/mjwFqVWICNZPyNuoQn18c7D0+xN8bVDduvkk1NsNgYkoe25bBsfYcfpwhnaDXBWFz3rgBdZ/xRVHyZ+EW9VuOvlB0+ANe9S0vU6KDDuf5XuNm+/rLQzSMPMhiIxfWASmivWZ043ar1jSNlyAr2rrs9ANcDngRWoHwB1zux7xBlG3gWHPf8XrCZFY3rARWgP43PH7/t73P5tCT7jgdRZfOPwPWACUQaTyziejcKq83yPVsAbIRs80Vr42hcJ/WBbezTs2Jp1fb9xa17+XWI3elAYpBH4HpIjVDYEHEp1//fK02JVaIMC/2Z0nNa26rUchCP6yEPfiJ7yR1Hl9WivNxl9jT62KGYjm/w6xyC60FnM8m+nOsW4W44++7vCD7YvNUnn3J9hsv0CfG4HlTPdbbsTZY7Pcszerc4+zLKMJtv/gLXOQTXAxo0wWYeMbhOetUM30+ERrtdu2B98vHd2yUyfUI8rgc1Sbx/dNMAMsnjwHXbh+B62ATWVgkQ7jh5IqrQIFz3X4saeJW/0RqTD9+yhTJ9gsn1Ft9YxGC+asBd9P9c73ED70G9VHrw/2L24HDd9jG4DkzaR5lA8ium+7yjcR1TE8YBP1a24dkTWU9rY/KBTy5kNxFFzLSP8VxV1YUqgRE2N9S1qN1q0lx377SYOo8Y1afKbxn8ajd45SHbBC7hOlrJERlu4NZOOX7Djf9fr6qj50O3Iqse+dOeZ45wWZvBpLnOeCj2cXUTeLNmIWMecNsERrXrZv7deK0g056NWsWMOwCbatFaDsTkOgcF/BSrBiwO19vcEJtLb3sjrnOATKA6+ohcpys5DphfBqBnXSjnhRmgsnnZaJ7OrbmOrMDUmzXm92Om1nLQhYsZf7b0tg/Edb8JXMJ1d3XFNvRCX+UvgSsHLIoX3IOG7bkOnpWa1wUfVebZuLGPJjgz1yHZld8ict1USzD/TqtmwTftWi9OeFbgi4tFyh24Dl5c5aLYoype/B3Fxxe9raW3fSyugwlUTGM8rjMqOeqHcP0lX+0lgiO0V3VcgD24bq4+lHshHlXDoXv7mDeRz811cwKVRWM8rnMop39z8chLA0aD5Ra+IKxyqSHYg+umXVLuhX5U9kSG+qEXxDw3180JVDwx8bjOkRKFoXNeTtN+M/4Cc+GY4ilWhojx0LcpeG24UJWFtuNRZd/ctPDtI//Cp3ByrhsTqGjeeFy3NhkYYRp/h2kHTiTUZLOuHADjvJ+cD7sr3QbzGzz/wnhUhtsX977uwvWPq0/w03TjsWYLgfmZn3+Jx3XjEoR1hU4hCzFNo25GiOD3EM0CL4iHWeAMIs/DeFQE76y35fr9GDECHjDOM/tAvLheWratuFs6YA7IeDC4M0DktFPtyHxvwcQhuD7fsnCdB+M88/i9uP6xJGmzt+phmDQeDwZ2fMntVmdwwnztNwj0tCAotm7EcI7S9e02cDM54vWoTsh13wnMTJkcxvXfWajsRkAM2oHemIFpiGlvzOX0m3zLSnBporLe93dVfikyKiuNheEc4R3nB1yV6+OiPCD9TkcQ18d4+RYt1ICE1jpkczkYsg7gx+ewxOtgP03hDib+XW3KFmTXBeEUNiMxnINVRceGq3I92vchiOuKU/ENJgDNvNmi+HmGZawAOqtt4hEXPYEl2RHDKbZ9VOfh+lSsbReu674cU7jj3+oYSXd24DrDiLDM3AXoUJReJXh0DKcQrodhMpO7cN1cUtbaHj8xpM+6Re6gVB8uqx4E4wHZg2oC8tcHDGcQrgdhduLtwXVsjaAId8o/1665s45J9R7TIWgmLH95WnpGEoIRCNdDQEcB+cOf60Qi99QYiM7zXk+0o1Jdu8GCqAHk8QJaSoJYMfy5cN0fWrepHbhOXrIvFGlzWawl2m0uwd8LRod3e0XMNHkVoNuHPxaue6I2/B7bc93G5S5t3+oFXUW0U1K9xxsvbOC8z3AYempcMQjXe/w4UJrmyTWpm08gcv8mHLWxVxDttFT/oXbUTuf7HdnQp2hcEhjz6y67QZciSprrb+xYzrrJ5Lq7XsmSCfyLsCMSW7RbpDoP0RKwJ9To+b1LRywK5zgu13PsWI6UNM7DeD0MZ4Qn1xkN71yIK9oX7d73iP6p0U8fLYz7zFznBF/7c50cP+tZ+Ad1fMDbEVG026U6E7EVu7GiGeMjhOvqf5u764xwja25/pf5OiJyJHaXaUmd77pDqrNQR1+cGjKP2OK+ONfNm2NIus25DrbZXcjMlOgODtGe9XeeO152TKo//ArhflboHK/HzkyRlsJ17b/NhaP7Y78D1/XwKSe6PzDDch2ivWirYURWJmJS/eaVVwED12JAF22TwRKua/9tRtO5qbsL19WwWBd67zLU1RbRXn6G+6hs6RSYVP+JI64btn2tE6FjPHEqdOnqXAcrP+eE7MT1vzHdwYnRrAEjTIv29+iCqkDd7BmYVO9zUHnL58WtNkgY8zK9rSz2aTCGfHiuG9uIDgcU0AZm0U8T63HdLWQblnAf7wCKa0K0/96KaajEHWFSfXBkcwR7hFYbFEjHcfpcdw25xg8nRgtTAhxlm9fjOqs6kav7XYcxhxSGgKOivQ+On4eKvu2IVG/Hl9OdquXZ9tYL5gbEzI/0ud7a7Z/5UBxcx4JNrE1Q9uX6nyPWpMfUcw+8yYhoH6IolaFCE4xJ9ekiro9NHa0BAQbwQs93aLDP9cX+Ox7X6T7Qf1r9ZOOa1GjRXK/69dX4Xs6Jl7tznVMidja5oCAAuMowPOXfrflCYDlC48fD5XFfw8eoADicFLexwT5nSaDMtJMH4DrNdvBo3Vyn9+DrIZ6ln80GP0+duyaQXYjBwx1HxYbPGI0YzO4xRPtoldWpNsoeNcjFxvlzBMc8ljXEsPZy+BubOFGzmH4dgR7Yqh51yzmDI5gz8sTP448YXO9CNB0+yFGtwOyeQbQXvzoC01m0qW7fXWeh4fXGpDqxDW8ctdDH+Hsyvx49+Hmw1ueV+fdLcBCu/7oFq0c1xHaLOxCIVwVj/IP1CjH4mkBHb4dJrcCIgTcMX9W5PuFTYR1p6fdIAVXMhg/17HX1yPNv1rf2aroShHjTUfWtOA/XO1R9FZNv/iA/pYygNxbZp48252AbonHdmaM2qhUYMYDANdUKRm8O3JydQRcpYyOkRIzGsKAuvioOxXU3WkJna0PhkGH8OK43gSHS1v6avpnrx7uyl+TGyGLbrDF8Hk4EVIgx2jUtYs59D64vyQ2YHcrW0SJNvExMQjA4u31AVK47gsknseHchBpjBJxoSX+mihgtB/wfu+lAWvoN3p7riCORiY+j440CZ7jJxPXVJjCE666ZmRaRLp3G5fpYrre0Hxqh5YB/MUEYy7OwtfoOXGfZXQjdMekcrWuPZvUJDOG6e17GG8UchwqYXKddmQaWbx95P3IsbG2ZitmF6wGlQlpjt44x2uJmu8h83DIVM0/gk/qBD8b1HixLzOK6R1TA4thd75UpGqG5LI1qvglVK36qF3Z3LK4bLKRu3ovtJtOBr5AKjsjyN9ynrd65to8aaQIb6gc2QGuuCnkP6YgB9Q9/R9in+ENGBdTgfxbnHvnuYxC9ELDtRTaUR1V1Ps9b7/LE4R99Y4N7t3AAtq1q1E23f2OL+UB0G+O7IOGZQen8xtyEAc7+G/ZsW4bnhMF1OirgXfJbDugob9Qq1s+eWFrPl0/aIe2AlxDTuf5Z/GErOb2x18l9MfB9h9LdPbrOWvM214Hxy3ApPVaRoD3ibq6PbAJusd+r5G4mjOBnvMgSUE/+FLt7+hVZADj3MEHh+odrq1yDvlnl8mO1jABkKCHzx5jAnnGWCDfjSAXdf2K7mWOEC7nT6eL6tAsLvJy9sgHndT/tMYTNcmTxfbmN27pxlGyMXH88owYwZ/gG8ef1PcRdL8S08IOLDhPmLAzKAYtgIbmq/iVJLNpRPygb8IVxvamzk9cld5rnC48H+A3sxe/BtC46rrfvVRhYZHk+BCF2xcteuUOCJwOtKq81lB76KmwuQVKDKISjuE5roOms1FDwe9RSTjgpS2X2zN9aDbX2/2rxSM+8qPKjvHbJwLCctuQ14PqbjCmmVawR5zau02vb2c8HQics1tpMJSRTXFH8nAzCqjMAbsvSScnAiagoRcRnR/sMrVyviZAi3c8HviTUDSIp4vEr9wpSAGZ0qUBwkzWa8wPRKnPEAPiN5jodFaBRFLw/6CKcKP2xbrcbwTFBbaGgjlTzIN1XjW2UkoKe5HpO/YWRzQfWvIjHmyzpxG8sIzgNiHYxPz4AzwbYNTW1APLiUFaa4DodO2buU7r7xNtK9a1XUUNwVFh3C81MH2BKge1HdAyuvj+9FW5ueoQE7WqEbhZwIf1n+y6g3/JUcAK44oX1ttWAgJAwmM/F9KrUxrZEM+3WkbkeWFtswGXlpM7s2CjJHYKUwNgUV4IHzKM/2CmRgK9RXXQUblEPfs/N8aUAXwe0NCS40DRQVhyTeBGvBV56wlhxBbi08d4sSMDXJE1yOqKiyUlXI17yFwx+LJnJC4GW5em1kDGDnfrgASTIEQWiYzwahoFdKaruGtjE/XmFGFXKeoiIuRrY1PgvPWjRYABLWADvBRHrDKICPqTYgKGOBda4GoM78kdwQrCbaNR4iRcUSFC7InhKNUC5rW4Km0HmnqVlAcxxYd7JymXwBMdFwanFi8CmeGHQ1sQvZOU4k6/Qf7PWjQ2siLasDJ4gcfCbaKiwRxYasnskbYF/Rqbgec2w11ZnSUhFtLVabQgSgncuuTNiXNt5GuU6bYvHMvQK2R92Ue1fJWp5GTzBKUBYXBouD7US0TI2xLCthEe9MpHdGY3o+TGKUAZPcBaUXDdGD/f5Rh0zKHtbPcYOgyjqyc5wU3rVErFnoQiuB7YPkrcZ00uWdihK7VwCD+a/E+JUSQoV/O7tbS4yXQDA3HZkJjz8tvv7YBargNHJ/nS1Ah5OzhwpJ2tccEkwG/nywmLLaoxyZy1+BxnDXEKymC4+RoEF7jDBOz+3JyMS/3F4mWD3l6JdsyOe4BxwNvJlFR+awa427LOEdHbEEx+jgANHI1+/OEG6I5oJPHgSh31xKj5GARvWRr5+ufjsutofH0sMkgLVd0Z8jAIv0D5Iv4xNVguluzXUCwN1GvExCgJAxUF6KmFGC6W758r0j/Lt0AVuBAIrUB+kd9MWRhV+e6gXBkwaVeJjFIQDiYMMaMblyvhzhHqxTik+RsFimD7IkDJx9qZHrK1S84zGh0HSjQQxoMdBBgkFS99ptPuQG+opxMcoiAbVBxloQCmPOCfUC8P8tdmku4ngQhiFe3A/Ubwae3Dh3GFxKj5GwQroE5h8djd1IBVOPSpqmPgtTsXHKFgJnXAPWUiOMKPAQvVLh1J8jIJVUS7ru6brmGWF/+M2xhIIIkNJ21igXwSCFPCKoF8EgiTQVwZbIvsFgkTQfALiXwSCJCGeQsFm+AcZhLyXgtxmbAAAAABJRU5ErkJggg=='/%3e%3c/defs%3e%3c/svg%3e",Fs=t=>{const e=[],n=window.location.pathname,i=Qs(t);return n.includes("approval")?i.approver&&e.push("Approval"):(i.manager&&e.push("Manager"),i.monitoringReport&&e.push("Monitoring"),i.staff&&e.push("Staff")),e},ZG=()=>{const t=window.location.pathname;switch(!0){case t.includes("group"):return{systemRole:["group"]};case t.includes("role"):case t.includes("user"):return{systemRole:["userAndRole"]};case t.includes("asset-policy"):return{systemRole:["assetPolicies"]};case t.includes("license"):return{systemRole:["license"]};case t.includes("device/tag"):return{systemRole:["tag"]};case t.includes("file-manager"):return{systemRole:["documentDeletion"]};case t.includes("transfer"):return{transactionAttribute:["transferRole"],roleType:Fs("transferRole")};case t.includes("assignment"):case t.includes("borrow"):return{transactionAttribute:["borrowingRole"],roleType:Fs("borrowingRole")};case t.includes("assets/disposal"):case t.includes("approvals/disposal"):return{transactionAttribute:["disposalRole"],roleType:Fs("disposalRole")};case t.includes("audit"):return{transactionAttribute:["auditRole"],roleType:Fs("auditRole")};case t.includes("maintenance-routine"):return{transactionAttribute:["maintenanceRole"],roleType:Fs("maintenanceRole")};case t.includes("repair-ticketing"):case t.includes("assets/damage"):return{transactionAttribute:["repairRole"],roleType:Fs("repairRole")};case t.includes("tracking"):case t.includes("assets/missing"):return{transactionAttribute:["trackingRole"],roleType:Fs("trackingRole")};case t.includes("handheld-reader"):case t.includes("iot-reader"):return{systemRole:["iotReader"]}}return{}},ire=ce("WangsVue",MT({locale:{global:{},components:{FieldWrapper:{labelRequired:"*"},InputText:{urlFormatInvalidText:"URL format is incorrect",emailFormatInvalidText:"Email format is incorrect",defaultPlaceholder:"Enter {label}",alreadyExistInvalidText:"{label} already exist",emptyInvalidText:"{label} must not be empty",exceedMaxLengthInvalidText:"Max. {maxLength} characters",includeSpecialCharsInvalidText:"Cannot include any special characters"},DialogConfirm:{nonActionableCloseButtonLabel:"Close",actionableCloseButtonLabel:"Cancel",defaultConfirmMessage:"Are you sure you want to continue?",defaultConfirmLabel:"Continue"},CustomColumn:{resetDefaultText:"Reset to Default"},ButtonSearch:{searchPlaceholder:"Search"},FilterContainer:{applyText:"Apply",clearFieldText:"Clear Field"},MultiSelect:{filterPlaceholder:"Search",loadingPlaceholder:"Loading...",inputPlaceholder:"Select {lowercaseLabel}",emptySelectionErrorMessage:"You must pick {formattedLabel}"},Dropdown:{filterPlaceholder:"Search",loadingPlaceholder:"Loading...",inputPlaceholder:"Select {lowercaseLabel}",emptySelectionErrorMessage:"You must pick {formattedLabel}"},InputCurrency:{emptyInputErrorMessage:"{label} must not be empty"},TextArea:{defaultPlaceholder:"Enter {label}",emptyInvalidText:"{label} must not be empty",exceedMaxLengthInvalidText:"Max. {maxLength} characters"},InputRangeNumber:{minPlaceholder:"Enter",maxPlaceholder:"Enter"},DialogForm:{cancelBtnLabel:"Cancel",clearBtnLabel:"Clear Field",stayCheckboxLabel:"Stay on this form after submitting",submitBtnLabel:"Submit",asideRightCollapsedButtonLabel:"See existing data >",asideRightExpandedButtonLabel:"Close <"},InputPhoneNumber:{defaultPlaceholder:"Enter phone number"},InputNumber:{defaultPlaceholder:"Enter {label}",alreadyExistInvalidText:"{label} already exist",emptyInvalidText:"{label} must not be empty"},Calendar:{defaultPlaceholder:"Select date",emptyInvalidText:"You must pick {formattedLabel}",cancelFooterButtonLabel:"Cancel",applyFooterButtonLabel:"Apply"},Menu:{noOptionLabel:"No Option Available"}}},defaultProps:{FieldWrapper:{showOptionalText:!1,showAsterisk:!0,tooltipPos:"top"},Tree:{fetchTree:async(t,e)=>{try{const{systemRole:n,transactionAttribute:i,roleType:r,...o}=e??ZG(),s={systemRole:n&&typeof n!="string"?JSON.stringify(n):void 0,transactionAttribute:i&&typeof i!="string"?JSON.stringify(i):void 0,roleType:r&&typeof r!="string"?JSON.stringify(r):void 0,...o},{data:a}=await Lv.getGroupCategory(t,s);return a}catch(n){console.error(n)}},type:"category",filter:""},ButtonBulkAction:{selectMenuType:"dropdown"},Animation:{libPath:"admin"},Image:{getImageURL:xf,placeholder:GG},DataTable:{rowHeight:"auto",emptyTableMessage:"No Data Found",excelToastErrorMessage:"Error, failed to download {fileName}."},ButtonDownload:{excelToastErrorMessage:"Error, failed to download {fileName}."},TagType:{useNfc:!1}},useToastConfig:A1}))}}});
427
+ exact amount you entered.`,severity:"primary"})]),E("div",iX,[E("div",rX,[(g(!0),T(le,null,_e(h.value,w=>(g(),T(le,{key:w},[c.value==="left"?(g(),T(le,{key:0},[l.value<w?(g(),T("img",{key:0,src:x(FC),alt:""},null,8,oX)):(g(),T("div",sX,[E("img",{src:x(Sv),alt:"",class:"logo",height:"14",width:"77"},null,8,aX),E("div",lX,[A[5]||(A[5]=E("span",{class:"text-code"},"Q*2D1AB4",-1)),E("span",{style:tr(`background-image: url(${d.value});`),class:"qr-code-wrapper"},null,4)])]))],64)):(g(),T(le,{key:1},[w===1||l.value<w-1?(g(),T("img",{key:0,src:x(FC),alt:""},null,8,uX)):(g(),T("div",cX,[E("img",{src:x(Sv),alt:"",class:"logo",height:"14",width:"77"},null,8,dX),E("div",fX,[A[6]||(A[6]=E("div",{class:"text-code"},"Q*2D1AB4",-1)),E("span",{style:tr(`background-image: url(${d.value});`),class:"qr-code-wrapper"},null,4)])]))],64))],64))),128))])]),A[7]||(A[7]=E("div",{class:"mt-3 flex w-100 h-[26px] bg-general-800 text-white text-xs font-medium justify-center items-center"}," Printer Side ",-1))])),E("div",pX,[E("div",hX," Label: "+_(l.value||0)+" pcs ",1),I(We,{disabled:!l.value||l.value<0,onClick:m,label:"Start Print"},null,8,["disabled"])]),E("div",mX,[E("div",gX,[E("div",vX,[c.value==="right"?(g(),T("div",yX)):N("",!0),(g(!0),T(le,null,_e(f.value,(w,y)=>(g(),T("div",{key:y,class:"box"},[E("img",{src:x(Sv),alt:"",class:"logo",height:"14",width:"77"},null,8,bX),E("div",AX,[E("span",wX,_(x(eX)(w.code)),1),E("span",{style:tr(`background-image: url(${w.url});`),class:"qr-code-wrapper"},null,4)])]))),128))])])])]),_:1},8,["visible"]))}})),OX=()=>[{field:"assets.name.nameWithSequence",header:"Name",sortable:!0,fixed:!0,bodyTemplate(t){var e,n;return((n=(e=t==null?void 0:t.assets)==null?void 0:e.name)==null?void 0:n.nameWithSequence)??"-"}},{field:"assets.group.name",header:"Group",sortable:!0,fixed:!0,bodyComponent(t){var e,n;return{component:Lt,props:{label:((n=(e=t==null?void 0:t.assets)==null?void 0:e.group)==null?void 0:n.name)??"-",severity:"primary",format:"nowrap"}}}},{field:"assets.status",header:"Asset Status",sortable:!0,fixed:!0,bodyComponent(t){var n,i;let e;switch((n=t==null?void 0:t.assets)==null?void 0:n.status){case"Available":e="success";break;case"On Disposal Process":case"Reported Disposal":e="secondary";break;case"Damaged":case"Missing":case"Not Paired Yet":case"TAG Reported":e="danger";break;case"On Borrowing Process":case"On Assign Process":case"Borrowed":case"Assigned":e="primary";break;case"On Transfer":e="warning";break;default:e="primary";break}return{component:Lt,props:{severity:e,format:"nowrap",label:((i=t==null?void 0:t.assets)==null?void 0:i.status)??"-"}}}},{field:"assets.maintenanceStatus",header:"Maintenance",sortable:!0,fixed:!1,bodyComponent(t){var e;return{component:Lt,props:{severity:"warning",format:"nowrap",label:(e=t==null?void 0:t.assets)==null?void 0:e.maintenanceStatus}}}},{field:"assets.auditStatus",header:"Audit",sortable:!0,fixed:!1,bodyComponent(t){var e;return{component:Lt,props:{severity:"warning",format:"nowrap",label:(e=t==null?void 0:t.assets)==null?void 0:e.auditStatus}}}}],TX=["Available","Borrowed","On Borrowing Process","Assigned","On Assign Process","On Transfer","Damaged","Missing","On Disposal Process","Reported Disposal","Not Paired Yet","TAG Reported"],xX=["In Maintenance","In Audit","None"],MX=[{label:"Group",field:"group",type:"group"},{type:"multiselect",field:"status",label:"Asset Status",placeholder:"Select status",fetchOptionFn:()=>TX.map(t=>({label:t,value:t}))},{type:"multiselect",field:"maintenanceAuditStatus",label:"In Maintenance / Audit",placeholder:"Select status",fetchOptionFn:()=>xX.map(t=>({label:t,value:t}))}],EX={class:"flex flex-col gap-2"},PX={class:"flex items-center gap-1","data-ts-section":"dialog-asset-name-detail-action-group"},IX={class:"flex items-center gap-3 text-body-medium mr-auto"},LX={class:"font-bold"},qie=ce("DialogAssetNameDetail",ye({__name:"DialogAssetNameDetail",props:{header:{default:"Asset Name Detail"},id:{},params:{},visible:{type:Boolean}},emits:["update:visible"],setup(t,{emit:e}){const n=sr(),i=t,r=e,o=OX(),s=W(()=>i.visible),a=oe("dialog-asset-name-detail-table"),l=re(),u=async()=>{try{const{data:d}=await Ef.getAssetNameDetail(i.id);l.value=d.data}catch(d){n.add({error:d,message:"Error, failed to load asset name detail"})}},c=async d=>{var f,p;try{const h=i.params?{...d,...i.params}:d,{data:m}=await Ef.getAssetsByAssetName(i.id,{...h,maintenanceAuditStatus:h!=null&&h.maintenanceAuditStatus?h==null?void 0:h.maintenanceAuditStatus:JSON.stringify(["In Maintenance","In Audit","None"])});if(m){const v=(p=(f=m==null?void 0:m.data)==null?void 0:f.data)==null?void 0:p.map((S,b)=>({...S,index:b}));return{message:m.message,data:{data:v,totalRecords:m.data.totalRecords}}}}catch(h){n.add({error:h,message:"Error, failed to load assets"})}};return(d,f)=>(g(),L(ur,{visible:s.value,"onUpdate:visible":[f[0]||(f[0]=p=>s.value=p),f[1]||(f[1]=p=>r("update:visible",!!p))],draggable:!1,header:d.header,onShow:u,class:"w-[800px]",closable:"","data-ts-name":"dialog-asset-name-detail",modal:""},{default:z(()=>{var p,h;return[E("div",EX,[E("div",PX,[E("div",IX,[E("span",LX,_(((p=l.value)==null?void 0:p.name)??"-"),1),E("span",null,"TAG: "+_(((h=l.value)==null?void 0:h.tagType)??"-")+" TAG",1)]),I(ih,{"table-name":a.value},null,8,["table-name"]),I(eh,{"table-name":a.value},null,8,["table-name"])]),I(Jg,{fields:x(MX),"table-name":a.value},null,8,["fields","table-name"]),I(Ph,{columns:x(o),"fetch-function":c,rows:10,"table-name":a.value,"use-option":!1,"data-key":"index",lazy:"","selection-type":"none","use-paginator":""},null,8,["columns","table-name"])])]}),_:1},8,["visible","header"]))}})),DX={class:"flex flex-col gap-3"},RX=ce("DialogReportTag",ye({__name:"DialogReportTag",props:{id:{},tagReported:{},visible:{type:Boolean},successMessage:{},submitLabel:{},submitWithoutApi:{type:Boolean},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(t,{emit:e}){const{setLoading:n}=Fi(),i=sr(),r=t,o=e,s=W(()=>r.visible),a=W(()=>{var p,h,m,v,S,b,k,A,w,y,C,P,R,M,D,$,q,J,ve,ae,me,se;const d=(p=r.tagReported)==null?void 0:p.rfid,f=(h=r.tagReported)==null?void 0:h.qr;return[{label:"RFID TAG",value:"RFID",visible:((v=(m=l.value)==null?void 0:m.asset)==null?void 0:v.rfid)&&!d&&!((k=(b=(S=l.value)==null?void 0:S.asset)==null?void 0:b.tagReported)!=null&&k.rfid)},{label:"QR TAG",value:"QR",visible:((w=(A=l.value)==null?void 0:A.asset)==null?void 0:w.qr)&&!f&&!((P=(C=(y=l.value)==null?void 0:y.asset)==null?void 0:C.tagReported)!=null&&P.qr)},{label:"RFID & QR TAG",value:"RFID & QR",visible:((M=(R=l.value)==null?void 0:R.asset)==null?void 0:M.rfid)&&(($=(D=l.value)==null?void 0:D.asset)==null?void 0:$.qr)&&!d&&!((ve=(J=(q=l.value)==null?void 0:q.asset)==null?void 0:J.tagReported)!=null&&ve.rfid)&&!f&&!((se=(me=(ae=l.value)==null?void 0:ae.asset)==null?void 0:me.tagReported)!=null&&se.qr)}].filter(Ie=>Ie.visible)}),l=re(),u=async d=>{try{n(!0);const p={RFID:{qr:!1,rfid:!0},QR:{qr:!0,rfid:!1},"RFID & QR":{qr:!0,rfid:!0}}[d.formValues.tagType],h="Success, TAG has been reported.";if(r.submitWithoutApi)i.add({message:r.successMessage??h}),o("reported",p),o("update:visible",!1);else if(r.submitFunction)await r.submitFunction(p)&&(i.add({message:r.successMessage??h}),o("reported",p),o("update:visible",!1));else{const{data:m}=await Mf.putReportTAG(r.id,p);m&&(i.add({message:r.successMessage??h}),o("reported",p),o("update:visible",!1))}}catch(f){i.add({error:f,message:"Error, failed to report TAG."})}finally{n(!1)}},c=W(()=>{var d,f,p,h,m;return((d=a.value)==null?void 0:d.length)>1&&((p=(f=l.value)==null?void 0:f.asset)==null?void 0:p.tagType)==="RFID & QR"?"RFID & QR":(m=(h=a.value)==null?void 0:h[0])==null?void 0:m.value});return(d,f)=>(g(),L(Ih,{visible:s.value,"onUpdate:visible":f[0]||(f[0]=p=>s.value=p),"action-label":r.submitLabel??"Submit","buttons-template":["cancel","submit"],"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:f[1]||(f[1]=p=>o("update:visible",!1)),action:"Submit",closable:"","data-ts-name":"report-tag",header:"Report TAG",width:"large"},{confirm:z(p=>{var h,m,v;return[I(cr,{lists:[(v=(m=(h=l.value)==null?void 0:h.asset)==null?void 0:m.name)==null?void 0:v.nameWithSequence],visible:p.visible,onConfirm:S=>p.submit(u),"onUpdate:visible":S=>!S&&p.hide(),body:"Are you sure want to report it?","confirm-label":"Report","data-ts-section":"confirm-dialog",header:"Report TAG",severity:"danger"},null,8,["lists","visible","onConfirm","onUpdate:visible"])]}),fields:z(()=>{var p;return[E("div",DX,[I($u,{id:r.id,ref_key:"assetInfo",ref:l},null,8,["id"]),(p=l.value)!=null&&p.asset?(g(),L(xl,{key:0,disabled:a.value.length<=1,"initial-value":c.value,options:a.value,"data-ts-section":"reported-tag-dropdown","field-info":"Reported TAG will be mark a damaged / missing TAG","field-name":"tagType",label:"Reported TAG",mandatory:"","option-label":"label","option-value":"value",placeholder:"Select TAG","use-validator":""},null,8,["disabled","initial-value","options"])):N("",!0)])]}),_:1},8,["visible","action-label"]))}})),NX={class:"font-bold"},BX={class:"flex flex-col gap-3"},$X={key:0,class:"flex flex-col gap-3"},VX={key:0,class:"flex items-center gap-3"},zX={class:"flex"},FX={key:0,class:"flex mr-1"},Xie=ce("DialogReportDamage",ye({__name:"DialogReportDamage",props:{id:{},reportSource:{},visible:{type:Boolean},byUser:{type:Boolean},successMessage:{},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(t,{emit:e}){const n=t,i=e,{plan:r}=JSON.parse(localStorage.getItem("user")??"{}"),{setLoading:o}=Fi(),s=sr(),a=W(()=>n.visible),l=W(()=>{var w,y,C,P;return((y=(w=c.value)==null?void 0:w.asset)==null?void 0:y.rfid)||((P=(C=c.value)==null?void 0:C.asset)==null?void 0:P.qr)}),u=re(),c=re(),d=oe(!1),f=oe(!1),p=oe(),h=W(()=>{var w,y;return((y=(w=c.value)==null?void 0:w.asset)==null?void 0:y.tagReported)??{}}),m=W(()=>{var R,M,D,$,q,J;const w=(R=h.value)==null?void 0:R.qr,y=(M=h.value)==null?void 0:M.rfid,C=!!(($=(D=c.value)==null?void 0:D.asset)!=null&&$.qr),P=!!((J=(q=c.value)==null?void 0:q.asset)!=null&&J.rfid);return(!y&&!w||!w&&C||!y&&P)&&!f.value}),v=W(()=>{const{qr:w,rfid:y}=h.value??{};return w&&y?"RFID & QR Reported":y?"RFID Reported":w?"QR Reported":""}),S=async w=>{try{o(!0);const y={notes:w.formValues.notes,image:w.formValues.image,reportSource:n.reportSource,serialNumber:p.value},C="Success, damaged asset report has been submitted.";if(n.submitFunction)await n.submitFunction(y)&&(s.add({message:n.successMessage??C}),i("reported"),A());else{const{data:P}=await Pf.putReportDamage(n.id,y);P&&(s.add({message:n.successMessage??C}),i("reported"),A())}}catch(y){s.add({error:y,message:"Error, failed to report damaged asset."})}finally{o(!1)}},b=async(w,y,C)=>{var P;try{const{data:R}=await uo.matchAssetWithTag(n.id,y);return p.value=C,(P=R==null?void 0:R.data)!=null&&P.totalRecords?!0:(s.add({severity:"error",message:"Error, failed to verify. TAG doesn't match.",group:"scan-error-validation"}),!1)}catch(R){s.add({error:R,message:"Error, failed to verify. TAG doesn't match.",group:"scan-error-validation"})}return!1},k=()=>{d.value=!0,A()},A=()=>{i("update:visible",!1)};return Re(a,()=>{f.value=!!n.byUser,p.value=void 0}),Re(f,w=>{var y;w||(y=u.value.form)==null||y.clearField()}),(w,y)=>(g(),T(le,null,[I(Ih,{ref_key:"dialogForm",ref:u,visible:a.value,"onUpdate:visible":y[2]||(y[2]=C=>a.value=C),"buttons-template":["cancel","submit"],"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:A,action:"Submit",closable:"","data-ts-name":"report-damage",header:"Report Damage",width:"large"},{confirm:z(C=>[I(cr,{visible:C.visible,onConfirm:P=>C.submit(S),"onUpdate:visible":P=>!P&&C.hide(),body:"Are you sure want to continue?","confirm-label":"Continue","data-ts-section":"confirm-dialog",header:"Report Damaged Asset",severity:"danger"},{body:z(()=>{var P,R,M;return[E("p",null,[E("span",NX,_(((M=(R=(P=c.value)==null?void 0:P.asset)==null?void 0:R.name)==null?void 0:M.nameWithSequence)??"-"),1),y[5]||(y[5]=ht(" will be reported as damaged asset. "))]),y[6]||(y[6]=E("p",null,"Are you sure want to continue?",-1))]}),_:2},1032,["visible","onConfirm","onUpdate:visible"])]),fields:z(()=>{var C,P,R,M,D;return[E("div",BX,[I($u,{id:n.id,ref_key:"assetInfo",ref:c,"use-tag-type":x(Jf)()!=="Basic"},null,8,["id","use-tag-type"]),(C=c.value)!=null&&C.asset?(g(),T("div",$X,[!n.byUser&&l.value&&x(r)!=="Basic"?(g(),T("div",VX,[E("div",zX,[(R=(P=c.value)==null?void 0:P.asset)!=null&&R.rfid?(g(),T("div",FX,[I(kc,{disabled:h.value.rfid,"scan-validation":b,onScan:y[0]||(y[0]=$=>f.value=!0),size:"small"},null,8,["disabled"]),I(Me,{class:"w-[13.33px] h-[13.33px]",icon:"info",info:"Use short range scanner to verify asset",severity:"primary"})])):N("",!0),(D=(M=c.value)==null?void 0:M.asset)!=null&&D.qr?(g(),L(kc,{key:1,disabled:h.value.qr,"scan-validation":b,onScan:y[1]||(y[1]=$=>f.value=!0),size:"small",type:"QR"},null,8,["disabled"])):N("",!0)]),I(Lt,{label:f.value?"Verified":"Unverified",severity:f.value?"success":"warning"},null,8,["label","severity"]),v.value?(g(),L(Lt,{key:0,label:v.value,format:"nowrap",severity:"danger"},null,8,["label"])):N("",!0),m.value?(g(),L(We,{key:1,onClick:k,label:"Report TAG",text:""})):N("",!0)])):N("",!0),I(Ia,{"data-ts-section":"condition-input",disabled:"",label:"Condition",mandatory:"","use-validator":"",value:"Damaged"}),I(sK,{disabled:!f.value&&l.value,"data-ts-section":"photo-input","field-name":"image","file-type":"jpeg",label:"Photo",mandatory:"","use-validator":""},null,8,["disabled"]),I(ff,{"custom-validation":{empty:"Note must not be empty"},disabled:!f.value&&l.value,"max-input":120,rows:3,"data-ts-section":"notes-input","field-name":"notes","input-class":"!min-h-[67px]",label:"Note",mandatory:"",placeholder:"Enter note","use-validator":""},null,8,["disabled"])])):N("",!0)])]}),_:1},8,["visible"]),I(RX,{id:n.id,visible:d.value,"onUpdate:visible":y[3]||(y[3]=C=>d.value=C),onReported:y[4]||(y[4]=C=>i("reported"))},null,8,["id","visible"])],64))}})),jX={class:"font-bold"},HX={class:"flex flex-col gap-3"},Gie=ce("DialogReportMissing",ye({__name:"DialogReportMissing",props:{id:{},reportSource:{},trackingId:{},visible:{type:Boolean},permanentlyMissing:{type:Boolean},successMessage:{},submitWithoutApi:{type:Boolean},submitFunction:{type:Function}},emits:["update:visible","reported"],setup(t,{emit:e}){const n=t,i=e,{setLoading:r}=Fi(),o=sr(),s=W(()=>n.visible),a=W(()=>n.permanentlyMissing?"Report Permanently Missing":"Report Missing"),l=W(()=>n.permanentlyMissing?"Report as Permanenly Missing":"Report Missing Asset"),u=re(),c=async d=>{try{r(!0);const f={notes:d.formValues.notes,reportSource:n.reportSource},p=n.permanentlyMissing?"Success, asset has been reported as permanently missing.":"Success, missing asset has been reported.";if(n.submitWithoutApi)o.add({message:n.successMessage??p}),i("reported",f),i("update:visible",!1);else if(n.submitFunction)await n.submitFunction(f)&&(o.add({message:n.successMessage??p}),i("reported"),i("update:visible",!1));else{const{data:h}=n.permanentlyMissing?await Pv.putReportPermanentlyMissing(n.trackingId??"",f):await Iv.putReportMissing(n.id,f);h&&(o.add({message:n.successMessage??p}),i("reported"),i("update:visible",!1))}}catch(f){const p=n.permanentlyMissing?"Error, failed to report asset as permanently missing.":"Error, failed to report missing asset.";o.add({error:f,message:p})}finally{r(!1)}};return(d,f)=>(g(),L(Ih,{visible:s.value,"onUpdate:visible":f[0]||(f[0]=p=>s.value=p),"buttons-template":["cancel","submit"],header:a.value,"reset-after-submit":!1,"show-stay-checkbox":!1,"use-clear-btn":!1,onClose:f[1]||(f[1]=p=>i("update:visible",!1)),action:"Submit",closable:"","data-ts-name":"report-missing",width:"large"},{confirm:z(p=>[I(cr,{header:l.value,visible:p.visible,onConfirm:h=>p.submit(c),"onUpdate:visible":h=>!h&&p.hide(),"confirm-label":"Report","data-ts-section":"confirm-dialog",severity:"danger"},{body:z(()=>{var h,m,v;return[E("p",null,[E("span",jX,_(((v=(m=(h=u.value)==null?void 0:h.asset)==null?void 0:m.name)==null?void 0:v.nameWithSequence)??"-"),1),ht(" will be reported as "+_(n.permanentlyMissing?"permanently missing asset":"missing asset")+". ",1)]),f[2]||(f[2]=E("p",null,"Are you sure you want to report it?",-1))]}),_:2},1032,["header","visible","onConfirm","onUpdate:visible"])]),fields:z(()=>[E("div",HX,[(g(),L($u,{id:n.id,key:n.id,ref_key:"assetInfo",ref:u,"use-tag-type":x(Jf)()!=="Basic"},null,8,["id","use-tag-type"])),I(ff,{"custom-validation":{empty:"Note must not be empty"},"max-input":120,rows:3,"data-ts-section":"notes-input","field-name":"notes","input-class":"!min-h-[67px]",label:"Note",mandatory:"",placeholder:"Enter note","use-validator":""})])]),_:1},8,["visible","header"]))}})),{plan:UX}=JSON.parse(localStorage.getItem("user")??"{}"),KX=()=>UX==="Basic",WX={class:"w-full flex items-center justify-between pr-4"},qX={class:"flex items-center gap-2"},XX={key:0,class:"flex flex-col gap-3"},GX={class:"flex justify-between items-center"},ZX={class:"flex items-center gap-1"},_X={class:"flex items-center gap-0.5"},JX={class:"flex items-center gap-0.5"},YX={class:"flex items-center gap-2"},QX={key:0,class:"flex flex-row items-center gap-1"},eG={key:1,class:"flex flex-col gap-1"},tG={class:"flex flex-row items-center gap-1"},nG={key:2,class:"flex flex-row items-center gap-1"},iG={class:"text-xs font-medium text-general-400"},rG={key:1,class:"text-xs font-medium"},oG=ye({__name:"DialogBasicTransferLog",props:Cn({id:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const e=t,n=si(t,"visible"),i=vo(),r=re(),o=re(),s=re(),a=re(0),l=dt("requestIds")??re([]),u=W(()=>{var S;return(S=l.value)!=null&&S.length?l.value.findIndex(b=>s.value===b):-1}),c=W(()=>{var S,b;return(S=l.value)!=null&&S.length?s.value===((b=l.value)==null?void 0:b[0]):!1}),d=W(()=>{var S,b,k;return(S=l.value)!=null&&S.length?s.value===((k=l.value)==null?void 0:k[((b=l.value)==null?void 0:b.length)-1]):!1}),f=W(()=>{var S;return(S=o.value)==null?void 0:S.map(b=>({_id:b.id,action:b.action,createdAt:b.updatedAt,title:b.action+" by",date:b.updatedAt,username:b.userFullName,body:b.action==="Handed over"?void 0:h(b.detail),detail:b.action==="Handed over"?void 0:h(b.detail)}))}),p=S=>{switch(S){case"Rejected":case"Reported Missing":return"danger";case"Waiting for Approval":case"Waiting for Handover":return"warning";case"Completed":case"Approved":return"success";default:return"primary"}},h=S=>{if(!S||!Object.keys(S).length)return;const b={},k=Object.keys(S);for(const A of k){const w=A.replace(/([A-Z])/g," $1"),y=w.charAt(0).toUpperCase()+w.slice(1);b[y==="Notes"?"Note":y]=S[A]??"-"}return b},m=async()=>{var S;if((S=s.value)!=null&&S.length)try{const{data:b}=await If.getTransactionLog(s.value);b&&(r.value=b.data.request,o.value=b.data.logs,a.value++)}catch(b){i.add({error:b,message:"Error, failed to load transfer transaction log"})}},v=S=>{if(u.value===-1||S==="prev"&&c.value||S==="next"&&d.value)return;const b=S==="prev"?u.value-1:u.value+1;s.value=l.value[b]};return Re(n,S=>{S&&(s.value=e.id)}),Re(s,S=>{S&&m()}),(S,b)=>(g(),L(ur,{visible:n.value,"onUpdate:visible":b[2]||(b[2]=k=>n.value=k),draggable:!1,class:"!w-[600px]","footer-class":"flex items-end justify-end gap-1",header:"Transfer Log",modal:""},{header:z(()=>[E("div",WX,[b[3]||(b[3]=E("div",{class:"flex gap-3 items-center"},[E("span",{class:"text-sm font-bold"},"Transfer Log")],-1)),E("div",qX,[I(We,{disabled:c.value,onClick:b[0]||(b[0]=k=>v("prev")),class:"!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",label:"<Prev",text:""},null,8,["disabled"]),I(We,{disabled:d.value,onClick:b[1]||(b[1]=k=>v("next")),class:"!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",label:"Next>",text:""},null,8,["disabled"])])])]),default:z(()=>{var k,A,w;return[r.value?(g(),T("div",XX,[(g(),L($u,{id:r.value.asset,key:r.value.asset,fields:["brand","model","group"],"use-nfc":!1,"use-tag-type":!1},null,8,["id"])),E("div",GX,[E("div",ZX,[E("div",_X,[b[4]||(b[4]=E("span",null,"Origin:",-1)),I(Lt,{label:(k=r.value.originGroup)==null?void 0:k.name},null,8,["label"])]),I(sC,{user:{...r.value.manager,fullName:(A=r.value.manager)==null?void 0:A.fullName}},null,8,["user"])]),E("div",JX,[b[5]||(b[5]=E("span",null,"Destination:",-1)),I(Lt,{label:(w=r.value.destinationGroup)==null?void 0:w.name},null,8,["label"])])]),E("div",YX,[b[6]||(b[6]=E("span",null,"Status:",-1)),I(Lt,{label:r.value.status,severity:p(r.value.status),format:"nowrap"},null,8,["label","severity"])]),I(Zg,{"active-index":0,menu:[{label:"Transfer Log"}],type:"tab"}),(g(),L(_g,{key:a.value,value:f.value},{detail:z(y=>[y.key==="To"?(g(),T("div",QX,[b[7]||(b[7]=E("span",{class:"text-xs font-medium text-general-400"}," Destination Group: ",-1)),I(Lt,{label:y.value},null,8,["label"])])):y.key==="From"?(g(),T("div",eG,[E("div",tG,[b[8]||(b[8]=E("span",{class:"text-xs font-medium text-general-400"}," Destination Group: ",-1)),I(Lt,{label:y.value},null,8,["label"])]),I(Me,{class:"!text-general-800 !text-xs -rotate-90",icon:"arrow-left"})])):(g(),T("div",nG,[E("span",iG,_(y.key)+": ",1),y.key.includes("Group")?(g(),L(Lt,{key:0,label:y.value},null,8,["label"])):(g(),T("span",rG,_(y.value),1))]))]),_:1},8,["value"]))])):N("",!0)]}),_:1},8,["visible"]))}}),sG={class:"w-full flex items-center justify-between pr-4"},aG={class:"flex gap-3 items-center"},lG={class:"flex gap-1 items-center"},uG={class:"text-xs font-medium"},cG={class:"flex items-center gap-2"},dG={key:0,class:"flex flex-col gap-3"},fG={class:"flex justify-between items-center"},pG={class:"flex items-center gap-1"},hG={class:"flex items-center gap-0.5"},mG={class:"flex items-center gap-0.5"},gG={class:"flex items-center gap-2"},vG={key:0,class:"flex flex-row items-center gap-1"},yG={key:1,class:"flex flex-col gap-1"},bG={class:"flex flex-row items-center gap-1"},AG={key:2,class:"flex flex-row items-center gap-1"},wG={class:"text-xs font-medium text-general-400"},SG={key:1,class:"text-xs font-medium"},CG=ye({__name:"DialogFullTransferLog",props:Cn({id:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const e=t,n=si(t,"visible"),i=vo();bt(()=>{window.Cypress&&(l.value=["66406b090d664c625212ac1a","66406b090d664c625212ac22"])});const r=re(),o=re(),s=re(),a=re(0),l=dt("requestIds")??re([]),u=W(()=>{var S;return(S=l.value)!=null&&S.length?l.value.findIndex(b=>s.value===b):-1}),c=W(()=>{var S,b;return(S=l.value)!=null&&S.length?s.value===((b=l.value)==null?void 0:b[0]):!1}),d=W(()=>{var S,b,k;return(S=l.value)!=null&&S.length?s.value===((k=l.value)==null?void 0:k[((b=l.value)==null?void 0:b.length)-1]):!1}),f=W(()=>{var S;return(S=o.value)==null?void 0:S.map(b=>({_id:b._id,action:b.action,createdAt:b.updatedAt,title:b.action+" by",date:b.updatedAt,username:b.userFullName,body:b.action==="Handed over"?void 0:h(b.detail),detail:b.action==="Handed over"?void 0:h(b.detail)}))}),p=S=>{switch(S){case"Rejected":case"Reported Missing":return"danger";case"Waiting for Approval":case"Waiting for Handover":return"warning";case"Completed":case"Approved":return"success";default:return"primary"}},h=S=>{if(!S||!Object.keys(S).length)return;const b={},k=Object.keys(S);for(const A of k){const w=A.replace(/([A-Z])/g," $1"),y=w.charAt(0).toUpperCase()+w.slice(1);b[y==="Notes"?"Note":y]=S[A]??"-"}return b},m=async()=>{var S;if((S=s.value)!=null&&S.length)try{const{data:b}=await If.getTransactionLog(s.value);b&&(r.value=b.data.request,o.value=b.data.logs,a.value++)}catch(b){i.add({error:b,message:"Error, failed to load transfer transaction log"})}},v=S=>{if(u.value===-1||S==="prev"&&c.value||S==="next"&&d.value)return;const b=S==="prev"?u.value-1:u.value+1;s.value=l.value[b]};return Re(n,S=>{S&&(s.value=e.id)}),Re(s,S=>{S&&m()}),(S,b)=>(g(),L(ur,{visible:n.value,"onUpdate:visible":b[2]||(b[2]=k=>n.value=k),draggable:!1,class:"!w-[600px]","footer-class":"flex items-end justify-end gap-1",header:"Transfer Log",modal:""},{header:z(()=>{var k,A;return[E("div",sG,[E("div",aG,[b[3]||(b[3]=E("span",{class:"text-sm font-bold"},"Transfer Log",-1)),E("div",lG,[E("span",uG,_(((k=r.value)==null?void 0:k.transactionId)??"-"),1),I(pE,{text:((A=r.value)==null?void 0:A.transactionId)??""},null,8,["text"])])]),E("div",cG,[I(We,{disabled:c.value,onClick:b[0]||(b[0]=w=>v("prev")),class:"!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",label:"<Prev",text:""},null,8,["disabled"]),I(We,{disabled:d.value,onClick:b[1]||(b[1]=w=>v("next")),class:"!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",label:"Next>",text:""},null,8,["disabled"])])])]}),default:z(()=>{var k,A,w;return[r.value?(g(),T("div",dG,[(g(),L($u,{id:r.value.asset,key:r.value.asset,fields:["brand","model"]},null,8,["id"])),E("div",fG,[E("div",pG,[E("div",hG,[b[4]||(b[4]=E("span",null,"Origin:",-1)),I(Lt,{label:(k=r.value.originGroup)==null?void 0:k.name},null,8,["label"])]),I(sC,{user:{...r.value.manager,fullName:(A=r.value.manager)==null?void 0:A.fullName}},null,8,["user"])]),E("div",mG,[b[5]||(b[5]=E("span",null,"Destination:",-1)),I(Lt,{label:(w=r.value.destinationGroup)==null?void 0:w.name},null,8,["label"])])]),E("div",gG,[b[6]||(b[6]=E("span",null,"Status:",-1)),I(Lt,{label:r.value.status,severity:p(r.value.status),format:"nowrap"},null,8,["label","severity"])]),I(Zg,{"active-index":0,menu:[{label:"Transfer Log"}],type:"tab"}),(g(),L(_g,{key:a.value,value:f.value},{detail:z(y=>[y.key==="To"?(g(),T("div",vG,[b[7]||(b[7]=E("span",{class:"text-xs font-medium text-general-400"}," Destination Group: ",-1)),I(Lt,{label:y.value},null,8,["label"])])):y.key==="From"?(g(),T("div",yG,[E("div",bG,[b[8]||(b[8]=E("span",{class:"text-xs font-medium text-general-400"}," Destination Group: ",-1)),I(Lt,{label:y.value},null,8,["label"])]),I(Me,{class:"!text-general-800 !text-xs -rotate-90",icon:"arrow-left"})])):(g(),T("div",AG,[E("span",wG,_(y.key)+": ",1),y.key.includes("Group")?(g(),L(Lt,{key:0,label:y.value},null,8,["label"])):(g(),T("span",SG,_(y.value),1))]))]),_:1},8,["value"]))])):N("",!0)]}),_:1},8,["visible"]))}}),Zie=ce("DialogTransferLog",ye({__name:"DialogTransferLog",props:Cn({id:{},visible:{type:Boolean}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){const e=si(t,"visible");return(n,i)=>x(KX)()?(g(),L(oG,{key:0,id:n.id,visible:e.value,"onUpdate:visible":i[0]||(i[0]=r=>e.value=r)},null,8,["id","visible"])):(g(),L(CG,{key:1,id:n.id,visible:e.value,"onUpdate:visible":i[1]||(i[1]=r=>e.value=r)},null,8,["id","visible"]))}})),kG={class:"w-full flex items-center justify-between"},OG={class:"flex items-center gap-2"},TG=["disabled"],xG=["disabled"],MG={class:"flex items-start gap-[18px]"},EG={class:"flex flex-col w-full"},PG={class:"w-full flex items-center justify-between"},IG={class:"text-body-medium !font-bold"},LG={class:"flex items-center gap-[6px] text-general-400"},DG={class:"flex gap-3 w-full mt-[6px]"},RG={class:"flex flex-col gap-1 items-start self-stretch"},NG={class:"flex gap-2"},BG=["data-wv-section"],$G={class:"text-body-medium text-general-400","data-wv-section":"key"},VG={key:1,class:"text-body-medium"},_ie=ce("DialogDamageLog",ye({__name:"DialogDamageLog",props:Cn({id:{},listId:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:Cn(["prev","next"],["update:modelValue"]),setup(t,{emit:e}){const n=t,i=e,r=si(t,"modelValue"),o=sr(),{setLoading:s}=Fi(),a=re(),l=re(0),u=re(0),c=W(()=>n.listId),d=[{label:"Damage Log"}],f=re([]),p=W(()=>{var C,P;switch((P=(C=a.value)==null?void 0:C.request)==null?void 0:P.status){case"Damaged":return"danger";case"Repaired":return"success";default:return"dark"}}),h=async C=>(k(C),await m(l.value)),m=async C=>{var P;try{s(!0);const{data:R}=await Pf.getDamageReportDetail(c.value[C]);a.value=R.data,f.value=b((P=a.value)==null?void 0:P.logs),u.value++}catch(R){o.add({error:R,message:"Error, failed to fetch damage detail."})}finally{s(!1)}},v=C=>{switch(C){case"Reported Damaged":return"Reported damaged by";case"Reported Disposal":return"Reported disposal by";case"Repaired":return"Marked as repaired asset by";case"Disposal Report Canceled":return"Reported disposal canceled by";case"Disposal Report Declined":return"Reported disposal declined by";case"Disposed":return"Asset has been disposed";default:return""}},S=(C,P)=>{switch(C){case"Reported Damaged":return{Note:(P==null?void 0:P.notes)??"-","Damaged Photo":(P==null?void 0:P.damagedPhotoBig)??(P==null?void 0:P.damagedPhoto),Source:(P==null?void 0:P.reportSource)??"-"};case"Reported Disposal":return{Note:(P==null?void 0:P.notes)??"-"}}},b=C=>C.map(P=>({_id:P._id,action:v(P.action),date:P.createdAt,username:P.userFullName,danger:!1,detail:S(P.action,P.detail),createdAt:P.createdAt})),k=C=>{var R;const P=(R=n.listId)==null?void 0:R.findIndex(M=>M===C);l.value=P},A=()=>{l.value++,i("next",l.value)},w=()=>{l.value--,i("prev",l.value)},y=()=>{var C,P;Js(`/assets/detail/${(P=(C=a.value)==null?void 0:C.request)==null?void 0:P.asset}`)};return Re(()=>l.value,C=>{m(C)}),(C,P)=>(g(),L(ur,{visible:r.value,"onUpdate:visible":P[0]||(P[0]=R=>r.value=R),onShow:P[1]||(P[1]=R=>h(C.id)),class:"w-[600px]",modal:""},{header:z(()=>[E("div",kG,[P[2]||(P[2]=E("h1",{class:"!text-base font-bold"},"Damage Log",-1)),E("div",OG,[E("button",{class:pe([l.value===0?"text-general-100":"text-primary","text-xs font-medium"]),disabled:l.value===0,onClick:w,"data-wv-section":"prev-button"}," <Prev ",10,TG),E("button",{class:pe([l.value===c.value.length-1||c.value.length===1?"text-general-100":"text-primary","text-xs font-medium"]),disabled:l.value===c.value.length-1||c.value.length===1,onClick:A,"data-wv-section":"next-button"}," Next> ",10,xG)])])]),default:z(()=>{var R,M,D,$,q,J,ve,ae,me,se,Ie,Be,xe,de,ge,Pe,Te,ue,Se,Z,X,U,Y,ke,Fe,H,he,De,nt;return[E("div",MG,[I(Ar,{src:(M=(R=a.value)==null?void 0:R.request)==null?void 0:M.assetImageBig,size:"big"},null,8,["src"]),E("div",EG,[E("div",PG,[E("p",IG,_((q=($=(D=a.value)==null?void 0:D.request)==null?void 0:$.assetName)==null?void 0:q.nameWithSequence),1),E("button",{onClick:y,class:"!text-xs font-medium !text-primary-500","data-wv-section":"detail-button"}," Asset Detail > ")]),E("div",LG,[E("p",null,_(((ve=(J=a.value)==null?void 0:J.request)==null?void 0:ve.assetId)??"-")+" "+_((Ie=(se=(me=(ae=a.value)==null?void 0:ae.request)==null?void 0:me.assetName)==null?void 0:se.aliasCode)!=null&&Ie.length?`(${(de=(xe=(Be=a.value)==null?void 0:Be.request)==null?void 0:xe.assetName)==null?void 0:de.aliasCode})`:""),1),x(Jf)()==="Enterprise"?(g(),T(le,{key:0},[P[3]||(P[3]=E("div",{class:"w-[6px] h-[6px] bg-general-100 rounded"},null,-1)),(Pe=(ge=a.value)==null?void 0:ge.request)!=null&&Pe.tagType?(g(),L(nC,{key:0,type:(ue=(Te=a.value)==null?void 0:Te.request)==null?void 0:ue.tagType},null,8,["type"])):N("",!0)],64)):N("",!0)]),E("div",DG,[P[4]||(P[4]=E("div",{class:"flex flex-col justify-between items-start self-stretch"},[E("p",null,"Brand"),E("p",null,"Model/Type"),E("p",null,"Group")],-1)),P[5]||(P[5]=E("div",{class:"flex flex-col justify-between items-start self-stretch"},[E("p",null,":"),E("p",null,":"),E("p",null,":")],-1)),E("div",RG,[I(Lt,{label:(X=(Z=(Se=a.value)==null?void 0:Se.request)==null?void 0:Z.assetBrand)==null?void 0:X.name,format:"nowrap",severity:"dark"},null,8,["label"]),I(Lt,{label:(ke=(Y=(U=a.value)==null?void 0:U.request)==null?void 0:Y.assetModel)==null?void 0:ke.name,format:"nowrap",severity:"dark"},null,8,["label"]),I(Lt,{label:(he=(H=(Fe=a.value)==null?void 0:Fe.request)==null?void 0:H.assetGroup)==null?void 0:he.name,format:"nowrap",severity:"primary"},null,8,["label"])])])])]),E("div",NG,[P[6]||(P[6]=E("p",{class:"text-xs font-medium tracking-tight"},"Status:",-1)),I(Lt,{label:(nt=(De=a.value)==null?void 0:De.request)==null?void 0:nt.status,severity:p.value,format:"nowrap"},null,8,["label","severity"])]),I(Zg,{"active-index":0,menu:d,type:"tab"}),f.value.length?(g(),L(_g,{key:u.value,value:f.value},{detail:z(({key:St,value:lt})=>[E("div",{class:pe(["flex gap-1 items-baseline",{"flex-col":St==="Damaged Photo"}]),"data-wv-section":St},[E("span",$G,_(St)+": ",1),St==="Damaged Photo"?(g(),L(Ar,{key:0,src:lt,width:36},null,8,["src"])):(g(),T("span",VG,_(lt),1))],10,BG)]),_:1},8,["value"])):N("",!0)]}),_:1},8,["visible"]))}})),zG=ye({__name:"DisposalReportBulkAction",props:{tableName:{}},emits:["noted","removed"],setup(t,{emit:e}){const{t:n}=ls(),i=t,r=e,o=re([]),s=oe(!1),a=oe(),l=[{label:n("Note"),icon:"note",useAdditionSlot:!0,command:()=>{r("noted",o.value,a.value),Ye.emit("data-table:clear-selected-data",{tableName:i.tableName}),a.value=void 0}},{label:n("Remove from List"),icon:"delete-bin",danger:!0,command:()=>{s.value=!0}}],u=()=>{r("removed",o.value),Ye.emit("data-table:clear-selected-data",{tableName:i.tableName})};return(c,d)=>(g(),T(le,null,[I(fE,O({"selected-data":o.value,"onUpdate:selectedData":d[1]||(d[1]=f=>o.value=f)},c.$attrs,{options:l,"table-name":c.tableName,naming:"Asset(s)"}),{addition:z(({selectedOption:f})=>[(f==null?void 0:f.label)===x(n)("Note")?(g(),L(ff,{key:0,modelValue:a.value,"onUpdate:modelValue":d[0]||(d[0]=p=>a.value=p),placeholder:x(n)("Enter note"),rows:1,"textarea-pt":{root:{maxlength:30}},class:"!max-w-[250px]"},null,8,["modelValue","placeholder"])):N("",!0)]),_:1},16,["selected-data","table-name"]),I(cr,{visible:s.value,"onUpdate:visible":d[2]||(d[2]=f=>s.value=f),"confirm-label":x(n)("Remove"),header:x(n)("Remove from List"),list:o.value,message:x(n)("Are you sure you want to remove it?"),onConfirm:u,"list-label":"name.nameWithSequence",severity:"danger"},null,8,["visible","confirm-label","header","list","message"])],64))}}),FG=ye({__name:"DisposalReportTableFilter",props:{assets:{},tableName:{}},setup(t){const e=t,n=sr(),{t:i}=ls(),r=oe([{label:i("Name"),placeholder:i("Select asset name"),field:"name.key",type:"multiselect",fetchOptionFn:async()=>a("nameOptions")},{label:i("Brand"),placeholder:i("Select brand"),field:"brand.key",type:"multiselect",fetchOptionFn:async()=>a("brandOptions")},{label:i("Model/Type"),placeholder:i("Select model/type"),field:"model.key",type:"multiselect",fetchOptionFn:async()=>a("modelOptions")},{label:i("Group"),field:"group.key",type:"group"}]),o=oe(e.assets.length),s=re({}),a=async l=>{var u;try{s.value[l]=!0;const c=e.assets.map(p=>p._id??"");o.value=c.length;const d={_id:JSON.stringify(c),[l]:!0},{data:f}=await uo.getAllAssetsOptions(d);return(u=f.data)==null?void 0:u[l]}catch(c){return console.error(c),n.add({error:c,message:"Error, failed to get filter option."}),[]}finally{s.value[l]=!1}};return(l,u)=>(g(),L(Jg,{fields:r.value,"table-name":l.tableName,class:"!gap-x-3 !gap-y-4 !p-3","data-ts-name":"diposalreportfilter",static:""},null,8,["fields","table-name"]))}}),jG={class:"flex flex-col gap-2","data-ts-section":"disposalreporttablewrapper"},HG={class:"flex gap-1 justify-end"},UG={class:"flex gap-1 justify-end"},KG=ye({__name:"DisposalReportTable",props:{treeTable:{type:Boolean},childTableProps:{},tableName:{},tableTitle:{},useOption:{type:Boolean},data:{},disableKey:{},includeCheckDisabledRows:{type:Boolean},highlightKey:{},disableAllRows:{type:Boolean},search:{},tag:{},defaultQueryParams:{},fetchFunction:{type:Function},rows:{},isSelectedAll:{type:Boolean},filters:{},lazy:{type:Boolean},loading:{type:Boolean},selectionType:{},useSelection:{type:Boolean},selectedData:{},expandedRows:{},usePaginator:{type:Boolean},options:{},singleSelect:{type:Boolean},customColumn:{type:Boolean},scrollHeight:{},rowHeight:{},reorderable:{type:Boolean},globalFilterFields:{},totalDisabledRows:{},excelToastErrorMessage:{},emptyTableMessage:{},singleSelection:{},router:{},reason:{}},setup(t){const e=t;bt(()=>{p()});const n=sr(),{t:i}=ls(),{setLoading:r}=Fi(),o=oe(!1),s=oe(!1),a=oe(0),l=oe([]),u=oe(),c=oe([]),d=re(new Map),f=[{field:"assetImageSmall",header:"Photo",style:"min-width: 72px",fixed:!0,sortable:!0,excluded:!0,bodyComponent:A=>({component:Ar,props:{src:A.assetImageBig,description:"asset-report-photo",size:"small"}})},{header:"Name",field:"name.nameWithSequence",sortable:!0,fixed:!0,bodyTemplate:A=>{var w;return((w=A.name)==null?void 0:w.nameWithSequence)??"-"}},{header:"Brand",field:"brand.name",sortable:!0,fixed:!1,bodyComponent:A=>{var w;return{component:Lt,props:{label:(w=A.brand)==null?void 0:w.name,severity:"dark",format:"nowrap"}}}},{header:"Model/Type",field:"model.name",sortable:!0,fixed:!1,bodyComponent:A=>{var w;return{component:Lt,props:{label:(w=A.model)==null?void 0:w.name,severity:"dark",format:"nowrap"}}}},{header:"Group",field:"group.name",sortable:!0,fixed:!1,bodyComponent:A=>{var w;return{component:Lt,props:{label:(w=A.group)==null?void 0:w.name,format:"nowrap"}}}},{header:"Note",field:"note",fixed:!0,bodyComponent:A=>({component:ff,props:{modelValue:d.value.get(A._id??"assetId").notes,placeholder:i("Enter note"),rows:1,maxlength:30},events:{"update:modelValue":w=>{const y=d.value.get(A._id??"assetId");d.value.set(A._id??"assetId",{...y,notes:w}),A.note=w}}})}],p=async()=>{try{r(!0);const A=sessionStorage.getItem("assetsDisposalReport")??"[]",{data:w}=await uo.getAllAssets({_id:A});w.data.data.forEach(y=>{d.value.set(y._id??"",{notes:null,reason:["Damaged","Missing"].includes(y.status)?y.status:e.reason})}),c.value=w.data.data,a.value=w.data.totalRecords}catch(A){console.error(A),n.add({error:A,message:"Error, failed to get assets. "})}finally{r(!1)}},h=[{label:i("Remove from List"),icon:"delete-bin",danger:!0,command:()=>{o.value=!0}}],m=A=>{c.value=c.value.filter(w=>!A.some(y=>w._id===y._id)),v(A)},v=A=>{A.forEach(w=>{d.value.delete(w._id??"")}),c.value.length||b(),n.add({message:i("Success, asset has been removed from the list."),severity:"success"})},S=(A,w)=>{A.forEach(y=>{d.value.set(y._id??"",{notes:w??null,reason:["Damaged","Missing"].includes(y.status)?y.status:e.reason})})},b=()=>{const A=window.location.pathname,w=A.slice(0,A.lastIndexOf("/"));e.router.replace(w),sessionStorage.removeItem("assetsDisposalReport")},k=async()=>{const A=[];d.value.forEach((w,y)=>{const C={asset:y,notes:w.notes,reason:w.reason};A.push(C)});try{r(!0),await Tf.postReportDisposal({data:A}),n.add({message:i("Success, disposal report has been submitted.")}),b()}catch(w){console.error(w),n.add({error:w,message:i("Error, failed to submit disposal report.")})}finally{r(!1)}};return(A,w)=>(g(),T(le,null,[E("div",jG,[E("div",HG,[I(zG,{"assets-to-report":c.value,"onUpdate:assetsToReport":w[0]||(w[0]=y=>c.value=y),"selected-data":l.value,"onUpdate:selectedData":w[1]||(w[1]=y=>l.value=y),onNoted:S,onRemoved:w[2]||(w[2]=y=>m(y)),"table-name":"disposal-report-page-table"},null,8,["assets-to-report","selected-data"]),I(ih,{class:"ml-auto","table-name":"disposal-report-page-table"}),I(eh,{"table-name":"disposal-report-page-table"})]),I(FG,{assets:c.value,"table-name":"disposal-report-page-table"},null,8,["assets"]),I(Ph,O(A.$props,{columns:f,data:c.value,lazy:!1,options:h,rows:10,onToggleOption:w[3]||(w[3]=y=>u.value=y),"data-key":"_id","rounded-header":"","selection-type":"checkbox","table-name":"disposal-report-page-table","use-option":"","use-paginator":""}),null,16,["data"])]),I(cr,{visible:o.value,"onUpdate:visible":w[4]||(w[4]=y=>o.value=y),body:x(i)("Are you sure you want to remove it?"),"confirm-label":x(i)("Remove"),header:x(i)("Remove from List"),lists:[u.value],onConfirm:w[5]||(w[5]=y=>m([u.value])),"list-label":"name.nameWithSequence",severity:"danger"},null,8,["visible","body","confirm-label","header","lists"]),I(cr,{visible:s.value,"onUpdate:visible":w[6]||(w[6]=y=>s.value=y),"confirm-label":x(i)("Continue"),header:x(i)("Cancel Report"),onConfirm:b,severity:"danger"},{body:z(()=>[E("p",null,_(x(i)("This action will cancel the disposal report.")),1),E("p",null,_(x(i)("Are you sure you want to continue?")),1)]),_:1},8,["visible","confirm-label","header"]),E("div",UG,[I(We,{label:x(i)("Cancel"),onClick:w[7]||(w[7]=y=>s.value=!0),severity:"dark",text:""},null,8,["label"]),I(We,{label:x(i)("Submit"),onClick:k,severity:"success"},null,8,["label"])])],64))}}),WG={class:"flex flex-col gap-3","data-ts-name":"disposalreport"},qG={class:"text-general-800 font-bold text-base leading-[21.86px] tracking-[0.02em]","data-ts-section":"pagetitle"},Jie=ce("DisposalReport",ye({__name:"DisposalReport",props:{router:{},reason:{}},setup(t){const{t:e}=ls();return(n,i)=>(g(),L(MI,null,{content:z(()=>[E("div",WG,[E("h2",qG,_(x(e)("Asset Disposal")),1),I(KG,it(Ot(n.$props)),null,16)])]),_:1}))}})),XG={class:"flex gap-3 items-center","data-ts-name":"steps","data-ts-section":"root"},Yie=ce("Steps",ye({__name:"Steps",props:{steps:{},currentStep:{}},setup(t){return(e,n)=>(g(),T("div",XG,[(g(!0),T(le,null,_e(e.steps,(i,r)=>(g(),T("div",{key:i.toString(),class:pe(["flex gap-1 items-center text-general-300 text-xs font-semibold",{"!text-primary-500":r+1===e.currentStep}]),"data-ts-section":"stepitem"},[E("span",{class:pe(["flex items-center justify-center","rounded-full border-2 w-5 h-5 tracking-[0.03em]","bg-general-50","border-general-300",{"!bg-primary-50 !border-primary-500":r+1===e.currentStep}]),"data-ts-section":"stepnumber"},_(r+1),3),ht(" "+_(typeof i=="string"?i:i.label),1)],2))),128))]))}})),GG="data:image/svg+xml,%3csvg%20width='125'%20height='125'%20viewBox='0%200%20125%20125'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20x='0.25'%20y='0.25'%20width='124.5'%20height='124.5'%20rx='7.75'%20fill='%23EBEAF0'/%3e%3crect%20x='0.25'%20y='0.25'%20width='124.5'%20height='124.5'%20rx='7.75'%20stroke='%23D9DBE9'%20stroke-width='0.5'/%3e%3crect%20x='26'%20y='32'%20width='74'%20height='62'%20fill='url(%23pattern0_7801_14173)'%20fill-opacity='0.25'/%3e%3cdefs%3e%3cpattern%20id='pattern0_7801_14173'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_7801_14173'%20transform='matrix(0.00382482%200%200%200.00458979%200.0059523%200)'/%3e%3c/pattern%3e%3cimage%20id='image0_7801_14173'%20width='747'%20height='215'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAusAAADXCAMAAACUAO/wAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAADNQTFRFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAowVGyQAAABF0Uk5TAECAIBBw/7DAYJDgMKDw0FBIfQQ/AAAbK0lEQVR4nO1d6bqjIAy9Lm1ttbbv/7Qz1g1IAgFxQXN+zTf1KuIxHkKWv78ZWU4gK/5SQ3mjbua299AEB8CdRL730LyR0TeT7T02wf4QrguuApoej72H5g3husAGmh7V3kPzxlO4LrDgTFzPhesCC2h63PcemjeE6wIbXtV5uP6i7qR+pOdAFayB5o0zpNx7YL7AX9vqmdyNCNZD8TjFdx/jep3cXQhWxu0MXG/hPTzEpgtMIP665DbW4S289x6S4IiAoj21jVO4lfQRqy5AUAIFkJqD/Zu+ChNsA6BiPnuPyBPAvZ7ayyrYCiUwi3uPyBPAmfTde0SCowJwJTEJUCf+rgq2A9AAaTliwHdJJIyAAvBjpBXVC4b/2ntEgsOiMMlS7z0iL4DP0nPvEQmOC+B1TCpiCkQINHuPSHBcALYkZRnNwcvSVEADqICUttiBXJelqYAGoEtKgh0Er8vSVEAD7iYlJHk/SQswwdYAfEnHww6cSGktrAVbA+iAdEJiQAB+SvpLsD1gpGAyxhF8klJaVwu2BxTsqYgYKGFErgusANYxFREDcwglTUNgBaywkognBsQ4pvKSCvZCA7iehuyF405FfAl2A7CP7d4jYgEmyybyPRLsB1g6K4U1HsyVFY+jwAUoBlIQvnBlKgECAieAiElBDcBBJ7MvINgPUMQcf3UK6zil8DES7A24KXN8GwnrOIoXRsAA2E46vGFHWsfIRpKAAaSw48ENOzTrR387N8Auq6wyMRsD/XcHpw5i1hMrbBMPRZbl+bv6bDoHZZbd8up30dRKgCKdBw5t2KFZv6xzXfUYb8d1xTimxnVkdXpkw36GYtqxoH7ituO6ctHUuI61pziwKIC+9TYx1RgPTq5n2XdsW//MYj3UlLmOCODj5uQjve+uu2dKcz175g9ow9oqj1DfNWWuY4b9qCVvC6RvzKFXF/4obzkX6oObuN4839CPrOBB9E4rnryLqiVv0+M6IoHrg+oCpKnZkRcXIbB0nrfhx/Xy+UCMgYn2hZkHojuiFelxHdHAsYRBGdfoYjw4mVlfxHW6ea2ONoe2jPu3KhLkOmLY4yxPs7qfjaKN4ispkZfybGZ9EdctnbwNwN6YF+E6dp8R+myVj3E2/j+/T4SXB2tUfTazvojriP+YhGl9rsJ1bH4Xq5hbe1e4/v+ES98ebJSnM+tISgELvSnxEd3G1F2F6+iNLjPETaXMRs/SdlnOE6Zg2tOZdaxtKwf90/L6KOhkvwzXMWOyZI+mfGmzMT6Cagk1scbySU62AwGcu0+WyepuNKHJmMtwHf34he8ofWt9NrIIs4MtoI/qGl0EbFXixGcIdDRnqa0GoH+lRkeGcD2F5GQIJNwxmJjlwzyF8mmFDgAeGmyAac61N4o3/6b7aWqrd37TowLK7AVEoGrNNK5/MwYSyNbEAfOV76GSXZ01wPXAqERMrB84lCEyNF+i/aF88/xLHpGZxlt5b7Sfoo38mMC+YZ5LvywvzDNBrvfzmGV+8gMT6+fzN1Lw4LoDT/3zqFiLK3Ed9XXxvez99vSP2gyud47g6sbnKqph01wZhSAe100tOD+CK3Ed33Rj9jz9PhT6Mbg+/MeHiEMyga1Lr1Q8ICLXjbmcXTGX4jrur2Js1hSvyVZ4cr07P+PRwTrxHZJdGvkjJtd1Ulf4fy+8xPGB79i5lEIGgjy9uN4Zd9e40Ni96yiYyFzXLMdcv/NaXCdCh6xUfOpL2hCu42F3M3CqX0jBROa63sN5mvmLcZ3YT6DJ/jQ9gWFct7Idp3p7IQUTm+sVejaS63lF4qgpPRxgaT802TMo8EO53rEdvwhO9avsIg2Iy/UXejaS65YN1aR1JL4KRJnVYHMQzvX7vUavglP9fOGNVvC4ztnr7PBAz3Y5rlPBGICGJX7gEq7f7xUQJgTVIwTXJwUO1wkz5QJDw9B/nDbXqbfYiOx/EmmNy7j+/3CdxATVryXW/3hc5+ckaXBz3RJQnzjX0cCTu64aCvKztpTremgY9UYduHzNOtiV63h8xg+Jc52ypffHZHIpCt4jcF1NX0LD0e5XW5d22JfrJRkUnzrXSeH36WMnSvo1j8L1KRSbyie72Lq0w75cp8mePNfx6JP/aLt5aQiNo9z8Qq73uXrk/F6Q6ntz/a8kTp4+1+nMmBupK9SbZ8Y5WvAuKSV1ORfMD3tzvatG9ui3jzQTdAKu0+noVqM+FsbgxK878iLJ61yS6gfgOn6dM3A9qOBZ/RrmjcP1vwJmhDFwTar7c72yJdF90LNdluv+ZH/PsREsrv9H82IUH9RwUar7c91KQvxs1+W6H9n10C0u1/9AmKQDV6W6cH1l8Mlu1jjy4DqS7kvjslQXrq8NLtlBOK4X17sCp7zrXJfqwvXVwSI7UsrLk+tUHJmBC1NduL4+HM70DtjOji/X6d0rBY8LU124vgGcHEQ3Mf25Tgbh2C90GQjXN0Bm5yAeXBvAdZdeumxbxx6bc91Suee0XP9rHBucb2RWvLle3uzL0zblvMYY2JzrOS+r6Vxct4c1dnhYu5EwuF64tpTqq6VmAHhzvX5ZuufV6NmuU5PaAmegRW0Uq/Piuns36dKr0h5bxMOEhIWcT1o6RHsHrWkmn+vft/vU55tPf2yRb8rwhQGcsHisU8d0eEzWncf1kkN00S8/cLi+qM/SH1GB345z1gRneNrvnUr8duadk6uR8+Sh6JcfWDUzQuJG1bN5G/YzNqv68zEa9TtXJx3hev7iL4Oul1qKgsX1EBGinc1TsZ+1mkOgGES57oNI7bNTB68WEkdpAnDqNqBY1OftyAhc5C/m+jkVoTc0CUlynbWsMqGdreAsofoHc94vbojz9YeFXL9CwVgGyu/sHre1ZwgwSeabk2VPxRd/IzaUzryMClv33Jdz/aSacC0UL68Gp/cL1pVyoQzm6lKui3fdGw23hukPe4/2cAjn6lKuXzu+UbA9gpemi7l+qfYZggMALPDZ+t2T6y3wA+x854KrAVC7cAYnhnC9yuB+hghKwZYAFek6t3cJmiUt43r7C4UHwQinCxsVHBpg13QgYObeeuByvRrcxuBIZjNhgSAKwNJ0yhMqn469OhbX1QB487cWDkcgWA1g11TdNrPT3c31T95Yr3XWsAvBIQHssPF7+X1T2t3B9cfNpDKoFXP1XFPBqijfmvcDBPRiGrq5PTDxbuF6lWM+FhCZqi1Oi1yCBgQx8eiajc46BfhGqI375glC03Guf943ypcIXiwl1LHLYa/PHHYk2Bo9M9vXKC/8fN5Flr/nVPWe65PTsq0e+ddumqndpNHHKSHtgniYiDpIGaDFWWf5BYc+h/fl+QsPZS0zweL092ooe1eiYgSxoHoYu5B8EOS4bowKcHDeOkf+ZpcXXAjGJmmdA/KtqyLAxlVllpDZOs43y275q6okWuF0cKcgrZt+5WiRd98yfz2vlCJZEq1wNjCyqFcWzO4wm83iBrSrCtdPhtLNtLV37RkZwhvJCf0TI1w/GRhZGWvn9jOGYG7crgR9W8DJ9SbLvkpO8hYjPBfKrFsa9Vg/gdstlte3b5wA4G1sLJPr5f8HVGHLnM8D3RoWGLBO4GqM59TGWD1AhTGGTZanpb6JhnG9zPKHQ/VVIOTn/0v0qlDEfjWeOX4dBn+KbUpj/J/AyhEYjk3gPEy93rbHgFnlvVanGafsQ2jOtXf74Bkm14snGfFmABQOok1K6/O4RjyNUKRJ4lEz6XqlMvxwr7pgCIydkf8TyKzwQVdeMgSvh4uQ8+zW18qsuoKBFjC4qJPB9TL3KplTP/mjwFqVWICNZPyNuoQn18c7D0+xN8bVDduvkk1NsNgYkoe25bBsfYcfpwhnaDXBWFz3rgBdZ/xRVHyZ+EW9VuOvlB0+ANe9S0vU6KDDuf5XuNm+/rLQzSMPMhiIxfWASmivWZ043ar1jSNlyAr2rrs9ANcDngRWoHwB1zux7xBlG3gWHPf8XrCZFY3rARWgP43PH7/t73P5tCT7jgdRZfOPwPWACUQaTyziejcKq83yPVsAbIRs80Vr42hcJ/WBbezTs2Jp1fb9xa17+XWI3elAYpBH4HpIjVDYEHEp1//fK02JVaIMC/2Z0nNa26rUchCP6yEPfiJ7yR1Hl9WivNxl9jT62KGYjm/w6xyC60FnM8m+nOsW4W44++7vCD7YvNUnn3J9hsv0CfG4HlTPdbbsTZY7Pcszerc4+zLKMJtv/gLXOQTXAxo0wWYeMbhOetUM30+ERrtdu2B98vHd2yUyfUI8rgc1Sbx/dNMAMsnjwHXbh+B62ATWVgkQ7jh5IqrQIFz3X4saeJW/0RqTD9+yhTJ9gsn1Ft9YxGC+asBd9P9c73ED70G9VHrw/2L24HDd9jG4DkzaR5lA8ium+7yjcR1TE8YBP1a24dkTWU9rY/KBTy5kNxFFzLSP8VxV1YUqgRE2N9S1qN1q0lx377SYOo8Y1afKbxn8ajd45SHbBC7hOlrJERlu4NZOOX7Djf9fr6qj50O3Iqse+dOeZ45wWZvBpLnOeCj2cXUTeLNmIWMecNsERrXrZv7deK0g056NWsWMOwCbatFaDsTkOgcF/BSrBiwO19vcEJtLb3sjrnOATKA6+ohcpys5DphfBqBnXSjnhRmgsnnZaJ7OrbmOrMDUmzXm92Om1nLQhYsZf7b0tg/Edb8JXMJ1d3XFNvRCX+UvgSsHLIoX3IOG7bkOnpWa1wUfVebZuLGPJjgz1yHZld8ict1USzD/TqtmwTftWi9OeFbgi4tFyh24Dl5c5aLYoype/B3Fxxe9raW3fSyugwlUTGM8rjMqOeqHcP0lX+0lgiO0V3VcgD24bq4+lHshHlXDoXv7mDeRz811cwKVRWM8rnMop39z8chLA0aD5Ra+IKxyqSHYg+umXVLuhX5U9kSG+qEXxDw3180JVDwx8bjOkRKFoXNeTtN+M/4Cc+GY4ilWhojx0LcpeG24UJWFtuNRZd/ctPDtI//Cp3ByrhsTqGjeeFy3NhkYYRp/h2kHTiTUZLOuHADjvJ+cD7sr3QbzGzz/wnhUhtsX977uwvWPq0/w03TjsWYLgfmZn3+Jx3XjEoR1hU4hCzFNo25GiOD3EM0CL4iHWeAMIs/DeFQE76y35fr9GDECHjDOM/tAvLheWratuFs6YA7IeDC4M0DktFPtyHxvwcQhuD7fsnCdB+M88/i9uP6xJGmzt+phmDQeDwZ2fMntVmdwwnztNwj0tCAotm7EcI7S9e02cDM54vWoTsh13wnMTJkcxvXfWajsRkAM2oHemIFpiGlvzOX0m3zLSnBporLe93dVfikyKiuNheEc4R3nB1yV6+OiPCD9TkcQ18d4+RYt1ICE1jpkczkYsg7gx+ewxOtgP03hDib+XW3KFmTXBeEUNiMxnINVRceGq3I92vchiOuKU/ENJgDNvNmi+HmGZawAOqtt4hEXPYEl2RHDKbZ9VOfh+lSsbReu674cU7jj3+oYSXd24DrDiLDM3AXoUJReJXh0DKcQrodhMpO7cN1cUtbaHj8xpM+6Re6gVB8uqx4E4wHZg2oC8tcHDGcQrgdhduLtwXVsjaAId8o/1665s45J9R7TIWgmLH95WnpGEoIRCNdDQEcB+cOf60Qi99QYiM7zXk+0o1Jdu8GCqAHk8QJaSoJYMfy5cN0fWrepHbhOXrIvFGlzWawl2m0uwd8LRod3e0XMNHkVoNuHPxaue6I2/B7bc93G5S5t3+oFXUW0U1K9xxsvbOC8z3AYempcMQjXe/w4UJrmyTWpm08gcv8mHLWxVxDttFT/oXbUTuf7HdnQp2hcEhjz6y67QZciSprrb+xYzrrJ5Lq7XsmSCfyLsCMSW7RbpDoP0RKwJ9To+b1LRywK5zgu13PsWI6UNM7DeD0MZ4Qn1xkN71yIK9oX7d73iP6p0U8fLYz7zFznBF/7c50cP+tZ+Ad1fMDbEVG026U6E7EVu7GiGeMjhOvqf5u764xwja25/pf5OiJyJHaXaUmd77pDqrNQR1+cGjKP2OK+ONfNm2NIus25DrbZXcjMlOgODtGe9XeeO152TKo//ArhflboHK/HzkyRlsJ17b/NhaP7Y78D1/XwKSe6PzDDch2ivWirYURWJmJS/eaVVwED12JAF22TwRKua/9tRtO5qbsL19WwWBd67zLU1RbRXn6G+6hs6RSYVP+JI64btn2tE6FjPHEqdOnqXAcrP+eE7MT1vzHdwYnRrAEjTIv29+iCqkDd7BmYVO9zUHnL58WtNkgY8zK9rSz2aTCGfHiuG9uIDgcU0AZm0U8T63HdLWQblnAf7wCKa0K0/96KaajEHWFSfXBkcwR7hFYbFEjHcfpcdw25xg8nRgtTAhxlm9fjOqs6kav7XYcxhxSGgKOivQ+On4eKvu2IVG/Hl9OdquXZ9tYL5gbEzI/0ud7a7Z/5UBxcx4JNrE1Q9uX6nyPWpMfUcw+8yYhoH6IolaFCE4xJ9ekiro9NHa0BAQbwQs93aLDP9cX+Ox7X6T7Qf1r9ZOOa1GjRXK/69dX4Xs6Jl7tznVMidja5oCAAuMowPOXfrflCYDlC48fD5XFfw8eoADicFLexwT5nSaDMtJMH4DrNdvBo3Vyn9+DrIZ6ln80GP0+duyaQXYjBwx1HxYbPGI0YzO4xRPtoldWpNsoeNcjFxvlzBMc8ljXEsPZy+BubOFGzmH4dgR7Yqh51yzmDI5gz8sTP448YXO9CNB0+yFGtwOyeQbQXvzoC01m0qW7fXWeh4fXGpDqxDW8ctdDH+Hsyvx49+Hmw1ueV+fdLcBCu/7oFq0c1xHaLOxCIVwVj/IP1CjH4mkBHb4dJrcCIgTcMX9W5PuFTYR1p6fdIAVXMhg/17HX1yPNv1rf2aroShHjTUfWtOA/XO1R9FZNv/iA/pYygNxbZp48252AbonHdmaM2qhUYMYDANdUKRm8O3JydQRcpYyOkRIzGsKAuvioOxXU3WkJna0PhkGH8OK43gSHS1v6avpnrx7uyl+TGyGLbrDF8Hk4EVIgx2jUtYs59D64vyQ2YHcrW0SJNvExMQjA4u31AVK47gsknseHchBpjBJxoSX+mihgtB/wfu+lAWvoN3p7riCORiY+j440CZ7jJxPXVJjCE666ZmRaRLp3G5fpYrre0Hxqh5YB/MUEYy7OwtfoOXGfZXQjdMekcrWuPZvUJDOG6e17GG8UchwqYXKddmQaWbx95P3IsbG2ZitmF6wGlQlpjt44x2uJmu8h83DIVM0/gk/qBD8b1HixLzOK6R1TA4thd75UpGqG5LI1qvglVK36qF3Z3LK4bLKRu3ovtJtOBr5AKjsjyN9ynrd65to8aaQIb6gc2QGuuCnkP6YgB9Q9/R9in+ENGBdTgfxbnHvnuYxC9ELDtRTaUR1V1Ps9b7/LE4R99Y4N7t3AAtq1q1E23f2OL+UB0G+O7IOGZQen8xtyEAc7+G/ZsW4bnhMF1OirgXfJbDugob9Qq1s+eWFrPl0/aIe2AlxDTuf5Z/GErOb2x18l9MfB9h9LdPbrOWvM214Hxy3ApPVaRoD3ibq6PbAJusd+r5G4mjOBnvMgSUE/+FLt7+hVZADj3MEHh+odrq1yDvlnl8mO1jABkKCHzx5jAnnGWCDfjSAXdf2K7mWOEC7nT6eL6tAsLvJy9sgHndT/tMYTNcmTxfbmN27pxlGyMXH88owYwZ/gG8ef1PcRdL8S08IOLDhPmLAzKAYtgIbmq/iVJLNpRPygb8IVxvamzk9cld5rnC48H+A3sxe/BtC46rrfvVRhYZHk+BCF2xcteuUOCJwOtKq81lB76KmwuQVKDKISjuE5roOms1FDwe9RSTjgpS2X2zN9aDbX2/2rxSM+8qPKjvHbJwLCctuQ14PqbjCmmVawR5zau02vb2c8HQics1tpMJSRTXFH8nAzCqjMAbsvSScnAiagoRcRnR/sMrVyviZAi3c8HviTUDSIp4vEr9wpSAGZ0qUBwkzWa8wPRKnPEAPiN5jodFaBRFLw/6CKcKP2xbrcbwTFBbaGgjlTzIN1XjW2UkoKe5HpO/YWRzQfWvIjHmyzpxG8sIzgNiHYxPz4AzwbYNTW1APLiUFaa4DodO2buU7r7xNtK9a1XUUNwVFh3C81MH2BKge1HdAyuvj+9FW5ueoQE7WqEbhZwIf1n+y6g3/JUcAK44oX1ttWAgJAwmM/F9KrUxrZEM+3WkbkeWFtswGXlpM7s2CjJHYKUwNgUV4IHzKM/2CmRgK9RXXQUblEPfs/N8aUAXwe0NCS40DRQVhyTeBGvBV56wlhxBbi08d4sSMDXJE1yOqKiyUlXI17yFwx+LJnJC4GW5em1kDGDnfrgASTIEQWiYzwahoFdKaruGtjE/XmFGFXKeoiIuRrY1PgvPWjRYABLWADvBRHrDKICPqTYgKGOBda4GoM78kdwQrCbaNR4iRcUSFC7InhKNUC5rW4Km0HmnqVlAcxxYd7JymXwBMdFwanFi8CmeGHQ1sQvZOU4k6/Qf7PWjQ2siLasDJ4gcfCbaKiwRxYasnskbYF/Rqbgec2w11ZnSUhFtLVabQgSgncuuTNiXNt5GuU6bYvHMvQK2R92Ue1fJWp5GTzBKUBYXBouD7US0TI2xLCthEe9MpHdGY3o+TGKUAZPcBaUXDdGD/f5Rh0zKHtbPcYOgyjqyc5wU3rVErFnoQiuB7YPkrcZ00uWdihK7VwCD+a/E+JUSQoV/O7tbS4yXQDA3HZkJjz8tvv7YBargNHJ/nS1Ah5OzhwpJ2tccEkwG/nywmLLaoxyZy1+BxnDXEKymC4+RoEF7jDBOz+3JyMS/3F4mWD3l6JdsyOe4BxwNvJlFR+awa427LOEdHbEEx+jgANHI1+/OEG6I5oJPHgSh31xKj5GARvWRr5+ufjsutofH0sMkgLVd0Z8jAIv0D5Iv4xNVguluzXUCwN1GvExCgJAxUF6KmFGC6W758r0j/Lt0AVuBAIrUB+kd9MWRhV+e6gXBkwaVeJjFIQDiYMMaMblyvhzhHqxTik+RsFimD7IkDJx9qZHrK1S84zGh0HSjQQxoMdBBgkFS99ptPuQG+opxMcoiAbVBxloQCmPOCfUC8P8tdmku4ngQhiFe3A/Ubwae3Dh3GFxKj5GwQroE5h8djd1IBVOPSpqmPgtTsXHKFgJnXAPWUiOMKPAQvVLh1J8jIJVUS7ru6brmGWF/+M2xhIIIkNJ21igXwSCFPCKoF8EgiTQVwZbIvsFgkTQfALiXwSCJCGeQsFm+AcZhLyXgtxmbAAAAABJRU5ErkJggg=='/%3e%3c/defs%3e%3c/svg%3e",Fs=t=>{const e=[],n=window.location.pathname,i=Qs(t);return n.includes("approval")?i.approver&&e.push("Approval"):(i.manager&&e.push("Manager"),i.monitoringReport&&e.push("Monitoring"),i.staff&&e.push("Staff")),e},ZG=()=>{const t=window.location.pathname;switch(!0){case t.includes("group"):return{systemRole:["group"]};case t.includes("role"):case t.includes("user"):return{systemRole:["userAndRole"]};case t.includes("asset-policy"):return{systemRole:["assetPolicies"]};case t.includes("license"):return{systemRole:["license"]};case t.includes("device/tag"):return{systemRole:["tag"]};case t.includes("file-manager"):return{systemRole:["documentDeletion"]};case t.includes("transfer"):return{transactionAttribute:["transferRole"],roleType:Fs("transferRole")};case t.includes("assignment"):case t.includes("borrow"):return{transactionAttribute:["borrowingRole"],roleType:Fs("borrowingRole")};case t.includes("assets/disposal"):case t.includes("approvals/disposal"):return{transactionAttribute:["disposalRole"],roleType:Fs("disposalRole")};case t.includes("audit"):return{transactionAttribute:["auditRole"],roleType:Fs("auditRole")};case t.includes("maintenance-routine"):return{transactionAttribute:["maintenanceRole"],roleType:Fs("maintenanceRole")};case t.includes("repair-ticketing"):case t.includes("assets/damage"):return{transactionAttribute:["repairRole"],roleType:Fs("repairRole")};case t.includes("tracking"):case t.includes("assets/missing"):return{transactionAttribute:["trackingRole"],roleType:Fs("trackingRole")};case t.includes("handheld-reader"):case t.includes("iot-reader"):return{systemRole:["iotReader"]}}return{}},ire=ce("WangsVue",MT({locale:{global:{},components:{FieldWrapper:{labelRequired:"*"},InputText:{urlFormatInvalidText:"URL format is incorrect",emailFormatInvalidText:"Email format is incorrect",defaultPlaceholder:"Enter {label}",alreadyExistInvalidText:"{label} already exist",emptyInvalidText:"{label} must not be empty",exceedMaxLengthInvalidText:"Max. {maxLength} characters",includeSpecialCharsInvalidText:"Cannot include any special characters"},DialogConfirm:{nonActionableCloseButtonLabel:"Close",actionableCloseButtonLabel:"Cancel",defaultConfirmMessage:"Are you sure you want to continue?",defaultConfirmLabel:"Continue"},CustomColumn:{resetDefaultText:"Reset to Default"},ButtonSearch:{searchPlaceholder:"Search"},FilterContainer:{applyText:"Apply",clearFieldText:"Clear Field"},MultiSelect:{filterPlaceholder:"Search",loadingPlaceholder:"Loading...",inputPlaceholder:"Select {lowercaseLabel}",emptySelectionErrorMessage:"You must pick {formattedLabel}"},Dropdown:{filterPlaceholder:"Search",loadingPlaceholder:"Loading...",inputPlaceholder:"Select {lowercaseLabel}",emptySelectionErrorMessage:"You must pick {formattedLabel}"},InputCurrency:{emptyInputErrorMessage:"{label} must not be empty"},TextArea:{defaultPlaceholder:"Enter {label}",emptyInvalidText:"{label} must not be empty",exceedMaxLengthInvalidText:"Max. {maxLength} characters"},InputRangeNumber:{minPlaceholder:"Enter",maxPlaceholder:"Enter"},DialogForm:{cancelBtnLabel:"Cancel",clearBtnLabel:"Clear Field",stayCheckboxLabel:"Stay on this form after submitting",submitBtnLabel:"Submit",asideRightCollapsedButtonLabel:"See existing data >",asideRightExpandedButtonLabel:"Close <"},InputPhoneNumber:{defaultPlaceholder:"Enter phone number"},InputNumber:{defaultPlaceholder:"Enter {label}",alreadyExistInvalidText:"{label} already exist",emptyInvalidText:"{label} must not be empty"},Calendar:{defaultPlaceholder:"Select date",emptyInvalidText:"You must pick {formattedLabel}",cancelFooterButtonLabel:"Cancel",applyFooterButtonLabel:"Apply"},Menu:{noOptionLabel:"No Option Available"}}},defaultProps:{FieldWrapper:{showOptionalText:!1,showAsterisk:!0,tooltipPos:"top"},Tree:{fetchTree:async(t,e)=>{try{const{systemRole:n,transactionAttribute:i,roleType:r,...o}=e??ZG(),s={systemRole:n&&typeof n!="string"?JSON.stringify(n):void 0,transactionAttribute:i&&typeof i!="string"?JSON.stringify(i):void 0,roleType:r&&typeof r!="string"?JSON.stringify(r):void 0,...o},{data:a}=await Lv.getGroupCategory(t,s);return a}catch(n){console.error(n)}},type:"category",filter:""},ButtonBulkAction:{selectMenuType:"dropdown"},Animation:{libPath:"admin"},Image:{getImageURL:xf,placeholder:GG},DataTable:{rowHeight:"auto",emptyTableMessage:"No Data Found",excelToastErrorMessage:"Error, failed to download {fileName}."},ButtonDownload:{excelToastErrorMessage:"Error, failed to download {fileName}."},TagType:{useNfc:!1}},useToastConfig:A1}))}}});