📁 File Manager Pro
v10.0.2 | PHP: 8.1.34
Server: LiteSpeed
2026-06-26 13:48:30
📂
/
/
home
/
pallabnv
/
public_html
/
wp-content__3bb9dea
/
plugins
/
elementor
/
assets
/
js
/
packages
/
editor-controls
✏️
Editing: editor-controls.min.js
/*! For license information please see editor-controls.min.js.LICENSE.txt */ !function(){var e={1020:function(e,t,n){"use strict";var r=n(7557),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!a.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:l.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},2162:function(e,t,n){"use strict";var r=n(7557),o=n(9888),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.useSyncExternalStore,l=r.useRef,a=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var p=l(null);if(null===p.current){var d={hasValue:!1,value:null};p.current=d}else d=p.current;p=c(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return l=t}return l=e}if(t=l,i(s,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(s=e,t):(s=e,l=n)}var s,l,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]);var h=s(e,p[0],p[1]);return a(function(){d.hasValue=!0,d.value=h},[h]),u(h),h}},4353:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",o="minute",i="hour",s="day",l="week",a="month",c="quarter",u="year",p="date",d="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,a),i=n-o<0,s=t.clone().add(r+(i?-1:1),a);return+(-(r+(n-o)/(i?o-s:s-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:a,y:u,w:l,d:s,D:p,h:i,m:o,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",b={};b[v]=m;var E="$isDayjsObject",w=function(e){return e instanceof C||!(!e||!e[E])},x=function e(t,n,r){var o;if(!t)return v;if("string"==typeof t){var i=t.toLowerCase();b[i]&&(o=i),n&&(b[i]=n,o=i);var s=t.split("-");if(!o&&s.length>1)return e(s[0])}else{var l=t.name;b[l]=t,o=l}return!r&&o&&(v=o),o||!r&&v},k=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},S=y;S.l=x,S.i=w,S.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function m(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[E]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(S.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return S},g.isValid=function(){return!(this.$d.toString()===d)},g.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return k(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<k(e)},g.$g=function(e,t,n){return S.u(e)?this[t]:this.set(n,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var n=this,c=!!S.u(t)||t,d=S.p(e),h=function(e,t){var r=S.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?r:r.endOf(s)},f=function(e,t){return S.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(d){case u:return c?h(1,0):h(31,11);case a:return c?h(1,g):h(0,g+1);case l:var b=this.$locale().weekStart||0,E=(m<b?m+7:m)-b;return h(c?y-E:y+(6-E),g);case s:case p:return f(v+"Hours",0);case i:return f(v+"Minutes",1);case o:return f(v+"Seconds",2);case r:return f(v+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var l,c=S.p(e),d="set"+(this.$u?"UTC":""),h=(l={},l[s]=d+"Date",l[p]=d+"Date",l[a]=d+"Month",l[u]=d+"FullYear",l[i]=d+"Hours",l[o]=d+"Minutes",l[r]=d+"Seconds",l[n]=d+"Milliseconds",l)[c],f=c===s?this.$D+(t-this.$W):t;if(c===a||c===u){var m=this.clone().set(p,1);m.$d[h](f),m.init(),this.$d=m.set(p,Math.min(this.$D,m.daysInMonth())).$d}else h&&this.$d[h](f);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[S.p(e)]()},g.add=function(n,c){var p,d=this;n=Number(n);var h=S.p(c),f=function(e){var t=k(d);return S.w(t.date(t.date()+Math.round(e*n)),d)};if(h===a)return this.set(a,this.$M+n);if(h===u)return this.set(u,this.$y+n);if(h===s)return f(1);if(h===l)return f(7);var m=(p={},p[o]=e,p[i]=t,p[r]=1e3,p)[h]||1,g=this.$d.getTime()+n*m;return S.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=S.z(this),i=this.$H,s=this.$m,l=this.$M,a=n.weekdays,c=n.months,u=n.meridiem,p=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},h=function(e){return S.s(i%12||12,e,"0")},m=u||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(f,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return S.s(t.$y,4,"0");case"M":return l+1;case"MM":return S.s(l+1,2,"0");case"MMM":return p(n.monthsShort,l,c,3);case"MMMM":return p(c,l);case"D":return t.$D;case"DD":return S.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(n.weekdaysMin,t.$W,a,2);case"ddd":return p(n.weekdaysShort,t.$W,a,3);case"dddd":return a[t.$W];case"H":return String(i);case"HH":return S.s(i,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return m(i,s,!0);case"A":return m(i,s,!1);case"m":return String(s);case"mm":return S.s(s,2,"0");case"s":return String(t.$s);case"ss":return S.s(t.$s,2,"0");case"SSS":return S.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,p,d){var h,f=this,m=S.p(p),g=k(n),y=(g.utcOffset()-this.utcOffset())*e,v=this-g,b=function(){return S.m(f,g)};switch(m){case u:h=b()/12;break;case a:h=b();break;case c:h=b()/3;break;case l:h=(v-y)/6048e5;break;case s:h=(v-y)/864e5;break;case i:h=v/t;break;case o:h=v/e;break;case r:h=v/1e3;break;default:h=v}return d?h:S.a(h)},g.daysInMonth=function(){return this.endOf(a).$D},g.$locale=function(){return b[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=x(e,t,!0);return r&&(n.$L=r),n},g.clone=function(){return S.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),T=C.prototype;return k.prototype=T,[["$ms",n],["$s",r],["$m",o],["$H",i],["$W",s],["$M",a],["$y",u],["$D",p]].forEach(function(e){T[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),k.extend=function(e,t){return e.$i||(e(t,C,k),e.$i=!0),k},k.locale=x,k.isDayjs=w,k.unix=function(e){return k(1e3*e)},k.en=b[v],k.Ls=b,k.p={},k}()},4848:function(e,t,n){"use strict";e.exports=n(1020)},7557:function(e){"use strict";e.exports=window.React},8493:function(e,t,n){"use strict";var r=n(7557),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l(function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})},[e,n,t]),s(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),a(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},9242:function(e,t,n){"use strict";e.exports=n(2162)},9888:function(e,t,n){"use strict";e.exports=n(8493)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r),n.d(r,{AspectRatioControl:function(){return ys},AttachmentTypeControl:function(){return Cx},AttributesControl:function(){return _x},BackgroundControl:function(){return vl},BoxShadowRepeaterControl:function(){return ro},ChipsControl:function(){return Lo},ClearIconButton:function(){return Rx},ColorControl:function(){return ar},ControlActionsProvider:function(){return q},ControlAdornments:function(){return O},ControlAdornmentsProvider:function(){return C},ControlFormLabel:function(){return k},ControlReplacementsProvider:function(){return P},ControlToggleButtonGroup:function(){return Fo},DateRangeControl:function(){return mc},DateTimeControl:function(){return lc},DisplayConditionsControl:function(){return Mx},EmailFormActionControl:function(){return Sx},EqualUnequalSizesControl:function(){return Yo},FilterRepeaterControl:function(){return Po},FontFamilyControl:function(){return Bi},GapControl:function(){return ds},HtmlTagControl:function(){return ps},ImageControl:function(){return re},InlineEditingControl:function(){return sx},InlineEditor:function(){return rx},InlineEditorToolbar:function(){return Ux},ItemSelector:function(){return Di},KeyValueControl:function(){return Nl},LinkControl:function(){return is},LinkedDimensionsControl:function(){return Ii},MentionTextAreaControl:function(){return Dn},NumberControl:function(){return qo},NumberInput:function(){return Wn},PopoverContent:function(){return eo},PopoverGridContainer:function(){return to},PositionControl:function(){return Dl},PromotionTrigger:function(){return Tx},PropKeyProvider:function(){return m},PropProvider:function(){return d},QueryControl:function(){return es},RepeatableControl:function(){return kl},Repeater:function(){return zx},SelectControl:function(){return ee},SelectControlWrapper:function(){return Ro},SizeComponent:function(){return xi},SizeControl:function(){return rr},StrokeControl:function(){return ur},StyledToggleButton:function(){return $o},StyledToggleButtonGroup:function(){return jo},SvgMediaControl:function(){return _s},SwitchControl:function(){return ts},TextAreaControl:function(){return le},TextControl:function(){return se},TimeRangeControl:function(){return Ec},TimeStringControl:function(){return yc},ToggleButtonGroupUi:function(){return Bo},ToggleControl:function(){return Wo},TransformRepeaterControl:function(){return Ia},TransformSettingsControl:function(){return Aa},TransitionRepeaterControl:function(){return rc},UnstableSizeControl:function(){return Mi},UnstableSizeField:function(){return ek},UrlControl:function(){return Fi},VideoMediaControl:function(){return Rs},createControl:function(){return D},createControlReplacementsRegistry:function(){return _},enqueueFont:function(){return ji},getControlReplacements:function(){return R},injectIntoRepeaterItemActions:function(){return $r},injectIntoRepeaterItemIcon:function(){return Dr},injectIntoRepeaterItemLabel:function(){return zr},isUnitExtendedOption:function(){return Un},registerControlReplacement:function(){return N},trackUpgradePromotionClick:function(){return Ha},trackViewPromotion:function(){return Va},transitionProperties:function(){return za},transitionsItemsList:function(){return ja},useBoundProp:function(){return b},useControlActions:function(){return J},useControlReplacement:function(){return I},useFontFamilies:function(){return nk},useSyncExternalState:function(){return Zn},useTypingBuffer:function(){return jn}});var e=n(7557),t=n.n(e),o=window.elementorV2.editorProps,i=window.elementorV2.ui,s=window.wp.i18n,l=window.elementorV2.utils;const a=(0,l.createError)({code:"missing_prop_provider_prop_type",message:"Prop type is missing"}),c=(0,l.createError)({code:"unsupported_prop_provider_prop_type",message:"Parent prop type is not supported"}),u=(0,l.createError)({code:"hook_outside_provider",message:"Hook used outside of provider"}),p=(0,e.createContext)(null),d=({children:t,value:n,setValue:r,propType:o,placeholder:i,baseValue:s,isDisabled:l})=>e.createElement(p.Provider,{value:{value:n,propType:o,setValue:r,placeholder:i,baseValue:s,isDisabled:l}},t),h=()=>{const t=(0,e.useContext)(p);if(!t)throw new u({context:{hook:"usePropContext",provider:"PropProvider"}});return t},f=(0,e.createContext)(null),m=({children:t,bind:n})=>{const{propType:r}=h();if(!r)throw new a({context:{bind:n}});if("array"===r.kind)return e.createElement(y,{bind:n},t);if("object"===r.kind)return e.createElement(g,{bind:n},t);throw new c({context:{propType:r}})},g=({children:t,bind:n})=>{const r=h(),{path:o}=(0,e.useContext)(f)??{},i=r.value?.[n],s=r.placeholder?.[n],l=r.baseValue?.[n],a=r.propType.shape[n];return e.createElement(f.Provider,{value:{...r,value:i,setValue:(e,t,o)=>{const i={...r.value??r.baseValue,[n]:e};return r?.setValue(i,t,{...o,bind:n})},placeholder:s,baseValue:l,bind:n,propType:a,path:[...o??[],n]}},t)},y=({children:t,bind:n})=>{const r=h(),{path:o}=(0,e.useContext)(f)??{},i=r.value?.[Number(n)],s=r.placeholder?.[Number(n)],l=r.baseValue?.[Number(n)],a=r.propType.item_prop_type;return e.createElement(f.Provider,{value:{...r,value:i,setValue:(e,t)=>{const o=[...r.value??r.baseValue??[]];return o[Number(n)]=e,r?.setValue(o,t,{bind:n})},bind:n,propType:a,path:[...o??[],n],placeholder:s??void 0,baseValue:l??void 0}},t)},v=()=>{const t=(0,e.useContext)(f);if(!t)throw new u({context:{hook:"usePropKeyContext",provider:"PropKeyProvider"}});return t};function b(e){const t=v(),{isValid:n,validate:r,restoreValue:o}=E(t.propType),i=t.isDisabled?.(t.propType),s=()=>{t.setValue(t.propType.initial_value??null)};if(!e)return{...t,disabled:i,resetValue:s};const l=w(t.propType,e.key),a=void 0!==t.baseValue&&null!==t.baseValue?null:l.default,c=e.extract(t.value??a??null),u=e.extract(t.baseValue??null),p=e.extract(t.placeholder??t.baseValue??null);return{...t,propType:l,setValue:function(n,o,i){if(r(n,i?.validation))return null===n?t?.setValue(null,o,i):t?.setValue(e?.create(n,o),{},i)},value:n?c:null,restoreValue:o,placeholder:p,baseValue:u,disabled:i,resetValue:s}}const E=t=>{const[n,r]=(0,e.useState)(!0);return{isValid:n,setIsValid:r,validate:(e,n)=>{let o=!0;return t.settings.required&&null===e&&(o=!1),n&&!n(e)&&(o=!1),r(o),o},restoreValue:()=>r(!0)}},w=(e,t)=>{let n=e;if("union"===e.kind&&(n=e.prop_types[t]),!n)throw new a({context:{key:t}});return n};function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(null,arguments)}const k=t=>e.createElement(i.FormLabel,x({size:"tiny"},t)),S=(0,e.createContext)(null),C=({children:t,items:n})=>e.createElement(S.Provider,{value:{items:n}},t),T=()=>{const t=(0,e.useContext)(S);return t?.items??[]};function O({customContext:t}){const n=T();return 0===n?.length?null:e.createElement(e.Fragment,null,n.map(({Adornment:n,id:r})=>e.createElement(n,{key:r,customContext:t})))}const A=({children:t,...n})=>e.createElement(i.Stack,{direction:"row",alignItems:"center",justifyItems:"start",gap:.25},e.createElement(k,n,t),e.createElement(O,null)),M=(0,e.createContext)([]),P=({replacements:t,children:n})=>e.createElement(M.Provider,{value:t},n),I=t=>{const{value:n,placeholder:r}=b(),o=(0,e.useContext)(M);try{const e=o.find(e=>e.condition({value:n,placeholder:r}));return{ControlToRender:e?.component??t,OriginalControl:t,isReplaced:!!e}}catch{return{ControlToRender:t,OriginalControl:t}}},_=()=>{const e=[];return{registerControlReplacement:function(t){e.push(t)},getControlReplacements:function(){return e}}},{registerControlReplacement:N,getControlReplacements:R}=_();function D(t){return n=>{const{ControlToRender:r,OriginalControl:o,isReplaced:s}=I(t),l=s?{...n,OriginalControl:o}:n;return e.createElement(i.ErrorBoundary,{fallback:null},e.createElement(r,l))}}Symbol("control");var L=window.elementorV2.query,z=window.elementorV2.httpClient;const j="elementor/v1/settings",$=e=>e.data.value,B="elementor_unfiltered_files_upload",F={queryKey:[B]},U=()=>(0,L.useQuery)({...F,queryFn:()=>{return(e=B,(0,z.httpService)().get(`${j}/${e}`).then(e=>$(e.data))).then(e=>V(e));var e},staleTime:1/0}),V=e=>Boolean("1"===e);var H=window.elementorV2.icons,W=window.elementorV2.wpMedia,G=window.elementorV2.editorUi;const K=(0,e.createContext)(null),q=({children:t,items:n})=>e.createElement(K.Provider,{value:{items:n}},t),J=()=>{const t=(0,e.useContext)(K);if(!t)throw new Error("useControlActions must be used within a ControlActionsProvider");return t};function Y({children:t}){const{items:n}=J(),{disabled:r}=b();if(0===n.length||r)return t;const o=n.map(({MenuItem:t,id:n})=>e.createElement(t,{key:n}));return e.createElement(G.FloatingActionsBar,{actions:o},t)}const X=D(({mediaTypes:t=["image"]})=>{const{value:n,setValue:r,propType:l,placeholder:a}=b(o.imageSrcPropTypeUtil),{id:c,url:u}=n??{},{data:p,isFetching:d}=(0,W.useWpMediaAttachment)(c?.value||null),{data:h}=(0,W.useWpMediaAttachment)(a?.id?.value||null),f=p?.url??u?.value??h?.url??null,m=o.imageSrcPropTypeUtil.extract(l.default??null)?.url?.value,g=u?.value&&u.value!==m?u.value:void 0,y=n?.alt?.value,{open:v}=(0,W.useWpMediaFrame)({mediaTypes:t,multiple:!1,selected:c?.value||null,allowUrlImport:!0,onSelect:e=>{r({id:{$$type:"image-attachment-id",value:e.id},url:null})},onSelectUrl:(e,t)=>{r({id:null,url:o.urlPropTypeUtil.create(e),alt:t?o.stringPropTypeUtil.create(t):null})}});return e.createElement(Y,null,e.createElement(i.Card,{variant:"outlined"},e.createElement(i.CardMedia,{image:f,sx:{height:l.meta.isDynamic?134:150}},d?e.createElement(i.Stack,{justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},e.createElement(i.CircularProgress,null)):e.createElement(e.Fragment,null)),e.createElement(i.CardOverlay,null,e.createElement(i.Stack,{gap:1},e.createElement(i.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>v({mode:"browse"})},(0,s.__)("Select image","elementor")),e.createElement(i.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:e.createElement(H.UploadIcon,null),onClick:()=>v({mode:"upload"})},(0,s.__)("Upload","elementor")),e.createElement(i.Button,{size:"tiny",variant:"text",color:"inherit",onClick:()=>v({mode:"url",currentUrl:g,currentAlt:y})},(0,s.__)("Insert from URL","elementor"))))))});function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q.apply(null,arguments)}const Z={MenuListProps:{sx:{maxHeight:"160px"}}},ee=D(({options:t,onChange:n,MenuProps:r=Z,ariaLabel:s})=>{const{value:l,setValue:a,disabled:c,placeholder:u}=b(o.stringPropTypeUtil),p=c||0===t.length;return e.createElement(Y,null,e.createElement(i.Select,{sx:{overflow:"hidden"},displayEmpty:!0,size:"tiny",MenuProps:r,"aria-label":s||u,renderValue:e=>te(t,u,e),value:l??"",onChange:e=>{const t=e.target.value||null;n?.(t,l),a(t)},disabled:p,fullWidth:!0},t.map(({label:t,...n})=>e.createElement(G.MenuListItem,Q({key:n.value},n,{value:n.value??""}),t))))});function te(t,n,r){const o=e=>t.find(({value:t})=>t===e);if(!ne(r))return o(r)?.label??r;if(n){const t=o(n)?.label??n;return e.createElement(i.Typography,{component:"span",variant:"inherit",color:"text.tertiary"},t)}return t.find(({value:e})=>ne(e))?.label??""}function ne(e){return null==e||""===e}const re=D(({sizes:t,label:n=(0,s.__)("Image","elementor")})=>{const r=b(o.imagePropTypeUtil);return e.createElement(d,r,e.createElement(i.Stack,{gap:1.5},e.createElement(A,null,n),e.createElement(oe,null),e.createElement(i.Grid,{container:!0,gap:1.5,alignItems:"center",flexWrap:"nowrap"},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,(0,s.__)("Resolution","elementor"))),e.createElement(i.Grid,{item:!0,xs:6,sx:{overflow:"hidden"}},e.createElement(ie,{sizes:t})))))}),oe=()=>{const{data:t}=U(),n=t?["image","svg"]:["image"];return e.createElement(m,{bind:"src"},e.createElement(X,{mediaTypes:n}))},ie=({sizes:t})=>e.createElement(m,{bind:"size"},e.createElement(ee,{options:t})),se=D(({placeholder:t,error:n,inputValue:r,inputDisabled:s,helperText:l,sx:a,ariaLabel:c})=>{const{value:u,setValue:p,disabled:d,placeholder:h}=b(o.stringPropTypeUtil),f=t??h??void 0;return e.createElement(Y,null,e.createElement(i.TextField,{size:"tiny",fullWidth:!0,disabled:s??d,value:r??u??"",onChange:e=>p(e.target.value),placeholder:f,error:n,helperText:l,sx:a,inputProps:{...c?{"aria-label":c}:{}}}))}),le=D(({placeholder:t,ariaLabel:n})=>{const{value:r,setValue:s,disabled:l,placeholder:a}=b(o.stringPropTypeUtil),c=t??a??void 0;return e.createElement(Y,null,e.createElement(i.TextField,{size:"tiny",multiline:!0,fullWidth:!0,minRows:5,disabled:l,value:r??"",onChange:e=>{s(e.target.value)},placeholder:c,inputProps:{...n?{"aria-label":n}:{}}}))});function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ce(e,t){if(e){if("string"==typeof e)return ae(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}function ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}(e,t)||ce(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(e){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(e)}function de(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t){for(var r=[],o=0;o<t.length;o++){var i=t[o];if(i){var s=pe(i);if("string"===s||"number"===s)r.push(i);else if("object"===s){var l=Array.isArray(i)?i:Object.entries(i).map(function(e){var t=ue(e,2),n=t[0];return t[1]?n:null});r=l.length?r.concat(l.filter(function(e){return!!e})):r}}}return r.join(" ").trim()}}function he(e){return function(e){if(Array.isArray(e))return ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ce(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e){var t=function(e){if("object"!=pe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pe(t)?t:t+""}function ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,me(r.key),r)}}function ye(e,t,n){return t&&ge(e.prototype,t),n&&ge(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ve(e,t,n){return(t=me(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function be(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ee(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw i}}}}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var we=function(){function e(){fe(this,e)}return ye(e,null,[{key:"innerWidth",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+(parseFloat(n.paddingLeft)+parseFloat(n.paddingRight))}return 0}},{key:"width",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-(parseFloat(n.paddingLeft)+parseFloat(n.paddingRight))}return 0}},{key:"getBrowserLanguage",value:function(){return navigator.userLanguage||navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"en"}},{key:"getWindowScrollTop",value:function(){var e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}},{key:"getWindowScrollLeft",value:function(){var e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}},{key:"getOuterWidth",value:function(e,t){if(e){var n=e.getBoundingClientRect().width||e.offsetWidth;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}},{key:"getOuterHeight",value:function(e,t){if(e){var n=e.getBoundingClientRect().height||e.offsetHeight;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}},{key:"getClientHeight",value:function(e,t){if(e){var n=e.clientHeight;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginTop)+parseFloat(r.marginBottom)}return n}return 0}},{key:"getClientWidth",value:function(e,t){if(e){var n=e.clientWidth;if(t){var r=getComputedStyle(e);n+=parseFloat(r.marginLeft)+parseFloat(r.marginRight)}return n}return 0}},{key:"getViewport",value:function(){var e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0];return{width:e.innerWidth||n.clientWidth||r.clientWidth,height:e.innerHeight||n.clientHeight||r.clientHeight}}},{key:"getOffset",value:function(e){if(e){var t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}},{key:"index",value:function(e){if(e)for(var t=e.parentNode.childNodes,n=0,r=0;r<t.length;r++){if(t[r]===e)return n;1===t[r].nodeType&&n++}return-1}},{key:"addMultipleClasses",value:function(e,t){if(e&&t)if(e.classList)for(var n=t.split(" "),r=0;r<n.length;r++)e.classList.add(n[r]);else for(var o=t.split(" "),i=0;i<o.length;i++)e.className=e.className+" "+o[i]}},{key:"removeMultipleClasses",value:function(e,t){if(e&&t)if(e.classList)for(var n=t.split(" "),r=0;r<n.length;r++)e.classList.remove(n[r]);else for(var o=t.split(" "),i=0;i<o.length;i++)e.className=e.className.replace(new RegExp("(^|\\b)"+o[i].split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"addClass",value:function(e,t){e&&t&&(e.classList?e.classList.add(t):e.className=e.className+" "+t)}},{key:"removeClass",value:function(e,t){e&&t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className))}},{key:"addStyles",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&Object.entries(t).forEach(function(t){var n=ue(t,2),r=n[0],o=n[1];return e.style[r]=o})}},{key:"find",value:function(e,t){return e?Array.from(e.querySelectorAll(t)):[]}},{key:"findSingle",value:function(e,t){return e?e.querySelector(t):null}},{key:"setAttributes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){var r=function(t,n){var o,i,s=null!=e&&null!==(o=e.$attrs)&&void 0!==o&&o[t]?[null==e||null===(i=e.$attrs)||void 0===i?void 0:i[t]]:[];return[n].flat().reduce(function(e,n){if(null!=n){var o=pe(n);if("string"===o||"number"===o)e.push(n);else if("object"===o){var i=Array.isArray(n)?r(t,n):Object.entries(n).map(function(e){var n=ue(e,2),r=n[0],o=n[1];return"style"!==t||!o&&0!==o?o?r:void 0:"".concat(r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(o)});e=i.length?e.concat(i.filter(function(e){return!!e})):e}}return e},s)};Object.entries(n).forEach(function(n){var o=ue(n,2),i=o[0],s=o[1];if(null!=s){var l=i.match(/^on(.+)/);l?e.addEventListener(l[1].toLowerCase(),s):"p-bind"===i?t.setAttributes(e,s):(s="class"===i?he(new Set(r("class",s))).join(" ").trim():"style"===i?r("style",s).join(";").trim():s,(e.$attrs=e.$attrs||{})&&(e.$attrs[i]=s),e.setAttribute(i,s))}})}}},{key:"getAttribute",value:function(e,t){if(e){var n=e.getAttribute(t);return isNaN(n)?"true"===n||"false"===n?"true"===n:n:+n}}},{key:"isAttributeEquals",value:function(e,t,n){return!!e&&this.getAttribute(e,t)===n}},{key:"isAttributeNotEquals",value:function(e,t,n){return!this.isAttributeEquals(e,t,n)}},{key:"getHeight",value:function(e){if(e){var t=e.offsetHeight,n=getComputedStyle(e);return t-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth))}return 0}},{key:"getWidth",value:function(e){if(e){var t=e.offsetWidth,n=getComputedStyle(e);return t-(parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth))}return 0}},{key:"alignOverlay",value:function(t,n,r){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t&&n&&("self"===r?this.relativePosition(t,n):(o&&(t.style.minWidth=e.getOuterWidth(n)+"px"),this.absolutePosition(t,n)))}},{key:"absolutePosition",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left";if(e&&t){var r,o,i=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),s=i.height,l=i.width,a=t.offsetHeight,c=t.offsetWidth,u=t.getBoundingClientRect(),p=this.getWindowScrollTop(),d=this.getWindowScrollLeft(),h=this.getViewport();u.top+a+s>h.height?((r=u.top+p-s)<0&&(r=p),e.style.transformOrigin="bottom"):(r=a+u.top+p,e.style.transformOrigin="top");var f=u.left;o="left"===n?f+l>h.width?Math.max(0,f+d+c-l):f+d:f+c-l<0?d:f+c-l+d,e.style.top=r+"px",e.style.left=o+"px"}}},{key:"relativePosition",value:function(e,t){if(e&&t){var n,r,o=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:this.getHiddenElementDimensions(e),i=t.offsetHeight,s=t.getBoundingClientRect(),l=this.getViewport();s.top+i+o.height>l.height?(n=-1*o.height,s.top+n<0&&(n=-1*s.top),e.style.transformOrigin="bottom"):(n=i,e.style.transformOrigin="top"),r=o.width>l.width?-1*s.left:s.left+o.width>l.width?-1*(s.left+o.width-l.width):0,e.style.top=n+"px",e.style.left=r+"px"}}},{key:"flipfitCollision",value:function(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left top",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left bottom",s=arguments.length>4?arguments[4]:void 0;if(t&&n){var l=n.getBoundingClientRect(),a=this.getViewport(),c=o.split(" "),u=i.split(" "),p=function(e,t){return t?+e.substring(e.search(/(\+|-)/g))||0:e.substring(0,e.search(/(\+|-)/g))||e},d={my:{x:p(c[0]),y:p(c[1]||c[0]),offsetX:p(c[0],!0),offsetY:p(c[1]||c[0],!0)},at:{x:p(u[0]),y:p(u[1]||u[0]),offsetX:p(u[0],!0),offsetY:p(u[1]||u[0],!0)}},h={left:function(){return d.my.offsetX+d.at.offsetX+l.left+("left"===d.my.x?0:-1*("center"===d.my.x?r.getOuterWidth(t)/2:r.getOuterWidth(t)))},top:function(){return d.my.offsetY+d.at.offsetY+l.top+("top"===d.my.y?0:-1*("center"===d.my.y?r.getOuterHeight(t)/2:r.getOuterHeight(t)))}},f={count:{x:0,y:0},left:function(){var n=h.left(),r=e.getWindowScrollLeft();t.style.left=n+r+"px",2===this.count.x?(t.style.left=r+"px",this.count.x=0):n<0&&(this.count.x++,d.my.x="left",d.at.x="right",d.my.offsetX*=-1,d.at.offsetX*=-1,this.right())},right:function(){var r=h.left()+e.getOuterWidth(n),o=e.getWindowScrollLeft();t.style.left=r+o+"px",2===this.count.x?(t.style.left=a.width-e.getOuterWidth(t)+o+"px",this.count.x=0):r+e.getOuterWidth(t)>a.width&&(this.count.x++,d.my.x="right",d.at.x="left",d.my.offsetX*=-1,d.at.offsetX*=-1,this.left())},top:function(){var n=h.top(),r=e.getWindowScrollTop();t.style.top=n+r+"px",2===this.count.y?(t.style.left=r+"px",this.count.y=0):n<0&&(this.count.y++,d.my.y="top",d.at.y="bottom",d.my.offsetY*=-1,d.at.offsetY*=-1,this.bottom())},bottom:function(){var r=h.top()+e.getOuterHeight(n),o=e.getWindowScrollTop();t.style.top=r+o+"px",2===this.count.y?(t.style.left=a.height-e.getOuterHeight(t)+o+"px",this.count.y=0):r+e.getOuterHeight(n)>a.height&&(this.count.y++,d.my.y="bottom",d.at.y="top",d.my.offsetY*=-1,d.at.offsetY*=-1,this.top())},center:function(r){if("y"===r){var o=h.top()+e.getOuterHeight(n)/2;t.style.top=o+e.getWindowScrollTop()+"px",o<0?this.bottom():o+e.getOuterHeight(n)>a.height&&this.top()}else{var i=h.left()+e.getOuterWidth(n)/2;t.style.left=i+e.getWindowScrollLeft()+"px",i<0?this.left():i+e.getOuterWidth(t)>a.width&&this.right()}}};f[d.at.x]("x"),f[d.at.y]("y"),this.isFunction(s)&&s(d)}}},{key:"findCollisionPosition",value:function(e){if(e){var t="left"===e?"right":"left";return"top"===e||"bottom"===e?{axis:"y",my:"center ".concat("top"===e?"bottom":"top"),at:"center ".concat(e)}:{axis:"x",my:"".concat(t," center"),at:"".concat(e," center")}}}},{key:"getParents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===e.parentNode?t:this.getParents(e.parentNode,t.concat([e.parentNode]))}},{key:"getScrollableParents",value:function(e){var t=this,n=[];if(e){var r,o=this.getParents(e),i=/(auto|scroll)/,s=function(e){var t=e?getComputedStyle(e):null;return t&&(i.test(t.getPropertyValue("overflow"))||i.test(t.getPropertyValue("overflow-x"))||i.test(t.getPropertyValue("overflow-y")))},l=function(e){n.push("BODY"===e.nodeName||"HTML"===e.nodeName||t.isDocument(e)?window:e)},a=be(o);try{for(a.s();!(r=a.n()).done;){var c,u=r.value,p=1===u.nodeType&&(null===(c=u.dataset)||void 0===c?void 0:c.scrollselectors);if(p){var d,h=be(p.split(","));try{for(h.s();!(d=h.n()).done;){var f=d.value,m=this.findSingle(u,f);m&&s(m)&&l(m)}}catch(e){h.e(e)}finally{h.f()}}1===u.nodeType&&s(u)&&l(u)}}catch(e){a.e(e)}finally{a.f()}}return n}},{key:"getHiddenElementOuterHeight",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetHeight;return e.style.display="none",e.style.visibility="visible",t}return 0}},{key:"getHiddenElementOuterWidth",value:function(e){if(e){e.style.visibility="hidden",e.style.display="block";var t=e.offsetWidth;return e.style.display="none",e.style.visibility="visible",t}return 0}},{key:"getHiddenElementDimensions",value:function(e){var t={};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible"),t}},{key:"fadeIn",value:function(e,t){if(e){e.style.opacity=0;var n=+new Date,r=0,o=function(){r=+e.style.opacity+((new Date).getTime()-n)/t,e.style.opacity=r,n=+new Date,+r<1&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))};o()}}},{key:"fadeOut",value:function(e,t){if(e)var n=1,r=50/t,o=setInterval(function(){(n-=r)<=0&&(n=0,clearInterval(o)),e.style.opacity=n},50)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isChrome",value:function(){return/(chrome)/i.test(navigator.userAgent)}},{key:"isClient",value:function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"appendChild",value:function(e,t){if(this.isElement(t))t.appendChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot append "+t+" to "+e);t.el.nativeElement.appendChild(e)}}},{key:"removeChild",value:function(e,t){if(this.isElement(t))t.removeChild(e);else{if(!t.el||!t.el.nativeElement)throw new Error("Cannot remove "+e+" from "+t);t.el.nativeElement.removeChild(e)}}},{key:"isElement",value:function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":pe(HTMLElement))?e instanceof HTMLElement:e&&"object"===pe(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}},{key:"isDocument",value:function(e){return"object"===("undefined"==typeof Document?"undefined":pe(Document))?e instanceof Document:e&&"object"===pe(e)&&null!==e&&9===e.nodeType}},{key:"scrollInView",value:function(e,t){var n=getComputedStyle(e).getPropertyValue("border-top-width"),r=n?parseFloat(n):0,o=getComputedStyle(e).getPropertyValue("padding-top"),i=o?parseFloat(o):0,s=e.getBoundingClientRect(),l=t.getBoundingClientRect().top+document.body.scrollTop-(s.top+document.body.scrollTop)-r-i,a=e.scrollTop,c=e.clientHeight,u=this.getOuterHeight(t);l<0?e.scrollTop=a+l:l+u>c&&(e.scrollTop=a+l-c+u)}},{key:"clearSelection",value: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(e){}}},{key:"calculateScrollbarWidth",value:function(e){if(e){var t=getComputedStyle(e);return e.offsetWidth-e.clientWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.borderRightWidth)}if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var n=document.createElement("div");n.className="p-scrollbar-measure",document.body.appendChild(n);var r=n.offsetWidth-n.clientWidth;return document.body.removeChild(n),this.calculatedScrollbarWidth=r,r}},{key:"calculateBodyScrollbarWidth",value:function(){return window.innerWidth-document.documentElement.offsetWidth}},{key:"getBrowser",value: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}},{key:"resolveUserAgent",value:function(){var e=navigator.userAgent.toLowerCase(),t=/(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:t[1]||"",version:t[2]||"0"}}},{key:"blockBodyScroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";!document.body.style.getPropertyValue("--scrollbar-width")&&document.body.style.setProperty("--scrollbar-width",this.calculateBodyScrollbarWidth()+"px"),this.addClass(document.body,e)}},{key:"unblockBodyScroll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,e)}},{key:"isVisible",value:function(e){return e&&(0!==e.clientHeight||0!==e.getClientRects().length||"none"!==getComputedStyle(e).display)}},{key:"isExist",value:function(e){return!(null==e||!e.nodeName||!e.parentNode)}},{key:"getFocusableElements",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=[],i=be(e.find(t,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(r,',\n [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r,',\n [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(r)));try{for(i.s();!(n=i.n()).done;){var s=n.value;"none"!==getComputedStyle(s).display&&"hidden"!==getComputedStyle(s).visibility&&o.push(s)}}catch(e){i.e(e)}finally{i.f()}return o}},{key:"getFirstFocusableElement",value:function(t,n){var r=e.getFocusableElements(t,n);return r.length>0?r[0]:null}},{key:"getLastFocusableElement",value:function(t,n){var r=e.getFocusableElements(t,n);return r.length>0?r[r.length-1]:null}},{key:"focus",value:function(e,t){var n=void 0===t||!t;e&&document.activeElement!==e&&e.focus({preventScroll:n})}},{key:"focusFirstElement",value:function(t,n){if(t){var r=e.getFirstFocusableElement(t);return r&&e.focus(r,n),r}}},{key:"getCursorOffset",value:function(e,t,n,r){if(e){var o=getComputedStyle(e),i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.overflow=o.overflow,i.style.width=o.width,i.style.height=o.height,i.style.padding=o.padding,i.style.border=o.border,i.style.overflowWrap=o.overflowWrap,i.style.whiteSpace=o.whiteSpace,i.style.lineHeight=o.lineHeight,i.innerHTML=t.replace(/\r\n|\r|\n/g,"<br />");var s=document.createElement("span");s.textContent=r,i.appendChild(s);var l=document.createTextNode(n);i.appendChild(l),document.body.appendChild(i);var a=s.offsetLeft,c=s.offsetTop,u=s.clientHeight;return document.body.removeChild(i),{left:Math.abs(a-e.scrollLeft),top:Math.abs(c-e.scrollTop)+u}}return{top:"auto",left:"auto"}}},{key:"invokeElementMethod",value:function(e,t,n){e[t].apply(e,n)}},{key:"isClickable",value:function(e){var t=e.nodeName,n=e.parentElement&&e.parentElement.nodeName;return"INPUT"===t||"TEXTAREA"===t||"BUTTON"===t||"A"===t||"INPUT"===n||"TEXTAREA"===n||"BUTTON"===n||"A"===n||this.hasClass(e,"p-button")||this.hasClass(e.parentElement,"p-button")||this.hasClass(e.parentElement,"p-checkbox")||this.hasClass(e.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function(e,t){if("string"==typeof t)e.style.cssText=t;else for(var n in t)e.style[n]=t[n]}},{key:"exportCSV",value:function(t,n){var r=new Blob([t],{type:"application/csv;charset=utf-8;"});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,n+".csv"):e.saveAs({name:n+".csv",src:URL.createObjectURL(r)})||(t="data:text/csv;charset=utf-8,"+t,window.open(encodeURI(t)))}},{key:"saveAs",value:function(e){if(e){var t=document.createElement("a");if(void 0!==t.download){var n=e.name,r=e.src;return t.setAttribute("href",r),t.setAttribute("download",n),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),!0}}return!1}},{key:"createInlineStyle",value:function(t,n){var r=document.createElement("style");return e.addNonce(r,t),n||(n=document.head),n.appendChild(r),r}},{key:"removeInlineStyle",value:function(e){if(this.isExist(e)){try{e.parentNode.removeChild(e)}catch(e){}e=null}return e}},{key:"addNonce",value:function(e,t){try{t||(t=process.env.REACT_APP_CSS_NONCE)}catch(e){}t&&e.setAttribute("nonce",t)}},{key:"getTargetElement",value:function(e){if(!e)return null;if("document"===e)return document;if("window"===e)return window;if("object"===pe(e)&&e.hasOwnProperty("current"))return this.isExist(e.current)?e.current:null;var t,n=(t=e)&&t.constructor&&t.call&&t.apply?e():e;return this.isDocument(n)||this.isExist(n)?n:null}},{key:"getAttributeNames",value:function(e){var t,n,r;for(n=[],r=e.attributes,t=0;t<r.length;++t)n.push(r[t].nodeName);return n.sort(),n}},{key:"isEqualElement",value:function(t,n){var r,o,i,s,l;if(r=e.getAttributeNames(t),o=e.getAttributeNames(n),r.join(",")!==o.join(","))return!1;for(var a=0;a<r.length;++a)if("style"===(i=r[a]))for(var c=t.style,u=n.style,p=/^\d+$/,d=0,h=Object.keys(c);d<h.length;d++){var f=h[d];if(!p.test(f)&&c[f]!==u[f])return!1}else if(t.getAttribute(i)!==n.getAttribute(i))return!1;for(s=t.firstChild,l=n.firstChild;s&&l;s=s.nextSibling,l=l.nextSibling){if(s.nodeType!==l.nodeType)return!1;if(1===s.nodeType){if(!e.isEqualElement(s,l))return!1}else if(s.nodeValue!==l.nodeValue)return!1}return!s&&!l}},{key:"hasCSSAnimation",value:function(e){if(e){var t=getComputedStyle(e);return parseFloat(t.getPropertyValue("animation-duration")||"0")>0}return!1}},{key:"hasCSSTransition",value:function(e){if(e){var t=getComputedStyle(e);return parseFloat(t.getPropertyValue("transition-duration")||"0")>0}return!1}}])}();function xe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ke(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw i}}}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}ve(we,"DATA_PROPS",["data-"]),ve(we,"ARIA_PROPS",["aria","focus-target"]);var Se=function(){function e(){fe(this,e)}return ye(e,null,[{key:"equals",value:function(e,t,n){return n&&e&&"object"===pe(e)&&t&&"object"===pe(t)?this.deepEquals(this.resolveFieldData(e,n),this.resolveFieldData(t,n)):this.deepEquals(e,t)}},{key:"deepEquals",value:function(e,t){if(e===t)return!0;if(e&&t&&"object"===pe(e)&&"object"===pe(t)){var n,r,o,i=Array.isArray(e),s=Array.isArray(t);if(i&&s){if((r=e.length)!==t.length)return!1;for(n=r;0!==n--;)if(!this.deepEquals(e[n],t[n]))return!1;return!0}if(i!==s)return!1;var l=e instanceof Date,a=t instanceof Date;if(l!==a)return!1;if(l&&a)return e.getTime()===t.getTime();var c=e instanceof RegExp,u=t instanceof RegExp;if(c!==u)return!1;if(c&&u)return e.toString()===t.toString();var p=Object.keys(e);if((r=p.length)!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!Object.prototype.hasOwnProperty.call(t,p[n]))return!1;for(n=r;0!==n--;)if(o=p[n],!this.deepEquals(e[o],t[o]))return!1;return!0}return e!=e&&t!=t}},{key:"resolveFieldData",value:function(e,t){if(!e||!t)return null;try{var n=e[t];if(this.isNotEmpty(n))return n}catch(e){}if(Object.keys(e).length){if(this.isFunction(t))return t(e);if(this.isNotEmpty(e[t]))return e[t];if(-1===t.indexOf("."))return e[t];for(var r=t.split("."),o=e,i=0,s=r.length;i<s;++i){if(null==o)return null;o=o[r[i]]}return o}return null}},{key:"findDiffKeys",value:function(e,t){return e&&t?Object.keys(e).filter(function(e){return!t.hasOwnProperty(e)}).reduce(function(t,n){return t[n]=e[n],t},{}):{}}},{key:"reduceKeys",value:function(e,t){var n={};return e&&t&&0!==t.length?(Object.keys(e).filter(function(e){return t.some(function(t){return e.startsWith(t)})}).forEach(function(t){n[t]=e[t],delete e[t]}),n):n}},{key:"reorderArray",value:function(e,t,n){e&&t!==n&&(n>=e.length&&(n%=e.length,t%=e.length),e.splice(n,0,e.splice(t,1)[0]))}},{key:"findIndexInList",value:function(e,t,n){var r=this;return t?n?t.findIndex(function(t){return r.equals(t,e,n)}):t.findIndex(function(t){return t===e}):-1}},{key:"getJSXElement",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.isFunction(e)?e.apply(void 0,n):e}},{key:"getItemValue",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return this.isFunction(e)?e.apply(void 0,n):e}},{key:"getProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e?e[t]:void 0;return void 0===r?n[t]:r}},{key:"getPropCaseInsensitive",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.toFlatCase(t);for(var o in e)if(e.hasOwnProperty(o)&&this.toFlatCase(o)===r)return e[o];for(var i in n)if(n.hasOwnProperty(i)&&this.toFlatCase(i)===r)return n[i]}},{key:"getMergedProps",value:function(e,t){return Object.assign({},t,e)}},{key:"getDiffProps",value:function(e,t){return this.findDiffKeys(e,t)}},{key:"getPropValue",value:function(e){if(!this.isFunction(e))return e;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(1===n.length){var o=n[0];return e(Array.isArray(o)?o[0]:o)}return e.apply(void 0,n)}},{key:"getComponentProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.isNotEmpty(e)?this.getProp(e.props,t,n):void 0}},{key:"getComponentProps",value:function(e,t){return this.isNotEmpty(e)?this.getMergedProps(e.props,t):void 0}},{key:"getComponentDiffProps",value:function(e,t){return this.isNotEmpty(e)?this.getDiffProps(e.props,t):void 0}},{key:"isValidChild",value:function(e,t,n){if(e){var r,o=this.getComponentProp(e,"__TYPE")||(e.type?e.type.displayName:void 0);return!o&&null!=e&&null!==(r=e.type)&&void 0!==r&&null!==(r=r._payload)&&void 0!==r&&r.value&&(o=e.type._payload.value.find(function(e){return e===t})),o===t}return!1}},{key:"getRefElement",value:function(e){return e?"object"===pe(e)&&e.hasOwnProperty("current")?e.current:e:null}},{key:"combinedRefs",value:function(e,t){e&&t&&("function"==typeof t?t(e.current):t.current=e.current)}},{key:"removeAccents",value:function(e){return e&&e.search(/[\xC0-\xFF]/g)>-1&&(e=e.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),e}},{key:"toFlatCase",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e.replace(/(-|_)/g,"").toLowerCase():e}},{key:"toCapitalCase",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e[0].toUpperCase()+e.slice(1):e}},{key:"trim",value:function(e){return this.isNotEmpty(e)&&this.isString(e)?e.trim():e}},{key:"isEmpty",value:function(e){return null==e||""===e||Array.isArray(e)&&0===e.length||!(e instanceof Date)&&"object"===pe(e)&&0===Object.keys(e).length}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"isFunction",value:function(e){return!!(e&&e.constructor&&e.call&&e.apply)}},{key:"isObject",value:function(e){return null!==e&&e instanceof Object&&e.constructor===Object}},{key:"isDate",value:function(e){return null!==e&&e instanceof Date&&e.constructor===Date}},{key:"isArray",value:function(e){return null!==e&&Array.isArray(e)}},{key:"isString",value:function(e){return null!==e&&"string"==typeof e}},{key:"isPrintableCharacter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.isNotEmpty(e)&&1===e.length&&e.match(/\S| /)}},{key:"isLetter",value:function(e){return/^[a-zA-Z\u00C0-\u017F]$/.test(e)}},{key:"isScalar",value:function(e){return null!=e&&("string"==typeof e||"number"==typeof e||"bigint"==typeof e||"boolean"==typeof e)}},{key:"findLast",value:function(e,t){var n;if(this.isNotEmpty(e))try{n=e.findLast(t)}catch(r){n=he(e).reverse().find(t)}return n}},{key:"findLastIndex",value:function(e,t){var n=-1;if(this.isNotEmpty(e))try{n=e.findLastIndex(t)}catch(r){n=e.lastIndexOf(he(e).reverse().find(t))}return n}},{key:"sort",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=this.compare(e,t,r,n),s=n;return(this.isEmpty(e)||this.isEmpty(t))&&(s=1===o?n:o),s*i}},{key:"compare",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=this.isEmpty(e),i=this.isEmpty(t);return o&&i?0:o?r:i?-r:"string"==typeof e&&"string"==typeof t?n(e,t):e<t?-1:e>t?1:0}},{key:"localeComparator",value:function(e){return new Intl.Collator(e,{numeric:!0}).compare}},{key:"findChildrenByKey",value:function(e,t){var n,r=xe(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.key===t)return o.children||[];if(o.children){var i=this.findChildrenByKey(o.children,t);if(i.length>0)return i}}}catch(e){r.e(e)}finally{r.f()}return[]}},{key:"mutateFieldData",value:function(e,t,n){if("object"===pe(e)&&"string"==typeof t)for(var r=t.split("."),o=e,i=0,s=r.length;i<s;++i){if(i+1-s===0){o[r[i]]=n;break}o[r[i]]||(o[r[i]]={}),o=o[r[i]]}}},{key:"getNestedValue",value:function(e,t){return t.split(".").reduce(function(e,t){return e&&void 0!==e[t]?e[t]:void 0},e)}},{key:"absoluteCompare",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!t||!n)return!0;if(o>r)return!0;if(pe(t)!==pe(n))return!1;var i=Object.keys(t),s=Object.keys(n);if(i.length!==s.length)return!1;for(var l=0,a=i;l<a.length;l++){var c=a[l],u=t[c],p=n[c],d=e.isObject(u)&&e.isObject(p),h=e.isFunction(u)&&e.isFunction(p);if((d||h)&&!this.absoluteCompare(u,p,r,o+1))return!1;if(!d&&u!==p)return!1}return!0}},{key:"selectiveCompare",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e===t)return!0;if(!e||!t||"object"!==pe(e)||"object"!==pe(t))return!1;if(!n)return this.absoluteCompare(e,t,1);var o,i=xe(n);try{for(i.s();!(o=i.n()).done;){var s=o.value,l=this.getNestedValue(e,s),a=this.getNestedValue(t,s),c="object"===pe(l)&&null!==l&&"object"===pe(a)&&null!==a;if(c&&!this.absoluteCompare(l,a,r))return!1;if(!c&&l!==a)return!1}}catch(e){i.e(e)}finally{i.f()}return!0}}])}(),Ce=0;function Te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(n),!0).forEach(function(t){ve(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ae(e){if(e){var t=function(e){return"function"==typeof e},n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).classNameMergeFunction,r=t(n);return e.reduce(function(e,o){if(!o)return e;var i=function(){var i=o[s];if("style"===s)e.style=Oe(Oe({},e.style),o.style);else if("className"===s){var l;l=r?n(e.className,o.className):[e.className,o.className].join(" ").trim(),e.className=l||void 0}else if(t(i)){var a=e[s];e[s]=a?function(){a.apply(void 0,arguments),i.apply(void 0,arguments)}:i}else e[s]=i};for(var s in o)i();return e},{})}}var Me,Pe,Ie=(Me=[],Pe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return he(Me).reverse().find(function(n){return!!t||n.key===e})||{key:e,value:n}},{get:function(e){return e&&parseInt(e.style.zIndex,10)||0},set:function(e,t,n,r){t&&(t.style.zIndex=String(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=Pe(e,t,n),o=r.value+(r.key===e?0:n)+1;return Me.push({key:e,value:o}),o}(e,n,r)))},clear:function(e){var t;e&&(t=Ie.get(e),Me=Me.filter(function(e){return e.value!==t}),e.style.zIndex="")},getCurrent:function(e,t){return function(e,t){return Pe(e,t).value}(e,t)}}),_e=Object.freeze({STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",NOT_IN:"notIn",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter",CUSTOM:"custom"});function Ne(e){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}function Re(e){var t=function(e){if("object"!=Ne(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ne(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ne(t)?t:t+""}function De(e,t,n){return(t=Re(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Le(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Re(r.key),r)}}function ze(e,t,n){return t&&Le(e.prototype,t),n&&Le(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.freeze({AND:"and",OR:"or"});var je=ze(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)});De(je,"ripple",!1),De(je,"inputStyle","outlined"),De(je,"locale","en"),De(je,"appendTo",null),De(je,"cssTransition",!0),De(je,"autoZIndex",!0),De(je,"hideOverlaysOnDocumentScrolling",!1),De(je,"nonce",null),De(je,"nullSortOrder",1),De(je,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200}),De(je,"pt",void 0),De(je,"filterMatchModeOptions",{text:[_e.STARTS_WITH,_e.CONTAINS,_e.NOT_CONTAINS,_e.ENDS_WITH,_e.EQUALS,_e.NOT_EQUALS],numeric:[_e.EQUALS,_e.NOT_EQUALS,_e.LESS_THAN,_e.LESS_THAN_OR_EQUAL_TO,_e.GREATER_THAN,_e.GREATER_THAN_OR_EQUAL_TO],date:[_e.DATE_IS,_e.DATE_IS_NOT,_e.DATE_BEFORE,_e.DATE_AFTER]}),De(je,"changeTheme",function(e,t,n,r){var o,i=document.getElementById(n);if(!i)throw Error("Element with id ".concat(n," not found."));var s=i.getAttribute("href").replace(e,t),l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("id",n),l.setAttribute("href",s),l.addEventListener("load",function(){r&&r()}),null===(o=i.parentNode)||void 0===o||o.replaceChild(l,i)}),Object.freeze({SUCCESS:"success",INFO:"info",WARN:"warn",ERROR:"error",SECONDARY:"secondary",CONTRAST:"contrast"}),Object.freeze({ADDRESS_BOOK:"pi pi-address-book",ALIGN_CENTER:"pi pi-align-center",ALIGN_JUSTIFY:"pi pi-align-justify",ALIGN_LEFT:"pi pi-align-left",ALIGN_RIGHT:"pi pi-align-right",AMAZON:"pi pi-amazon",ANDROID:"pi pi-android",ANGLE_DOUBLE_DOWN:"pi pi-angle-double-down",ANGLE_DOUBLE_LEFT:"pi pi-angle-double-left",ANGLE_DOUBLE_RIGHT:"pi pi-angle-double-right",ANGLE_DOUBLE_UP:"pi pi-angle-double-up",ANGLE_DOWN:"pi pi-angle-down",ANGLE_LEFT:"pi pi-angle-left",ANGLE_RIGHT:"pi pi-angle-right",ANGLE_UP:"pi pi-angle-up",APPLE:"pi pi-apple",ARROW_CIRCLE_DOWN:"pi pi-arrow-circle-down",ARROW_CIRCLE_LEFT:"pi pi-arrow-circle-left",ARROW_CIRCLE_RIGHT:"pi pi-arrow-circle-right",ARROW_CIRCLE_UP:"pi pi-arrow-circle-up",ARROW_DOWN_LEFT_AND_ARROW_UP_RIGHT_TO_CENTER:"pi pi-arrow-down-left-and-arrow-up-right-to-center",ARROW_DOWN_LEFT:"pi pi-arrow-down-left",ARROW_DOWN_RIGHT:"pi pi-arrow-down-right",ARROW_DOWN:"pi pi-arrow-down",ARROW_LEFT:"pi pi-arrow-left",ARROW_RIGHT_ARROW_LEFT:"pi pi-arrow-right-arrow-left",ARROW_RIGHT:"pi pi-arrow-right",ARROW_UP_LEFT:"pi pi-arrow-up-left",ARROW_UP_RIGHT_AND_ARROW_DOWN_LEFT_FROM_CENTER:"pi pi-arrow-up-right-and-arrow-down-left-from-center",ARROW_UP_RIGHT:"pi pi-arrow-up-right",ARROW_UP:"pi pi-arrow-up",ARROWS_ALT:"pi pi-arrows-alt",ARROWS_H:"pi pi-arrows-h",ARROWS_V:"pi pi-arrows-v",ASTERISK:"pi pi-asterisk",AT:"pi pi-at",BACKWARD:"pi pi-backward",BAN:"pi pi-ban",BARCODE:"pi pi-barcode",BARS:"pi pi-bars",BELL_SLASH:"pi pi-bell-slash",BELL:"pi pi-bell",BITCOIN:"pi pi-bitcoin",BOLT:"pi pi-bolt",BOOK:"pi pi-book",BOOKMARK_FILL:"pi pi-bookmark-fill",BOOKMARK:"pi pi-bookmark",BOX:"pi pi-box",BRIEFCASE:"pi pi-briefcase",BUILDING_COLUMNS:"pi pi-building-columns",BUILDING:"pi pi-building",BULLSEYE:"pi pi-bullseye",CALCULATOR:"pi pi-calculator",CALENDAR_CLOCK:"pi pi-calendar-clock",CALENDAR_MINUS:"pi pi-calendar-minus",CALENDAR_PLUS:"pi pi-calendar-plus",CALENDAR_TIMES:"pi pi-calendar-times",CALENDAR:"pi pi-calendar",CAMERA:"pi pi-camera",CAR:"pi pi-car",CARET_DOWN:"pi pi-caret-down",CARET_LEFT:"pi pi-caret-left",CARET_RIGHT:"pi pi-caret-right",CARET_UP:"pi pi-caret-up",CART_ARROW_DOWN:"pi pi-cart-arrow-down",CART_MINUS:"pi pi-cart-minus",CART_PLUS:"pi pi-cart-plus",CHART_BAR:"pi pi-chart-bar",CHART_LINE:"pi pi-chart-line",CHART_PIE:"pi pi-chart-pie",CHART_SCATTER:"pi pi-chart-scatter",CHECK_CIRCLE:"pi pi-check-circle",CHECK_SQUARE:"pi pi-check-square",CHECK:"pi pi-check",CHEVRON_CIRCLE_DOWN:"pi pi-chevron-circle-down",CHEVRON_CIRCLE_LEFT:"pi pi-chevron-circle-left",CHEVRON_CIRCLE_RIGHT:"pi pi-chevron-circle-right",CHEVRON_CIRCLE_UP:"pi pi-chevron-circle-up",CHEVRON_DOWN:"pi pi-chevron-down",CHEVRON_LEFT:"pi pi-chevron-left",CHEVRON_RIGHT:"pi pi-chevron-right",CHEVRON_UP:"pi pi-chevron-up",CIRCLE_FILL:"pi pi-circle-fill",CIRCLE_OFF:"pi pi-circle-off",CIRCLE_ON:"pi pi-circle-on",CIRCLE:"pi pi-circle",CLIPBOARD:"pi pi-clipboard",CLOCK:"pi pi-clock",CLONE:"pi pi-clone",CLOUD_DOWNLOAD:"pi pi-cloud-download",CLOUD_UPLOAD:"pi pi-cloud-upload",CLOUD:"pi pi-cloud",CODE:"pi pi-code",COG:"pi pi-cog",COMMENT:"pi pi-comment",COMMENTS:"pi pi-comments",COMPASS:"pi pi-compass",COPY:"pi pi-copy",CREDIT_CARD:"pi pi-credit-card",CROWN:"pi pi-crown",DATABASE:"pi pi-database",DELETE_LEFT:"pi pi-delete-left",DESKTOP:"pi pi-desktop",DIRECTIONS_ALT:"pi pi-directions-alt",DIRECTIONS:"pi pi-directions",DISCORD:"pi pi-discord",DOLLAR:"pi pi-dollar",DOWNLOAD:"pi pi-download",EJECT:"pi pi-eject",ELLIPSIS_H:"pi pi-ellipsis-h",ELLIPSIS_V:"pi pi-ellipsis-v",ENVELOPE:"pi pi-envelope",EQUALS:"pi pi-equals",ERASER:"pi pi-eraser",ETHEREUM:"pi pi-ethereum",EURO:"pi pi-euro",EXCLAMATION_CIRCLE:"pi pi-exclamation-circle",EXCLAMATION_TRIANGLE:"pi pi-exclamation-triangle",EXPAND:"pi pi-expand",EXTERNAL_LINK:"pi pi-external-link",EYE_SLASH:"pi pi-eye-slash",EYE:"pi pi-eye",FACE_SMILE:"pi pi-face-smile",FACEBOOK:"pi pi-facebook",FAST_BACKWARD:"pi pi-fast-backward",FAST_FORWARD:"pi pi-fast-forward",FILE_ARROW_UP:"pi pi-file-arrow-up",FILE_CHECK:"pi pi-file-check",FILE_EDIT:"pi pi-file-edit",FILE_EXCEL:"pi pi-file-excel",FILE_EXPORT:"pi pi-file-export",FILE_IMPORT:"pi pi-file-import",FILE_O:"pi pi-file-o",FILE_PDF:"pi pi-file-pdf",FILE_PLUS:"pi pi-file-plus",FILE_WORD:"pi pi-file-word",FILE:"pi pi-file",FILTER_FILL:"pi pi-filter-fill",FILTER_SLASH:"pi pi-filter-slash",FILTER:"pi pi-filter",FLAG_FILL:"pi pi-flag-fill",FLAG:"pi pi-flag",FOLDER_OPEN:"pi pi-folder-open",FOLDER_PLUS:"pi pi-folder-plus",FOLDER:"pi pi-folder",FORWARD:"pi pi-forward",GAUGE:"pi pi-gauge",GIFT:"pi pi-gift",GITHUB:"pi pi-github",GLOBE:"pi pi-globe",GOOGLE:"pi pi-google",GRADUATION_CAP:"pi pi-graduation-cap",HAMMER:"pi pi-hammer",HASHTAG:"pi pi-hashtag",HEADPHONES:"pi pi-headphones",HEART_FILL:"pi pi-heart-fill",HEART:"pi pi-heart",HISTORY:"pi pi-history",HOME:"pi pi-home",HOURGLASS:"pi pi-hourglass",ID_CARD:"pi pi-id-card",IMAGE:"pi pi-image",IMAGES:"pi pi-images",INBOX:"pi pi-inbox",INDIAN_RUPEE:"pi pi-indian-rupee",INFO_CIRCLE:"pi pi-info-circle",INFO:"pi pi-info",INSTAGRAM:"pi pi-instagram",KEY:"pi pi-key",LANGUAGE:"pi pi-language",LIGHTBULB:"pi pi-lightbulb",LINK:"pi pi-link",LINKEDIN:"pi pi-linkedin",LIST_CHECK:"pi pi-list-check",LIST:"pi pi-list",LOCK_OPEN:"pi pi-lock-open",LOCK:"pi pi-lock",MAP_MARKER:"pi pi-map-marker",MAP:"pi pi-map",MARS:"pi pi-mars",MEGAPHONE:"pi pi-megaphone",MICROCHIP_AI:"pi pi-microchip-ai",MICROCHIP:"pi pi-microchip",MICROPHONE:"pi pi-microphone",MICROSOFT:"pi pi-microsoft",MINUS_CIRCLE:"pi pi-minus-circle",MINUS:"pi pi-minus",MOBILE:"pi pi-mobile",MONEY_BILL:"pi pi-money-bill",MOON:"pi pi-moon",OBJECTS_COLUMN:"pi pi-objects-column",PALETTE:"pi pi-palette",PAPERCLIP:"pi pi-paperclip",PAUSE_CIRCLE:"pi pi-pause-circle",PAUSE:"pi pi-pause",PAYPAL:"pi pi-paypal",PEN_TO_SQUARE:"pi pi-pen-to-square",PENCIL:"pi pi-pencil",PERCENTAGE:"pi pi-percentage",PHONE:"pi pi-phone",PINTEREST:"pi pi-pinterest",PLAY_CIRCLE:"pi pi-play-circle",PLAY:"pi pi-play",PLUS_CIRCLE:"pi pi-plus-circle",PLUS:"pi pi-plus",POUND:"pi pi-pound",POWER_OFF:"pi pi-power-off",PRIME:"pi pi-prime",PRINT:"pi pi-print",QRCODE:"pi pi-qrcode",QUESTION_CIRCLE:"pi pi-question-circle",QUESTION:"pi pi-question",RECEIPT:"pi pi-receipt",REDDIT:"pi pi-reddit",REFRESH:"pi pi-refresh",REPLAY:"pi pi-replay",REPLY:"pi pi-reply",SAVE:"pi pi-save",SEARCH_MINUS:"pi pi-search-minus",SEARCH_PLUS:"pi pi-search-plus",SEARCH:"pi pi-search",SEND:"pi pi-send",SERVER:"pi pi-server",SHARE_ALT:"pi pi-share-alt",SHIELD:"pi pi-shield",SHOP:"pi pi-shop",SHOPPING_BAG:"pi pi-shopping-bag",SHOPPING_CART:"pi pi-shopping-cart",SIGN_IN:"pi pi-sign-in",SIGN_OUT:"pi pi-sign-out",SITEMAP:"pi pi-sitemap",SLACK:"pi pi-slack",SLIDERS_H:"pi pi-sliders-h",SLIDERS_V:"pi pi-sliders-v",SORT_ALPHA_DOWN_ALT:"pi pi-sort-alpha-down-alt",SORT_ALPHA_DOWN:"pi pi-sort-alpha-down",SORT_ALPHA_UP_ALT:"pi pi-sort-alpha-up-alt",SORT_ALPHA_UP:"pi pi-sort-alpha-up",SORT_ALT_SLASH:"pi pi-sort-alt-slash",SORT_ALT:"pi pi-sort-alt",SORT_AMOUNT_DOWN_ALT:"pi pi-sort-amount-down-alt",SORT_AMOUNT_DOWN:"pi pi-sort-amount-down",SORT_AMOUNT_UP_ALT:"pi pi-sort-amount-up-alt",SORT_AMOUNT_UP:"pi pi-sort-amount-up",SORT_DOWN_FILL:"pi pi-sort-down-fill",SORT_DOWN:"pi pi-sort-down",SORT_NUMERIC_DOWN_ALT:"pi pi-sort-numeric-down-alt",SORT_NUMERIC_DOWN:"pi pi-sort-numeric-down",SORT_NUMERIC_UP_ALT:"pi pi-sort-numeric-up-alt",SORT_NUMERIC_UP:"pi pi-sort-numeric-up",SORT_UP_FILL:"pi pi-sort-up-fill",SORT_UP:"pi pi-sort-up",SORT:"pi pi-sort",SPARKLES:"pi pi-sparkles",SPINNER_DOTTED:"pi pi-spinner-dotted",SPINNER:"pi pi-spinner",STAR_FILL:"pi pi-star-fill",STAR_HALF_FILL:"pi pi-star-half-fill",STAR_HALF:"pi pi-star-half",STAR:"pi pi-star",STEP_BACKWARD_ALT:"pi pi-step-backward-alt",STEP_BACKWARD:"pi pi-step-backward",STEP_FORWARD_ALT:"pi pi-step-forward-alt",STEP_FORWARD:"pi pi-step-forward",STOP_CIRCLE:"pi pi-stop-circle",STOP:"pi pi-stop",STOPWATCH:"pi pi-stopwatch",SUN:"pi pi-sun",SYNC:"pi pi-sync",TABLE:"pi pi-table",TABLET:"pi pi-tablet",TAG:"pi pi-tag",TAGS:"pi pi-tags",TELEGRAM:"pi pi-telegram",TH_LARGE:"pi pi-th-large",THUMBS_DOWN_FILL:"pi pi-thumbs-down-fill",THUMBS_DOWN:"pi pi-thumbs-down",THUMBS_UP_FILL:"pi pi-thumbs-up-fill",THUMBS_UP:"pi pi-thumbs-up",THUMBTACK:"pi pi-thumbtack",TICKET:"pi pi-ticket",TIKTOK:"pi pi-tiktok",TIMES_CIRCLE:"pi pi-times-circle",TIMES:"pi pi-times",TRASH:"pi pi-trash",TROPHY:"pi pi-trophy",TRUCK:"pi pi-truck",TURKISH_LIRA:"pi pi-turkish-lira",TWITCH:"pi pi-twitch",TWITTER:"pi pi-twitter",UNDO:"pi pi-undo",UNLOCK:"pi pi-unlock",UPLOAD:"pi pi-upload",USER_EDIT:"pi pi-user-edit",USER_MINUS:"pi pi-user-minus",USER_PLUS:"pi pi-user-plus",USER:"pi pi-user",USERS:"pi pi-users",VENUS:"pi pi-venus",VERIFIED:"pi pi-verified",VIDEO:"pi pi-video",VIMEO:"pi pi-vimeo",VOLUME_DOWN:"pi pi-volume-down",VOLUME_OFF:"pi pi-volume-off",VOLUME_UP:"pi pi-volume-up",WALLET:"pi pi-wallet",WAREHOUSE:"pi pi-warehouse",WAVE_PULSE:"pi pi-wave-pulse",WHATSAPP:"pi pi-whatsapp",WIFI:"pi pi-wifi",WINDOW_MAXIMIZE:"pi pi-window-maximize",WINDOW_MINIMIZE:"pi pi-window-minimize",WRENCH:"pi pi-wrench",YOUTUBE:"pi pi-youtube"}),Object.freeze({DESC:-1,UNSORTED:0,ASC:1});var $e=t().createContext(),Be=je;function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ue(e,t){if(e){if("string"==typeof e)return Fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fe(e,t):void 0}}function Ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}(e,t)||Ue(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var He=function(t){var n=e.useRef(null);return e.useEffect(function(){return n.current=t,function(){n.current=null}},[t]),n.current},We=function(t){return e.useEffect(function(){return t},[])},Ge=function(t){var n=t.target,r=void 0===n?"document":n,o=t.type,i=t.listener,s=t.options,l=t.when,a=void 0===l||l,c=e.useRef(null),u=e.useRef(null),p=He(i),d=He(s),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.target;Se.isNotEmpty(t)&&(f(),(e.when||a)&&(c.current=we.getTargetElement(t))),!u.current&&c.current&&(u.current=function(e){return i&&i(e)},c.current.addEventListener(o,u.current,s))},f=function(){u.current&&(c.current.removeEventListener(o,u.current,s),u.current=null)},m=function(){f(),p=null,d=null},g=e.useCallback(function(){a?c.current=we.getTargetElement(r):(f(),c.current=null)},[r,a]);return e.useEffect(function(){g()},[g]),e.useEffect(function(){var e="".concat(p)!=="".concat(i),t=d!==s,n=u.current;n&&(e||t)?(f(),a&&h()):n||m()},[i,s,a]),We(function(){m()}),[h,f]},Ke={};function qe(e){return function(e){if(Array.isArray(e))return Fe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ue(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Je={escKeyListeners:new Map,onGlobalKeyDown:function(e){if("Escape"===e.code){var t=Je.escKeyListeners,n=Math.max.apply(Math,qe(t.keys())),r=t.get(n),o=Math.max.apply(Math,qe(r.keys()));r.get(o)(e)}},refreshGlobalKeyDownListener:function(){var e=we.getTargetElement("document");this.escKeyListeners.size>0?e.addEventListener("keydown",this.onGlobalKeyDown):e.removeEventListener("keydown",this.onGlobalKeyDown)},addListener:function(e,t){var n=this,r=Ve(t,2),o=r[0],i=r[1],s=this.escKeyListeners;s.has(o)||s.set(o,new Map);var l=s.get(o);if(l.has(i))throw new Error("Unexpected: global esc key listener with priority [".concat(o,", ").concat(i,"] already exists."));return l.set(i,e),this.refreshGlobalKeyDownListener(),function(){l.delete(i),0===l.size&&s.delete(o),n.refreshGlobalKeyDownListener()}}},Ye=function(){var t=(0,e.useContext)($e);return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ae(n,null==t?void 0:t.ptOptions)}},Xe=function(t){var n=e.useRef(!1);return e.useEffect(function(){if(!n.current)return n.current=!0,t&&t()},[])},Qe=function(t){var n=t.target,r=t.listener,o=t.options,i=t.when,s=void 0===i||i,l=e.useContext($e),a=e.useRef(null),c=e.useRef(null),u=e.useRef([]),p=He(r),d=He(o),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Se.isNotEmpty(e.target)&&(f(),(e.when||s)&&(a.current=we.getTargetElement(e.target))),!c.current&&a.current){var t=l?l.hideOverlaysOnDocumentScrolling:Be.hideOverlaysOnDocumentScrolling,n=u.current=we.getScrollableParents(a.current);n.some(function(e){return e===document.body||e===window})||n.push(t?window:document.body),c.current=function(e){return r&&r(e)},n.forEach(function(e){return e.addEventListener("scroll",c.current,o)})}},f=function(){c.current&&(u.current.forEach(function(e){return e.removeEventListener("scroll",c.current,o)}),c.current=null)},m=function(){f(),u.current=null,p=null,d=null},g=e.useCallback(function(){s?a.current=we.getTargetElement(n):(f(),a.current=null)},[n,s]);return e.useEffect(function(){g()},[g]),e.useEffect(function(){var e="".concat(p)!=="".concat(r),t=d!==o,n=c.current;n&&(e||t)?(f(),s&&h()):n||m()},[r,o,s]),We(function(){m()}),[h,f]},Ze=function(e){var t=e.listener,n=e.when;return Ge({target:"window",type:"resize",listener:t,when:void 0===n||n})},et=0,tt=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Ve((0,e.useState)(!1),2),o=r[0],i=r[1],s=(0,e.useRef)(null),l=(0,e.useContext)($e),a=we.isClient()?window.document:void 0,c=n.document,u=void 0===c?a:c,p=n.manual,d=void 0!==p&&p,h=n.name,f=void 0===h?"style_".concat(++et):h,m=n.id,g=void 0===m?void 0:m,y=n.media,v=void 0===y?void 0:y,b=function(){if(u&&!o){var e=(null==l?void 0:l.styleContainer)||u.head;s.current=function(e){var t=e.querySelector('style[data-primereact-style-id="'.concat(f,'"]'));if(t)return t;if(void 0!==g){var n=u.getElementById(g);if(n)return n}return u.createElement("style")}(e),s.current.isConnected||(s.current.type="text/css",g&&(s.current.id=g),v&&(s.current.media=v),we.addNonce(s.current,l&&l.nonce||Be.nonce),e.appendChild(s.current),f&&s.current.setAttribute("data-primereact-style-id",f)),s.current.textContent=t,i(!0)}};return(0,e.useEffect)(function(){d||b()},[d]),{id:g,name:f,update:function(e){o&&t!==e&&(s.current.textContent=e)},unload:function(){u&&s.current&&(we.removeInlineStyle(s.current),i(!1))},load:b,isLoaded:o}},nt=function(t,n){var r=e.useRef(!1);return e.useEffect(function(){if(r.current)return t&&t();r.current=!0},n)};function rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ot(e){return function(e){if(Array.isArray(e))return rt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function it(e){return it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},it(e)}function st(e,t,n){return(t=function(e){var t=function(e){if("object"!=it(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=it(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==it(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(n),!0).forEach(function(t){st(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ct="\n@layer primereact {\n .p-component, .p-component * {\n box-sizing: border-box;\n }\n\n .p-hidden {\n display: none;\n }\n\n .p-hidden-space {\n visibility: hidden;\n }\n\n .p-reset {\n margin: 0;\n padding: 0;\n border: 0;\n outline: 0;\n text-decoration: none;\n font-size: 100%;\n list-style: none;\n }\n\n .p-disabled, .p-disabled * {\n cursor: default;\n pointer-events: none;\n user-select: none;\n }\n\n .p-component-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n .p-unselectable-text {\n user-select: none;\n }\n\n .p-scrollbar-measure {\n width: 100px;\n height: 100px;\n overflow: scroll;\n position: absolute;\n top: -9999px;\n }\n\n @-webkit-keyframes p-fadein {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n @keyframes p-fadein {\n 0% { opacity: 0; }\n 100% { opacity: 1; }\n }\n\n .p-link {\n text-align: left;\n background-color: transparent;\n margin: 0;\n padding: 0;\n border: none;\n cursor: pointer;\n user-select: none;\n }\n\n .p-link:disabled {\n cursor: default;\n }\n\n /* Non react overlay animations */\n .p-connected-overlay {\n opacity: 0;\n transform: scaleY(0.8);\n transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-connected-overlay-visible {\n opacity: 1;\n transform: scaleY(1);\n }\n\n .p-connected-overlay-hidden {\n opacity: 0;\n transform: scaleY(1);\n transition: opacity .1s linear;\n }\n\n /* React based overlay animations */\n .p-connected-overlay-enter {\n opacity: 0;\n transform: scaleY(0.8);\n }\n\n .p-connected-overlay-enter-active {\n opacity: 1;\n transform: scaleY(1);\n transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);\n }\n\n .p-connected-overlay-enter-done {\n transform: none;\n }\n\n .p-connected-overlay-exit {\n opacity: 1;\n }\n\n .p-connected-overlay-exit-active {\n opacity: 0;\n transition: opacity .1s linear;\n }\n\n /* Toggleable Content */\n .p-toggleable-content-enter {\n max-height: 0;\n }\n\n .p-toggleable-content-enter-active {\n overflow: hidden;\n max-height: 1000px;\n transition: max-height 1s ease-in-out;\n }\n\n .p-toggleable-content-enter-done {\n transform: none;\n }\n\n .p-toggleable-content-exit {\n max-height: 1000px;\n }\n\n .p-toggleable-content-exit-active {\n overflow: hidden;\n max-height: 0;\n transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);\n }\n\n /* @todo Refactor */\n .p-menu .p-menuitem-link {\n cursor: pointer;\n display: flex;\n align-items: center;\n text-decoration: none;\n overflow: hidden;\n position: relative;\n }\n\n ".concat("\n.p-button {\n margin: 0;\n display: inline-flex;\n cursor: pointer;\n user-select: none;\n align-items: center;\n vertical-align: bottom;\n text-align: center;\n overflow: hidden;\n position: relative;\n}\n\n.p-button-label {\n flex: 1 1 auto;\n}\n\n.p-button-icon {\n pointer-events: none;\n}\n\n.p-button-icon-right {\n order: 1;\n}\n\n.p-button:disabled {\n cursor: default;\n}\n\n.p-button-icon-only {\n justify-content: center;\n}\n\n.p-button-icon-only .p-button-label {\n visibility: hidden;\n width: 0;\n flex: 0 0 auto;\n}\n\n.p-button-vertical {\n flex-direction: column;\n}\n\n.p-button-icon-bottom {\n order: 2;\n}\n\n.p-button-group .p-button {\n margin: 0;\n}\n\n.p-button-group .p-button:not(:last-child) {\n border-right: 0 none;\n}\n\n.p-button-group .p-button:not(:first-of-type):not(:last-of-type) {\n border-radius: 0;\n}\n\n.p-button-group .p-button:first-of-type {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.p-button-group .p-button:last-of-type {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.p-button-group .p-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.p-button-group-single .p-button:first-of-type {\n border-top-right-radius: var(--border-radius) !important;\n border-bottom-right-radius: var(--border-radius) !important;\n}\n\n.p-button-group-single .p-button:last-of-type {\n border-top-left-radius: var(--border-radius) !important;\n border-bottom-left-radius: var(--border-radius) !important;\n}\n","\n ").concat("\n.p-inputtext {\n margin: 0;\n}\n\n.p-fluid .p-inputtext {\n width: 100%;\n}\n\n/* InputGroup */\n.p-inputgroup {\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n\n.p-inputgroup-addon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-inputgroup .p-float-label {\n display: flex;\n align-items: stretch;\n width: 100%;\n}\n\n.p-inputgroup .p-inputtext,\n.p-fluid .p-inputgroup .p-inputtext,\n.p-inputgroup .p-inputwrapper,\n.p-fluid .p-inputgroup .p-input {\n flex: 1 1 auto;\n width: 1%;\n}\n\n/* Floating Label */\n.p-float-label {\n display: block;\n position: relative;\n}\n\n.p-float-label label {\n position: absolute;\n pointer-events: none;\n top: 50%;\n margin-top: -0.5rem;\n transition-property: all;\n transition-timing-function: ease;\n line-height: 1;\n}\n\n.p-float-label textarea ~ label,\n.p-float-label .p-mention ~ label {\n top: 1rem;\n}\n\n.p-float-label input:focus ~ label,\n.p-float-label input:-webkit-autofill ~ label,\n.p-float-label input.p-filled ~ label,\n.p-float-label textarea:focus ~ label,\n.p-float-label textarea.p-filled ~ label,\n.p-float-label .p-inputwrapper-focus ~ label,\n.p-float-label .p-inputwrapper-filled ~ label,\n.p-float-label .p-tooltip-target-wrapper ~ label {\n top: -0.75rem;\n font-size: 12px;\n}\n\n.p-float-label .p-placeholder,\n.p-float-label input::placeholder,\n.p-float-label .p-inputtext::placeholder {\n opacity: 0;\n transition-property: all;\n transition-timing-function: ease;\n}\n\n.p-float-label .p-focus .p-placeholder,\n.p-float-label input:focus::placeholder,\n.p-float-label .p-inputtext:focus::placeholder {\n opacity: 1;\n transition-property: all;\n transition-timing-function: ease;\n}\n\n.p-input-icon-left,\n.p-input-icon-right {\n position: relative;\n display: inline-block;\n}\n\n.p-input-icon-left > i,\n.p-input-icon-right > i,\n.p-input-icon-left > svg,\n.p-input-icon-right > svg,\n.p-input-icon-left > .p-input-prefix,\n.p-input-icon-right > .p-input-suffix {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n}\n\n.p-fluid .p-input-icon-left,\n.p-fluid .p-input-icon-right {\n display: block;\n width: 100%;\n}\n","\n ").concat("\n.p-icon {\n display: inline-block;\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\nsvg.p-icon {\n pointer-events: auto;\n}\n\nsvg.p-icon g,\n.p-disabled svg.p-icon {\n pointer-events: none;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n","\n}\n"),ut={cProps:void 0,cParams:void 0,cName:void 0,defaultProps:{pt:void 0,ptOptions:void 0,unstyled:!1},context:{},globalCSS:void 0,classes:{},styles:"",extend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.css,n=at(at({},e.defaultProps),ut.defaultProps),r={},o=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t.hasOwnProperty("pt")&&void 0!==t.pt&&(t=t.pt);var i=n,s=/./g.test(i)&&!!r[i.split(".")[0]],l=s?Se.toFlatCase(i.split(".")[1]):Se.toFlatCase(i),a=r.hostName&&Se.toFlatCase(r.hostName)||r.props&&r.props.__TYPE&&Se.toFlatCase(r.props.__TYPE)||"",c="transition"===l,u="data-pc-",p=function(e){return null!=e&&e.props?e.hostName?e.props.__TYPE===e.hostName?e.props:p(e.parent):e.parent:void 0};ut.cParams=r,ut.cName=a;var d,h,f,m=(d="ptOptions",(null===(h=r.props)||void 0===h?void 0:h[d])||(null===(f=p(r))||void 0===f?void 0:f[d])||ut.context.ptOptions||{}),g=m.mergeSections,y=void 0===g||g,v=m.mergeProps,b=void 0!==v&&v,E=function(){var e=pt.apply(void 0,arguments);return Array.isArray(e)?{className:de.apply(void 0,ot(e))}:Se.isString(e)?{className:e}:null!=e&&e.hasOwnProperty("className")&&Array.isArray(e.className)?{className:de.apply(void 0,ot(e.className))}:e},w=o?s?ft(E,i,r):mt(E,i,r):void 0,x=s?void 0:ht(dt(t,a),E,i,r),k=!c&&at(at({},"root"===l&&st({},"".concat(u,"name"),r.props&&r.props.__parentMetadata?Se.toFlatCase(r.props.__TYPE):a)),{},st({},"".concat(u,"section"),l));return y||!y&&x?b?Ae([w,x,Object.keys(k).length?k:{}],{classNameMergeFunction:null===(e=ut.context.ptOptions)||void 0===e?void 0:e.classNameMergeFunction}):at(at(at({},w),x),Object.keys(k).length?k:{}):at(at({},x),Object.keys(k).length?k:{})};return at(at({getProps:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ut.context=t,ut.cProps=e,Se.getMergedProps(e,n)},getOtherProps:function(e){return Se.getDiffProps(e,n)},setMetaData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.props,i=e.state,s=function(){return ut.context.unstyled||Be.unstyled||n.unstyled};return{ptm:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o((n||{}).pt,t,at(at({},e),r))},ptmo:function(){return o(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},!1)},sx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){var s,l=pt(t&&t.inlineStyles,e,at({props:n,state:i},o));return Ae([pt(r,e,at({props:n,state:i},o)),l],{classNameMergeFunction:null===(s=ut.context.ptOptions)||void 0===s?void 0:s.classNameMergeFunction})}},cx:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s()?void 0:pt(t&&t.classes,e,at({props:n,state:i},r))},isUnstyled:s}}},e),{},{defaultProps:n})}},pt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=String(Se.toFlatCase(t)).split("."),o=r.shift(),i=Se.isNotEmpty(e)?Object.keys(e).find(function(e){return Se.toFlatCase(e)===o}):"";return o?Se.isObject(e)?pt(Se.getItemValue(e[i],n),r.join("."),n):void 0:Se.getItemValue(e,n)},dt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=null==e?void 0:e._usept,o=function(e){var r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n?n(e):e,s=Se.toFlatCase(t);return null!==(r=o?s!==ut.cName?null==i?void 0:i[s]:void 0:null==i?void 0:i[s])&&void 0!==r?r:i};return Se.isNotEmpty(r)?{_usept:r,originalValue:o(e.originalValue),value:o(e.value)}:o(e,!0)},ht=function(e,t,n,r){var o=function(e){return t(e,n,r)};if(null!=e&&e.hasOwnProperty("_usept")){var i=e._usept||ut.context.ptOptions||{},s=i.mergeSections,l=void 0===s||s,a=i.mergeProps,c=void 0!==a&&a,u=i.classNameMergeFunction,p=o(e.originalValue),d=o(e.value);if(void 0===p&&void 0===d)return;return Se.isString(d)?d:Se.isString(p)?p:l||!l&&d?c?Ae([p,d],{classNameMergeFunction:u}):at(at({},p),d):d}return o(e)},ft=function(e,t,n){return ht(dt(ut.context.pt||Be.pt,void 0,function(e){return Se.getItemValue(e,ut.cParams)}),e,t,n)},mt=function(e,t,n){return ht(dt(ut.context.pt||Be.pt,void 0,function(e){return pt(e,ut.cName,ut.cParams)||Se.getItemValue(e,ut.cParams)}),e,t,n)},gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2?arguments[2]:void 0,r=n.name,o=n.styled,i=void 0!==o&&o,s=n.hostName,l=void 0===s?"":s,a=ft(pt,"global.css",ut.cParams),c=Se.toFlatCase(r),u=tt("\n.p-hidden-accessible {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n opacity: 0;\n overflow: hidden;\n padding: 0;\n pointer-events: none;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.p-overflow-hidden {\n overflow: hidden;\n padding-right: var(--scrollbar-width);\n}\n",{name:"base",manual:!0}).load,p=tt(ct,{name:"common",manual:!0}).load,d=tt(a,{name:"global",manual:!0}).load,h=tt(e,{name:r,manual:!0}).load,f=function(e){if(!l){var t=ht(dt((ut.cProps||{}).pt,c),pt,"hooks.".concat(e)),n=mt(pt,"hooks.".concat(e));null==t||t(),null==n||n()}};f("useMountEffect"),Xe(function(){u(),d(),t()||(p(),i||h())}),nt(function(){f("useUpdateEffect")}),We(function(){f("useUnmountEffect")})};function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yt.apply(null,arguments)}function vt(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function bt(e,t){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bt(e,t)}function Et(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,bt(e,t)}function wt(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var xt=window.ReactDOM,kt=n.n(xt),St=t().createContext(null),Ct=function(e){return e.scrollTop},Tt="unmounted",Ot="exited",At="entering",Mt="entered",Pt="exiting",It=function(e){function n(t,n){var r;r=e.call(this,t,n)||this;var o,i=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=Ot,r.appearStatus=At):o=Mt:o=t.unmountOnExit||t.mountOnEnter?Tt:Ot,r.state={status:o},r.nextCallback=null,r}Et(n,e),n.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Tt?{status:Ot}:null};var r=n.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==At&&n!==Mt&&(t=At):n!==At&&n!==Mt||(t=Pt)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},r.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===At){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:kt().findDOMNode(this);n&&Ct(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ot&&this.setState({status:Tt})},r.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[kt().findDOMNode(this),r],i=o[0],s=o[1],l=this.getTimeouts(),a=r?l.appear:l.enter;e||n?(this.props.onEnter(i,s),this.safeSetState({status:At},function(){t.props.onEntering(i,s),t.onTransitionEnd(a,function(){t.safeSetState({status:Mt},function(){t.props.onEntered(i,s)})})})):this.safeSetState({status:Mt},function(){t.props.onEntered(i)})},r.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:kt().findDOMNode(this);t?(this.props.onExit(r),this.safeSetState({status:Pt},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Ot},function(){e.props.onExited(r)})})})):this.safeSetState({status:Ot},function(){e.props.onExited(r)})},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:kt().findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=o[0],s=o[1];this.props.addEndListener(i,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===Tt)return null;var n=this.props,r=n.children,o=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,vt(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return t().createElement(St.Provider,{value:null},"function"==typeof r?r(e,o):t().cloneElement(t().Children.only(r),o))},n}(t().Component);function _t(){}It.contextType=St,It.propTypes={},It.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:_t,onEntering:_t,onEntered:_t,onExit:_t,onExiting:_t,onExited:_t},It.UNMOUNTED=Tt,It.EXITED=Ot,It.ENTERING=At,It.ENTERED=Mt,It.EXITING=Pt;var Nt=It,Rt=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=wt(n.className,r):n.setAttribute("class",wt(n.className&&n.className.baseVal||"",r)));var n,r})},Dt=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1];t.removeClasses(o,"exit"),t.addClass(o,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1]?"appear":"enter";t.addClass(o,i,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),o=r[0],i=r[1]?"appear":"enter";t.removeClasses(o,i),t.addClass(o,i,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?(r&&n?n+"-":"")+e:n[e];return{baseClassName:o,activeClassName:r?o+"-active":n[e+"Active"],doneClassName:r?o+"-done":n[e+"Done"]}},t}Et(n,e);var r=n.prototype;return r.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&Ct(e),r&&(this.appliedClasses[t][n]=r,function(e,t){e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r})}(e,r))},r.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,o=n.active,i=n.done;this.appliedClasses[t]={},r&&Rt(e,r),o&&Rt(e,o),i&&Rt(e,i)},r.render=function(){var e=this.props,n=(e.classNames,vt(e,["classNames"]));return t().createElement(Nt,yt({},n,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},n}(t().Component);Dt.defaultProps={classNames:""},Dt.propTypes={};var Lt=Dt;function zt(e){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zt(e)}function jt(e,t,n){return(t=function(e){var t=function(e){if("object"!=zt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $t={defaultProps:{__TYPE:"CSSTransition",children:void 0},getProps:function(e){return Se.getMergedProps(e,$t.defaultProps)},getOtherProps:function(e){return Se.getDiffProps(e,$t.defaultProps)}};function Bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(n),!0).forEach(function(t){jt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ut=e.forwardRef(function(t,n){var r=$t.getProps(t),o=e.useContext($e),i=r.disabled||r.options&&r.options.disabled||o&&!o.cssTransition||!Be.cssTransition,s=function(e,t){r.onEnter&&r.onEnter(e,t),r.options&&r.options.onEnter&&r.options.onEnter(e,t)},l=function(e,t){r.onEntering&&r.onEntering(e,t),r.options&&r.options.onEntering&&r.options.onEntering(e,t)},a=function(e,t){r.onEntered&&r.onEntered(e,t),r.options&&r.options.onEntered&&r.options.onEntered(e,t)},c=function(e){r.onExit&&r.onExit(e),r.options&&r.options.onExit&&r.options.onExit(e)},u=function(e){r.onExiting&&r.onExiting(e),r.options&&r.options.onExiting&&r.options.onExiting(e)},p=function(e){r.onExited&&r.onExited(e),r.options&&r.options.onExited&&r.options.onExited(e)};if(nt(function(){if(i){var e=Se.getRefElement(r.nodeRef);r.in?(s(e,!0),l(e,!0),a(e,!0)):(c(e),u(e),p(e))}},[r.in]),i)return r.in?r.children:null;var d={nodeRef:r.nodeRef,in:r.in,appear:r.appear,onEnter:s,onEntering:l,onEntered:a,onExit:c,onExiting:u,onExited:p},h=Ft(Ft(Ft({},{classNames:r.classNames,timeout:r.timeout,unmountOnExit:r.unmountOnExit}),r.options||{}),d);return e.createElement(Lt,h,r.children)});function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}Ut.displayName="CSSTransition";var Ht={DEFAULT_MASKS:{pint:/[\d]/,int:/[\d\-]/,pnum:/[\d\.]/,money:/[\d\.\s,]/,num:/[\d\-\.]/,hex:/[0-9a-f]/i,email:/[a-z0-9_\.\-@]/i,alpha:/[a-z_]/i,alphanum:/[a-z0-9_]/i},getRegex:function(e){return Ht.DEFAULT_MASKS[e]?Ht.DEFAULT_MASKS[e]:e},onBeforeInput:function(e,t,n){!n&&we.isAndroid()&&this.validateKey(e,e.data,t)},onKeyPress:function(e,t,n){n||we.isAndroid()||e.ctrlKey||e.altKey||e.metaKey||this.validateKey(e,e.key,t)},onPaste:function(e,t,n){if(!n){var r=this.getRegex(t);(o=e.clipboardData.getData("text"),function(e){if(Array.isArray(e))return Vt(e)}(o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return Vt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vt(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach(function(t){if(!r.test(t))return e.preventDefault(),!1})}var o},validateKey:function(e,t,n){null!=t&&t.length<=2&&(this.getRegex(n).test(t)||e.preventDefault())},validate:function(e,t){var n=e.target.value,r=!0,o=this.getRegex(t);return n&&!o.test(n)&&(r=!1),r}};function Wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Gt={defaultProps:{__TYPE:"Portal",element:null,appendTo:null,visible:!1,onMounted:null,onUnmounted:null,children:void 0},getProps:function(e){return Se.getMergedProps(e,Gt.defaultProps)},getOtherProps:function(e){return Se.getDiffProps(e,Gt.defaultProps)}},Kt=e.memo(function(t){var n,r,o=Gt.getProps(t),i=e.useContext($e),s=(n=e.useState(o.visible&&we.isClient()),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}(n,r)||function(e,t){if(e){if("string"==typeof e)return Wt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(e,t):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=s[0],a=s[1];Xe(function(){we.isClient()&&!l&&(a(!0),o.onMounted&&o.onMounted())}),nt(function(){o.onMounted&&o.onMounted()},[l]),We(function(){o.onUnmounted&&o.onUnmounted()});var c=o.element||o.children;if(c&&l){var u=o.appendTo||i&&i.appendTo||Be.appendTo;return Se.isFunction(u)&&(u=u()),u||(u=document.body),"self"===u?c:kt().createPortal(c,u)}return null});function qt(){return qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qt.apply(null,arguments)}function Jt(e){return Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(e)}function Yt(e,t,n){return(t=function(e){var t=function(e){if("object"!=Jt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Qt(e,t){if(e){if("string"==typeof e)return Xt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xt(e,t):void 0}}function Zt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}(e,t)||Qt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Kt.displayName="Portal";var en={root:function(e){var t=e.positionState,n=e.classNameState;return de("p-tooltip p-component",Yt({},"p-tooltip-".concat(t),!0),n)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},tn=ut.extend({defaultProps:{__TYPE:"Tooltip",appendTo:null,at:null,autoHide:!0,autoZIndex:!0,baseZIndex:0,className:null,closeOnEscape:!1,content:null,disabled:!1,event:null,hideDelay:0,hideEvent:"mouseleave",id:null,mouseTrack:!1,mouseTrackLeft:5,mouseTrackTop:5,my:null,onBeforeHide:null,onBeforeShow:null,onHide:null,onShow:null,position:"right",showDelay:0,showEvent:"mouseenter",showOnDisabled:!1,style:null,target:null,updateDelay:0,children:void 0},css:{classes:en,styles:"\n@layer primereact {\n .p-tooltip {\n position: absolute;\n padding: .25em .5rem;\n /* #3687: Tooltip prevent scrollbar flickering */\n top: -9999px;\n left: -9999px;\n }\n \n .p-tooltip.p-tooltip-right,\n .p-tooltip.p-tooltip-left {\n padding: 0 .25rem;\n }\n \n .p-tooltip.p-tooltip-top,\n .p-tooltip.p-tooltip-bottom {\n padding:.25em 0;\n }\n \n .p-tooltip .p-tooltip-text {\n white-space: pre-line;\n word-break: break-word;\n }\n \n .p-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n \n .p-tooltip-right .p-tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -.25rem;\n border-width: .25em .25em .25em 0;\n }\n \n .p-tooltip-left .p-tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -.25rem;\n border-width: .25em 0 .25em .25rem;\n }\n \n .p-tooltip.p-tooltip-top {\n padding: .25em 0;\n }\n \n .p-tooltip-top .p-tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: .25em .25em 0;\n }\n \n .p-tooltip-bottom .p-tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -.25rem;\n border-width: 0 .25em .25rem;\n }\n\n .p-tooltip-target-wrapper {\n display: inline-flex;\n }\n}\n",inlineStyles:{arrow:function(e){var t=e.context;return{top:t.bottom?"0":t.right||t.left||!t.right&&!t.left&&!t.top&&!t.bottom?"50%":null,bottom:t.top?"0":null,left:!t.right&&(t.right||t.left||t.top||t.bottom)?t.top||t.bottom?"50%":null:"0",right:t.left?"0":null}}}}});function nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(n),!0).forEach(function(t){Yt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var on=e.memo(e.forwardRef(function(t,n){var r,o,i,s,l=Ye(),a=e.useContext($e),c=tn.getProps(t,a),u=Zt(e.useState(!1),2),p=u[0],d=u[1],h=Zt(e.useState(c.position||"right"),2),f=h[0],m=h[1],g=Zt(e.useState(""),2),y=g[0],v=g[1],b=Zt(e.useState(!1),2),E=b[0],w=b[1],x=p&&c.closeOnEscape,k=function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Ve(e.useState(function(){return function(){return Ce++,"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pr_id_").concat(Ce)}()}),1)[0],o=Ve(e.useState(0),2),i=o[0],s=o[1];return e.useEffect(function(){if(n){Ke[t]||(Ke[t]=[]);var e=Ke[t].push(r);return s(e),function(){delete Ke[t][e-1];var n=Ke[t].length-1,r=Se.findLastIndex(Ke[t],function(e){return void 0!==e});r!==n&&Ke[t].splice(r+1),s(void 0)}}},[t,r,n]),i}("tooltip",x),S={props:c,state:{visible:p,position:f,className:y},context:{right:"right"===f,left:"left"===f,top:"top"===f,bottom:"bottom"===f}},C=tn.setMetaData(S),T=C.ptm,O=C.cx,A=C.sx,M=C.isUnstyled;gt(tn.css.styles,M,{name:"tooltip"}),o=(r={callback:function(){ee()},when:x,priority:[1200,k]}).callback,i=r.when,s=r.priority,(0,e.useEffect)(function(){if(i)return Je.addListener(o,s)},[o,i,s]);var P=e.useRef(null),I=e.useRef(null),_=e.useRef(null),N=e.useRef(null),R=e.useRef(!0),D=e.useRef({}),L=e.useRef(null),z=Zt(Ze({listener:function(e){!we.isTouchDevice()&&ee(e)}}),2),j=z[0],$=z[1],B=Zt(Qe({target:_.current,listener:function(e){ee(e)},when:p}),2),F=B[0],U=B[1],V=function(e){return K(e,"mousetrack")||c.mouseTrack},H=function(e){return"true"===K(e,"disabled")||q(e,"disabled")||c.disabled},W=function(e){return K(e,"showondisabled")||c.showOnDisabled},G=function(){return K(_.current,"autohide")||c.autoHide},K=function(e,t){return q(e,"data-pr-".concat(t))?e.getAttribute("data-pr-".concat(t)):null},q=function(e,t){return e&&e.hasAttribute(t)},J=function(e){var t=[K(e,"showevent")||c.showEvent],n=[K(e,"hideevent")||c.hideEvent];if(V(e))t=["mousemove"],n=["mouseleave"];else{var r=K(e,"event")||c.event;"focus"===r&&(t=["focus"],n=["blur"]),"both"===r&&(t=["focus","mouseenter"],n=E?["blur"]:["mouseleave","blur"])}return{showEvents:t,hideEvents:n}},Y=function(e){return K(e,"position")||f},X=function(e,t){if(I.current){var n=K(e,"tooltip")||c.content;n?(I.current.innerHTML="",I.current.appendChild(document.createTextNode(n)),t()):c.children&&t()}},Q=function(e){X(_.current,function(){var t=L.current,n=t.pageX,r=t.pageY;c.autoZIndex&&!Ie.get(P.current)&&Ie.set("tooltip",P.current,a&&a.autoZIndex||Be.autoZIndex,c.baseZIndex||a&&a.zIndex.tooltip||Be.zIndex.tooltip),P.current.style.left="",P.current.style.top="",G()&&(P.current.style.pointerEvents="none");var o=V(_.current)||"mouse"===e;(o&&!N.current||o)&&(N.current={width:we.getOuterWidth(P.current),height:we.getOuterHeight(P.current)}),te(_.current,{x:n,y:r},e)})},Z=function(e){e.type&&"focus"===e.type&&w(!0),_.current=e.currentTarget;var t,n=H(_.current);t=W(_.current)&&n?_.current.firstChild:_.current,!(c.content||K(t,"tooltip")||c.children)||n||(L.current=e,p?se("updateDelay",Q):le(c.onBeforeShow,{originalEvent:e,target:_.current})&&se("showDelay",function(){d(!0),le(c.onShow,{originalEvent:e,target:_.current})}))},ee=function(e){e&&"blur"===e.type&&w(!1),ae(),p?le(c.onBeforeHide,{originalEvent:e,target:_.current})&&se("hideDelay",function(){(G()||!1!==R.current)&&(Ie.clear(P.current),we.removeClass(P.current,"p-tooltip-active"),d(!1),le(c.onHide,{originalEvent:e,target:_.current}))}):c.onBeforeHide||ie("hideDelay")||d(!1)},te=function(e,t,n){var r=0,o=0,i=n||f;if((V(e)||"mouse"==i)&&t){var s={width:we.getOuterWidth(P.current),height:we.getOuterHeight(P.current)};r=t.x,o=t.y;var l=function(e){return{top:K(e,"mousetracktop")||c.mouseTrackTop,left:K(e,"mousetrackleft")||c.mouseTrackLeft}}(e),a=l.top,u=l.left;switch(i){case"left":r-=s.width+u,o-=s.height/2-a;break;case"right":case"mouse":r+=u,o-=s.height/2-a;break;case"top":r-=s.width/2-u,o-=s.height+a;break;case"bottom":r-=s.width/2-u,o+=a}r<=0||N.current.width>s.width?(P.current.style.left="0px",P.current.style.right=window.innerWidth-s.width-r+"px"):(P.current.style.right="",P.current.style.left=r+"px"),P.current.style.top=o+"px",we.addClass(P.current,"p-tooltip-active")}else{var p=we.findCollisionPosition(i),d=K(e,"my")||c.my||p.my,h=K(e,"at")||c.at||p.at;P.current.style.padding="0px",we.flipfitCollision(P.current,e,d,h,function(e){var t=e.at,n=t.x,r=t.y,o=e.my.x,i=c.at?"center"!==n&&n!==o?n:r:e.at["".concat(p.axis)];P.current.style.padding="",m(i),ne(i),we.addClass(P.current,"p-tooltip-active")})}},ne=function(e){if(P.current){var t=getComputedStyle(P.current);"left"===e?P.current.style.left=parseFloat(t.left)-2*parseFloat(t.paddingLeft)+"px":"top"===e&&(P.current.style.top=parseFloat(t.top)-2*parseFloat(t.paddingTop)+"px")}},re=function(e){if(e){var t=J(e),n=t.showEvents,r=t.hideEvents,o=ce(e);n.forEach(function(e){return null==o?void 0:o.addEventListener(e,Z)}),r.forEach(function(e){return null==o?void 0:o.addEventListener(e,ee)})}},oe=function(e){if(e){var t=J(e),n=t.showEvents,r=t.hideEvents,o=ce(e);n.forEach(function(e){return null==o?void 0:o.removeEventListener(e,Z)}),r.forEach(function(e){return null==o?void 0:o.removeEventListener(e,ee)})}},ie=function(e){return K(_.current,e.toLowerCase())||c[e]},se=function(e,t){ae();var n=ie(e);n?D.current["".concat(e)]=setTimeout(function(){return t()},n):t()},le=function(e){if(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=e.apply(void 0,n);return void 0===o&&(o=!0),o}return!0},ae=function(){Object.values(D.current).forEach(function(e){return clearTimeout(e)})},ce=function(e){if(e){if(W(e)){if(!e.hasWrapper){var t=document.createElement("div");return"INPUT"===e.nodeName?we.addMultipleClasses(t,"p-tooltip-target-wrapper p-inputwrapper"):we.addClass(t,"p-tooltip-target-wrapper"),e.parentNode.insertBefore(t,e),t.appendChild(e),e.hasWrapper=!0,t}return e.parentElement}var n;return e.hasWrapper&&((n=e.parentElement).replaceWith.apply(n,function(e){if(Array.isArray(e))return Xt(e)}(r=e.parentElement.childNodes)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||Qt(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),delete e.hasWrapper),e}var r;return null},ue=function(e){he(e),pe(e)},pe=function(e){fe(e||c.target,re)},he=function(e){fe(e||c.target,oe)},fe=function(e,t){if(e=Se.getRefElement(e))if(we.isElement(e))t(e);else{var n=function(e){we.find(document,e).forEach(function(e){t(e)})};e instanceof Array?e.forEach(function(e){n(e)}):n(e)}};if(Xe(function(){p&&_.current&&H(_.current)&&ee()}),nt(function(){return pe(),function(){he()}},[Z,ee,c.target]),nt(function(){if(p){var e=Y(_.current),t=K(_.current,"classname");m(e),v(t),Q(e),j(),F()}else m(c.position||"right"),v(""),_.current=null,N.current=null,R.current=!0;return function(){$(),U()}},[p]),nt(function(){var e=Y(_.current);p&&"mouse"!==e&&se("updateDelay",function(){X(_.current,function(){te(_.current)})})},[c.content]),We(function(){ee(),Ie.clear(P.current)}),e.useImperativeHandle(n,function(){return{props:c,updateTargetEvents:ue,loadTargetEvents:pe,unloadTargetEvents:he,show:Z,hide:ee,getElement:function(){return P.current},getTarget:function(){return _.current}}}),p){var me=function(){var t,n=(t=_.current,!(c.content||K(t,"tooltip"))),r=l({id:c.id,className:de(c.className,O("root",{positionState:f,classNameState:y})),style:c.style,role:"tooltip","aria-hidden":p,onMouseEnter:function(e){G()||(R.current=!1)},onMouseLeave:function(e){return function(e){G()||(R.current=!0,ee(e))}(e)}},tn.getOtherProps(c),T("root")),o=l({className:O("arrow"),style:A("arrow",rn({},S))},T("arrow")),i=l({className:O("text")},T("text"));return e.createElement("div",qt({ref:P},r),e.createElement("div",o),e.createElement("div",qt({ref:I},i),n&&c.children))}();return e.createElement(Kt,{element:me,appendTo:c.appendTo,visible:!0})}return null}));on.displayName="Tooltip";var sn,ln=(sn=new Map,{on:function(e,t){var n=sn.get(e);n?n.push(t):n=[t],sn.set(e,n)},off:function(e,t){var n=sn.get(e);n&&n.splice(n.indexOf(t)>>>0,1)},emit:function(e,t){var n=sn.get(e);n&&n.slice().forEach(function(e){return e(t)})}});function an(){return an=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},an.apply(null,arguments)}function cn(e){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cn(e)}function un(e,t,n){return(t=function(e){var t=function(e){if("object"!=cn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cn(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var dn=ut.extend({defaultProps:{__TYPE:"Ripple",children:void 0},css:{styles:"\n@layer primereact {\n .p-ripple {\n overflow: hidden;\n position: relative;\n }\n \n .p-ink {\n display: block;\n position: absolute;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 100%;\n transform: scale(0);\n }\n \n .p-ink-active {\n animation: ripple 0.4s linear;\n }\n \n .p-ripple-disabled .p-ink {\n display: none;\n }\n}\n\n@keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n}\n\n",classes:{root:"p-ink"}},getProps:function(e){return Se.getMergedProps(e,dn.defaultProps)},getOtherProps:function(e){return Se.getDiffProps(e,dn.defaultProps)}});function hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var fn=e.memo(e.forwardRef(function(t,n){var r,o,i=(r=e.useState(!1),o=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}(r,o)||function(e,t){if(e){if("string"==typeof e)return pn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pn(e,t):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[0],l=i[1],a=e.useRef(null),c=e.useRef(null),u=Ye(),p=e.useContext($e),d=dn.getProps(t,p),h=p&&p.ripple||Be.ripple,f={props:d};tt(dn.css.styles,{name:"ripple",manual:!h});var m=dn.setMetaData(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(n),!0).forEach(function(t){un(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},f)),g=m.ptm,y=m.cx,v=function(){return a.current&&a.current.parentElement},b=function(){c.current&&c.current.addEventListener("pointerdown",E)},E=function(e){var t=we.getOffset(c.current),n=e.pageX-t.left+document.body.scrollTop-we.getWidth(a.current)/2,r=e.pageY-t.top+document.body.scrollLeft-we.getHeight(a.current)/2;w(n,r)},w=function(e,t){a.current&&"none"!==getComputedStyle(a.current,null).display&&(we.removeClass(a.current,"p-ink-active"),x(),a.current.style.top=t+"px",a.current.style.left=e+"px",we.addClass(a.current,"p-ink-active"))},x=function(){if(a.current&&!we.getHeight(a.current)&&!we.getWidth(a.current)){var e=Math.max(we.getOuterWidth(c.current),we.getOuterHeight(c.current));a.current.style.height=e+"px",a.current.style.width=e+"px"}};if(e.useImperativeHandle(n,function(){return{props:d,getInk:function(){return a.current},getTarget:function(){return c.current}}}),Xe(function(){l(!0)}),nt(function(){s&&a.current&&(c.current=v(),x(),b())},[s]),nt(function(){a.current&&!c.current&&(c.current=v(),x(),b())}),We(function(){a.current&&(c.current=null,c.current&&c.current.removeEventListener("pointerdown",E))}),!h)return null;var k=u({"aria-hidden":!0,className:de(y("root"))},dn.getOtherProps(d),g("root"));return e.createElement("span",an({role:"presentation",ref:a},k,{onAnimationEnd:function(e){we.removeClass(e.currentTarget,"p-ink-active")}}))}));function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mn.apply(null,arguments)}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yn(e,t){if(e){if("string"==typeof e)return gn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gn(e,t):void 0}}function vn(e){return function(e){if(Array.isArray(e))return gn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||yn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bn(e){return bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bn(e)}function En(e,t,n){return(t=function(e){var t=function(e){if("object"!=bn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bn(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}(e,t)||yn(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}fn.displayName="Ripple";var xn={root:function(e){var t=e.props,n=e.context,r=e.isFilled;return de("p-inputtextarea p-inputtext p-component",{"p-disabled":t.disabled,"p-filled":r,"p-inputtextarea-resizable":t.autoResize,"p-invalid":t.invalid,"p-variant-filled":t.variant?"filled"===t.variant:n&&"filled"===n.inputStyle})}},kn=ut.extend({defaultProps:{__TYPE:"InputTextarea",__parentMetadata:null,autoResize:!1,invalid:!1,variant:null,keyfilter:null,onBlur:null,onFocus:null,onBeforeInput:null,onInput:null,onKeyDown:null,onKeyUp:null,onPaste:null,tooltip:null,tooltipOptions:null,validateOnly:!1,children:void 0,className:null},css:{classes:xn,styles:"\n@layer primereact {\n .p-inputtextarea-resizable {\n overflow: hidden;\n resize: none;\n }\n \n .p-fluid .p-inputtextarea {\n width: 100%;\n }\n}\n"}});function Sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sn(Object(n),!0).forEach(function(t){En(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Tn=e.memo(e.forwardRef(function(t,n){var r=Ye(),o=e.useContext($e),i=kn.getProps(t,o),s=e.useRef(n),l=e.useRef(0),a=kn.setMetaData(Cn(Cn({props:i},i.__parentMetadata),{},{context:{disabled:i.disabled}})),c=a.ptm,u=a.cx,p=a.isUnstyled;gt(kn.css.styles,p,{name:"inputtextarea"});var d=function(e){var t=s.current;t&&h()&&(l.current||(l.current=t.scrollHeight,t.style.overflow="hidden"),(l.current!==t.scrollHeight||e)&&(t.style.height="",t.style.height=t.scrollHeight+"px",parseFloat(t.style.height)>=parseFloat(t.style.maxHeight)?(t.style.overflowY="scroll",t.style.height=t.style.maxHeight):t.style.overflow="hidden",l.current=t.scrollHeight))},h=function(){if(we.isVisible(s.current)){var e=s.current.getBoundingClientRect();return e.width>0&&e.height>0}return!1};e.useEffect(function(){Se.combinedRefs(s,n)},[s,n]),e.useEffect(function(){i.autoResize&&d(!0)},[i.autoResize,i.value]);var f=e.useMemo(function(){return Se.isNotEmpty(i.value)||Se.isNotEmpty(i.defaultValue)},[i.value,i.defaultValue]),m=Se.isNotEmpty(i.tooltip),g=r({ref:s,className:de(i.className,u("root",{context:o,isFilled:f})),onFocus:function(e){i.autoResize&&d(),i.onFocus&&i.onFocus(e)},onBlur:function(e){i.autoResize&&d(),i.onBlur&&i.onBlur(e)},onKeyUp:function(e){i.autoResize&&d(),i.onKeyUp&&i.onKeyUp(e)},onKeyDown:function(e){i.onKeyDown&&i.onKeyDown(e),i.keyfilter&&Ht.onKeyPress(e,i.keyfilter,i.validateOnly)},onBeforeInput:function(e){i.onBeforeInput&&i.onBeforeInput(e),i.keyfilter&&Ht.onBeforeInput(e,i.keyfilter,i.validateOnly)},onInput:function(e){var t=e.target;i.autoResize&&d(Se.isEmpty(t.value)),i.onInput&&i.onInput(e),Se.isNotEmpty(t.value)?we.addClass(t,"p-filled"):we.removeClass(t,"p-filled")},onPaste:function(e){i.onPaste&&i.onPaste(e),i.keyfilter&&Ht.onPaste(e,i.keyfilter,i.validateOnly)}},kn.getOtherProps(i),c("root"));return e.createElement(e.Fragment,null,e.createElement("textarea",g),m&&e.createElement(on,mn({target:s,content:i.tooltip,pt:c("tooltip")},i.tooltipOptions)))}));Tn.displayName="InputTextarea";var On={item:function(e){return de("p-mention-item",{"p-highlight":e.isSelected})},items:"p-mention-items",panel:function(e){return de("p-mention-panel p-component",e.props.panelClassName)},input:function(e){return de("p-mention-input",e.props.inputClassName)},root:function(e){return e.props,de("p-mention p-component p-inputwrapper",{"p-inputwrapper-filled":e.isFilled,"p-inputwrapper-focus":e.focusedState})},transition:"p-connected-overlay"},An=ut.extend({defaultProps:{__TYPE:"Mention",autoHighlight:!0,autoResize:!1,className:null,delay:0,field:null,footerTemplate:null,headerTemplate:null,id:null,inputClassName:null,inputId:null,inputRef:null,inputStyle:null,itemTemplate:null,onBlur:null,onChange:null,onFocus:null,onHide:null,onInput:null,onSearch:null,onSelect:null,onShow:null,panelClassName:null,panelStyle:null,scrollHeight:"200px",style:null,suggestions:null,transitionOptions:null,trigger:"@",variant:null,children:void 0},css:{classes:On,styles:"\n@layer primereact {\n .p-mention {\n display: inline-flex;\n position: relative;\n }\n \n .p-autocomplete-loader {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n }\n \n .p-mention .p-mention-panel {\n min-width: 100%;\n }\n \n .p-mention-panel {\n position: absolute;\n top: 0;\n left: 0;\n overflow: auto;\n }\n \n .p-mention-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n \n .p-mention-item {\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n overflow: hidden;\n }\n \n .p-fluid .p-mention {\n display: flex;\n }\n}\n"}});function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(n),!0).forEach(function(t){En(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var In=e.memo(e.forwardRef(function(t,n){var r=Ye(),o=e.useContext($e),i=An.getProps(t,o),s=wn(e.useState(!1),2),l=s[0],a=s[1],c=wn(e.useState(!1),2),u=c[0],p=c[1],d=wn(e.useState(!1),2),h=d[0],f=d[1],m=wn(e.useState(null),2),g=m[0],y=m[1],v=wn(e.useState([]),2),b=v[0],E=v[1],w=e.useRef(null),x=e.useRef(null),k=e.useRef(i.inputRef),S=e.useRef(null),C=e.useRef(null),T={props:i,state:{overlayVisible:l,focused:u,searching:h,trigger:g}},O=An.setMetaData(T),A=O.ptm,M=O.cx;O.sx;var P=O.isUnstyled;gt(An.css.styles,P,{name:"mention"});var I=function(t){var n=t.target,r=t.overlay,o=t.listener,i=t.when,s=void 0===i||i,l=t.type,a=void 0===l?"click":l,c=e.useRef(null),u=e.useRef(null),p=Ve(Ge({target:"window",type:a,listener:function(e){o&&o(e,{type:"outside",valid:3!==e.which&&k(e)})},when:s}),2),d=p[0],h=p[1],f=Ve(Ze({listener:function(e){o&&o(e,{type:"resize",valid:!we.isTouchDevice()})},when:s}),2),m=f[0],g=f[1],y=Ve(Ge({target:"window",type:"orientationchange",listener:function(e){o&&o(e,{type:"orientationchange",valid:!0})},when:s}),2),v=y[0],b=y[1],E=Ve(Qe({target:n,listener:function(e){o&&o(e,{type:"scroll",valid:!0})},when:s}),2),w=E[0],x=E[1],k=function(e){return c.current&&!(c.current.isSameNode(e.target)||c.current.contains(e.target)||u.current&&u.current.contains(e.target))},S=function(){h(),g(),b(),x()};return e.useEffect(function(){s?(c.current=we.getTargetElement(n),u.current=we.getTargetElement(r)):(S(),c.current=u.current=null)},[n,r,s]),We(function(){S()}),[function(){d(),m(),v(),w()},S]}({target:w,overlay:x,listener:function(e,t){var n=t.valid,r=t.type;n&&(o.hideOverlaysOnDocumentScrolling||"outside"===r?L():we.isDocument(e.target)||U())},when:l}),_=wn(I,2),N=_[0],R=_[1],D=function(){a(!0)},L=function(){a(!1),f(!1),y(null)},z=function(){Ie.set("overlay",x.current,o&&o.autoZIndex||Be.autoZIndex,o&&o.zIndex.overlay||Be.zIndex.overlay),we.addStyles(x.current,{position:"absolute",top:"0",left:"0"}),U()},j=function(){i.autoHighlight&&i.suggestions&&i.suggestions.length&&E(function(e){var t=vn(e);return t[0]=!0,t})},$=function(){N(),i.onShow&&i.onShow()},B=function(){R()},F=function(){Ie.clear(x.current),i.onHide&&i.onHide()},U=function(){if(g){var e=g.key,t=g.index,n=k.current.value,r=we.getCursorOffset(k.current,n.substring(0,t-1),n.substring(t),e);x.current.style.transformOrigin="top",x.current.style.left="calc(".concat(r.left,"px + 1rem)"),x.current.style.top="calc(".concat(r.top,"px + 1.2rem)")}},V=function(e){ln.emit("overlay-click",{originalEvent:e,target:w.current})},H=function(e){C.current&&clearTimeout(C.current);var t=e.target,n=t.value,r=t.selectionStart,o=n.substring(r-1,r);if(" "!==o){var s=function(e,t,n){if(!g){var r=Array.isArray(i.trigger)?i.trigger.find(function(e){return e===t}):i.trigger===t?i.trigger:null;if(r)return{key:r,index:n};var o=e.substring(0,n).lastIndexOf(" "),s=function(e,t){if(Array.isArray(i.trigger)){var n={};return i.trigger.forEach(function(r){var o=e.substring(0,t).lastIndexOf(r);-1!==o&&(o>n.index||!n.index)&&(n={key:r,index:-1!==o?o+1:-1})}),n}var r=e.substring(0,t).lastIndexOf(i.trigger);return{key:i.trigger,index:-1!==r?r+1:-1}}(e,n);if(s.index>o)return s}return g}(n,o,r);if(s&&s.index>-1){var l=n.substring(s.index,r);C.current=setTimeout(function(){W(e,l,s)},i.delay)}}else L()},W=function(e,t,n){i.onSearch&&(f(!0),y(n),i.onSearch({originalEvent:e,trigger:n.key,query:t}))},G=function(e,t){var n=k.current,r=n.value,o=n.selectionStart,s=r.indexOf(" ",g.index),l=r.substring(g.index,s>-1?s:o),a=K(t).replace(/\s+/g,"");if(l.trim()!==a){var c=r.substring(0,g.index),u=r.substring(s>-1?o:g.index+l.length);k.current.value=" "===u[0]?"".concat(c).concat(a).concat(u):"".concat(c).concat(a," ").concat(u),e.target=k.current,i.onChange&&i.onChange(e)}var p=g.index+a.length+1;k.current.setSelectionRange(p,p),L(),i.onSelect&&i.onSelect({originalEvent:e,suggestion:t})},K=function(e){if(e){var t=Array.isArray(i.field)?i.field[i.trigger.findIndex(function(e){return e===g.key})]:i.field;return t?Se.resolveFieldData(e,t):e}return""},q=k.current&&k.current.value,J=e.useMemo(function(){return Se.isNotEmpty(i.value)||Se.isNotEmpty(i.defaultValue)||Se.isNotEmpty(q)},[i.value,i.defaultValue,q]);e.useImperativeHandle(n,function(){return{props:i,show:D,hide:L,focus:function(){return we.focus(k.current)},getElement:function(){return w.current},getOverlay:function(){return x.current},getInput:function(){return k.current}}}),e.useEffect(function(){Se.combinedRefs(k,i.inputRef)},[k,i.inputRef]),nt(function(){var e=i.suggestions&&i.suggestions.length;if(e){var t=i.suggestions.map(function(){return!1});E(t)}h&&(e?D():L(),l&&U(),f(!1))},[i.suggestions]),nt(function(){var e=P(),t=e?we.isAttributeEquals(w.current,"data-p-inputwrapper-filled",!0):we.hasClass(w.current,"p-inputwrapper-filled");!J&&t&&(e?we.setAttributes(w.current,{"data-p-inputwrapper-filled":!1}):we.removeClass(w.current,"p-inputwrapper-filled"))},[J]),We(function(){Ie.clear(x.current)});var Y=function(t,n){var o,s=n+"_item",l=i.itemTemplate?Se.getJSXElement(i.itemTemplate,t,{trigger:g?g.key:"",index:n}):K(t),a=b[n],c=r({className:M("item",{isSelected:a}),onClick:function(e){return function(e,t){we.focus(k.current),G(e,t)}(e,t)},"data-p-highlight":a},(o={selected:a},A("item",{context:{trigger:g?g.key:""},state:Pn({},o)})));return e.createElement("li",mn({},c,{key:s}),l,e.createElement(fn,null))},X=An.getOtherProps(i),Q=function(){var t=Se.getJSXElement(i.headerTemplate,i),n=Se.getJSXElement(i.footerTemplate,i),o=function(){var t=r({ref:S,className:M("items")},A("items"));if(i.suggestions){var n=i.suggestions.map(Y);return e.createElement("ul",t,n)}return null}(),s=r({ref:x,className:M("panel"),style:Pn({maxHeight:i.scrollHeight},i.panelStyle),onClick:V},A("panel")),a=r({classNames:M("transition"),in:l,timeout:{enter:120,exit:100},options:i.transitionOptions,unmountOnExit:!0,onEnter:z,onEntering:j,onEntered:$,onExit:B,onExited:F},A("transition")),c=e.createElement(Ut,mn({nodeRef:x},a),e.createElement("div",s,t,o,n));return e.createElement(Kt,{element:c,appendTo:"self"})}(),Z=r(Pn(Pn({ref:k,id:i.inputId,className:M("input"),style:i.inputStyle},X),{},{unstyled:i.unstyled,variant:i.variant,autoResize:i.autoResize,onFocus:function(e){p(!0),i.onFocus&&i.onFocus(e)},onBlur:function(e){p(!1),i.onBlur&&i.onBlur(e)},onKeyDown:function(e){if(l){var t=we.findSingle(x.current,'li[data-p-highlight="true"]');switch(e.which){case 40:if(t){var n=t.nextElementSibling;if(n){var r=we.index(n),o=we.index(t);E(function(e){var t=vn(e);return t[r]=!0,t[o]=!1,t}),we.scrollInView(x.current,n)}}else if(t=we.findSingle(x.current,"li")){var s=we.index(t);E(function(e){var t=vn(e);return t[s]=!0,t})}e.preventDefault();break;case 38:if(t){var a=t.previousElementSibling;if(a){var c=we.index(a),u=we.index(t);E(function(e){var t=vn(e);return t[c]=!0,t[u]=!1,t}),we.scrollInView(x.current,a)}}e.preventDefault();break;case 8:var p=e.target,d=p.value,h=p.selectionStart;d.substring(h-1,h)===g.key&&L();break;case 13:t&&G(e,i.suggestions[we.index(t)]),e.preventDefault();break;case 27:L(),e.preventDefault()}}},onInput:function(e){i.onInput&&i.onInput(e);var t=e.target.value.length>0;P()?we.setAttributes(w.current,{"data-p-inputwrapper-filled":t}):t?we.addClass(w.current,"p-inputwrapper-filled"):we.removeClass(w.current,"p-inputwrapper-filled")},onKeyUp:function(e){37!==e.which&&39!==e.which||H(e)},onChange:function(e){i.onChange&&i.onChange(e),H(e)},__parentMetadata:{parent:T}}),A("input")),ee=r({ref:w,id:i.id,className:de(i.className,M("root",{focusedState:u,isFilled:J})),style:i.style},An.getOtherProps(i),A("root"));return e.createElement("div",ee,e.createElement(Tn,Z),Q)}));function _n(){return _n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_n.apply(null,arguments)}In.displayName="Mention";const Nn=(0,i.styled)("div")(({theme:e})=>({position:"relative","& .p-mention":{width:"100%",position:"relative"},"& textarea":{width:"100%",boxSizing:"border-box",fontFamily:"inherit",fontSize:e.typography.pxToRem(12),lineHeight:1.4375,padding:"4px 8px",borderRadius:e.shape.borderRadius,border:`1px solid ${e.palette.divider}`,backgroundColor:"transparent",color:"inherit",resize:"vertical",outline:"none",transition:"border-color 150ms ease-in-out","&:hover":{borderColor:e.palette.action.active},"&:focus":{borderColor:e.palette.primary.main,borderWidth:2,padding:"3px 7px"},"&:disabled":{opacity:.38,cursor:"default"},"&::placeholder":{color:"inherit",opacity:.5}},"& .p-mention-panel":{fontFamily:"inherit",fontSize:e.typography.pxToRem(12),backgroundColor:e.palette.background.paper,border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,boxShadow:e.shadows[4],maxHeight:"200px",overflow:"auto",zIndex:e.zIndex.modal,maxWidth:"100%",right:0,left:"auto !important"},"& .p-mention-items":{listStyle:"none",margin:0,padding:"4px 0"},"& .p-mention-item":{padding:"6px 12px",cursor:"pointer",color:e.palette.text.primary,"&:hover":{backgroundColor:e.palette.action.hover},"&.p-highlight":{backgroundColor:e.palette.action.selected}},'&[data-single-line="true"] textarea':{resize:"none"}}));function Rn(e,t){const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`${"start"===t?"^":""}@${n}(?=\\s|$|[^a-zA-Z0-9_-])`,"g")}const Dn=D(({placeholder:t,ariaLabel:n,suggestions:r,rows:i=5,triggerPosition:s="auto"})=>{const{value:l,setValue:a,disabled:c}=b(o.stringPropTypeUtil),[u,p]=(0,e.useState)([]),d=(0,e.useCallback)(e=>{let t=e;for(const e of r){const n=Rn(e.value,s);t=t.replace(n,`[${e.value}]`)}return t},[r,s]),h=(0,e.useCallback)(e=>{const t=e.target.value,n=d(t);a(n)},[a,d]),f=(0,e.useCallback)(e=>{if("start"===s&&0!==e.originalEvent.target.selectionStart-e.query.length-e.trigger.length)return void p([]);const t=e.query.toLowerCase(),n=r.filter(e=>e.label.toLowerCase().includes(t)||e.value.toLowerCase().includes(t));p(n)},[r,s]);return e.createElement(Y,null,e.createElement(Nn,{"data-single-line":1===i?"true":void 0},e.createElement(In,_n({value:l??"",onChange:h,suggestions:u,onSearch:f,field:"value",trigger:"@",rows:i,disabled:c,placeholder:t,itemTemplate:Ln},n?{"aria-label":n}:{}))))}),Ln=t=>e.createElement("span",null,t.label);var zn=window.elementorV2.editorResponsive;function jn(t={}){const{limit:n=3,timeout:r=600}=t,o=(0,e.useRef)(""),i=(0,e.useRef)(null);return(0,e.useEffect)(()=>()=>{o.current="",i.current&&(clearTimeout(i.current),i.current=null)},[]),{buffer:o.current,appendKey:e=>(o.current=(o.current+e).slice(-n),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{o.current="",i.current=null},r),o.current),startsWith:(e,t)=>!(3<e.length&&2>t.length)&&e.startsWith(t)}}const $n=["px","%","em","rem","vw","vh","ch"],Bn=["auto","custom"],Fn=NaN;function Un(e){return Bn.includes(e)}function Vn(){return Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vn.apply(null,arguments)}const Hn=["e","E","+"],Wn=(0,e.forwardRef)((t,n)=>{const[r,o]=(0,e.useState)(0);return e.createElement(i.TextField,Vn({},t,{ref:n,key:r,onKeyDown:e=>{!function(e,t){const n=[...Hn];t>=0&&n.push("-"),n.includes(e.key)&&e.preventDefault()}(e,t.inputProps?.min),t.onKeyDown?.(e)},onBlur:e=>{t.onBlur?.(e);const{valid:n}=e.target.validity;n||o(e=>e+1)}}))});function Gn(){return Gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gn.apply(null,arguments)}const Kn=(0,e.forwardRef)(({placeholder:t,type:n,value:r,onChange:i,onBlur:s,onKeyDown:l,onKeyUp:a,InputProps:c,inputProps:u,disabled:p,isPopoverOpen:d,id:h},f)=>{const{placeholder:m}=b(o.sizePropTypeUtil);return e.createElement(Wn,{ref:f,sx:{input:{cursor:c.readOnly?"default !important":void 0}},size:"tiny",fullWidth:!0,type:n,value:r,onInput:i,onKeyDown:l,onKeyUp:a,disabled:p,onBlur:s,focused:!!d||void 0,placeholder:t??(String(m?.size??"")||void 0),InputProps:c,inputProps:u,id:h})}),qn=({options:t,alternativeOptionLabels:n={},onClick:r,value:s,menuItemsAttributes:l={},disabled:a})=>{const c=(0,i.usePopupState)({variant:"popover",popupId:(0,e.useId)()}),{placeholder:u,showPrimaryColor:p}=function(e){const{value:t,placeholder:n}=b(o.sizePropTypeUtil),r=t?.size,i=t?.unit,s="custom"===e&&Boolean(r),l="auto"===e||s||Boolean(r);if(!n)return{placeholder:null,showPrimaryColor:l};return{placeholder:!i&&"px"===e?n.unit:void 0,showPrimaryColor:l}}(s),d={display:"flex",flexDirection:"column",justifyContent:"center"};return e.createElement(i.InputAdornment,{position:"end"},e.createElement(Jn,Gn({isPrimaryColor:p,size:"small",disabled:a},(0,i.bindTrigger)(c)),u??n[s]??s),e.createElement(i.Menu,Gn({MenuListProps:{dense:!0}},(0,i.bindMenu)(c)),t.map((o,i)=>e.createElement(G.MenuListItem,Gn({key:o,onClick:()=>(e=>{r(t[e]),c.close()})(i)},l?.[o],{primaryTypographyProps:{variant:"caption",sx:{...d,lineHeight:"1"}},menuItemTextProps:{sx:d}}),n[o]??o.toUpperCase()))))},Jn=(0,i.styled)(i.Button,{shouldForwardProp:e=>"isPrimaryColor"!==e})(({isPrimaryColor:e,theme:t})=>({color:e?t.palette.text.primary:t.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),Yn=({units:t,handleUnitChange:n,handleSizeChange:r,placeholder:o,startIcon:s,onBlur:l,onFocus:a,onClick:c,size:u,unit:p,popupState:d,disabled:h,min:f,id:m,ariaLabel:g})=>{const{appendKey:y,startsWith:v}=jn(),b=Un(p)?"text":"number",E=!Un(p)&&Number.isNaN(u)?"":u??"",w={"aria-controls":d.isOpen?d.popupId:void 0,"aria-haspopup":!0},x=t.includes("custom")?{custom:w}:void 0,k={custom:e.createElement(H.MathFunctionIcon,{fontSize:"tiny"})},S={...w,readOnly:Un(p),autoComplete:"off",onClick:c,onFocus:a,startAdornment:s?e.createElement(i.InputAdornment,{position:"start",disabled:h},s):void 0,endAdornment:e.createElement(qn,{disabled:h,options:t,onClick:n,value:p,alternativeOptionLabels:k,menuItemsAttributes:x})};return e.createElement(Y,null,e.createElement(i.Box,null,e.createElement(Kn,{disabled:h,placeholder:o,type:b,value:E,onChange:r,onKeyDown:e=>{const{key:r,altKey:o,ctrlKey:i,metaKey:s}=e;if(o||i||s)return;if(Un(p)&&!isNaN(Number(r))){const e=t?.[0];return void(e&&n(e))}if(!/^[a-zA-Z%]$/.test(r))return;e.preventDefault();const l=r.toLowerCase(),a=y(l),c=t.find(e=>v(e,a));c&&n(c)},onBlur:l,InputProps:S,inputProps:{min:f,step:"any","aria-label":g},isPopoverOpen:d.isOpen,id:m})))};function Xn(){return Xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xn.apply(null,arguments)}const Qn=t=>{const{popupState:n,restoreValue:r,anchorRef:o,value:l,onChange:a}=t,c=(0,e.useRef)(null);(0,e.useEffect)(()=>{n.isOpen&&requestAnimationFrame(()=>{c.current&&c.current.focus()})},[n.isOpen]);const u=()=>{r(),n.close()};return e.createElement(i.Popover,Xn({disablePortal:!0,slotProps:{paper:{sx:{borderRadius:2,width:o.current?.offsetWidth+"px"}}}},(0,i.bindPopover)(n),{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onClose:u}),e.createElement(G.PopoverHeader,{title:(0,s.__)("CSS function","elementor"),onClose:u,icon:e.createElement(H.MathFunctionIcon,{fontSize:"tiny"})}),e.createElement(i.TextField,{value:l,onChange:a,onKeyPress:e=>{"enter"===e.key.toLowerCase()&&u()},size:"tiny",type:"text",fullWidth:!0,inputProps:{ref:c},sx:{pt:0,pr:1.5,pb:1.5,pl:1.5}}))},Zn=({external:t,setExternal:n,persistWhen:r,fallback:o})=>{function i(e,t){return e||o(t)}const[s,l]=(0,e.useState)(i(t,null));return(0,e.useEffect)(()=>{l(e=>i(t,e))},[t]),[s,(e,t,o)=>{const i=("function"==typeof e?e:()=>e)(s);var a;l(i),n(r(a=i)?a:null,t,o)}]},er={length:"px",angle:"deg",time:"ms"},tr={length:[...$n],angle:["deg","rad","grad","turn"],time:["s","ms"]},nr="fx",rr=D(({variant:t="length",defaultUnit:n,units:r,placeholder:s,startIcon:l,anchorRef:a,extendedOptions:c,disableCustom:u,min:p=0,enablePropTypeUnits:d=!1,id:h,ariaLabel:f})=>{const{value:m,setValue:g,disabled:y,restoreValue:v,placeholder:E,propType:w}=b(o.sizePropTypeUtil),x=n??E?.unit??er[t],k=(0,zn.useActiveBreakpoint)(),S=function(t,n){return(0,e.useMemo)(()=>{const e=[...t];return n||e.includes("custom")?t.includes("custom")&&e.splice(e.indexOf("custom"),1):e.push("custom"),e},[t,n])}(c||[],u??!1),C=function(e,t,n,r,o){const i=[...tr[n]];return t?e.settings?.available_units??i:[...r??i,...o||[]]}(w,d,t,r,S),T=(0,i.usePopupState)({variant:"popover"}),O=(0,e.useMemo)(()=>function(e,t,n="",r=""){const o=e?.unit??t,i=e?.size??n;return{numeric:Un(o)||isNaN(Number(i))||!i&&0!==i?Fn:Number(i),custom:"custom"===o?String(i):r,unit:o}}(m,x),[m,x]),[A,M]=Zn({external:O,setExternal:(e,t,n)=>g(ir(e),t,n),persistWhen:e=>!!ir(e),fallback:e=>({unit:e?.unit??x,numeric:e?.numeric??Fn,custom:e?.custom??""})}),{size:P=Fn,unit:I=x}=ir(A,!0)||{},_=e=>{const t=e.target.value,n=e.target.validity.valid;"auto"!==I?M(e=>({...e,["custom"===I?"custom":"numeric"]:or(t,I),unit:I}),void 0,{validation:()=>n}):M(e=>({...e,unit:I}))},N=(0,e.useCallback)(()=>{T&&T.isOpen&&T.close()},[T]);return(0,e.useEffect)(()=>{N()},[k]),e.createElement(e.Fragment,null,e.createElement(Yn,{disabled:y,size:P,unit:I,units:[...C],placeholder:s,startIcon:l,handleSizeChange:_,handleUnitChange:e=>{"custom"===e&&T.open(a?.current),M(t=>({...t,unit:e}))},onBlur:v,onClick:e=>{e.target.closest("input")&&"custom"===A.unit&&T.open(a?.current)},popupState:T,min:p,id:h,ariaLabel:f}),a?.current&&T.isOpen&&e.createElement(Qn,{popupState:T,anchorRef:a,restoreValue:v,value:P,onChange:_}))});function or(e,t){return Un(t)?"auto"===t?"":String(e??""):e||0===e?Number(e):NaN}function ir(e,t=!1){if(!e)return null;if(!e?.unit)return{size:Fn,unit:"px"};const{unit:n}=e;if("auto"===n)return{size:"",unit:n};if("custom"===n)return{size:e.custom??"",unit:"custom"};const r=e.numeric;return t||null!=r&&!Number.isNaN(r)?{size:r,unit:n}:null}const sr=({gap:t=.5,sx:n,children:r})=>e.createElement(i.Stack,{gap:t,sx:{...n}},r);function lr(){return lr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr.apply(null,arguments)}const ar=D(({propTypeUtil:t=o.colorPropTypeUtil,anchorEl:n,slotProps:r={},id:s,...l})=>{const{value:a,setValue:c,placeholder:u,disabled:p}=b(t),d=l.placeholder??u;return e.createElement(Y,null,e.createElement(i.UnstableColorField,lr({id:s,size:"tiny",fullWidth:!0,value:a??"",placeholder:d??"",onChange:e=>{c(e||null)}},l,{disabled:p,slotProps:{...r,colorPicker:{anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:-10},slotProps:{colorIndicator:{value:a??d??""},colorBox:{value:a??d??""}}}}})))}),cr=["px","em","rem"],ur=D(()=>{const t=b(o.strokePropTypeUtil),n=(0,e.useRef)(null);return e.createElement(d,t,e.createElement(sr,{gap:2},e.createElement(pr,{bind:"width",label:(0,s.__)("Stroke width","elementor"),ref:n},e.createElement(rr,{units:cr,anchorRef:n})),e.createElement(pr,{bind:"color",label:(0,s.__)("Stroke color","elementor")},e.createElement(ar,null))))}),pr=(0,e.forwardRef)(({bind:t,label:n,children:r},o)=>e.createElement(m,{bind:t},e.createElement(i.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap",ref:o},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,n)),e.createElement(i.Grid,{item:!0,xs:6},r)))),dr=({isOpen:t,onClose:n})=>{const r=(0,e.useRef)(n);r.current=n;const o=(0,zn.useActiveBreakpoint)(),i=(0,zn.useBreakpoints)(),s=(0,e.useMemo)(()=>(e=>e.map(e=>[e.id,e.width??"",e.type??""].join(":")).join("|"))(i),[i]),l=(0,e.useRef)(void 0),a=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!t)return l.current=o,void(a.current=s);const e=l.current,n=a.current;(void 0!==e&&e!==o||null!==n&&n!==s)&&r.current(),l.current=o,a.current=s},[o,s,t]),(0,e.useEffect)(()=>{if(!t)return;const e=e=>{"Escape"!==e.key||e.defaultPrevented||r.current()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t])},hr=new class{listeners=new Map;subscribe(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);const n=this.listeners.get(e);n&&n.add(t)}unsubscribe(e,t){const n=this.listeners.get(e);n&&(n.delete(t),0===n.size&&this.listeners.delete(e))}emit(e,t){const n=this.listeners.get(e);n&&n.forEach(e=>e(t))}clearAll(){this.listeners.clear()}},fr=(0,e.createContext)({index:-1,value:{}}),mr=(0,e.createContext)(null),gr=()=>{const t=(0,e.useContext)(mr),n=(0,e.useContext)(fr);if(!t)throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");return{...t,...n}},yr=({children:t,initial:n,propTypeUtil:r,isItemDisabled:o=()=>!1})=>{const{value:s,setValue:l}=b(r),[a,c]=Zn({external:s,fallback:()=>[],setExternal:l,persistWhen:()=>!0}),[u,p]=(0,e.useState)(()=>a?.map(()=>vr())??[]);(0,e.useEffect)(()=>{const e=a?.length??0;p(t=>{const n=t.length;return n===e?t:n>e?t.slice(0,e):[...t,...Array.from({length:e-n},vr)]})},[a?.length]);const d=(0,e.useMemo)(()=>u.map((e,t)=>({key:e,item:a[t]})).filter(({item:e})=>void 0!==e),[u,a]),[h,f]=(0,e.useState)(-1),[m,g]=(0,e.useState)(null),y=-1!==h,v=(0,i.usePopupState)({variant:"popover"});return dr({isOpen:y,onClose:()=>{y&&(f(-1),g(null),v.close())}}),e.createElement(mr.Provider,{value:{isOpen:y,openItemIndex:h,setOpenItemIndex:f,items:d??[],setItems:e=>{c(e.map(({item:e})=>e))},popoverState:v,initial:n,updateItem:(e,t)=>{const n=[...a.slice(0,t),e,...a.slice(t+1)];c(n)},addItem:(e,t)=>{const o=t?.item??{...n},i=t?.index??a.length,s=vr(),l=[...a];l.splice(i,0,o),c(l),p([...u.slice(0,i),s,...u.slice(i)]),f(i),v.open(m??e),hr.emit(`${r.key}-item-added`,{itemValue:n.value})},removeItem:e=>{const t=a[e];c(a.filter((t,n)=>n!==e)),p(u.filter((t,n)=>n!==e)),hr.emit(`${r.key}-item-removed`,{itemValue:t?.value})},rowRef:m,setRowRef:g,isItemDisabled:e=>o(d[e].item)}},t)},vr=()=>Date.now()+Math.floor(1e6*Math.random()),br="tiny",Er=({disabled:t=!1,enableTooltip:n=!1,tooltipContent:r=null,newItemIndex:o,ariaLabel:l})=>{const{addItem:a}=gr();return e.createElement(wr,{content:r,enable:n},e.createElement(i.Box,{component:"span",sx:{cursor:t?"not-allowed":"pointer"}},e.createElement(i.IconButton,{size:br,disabled:t,onClick:e=>a(e,{index:o}),"aria-label":(0,s.sprintf)((0,s.__)("Add %s item","elementor"),l?.toLowerCase())},e.createElement(H.PlusIcon,{fontSize:br}))))},wr=({children:t,enable:n,content:r})=>n&&r?e.createElement(i.Infotip,{placement:"right",color:"secondary",content:r},t):t;function xr(){return xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xr.apply(null,arguments)}const kr=t=>e.createElement(i.List,{sx:{p:0,my:-.5,mx:0}},e.createElement(i.UnstableSortableProvider,xr({restrictAxis:!0,disableDragOverlay:!1,variant:"static"},t))),Sr=({id:t,children:n,disabled:r})=>e.createElement(i.UnstableSortableItem,{id:t,disabled:r,render:({itemProps:t,triggerProps:o,itemStyle:i,triggerStyle:s,showDropIndication:l,dropIndicationStyle:a})=>e.createElement(Cr,xr({},t,{style:i,tabIndex:-1}),!r&&e.createElement(Tr,xr({},o,{style:s})),n,l&&e.createElement(Or,{style:a}))}),Cr=(0,i.styled)(i.ListItem)` position: relative; margin-inline: 0px; padding-inline: 0px; padding-block: ${({theme:e})=>e.spacing(.5)}; & .class-item-sortable-trigger { color: ${({theme:e})=>e.palette.action.active}; height: 100%; display: flex; align-items: center; visibility: hidden; position: absolute; top: 50%; padding-inline-end: ${({theme:e})=>e.spacing(.5)}; transform: translate( -75%, -50% ); } &[aria-describedby=''] > .MuiTag-root { background-color: ${({theme:e})=>e.palette.background.paper}; box-shadow: ${({theme:e})=>e.shadows[3]}; } &:hover, &:focus-within { & .class-item-sortable-trigger { visibility: visible; } } `,Tr=t=>e.createElement("div",xr({},t,{role:"button",className:"class-item-sortable-trigger",tabIndex:0,"aria-label":(0,s.__)("Drag item","elementor")}),e.createElement(H.GripVerticalIcon,{fontSize:"tiny"})),Or=(0,i.styled)(i.Divider)` height: 0px; border: none; overflow: visible; &:after { --height: 2px; content: ''; display: block; width: 100%; height: var( --height ); margin-block: calc( -1 * var( --height ) / 2 ); border-radius: ${({theme:e})=>e.spacing(.5)}; background-color: ${({theme:e})=>e.palette.text.primary}; } `,Ar=({isSortable:t=!0,children:n})=>{const{items:r,setItems:o}=gr(),i=r.map(({key:e})=>e);return n?e.createElement(e.Fragment,null,e.createElement(kr,{value:i,onChange:e=>{o(e.map(e=>{const t=r.findIndex(t=>t.key===e);return r[t]}))}},i.map((o,i)=>{const s=r[i].item;return e.createElement(Sr,{id:o,key:`sortable-${o}`,disabled:!t},e.createElement(fr.Provider,{value:{index:i,value:s}},n))}))):null},Mr=(0,e.createContext)(void 0),Pr=()=>{const t=(0,e.useContext)(Mr);if(!t)throw new Error("useRepeatableControlContext must be used within RepeatableControl");return t};function Ir(){return Ir=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ir.apply(null,arguments)}const _r=(0,e.forwardRef)((t,n)=>e.createElement(i.UnstableTag,Ir({ref:n,fullWidth:!0,showActionsOnHover:!0,variant:"outlined",sx:{minHeight:e=>e.spacing(3.5)}},t)));var Nr=window.elementorV2.locations;const{Slot:Rr,inject:Dr}=(0,Nr.createReplaceableLocation)(),{Slot:Lr,inject:zr}=(0,Nr.createReplaceableLocation)(),{Slot:jr,inject:$r}=(0,Nr.createLocation)();function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Br.apply(null,arguments)}const Fr=({Label:t,Icon:n,actions:r})=>{const{popoverState:o,setRowRef:l,openItemIndex:a,setOpenItemIndex:c,index:u=-1,value:p,isItemDisabled:d}=gr(),h=(0,e.useContext)(Mr),f=!!h?.props?.readOnly,m=(0,i.bindTrigger)(o);return e.createElement(_r,Br({ref:e=>{e&&a===u&&e!==o.anchorEl&&(l(e),o.setAnchorEl(e))},label:e.createElement(Lr,{value:p},e.createElement(t,{value:p})),"aria-label":(0,s.__)("Open item","elementor")},m,{onClick:e=>{f||d(u)||(m.onClick(e),c(u))},startIcon:e.createElement(Rr,{value:p},e.createElement(n,{value:p})),sx:{minHeight:e=>e.spacing(3.5),...d(u)&&{'[role="button"]':{cursor:"not-allowed"}}},actions:e.createElement(e.Fragment,null,e.createElement(jr,{index:u??-1}),r)}))},Ur=({children:t,initial:n,propTypeUtil:r,isItemDisabled:o})=>e.createElement(sr,null,e.createElement(yr,{initial:n,propTypeUtil:r,isItemDisabled:o},t)),Vr="tiny",Hr=()=>{const{items:t,updateItem:n,index:r=-1}=gr();if(-1===r)return null;const o=t[r].item.disabled??!1,l=o?(0,s.__)("Show","elementor"):(0,s.__)("Hide","elementor");return e.createElement(i.Tooltip,{title:l,placement:"top"},e.createElement(i.IconButton,{size:Vr,onClick:()=>{const e=structuredClone(t[r].item);e.disabled=!e.disabled,e.disabled||delete e.disabled,n(e,r)},"aria-label":l},o?e.createElement(H.EyeOffIcon,{fontSize:Vr}):e.createElement(H.EyeIcon,{fontSize:Vr})))},Wr="tiny",Gr=()=>{const{items:t,addItem:n,index:r=-1,isItemDisabled:o}=gr();if(-1===r)return null;const l=(0,s.__)("Duplicate","elementor"),a=t[r]?.item;return e.createElement(i.Tooltip,{title:l,placement:"top"},e.createElement(i.IconButton,{size:Wr,onClick:e=>{const t=structuredClone(a);n(e,{item:t,index:r+1})},"aria-label":l,disabled:o(r)},e.createElement(H.CopyIcon,{fontSize:Wr})))},Kr="tiny",qr=()=>{const{removeItem:t,index:n=-1}=gr();if(-1===n)return null;const r=(0,s.__)("Remove","elementor");return e.createElement(i.Tooltip,{title:r,placement:"top"},e.createElement(i.IconButton,{size:Kr,onClick:()=>t(n),"aria-label":r},e.createElement(H.XIcon,{fontSize:Kr})))};function Jr(){return Jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jr.apply(null,arguments)}const Yr=({children:t,width:n,...r})=>e.createElement(i.Popover,Jr({disablePortal:!0,disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{marginBlockStart:.5,width:n,overflow:"visible"}}}},r),t);function Xr(){return Xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xr.apply(null,arguments)}const Qr=({children:t})=>{const{popoverState:n,openItemIndex:r,isOpen:o,rowRef:s,setOpenItemIndex:l,setRowRef:a}=gr();return o&&s?e.createElement(Yr,Xr({width:s.offsetWidth},(0,i.bindPopover)(n),{onClose:()=>{a(null),n.setAnchorEl(null),l(-1)}}),e.createElement(m,{bind:String(r)},e.createElement(i.Box,null,t))):null};function Zr(){return Zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zr.apply(null,arguments)}const eo=({gap:t=1.5,children:n,...r})=>e.createElement(i.Stack,Zr({},r,{gap:t}),n),to=(0,e.forwardRef)(({gap:t=1.5,alignItems:n="center",flexWrap:r="nowrap",children:o},s)=>e.createElement(i.Grid,{container:!0,gap:t,alignItems:n,flexWrap:r,ref:s},o)),no=(0,e.forwardRef)(({label:t,children:n,adornment:r=O},o)=>e.createElement(i.Stack,{direction:"row",alignItems:"center",gap:1,sx:{marginInlineEnd:-.75,py:.25},ref:o},e.createElement(i.Box,{display:"flex",alignItems:"center",gap:1,sx:{flexGrow:1}},e.createElement(i.Typography,{component:"label",variant:"caption",color:"text.secondary",sx:{lineHeight:1}},t),e.createElement(r,null)),n)),ro=D(()=>{const{propType:t,value:n,setValue:r,disabled:i}=b(o.boxShadowPropTypeUtil);return e.createElement(d,{propType:t,value:n,setValue:r,isDisabled:()=>i},e.createElement(Ur,{initial:co,propTypeUtil:o.boxShadowPropTypeUtil},e.createElement(no,{label:(0,s.__)("Box shadow","elementor")},e.createElement(Er,{newItemIndex:0,disabled:i,ariaLabel:"Box shadow"})),e.createElement(Ar,null,e.createElement(Fr,{Icon:io,Label:ao,actions:e.createElement(e.Fragment,null,e.createElement(Gr,null),e.createElement(Hr,null),e.createElement(qr,null))})),e.createElement(Qr,null,e.createElement(so,null))))}),oo=(0,i.styled)(i.UnstableColorIndicator)(({theme:e})=>({height:"1rem",width:"1rem",borderRadius:e.shape.borderRadius/2+"px"})),io=({value:t})=>e.createElement(oo,{size:"inherit",component:"span",value:t.value.color?.value}),so=()=>{const t=b(o.shadowPropTypeUtil),n=[(0,e.useRef)(null),(0,e.useRef)(null)],{rowRef:r}=gr();return e.createElement(d,t,e.createElement(eo,{p:1.5},e.createElement(to,null,e.createElement(lo,{bind:"color",label:(0,s.__)("Color","elementor")},e.createElement(ar,{anchorEl:r})),e.createElement(lo,{bind:"position",label:(0,s.__)("Position","elementor"),sx:{overflow:"hidden"}},e.createElement(ee,{options:[{label:(0,s.__)("Inset","elementor"),value:"inset"},{label:(0,s.__)("Outset","elementor"),value:null}]}))),e.createElement(to,{ref:n[0]},e.createElement(lo,{bind:"hOffset",label:(0,s.__)("Horizontal","elementor")},e.createElement(rr,{anchorRef:n[0],min:-Number.MAX_SAFE_INTEGER})),e.createElement(lo,{bind:"vOffset",label:(0,s.__)("Vertical","elementor")},e.createElement(rr,{anchorRef:n[0],min:-Number.MAX_SAFE_INTEGER}))),e.createElement(to,{ref:n[1]},e.createElement(lo,{bind:"blur",label:(0,s.__)("Blur","elementor")},e.createElement(rr,{anchorRef:n[1]})),e.createElement(lo,{bind:"spread",label:(0,s.__)("Spread","elementor")},e.createElement(rr,{anchorRef:n[1],min:-Number.MAX_SAFE_INTEGER})))))},lo=({label:t,bind:n,children:r,sx:o})=>e.createElement(m,{bind:n},e.createElement(i.Grid,{item:!0,xs:6,sx:o},e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(i.FormLabel,{size:"tiny"},t)),e.createElement(i.Grid,{item:!0,xs:12},r)))),ao=({value:t})=>{const{position:n,hOffset:r,vOffset:o,blur:i,spread:s}=t.value,{size:l="",unit:a=""}=i?.value||{},{size:c="",unit:u=""}=s?.value||{},{size:p="unset",unit:d=""}=r?.value||{},{size:h="unset",unit:f=""}=o?.value||{},m=n?.value||"outset",g=[[p,d],[h,f],[l,a],[c,u]].map(([e,t])=>"custom"!==t?e+t:e||nr).join(" ");return e.createElement("span",{style:{textTransform:"capitalize"}},m,": ",g)},co={$$type:"shadow",value:{hOffset:{$$type:"size",value:{unit:"px",size:0}},vOffset:{$$type:"size",value:{unit:"px",size:0}},blur:{$$type:"size",value:{unit:"px",size:10}},spread:{$$type:"size",value:{unit:"px",size:0}},color:{$$type:"color",value:"rgba(0, 0, 0, 1)"},position:null}},uo={blur:{blur:{name:(0,s.__)("Blur","elementor"),valueName:(0,s.__)("Radius","elementor")}},intensity:{brightness:{name:(0,s.__)("Brightness","elementor")},contrast:{name:(0,s.__)("Contrast","elementor")},saturate:{name:(0,s.__)("Saturate","elementor")}},"hue-rotate":{"hue-rotate":{name:(0,s.__)("Hue Rotate","elementor"),valueName:(0,s.__)("Angle","elementor")}},"color-tone":{grayscale:{name:(0,s.__)("Grayscale","elementor")},invert:{name:(0,s.__)("Invert","elementor")},sepia:{name:(0,s.__)("Sepia","elementor")}},"drop-shadow":{"drop-shadow":{name:(0,s.__)("Drop shadow","elementor"),valueName:(0,s.__)("Drop-shadow","elementor")}}},po=(0,s.__)("Amount","elementor"),ho={"drop-shadow":e=>function(e){const t=e.shape;return{blur:t?.blur?.default,xAxis:t?.xAxis?.default,yAxis:t?.yAxis?.default,color:t?.color?.default??(t?.color).prop_types.color.default}}(e)};const fo=(0,e.createContext)(null);function mo({children:t}){const n=b(o.cssFilterFunctionPropUtil),r=(0,e.useMemo)(()=>{const e=function(e){const t=Object.entries(uo).flatMap(([t,n])=>Object.entries(n).map(([n,r])=>function(t,n,{name:r,valueName:o}){const i=function(e,t){return e.shape?.args?.prop_types[t]}(e,t),s=ho[n]?.(i)??function(e){const t=e?.shape?.size;return{size:t?.default}}(i),l=function({filterFunction:e,filterFunctionGroup:t,value:n}){return{$$type:"css-filter-func",value:{func:{$$type:"string",value:e},args:{$$type:t,value:n}}}}({filterFunction:n,filterFunctionGroup:t,value:s});return[n,{name:r,valueName:o??po,defaultValue:l,filterFunctionGroup:t}]}(t,n,r)));return Object.fromEntries(t)}(n.propType.item_prop_type),t=Object.entries(e).map(([e,t])=>({value:e,label:t.name}));return{config:e,filterOptions:t,getFilterFunctionConfig:t=>e[t],getInitialValue:()=>e.blur.defaultValue}},[n.propType]);return e.createElement(fo.Provider,{value:r},t)}function go(){const t=(0,e.useContext)(fo);if(!t)throw new Error("useFilterConfig must be used within FilterConfigProvider");return t}const yo=[{bind:"xAxis",label:(0,s.__)("X-axis","elementor"),rowIndex:0},{bind:"yAxis",label:(0,s.__)("Y-axis","elementor"),rowIndex:0},{bind:"blur",label:(0,s.__)("Blur","elementor"),rowIndex:1},{bind:"color",label:(0,s.__)("Color","elementor"),rowIndex:1}],vo=({anchorEl:t})=>{const n=b(o.dropShadowFilterPropTypeUtil),r=[(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(d,n,yo.map(n=>e.createElement(to,{key:n.bind,ref:r[n.rowIndex]??null},e.createElement(m,{bind:n.bind},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,n.label)),e.createElement(i.Grid,{item:!0,xs:6},"color"===n.bind?e.createElement(ar,{anchorEl:t}):e.createElement(rr,{anchorRef:r[n.rowIndex],enablePropTypeUnits:!0,min:"blur"===n.bind?0:-Number.MAX_SAFE_INTEGER,defaultUnit:"px"}))))))},bo={blur:o.blurFilterPropTypeUtil,intensity:o.intensityFilterPropTypeUtil,"hue-rotate":o.hueRotateFilterPropTypeUtil,"color-tone":o.colorToneFilterPropTypeUtil},Eo=({filterFunc:t})=>{const n=(0,e.useRef)(null),{getFilterFunctionConfig:r}=go(),{valueName:o,filterFunctionGroup:s}=r(t),l=b(bo[s]);return e.createElement(d,l,e.createElement(m,{bind:s},e.createElement(m,{bind:"size"},e.createElement(to,{ref:n},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,o)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(rr,{anchorRef:n,enablePropTypeUnits:!0}))))))};function wo(){return wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wo.apply(null,arguments)}const xo=()=>{const t=b(o.cssFilterFunctionPropUtil),{filterOptions:n,getFilterFunctionConfig:r}=go();return e.createElement(d,wo({},t,{setValue:(e,n,o)=>{let i=structuredClone(e);const s=r(i?.func.value);"func"===o?.bind&&(i=s.defaultValue.value),i.args&&t.setValue(i)}}),e.createElement(m,{bind:"css-filter-func"},e.createElement(eo,{p:1.5},e.createElement(to,null,e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,(0,s.__)("Filter","elementor"))),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"func"},e.createElement(ee,{options:n})))),e.createElement(m,{bind:"args"},e.createElement(ko,null)))))},ko=()=>{const{openItemIndex:t,items:n}=gr(),r=n[t].item.value.func.value;return"drop-shadow"===r?e.createElement(vo,null):e.createElement(Eo,{filterFunc:r})},So=({value:t})=>"drop-shadow"!==t.value.func.value?null:e.createElement(Co,{size:"inherit",component:"span",value:t.value.args.value?.color.value}),Co=(0,i.styled)(i.UnstableColorIndicator)(({theme:e})=>({borderRadius:e.shape.borderRadius/2+"px"})),To=({value:t})=>{const n=t.value.args.value,r=["xAxis","yAxis","blur"].map(e=>"custom"!==n[e]?.value?.unit?`${n[e]?.value?.size??0}${n[e]?.value?.unit??"px"}`:n[e]?.value?.size||nr);return e.createElement(i.Box,{component:"span"},e.createElement(i.Box,{component:"span",style:{textTransform:"capitalize"}},(0,s.__)("Drop shadow:","elementor")),` ${r.join(" ")}`)},Oo=({value:t})=>{const{func:n,args:r}=t.value,{getFilterFunctionConfig:o}=go(),{defaultValue:s}=o(n.value??""),l=s.value.args.value?.size?.value?.unit??$n[0],{unit:a,size:c}=r.value.size?.value??{unit:l,size:0},u=e.createElement(i.Box,{component:"span",style:{textTransform:"capitalize"}},n.value??"",":");return e.createElement(i.Box,{component:"span"},u," "+("custom"!==a?`${c??0}${a??l}`:c||nr))},Ao=({value:t})=>"drop-shadow"===t.value.func.value?e.createElement(To,{value:t}):e.createElement(Oo,{value:t}),Mo={filter:{propTypeUtil:o.filterPropTypeUtil,label:(0,s.__)("Filters","elementor")},"backdrop-filter":{propTypeUtil:o.backdropFilterPropTypeUtil,label:(0,s.__)("Backdrop filters","elementor")}},Po=D(({filterPropName:t="filter"})=>{const{propTypeUtil:n,label:r}=(l=t)&&l in Mo?Mo[l]:Mo.filter,{propType:o,value:i,setValue:s}=b(n);var l;return e.createElement(mo,null,e.createElement(d,{propType:o,value:i,setValue:s},e.createElement(Io,{propTypeUtil:n,label:r,filterPropName:t})))}),Io=({propTypeUtil:t,label:n,filterPropName:r})=>{const{getInitialValue:o}=go();return e.createElement(Ur,{initial:o(),propTypeUtil:t},e.createElement(no,{label:n},e.createElement(Er,{newItemIndex:0,ariaLabel:"backdrop-filter"===r?"backdrop filter":"filter"})),e.createElement(Ar,null,e.createElement(Fr,{Label:Ao,Icon:So,actions:e.createElement(e.Fragment,null,e.createElement(Gr,null),e.createElement(Hr,null),e.createElement(qr,null))})),e.createElement(Qr,null,e.createElement(xo,null)))};function _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_o.apply(null,arguments)}const No={"off-canvas":()=>{const e=window,t=e.elementor.config.document.id,n=e.elementor.$previewContents[0].querySelectorAll(`[data-elementor-id="${t}"] .elementor-widget-off-canvas.elementor-element-edit-mode`);return Array.from(n).map(e=>({label:e.querySelector(".e-off-canvas")?.getAttribute("aria-label")??"",value:e.dataset.id}))},"form-elements":()=>{const e=window,t=e.elementor.config.document.id,n=[`[data-elementor-id="${t}"] input[id]:not([type="hidden"]):not([type="reset"]):not([type="button"])`,`[data-elementor-id="${t}"] select[id]`,`[data-elementor-id="${t}"] textarea[id]`],r=e.elementor.$previewContents[0].querySelectorAll(n.join(", "));return Array.from(r).map(e=>{const t=e.tagName.toLowerCase();return{label:`${e.id} (${"input"===t?e.getAttribute("type"):t})`,value:e.id}})}},Ro=D(({collectionId:t,options:n,...r})=>{const o=((t,n)=>{const[r,o]=(0,e.useState)(n??[]);return(0,e.useEffect)(()=>{t&&No[t]?o(No[t]()):o(n??[])},[t,n]),r})(t,n);return e.createElement(ee,_o({options:o},r))});function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Do.apply(null,arguments)}const Lo=D(({options:t})=>{const{value:n,setValue:r,disabled:s}=b(o.stringArrayPropTypeUtil),l=(n||[]).map(e=>o.stringPropTypeUtil.extract(e)).filter(e=>null!==e).map(e=>t.find(t=>t.value===e)).filter(e=>void 0!==e);return e.createElement(Y,null,e.createElement(i.Autocomplete,{fullWidth:!0,multiple:!0,size:"tiny",disabled:s,value:l,onChange:(e,t)=>{const n=t.map(e=>o.stringPropTypeUtil.create(e.value));r(n)},options:t,getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t.value,renderInput:t=>e.createElement(i.TextField,t),renderTags:(t,n)=>t.map((t,r)=>{const{key:o,...s}=n({index:r});return e.createElement(i.Chip,Do({key:o,size:"tiny",label:t.label},s))})}))}),zo=({showTooltip:t,children:n,label:r})=>t&&r?e.createElement(i.Tooltip,{title:r,disableFocusListener:!0,placement:"top"},n):n,jo=(0,i.styled)(i.ToggleButtonGroup)` ${({justify:e})=>`justify-content: ${e};`} button:not( :last-of-type ) { border-start-end-radius: 0; border-end-end-radius: 0; } button:not( :first-of-type ) { border-start-start-radius: 0; border-end-start-radius: 0; } button:last-of-type { border-start-end-radius: 8px; border-end-end-radius: 8px; } `,$o=(0,i.styled)(i.ToggleButton,{shouldForwardProp:e=>"isPlaceholder"!==e})` ${({theme:e,isPlaceholder:t})=>t&&`\n\t\tcolor: ${e.palette.text.tertiary};\n\t\tbackground-color: ${"dark"===e.palette.mode?"rgba(255,255,255,0.04)":"rgba(0,0,0,0.02)"};\n\n\t\t&:hover {\n\t\t\tbackground-color: ${"dark"===e.palette.mode?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.04)"};\n\t\t}\n\t`} `,Bo=e.forwardRef(({justify:t="end",size:n="tiny",value:r,onChange:o,items:s,maxItems:l,exclusive:a=!1,fullWidth:c=!1,disabled:u,placeholder:p},d)=>{const h=a&&void 0!==l&&s.length>l,f=h?s.slice(l-1):[],m=h?s.slice(0,l-1):s,g="rtl"===(0,i.useTheme)().direction,y=(0,e.useMemo)(()=>{const e=f?.length,t=e?m.length+1:m.length,n=e?"auto":"";return c?`repeat(${t}, 1fr) ${n}`:`repeat(${t}, minmax(0, 25%)) ${n}`},[f?.length,m.length,c]),v=a&&(null==r||""===r),b=!a&&Array.isArray(r)?r.map(e=>"string"==typeof e?e:"").join(" ").trim().split(/\s+/).filter(Boolean):[],E=!a&&0===b.length,w=(x=p,Array.isArray(x)?x.flatMap(e=>"string"==typeof e?e.trim().split(/\s+/).filter(Boolean):[]):"string"==typeof x?x.trim().split(/\s+/).filter(Boolean):[]);var x;return e.createElement(jo,{ref:d,justify:t,value:r,onChange:(e,t)=>{o(t)},exclusive:a,disabled:u,sx:{direction:g?"rtl /* @noflip */":"ltr /* @noflip */",display:"grid",gridTemplateColumns:y,width:"100%"}},m.map(({label:t,value:r,renderContent:o,showTooltip:i,disabled:s=!1})=>{const l=w.length>0&&w.includes(r)&&(v||E);return e.createElement(zo,{key:r,label:t,showTooltip:i||!1},e.createElement($o,{value:r,"aria-label":t,size:n,fullWidth:c,isPlaceholder:l,disabled:s},e.createElement(o,{size:n})))}),f.length&&a&&e.createElement(Uo,{size:n,value:r||null,onChange:o,items:f,fullWidth:c}))}),Fo=t=>e.createElement(Y,null,e.createElement(Bo,t)),Uo=({size:t="tiny",onChange:n,items:r,fullWidth:o,value:s})=>{const l=Vo(r,s),[a,c]=(0,e.useState)(!1),u=(0,e.useRef)(null),p=e=>{c(!1),d(e)},d=e=>{n(e===s?null:e)};return e.createElement(e.Fragment,null,e.createElement(i.ToggleButton,{value:l.value,"aria-label":l.label,size:t,fullWidth:o,onClick:e=>{e.preventDefault(),p(l.value)}},l.renderContent({size:t})),e.createElement(i.ToggleButton,{size:t,"aria-expanded":a?"true":void 0,"aria-haspopup":"menu","aria-pressed":void 0,onClick:e=>{c(e=>!e),e.preventDefault()},ref:u,value:"__chevron-icon-button__"},e.createElement(H.ChevronDownIcon,{fontSize:t})),e.createElement(i.Menu,{open:a,onClose:()=>c(!1),anchorEl:u.current,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:.5}},r.map(({label:t,value:n})=>e.createElement(i.MenuItem,{key:n,selected:n===s,onClick:()=>p(n)},e.createElement(i.ListItemText,null,e.createElement(i.Typography,{sx:{fontSize:"14px"}},t))))))},Vo=(t,n)=>{const[r,o]=(0,e.useState)(t.find(e=>e.value===n)??t[0]);return(0,e.useEffect)(()=>{const e=t.find(e=>e.value===n);e&&o(e)},[t,n]),r};function Ho(){return Ho=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ho.apply(null,arguments)}const Wo=D(({options:t,fullWidth:n=!1,size:r="tiny",exclusive:i=!0,maxItems:s,convertOptions:l=!1})=>{const{value:a,setValue:c,placeholder:u,disabled:p}=b(o.stringPropTypeUtil),d=l?(t=>t.map(t=>{const n=t.icon,r=H[n];return{value:t.value,label:t.label,renderContent:({size:n})=>r?e.createElement(r,{fontSize:n}):t.label,showTooltip:t.showTooltip,exclusive:t.exclusive}}))(t):t,h=d.filter(e=>e.exclusive).map(e=>e.value),f={items:d,maxItems:s,fullWidth:n,size:r,placeholder:u};return i?e.createElement(Fo,Ho({},f,{value:a??null,onChange:c,disabled:p,exclusive:!0})):e.createElement(Fo,Ho({},f,{value:a?.split(" ")??[],onChange:e=>{const t=e[e.length-1],n=h.includes(t)?[t]:e?.filter(e=>!h.includes(e));c(n?.join(" ")||null)},disabled:p,exclusive:!1}))}),Go=e=>null==e||""===e||Number.isNaN(Number(e)),Ko=t=>t.meta?.suffix?e.createElement(i.InputAdornment,{position:"end"},e.createElement(i.Typography,{variant:"caption",color:"text.secondary"},t.meta.suffix)):e.createElement(e.Fragment,null),qo=D(({placeholder:t,max:n=Number.MAX_SAFE_INTEGER,min:r=-Number.MAX_SAFE_INTEGER,step:s=1,shouldForceInt:l=!1,startIcon:a,disabled:c})=>{const{value:u,setValue:p,placeholder:d,disabled:h,restoreValue:f,propType:m}=b(o.numberPropTypeUtil);return e.createElement(Y,null,e.createElement(Wn,{size:"tiny",type:"number",fullWidth:!0,disabled:c??h,value:Go(u)?"":u,onInput:e=>{const{value:t,validity:{valid:o}}=e.target;let i;if(Go(t))i=null;else{const e=l?+parseInt(t):Number(t);i=Math.min(Math.max(e,r??Number.MIN_SAFE_INTEGER),n??Number.MAX_SAFE_INTEGER)}p(i,void 0,{validation:()=>o})},onBlur:f,placeholder:t??(Go(d)?"":String(d)),inputProps:{step:s,min:r},InputProps:{startAdornment:a?e.createElement(i.InputAdornment,{position:"start",disabled:c??h},a):void 0,endAdornment:Ko(m)}}))});function Jo(){return Jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jo.apply(null,arguments)}function Yo({label:t,icon:n,tooltipLabel:r,items:o,multiSizePropTypeUtil:l}){const a=(0,e.useId)(),c=(0,i.usePopupState)({variant:"popover",popupId:a}),u=[(0,e.useRef)(null),(0,e.useRef)(null)],{propType:p,disabled:h}=b(l),{value:f,setValue:m,placeholder:g}=b(),y=e=>{if(l.isValid(e))return e.value;const t={};o.forEach(n=>{t[n.bind]=e});const n=l.create(t);return n?.value},v=!c.isOpen,E=y(f),w=y(g),x=e=>{if(!e)return!0;const t=l.create(e),n={};o.forEach(e=>{n[e.bind]=t?.value?.[e.bind]??null});const r=Object.values(n).map(e=>JSON.stringify(e));return r.every(e=>e===r[0])},S=!f&&!x(w),C=S||!x(E);return e.createElement(e.Fragment,null,e.createElement(i.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap",ref:u[0]},e.createElement(i.Grid,{item:!0,xs:6},v?e.createElement(A,null,t):e.createElement(k,null,t)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(i.Stack,{direction:"row",alignItems:"center",gap:1},e.createElement(i.Box,{flexGrow:1},e.createElement(rr,{placeholder:C?(0,s.__)("Mixed","elementor"):void 0,enablePropTypeUnits:!C||!S,anchorRef:u[0]})),e.createElement(i.Tooltip,{title:r,placement:"top"},e.createElement($o,Jo({size:"tiny",value:"check",sx:{marginLeft:"auto"}},(0,i.bindToggle)(c),{selected:c.isOpen,isPlaceholder:S,"aria-label":r}),n))))),e.createElement(i.Popover,Jo({disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},(0,i.bindPopover)(c),{slotProps:{paper:{sx:{mt:.5,width:u[0].current?.getBoundingClientRect().width}}}}),e.createElement(d,{propType:p,value:E,placeholder:w,setValue:e=>{x(e)?m(Object.values(e)?.pop()??null):m(l.create(e))},isDisabled:()=>h},e.createElement(eo,{p:1.5},e.createElement(to,{ref:u[1]},e.createElement(Xo,{item:o[0],rowRef:u[1]}),e.createElement(Xo,{item:o[1],rowRef:u[1]})),e.createElement(to,{ref:u[2]},e.createElement(Xo,{item:o[2],rowRef:u[2]}),e.createElement(Xo,{item:o[3],rowRef:u[2]}))))))}const Xo=({item:t,rowRef:n})=>{const{bind:r,label:o,icon:s,ariaLabel:l}=t;return e.createElement(m,{bind:r},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(A,null,o)),e.createElement(i.Grid,{item:!0,xs:12},e.createElement(rr,{startIcon:s,ariaLabel:l,anchorRef:n})))))},Qo=()=>window.elementor?.config?.size_units?.length??[],Zo=()=>window.elementor?.config?.size_units?.angle??[],ei=()=>window.elementor?.config?.size_units?.time??[],ti=e=>(window.elementor?.config?.size_units?.extended_units??[]).includes(e),ni=/^[a-zA-Z%]$/,ri="",oi="auto",ii="custom",si=(e,t)=>ti(t)?ri:e,li=(e,t,n)=>t.includes(e)?e:n&&t.includes(n)?n:t[0]??"",ai=(e,t)=>e?.size!==t?.size||e?.unit!==t?.unit,ci=(0,e.forwardRef)(({id:t,type:n,value:r,onBlur:o,onKeyUp:i,focused:s,disabled:l,onChange:a,onKeyDown:c,InputProps:u,inputProps:p,placeholder:d},h)=>e.createElement(Wn,{id:t,ref:h,size:"tiny",fullWidth:!0,type:n,value:r,placeholder:d,onKeyUp:i,focused:s,disabled:l,onKeyDown:c,onInput:a,onBlur:o,InputProps:u,inputProps:p,sx:ui(u?.readOnly??!1)})),ui=e=>({input:{cursor:e?"default !important":void 0}});function pi(){return pi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pi.apply(null,arguments)}const di={display:"flex",flexDirection:"column",justifyContent:"center"},hi=({value:t,isUnitHighlighted:n,onSelect:r,options:o,disabled:s,menuItemsAttributes:l={},optionLabelOverrides:a={}})=>{const c=(0,i.usePopupState)({variant:"popover",popupId:(0,e.useId)()});return e.createElement(e.Fragment,null,e.createElement(fi,pi({isHighlighted:n,disabled:s,size:"small"},(0,i.bindTrigger)(c)),a[t]??t),e.createElement(i.Menu,pi({MenuListProps:{dense:!0}},(0,i.bindMenu)(c)),o.map(t=>e.createElement(G.MenuListItem,pi({key:t,onClick:()=>(e=>{r(e),c.close()})(t)},l?.[t],{primaryTypographyProps:{variant:"caption",sx:{...di,lineHeight:"1"}},menuItemTextProps:{sx:di}}),a[t]??t.toUpperCase()))))},fi=(0,i.styled)(i.Button,{shouldForwardProp:e=>"isHighlighted"!==e})(({isHighlighted:e,theme:t})=>({color:e?t.palette.text.primary:t.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"}));function mi(){return mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mi.apply(null,arguments)}const gi={custom:e.createElement(H.MathFunctionIcon,{fontSize:"tiny"})},yi=({value:t,focused:n,disabled:r,InputProps:o,defaultUnit:s,placeholder:l,onUnitChange:a,startIcon:c,ariaLabel:u,onKeyDown:p,setValue:d,onBlur:h,units:f,min:m,unitSelectorProps:g})=>{const{size:y,unit:v,setSize:b,setUnit:E}=(({value:t,setValue:n,units:r,defaultUnit:o})=>{const i=(0,e.useMemo)(()=>((e,t)=>{if(!e)return e;const{units:n,defaultUnit:r}=t,o=li(e.unit,n,r);return o===oi?{size:ri,unit:o}:o===ii?{size:String(e.size??ri),unit:o}:{size:(i=e.size,("number"==typeof i&&isNaN(i)?ri:i)??ri),unit:o};var i})(t,{units:r,defaultUnit:o}),[t?.size,t?.unit,o]),[s,l]=Zn({external:i,setExternal:(e,t,r)=>{null!==e&&n(e,t,r)},persistWhen:e=>ai(e,i),fallback:()=>((e,t)=>{let[n]=e;return void 0!==t&&(n=li(t,e)),{size:ri,unit:n}})(r,o)}),[a,c]=(({sizeValue:t,setUnit:n,persistWhen:r})=>{const[o,i]=(0,e.useState)(t.unit);return(0,e.useEffect)(()=>{t.unit!==o&&i(t.unit)},[t.unit,t.size]),[o,e=>{i(e),(ti(e)||r())&&n(e)}]})({sizeValue:s,setUnit:e=>{l({unit:e,size:si(s.size,e)})},persistWhen:()=>Boolean(s.size)||""!==s.size||ti(s.unit)});return{size:s.size,setSize:(e,t=!0)=>{if(ti(a))return;const n=e.trim(),r=Number(n),o={unit:a,size:n&&!isNaN(r)?r:""};l(o,void 0,{validation:()=>t})},unit:a,setUnit:c}})({value:t,setValue:d,units:f,defaultUnit:s}),w=e=>{E(e),a?.(e)},{onUnitKeyDown:x}=(({unit:e,units:t,onUnitChange:n})=>{const{appendKey:r,startsWith:o}=jn();return{onUnitKeyDown:i=>{if(0===t.length)return;const{key:s,altKey:l,ctrlKey:a,metaKey:c}=i;if(l||a||c)return;if(ti(e)&&(e=>"number"==typeof e?!isNaN(e):"string"==typeof e&&""!==e.trim()&&!isNaN(Number(e)))(s)){const[e]=t;return void(e&&n(e))}if(!ni.test(s))return;i.preventDefault();const u=r(s.toLowerCase()),p=t.find(e=>o(e,u));p&&n(p)}}})({unit:v,onUnitChange:w,units:f}),k=ti(v)?"text":"number";return e.createElement(ci,{disabled:r,focused:n,type:k,value:y,placeholder:l,onBlur:h,onKeyDown:e=>{x(e),p?.(e)},onChange:e=>{const t=e.target.value,n=e.target.validity.valid;b(t,n)},InputProps:{...o,autoComplete:"off",readOnly:ti(v),startAdornment:c&&e.createElement(i.InputAdornment,{position:"start",disabled:r},c),endAdornment:e.createElement(i.InputAdornment,{position:"end"},e.createElement(hi,mi({options:f,value:v,onSelect:w,isUnitHighlighted:vi({size:y,unit:v})},g,{optionLabelOverrides:gi})))},inputProps:{min:m,step:"any","aria-label":u}})},vi=e=>!!e&&(e.unit===oi||Boolean(e.size)||0===e.size);function bi(){return bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bi.apply(null,arguments)}const Ei=({popupState:t,anchorRef:n,value:r,onChange:o,onClose:l})=>{const a=(0,e.useRef)(null);(0,e.useEffect)(()=>{t.isOpen&&requestAnimationFrame(()=>{a.current&&a.current.focus()})},[t.isOpen]);const c=()=>{l?.(),t.close()};return e.createElement(i.Popover,bi({disablePortal:!0,slotProps:{paper:{sx:{borderRadius:2,width:n.current?.offsetWidth+"px"}}}},(0,i.bindPopover)(t),{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onClose:c}),e.createElement(G.PopoverHeader,{title:(0,s.__)("CSS function","elementor"),onClose:c,icon:e.createElement(H.MathFunctionIcon,{fontSize:"tiny"})}),e.createElement(i.TextField,{value:r,onChange:o,onKeyDown:e=>{"enter"===e.key.toLowerCase()&&c()},size:"tiny",type:"text",fullWidth:!0,inputProps:{ref:a},sx:{pt:0,pr:1.5,pb:1.5,pl:1.5}}))};function wi(){return wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wi.apply(null,arguments)}const xi=({anchorRef:t,SizeFieldWrapper:n=e.Fragment,...r})=>{const o=(0,i.usePopupState)({variant:"popover"}),s=(0,zn.useActiveBreakpoint)(),l=r?.value?.unit===ii,a=r.units.includes(ii);(0,e.useEffect)(()=>{o&&o.isOpen&&o.close()},[s]);const c={"aria-controls":o.isOpen?o.popupId:void 0,"aria-haspopup":!0};return e.createElement(e.Fragment,null,e.createElement(n,null,e.createElement(i.Box,null,e.createElement(yi,wi({focused:!!o.isOpen||void 0,onUnitChange:e=>{e===ii&&t?.current&&o.open(t.current)},InputProps:{...c,onClick:e=>{e.target.closest("input")&&l&&o.open(t?.current)}},unitSelectorProps:{menuItemsAttributes:a?{custom:c}:void 0}},r)))),o.isOpen&&t?.current&&e.createElement(Ei,{popupState:o,anchorRef:t,value:String(r?.value?.size??""),onChange:e=>{r.setValue({size:e.target.value,unit:ii})},onClose:()=>{}}))},ki=e=>({...e,size:""}),Si=e=>{const t=e.find(({candidate:e})=>Ci(e));return t?t.resolve(t.candidate):null},Ci=e=>{if(!e||"object"!=typeof e)return!1;const t=o.sizePropTypeUtil.create(e);return o.sizePropTypeUtil.isValid(t)},Ti=e=>{if("string"==typeof e)return e;const t=e?.size;return void 0!==t?"number"==typeof t?t.toString():t:void 0},Oi=e=>e.settings,Ai=[e=>Boolean(e),e=>null==e?.size||""===e?.size,e=>e?.unit!==oi,e=>e?.unit!==ii],Mi=D(({variant:t="length",placeholder:n,anchorRef:r,startIcon:i,ariaLabel:s,min:l})=>{const{value:a,setValue:c,propType:u,placeholder:p,restoreValue:d}=b(o.sizePropTypeUtil),h=(0,e.useRef)(null),{sizeValue:f,placeholder:m}=((e,t,n)=>{const r=n??t;return{sizeValue:Si([{candidate:e,resolve:e=>e},{candidate:n,resolve:ki},{candidate:t,resolve:ki}]),placeholder:Boolean(e)?void 0:Ti(r)}})(a??h.current,p,n),g=((e,t)=>(e=>Oi(e)?.available_units)(e)??(e=>({length:Qo,angle:Zo,time:ei}[e]()))(t))(u,t),y=(e=>Oi(e)?.default_unit)(u);return e.createElement(xi,{units:g,value:f,anchorRef:r,placeholder:m,defaultUnit:y,onBlur:()=>{const e=u.settings.required;(e=>Ai.every(t=>t(e)))(a)&&!e&&c(null),e&&d()},setValue:(e,t,n)=>{if(Pi(e,a))return h.current=e,void c(null);c(e,t,{...n,validation:()=>u.settings.required?""!==e.size:!n?.validation||n.validation(e)})},SizeFieldWrapper:Y,startIcon:i,ariaLabel:s,min:l})}),Pi=(e,t)=>!ti(e.unit)&&ti(t?.unit)&&""===e.size,Ii=({label:t,isSiteRtl:n=!1,min:r})=>{const l=[(0,e.useRef)(null),(0,e.useRef)(null)],{disabled:a}=b(o.sizePropTypeUtil),{value:c,setValue:u,propType:p,placeholder:h,disabled:f}=b(o.dimensionsPropTypeUtil),{value:m,placeholder:g,setValue:y}=b(),v=()=>!(o.dimensionsPropTypeUtil.isValid(m)||!m&&o.dimensionsPropTypeUtil.isValid(g)),[E,w]=(0,e.useState)(()=>v()),x=(0,zn.useActiveBreakpoint)(),S=o.dimensionsPropTypeUtil.isValid(m??g);(0,e.useLayoutEffect)(()=>{w(v)},[x,S]);const C=t.toLowerCase(),T=E?H.LinkIcon:H.DetachIcon,O=(0,s.__)("Link %s","elementor").replace("%s",C),A=(0,s.__)("Unlink %s","elementor").replace("%s",C),M=a||f,P={propType:p,value:c,placeholder:h??(E?null:{"block-start":g,"block-end":g,"inline-start":g,"inline-end":g}),setValue:e=>{const t=Object.entries(e).filter(([,e])=>Boolean(e));u(0===t.length?null:Object.fromEntries(t))},isDisabled:()=>f},I=!m&&(h||g),_=e=>{if(E){const e=Ri(h);return o.sizePropTypeUtil.extract(e)}return o.sizePropTypeUtil.extract(h?.[e])};return e.createElement(d,P,e.createElement(i.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},e.createElement(k,null,t),e.createElement(i.Tooltip,{title:E?A:O,placement:"top"},e.createElement($o,{"aria-label":E?A:O,size:"tiny",value:"check",selected:E,sx:{marginLeft:"auto"},onChange:()=>{if(w(e=>!e),!o.dimensionsPropTypeUtil.isValid(m)){const e=m||null;return e?void y(o.dimensionsPropTypeUtil.create({"block-start":e,"block-end":e,"inline-start":e,"inline-end":e})):void y(null)}const e=Ri(c)??null;y(e||null)},disabled:M,isPlaceholder:I},e.createElement(T,{fontSize:"tiny"})))),function(t,n){return[[{bind:"block-start",label:(0,s.__)("Top","elementor"),ariaLabel:(0,s.sprintf)((0,s.__)("%s top","elementor"),t),icon:e.createElement(H.SideTopIcon,{fontSize:"tiny"})},{bind:"inline-end",label:n?(0,s.__)("Left","elementor"):(0,s.__)("Right","elementor"),ariaLabel:n?(0,s.sprintf)((0,s.__)("%s left","elementor"),t):(0,s.sprintf)((0,s.__)("%s right","elementor"),t),icon:n?e.createElement(H.SideLeftIcon,{fontSize:"tiny"}):e.createElement(H.SideRightIcon,{fontSize:"tiny"})}],[{bind:"block-end",label:(0,s.__)("Bottom","elementor"),ariaLabel:(0,s.sprintf)((0,s.__)("%s bottom","elementor"),t),icon:e.createElement(H.SideBottomIcon,{fontSize:"tiny"})},{bind:"inline-start",label:n?(0,s.__)("Right","elementor"):(0,s.__)("Left","elementor"),ariaLabel:n?(0,s.sprintf)((0,s.__)("%s right","elementor"),t):(0,s.sprintf)((0,s.__)("%s left","elementor"),t),icon:n?e.createElement(H.SideRightIcon,{fontSize:"tiny"}):e.createElement(H.SideLeftIcon,{fontSize:"tiny"})}]]}(t,n).map((t,n)=>e.createElement(i.Stack,{direction:"row",gap:2,flexWrap:"nowrap",key:n,ref:l[n]},t.map(({icon:t,...o})=>e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center",key:o.bind},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(Ni,o)),e.createElement(i.Grid,{item:!0,xs:12},e.createElement(_i,{bind:o.bind,ariaLabel:o.ariaLabel,startIcon:t,isLinked:E,placeholder:_(o.bind)??void 0,anchorRef:l[n],min:r})))))))},_i=({bind:t,ariaLabel:n,startIcon:r,isLinked:o,placeholder:i,anchorRef:s,min:l})=>o?e.createElement(Mi,{ariaLabel:n,startIcon:r,anchorRef:s,placeholder:i,min:l}):e.createElement(m,{bind:t},e.createElement(Mi,{ariaLabel:n,startIcon:r,anchorRef:s,min:l,placeholder:i})),Ni=({label:t,bind:n})=>e.createElement(m,{bind:n},e.createElement(A,null,t)),Ri=e=>e?.["block-start"]??e?.["inline-end"]??e?.["block-end"]??e?.["inline-start"],Di=({itemsList:t,selectedItem:n,onItemChange:r,onClose:o,sectionWidth:l,title:a,itemStyle:c=()=>({}),onDebounce:u=()=>{},icon:p,disabledItems:d,id:h="item-selector",footer:f,categoryItemContentTemplate:m})=>{const[g,y]=(0,e.useState)(""),v=((e,t,n)=>e.reduce((e,r)=>{const o=r.items.filter(e=>e.toLowerCase().includes(t.toLowerCase()));return o.length&&(e.push({type:"category",value:r.label}),o.forEach(t=>{e.push({type:"item",value:t,disabled:n?.includes(t)??!1})})),e},[]))(t,g,d),b=p,E=()=>{y(""),o()};return e.createElement(G.PopoverBody,{width:l,id:h},e.createElement(G.PopoverHeader,{title:a,onClose:E,icon:e.createElement(b,{fontSize:"tiny"})}),e.createElement(G.SearchField,{value:g,onSearch:e=>{y(e)},placeholder:(0,s.__)("Search","elementor"),id:h+"-search"}),e.createElement(i.Divider,null),e.createElement(i.Box,{sx:{flex:1,overflow:"auto",minHeight:0}},v.length>0?e.createElement(Li,{itemListItems:v,setSelectedItem:r,handleClose:E,selectedItem:n,itemStyle:c,onDebounce:u,categoryItemContentTemplate:m}):e.createElement(i.Stack,{alignItems:"center",justifyContent:"center",height:"100%",p:2.5,gap:1.5,overflow:"hidden"},e.createElement(b,{fontSize:"large"}),e.createElement(i.Box,{sx:{maxWidth:160,overflow:"hidden"}},e.createElement(i.Typography,{align:"center",variant:"subtitle2",color:"text.secondary"},(0,s.__)("Sorry, nothing matched","elementor")),e.createElement(i.Typography,{variant:"subtitle2",color:"text.secondary",sx:{display:"flex",width:"100%",justifyContent:"center"}},e.createElement("span",null,"“"),e.createElement(i.Box,{component:"span",sx:{maxWidth:"80%",overflow:"hidden",textOverflow:"ellipsis"}},g),e.createElement("span",null,"”."))),e.createElement(i.Typography,{align:"center",variant:"caption",color:"text.secondary",sx:{display:"flex",flexDirection:"column"}},(0,s.__)("Try something else.","elementor"),e.createElement(i.Link,{color:"secondary",variant:"caption",component:"button",onClick:()=>y("")},(0,s.__)("Clear & try again","elementor"))))),f)},Li=({itemListItems:t,setSelectedItem:n,handleClose:r,selectedItem:o,itemStyle:i=()=>({}),onDebounce:s=()=>{},categoryItemContentTemplate:l})=>{const a=t.find(e=>e.value===o),c=zi(e=>{e.forEach(e=>{e&&"item"===e.type&&s(e.value)})},100),u=(0,e.useCallback)(e=>i(e),[i]);return e.createElement(G.PopoverMenuList,{items:t,selectedValue:a?.value,onChange:c,onSelect:n,onClose:r,itemStyle:u,"data-testid":"item-list",categoryItemContentTemplate:l})},zi=(t,n)=>{const[r]=(0,e.useState)(()=>(0,l.debounce)(t,n));return(0,e.useEffect)(()=>()=>r.cancel(),[r]),r},ji=(e,t="editor")=>{const n=window;return n.elementor?.helpers?.enqueueFont?.(e,t)??null};function $i(){return $i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$i.apply(null,arguments)}const Bi=D(({fontFamilies:t,sectionWidth:n,ariaLabel:r})=>{const{value:l,setValue:a,disabled:c,placeholder:u}=b(o.stringPropTypeUtil),p=(0,i.usePopupState)({variant:"popover"}),d=!l&&u,h=(0,e.useMemo)(()=>t.map(({label:e,fonts:t})=>({label:e,items:t})),[t]);return e.createElement(e.Fragment,null,e.createElement(Y,null,e.createElement(i.UnstableTag,$i({id:"font-family-control",variant:"outlined",label:l||u,endIcon:e.createElement(H.ChevronDownIcon,{fontSize:"tiny"})},(0,i.bindTrigger)(p),{fullWidth:!0,disabled:c,"aria-label":r,sx:d?{"& .MuiTag-label":{color:e=>e.palette.text.tertiary},textTransform:"capitalize"}:void 0}))),e.createElement(i.Popover,$i({disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{my:1.5}},(0,i.bindPopover)(p)),e.createElement(Di,{id:"font-family-selector",itemsList:h,selectedItem:l,onItemChange:a,onClose:p.close,sectionWidth:n,title:(0,s.__)("Font family","elementor"),itemStyle:e=>({fontFamily:e.value}),onDebounce:ji,icon:H.TextIcon})))}),Fi=D(({placeholder:t,ariaLabel:n})=>{const{value:r,setValue:s,disabled:l,placeholder:a}=b(o.urlPropTypeUtil),c=t??a??void 0;return e.createElement(Y,null,e.createElement(i.TextField,{size:"tiny",fullWidth:!0,value:r??"",disabled:l,onChange:e=>s(e.target.value),placeholder:c,inputProps:{...n?{"aria-label":n}:{}}}))});var Ui=window.elementorV2.editorElements,Vi=window.elementorV2.editorV1Adapters,Hi=window.elementorV2.session;const Wi={label:(0,s.__)("Learn More","elementor"),href:"https://go.elementor.com/element-link-inside-link-infotip"},Gi={descendant:(0,s.__)("To add a link or action to this element, first remove the link or action from the elements inside of it.","elementor"),ancestor:(0,s.__)("To add a link or action to this container, first remove the link or action from its parent container.","elementor")},Ki=({linkInLinkRestriction:t,isVisible:n,children:r})=>{const{shouldRestrict:o,reason:l,elementId:a}=t,c=!(!a||!function(e){if(!e)return!1;const t=(0,Ui.getContainer)(e)?.view?.el;if(!t)return!1;const n=t.closest("[data-elementor-id]")?.getAttribute("data-elementor-id"),r=String((0,Ui.getCurrentDocumentId)()??"");return!(!n||!r||n!==r)}(a)),u=e.createElement(i.Alert,{color:"secondary",icon:e.createElement(H.InfoCircleFilledIcon,null),size:"small",action:c?e.createElement(i.AlertAction,{sx:{width:"fit-content"},variant:"contained",color:"secondary",onClick:()=>{a&&(0,Ui.selectElement)(a)}},(0,s.__)("Take me there","elementor")):void 0},e.createElement(i.AlertTitle,null,(0,s.__)("Nested links","elementor")),e.createElement(i.Box,{component:"span"},Gi[l??"descendant"]," ",e.createElement(i.Link,{href:Wi.href,target:"_blank",color:"info.main"},Wi.label)));return o&&n?e.createElement(i.Infotip,{placement:"right",content:u,color:"secondary",slotProps:{popper:{sx:{width:300}}}},e.createElement(i.Box,null,r)):e.createElement(e.Fragment,null,r)};function qi(){return qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qi.apply(null,arguments)}const Ji=(0,e.forwardRef)((t,n)=>{const{options:r,onOptionChange:o,onTextChange:s,allowCustomValues:l=!1,placeholder:a="",minInputLength:c=2,value:u="",startAdornment:p,disablePortal:d=!0,inputProps:h,...f}=t,m=function(e,t,n){if(null===e)return t;const r=String(e||"")?.toLowerCase();return r.length<n?new Array(0):t.filter(e=>String(e.id).toLowerCase().includes(r)||e.label.toLowerCase().includes(r))}(u,r,c).map(({id:e})=>e),g=!!u,y=l||u?.toString()?.length?void 0:()=>!0,v="number"==typeof u&&!!Qi(r,u),b=(u?.toString()?.length??0)>=c&&(!l||m.length>0);return e.createElement(i.Autocomplete,qi({},f,{ref:n,forcePopupIcon:!1,disablePortal:d,disableClearable:!0,freeSolo:l,openOnFocus:!1,open:b,value:u?.toString()||"",size:"tiny",onChange:(e,t)=>o(Number(t)),readOnly:v,options:m,getOptionKey:e=>Qi(r,e)?.id||e,getOptionLabel:e=>Qi(r,e)?.label||e.toString(),groupBy:Zi(r)?e=>Qi(r,e)?.groupLabel||e:void 0,isOptionEqualToValue:y,filterOptions:()=>m,renderOption:(t,n)=>e.createElement(i.Box,qi({component:"li"},t,{key:t.id}),Qi(r,n)?.label??n),renderInput:t=>e.createElement(Yi,{params:t,handleChange:e=>s?.(e),allowClear:g,placeholder:a,hasSelectedValue:v,startAdornment:p,extraInputProps:h})}))}),Yi=({params:t,allowClear:n,placeholder:r,handleChange:o,hasSelectedValue:s,startAdornment:l,extraInputProps:a})=>e.createElement(i.TextField,qi({},t,{placeholder:r,onChange:e=>{o(e.target.value)},inputProps:{...t.inputProps??{},...a??{}},sx:{"& .MuiInputBase-input":{cursor:s?"default":void 0}},InputProps:{...t.InputProps,startAdornment:l||t.InputProps.startAdornment,endAdornment:e.createElement(Xi,{params:t,allowClear:n,handleChange:o})}})),Xi=({allowClear:t,handleChange:n,params:r})=>e.createElement(i.InputAdornment,{position:"end"},t&&e.createElement(i.IconButton,{size:r.size,onClick:()=>n(null),sx:{cursor:"pointer"}},e.createElement(H.XIcon,{fontSize:r.size})));function Qi(e,t=null){const n=(t||"").toString();return e.find(({id:e})=>n===e.toString())}function Zi(e){return!(e.length<=1)&&new Set(e.map(e=>e.groupLabel)).size>1}const es=D(t=>{const{value:n,setValue:r}=b(o.queryPropTypeUtil),{value:i,setValue:a,placeholder:c}=b(o.urlPropTypeUtil),{allowCustomValues:u=!0,queryOptions:{url:p,params:d={}},placeholder:h=(0,s.__)("Search","elementor"),minInputLength:f=2,onSetValue:m,ariaLabel:g}=t||{},[y,v]=(0,e.useState)(function(e){const t=e?.id?.value,n=e?.label?.value,r=[];return t&&n&&r.push({id:t.toString(),label:n}),r}(n)),E=(0,e.useMemo)(()=>(0,l.debounce)(e=>async function(e,t){if(!t||!e)return[];try{const{data:n}=await(0,z.httpService)().get(e,{params:t});return n.data.value}catch{return[]}}(p,e).then(e=>{v(function(e){const t=Zi(e)?"groupLabel":"label";return e.sort((e,n)=>e[t]&&n[t]?e[t].localeCompare(n[t]):0)}(e))}),400),[p]),w=n?.id?.value??i;return e.createElement(Y,null,e.createElement(Ji,{options:y,allowCustomValues:u,placeholder:c??h,startAdornment:e.createElement(H.SearchIcon,{fontSize:"tiny"}),value:w,onOptionChange:e=>{if(null===e)return r(null),void m?.(null);const t={id:o.numberPropTypeUtil.create(e),label:o.stringPropTypeUtil.create(Qi(y,e)?.label||null)};r(t),m?.(o.queryPropTypeUtil.create(t))},onTextChange:e=>{const t=e?.trim()||"";if(!t)return a(null),void m?.(null);a(t),m?.(o.urlPropTypeUtil.create(t)),(e=>{v([]),!e||!p||e.length<f||E({...d,term:e})})(e)},minInputLength:f,disablePortal:!1,inputProps:{...g?{"aria-label":g}:{}}}))}),ts=D(()=>{const{value:t,setValue:n,disabled:r,placeholder:s}=b(o.booleanPropTypeUtil);return e.createElement(i.Box,{sx:{display:"flex",justifyContent:"flex-end"}},e.createElement(i.Switch,{checked:!(!t&&!s),onChange:e=>{n(e.target.checked)},size:"small",disabled:r,inputProps:{...r?{style:{opacity:0}}:{}}}))});function ns(){return ns=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ns.apply(null,arguments)}const rs="tiny",is=D(t=>{const{value:n,path:r,setValue:a,...c}=b(o.linkPropTypeUtil),u=c.placeholder,[p,h]=(0,Hi.useSessionStorage)(r.join("/")),[f,g]=(0,e.useState)(!!n||!!u),{allowCustomValues:y=!0,queryOptions:v,placeholder:E,minInputLength:w=2,context:{elementId:x},label:S=(0,s.__)("Link","elementor"),ariaLabel:C}=t||{},[T,O]=(0,e.useState)((0,Ui.getLinkInLinkRestriction)(x,n??u)),M=!f&&T.shouldRestrict,P=(0,l.useDebouncedCallback)(()=>{const e=(0,Ui.getLinkInLinkRestriction)(x,n??u);e.shouldRestrict&&f&&!u&&(g(!1),null!==n&&a(null)),O(t=>{return r=e,(n=t).shouldRestrict===r.shouldRestrict&&n.reason===r.reason&&n.elementId===r.elementId?t:e;var n,r})},300);return(0,Vi.__privateUseListenTo)((0,Vi.commandEndEvent)("document/elements/set-settings"),()=>{P()},[P]),(0,e.useEffect)(()=>{P();const e=()=>{P()};return window.addEventListener("elementor:inline-link-changed",e),()=>{window.removeEventListener("elementor:inline-link-changed",e)}},[x,P]),e.createElement(d,ns({},c,{value:n,setValue:a}),e.createElement(i.Stack,{gap:1.5},e.createElement(i.Stack,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",marginInlineEnd:-.75}},e.createElement(A,null,S),e.createElement(Ki,{isVisible:!f,linkInLinkRestriction:T},e.createElement(i.IconButton,{size:rs,onClick:()=>{if(O((0,Ui.getLinkInLinkRestriction)(x,n??u)),T.shouldRestrict&&!f)return;const e=!f;g(e),e||null===n||a(null),e&&p?.value&&a(p.value),h({value:p?.value,meta:{isEnabled:e}})},"aria-label":(0,s.__)("Toggle link","elementor"),disabled:M},f?e.createElement(H.MinusIcon,{fontSize:rs}):e.createElement(H.PlusIcon,{fontSize:rs})))),e.createElement(i.Collapse,{in:f,timeout:"auto",unmountOnExit:!0},e.createElement(i.Stack,{gap:1.5},e.createElement(m,{bind:"destination"},e.createElement(es,{queryOptions:v,allowCustomValues:y,minInputLength:w,placeholder:E,onSetValue:e=>{const t=e?{...n,destination:e}:null;h({...p,value:t})},ariaLabel:C||S})),e.createElement(m,{bind:"isTargetBlank"},e.createElement(i.Grid,{container:!0,alignItems:"center",flexWrap:"nowrap",justifyContent:"space-between"},e.createElement(i.Grid,{item:!0},e.createElement(k,null,(0,s.__)("Open in a new tab","elementor"))),e.createElement(i.Grid,{item:!0,sx:{marginInlineEnd:-1}},e.createElement(ts,null))))))))});function ss(){return ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ss.apply(null,arguments)}const ls="secondary",as=e.forwardRef(({children:t,title:n,description:r,alertProps:o,infotipProps:s,...l},a)=>{const c="rtl"===(0,i.useTheme)().direction,u=l.isEnabled&&(n||r);return e.createElement(i.Box,{ref:a},u?e.createElement(i.DirectionProvider,{rtl:c},e.createElement(i.Infotip,ss({placement:"right",color:ls,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,10]}}]}}},s,{content:e.createElement(G.InfoAlert,ss({color:ls,sx:{width:300,px:1.5,py:2}},o),e.createElement(i.Box,{sx:{flexDirection:"column",display:"flex",gap:.5}},e.createElement(i.AlertTitle,null,n),e.createElement(i.Box,null,r)))}),t)):t)});function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cs.apply(null,arguments)}const us=(0,i.styled)(i.Select)(()=>({".MuiSelect-select.Mui-disabled":{cursor:"not-allowed"}})),ps=D(t=>{const{options:n,onChange:r,fallbackLabels:l={},context:{elementId:a}}=t,{value:c,setValue:u,disabled:p,placeholder:d}=b(o.stringPropTypeUtil),h=(0,Ui.getElementLabel)(a)??"element",f={title:(0,s.__)("HTML Tag","elementor"),description:(0,s.__)("The tag is locked to 'a' tag because this %s has a link. To pick a different tag, remove the link first.","elementor").replace("%s",h),isEnabled:!!p},m=e=>n.find(t=>t.value===e);return e.createElement(Y,null,e.createElement(as,f,e.createElement(us,{sx:{overflow:"hidden",cursor:p?"not-allowed":void 0},displayEmpty:!0,size:"tiny",renderValue:t=>{if(t)return m(t)?.label||l[t]||t;if(!d)return"";const n=m(d),r=n?.label||d;return e.createElement(i.Typography,{component:"span",variant:"caption",color:"text.tertiary"},r)},value:c??"",onChange:e=>{const t=e.target.value||null;r?.(t,c),u(t)},disabled:p,fullWidth:!0},n.map(({label:t,...n})=>e.createElement(G.MenuListItem,cs({key:n.value},n,{value:n.value??""}),t)))))}),ds=({label:t})=>{const n=(0,e.useRef)(null),{disabled:r}=b(o.sizePropTypeUtil),{value:l,setValue:a,propType:c,placeholder:u,disabled:p}=b(o.layoutDirectionPropTypeUtil),{value:h,setValue:f,placeholder:m}=b(),g=()=>!(o.layoutDirectionPropTypeUtil.isValid(h)||!h&&o.layoutDirectionPropTypeUtil.isValid(m)),[y,v]=(0,e.useState)(()=>g()),E=o.layoutDirectionPropTypeUtil.isValid(h??m),w=(0,zn.useActiveBreakpoint)();(0,e.useLayoutEffect)(()=>{v(g())},[w,E]);const x=t.toLowerCase(),S=y?H.LinkIcon:H.DetachIcon,C=(0,s.__)("Link %s","elementor").replace("%s",x),T=(0,s.__)("Unlink %s","elementor").replace("%s",x),O=r||p,M={propType:c,value:l??(y?null:{row:m,column:m}),setValue:e=>{const t=Object.entries(e).filter(([,e])=>Boolean(e));a(0===t.length?null:Object.fromEntries(t))},placeholder:u},P=!h&&(u||m),I=e=>{if(y){const e=u?.column??u?.row;return o.sizePropTypeUtil.extract(e)}return o.sizePropTypeUtil.extract(u?.[e])};return e.createElement(d,M,e.createElement(i.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},e.createElement(A,null,t),e.createElement(i.Tooltip,{title:y?T:C,placement:"top"},e.createElement($o,{"aria-label":y?T:C,size:"tiny",value:"check",selected:y,sx:{marginLeft:"auto"},onChange:()=>{if(v(e=>!e),!o.layoutDirectionPropTypeUtil.isValid(h)){const e=h||null;return e?void f(o.layoutDirectionPropTypeUtil.create({row:e,column:e})):void f(null)}f(l?.column??l?.row??null)},disabled:O,isPlaceholder:P},e.createElement(S,{fontSize:"tiny"})))),e.createElement(i.Stack,{direction:"row",gap:2,flexWrap:"nowrap",ref:n},e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(k,null,(0,s.__)("Column","elementor"))),e.createElement(i.Grid,{item:!0,xs:12},e.createElement(hs,{bind:"column",ariaLabel:(0,s.__)("Column gap","elementor"),isLinked:y,anchorRef:n,placeholder:I("column")??void 0}))),e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(k,null,(0,s.__)("Row","elementor"))),e.createElement(i.Grid,{item:!0,xs:12},e.createElement(hs,{bind:"row",ariaLabel:(0,s.__)("Row gap","elementor"),isLinked:y,anchorRef:n,placeholder:I("row")??void 0})))))},hs=({bind:t,ariaLabel:n,isLinked:r,anchorRef:o,placeholder:i})=>r?e.createElement(Mi,{anchorRef:o,placeholder:i,ariaLabel:n}):e.createElement(m,{bind:t},e.createElement(Mi,{anchorRef:o,placeholder:i,ariaLabel:n}));function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fs.apply(null,arguments)}const ms=[{label:(0,s.__)("Auto","elementor"),value:"auto"},{label:"1/1",value:"1/1"},{label:"4/3",value:"4/3"},{label:"3/4",value:"3/4"},{label:"16/9",value:"16/9"},{label:"9/16",value:"9/16"},{label:"3/2",value:"3/2"},{label:"2/3",value:"2/3"}],gs="custom",ys=D(({label:t})=>{const{value:n,setValue:r,disabled:l,placeholder:a}=b(o.stringPropTypeUtil),c=n??a,u=c&&!ms.some(e=>e.value===c),[p,d]=u?c.split("/"):["",""],[h,f]=(0,e.useState)(u),[m,g]=(0,e.useState)(p),[y,v]=(0,e.useState)(d),[E,w]=(0,e.useState)(u?gs:c||"");(0,e.useEffect)(()=>{if(c&&!ms.some(e=>e.value===c)){const[e,t]=c.split("/");g(e||""),v(t||""),w(gs),f(!0)}else w(c||""),f(!1),g(""),v("")},[c]);const x=n??a,k=ms.find(e=>e.value===x);return e.createElement(Y,null,e.createElement(i.Stack,{direction:"column",gap:2},e.createElement(i.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(A,null,t)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(i.Select,{size:"tiny",displayEmpty:!0,sx:{overflow:"hidden"},disabled:l,value:E,onChange:e=>{const t=e.target.value,n=t===gs;f(n),w(t),n||r(t)},renderValue:u?void 0:()=>k?.label,fullWidth:!0},[...ms,{label:(0,s.__)("Custom","elementor"),value:gs}].map(({label:t,...n})=>e.createElement(G.MenuListItem,fs({key:n.value},n,{value:n.value??""}),t))))),h&&e.createElement(i.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(i.TextField,{size:"tiny",type:"number",fullWidth:!0,disabled:l,value:m,onChange:e=>{const t=e.target.value;g(t),t&&y&&r(`${t}/${y}`)},InputProps:{startAdornment:e.createElement(H.ArrowsMoveHorizontalIcon,{fontSize:"tiny"})}})),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(i.TextField,{size:"tiny",type:"number",fullWidth:!0,disabled:l,value:y,onChange:e=>{const t=e.target.value;v(t),m&&t&&r(`${m}/${t}`)},InputProps:{startAdornment:e.createElement(H.ArrowsMoveVerticalIcon,{fontSize:"tiny"})}})))))});var vs=window.elementorV2.editorCurrentUser;const bs=(0,s.__)("Enable Unfiltered Uploads","elementor"),Es=(0,s.__)("Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.","elementor"),ws=(0,s.__)("Failed to enable unfiltered files upload.","elementor"),xs=(0,s.__)("You can try again, if the problem persists, please contact support.","elementor"),ks=t=>{const{mutateAsync:n,isPending:r}=function(){const e=(0,L.useQueryClient)();return(0,L.useMutation)({mutationFn:({allowUnfilteredFilesUpload:e})=>{return t=B,n=e?"1":"0",(0,z.httpService)().put(`${j}/${t}`,{value:n});var t,n},onSuccess:()=>e.invalidateQueries(F)})}(),[o,i]=(0,e.useState)(!1),s={...t,isPending:r,handleEnable:async()=>{try{const e=await n({allowUnfilteredFilesUpload:!0});!1===e?.data?.success?i(!0):t.onClose(!0)}catch{i(!0)}},isError:o,onClose:e=>{t.onClose(e),setTimeout(()=>i(!1),300)}};return e.createElement(Ss,s)},Ss=({open:t,onClose:n,handleEnable:r,isPending:o,isError:l})=>e.createElement(i.Dialog,{open:t,maxWidth:"sm",onClose:()=>n(!1)},e.createElement(i.DialogHeader,{logo:!1},e.createElement(i.DialogTitle,null,bs)),e.createElement(i.Divider,null),e.createElement(i.DialogContent,null,e.createElement(i.DialogContentText,null,l?e.createElement(e.Fragment,null,ws," ",e.createElement("br",null)," ",xs):Es)),e.createElement(i.DialogActions,null,e.createElement(i.Button,{size:"medium",color:"secondary",onClick:()=>n(!1)},(0,s.__)("Cancel","elementor")),e.createElement(i.Button,{size:"medium",onClick:()=>r(),variant:"contained",color:"primary",disabled:o},o?e.createElement(i.CircularProgress,{size:24}):(0,s.__)("Enable","elementor")))),Cs="transparent",Ts="#c1c1c1",Os=`linear-gradient(45deg, ${Ts} 25%, ${Cs} 0, ${Cs} 75%, ${Ts} 0, ${Ts})`,As=(0,i.styled)(i.Card)` background-color: white; background-image: ${Os}, ${Os}; background-size: ${8}px ${8}px; background-position: 0 0, ${4}px ${4}px; border: none; `,Ms=(0,i.styled)(i.Stack)` position: relative; height: 140px; object-fit: contain; padding: 5px; justify-content: center; align-items: center; background-color: rgba( 255, 255, 255, 0.37 ); `,Ps={mode:"browse"},Is={mode:"upload"},_s=D(()=>{const{value:t,setValue:n}=b(o.svgSrcPropTypeUtil),r=t?.id,l=t?.url,{data:a,isFetching:c}=(0,W.useWpMediaAttachment)(r?.value||null),u=a?.url??l?.value??null,{data:p}=U(),[d,h]=(0,e.useState)(!1),{isAdmin:f}=(0,vs.useCurrentUserCapabilities)(),{open:m}=(0,W.useWpMediaFrame)({mediaTypes:["svg"],multiple:!1,selected:r?.value||null,onSelect:e=>{n({id:{$$type:"image-attachment-id",value:e.id},url:o.urlPropTypeUtil.create(e.url)})}}),g=e=>{p||e!==Is?m(e):h(!0)},y={title:(0,s.__)("Sorry, you can't upload that file yet.","elementor"),description:e.createElement(e.Fragment,null,(0,s.__)("To upload them anyway, ask the site administrator to enable unfiltered","elementor"),e.createElement("br",null),(0,s.__)("file uploads.","elementor")),isEnabled:!f};return e.createElement(i.Stack,{gap:1,"aria-label":"SVG Control"},e.createElement(ks,{open:d,onClose:e=>{h(!1),e&&m(Is)}}),e.createElement(Y,null,e.createElement(As,{variant:"outlined"},e.createElement(Ms,null,c?e.createElement(i.CircularProgress,{role:"progressbar"}):e.createElement(i.CardMedia,{component:"img",image:u,alt:(0,s.__)("Preview SVG","elementor"),sx:{maxHeight:"140px",width:"50px"}})),e.createElement(i.CardOverlay,{sx:{"&:hover":{backgroundColor:"rgba( 0, 0, 0, 0.75 )"}}},e.createElement(i.Stack,{gap:1},e.createElement(i.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>g(Ps),"aria-label":"Select SVG"},(0,s.__)("Select SVG","elementor")),e.createElement(as,y,e.createElement("span",null,e.createElement(i.ThemeProvider,{colorScheme:f?"light":"dark"},e.createElement(i.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:e.createElement(H.UploadIcon,null),disabled:!f,onClick:()=>f&&g(Is),"aria-label":"Upload SVG"},(0,s.__)("Upload","elementor"))))))))))}),Ns=window.elementorCommon?.config?.urls?.assets+"/shapes/play-triangle.svg",Rs=D(()=>{const{value:t,setValue:n}=b(o.videoSrcPropTypeUtil),{id:r,url:l}=t??{},{data:a,isFetching:c}=(0,W.useWpMediaAttachment)(r?.value||null),u=a?.url??l?.value??null,{open:p}=(0,W.useWpMediaFrame)({mediaTypes:["video"],multiple:!1,selected:r?.value||null,onSelect:e=>{n({id:{$$type:"video-attachment-id",value:e.id},url:null})}});return e.createElement(Y,null,e.createElement(i.Card,{variant:"outlined"},e.createElement(i.CardMedia,{sx:{height:140,backgroundColor:"white",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundRepeat:"repeat",backgroundImage:`${Os}, ${Os}`,display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(Ds,{isFetching:c,videoUrl:u})),e.createElement(i.CardOverlay,null,e.createElement(i.Stack,{gap:1},e.createElement(i.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>p({mode:"browse"})},(0,s.__)("Select video","elementor")),e.createElement(i.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:e.createElement(H.UploadIcon,null),onClick:()=>p({mode:"upload"})},(0,s.__)("Upload","elementor"))))))}),Ds=({isFetching:t=!1,videoUrl:n})=>t?e.createElement(i.CircularProgress,null):n?e.createElement("video",{src:n,muted:!0,preload:"metadata",style:{width:"100%",height:"100%",objectFit:"cover",pointerEvents:"none"}}):e.createElement("img",{src:Ns,alt:"No video selected"});var Ls=window.elementorV2.env;const{env:zs}=(0,Ls.parseEnv)("@elementor/editor-controls"),js=D(()=>{const{value:t,setValue:n}=b(o.backgroundGradientOverlayPropTypeUtil);return e.createElement(i.UnstableGradientBox,{sx:{width:"auto",padding:1.5},value:(()=>{if(!t)return;const{type:e,angle:n,stops:r,positions:o}=t;return{type:e.value,angle:n?.value||0,stops:r.value.map(({value:{color:e,offset:t}})=>({color:e.value,offset:t.value})),positions:o?.value.split(" ")}})(),onChange:e=>{const t=(e=>({...e,type:o.stringPropTypeUtil.create(e.type),angle:o.numberPropTypeUtil.create(e.angle),stops:o.gradientColorStopPropTypeUtil.create(e.stops.map(({color:e,offset:t})=>o.colorStopPropTypeUtil.create({color:o.colorPropTypeUtil.create(e),offset:o.numberPropTypeUtil.create(t)})))}))(e);t.positions&&(t.positions=o.stringPropTypeUtil.create(e.positions.join(" "))),n(t)}})}),$s=o.backgroundGradientOverlayPropTypeUtil.create({type:o.stringPropTypeUtil.create("linear"),angle:o.numberPropTypeUtil.create(180),stops:o.gradientColorStopPropTypeUtil.create([o.colorStopPropTypeUtil.create({color:o.colorPropTypeUtil.create("rgb(0,0,0)"),offset:o.numberPropTypeUtil.create(0)}),o.colorStopPropTypeUtil.create({color:o.colorPropTypeUtil.create("rgb(255,255,255)"),offset:o.numberPropTypeUtil.create(100)})])}),Bs=[{value:"fixed",label:(0,s.__)("Fixed","elementor"),renderContent:({size:t})=>e.createElement(H.PinIcon,{fontSize:t}),showTooltip:!0},{value:"scroll",label:(0,s.__)("Scroll","elementor"),renderContent:({size:t})=>e.createElement(H.PinnedOffIcon,{fontSize:t}),showTooltip:!0}],Fs=()=>e.createElement(to,null,e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,(0,s.__)("Attachment","elementor"))),e.createElement(i.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end",overflow:"hidden"}},e.createElement(Wo,{options:Bs}))),Us=[{label:(0,s.__)("Center center","elementor"),value:"center center"},{label:(0,s.__)("Center left","elementor"),value:"center left"},{label:(0,s.__)("Center right","elementor"),value:"center right"},{label:(0,s.__)("Top center","elementor"),value:"top center"},{label:(0,s.__)("Top left","elementor"),value:"top left"},{label:(0,s.__)("Top right","elementor"),value:"top right"},{label:(0,s.__)("Bottom center","elementor"),value:"bottom center"},{label:(0,s.__)("Bottom left","elementor"),value:"bottom left"},{label:(0,s.__)("Bottom right","elementor"),value:"bottom right"},{label:(0,s.__)("Custom","elementor"),value:"custom"}],Vs=()=>{const t=b(o.backgroundImagePositionOffsetPropTypeUtil),n=b(o.stringPropTypeUtil),r=!!t.value,l=(0,e.useRef)(null);return e.createElement(i.Grid,{container:!0,spacing:1.5},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(to,null,e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,(0,s.__)("Position","elementor"))),e.createElement(i.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end",overflow:"hidden"}},e.createElement(Y,null,e.createElement(i.Select,{fullWidth:!0,size:"tiny",onChange:e=>{const r=e.target.value||null;"custom"===r?t.setValue({x:null,y:null}):n.setValue(r)},disabled:n.disabled,value:(t.value?"custom":n.value)??""},Us.map(({label:t,value:n})=>e.createElement(G.MenuListItem,{key:n,value:n??""},t))))))),r?e.createElement(d,t,e.createElement(i.Grid,{item:!0,xs:12},e.createElement(i.Grid,{container:!0,spacing:1.5,ref:l},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"x"},e.createElement(rr,{startIcon:e.createElement(H.LetterXIcon,{fontSize:"tiny"}),anchorRef:l,min:-Number.MAX_SAFE_INTEGER}))),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"y"},e.createElement(rr,{startIcon:e.createElement(H.LetterYIcon,{fontSize:"tiny"}),anchorRef:l,min:-Number.MAX_SAFE_INTEGER})))))):null)},Hs=[{value:"repeat",label:(0,s.__)("Repeat","elementor"),renderContent:({size:t})=>e.createElement(H.GridDotsIcon,{fontSize:t}),showTooltip:!0},{value:"repeat-x",label:(0,s.__)("Repeat-x","elementor"),renderContent:({size:t})=>e.createElement(H.DotsHorizontalIcon,{fontSize:t}),showTooltip:!0},{value:"repeat-y",label:(0,s.__)("Repeat-y","elementor"),renderContent:({size:t})=>e.createElement(H.DotsVerticalIcon,{fontSize:t}),showTooltip:!0},{value:"no-repeat",label:(0,s.__)("No-repeat","elementor"),renderContent:({size:t})=>e.createElement(H.XIcon,{fontSize:t}),showTooltip:!0}],Ws=()=>e.createElement(to,null,e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,(0,s.__)("Repeat","elementor"))),e.createElement(i.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end"}},e.createElement(Wo,{options:Hs}))),Gs=[{value:"auto",label:(0,s.__)("Auto","elementor"),renderContent:({size:t})=>e.createElement(H.LetterAIcon,{fontSize:t}),showTooltip:!0},{value:"cover",label:(0,s.__)("Cover","elementor"),renderContent:({size:t})=>e.createElement(H.ArrowsMaximizeIcon,{fontSize:t}),showTooltip:!0},{value:"contain",label:(0,s.__)("Contain","elementor"),renderContent:({size:t})=>e.createElement(H.ArrowBarBothIcon,{fontSize:t}),showTooltip:!0},{value:"custom",label:(0,s.__)("Custom","elementor"),renderContent:({size:t})=>e.createElement(H.PencilIcon,{fontSize:t}),showTooltip:!0}],Ks=()=>{const t=b(o.backgroundImageSizeScalePropTypeUtil),n=b(o.stringPropTypeUtil),r=!!t.value,l=(0,e.useRef)(null);return e.createElement(i.Grid,{container:!0,spacing:1.5},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(to,null,e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,(0,s.__)("Size","elementor"))),e.createElement(i.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end"}},e.createElement(Fo,{exclusive:!0,items:Gs,onChange:e=>{"custom"===e?t.setValue({width:null,height:null}):n.setValue(e)},disabled:n.disabled,value:t.value?"custom":n.value})))),r?e.createElement(d,t,e.createElement(i.Grid,{item:!0,xs:12,ref:l},e.createElement(to,null,e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"width"},e.createElement(rr,{startIcon:e.createElement(H.ArrowsMoveHorizontalIcon,{fontSize:"tiny"}),extendedOptions:["auto"],anchorRef:l}))),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"height"},e.createElement(rr,{startIcon:e.createElement(H.ArrowsMoveVerticalIcon,{fontSize:"tiny"}),extendedOptions:["auto"],anchorRef:l})))))):null)};function qs(){return qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qs.apply(null,arguments)}const Js=o.backgroundColorOverlayPropTypeUtil.create({color:o.colorPropTypeUtil.create("#00000033")}),Ys=()=>({$$type:"background-image-overlay",value:{image:{$$type:"image",value:{src:{$$type:"image-src",value:{url:{$$type:"url",value:zs.background_placeholder_image},id:null}},size:{$$type:"string",value:"large"}}}}}),Xs=[{label:(0,s.__)("Thumbnail - 150 x 150","elementor"),value:"thumbnail"},{label:(0,s.__)("Medium - 300 x 300","elementor"),value:"medium"},{label:(0,s.__)("Large 1024 x 1024","elementor"),value:"large"},{label:(0,s.__)("Full","elementor"),value:"full"}],Qs=D(()=>{const{propType:t,value:n,setValue:r}=b(o.backgroundOverlayPropTypeUtil);return e.createElement(d,{propType:t,value:n,setValue:r},e.createElement(Ur,{initial:Ys(),propTypeUtil:o.backgroundOverlayPropTypeUtil},e.createElement(no,{label:(0,s.__)("Overlay","elementor")},e.createElement(Er,{newItemIndex:0})),e.createElement(Ar,null,e.createElement(Fr,{Icon:el,Label:il,actions:e.createElement(e.Fragment,null,e.createElement(Gr,null),e.createElement(Hr,null),e.createElement(qr,null))})),e.createElement(Qr,null,e.createElement(Zs,null))))}),Zs=()=>{const{getTabsProps:t,getTabProps:n,getTabPanelProps:r}=(({color:t,image:n,gradient:r})=>{const{value:s,setValue:l}=b(o.backgroundImageOverlayPropTypeUtil),{value:a,setValue:c}=b(o.backgroundColorOverlayPropTypeUtil),{value:u,setValue:p}=b(o.backgroundGradientOverlayPropTypeUtil),{getTabsProps:d,getTabProps:h,getTabPanelProps:f}=(0,i.useTabs)(a?"color":u?"gradient":"image"),m=(0,e.useRef)({image:n,color:t,gradient:r}),g=(e,t)=>{t&&(m.current[e]=t)},y=(e,t)=>{switch(t){case"image":l(m.current.image),g("color",a),g("gradient",u);break;case"gradient":p(m.current.gradient),g("color",a),g("image",s);break;case"color":c(m.current.color),g("image",s),g("gradient",u)}return d().onChange(e,t)};return{getTabProps:h,getTabPanelProps:f,getTabsProps:()=>({...d(),onChange:y})}})({image:Ys().value,color:Js.value,gradient:$s.value}),{rowRef:l}=gr();return e.createElement(i.Box,{sx:{width:"100%"}},e.createElement(i.Box,{sx:{borderBottom:1,borderColor:"divider"}},e.createElement(i.Tabs,qs({size:"small",variant:"fullWidth"},t(),{"aria-label":(0,s.__)("Background Overlay","elementor")}),e.createElement(i.Tab,qs({label:(0,s.__)("Image","elementor")},n("image"))),e.createElement(i.Tab,qs({label:(0,s.__)("Gradient","elementor")},n("gradient"))),e.createElement(i.Tab,qs({label:(0,s.__)("Color","elementor")},n("color"))))),e.createElement(i.TabPanel,qs({sx:{p:1.5}},r("image")),e.createElement(eo,null,e.createElement(ul,null))),e.createElement(i.TabPanel,qs({sx:{p:1.5}},r("gradient")),e.createElement(js,null)),e.createElement(i.TabPanel,qs({sx:{p:1.5}},r("color")),e.createElement(eo,null,e.createElement(cl,{anchorEl:l}))))},el=({value:t})=>{switch(t.$$type){case"background-image-overlay":return e.createElement(rl,{value:t});case"background-color-overlay":return e.createElement(nl,{value:t});case"background-gradient-overlay":return e.createElement(ol,{value:t});default:return null}},tl=e=>e?.value?.color?.value?e.value.color.value:"",nl=({value:t})=>{const n=tl(t);return e.createElement(pl,{size:"inherit",component:"span",value:n})},rl=({value:t})=>{const{imageUrl:n}=dl(t);return e.createElement(i.CardMedia,{image:n,sx:e=>({height:"1rem",width:"1rem",borderRadius:e.shape.borderRadius/2+"px",outline:`1px solid ${e.palette.action.disabled}`})})},ol=({value:t})=>{const n=fl(t);return e.createElement(pl,{size:"inherit",component:"span",value:n})},il=({value:t})=>{switch(t.$$type){case"background-image-overlay":return e.createElement(ll,{value:t});case"background-color-overlay":return e.createElement(sl,{value:t});case"background-gradient-overlay":return e.createElement(al,{value:t});default:return null}},sl=({value:t})=>{const n=tl(t);return e.createElement("span",null,n)},ll=({value:t})=>{const{imageTitle:n}=dl(t);return e.createElement("span",null,n)},al=({value:t})=>"linear"===t.value.type.value?e.createElement("span",null,(0,s.__)("Linear Gradient","elementor")):e.createElement("span",null,(0,s.__)("Radial Gradient","elementor")),cl=({anchorEl:t})=>{const n=b(o.backgroundColorOverlayPropTypeUtil);return e.createElement(d,n,e.createElement(m,{bind:"color"},e.createElement(ar,{anchorEl:t})))},ul=()=>{const t=b(o.backgroundImageOverlayPropTypeUtil);return e.createElement(d,t,e.createElement(m,{bind:"image"},e.createElement(re,{sizes:Xs})),e.createElement(m,{bind:"position"},e.createElement(Vs,null)),e.createElement(m,{bind:"repeat"},e.createElement(Ws,null)),e.createElement(m,{bind:"size"},e.createElement(Ks,null)),e.createElement(m,{bind:"attachment"},e.createElement(Fs,null)))},pl=(0,i.styled)(i.UnstableColorIndicator)(({theme:e})=>({height:"1rem",width:"1rem",borderRadius:e.shape.borderRadius/2+"px"})),dl=e=>{let t,n=null;const r=e?.value.image.value?.src.value,{data:o}=(0,W.useWpMediaAttachment)(r.id?.value||null);if(r.id){const e=hl(o?.filename);t=`${o?.title}${e}`||null,n=o?.url||null}else r.url&&(n=r.url.value,t=n?.substring(n.lastIndexOf("/")+1)||null);return{imageTitle:t,imageUrl:n}},hl=e=>e?`.${e.substring(e.lastIndexOf(".")+1)}`:"",fl=e=>{const t=e.value,n=t.stops.value?.map(({value:{color:e,offset:t}})=>`${e.value} ${t.value??0}%`)?.join(",");return"linear"===t.type.value?`linear-gradient(${t.angle.value}deg, ${n})`:`radial-gradient(circle at ${t.positions.value}, ${n})`},ml=[{label:(0,s.__)("Full element","elementor"),value:"border-box"},{label:(0,s.__)("Padding edges","elementor"),value:"padding-box"},{label:(0,s.__)("Content edges","elementor"),value:"content-box"},{label:(0,s.__)("Text","elementor"),value:"text"}],gl=(0,s.__)("Color","elementor"),yl=(0,s.__)("Clipping","elementor"),vl=D(()=>{const t=b(o.backgroundPropTypeUtil);return e.createElement(d,t,e.createElement(m,{bind:"background-overlay"},e.createElement(Qs,null)),e.createElement(bl,null),e.createElement(El,null))}),bl=()=>e.createElement(m,{bind:"color"},e.createElement(i.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(A,null,gl)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(ar,null)))),El=()=>e.createElement(m,{bind:"clip"},e.createElement(i.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(A,null,yl)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(ee,{options:ml}))));function wl(){return wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wl.apply(null,arguments)}const xl=/\$\{([^}]+)\}/g,kl=D(({repeaterLabel:t,childControlConfig:n,showDuplicate:r,showToggle:i,initialValues:s,patternLabel:l,placeholder:a,propKey:c,isSortable:u,addItemTooltipProps:p})=>{const{propTypeUtil:h,isItemDisabled:f}=n;if(!h)return null;const m=(0,e.useMemo)(()=>(0,o.createArrayPropUtils)(h.key,h.schema,c),[h.key,h.schema,c]),g=(0,e.useMemo)(()=>({...n,placeholder:a||"",patternLabel:l||""}),[n,a,l]),{propType:y,value:v,setValue:E}=b(m),w=null===p?.newItemIndex?void 0:0;return e.createElement(d,{propType:y,value:v,setValue:E},e.createElement(Mr.Provider,{value:g},e.createElement(Ur,{initial:h.create(s||null),propTypeUtil:m,isItemDisabled:f},e.createElement(no,{label:t},e.createElement(Er,wl({},p,{newItemIndex:w,ariaLabel:t}))),e.createElement(Ar,{isSortable:u},e.createElement(Fr,{Icon:Sl,Label:Al,actions:e.createElement(e.Fragment,null,r&&e.createElement(Gr,null),i&&e.createElement(Hr,null),e.createElement(qr,null))})),e.createElement(Qr,null,e.createElement(Cl,null)))))}),Sl=()=>e.createElement(e.Fragment,null),Cl=()=>{const{component:t,props:n={}}=Pr();return e.createElement(eo,{p:1.5},e.createElement(to,null,e.createElement(t,n)))},Tl=(e,t)=>{let n={};const r=t.split("."),o=r.slice(-1)[0];let i=r.reduce((e,t,o)=>(o===r.length-2&&(n=e),e&&"object"==typeof e?e[t]:{}),e);i=i||"";const s=n?.$$type,l=n?.value;return"unit"===o&&"size"===s&&"custom"===l?.unit?l?.size?"":nr:i},Ol=e=>"string"==typeof e?""===e.trim():!!Number.isNaN(e)||(Array.isArray(e)?0===e.length:"object"==typeof e&&null!==e&&0===Object.keys(e).length),Al=({value:t})=>{const{placeholder:n,patternLabel:r,props:o}=Pr(),s=((e,t)=>{const n=Ml(e).map(e=>Tl(t,e));return!(0===n.length||!n.some(e=>null==e)&&!n.every(Ol))})(r,t),l=s?n:(a=r,(c=t)?a.replace(xl,(e,t)=>{const n=Tl(c,t);return"object"!=typeof n||null===n||Array.isArray(n)?Array.isArray(n)?n.join(", "):String(n??""):"name"in n&&n.name?n.name:JSON.stringify(n)}):a);var a,c;const u=((e,t)=>e?"text.disabled":t?"text.tertiary":"text.primary")(!!o?.readOnly,s);return e.createElement(i.Box,{component:"span",color:u},l)},Ml=e=>e.match(xl)?.map(e=>e.slice(2,-1))||[],Pl=e=>{const t={"&":"&","<":"<",">":">","'":"'",'"':"""};return e.replace(/[&<>'"]/g,e=>t[e]||e)};function Il(){return Il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Il.apply(null,arguments)}const _l=e=>{const t=e;return e&&"object"==typeof e&&"dynamic"!==t.$$type&&t.value||""},Nl=D((t={})=>{const{value:n,setValue:r,...l}=b(o.keyValuePropTypeUtil),[a,c]=(0,e.useState)(""),[u,p]=(0,e.useState)(""),[h,f]=(0,e.useState)({key:_l(n?.key),value:_l(n?.value)}),g=t.keyName||(0,s.__)("Key","elementor"),y=t.valueName||(0,s.__)("Value","elementor"),{keyHelper:v,valueHelper:E}=t.getHelperText?.(h.key,h.value)||{keyHelper:void 0,valueHelper:void 0},[w,x,k]=(0,e.useMemo)(()=>[t.regexKey?new RegExp(t.regexKey):void 0,t.regexValue?new RegExp(t.regexValue):void 0,t.validationErrorMessage||(0,s.__)("Invalid Format","elementor")],[t.regexKey,t.regexValue,t.validationErrorMessage]);return e.createElement(d,Il({},l,{value:n,setValue:(e,t,i)=>{const s=i?.bind;if(!s)return;const l=e[s];if((0,o.isTransformable)(l)&&"dynamic"===l.$$type)return void r({...n,[s]:l});const a=o.stringPropTypeUtil.extract(l);f(e=>({...e,[s]:a})),a&&((e,t)=>{if("key"===t&&w){const t=w.test(e);return c(t?"":k),t}if("value"===t&&x){const t=x.test(e);return p(t?"":k),t}return!0})(a,s)?r({...n,[s]:l}):r({...n,[s]:{value:"",$$type:"string"}})}}),e.createElement(i.Grid,{container:!0,gap:1.5},e.createElement(i.Grid,{item:!0,xs:12,display:"flex",flexDirection:"column"},e.createElement(i.FormLabel,{size:"tiny",sx:{pb:1}},g),e.createElement(m,{bind:"key"},e.createElement(se,{inputValue:t.escapeHtml?Pl(h.key):h.key,error:!!a,helperText:v})),!!a&&e.createElement(i.FormHelperText,{error:!0},a)),e.createElement(i.Grid,{item:!0,xs:12,display:"flex",flexDirection:"column"},e.createElement(i.FormLabel,{size:"tiny",sx:{pb:1}},y),e.createElement(m,{bind:"value"},e.createElement(se,{inputValue:t.escapeHtml?Pl(h.value):h.value,error:!!u,inputDisabled:!!a,helperText:E})),!!u&&e.createElement(i.FormHelperText,{error:!0},u))))}),Rl=[{label:(0,s.__)("Center center","elementor"),value:"center center"},{label:(0,s.__)("Center left","elementor"),value:"center left"},{label:(0,s.__)("Center right","elementor"),value:"center right"},{label:(0,s.__)("Top center","elementor"),value:"top center"},{label:(0,s.__)("Top left","elementor"),value:"top left"},{label:(0,s.__)("Top right","elementor"),value:"top right"},{label:(0,s.__)("Bottom center","elementor"),value:"bottom center"},{label:(0,s.__)("Bottom left","elementor"),value:"bottom left"},{label:(0,s.__)("Bottom right","elementor"),value:"bottom right"},{label:(0,s.__)("Custom","elementor"),value:"custom"}],Dl=()=>{const t=b(o.positionPropTypeUtil),n=b(o.stringPropTypeUtil),r=!!t.value,l=t.placeholder?"custom":n.placeholder??null;return e.createElement(i.Grid,{container:!0,spacing:1.5},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(i.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,(0,s.__)("Object position","elementor"))),e.createElement(i.Grid,{item:!0,xs:6,sx:{overflow:"hidden"}},e.createElement(i.Select,{size:"tiny",displayEmpty:!0,disabled:n.disabled,value:(t.value?"custom":n.value)??"",onChange:e=>{const r=e.target.value||null;"custom"===r?t.setValue({x:null,y:null}):n.setValue(r)},renderValue:e=>te(Rl,l,e),fullWidth:!0},Rl.map(({label:t,value:n})=>e.createElement(G.MenuListItem,{key:n,value:n??""},t)))))),r&&e.createElement(d,t,e.createElement(i.Grid,{item:!0,xs:12},e.createElement(i.Grid,{container:!0,spacing:1.5},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"x"},e.createElement(rr,{startIcon:e.createElement(H.LetterXIcon,{fontSize:"tiny"}),min:-Number.MAX_SAFE_INTEGER}))),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"y"},e.createElement(rr,{startIcon:e.createElement(H.LetterYIcon,{fontSize:"tiny"}),min:-Number.MAX_SAFE_INTEGER})))))))},Ll="transform-move",zl="transform-scale",jl="transform-rotate",$l="transform-skew",Bl={move:{size:0,unit:"px"},scale:1,rotate:{size:0,unit:"deg"},skew:{size:0,unit:"deg"}},Fl={$$type:Ll,value:{x:{$$type:"size",value:{size:Bl.move.size,unit:Bl.move.unit}},y:{$$type:"size",value:{size:Bl.move.size,unit:Bl.move.unit}},z:{$$type:"size",value:{size:Bl.move.size,unit:Bl.move.unit}}}},Ul=o.scaleTransformPropTypeUtil.create({x:o.numberPropTypeUtil.create(Bl.scale),y:o.numberPropTypeUtil.create(Bl.scale),z:o.numberPropTypeUtil.create(Bl.scale)}),Vl=o.rotateTransformPropTypeUtil.create({x:{$$type:"size",value:{size:Bl.rotate.size,unit:Bl.rotate.unit}},y:{$$type:"size",value:{size:Bl.rotate.size,unit:Bl.rotate.unit}},z:{$$type:"size",value:{size:Bl.rotate.size,unit:Bl.rotate.unit}}}),Hl=o.skewTransformPropTypeUtil.create({x:{$$type:"size",value:{size:Bl.skew.size,unit:Bl.skew.unit}},y:{$$type:"size",value:{size:Bl.skew.size,unit:Bl.skew.unit}}}),Wl=({label:t,bind:n,startIcon:r,anchorRef:o,units:s,variant:l="angle"})=>{const a=t.replace(/\s+/g,"-").toLowerCase();return e.createElement(i.Grid,{item:!0,xs:12},e.createElement(to,{ref:o},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(A,{htmlFor:a},t)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:n},e.createElement(rr,{anchorRef:o,startIcon:r,units:s,variant:l,min:-Number.MAX_SAFE_INTEGER,id:a})))))};function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gl.apply(null,arguments)}const Kl=[{label:(0,s.__)("Move X","elementor"),bind:"x",startIcon:e.createElement(H.ArrowRightIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vw"]},{label:(0,s.__)("Move Y","elementor"),bind:"y",startIcon:e.createElement(H.ArrowDownSmallIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vh"]},{label:(0,s.__)("Move Z","elementor"),bind:"z",startIcon:e.createElement(H.ArrowDownLeftIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vw","vh"]}],ql=()=>{const t=b(o.moveTransformPropTypeUtil),n=[(0,e.useRef)(null),(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(i.Grid,{container:!0,spacing:1.5},e.createElement(d,t,e.createElement(m,{bind:Ll},Kl.map((t,r)=>e.createElement(Wl,Gl({key:t.bind},t,{anchorRef:n[r],units:t.units,variant:"length"}))))))};function Jl(){return Jl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jl.apply(null,arguments)}const Yl=[{label:(0,s.__)("Rotate X","elementor"),bind:"x",startIcon:e.createElement(H.Arrow360Icon,{fontSize:"tiny"})},{label:(0,s.__)("Rotate Y","elementor"),bind:"y",startIcon:e.createElement(H.Arrow360Icon,{fontSize:"tiny",style:{transform:"scaleX(-1) rotate(-90deg)"}})},{label:(0,s.__)("Rotate Z","elementor"),bind:"z",startIcon:e.createElement(H.RotateClockwiseIcon,{fontSize:"tiny"})}],Xl=["deg","rad","grad","turn"],Ql=()=>{const t=b(o.rotateTransformPropTypeUtil),n=[(0,e.useRef)(null),(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(i.Grid,{container:!0,spacing:1.5},e.createElement(d,t,e.createElement(m,{bind:jl},Yl.map((t,r)=>e.createElement(Wl,Jl({key:t.bind},t,{anchorRef:n[r],units:Xl}))))))},Zl=({label:t,bind:n,startIcon:r,anchorRef:o})=>e.createElement(i.Grid,{item:!0,xs:12},e.createElement(to,{ref:o},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(A,null,t)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:n},e.createElement(qo,{step:.1,placeholder:"1",startIcon:r})))));function ea(){return ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ea.apply(null,arguments)}const ta=[{label:(0,s.__)("Scale X","elementor"),bind:"x",startIcon:e.createElement(H.ArrowRightIcon,{fontSize:"tiny"})},{label:(0,s.__)("Scale Y","elementor"),bind:"y",startIcon:e.createElement(H.ArrowDownSmallIcon,{fontSize:"tiny"})},{label:(0,s.__)("Scale Z","elementor"),bind:"z",startIcon:e.createElement(H.ArrowDownLeftIcon,{fontSize:"tiny"})}],na=()=>{const t=b(o.scaleTransformPropTypeUtil),n=[(0,e.useRef)(null),(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(i.Grid,{container:!0,spacing:1.5},e.createElement(d,t,e.createElement(m,{bind:zl},ta.map((t,r)=>e.createElement(Zl,ea({key:t.bind},t,{anchorRef:n[r]}))))))};function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ra.apply(null,arguments)}const oa=[{label:(0,s.__)("Skew X","elementor"),bind:"x",startIcon:e.createElement(H.ArrowRightIcon,{fontSize:"tiny"})},{label:(0,s.__)("Skew Y","elementor"),bind:"y",startIcon:e.createElement(H.ArrowLeftIcon,{fontSize:"tiny",style:{transform:"scaleX(-1) rotate(-90deg)"}})}],ia=["deg","rad","grad","turn"],sa=()=>{const t=b(o.skewTransformPropTypeUtil),n=[(0,e.useRef)(null),(0,e.useRef)(null),(0,e.useRef)(null)];return e.createElement(i.Grid,{container:!0,spacing:1.5},e.createElement(d,t,e.createElement(m,{bind:$l},oa.map((t,r)=>e.createElement(Wl,ra({key:t.bind},t,{anchorRef:n[r],units:ia}))))))};function la(){return la=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},la.apply(null,arguments)}const aa=()=>{const{getTabsProps:t,getTabProps:n,getTabPanelProps:r}=(({move:t,scale:n,rotate:r,skew:s})=>{const{value:l,setValue:a}=b(o.moveTransformPropTypeUtil),{value:c,setValue:u}=b(o.scaleTransformPropTypeUtil),{value:p,setValue:d}=b(o.rotateTransformPropTypeUtil),{value:h,setValue:f}=b(o.skewTransformPropTypeUtil),{openItemIndex:m,items:g}=gr(),{getTabsProps:y,getTabProps:v,getTabPanelProps:E}=(0,i.useTabs)((()=>{switch(!0){case!!c:return zl;case!!p:return jl;case!!h:return $l;default:return Ll}})()),w=(0,e.useRef)({move:t,scale:n,rotate:r,skew:s}),x=(e,t)=>{t&&(w.current[e]=t)},k=(e,t)=>{switch(t){case Ll:a(w.current.move),x("scale",c),x("rotate",p),x("skew",h);break;case zl:u(w.current.scale),x("move",l),x("rotate",p),x("skew",h);break;case jl:d(w.current.rotate),x("move",l),x("scale",c),x("skew",h);break;case $l:f(w.current.skew),x("move",l),x("scale",c),x("rotate",p)}return y().onChange(e,t)};return{getTabProps:e=>{return{...v(e),disabled:(t=e,!!g.find(({item:{$$type:e}},n)=>t===e&&n!==m))};var t},getTabPanelProps:E,getTabsProps:()=>({...y(),onChange:k})}})({move:Fl.value,scale:Ul.value,rotate:Vl.value,skew:Hl.value});return e.createElement(eo,null,e.createElement(i.Box,{sx:{width:"100%"}},e.createElement(i.Box,{sx:{borderBottom:1,borderColor:"divider"}},e.createElement(i.Tabs,la({size:"small",variant:"fullWidth",sx:{"& .MuiTab-root":{minWidth:"62px"}}},t(),{"aria-label":(0,s.__)("Transform","elementor")}),e.createElement(i.Tab,la({label:(0,s.__)("Move","elementor")},n(Ll))),e.createElement(i.Tab,la({label:(0,s.__)("Scale","elementor")},n(zl))),e.createElement(i.Tab,la({label:(0,s.__)("Rotate","elementor")},n(jl))),e.createElement(i.Tab,la({label:(0,s.__)("Skew","elementor")},n($l))))),e.createElement(i.TabPanel,la({sx:{p:1.5}},r(Ll)),e.createElement(ql,null)),e.createElement(i.TabPanel,la({sx:{p:1.5}},r(zl)),e.createElement(na,null)),e.createElement(i.TabPanel,la({sx:{p:1.5}},r(jl)),e.createElement(Ql,null)),e.createElement(i.TabPanel,la({sx:{p:1.5}},r($l)),e.createElement(sa,null))))},ca=({value:t})=>{switch(t.$$type){case Ll:return e.createElement(H.ArrowsMaximizeIcon,{fontSize:"tiny"});case zl:return e.createElement(H.ArrowAutofitHeightIcon,{fontSize:"tiny"});case jl:return e.createElement(H.RotateClockwise2Icon,{fontSize:"tiny"});case $l:return e.createElement(H.SkewXIcon,{fontSize:"tiny"});default:return null}},ua=["x","y","z"],pa=(e,t)=>ua.map(n=>{const r=e[n];if("scale"===t)return r?.value||Bl[t];const o=Bl[t],i=r?.value?.size??o.size,s=r?.value?.unit??o.unit;return"custom"===s?i||nr:`${i}${s}`}).join(", "),da=t=>{const{$$type:n,value:r}=t.value;switch(n){case Ll:return e.createElement(ha,{label:(0,s.__)("Move","elementor"),value:pa(r,"move")});case zl:return e.createElement(ha,{label:(0,s.__)("Scale","elementor"),value:pa(r,"scale")});case jl:return e.createElement(ha,{label:(0,s.__)("Rotate","elementor"),value:pa(r,"rotate")});case $l:return e.createElement(ha,{label:(0,s.__)("Skew","elementor"),value:pa(r,"skew")});default:return""}},ha=({label:t,value:n})=>e.createElement(i.Box,{component:"span"},t,": ",n),fa=["px","%","em","rem"],ma={label:(0,s.__)("Perspective","elementor"),bind:"perspective",units:["px","em","rem","vw","vh"]},ga=[{label:(0,s.__)("Origin X","elementor"),bind:"x",units:fa},{label:(0,s.__)("Origin Y","elementor"),bind:"y",units:fa}],ya=()=>e.createElement(i.Stack,{direction:"column",spacing:1.5},e.createElement(k,null,(0,s.__)("Children perspective","elementor")),e.createElement(va,null),e.createElement(ba,null)),va=()=>e.createElement(m,{bind:"perspective"},e.createElement(wa,{control:ma,key:ma.bind})),ba=()=>e.createElement(m,{bind:"perspective-origin"},e.createElement(Ea,null)),Ea=()=>{const t=b(o.perspectiveOriginPropTypeUtil);return e.createElement(d,t,ga.map(t=>e.createElement(m,{bind:t.bind,key:t.bind},e.createElement(wa,{control:t}))))},wa=({control:t})=>{const n=(0,e.useRef)(null);return e.createElement(to,{ref:n},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,t.label)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(rr,{variant:"length",units:t.units,anchorRef:n,disableCustom:!0})))},xa=["px","%","em","rem"],ka=xa.filter(e=>"%"!==e),Sa=[{label:(0,s.__)("Origin X","elementor"),bind:"x",units:xa},{label:(0,s.__)("Origin Y","elementor"),bind:"y",units:xa},{label:(0,s.__)("Origin Z","elementor"),bind:"z",units:ka}],Ca=()=>e.createElement(i.Stack,{direction:"column",spacing:1.5},e.createElement(k,null,(0,s.__)("Transform","elementor")),Sa.map(t=>e.createElement(Ta,{control:t,key:t.bind}))),Ta=({control:t})=>{const n=b(o.transformOriginPropTypeUtil),r=(0,e.useRef)(null);return e.createElement(d,n,e.createElement(m,{bind:t.bind},e.createElement(to,{ref:r},e.createElement(i.Grid,{item:!0,xs:6},e.createElement(k,null,t.label)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(rr,{variant:"length",units:t.units,anchorRef:r})))))};function Oa(){return Oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oa.apply(null,arguments)}const Aa=({popupState:t,anchorRef:n,showChildrenPerspective:r})=>{const o=(0,i.bindPopover)({...t,anchorEl:n.current??void 0});return e.createElement(i.Popover,Oa({disablePortal:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{width:(n.current?.offsetWidth||0)-6+"px",mt:.5}}}},o),e.createElement(G.PopoverHeader,{title:(0,s.__)("Transform settings","elementor"),onClose:t.close,icon:e.createElement(H.AdjustmentsIcon,{fontSize:"tiny"})}),e.createElement(i.Divider,null),e.createElement(eo,{sx:{px:2,py:1.5}},e.createElement(m,{bind:"transform-origin"},e.createElement(Ca,null)),r&&e.createElement(e.Fragment,null,e.createElement(i.Box,{sx:{my:.5}},e.createElement(i.Divider,null)),e.createElement(ya,null))))};function Ma(){return Ma=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ma.apply(null,arguments)}const Pa="tiny",Ia=D(({showChildrenPerspective:t})=>{const n=b(o.transformPropTypeUtil),r=(0,e.useRef)(null),s=(0,i.usePopupState)({variant:"popover"});return e.createElement(d,n,e.createElement(Aa,{popupState:s,anchorRef:r,showChildrenPerspective:t}),e.createElement(m,{bind:"transform-functions"},e.createElement(Na,{headerRef:r,propType:n.propType,popupState:s})))}),_a=e.createElement(i.Box,{component:"span","aria-label":void 0,sx:{display:"flex",gap:.5,p:2,width:320,borderRadius:1}},e.createElement(H.InfoCircleFilledIcon,{sx:{color:"secondary.main"}}),e.createElement(i.Typography,{variant:"body2",color:"text.secondary",fontSize:"14px"},(0,s.__)("You can use each kind of transform only once per element.","elementor"))),Na=({headerRef:t,propType:n,popupState:r})=>{const i=b(o.transformFunctionsPropTypeUtil),l=[Fl,Ul,Vl,Hl],{value:a,bind:c}=i,u=()=>l.find(e=>!a?.some(t=>t.$$type===e.$$type)),p=!u();return e.createElement(d,i,e.createElement(Ur,{initial:u()??Fl,propTypeUtil:o.transformFunctionsPropTypeUtil},e.createElement(no,{label:(0,s.__)("Transform","elementor"),adornment:()=>e.createElement(O,{customContext:{path:["transform"],propType:n}}),ref:t},e.createElement(Ra,{popupState:r,repeaterBindKey:c}),e.createElement(Er,{disabled:p,tooltipContent:_a,enableTooltip:p,ariaLabel:"transform"})),e.createElement(Ar,null,e.createElement(Fr,{Icon:ca,Label:da,actions:e.createElement(e.Fragment,null,e.createElement(Hr,null),e.createElement(qr,null))})),e.createElement(Qr,null,e.createElement(aa,null))))},Ra=({popupState:t,repeaterBindKey:n})=>{const{bind:r}=b(),o=(0,s.__)("Transform settings","elementor");return r!==n?null:e.createElement(i.Tooltip,{title:o,placement:"top"},e.createElement(i.IconButton,Ma({size:Pa,"aria-label":o},(0,i.bindTrigger)(t)),e.createElement(H.AdjustmentsIcon,{fontSize:Pa})))},Da=D(({selectionLabel:t,sizeLabel:n,selectionConfig:r,sizeConfigMap:s})=>{const{value:l,setValue:a,propType:c}=b(o.selectionSizePropTypeUtil),u=(0,e.useRef)(null),p=n.replace(/\s+/g,"-").toLowerCase(),h=(0,e.useMemo)(()=>{switch(l.selection.$$type){case"key-value":return s[l?.selection?.value.value.value||""];case"string":return s[l?.selection?.value||""];default:return null}},[l,s]),f=r.component;return e.createElement(d,{value:l,setValue:a,propType:c},e.createElement(i.Grid,{container:!0,spacing:1.5,ref:u},e.createElement(i.Grid,{item:!0,xs:6,sx:{display:"flex",alignItems:"center"}},e.createElement(k,null,t)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"selection"},e.createElement(f,r.props))),h&&e.createElement(e.Fragment,null,e.createElement(i.Grid,{item:!0,xs:6,sx:{display:"flex",alignItems:"center"}},e.createElement(k,{htmlFor:p},n)),e.createElement(i.Grid,{item:!0,xs:6},e.createElement(m,{bind:"size"},e.createElement(rr,{anchorRef:u,variant:h.variant,units:h.units,defaultUnit:h.defaultUnit,id:p}))))))}),La={selection:{$$type:"key-value",value:{key:{value:(0,s.__)("All properties","elementor"),$$type:"string"},value:{value:"all",$$type:"string"}}},size:{$$type:"size",value:{size:200,unit:"ms"}}},za=(()=>{const e=!!window.elementorFrontend?.config?.is_rtl,t=[{label:(0,s.__)("Default","elementor"),type:"category",properties:[{label:(0,s.__)("All properties","elementor"),value:"all"}]},{label:(0,s.__)("Margin","elementor"),type:"category",properties:[{label:(0,s.__)("Margin (all)","elementor"),value:"margin",isDisabled:!0},{label:(0,s.__)("Margin bottom","elementor"),value:"margin-block-end",isDisabled:!0},{label:e?(0,s.__)("Margin right","elementor"):(0,s.__)("Margin left","elementor"),value:"margin-inline-start",isDisabled:!0},{label:e?(0,s.__)("Margin left","elementor"):(0,s.__)("Margin right","elementor"),value:"margin-inline-end",isDisabled:!0},{label:(0,s.__)("Margin top","elementor"),value:"margin-block-start",isDisabled:!0}]},{label:(0,s.__)("Padding","elementor"),type:"category",properties:[{label:(0,s.__)("Padding (all)","elementor"),value:"padding",isDisabled:!0},{label:(0,s.__)("Padding bottom","elementor"),value:"padding-block-end",isDisabled:!0},{label:e?(0,s.__)("Padding right","elementor"):(0,s.__)("Padding left","elementor"),value:"padding-inline-start",isDisabled:!0},{label:e?(0,s.__)("Padding left","elementor"):(0,s.__)("Padding right","elementor"),value:"padding-inline-end",isDisabled:!0},{label:(0,s.__)("Padding top","elementor"),value:"padding-block-start",isDisabled:!0}]},{label:(0,s.__)("Flex","elementor"),type:"category",properties:[{label:(0,s.__)("Flex (all)","elementor"),value:"flex",isDisabled:!0},{label:(0,s.__)("Flex grow","elementor"),value:"flex-grow",isDisabled:!0},{label:(0,s.__)("Flex shrink","elementor"),value:"flex-shrink",isDisabled:!0},{label:(0,s.__)("Flex basis","elementor"),value:"flex-basis",isDisabled:!0}]},{label:(0,s.__)("Size","elementor"),type:"category",properties:[{label:(0,s.__)("Width","elementor"),value:"width",isDisabled:!0},{label:(0,s.__)("Height","elementor"),value:"height",isDisabled:!0},{label:(0,s.__)("Max height","elementor"),value:"max-height",isDisabled:!0},{label:(0,s.__)("Max width","elementor"),value:"max-width",isDisabled:!0},{label:(0,s.__)("Min height","elementor"),value:"min-height",isDisabled:!0},{label:(0,s.__)("Min width","elementor"),value:"min-width",isDisabled:!0}]},{label:(0,s.__)("Position","elementor"),type:"category",properties:[{label:(0,s.__)("Top","elementor"),value:"inset-block-start",isDisabled:!0},{label:e?(0,s.__)("Right","elementor"):(0,s.__)("Left","elementor"),value:"inset-inline-start",isDisabled:!0},{label:e?(0,s.__)("Left","elementor"):(0,s.__)("Right","elementor"),value:"inset-inline-end",isDisabled:!0},{label:(0,s.__)("Bottom","elementor"),value:"inset-block-end",isDisabled:!0},{label:(0,s.__)("Z-index","elementor"),value:"z-index",isDisabled:!0}]},{label:(0,s.__)("Typography","elementor"),type:"category",properties:[{label:(0,s.__)("Font color","elementor"),value:"color",isDisabled:!0},{label:(0,s.__)("Font size","elementor"),value:"font-size",isDisabled:!0},{label:(0,s.__)("Line height","elementor"),value:"line-height",isDisabled:!0},{label:(0,s.__)("Letter spacing","elementor"),value:"letter-spacing",isDisabled:!0},{label:(0,s.__)("Word spacing","elementor"),value:"word-spacing",isDisabled:!0},{label:(0,s.__)("Font variations","elementor"),value:"font-variation-settings",isDisabled:!0},{label:(0,s.__)("Text stroke color","elementor"),value:"-webkit-text-stroke-color",isDisabled:!0}]},{label:(0,s.__)("Background","elementor"),type:"category",properties:[{label:(0,s.__)("Background color","elementor"),value:"background-color",isDisabled:!0},{label:(0,s.__)("Background position","elementor"),value:"background-position",isDisabled:!0},{label:(0,s.__)("Box shadow","elementor"),value:"box-shadow",isDisabled:!0}]},{label:(0,s.__)("Border","elementor"),type:"category",properties:[{label:(0,s.__)("Border (all)","elementor"),value:"border",isDisabled:!0},{label:(0,s.__)("Border radius","elementor"),value:"border-radius",isDisabled:!0},{label:(0,s.__)("Border color","elementor"),value:"border-color",isDisabled:!0},{label:(0,s.__)("Border width","elementor"),value:"border-width",isDisabled:!0}]},{label:(0,s.__)("Effects","elementor"),type:"category",properties:[{label:(0,s.__)("Opacity","elementor"),value:"opacity",isDisabled:!0},{label:(0,s.__)("Transform (all)","elementor"),value:"transform",isDisabled:!0},{label:(0,s.__)("Filter (all)","elementor"),value:"filter",isDisabled:!0}]}];return(()=>{if(!(0,l.hasProInstalled)())return!0;const e=window.elementorPro?.config?.version;return!!e&&(0,l.isVersionGreaterOrEqual)(e,"3.35")})()?t:[t[0]]})(),ja=za.map(e=>({label:e.label,items:e.properties.map(e=>e.label)}));var $a=window.elementorV2.events;const Ba={eventName:"click_added_transition",location:"V4 Style Tab",secondaryLocation:"Transition control",trigger:"click"},Fa=(e,t)=>({app_type:t?.appTypes?.editor??"editor",window_name:t?.appTypes?.editor??"editor",interaction_type:t?.triggers?.click??"Click",target_name:e.target_name,target_location:e.target_location??"widget_panel",location_l1:e.location_l1??(0,Ui.getSelectedElements)()[0]?.type??"",...e.location_l2&&{location_l2:e.location_l2}}),Ua=(e,t)=>{const{dispatchEvent:n,config:r}=(0,$a.getMixpanel)(),{eventName:o,interactionResult:i,interactionDescription:s}=t(r);o&&n?.(o,{...Fa(e,r),interaction_result:i,interaction_description:s})},Va=e=>{Ua(e,e=>({eventName:e?.names?.promotions?.viewPromotion,interactionResult:e?.interactionResults?.promotionViewed??"promotion_viewed",interactionDescription:"user_viewed_promotion"}))},Ha=e=>{Ua(e,e=>({eventName:e?.names?.promotions?.upgradePromotionClick,interactionResult:e?.interactionResults?.upgradeNow??"upgrade_now",interactionDescription:"user_clicked_upgrade_now"}))};function Wa(){return Wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wa.apply(null,arguments)}function Ga(e){if(!e?.value)return null;for(const t of za)for(const n of t.properties)if(n.value===e.value)return n;return null}const Ka=(e,t)=>t.filter(t=>t!==e.key.value),qa=({recentlyUsedList:t=[],disabledItems:n=[],showPromotion:r=!1})=>{const{value:l,setValue:a}=b(o.keyValuePropTypeUtil),{key:{value:c}}=l,u=(0,e.useRef)(null),p=(0,i.usePopupState)({variant:"popover"}),d=(0,e.useMemo)(()=>new Set(za.filter(e=>e.properties.some(e=>e.isDisabled)).map(e=>e.label)),[]);return e.createElement(i.Box,{ref:u},e.createElement(Y,null,e.createElement(i.UnstableTag,Wa({variant:"outlined",label:c,endIcon:e.createElement(H.ChevronDownIcon,{fontSize:"tiny"})},(0,i.bindTrigger)(p),{fullWidth:!0}))),e.createElement(i.Popover,Wa({disablePortal:!0,disableScrollLock:!0},(0,i.bindPopover)(p),{anchorReference:"anchorPosition",anchorPosition:(()=>{if(!u.current)return;const e=u.current.getBoundingClientRect();return{top:e.top,left:e.right+36}})(),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}}),e.createElement(Di,{itemsList:(()=>{const e=t.map(e=>Ga({value:e,$$type:"string"})?.label).filter(e=>!!e),n=ja.map(t=>({...t,items:t.items.filter(t=>!e.includes(t))}));if(0===e.length)return n;const[r,...o]=n;return[r,{label:(0,s.__)("Recently Used","elementor"),items:e},...o]})(),selectedItem:c,onItemChange:e=>{const t=(e=>{for(const t of za){const n=t.properties.find(t=>t.label===e);if(n)return{key:{value:n.label,$$type:"string"},value:{value:n.value,$$type:"string"}}}return null})(e);t&&(a(t),p.close())},onClose:p.close,sectionWidth:268,title:(0,s.__)("Transition Property","elementor"),icon:H.VariationsIcon,disabledItems:Ka(l,n),categoryItemContentTemplate:t=>e.createElement(i.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},e.createElement("span",null,t.value),r&&d.has(t.value)&&e.createElement(G.PromotionChip,null)),footer:r?e.createElement(G.PromotionAlert,{message:(0,s.__)("Upgrade to customize transition properties and control effects.","elementor"),upgradeUrl:"https://go.elementor.com/go-pro-transitions-modal/",onCtaClick:()=>Ha({target_name:"transition_property",location_l2:"style"})}):null})))},Ja={variant:"time",units:["s","ms"],defaultUnit:"ms"},Ya=(0,o.createArrayPropUtils)(o.selectionSizePropTypeUtil.key,o.selectionSizePropTypeUtil.schema,"transition");hr.subscribe("transition-item-added",e=>{const t=e,n=t?.itemValue?.selection?.value?.value?.value,r=(0,Ui.getSelectedElements)(),o=r[0]?.type??null;(0,$a.trackEvent)({transition_type:n??"unknown",...Ba,widget_type:o})});const Xa=(e,t,n)=>({selectionLabel:(0,s.__)("Type","elementor"),sizeLabel:(0,s.__)("Duration","elementor"),selectionConfig:{component:qa,props:{recentlyUsedList:e,disabledItems:t,showPromotion:n}},sizeConfigMap:{...za.reduce((e,t)=>(t.properties.forEach(t=>{e[t.value]=Ja}),e),{})}}),Qa=e=>{const t=Ga(e.value.selection.value?.value);return!!t&&!!t.isDisabled},Za=(e,t,n)=>({propTypeUtil:o.selectionSizePropTypeUtil,component:Da,props:Xa(e,t,n),isItemDisabled:Qa}),ec=(e,t)=>(e??[]).some(e=>e?.value?.selection?.value?.value?.value===t.value),tc=(e=[])=>{if(!e?.length)return La;for(const t of za)for(const n of t.properties)if(!ec(e,n))return{...La,selection:{$$type:"key-value",value:{key:{value:n.label,$$type:"string"},value:{value:n.value,$$type:"string"}}}};return La},nc=e.createElement(i.Alert,{sx:{width:280,gap:.5},color:"secondary",icon:e.createElement(H.InfoCircleFilledIcon,null)},e.createElement(i.AlertTitle,null,(0,s.__)("Transitions","elementor")),e.createElement(i.Box,{component:"span"},e.createElement(i.Typography,{variant:"body2"},(0,s.__)("Switch to 'Normal' state to add a transition.","elementor")))),rc=D(({recentlyUsedListGetter:t,currentStyleState:n})=>{const r=null===n,[o,i]=(0,e.useState)([]),a=(0,l.hasProInstalled)(),{value:c,setValue:u}=b(Ya),{allDisabled:p,proDisabled:d}=(0,e.useMemo)(()=>((e=[])=>{const t=(e||[]).map(e=>e.value?.selection?.value?.key?.value),n=[];return za.forEach(e=>{const r=e.properties.filter(e=>e.isDisabled&&!t.includes(e.label)).map(e=>e.label);n.push(...r)}),{allDisabled:[...t,...n],proDisabled:n}})(c),[c]),h=(0,e.useMemo)(()=>{const e=new Set;return za.forEach(t=>{t.properties.forEach(t=>{t.isDisabled&&!a||e.add(t.value)})}),e},[a]);(0,e.useEffect)(()=>{if(!c||0===c.length)return;const e=c.filter(e=>{const t=e?.value?.selection?.value?.value?.value??"";return h.has(t)});e.length!==c.length&&u(e)},[h]),(0,e.useEffect)(()=>{t().then(i)},[t]);const f=(0,e.useMemo)(()=>((e=[])=>!!e?.length&&za.every(t=>t.properties.every(t=>t.isDisabled||!!e?.find(e=>e.value?.selection?.value?.value?.value===t.value))))(c),[c]),m=!r||f;return e.createElement(kl,{label:(0,s.__)("Transitions","elementor"),repeaterLabel:(0,s.__)("Transitions","elementor"),patternLabel:"${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",placeholder:(0,s.__)("Empty Transition","elementor"),showDuplicate:!1,showToggle:!0,initialValues:tc(c),childControlConfig:Za(o,p,d.length>0),propKey:"transition",addItemTooltipProps:{disabled:m,enableTooltip:!r,tooltipContent:nc}})});var oc=n(4353),ic=n.n(oc);function sc(){return sc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sc.apply(null,arguments)}const lc=D(({inputDisabled:t})=>{const{value:n,setValue:r,...s}=b(o.DateTimePropTypeUtil),l=(e,t)=>{const i=t.bind,s=e[i];if((0,o.isTransformable)(s))return r({...n,[i]:s});let l="";if(s){const e=s;l="date"===i?e.format("YYYY-MM-DD"):e.format("HH:mm")}r({...n,[i]:{$$type:"string",value:l}})};return e.createElement(d,sc({},s,{value:n,setValue:r}),e.createElement(Y,null,e.createElement(i.LocalizationProvider,null,e.createElement(i.Box,{display:"flex",gap:1,alignItems:"center"},e.createElement(m,{bind:"date"},e.createElement(i.DatePicker,{value:(e=>{if(!e)return null;const t=ic()(e);return t&&"function"==typeof t.isValid&&t.isValid()?t:null})(o.stringPropTypeUtil.extract(n?.date)),onChange:e=>l({date:e},{bind:"date"}),disabled:t,slotProps:{textField:{size:"tiny"},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}}})),e.createElement(m,{bind:"time"},e.createElement(i.TimePicker,{value:(e=>{if(!e)return null;const[t,n]=e.split(":"),r=Number.parseInt(t??"",10),o=Number.parseInt(n??"",10);return Number.isNaN(r)||Number.isNaN(o)?null:ic()().hour(r).minute(o).second(0).millisecond(0)})(o.stringPropTypeUtil.extract(n?.time)),onChange:e=>l({time:e},{bind:"time"}),disabled:t,slotProps:{textField:{size:"tiny"},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}}}))))))});function ac(e){return!!e&&"function"==typeof e.isValid&&e.isValid()}function cc(e){if(!e)return null;const t=ic()(e);return ac(t)?t:null}function uc(e){if(!e)return null;const[t,n,r]=e.split(":"),o=Number.parseInt(t??"",10),i=Number.parseInt(n??"",10),s=Number.parseInt(r??"0",10);return Number.isNaN(o)||Number.isNaN(i)?null:ic()().hour(o).minute(i).second(Number.isNaN(s)?0:s).millisecond(0)}const pc=D(({inputDisabled:t,ariaLabel:n,error:r,coerceInvalidToNull:s=!1})=>{const{value:l,setValue:a,disabled:c}=b(o.dateStringPropTypeUtil),u=t??c,p={textField:{size:"tiny",fullWidth:!0,error:r,inputProps:n?{"aria-label":n}:void 0},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}};return e.createElement(i.LocalizationProvider,null,e.createElement(Y,null,e.createElement(i.DatePicker,{value:cc(l??""),onChange:e=>(e=>{!e||s&&!ac(e)?a(null):a(e.format("YYYY-MM-DD"))})(e),disabled:u,slotProps:p})))});function dc(){return dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dc.apply(null,arguments)}const hc={min:(0,s.__)("Min date","elementor"),max:(0,s.__)("Max date","elementor")},fc=(0,s.__)("Max date must be on or after Min date","elementor"),mc=D(()=>{const{value:t,setValue:n,...r}=b(o.dateRangePropTypeUtil),s=o.dateStringPropTypeUtil.extract(t?.min),l=(c=o.dateStringPropTypeUtil.extract(t?.max),!(!(a=s)||!c)&&c<a);var a,c;return e.createElement(d,dc({},r,{value:t,setValue:n}),e.createElement(i.Stack,{gap:.75},e.createElement(i.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(k,null,hc.min)),e.createElement(i.Grid,{item:!0,xs:12},e.createElement(gc,{bind:"min",ariaLabel:hc.min,error:l}))),e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(k,null,hc.max)),e.createElement(i.Grid,{item:!0,xs:12},e.createElement(gc,{bind:"max",ariaLabel:hc.max,error:l})))),l&&e.createElement(i.FormHelperText,{error:!0},fc)))}),gc=({bind:t,ariaLabel:n,error:r})=>e.createElement(m,{bind:t},e.createElement(pc,{ariaLabel:n,error:r,coerceInvalidToNull:!0})),yc=D(({inputDisabled:t,ariaLabel:n,error:r,coerceInvalidToNull:s=!1})=>{const{value:l,setValue:a,disabled:c}=b(o.timeStringPropTypeUtil),u=t??c,p={textField:{size:"tiny",fullWidth:!0,error:r,inputProps:n?{"aria-label":n}:void 0},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}};return e.createElement(i.LocalizationProvider,null,e.createElement(Y,null,e.createElement(i.TimePicker,{value:uc(l??""),onChange:e=>(e=>{!e||s&&!ac(e)?a(null):a(e.format("HH:mm"))})(e),disabled:u,slotProps:p})))});function vc(){return vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vc.apply(null,arguments)}const bc={min:(0,s.__)("Start time","elementor"),max:(0,s.__)("End time","elementor")},Ec=D(()=>{const{value:t,setValue:n,...r}=b(o.timeRangePropTypeUtil);return e.createElement(d,vc({},r,{value:t,setValue:n}),e.createElement(i.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(k,null,bc.min)),e.createElement(i.Grid,{item:!0,xs:12},e.createElement(wc,{bind:"min",ariaLabel:bc.min}))),e.createElement(i.Grid,{container:!0,gap:.75,alignItems:"center"},e.createElement(i.Grid,{item:!0,xs:12},e.createElement(k,null,bc.max)),e.createElement(i.Grid,{item:!0,xs:12},e.createElement(wc,{bind:"max",ariaLabel:bc.max})))))}),wc=({bind:t,ariaLabel:n})=>e.createElement(m,{bind:t},e.createElement(yc,{ariaLabel:n,coerceInvalidToNull:!0}));function xc(e){this.content=e}xc.prototype={constructor:xc,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new xc(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new xc(n)},addToStart:function(e,t){return new xc([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new xc(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new xc(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=xc.from(e)).size?new xc(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=xc.from(e)).size?new xc(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=xc.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},xc.from=function(e){if(e instanceof xc)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new xc(t)};var kc=xc;function Sc(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=Sc(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function Cc(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),l=t.child(--i),a=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let e=0,t=Math.min(s.text.length,l.text.length);for(;e<t&&s.text[s.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let e=Cc(s.content,l.content,n-1,r-1);if(e)return e}n-=a,r-=a}else n-=a,r-=a}}class Tc{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let l=this.content[i],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,o||null,i)&&l.content.size){let o=s+1;l.nodesBetween(Math.max(0,e-o),Math.min(l.content.size,t-o),n,r+o)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=a},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new Tc(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],l=i+s.nodeSize;l>e&&((i<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=l}return new Tc(n,r)}cutByIndex(e,t){return e==t?Tc.empty:0==e&&t==this.content.length?this:new Tc(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new Tc(r,o)}addToStart(e){return new Tc([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Tc(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Sc(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Cc(this,e,t,n)}findIndex(e){if(0==e)return Ac(0,e);if(e==this.size)return Ac(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?Ac(t+1,r):Ac(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Tc.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Tc(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Tc.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new Tc(t||e,n)}static from(e){if(!e)return Tc.empty;if(e instanceof Tc)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Tc([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Tc.empty=new Tc([],0);const Oc={index:0,offset:0};function Ac(e,t){return Oc.index=e,Oc.offset=t,Oc}function Mc(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Mc(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Mc(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class Pc{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!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))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Mc(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return Pc.none;if(e instanceof Pc)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}Pc.none=[];class Ic extends Error{}class _c{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Rc(this.content,e+this.openStart,t);return n&&new _c(n,this.openStart,this.openEnd)}removeBetween(e,t){return new _c(Nc(this.content,e+this.openStart,t+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,t){if(!t)return _c.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new _c(Tc.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new _c(e,n,r)}}function Nc(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:l}=e.findIndex(n);if(o==t||i.isText){if(l!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(Nc(i.content,t-o-1,n-o-1)))}function Rc(e,t,n,r){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Rc(s.content,t-i-1,n,s);return l&&e.replaceChild(o,s.copy(l))}function Dc(e,t,n){if(n.openStart>e.depth)throw new Ic("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ic("Inconsistent open depths");return Lc(e,t,n,0)}function Lc(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=Lc(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Tc.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Fc(i,Uc(e,o,s,t,r))}{let r=e.parent,o=r.content;return Fc(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return Fc(i,Vc(e,t,r))}function zc(e,t){if(!t.type.compatibleContent(e.type))throw new Ic("Cannot join "+t.type.name+" onto "+e.type.name)}function jc(e,t,n){let r=e.node(n);return zc(r,t.node(n)),r}function $c(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Bc(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&($c(e.nodeAfter,r),i++));for(let e=i;e<s;e++)$c(o.child(e),r);t&&t.depth==n&&t.textOffset&&$c(t.nodeBefore,r)}function Fc(e,t){return e.type.checkContent(t),e.copy(t)}function Uc(e,t,n,r,o){let i=e.depth>o&&jc(e,t,o+1),s=r.depth>o&&jc(n,r,o+1),l=[];return Bc(null,e,o,l),i&&s&&t.index(o)==n.index(o)?(zc(i,s),$c(Fc(i,Uc(e,t,n,r,o+1)),l)):(i&&$c(Fc(i,Vc(e,t,o+1)),l),Bc(t,n,o,l),s&&$c(Fc(s,Vc(n,r,o+1)),l)),Bc(r,null,o,l),new Tc(l)}function Vc(e,t,n){let r=[];return Bc(null,e,n,r),e.depth>n&&$c(Fc(jc(e,t,n+1),Vc(e,t,n+1)),r),Bc(t,null,n,r),new Tc(r)}_c.empty=new _c(Tc.empty,0,0);class Hc{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Pc.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new qc(this,e,n);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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new Hc(t,n,o)}static resolveCached(e,t){let n=Kc.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else Kc.set(e,n=new Wc);let r=n.elts[n.i]=Hc.resolve(e,t);return n.i=(n.i+1)%Gc,r}}class Wc{constructor(){this.elts=[],this.i=0}}const Gc=12,Kc=new WeakMap;class qc{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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 Jc=Object.create(null);class Yc{constructor(e,t,n,r=Pc.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Tc.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,t,n,r=0){this.content.nodesBetween(e,t,n,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,t,n,r){return this.content.textBetween(e,t,n,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,t,n){return this.type==e&&Mc(this.attrs,t||e.defaultAttrs||Jc)&&Pc.sameSet(this.marks,n||Pc.none)}copy(e=null){return e==this.content?this:new Yc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Yc(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return _c.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),l=r.node(i).content.cut(r.pos-s,o.pos-s);return new _c(l,r.depth-i,o.depth-i)}replace(e,t,n){return Dc(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Hc.resolveCached(this,e)}resolveNoCache(e){return Hc.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.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()+")"),Qc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Tc.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}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=Pc.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Pc.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t 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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Tc.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}Yc.prototype.text=void 0;class Xc extends Yc{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Qc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Xc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Xc(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Qc(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Zc{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new eu(e,t);if(null==n.next)return Zc.empty;let r=tu(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return function n(r){let o=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);lu(e,n).forEach(e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})})});let i=t[r.join(",")]=new Zc(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(su);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}(lu(e,0))}(function(e){let t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,i)),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(i,s),o(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return o(e(t.expr,i),s),o(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){let s=i;for(let r=0;r<t.min;r++){let r=n();o(e(t.expr,s),r),s=r}if(-1==t.max)o(e(t.expr,s),s);else for(let i=t.min;i<t.max;i++){let i=n();r(s,i),o(e(t.expr,s),i),s=i}return[r(s)]}if("name"==t.type)return[r(i,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],i);if(r==t.exprs.length-1)return s;o(s,i=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let l=i.matchFragment(e,n);if(l&&(!t||l.validEnd))return Tc.from(s.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.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=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}Zc.empty=new Zc(!0);class eu{constructor(e,t){this.string=e,this.nodeTypes=t,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 tu(e){let t=[];do{t.push(nu(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function nu(e){let t=[];do{t.push(ru(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function ru(e){let t=function(e){if(e.eat("(")){let t=tu(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.isInGroup(t)&&o.push(r)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=iu(e,t)}return t}function ou(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function iu(e,t){let n=ou(e),r=n;return e.eat(",")&&(r="}"!=e.next?ou(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function su(e,t){return t-e}function lu(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(su)}function au(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function cu(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function uu(e,t,n,r){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function pu(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new hu(e,r,t[r]);return n}class du{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=pu(e,n.attrs),this.defaultAttrs=au(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Zc.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:cu(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Yc(this,this.computeAttrs(e),Tc.from(t),Pc.setFrom(n))}createChecked(e=null,t,n){return t=Tc.from(t),this.checkContent(t),new Yc(this,this.computeAttrs(e),t,Pc.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Tc.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(Tc.empty,!0);return o?new Yc(this,e,t.append(o),Pc.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).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){uu(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Pc.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new du(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class hu{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class fu{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=pu(e,r.attrs),this.excluded=null;let o=au(this.attrs);this.instance=o?new Pc(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Pc(this,cu(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,o)=>n[e]=new fu(e,r++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){uu(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class mu{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=kc.from(e.nodes),t.marks=kc.from(e.marks||{}),this.nodes=du.compile(this.spec.nodes,this),this.marks=fu.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Zc.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==o?null:o?gu(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:gu(this,n.split(" "))}this.nodeFromJSON=e=>Yc.fromJSON(this,e),this.markFromJSON=e=>Pc.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof du))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Xc(n,n.defaultAttrs,e,Pc.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function gu(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class yu{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ku(this,t,!1);return n.addAll(e,Pc.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ku(this,t,!0);return n.addAll(e,Pc.none,t.from,t.to),_c.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Su(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Cu(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Cu(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new yu(e,yu.schemaRules(e)))}}const vu={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},bu={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Eu={ol:!0,ul:!0};function wu(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class xu{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=Pc.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Tc.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Tc.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Tc.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!vu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ku{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,o=t.topNode,i=wu(null,t.preserveWhitespace,0)|(n?4:0);r=o?new xu(o.type,o.attrs,Pc.none,!0,t.topMatch||o.type.contentMatch,i):new xu(n?null:e.schema.topNodeType,null,Pc.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(i.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i,s=e.nodeName.toLowerCase();Eu.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Eu.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));e:if(l?l.ignore:bu.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);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 n,r=this.needsBlock;if(vu.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let i=l&&l.skip?t:this.readStyles(e,t);i&&this.addAll(e,i),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?i:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],o=n.getPropertyValue(r);if(o)for(let e;;){let n=this.parser.matchStyle(r,o,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;e=n}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let t=this.open,i=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+i)&&(r=l,o=s,!l.length))break;if(s.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=Pc.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):Tu(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=wu(e,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let l=Pc.none;return n=n.filter(t=>!(i.type?i.type.allowsMarkType(t.type):Tu(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new xu(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function Su(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Cu(e){let t={};for(let n in e)t[n]=e[n];return t}function Tu(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Ou{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Mu(t).createDocumentFragment());let r=n,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Iu(Mu(t),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,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Iu(Mu(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Iu(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ou(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Au(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Au(e.marks)}}function Au(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Mu(e){return e.document||window.document}const Pu=new WeakMap;function Iu(e,t,n,r){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let o,i=t[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=function(e){let t=Pu.get(e);return void 0===t&&Pu.set(e,t=function(e){let t=null;return function e(n){if(n&&"object"==typeof n)if(Array.isArray(n))if("string"==typeof n[0])t||(t=[]),t.push(n);else for(let t=0;t<n.length;t++)e(n[t]);else for(let t in n)e(n[t])}(e),t}(e)),t}(r))&&o.indexOf(t)>-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,l=i.indexOf(" ");l>0&&(n=i.slice(0,l),i=i.slice(l+1));let a=n?e.createElementNS(n,i):e.createElement(i),c=t[1],u=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){u=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?a.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&a.style?a.style.cssText=c[e]:a.setAttribute(e,c[e])}}for(let o=u;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:t,contentDOM:o}=Iu(e,i,n,r);if(a.appendChild(t),o){if(s)throw new RangeError("Multiple content holes");s=o}}}return{dom:a,contentDOM:s}}const _u=Math.pow(2,16);function Nu(e,t){return e+t*_u}function Ru(e){return 65535&e}class Du{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Lu{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Lu.empty)return Lu.empty}recover(e){let t=0,n=Ru(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/_u}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[s+o],c=this.ranges[s+i],u=l+a;if(e<=u){let o=l+r+((a?e==l?-1:e==u?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?l:u)?null:Nu(s/3,e-l),p=e==l?2:e==u?1:4;return(t<0?e!=l:e!=u)&&(p|=8),new Du(o,p,i)}r+=c-a}return n?e+r:new Du(e+r,0,null)}touches(e,t){let n=0,r=Ru(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+o];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+i]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),l=i+(this.inverted?0:o),a=this.ranges[r+t],c=this.ranges[r+n];e(s,s+a,l,l+c),o+=c-a}}invert(){return new Lu(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Lu.empty:new Lu(e<0?[0,-e,0]:[0,0,e])}}Lu.empty=new Lu([]);class zu{constructor(e,t,n=0,r=(e?e.length:0)){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new zu(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new zu;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this._maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new Du(e,r,null)}}const ju=Object.create(null);class $u{getMap(){return Lu.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=ju[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ju)throw new RangeError("Duplicate use of step JSON ID "+e);return ju[e]=t,t.prototype.jsonID=e,t}}class Bu{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Bu(e,null)}static fail(e){return new Bu(null,e)}static fromReplace(e,t,n,r){try{return Bu.ok(e.replace(t,n,r))}catch(e){if(e instanceof Ic)return Bu.fail(e.message);throw e}}}function Fu(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(Fu(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return Tc.fromArray(r)}class Uu extends $u{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new _c(Fu(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return Bu.fromReplace(e,this.from,this.to,o)}invert(){return new Vu(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Uu(t.pos,n.pos,this.mark)}merge(e){return e instanceof Uu&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Uu(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,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Uu(t.from,t.to,e.markFromJSON(t.mark))}}$u.jsonID("addMark",Uu);class Vu extends $u{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _c(Fu(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Bu.fromReplace(e,this.from,this.to,n)}invert(){return new Uu(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Vu(t.pos,n.pos,this.mark)}merge(e){return e instanceof Vu&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vu(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,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vu(t.from,t.to,e.markFromJSON(t.mark))}}$u.jsonID("removeMark",Vu);class Hu extends $u{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bu.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Bu.fromReplace(e,this.pos,this.pos+1,new _c(Tc.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new Hu(this.pos,t.marks[n]);return new Hu(this.pos,this.mark)}}return new Wu(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Hu(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Hu(t.pos,e.markFromJSON(t.mark))}}$u.jsonID("addNodeMark",Hu);class Wu extends $u{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bu.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Bu.fromReplace(e,this.pos,this.pos+1,new _c(Tc.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Hu(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Wu(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wu(t.pos,e.markFromJSON(t.mark))}}$u.jsonID("removeNodeMark",Wu);class Gu extends $u{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&qu(e,this.from,this.to)?Bu.fail("Structure replace would overwrite content"):Bu.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Lu([this.from,this.to-this.from,this.slice.size])}invert(e){return new Gu(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Gu(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Gu)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?_c.empty:new _c(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Gu(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?_c.empty:new _c(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Gu(this.from,this.to+(e.to-e.from),t,this.structure)}}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,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Gu(t.from,t.to,_c.fromJSON(e,t.slice),!!t.structure)}}$u.jsonID("replace",Gu);class Ku extends $u{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(qu(e,this.from,this.gapFrom)||qu(e,this.gapTo,this.to)))return Bu.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Bu.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Bu.fromReplace(e,this.from,this.to,n):Bu.fail("Content does not fit in gap")}getMap(){return new Lu([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Ku(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new Ku(t.pos,n.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,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ku(t.from,t.to,t.gapFrom,t.gapTo,_c.fromJSON(e,t.slice),t.insert,!!t.structure)}}function qu(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function Ju(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],l=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),c=l+a.nodeSize,u=r.matchType(a.type);if(u){r=u;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new Vu(l,c,a.marks[t]));if(o&&a.isText&&"pre"!=n.whitespace){let e,t,r=/\r?\n|\r/g;for(;e=r.exec(a.text);)t||(t=new _c(Tc.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),s.push(new Gu(l+e.index,l+e.index+e[0].length,t))}}else s.push(new Gu(l,c,_c.empty));l=c}if(!r.validEnd){let t=r.fillBefore(Tc.empty,!0);e.replace(l,l,new _c(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function Yu(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Xu(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let i=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-o;if(n<e.depth&&i.canReplace(s,l,t))return n;if(0==n||i.type.spec.isolating||!Yu(i,s,l))break;s&&(r=1),l<i.childCount&&(o=1)}return null}function Qu(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<o;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return i?o.map(Zu).concat({type:t,attrs:n}).concat(i.map(Zu)):null}function Zu(e){return{type:e,attrs:null}}function ep(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function tp(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function np(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function rp(e,t){let n=e.resolve(t),r=n.index();return op(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function op(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==r?e.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function ip(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,i,s=r.index(e);if(e==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(e+1),s++,i=r.node(e).maybeChild(s)):(o=r.node(e).maybeChild(s-1),i=r.node(e+1)),o&&!o.isTextblock&&op(o,i)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function sp(e,t,n=t,r=_c.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return lp(o,i,r)?new Gu(t,n,r):new ap(o,i,r).fit()}function lp(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}$u.jsonID("replaceAround",Ku);class ap{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Tc.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=Tc.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let l=new _c(o,i,s);return e>-1?new Ku(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new Gu(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=pp(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let e=this.depth;e>=0;e--){let i,{type:s,match:l}=this.frontier[e],a=null;if(1==t&&(o?l.matchType(o.type)||(a=l.fillBefore(Tc.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:a};if(2==t&&o&&(i=l.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:i};if(r&&l.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=pp(e,t);return!(!r.childCount||r.firstChild.isLeaf||(this.unplaced=new _c(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=pp(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new _c(cp(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new _c(cp(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,l=i.openStart-e,a=0,c=[],{match:u,type:p}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let d=s.size+e-(i.content.size-i.openEnd);for(;a<s.childCount;){let e=s.child(a),t=u.matchType(e.type);if(!t)break;a++,(a>1||0==l||e.content.size)&&(u=t,c.push(dp(e.mark(p.allowedMarks(e.marks)),1==a?l:0,a==s.childCount?d:-1)))}let h=a==s.childCount;h||(d=-1),this.placed=up(this.placed,t,Tc.from(c)),this.frontier[t].match=u,h&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<d;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=h?0==e?_c.empty:new _c(cp(i.content,e-1,1),e-1,d<0?i.openEnd:e-1):new _c(cp(i.content,e,a),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!hp(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=hp(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=hp(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=up(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=up(this.placed,this.depth,Tc.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Tc.empty,!0);e.childCount&&(this.placed=up(this.placed,this.frontier.length,e))}}function cp(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(cp(e.firstChild.content,t-1,n)))}function up(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(up(e.lastChild.content,t-1,n)))}function pp(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function dp(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,dp(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Tc.empty,!0)))),e.copy(r)}function hp(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?l:null}function fp(e){return e.spec.defining||e.spec.definingForContent}function mp(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(mp(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Tc.empty,!0))}return e}function gp(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class yp extends $u{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bu.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Bu.fromReplace(e,this.pos,this.pos+1,new _c(Tc.from(r),0,t.isLeaf?0:1))}getMap(){return Lu.empty}invert(e){return new yp(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new yp(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new yp(t.pos,t.attr,t.value)}}$u.jsonID("attr",yp);class vp extends $u{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Bu.ok(n)}getMap(){return Lu.empty}invert(e){return new vp(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new vp(t.attr,t.value)}}$u.jsonID("docAttr",vp);let bp=class extends Error{};bp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(bp.prototype=Object.create(Error.prototype)).constructor=bp,bp.prototype.name="TransformError";class Ep{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new zu}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new bp(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,o,i)=>{e=Math.min(e,o),t=Math.max(t,i)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=_c.empty){let r=sp(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new _c(Tc.from(n),0,0))}delete(e,t){return this.replace(e,t,_c.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(lp(o,i,r))return e.step(new Gu(t,n,r));let s=gp(o,i);0==s[s.length-1]&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?l=e:o.before(e)==t&&s.splice(1,0,-e)}let a=s.indexOf(l),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=c[e],n=fp(t.type);if(n&&!t.sameMarkup(o.node(Math.abs(l)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let l=(t+u+1)%(r.openStart+1),p=c[l];if(p)for(let t=0;t<s.length;t++){let c=s[(t+a)%s.length],u=!0;c<0&&(u=!1,c=-c);let d=o.node(c-1),h=o.index(c-1);if(d.canReplaceWith(h,h,p.type,p.marks))return e.replace(o.before(c),u?i.after(c):n,new _c(mp(r.content,0,r.openStart,l),l,r.openEnd))}}let p=e.steps.length;for(let l=s.length-1;l>=0&&(e.replace(t,n,r),!(e.steps.length>p));l--){let e=s[l];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new _c(Tc.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=gp(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),l=o.after(i+1),a=s,c=l,u=Tc.empty,p=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=Tc.from(r.node(e).copy(u)),p++):a--;let d=Tc.empty,h=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,d=Tc.from(o.node(e).copy(d)),h++):c++;e.step(new Ku(a,c,s,l,new _c(u.append(d),p,h),u.size-p,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-n),s=i.node().type;if(o&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(o);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);tp(e,r.node(),r.before(),l)}s.inlineContent&&Ju(e,t+n-1,s,i.node().contentMatchAt(i.index()),null==r);let a=e.mapping.slice(l),c=a.map(t-n);if(e.step(new Gu(c,a.map(t+n,-1),_c.empty,!0)),!0===r){let t=e.doc.resolve(c);ep(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Tc.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Tc.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new Ku(o,i,o,i,new _c(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let s="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(r,s)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){let o=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&tp(e,t,n,i),Ju(e,e.mapping.slice(i).map(n,1),r,void 0,null===o);let l=e.mapping.slice(i),a=l.map(n,1),c=l.map(n+t.nodeSize,1);return e.step(new Ku(a,c,a+1,c-1,new _c(Tc.from(r.create(s,null,t.marks)),0,0),1,!0)),!0===o&&ep(e,t,n,i),!1}})}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ku(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new _c(Tc.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new yp(e,t,n)),this}setDocAttribute(e,t){return this.step(new vp(e,t)),this}addNodeMark(e,t){return this.step(new Hu(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Pc)t.isInSet(n.marks)&&this.step(new Wu(e,t));else{let r,o=n.marks,i=[];for(;r=t.isInSet(o);)i.push(new Wu(e,r)),o=r.removeFromSet(o);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=Tc.empty,s=Tc.empty;for(let e=o.depth,t=o.depth-n,l=n-1;e>t;e--,l--){i=Tc.from(o.node(e).copy(i));let t=r&&r[l];s=Tc.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new Gu(t,t,new _c(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],l=[];e.doc.nodesBetween(t,n,(e,a,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(a,t),p=Math.min(a+e.nodeSize,n),d=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(d)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=p:s.push(o=new Vu(c,p,u[e])));i&&i.to==c?i.to=p:l.push(i=new Uu(c,p,r))}}),s.forEach(t=>e.step(t)),l.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(e,s)=>{if(!e.isInline)return;i++;let l=null;if(r instanceof fu){let t,n=e.marks;for(;t=r.isInSet(n);)(l||(l=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(l=[r]):l=e.marks;if(l&&l.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<l.length;e++){let n,a=l[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&a.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:a,from:Math.max(s,t),to:r,step:i})}}}),o.forEach(t=>e.step(new Vu(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return Ju(this,e,t,n),this}}const wp=Object.create(null);class xp{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new kp(e.min(t),e.max(t))]}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 t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=_c.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:l,$to:a}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(a.pos),s?_c.empty:t),0==s&&Np(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],l=e.mapping.slice(n),a=l.map(i.pos),c=l.map(s.pos);o?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),Np(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Tp(e):_p(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?_p(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):_p(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Pp(e.node(0))}static atStart(e){return _p(e,e,0,0,1)||new Pp(e)}static atEnd(e){return _p(e,e,e.content.size,e.childCount,-1)||new Pp(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=wp[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in wp)throw new RangeError("Duplicate use of selection JSON ID "+e);return wp[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Tp.between(this.$anchor,this.$head).getBookmark()}}xp.prototype.visible=!0;class kp{constructor(e,t){this.$from=e,this.$to=t}}let Sp=!1;function Cp(e){Sp||e.parent.inlineContent||(Sp=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Tp extends xp{constructor(e,t=e){Cp(e),Cp(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return xp.near(n);let r=e.resolve(t.map(this.anchor));return new Tp(r.parent.inlineContent?r:n,n)}replace(e,t=_c.empty){if(super.replace(e,t),t==_c.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Tp&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Op(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Tp(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=xp.findFrom(t,n,!0)||xp.findFrom(t,-n,!0);if(!e)return xp.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(xp.findFrom(e,-n,!0)||xp.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new Tp(e,t)}}xp.jsonID("text",Tp);class Op{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Op(e.map(this.anchor),e.map(this.head))}resolve(e){return Tp.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ap extends xp{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?xp.near(o):new Ap(o)}content(){return new _c(Tc.from(this.node),0,0)}eq(e){return e instanceof Ap&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Mp(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ap(e.resolve(t.anchor))}static create(e,t){return new Ap(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Ap.prototype.visible=!1,xp.jsonID("node",Ap);class Mp{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Op(n,n):new Mp(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Ap.isSelectable(n)?new Ap(t):xp.near(t)}}class Pp extends xp{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=_c.empty){if(t==_c.empty){e.delete(0,e.doc.content.size);let t=xp.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Pp(e)}map(e){return new Pp(e)}eq(e){return e instanceof Pp}getBookmark(){return Ip}}xp.jsonID("all",Pp);const Ip={map(){return this},resolve(e){return new Pp(e)}};function _p(e,t,n,r,o,i=!1){if(t.inlineContent)return Tp.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&Ap.isSelectable(r))return Ap.create(e,n-(o<0?r.nodeSize:0))}else{let t=_p(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function Np(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof Gu||i instanceof Ku)&&(e.mapping.maps[r].forEach((e,t,n,r)=>{null==o&&(o=r)}),e.setSelection(xp.near(e.doc.resolve(o),n)))}class Rp extends Ep{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=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Pc.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(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Pc.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(xp.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Dp(e,t){return t&&e?e.bind(t):e}class Lp{constructor(e,t,n){this.name=e,this.init=Dp(t.init,n),this.apply=Dp(t.apply,n)}}const zp=[new Lp("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Lp("selection",{init(e,t){return e.selection||xp.atStart(t.doc)},apply(e){return e.selection}}),new Lp("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Lp("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class jp{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=zp.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Lp(e.key,e.spec.state,e))})}}class $p{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,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let l=r?r[i].n:0,a=r?r[i].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new $p(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new Rp(this)}static create(e){let t=new jp(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new $p(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new jp(this.schema,e.plugins),n=t.fields,r=new $p(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new jp(e.schema,e.plugins),o=new $p(r);return r.fields.forEach(r=>{if("doc"==r.name)o.doc=Yc.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=xp.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=l.fromJSON.call(s,e,t[i],o))}o[r.name]=r.init(e,o)}}),o}}function Bp(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Bp(o,t,{})),n[r]=o}return n}class Fp{constructor(e){this.spec=e,this.props={},e.props&&Bp(e.props,this,this.props),this.key=e.key?e.key.key:Vp("plugin")}getState(e){return e[this.key]}}const Up=Object.create(null);function Vp(e){return e in Up?e+"$"+ ++Up[e]:(Up[e]=0,e+"$")}class Hp{constructor(e="key"){this.key=Vp(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Wp=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Gp(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const Kp=(e,t,n)=>{let r=Gp(e,n);if(!r)return!1;let o=Xp(r);if(!o){let n=r.blockRange(),o=n&&Xu(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(ad(e,o,t,-1))return!0;if(0==r.parent.content.size&&(Jp(i,"end")||Ap.isSelectable(i)))for(let n=r.depth;;n--){let s=sp(e.doc,r.before(n),r.after(n),_c.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(Jp(i,"end")?xp.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):Ap.create(n.doc,o.pos-i.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),0))};function qp(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let i=t.nodeAfter,s=t.pos+1;for(;!i.isTextblock;s++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let l=sp(e.doc,o,s,_c.empty);if(!l||l.from!=o||l instanceof Gu&&l.slice.size>=s-o)return!1;if(n){let t=e.tr.step(l);t.setSelection(Tp.create(t.doc,o)),n(t.scrollIntoView())}return!0}function Jp(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const Yp=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=Xp(r)}let s=i&&i.nodeBefore;return!(!s||!Ap.isSelectable(s)||(t&&t(e.tr.setSelection(Ap.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),0))};function Xp(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Qp(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Zp=(e,t,n)=>{let r=Qp(e,n);if(!r)return!1;let o=td(r);if(!o)return!1;let i=o.nodeAfter;if(ad(e,o,t,1))return!0;if(0==r.parent.content.size&&(Jp(i,"start")||Ap.isSelectable(i))){let n=sp(e.doc,r.before(),r.after(),_c.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Jp(i,"start")?xp.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Ap.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1||(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),0))},ed=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=td(r)}let s=i&&i.nodeAfter;return!(!s||!Ap.isSelectable(s)||(t&&t(e.tr.setSelection(Ap.create(e.doc,i.pos)).scrollIntoView()),0))};function td(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const nd=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))};function rd(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const od=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=rd(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(xp.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},id=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof Pp||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=rd(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(Tp.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},sd=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(np(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Xu(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};var ld;function ad(e,t,n,r){let o,i,s=t.nodeBefore,l=t.nodeAfter,a=s.type.spec.isolating||l.type.spec.isolating;if(!a&&function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!rp(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!a&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(l.type))&&i.matchType(o[0]||l.type).validEnd){if(n){let r=t.pos+l.nodeSize,i=Tc.empty;for(let e=o.length-1;e>=0;e--)i=Tc.from(o[e].create(null,i));i=Tc.from(s.copy(i));let a=e.tr.step(new Ku(t.pos-1,r,t.pos,r,new _c(i,1,0),o.length,!0)),c=a.doc.resolve(r+2*o.length);c.nodeAfter&&c.nodeAfter.type==s.type&&rp(a.doc,c.pos)&&a.join(c.pos),n(a.scrollIntoView())}return!0}let u=l.type.spec.isolating||r>0&&a?null:xp.findFrom(t,1),p=u&&u.$from.blockRange(u.$to),d=p&&Xu(p);if(null!=d&&d>=t.depth)return n&&n(e.tr.lift(p,d).scrollIntoView()),!0;if(c&&Jp(l,"start",!0)&&Jp(s,"end")){let r=s,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=l,a=1;for(;!i.isTextblock;i=i.firstChild)a++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=Tc.empty;for(let e=o.length-1;e>=0;e--)r=Tc.from(o[e].copy(r));n(e.tr.step(new Ku(t.pos-o.length,t.pos+l.nodeSize,t.pos+a,t.pos+l.nodeSize-a,new _c(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function cd(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(Tp.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const ud=cd(-1),pd=cd(1);function dd(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,(r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}}function hd(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let fd=hd(Wp,Kp,Yp),md=hd(Wp,Zp,ed);const gd={Enter:hd(nd,id,sd,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Ap&&e.selection.node.isBlock)return!(!n.parentOffset||!np(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let o,i,s=[],l=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){l=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),i=rd(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));let t=ld;s.unshift(t||(l&&i?{type:i}:null)),o=e;break}if(1==e)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof Tp||e.selection instanceof Pp)&&c.deleteSelection();let u=c.mapping.map(n.pos),p=np(c.doc,u,s.length,s);if(p||(s[0]=i?{type:i}:null,p=np(c.doc,u,s.length,s)),!p)return!1;if(c.split(u,s.length,s),!l&&a&&n.node(o).type!=i){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);i&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,i)&&c.setNodeMarkup(c.mapping.map(n.before(o)),i)}return t&&t(c.scrollIntoView()),!0}),"Mod-Enter":od,Backspace:fd,"Mod-Backspace":fd,"Shift-Backspace":fd,Delete:md,"Mod-Delete":md,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Pp(e.doc))),!0)},yd={"Ctrl-h":gd.Backspace,"Alt-Backspace":gd["Mod-Backspace"],"Ctrl-d":gd.Delete,"Ctrl-Alt-Backspace":gd["Mod-Delete"],"Alt-Delete":gd["Mod-Delete"],"Alt-d":gd["Mod-Delete"],"Ctrl-a":ud,"Ctrl-e":pd};for(let e in gd)yd[e]=gd[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();const vd=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},bd=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Ed=null;const wd=function(e,t,n){let r=Ed||(Ed=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},xd=function(e,t,n,r){return n&&(Sd(e,t,n,r,-1)||Sd(e,t,n,r,1))},kd=/^(img|br|input|textarea|hr)$/i;function Sd(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Cd(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Td(e)||kd.test(e.nodeName)||"false"==e.contentEditable)return!1;t=vd(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(i=n.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;t+=o}else e=n,t=o<0?Cd(e):0}}}}function Cd(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Td(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Od=function(e){return e.focusNode&&xd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ad(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Md="undefined"!=typeof navigator?navigator:null,Pd="undefined"!=typeof document?document:null,Id=Md&&Md.userAgent||"",_d=/Edge\/(\d+)/.exec(Id),Nd=/MSIE \d/.exec(Id),Rd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Id),Dd=!!(Nd||Rd||_d),Ld=Nd?document.documentMode:Rd?+Rd[1]:_d?+_d[1]:0,zd=!Dd&&/gecko\/(\d+)/i.test(Id);zd&&(/Firefox\/(\d+)/.exec(Id)||[0,0])[1];const jd=!Dd&&/Chrome\/(\d+)/.exec(Id),$d=!!jd,Bd=jd?+jd[1]:0,Fd=!Dd&&!!Md&&/Apple Computer/.test(Md.vendor),Ud=Fd&&(/Mobile\/\w+/.test(Id)||!!Md&&Md.maxTouchPoints>2),Vd=Ud||!!Md&&/Mac/.test(Md.platform),Hd=!!Md&&/Win/.test(Md.platform),Wd=/Android \d/.test(Id),Gd=!!Pd&&"webkitFontSmoothing"in Pd.documentElement.style,Kd=Gd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function qd(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Jd(e,t){return"number"==typeof e?e:e[t]}function Yd(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Xd(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=bd(s);continue}let e=s,n=e==i.body,l=n?qd(i):Yd(e),a=0,c=0;if(t.top<l.top+Jd(r,"top")?c=-(l.top-t.top+Jd(o,"top")):t.bottom>l.bottom-Jd(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+Jd(o,"top")-l.top:t.bottom-l.bottom+Jd(o,"bottom")),t.left<l.left+Jd(r,"left")?a=-(l.left-t.left+Jd(o,"left")):t.right>l.right-Jd(r,"right")&&(a=t.right-l.right+Jd(o,"right")),a||c)if(n)i.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let u=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(u))break;s="absolute"==u?s.offsetParent:bd(s)}}function Qd(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=bd(r));return t}function Zd(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let eh=null;function th(e,t){let n,r,o,i,s=2e8,l=0,a=t.top,c=t.top;for(let u=e.firstChild,p=0;u;u=u.nextSibling,p++){let e;if(1==u.nodeType)e=u.getClientRects();else{if(3!=u.nodeType)continue;e=wd(u).getClientRects()}for(let d=0;d<e.length;d++){let h=e[d];if(h.top<=a&&h.bottom>=c){a=Math.max(h.bottom,a),c=Math.min(h.top,c);let e=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(e<s){n=u,s=e,r=e&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==u.nodeType&&e&&(l=p+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!o&&h.left<=t.left&&h.right>=t.left&&(o=u,i={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(l=p+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n,r=e.nodeValue.length,o=document.createRange();for(let i=0;i<r;i++){o.setEnd(e,i+1),o.setStart(e,i);let r=sh(o,1);if(r.top!=r.bottom&&nh(t,r)){n={node:e,offset:i+(t.left>=(r.left+r.right)/2?1:0)};break}}return o.detach(),n||{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:l}:th(n,r)}function nh(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function rh(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(nh(t,o))return rh(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function oh(e,t){let n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Cd(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Cd(r.startContainer),r.startOffset)}}}(r,t.left,t.top);i&&({node:n,offset:o}=i);let s,l=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){let n=e.dom.getBoundingClientRect();if(!nh(t,n))return null;if(l=rh(e.dom,t,n),!l)return null}if(Fd)for(let e=l;n&&e;e=bd(e))e.draggable&&(n=void 0);if(l=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),n){if(zd&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}let r;Gd&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t,s=e.docView.nearestDesc(n,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((t=s.dom.getBoundingClientRect()).width||t.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!i&&t.left>r.left||t.top>r.top?o=s.posBefore:(!i&&t.right<r.left||t.bottom<r.top)&&(o=s.posAfter),i=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2)?s.posBefore:s.posAfter;n=s.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=th(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,l,t));let a=e.docView.nearestDesc(l,!0);return{pos:s,inside:a?a.posAtStart-a.border:-1}}function ih(e){return e.top<e.bottom||e.left<e.right}function sh(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(ih(e))return e}return Array.prototype.find.call(n,ih)||e.getBoundingClientRect()}const lh=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ah(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=Gd||zd;if(3==r.nodeType){if(!s||!lh.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,ch(sh(wd(r,e,t),i),i<0)}{let e=sh(wd(r,o,o),n);if(zd&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=sh(wd(r,o-1,o-1),-1);if(t.top==e.top){let n=sh(wd(r,o,o+1),-1);if(n.top!=e.top)return ch(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==Cd(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return uh(e.getBoundingClientRect(),!1)}if(null==i&&o<Cd(r)){let e=r.childNodes[o];if(1==e.nodeType)return uh(e.getBoundingClientRect(),!0)}return uh(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==Cd(r))){let e=r.childNodes[o-1],t=3==e.nodeType?wd(e,Cd(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return ch(sh(t,1),!1)}if(null==i&&o<Cd(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?wd(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return ch(sh(t,-1),!0)}return ch(sh(3==r.nodeType?wd(r):r,-n),n>=0)}function ch(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function uh(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function ph(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const dh=/[\u0590-\u08ac]/;let hh=null,fh=null,mh=!1;class gh{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].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 t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=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,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>vd(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let o=this.children[n],i=t+o.size;if(i>e||o instanceof kh){r=e-t;break}t=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof yh&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?vd(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?vd(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],l=i+n.size;if(-1==r&&e<=l){let o=i+n.border;if(e>=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=vd(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=vd(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],c=l+a.size;if(o>l&&i<c)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=c}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),c=n.domSelectionRange(),u=!1;if((zd||Fd)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(u=!(!t||"\n"!=e.nodeValue[t-1]),u&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=l={node:t.parentNode,offset:vd(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(zd&&c.focusNode&&c.focusNode!=l.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&Fd)&&xd(s.node,s.offset,c.anchorNode,c.anchorOffset)&&xd(l.node,l.offset,c.focusNode,c.focusOffset))return;let p=!1;if((a.extend||e==t)&&(!u||!zd)){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),p=!0}catch(e){}}if(!p){if(e>t){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class yh extends gh{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class vh extends gh{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class bh extends gh{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=Ou.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new bh(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=bh.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=Lh(o,t,i,n)),e>0&&(o=Lh(o,0,e,n));for(let e=0;e<o.length;e++)o[e].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 Eh extends gh{constructor(e,t,n,r,o,i,s,l,a){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,o,i){let s,l=o.nodeViews[t.type.name],a=l&&l(t,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i,n,r),c=a&&a.dom,u=a&&a.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=Ou.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:u}=e)}u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let p=c;return c=Ih(c,n,t),a?s=new Sh(e,t,n,r,c,u||null,p,a,o,i+1):t.isText?new xh(e,t,n,r,c,p,o):new Eh(e,t,n,r,c,u||null,p,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Tc.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&_h(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new Rh(this,i&&i.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let u,p,d,h;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(u?(p||(p=[u])).push(e):u=e)}if(u)if(p){p.sort(Dh);for(let e=0;e<p.length;e++)n(p[e],c,!!a)}else n(u,c,!!a);if(a)h=-1,d=a,a=null;else{if(!(c<e.childCount))break;h=c,d=e.child(c++)}for(let e=0;e<l.length;e++)l[e].to<=i&&l.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let f=i+d.nodeSize;if(d.isText){let e=f;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=d.cut(e-i),d=d.cut(0,e-i),f=e,h=-1)}else for(;s<o.length&&o[s].to<f;)s++;r(d,d.isInline&&!d.isLeaf?l.filter(e=>!e.inline):l.slice(),t.forChild(i,d),h),i=f}}(this.node,this.innerDeco,(t,o,i)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e,o):t.type.side>=0&&!i&&l.syncToMarks(o==this.node.childCount?Pc.none:this.node.child(o).marks,n,e,o),l.placeWidget(t,e,r)},(t,i,a,c)=>{let u;l.syncToMarks(t.marks,n,e,c),l.findNodeMatch(t,i,a,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(t,i,a,u,e)||l.updateNextNode(t,i,a,e,c,r)||l.addNode(t,i,a,e,r),r+=t.nodeSize}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),Ch(this.contentDOM,this.children,e),Ud&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Tp)||n<t||r>t+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 e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;a+=t.text}if(i>=n){if(i>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;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 i=new vh(this,o,t,r);e.input.compositionNodes.push(i),this.children=Lh(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(_h(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Mh(this.dom,this.nodeDOM,Ah(this.outerDeco,this.node,t),Ah(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function wh(e,t,n,r,o){Ih(r,t,e);let i=new Eh(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class xh extends Eh{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&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=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new xh(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class kh extends gh{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Sh extends Eh{constructor(e,t,n,r,o,i,s,l,a,c){super(e,t,n,r,o,i,s,a,c),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Ch(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],l=s.dom;if(l.parentNode==e){for(;l!=r;)r=Nh(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(l,r);if(s instanceof bh){let t=r?r.previousSibling:e.lastChild;Ch(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Nh(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Th=function(e){e&&(this.nodeName=e)};Th.prototype=Object.create(null);const Oh=[new Th];function Ah(e,t,n){if(0==e.length)return Oh;let r=n?Oh[0]:new Th,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new Th(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new Th(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function Mh(e,t,n,r){if(n==Oh&&r==Oh)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=Oh[0]),o=t}Ph(o,s||Oh[0],i)}return o}function Ph(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Ih(e,t,n){return Mh(e,e,Oh,Ah(t,n,1!=e.nodeType))}function _h(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Nh(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Rh{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let l;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof bh)){l=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=e.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){o=t;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let r=bh.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof Eh){let a=this.preMatch.matched.get(l);if(null!=a&&a!=o)return!1;let c,u=l.dom,p=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&_h(t,l.outerDeco));if(!p&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(c=this.recreateWrapper(l,e,t,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!_h(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=Eh.create(this.top,t,n,r,o,i);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,o){let i=Eh.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){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){let r=new yh(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof bh;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof xh)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Fd||$d)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new kh(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function Dh(e,t){return e.type.side-t.type.side}function Lh(e,t,n,r,o){let i=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,u=l+=a.size;c>=n||u<=t?i.push(a):(c<t&&i.push(a.slice(0,t-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function zh(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l,a,c=r.resolve(s);if(Od(n)){for(l=s;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Ap.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==Cd(e);r||o;){if(e==n)return!0;let t=vd(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==Cd(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;a=new Ap(s==e?c:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[l,s]=o==e.state.selection.anchor?[o,t]:[t,o],c=r.resolve(s)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);return a||(a=Gh(e,u,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)),a}function jh(e){return e.editable?e.hasFocus():qh(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function $h(e,t=!1){let n=e.state.selection;if(Hh(e,n),jh(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&$d){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&xd(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,vd(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Dd&&Ld<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let r,o,{anchor:i,head:s}=n;!Bh||n instanceof Tp||(n.$from.parent.inlineContent||(r=Fh(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Fh(e,n.to))),e.docView.setSelection(i,s,e,t),Bh&&(r&&Vh(r),o&&Vh(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{jh(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Bh=Fd||$d&&Bd<63;function Fh(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Fd&&o&&"false"==o.contentEditable)return Uh(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return Uh(o);if(i)return Uh(i)}}function Uh(e){return e.contentEditable="true",Fd&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Vh(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Hh(e,t){if(t instanceof Ap){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Wh(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Wh(e)}function Wh(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Gh(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||Tp.between(t,n,r)}function Kh(e){return!(e.editable&&!e.hasFocus())&&qh(e)}function qh(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Jh(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&xp.findFrom(i,t)}function Yh(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Xh(e,t,n){let r=e.state.selection;if(!(r instanceof Tp)){if(r instanceof Ap&&r.node.isInline)return Yh(e,new Tp(t>0?r.$to:r.$from));{let n=Jh(e.state,t);return!!n&&Yh(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return Yh(e,new Tp(r.$anchor,i))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Jh(e.state,t);return!!(n&&n instanceof Ap)&&Yh(e,n)}if(!(Vd&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Ap.isSelectable(i)?Yh(e,new Ap(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!Gd&&Yh(e,new Tp(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function Qh(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Zh(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function ef(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(zd&&1==n.nodeType&&r<Qh(n)&&Zh(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Zh(e,-1))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(tf(n))break;{let t=n.previousSibling;for(;t&&Zh(t,-1);)o=n.parentNode,i=vd(t),t=t.previousSibling;if(t)n=t,r=Qh(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?nf(e,n,r):o&&nf(e,o,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=Qh(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Zh(n.childNodes[r],1))break;o=n,i=++r}else{if(tf(n))break;{let t=n.nextSibling;for(;t&&Zh(t,1);)o=t.parentNode,i=vd(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=Qh(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&nf(e,o,i)}(e)}function tf(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function nf(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Td(e);)t=vd(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Td(e);)t=vd(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Od(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&$h(e)},50)}function rf(e,t){let n=e.state.doc.resolve(t);if(!$d&&!Hd&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function of(e,t,n){let r=e.state.selection;if(r instanceof Tp&&!r.empty||n.indexOf("s")>-1)return!1;if(Vd&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Jh(e.state,t);if(n&&n instanceof Ap)return Yh(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof Pp?xp.near(n,t):xp.findFrom(n,t);return!!s&&Yh(e,s)}return!1}function sf(e,t){if(!(e.state.selection instanceof Tp))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function lf(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function af(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Ou.fromSchema(e.state.schema),l=vf(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c,u=a.firstChild,p=0;for(;u&&1==u.nodeType&&(c=gf[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),p++}u=a.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${o} ${i}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function cf(e,t,n,r,o){let i,s,l=o.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(r||l||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,l||r,e)}),l)return s=new _c(Tc.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let n=e.someProp("clipboardTextParser",n=>n(t,o,r,e));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=Ou.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=vf().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);if((n=o&&gf[o[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join("")),r.innerHTML=function(e){let t=window.trustedTypes;return t?(bf||(bf=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),bf.createHTML(e)):e}(e),n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),Gd&&function(e){let t=e.querySelectorAll($d?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0;e--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||yu.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!a&&!u),context:o,ruleFromNode(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||uf.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(u)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:i,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=Tc.from(t.create(n[e+1],o)),i++,s++}return new _c(o,i,s)}(mf(s,+u[1],+u[2]),u[4]);else if(s=_c.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach(e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&df(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=hf(i[i.length-1],r.length));let t=pf(e,n);i.push(t),o=o.matchType(t.type),r=n}}),i)return Tc.from(i)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=mf(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,a)}),s}const uf=/^(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 pf(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Tc.from(e));return e}function df(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=df(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(Tc.from(pf(n,e,o+1))))}}function hf(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,hf(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Tc.empty,!0);return e.copy(n.append(r))}function ff(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,l=s.content;return e.childCount>1&&(i=0),o<r-1&&(l=ff(l,t,n,r,o+1,i)),o>=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(Tc.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function mf(e,t,n){return t<e.openStart&&(e=new _c(ff(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new _c(ff(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const gf={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 yf=null;function vf(){return yf||(yf=document.implementation.createHTMLDocument("title"))}let bf=null;const Ef={},wf={},xf={touchstart:!0,touchmove:!0};class kf{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Sf(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Cf(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Tf(e,t))})}function Tf(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function Of(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Af(e){return{left:e.clientX,top:e.clientY}}function Mf(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)))return!0;return!1}function Pf(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function If(e,t,n,r){return Mf(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}function _f(e,t,n,r){return Mf(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Pf(e,Tp.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(n.inlineContent)Pf(e,Tp.create(r,i+1,i+1+n.content.size),"pointer");else{if(!Ap.isSelectable(n))continue;Pf(e,Ap.create(r,i),"pointer")}return!0}}(e,n,r)}function Nf(e){return Bf(e)}wf.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Lf(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!Wd||!$d||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Ud||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||function(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Vd&&72==n&&"c"==r)return sf(e,-1)||ef(e,-1);if(46==n&&!t.shiftKey||Vd&&68==n&&"c"==r)return sf(e,1)||ef(e,1);if(13==n||27==n)return!0;if(37==n||Vd&&66==n&&"c"==r){let t=37==n?"ltr"==rf(e,e.state.selection.from)?-1:1:-1;return Xh(e,t,r)||ef(e,t)}if(39==n||Vd&&70==n&&"c"==r){let t=39==n?"ltr"==rf(e,e.state.selection.from)?1:-1:1;return Xh(e,t,r)||ef(e,t)}return 38==n||Vd&&80==n&&"c"==r?of(e,-1,r)||ef(e,-1):40==n||Vd&&78==n&&"c"==r?function(e){if(!Fd||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;lf(e,n,"true"),setTimeout(()=>lf(e,n,"false"),20)}return!1}(e)||of(e,1,r)||ef(e,1):r==(Vd?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():Sf(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,Ad(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},wf.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},wf.keypress=(e,t)=>{let n=t;if(Lf(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Vd&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Tp&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,r.$from.pos,r.$to.pos,t,o))||e.dispatch(o()),n.preventDefault()}};const Rf=Vd?"metaKey":"ctrlKey";Ef.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Nf(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Rf]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=e.posAtCoords(Af(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Df(e,s,n,!!r)):("doubleClick"==i?If:_f)(e,s.pos,s.inside,n)?n.preventDefault():Sf(e,"pointer"))};class Df{constructor(e,t,n,r){let o,i;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Rf],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.nodeDOM.nodeType?l.nodeDOM:null;let{selection:a}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||a instanceof Ap&&a.from<=i&&a.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!zd||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)),Sf(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(()=>$h(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Af(e))),this.updateAllowDefault(e),this.allowDefault||!t?Sf(this.view,"pointer"):function(e,t,n,r,o){return Mf(e,"handleClickOn",t,n,r)||e.someProp("handleClick",n=>n(e,t,r))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof Ap&&(n=o.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(Ap.isSelectable(t)){r=n&&o.$from.depth>0&&e>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(e);break}}return null!=r&&(Pf(e,Ap.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Ap.isSelectable(r))&&(Pf(e,new Ap(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Fd&&this.mightDrag&&!this.mightDrag.node.isAtom||$d&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Pf(this.view,xp.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Sf(this.view,"pointer")}move(e){this.updateAllowDefault(e),Sf(this.view,"pointer"),0==e.buttons&&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)}}function Lf(e,t){return!!e.composing||!!(Fd&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Ef.touchstart=e=>{e.input.lastTouch=Date.now(),Nf(e),Sf(e,"pointer")},Ef.touchmove=e=>{e.input.lastTouch=Date.now(),Sf(e,"pointer")},Ef.contextmenu=e=>Nf(e);const zf=Wd?5e3:-1;function jf(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Bf(e),t))}function $f(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Bf(e,t=!1){if(!(Wd&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),$f(e),t||e.docView&&e.docView.dirty){let n=zh(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}wf.compositionstart=wf.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Tp&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||$d&&Hd&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),Bf(e,!0),e.markCursor=null;else if(Bf(e,!t.selection.empty),zd&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}jf(e,zf)},wf.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,jf(e,20))};const Ff=Dd&&Ld<15||Ud&&Kd<604;function Uf(e,t,n,r,o){let i=cf(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,i||_c.empty)))return!0;if(!i)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Vf(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ef.copy=wf.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=Ff?null:n.clipboardData,s=r.content(),{dom:l,text:a}=af(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,l),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},wf.paste=(e,t)=>{let n=t;if(e.composing&&!Wd)return;let r=Ff?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Uf(e,Vf(r),r.getData("text/html"),o,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Uf(e,r.value,null,o,t):Uf(e,r.textContent,r.innerHTML,o,t)},50)}(e,n)};class Hf{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Wf=Vd?"altKey":"ctrlKey";function Gf(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[Wf]}Ef.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=e.state.selection,s=i.empty?null:e.posAtCoords(Af(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof Ap?i.to-1:i.to));else if(r&&r.mightDrag)o=Ap.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Ap.create(e.state.doc,t.posBefore))}let l=(o||e.state.selection).content(),{dom:a,text:c,slice:u}=af(e,l);(!n.dataTransfer.files.length||!$d||Bd>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Ff?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Ff||n.dataTransfer.setData("text/plain",c),e.dragging=new Hf(u,Gf(e,n),o)},Ef.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},wf.dragover=wf.dragenter=(e,t)=>t.preventDefault(),wf.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Af(t));if(!r)return;let o=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",t=>{i=t(i,e,!1)}):i=cf(e,Vf(t.dataTransfer),Ff?null:t.dataTransfer.getData("text/html"),!1,o);let s=!(!n||!Gf(e,t));if(e.someProp("handleDrop",n=>n(e,t,i||_c.empty,s)))return void t.preventDefault();if(!i)return;t.preventDefault();let l=i?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+(n>0?1:0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);l=e&&s.canReplaceWith(i,i,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}(e.state.doc,o.pos,i):o.pos;null==l&&(l=o.pos);let a=e.state.tr;if(s){let{node:e}=n;e?e.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,p=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(p))return;let d=a.doc.resolve(c);if(u&&Ap.isSelectable(i.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new Ap(d));else{let t=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),a.setSelection(Gh(e,d,a.doc.resolve(t)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},Ef.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&$h(e)},20))},Ef.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Ef.beforeinput=(e,t)=>{if($d&&Wd&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,Ad(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in wf)Ef[e]=wf[e];function Kf(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class qf{constructor(e,t){this.toDOM=e,this.spec=t||Zf,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new Xf(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof qf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Kf(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Jf{constructor(e,t){this.attrs=e,this.spec=t||Zf}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Xf(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Jf&&Kf(this.attrs,e.attrs)&&Kf(this.spec,e.spec)}static is(e){return e.type instanceof Jf}destroy(){}}class Yf{constructor(e,t){this.attrs=e,this.spec=t||Zf}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new Xf(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof Yf&&Kf(this.attrs,e.attrs)&&Kf(this.spec,e.spec)}destroy(){}}class Xf{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Xf(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Xf(e,e,new qf(t,n))}static inline(e,t,n,r){return new Xf(e,t,new Jf(n,r))}static node(e,t,n,r){return new Xf(e,t,new Yf(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Jf}get widget(){return this.type instanceof qf}}const Qf=[],Zf={};class em{constructor(e,t){this.local=e.length?e:Qf,this.children=t.length?t:Qf}static create(e,t){return t.length?sm(t,e,0,Zf):tm}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==tm||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Zf)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(i||(i=[])).push(l):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let l=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,o,i)=>{let s=i-o-(n-e);for(let o=0;o<l.length;o+=3){let i=l[o+1];if(i<0||e>i+t-r)continue;let a=l[o]+t-r;n>=a?l[o+1]=e<=a?-2:-1:e>=t&&s&&(l[o]+=s,l[o+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let c=n.map(e[t]+i),u=c-o;if(u<0||u>=r.content.size){a=!0;continue}let p=n.map(e[t+1]+i,-1)-o,{index:d,offset:h}=r.content.findIndex(u),f=r.maybeChild(d);if(f&&h==u&&h+f.nodeSize==p){let r=l[t+2].mapInner(n,f,c+1,e[t]+i+1,s);r!=tm?(l[t]=u,l[t+1]=p,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=function(e,t,n,r,o,i,s){function l(e,t){for(let i=0;i<e.local.length;i++){let l=e.local[i].map(r,o,t);l?n.push(l):s.onRemove&&s.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&l(e[n+2],t[n]+i+1);return n}(l,e,t,n,o,i,s),c=sm(a,r,0,s);t=c.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new em(t.sort(lm),l)}(this.children,i||[],e,t,n,r,o):i?new em(i.sort(lm),Qf):tm}add(e,t){return t.length?this==tm?em.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach((e,i)=>{let s,l=i+n;if(s=om(t,e,l)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,l+1):r.splice(o,0,i,i+e.nodeSize,sm(s,e,l+1,Zf)),o+=3}});let i=rm(o?im(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new em(i.length?this.local.concat(i).sort(lm):this.local,r||this.children)}remove(e){return 0==e.length||this==tm?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(o,i+1);l!=tm?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new em(r,n):tm}forChild(e,t){if(this==tm)return this;if(t.isLeaf)return em.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof Jf){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new em(r.sort(lm),Qf);return n?new nm([e,n]):e}return n||tm}eq(e){if(this==e)return!0;if(!(e instanceof em)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return am(this.localsInner(e))}localsInner(e){if(this==tm)return Qf;if(e.inlineContent||!this.local.some(Jf.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Jf||t.push(this.local[e]);return t}forEachSet(e){e(this)}}em.empty=new em([],[]),em.removeOverlap=am;const tm=em.empty;class nm{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Zf));return nm.from(n)}forChild(e,t){if(t.isLeaf)return em.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=tm&&(o instanceof nm?n=n.concat(o.members):n.push(o))}return nm.from(n)}eq(e){if(!(e instanceof nm)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?am(n?t:t.sort(lm)):Qf}static from(e){switch(e.length){case 0:return tm;case 1:return e[0];default:return new nm(e.every(e=>e instanceof em)?e:e.reduce((e,t)=>e.concat(t instanceof em?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function rm(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new Xf(o.from+t,o.to+t,o.type))}return n}function om(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function im(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function sm(e,t,n,r){let o=[],i=!1;t.forEach((t,s)=>{let l=om(e,t,s+n);if(l){i=!0;let e=sm(l,t,n+s+1,r);e!=tm&&o.push(s,s+t.nodeSize,e)}});let s=rm(i?im(e):e,-n).sort(lm);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new em(s,o):tm}function lm(e,t){return e.from-t.from||e.to-t.to}function am(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),cm(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),cm(t,o+1,i.copy(r.to,i.to)))}}return t}function cm(e,t,n){for(;t<e.length&&lm(n,e[t])>0;)t++;e.splice(t,0,n)}function um(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=tm&&t.push(r)}),e.cursorWrapper&&t.push(em.create(e.state.doc,[e.cursorWrapper.deco])),nm.from(t)}const pm={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dm=Dd&&Ld<=11;class hm{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 fm{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new hm,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Dd&&Ld<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Fd&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),dm&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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,pm)),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 t=0;t<e.length;t++)this.queue.push(e[t]);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(Kh(this.view)){if(this.suppressingSelectionUpdates)return $h(this.view);if(Dd&&Ld<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xd(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 t,n=new Set;for(let t=e.focusNode;t;t=bd(t))n.add(t);for(let r=e.anchorNode;r;r=bd(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 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 t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Kh(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,s=!1,l=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],l);n&&(o=o<0?n.from:Math.min(n.from,o),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(s=!0))}if(!l.some(e=>"BR"==e.nodeName)||8!=e.input.lastKeyCode&&46!=e.input.lastKeyCode){if(zd&&l.length){let t=l.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&vm(e,n)==t||r.remove()}}}}else for(let e of l)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&e.parentNode.removeChild(e)}let a=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Od(n)&&(a=zh(e))&&a.eq(xp.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,$h(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(!mm.has(e)&&(mm.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=zd,gm)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."),gm=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let i of t)if("TR"==(null===(n=i.parentNode)||void 0===n?void 0:n.nodeName)){let t=i.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(i,n.firstChild),r==i&&e.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}(e,l)),this.handleDOMChange(o,i,s,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||$h(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(Dd&&Ld<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?vd(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?vd(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let mm=new WeakMap,gm=!1;function ym(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return xd(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function vm(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function bm(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Fd&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Fd&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Em=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function wm(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Gh(e,t.resolve(n.anchor),t.resolve(n.head))}function xm(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function km(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Sm{constructor(e,t){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 kf,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Mm),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Om(this),Tm(this),this.nodeViews=Am(this),this.docView=wh(this.state.doc,Cm(this),um(this),this.dom,this),this.domObserver=new fm(this,(e,t,n,r)=>function(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=zh(e,t);if(n&&!e.state.selection.eq(n)){if($d&&Wd&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,Ad(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),i&&r.setMeta("composition",i),e.dispatch(r)}return}let s=e.state.doc.resolve(t),l=s.sharedDepth(n);t=s.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a,c,u=e.state.selection,p=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],Od(c)||r.push({node:c.focusNode,offset:c.focusOffset})),$d&&8===e.input.lastKeyCode)for(let e=s;e>i;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let p=e.state.doc,d=e.someProp("domParser")||yu.fromSchema(e.state.schema),h=p.resolve(l),f=null,m=d.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:bm,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,n),d=e.state.doc,h=d.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,c="end"):(a=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o&&(r-=s+Math.max(0,i-Math.min(s,l))-i),s<i&&e.size<t.size){let e=r<=i&&r>=s?i-r:0;i-=e,i&&i<t.size&&km(t.textBetween(i-1,i+1))&&(i+=e?1:-1),l=i+(l-s),s=i}else if(l<i){let t=r<=i&&r>=l?i-r:0;i-=t,i&&i<e.size&&km(e.textBetween(i-1,i+1))&&(i+=t?1:-1),s=i+(s-l),l=i}return{start:i,endA:s,endB:l}}(h.content,p.doc.content,p.from,a,c);if(f&&e.input.domChangeCount++,(Ud&&e.input.lastIOSEnter>Date.now()-225||Wd)&&o.some(e=>1==e.nodeType&&!Em.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,Ad(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&u instanceof Tp&&!u.empty&&u.$head.sameParent(u.$anchor))||e.composing||p.sel&&p.sel.anchor!=p.sel.head){if(p.sel){let t=wm(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}f={start:u.from,endA:u.to,endB:u.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Tp&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),Dd&&Ld<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>p.from&&" "==p.doc.textBetween(f.start-p.from-1,f.start-p.from+1)&&(f.start--,f.endA--,f.endB--);let m=p.doc.resolveNoCache(f.start-p.from),g=p.doc.resolveNoCache(f.endB-p.from),y=d.resolve(f.start),v=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Ud&&e.input.lastIOSEnter>Date.now()-225&&(!v||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!v&&m.pos<p.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(p.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,Ad(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||xm(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(xm(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||xm(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(d,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",t=>t(e,Ad(8,"Backspace"))))return void(Wd&&$d&&e.domObserver.suppressSelectionUpdates());$d&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),Wd&&!v&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==f.endA&&(f.endB-=2,g=p.doc.resolveNoCache(f.endB-p.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,Ad(13,"Enter"))})},20));let b,E=f.start,w=f.endA,x=t=>{let n=t||e.state.tr.replace(E,w,p.doc.slice(f.start-p.from,f.endB-p.from));if(p.sel){let t=wm(e,n.doc,p.sel);t&&!($d&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==E||t.head==n.mapping.map(w)-1)||Dd&&t.empty&&t.head==E)&&n.setSelection(t)}return i&&n.setMeta("composition",i),n.scrollIntoView()};if(v)if(m.pos==g.pos){Dd&&Ld<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>$h(e),20));let t=x(e.state.tr.delete(E,w)),n=d.resolve(f.start).marksAcross(d.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(b=function(e,t){let n,r,o,i=e.firstChild.marks,s=t.firstChild.marks,l=i,a=s;for(let e=0;e<s.length;e++)l=s[e].removeFromSet(l);for(let e=0;e<i.length;e++)a=i[e].removeFromSet(a);if(1==l.length&&0==a.length)r=l[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=l.length||1!=a.length)return null;r=a[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(o(t.child(e)));if(Tc.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let t=x(e.state.tr);"add"==b.type?t.addMark(E,w,b.mark):t.removeMark(E,w,b.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,E,w));e.someProp("handleTextInput",r=>r(e,E,w,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in Ef){let n=Ef[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Of(e,t)||Tf(e,t)||!e.editable&&t.type in wf||n(e,t)},xf[t]?{passive:!0}:void 0)}Fd&&e.dom.addEventListener("input",()=>null),Cf(e)}(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 t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Cf(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Mm),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&($f(this),i=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Am(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Cf(this),this.editable=Om(this),Tm(this);let l=um(this),a=Cm(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",u=o||!this.docView.matchesNode(e.doc,a,l);!u&&e.selection.eq(r.selection)||(i=!0);let p="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:Qd(e.dom)}}(this);if(i){this.domObserver.stop();let t=u&&(Dd||$d)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(u){let n=$d?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=Cd(e=e.childNodes[t-1])}else{if(!e.parentNode||Td(e))return null;t=vd(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||Td(e))return null;t=vd(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}(this)),!o&&this.docView.update(e.doc,a,l,this)||(this.docView.updateOuterDeco(a),this.docView.destroy(),this.docView=wh(e.doc,a,l,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return xd(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?$h(this,t):(Hh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Zd(n,0==r?0:r-t)}(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof Ap){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&Xd(this,t.getBoundingClientRect(),e)}else Xd(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)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Hf(e.slice,e.move,r<0?void 0:Ap.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){if(Dd){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("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(eh)return e.focus(eh);let t=Qd(e);e.focus(null==eh?{get preventScroll(){return eh={preventScroll:!0},!0}}:void 0),eh||(eh=!1,Zd(t,0))}(this.dom),$h(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}updateRoot(){this._root=null}posAtCoords(e){return oh(this,e)}coordsAtPos(e,t=1){return ah(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){return hh==t&&fh==n?mh:(hh=t,fh=n,mh="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return ph(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=ah(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=wd(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=e.domSelection();return l?dh.test(r.parent.textContent)&&l.modify?ph(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:p}=e.domSelectionRange(),d=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&o==p;try{l.collapse(i,s),t&&(t!=i||o!=s)&&l.extend&&l.extend(t,o)}catch(e){}return null!=a&&(l.caretBidiLevel=a),d}):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return Uf(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Uf(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return af(this,e)}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],um(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Ed=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Tf(e,t)||!Ef[t.type]||!e.editable&&t.type in wf||Ef[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Fd&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ym(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?ym(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Cm(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[Xf.node(0,e.state.doc.content.size,t)]}function Tm(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Xf.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Om(e){return!e.someProp("editable",t=>!1===t(e.state))}function Am(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Mm(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Sm.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var Pm={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:"'"},Im={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},_m="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Nm="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Rm=0;Rm<10;Rm++)Pm[48+Rm]=Pm[96+Rm]=String(Rm);for(Rm=1;Rm<=24;Rm++)Pm[Rm+111]="F"+Rm;for(Rm=65;Rm<=90;Rm++)Pm[Rm]=String.fromCharCode(Rm+32),Im[Rm]=String.fromCharCode(Rm);for(var Dm in Pm)Im.hasOwnProperty(Dm)||(Im[Dm]=Pm[Dm]);const Lm="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),zm="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function jm(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);Lm?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function $m(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Bm(e){let t=function(e){let t=Object.create(null);for(let n in e)t[jm(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!(_m&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Nm&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Im:Pm)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=t[$m(o,n)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[$m(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(zm&&n.ctrlKey&&n.altKey)&&(r=Pm[n.keyCode])&&r!=o){let o=t[$m(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}var Fm=Object.defineProperty,Um=(e,t)=>{for(var n in t)Fm(e,n,{get:t[n],enumerable:!0})};function Vm(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var Hm=class{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:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],l=!!e,a=e||o.tr,c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{const r=this.buildProps(a,t),o=n(...e)(r);return s.push(o),c}])),run:()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(a),s.every(e=>!0===e))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:Vm({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},Wm={};Um(Wm,{blur:()=>Gm,clearContent:()=>Km,clearNodes:()=>qm,command:()=>Jm,createParagraphNear:()=>Ym,cut:()=>Xm,deleteCurrentNode:()=>Qm,deleteNode:()=>eg,deleteRange:()=>tg,deleteSelection:()=>ng,enter:()=>rg,exitCode:()=>og,extendMarkRange:()=>pg,first:()=>dg,focus:()=>vg,forEach:()=>bg,insertContent:()=>Eg,insertContentAt:()=>Sg,joinBackward:()=>Og,joinDown:()=>Tg,joinForward:()=>Ag,joinItemBackward:()=>Mg,joinItemForward:()=>Pg,joinTextblockBackward:()=>Ig,joinTextblockForward:()=>_g,joinUp:()=>Cg,keyboardShortcut:()=>Rg,lift:()=>Lg,liftEmptyBlock:()=>zg,liftListItem:()=>jg,newlineInCode:()=>$g,resetAttributes:()=>Ug,scrollIntoView:()=>Vg,selectAll:()=>Hg,selectNodeBackward:()=>Wg,selectNodeForward:()=>Gg,selectParentNode:()=>Kg,selectTextblockEnd:()=>qg,selectTextblockStart:()=>Jg,setContent:()=>Xg,setMark:()=>My,setMeta:()=>Py,setNode:()=>Iy,setNodeSelection:()=>_y,setTextDirection:()=>Ny,setTextSelection:()=>Ry,sinkListItem:()=>Dy,splitBlock:()=>zy,splitListItem:()=>jy,toggleList:()=>Fy,toggleMark:()=>Uy,toggleNode:()=>Vy,toggleWrap:()=>Hy,undoInputRule:()=>Wy,unsetAllMarks:()=>Gy,unsetMark:()=>Ky,unsetTextDirection:()=>qy,updateAttributes:()=>Jy,wrapIn:()=>Yy,wrapInList:()=>Xy});var Gm=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),Km=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),qm=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return!n||(o.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),l=i.blockRange(s);if(!l)return;const a=Xu(l);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(l.start,e)}(a||0===a)&&t.lift(l,a)})}),!0)},Jm=e=>t=>e(t),Ym=()=>({state:e,dispatch:t})=>id(e,t),Xm=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new Tp(r.doc.resolve(Math.max(s-1,0)))),!0},Qm=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1)if(o.node(n).type===r.type){if(t){const t=o.before(n),r=o.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function Zm(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var eg=e=>({tr:t,state:n,dispatch:r})=>{const o=Zm(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},tg=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},ng=()=>({state:e,dispatch:t})=>Wp(e,t),rg=()=>({commands:e})=>e.keyboardShortcut("Enter"),og=()=>({state:e,dispatch:t})=>od(e,t);function ig(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function sg(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:ig(t[r])?t[r].test(e[r]):t[r]===e[r])}function lg(e,t,n={}){return e.find(e=>e.type===t&&sg(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function ag(e,t,n={}){return!!lg(e,t,n)}function cg(e,t,n){var r;if(!e||!t)return;let o=e.parent.childAfter(e.parentOffset);if(o.node&&o.node.marks.some(e=>e.type===t)||(o=e.parent.childBefore(e.parentOffset)),!o.node||!o.node.marks.some(e=>e.type===t))return;if(n=n||(null==(r=o.node.marks[0])?void 0:r.attrs),!lg([...o.node.marks],t,n))return;let i=o.index,s=e.start()+o.offset,l=i+1,a=s+o.node.nodeSize;for(;i>0&&ag([...e.parent.child(i-1).marks],t,n);)i-=1,s-=e.parent.child(i).nodeSize;for(;l<e.parent.childCount&&ag([...e.parent.child(l).marks],t,n);)a+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function ug(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var pg=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const i=ug(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:c,to:u}=l;if(o){const e=cg(a,i,t);if(e&&e.from<=c&&e.to>=u){const t=Tp.create(s,e.from,e.to);n.setSelection(t)}}return!0},dg=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function hg(e){return e instanceof Tp}function fg(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function mg(e,t=null){if(!t)return null;const n=xp.atStart(e),r=xp.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?Tp.create(e,fg(0,o,i),fg(e.content.size,o,i)):Tp.create(e,fg(t,o,i),fg(t,o,i))}function gg(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function yg(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var vg=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{(yg()||gg())&&r.dom.focus(),"undefined"==typeof navigator||!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||yg()||gg()||r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(i&&null===e&&!hg(n.state.selection))return s(),!0;const l=mg(o.doc,e)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},bg=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Eg=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),wg=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&wg(r)}return e};function xg(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return wg(n)}function kg(e,t,n){if(e instanceof Yc||e instanceof Tc)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return Tc.fromArray(e.map(e=>t.nodeFromJSON(e)));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),kg("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,o="";const i=new mu({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?yu.fromSchema(i).parseSlice(xg(e),n.parseOptions):yu.fromSchema(i).parse(xg(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const r=yu.fromSchema(t);return n.slice?r.parseSlice(xg(e),n.parseOptions).content:r.parse(xg(e),n.parseOptions)}return kg("",t,n)}var Sg=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){let o;const l=e=>{i.emit("contentError",{editor:i,error:e,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},a={preserveWhitespace:"full",...(n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{kg(t,i.schema,{parseOptions:a,errorOnInvalidContent:!0})}catch(e){l(e)}try{o=kg(t,i.schema,{parseOptions:a,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:i.options.enableContentCheck})}catch(e){return l(e),!1}let c,{from:u,to:p}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},d=!0,h=!0;if(("type"in o?[o]:o).forEach(e=>{e.check(),d=!!d&&e.isText&&0===e.marks.length,h=!!h&&e.isBlock}),u===p&&h){const{parent:e}=r.doc.resolve(u);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(u-=1,p+=1)}if(d){if(Array.isArray(t))c=t.map(e=>e.text||"").join("");else if(t instanceof Tc){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),c=e}else c="object"==typeof t&&t&&t.text?t.text:t;r.insertText(c,u,p)}else{c=o;const e=r.doc.resolve(u),t=e.node(),n=0===e.parentOffset,i=t.isText||t.isTextblock,s=t.content.size>0;n&&i&&s&&(u=Math.max(0,u-1)),r.replaceWith(u,p,c)}n.updateSelection&&function(e,t){const n=e.steps.length-1;if(n<t)return;const r=e.steps[n];if(!(r instanceof Gu||r instanceof Ku))return;const o=e.mapping.maps[n];let i=0;o.forEach((e,t,n,r)=>{0===i&&(i=r)}),e.setSelection(xp.near(e.doc.resolve(i),-1))}(r,r.steps.length-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:c}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:c})}return!0},Cg=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,o=r instanceof Ap;if(o){if(r.node.isTextblock||!rp(e.doc,r.from))return!1;n=r.from}else if(n=ip(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);o&&r.setSelection(Ap.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),Tg=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof Ap){if(r.node.isTextblock||!rp(e.doc,r.to))return!1;n=r.to}else if(n=ip(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),Og=()=>({state:e,dispatch:t})=>Kp(e,t),Ag=()=>({state:e,dispatch:t})=>Zp(e,t),Mg=()=>({state:e,dispatch:t,tr:n})=>{try{const r=ip(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Pg=()=>({state:e,dispatch:t,tr:n})=>{try{const r=ip(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Ig=()=>({state:e,dispatch:t})=>((e,t)=>{let n=Gp(e,void 0);if(!n)return!1;let r=Xp(n);return!!r&&qp(e,r,t)})(e,t),_g=()=>({state:e,dispatch:t})=>((e,t)=>{let n=Qp(e,void 0);if(!n)return!1;let r=td(n);return!!r&&qp(e,r,t)})(e,t);function Ng(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Rg=e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);yg()||Ng()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=i.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{const t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0};function Dg(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?Zm(t,e.schema):null,l=[];e.doc.nodesBetween(r,o,(e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);l.push({node:e,from:n,to:i})});const a=o-r,c=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>sg(e.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=a}var Lg=(e,t={})=>({state:n,dispatch:r})=>!!Dg(n,Zm(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&Xu(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r),zg=()=>({state:e,dispatch:t})=>sd(e,t),jg=e=>({state:t,dispatch:n})=>{return(r=Zm(e,t.schema),function(e,t){let{$from:n,$to:o}=e.selection,i=n.blockRange(o,e=>e.childCount>0&&e.firstChild.type==r);return!!i&&(!t||(n.node(i.depth-1).type==r?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Ku(i-1,s,i,s,new _c(Tc.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new qc(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const l=Xu(r);if(null==l)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(i,-1)-1);return rp(o.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&o.join(a.pos),t(o.scrollIntoView()),!0}(e,t,r,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,a=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?Tc.empty:Tc.from(o))))return!1;let p=i.pos,d=p+s.nodeSize;return r.step(new Ku(p-(l?1:0),d+(a?1:0),p+1,d-1,new _c((l?Tc.empty:Tc.from(o.copy(Tc.empty))).append(a?Tc.empty:Tc.from(o.copy(Tc.empty))),l?0:1,a?0:1),l?0:1)),t(r.scrollIntoView()),!0}(e,t,i)))})(t,n);var r},$g=()=>({state:e,dispatch:t})=>nd(e,t);function Bg(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Fg(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Ug=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const l=Bg("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(i=Zm(e,r.schema)),"mark"===l&&(s=ug(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&(a=!0,o&&n.setNodeMarkup(r,void 0,Fg(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&(a=!0,o&&n.addMark(r,r+e.nodeSize,s.create(Fg(i.attrs,t))))})})}),a},Vg=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Hg=()=>({tr:e,dispatch:t})=>{if(t){const t=new Pp(e.doc);e.setSelection(t)}return!0},Wg=()=>({state:e,dispatch:t})=>Yp(e,t),Gg=()=>({state:e,dispatch:t})=>ed(e,t),Kg=()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(Ap.create(e.doc,n))),!0)})(e,t),qg=()=>({state:e,dispatch:t})=>pd(e,t),Jg=()=>({state:e,dispatch:t})=>ud(e,t);function Yg(e,t,n={},r={}){return kg(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Xg=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:l})=>{const{doc:a}=i;if("full"!==r.preserveWhitespace){const l=Yg(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return s&&i.replaceWith(0,a.content.size,l).setMeta("preventUpdate",!n),!0}return s&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function Qg(e,t){const n=ug(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{s.push(...e.marks)});const l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function Zg(e,t){const n=new Ep(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function ey(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function ty(e,t,n){return void 0===e.config[t]&&e.parent?ty(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?ty(e.parent,t,n):null}):e.config[t]}function ny(e){return e.map(e=>{const t=ty(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...ny(t())]:e}).flat(10)}function ry(e,t){const n=Ou.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function oy(e){return"function"==typeof e}function iy(e,t=void 0,...n){return oy(e)?t?e.bind(t)(...n):e(...n):e}function sy(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function ly(e){const t=[],{nodeExtensions:n,markExtensions:r}=sy(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(e=>"text"!==e.name).map(e=>e.name),l=r.map(e=>e.name),a=[...s,...l];return e.forEach(e=>{const n=ty(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:o});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:"*"===e.types?a:"nodes"===e.types?s:"marks"===e.types?l:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})})})})}),o.forEach(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ty(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach(([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})})}),t}function ay(...e){return e.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter(e=>!o.includes(e));n[e]=[...o,...i].join(" ")}else if("style"===e){const r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],o=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],i=new Map;o.forEach(e=>{const[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),r.forEach(e=>{const[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),n[e]=Array.from(i.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t;else n[e]=t}),n},{})}function cy(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>ay(e,t),{})}function uy(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}},{});return{...r,...o}}}}function py(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function dy(e){var t,n;const r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function hy(e){return e.sort((e,t)=>{const n=ty(e,"priority")||100,r=ty(t,"priority")||100;return n>r?-1:n<r?1:0})}function fy(e){const t=hy(ny(e)),n=function(e){const t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),t}function my(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let l="";return e.nodesBetween(r,o,(e,n,a,c)=>{var u;e.isBlock&&n>r&&(l+=i);const p=null==s?void 0:s[e.type.name];if(p)return a&&(l+=p({node:e,pos:n,parent:a,index:c,range:t})),!1;e.isText&&(l+=null==(u=null==e?void 0:e.text)?void 0:u.slice(Math.max(r,n)-n,o-n))}),l}function gy(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function yy(e,t){const n=Bg("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=Zm(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,e=>{i.push(e)});const s=i.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?Qg(e,t):{}}function vy(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,o)=>{const i=[];if(e.ranges.length)e.forEach((e,t)=>{i.push({from:e,to:t})});else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach(({from:e,to:n})=>{const i=t.slice(o).map(e,-1),s=t.slice(o).map(n),l=t.invert().map(i,-1),a=t.invert().map(s);r.push({oldRange:{from:l,to:a},newRange:{from:i,to:s}})})}),function(e){const t=function(e,t=JSON.stringify){const n={};return e.filter(e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(e);return 1===t.length?t:t.filter((e,n)=>{const r=t.filter((e,t)=>t!==n);return!r.some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to)})}(r)}function by(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(t=>{const o=cg(n.resolve(e),t.type);o&&r.push({mark:t,...o})}):n.nodesBetween(e,t,(e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function Ey(e,t){return t.nodes[e]||t.marks[e]||null}function wy(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{const r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function xy(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?ug(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>sg(e.attrs,n,{strict:!1}));let s=0;const l=[];if(o.forEach(({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,(e,t)=>{if(i&&e.inlineContent&&!e.type.allowsMarkType(i))return!1;if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),a=Math.min(o,t+e.nodeSize);s+=a-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:a})))})}),0===s)return!1;const a=l.filter(e=>!i||i.name===e.mark.type.name).filter(e=>sg(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=l.filter(e=>!i||e.mark.type!==i&&e.mark.type.excludes(i)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+c:a)>=s}function ky(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function Sy(e,t){const{nodeExtensions:n}=sy(t),r=n.find(t=>t.name===e);if(!r)return!1;const o=iy(ty(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function Cy(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(Cy(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}var Ty=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Oy(e,t){const n=t.mapping.mapResult(e.position);return{position:new Ty(n.pos),mapResult:n}}function Ay(e){return new Ty(e)}var My=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:l}=i,a=ug(e,r.schema);if(o)if(s){const e=Qg(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,(e,r)=>{const s=Math.max(r,o),l=Math.min(r+e.nodeSize,i);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){var r;const{selection:o}=t;let i=null;if(hg(o)&&(i=o.$cursor),i){const t=null!=(r=e.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}const{ranges:s}=o;return s.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&i}return!o}),o})}(r,n,a)},Py=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Iy=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=Zm(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:e})=>!!dd(i,{...s,...t})(n)||e.clearNodes()).command(({state:e})=>dd(i,{...s,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},_y=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=fg(e,0,n.content.size),o=Ap.create(n,r);t.setSelection(o)}return!0},Ny=(e,t)=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=r;let s,l;return"number"==typeof t?(s=t,l=t):t&&"from"in t&&"to"in t?(s=t.from,l=t.to):(s=i.from,l=i.to),o&&n.doc.nodesBetween(s,l,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},Ry=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=Tp.atStart(n).from,s=Tp.atEnd(n).to,l=fg(r,i,s),a=fg(o,i,s),c=Tp.create(n,l,a);t.setSelection(c)}return!0},Dy=e=>({state:t,dispatch:n})=>{const r=Zm(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,i=n.blockRange(r,e=>e.childCount>0&&e.firstChild.type==o);if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=o)return!1;if(t){let n=a.lastChild&&a.lastChild.type==l.type,r=Tc.from(n?o.create():null),s=new _c(Tc.from(o.create(null,Tc.from(l.type.create(null,r)))),n?3:1,0),c=i.start,u=i.end;t(e.tr.step(new Ku(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0})(t,n);var o};function Ly(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var zy=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:l,$to:a}=i,c=wy(o.extensionManager.attributes,l.node().type.name,l.node().attrs);if(i instanceof Ap&&i.node.isBlock)return!(!l.parentOffset||!np(s,l.pos)||(r&&(e&&Ly(n,o.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),0));if(!l.parent.isBlock)return!1;const u=a.parentOffset===a.parent.content.size,p=0===l.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let d=u&&p?[{type:p,attrs:c}]:void 0,h=np(t.doc,t.mapping.map(l.pos),1,d);if(d||h||!np(t.doc,t.mapping.map(l.pos),1,p?[{type:p}]:void 0)||(h=!0,d=p?[{type:p,attrs:c}]:void 0),r){if(h&&(i instanceof Tp&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,d),p&&!u&&!l.parentOffset&&l.parent.type!==p)){const e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,p)&&t.setNodeMarkup(t.mapping.map(l.before()),p)}e&&Ly(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return h},jy=(e,t={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const l=Zm(e,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const p=a.node(-1);if(p.type!==l)return!1;const d=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let e=Tc.empty;const r=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-r;t>=a.depth-3;t-=1)e=Tc.from(a.node(t).copy(e));const o=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i={...wy(d,a.node().type.name,a.node().attrs),...t},c=(null==(s=l.contentMatch.defaultType)?void 0:s.createAndFill(i))||void 0;e=e.append(Tc.from(l.createAndFill(null,c)||void 0));const u=a.before(a.depth-(r-1));n.replace(u,a.after(-o),new _c(e,4-r,0));let p=-1;n.doc.nodesBetween(u,n.doc.content.size,(e,t)=>{if(p>-1)return!1;e.isTextblock&&0===e.content.size&&(p=t+1)}),p>-1&&n.setSelection(Tp.near(n.doc.resolve(p))),n.scrollIntoView()}return!0}const h=c.pos===a.end()?p.contentMatchAt(0).defaultType:null,f={...wy(d,p.type.name,p.attrs),...t},m={...wy(d,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,c.pos);const g=h?[{type:l,attrs:f},{type:h,attrs:m}]:[{type:l,attrs:f}];if(!np(n.doc,a.pos,2))return!1;if(o){const{selection:e,storedMarks:t}=r,{splittableMarks:s}=i.extensionManager,l=t||e.$to.parentOffset&&e.$from.marks();if(n.split(a.pos,2,g).scrollIntoView(),!l||!o)return!0;const c=l.filter(e=>s.includes(e.type.name));n.ensureMarks(c)}return!0},$y=(e,t)=>{const n=ey(e=>e.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!rp(e.doc,n.pos)||(e.join(n.pos),!0)},By=(e,t)=>{const n=ey(e=>e.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!rp(e.doc,r)||(e.join(r),!0)},Fy=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:p,splittableMarks:d}=o.extensionManager,h=Zm(e,s.schema),f=Zm(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:v}=m,b=y.blockRange(v),E=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const w=ey(e=>Sy(e.type.name,p))(m);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===h)return c.liftListItem(f);if(Sy(w.node.type.name,p)&&h.validContent(w.node.content)&&l)return a().command(()=>(i.setNodeMarkup(w.pos,h),!0)).command(()=>$y(i,h)).command(()=>By(i,h)).run()}return n&&E&&l?a().command(()=>{const e=u().wrapInList(h,r),t=E.filter(e=>d.includes(e.type.name));return i.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(h,r).command(()=>$y(i,h)).command(()=>By(i,h)).run():a().command(()=>!!u().wrapInList(h,r)||c.clearNodes()).wrapInList(h,r).command(()=>$y(i,h)).command(()=>By(i,h)).run()},Uy=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=ug(e,r.schema);return xy(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},Vy=(e,t,n={})=>({state:r,commands:o})=>{const i=Zm(e,r.schema),s=Zm(t,r.schema),l=Dg(r,i,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?o.setNode(s,a):o.setNode(i,{...a,...n})},Hy=(e,t={})=>({state:n,commands:r})=>{const o=Zm(e,n.schema);return Dg(n,o,t)?r.lift(o):r.wrapIn(o,t)},Wy=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},Gy=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},Ky=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=ug(e,r.schema),{$from:c,empty:u,ranges:p}=l;if(!o)return!0;if(u&&s){let{from:e,to:t}=l;const r=null==(i=c.marks().find(e=>e.type===a))?void 0:i.attrs,o=cg(c,a,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,a)}else p.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},qy=e=>({tr:t,state:n,dispatch:r})=>{const{selection:o}=n;let i,s;return"number"==typeof e?(i=e,s=e):e&&"from"in e&&"to"in e?(i=e.from,s=e.to):(i=o.from,s=o.to),r&&t.doc.nodesBetween(i,s,(e,n)=>{if(e.isText)return;const r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},Jy=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const l=Bg("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(i=Zm(e,r.schema)),"mark"===l&&(s=ug(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{const l=e.$from.pos,c=e.$to.pos;let u,p,d,h;n.selection.empty?r.doc.nodesBetween(l,c,(e,t)=>{i&&i===e.type&&(a=!0,d=Math.max(t,l),h=Math.min(t+e.nodeSize,c),u=t,p=e)}):r.doc.nodesBetween(l,c,(e,r)=>{r<l&&i&&i===e.type&&(a=!0,d=Math.max(r,l),h=Math.min(r+e.nodeSize,c),u=r,p=e),r>=l&&r<=c&&(i&&i===e.type&&(a=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type&&(a=!0,o)){const o=Math.max(r,l),a=Math.min(r+e.nodeSize,c);n.addMark(o,a,s.create({...i.attrs,...t}))}}))}),p&&(void 0!==u&&o&&n.setNodeMarkup(u,void 0,{...p.attrs,...t}),s&&p.marks.length&&p.marks.forEach(e=>{s===e.type&&o&&n.addMark(d,h,s.create({...e.attrs,...t}))}))}),a},Yy=(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&Qu(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}(Zm(e,n.schema),t)(n,r),Xy=(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let l=r?n.tr:null;return!!function(e,t,n,r=null){let o=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);i=new qc(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new qc(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let l=Qu(i,n,r,t);return!!l&&(e&&function(e,t,n,r,o){let i=Tc.empty;for(let e=n.length-1;e>=0;e--)i=Tc.from(n[e].type.create(n[e].attrs,i));e.step(new Ku(t.start-(r?2:0),t.end,t.start,t.end,new _c(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let l=n.length-s,a=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&np(e.doc,a,l)&&(e.split(a,l),a+=2*l),a+=c.child(n).nodeSize}(e,t,l,o,n),!0)}(l,s,e,t)&&(r&&r(l.scrollIntoView()),!0)}}(Zm(e,n.schema),t)(n,r),Qy=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Zy=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function ev(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let u=!1;const p=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,o,i)=>{var s,l;const a=(null==(l=(s=e.type.spec).toText)?void 0:l.call(s,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(c)+i;return s.forEach(e=>{if(u)return;const t=((e,t)=>{if(ig(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(p,e.find);if(!t)return;const s=a.state.tr,c=Vm({state:a.state,transaction:s}),d={from:r-(t[0].length-i.length),to:o},{commands:h,chain:f,can:m}=new Hm({editor:n,state:c});null!==e.handler({state:c,range:d,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(l,{transform:s,from:r,to:o,text:i}),a.dispatch(s),u=!0)}),u}function tv(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function nv(e,t){const n={...e};return tv(e)&&tv(t)&&Object.keys(t).forEach(r=>{tv(t[r])&&tv(e[r])?n[r]=nv(e[r],t[r]):n[r]=t[r]}),n}var rv=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...iy(ty(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...iy(ty(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>nv(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},ov=class e extends rv{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;const i=o.find(e=>(null==e?void 0:e.type.name)===t.name);return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},iv=class{constructor(e){this.find=e.find,this.handler=e.handler}};var sv=null;function lv(e){const{editor:t,rules:n}=e;let r,o=null,i=!1,s=!1,l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const a=({state:e,from:n,to:o,rule:i,pasteEvt:s})=>{const a=e.tr,c=Vm({state:e,transaction:a});if(function(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:c,can:u}=new Hm({editor:t,state:n}),p=[];return n.doc.nodesBetween(r,o,(e,t)=>{var d,h,f,m,g;if((null==(h=null==(d=e.type)?void 0:d.spec)?void 0:h.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(o,t+y);if(v>=b)return;const E=((e,t,n)=>{if(ig(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,""),i.find,s);E.forEach(e=>{if(void 0===e.index)return;const t=v+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},d=i.handler({state:n,range:o,match:e,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});p.push(d)})}),p.every(e=>null!==e)}({editor:t,state:c,from:Math.max(n-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:r})&&a.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return n.map(e=>new Fp({view(e){const n=n=>{var r;o=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,o&&(sv=t)},r=()=>{sv&&(sv=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(s=o===e.dom.parentElement,r=t,!s){const e=sv;(null==e?void 0:e.isEditable)&&setTimeout(()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return l=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const o=t[0],c="paste"===o.getMeta("uiEvent")&&!i,u="drop"===o.getMeta("uiEvent")&&!s,p=o.getMeta("applyPasteRules"),d=!!p;if(!c&&!u&&!d)return;if(d){let{text:t}=p;"string"==typeof t||(t=ry(Tc.from(t),r.schema));const{from:n}=p,o=n+t.length,i=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return a({rule:e,state:r,from:n,to:{b:o},pasteEvt:i})}const h=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof h&&f&&h!==f.b?a({rule:e,state:r,from:h,to:f,pasteEvt:l}):void 0}}))}var av=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=fy(e),this.schema=function(e,t){var n;const r=ly(e),{nodeExtensions:o,markExtensions:i}=sy(e),s=null==(n=o.find(e=>ty(e,"topNode")))?void 0:n.name,l=Object.fromEntries(o.map(n=>{const o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=py({...e.reduce((e,t)=>{const r=ty(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),content:iy(ty(n,"content",i)),marks:iy(ty(n,"marks",i)),group:iy(ty(n,"group",i)),inline:iy(ty(n,"inline",i)),atom:iy(ty(n,"atom",i)),selectable:iy(ty(n,"selectable",i)),draggable:iy(ty(n,"draggable",i)),code:iy(ty(n,"code",i)),whitespace:iy(ty(n,"whitespace",i)),linebreakReplacement:iy(ty(n,"linebreakReplacement",i)),defining:iy(ty(n,"defining",i)),isolating:iy(ty(n,"isolating",i)),attrs:Object.fromEntries(o.map(dy))}),l=iy(ty(n,"parseHTML",i));l&&(s.parseDOM=l.map(e=>uy(e,o)));const a=ty(n,"renderHTML",i);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:cy(e,o)}));const c=ty(n,"renderText",i);return c&&(s.toText=c),[n.name,s]})),a=Object.fromEntries(i.map(n=>{const o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=py({...e.reduce((e,t)=>{const r=ty(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),inclusive:iy(ty(n,"inclusive",i)),excludes:iy(ty(n,"excludes",i)),group:iy(ty(n,"group",i)),spanning:iy(ty(n,"spanning",i)),code:iy(ty(n,"code",i)),attrs:Object.fromEntries(o.map(dy))}),l=iy(ty(n,"parseHTML",i));l&&(s.parseDOM=l.map(e=>uy(e,o)));const a=ty(n,"renderHTML",i);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:cy(e,o)})),[n.name,s]}));return new mu({topNode:s,nodes:l,marks:a})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n=ty(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ey(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this,t=hy([...this.extensions].reverse()).flatMap(t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ey(t.name,this.schema)},r=[],o=ty(t,"addKeyboardShortcuts",n);let i={};if("mark"===t.type&&ty(t,"exitable",n)&&(i.ArrowRight=()=>ov.handleExit({editor:e,mark:t})),o){const t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));i={...i,...t}}const s=new Fp({props:{handleKeyDown:Bm(i)}});r.push(s);const l=ty(t,"addInputRules",n);if(ky(t,e.options.enableInputRules)&&l){const t=l();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new Fp({state:{init(){return null},apply(e,o,i){const s=e.getMeta(r);if(s)return s;const l=e.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=ry(Tc.from(e),i.schema));const{from:o}=l,s=o+e.length;ev({editor:t,from:o,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput(e,o,i,s){return ev({editor:t,from:o,to:i,text:s,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{const{$cursor:o}=e.state.selection;o&&ev({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&ev({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}const a=ty(t,"addPasteRules",n);if(ky(t,e.options.enablePasteRules)&&a){const t=a();if(t&&t.length){const n=lv({editor:e,rules:t});r.push(...n)}}const c=ty(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r});return t}get attributes(){return ly(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=sy(this.extensions);return Object.fromEntries(t.filter(e=>!!ty(e,"addNodeView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Zm(t.name,this.schema)},o=ty(t,"addNodeView",r);if(!o)return[];const i=o();return i?[t.name,(r,o,s,l,a)=>{const c=cy(r,n);return i({node:r,view:o,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:c})}]:[]}))}dispatchTransaction(e){const{editor:t}=this;return hy([...this.extensions].reverse()).reduceRight((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ey(n.name,this.schema)},o=ty(n,"dispatchTransaction",r);return o?t=>{o.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){const{editor:t}=this;return hy([...this.extensions]).reduce((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ey(n.name,this.schema)},o=ty(n,"transformPastedHTML",r);return o?(t,n)=>{const i=e(t,n);return o.call(r,i)}:e},e||(e=>e))}get markViews(){const{editor:e}=this,{markExtensions:t}=sy(this.extensions);return Object.fromEntries(t.filter(e=>!!ty(e,"addMarkView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ug(t.name,this.schema)},o=ty(t,"addMarkView",r);return o?[t.name,(r,i,s)=>{const l=cy(r,n);return o()({mark:r,view:i,inline:s,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{!function(e,t,n={}){const{state:r}=t,{doc:o,tr:i}=r,s=e;o.descendants((t,r)=>{const o=i.mapping.map(r),l=i.mapping.map(r)+t.nodeSize;let a=null;if(t.marks.forEach(e=>{if(e!==s)return!1;a=e}),!a)return;let c=!1;if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(c=!0)}),c){const t=e.type.create({...e.attrs,...n});i.removeMark(o,l,e.type),i.addMark(o,l,t)}}),i.docChanged&&t.view.dispatch(i)}(r,e,t)}})}]:[]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Ey(e.name,this.schema)};"mark"===e.type&&(null==(t=iy(ty(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);const r=ty(e,"onBeforeCreate",n),o=ty(e,"onCreate",n),i=ty(e,"onUpdate",n),s=ty(e,"onSelectionUpdate",n),l=ty(e,"onTransaction",n),a=ty(e,"onFocus",n),c=ty(e,"onBlur",n),u=ty(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),a&&this.editor.on("focus",a),c&&this.editor.on("blur",c),u&&this.editor.on("destroy",u)})}};av.resolve=fy,av.sort=hy,av.flatten=ny,Um({},{ClipboardTextSerializer:()=>uv,Commands:()=>pv,Delete:()=>dv,Drop:()=>hv,Editable:()=>fv,FocusEvents:()=>gv,Keymap:()=>yv,Paste:()=>vv,Tabindex:()=>bv,TextDirection:()=>Ev,focusEventsPluginKey:()=>mv});var cv=class e extends rv{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},uv=cv.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Fp({key:new Hp("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map(e=>e.$from.pos)),l=Math.max(...i.map(e=>e.$to.pos)),a=gy(n);return my(r,{from:s,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),pv=cv.create({name:"commands",addCommands(){return{...Wm}}}),dv=cv.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;const i=()=>{var n,r,o,i;if(null!=(i=null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:o.call(r,e))?i:e.getMeta("y-sync$"))return;const s=Zg(e.before,[e,...t]);vy(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{const o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})})});const l=s.mapping;s.steps.forEach((t,n)=>{var r,o;if(t instanceof Vu){const i=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(i,-1),u=l.invert().map(a),p=null==(r=s.doc.nodeAt(i-1))?void 0:r.marks.some(e=>e.eq(t.mark)),d=null==(o=s.doc.nodeAt(a))?void 0:o.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:u},newRange:{from:i,to:a},partial:Boolean(d||p),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||o?setTimeout(i,0):i()}}),hv=cv.create({name:"drop",addProseMirrorPlugins(){return[new Fp({key:new Hp("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),fv=cv.create({name:"editable",addProseMirrorPlugins(){return[new Fp({key:new Hp("editable"),props:{editable:()=>this.editor.options.editable}})]}}),mv=new Hp("focusEvents"),gv=cv.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Fp({key:mv,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),yv=cv.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{const{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:s,parent:l}=i,a=i.parent.isTextblock&&s>0?t.doc.resolve(s-1):i,c=a.parent.type.spec.isolating,u=i.pos-i.parentOffset,p=c&&1===a.parent.childCount?u===i.pos:xp.atStart(r).from===s;return!(!o||!l.type.isTextblock||l.textContent.length||!p||p&&"paragraph"===i.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return yg()||Ng()?o:r},addProseMirrorPlugins(){return[new Fp({key:new Hp("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;const r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:l}=t.selection,a=xp.atStart(t.doc).from,c=xp.atEnd(t.doc).to;if(i||s!==a||l!==c)return;if(!Cy(n.doc))return;const u=n.tr,p=Vm({state:n,transaction:u}),{commands:d}=new Hm({editor:this.editor,state:p});return d.clearNodes(),u.steps.length?u:void 0}})]}}),vv=cv.create({name:"paste",addProseMirrorPlugins(){return[new Fp({key:new Hp("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),bv=cv.create({name:"tabindex",addProseMirrorPlugins(){return[new Fp({key:new Hp("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Ev=cv.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=sy(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return!t||"ltr"!==t&&"rtl"!==t&&"auto"!==t?this.options.direction:t},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Fp({key:new Hp("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),wv=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},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(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=n.isInline,l=this.pos+r+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!o&&!s&&a.depth<=this.depth)return;const c=new e(a,this.editor,o,o||s?n:null);o&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];if(e[o]!==t[o])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(t);return this.children.forEach(i=>{n&&r.length>0||(i.node.type.name===e&&o.every(e=>t[e]===i.node.attrs[e])&&r.push(i),n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n))))}),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},xv=class extends Qy{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Oy,createMappablePosition:Ay},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=mg(t,this.options.autofocus);this.editorState=$p.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML='.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',document.getElementsByTagName("head")[0].appendChild(r),r}(0,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=oy(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(e=>{const t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[fv,uv.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),pv,gv,yv,bv,hv,vv,dv,Ev.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new av(n,this)}createCommandManager(){this.commandManager=new Hm({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Yg(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=Yg(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new Sm(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:o,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)}):void(this.capturedTransaction=e);const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==s?void 0:s.getMeta("focus"),a=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return yy(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return Dg(e,null,n)||xy(e,null,n);const r=Bg(t,e.schema);return"node"===r?Dg(e,t,n):"mark"===r&&xy(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ry(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return my(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...gy(this.schema),...n}})}get isEmpty(){return Cy(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new wv(t,this)}get $doc(){return this.$pos(0)}};function kv(e){return new Zy({find:e.find,handler:({state:t,range:n,match:r})=>{const o=iy(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],l=r[0];if(s){const r=l.search(/\S/),a=n.from+l.indexOf(s),c=a+s.length;if(by(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;c<n.to&&i.delete(c,n.to),a>n.from&&i.delete(n.from+r,a);const u=n.from+r+s.length;i.addMark(n.from+r,u,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function Sv(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const e=o.map(e=>e.trim().slice(1));t.class=e.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(t.id=i[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var o;const i=parseInt((null==(o=r.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10),s=n[i];s&&(t[e]=s.slice(1,-1))});const s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function Cv(e){if(!e||0===Object.keys(e).length)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function Tv(e){const{nodeName:t,name:n,parseAttributes:r=Sv,serializeAttributes:o=Cv,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:l}=e,a=n||t;return{parseMarkdown:(e,n)=>{const r={...i,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${a}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,o){const i=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),l=e.match(i);if(!l)return;const c=l[1]||"",u=r(c);return s.find(e=>!(e in u))?void 0:{type:t,raw:l[0],attributes:u}}},renderMarkdown:e=>{const t=(e=>{if(!l)return e;const t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}),n=o(t);return`:::${a}${n?` {${n}}`:""} :::`}}}function Ov(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=Sv,serializeAttributes:i=Cv,defaultAttributes:s={},content:l="block",allowedAttributes:a}=e,c=n||t;return{parseMarkdown:(e,n)=>{let o;if(r){const t=r(e);o="string"==typeof t?[{type:"text",text:t}]:t}else o="block"===l?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const i={...s,...e.attributes};return n.createNode(t,i,o)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var i;const s=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),a=e.match(s);if(!a)return;const[u,p=""]=a,d=o(p);let h=1;const f=u.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const o=n.index,s=n[1];if(!(null==(i=n[2])?void 0:i.endsWith(":::")))if(s)h+=1;else if(h-=1,0===h){const i=y.slice(0,o);m=i.trim();const s=e.slice(0,f+o+n[0].length);let a=[];if(m)if("block"===l)for(a=r.blockTokens(i),a.forEach(e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))});a.length>0;){const e=a[a.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;a.pop()}else a=r.inlineTokens(m);return{type:t,raw:s,attributes:d,content:m,tokens:a}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!a)return e;const t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}),r=i(n),o=r?` {${r}}`:"",s=t.renderChildren(e.content||[],"\n\n");return`:::${c}${o}\n\n${s}\n\n:::`}}}function Av(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,o,i,s]=r;t[o]=i||s,r=n.exec(e)}return t}function Mv(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function Pv(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=Av,serializeAttributes:i=Mv,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=e,c=n||t,u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const o={...s,...e.attributes};if(l)return n.createNode(t,o);const i=r?r(e):e.content||"";return i?n.createNode(t,o,[n.createTextNode(i)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const i=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),s=e.match(i);if(!s)return;let a="",c="";if(l){const[,e]=s;c=e}else{const[,e,t]=s;c=e,a=t||""}const p=o(c.trim());return{type:t,raw:s[0],content:a.trim(),attributes:p}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));const n=(e=>{if(!a)return e;const t={};return a.forEach(n=>{const r="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(r in e){const n=e[r];if(void 0!==o&&n===o)return;t[r]=n}}),t})(e.attrs||{}),o=i(n),s=o?` ${o}`:"";return l?`[${c}${s}]`:`[${c}${s}]${t}[/${c}]`}}}function Iv(e,t,n){var r,o,i,s;const l=e.split("\n"),a=[];let c="",u=0;const p=t.baseIndentSize||2;for(;u<l.length;){const e=l[u],d=e.match(t.itemPattern);if(!d){if(a.length>0)break;if(""===e.trim()){u+=1,c=`${c}${e}\n`;continue}return}const h=t.extractItemData(d),{indentLevel:f,mainContent:m}=h;c=`${c}${e}\n`;const g=[m];for(u+=1;u<l.length;){const e=l[u];if(""===e.trim()){const t=l.slice(u+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null==(o=null==(r=l[u+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){g.push(e),c=`${c}${e}\n`,u+=1;continue}break}if(!(((null==(s=null==(i=e.match(/^(\s*)/))?void 0:i[1])?void 0:s.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,u+=1}let y;const v=g.slice(1);if(v.length>0){const e=v.map(e=>e.slice(f+p)).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(h,y);a.push(b)}if(0!==a.length)return{items:a,raw:c}}function _v(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const o="function"==typeof n?n(r):n,[i,...s]=e.content,l=[`${o}${t.renderChildren([i])}`];return s&&s.length>0&&s.forEach(e=>{const n=t.renderChildren([e]);if(n){const e=n.split("\n").map(e=>e?t.indent(e):"").join("\n");l.push(e)}}),l.join("\n")}Um({},{createAtomBlockMarkdownSpec:()=>Tv,createBlockMarkdownSpec:()=>Ov,createInlineMarkdownSpec:()=>Pv,parseAttributes:()=>Sv,parseIndentedBlocks:()=>Iv,renderNestedMarkdownContent:()=>_v,serializeAttributes:()=>Cv});var Nv=class e extends rv{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};function Rv(e){return new iv({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=iy(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;const{tr:s}=t,l=r[r.length-1],a=r[0];let c=n.to;if(l){const r=a.search(/\S/),o=n.from+a.indexOf(l),u=o+l.length;if(by(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>o).length)return null;u<n.to&&s.delete(u,n.to),o>n.from&&s.delete(n.from+r,o),c=n.from+r+l.length,s.addMark(n.from+r,c,e.type.create(i||{})),s.removeStoredMark(e.type)}}})}var Dv=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);const{children:n,...r}=null!=t?t:{};if("svg"===e)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},Lv=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,zv=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,jv=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,$v=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Bv=ov.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Dv("strong",{...ay(this.options.HTMLAttributes,e),children:Dv("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[kv({find:Lv,type:this.type}),kv({find:jv,type:this.type})]},addPasteRules(){return[Rv({find:zv,type:this.type}),Rv({find:$v,type:this.type})]}}),Fv=Nv.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),Uv=Nv.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",ay(this.options.HTMLAttributes,e)]},renderText(){return"\n"},renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,l=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&i){const t=l.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Vv=Uv,Hv=Nv.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,ay(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,o="#".repeat(r);return e.content?`${o} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>{return t={find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}},new Zy({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=iy(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable});var t})}}),Wv=Hv,Gv=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Kv=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,qv=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Jv=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Yv=ov.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",ay(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[kv({find:Gv,type:this.type}),kv({find:qv,type:this.type})]},addPasteRules(){return[Rv({find:Kv,type:this.type}),Rv({find:Jv,type:this.type})]}});const Xv="numeric",Qv="ascii",Zv="alpha",eb="asciinumeric",tb="alphanumeric",nb="domain",rb="emoji",ob="scheme",ib="slashscheme",sb="whitespace";function lb(e,t){return e in t||(t[e]=[]),t[e]}function ab(e,t,n){t[Xv]&&(t[eb]=!0,t[tb]=!0),t[Qv]&&(t[eb]=!0,t[Zv]=!0),t[eb]&&(t[tb]=!0),t[Zv]&&(t[tb]=!0),t[tb]&&(t[nb]=!0),t[rb]&&(t[nb]=!0);for(const r in t){const t=lb(r,n);t.indexOf(e)<0&&t.push(e)}}function cb(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}cb.groups={},cb.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const r=t.jr[n][0],o=t.jr[n][1];if(o&&r.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||cb.groups,t&&t.j?o=t:(o=new cb(t),n&&r&&ab(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||cb.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let s,l=o.go(e);if(l?(s=new cb,Object.assign(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new cb,i){if(r)if(s.t&&"string"==typeof s.t){const e=Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n);ab(i,e,r)}else n&&ab(i,n,r);s.t=i}return o.j[e]=s,s}};const ub=(e,t,n,r,o)=>e.ta(t,n,r,o),pb=(e,t,n,r,o)=>e.tr(t,n,r,o),db=(e,t,n,r,o)=>e.ts(t,n,r,o),hb=(e,t,n,r,o)=>e.tt(t,n,r,o),fb="WORD",mb="UWORD",gb="ASCIINUMERICAL",yb="ALPHANUMERICAL",vb="LOCALHOST",bb="TLD",Eb="UTLD",wb="SCHEME",xb="SLASH_SCHEME",kb="NUM",Sb="WS",Cb="NL",Tb="OPENBRACE",Ob="CLOSEBRACE",Ab="OPENBRACKET",Mb="CLOSEBRACKET",Pb="OPENPAREN",Ib="CLOSEPAREN",_b="OPENANGLEBRACKET",Nb="CLOSEANGLEBRACKET",Rb="FULLWIDTHLEFTPAREN",Db="FULLWIDTHRIGHTPAREN",Lb="LEFTCORNERBRACKET",zb="RIGHTCORNERBRACKET",jb="LEFTWHITECORNERBRACKET",$b="RIGHTWHITECORNERBRACKET",Bb="FULLWIDTHLESSTHAN",Fb="FULLWIDTHGREATERTHAN",Ub="AMPERSAND",Vb="APOSTROPHE",Hb="ASTERISK",Wb="AT",Gb="BACKSLASH",Kb="BACKTICK",qb="CARET",Jb="COLON",Yb="COMMA",Xb="DOLLAR",Qb="DOT",Zb="EQUALS",eE="EXCLAMATION",tE="HYPHEN",nE="PERCENT",rE="PIPE",oE="PLUS",iE="POUND",sE="QUERY",lE="QUOTE",aE="FULLWIDTHMIDDLEDOT",cE="SEMI",uE="SLASH",pE="TILDE",dE="UNDERSCORE",hE="EMOJI",fE="SYM";var mE=Object.freeze({__proto__:null,ALPHANUMERICAL:yb,AMPERSAND:Ub,APOSTROPHE:Vb,ASCIINUMERICAL:gb,ASTERISK:Hb,AT:Wb,BACKSLASH:Gb,BACKTICK:Kb,CARET:qb,CLOSEANGLEBRACKET:Nb,CLOSEBRACE:Ob,CLOSEBRACKET:Mb,CLOSEPAREN:Ib,COLON:Jb,COMMA:Yb,DOLLAR:Xb,DOT:Qb,EMOJI:hE,EQUALS:Zb,EXCLAMATION:eE,FULLWIDTHGREATERTHAN:Fb,FULLWIDTHLEFTPAREN:Rb,FULLWIDTHLESSTHAN:Bb,FULLWIDTHMIDDLEDOT:aE,FULLWIDTHRIGHTPAREN:Db,HYPHEN:tE,LEFTCORNERBRACKET:Lb,LEFTWHITECORNERBRACKET:jb,LOCALHOST:vb,NL:Cb,NUM:kb,OPENANGLEBRACKET:_b,OPENBRACE:Tb,OPENBRACKET:Ab,OPENPAREN:Pb,PERCENT:nE,PIPE:rE,PLUS:oE,POUND:iE,QUERY:sE,QUOTE:lE,RIGHTCORNERBRACKET:zb,RIGHTWHITECORNERBRACKET:$b,SCHEME:wb,SEMI:cE,SLASH:uE,SLASH_SCHEME:xb,SYM:fE,TILDE:pE,TLD:bb,UNDERSCORE:dE,UTLD:Eb,UWORD:mb,WORD:fb,WS:Sb});const gE=/[a-z]/,yE=/\p{L}/u,vE=/\p{Emoji}/u,bE=/\d/,EE=/\s/;let wE=null,xE=null;function kE(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let l=e,a=null,c=0,u=null,p=-1,d=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(p=0,d=0,u=l):p>=0&&(p+=n[s].length,d++),c+=n[s].length,i+=n[s].length,s++;i-=p,s-=d,c-=p,o.push({t:u.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function SE(e,t,n,r,o){let i;const s=t.length;for(let n=0;n<s-1;n++){const s=t[n];e.j[s]?i=e.j[s]:(i=new cb(r),i.jr=o.slice(),e.j[s]=i),e=i}return i=new cb(n),i.jr=o.slice(),e.j[t[s-1]]=i,i}function CE(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}const TE={defaultProtocol:"http",events:null,format:AE,formatHref:AE,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function OE(e,t=null){let n=Object.assign({},TE);e&&(n=Object.assign(n,e instanceof OE?e.o:e));const r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function AE(e){return e}function ME(e,t){this.t="token",this.v=e,this.tk=t}function PE(e,t){class n extends ME{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}OE.prototype={o:TE,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o?("object"==typeof o?(o=n.t in o?o[n.t]:TE[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},ME.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=TE.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},l=e.get("className",n,t),a=e.get("target",n,t),c=e.get("rel",n,t),u=e.getObj("attributes",n,t),p=e.getObj("events",n,t);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&Object.assign(s,u),{tagName:o,attributes:s,content:i,eventListeners:p}}};const IE=PE("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),_E=PE("text"),NE=PE("nl"),RE=PE("url",{isLink:!0,toHref(e=TE.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==vb&&e[1].t===Jb}}),DE=e=>new cb(e);function LE(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}const zE="undefined"!=typeof console&&console&&console.warn||(()=>{}),jE={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function $E(e,t=!1){if(jE.initialized&&zE(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');jE.customSchemes.push([e,t])}function BE(e){return jE.initialized||function(){jE.scanner=function(e=[]){const t={};cb.groups=t;const n=new cb;null==wE&&(wE=CE("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==xE&&(xE=CE("ελ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")),hb(n,"'",Vb),hb(n,"{",Tb),hb(n,"}",Ob),hb(n,"[",Ab),hb(n,"]",Mb),hb(n,"(",Pb),hb(n,")",Ib),hb(n,"<",_b),hb(n,">",Nb),hb(n,"(",Rb),hb(n,")",Db),hb(n,"「",Lb),hb(n,"」",zb),hb(n,"『",jb),hb(n,"』",$b),hb(n,"<",Bb),hb(n,">",Fb),hb(n,"&",Ub),hb(n,"*",Hb),hb(n,"@",Wb),hb(n,"`",Kb),hb(n,"^",qb),hb(n,":",Jb),hb(n,",",Yb),hb(n,"$",Xb),hb(n,".",Qb),hb(n,"=",Zb),hb(n,"!",eE),hb(n,"-",tE),hb(n,"%",nE),hb(n,"|",rE),hb(n,"+",oE),hb(n,"#",iE),hb(n,"?",sE),hb(n,'"',lE),hb(n,"/",uE),hb(n,";",cE),hb(n,"~",pE),hb(n,"_",dE),hb(n,"\\",Gb),hb(n,"・",aE);const r=pb(n,bE,kb,{[Xv]:!0});pb(r,bE,r);const o=pb(r,gE,gb,{[eb]:!0}),i=pb(r,yE,yb,{[tb]:!0}),s=pb(n,gE,fb,{[Qv]:!0});pb(s,bE,o),pb(s,gE,s),pb(o,bE,o),pb(o,gE,o);const l=pb(n,yE,mb,{[Zv]:!0});pb(l,gE),pb(l,bE,i),pb(l,yE,l),pb(i,bE,i),pb(i,gE),pb(i,yE,i);const a=hb(n,"\n",Cb,{[sb]:!0}),c=hb(n,"\r",Sb,{[sb]:!0}),u=pb(n,EE,Sb,{[sb]:!0});hb(n,"",u),hb(c,"\n",a),hb(c,"",u),pb(c,EE,u),hb(u,"\r"),hb(u,"\n"),pb(u,EE,u),hb(u,"",u);const p=pb(n,vE,hE,{[rb]:!0});hb(p,"#"),pb(p,vE,p),hb(p,"️",p);const d=hb(p,"");hb(d,"#"),pb(d,vE,p);const h=[[gE,s],[bE,o]],f=[[gE,null],[yE,l],[bE,i]];for(let e=0;e<wE.length;e++)SE(n,wE[e],bb,fb,h);for(let e=0;e<xE.length;e++)SE(n,xE[e],Eb,mb,f);ab(bb,{tld:!0,ascii:!0},t),ab(Eb,{utld:!0,alpha:!0},t),SE(n,"file",wb,fb,h),SE(n,"mailto",wb,fb,h),SE(n,"http",xb,fb,h),SE(n,"https",xb,fb,h),SE(n,"ftp",xb,fb,h),SE(n,"ftps",xb,fb,h),ab(wb,{scheme:!0,ascii:!0},t),ab(xb,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){const r=e[t][0],o=e[t][1]?{[ob]:!0}:{[ib]:!0};r.indexOf("-")>=0?o[nb]=!0:gE.test(r)?bE.test(r)?o[eb]=!0:o[Qv]=!0:o[Xv]=!0,db(n,r,r,o)}return db(n,"localhost",vb,{ascii:!0}),n.jd=new cb(fE),{start:n,tokens:Object.assign({groups:t},mE)}}(jE.customSchemes);for(let e=0;e<jE.tokenQueue.length;e++)jE.tokenQueue[e][1]({scanner:jE.scanner});jE.parser=function({groups:e}){const t=e.domain.concat([Ub,Hb,Wb,Gb,Kb,qb,Xb,Zb,tE,kb,nE,rE,oE,iE,uE,fE,pE,dE]),n=[Vb,Jb,Yb,Qb,eE,nE,sE,lE,cE,_b,Nb,Tb,Ob,Mb,Ab,Pb,Ib,Rb,Db,Lb,zb,jb,$b,Bb,Fb],r=[Ub,Vb,Hb,Gb,Kb,qb,Xb,Zb,tE,Tb,Ob,nE,rE,oE,iE,sE,uE,fE,pE,dE],o=DE(),i=hb(o,pE);ub(i,r,i),ub(i,e.domain,i);const s=DE(),l=DE(),a=DE();ub(o,e.domain,s),ub(o,e.scheme,l),ub(o,e.slashscheme,a),ub(s,r,i),ub(s,e.domain,s);const c=hb(s,Wb);hb(i,Wb,c),hb(l,Wb,c),hb(a,Wb,c);const u=hb(i,Qb);ub(u,r,i),ub(u,e.domain,i);const p=DE();ub(c,e.domain,p),ub(p,e.domain,p);const d=hb(p,Qb);ub(d,e.domain,p);const h=DE(IE);ub(d,e.tld,h),ub(d,e.utld,h),hb(c,vb,h);const f=hb(p,tE);hb(f,tE,f),ub(f,e.domain,p),ub(h,e.domain,p),hb(h,Qb,d),hb(h,tE,f);const m=hb(h,Jb);ub(m,e.numeric,IE);const g=hb(s,tE),y=hb(s,Qb);hb(g,tE,g),ub(g,e.domain,s),ub(y,r,i),ub(y,e.domain,s);const v=DE(RE);ub(y,e.tld,v),ub(y,e.utld,v),ub(v,e.domain,s),ub(v,r,i),hb(v,Qb,y),hb(v,tE,g),hb(v,Wb,c);const b=hb(v,Jb),E=DE(RE);ub(b,e.numeric,E);const w=DE(RE),x=DE();ub(w,t,w),ub(w,n,x),ub(x,t,w),ub(x,n,x),hb(v,uE,w),hb(E,uE,w);const k=hb(l,Jb),S=hb(a,Jb),C=hb(S,uE),T=hb(C,uE);ub(l,e.domain,s),hb(l,Qb,y),hb(l,tE,g),ub(a,e.domain,s),hb(a,Qb,y),hb(a,tE,g),ub(k,e.domain,w),hb(k,uE,w),hb(k,sE,w),ub(T,e.domain,w),ub(T,t,w),hb(T,uE,w);const O=[[Tb,Ob],[Ab,Mb],[Pb,Ib],[_b,Nb],[Rb,Db],[Lb,zb],[jb,$b],[Bb,Fb]];for(let e=0;e<O.length;e++){const[r,o]=O[e],i=hb(w,r);hb(x,r,i),hb(i,o,w);const s=DE(RE);ub(i,t,s);const l=DE();ub(i,n),ub(s,t,s),ub(s,n,l),ub(l,t,s),ub(l,n,l),hb(s,o,w),hb(l,o,w)}return hb(o,vb,v),hb(o,Cb,NE),{start:o,tokens:mE}}(jE.scanner.tokens);for(let e=0;e<jE.pluginQueue.length;e++)jE.pluginQueue[e][1]({scanner:jE.scanner,parser:jE.parser});jE.initialized=!0}(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let l=e,a=null,c=null,u=0,p=null,d=-1;for(;o<r&&!(a=l.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,l=c,l.accepts()?(d=0,p=l):d>=0&&d++,o++,u++;if(d<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(LE(_E,t,s)),s=[]),o-=d,u-=d;const e=p.t,r=n.slice(o-u,o);i.push(LE(e,t,r))}}return s.length>0&&i.push(LE(_E,t,s)),i}(jE.parser.start,e,kE(jE.scanner.start,e))}function FE(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new OE(n),o=BE(e),i=[];for(let e=0;e<o.length;e++){const n=o[e];!n.isLink||t&&n.t!==t||!r.check(n)||i.push(n.toFormattedObject(r))}return i}BE.scan=kE;var UE="[\0- -\u2029 ]",VE=new RegExp(UE),HE=new RegExp(`${UE}$`),WE=new RegExp(UE,"g");function GE(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(WE,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var KE=ov.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(e=>{"string"!=typeof e?$E(e.scheme,e.optionalSlashes):$E(e)})},onDestroy(){cb.groups={},jE.scanner=null,jE.parser=null,jE.tokenQueue=[],jE.pluginQueue=[],jE.customSchemes=[],jE.initialized=!1},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!GE(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!GE(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!GE(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ay(this.options.HTMLAttributes,e),0]:["a",ay(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,o,i;const s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",l=null!=(i=null==(o=e.attrs)?void 0:o.title)?i:"",a=t.renderChildren(e);return l?`[${a}](${s} "${l}")`:`[${a}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!GE(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!GE(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Rv({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=FE(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!GE(e,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push((r={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!GE(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new Fp({key:new Hp("autolink"),appendTransaction:(e,t,n)=>{const o=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=n;return vy(Zg(t.doc,[...e])).forEach(({newRange:e})=>{const t=function(e,t){const n=[];return e.nodesBetween(t.from,t.to,(e,t)=>{(e=>e.isTextblock)(e)&&n.push({node:e,pos:t})}),n}(n.doc,e);let o,i;if(t.length>1)o=t[0],i=n.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(t.length){const r=n.doc.textBetween(e.from,e.to," "," ");if(!HE.test(r))return;o=t[0],i=n.doc.textBetween(o.pos,e.to,void 0," ")}if(o&&i){const e=i.split(VE).filter(Boolean);if(e.length<=0)return!1;const t=e[e.length-1],a=o.pos+i.lastIndexOf(t);if(!t)return!1;const c=BE(t).map(e=>e.toObject(r.defaultProtocol));if(!(1===(l=c).length?l[0].isLink:3===l.length&&l[1].isLink&&["()","[]"].includes(l[0].value+l[2].value)))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:a+e.start+1,to:a+e.end+1})).filter(e=>!n.schema.marks.code||!n.doc.rangeHasMark(e.from,e.to,n.schema.marks.code)).filter(e=>r.validate(e.value)).filter(e=>r.shouldAutoLink(e.value)).forEach(e=>{by(e.from,e.to,n.doc).some(e=>e.mark.type===r.type)||s.addMark(e.from,e.to,r.type.create({href:e.href}))})}var l}),s.steps.length?s:void 0}}))),e.push(function(e){return new Fp({key:new Hp("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button)return!1;if(!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const t=r.target;if(!t)return!1;const n=e.editor.view.dom;s=t.closest("a"),s&&!n.contains(s)&&(s=null)}if(!s)return!1;let l=!1;if(e.enableClickSelection&&(l=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const n=yy(t.state,e.type.name),r=null!=(o=s.href)?o:n.href,a=null!=(i=s.target)?i:n.target;r&&(window.open(r,a),l=!0)}return l}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(function(e){return new Fp({key:new Hp("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:i}=t,{selection:s}=i,{empty:l}=s;if(l)return!1;let a="";r.content.forEach(e=>{a+=e.textContent});const c=FE(a,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!(!a||!c||void 0!==o&&!o(c.value))&&e.editor.commands.setMark(e.type,{href:c.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e;var r}}),qE=KE,JE=" ",YE=Nv.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",ay(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);const r=t.parseInline(n);return 1!==r.length||"text"!==r[0].type||r[0].text!==JE&&" "!==r[0].text?t.createNode("paragraph",void 0,r):t.createNode("paragraph",void 0,[])},renderMarkdown:(e,t)=>{if(!e)return"";const n=Array.isArray(e.content)?e.content:[];return 0===n.length?JE:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),XE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,QE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ZE=ov.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}]},renderHTML({HTMLAttributes:e}){return["s",ay(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[kv({find:XE,type:this.type})]},addPasteRules(){return[Rv({find:QE,type:this.type})]}}),ew=ov.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(e){return"sub"===e&&null}}]},renderHTML({HTMLAttributes:e}){return["sub",ay(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),tw=ov.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(e){return"super"===e&&null}}]},renderHTML({HTMLAttributes:e}){return["sup",ay(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),nw=Nv.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),rw=ov.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}]},renderHTML({HTMLAttributes:e}){return["u",ay(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),ow=n(9888),iw=n(4848);const{getOwnPropertyNames:sw,getOwnPropertySymbols:lw}=Object,{hasOwnProperty:aw}=Object.prototype;function cw(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function uw(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);const{cache:o}=r,i=o.get(t),s=o.get(n);if(i&&s)return i===n&&s===t;o.set(t,n),o.set(n,t);const l=e(t,n,r);return o.delete(t),o.delete(n),l}}function pw(e){return sw(e).concat(lw(e))}const dw=Object.hasOwn||((e,t)=>aw.call(e,t));function hw(e,t){return e===t||!e&&!t&&e!=e&&t!=t}const{getOwnPropertyDescriptor:fw,keys:mw}=Object;function gw(e,t){return e.byteLength===t.byteLength&&Mw(new Uint8Array(e),new Uint8Array(t))}function yw(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function vw(e,t){return e.byteLength===t.byteLength&&Mw(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function bw(e,t){return hw(e.getTime(),t.getTime())}function Ew(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function ww(e,t){return e===t}function xw(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.entries();let s,l,a=0;for(;(s=i.next())&&!s.done;){const r=t.entries();let i=!1,c=0;for(;(l=r.next())&&!l.done;){if(o[c]){c++;continue}const r=s.value,u=l.value;if(n.equals(r[0],u[0],a,c,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){i=o[c]=!0;break}c++}if(!i)return!1;a++}return!0}const kw=hw;function Sw(e,t,n){const r=mw(e);let o=r.length;if(mw(t).length!==o)return!1;for(;o-- >0;)if(!Iw(e,t,n,r[o]))return!1;return!0}function Cw(e,t,n){const r=pw(e);let o,i,s,l=r.length;if(pw(t).length!==l)return!1;for(;l-- >0;){if(o=r[l],!Iw(e,t,n,o))return!1;if(i=fw(e,o),s=fw(t,o),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable))return!1}return!0}function Tw(e,t){return hw(e.valueOf(),t.valueOf())}function Ow(e,t){return e.source===t.source&&e.flags===t.flags}function Aw(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.values();let s,l;for(;(s=i.next())&&!s.done;){const r=t.values();let i=!1,a=0;for(;(l=r.next())&&!l.done;){if(!o[a]&&n.equals(s.value,l.value,s.value,l.value,e,t,n)){i=o[a]=!0;break}a++}if(!i)return!1}return!0}function Mw(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Pw(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Iw(e,t,n,r){return!("_owner"!==r&&"__o"!==r&&"__v"!==r||!e.$$typeof&&!t.$$typeof)||dw(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const _w={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Nw=Object.prototype.toString;const Rw=Dw();function Dw(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:o=!1}=e,i=function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:gw,areArraysEqual:n?Cw:yw,areDataViewsEqual:vw,areDatesEqual:bw,areErrorsEqual:Ew,areFunctionsEqual:ww,areMapsEqual:n?cw(xw,Cw):xw,areNumbersEqual:kw,areObjectsEqual:n?Cw:Sw,arePrimitiveWrappersEqual:Tw,areRegExpsEqual:Ow,areSetsEqual:n?cw(Aw,Cw):Aw,areTypedArraysEqual:n?cw(Mw,Cw):Mw,areUrlsEqual:Pw,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const e=uw(r.areArraysEqual),t=uw(r.areMapsEqual),n=uw(r.areObjectsEqual),o=uw(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:o})}return r}(e),s=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:i,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:p,areTypedArraysEqual:d,areUrlsEqual:h,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const v=typeof m;if(v!==typeof g)return!1;if("object"!==v)return"number"===v?l(m,g,y):"function"===v&&i(m,g,y);const b=m.constructor;if(b!==g.constructor)return!1;if(b===Object)return a(m,g,y);if(Array.isArray(m))return t(m,g,y);if(b===Date)return r(m,g,y);if(b===RegExp)return u(m,g,y);if(b===Map)return s(m,g,y);if(b===Set)return p(m,g,y);const E=Nw.call(m);if("[object Date]"===E)return r(m,g,y);if("[object RegExp]"===E)return u(m,g,y);if("[object Map]"===E)return s(m,g,y);if("[object Set]"===E)return p(m,g,y);if("[object Object]"===E)return"function"!=typeof m.then&&"function"!=typeof g.then&&a(m,g,y);if("[object URL]"===E)return h(m,g,y);if("[object Error]"===E)return o(m,g,y);if("[object Arguments]"===E)return a(m,g,y);if(_w[E])return d(m,g,y);if("[object ArrayBuffer]"===E)return e(m,g,y);if("[object DataView]"===E)return n(m,g,y);if("[object Boolean]"===E||"[object Number]"===E||"[object String]"===E)return c(m,g,y);if(f){let e=f[E];if(!e){const t=null!=(w=m)?w[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,y)}var w;return!1}}(i);var l;return function({circular:e,comparator:t,createState:n,equals:r,strict:o}){if(n)return function(i,s){const{cache:l=(e?new WeakMap:void 0),meta:a}=n();return t(i,s,{cache:l,equals:r,meta:a,strict:o})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const i={cache:void 0,equals:r,meta:void 0,strict:o};return function(e,n){return t(e,n,i)}}({circular:t,comparator:s,createState:r,equals:n?n(s):(l=s,function(e,t,n,r,o,i,s){return l(e,t,s)}),strict:o})}Dw({strict:!0}),Dw({circular:!0}),Dw({circular:!0,strict:!0}),Dw({createInternalComparator:()=>hw}),Dw({strict:!0,createInternalComparator:()=>hw}),Dw({circular:!0,createInternalComparator:()=>hw}),Dw({circular:!0,createInternalComparator:()=>hw,strict:!0});var Lw=n(9242),zw=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},jw=({contentComponent:e})=>{const t=(0,ow.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,iw.jsx)(iw.Fragment,{children:Object.values(t)})},$w=class extends e.Component{constructor(t){var n;super(t),this.editorContentRef=e.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(n=t.editor)?void 0:n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){if(t.contentComponent)return;const e=this.editorContentRef.current;e.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:e}),t.contentComponent=function(){const e=new Set;let t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:xt.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(e=>e())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return(0,iw.jsxs)(iw.Fragment,{children:[(0,iw.jsx)("div",{ref:zw(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,iw.jsx)(jw,{contentComponent:e.contentComponent})]})}},Bw=(0,e.forwardRef)((t,n)=>{const r=e.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[t.editor]);return e.createElement($w,{key:r,innerRef:n,...t})}),Fw=e.memo(Bw),Uw="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Vw=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function Hw(t){var n;const[r]=(0,e.useState)(()=>new Vw(t.editor)),o=(0,Lw.useSyncExternalStoreWithSelector)(r.subscribe,r.getSnapshot,r.getServerSnapshot,t.selector,null!=(n=t.equalityFn)?n:Rw);return Uw(()=>r.watch(t.editor),[t.editor,r]),(0,e.useDebugValue)(o),o}var Ww="undefined"==typeof window,Gw=Ww||Boolean("undefined"!=typeof window&&window.next),Kw=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?Ww||Gw?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new xv(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};var qw=(0,e.createContext)({editor:null});qw.Consumer;var Jw=(0,e.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});e.forwardRef((t,n)=>{const{onDragStart:r}=(0,e.useContext)(Jw),o=t.as||"div";return(0,iw.jsx)(o,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})}),e.createContext({markViewContentRef:()=>{}});var Yw=(0,e.createContext)({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Yw.displayName="TiptapContext";function Xw({editor:t,instance:n,children:r}){const o=null!=t?t:n;if(!o)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=(0,e.useMemo)(()=>({editor:o}),[o]),s=(0,e.useMemo)(()=>({editor:o}),[o]);return(0,iw.jsx)(qw.Provider,{value:s,children:(0,iw.jsx)(Yw.Provider,{value:i,children:r})})}function Qw({...t}){const{editor:n}=(0,e.useContext)(Yw);return(0,iw.jsx)(Fw,{editor:n,...t})}function Zw(e){if(!e)return"";const t=e.replace(/<br\s*\/?>/gi,"\n").replace(/<\/p>\s*<p[^>]*>/gi,"\n");return(new DOMParser).parseFromString(t,"text/html").body.textContent??""}Xw.displayName="Tiptap",Qw.displayName="Tiptap.Content",Object.assign(Xw,{Content:Qw});const ex="i",tx="b",nx="u",rx=e.forwardRef((t,n)=>{const{value:r,setValue:o,placeholder:s=null,editorProps:l={},elementClasses:a="",autofocus:c=!1,sx:u={},onBlur:p,expectedTag:d=null,onEditorCreate:h,wrapperClassName:f,onSelectionEnd:m,mountElement:g=null}=t,y=(0,e.useRef)(null),v=(0,e.useRef)(p);v.current=p;const b=d?"block+":"inline*",E=e=>({...e,class:a}),w=function(t={},n=[]){const r=(0,e.useRef)(t);r.current=t;const[o]=(0,e.useState)(()=>new Kw(r)),i=(0,ow.useSyncExternalStore)(o.subscribe,o.getEditor,o.getServerSnapshot);return(0,e.useDebugValue)(i),(0,e.useEffect)(o.onRender(n)),Hw({editor:i,selector:({transactionNumber:e})=>!1===t.shouldRerenderOnTransaction||void 0===t.shouldRerenderOnTransaction?null:t.immediatelyRender&&0===e?0:e+1}),i}({...g?{element:g}:{},extensions:[Fv.extend({content:b}),YE.extend({renderHTML({HTMLAttributes:e}){return[d??"p",E(e),0]}}),Wv.extend({renderHTML({node:e,HTMLAttributes:t}){return d?[d,E(t),0]:[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,E(t),0]}}).configure({levels:[1,2,3,4,5,6]}),qE.configure({openOnClick:!1}),nw,Bv,Yv,ZE,tw,ew,rw,Vv.extend({addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.setHardBreak()}}})],content:r,onUpdate:({editor:e})=>{const t=e.getHTML();o(function(e=""){if(!e)return!0;const t=document.createElement("div");return t.innerHTML=e,!t.textContent?.length}(t)?null:t)},autofocus:c,editorProps:{...l,handleDOMEvents:{keydown:(e,t)=>{"Escape"===t.key&&v.current?.(),!t.metaKey&&!t.ctrlKey||t.altKey||[ex,tx,nx].includes(t.key)&&t.stopPropagation()}},attributes:{...l.attributes??{},role:"textbox",...s?{"data-placeholder":Zw(s)}:{},...null===r||""===r?{class:"is-empty"}:{}}},onCreate:h?({editor:e})=>h(e):void 0,onBlur:g?void 0:()=>v.current?.(),onSelectionUpdate:m?({editor:e})=>m(e.view):void 0});return ox(()=>{w&&w.getHTML()!==r&&w.commands.setContent(r,{emitUpdate:!1})},[w,r]),g?null:e.createElement(i.Box,{ref:y,sx:u,className:f},e.createElement(Fw,{ref:n,editor:w}))}),ox=(t,n)=>{const r=(0,e.useRef)(!1);(0,e.useEffect)(()=>{r.current?t():r.current=!0},n)};function ix(){return ix=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ix.apply(null,arguments)}const sx=D(({sx:t,attributes:n,props:r})=>{const{value:s,setValue:a,placeholder:c}=b(o.htmlV3PropTypeUtil),u=o.stringPropTypeUtil.extract(s?.content??null)??"",p=(0,e.useMemo)(()=>(0,l.debounce)(e=>{const t=(0,o.parseHtmlChildren)(e);a({content:t.content?o.stringPropTypeUtil.create(t.content):null,children:t.children})},300),[a]),d=(0,e.useCallback)(e=>{const t=e??"";a({content:t?o.stringPropTypeUtil.create(t):null,children:s?.children??[]}),p(t)},[a,s?.children,p]);return(0,e.useEffect)(()=>()=>p.cancel(),[p]),e.createElement(Y,null,e.createElement(i.Box,ix({sx:{p:.8,border:"1px solid",borderColor:"grey.200",borderRadius:"8px",transition:"border-color .2s ease, box-shadow .2s ease","&:hover":{borderColor:"black"},"&:focus-within":{borderColor:"black",boxShadow:"0 0 0 1px black"},"& .ProseMirror:focus":{outline:"none"},"& .ProseMirror":{minHeight:"70px",fontSize:"12px","& a":{color:"inherit"},"& .elementor-inline-editor-reset":{margin:0,padding:0},"&.is-empty::before":{content:"attr(data-placeholder)",color:"text.tertiary",pointerEvents:"none",position:"absolute",opacity:.6}},".strip-styles *":{all:"unset"},...t}},n,r),e.createElement(rx,{value:u,setValue:d,placeholder:c?.content?.value??null})))}),lx=["e-form-input","e-form-textarea","e-form-checkbox","e-form-radio-button","e-form-select","e-form-date-picker","e-form-time-picker"];function ax(e){return o.stringPropTypeUtil.extract(e)}function cx(e,t,n){const r=e.settings.get(n);if(null!=r)return r;const o=(0,Ui.getWidgetsCache)()?.[t]?.atomic_props_schema;return o?.[n]?.default??null}function ux(e){return(0,Vi.__privateUseListenTo)([(0,Vi.v1ReadyEvent)(),(0,Vi.commandEndEvent)("document/elements/create"),(0,Vi.commandEndEvent)("document/elements/delete"),(0,Vi.commandEndEvent)("document/elements/set-settings")],()=>{const t=(0,Ui.getSelectedElements)()[0];if(!t)return[];const n=function(e){let t=(0,Ui.getContainer)(e);for(;t;){if("e-form"===t.model.get("elType"))return t;t=t.parent??null}return null}(t.id);if(!n?.children)return[];const r=[],o=new Set;return n.children.forEachRecursive?.(t=>{const n=t.model.get("widgetType");if(!n||!function(e){return lx.includes(e)}(n))return;if(e?.inputType&&ax(cx(t,n,"type"))!==e.inputType)return;const i=function(e,t){return ax(cx(e,t,"_cssid"))}(t,n);i&&!o.has(i)&&(o.add(i),r.push({label:i,value:i}))}),r},[])}function px(){return px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},px.apply(null,arguments)}const dx=({bind:t,label:n,placeholder:r})=>e.createElement(m,{bind:t},e.createElement(i.Grid,{container:!0,direction:"column",gap:.5},e.createElement(i.Grid,{item:!0},e.createElement(k,null,n)),e.createElement(i.Grid,{item:!0},e.createElement(se,{placeholder:r})))),hx=({placeholder:t})=>e.createElement(dx,{bind:"to",label:(0,s.__)("Send to","elementor"),placeholder:t}),fx=()=>e.createElement(dx,{bind:"subject",label:(0,s.__)("Email subject","elementor"),placeholder:(0,s.__)("New form submission","elementor")}),mx=()=>{const t=ux();return e.createElement(m,{bind:"message"},e.createElement(i.Grid,{container:!0,direction:"column",gap:.5},e.createElement(i.Grid,{item:!0},e.createElement(k,null,(0,s.__)("Message","elementor"))),e.createElement(i.Grid,{item:!0},e.createElement(Dn,{suggestions:t})),e.createElement(i.Grid,{item:!0},e.createElement(G.InfoAlert,null,(()=>{if(!(0,l.hasProInstalled)())return!0;const e=window.elementorPro?.config?.version;return!!e&&(0,l.isVersionGreaterOrEqual)(e,"4.1.0")})()?(0,s.__)("[all-fields] shortcode sends all fields. Type @ to insert specific fields and customize your message.","elementor"):(0,s.__)("[all-fields] shortcode sends all fields.","elementor")))))},gx=()=>e.createElement(dx,{bind:"from",label:(0,s.__)("From email","elementor"),placeholder:(0,s.__)("What email should appear as the sender?","elementor")}),yx=()=>e.createElement(dx,{bind:"from-name",label:(0,s.__)("From name","elementor"),placeholder:(0,s.__)("What name should appear as the sender?","elementor")}),vx=()=>{const t=ux({inputType:"email"});return e.createElement(m,{bind:"reply-to"},e.createElement(i.Grid,{container:!0,direction:"column",gap:.5},e.createElement(i.Grid,{item:!0},e.createElement(k,null,(0,s.__)("Reply-to","elementor"))),e.createElement(i.Grid,{item:!0},e.createElement(Dn,{suggestions:t,rows:1,triggerPosition:"start",placeholder:(0,s.__)("You can type @ to insert an email field","elementor")}))))},bx=()=>e.createElement(dx,{bind:"cc",label:(0,s.__)("Cc","elementor")}),Ex=()=>e.createElement(dx,{bind:"bcc",label:(0,s.__)("Bcc","elementor")}),wx=()=>e.createElement(m,{bind:"meta-data"},e.createElement(i.Stack,{gap:.5},e.createElement(k,null,(0,s.__)("Metadata","elementor")),e.createElement(Lo,{options:[{label:(0,s.__)("Date","elementor"),value:"date"},{label:(0,s.__)("Time","elementor"),value:"time"},{label:(0,s.__)("Page URL","elementor"),value:"page-url"},{label:(0,s.__)("User agent","elementor"),value:"user-agent"},{label:(0,s.__)("Credit","elementor"),value:"credit"}]}))),xx=()=>e.createElement(m,{bind:"send-as"},e.createElement(i.Grid,{container:!0,direction:"column",gap:.5},e.createElement(i.Grid,{item:!0},e.createElement(k,null,(0,s.__)("Send as","elementor"))),e.createElement(i.Grid,{item:!0},e.createElement(ee,{options:[{label:(0,s.__)("HTML","elementor"),value:"html"},{label:(0,s.__)("Plain Text","elementor"),value:"plain"}]})))),kx=()=>e.createElement(G.CollapsibleContent,{defaultOpen:!1},e.createElement(i.Box,{sx:{pt:2}},e.createElement(i.Stack,{gap:2},e.createElement(yx,null),e.createElement(vx,null),e.createElement(bx,null),e.createElement(Ex,null),e.createElement(i.Divider,null),e.createElement(wx,null),e.createElement(xx,null)))),Sx=D(({toPlaceholder:t})=>{const{value:n,setValue:r,...l}=b(o.emailPropTypeUtil);return e.createElement(d,px({},l,{value:n,setValue:r}),e.createElement(i.Stack,{gap:2},e.createElement(A,null,(0,s.__)("Email settings","elementor")),e.createElement(hx,{placeholder:t}),e.createElement(fx,null),e.createElement(mx,null),e.createElement(gx,null),e.createElement(kx,null)))}),Cx=D(({label:t,options:n})=>e.createElement(i.Grid,{container:!0,direction:"column",gap:1},t&&e.createElement(i.Grid,{item:!0},e.createElement(k,null,t)),e.createElement(i.Grid,{item:!0},e.createElement(ee,{options:n})),e.createElement(i.Grid,{item:!0},e.createElement(G.InfoAlert,null,(0,s.__)("Linked uploads are saved to the server. Direct attachments will not appear under Submissions.","elementor"))))),Tx=(0,e.forwardRef)(({promotionKey:t,children:n,trackingData:r},o)=>{const[s,l]=(0,e.useState)(!1),a=(c=t,window.elementor?.config?.v4Promotions?.[c]);var c;const u=(0,e.useCallback)(()=>{l(e=>(e||Va(r),!e))},[r]);return(0,e.useImperativeHandle)(o,()=>({toggle:u}),[u]),e.createElement(e.Fragment,null,a&&e.createElement(G.PromotionInfotip,{title:a.title,content:a.content,assetUrl:a.image,ctaUrl:a.ctaUrl,open:s,onClose:e=>{e.stopPropagation(),l(!1)},onCtaClick:()=>Ha(r)},e.createElement(i.Box,{onClick:e=>{e.stopPropagation(),u()},sx:{cursor:"pointer",display:"inline-flex"}},n??e.createElement(G.PromotionChip,null))))}),Ox=(0,s.__)("Display Conditions","elementor"),Ax={target_name:"display_conditions",location_l2:"general"},Mx=D(()=>{const t=(0,e.useRef)(null);return e.createElement(i.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",alignItems:"center"}},e.createElement(Tx,{ref:t,promotionKey:"displayConditions",trackingData:Ax}),e.createElement(i.Tooltip,{title:Ox,placement:"top"},e.createElement(i.IconButton,{size:"tiny","aria-label":Ox,"data-behavior":"display-conditions",onClick:()=>t.current?.toggle(),sx:{border:"1px solid",borderColor:"divider",borderRadius:1}},e.createElement(H.SitemapIcon,{fontSize:"tiny",color:"disabled"}))))}),Px=(0,s.__)("Attributes","elementor"),Ix={target_name:"attributes",location_l2:"general"},_x=D(()=>{const t=(0,e.useRef)(null);return e.createElement(i.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",alignItems:"center"}},e.createElement(Tx,{ref:t,promotionKey:"attributes",trackingData:Ix}),e.createElement(i.Tooltip,{title:Px,placement:"top"},e.createElement(H.PlusIcon,{"aria-label":Px,fontSize:"tiny",color:"disabled",onClick:()=>t.current?.toggle(),sx:{cursor:"pointer"}})))}),Nx=(0,i.styled)(i.IconButton)(({theme:e})=>({width:e.spacing(2.5),height:e.spacing(2.5)})),Rx=({tooltipText:t,onClick:n,disabled:r,size:o="tiny"})=>e.createElement(i.Tooltip,{title:t,placement:"top",disableInteractive:!0},e.createElement(Nx,{"aria-label":t,size:o,onClick:n,disabled:r},e.createElement(H.BrushBigIcon,{fontSize:o})));function Dx(){return Dx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dx.apply(null,arguments)}const Lx="tiny",zx=({label:t,itemSettings:n,disabled:r=!1,openOnAdd:o=!1,values:l=[],setValues:a,showDuplicate:c=!0,showToggle:u=!0,showRemove:p=!0,disableAddItemButton:d=!1,addButtonInfotipContent:h,openItem:f=-1,isSortable:m=!0})=>{const[g,y]=(0,e.useState)(f),v=l.map((e,t)=>m&&"getId"in n?n.getId({item:e,index:t}):String(t)),b=r||d,E=b&&h,w=e.createElement(i.IconButton,{size:Lx,sx:{ml:"auto"},disabled:b,onClick:()=>{const e=structuredClone(n.initialValues),t=l.length;a([...l,e],{},{action:{type:"add",payload:[{index:t,item:e}]}}),o&&y(t)},"aria-label":(0,s.__)("Add item","elementor")},e.createElement(H.PlusIcon,{fontSize:Lx}));return e.createElement(sr,{gap:2},e.createElement(no,{label:t,adornment:O},E?e.createElement(i.Infotip,{placement:"right",content:h,color:"secondary",slotProps:{popper:{sx:{width:300}}}},e.createElement(i.Box,{sx:{...b?{cursor:"not-allowed"}:{}}},w)):w),0<v.length&&e.createElement(kr,{value:v,onChange:(e,t)=>{a(e.map(e=>l[v.indexOf(e)]),{},{action:{type:"reorder",payload:{...t}}})}},v.map(t=>{const i=v.indexOf(t),s=l[i];return s?e.createElement(Sr,{id:t,key:`sortable-${t}`,disabled:!m},e.createElement(jx,{disabled:r,propDisabled:s?.disabled,label:e.createElement(Lr,{value:s},e.createElement(n.Label,{value:s,index:i})),startIcon:e.createElement(Rr,{value:s},e.createElement(n.Icon,{value:s})),removeItem:()=>(e=>{const t=l[e];a(l.filter((t,n)=>n!==e),{},{action:{type:"remove",payload:[{index:e,item:t}]}})})(i),duplicateItem:()=>(e=>{const t=structuredClone(l[e]),n=1+e;a([...l.slice(0,n),t,...l.slice(n)],{},{action:{type:"duplicate",payload:[{index:e,item:t}]}})})(i),toggleDisableItem:()=>(e=>{a(l.map((t,n)=>{if(n===e){const{disabled:e,...n}=t;return{...n,...e?{}:{disabled:!0}}}return t}),{},{action:{type:"toggle-disable"}})})(i),openOnMount:o&&g===i,onOpen:()=>y(-1),onPopoverOpen:n.onPopoverOpen,onPopoverClose:n.onPopoverClose,showDuplicate:c,showToggle:u,showRemove:p,actions:n.actions,value:s},t=>e.createElement(n.Content,Dx({},t,{value:s,bind:String(i),index:i})))):null})))},jx=({label:t,propDisabled:n,startIcon:r,children:o,removeItem:l,duplicateItem:a,toggleDisableItem:c,openOnMount:u,onOpen:p,onPopoverOpen:d,onPopoverClose:h,showDuplicate:f,showToggle:m,showRemove:g,disabled:y,actions:v,value:b})=>{const E=h?()=>h(b):void 0,{popoverState:w,popoverProps:x,ref:k,setRef:S}=$x(u,()=>{p(),d?.(b)},E),C=(0,i.bindTrigger)(w);dr({isOpen:w.isOpen,onClose:x.onClose});const T=(0,s.__)("Duplicate","elementor"),O=n?(0,s.__)("Show","elementor"):(0,s.__)("Hide","elementor"),A=(0,s.__)("Remove","elementor");return e.createElement(i.Box,{sx:{display:"contents"}},e.createElement(_r,Dx({disabled:y,label:t,ref:S,"aria-label":(0,s.__)("Open item","elementor")},C,{onClick:e=>{C.onClick(e),w.isOpen||d?.(b)},startIcon:r,actions:e.createElement(e.Fragment,null,f&&e.createElement(i.Tooltip,{title:T,placement:"top"},e.createElement(i.IconButton,{size:Lx,onClick:a,"aria-label":T},e.createElement(H.CopyIcon,{fontSize:Lx}))),m&&e.createElement(i.Tooltip,{title:O,placement:"top"},e.createElement(i.IconButton,{size:Lx,onClick:c,"aria-label":O},n?e.createElement(H.EyeOffIcon,{fontSize:Lx}):e.createElement(H.EyeIcon,{fontSize:Lx}))),v?.(b),g&&e.createElement(i.Tooltip,{title:A,placement:"top"},e.createElement(i.IconButton,{size:Lx,onClick:l,"aria-label":A},e.createElement(H.XIcon,{fontSize:Lx}))))})),e.createElement(Yr,Dx({width:k?.getBoundingClientRect().width},x,{anchorEl:k}),e.createElement(i.Box,null,o({anchorEl:k}))))},$x=(t,n,r)=>{const[o,s]=(0,e.useState)(null),l=(0,i.usePopupState)({variant:"popover"}),a=(0,i.bindPopover)(l);return(0,e.useEffect)(()=>{t&&o&&(l.open(o),n?.())},[o]),{popoverState:l,ref:o,setRef:s,popoverProps:{...a,onClose:()=>{a.onClose?.(),r?.()}}}};function Bx(){return Bx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bx.apply(null,arguments)}const Fx=({popupState:t,restoreValue:n,anchorRef:r,value:o,onChange:l,openInNewTab:a,onToggleNewTab:c})=>{const u=(0,e.useRef)(null);(0,e.useEffect)(()=>{t.isOpen&&requestAnimationFrame(()=>u.current?.focus())},[t.isOpen]);const p=()=>{n(),t.close()};return e.createElement(i.Popover,Bx({slotProps:{paper:{sx:{borderRadius:"16px",width:r.current?.offsetWidth+"px",marginTop:-1}}}},(0,i.bindPopover)(t),{anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:p}),e.createElement(i.Stack,{direction:"row",alignItems:"center",gap:1,sx:{p:1.5}},e.createElement(i.TextField,{value:o,onChange:l,size:"tiny",fullWidth:!0,placeholder:(0,s.__)("Type a URL","elementor"),inputProps:{ref:u},color:"secondary",InputProps:{sx:{borderRadius:"8px"}},onKeyUp:e=>"Enter"===e.key&&p()}),e.createElement(i.Tooltip,{title:(0,s.__)("Open in a new tab","elementor")},e.createElement(i.ToggleButton,{size:"tiny",value:"newTab",selected:a,onClick:c,"aria-label":(0,s.__)("Open in a new tab","elementor"),sx:{borderRadius:"8px"}},e.createElement(H.ExternalLinkIcon,{fontSize:"tiny"})))))},Ux=({editor:t,elementId:n,sx:r={}})=>{const[o,s]=(0,e.useState)(""),[l,a]=(0,e.useState)(!1),c=(0,e.useRef)(null),u=(0,i.usePopupState)({variant:"popover"}),p=!!n&&Vx(n),d=Hw({editor:t,selector:e=>Kx.filter(t=>e.editor.isActive(t))}),h=(0,e.useMemo)(()=>{const e=Object.values(Gx);return p?e.filter(e=>"link"!==e.action):e},[p]);return(0,e.useEffect)(()=>{t?.commands?.focus()},[t]),e.createElement(i.Box,{ref:c,sx:{display:"inline-flex",gap:.5,padding:.5,borderRadius:"8px",backgroundColor:"background.paper",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.2)",alignItems:"center",visibility:u.isOpen?"hidden":"visible",pointerEvents:u.isOpen?"none":"all",...r}},e.createElement(i.Tooltip,{title:Wx.label,placement:"top",sx:{borderRadius:"8px"}},e.createElement(i.IconButton,{"aria-label":Wx.label,onClick:()=>Wx.method(t),size:"tiny"},Wx.icon)),e.createElement(i.ToggleButtonGroup,{value:d,size:"tiny",sx:{display:"flex",gap:.5,border:"none",[`& .${i.toggleButtonGroupClasses.firstButton}, & .${i.toggleButtonGroupClasses.middleButton}, & .${i.toggleButtonGroupClasses.lastButton}`]:{borderRadius:"8px",border:"none",marginLeft:0,"&.Mui-selected":{marginLeft:0},"& + &.Mui-selected":{marginLeft:0}}}},h.map(n=>e.createElement(i.Tooltip,{title:n.label,key:n.action,placement:"top"},e.createElement(i.ToggleButton,{value:n.action,"aria-label":n.label,size:"tiny",onClick:()=>{"link"===n.action?(()=>{const e=t.getAttributes("link");s(e.href||""),a("_blank"===e.target),u.open(c.current)})():n.method?.(t),t?.commands?.focus()}},n.icon)))),e.createElement(Fx,{popupState:u,anchorRef:c,restoreValue:()=>{o?t.chain().focus().setLink({href:o,target:l?"_blank":"_self"}).run():t.chain().focus().unsetLink().run(),n&&window.dispatchEvent(new CustomEvent("elementor:inline-link-changed",{detail:{elementId:n}})),u.close()},value:o,onChange:e=>{s(e.target.value)},openInNewTab:l,onToggleNewTab:()=>{a(!l)}}))},Vx=e=>{const t=(0,Ui.getContainer)(e),n=t?.model.get("widgetType"),r="e-button"===n,o=!!(0,Ui.getElementSetting)(e,"link")?.value?.destination;return r||o},Hx={clear:{label:(0,s.__)("Clear","elementor"),icon:e.createElement(H.MinusIcon,{fontSize:"tiny"}),action:"clear",method:e=>{e.chain().focus().clearNodes().unsetAllMarks().run()}},bold:{label:(0,s.__)("Bold","elementor"),icon:e.createElement(H.BoldIcon,{fontSize:"tiny"}),action:"bold",method:e=>{e.chain().focus().toggleBold().run()}},italic:{label:(0,s.__)("Italic","elementor"),icon:e.createElement(H.ItalicIcon,{fontSize:"tiny"}),action:"italic",method:e=>{e.chain().focus().toggleItalic().run()}},underline:{label:(0,s.__)("Underline","elementor"),icon:e.createElement(H.UnderlineIcon,{fontSize:"tiny"}),action:"underline",method:e=>{e.chain().focus().toggleUnderline().run()}},strike:{label:(0,s.__)("Strikethrough","elementor"),icon:e.createElement(H.StrikethroughIcon,{fontSize:"tiny"}),action:"strike",method:e=>{e.chain().focus().toggleStrike().run()}},superscript:{label:(0,s.__)("Superscript","elementor"),icon:e.createElement(H.SuperscriptIcon,{fontSize:"tiny"}),action:"superscript",method:e=>{e.chain().focus().toggleSuperscript().run()}},subscript:{label:(0,s.__)("Subscript","elementor"),icon:e.createElement(H.SubscriptIcon,{fontSize:"tiny"}),action:"subscript",method:e=>{e.chain().focus().toggleSubscript().run()}},link:{label:(0,s.__)("Link","elementor"),icon:e.createElement(H.LinkIcon,{fontSize:"tiny"}),action:"link",method:null}},{clear:Wx,...Gx}=Hx,Kx=Object.keys(Gx);function qx(){return qx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qx.apply(null,arguments)}const Jx={display:"flex",flexDirection:"column",justifyContent:"center"},Yx=({value:t,showPrimaryColor:n,onClick:r,options:o})=>{const s=(0,i.usePopupState)({variant:"popover",popupId:(0,e.useId)()});return e.createElement(e.Fragment,null,e.createElement(Xx,qx({isPrimaryColor:n,size:"small"},(0,i.bindTrigger)(s)),t),e.createElement(i.Menu,qx({MenuListProps:{dense:!0}},(0,i.bindMenu)(s)),o.map((t,n)=>e.createElement(G.MenuListItem,{key:t,onClick:()=>(e=>{r(o[e]),s.close()})(n),primaryTypographyProps:{variant:"caption",sx:{...Jx,lineHeight:"1"}},menuItemTextProps:{sx:Jx}},t.toUpperCase()))))},Xx=(0,i.styled)(i.Button,{shouldForwardProp:e=>"isPrimaryColor"!==e})(({isPrimaryColor:e,theme:t})=>({color:e?t.palette.text.primary:t.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),Qx=(0,e.forwardRef)(({type:t,value:n,onChange:r,onKeyDown:o,onKeyUp:i,InputProps:s,onBlur:l,focused:a,disabled:c},u)=>e.createElement(Wn,{ref:u,size:"tiny",fullWidth:!0,type:t,value:n,onKeyUp:i,focused:a,disabled:c,onKeyDown:o,onInput:r,onBlur:l,InputProps:s,sx:Zx(s?.readOnly??!1)})),Zx=e=>({input:{cursor:e?"default !important":void 0}}),ek=({value:t,InputProps:n,onChange:r,onBlur:o,units:s,defaultUnit:l,startIcon:a})=>{const{size:c,unit:u,setSize:p,setUnit:d}=((e,t,n)=>{const[r,o]=Zn({external:e,setExternal:e=>{null!==e&&t(e)},persistWhen:t=>((e,t)=>e?.size!==t?.size||e?.unit!==t?.unit)(t,e),fallback:()=>({size:"",unit:n??"px"})});return{size:r.size,unit:r.unit,setSize:e=>{const t={...r,size:""===e.trim()?null:Number(e)};o(t)},setUnit:e=>{const t={...r,unit:e};o(t)}}})(t,r,l);return e.createElement(Qx,{type:"number",value:c??"",onBlur:o,onChange:e=>p(e.target.value),InputProps:{...n,startAdornment:a&&e.createElement(i.InputAdornment,{position:"start"},a),endAdornment:e.createElement(i.InputAdornment,{position:"end"},e.createElement(Yx,{options:s,value:u,onClick:d,showPrimaryColor:tk(c)}))}})},tk=e=>null!==e&&""!==e,nk=()=>{const{groups:t,options:n}=(()=>{const{controls:e}=(0,Vi.getElementorConfig)();return e?.font??{}})();return(0,e.useMemo)(()=>{if(!t||!n)return[];const e=Object.keys(t),r=new Map(e.map((e,t)=>[e,t]));return Object.entries(n).reduce((e,[n,o])=>{const i=r.get(o);return void 0===i||(e[i]||(e[i]={label:t[o],fonts:[]}),e[i].fonts.push(n)),e},[]).filter(Boolean)},[t,n])}}(),(window.elementorV2=window.elementorV2||{}).editorControls=r}(),window.elementorV2.editorControls?.init?.();
💾 Save Changes
❌ Cancel