← All changes
|
assets/js/packages/editor-controls/editor-controls.min.js
+16
-16
4.2.0-dev2
→
4.1.0-beta3
View file →
| @@ -1,13 +1,13 @@ | ||
| 1 | 1 | /*! For license information please see editor-controls.min.js.LICENSE.txt */ |
| 2 | -!function(){var r={2020:function(r){"use strict";r.exports=window.elementorV2.editorProps},5067:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Paragraph:()=>E,default:()=>w}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=" ",E=b.Node.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},parseMarkdown:(r,o)=>{const i=r.tokens||[];if(1===i.length&&"image"===i[0].type)return o.parseChildren([i[0]]);const a=o.parseInline(i);return 1!==a.length||"text"!==a[0].type||a[0].text!==k&&" "!==a[0].text?o.createNode("paragraph",void 0,a):o.createNode("paragraph",void 0,[])},renderMarkdown:(r,o)=>{if(!r)return"";const i=Array.isArray(r.content)?r.content:[];return 0===i.length?k:o.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),w=E},5527:function(r){"use strict";r.exports=window.elementorV2.editorV1Adapters},5820:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Subscript:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Mark.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(r){return"sub"===r&&null}}]},renderHTML({HTMLAttributes:r}){return["sub",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},addCommands(){return{setSubscript:()=>({commands:r})=>r.setMark(this.name),toggleSubscript:()=>({commands:r})=>r.toggleMark(this.name),unsetSubscript:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),E=k},14841:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Superscript:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Mark.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(r){return"super"===r&&null}}]},renderHTML({HTMLAttributes:r}){return["sup",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},addCommands(){return{setSuperscript:()=>({commands:r})=>r.setMark(this.name),toggleSuperscript:()=>({commands:r})=>r.toggleMark(this.name),unsetSuperscript:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),E=k},18998:function(r){"use strict";r.exports=window.elementorV2.httpClient},19721:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Underline:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Mark.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:r=>!!r.includes("underline")&&{}}]},renderHTML({HTMLAttributes:r}){return["u",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},parseMarkdown(r,o){return o.applyMark(this.name||"underline",o.parseInline(r.tokens||[]))},renderMarkdown(r,o){return`++${o.renderChildren(r)}++`},markdownTokenizer:{name:"underline",level:"inline",start(r){return r.indexOf("++")},tokenize(r,o,i){const a=/^(\+\+)([\s\S]+?)(\+\+)/.exec(r);if(!a)return;const c=a[2].trim();return{type:"underline",raw:a[0],text:c,tokens:i.inlineTokens(c)}}},addCommands(){return{setUnderline:()=>({commands:r})=>r.setMark(this.name),toggleUnderline:()=>({commands:r})=>r.toggleMark(this.name),unsetUnderline:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),E=k},19888:function(r,o,i){"use strict";r.exports=i(58493)},21020:function(r,o,i){"use strict";var a=i(97557),c=Symbol.for("react.element"),u=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,g=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function q(r,o,i){var a,u={},b=null,k=null;for(a in void 0!==i&&(b=""+i),void 0!==o.key&&(b=""+o.key),void 0!==o.ref&&(k=o.ref),o)p.call(o,a)&&!v.hasOwnProperty(a)&&(u[a]=o[a]);if(r&&r.defaultProps)for(a in o=r.defaultProps)void 0===u[a]&&(u[a]=o[a]);return{$$typeof:c,type:r,key:b,ref:k,props:u,_owner:g.current}}o.Fragment=u,o.jsx=q,o.jsxs=q},21765:function(r){"use strict";var o,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,p={};function Fragment(r){return r.children}((r,o)=>{for(var a in o)i(r,a,{get:o[a],enumerable:!0})})(p,{Fragment:()=>Fragment,createElement:()=>h,h:()=>h,jsx:()=>h,jsxDEV:()=>h,jsxs:()=>h}),r.exports=(o=p,((r,o,p,g)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of c(o))u.call(r,v)||v===p||i(r,v,{get:()=>o[v],enumerable:!(g=a(o,v))||g.enumerable});return r})(i({},"__esModule",{value:!0}),o));var h=(r,o)=>{if("slot"===r)return 0;if(r instanceof Function)return r(o);const{children:i,...a}=null!=o?o:{};if("svg"===r)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[r,a,i]}},22162:function(r,o,i){"use strict";var a=i(97557),c=i(19888);var u="function"==typeof Object.is?Object.is:function is(r,o){return r===o&&(0!==r||1/r==1/o)||r!=r&&o!=o},p=c.useSyncExternalStore,g=a.useRef,v=a.useEffect,b=a.useMemo,k=a.useDebugValue;o.useSyncExternalStoreWithSelector=function(r,o,i,a,c){var E=g(null);if(null===E.current){var w={hasValue:!1,value:null};E.current=w}else w=E.current;E=b(function(){function memoizedSelector(o){if(!g){if(g=!0,r=o,o=a(o),void 0!==c&&w.hasValue){var i=w.value;if(c(i,o))return p=i}return p=o}if(i=p,u(r,o))return i;var v=a(o);return void 0!==c&&c(i,v)?(r=o,i):(r=o,p=v)}var r,p,g=!1,v=void 0===i?null:i;return[function(){return memoizedSelector(o())},null===v?void 0:function(){return memoizedSelector(v())}]},[o,i,a,c]);var x=p(r,E[0],E[1]);return v(function(){w.hasValue=!0,w.value=x},[x]),k(x),x}},22444:function(r){"use strict";r.exports=window.elementorV2.utils},24007:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(57449))},24413:function(r){"use strict";r.exports=window.elementorV2.icons},26401:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(36553))},27096:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Bold:()=>_,default:()=>T,starInputRegex:()=>E,starPasteRegex:()=>w,underscoreInputRegex:()=>x,underscorePasteRegex:()=>C}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=i(38882),E=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,w=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,x=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,C=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,_=b.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>"normal"!==r.style.fontWeight&&null},{style:"font-weight=400",clearMark:r=>r.type.name===this.name},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return(0,k.jsx)("strong",{...(0,b.mergeAttributes)(this.options.HTMLAttributes,r),children:(0,k.jsx)("slot",{})})},markdownTokenName:"strong",parseMarkdown:(r,o)=>o.applyMark("bold",o.parseInline(r.tokens||[])),renderMarkdown:(r,o)=>`**${o.renderChildren(r)}**`,addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,b.markInputRule)({find:E,type:this.type}),(0,b.markInputRule)({find:x,type:this.type})]},addPasteRules(){return[(0,b.markPasteRule)({find:w,type:this.type}),(0,b.markPasteRule)({find:C,type:this.type})]}}),T=_},27723:function(r){"use strict";r.exports=window.wp.i18n},29656:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{HardBreak:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Node.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",(0,b.mergeAttributes)(this.options.HTMLAttributes,r)]},renderText(){return"\n"},renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:r,chain:o,state:i,editor:a})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:r,storedMarks:c}=i;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:p}=a.extensionManager,g=c||r.$to.parentOffset&&r.$from.marks();return o().insertContent({type:this.name}).command(({tr:r,dispatch:o})=>{if(o&&g&&u){const o=g.filter(r=>p.includes(r.type.name));r.ensureMarks(o)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),E=k},32386:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(77712))},33176:function(r){"use strict";r.exports=window.elementorV2.events},34243:function(r,o,i){"use strict";var a=i(36553),c=i(77712),u=i(37820),p=["ol",0],g=["ul",0],v=["li",0],b={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:function getAttrs(r){return{order:r.hasAttribute("start")?+r.getAttribute("start"):1}}}],toDOM:function toDOM(r){return 1==r.attrs.order?p:["ol",{start:r.attrs.order},0]}},k={parseDOM:[{tag:"ul"}],toDOM:function toDOM(){return g}},E={parseDOM:[{tag:"li"}],toDOM:function toDOM(){return v},defining:!0};function add(r,o){var i={};for(var a in r)i[a]=r[a];for(var c in o)i[c]=o[c];return i}function wrapRangeInList(r,o,i){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,p=!1,g=o,v=o.$from.doc;if(o.depth>=2&&o.$from.node(o.depth-1).type.compatibleContent(i)&&0==o.startIndex){if(0==o.$from.index(o.depth-1))return!1;var b=v.resolve(o.start-2);g=new c.NodeRange(b,b,o.depth),o.endIndex<o.parent.childCount&&(o=new c.NodeRange(o.$from,v.resolve(o.$to.end(o.depth)),o.depth)),p=!0}var k=a.findWrapping(g,i,u,o);return!!k&&(r&&function doWrapInList(r,o,i,u,p){for(var g=c.Fragment.empty,v=i.length-1;v>=0;v--)g=c.Fragment.from(i[v].type.create(i[v].attrs,g));r.step(new a.ReplaceAroundStep(o.start-(u?2:0),o.end,o.start,o.end,new c.Slice(g,0,0),i.length,!0));for(var b=0,k=0;k<i.length;k++)i[k].type==p&&(b=k+1);for(var E=i.length-b,w=o.start+i.length-(u?2:0),x=o.parent,C=o.startIndex,_=o.endIndex,T=!0;C<_;C++,T=!1)!T&&a.canSplit(r.doc,w,E)&&(r.split(w,E),w+=2*E),w+=x.child(C).nodeSize;return r}(r,o,k,p,i),!0)}function splitListItem(r,o){return function(i,p){var g=i.selection,v=g.$from,b=g.$to,k=g.node;if(k&&k.isBlock||v.depth<2||!v.sameParent(b))return!1;var E=v.node(-1);if(E.type!=r)return!1;if(0==v.parent.content.size&&v.node(-1).childCount==v.indexAfter(-1)){if(3==v.depth||v.node(-3).type!=r||v.index(-2)!=v.node(-2).childCount-1)return!1;if(p){for(var w=c.Fragment.empty,x=v.index(-1)?1:v.index(-2)?2:3,C=v.depth-x;C>=v.depth-3;C--)w=c.Fragment.from(v.node(C).copy(w));var _=v.indexAfter(-1)<v.node(-2).childCount?1:v.indexAfter(-2)<v.node(-3).childCount?2:3;w=w.append(c.Fragment.from(r.createAndFill()));var T=v.before(v.depth-(x-1)),P=i.tr.replace(T,v.after(-_),new c.Slice(w,4-x,0)),A=-1;P.doc.nodesBetween(T,P.doc.content.size,function(r,o){if(A>-1)return!1;r.isTextblock&&0==r.content.size&&(A=o+1)}),A>-1&&P.setSelection(u.Selection.near(P.doc.resolve(A))),p(P.scrollIntoView())}return!0}var N=b.pos==v.end()?E.contentMatchAt(0).defaultType:null,R=i.tr.delete(v.pos,b.pos),I=N?[o?{type:r,attrs:o}:null,{type:N}]:void 0;return!!a.canSplit(R.doc,v.pos,2,I)&&(p&&p(R.split(v.pos,2,I).scrollIntoView()),!0)}}o.addListNodes=function addListNodes(r,o,i){return r.append({ordered_list:add(b,{content:"list_item+",group:i}),bullet_list:add(k,{content:"list_item+",group:i}),list_item:add(E,{content:o})})},o.bulletList=k,o.liftListItem=function liftListItem(r){return function(o,i){var u=o.selection,p=u.$from,g=u.$to,v=p.blockRange(g,function(o){return o.childCount>0&&o.firstChild.type==r});return!!v&&(!i||(p.node(v.depth-1).type==r?function liftToOuterList(r,o,i,u){var p=r.tr,g=u.end,v=u.$to.end(u.depth);g<v&&(p.step(new a.ReplaceAroundStep(g-1,v,g,v,new c.Slice(c.Fragment.from(i.create(null,u.parent.copy())),1,0),1,!0)),u=new c.NodeRange(p.doc.resolve(u.$from.pos),p.doc.resolve(v),u.depth));var b=a.liftTarget(u);if(null==b)return!1;p.lift(u,b);var k=p.doc.resolve(p.mapping.map(g,-1)-1);a.canJoin(p.doc,k.pos)&&k.nodeBefore.type==k.nodeAfter.type&&p.join(k.pos);return o(p.scrollIntoView()),!0}(o,i,r,v):function liftOutOfList(r,o,i){for(var u=r.tr,p=i.parent,g=i.end,v=i.endIndex-1,b=i.startIndex;v>b;v--)g-=p.child(v).nodeSize,u.delete(g-1,g+1);var k=u.doc.resolve(i.start),E=k.nodeAfter;if(u.mapping.map(i.end)!=i.start+k.nodeAfter.nodeSize)return!1;var w=0==i.startIndex,x=i.endIndex==p.childCount,C=k.node(-1),_=k.index(-1);if(!C.canReplace(_+(w?0:1),_+1,E.content.append(x?c.Fragment.empty:c.Fragment.from(p))))return!1;var T=k.pos,P=T+E.nodeSize;return u.step(new a.ReplaceAroundStep(T-(w?1:0),P+(x?1:0),T+1,P-1,new c.Slice((w?c.Fragment.empty:c.Fragment.from(p.copy(c.Fragment.empty))).append(x?c.Fragment.empty:c.Fragment.from(p.copy(c.Fragment.empty))),w?0:1,x?0:1),w?0:1)),o(u.scrollIntoView()),!0}(o,i,v)))}},o.listItem=E,o.orderedList=b,o.sinkListItem=function sinkListItem(r){return function(o,i){var u=o.selection,p=u.$from,g=u.$to,v=p.blockRange(g,function(o){return o.childCount>0&&o.firstChild.type==r});if(!v)return!1;var b=v.startIndex;if(0==b)return!1;var k=v.parent,E=k.child(b-1);if(E.type!=r)return!1;if(i){var w=E.lastChild&&E.lastChild.type==k.type,x=c.Fragment.from(w?r.create():null),C=new c.Slice(c.Fragment.from(r.create(null,c.Fragment.from(k.type.create(null,x)))),w?3:1,0),_=v.start,T=v.end;i(o.tr.step(new a.ReplaceAroundStep(_-(w?3:1),T,_,T,C,1,!0)).scrollIntoView())}return!0}},o.splitListItem=splitListItem,o.splitListItemKeepMarks=function splitListItemKeepMarks(r,o){var i=splitListItem(r,o);return function(r,o){return i(r,o&&function(i){var a=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();a&&i.ensureMarks(a),o(i)})}},o.wrapInList=function wrapInList(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(i,a){var c=i.selection,u=c.$from,p=c.$to,g=u.blockRange(p);if(!g)return!1;var v=a?i.tr:null;return!!wrapRangeInList(v,g,r,o)&&(a&&a(v.scrollIntoView()),!0)}},o.wrapRangeInList=wrapRangeInList},35423:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(34243))},36553:function(r,o,i){"use strict";function _wrapNativeSuper(r){var o="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(r){if(null===r||!function _isNativeFunction(r){try{return-1!==Function.toString.call(r).indexOf("[native code]")}catch(o){return"function"==typeof r}}(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(r))return o.get(r);o.set(r,Wrapper)}function Wrapper(){return _construct(r,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(r.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,r)},_wrapNativeSuper(r)}function _construct(r,o,i){return _construct=_isNativeReflectConstruct()?Reflect.construct.bind():function _construct(r,o,i){var a=[null];a.push.apply(a,o);var c=new(Function.bind.apply(r,a));return i&&_setPrototypeOf(c,i.prototype),c},_construct.apply(null,arguments)}function _inherits(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),o&&_setPrototypeOf(r,o)}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _createSuper(r){var o=_isNativeReflectConstruct();return function _createSuperInternal(){var i,a=_getPrototypeOf(r);if(o){var c=_getPrototypeOf(this).constructor;i=Reflect.construct(a,arguments,c)}else i=a.apply(this,arguments);return function _possibleConstructorReturn(r,o){if(o&&("object"===_typeof(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,i)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,_toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _toPropertyKey(r){var o=function _toPrimitive(r,o){if("object"!==_typeof(r)||null===r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"===_typeof(o)?o:String(o)}var a=i(77712),c=Math.pow(2,16);function makeRecover(r,o){return r+o*c}function recoverIndex(r){return 65535&r}var u=function(){function MapResult(r,o,i){_classCallCheck(this,MapResult),this.pos=r,this.delInfo=o,this.recover=i}return _createClass(MapResult,[{key:"deleted",get:function get(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function get(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function get(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function get(){return(4&this.delInfo)>0}}]),MapResult}(),p=function(){function StepMap(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(_classCallCheck(this,StepMap),this.ranges=r,this.inverted=o,!r.length&&StepMap.empty)return StepMap.empty}return _createClass(StepMap,[{key:"recover",value:function recover(r){var o=0,i=recoverIndex(r);if(!this.inverted)for(var a=0;a<i;a++)o+=this.ranges[3*a+2]-this.ranges[3*a+1];return this.ranges[3*i]+o+function recoverOffset(r){return(r-(65535&r))/c}(r)}},{key:"mapResult",value:function mapResult(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(r,o,!1)}},{key:"map",value:function map(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(r,o,!0)}},{key:"_map",value:function _map(r,o,i){for(var a=0,c=this.inverted?2:1,p=this.inverted?1:2,g=0;g<this.ranges.length;g+=3){var v=this.ranges[g]-(this.inverted?a:0);if(v>r)break;var b=this.ranges[g+c],k=this.ranges[g+p],E=v+b;if(r<=E){var w=v+a+((b?r==v?-1:r==E?1:o:o)<0?0:k);if(i)return w;var x=r==(o<0?v:E)?null:makeRecover(g/3,r-v),C=r==v?2:r==E?1:4;return(o<0?r!=v:r!=E)&&(C|=8),new u(w,C,x)}a+=k-b}return i?r+a:new u(r+a,0,null)}},{key:"touches",value:function touches(r,o){for(var i=0,a=recoverIndex(o),c=this.inverted?2:1,u=this.inverted?1:2,p=0;p<this.ranges.length;p+=3){var g=this.ranges[p]-(this.inverted?i:0);if(g>r)break;var v=this.ranges[p+c];if(r<=g+v&&p==3*a)return!0;i+=this.ranges[p+u]-v}return!1}},{key:"forEach",value:function forEach(r){for(var o=this.inverted?2:1,i=this.inverted?1:2,a=0,c=0;a<this.ranges.length;a+=3){var u=this.ranges[a],p=u-(this.inverted?c:0),g=u+(this.inverted?0:c),v=this.ranges[a+o],b=this.ranges[a+i];r(p,p+v,g,g+b),c+=b-v}}},{key:"invert",value:function invert(){return new StepMap(this.ranges,!this.inverted)}},{key:"toString",value:function toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function offset(r){return 0==r?StepMap.empty:new StepMap(r<0?[0,-r,0]:[0,0,r])}}]),StepMap}();p.empty=new p([]);var g=function(){function Mapping(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r?r.length:0;_classCallCheck(this,Mapping),this.mirror=o,this.from=i,this.to=a,this._maps=r||[],this.ownData=!(r||o)}return _createClass(Mapping,[{key:"maps",get:function get(){return this._maps}},{key:"slice",value:function slice(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new Mapping(this._maps,this.mirror,r,o)}},{key:"appendMap",value:function appendMap(r,o){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(r),null!=o&&this.setMirror(this._maps.length-1,o)}},{key:"appendMapping",value:function appendMapping(r){for(var o=0,i=this._maps.length;o<r._maps.length;o++){var a=r.getMirror(o);this.appendMap(r._maps[o],null!=a&&a<o?i+a:void 0)}}},{key:"getMirror",value:function getMirror(r){if(this.mirror)for(var o=0;o<this.mirror.length;o++)if(this.mirror[o]==r)return this.mirror[o+(o%2?-1:1)]}},{key:"setMirror",value:function setMirror(r,o){this.mirror||(this.mirror=[]),this.mirror.push(r,o)}},{key:"appendMappingInverted",value:function appendMappingInverted(r){for(var o=r.maps.length-1,i=this._maps.length+r._maps.length;o>=0;o--){var a=r.getMirror(o);this.appendMap(r._maps[o].invert(),null!=a&&a>o?i-a-1:void 0)}}},{key:"invert",value:function invert(){var r=new Mapping;return r.appendMappingInverted(this),r}},{key:"map",value:function map(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(r,o,!0);for(var i=this.from;i<this.to;i++)r=this._maps[i].map(r,o);return r}},{key:"mapResult",value:function mapResult(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(r,o,!1)}},{key:"_map",value:function _map(r,o,i){for(var a=0,c=this.from;c<this.to;c++){var p=this._maps[c].mapResult(r,o);if(null!=p.recover){var g=this.getMirror(c);if(null!=g&&g>c&&g<this.to){c=g,r=this._maps[g].recover(p.recover);continue}}a|=p.delInfo,r=p.pos}return i?r:new u(r,a,null)}}]),Mapping}(),v=Object.create(null),b=function(){function Step(){_classCallCheck(this,Step)}return _createClass(Step,[{key:"getMap",value:function getMap(){return p.empty}},{key:"merge",value:function merge(r){return null}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o||!o.stepType)throw new RangeError("Invalid input for Step.fromJSON");var i=v[o.stepType];if(!i)throw new RangeError("No step type ".concat(o.stepType," defined"));return i.fromJSON(r,o)}},{key:"jsonID",value:function jsonID(r,o){if(r in v)throw new RangeError("Duplicate use of step JSON ID "+r);return v[r]=o,o.prototype.jsonID=r,o}}]),Step}(),k=function(){function StepResult(r,o){_classCallCheck(this,StepResult),this.doc=r,this.failed=o}return _createClass(StepResult,null,[{key:"ok",value:function ok(r){return new StepResult(r,null)}},{key:"fail",value:function fail(r){return new StepResult(null,r)}},{key:"fromReplace",value:function fromReplace(r,o,i,c){try{return StepResult.ok(r.replace(o,i,c))}catch(r){if(r instanceof a.ReplaceError)return StepResult.fail(r.message);throw r}}}]),StepResult}();function mapFragment(r,o,i){for(var c=[],u=0;u<r.childCount;u++){var p=r.child(u);p.content.size&&(p=p.copy(mapFragment(p.content,o,p))),p.isInline&&(p=o(p,i,u)),c.push(p)}return a.Fragment.fromArray(c)}var E=function(r){_inherits(AddMarkStep,r);var o=_createSuper(AddMarkStep);function AddMarkStep(r,i,a){var c;return _classCallCheck(this,AddMarkStep),(c=o.call(this)).from=r,c.to=i,c.mark=a,c}return _createClass(AddMarkStep,[{key:"apply",value:function apply(r){var o=this,i=r.slice(this.from,this.to),c=r.resolve(this.from),u=c.node(c.sharedDepth(this.to)),p=new a.Slice(mapFragment(i.content,function(r,i){return r.isAtom&&i.type.allowsMarkType(o.mark.type)?r.mark(o.mark.addToSet(r.marks)):r},u),i.openStart,i.openEnd);return k.fromReplace(r,this.from,this.to,p)}},{key:"invert",value:function invert(){return new w(this.from,this.to,this.mark)}},{key:"map",value:function map(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new AddMarkStep(o.pos,i.pos,this.mark)}},{key:"merge",value:function merge(r){return r instanceof AddMarkStep&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from?new AddMarkStep(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark):null}},{key:"toJSON",value:function toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.from||"number"!=typeof o.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new AddMarkStep(o.from,o.to,r.markFromJSON(o.mark))}}]),AddMarkStep}(b);b.jsonID("addMark",E);var w=function(r){_inherits(RemoveMarkStep,r);var o=_createSuper(RemoveMarkStep);function RemoveMarkStep(r,i,a){var c;return _classCallCheck(this,RemoveMarkStep),(c=o.call(this)).from=r,c.to=i,c.mark=a,c}return _createClass(RemoveMarkStep,[{key:"apply",value:function apply(r){var o=this,i=r.slice(this.from,this.to),c=new a.Slice(mapFragment(i.content,function(r){return r.mark(o.mark.removeFromSet(r.marks))},r),i.openStart,i.openEnd);return k.fromReplace(r,this.from,this.to,c)}},{key:"invert",value:function invert(){return new E(this.from,this.to,this.mark)}},{key:"map",value:function map(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new RemoveMarkStep(o.pos,i.pos,this.mark)}},{key:"merge",value:function merge(r){return r instanceof RemoveMarkStep&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from?new RemoveMarkStep(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark):null}},{key:"toJSON",value:function toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.from||"number"!=typeof o.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new RemoveMarkStep(o.from,o.to,r.markFromJSON(o.mark))}}]),RemoveMarkStep}(b);b.jsonID("removeMark",w);var x=function(r){_inherits(AddNodeMarkStep,r);var o=_createSuper(AddNodeMarkStep);function AddNodeMarkStep(r,i){var a;return _classCallCheck(this,AddNodeMarkStep),(a=o.call(this)).pos=r,a.mark=i,a}return _createClass(AddNodeMarkStep,[{key:"apply",value:function apply(r){var o=r.nodeAt(this.pos);if(!o)return k.fail("No node at mark step's position");var i=o.type.create(o.attrs,null,this.mark.addToSet(o.marks));return k.fromReplace(r,this.pos,this.pos+1,new a.Slice(a.Fragment.from(i),0,o.isLeaf?0:1))}},{key:"invert",value:function invert(r){var o=r.nodeAt(this.pos);if(o){var i=this.mark.addToSet(o.marks);if(i.length==o.marks.length){for(var a=0;a<o.marks.length;a++)if(!o.marks[a].isInSet(i))return new AddNodeMarkStep(this.pos,o.marks[a]);return new AddNodeMarkStep(this.pos,this.mark)}}return new C(this.pos,this.mark)}},{key:"map",value:function map(r){var o=r.mapResult(this.pos,1);return o.deletedAfter?null:new AddNodeMarkStep(o.pos,this.mark)}},{key:"toJSON",value:function toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new AddNodeMarkStep(o.pos,r.markFromJSON(o.mark))}}]),AddNodeMarkStep}(b);b.jsonID("addNodeMark",x);var C=function(r){_inherits(RemoveNodeMarkStep,r);var o=_createSuper(RemoveNodeMarkStep);function RemoveNodeMarkStep(r,i){var a;return _classCallCheck(this,RemoveNodeMarkStep),(a=o.call(this)).pos=r,a.mark=i,a}return _createClass(RemoveNodeMarkStep,[{key:"apply",value:function apply(r){var o=r.nodeAt(this.pos);if(!o)return k.fail("No node at mark step's position");var i=o.type.create(o.attrs,null,this.mark.removeFromSet(o.marks));return k.fromReplace(r,this.pos,this.pos+1,new a.Slice(a.Fragment.from(i),0,o.isLeaf?0:1))}},{key:"invert",value:function invert(r){var o=r.nodeAt(this.pos);return o&&this.mark.isInSet(o.marks)?new x(this.pos,this.mark):this}},{key:"map",value:function map(r){var o=r.mapResult(this.pos,1);return o.deletedAfter?null:new RemoveNodeMarkStep(o.pos,this.mark)}},{key:"toJSON",value:function toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new RemoveNodeMarkStep(o.pos,r.markFromJSON(o.mark))}}]),RemoveNodeMarkStep}(b);b.jsonID("removeNodeMark",C);var _=function(r){_inherits(ReplaceStep,r);var o=_createSuper(ReplaceStep);function ReplaceStep(r,i,a){var c,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return _classCallCheck(this,ReplaceStep),(c=o.call(this)).from=r,c.to=i,c.slice=a,c.structure=u,c}return _createClass(ReplaceStep,[{key:"apply",value:function apply(r){return this.structure&&contentBetween(r,this.from,this.to)?k.fail("Structure replace would overwrite content"):k.fromReplace(r,this.from,this.to,this.slice)}},{key:"getMap",value:function getMap(){return new p([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function invert(r){return new ReplaceStep(this.from,this.from+this.slice.size,r.slice(this.from,this.to))}},{key:"map",value:function map(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return o.deletedAcross&&i.deletedAcross?null:new ReplaceStep(o.pos,Math.max(o.pos,i.pos),this.slice,this.structure)}},{key:"merge",value:function merge(r){if(!(r instanceof ReplaceStep)||r.structure||this.structure)return null;if(this.from+this.slice.size!=r.from||this.slice.openEnd||r.slice.openStart){if(r.to!=this.from||this.slice.openStart||r.slice.openEnd)return null;var o=this.slice.size+r.slice.size==0?a.Slice.empty:new a.Slice(r.slice.content.append(this.slice.content),r.slice.openStart,this.slice.openEnd);return new ReplaceStep(r.from,this.to,o,this.structure)}var i=this.slice.size+r.slice.size==0?a.Slice.empty:new a.Slice(this.slice.content.append(r.slice.content),this.slice.openStart,r.slice.openEnd);return new ReplaceStep(this.from,this.to+(r.to-r.from),i,this.structure)}},{key:"toJSON",value:function toJSON(){var r={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.from||"number"!=typeof o.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ReplaceStep(o.from,o.to,a.Slice.fromJSON(r,o.slice),!!o.structure)}}]),ReplaceStep}(b);b.jsonID("replace",_);var T=function(r){_inherits(ReplaceAroundStep,r);var o=_createSuper(ReplaceAroundStep);function ReplaceAroundStep(r,i,a,c,u,p){var g,v=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return _classCallCheck(this,ReplaceAroundStep),(g=o.call(this)).from=r,g.to=i,g.gapFrom=a,g.gapTo=c,g.slice=u,g.insert=p,g.structure=v,g}return _createClass(ReplaceAroundStep,[{key:"apply",value:function apply(r){if(this.structure&&(contentBetween(r,this.from,this.gapFrom)||contentBetween(r,this.gapTo,this.to)))return k.fail("Structure gap-replace would overwrite content");var o=r.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return k.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?k.fromReplace(r,this.from,this.to,i):k.fail("Content does not fit in gap")}},{key:"getMap",value:function getMap(){return new p([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function invert(r){var o=this.gapTo-this.gapFrom;return new ReplaceAroundStep(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,r.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function map(r){var o=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),a=this.from==this.gapFrom?o.pos:r.map(this.gapFrom,-1),c=this.to==this.gapTo?i.pos:r.map(this.gapTo,1);return o.deletedAcross&&i.deletedAcross||a<o.pos||c>i.pos?null:new ReplaceAroundStep(o.pos,i.pos,a,c,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function toJSON(){var r={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.from||"number"!=typeof o.to||"number"!=typeof o.gapFrom||"number"!=typeof o.gapTo||"number"!=typeof o.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ReplaceAroundStep(o.from,o.to,o.gapFrom,o.gapTo,a.Slice.fromJSON(r,o.slice),o.insert,!!o.structure)}}]),ReplaceAroundStep}(b);function contentBetween(r,o,i){for(var a=r.resolve(o),c=i-o,u=a.depth;c>0&&u>0&&a.indexAfter(u)==a.node(u).childCount;)u--,c--;if(c>0)for(var p=a.node(u).maybeChild(a.indexAfter(u));c>0;){if(!p||p.isLeaf)return!0;p=p.firstChild,c--}return!1}function _clearIncompatible(r,o,i){for(var c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.contentMatch,u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],p=r.doc.nodeAt(o),g=[],v=o+1,b=0;b<p.childCount;b++){var k=p.child(b),E=v+k.nodeSize,x=c.matchType(k.type);if(x){c=x;for(var C=0;C<k.marks.length;C++)i.allowsMarkType(k.marks[C].type)||r.step(new w(v,E,k.marks[C]));if(u&&k.isText&&"pre"!=i.whitespace)for(var T=void 0,P=/\r?\n|\r/g,A=void 0;T=P.exec(k.text);)A||(A=new a.Slice(a.Fragment.from(i.schema.text(" ",i.allowedMarks(k.marks))),0,0)),g.push(new _(v+T.index,v+T.index+T[0].length,A))}else g.push(new _(v,E,a.Slice.empty));v=E}if(!c.validEnd){var N=c.fillBefore(a.Fragment.empty,!0);r.replace(v,v,new a.Slice(N,0,0))}for(var R=g.length-1;R>=0;R--)r.step(g[R])}function canCut(r,o,i){return(0==o||r.canReplace(o,r.childCount))&&(i==r.childCount||r.canReplace(0,i))}function withAttrs(r){return{type:r,attrs:null}}function replaceNewlines(r,o,i,a){o.forEach(function(c,u){if(c.isText)for(var p,g=/\r?\n|\r/g;p=g.exec(c.text);){var v=r.mapping.slice(a).map(i+1+u+p.index);r.replaceWith(v,v+1,o.type.schema.linebreakReplacement.create())}})}function replaceLinebreaks(r,o,i,a){o.forEach(function(c,u){if(c.type==c.type.schema.linebreakReplacement){var p=r.mapping.slice(a).map(i+1+u);r.replaceWith(p,p+1,o.type.schema.text("\n"))}})}function joinable(r,o){return!(!r||!o||r.isLeaf||!function canAppendWithSubstitutedLinebreaks(r,o){o.content.size||r.type.compatibleContent(o.type);for(var i=r.contentMatchAt(r.childCount),a=r.type.schema.linebreakReplacement,c=0;c<o.childCount;c++){var u=o.child(c),p=u.type==a?r.type.schema.nodes.text:u.type;if(!(i=i.matchType(p)))return!1;if(!r.type.allowsMarks(u.marks))return!1}return i.validEnd}(r,o))}function insertPoint(r,o,i){var a=r.resolve(o);if(a.parent.canReplaceWith(a.index(),a.index(),i))return o;if(0==a.parentOffset)for(var c=a.depth-1;c>=0;c--){var u=a.index(c);if(a.node(c).canReplaceWith(u,u,i))return a.before(c+1);if(u>0)return null}if(a.parentOffset==a.parent.content.size)for(var p=a.depth-1;p>=0;p--){var g=a.indexAfter(p);if(a.node(p).canReplaceWith(g,g,i))return a.after(p+1);if(g<a.node(p).childCount)return null}return null}function replaceStep(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.Slice.empty;if(o==i&&!c.size)return null;var u=r.resolve(o),p=r.resolve(i);return fitsTrivially(u,p,c)?new _(o,i,c):new P(u,p,c).fit()}function fitsTrivially(r,o,i){return!i.openStart&&!i.openEnd&&r.start()==o.start()&&r.parent.canReplace(r.index(),o.index(),i.content)}b.jsonID("replaceAround",T);var P=function(){function Fitter(r,o,i){_classCallCheck(this,Fitter),this.$from=r,this.$to=o,this.unplaced=i,this.frontier=[],this.placed=a.Fragment.empty;for(var c=0;c<=r.depth;c++){var u=r.node(c);this.frontier.push({type:u.type,match:u.contentMatchAt(r.indexAfter(c))})}for(var p=r.depth;p>0;p--)this.placed=a.Fragment.from(r.node(p).copy(this.placed))}return _createClass(Fitter,[{key:"depth",get:function get(){return this.frontier.length-1}},{key:"fit",value:function fit(){for(;this.unplaced.size;){var fit=this.findFittable();fit?this.placeNodes(fit):this.openMore()||this.dropNode()}var r=this.mustMoveInline(),o=this.placed.size-this.depth-this.$from.depth,i=this.$from,c=this.close(r<0?this.$to:i.doc.resolve(r));if(!c)return null;for(var u=this.placed,p=i.depth,g=c.depth;p&&g&&1==u.childCount;)u=u.firstChild.content,p--,g--;var v=new a.Slice(u,p,g);return r>-1?new T(i.pos,r,this.$to.pos,this.$to.end(),v,o):v.size||i.pos!=this.$to.pos?new _(i.pos,c.pos,v):null}},{key:"findFittable",value:function findFittable(){for(var r=this.unplaced.openStart,o=this.unplaced.content,i=0,c=this.unplaced.openEnd;i<r;i++){var u=o.firstChild;if(o.childCount>1&&(c=0),u.type.spec.isolating&&c<=i){r=i;break}o=u.content}for(var p=1;p<=2;p++)for(var g=1==p?r:this.unplaced.openStart;g>=0;g--)for(var v=null,b=(g?(v=contentAt(this.unplaced.content,g-1).firstChild).content:this.unplaced.content).firstChild,k=this.depth;k>=0;k--){var E=this.frontier[k],w=E.type,x=E.match,C=void 0,_=null;if(1==p&&(b?x.matchType(b.type)||(_=x.fillBefore(a.Fragment.from(b),!1)):v&&w.compatibleContent(v.type)))return{sliceDepth:g,frontierDepth:k,parent:v,inject:_};if(2==p&&b&&(C=x.findWrapping(b.type)))return{sliceDepth:g,frontierDepth:k,parent:v,wrap:C};if(v&&x.matchType(v.type))break}}},{key:"openMore",value:function openMore(){var r=this.unplaced,o=r.content,i=r.openStart,c=r.openEnd,u=contentAt(o,i);return!(!u.childCount||u.firstChild.isLeaf)&&(this.unplaced=new a.Slice(o,i+1,Math.max(c,u.size+i>=o.size-c?i+1:0)),!0)}},{key:"dropNode",value:function dropNode(){var r=this.unplaced,o=r.content,i=r.openStart,c=r.openEnd,u=contentAt(o,i);if(u.childCount<=1&&i>0){var p=o.size-i<=i+u.size;this.unplaced=new a.Slice(dropFromFragment(o,i-1,1),i-1,p?i-1:c)}else this.unplaced=new a.Slice(dropFromFragment(o,i,1),i,c)}},{key:"placeNodes",value:function placeNodes(r){for(var o=r.sliceDepth,i=r.frontierDepth,c=r.parent,u=r.inject,p=r.wrap;this.depth>i;)this.closeFrontierNode();if(p)for(var g=0;g<p.length;g++)this.openFrontierNode(p[g]);var v=this.unplaced,b=c?c.content:v.content,k=v.openStart-o,E=0,w=[],x=this.frontier[i],C=x.match,_=x.type;if(u){for(var T=0;T<u.childCount;T++)w.push(u.child(T));C=C.matchFragment(u)}for(var P=b.size+o-(v.content.size-v.openEnd);E<b.childCount;){var A=b.child(E),N=C.matchType(A.type);if(!N)break;(++E>1||0==k||A.content.size)&&(C=N,w.push(closeNodeStart(A.mark(_.allowedMarks(A.marks)),1==E?k:0,E==b.childCount?P:-1)))}var R=E==b.childCount;R||(P=-1),this.placed=addToFragment(this.placed,i,a.Fragment.from(w)),this.frontier[i].match=C,R&&P<0&&c&&c.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var I=0,L=b;I<P;I++){var z=L.lastChild;this.frontier.push({type:z.type,match:z.contentMatchAt(z.childCount)}),L=z.content}this.unplaced=R?0==o?a.Slice.empty:new a.Slice(dropFromFragment(v.content,o-1,1),o-1,P<0?v.openEnd:o-1):new a.Slice(dropFromFragment(v.content,o,E),v.openStart,v.openEnd)}},{key:"mustMoveInline",value:function mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;var r,o=this.frontier[this.depth];if(!o.type.isTextblock||!contentAfterFits(this.$to,this.$to.depth,o.type,o.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;for(var i=this.$to.depth,a=this.$to.after(i);i>1&&a==this.$to.end(--i);)++a;return a}},{key:"findCloseLevel",value:function findCloseLevel(r){e:for(var o=Math.min(this.depth,r.depth);o>=0;o--){var i=this.frontier[o],a=i.match,c=i.type,u=o<r.depth&&r.end(o+1)==r.pos+(r.depth-(o+1)),p=contentAfterFits(r,o,c,a,u);if(p){for(var g=o-1;g>=0;g--){var v=this.frontier[g],b=v.match,k=contentAfterFits(r,g,v.type,b,!0);if(!k||k.childCount)continue e}return{depth:o,fit:p,move:u?r.doc.resolve(r.after(o+1)):r}}}}},{key:"close",value:function close(r){var close=this.findCloseLevel(r);if(!close)return null;for(;this.depth>close.depth;)this.closeFrontierNode();close.fit.childCount&&(this.placed=addToFragment(this.placed,close.depth,close.fit)),r=close.move;for(var o=close.depth+1;o<=r.depth;o++){var i=r.node(o),a=i.type.contentMatch.fillBefore(i.content,!0,r.index(o));this.openFrontierNode(i.type,i.attrs,a)}return r}},{key:"openFrontierNode",value:function openFrontierNode(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,c=this.frontier[this.depth];c.match=c.match.matchType(r),this.placed=addToFragment(this.placed,this.depth,a.Fragment.from(r.create(o,i))),this.frontier.push({type:r,match:r.contentMatch})}},{key:"closeFrontierNode",value:function closeFrontierNode(){var r=this.frontier.pop().match.fillBefore(a.Fragment.empty,!0);r.childCount&&(this.placed=addToFragment(this.placed,this.frontier.length,r))}}]),Fitter}();function dropFromFragment(r,o,i){return 0==o?r.cutByIndex(i,r.childCount):r.replaceChild(0,r.firstChild.copy(dropFromFragment(r.firstChild.content,o-1,i)))}function addToFragment(r,o,i){return 0==o?r.append(i):r.replaceChild(r.childCount-1,r.lastChild.copy(addToFragment(r.lastChild.content,o-1,i)))}function contentAt(r,o){for(var i=0;i<o;i++)r=r.firstChild.content;return r}function closeNodeStart(r,o,i){if(o<=0)return r;var c=r.content;return o>1&&(c=c.replaceChild(0,closeNodeStart(c.firstChild,o-1,1==c.childCount?i-1:0))),o>0&&(c=r.type.contentMatch.fillBefore(c).append(c),i<=0&&(c=c.append(r.type.contentMatch.matchFragment(c).fillBefore(a.Fragment.empty,!0)))),r.copy(c)}function contentAfterFits(r,o,i,a,c){var u=r.node(o),p=c?r.indexAfter(o):r.index(o);if(p==u.childCount&&!i.compatibleContent(u.type))return null;var g=a.fillBefore(u.content,!0,p);return g&&!function invalidMarks(r,o,i){for(var a=i;a<o.childCount;a++)if(!r.allowsMarks(o.child(a).marks))return!0;return!1}(i,u.content,p)?g:null}function definesContent(r){return r.spec.defining||r.spec.definingForContent}function closeFragment(r,o,i,c,u){if(o<i){var p=r.firstChild;r=r.replaceChild(0,p.copy(closeFragment(p.content,o+1,i,c,p)))}if(o>c){var g=u.contentMatchAt(0),v=g.fillBefore(r).append(r);r=v.append(g.matchFragment(v).fillBefore(a.Fragment.empty,!0))}return r}function coveredDepths(r,o){for(var i=[],a=Math.min(r.depth,o.depth);a>=0;a--){var c=r.start(a);if(c<r.pos-(r.depth-a)||o.end(a)>o.pos+(o.depth-a)||r.node(a).type.spec.isolating||o.node(a).type.spec.isolating)break;(c==o.start(a)||a==r.depth&&a==o.depth&&r.parent.inlineContent&&o.parent.inlineContent&&a&&o.start(a-1)==c-1)&&i.push(a)}return i}var A=function(r){_inherits(AttrStep,r);var o=_createSuper(AttrStep);function AttrStep(r,i,a){var c;return _classCallCheck(this,AttrStep),(c=o.call(this)).pos=r,c.attr=i,c.value=a,c}return _createClass(AttrStep,[{key:"apply",value:function apply(r){var o=r.nodeAt(this.pos);if(!o)return k.fail("No node at attribute step's position");var i=Object.create(null);for(var c in o.attrs)i[c]=o.attrs[c];i[this.attr]=this.value;var u=o.type.create(i,null,o.marks);return k.fromReplace(r,this.pos,this.pos+1,new a.Slice(a.Fragment.from(u),0,o.isLeaf?0:1))}},{key:"getMap",value:function getMap(){return p.empty}},{key:"invert",value:function invert(r){return new AttrStep(this.pos,this.attr,r.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function map(r){var o=r.mapResult(this.pos,1);return o.deletedAfter?null:new AttrStep(o.pos,this.attr,this.value)}},{key:"toJSON",value:function toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.pos||"string"!=typeof o.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new AttrStep(o.pos,o.attr,o.value)}}]),AttrStep}(b);b.jsonID("attr",A);var N=function(r){_inherits(DocAttrStep,r);var o=_createSuper(DocAttrStep);function DocAttrStep(r,i){var a;return _classCallCheck(this,DocAttrStep),(a=o.call(this)).attr=r,a.value=i,a}return _createClass(DocAttrStep,[{key:"apply",value:function apply(r){var o=Object.create(null);for(var i in r.attrs)o[i]=r.attrs[i];o[this.attr]=this.value;var a=r.type.create(o,r.content,r.marks);return k.ok(a)}},{key:"getMap",value:function getMap(){return p.empty}},{key:"invert",value:function invert(r){return new DocAttrStep(this.attr,r.attrs[this.attr])}},{key:"map",value:function map(r){return this}},{key:"toJSON",value:function toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("string"!=typeof o.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new DocAttrStep(o.attr,o.value)}}]),DocAttrStep}(b);b.jsonID("docAttr",N),o.TransformError=function(r){_inherits(TransformError,r);var o=_createSuper(TransformError);function TransformError(){return _classCallCheck(this,TransformError),o.apply(this,arguments)}return _createClass(TransformError)}(_wrapNativeSuper(Error)),o.TransformError=function TransformError(r){var o=Error.call(this,r);return o.__proto__=TransformError.prototype,o},o.TransformError.prototype=Object.create(Error.prototype),o.TransformError.prototype.constructor=o.TransformError,o.TransformError.prototype.name="TransformError";var R=function(){function Transform(r){_classCallCheck(this,Transform),this.doc=r,this.steps=[],this.docs=[],this.mapping=new g}return _createClass(Transform,[{key:"before",get:function get(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function step(r){var i=this.maybeStep(r);if(i.failed)throw new o.TransformError(i.failed);return this}},{key:"maybeStep",value:function maybeStep(r){var o=r.apply(this.doc);return o.failed||this.addStep(r,o.doc),o}},{key:"docChanged",get:function get(){return this.steps.length>0}},{key:"changedRange",value:function changedRange(){for(var r=1e9,o=-1e9,i=0;i<this.mapping.maps.length;i++){var a=this.mapping.maps[i];i&&(r=a.map(r,1),o=a.map(o,-1)),a.forEach(function(i,a,c,u){r=Math.min(r,c),o=Math.max(o,u)})}return 1e9==r?null:{from:r,to:o}}},{key:"addStep",value:function addStep(r,o){this.docs.push(this.doc),this.steps.push(r),this.mapping.appendMap(r.getMap()),this.doc=o}},{key:"replace",value:function replace(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.Slice.empty,c=replaceStep(this.doc,r,o,i);return c&&this.step(c),this}},{key:"replaceWith",value:function replaceWith(r,o,i){return this.replace(r,o,new a.Slice(a.Fragment.from(i),0,0))}},{key:"delete",value:function _delete(r,o){return this.replace(r,o,a.Slice.empty)}},{key:"insert",value:function insert(r,o){return this.replaceWith(r,r,o)}},{key:"replaceRange",value:function replaceRange(r,o,i){return function _replaceRange(r,o,i,c){if(!c.size)return r.deleteRange(o,i);var u=r.doc.resolve(o),p=r.doc.resolve(i);if(fitsTrivially(u,p,c))return r.step(new _(o,i,c));var g=coveredDepths(u,p);0==g[g.length-1]&&g.pop();var v=-(u.depth+1);g.unshift(v);for(var b=u.depth,k=u.pos-1;b>0;b--,k--){var E=u.node(b).type.spec;if(E.defining||E.definingAsContext||E.isolating)break;g.indexOf(b)>-1?v=b:u.before(b)==k&&g.splice(1,0,-b)}for(var w=g.indexOf(v),x=[],C=c.openStart,T=c.content,P=0;;P++){var A=T.firstChild;if(x.push(A),P==c.openStart)break;T=A.content}for(var N=C-1;N>=0;N--){var R=x[N],I=definesContent(R.type);if(I&&!R.sameMarkup(u.node(Math.abs(v)-1)))C=N;else if(I||!R.type.isTextblock)break}for(var L=c.openStart;L>=0;L--){var z=(L+C+1)%(c.openStart+1),j=x[z];if(j)for(var B=0;B<g.length;B++){var V=g[(B+w)%g.length],U=!0;V<0&&(U=!1,V=-V);var H=u.node(V-1),W=u.index(V-1);if(H.canReplaceWith(W,W,j.type,j.marks))return r.replace(u.before(V),U?p.after(V):i,new a.Slice(closeFragment(c.content,0,c.openStart,z),z,c.openEnd))}}for(var K=r.steps.length,G=g.length-1;G>=0&&(r.replace(o,i,c),!(r.steps.length>K));G--){var J=g[G];J<0||(o=u.before(J),i=p.after(J))}}(this,r,o,i),this}},{key:"replaceRangeWith",value:function replaceRangeWith(r,o,i){return function _replaceRangeWith(r,o,i,c){if(!c.isInline&&o==i&&r.doc.resolve(o).parent.content.size){var u=insertPoint(r.doc,o,c.type);null!=u&&(o=i=u)}r.replaceRange(o,i,new a.Slice(a.Fragment.from(c),0,0))}(this,r,o,i),this}},{key:"deleteRange",value:function deleteRange(r,o){return function _deleteRange(r,o,i){for(var a=r.doc.resolve(o),c=r.doc.resolve(i),u=coveredDepths(a,c),p=0;p<u.length;p++){var g=u[p],v=p==u.length-1;if(v&&0==g||a.node(g).type.contentMatch.validEnd)return r.delete(a.start(g),c.end(g));if(g>0&&(v||a.node(g-1).canReplace(a.index(g-1),c.indexAfter(g-1))))return r.delete(a.before(g),c.after(g))}for(var b=1;b<=a.depth&&b<=c.depth;b++)if(o-a.start(b)==a.depth-b&&i>a.end(b)&&c.end(b)-i!=c.depth-b&&a.start(b-1)==c.start(b-1)&&a.node(b-1).canReplace(a.index(b-1),c.index(b-1)))return r.delete(a.before(b),i);r.delete(o,i)}(this,r,o),this}},{key:"lift",value:function lift(r,o){return function _lift(r,o,i){for(var c=o.$from,u=o.$to,p=o.depth,g=c.before(p+1),v=u.after(p+1),b=g,k=v,E=a.Fragment.empty,w=0,x=p,C=!1;x>i;x--)C||c.index(x)>0?(C=!0,E=a.Fragment.from(c.node(x).copy(E)),w++):b--;for(var _=a.Fragment.empty,P=0,A=p,N=!1;A>i;A--)N||u.after(A+1)<u.end(A)?(N=!0,_=a.Fragment.from(u.node(A).copy(_)),P++):k++;r.step(new T(b,k,g,v,new a.Slice(E.append(_),w,P),E.size-w,!0))}(this,r,o),this}},{key:"join",value:function join(r){return function _join(r,o,i){var c=null,u=r.doc.type.schema.linebreakReplacement,p=r.doc.resolve(o-i),g=p.node().type;if(u&&g.inlineContent){var v="pre"==g.whitespace,b=!!g.contentMatch.matchType(u);v&&!b?c=!1:!v&&b&&(c=!0)}var k=r.steps.length;if(!1===c){var E=r.doc.resolve(o+i);replaceLinebreaks(r,E.node(),E.before(),k)}g.inlineContent&&_clearIncompatible(r,o+i-1,g,p.node().contentMatchAt(p.index()),null==c);var w=r.mapping.slice(k),x=w.map(o-i);if(r.step(new _(x,w.map(o+i,-1),a.Slice.empty,!0)),!0===c){var C=r.doc.resolve(x);replaceNewlines(r,C.node(),C.before(),r.steps.length)}return r}(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this}},{key:"wrap",value:function wrap(r,o){return function _wrap2(r,o,i){for(var c=a.Fragment.empty,u=i.length-1;u>=0;u--){if(c.size){var p=i[u].type.contentMatch.matchFragment(c);if(!p||!p.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}c=a.Fragment.from(i[u].type.create(i[u].attrs,c))}var g=o.start,v=o.end;r.step(new T(g,v,g,v,new a.Slice(c,0,0),i.length,!0))}(this,r,o),this}},{key:"setBlockType",value:function setBlockType(r){return function _setBlockType(r,o,i,c,u){if(!c.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var p=r.steps.length;r.doc.nodesBetween(o,i,function(o,i){var g="function"==typeof u?u(o):u;if(o.isTextblock&&!o.hasMarkup(c,g)&&function canChangeType(r,o,i){var a=r.resolve(o),c=a.index();return a.parent.canReplaceWith(c,c+1,i)}(r.doc,r.mapping.slice(p).map(i),c)){var v=null;if(c.schema.linebreakReplacement){var b="pre"==c.whitespace,k=!!c.contentMatch.matchType(c.schema.linebreakReplacement);b&&!k?v=!1:!b&&k&&(v=!0)}!1===v&&replaceLinebreaks(r,o,i,p),_clearIncompatible(r,r.mapping.slice(p).map(i,1),c,void 0,null===v);var E=r.mapping.slice(p),w=E.map(i,1),x=E.map(i+o.nodeSize,1);return r.step(new T(w,x,w+1,x-1,new a.Slice(a.Fragment.from(c.create(g,null,o.marks)),0,0),1,!0)),!0===v&&replaceNewlines(r,o,i,p),!1}})}(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,arguments.length>2?arguments[2]:void 0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null),this}},{key:"setNodeMarkup",value:function setNodeMarkup(r,o){return function _setNodeMarkup(r,o,i,c,u){var p=r.doc.nodeAt(o);if(!p)throw new RangeError("No node at given position");i||(i=p.type);var g=i.create(c,null,u||p.marks);if(p.isLeaf)return r.replaceWith(o,o+p.nodeSize,g);if(!i.validContent(p.content))throw new RangeError("Invalid content for node type "+i.name);r.step(new T(o,o+p.nodeSize,o+1,o+p.nodeSize-1,new a.Slice(a.Fragment.from(g),0,0),1,!0))}(this,r,o,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0),this}},{key:"setNodeAttribute",value:function setNodeAttribute(r,o,i){return this.step(new A(r,o,i)),this}},{key:"setDocAttribute",value:function setDocAttribute(r,o){return this.step(new N(r,o)),this}},{key:"addNodeMark",value:function addNodeMark(r,o){return this.step(new x(r,o)),this}},{key:"removeNodeMark",value:function removeNodeMark(r,o){var i=this.doc.nodeAt(r);if(!i)throw new RangeError("No node at position "+r);if(o instanceof a.Mark)o.isInSet(i.marks)&&this.step(new C(r,o));else{for(var c,u=i.marks,p=[];c=o.isInSet(u);)p.push(new C(r,c)),u=c.removeFromSet(u);for(var g=p.length-1;g>=0;g--)this.step(p[g])}return this}},{key:"split",value:function split(r){return function _split(r,o){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,c=arguments.length>3?arguments[3]:void 0,u=r.doc.resolve(o),p=a.Fragment.empty,g=a.Fragment.empty,v=u.depth,b=u.depth-i,k=i-1;v>b;v--,k--){p=a.Fragment.from(u.node(v).copy(p));var E=c&&c[k];g=a.Fragment.from(E?E.type.create(E.attrs,g):u.node(v).copy(g))}r.step(new _(o,o,new a.Slice(p.append(g),i,i),!0))}(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0),this}},{key:"addMark",value:function addMark(r,o,i){return function _addMark(r,o,i,a){var c,u,p=[],g=[];r.doc.nodesBetween(o,i,function(r,v,b){if(r.isInline){var k=r.marks;if(!a.isInSet(k)&&b.type.allowsMarkType(a.type)){for(var x=Math.max(v,o),C=Math.min(v+r.nodeSize,i),_=a.addToSet(k),T=0;T<k.length;T++)k[T].isInSet(_)||(c&&c.to==x&&c.mark.eq(k[T])?c.to=C:p.push(c=new w(x,C,k[T])));u&&u.to==x?u.to=C:g.push(u=new E(x,C,a))}}}),p.forEach(function(o){return r.step(o)}),g.forEach(function(o){return r.step(o)})}(this,r,o,i),this}},{key:"removeMark",value:function removeMark(r,o,i){return function _removeMark(r,o,i,c){var u=[],p=0;r.doc.nodesBetween(o,i,function(r,g){if(r.isInline){p++;var v=null;if(c instanceof a.MarkType)for(var b,k=r.marks;b=c.isInSet(k);)(v||(v=[])).push(b),k=b.removeFromSet(k);else c?c.isInSet(r.marks)&&(v=[c]):v=r.marks;if(v&&v.length)for(var E=Math.min(g+r.nodeSize,i),w=0;w<v.length;w++){for(var x=v[w],C=void 0,_=0;_<u.length;_++){var T=u[_];T.step==p-1&&x.eq(u[_].style)&&(C=T)}C?(C.to=E,C.step=p):u.push({style:x,from:Math.max(g,o),to:E,step:p})}}}),u.forEach(function(o){return r.step(new w(o.from,o.to,o.style))})}(this,r,o,i),this}},{key:"clearIncompatible",value:function clearIncompatible(r,o,i){return _clearIncompatible(this,r,o,i),this}}]),Transform}();o.AddMarkStep=E,o.AddNodeMarkStep=x,o.AttrStep=A,o.DocAttrStep=N,o.MapResult=u,o.Mapping=g,o.RemoveMarkStep=w,o.RemoveNodeMarkStep=C,o.ReplaceAroundStep=T,o.ReplaceStep=_,o.Step=b,o.StepMap=p,o.StepResult=k,o.Transform=R,o.canJoin=function canJoin(r,o){var i=r.resolve(o),a=i.index();return joinable(i.nodeBefore,i.nodeAfter)&&i.parent.canReplace(a,a+1)},o.canSplit=function canSplit(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,c=r.resolve(o),u=c.depth-i,p=a&&a[a.length-1]||c.parent;if(u<0||c.parent.type.spec.isolating||!c.parent.canReplace(c.index(),c.parent.childCount)||!p.type.validContent(c.parent.content.cutByIndex(c.index(),c.parent.childCount)))return!1;for(var g=c.depth-1,v=i-2;g>u;g--,v--){var b=c.node(g),k=c.index(g);if(b.type.spec.isolating)return!1;var E=b.content.cutByIndex(k,b.childCount),w=a&&a[v+1];w&&(E=E.replaceChild(0,w.type.create(w.attrs)));var x=a&&a[v]||b;if(!b.canReplace(k+1,b.childCount)||!x.type.validContent(E))return!1}var C=c.indexAfter(u),_=a&&a[0];return c.node(u).canReplaceWith(C,C,_?_.type:c.node(u+1).type)},o.dropPoint=function dropPoint(r,o,i){var a=r.resolve(o);if(!i.content.size)return o;for(var c=i.content,u=0;u<i.openStart;u++)c=c.firstChild.content;for(var p=1;p<=(0==i.openStart&&i.size?2:1);p++)for(var g=a.depth;g>=0;g--){var v=g==a.depth?0:a.pos<=(a.start(g+1)+a.end(g+1))/2?-1:1,b=a.index(g)+(v>0?1:0),k=a.node(g),E=!1;if(1==p)E=k.canReplace(b,b,c);else{var w=k.contentMatchAt(b).findWrapping(c.firstChild.type);E=w&&k.canReplaceWith(b,b,w[0])}if(E)return 0==v?a.pos:v<0?a.before(g+1):a.after(g+1)}return null},o.findWrapping=function findWrapping(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r,c=function findWrappingOutside(r,o){var i=r.parent,a=r.startIndex,c=r.endIndex,u=i.contentMatchAt(a).findWrapping(o);if(!u)return null;var p=u.length?u[0]:o;return i.canReplaceWith(a,c,p)?u:null}(r,o),u=c&&function findWrappingInside(r,o){var i=r.parent,a=r.startIndex,c=r.endIndex,u=i.child(a),p=o.contentMatch.findWrapping(u.type);if(!p)return null;for(var g=(p.length?p[p.length-1]:o).contentMatch,v=a;g&&v<c;v++)g=g.matchType(i.child(v).type);return g&&g.validEnd?p:null}(a,o);return u?c.map(withAttrs).concat({type:o,attrs:i}).concat(u.map(withAttrs)):null},o.insertPoint=insertPoint,o.joinPoint=function joinPoint(r,o){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=r.resolve(o),c=a.depth;;c--){var u=void 0,p=void 0,g=a.index(c);if(c==a.depth?(u=a.nodeBefore,p=a.nodeAfter):i>0?(u=a.node(c+1),g++,p=a.node(c).maybeChild(g)):(u=a.node(c).maybeChild(g-1),p=a.node(c+1)),u&&!u.isTextblock&&joinable(u,p)&&a.node(c).canReplace(g,g+1))return o;if(0==c)break;o=i<0?a.before(c):a.after(c)}},o.liftTarget=function liftTarget(r){for(var o=r.parent.content.cutByIndex(r.startIndex,r.endIndex),i=r.depth,a=0,c=0;;--i){var u=r.$from.node(i),p=r.$from.index(i)+a,g=r.$to.indexAfter(i)-c;if(i<r.depth&&u.canReplace(p,g,o))return i;if(0==i||u.type.spec.isolating||!canCut(u,p,g))break;p&&(a=1),g<u.childCount&&(c=1)}return null},o.replaceStep=replaceStep},37112:function(r,o,i){"use strict";i.r(o),i.d(o,{Mention:function(){return Oe}});var a=i(97557),c=i.n(a);function _arrayLikeToArray$2(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function _unsupportedIterableToArray$2(r,o){if(r){if("string"==typeof r)return _arrayLikeToArray$2(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray$2(r,o):void 0}}function _slicedToArray(r,o){return function _arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function _iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||_unsupportedIterableToArray$2(r,o)||function _nonIterableRest(){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 _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function classNames(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(o){for(var a=[],c=0;c<o.length;c++){var u=o[c];if(u){var p=_typeof(u);if("string"===p||"number"===p)a.push(u);else if("object"===p){var g=Array.isArray(u)?u:Object.entries(u).map(function(r){var o=_slicedToArray(r,2),i=o[0];return o[1]?i:null});a=g.length?a.concat(g.filter(function(r){return!!r})):a}}}return a.join(" ").trim()}}function _toConsumableArray(r){return function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray$2(r)}(r)||function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||_unsupportedIterableToArray$2(r)||function _nonIterableSpread(){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 _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function toPropertyKey(r){var o=function toPrimitive(r,o){if("object"!=_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==_typeof(o)?o:o+""}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _defineProperty(r,o,i){return(o=toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function _createForOfIteratorHelper$1(r,o){var i="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function _unsupportedIterableToArray$1(r,o){if(r){if("string"==typeof r)return _arrayLikeToArray$1(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray$1(r,o):void 0}}(r))||o&&r&&"number"==typeof r.length){i&&(r=i);var a=0,c=function F(){};return{s:c,n:function n(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function e(r){throw r},f:c}}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 u,p=!0,g=!1;return{s:function s(){i=i.call(r)},n:function n(){var r=i.next();return p=r.done,r},e:function e(r){g=!0,u=r},f:function f(){try{p||null==i.return||i.return()}finally{if(g)throw u}}}}function _arrayLikeToArray$1(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}var u=function(){function DomHandler(){_classCallCheck(this,DomHandler)}return _createClass(DomHandler,null,[{key:"innerWidth",value:function innerWidth(r){if(r){var o=r.offsetWidth,i=getComputedStyle(r);return o+=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)}return 0}},{key:"width",value:function width(r){if(r){var o=r.offsetWidth,i=getComputedStyle(r);return o-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)}return 0}},{key:"getBrowserLanguage",value:function getBrowserLanguage(){return navigator.userLanguage||navigator.languages&&navigator.languages.length&&navigator.languages[0]||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"en"}},{key:"getWindowScrollTop",value:function getWindowScrollTop(){var r=document.documentElement;return(window.pageYOffset||r.scrollTop)-(r.clientTop||0)}},{key:"getWindowScrollLeft",value:function getWindowScrollLeft(){var r=document.documentElement;return(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0)}},{key:"getOuterWidth",value:function getOuterWidth(r,o){if(r){var i=r.getBoundingClientRect().width||r.offsetWidth;if(o){var a=getComputedStyle(r);i+=parseFloat(a.marginLeft)+parseFloat(a.marginRight)}return i}return 0}},{key:"getOuterHeight",value:function getOuterHeight(r,o){if(r){var i=r.getBoundingClientRect().height||r.offsetHeight;if(o){var a=getComputedStyle(r);i+=parseFloat(a.marginTop)+parseFloat(a.marginBottom)}return i}return 0}},{key:"getClientHeight",value:function getClientHeight(r,o){if(r){var i=r.clientHeight;if(o){var a=getComputedStyle(r);i+=parseFloat(a.marginTop)+parseFloat(a.marginBottom)}return i}return 0}},{key:"getClientWidth",value:function getClientWidth(r,o){if(r){var i=r.clientWidth;if(o){var a=getComputedStyle(r);i+=parseFloat(a.marginLeft)+parseFloat(a.marginRight)}return i}return 0}},{key:"getViewport",value:function getViewport(){var r=window,o=document,i=o.documentElement,a=o.getElementsByTagName("body")[0];return{width:r.innerWidth||i.clientWidth||a.clientWidth,height:r.innerHeight||i.clientHeight||a.clientHeight}}},{key:"getOffset",value:function getOffset(r){if(r){var o=r.getBoundingClientRect();return{top:o.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:o.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}},{key:"index",value:function index(r){if(r)for(var o=r.parentNode.childNodes,i=0,a=0;a<o.length;a++){if(o[a]===r)return i;1===o[a].nodeType&&i++}return-1}},{key:"addMultipleClasses",value:function addMultipleClasses(r,o){if(r&&o)if(r.classList)for(var i=o.split(" "),a=0;a<i.length;a++)r.classList.add(i[a]);else for(var c=o.split(" "),u=0;u<c.length;u++)r.className=r.className+" "+c[u]}},{key:"removeMultipleClasses",value:function removeMultipleClasses(r,o){if(r&&o)if(r.classList)for(var i=o.split(" "),a=0;a<i.length;a++)r.classList.remove(i[a]);else for(var c=o.split(" "),u=0;u<c.length;u++)r.className=r.className.replace(new RegExp("(^|\\b)"+c[u].split(" ").join("|")+"(\\b|$)","gi")," ")}},{key:"addClass",value:function addClass(r,o){r&&o&&(r.classList?r.classList.add(o):r.className=r.className+" "+o)}},{key:"removeClass",value:function removeClass(r,o){r&&o&&(r.classList?r.classList.remove(o):r.className=r.className.replace(new RegExp("(^|\\b)"+o.split(" ").join("|")+"(\\b|$)","gi")," "))}},{key:"hasClass",value:function hasClass(r,o){return!!r&&(r.classList?r.classList.contains(o):new RegExp("(^| )"+o+"( |$)","gi").test(r.className))}},{key:"addStyles",value:function addStyles(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r&&Object.entries(o).forEach(function(o){var i=_slicedToArray(o,2),a=i[0],c=i[1];return r.style[a]=c})}},{key:"find",value:function find(r,o){return r?Array.from(r.querySelectorAll(o)):[]}},{key:"findSingle",value:function findSingle(r,o){return r?r.querySelector(o):null}},{key:"setAttributes",value:function setAttributes(r){var o=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r){var a=function computedStyles(o,i){var c,u,p=null!=r&&null!==(c=r.$attrs)&&void 0!==c&&c[o]?[null==r||null===(u=r.$attrs)||void 0===u?void 0:u[o]]:[];return[i].flat().reduce(function(r,i){if(null!=i){var c=_typeof(i);if("string"===c||"number"===c)r.push(i);else if("object"===c){var u=Array.isArray(i)?a(o,i):Object.entries(i).map(function(r){var i=_slicedToArray(r,2),a=i[0],c=i[1];return"style"!==o||!c&&0!==c?c?a:void 0:"".concat(a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(c)});r=u.length?r.concat(u.filter(function(r){return!!r})):r}}return r},p)};Object.entries(i).forEach(function(i){var c=_slicedToArray(i,2),u=c[0],p=c[1];if(null!=p){var g=u.match(/^on(.+)/);g?r.addEventListener(g[1].toLowerCase(),p):"p-bind"===u?o.setAttributes(r,p):(p="class"===u?_toConsumableArray(new Set(a("class",p))).join(" ").trim():"style"===u?a("style",p).join(";").trim():p,(r.$attrs=r.$attrs||{})&&(r.$attrs[u]=p),r.setAttribute(u,p))}})}}},{key:"getAttribute",value:function getAttribute(r,o){if(r){var i=r.getAttribute(o);return isNaN(i)?"true"===i||"false"===i?"true"===i:i:+i}}},{key:"isAttributeEquals",value:function isAttributeEquals(r,o,i){return!!r&&this.getAttribute(r,o)===i}},{key:"isAttributeNotEquals",value:function isAttributeNotEquals(r,o,i){return!this.isAttributeEquals(r,o,i)}},{key:"getHeight",value:function getHeight(r){if(r){var o=r.offsetHeight,i=getComputedStyle(r);return o-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth)}return 0}},{key:"getWidth",value:function getWidth(r){if(r){var o=r.offsetWidth,i=getComputedStyle(r);return o-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth)}return 0}},{key:"alignOverlay",value:function alignOverlay(r,o,i){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];r&&o&&("self"===i?this.relativePosition(r,o):(a&&(r.style.minWidth=DomHandler.getOuterWidth(o)+"px"),this.absolutePosition(r,o)))}},{key:"absolutePosition",value:function absolutePosition(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left";if(r&&o){var a,c,u=r.offsetParent?{width:r.offsetWidth,height:r.offsetHeight}:this.getHiddenElementDimensions(r),p=u.height,g=u.width,v=o.offsetHeight,b=o.offsetWidth,k=o.getBoundingClientRect(),E=this.getWindowScrollTop(),w=this.getWindowScrollLeft(),x=this.getViewport();k.top+v+p>x.height?((a=k.top+E-p)<0&&(a=E),r.style.transformOrigin="bottom"):(a=v+k.top+E,r.style.transformOrigin="top");var C=k.left;c="left"===i?C+g>x.width?Math.max(0,C+w+b-g):C+w:C+b-g<0?w:C+b-g+w,r.style.top=a+"px",r.style.left=c+"px"}}},{key:"relativePosition",value:function relativePosition(r,o){if(r&&o){var i,a,c=r.offsetParent?{width:r.offsetWidth,height:r.offsetHeight}:this.getHiddenElementDimensions(r),u=o.offsetHeight,p=o.getBoundingClientRect(),g=this.getViewport();p.top+u+c.height>g.height?(i=-1*c.height,p.top+i<0&&(i=-1*p.top),r.style.transformOrigin="bottom"):(i=u,r.style.transformOrigin="top"),a=c.width>g.width?-1*p.left:p.left+c.width>g.width?-1*(p.left+c.width-g.width):0,r.style.top=i+"px",r.style.left=a+"px"}}},{key:"flipfitCollision",value:function flipfitCollision(r,o){var i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left top",c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left bottom",u=arguments.length>4?arguments[4]:void 0;if(r&&o){var p=o.getBoundingClientRect(),g=this.getViewport(),v=a.split(" "),b=c.split(" "),k=function getPositionValue(r,o){return o?+r.substring(r.search(/(\+|-)/g))||0:r.substring(0,r.search(/(\+|-)/g))||r},E={my:{x:k(v[0]),y:k(v[1]||v[0]),offsetX:k(v[0],!0),offsetY:k(v[1]||v[0],!0)},at:{x:k(b[0]),y:k(b[1]||b[0]),offsetX:k(b[0],!0),offsetY:k(b[1]||b[0],!0)}},w={left:function left(){return E.my.offsetX+E.at.offsetX+p.left+("left"===E.my.x?0:-1*("center"===E.my.x?i.getOuterWidth(r)/2:i.getOuterWidth(r)))},top:function top(){return E.my.offsetY+E.at.offsetY+p.top+("top"===E.my.y?0:-1*("center"===E.my.y?i.getOuterHeight(r)/2:i.getOuterHeight(r)))}},x={count:{x:0,y:0},left:function left(){var left=w.left(),o=DomHandler.getWindowScrollLeft();r.style.left=left+o+"px",2===this.count.x?(r.style.left=o+"px",this.count.x=0):left<0&&(this.count.x++,E.my.x="left",E.at.x="right",E.my.offsetX*=-1,E.at.offsetX*=-1,this.right())},right:function right(){var i=w.left()+DomHandler.getOuterWidth(o),a=DomHandler.getWindowScrollLeft();r.style.left=i+a+"px",2===this.count.x?(r.style.left=g.width-DomHandler.getOuterWidth(r)+a+"px",this.count.x=0):i+DomHandler.getOuterWidth(r)>g.width&&(this.count.x++,E.my.x="right",E.at.x="left",E.my.offsetX*=-1,E.at.offsetX*=-1,this.left())},top:function top(){var top=w.top(),o=DomHandler.getWindowScrollTop();r.style.top=top+o+"px",2===this.count.y?(r.style.left=o+"px",this.count.y=0):top<0&&(this.count.y++,E.my.y="top",E.at.y="bottom",E.my.offsetY*=-1,E.at.offsetY*=-1,this.bottom())},bottom:function bottom(){var i=w.top()+DomHandler.getOuterHeight(o),a=DomHandler.getWindowScrollTop();r.style.top=i+a+"px",2===this.count.y?(r.style.left=g.height-DomHandler.getOuterHeight(r)+a+"px",this.count.y=0):i+DomHandler.getOuterHeight(o)>g.height&&(this.count.y++,E.my.y="bottom",E.at.y="top",E.my.offsetY*=-1,E.at.offsetY*=-1,this.top())},center:function center(i){if("y"===i){var a=w.top()+DomHandler.getOuterHeight(o)/2;r.style.top=a+DomHandler.getWindowScrollTop()+"px",a<0?this.bottom():a+DomHandler.getOuterHeight(o)>g.height&&this.top()}else{var c=w.left()+DomHandler.getOuterWidth(o)/2;r.style.left=c+DomHandler.getWindowScrollLeft()+"px",c<0?this.left():c+DomHandler.getOuterWidth(r)>g.width&&this.right()}}};x[E.at.x]("x"),x[E.at.y]("y"),this.isFunction(u)&&u(E)}}},{key:"findCollisionPosition",value:function findCollisionPosition(r){if(r){var o="left"===r?"right":"left";return"top"===r||"bottom"===r?{axis:"y",my:"center ".concat("top"===r?"bottom":"top"),at:"center ".concat(r)}:{axis:"x",my:"".concat(o," center"),at:"".concat(r," center")}}}},{key:"getParents",value:function getParents(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return null===r.parentNode?o:this.getParents(r.parentNode,o.concat([r.parentNode]))}},{key:"getScrollableParents",value:function getScrollableParents(r){var o=this,i=[];if(r){var a,c=this.getParents(r),u=/(auto|scroll)/,p=function overflowCheck(r){var o=r?getComputedStyle(r):null;return o&&(u.test(o.getPropertyValue("overflow"))||u.test(o.getPropertyValue("overflow-x"))||u.test(o.getPropertyValue("overflow-y")))},g=function addScrollableParent(r){i.push("BODY"===r.nodeName||"HTML"===r.nodeName||o.isDocument(r)?window:r)},v=_createForOfIteratorHelper$1(c);try{for(v.s();!(a=v.n()).done;){var b,k=a.value,E=1===k.nodeType&&(null===(b=k.dataset)||void 0===b?void 0:b.scrollselectors);if(E){var w,x=_createForOfIteratorHelper$1(E.split(","));try{for(x.s();!(w=x.n()).done;){var C=w.value,_=this.findSingle(k,C);_&&p(_)&&g(_)}}catch(r){x.e(r)}finally{x.f()}}1===k.nodeType&&p(k)&&g(k)}}catch(r){v.e(r)}finally{v.f()}}return i}},{key:"getHiddenElementOuterHeight",value:function getHiddenElementOuterHeight(r){if(r){r.style.visibility="hidden",r.style.display="block";var o=r.offsetHeight;return r.style.display="none",r.style.visibility="visible",o}return 0}},{key:"getHiddenElementOuterWidth",value:function getHiddenElementOuterWidth(r){if(r){r.style.visibility="hidden",r.style.display="block";var o=r.offsetWidth;return r.style.display="none",r.style.visibility="visible",o}return 0}},{key:"getHiddenElementDimensions",value:function getHiddenElementDimensions(r){var o={};return r&&(r.style.visibility="hidden",r.style.display="block",o.width=r.offsetWidth,o.height=r.offsetHeight,r.style.display="none",r.style.visibility="visible"),o}},{key:"fadeIn",value:function fadeIn(r,o){if(r){r.style.opacity=0;var i=+new Date,a=0,c=function tick(){a=+r.style.opacity+((new Date).getTime()-i)/o,r.style.opacity=a,i=+new Date,+a<1&&(window.requestAnimationFrame&&requestAnimationFrame(c)||setTimeout(c,16))};c()}}},{key:"fadeOut",value:function fadeOut(r,o){if(r)var i=1,a=50/o,c=setInterval(function(){(i-=a)<=0&&(i=0,clearInterval(c)),r.style.opacity=i},50)}},{key:"getUserAgent",value:function getUserAgent(){return navigator.userAgent}},{key:"isIOS",value:function isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function isAndroid(){return/(android)/i.test(navigator.userAgent)}},{key:"isChrome",value:function isChrome(){return/(chrome)/i.test(navigator.userAgent)}},{key:"isClient",value:function isClient(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}},{key:"isTouchDevice",value:function isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function isFunction(r){return!!(r&&r.constructor&&r.call&&r.apply)}},{key:"appendChild",value:function appendChild(r,o){if(this.isElement(o))o.appendChild(r);else{if(!o.el||!o.el.nativeElement)throw new Error("Cannot append "+o+" to "+r);o.el.nativeElement.appendChild(r)}}},{key:"removeChild",value:function removeChild(r,o){if(this.isElement(o))o.removeChild(r);else{if(!o.el||!o.el.nativeElement)throw new Error("Cannot remove "+r+" from "+o);o.el.nativeElement.removeChild(r)}}},{key:"isElement",value:function isElement(r){return"object"===("undefined"==typeof HTMLElement?"undefined":_typeof(HTMLElement))?r instanceof HTMLElement:r&&"object"===_typeof(r)&&null!==r&&1===r.nodeType&&"string"==typeof r.nodeName}},{key:"isDocument",value:function isDocument(r){return"object"===("undefined"==typeof Document?"undefined":_typeof(Document))?r instanceof Document:r&&"object"===_typeof(r)&&null!==r&&9===r.nodeType}},{key:"scrollInView",value:function scrollInView(r,o){var i=getComputedStyle(r).getPropertyValue("border-top-width"),a=i?parseFloat(i):0,c=getComputedStyle(r).getPropertyValue("padding-top"),u=c?parseFloat(c):0,p=r.getBoundingClientRect(),g=o.getBoundingClientRect().top+document.body.scrollTop-(p.top+document.body.scrollTop)-a-u,v=r.scrollTop,b=r.clientHeight,k=this.getOuterHeight(o);g<0?r.scrollTop=v+g:g+k>b&&(r.scrollTop=v+g-b+k)}},{key:"clearSelection",value:function clearSelection(){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(r){}}},{key:"calculateScrollbarWidth",value:function calculateScrollbarWidth(r){if(r){var o=getComputedStyle(r);return r.offsetWidth-r.clientWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.borderRightWidth)}if(null!=this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var i=document.createElement("div");i.className="p-scrollbar-measure",document.body.appendChild(i);var a=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),this.calculatedScrollbarWidth=a,a}},{key:"calculateBodyScrollbarWidth",value:function calculateBodyScrollbarWidth(){return window.innerWidth-document.documentElement.offsetWidth}},{key:"getBrowser",value:function getBrowser(){if(!this.browser){var r=this.resolveUserAgent();this.browser={},r.browser&&(this.browser[r.browser]=!0,this.browser.version=r.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function resolveUserAgent(){var r=navigator.userAgent.toLowerCase(),o=/(chrome)[ ]([\w.]+)/.exec(r)||/(webkit)[ ]([\w.]+)/.exec(r)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(r)||/(msie) ([\w.]+)/.exec(r)||r.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(r)||[];return{browser:o[1]||"",version:o[2]||"0"}}},{key:"blockBodyScroll",value:function blockBodyScroll(){var r=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,r)}},{key:"unblockBodyScroll",value:function unblockBodyScroll(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"p-overflow-hidden";document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,r)}},{key:"isVisible",value:function isVisible(r){return r&&(0!==r.clientHeight||0!==r.getClientRects().length||"none"!==getComputedStyle(r).display)}},{key:"isExist",value:function isExist(r){return!(null==r||!r.nodeName||!r.parentNode)}},{key:"getFocusableElements",value:function getFocusableElements(r){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=[],c=_createForOfIteratorHelper$1(DomHandler.find(r,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(i,',\n [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i,',\n [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])').concat(i)));try{for(c.s();!(o=c.n()).done;){var u=o.value;"none"!==getComputedStyle(u).display&&"hidden"!==getComputedStyle(u).visibility&&a.push(u)}}catch(r){c.e(r)}finally{c.f()}return a}},{key:"getFirstFocusableElement",value:function getFirstFocusableElement(r,o){var i=DomHandler.getFocusableElements(r,o);return i.length>0?i[0]:null}},{key:"getLastFocusableElement",value:function getLastFocusableElement(r,o){var i=DomHandler.getFocusableElements(r,o);return i.length>0?i[i.length-1]:null}},{key:"focus",value:function focus(r,o){var i=void 0===o||!o;r&&document.activeElement!==r&&r.focus({preventScroll:i})}},{key:"focusFirstElement",value:function focusFirstElement(r,o){if(r){var i=DomHandler.getFirstFocusableElement(r);return i&&DomHandler.focus(i,o),i}}},{key:"getCursorOffset",value:function getCursorOffset(r,o,i,a){if(r){var c=getComputedStyle(r),u=document.createElement("div");u.style.position="absolute",u.style.top="0px",u.style.left="0px",u.style.visibility="hidden",u.style.pointerEvents="none",u.style.overflow=c.overflow,u.style.width=c.width,u.style.height=c.height,u.style.padding=c.padding,u.style.border=c.border,u.style.overflowWrap=c.overflowWrap,u.style.whiteSpace=c.whiteSpace,u.style.lineHeight=c.lineHeight,u.innerHTML=o.replace(/\r\n|\r|\n/g,"<br />");var p=document.createElement("span");p.textContent=a,u.appendChild(p);var g=document.createTextNode(i);u.appendChild(g),document.body.appendChild(u);var v=p.offsetLeft,b=p.offsetTop,k=p.clientHeight;return document.body.removeChild(u),{left:Math.abs(v-r.scrollLeft),top:Math.abs(b-r.scrollTop)+k}}return{top:"auto",left:"auto"}}},{key:"invokeElementMethod",value:function invokeElementMethod(r,o,i){r[o].apply(r,i)}},{key:"isClickable",value:function isClickable(r){var o=r.nodeName,i=r.parentElement&&r.parentElement.nodeName;return"INPUT"===o||"TEXTAREA"===o||"BUTTON"===o||"A"===o||"INPUT"===i||"TEXTAREA"===i||"BUTTON"===i||"A"===i||this.hasClass(r,"p-button")||this.hasClass(r.parentElement,"p-button")||this.hasClass(r.parentElement,"p-checkbox")||this.hasClass(r.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function applyStyle(r,o){if("string"==typeof o)r.style.cssText=o;else for(var i in o)r.style[i]=o[i]}},{key:"exportCSV",value:function exportCSV(r,o){var i=new Blob([r],{type:"application/csv;charset=utf-8;"});window.navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(i,o+".csv"):DomHandler.saveAs({name:o+".csv",src:URL.createObjectURL(i)})||(r="data:text/csv;charset=utf-8,"+r,window.open(encodeURI(r)))}},{key:"saveAs",value:function saveAs(r){if(r){var o=document.createElement("a");if(void 0!==o.download){var i=r.name,a=r.src;return o.setAttribute("href",a),o.setAttribute("download",i),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),!0}}return!1}},{key:"createInlineStyle",value:function createInlineStyle(r,o){var i=document.createElement("style");return DomHandler.addNonce(i,r),o||(o=document.head),o.appendChild(i),i}},{key:"removeInlineStyle",value:function removeInlineStyle(r){if(this.isExist(r)){try{r.parentNode.removeChild(r)}catch(r){}r=null}return r}},{key:"addNonce",value:function addNonce(r,o){try{o||(o=process.env.REACT_APP_CSS_NONCE)}catch(r){}o&&r.setAttribute("nonce",o)}},{key:"getTargetElement",value:function getTargetElement(r){if(!r)return null;if("document"===r)return document;if("window"===r)return window;if("object"===_typeof(r)&&r.hasOwnProperty("current"))return this.isExist(r.current)?r.current:null;var o=function isFunction(r){return!!(r&&r.constructor&&r.call&&r.apply)}(r)?r():r;return this.isDocument(o)||this.isExist(o)?o:null}},{key:"getAttributeNames",value:function getAttributeNames(r){var o,i,a;for(i=[],a=r.attributes,o=0;o<a.length;++o)i.push(a[o].nodeName);return i.sort(),i}},{key:"isEqualElement",value:function isEqualElement(r,o){var i,a,c,u,p;if(i=DomHandler.getAttributeNames(r),a=DomHandler.getAttributeNames(o),i.join(",")!==a.join(","))return!1;for(var g=0;g<i.length;++g)if("style"===(c=i[g]))for(var v=r.style,b=o.style,k=/^\d+$/,E=0,w=Object.keys(v);E<w.length;E++){var x=w[E];if(!k.test(x)&&v[x]!==b[x])return!1}else if(r.getAttribute(c)!==o.getAttribute(c))return!1;for(u=r.firstChild,p=o.firstChild;u&&p;u=u.nextSibling,p=p.nextSibling){if(u.nodeType!==p.nodeType)return!1;if(1===u.nodeType){if(!DomHandler.isEqualElement(u,p))return!1}else if(u.nodeValue!==p.nodeValue)return!1}return!u&&!p}},{key:"hasCSSAnimation",value:function hasCSSAnimation(r){if(r){var o=getComputedStyle(r);return parseFloat(o.getPropertyValue("animation-duration")||"0")>0}return!1}},{key:"hasCSSTransition",value:function hasCSSTransition(r){if(r){var o=getComputedStyle(r);return parseFloat(o.getPropertyValue("transition-duration")||"0")>0}return!1}}])}();function _createForOfIteratorHelper(r,o){var i="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function _unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return _arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(r,o):void 0}}(r))||o&&r&&"number"==typeof r.length){i&&(r=i);var a=0,c=function F(){};return{s:c,n:function n(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function e(r){throw r},f:c}}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 u,p=!0,g=!1;return{s:function s(){i=i.call(r)},n:function n(){var r=i.next();return p=r.done,r},e:function e(r){g=!0,u=r},f:function f(){try{p||null==i.return||i.return()}finally{if(g)throw u}}}}function _arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}_defineProperty(u,"DATA_PROPS",["data-"]),_defineProperty(u,"ARIA_PROPS",["aria","focus-target"]);var p=function(){function ObjectUtils(){_classCallCheck(this,ObjectUtils)}return _createClass(ObjectUtils,null,[{key:"equals",value:function equals(r,o,i){return i&&r&&"object"===_typeof(r)&&o&&"object"===_typeof(o)?this.deepEquals(this.resolveFieldData(r,i),this.resolveFieldData(o,i)):this.deepEquals(r,o)}},{key:"deepEquals",value:function deepEquals(r,o){if(r===o)return!0;if(r&&o&&"object"===_typeof(r)&&"object"===_typeof(o)){var i,a,c,u=Array.isArray(r),p=Array.isArray(o);if(u&&p){if((a=r.length)!==o.length)return!1;for(i=a;0!==i--;)if(!this.deepEquals(r[i],o[i]))return!1;return!0}if(u!==p)return!1;var g=r instanceof Date,v=o instanceof Date;if(g!==v)return!1;if(g&&v)return r.getTime()===o.getTime();var b=r instanceof RegExp,k=o instanceof RegExp;if(b!==k)return!1;if(b&&k)return r.toString()===o.toString();var E=Object.keys(r);if((a=E.length)!==Object.keys(o).length)return!1;for(i=a;0!==i--;)if(!Object.prototype.hasOwnProperty.call(o,E[i]))return!1;for(i=a;0!==i--;)if(c=E[i],!this.deepEquals(r[c],o[c]))return!1;return!0}return r!=r&&o!=o}},{key:"resolveFieldData",value:function resolveFieldData(r,o){if(!r||!o)return null;try{var i=r[o];if(this.isNotEmpty(i))return i}catch(r){}if(Object.keys(r).length){if(this.isFunction(o))return o(r);if(this.isNotEmpty(r[o]))return r[o];if(-1===o.indexOf("."))return r[o];for(var a=o.split("."),c=r,u=0,p=a.length;u<p;++u){if(null==c)return null;c=c[a[u]]}return c}return null}},{key:"findDiffKeys",value:function findDiffKeys(r,o){return r&&o?Object.keys(r).filter(function(r){return!o.hasOwnProperty(r)}).reduce(function(o,i){return o[i]=r[i],o},{}):{}}},{key:"reduceKeys",value:function reduceKeys(r,o){var i={};return r&&o&&0!==o.length?(Object.keys(r).filter(function(r){return o.some(function(o){return r.startsWith(o)})}).forEach(function(o){i[o]=r[o],delete r[o]}),i):i}},{key:"reorderArray",value:function reorderArray(r,o,i){r&&o!==i&&(i>=r.length&&(i%=r.length,o%=r.length),r.splice(i,0,r.splice(o,1)[0]))}},{key:"findIndexInList",value:function findIndexInList(r,o,i){var a=this;return o?i?o.findIndex(function(o){return a.equals(o,r,i)}):o.findIndex(function(o){return o===r}):-1}},{key:"getJSXElement",value:function getJSXElement(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return this.isFunction(r)?r.apply(void 0,i):r}},{key:"getItemValue",value:function getItemValue(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return this.isFunction(r)?r.apply(void 0,i):r}},{key:"getProp",value:function getProp(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r?r[o]:void 0;return void 0===a?i[o]:a}},{key:"getPropCaseInsensitive",value:function getPropCaseInsensitive(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=this.toFlatCase(o);for(var c in r)if(r.hasOwnProperty(c)&&this.toFlatCase(c)===a)return r[c];for(var u in i)if(i.hasOwnProperty(u)&&this.toFlatCase(u)===a)return i[u]}},{key:"getMergedProps",value:function getMergedProps(r,o){return Object.assign({},o,r)}},{key:"getDiffProps",value:function getDiffProps(r,o){return this.findDiffKeys(r,o)}},{key:"getPropValue",value:function getPropValue(r){if(!this.isFunction(r))return r;for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];if(1===i.length){var c=i[0];return r(Array.isArray(c)?c[0]:c)}return r.apply(void 0,i)}},{key:"getComponentProp",value:function getComponentProp(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.isNotEmpty(r)?this.getProp(r.props,o,i):void 0}},{key:"getComponentProps",value:function getComponentProps(r,o){return this.isNotEmpty(r)?this.getMergedProps(r.props,o):void 0}},{key:"getComponentDiffProps",value:function getComponentDiffProps(r,o){return this.isNotEmpty(r)?this.getDiffProps(r.props,o):void 0}},{key:"isValidChild",value:function isValidChild(r,o,i){if(r){var a,c=this.getComponentProp(r,"__TYPE")||(r.type?r.type.displayName:void 0);!c&&null!=r&&null!==(a=r.type)&&void 0!==a&&null!==(a=a._payload)&&void 0!==a&&a.value&&(c=r.type._payload.value.find(function(r){return r===o}));var u=c===o;try{0}catch(r){}return u}return!1}},{key:"getRefElement",value:function getRefElement(r){return r?"object"===_typeof(r)&&r.hasOwnProperty("current")?r.current:r:null}},{key:"combinedRefs",value:function combinedRefs(r,o){r&&o&&("function"==typeof o?o(r.current):o.current=r.current)}},{key:"removeAccents",value:function removeAccents(r){return r&&r.search(/[\xC0-\xFF]/g)>-1&&(r=r.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")),r}},{key:"toFlatCase",value:function toFlatCase(r){return this.isNotEmpty(r)&&this.isString(r)?r.replace(/(-|_)/g,"").toLowerCase():r}},{key:"toCapitalCase",value:function toCapitalCase(r){return this.isNotEmpty(r)&&this.isString(r)?r[0].toUpperCase()+r.slice(1):r}},{key:"trim",value:function trim(r){return this.isNotEmpty(r)&&this.isString(r)?r.trim():r}},{key:"isEmpty",value:function isEmpty(r){return null==r||""===r||Array.isArray(r)&&0===r.length||!(r instanceof Date)&&"object"===_typeof(r)&&0===Object.keys(r).length}},{key:"isNotEmpty",value:function isNotEmpty(r){return!this.isEmpty(r)}},{key:"isFunction",value:function isFunction(r){return!!(r&&r.constructor&&r.call&&r.apply)}},{key:"isObject",value:function isObject(r){return null!==r&&r instanceof Object&&r.constructor===Object}},{key:"isDate",value:function isDate(r){return null!==r&&r instanceof Date&&r.constructor===Date}},{key:"isArray",value:function isArray(r){return null!==r&&Array.isArray(r)}},{key:"isString",value:function isString(r){return null!==r&&"string"==typeof r}},{key:"isPrintableCharacter",value:function isPrintableCharacter(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.isNotEmpty(r)&&1===r.length&&r.match(/\S| /)}},{key:"isLetter",value:function isLetter(r){return/^[a-zA-Z\u00C0-\u017F]$/.test(r)}},{key:"isScalar",value:function isScalar(r){return null!=r&&("string"==typeof r||"number"==typeof r||"bigint"==typeof r||"boolean"==typeof r)}},{key:"findLast",value:function findLast(r,o){var i;if(this.isNotEmpty(r))try{i=r.findLast(o)}catch(a){i=_toConsumableArray(r).reverse().find(o)}return i}},{key:"findLastIndex",value:function findLastIndex(r,o){var i=-1;if(this.isNotEmpty(r))try{i=r.findLastIndex(o)}catch(a){i=r.lastIndexOf(_toConsumableArray(r).reverse().find(o))}return i}},{key:"sort",value:function sort(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=this.compare(r,o,a,i),p=i;return(this.isEmpty(r)||this.isEmpty(o))&&(p=1===c?i:c),p*u}},{key:"compare",value:function compare(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,c=this.isEmpty(r),u=this.isEmpty(o);return c&&u?0:c?a:u?-a:"string"==typeof r&&"string"==typeof o?i(r,o):r<o?-1:r>o?1:0}},{key:"localeComparator",value:function localeComparator(r){return new Intl.Collator(r,{numeric:!0}).compare}},{key:"findChildrenByKey",value:function findChildrenByKey(r,o){var i,a=_createForOfIteratorHelper(r);try{for(a.s();!(i=a.n()).done;){var c=i.value;if(c.key===o)return c.children||[];if(c.children){var u=this.findChildrenByKey(c.children,o);if(u.length>0)return u}}}catch(r){a.e(r)}finally{a.f()}return[]}},{key:"mutateFieldData",value:function mutateFieldData(r,o,i){if("object"===_typeof(r)&&"string"==typeof o)for(var a=o.split("."),c=r,u=0,p=a.length;u<p;++u){if(u+1-p===0){c[a[u]]=i;break}c[a[u]]||(c[a[u]]={}),c=c[a[u]]}}},{key:"getNestedValue",value:function getNestedValue(r,o){return o.split(".").reduce(function(r,o){return r&&void 0!==r[o]?r[o]:void 0},r)}},{key:"absoluteCompare",value:function absoluteCompare(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!r||!o)return!0;if(a>i)return!0;if(_typeof(r)!==_typeof(o))return!1;var c=Object.keys(r),u=Object.keys(o);if(c.length!==u.length)return!1;for(var p=0,g=c;p<g.length;p++){var v=g[p],b=r[v],k=o[v],E=ObjectUtils.isObject(b)&&ObjectUtils.isObject(k),w=ObjectUtils.isFunction(b)&&ObjectUtils.isFunction(k);if((E||w)&&!this.absoluteCompare(b,k,i,a+1))return!1;if(!E&&b!==k)return!1}return!0}},{key:"selectiveCompare",value:function selectiveCompare(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(r===o)return!0;if(!r||!o||"object"!==_typeof(r)||"object"!==_typeof(o))return!1;if(!i)return this.absoluteCompare(r,o,1);var c,u=_createForOfIteratorHelper(i);try{for(u.s();!(c=u.n()).done;){var p=c.value,g=this.getNestedValue(r,p),v=this.getNestedValue(o,p),b="object"===_typeof(g)&&null!==g&&"object"===_typeof(v)&&null!==v;if(b&&!this.absoluteCompare(g,v,a))return!1;if(!b&&g!==v)return!1}}catch(r){u.e(r)}finally{u.f()}return!0}}])}(),g=0;function UniqueComponentId(){return g++,"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pr_id_").concat(g)}function ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function _objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ownKeys(Object(i),!0).forEach(function(o){_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}function mergeProps(r){if(r){var o=function isFunction(r){return"function"==typeof r},i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).classNameMergeFunction,a=o(i);return r.reduce(function(r,c){if(!c)return r;var u=function _loop(){var u=c[p];if("style"===p)r.style=_objectSpread(_objectSpread({},r.style),c.style);else if("className"===p){var g="";g=a?i(r.className,c.className):[r.className,c.className].join(" ").trim(),r.className=g||void 0}else if(o(u)){var v=r[p];r[p]=v?function(){v.apply(void 0,arguments),u.apply(void 0,arguments)}:u}else r[p]=u};for(var p in c)u();return r},{})}}var v=function handler(){var r=[],o=function getLastZIndex(o,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return _toConsumableArray(r).reverse().find(function(r){return!!i||r.key===o})||{key:o,value:a}};return{get:function getZIndex(r){return r&&parseInt(r.style.zIndex,10)||0},set:function set(i,a,c,u){a&&(a.style.zIndex=String(function generateZIndex(i,a){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,u=o(i,a,c),p=u.value+(u.key===i?0:c)+1;return r.push({key:i,value:p}),p}(i,c,u)))},clear:function clear(o){o&&(!function revertZIndex(o){r=r.filter(function(r){return r.value!==o})}(v.get(o)),o.style.zIndex="")},getCurrent:function getCurrent(r,i){return function getCurrentZIndex(r,i){return o(r,i).value}(r,i)}}}(),b=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"});Object.freeze({AND:"and",OR:"or"});function api_esm_typeof(r){return api_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},api_esm_typeof(r)}function api_esm_toPropertyKey(r){var o=function api_esm_toPrimitive(r,o){if("object"!=api_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=api_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==api_esm_typeof(o)?o:o+""}function api_esm_defineProperty(r,o,i){return(o=api_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function api_esm_defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,api_esm_toPropertyKey(a.key),a)}}function api_esm_createClass(r,o,i){return o&&api_esm_defineProperties(r.prototype,o),i&&api_esm_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}var k=api_esm_createClass(function PrimeReact(){!function api_esm_classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}(this,PrimeReact)});api_esm_defineProperty(k,"ripple",!1),api_esm_defineProperty(k,"inputStyle","outlined"),api_esm_defineProperty(k,"locale","en"),api_esm_defineProperty(k,"appendTo",null),api_esm_defineProperty(k,"cssTransition",!0),api_esm_defineProperty(k,"autoZIndex",!0),api_esm_defineProperty(k,"hideOverlaysOnDocumentScrolling",!1),api_esm_defineProperty(k,"nonce",null),api_esm_defineProperty(k,"nullSortOrder",1),api_esm_defineProperty(k,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200}),api_esm_defineProperty(k,"pt",void 0),api_esm_defineProperty(k,"filterMatchModeOptions",{text:[b.STARTS_WITH,b.CONTAINS,b.NOT_CONTAINS,b.ENDS_WITH,b.EQUALS,b.NOT_EQUALS],numeric:[b.EQUALS,b.NOT_EQUALS,b.LESS_THAN,b.LESS_THAN_OR_EQUAL_TO,b.GREATER_THAN,b.GREATER_THAN_OR_EQUAL_TO],date:[b.DATE_IS,b.DATE_IS_NOT,b.DATE_BEFORE,b.DATE_AFTER]}),api_esm_defineProperty(k,"changeTheme",function(r,o,i,a){var c,u=document.getElementById(i);if(!u)throw Error("Element with id ".concat(i," not found."));var p=u.getAttribute("href").replace(r,o),g=document.createElement("link");g.setAttribute("rel","stylesheet"),g.setAttribute("id",i),g.setAttribute("href",p),g.addEventListener("load",function(){a&&a()}),null===(c=u.parentNode)||void 0===c||c.replaceChild(g,u)});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=c().createContext(),w=k;function hooks_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function hooks_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return hooks_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?hooks_esm_arrayLikeToArray(r,o):void 0}}function hooks_esm_slicedToArray(r,o){return function hooks_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function hooks_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||hooks_esm_unsupportedIterableToArray(r,o)||function hooks_esm_nonIterableRest(){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 x=function usePrevious(r){var o=a.useRef(null);return a.useEffect(function(){return o.current=r,function(){o.current=null}},[r]),o.current},C=function useUnmountEffect(r){return a.useEffect(function(){return r},[])},_=function useEventListener(r){var o=r.target,i=void 0===o?"document":o,c=r.type,g=r.listener,v=r.options,b=r.when,k=void 0===b||b,E=a.useRef(null),w=a.useRef(null),_=x(g),T=x(v),P=function bind(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.target;p.isNotEmpty(o)&&(A(),(r.when||k)&&(E.current=u.getTargetElement(o))),!w.current&&E.current&&(w.current=function(r){return g&&g(r)},E.current.addEventListener(c,w.current,v))},A=function unbind(){w.current&&(E.current.removeEventListener(c,w.current,v),w.current=null)},N=function dispose(){A(),_=null,T=null},R=a.useCallback(function(){k?E.current=u.getTargetElement(i):(A(),E.current=null)},[i,k]);return a.useEffect(function(){R()},[R]),a.useEffect(function(){var r="".concat(_)!=="".concat(g),o=T!==v,i=w.current;i&&(r||o)?(A(),k&&P()):i||N()},[g,v,k]),C(function(){N()}),[P,A]},T={};function hooks_esm_toConsumableArray(r){return function hooks_esm_arrayWithoutHoles(r){if(Array.isArray(r))return hooks_esm_arrayLikeToArray(r)}(r)||function hooks_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||hooks_esm_unsupportedIterableToArray(r)||function hooks_esm_nonIterableSpread(){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 P=1200,A={escKeyListeners:new Map,onGlobalKeyDown:function onGlobalKeyDown(r){if("Escape"===r.code){var o=A.escKeyListeners,i=Math.max.apply(Math,hooks_esm_toConsumableArray(o.keys())),a=o.get(i),c=Math.max.apply(Math,hooks_esm_toConsumableArray(a.keys()));a.get(c)(r)}},refreshGlobalKeyDownListener:function refreshGlobalKeyDownListener(){var r=u.getTargetElement("document");this.escKeyListeners.size>0?r.addEventListener("keydown",this.onGlobalKeyDown):r.removeEventListener("keydown",this.onGlobalKeyDown)},addListener:function addListener(r,o){var i=this,a=hooks_esm_slicedToArray(o,2),c=a[0],u=a[1],p=this.escKeyListeners;p.has(c)||p.set(c,new Map);var g=p.get(c);if(g.has(u))throw new Error("Unexpected: global esc key listener with priority [".concat(c,", ").concat(u,"] already exists."));return g.set(u,r),this.refreshGlobalKeyDownListener(),function(){g.delete(u),0===g.size&&p.delete(c),i.refreshGlobalKeyDownListener()}}},N=function useMergeProps(){var r=(0,a.useContext)(E);return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return mergeProps(i,null==r?void 0:r.ptOptions)}},R=function useMountEffect(r){var o=a.useRef(!1);return a.useEffect(function(){if(!o.current)return o.current=!0,r&&r()},[])};var I=function useOverlayScrollListener(r){var o=r.target,i=r.listener,c=r.options,g=r.when,v=void 0===g||g,b=a.useContext(E),k=a.useRef(null),_=a.useRef(null),T=a.useRef([]),P=x(i),A=x(c),N=function bind(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(p.isNotEmpty(r.target)&&(R(),(r.when||v)&&(k.current=u.getTargetElement(r.target))),!_.current&&k.current){var o=b?b.hideOverlaysOnDocumentScrolling:w.hideOverlaysOnDocumentScrolling,a=T.current=u.getScrollableParents(k.current);a.some(function(r){return r===document.body||r===window})||a.push(o?window:document.body),_.current=function(r){return i&&i(r)},a.forEach(function(r){return r.addEventListener("scroll",_.current,c)})}},R=function unbind(){_.current&&(T.current.forEach(function(r){return r.removeEventListener("scroll",_.current,c)}),_.current=null)},I=function dispose(){R(),T.current=null,P=null,A=null},L=a.useCallback(function(){v?k.current=u.getTargetElement(o):(R(),k.current=null)},[o,v]);return a.useEffect(function(){L()},[L]),a.useEffect(function(){var r="".concat(P)!=="".concat(i),o=A!==c,a=_.current;a&&(r||o)?(R(),v&&N()):a||I()},[i,c,v]),C(function(){I()}),[N,R]},L=function useResizeListener(r){var o=r.listener,i=r.when;return _({target:"window",type:"resize",listener:o,when:void 0===i||i})},z=0,j=function useStyle(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=hooks_esm_slicedToArray((0,a.useState)(!1),2),c=i[0],p=i[1],g=(0,a.useRef)(null),v=(0,a.useContext)(E),b=u.isClient()?window.document:void 0,k=o.document,x=void 0===k?b:k,C=o.manual,_=void 0!==C&&C,T=o.name,P=void 0===T?"style_".concat(++z):T,A=o.id,N=void 0===A?void 0:A,R=o.media,I=void 0===R?void 0:R,L=function load(){if(x&&!c){var o=(null==v?void 0:v.styleContainer)||x.head;g.current=function getCurrentStyleRef(r){var o=r.querySelector('style[data-primereact-style-id="'.concat(P,'"]'));if(o)return o;if(void 0!==N){var i=x.getElementById(N);if(i)return i}return x.createElement("style")}(o),g.current.isConnected||(g.current.type="text/css",N&&(g.current.id=N),I&&(g.current.media=I),u.addNonce(g.current,v&&v.nonce||w.nonce),o.appendChild(g.current),P&&g.current.setAttribute("data-primereact-style-id",P)),g.current.textContent=r,p(!0)}};return(0,a.useEffect)(function(){_||L()},[_]),{id:N,name:P,update:function update(o){c&&r!==o&&(g.current.textContent=o)},unload:function unload(){x&&g.current&&(u.removeInlineStyle(g.current),p(!1))},load:L,isLoaded:c}},B=function useUpdateEffect(r,o){var i=a.useRef(!1);return a.useEffect(function(){if(i.current)return r&&r();i.current=!0},o)};function componentbase_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function componentbase_esm_toConsumableArray(r){return function componentbase_esm_arrayWithoutHoles(r){if(Array.isArray(r))return componentbase_esm_arrayLikeToArray(r)}(r)||function componentbase_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function componentbase_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return componentbase_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?componentbase_esm_arrayLikeToArray(r,o):void 0}}(r)||function componentbase_esm_nonIterableSpread(){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 componentbase_esm_typeof(r){return componentbase_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},componentbase_esm_typeof(r)}function componentbase_esm_toPropertyKey(r){var o=function componentbase_esm_toPrimitive(r,o){if("object"!=componentbase_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=componentbase_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==componentbase_esm_typeof(o)?o:o+""}function componentbase_esm_defineProperty(r,o,i){return(o=componentbase_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function componentbase_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function componentbase_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?componentbase_esm_ownKeys(Object(i),!0).forEach(function(o){componentbase_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):componentbase_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var V="\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"),U={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 extend(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.css,i=componentbase_esm_objectSpread(componentbase_esm_objectSpread({},r.defaultProps),U.defaultProps),a={},c=function getPTValue(){var r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];o.hasOwnProperty("pt")&&void 0!==o.pt&&(o=o.pt);var u=i,g=/./g.test(u)&&!!a[u.split(".")[0]],v=g?p.toFlatCase(u.split(".")[1]):p.toFlatCase(u),b=a.hostName&&p.toFlatCase(a.hostName)||a.props&&a.props.__TYPE&&p.toFlatCase(a.props.__TYPE)||"",k="transition"===v,E="data-pc-",w=function getHostInstance(r){return null!=r&&r.props?r.hostName?r.props.__TYPE===r.hostName?r.props:w(r.parent):r.parent:void 0};U.cParams=a,U.cName=b;var x=function getPropValue(r){var o,i;return(null===(o=a.props)||void 0===o?void 0:o[r])||(null===(i=w(a))||void 0===i?void 0:i[r])}("ptOptions")||U.context.ptOptions||{},C=x.mergeSections,_=void 0===C||C,T=x.mergeProps,P=void 0!==T&&T,A=function getPTClassValue(){var r=H.apply(void 0,arguments);return Array.isArray(r)?{className:classNames.apply(void 0,componentbase_esm_toConsumableArray(r))}:p.isString(r)?{className:r}:null!=r&&r.hasOwnProperty("className")&&Array.isArray(r.className)?{className:classNames.apply(void 0,componentbase_esm_toConsumableArray(r.className))}:r},N=c?g?G(A,u,a):J(A,u,a):void 0,R=g?void 0:K(W(o,b),A,u,a),I=!k&&componentbase_esm_objectSpread(componentbase_esm_objectSpread({},"root"===v&&componentbase_esm_defineProperty({},"".concat(E,"name"),a.props&&a.props.__parentMetadata?p.toFlatCase(a.props.__TYPE):b)),{},componentbase_esm_defineProperty({},"".concat(E,"section"),v));return _||!_&&R?P?mergeProps([N,R,Object.keys(I).length?I:{}],{classNameMergeFunction:null===(r=U.context.ptOptions)||void 0===r?void 0:r.classNameMergeFunction}):componentbase_esm_objectSpread(componentbase_esm_objectSpread(componentbase_esm_objectSpread({},N),R),Object.keys(I).length?I:{}):componentbase_esm_objectSpread(componentbase_esm_objectSpread({},R),Object.keys(I).length?I:{})};return componentbase_esm_objectSpread(componentbase_esm_objectSpread({getProps:function getProps(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return U.context=o,U.cProps=r,p.getMergedProps(r,i)},getOtherProps:function getOtherProps(r){return p.getDiffProps(r,i)},setMetaData:function setMetaData(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.props,u=r.state,p=function isUnstyled(){return U.context.unstyled||w.unstyled||i.unstyled};return{ptm:function ptm(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c((i||{}).pt,o,componentbase_esm_objectSpread(componentbase_esm_objectSpread({},r),a))},ptmo:function ptmo(){return c(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 sx(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){var p,g=H(o&&o.inlineStyles,r,componentbase_esm_objectSpread({props:i,state:u},c));return mergeProps([H(a,r,componentbase_esm_objectSpread({props:i,state:u},c)),g],{classNameMergeFunction:null===(p=U.context.ptOptions)||void 0===p?void 0:p.classNameMergeFunction})}},cx:function cx(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p()?void 0:H(o&&o.classes,r,componentbase_esm_objectSpread({props:i,state:u},a))},isUnstyled:p}}},r),{},{defaultProps:i})}},H=function getOptionValue(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=String(p.toFlatCase(o)).split("."),c=a.shift(),u=p.isNotEmpty(r)?Object.keys(r).find(function(r){return p.toFlatCase(r)===c}):"";return c?p.isObject(r)?H(p.getItemValue(r[u],i),a.join("."),i):void 0:p.getItemValue(r,i)},W=function _getPT(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,a=null==r?void 0:r._usept,c=function getValue(r){var a,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=i?i(r):r,g=p.toFlatCase(o);return null!==(a=c?g!==U.cName?null==u?void 0:u[g]:void 0:null==u?void 0:u[g])&&void 0!==a?a:u};return p.isNotEmpty(a)?{_usept:a,originalValue:c(r.originalValue),value:c(r.value)}:c(r,!0)},K=function _usePT(r,o,i,a){var c=function fn(r){return o(r,i,a)};if(null!=r&&r.hasOwnProperty("_usept")){var u=r._usept||U.context.ptOptions||{},g=u.mergeSections,v=void 0===g||g,b=u.mergeProps,k=void 0!==b&&b,E=u.classNameMergeFunction,w=c(r.originalValue),x=c(r.value);if(void 0===w&&void 0===x)return;return p.isString(x)?x:p.isString(w)?w:v||!v&&x?k?mergeProps([w,x],{classNameMergeFunction:E}):componentbase_esm_objectSpread(componentbase_esm_objectSpread({},w),x):x}return c(r)},G=function _useGlobalPT(r,o,i){return K(function getGlobalPT(){return W(U.context.pt||w.pt,void 0,function(r){return p.getItemValue(r,U.cParams)})}(),r,o,i)},J=function _useDefaultPT(r,o,i){return K(function getDefaultPT(){return W(U.context.pt||w.pt,void 0,function(r){return H(r,U.cName,U.cParams)||p.getItemValue(r,U.cParams)})}(),r,o,i)},Y=function useHandleStyle(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2?arguments[2]:void 0,a=i.name,c=i.styled,u=void 0!==c&&c,g=i.hostName,v=void 0===g?"":g,b=G(H,"global.css",U.cParams),k=p.toFlatCase(a),E=j("\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,w=j(V,{name:"common",manual:!0}).load,x=j(b,{name:"global",manual:!0}).load,_=j(r,{name:a,manual:!0}).load,T=function hook(r){if(!v){var o=K(W((U.cProps||{}).pt,k),H,"hooks.".concat(r)),i=J(H,"hooks.".concat(r));null==o||o(),null==i||i()}};T("useMountEffect"),R(function(){E(),x(),o()||(w(),u||_())}),B(function(){T("useUpdateEffect")}),C(function(){T("useUnmountEffect")})};function extends_extends(){return extends_extends=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var a in i)({}).hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},extends_extends.apply(null,arguments)}function _objectWithoutPropertiesLoose(r,o){if(null==r)return{};var i={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(-1!==o.indexOf(a))continue;i[a]=r[a]}return i}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _inheritsLoose(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,_setPrototypeOf(r,o)}function replaceClassName(r,o){return r.replace(new RegExp("(^|\\s)"+o+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var X=i(43617),Q=i.n(X),Z=!1,ee=c().createContext(null),te=function forceReflow(r){return r.scrollTop},ne="unmounted",re="exited",oe="entering",ie="entered",ae="exiting",se=function(r){function Transition(o,i){var a;a=r.call(this,o,i)||this;var c,u=i&&!i.isMounting?o.enter:o.appear;return a.appearStatus=null,o.in?u?(c=re,a.appearStatus=oe):c=ie:c=o.unmountOnExit||o.mountOnEnter?ne:re,a.state={status:c},a.nextCallback=null,a}_inheritsLoose(Transition,r),Transition.getDerivedStateFromProps=function getDerivedStateFromProps(r,o){return r.in&&o.status===ne?{status:re}:null};var o=Transition.prototype;return o.componentDidMount=function componentDidMount(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function componentDidUpdate(r){var o=null;if(r!==this.props){var i=this.state.status;this.props.in?i!==oe&&i!==ie&&(o=oe):i!==oe&&i!==ie||(o=ae)}this.updateStatus(!1,o)},o.componentWillUnmount=function componentWillUnmount(){this.cancelNextCallback()},o.getTimeouts=function getTimeouts(){var r,o,i,a=this.props.timeout;return r=o=i=a,null!=a&&"number"!=typeof a&&(r=a.exit,o=a.enter,i=void 0!==a.appear?a.appear:o),{exit:r,enter:o,appear:i}},o.updateStatus=function updateStatus(r,o){if(void 0===r&&(r=!1),null!==o)if(this.cancelNextCallback(),o===oe){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Q().findDOMNode(this);i&&te(i)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===re&&this.setState({status:ne})},o.performEnter=function performEnter(r){var o=this,i=this.props.enter,a=this.context?this.context.isMounting:r,c=this.props.nodeRef?[a]:[Q().findDOMNode(this),a],u=c[0],p=c[1],g=this.getTimeouts(),v=a?g.appear:g.enter;!r&&!i||Z?this.safeSetState({status:ie},function(){o.props.onEntered(u)}):(this.props.onEnter(u,p),this.safeSetState({status:oe},function(){o.props.onEntering(u,p),o.onTransitionEnd(v,function(){o.safeSetState({status:ie},function(){o.props.onEntered(u,p)})})}))},o.performExit=function performExit(){var r=this,o=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:Q().findDOMNode(this);o&&!Z?(this.props.onExit(a),this.safeSetState({status:ae},function(){r.props.onExiting(a),r.onTransitionEnd(i.exit,function(){r.safeSetState({status:re},function(){r.props.onExited(a)})})})):this.safeSetState({status:re},function(){r.props.onExited(a)})},o.cancelNextCallback=function cancelNextCallback(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function safeSetState(r,o){o=this.setNextCallback(o),this.setState(r,o)},o.setNextCallback=function setNextCallback(r){var o=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,o.nextCallback=null,r(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},o.onTransitionEnd=function onTransitionEnd(r,o){this.setNextCallback(o);var i=this.props.nodeRef?this.props.nodeRef.current:Q().findDOMNode(this),a=null==r&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],u=c[0],p=c[1];this.props.addEndListener(u,p)}null!=r&&setTimeout(this.nextCallback,r)}else setTimeout(this.nextCallback,0)},o.render=function render(){var r=this.state.status;if(r===ne)return null;var o=this.props,i=o.children,a=(o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef,_objectWithoutPropertiesLoose(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return c().createElement(ee.Provider,{value:null},"function"==typeof i?i(r,a):c().cloneElement(c().Children.only(i),a))},Transition}(c().Component);function noop(){}se.contextType=ee,se.propTypes={},se.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop,onEntering:noop,onEntered:noop,onExit:noop,onExiting:noop,onExited:noop},se.UNMOUNTED=ne,se.EXITED=re,se.ENTERING=oe,se.ENTERED=ie,se.EXITING=ae;var le=se,ce=function removeClass(r,o){return r&&o&&o.split(" ").forEach(function(o){return function removeClass_removeClass(r,o){r.classList?r.classList.remove(o):"string"==typeof r.className?r.className=replaceClassName(r.className,o):r.setAttribute("class",replaceClassName(r.className&&r.className.baseVal||"",o))}(r,o)})},ue=function(r){function CSSTransition(){for(var o,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];return(o=r.call.apply(r,[this].concat(a))||this).appliedClasses={appear:{},enter:{},exit:{}},o.onEnter=function(r,i){var a=o.resolveArguments(r,i),c=a[0],u=a[1];o.removeClasses(c,"exit"),o.addClass(c,u?"appear":"enter","base"),o.props.onEnter&&o.props.onEnter(r,i)},o.onEntering=function(r,i){var a=o.resolveArguments(r,i),c=a[0],u=a[1]?"appear":"enter";o.addClass(c,u,"active"),o.props.onEntering&&o.props.onEntering(r,i)},o.onEntered=function(r,i){var a=o.resolveArguments(r,i),c=a[0],u=a[1]?"appear":"enter";o.removeClasses(c,u),o.addClass(c,u,"done"),o.props.onEntered&&o.props.onEntered(r,i)},o.onExit=function(r){var i=o.resolveArguments(r)[0];o.removeClasses(i,"appear"),o.removeClasses(i,"enter"),o.addClass(i,"exit","base"),o.props.onExit&&o.props.onExit(r)},o.onExiting=function(r){var i=o.resolveArguments(r)[0];o.addClass(i,"exit","active"),o.props.onExiting&&o.props.onExiting(r)},o.onExited=function(r){var i=o.resolveArguments(r)[0];o.removeClasses(i,"exit"),o.addClass(i,"exit","done"),o.props.onExited&&o.props.onExited(r)},o.resolveArguments=function(r,i){return o.props.nodeRef?[o.props.nodeRef.current,r]:[r,i]},o.getClassNames=function(r){var i=o.props.classNames,a="string"==typeof i,c=a?""+(a&&i?i+"-":"")+r:i[r];return{baseClassName:c,activeClassName:a?c+"-active":i[r+"Active"],doneClassName:a?c+"-done":i[r+"Done"]}},o}_inheritsLoose(CSSTransition,r);var o=CSSTransition.prototype;return o.addClass=function addClass(r,o,i){var a=this.getClassNames(o)[i+"ClassName"],c=this.getClassNames("enter").doneClassName;"appear"===o&&"done"===i&&c&&(a+=" "+c),"active"===i&&r&&te(r),a&&(this.appliedClasses[o][i]=a,function addClass(r,o){r&&o&&o.split(" ").forEach(function(o){return function addClass_addClass(r,o){r.classList?r.classList.add(o):function hasClass(r,o){return r.classList?!!o&&r.classList.contains(o):-1!==(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+o+" ")}(r,o)||("string"==typeof r.className?r.className=r.className+" "+o:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+o))}(r,o)})}(r,a))},o.removeClasses=function removeClasses(r,o){var i=this.appliedClasses[o],a=i.base,c=i.active,u=i.done;this.appliedClasses[o]={},a&&ce(r,a),c&&ce(r,c),u&&ce(r,u)},o.render=function render(){var r=this.props,o=(r.classNames,_objectWithoutPropertiesLoose(r,["classNames"]));return c().createElement(le,extends_extends({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},CSSTransition}(c().Component);ue.defaultProps={classNames:""},ue.propTypes={};var pe=ue;function csstransition_esm_typeof(r){return csstransition_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},csstransition_esm_typeof(r)}function csstransition_esm_toPropertyKey(r){var o=function csstransition_esm_toPrimitive(r,o){if("object"!=csstransition_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=csstransition_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==csstransition_esm_typeof(o)?o:o+""}function csstransition_esm_defineProperty(r,o,i){return(o=csstransition_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}var de={defaultProps:{__TYPE:"CSSTransition",children:void 0},getProps:function getProps(r){return p.getMergedProps(r,de.defaultProps)},getOtherProps:function getOtherProps(r){return p.getDiffProps(r,de.defaultProps)}};function csstransition_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function csstransition_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?csstransition_esm_ownKeys(Object(i),!0).forEach(function(o){csstransition_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):csstransition_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var fe=a.forwardRef(function(r,o){var i=de.getProps(r),c=a.useContext(E),u=i.disabled||i.options&&i.options.disabled||c&&!c.cssTransition||!w.cssTransition,g=function onEnter(r,o){i.onEnter&&i.onEnter(r,o),i.options&&i.options.onEnter&&i.options.onEnter(r,o)},v=function onEntering(r,o){i.onEntering&&i.onEntering(r,o),i.options&&i.options.onEntering&&i.options.onEntering(r,o)},b=function onEntered(r,o){i.onEntered&&i.onEntered(r,o),i.options&&i.options.onEntered&&i.options.onEntered(r,o)},k=function onExit(r){i.onExit&&i.onExit(r),i.options&&i.options.onExit&&i.options.onExit(r)},x=function onExiting(r){i.onExiting&&i.onExiting(r),i.options&&i.options.onExiting&&i.options.onExiting(r)},C=function onExited(r){i.onExited&&i.onExited(r),i.options&&i.options.onExited&&i.options.onExited(r)};if(B(function(){if(u){var r=p.getRefElement(i.nodeRef);i.in?(g(r,!0),v(r,!0),b(r,!0)):(k(r),x(r),C(r))}},[i.in]),u)return i.in?i.children:null;var _={nodeRef:i.nodeRef,in:i.in,appear:i.appear,onEnter:g,onEntering:v,onEntered:b,onExit:k,onExiting:x,onExited:C},T=csstransition_esm_objectSpread(csstransition_esm_objectSpread(csstransition_esm_objectSpread({},{classNames:i.classNames,timeout:i.timeout,unmountOnExit:i.unmountOnExit}),i.options||{}),_);return a.createElement(pe,T,i.children)});function keyfilter_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function keyfilter_esm_toConsumableArray(r){return function keyfilter_esm_arrayWithoutHoles(r){if(Array.isArray(r))return keyfilter_esm_arrayLikeToArray(r)}(r)||function keyfilter_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function keyfilter_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return keyfilter_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?keyfilter_esm_arrayLikeToArray(r,o):void 0}}(r)||function keyfilter_esm_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}fe.displayName="CSSTransition";var he={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 getRegex(r){return he.DEFAULT_MASKS[r]?he.DEFAULT_MASKS[r]:r},onBeforeInput:function onBeforeInput(r,o,i){!i&&u.isAndroid()&&this.validateKey(r,r.data,o)},onKeyPress:function onKeyPress(r,o,i){i||u.isAndroid()||r.ctrlKey||r.altKey||r.metaKey||this.validateKey(r,r.key,o)},onPaste:function onPaste(r,o,i){if(!i){var a=this.getRegex(o);keyfilter_esm_toConsumableArray(r.clipboardData.getData("text")).forEach(function(o){if(!a.test(o))return r.preventDefault(),!1})}},validateKey:function validateKey(r,o,i){null!=o&&(o.length<=2&&(this.getRegex(i).test(o)||r.preventDefault()))},validate:function validate(r,o){var i=r.target.value,a=!0,c=this.getRegex(o);return i&&!c.test(i)&&(a=!1),a}};function portal_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function portal_esm_slicedToArray(r,o){return function portal_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function portal_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||function portal_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return portal_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?portal_esm_arrayLikeToArray(r,o):void 0}}(r,o)||function portal_esm_nonIterableRest(){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 me={defaultProps:{__TYPE:"Portal",element:null,appendTo:null,visible:!1,onMounted:null,onUnmounted:null,children:void 0},getProps:function getProps(r){return p.getMergedProps(r,me.defaultProps)},getOtherProps:function getOtherProps(r){return p.getDiffProps(r,me.defaultProps)}},ge=a.memo(function(r){var o=me.getProps(r),i=a.useContext(E),c=portal_esm_slicedToArray(a.useState(o.visible&&u.isClient()),2),g=c[0],v=c[1];R(function(){u.isClient()&&!g&&(v(!0),o.onMounted&&o.onMounted())}),B(function(){o.onMounted&&o.onMounted()},[g]),C(function(){o.onUnmounted&&o.onUnmounted()});var b=o.element||o.children;if(b&&g){var k=o.appendTo||i&&i.appendTo||w.appendTo;return p.isFunction(k)&&(k=k()),k||(k=document.body),"self"===k?b:Q().createPortal(b,k)}return null});function tooltip_esm_extends(){return tooltip_esm_extends=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var a in i)({}).hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},tooltip_esm_extends.apply(null,arguments)}function tooltip_esm_typeof(r){return tooltip_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},tooltip_esm_typeof(r)}function tooltip_esm_toPropertyKey(r){var o=function tooltip_esm_toPrimitive(r,o){if("object"!=tooltip_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=tooltip_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==tooltip_esm_typeof(o)?o:o+""}function tooltip_esm_defineProperty(r,o,i){return(o=tooltip_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function tooltip_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function tooltip_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return tooltip_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?tooltip_esm_arrayLikeToArray(r,o):void 0}}function tooltip_esm_toConsumableArray(r){return function tooltip_esm_arrayWithoutHoles(r){if(Array.isArray(r))return tooltip_esm_arrayLikeToArray(r)}(r)||function tooltip_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||tooltip_esm_unsupportedIterableToArray(r)||function tooltip_esm_nonIterableSpread(){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 tooltip_esm_slicedToArray(r,o){return function tooltip_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function tooltip_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||tooltip_esm_unsupportedIterableToArray(r,o)||function tooltip_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}ge.displayName="Portal";var ve={root:function root(r){var o=r.positionState,i=r.classNameState;return classNames("p-tooltip p-component",tooltip_esm_defineProperty({},"p-tooltip-".concat(o),!0),i)},arrow:"p-tooltip-arrow",text:"p-tooltip-text"},ye=U.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:ve,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 arrow(r){var o=r.context;return{top:o.bottom?"0":o.right||o.left||!o.right&&!o.left&&!o.top&&!o.bottom?"50%":null,bottom:o.top?"0":null,left:!o.right&&(o.right||o.left||o.top||o.bottom)?o.top||o.bottom?"50%":null:"0",right:o.left?"0":null}}}}});function tooltip_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function tooltip_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?tooltip_esm_ownKeys(Object(i),!0).forEach(function(o){tooltip_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):tooltip_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var be=a.memo(a.forwardRef(function(r,o){var i=N(),c=a.useContext(E),g=ye.getProps(r,c),b=tooltip_esm_slicedToArray(a.useState(!1),2),k=b[0],x=b[1],_=tooltip_esm_slicedToArray(a.useState(g.position||"right"),2),z=_[0],j=_[1],V=tooltip_esm_slicedToArray(a.useState(""),2),U=V[0],H=V[1],W=tooltip_esm_slicedToArray(a.useState(!1),2),K=W[0],G=W[1],J=k&&g.closeOnEscape,X=function useDisplayOrder(r){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=hooks_esm_slicedToArray(a.useState(function(){return UniqueComponentId()}),1)[0],c=hooks_esm_slicedToArray(a.useState(0),2),u=c[0],g=c[1];return a.useEffect(function(){if(o){T[r]||(T[r]=[]);var a=T[r].push(i);return g(a),function(){delete T[r][a-1];var o=T[r].length-1,i=p.findLastIndex(T[r],function(r){return void 0!==r});i!==o&&T[r].splice(i+1),g(void 0)}}},[r,i,o]),u}("tooltip",J),Q={props:g,state:{visible:k,position:z,className:U},context:{right:"right"===z,left:"left"===z,top:"top"===z,bottom:"bottom"===z}},Z=ye.setMetaData(Q),ee=Z.ptm,te=Z.cx,ne=Z.sx,re=Z.isUnstyled;Y(ye.css.styles,re,{name:"tooltip"}),function useGlobalOnEscapeKey(r){var o=r.callback,i=r.when,c=r.priority;(0,a.useEffect)(function(){if(i)return A.addListener(o,c)},[o,i,c])}({callback:function callback(){Ae()},when:J,priority:[P,X]});var oe=a.useRef(null),ie=a.useRef(null),ae=a.useRef(null),se=a.useRef(null),le=a.useRef(!0),ce=a.useRef({}),ue=a.useRef(null),pe=tooltip_esm_slicedToArray(L({listener:function listener(r){!u.isTouchDevice()&&Ae(r)}}),2),de=pe[0],fe=pe[1],he=tooltip_esm_slicedToArray(I({target:ae.current,listener:function listener(r){Ae(r)},when:k}),2),me=he[0],ve=he[1],be=function isMouseTrack(r){return we(r,"mousetrack")||g.mouseTrack},ke=function isDisabled(r){return"true"===we(r,"disabled")||xe(r,"disabled")||g.disabled},Ee=function isShowOnDisabled(r){return we(r,"showondisabled")||g.showOnDisabled},Se=function isAutoHide(){return we(ae.current,"autohide")||g.autoHide},we=function getTargetOption(r,o){return xe(r,"data-pr-".concat(o))?r.getAttribute("data-pr-".concat(o)):null},xe=function hasTargetOption(r,o){return r&&r.hasAttribute(o)},Ce=function getEvents(r){var o=[we(r,"showevent")||g.showEvent],i=[we(r,"hideevent")||g.hideEvent];if(be(r))o=["mousemove"],i=["mouseleave"];else{var a=we(r,"event")||g.event;"focus"===a&&(o=["focus"],i=["blur"]),"both"===a&&(o=["focus","mouseenter"],i=K?["blur"]:["mouseleave","blur"])}return{showEvents:o,hideEvents:i}},_e=function getPosition(r){return we(r,"position")||z},Te=function updateText(r,o){if(ie.current){var i=we(r,"tooltip")||g.content;i?(ie.current.innerHTML="",ie.current.appendChild(document.createTextNode(i)),o()):g.children&&o()}},Oe=function updateTooltipState(r){Te(ae.current,function(){var o=ue.current,i=o.pageX,a=o.pageY;g.autoZIndex&&!v.get(oe.current)&&v.set("tooltip",oe.current,c&&c.autoZIndex||w.autoZIndex,g.baseZIndex||c&&c.zIndex.tooltip||w.zIndex.tooltip),oe.current.style.left="",oe.current.style.top="",Se()&&(oe.current.style.pointerEvents="none");var p=be(ae.current)||"mouse"===r;(p&&!se.current||p)&&(se.current={width:u.getOuterWidth(oe.current),height:u.getOuterHeight(oe.current)}),Me(ae.current,{x:i,y:a},r)})},Pe=function show(r){r.type&&"focus"===r.type&&G(!0),ae.current=r.currentTarget;var o=ke(ae.current);(function isContentEmpty(r){return!(g.content||we(r,"tooltip")||g.children)})(Ee(ae.current)&&o?ae.current.firstChild:ae.current)||o||(ue.current=r,k?Le("updateDelay",Oe):Fe(g.onBeforeShow,{originalEvent:r,target:ae.current})&&Le("showDelay",function(){x(!0),Fe(g.onShow,{originalEvent:r,target:ae.current})}))},Ae=function hide(r){(r&&"blur"===r.type&&G(!1),ze(),k)?Fe(g.onBeforeHide,{originalEvent:r,target:ae.current})&&Le("hideDelay",function(){(Se()||!1!==le.current)&&(v.clear(oe.current),u.removeClass(oe.current,"p-tooltip-active"),x(!1),Fe(g.onHide,{originalEvent:r,target:ae.current}))}):g.onBeforeHide||De("hideDelay")||x(!1)},Me=function align(r,o,i){var a=0,c=0,p=i||z;if((be(r)||"mouse"==p)&&o){var v={width:u.getOuterWidth(oe.current),height:u.getOuterHeight(oe.current)};a=o.x,c=o.y;var b=function getMouseTrackPosition(r){return{top:we(r,"mousetracktop")||g.mouseTrackTop,left:we(r,"mousetrackleft")||g.mouseTrackLeft}}(r),k=b.top,E=b.left;switch(p){case"left":a-=v.width+E,c-=v.height/2-k;break;case"right":case"mouse":a+=E,c-=v.height/2-k;break;case"top":a-=v.width/2-E,c-=v.height+k;break;case"bottom":a-=v.width/2-E,c+=k}a<=0||se.current.width>v.width?(oe.current.style.left="0px",oe.current.style.right=window.innerWidth-v.width-a+"px"):(oe.current.style.right="",oe.current.style.left=a+"px"),oe.current.style.top=c+"px",u.addClass(oe.current,"p-tooltip-active")}else{var w=u.findCollisionPosition(p),x=we(r,"my")||g.my||w.my,C=we(r,"at")||g.at||w.at;oe.current.style.padding="0px",u.flipfitCollision(oe.current,r,x,C,function(r){var o=r.at,i=o.x,a=o.y,c=r.my.x,p=g.at?"center"!==i&&i!==c?i:a:r.at["".concat(w.axis)];oe.current.style.padding="",j(p),Ne(p),u.addClass(oe.current,"p-tooltip-active")})}},Ne=function updateContainerPosition(r){if(oe.current){var o=getComputedStyle(oe.current);"left"===r?oe.current.style.left=parseFloat(o.left)-2*parseFloat(o.paddingLeft)+"px":"top"===r&&(oe.current.style.top=parseFloat(o.top)-2*parseFloat(o.paddingTop)+"px")}},Re=function bindTargetEvent(r){if(r){var o=Ce(r),i=o.showEvents,a=o.hideEvents,c=je(r);i.forEach(function(r){return null==c?void 0:c.addEventListener(r,Pe)}),a.forEach(function(r){return null==c?void 0:c.addEventListener(r,Ae)})}},Ie=function unbindTargetEvent(r){if(r){var o=Ce(r),i=o.showEvents,a=o.hideEvents,c=je(r);i.forEach(function(r){return null==c?void 0:c.removeEventListener(r,Pe)}),a.forEach(function(r){return null==c?void 0:c.removeEventListener(r,Ae)})}},De=function getDelay(r){return we(ae.current,r.toLowerCase())||g[r]},Le=function applyDelay(r,o){ze();var i=De(r);i?ce.current["".concat(r)]=setTimeout(function(){return o()},i):o()},Fe=function sendCallback(r){if(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];var c=r.apply(void 0,i);return void 0===c&&(c=!0),c}return!0},ze=function clearTimeouts(){Object.values(ce.current).forEach(function(r){return clearTimeout(r)})},je=function getTarget(r){if(r){if(Ee(r)){if(!r.hasWrapper){var o=document.createElement("div");return"INPUT"===r.nodeName?u.addMultipleClasses(o,"p-tooltip-target-wrapper p-inputwrapper"):u.addClass(o,"p-tooltip-target-wrapper"),r.parentNode.insertBefore(o,r),o.appendChild(r),r.hasWrapper=!0,o}return r.parentElement}var i;return r.hasWrapper&&((i=r.parentElement).replaceWith.apply(i,tooltip_esm_toConsumableArray(r.parentElement.childNodes)),delete r.hasWrapper),r}return null},Be=function updateTargetEvents(r){$e(r),Ve(r)},Ve=function loadTargetEvents(r){Ue(r||g.target,Re)},$e=function unloadTargetEvents(r){Ue(r||g.target,Ie)},Ue=function setTargetEventOperations(r,o){if(r=p.getRefElement(r))if(u.isElement(r))o(r);else{var i=function setEvent(r){u.find(document,r).forEach(function(r){o(r)})};r instanceof Array?r.forEach(function(r){i(r)}):i(r)}};R(function(){k&&ae.current&&ke(ae.current)&&Ae()}),B(function(){return Ve(),function(){$e()}},[Pe,Ae,g.target]),B(function(){if(k){var r=_e(ae.current),o=we(ae.current,"classname");j(r),H(o),Oe(r),de(),me()}else j(g.position||"right"),H(""),ae.current=null,se.current=null,le.current=!0;return function(){fe(),ve()}},[k]),B(function(){var r=_e(ae.current);k&&"mouse"!==r&&Le("updateDelay",function(){Te(ae.current,function(){Me(ae.current)})})},[g.content]),C(function(){Ae(),v.clear(oe.current)}),a.useImperativeHandle(o,function(){return{props:g,updateTargetEvents:Be,loadTargetEvents:Ve,unloadTargetEvents:$e,show:Pe,hide:Ae,getElement:function getElement(){return oe.current},getTarget:function getTarget(){return ae.current}}});if(k){var He=function createElement(){var r=function isTargetContentEmpty(r){return!(g.content||we(r,"tooltip"))}(ae.current),o=i({id:g.id,className:classNames(g.className,te("root",{positionState:z,classNameState:U})),style:g.style,role:"tooltip","aria-hidden":k,onMouseEnter:function onMouseEnter(r){return function onMouseEnter(){Se()||(le.current=!1)}()},onMouseLeave:function onMouseLeave(r){return function onMouseLeave(r){Se()||(le.current=!0,Ae(r))}(r)}},ye.getOtherProps(g),ee("root")),c=i({className:te("arrow"),style:ne("arrow",tooltip_esm_objectSpread({},Q))},ee("arrow")),u=i({className:te("text")},ee("text"));return a.createElement("div",tooltip_esm_extends({ref:oe},o),a.createElement("div",c),a.createElement("div",tooltip_esm_extends({ref:ie},u),r&&g.children))}();return a.createElement(ge,{element:He,appendTo:g.appendTo,visible:!0})}return null}));be.displayName="Tooltip";var ke=function EventBus(){var r=new Map;return{on:function on(o,i){var a=r.get(o);a?a.push(i):a=[i],r.set(o,a)},off:function off(o,i){var a=r.get(o);a&&a.splice(a.indexOf(i)>>>0,1)},emit:function emit(o,i){var a=r.get(o);a&&a.slice().forEach(function(r){return r(i)})}}}();function ripple_esm_extends(){return ripple_esm_extends=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var a in i)({}).hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},ripple_esm_extends.apply(null,arguments)}function ripple_esm_typeof(r){return ripple_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ripple_esm_typeof(r)}function ripple_esm_toPropertyKey(r){var o=function ripple_esm_toPrimitive(r,o){if("object"!=ripple_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=ripple_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==ripple_esm_typeof(o)?o:o+""}function ripple_esm_defineProperty(r,o,i){return(o=ripple_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function ripple_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function ripple_esm_slicedToArray(r,o){return function ripple_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function ripple_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||function ripple_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return ripple_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ripple_esm_arrayLikeToArray(r,o):void 0}}(r,o)||function ripple_esm_nonIterableRest(){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 Ee=U.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 getProps(r){return p.getMergedProps(r,Ee.defaultProps)},getOtherProps:function getOtherProps(r){return p.getDiffProps(r,Ee.defaultProps)}});function ripple_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}var Se=a.memo(a.forwardRef(function(r,o){var i=ripple_esm_slicedToArray(a.useState(!1),2),c=i[0],p=i[1],g=a.useRef(null),v=a.useRef(null),b=N(),k=a.useContext(E),x=Ee.getProps(r,k),_=k&&k.ripple||w.ripple,T={props:x};j(Ee.css.styles,{name:"ripple",manual:!_});var P=Ee.setMetaData(function ripple_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?ripple_esm_ownKeys(Object(i),!0).forEach(function(o){ripple_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):ripple_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}({},T)),A=P.ptm,I=P.cx,L=function getTarget(){return g.current&&g.current.parentElement},z=function bindEvents(){v.current&&v.current.addEventListener("pointerdown",V)},V=function onPointerDown(r){var o=u.getOffset(v.current),i=r.pageX-o.left+document.body.scrollTop-u.getWidth(g.current)/2,a=r.pageY-o.top+document.body.scrollLeft-u.getHeight(g.current)/2;U(i,a)},U=function activateRipple(r,o){g.current&&"none"!==getComputedStyle(g.current,null).display&&(u.removeClass(g.current,"p-ink-active"),H(),g.current.style.top=o+"px",g.current.style.left=r+"px",u.addClass(g.current,"p-ink-active"))},H=function setDimensions(){if(g.current&&!u.getHeight(g.current)&&!u.getWidth(g.current)){var r=Math.max(u.getOuterWidth(v.current),u.getOuterHeight(v.current));g.current.style.height=r+"px",g.current.style.width=r+"px"}};if(a.useImperativeHandle(o,function(){return{props:x,getInk:function getInk(){return g.current},getTarget:function getTarget(){return v.current}}}),R(function(){p(!0)}),B(function(){c&&g.current&&(v.current=L(),H(),z())},[c]),B(function(){g.current&&!v.current&&(v.current=L(),H(),z())}),C(function(){g.current&&(v.current=null,function unbindEvents(){v.current&&v.current.removeEventListener("pointerdown",V)}())}),!_)return null;var W=b({"aria-hidden":!0,className:classNames(I("root"))},Ee.getOtherProps(x),A("root"));return a.createElement("span",ripple_esm_extends({role:"presentation",ref:g},W,{onAnimationEnd:function onAnimationEnd(r){u.removeClass(r.currentTarget,"p-ink-active")}}))}));function mention_esm_extends(){return mention_esm_extends=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var a in i)({}).hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},mention_esm_extends.apply(null,arguments)}function mention_esm_arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=Array(o);i<o;i++)a[i]=r[i];return a}function mention_esm_unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return mention_esm_arrayLikeToArray(r,o);var i={}.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?mention_esm_arrayLikeToArray(r,o):void 0}}function mention_esm_toConsumableArray(r){return function mention_esm_arrayWithoutHoles(r){if(Array.isArray(r))return mention_esm_arrayLikeToArray(r)}(r)||function mention_esm_iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||mention_esm_unsupportedIterableToArray(r)||function mention_esm_nonIterableSpread(){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 mention_esm_typeof(r){return mention_esm_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},mention_esm_typeof(r)}function mention_esm_toPropertyKey(r){var o=function mention_esm_toPrimitive(r,o){if("object"!=mention_esm_typeof(r)||!r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!=mention_esm_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"==mention_esm_typeof(o)?o:o+""}function mention_esm_defineProperty(r,o,i){return(o=mention_esm_toPropertyKey(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}function mention_esm_slicedToArray(r,o){return function mention_esm_arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function mention_esm_iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||mention_esm_unsupportedIterableToArray(r,o)||function mention_esm_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Se.displayName="Ripple";var we={root:function root(r){var o=r.props,i=r.context,a=r.isFilled;return classNames("p-inputtextarea p-inputtext p-component",{"p-disabled":o.disabled,"p-filled":a,"p-inputtextarea-resizable":o.autoResize,"p-invalid":o.invalid,"p-variant-filled":o.variant?"filled"===o.variant:i&&"filled"===i.inputStyle})}},xe=U.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:we,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 mention_esm_ownKeys$1(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function mention_esm_objectSpread$1(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?mention_esm_ownKeys$1(Object(i),!0).forEach(function(o){mention_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):mention_esm_ownKeys$1(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var Ce=a.memo(a.forwardRef(function(r,o){var i=N(),c=a.useContext(E),g=xe.getProps(r,c),v=a.useRef(o),b=a.useRef(0),k=xe.setMetaData(mention_esm_objectSpread$1(mention_esm_objectSpread$1({props:g},g.__parentMetadata),{},{context:{disabled:g.disabled}})),w=k.ptm,x=k.cx,C=k.isUnstyled;Y(xe.css.styles,C,{name:"inputtextarea"});var _=function resize(r){var o=v.current;o&&T()&&(b.current||(b.current=o.scrollHeight,o.style.overflow="hidden"),(b.current!==o.scrollHeight||r)&&(o.style.height="",o.style.height=o.scrollHeight+"px",parseFloat(o.style.height)>=parseFloat(o.style.maxHeight)?(o.style.overflowY="scroll",o.style.height=o.style.maxHeight):o.style.overflow="hidden",b.current=o.scrollHeight))},T=function isVisible(){if(u.isVisible(v.current)){var r=v.current.getBoundingClientRect();return r.width>0&&r.height>0}return!1};a.useEffect(function(){p.combinedRefs(v,o)},[v,o]),a.useEffect(function(){g.autoResize&&_(!0)},[g.autoResize,g.value]);var P=a.useMemo(function(){return p.isNotEmpty(g.value)||p.isNotEmpty(g.defaultValue)},[g.value,g.defaultValue]),A=p.isNotEmpty(g.tooltip),R=i({ref:v,className:classNames(g.className,x("root",{context:c,isFilled:P})),onFocus:function onFocus(r){g.autoResize&&_(),g.onFocus&&g.onFocus(r)},onBlur:function onBlur(r){g.autoResize&&_(),g.onBlur&&g.onBlur(r)},onKeyUp:function onKeyUp(r){g.autoResize&&_(),g.onKeyUp&&g.onKeyUp(r)},onKeyDown:function onKeyDown(r){g.onKeyDown&&g.onKeyDown(r),g.keyfilter&&he.onKeyPress(r,g.keyfilter,g.validateOnly)},onBeforeInput:function onBeforeInput(r){g.onBeforeInput&&g.onBeforeInput(r),g.keyfilter&&he.onBeforeInput(r,g.keyfilter,g.validateOnly)},onInput:function onInput(r){var o=r.target;g.autoResize&&_(p.isEmpty(o.value)),g.onInput&&g.onInput(r),p.isNotEmpty(o.value)?u.addClass(o,"p-filled"):u.removeClass(o,"p-filled")},onPaste:function onPaste(r){g.onPaste&&g.onPaste(r),g.keyfilter&&he.onPaste(r,g.keyfilter,g.validateOnly)}},xe.getOtherProps(g),w("root"));return a.createElement(a.Fragment,null,a.createElement("textarea",R),A&&a.createElement(be,mention_esm_extends({target:v,content:g.tooltip,pt:w("tooltip")},g.tooltipOptions)))}));Ce.displayName="InputTextarea";var _e={item:function item(r){return classNames("p-mention-item",{"p-highlight":r.isSelected})},items:"p-mention-items",panel:function panel(r){return classNames("p-mention-panel p-component",r.props.panelClassName)},input:function input(r){return classNames("p-mention-input",r.props.inputClassName)},root:function root(r){return r.props,classNames("p-mention p-component p-inputwrapper",{"p-inputwrapper-filled":r.isFilled,"p-inputwrapper-focus":r.focusedState})},transition:"p-connected-overlay"},Te=U.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:_e,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 mention_esm_ownKeys(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);o&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,a)}return i}function mention_esm_objectSpread(r){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?mention_esm_ownKeys(Object(i),!0).forEach(function(o){mention_esm_defineProperty(r,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):mention_esm_ownKeys(Object(i)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(i,o))})}return r}var Oe=a.memo(a.forwardRef(function(r,o){var i=N(),c=a.useContext(E),g=Te.getProps(r,c),b=mention_esm_slicedToArray(a.useState(!1),2),k=b[0],x=b[1],T=mention_esm_slicedToArray(a.useState(!1),2),P=T[0],A=T[1],R=mention_esm_slicedToArray(a.useState(!1),2),z=R[0],j=R[1],V=mention_esm_slicedToArray(a.useState(null),2),U=V[0],H=V[1],W=mention_esm_slicedToArray(a.useState([]),2),K=W[0],G=W[1],J=a.useRef(null),X=a.useRef(null),Q=a.useRef(g.inputRef),Z=a.useRef(null),ee=a.useRef(null),te={props:g,state:{overlayVisible:k,focused:P,searching:z,trigger:U}},ne=Te.setMetaData(te),re=ne.ptm,oe=ne.cx;ne.sx;var ie=ne.isUnstyled;Y(Te.css.styles,ie,{name:"mention"});var ae=function useOverlayListener(r){var o=r.target,i=r.overlay,c=r.listener,p=r.when,g=void 0===p||p,v=r.type,b=void 0===v?"click":v,k=a.useRef(null),E=a.useRef(null),w=hooks_esm_slicedToArray(_({target:"window",type:b,listener:function listener(r){c&&c(r,{type:"outside",valid:3!==r.which&&H(r)})},when:g}),2),x=w[0],T=w[1],P=hooks_esm_slicedToArray(L({listener:function listener(r){c&&c(r,{type:"resize",valid:!u.isTouchDevice()})},when:g}),2),A=P[0],N=P[1],R=hooks_esm_slicedToArray(_({target:"window",type:"orientationchange",listener:function listener(r){c&&c(r,{type:"orientationchange",valid:!0})},when:g}),2),z=R[0],j=R[1],B=hooks_esm_slicedToArray(I({target:o,listener:function listener(r){c&&c(r,{type:"scroll",valid:!0})},when:g}),2),V=B[0],U=B[1],H=function isOutsideClicked(r){return k.current&&!(k.current.isSameNode(r.target)||k.current.contains(r.target)||E.current&&E.current.contains(r.target))},W=function unbind(){T(),N(),j(),U()};return a.useEffect(function(){g?(k.current=u.getTargetElement(o),E.current=u.getTargetElement(i)):(W(),k.current=E.current=null)},[o,i,g]),C(function(){W()}),[function bind(){x(),A(),z(),V()},W]}({target:J,overlay:X,listener:function listener(r,o){var i=o.valid,a=o.type;i&&(c.hideOverlaysOnDocumentScrolling||"outside"===a?pe():u.isDocument(r.target)||be())},when:k}),se=mention_esm_slicedToArray(ae,2),le=se[0],ce=se[1],ue=function show(){x(!0)},pe=function hide(){x(!1),j(!1),H(null)},de=function onOverlayEnter(){v.set("overlay",X.current,c&&c.autoZIndex||w.autoZIndex,c&&c.zIndex.overlay||w.zIndex.overlay),u.addStyles(X.current,{position:"absolute",top:"0",left:"0"}),be()},he=function onOverlayEntering(){g.autoHighlight&&g.suggestions&&g.suggestions.length&&G(function(r){var o=mention_esm_toConsumableArray(r);return o[0]=!0,o})},me=function onOverlayEntered(){le(),g.onShow&&g.onShow()},ve=function onOverlayExit(){ce()},ye=function onOverlayExited(){v.clear(X.current),g.onHide&&g.onHide()},be=function alignOverlay(){if(U){var r=U.key,o=U.index,i=Q.current.value,a=u.getCursorOffset(Q.current,i.substring(0,o-1),i.substring(o),r);X.current.style.transformOrigin="top",X.current.style.left="calc(".concat(a.left,"px + 1rem)"),X.current.style.top="calc(".concat(a.top,"px + 1.2rem)")}},Ee=function onPanelClick(r){ke.emit("overlay-click",{originalEvent:r,target:J.current})},we=function getLatestTrigger(r,o){if(Array.isArray(g.trigger)){var i={};return g.trigger.forEach(function(a){var c=r.substring(0,o).lastIndexOf(a);-1!==c&&(c>i.index||!i.index)&&(i={key:a,index:-1!==c?c+1:-1})}),i}var a=r.substring(0,o).lastIndexOf(g.trigger);return{key:g.trigger,index:-1!==a?a+1:-1}},xe=function onSearch(r){ee.current&&clearTimeout(ee.current);var o=r.target,i=o.value,a=o.selectionStart,c=i.substring(a-1,a);if(" "!==c){var u=function getTrigger(r,o,i){if(!U){var a=Array.isArray(g.trigger)?g.trigger.find(function(r){return r===o}):g.trigger===o?g.trigger:null;if(a)return{key:a,index:i};var c=r.substring(0,i).lastIndexOf(" "),u=we(r,i);if(u.index>c)return u}return U}(i,c,a);if(u&&u.index>-1){var p=i.substring(u.index,a);ee.current=setTimeout(function(){_e(r,p,u)},g.delay)}}else pe()},_e=function search(r,o,i){g.onSearch&&(j(!0),H(i),g.onSearch({originalEvent:r,trigger:i.key,query:o}))},Oe=function selectItem(r,o){var i=Q.current,a=i.value,c=i.selectionStart,u=a.indexOf(" ",U.index),p=a.substring(U.index,u>-1?u:c),v=Pe(o).replace(/\s+/g,"");if(p.trim()!==v){var b=a.substring(0,U.index),k=a.substring(u>-1?c:U.index+p.length);Q.current.value=" "===k[0]?"".concat(b).concat(v).concat(k):"".concat(b).concat(v," ").concat(k),r.target=Q.current,g.onChange&&g.onChange(r)}var E=U.index+v.length+1;Q.current.setSelectionRange(E,E),pe(),g.onSelect&&g.onSelect({originalEvent:r,suggestion:o})},Pe=function formatValue(r){if(r){var o=Array.isArray(g.field)?g.field[g.trigger.findIndex(function(r){return r===U.key})]:g.field;return o?p.resolveFieldData(r,o):r}return""},Ae=Q.current&&Q.current.value,Me=a.useMemo(function(){return p.isNotEmpty(g.value)||p.isNotEmpty(g.defaultValue)||p.isNotEmpty(Ae)},[g.value,g.defaultValue,Ae]);a.useImperativeHandle(o,function(){return{props:g,show:ue,hide:pe,focus:function focus(){return u.focus(Q.current)},getElement:function getElement(){return J.current},getOverlay:function getOverlay(){return X.current},getInput:function getInput(){return Q.current}}}),a.useEffect(function(){p.combinedRefs(Q,g.inputRef)},[Q,g.inputRef]),B(function(){var r=g.suggestions&&g.suggestions.length;if(r){var o=g.suggestions.map(function(){return!1});G(o)}z&&(r?ue():pe(),k&&be(),j(!1))},[g.suggestions]),B(function(){var r=ie(),o=r?u.isAttributeEquals(J.current,"data-p-inputwrapper-filled",!0):u.hasClass(J.current,"p-inputwrapper-filled");!Me&&o&&(r?u.setAttributes(J.current,{"data-p-inputwrapper-filled":!1}):u.removeClass(J.current,"p-inputwrapper-filled"))},[Me]),C(function(){v.clear(X.current)});var Ne=function createItem(r,o){var c=o+"_item",v=g.itemTemplate?p.getJSXElement(g.itemTemplate,r,{trigger:U?U.key:"",index:o}):Pe(r),b=K[o],k=i({className:oe("item",{isSelected:b}),onClick:function onClick(o){return function onItemClick(r,o){u.focus(Q.current),Oe(r,o)}(o,r)},"data-p-highlight":b},function getPTOptions(r,o,i){return re(o,{context:{trigger:U?U.key:""},state:mention_esm_objectSpread({},i)})}(0,"item",{selected:b}));return a.createElement("li",mention_esm_extends({},k,{key:c}),v,a.createElement(Se,null))},Re=Te.getOtherProps(g),Ie=function createPanel(){var r=p.getJSXElement(g.headerTemplate,g),o=p.getJSXElement(g.footerTemplate,g),c=function createList(){var r=i({ref:Z,className:oe("items")},re("items"));if(g.suggestions){var o=g.suggestions.map(Ne);return a.createElement("ul",r,o)}return null}(),u=i({ref:X,className:oe("panel"),style:mention_esm_objectSpread({maxHeight:g.scrollHeight},g.panelStyle),onClick:Ee},re("panel")),v=i({classNames:oe("transition"),in:k,timeout:{enter:120,exit:100},options:g.transitionOptions,unmountOnExit:!0,onEnter:de,onEntering:he,onEntered:me,onExit:ve,onExited:ye},re("transition")),b=a.createElement(fe,mention_esm_extends({nodeRef:X},v),a.createElement("div",u,r,c,o));return a.createElement(ge,{element:b,appendTo:"self"})}(),De=i(mention_esm_objectSpread(mention_esm_objectSpread({ref:Q,id:g.inputId,className:oe("input"),style:g.inputStyle},Re),{},{unstyled:g.unstyled,variant:g.variant,autoResize:g.autoResize,onFocus:function onFocus(r){A(!0),g.onFocus&&g.onFocus(r)},onBlur:function onBlur(r){A(!1),g.onBlur&&g.onBlur(r)},onKeyDown:function onKeyDown(r){if(k){var o=u.findSingle(X.current,'li[data-p-highlight="true"]');switch(r.which){case 40:if(o){var i=o.nextElementSibling;if(i){var a=u.index(i),c=u.index(o);G(function(r){var o=mention_esm_toConsumableArray(r);return o[a]=!0,o[c]=!1,o}),u.scrollInView(X.current,i)}}else if(o=u.findSingle(X.current,"li")){var p=u.index(o);G(function(r){var o=mention_esm_toConsumableArray(r);return o[p]=!0,o})}r.preventDefault();break;case 38:if(o){var v=o.previousElementSibling;if(v){var b=u.index(v),E=u.index(o);G(function(r){var o=mention_esm_toConsumableArray(r);return o[b]=!0,o[E]=!1,o}),u.scrollInView(X.current,v)}}r.preventDefault();break;case 8:var w=r.target,x=w.value,C=w.selectionStart;x.substring(C-1,C)===U.key&&pe();break;case 13:o&&Oe(r,g.suggestions[u.index(o)]),r.preventDefault();break;case 27:pe(),r.preventDefault()}}},onInput:function onInput(r){g.onInput&&g.onInput(r);var o=r.target.value.length>0;ie()?u.setAttributes(J.current,{"data-p-inputwrapper-filled":o}):o?u.addClass(J.current,"p-inputwrapper-filled"):u.removeClass(J.current,"p-inputwrapper-filled")},onKeyUp:function onKeyUp(r){37!==r.which&&39!==r.which||xe(r)},onChange:function onChange(r){g.onChange&&g.onChange(r),xe(r)},__parentMetadata:{parent:te}}),re("input")),Le=i({ref:J,id:g.id,className:classNames(g.className,oe("root",{focusedState:P,isFilled:Me})),style:g.style},Te.getOtherProps(g),re("root"));return a.createElement("div",Le,a.createElement(Ce,De),Ie)}));Oe.displayName="Mention"},37820:function(r,o,i){"use strict";function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(r,o,i){var a=function _superPropBase(r,o){for(;!Object.prototype.hasOwnProperty.call(r,o)&&null!==(r=_getPrototypeOf(r)););return r}(r,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(arguments.length<3?r:i):c.value}},_get.apply(this,arguments)}function _inherits(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),o&&_setPrototypeOf(r,o)}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _createSuper(r){var o=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}();return function _createSuperInternal(){var i,a=_getPrototypeOf(r);if(o){var c=_getPrototypeOf(this).constructor;i=Reflect.construct(a,arguments,c)}else i=a.apply(this,arguments);return function _possibleConstructorReturn(r,o){if(o&&("object"===_typeof(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,i)}}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,_toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _toPropertyKey(r){var o=function _toPrimitive(r,o){if("object"!==_typeof(r)||null===r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"===_typeof(o)?o:String(o)}var a=i(77712),c=i(36553),u=Object.create(null),p=function(){function Selection(r,o,i){_classCallCheck(this,Selection),this.$anchor=r,this.$head=o,this.ranges=i||[new g(r.min(o),r.max(o))]}return _createClass(Selection,[{key:"anchor",get:function get(){return this.$anchor.pos}},{key:"head",get:function get(){return this.$head.pos}},{key:"from",get:function get(){return this.$from.pos}},{key:"to",get:function get(){return this.$to.pos}},{key:"$from",get:function get(){return this.ranges[0].$from}},{key:"$to",get:function get(){return this.ranges[0].$to}},{key:"empty",get:function get(){for(var r=this.ranges,o=0;o<r.length;o++)if(r[o].$from.pos!=r[o].$to.pos)return!1;return!0}},{key:"content",value:function content(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function replace(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Slice.empty,i=o.content.lastChild,c=null,u=0;u<o.openEnd;u++)c=i,i=i.lastChild;for(var p=r.steps.length,g=this.ranges,v=0;v<g.length;v++){var b=g[v],k=b.$from,E=b.$to,w=r.mapping.slice(p);r.replaceRange(w.map(k.pos),w.map(E.pos),v?a.Slice.empty:o),0==v&&selectionToInsertionEnd(r,p,(i?i.isInline:c&&c.isTextblock)?-1:1)}}},{key:"replaceWith",value:function replaceWith(r,o){for(var i=r.steps.length,a=this.ranges,c=0;c<a.length;c++){var u=a[c],p=u.$from,g=u.$to,v=r.mapping.slice(i),b=v.map(p.pos),k=v.map(g.pos);c?r.deleteRange(b,k):(r.replaceRangeWith(b,k,o),selectionToInsertionEnd(r,i,o.isInline?-1:1))}}},{key:"getBookmark",value:function getBookmark(){return b.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function findFrom(r,o){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=r.parent.inlineContent?new b(r):findSelectionIn(r.node(0),r.parent,r.pos,r.index(),o,i);if(a)return a;for(var c=r.depth-1;c>=0;c--){var u=o<0?findSelectionIn(r.node(0),r.node(c),r.before(c+1),r.index(c),o,i):findSelectionIn(r.node(0),r.node(c),r.after(c+1),r.index(c)+1,o,i);if(u)return u}return null}},{key:"near",value:function near(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(r,o)||this.findFrom(r,-o)||new x(r.node(0))}},{key:"atStart",value:function atStart(r){return findSelectionIn(r,r,0,0,1)||new x(r)}},{key:"atEnd",value:function atEnd(r){return findSelectionIn(r,r,r.content.size,r.childCount,-1)||new x(r)}},{key:"fromJSON",value:function fromJSON(r,o){if(!o||!o.type)throw new RangeError("Invalid input for Selection.fromJSON");var i=u[o.type];if(!i)throw new RangeError("No selection type ".concat(o.type," defined"));return i.fromJSON(r,o)}},{key:"jsonID",value:function jsonID(r,o){if(r in u)throw new RangeError("Duplicate use of selection JSON ID "+r);return u[r]=o,o.prototype.jsonID=r,o}}]),Selection}();p.prototype.visible=!0;var g=_createClass(function SelectionRange(r,o){_classCallCheck(this,SelectionRange),this.$from=r,this.$to=o}),v=!1;function checkTextSelection(r){v||r.parent.inlineContent||(v=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}var b=function(r){_inherits(TextSelection,r);var o=_createSuper(TextSelection);function TextSelection(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;return _classCallCheck(this,TextSelection),checkTextSelection(r),checkTextSelection(i),o.call(this,r,i)}return _createClass(TextSelection,[{key:"$cursor",get:function get(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function map(r,o){var i=r.resolve(o.map(this.head));if(!i.parent.inlineContent)return p.near(i);var a=r.resolve(o.map(this.anchor));return new TextSelection(a.parent.inlineContent?a:i,i)}},{key:"replace",value:function replace(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Slice.empty;if(_get(_getPrototypeOf(TextSelection.prototype),"replace",this).call(this,r,o),o==a.Slice.empty){var i=this.$from.marksAcross(this.$to);i&&r.ensureMarks(i)}}},{key:"eq",value:function eq(r){return r instanceof TextSelection&&r.anchor==this.anchor&&r.head==this.head}},{key:"getBookmark",value:function getBookmark(){return new k(this.anchor,this.head)}},{key:"toJSON",value:function toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.anchor||"number"!=typeof o.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new TextSelection(r.resolve(o.anchor),r.resolve(o.head))}},{key:"create",value:function create(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,a=r.resolve(o);return new this(a,i==o?a:r.resolve(i))}},{key:"between",value:function between(r,o,i){var a=r.pos-o.pos;if(i&&!a||(i=a>=0?1:-1),!o.parent.inlineContent){var c=p.findFrom(o,i,!0)||p.findFrom(o,-i,!0);if(!c)return p.near(o,i);o=c.$head}return r.parent.inlineContent||(0==a||(r=(p.findFrom(r,-i,!0)||p.findFrom(r,i,!0)).$anchor).pos<o.pos!=a<0)&&(r=o),new TextSelection(r,o)}}]),TextSelection}(p);p.jsonID("text",b);var k=function(){function TextBookmark(r,o){_classCallCheck(this,TextBookmark),this.anchor=r,this.head=o}return _createClass(TextBookmark,[{key:"map",value:function map(r){return new TextBookmark(r.map(this.anchor),r.map(this.head))}},{key:"resolve",value:function resolve(r){return b.between(r.resolve(this.anchor),r.resolve(this.head))}}]),TextBookmark}(),E=function(r){_inherits(NodeSelection,r);var o=_createSuper(NodeSelection);function NodeSelection(r){var i;_classCallCheck(this,NodeSelection);var a=r.nodeAfter,c=r.node(0).resolve(r.pos+a.nodeSize);return(i=o.call(this,r,c)).node=a,i}return _createClass(NodeSelection,[{key:"map",value:function map(r,o){var i=o.mapResult(this.anchor),a=i.deleted,c=i.pos,u=r.resolve(c);return a?p.near(u):new NodeSelection(u)}},{key:"content",value:function content(){return new a.Slice(a.Fragment.from(this.node),0,0)}},{key:"eq",value:function eq(r){return r instanceof NodeSelection&&r.anchor==this.anchor}},{key:"toJSON",value:function toJSON(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function getBookmark(){return new w(this.anchor)}}],[{key:"fromJSON",value:function fromJSON(r,o){if("number"!=typeof o.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new NodeSelection(r.resolve(o.anchor))}},{key:"create",value:function create(r,o){return new NodeSelection(r.resolve(o))}},{key:"isSelectable",value:function isSelectable(r){return!r.isText&&!1!==r.type.spec.selectable}}]),NodeSelection}(p);E.prototype.visible=!1,p.jsonID("node",E);var w=function(){function NodeBookmark(r){_classCallCheck(this,NodeBookmark),this.anchor=r}return _createClass(NodeBookmark,[{key:"map",value:function map(r){var o=r.mapResult(this.anchor),i=o.deleted,a=o.pos;return i?new k(a,a):new NodeBookmark(a)}},{key:"resolve",value:function resolve(r){var o=r.resolve(this.anchor),i=o.nodeAfter;return i&&E.isSelectable(i)?new E(o):p.near(o)}}]),NodeBookmark}(),x=function(r){_inherits(AllSelection,r);var o=_createSuper(AllSelection);function AllSelection(r){return _classCallCheck(this,AllSelection),o.call(this,r.resolve(0),r.resolve(r.content.size))}return _createClass(AllSelection,[{key:"replace",value:function replace(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Slice.empty;if(o==a.Slice.empty){r.delete(0,r.doc.content.size);var i=p.atStart(r.doc);i.eq(r.selection)||r.setSelection(i)}else _get(_getPrototypeOf(AllSelection.prototype),"replace",this).call(this,r,o)}},{key:"toJSON",value:function toJSON(){return{type:"all"}}},{key:"map",value:function map(r){return new AllSelection(r)}},{key:"eq",value:function eq(r){return r instanceof AllSelection}},{key:"getBookmark",value:function getBookmark(){return C}}],[{key:"fromJSON",value:function fromJSON(r){return new AllSelection(r)}}]),AllSelection}(p);p.jsonID("all",x);var C={map:function map(){return this},resolve:function resolve(r){return new x(r)}};function findSelectionIn(r,o,i,a,c){var u=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(o.inlineContent)return b.create(r,i);for(var p=a-(c>0?0:1);c>0?p<o.childCount:p>=0;p+=c){var g=o.child(p);if(g.isAtom){if(!u&&E.isSelectable(g))return E.create(r,i-(c<0?g.nodeSize:0))}else{var v=findSelectionIn(r,g,i+c,c<0?g.childCount:0,c,u);if(v)return v}i+=g.nodeSize*c}return null}function selectionToInsertionEnd(r,o,i){var a=r.steps.length-1;if(!(a<o)){var u,g=r.steps[a];if(g instanceof c.ReplaceStep||g instanceof c.ReplaceAroundStep)r.mapping.maps[a].forEach(function(r,o,i,a){null==u&&(u=a)}),r.setSelection(p.near(r.doc.resolve(u),i))}}var _=function(r){_inherits(Transaction,r);var o=_createSuper(Transaction);function Transaction(r){var i;return _classCallCheck(this,Transaction),(i=o.call(this,r.doc)).curSelectionFor=0,i.updated=0,i.meta=Object.create(null),i.time=Date.now(),i.curSelection=r.selection,i.storedMarks=r.storedMarks,i}return _createClass(Transaction,[{key:"selection",get:function get(){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}},{key:"setSelection",value:function setSelection(r){if(r.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=r,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}},{key:"selectionSet",get:function get(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function setStoredMarks(r){return this.storedMarks=r,this.updated|=2,this}},{key:"ensureMarks",value:function ensureMarks(r){return a.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),r)||this.setStoredMarks(r),this}},{key:"addStoredMark",value:function addStoredMark(r){return this.ensureMarks(r.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function removeStoredMark(r){return this.ensureMarks(r.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function get(){return(2&this.updated)>0}},{key:"addStep",value:function addStep(r,o){_get(_getPrototypeOf(Transaction.prototype),"addStep",this).call(this,r,o),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function setTime(r){return this.time=r,this}},{key:"replaceSelection",value:function replaceSelection(r){return this.selection.replace(this,r),this}},{key:"replaceSelectionWith",value:function replaceSelectionWith(r){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.selection;return o&&(r=r.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||a.Mark.none))),i.replaceWith(this,r),this}},{key:"deleteSelection",value:function deleteSelection(){return this.selection.replace(this),this}},{key:"insertText",value:function insertText(r,o,i){var a=this.doc.type.schema;if(null==o)return r?this.replaceSelectionWith(a.text(r),!0):this.deleteSelection();if(null==i&&(i=o),!r)return this.deleteRange(o,i);var c=this.storedMarks;if(!c){var u=this.doc.resolve(o);c=i==o?u.marks():u.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(o,i,a.text(r,c)),this.selection.empty||this.selection.to!=o+r.length||this.setSelection(p.near(this.selection.$to)),this}},{key:"setMeta",value:function setMeta(r,o){return this.meta["string"==typeof r?r:r.key]=o,this}},{key:"getMeta",value:function getMeta(r){return this.meta["string"==typeof r?r:r.key]}},{key:"isGeneric",get:function get(){for(var r in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function scrollIntoView(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function get(){return(4&this.updated)>0}}]),Transaction}(c.Transform);function bind(r,o){return o&&r?r.bind(o):r}var T=_createClass(function FieldDesc(r,o,i){_classCallCheck(this,FieldDesc),this.name=r,this.init=bind(o.init,i),this.apply=bind(o.apply,i)}),P=[new T("doc",{init:function init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply:function apply(r){return r.doc}}),new T("selection",{init:function init(r,o){return r.selection||p.atStart(o.doc)},apply:function apply(r){return r.selection}}),new T("storedMarks",{init:function init(r){return r.storedMarks||null},apply:function apply(r,o,i,a){return a.selection.$cursor?r.storedMarks:null}}),new T("scrollToSelection",{init:function init(){return 0},apply:function apply(r,o){return r.scrolledIntoView?o+1:o}})],A=_createClass(function Configuration(r,o){var i=this;_classCallCheck(this,Configuration),this.schema=r,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=P.slice(),o&&o.forEach(function(r){if(i.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");i.plugins.push(r),i.pluginsByKey[r.key]=r,r.spec.state&&i.fields.push(new T(r.key,r.spec.state,r))})}),N=function(){function EditorState(r){_classCallCheck(this,EditorState),this.config=r}return _createClass(EditorState,[{key:"schema",get:function get(){return this.config.schema}},{key:"plugins",get:function get(){return this.config.plugins}},{key:"apply",value:function apply(r){return this.applyTransaction(r).state}},{key:"filterTransaction",value:function filterTransaction(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,i=0;i<this.config.plugins.length;i++)if(i!=o){var a=this.config.plugins[i];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,r,this))return!1}return!0}},{key:"applyTransaction",value:function applyTransaction(r){if(!this.filterTransaction(r))return{state:this,transactions:[]};for(var o=[r],i=this.applyInner(r),a=null;;){for(var c=!1,u=0;u<this.config.plugins.length;u++){var p=this.config.plugins[u];if(p.spec.appendTransaction){var g=a?a[u].n:0,v=a?a[u].state:this,b=g<o.length&&p.spec.appendTransaction.call(p,g?o.slice(g):o,v,i);if(b&&i.filterTransaction(b,u)){if(b.setMeta("appendedTransaction",r),!a){a=[];for(var k=0;k<this.config.plugins.length;k++)a.push(k<u?{state:i,n:o.length}:{state:this,n:0})}o.push(b),i=i.applyInner(b),c=!0}a&&(a[u]={state:i,n:o.length})}}if(!c)return{state:i,transactions:o}}}},{key:"applyInner",value:function applyInner(r){if(!r.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var o=new EditorState(this.config),i=this.config.fields,a=0;a<i.length;a++){var c=i[a];o[c.name]=c.apply(r,this[c.name],this,o)}return o}},{key:"tr",get:function get(){return new _(this)}},{key:"reconfigure",value:function reconfigure(r){for(var o=new A(this.schema,r.plugins),i=o.fields,a=new EditorState(o),c=0;c<i.length;c++){var u=i[c].name;a[u]=this.hasOwnProperty(u)?this[u]:i[c].init(r,a)}return a}},{key:"toJSON",value:function toJSON(r){var o={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(o.storedMarks=this.storedMarks.map(function(r){return r.toJSON()})),r&&"object"==_typeof(r))for(var i in r){if("doc"==i||"selection"==i)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var a=r[i],c=a.spec.state;c&&c.toJSON&&(o[i]=c.toJSON.call(a,this[a.key]))}return o}}],[{key:"create",value:function create(r){for(var o=new A(r.doc?r.doc.type.schema:r.schema,r.plugins),i=new EditorState(o),a=0;a<o.fields.length;a++)i[o.fields[a].name]=o.fields[a].init(r,i);return i}},{key:"fromJSON",value:function fromJSON(r,o,i){if(!o)throw new RangeError("Invalid input for EditorState.fromJSON");if(!r.schema)throw new RangeError("Required config field 'schema' missing");var c=new A(r.schema,r.plugins),u=new EditorState(c);return c.fields.forEach(function(c){if("doc"==c.name)u.doc=a.Node.fromJSON(r.schema,o.doc);else if("selection"==c.name)u.selection=p.fromJSON(u.doc,o.selection);else if("storedMarks"==c.name)o.storedMarks&&(u.storedMarks=o.storedMarks.map(r.schema.markFromJSON));else{if(i)for(var g in i){var v=i[g],b=v.spec.state;if(v.key==c.name&&b&&b.fromJSON&&Object.prototype.hasOwnProperty.call(o,g))return void(u[c.name]=b.fromJSON.call(v,r,o[g],u))}u[c.name]=c.init(r,u)}}),u}}]),EditorState}();function bindProps(r,o,i){for(var a in r){var c=r[a];c instanceof Function?c=c.bind(o):"handleDOMEvents"==a&&(c=bindProps(c,o,{})),i[a]=c}return i}var R=function(){function Plugin(r){_classCallCheck(this,Plugin),this.spec=r,this.props={},r.props&&bindProps(r.props,this,this.props),this.key=r.key?r.key.key:createKey("plugin")}return _createClass(Plugin,[{key:"getState",value:function getState(r){return r[this.key]}}]),Plugin}(),I=Object.create(null);function createKey(r){return r in I?r+"$"+ ++I[r]:(I[r]=0,r+"$")}var L=function(){function PluginKey(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";_classCallCheck(this,PluginKey),this.key=createKey(r)}return _createClass(PluginKey,[{key:"get",value:function get(r){return r.config.pluginsByKey[this.key]}},{key:"getState",value:function getState(r){return r[this.key]}}]),PluginKey}();o.AllSelection=x,o.EditorState=N,o.NodeSelection=E,o.Plugin=R,o.PluginKey=L,o.Selection=p,o.SelectionRange=g,o.TextSelection=b,o.Transaction=_},38393:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Strike:()=>w,default:()=>x,inputRegex:()=>k,pasteRegex:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,E=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,w=b.Mark.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>!!r.includes("line-through")&&{}}]},renderHTML({HTMLAttributes:r}){return["s",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},markdownTokenName:"del",parseMarkdown:(r,o)=>o.applyMark("strike",o.parseInline(r.tokens||[])),renderMarkdown:(r,o)=>`~~${o.renderChildren(r)}~~`,addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,b.markInputRule)({find:k,type:this.type})]},addPasteRules(){return[(0,b.markPasteRule)({find:E,type:this.type})]}}),x=w},38882:function(r,o,i){r.exports=i(21765)},39007:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Italic:()=>C,default:()=>_,starInputRegex:()=>k,starPasteRegex:()=>E,underscoreInputRegex:()=>w,underscorePasteRegex:()=>x}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,E=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,w=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,x=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,C=b.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>"normal"!==r.style.fontStyle&&null},{style:"font-style=normal",clearMark:r=>r.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(r,o)=>o.applyMark("italic",o.parseInline(r.tokens||[])),renderMarkdown:(r,o)=>`*${o.renderChildren(r)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,b.markInputRule)({find:k,type:this.type}),(0,b.markInputRule)({find:w,type:this.type})]},addPasteRules(){return[(0,b.markPasteRule)({find:E,type:this.type}),(0,b.markPasteRule)({find:x,type:this.type})]}}),_=C},40002:function(r,o,i){"use strict";var a,c=Object.create,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,__copyProps=(r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of g(o))b.call(r,c)||c===i||u(r,c,{get:()=>o[c],enumerable:!(a=p(o,c))||a.enumerable});return r},__toESM=(r,o,i)=>(i=null!=r?c(v(r)):{},__copyProps(!o&&r&&r.__esModule?i:u(i,"default",{value:r,enumerable:!0}),r)),k={};((r,o)=>{for(var i in o)u(r,i,{get:o[i],enumerable:!0})})(k,{AspectRatioControl:()=>cs,AttachmentTypeControl:()=>Hd,AttributesControl:()=>mf,BackgroundControl:()=>jl,BoxShadowRepeaterControl:()=>lr,ChipsControl:()=>oo,ClearIconButton:()=>ClearIconButton,ColorControl:()=>Lt,ControlActions:()=>ControlActions,ControlActionsProvider:()=>ControlActionsProvider,ControlAdornments:()=>ControlAdornments,ControlAdornmentsProvider:()=>ControlAdornmentsProvider,ControlFormLabel:()=>ControlFormLabel,ControlReplacementsProvider:()=>ControlReplacementsProvider,ControlToggleButtonGroup:()=>ControlToggleButtonGroup,DateRangeControl:()=>Ip,DateTimeControl:()=>Sp,DisplayConditionsControl:()=>lf,EmailFormActionControl:()=>jd,EqualUnequalSizesControl:()=>EqualUnequalSizesControl,FilterRepeaterControl:()=>Gr,FontFamilyControl:()=>Ti,GapControl:()=>GapControl,GridSpanControl:()=>Gd,HtmlTagControl:()=>Pa,ImageControl:()=>Te,InlineEditingControl:()=>gd,InlineEditor:()=>md,InlineEditorToolbar:()=>InlineEditorToolbar,ItemSelector:()=>ItemSelector,KeyValueControl:()=>Xl,LinkControl:()=>ma,LinkedDimensionsControl:()=>LinkedDimensionsControl,MentionTextAreaControl:()=>Ve,NumberControl:()=>wo,NumberInput:()=>pt,PopoverContent:()=>PopoverContent,PopoverGridContainer:()=>rr,PositionControl:()=>PositionControl,PromotionTrigger:()=>of,PropKeyProvider:()=>PropKeyProvider,PropProvider:()=>PropProvider,QueryChipsControl:()=>La,QueryControl:()=>ca,QueryFilterRepeaterControl:()=>Ha,RepeatableControl:()=>Wl,Repeater:()=>Repeater3,SelectControl:()=>_e,SelectControlWrapper:()=>Qr,SizeComponent:()=>SizeComponent,SizeControl:()=>Ct,StrokeControl:()=>zt,StyledToggleButton:()=>mo,StyledToggleButtonGroup:()=>ho,SvgMediaControl:()=>Rs,SwitchControl:()=>fa,TextAreaControl:()=>De,TextControl:()=>Me,TimeRangeControl:()=>Hp,TimeStringControl:()=>zp,ToggleButtonGroupUi:()=>go,ToggleControl:()=>bo,TransformRepeaterControl:()=>Du,TransformSettingsControl:()=>TransformSettingsControl,TransitionRepeaterControl:()=>gp,UnstableSizeControl:()=>hi,UnstableSizeField:()=>UnstableSizeField,UrlControl:()=>Mi,VideoMediaControl:()=>Vs,createControl:()=>createControl,createControlReplacementsRegistry:()=>createControlReplacementsRegistry,enqueueFont:()=>enqueueFont,getControlReplacements:()=>re,injectIntoRepeaterItemActions:()=>An,injectIntoRepeaterItemIcon:()=>_n,injectIntoRepeaterItemLabel:()=>On,isUnitExtendedOption:()=>isUnitExtendedOption,registerControlReplacement:()=>ne,trackUpgradePromotionClick:()=>trackUpgradePromotionClick,trackViewPromotion:()=>trackViewPromotion,transitionProperties:()=>Qu,transitionsItemsList:()=>Zu,useBoundProp:()=>useBoundProp,useControlActions:()=>useControlActions,useControlReplacement:()=>useControlReplacement,useFontFamilies:()=>useFontFamilies,useSyncExternalState:()=>useSyncExternalState,useTypingBuffer:()=>useTypingBuffer}),r.exports=(a=k,__copyProps(u({},"__esModule",{value:!0}),a));var E=__toESM(i(97557)),w=i(2020),x=i(79513),C=i(27723),_=__toESM(i(97557)),T=i(97557),P=i(22444),A=(0,P.createError)({code:"missing_prop_provider_prop_type",message:"Prop type is missing"}),N=(0,P.createError)({code:"unsupported_prop_provider_prop_type",message:"Parent prop type is not supported"}),R=(0,P.createError)({code:"hook_outside_provider",message:"Hook used outside of provider"}),I=(0,T.createContext)(null),PropProvider=({children:r,value:o,setValue:i,propType:a,placeholder:c,baseValue:u,isDisabled:p})=>_.createElement(I.Provider,{value:{value:o,propType:a,setValue:i,placeholder:c,baseValue:u,isDisabled:p}},r),usePropContext=()=>{const r=(0,T.useContext)(I);if(!r)throw new R({context:{hook:"usePropContext",provider:"PropProvider"}});return r},L=__toESM(i(97557)),z=i(97557),j=(0,z.createContext)(null),PropKeyProvider=({children:r,bind:o})=>{const{propType:i}=usePropContext();if(!i)throw new A({context:{bind:o}});if("array"===i.kind)return L.createElement(ArrayPropKeyProvider,{bind:o},r);if("object"===i.kind)return L.createElement(ObjectPropKeyProvider,{bind:o},r);throw new N({context:{propType:i}})},ObjectPropKeyProvider=({children:r,bind:o})=>{const i=usePropContext(),{path:a}=(0,z.useContext)(j)??{},c=i.value?.[o],u=i.placeholder?.[o],p=i.baseValue?.[o],g=i.propType.shape[o];return L.createElement(j.Provider,{value:{...i,value:c,setValue:(r,a,c)=>{const u={...i.value??i.baseValue,[o]:r};return i?.setValue(u,a,{...c,bind:o})},placeholder:u,baseValue:p,bind:o,propType:g,path:[...a??[],o]}},r)},ArrayPropKeyProvider=({children:r,bind:o})=>{const i=usePropContext(),{path:a}=(0,z.useContext)(j)??{},c=i.value?.[Number(o)],u=i.placeholder?.[Number(o)],p=i.baseValue?.[Number(o)],g=i.propType.item_prop_type;return L.createElement(j.Provider,{value:{...i,value:c,setValue:(r,a)=>{const c=[...i.value??i.baseValue??[]];return c[Number(o)]=r,i?.setValue(c,a,{bind:o})},bind:o,propType:g,path:[...a??[],o],placeholder:u??void 0,baseValue:p??void 0}},r)},usePropKeyContext=()=>{const r=(0,z.useContext)(j);if(!r)throw new R({context:{hook:"usePropKeyContext",provider:"PropKeyProvider"}});return r},B=i(97557);function useBoundProp(r){const o=usePropKeyContext(),{isValid:i,validate:a,restoreValue:c}=useValidation(o.propType),u=o.isDisabled?.(o.propType),resetValue=()=>{o.setValue(o.propType.initial_value??null)};if(!r)return{...o,disabled:u,resetValue:resetValue};const p=resolveUnionPropType(o.propType,r.key),g=void 0!==o.baseValue&&null!==o.baseValue?null:p.default,v=r.extract(o.value??g??null),b=r.extract(o.baseValue??null),k=r.extract(o.placeholder??o.baseValue??null);return{...o,propType:p,setValue:function setValue(i,c,u){if(a(i,u?.validation))return null===i?o?.setValue(null,c,u):o?.setValue(r?.create(i,c),{},u)},value:i?v:null,restoreValue:c,placeholder:k,baseValue:b,disabled:u,resetValue:resetValue}}var useValidation=r=>{const[o,i]=(0,B.useState)(!0);return{isValid:o,setIsValid:i,validate:(o,a)=>{let c=!0;return r.settings.required&&null===o&&(c=!1),a&&!a(o)&&(c=!1),i(c),c},restoreValue:()=>i(!0)}},resolveUnionPropType=(r,o)=>{let i=r;if("union"===r.kind&&(i=r.prop_types[o]),!i)throw new A({context:{key:o}});return i},V=__toESM(i(97557)),U=i(79513),ControlFormLabel=r=>V.createElement(U.FormLabel,{size:"tiny",...r}),H=__toESM(i(97557)),W=i(79513),K=__toESM(i(97557)),G=__toESM(i(97557)),J=i(97557),Y=(0,J.createContext)(null),ControlAdornmentsProvider=({children:r,items:o})=>G.createElement(Y.Provider,{value:{items:o}},r),useControlAdornments=()=>{const r=(0,J.useContext)(Y);return r?.items??[]};function ControlAdornments({customContext:r}){const o=useControlAdornments();return 0===o?.length?null:K.createElement(K.Fragment,null,o.map(({Adornment:o,id:i})=>K.createElement(o,{key:i,customContext:r})))}var ControlLabel=({children:r,...o})=>H.createElement(W.Stack,{direction:"row",alignItems:"center",justifyItems:"start",gap:.25},H.createElement(ControlFormLabel,{...o},r),H.createElement(ControlAdornments,null)),X=__toESM(i(97557)),Q=i(79513),Z=__toESM(i(97557)),ee=i(97557),te=(0,ee.createContext)([]),ControlReplacementsProvider=({replacements:r,children:o})=>Z.createElement(te.Provider,{value:r},o),useControlReplacement=r=>{const{value:o,placeholder:i}=useBoundProp(),a=(0,ee.useContext)(te);try{const c=a.find(r=>r.condition({value:o,placeholder:i}));return{ControlToRender:c?.component??r,OriginalControl:r,isReplaced:!!c}}catch{return{ControlToRender:r,OriginalControl:r}}},createControlReplacementsRegistry=()=>{const r=[];return{registerControlReplacement:function registerControlReplacement2(o){r.push(o)},getControlReplacements:function getControlReplacements2(){return r}}},{registerControlReplacement:ne,getControlReplacements:re}=createControlReplacementsRegistry();function createControl(r){return o=>{const{ControlToRender:i,OriginalControl:a,isReplaced:c}=useControlReplacement(r),u=c?{...o,OriginalControl:a}:o;return X.createElement(Q.ErrorBoundary,{fallback:null},X.createElement(i,{...u}))}}var oe=i(45643),ie=i(18998),ae="elementor/v1/settings",apiClient_getElementorSetting=r=>(0,ie.httpService)().get(`${ae}/${r}`).then(r=>formatSettingResponse(r.data)),apiClient_updateElementorSetting=(r,o)=>(0,ie.httpService)().put(`${ae}/${r}`,{value:o}),formatSettingResponse=r=>r.data.value,se="elementor_unfiltered_files_upload",le={queryKey:[se]},useUnfilteredFilesUpload=()=>(0,oe.useQuery)({...le,queryFn:()=>apiClient_getElementorSetting(se).then(r=>formatResponse(r)),staleTime:1/0});var formatResponse=r=>Boolean("1"===r),ce=__toESM(i(97557)),ue=i(2020),pe=i(24413),de=i(79513),fe=i(84792),he=i(27723),me=__toESM(i(97557)),ge=i(70374),ve=__toESM(i(97557)),ye=i(97557),be=(0,ye.createContext)(null),ControlActionsProvider=({children:r,items:o})=>ve.createElement(be.Provider,{value:{items:o}},r),useControlActions=()=>{const r=(0,ye.useContext)(be);if(!r)throw new Error("useControlActions must be used within a ControlActionsProvider");return r};function ControlActions({children:r}){const{items:o}=useControlActions(),{disabled:i}=useBoundProp();if(0===o.length||i)return r;const a=o.map(({MenuItem:r,id:o})=>me.createElement(r,{key:o}));return me.createElement(ge.FloatingActionsBar,{actions:a},r)}var ke=createControl(({mediaTypes:r=["image"]})=>{const{value:o,setValue:i,propType:a,placeholder:c}=useBoundProp(ue.imageSrcPropTypeUtil),{id:u,url:p}=o??{},{data:g,isFetching:v}=(0,fe.useWpMediaAttachment)(u?.value||null),{data:b}=(0,fe.useWpMediaAttachment)(c?.id?.value||null),k=g?.url??p?.value??b?.url??null,E=ue.imageSrcPropTypeUtil.extract(a.default??null)?.url?.value,w=p?.value&&p.value!==E?p.value:void 0,x=o?.alt?.value,{open:C}=(0,fe.useWpMediaFrame)({mediaTypes:r,multiple:!1,selected:u?.value||null,allowUrlImport:!0,onSelect:r=>{i({id:{$$type:"image-attachment-id",value:r.id},url:null})},onSelectUrl:(r,o)=>{i({id:null,url:ue.urlPropTypeUtil.create(r),alt:o?ue.stringPropTypeUtil.create(o):null})}});return ce.createElement(ControlActions,null,ce.createElement(de.Card,{variant:"outlined"},ce.createElement(de.CardMedia,{image:k,sx:{height:a.meta.isDynamic?134:150}},v?ce.createElement(de.Stack,{justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},ce.createElement(de.CircularProgress,null)):ce.createElement(ce.Fragment,null)),ce.createElement(de.CardOverlay,null,ce.createElement(de.Stack,{gap:1},ce.createElement(de.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>C({mode:"browse"})},(0,he.__)("Select image","elementor")),ce.createElement(de.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:ce.createElement(pe.UploadIcon,null),onClick:()=>C({mode:"upload"})},(0,he.__)("Upload","elementor")),ce.createElement(de.Button,{size:"tiny",variant:"text",color:"inherit",onClick:()=>C({mode:"url",currentUrl:w,currentAlt:x})},(0,he.__)("Insert from URL","elementor"))))))}),Ee=__toESM(i(97557)),Se=i(2020),we=i(70374),xe=i(79513),Ce={MenuListProps:{sx:{maxHeight:"160px"}}},_e=createControl(({options:r,onChange:o,MenuProps:i=Ce,ariaLabel:a})=>{const{value:c,setValue:u,disabled:p,placeholder:g}=useBoundProp(Se.stringPropTypeUtil),v=p||0===r.length;return Ee.createElement(ControlActions,null,Ee.createElement(xe.Select,{sx:{overflow:"hidden"},displayEmpty:!0,size:"tiny",MenuProps:i,"aria-label":a||g,renderValue:o=>getSelectRenderValue(r,g,o),value:c??"",onChange:r=>{const i=r.target.value||null;o?.(i,c),u(i)},disabled:v,fullWidth:!0},r.map(({label:r,...o})=>Ee.createElement(we.MenuListItem,{key:o.value,...o,value:o.value??""},r))))});function getSelectRenderValue(r,o,i){const optionWithValue=o=>r.find(({value:r})=>r===o);if(!isUnsetSelectValue(i))return optionWithValue(i)?.label??i;if(o){const r=optionWithValue(o)?.label??o;return Ee.createElement(xe.Typography,{component:"span",variant:"inherit",color:"text.tertiary"},r)}return r.find(({value:r})=>isUnsetSelectValue(r))?.label??""}function isUnsetSelectValue(r){return null==r||""===r}var Te=createControl(({sizes:r,label:o=(0,C.__)("Image","elementor")})=>{const i=useBoundProp(w.imagePropTypeUtil);return E.createElement(PropProvider,{...i},E.createElement(x.Stack,{gap:1.5},E.createElement(ControlLabel,null,o),E.createElement(ImageSrcControl,null),E.createElement(x.Grid,{container:!0,gap:1.5,alignItems:"center",flexWrap:"nowrap"},E.createElement(x.Grid,{item:!0,xs:6},E.createElement(ControlFormLabel,null,(0,C.__)("Resolution","elementor"))),E.createElement(x.Grid,{item:!0,xs:6,sx:{overflow:"hidden"}},E.createElement(ImageSizeControl,{sizes:r})))))}),ImageSrcControl=()=>{const{data:r}=useUnfilteredFilesUpload(),o=r?["image","svg"]:["image"];return E.createElement(PropKeyProvider,{bind:"src"},E.createElement(ke,{mediaTypes:o}))},ImageSizeControl=({sizes:r})=>E.createElement(PropKeyProvider,{bind:"size"},E.createElement(_e,{options:r})),Oe=__toESM(i(97557)),Pe=i(2020),Ae=i(79513),Me=createControl(({placeholder:r,error:o,inputValue:i,inputDisabled:a,helperText:c,sx:u,ariaLabel:p})=>{const{value:g,setValue:v,disabled:b,placeholder:k}=useBoundProp(Pe.stringPropTypeUtil),E=r??k??void 0;return Oe.createElement(ControlActions,null,Oe.createElement(Ae.TextField,{size:"tiny",fullWidth:!0,disabled:a??b,value:i??g??"",onChange:r=>v(r.target.value),placeholder:E,error:o,helperText:c,sx:u,inputProps:{...p?{"aria-label":p}:{}}}))}),Ne=__toESM(i(97557)),Re=i(2020),Ie=i(79513),De=createControl(({placeholder:r,ariaLabel:o})=>{const{value:i,setValue:a,disabled:c,placeholder:u}=useBoundProp(Re.stringPropTypeUtil),p=r??u??void 0;return Ne.createElement(ControlActions,null,Ne.createElement(Ie.TextField,{size:"tiny",multiline:!0,fullWidth:!0,minRows:5,disabled:c,value:i??"",onChange:r=>{a(r.target.value)},placeholder:p,inputProps:{...o?{"aria-label":o}:{}}}))}),Le=__toESM(i(97557)),Fe=i(97557),ze=i(37112),je=i(2020),Be=(0,i(79513).styled)("div")(({theme:r})=>({position:"relative","& .p-mention":{width:"100%",position:"relative"},"& textarea":{width:"100%",boxSizing:"border-box",fontFamily:"inherit",fontSize:r.typography.pxToRem(12),lineHeight:1.4375,padding:"4px 8px",borderRadius:r.shape.borderRadius,border:`1px solid ${r.palette.divider}`,backgroundColor:"transparent",color:"inherit",resize:"vertical",outline:"none",transition:"border-color 150ms ease-in-out","&:hover":{borderColor:r.palette.action.active},"&:focus":{borderColor:r.palette.primary.main,borderWidth:2,padding:"3px 7px"},"&:disabled":{opacity:.38,cursor:"default"},"&::placeholder":{color:"inherit",opacity:.5}},"& .p-mention-panel":{fontFamily:"inherit",fontSize:r.typography.pxToRem(12),backgroundColor:r.palette.background.paper,border:`1px solid ${r.palette.divider}`,borderRadius:r.shape.borderRadius,boxShadow:r.shadows[4],maxHeight:"200px",overflow:"auto",zIndex:r.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:r.palette.text.primary,"&:hover":{backgroundColor:r.palette.action.hover},"&.p-highlight":{backgroundColor:r.palette.action.selected}},'&[data-single-line="true"] textarea':{resize:"none"}}));function createMentionPattern(r,o){const i=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`${"start"===o?"^":""}@${i}(?=\\s|$|[^a-zA-Z0-9_-])`,"g")}var Ve=createControl(({placeholder:r,ariaLabel:o,suggestions:i,rows:a=5,triggerPosition:c="auto"})=>{const{value:u,setValue:p,disabled:g}=useBoundProp(je.stringPropTypeUtil),[v,b]=(0,Fe.useState)([]),k=(0,Fe.useCallback)(r=>{let o=r;for(const r of i){const i=createMentionPattern(r.value,c);o=o.replace(i,`[${r.value}]`)}return o},[i,c]),E=(0,Fe.useCallback)(r=>{const o=r.target.value,i=k(o);p(i)},[p,k]),w=(0,Fe.useCallback)(r=>{if("start"===c){if(0!==r.originalEvent.target.selectionStart-r.query.length-r.trigger.length)return void b([])}const o=r.query.toLowerCase(),a=i.filter(r=>r.label.toLowerCase().includes(o)||r.value.toLowerCase().includes(o));b(a)},[i,c]);return Le.createElement(ControlActions,null,Le.createElement(Be,{"data-single-line":1===a?"true":void 0},Le.createElement(ze.Mention,{value:u??"",onChange:E,suggestions:v,onSearch:w,field:"value",trigger:"@",rows:a,disabled:g,placeholder:r,itemTemplate:SuggestionItem,...o?{"aria-label":o}:{}})))}),SuggestionItem=r=>Le.createElement("span",null,r.label),$e=__toESM(i(97557)),Ue=i(97557),He=i(2020),We=i(74518),qe=i(79513),Ke=__toESM(i(97557)),Ge=i(24413),Je=i(79513),Ye=i(97557);function useTypingBuffer(r={}){const{limit:o=3,timeout:i=600}=r,a=(0,Ye.useRef)(""),c=(0,Ye.useRef)(null);return(0,Ye.useEffect)(()=>()=>{a.current="",c.current&&(clearTimeout(c.current),c.current=null)},[]),{buffer:a.current,appendKey:r=>(a.current=(a.current+r).slice(-o),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{a.current="",c.current=null},i),a.current),startsWith:(r,o)=>!(3<r.length&&2>o.length)&&r.startsWith(o)}}var Xe=["px","%","em","rem","vw","vh","ch"],Qe="px",Ze=NaN,et=["auto","custom"];function isUnitExtendedOption(r){return et.includes(r)}var nt=__toESM(i(97557)),rt=i(97557),ot=i(2020),it=i(70374),at=i(79513),st=__toESM(i(97557)),lt=i(97557),ct=i(79513),ut=["e","E","+"],pt=(0,lt.forwardRef)((r,o)=>{const[i,a]=(0,lt.useState)(0);return st.createElement(ct.TextField,{...r,ref:o,key:i,onKeyDown:o=>{!function blockRestrictedKeys(r,o){const i=[...ut];o>=0&&i.push("-");i.includes(r.key)&&r.preventDefault()}(o,r.inputProps?.min),r.onKeyDown?.(o)},onBlur:o=>{r.onBlur?.(o);const{valid:i}=o.target.validity;i||a(r=>r+1)}})});var dt=(0,rt.forwardRef)(({placeholder:r,type:o,value:i,onChange:a,onBlur:c,onKeyDown:u,onKeyUp:p,InputProps:g,inputProps:v,disabled:b,isPopoverOpen:k,id:E},w)=>{const{placeholder:x}=useBoundProp(ot.sizePropTypeUtil);return nt.createElement(pt,{ref:w,sx:{input:{cursor:g.readOnly?"default !important":void 0}},size:"tiny",fullWidth:!0,type:o,value:i,onInput:a,onKeyDown:u,onKeyUp:p,disabled:b,onBlur:c,focused:!!k||void 0,placeholder:r??(String(x?.size??"")||void 0),InputProps:g,inputProps:v,id:E})}),SelectionEndAdornment=({options:r,alternativeOptionLabels:o={},onClick:i,value:a,menuItemsAttributes:c={},disabled:u})=>{const p=(0,at.usePopupState)({variant:"popover",popupId:(0,rt.useId)()}),{placeholder:g,showPrimaryColor:v}=function useUnitPlaceholder(r){const{value:o,placeholder:i}=useBoundProp(ot.sizePropTypeUtil),a=o?.size,c=o?.unit,u="custom"===r&&Boolean(a),p="auto"===r,g=p||u||Boolean(a);if(!i)return{placeholder:null,showPrimaryColor:g};const v=!c&&r===Qe;return{placeholder:v?i.unit:void 0,showPrimaryColor:g}}(a),b={display:"flex",flexDirection:"column",justifyContent:"center"};return nt.createElement(at.InputAdornment,{position:"end"},nt.createElement(ft,{isPrimaryColor:v,size:"small",disabled:u,...(0,at.bindTrigger)(p)},g??o[a]??a),nt.createElement(at.Menu,{MenuListProps:{dense:!0},...(0,at.bindMenu)(p)},r.map((a,u)=>nt.createElement(it.MenuListItem,{key:a,onClick:()=>(o=>{i(r[o]),p.close()})(u),...c?.[a],primaryTypographyProps:{variant:"caption",sx:{...b,lineHeight:"1"}},menuItemTextProps:{sx:b}},o[a]??a.toUpperCase()))))};var ft=(0,at.styled)(at.Button,{shouldForwardProp:r=>"isPrimaryColor"!==r})(({isPrimaryColor:r,theme:o})=>({color:r?o.palette.text.primary:o.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),SizeInput=({units:r,handleUnitChange:o,handleSizeChange:i,placeholder:a,startIcon:c,onBlur:u,onFocus:p,onClick:g,size:v,unit:b,popupState:k,disabled:E,min:w,id:x,ariaLabel:C})=>{const{appendKey:_,startsWith:T}=useTypingBuffer(),P=isUnitExtendedOption(b)?"text":"number",A=!isUnitExtendedOption(b)&&Number.isNaN(v)?"":v??"",N={"aria-controls":k.isOpen?k.popupId:void 0,"aria-haspopup":!0},R=r.includes("custom")?{custom:N}:void 0,I={custom:Ke.createElement(Ge.MathFunctionIcon,{fontSize:"tiny"})},L={...N,readOnly:isUnitExtendedOption(b),autoComplete:"off",onClick:g,onFocus:p,startAdornment:c?Ke.createElement(Je.InputAdornment,{position:"start",disabled:E},c):void 0,endAdornment:Ke.createElement(SelectionEndAdornment,{disabled:E,options:r,onClick:o,value:b,alternativeOptionLabels:I,menuItemsAttributes:R})};return Ke.createElement(ControlActions,null,Ke.createElement(Je.Box,null,Ke.createElement(dt,{disabled:E,placeholder:a,type:P,value:A,onChange:i,onKeyDown:i=>{const{key:a,altKey:c,ctrlKey:u,metaKey:p}=i;if(c||u||p)return;if(isUnitExtendedOption(b)&&!isNaN(Number(a))){const i=r?.[0];return void(i&&o(i))}if(!/^[a-zA-Z%]$/.test(a))return;i.preventDefault();const g=a.toLowerCase(),v=_(g),k=r.find(r=>T(r,v));k&&o(k)},onBlur:u,InputProps:L,inputProps:{min:w,step:"any","aria-label":C},isPopoverOpen:k.isOpen,id:x})))},ht=__toESM(i(97557)),mt=i(97557),gt=i(70374),vt=i(24413),yt=i(79513),bt=i(27723),TextFieldPopover=r=>{const{popupState:o,restoreValue:i,anchorRef:a,value:c,onChange:u}=r,p=(0,mt.useRef)(null);(0,mt.useEffect)(()=>{o.isOpen&&requestAnimationFrame(()=>{p.current&&p.current.focus()})},[o.isOpen]);const handleClose=()=>{i(),o.close()};return ht.createElement(yt.Popover,{disablePortal:!0,slotProps:{paper:{sx:{borderRadius:2,width:a.current?.offsetWidth+"px"}}},...(0,yt.bindPopover)(o),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onClose:handleClose},ht.createElement(gt.PopoverHeader,{title:(0,bt.__)("CSS function","elementor"),onClose:handleClose,icon:ht.createElement(vt.MathFunctionIcon,{fontSize:"tiny"})}),ht.createElement(yt.TextField,{value:c,onChange:u,onKeyPress:r=>{"enter"===r.key.toLowerCase()&&handleClose()},size:"tiny",type:"text",fullWidth:!0,inputProps:{ref:p},sx:{pt:0,pr:1.5,pb:1.5,pl:1.5}}))},kt=i(97557);var Et=i(97557),useSyncExternalState=({external:r,setExternal:o,persistWhen:i,fallback:a})=>{function toInternal(r,o){return r||a(o)}const[c,u]=(0,Et.useState)(toInternal(r,null));(0,Et.useEffect)(()=>{u(o=>toInternal(r,o))},[r]);return[c,(r,a,p)=>{const g=("function"==typeof r?r:()=>r)(c);u(g),o(function toExternal(r){return i(r)?r:null}(g),a,p)}]},getPropTypeSettings=r=>r.settings,St={length:"px",angle:"deg",time:"ms"},wt={length:[...Xe],angle:["deg","rad","grad","turn"],time:["s","ms"]},xt="fx",Ct=createControl(({variant:r="length",defaultUnit:o,units:i,placeholder:a,startIcon:c,anchorRef:u,extendedOptions:p,disableCustom:g,min:v=0,enablePropTypeUnits:b=!1,id:k,ariaLabel:E})=>{const{value:w,setValue:x,disabled:C,restoreValue:_,placeholder:T,propType:P}=useBoundProp(He.sizePropTypeUtil),A=o??T?.unit??St[r],N=(0,We.useActiveBreakpoint)(),R=function useSizeExtendedOptions(r,o){return(0,kt.useMemo)(()=>{const i=[...r];return o||i.includes("custom")?r.includes("custom")&&i.splice(i.indexOf("custom"),1):i.push("custom"),i},[r,o])}(p||[],g??!1),I=function resolveUnits(r,o,i,a,c){const u=[...wt[i]];if(!o)return[...a??u,...c||[]];return getPropTypeSettings(r)?.available_units??u}(P,b,r,i,R),L=(0,qe.usePopupState)({variant:"popover"}),z=(0,Ue.useMemo)(()=>function createStateFromSizeProp(r,o,i="",a=""){const c=r?.unit??o,u=r?.size??i;return{numeric:isUnitExtendedOption(c)||isNaN(Number(u))||!u&&0!==u?Ze:Number(u),custom:"custom"===c?String(u):a,unit:c}}(w,A),[w,A]),[j,B]=useSyncExternalState({external:z,setExternal:(r,o,i)=>x(extractValueFromState(r),o,i),persistWhen:r=>!!extractValueFromState(r),fallback:r=>({unit:r?.unit??A,numeric:r?.numeric??Ze,custom:r?.custom??""})}),{size:V=Ze,unit:U=A}=extractValueFromState(j,!0)||{},handleSizeChange=r=>{const o=r.target.value,i=r.target.validity.valid;"auto"!==U?B(r=>({...r,["custom"===U?"custom":"numeric"]:formatSize(o,U),unit:U}),void 0,{validation:()=>i}):B(r=>({...r,unit:U}))},H=(0,Ue.useCallback)(()=>{L&&L.isOpen&&L.close()},[L]);return(0,Ue.useEffect)(()=>{H()},[N]),$e.createElement($e.Fragment,null,$e.createElement(SizeInput,{disabled:C,size:V,unit:U,units:[...I],placeholder:a,startIcon:c,handleSizeChange:handleSizeChange,handleUnitChange:r=>{"custom"===r&&L.open(u?.current),B(o=>({...o,unit:r}))},onBlur:_,onClick:r=>{r.target.closest("input")&&"custom"===j.unit&&L.open(u?.current)},popupState:L,min:v,id:k,ariaLabel:E}),u?.current&&L.isOpen&&$e.createElement(TextFieldPopover,{popupState:L,anchorRef:u,restoreValue:_,value:V,onChange:handleSizeChange}))});function formatSize(r,o){return isUnitExtendedOption(o)?"auto"===o?"":String(r??""):r||0===r?Number(r):NaN}function extractValueFromState(r,o=!1){if(!r)return null;if(!r?.unit)return{size:Ze,unit:Qe};const{unit:i}=r;if("auto"===i)return{size:"",unit:i};if("custom"===i)return{size:r.custom??"",unit:"custom"};const a=r.numeric;return o||null!=a&&!Number.isNaN(a)?{size:a,unit:i}:null}var _t=__toESM(i(97557)),Tt=i(97557),Ot=i(2020),Pt=i(79513),At=i(27723),Mt=__toESM(i(97557)),Nt=i(79513),SectionContent=({gap:r=.5,sx:o,children:i})=>Mt.createElement(Nt.Stack,{gap:r,sx:{...o}},i),Rt=__toESM(i(97557)),It=i(2020),Dt=i(79513),Lt=createControl(({propTypeUtil:r=It.colorPropTypeUtil,anchorEl:o,slotProps:i={},id:a,...c})=>{const{value:u,setValue:p,placeholder:g,disabled:v}=useBoundProp(r),b=c.placeholder??g;return Rt.createElement(ControlActions,null,Rt.createElement(Dt.UnstableColorField,{id:a,size:"tiny",fullWidth:!0,value:u??"",placeholder:b??"",onChange:r=>{p(r||null)},...c,disabled:v,slotProps:{...i,colorPicker:{anchorEl:o,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:-10},slotProps:{colorIndicator:{value:u??b??""},colorBox:{value:u??b??""}}}}}))}),Ft=["px","em","rem"],zt=createControl(()=>{const r=useBoundProp(Ot.strokePropTypeUtil),o=(0,Tt.useRef)(null);return _t.createElement(PropProvider,{...r},_t.createElement(SectionContent,{gap:2},_t.createElement(jt,{bind:"width",label:(0,At.__)("Stroke width","elementor"),ref:o},_t.createElement(Ct,{units:Ft,anchorRef:o})),_t.createElement(jt,{bind:"color",label:(0,At.__)("Stroke color","elementor")},_t.createElement(Lt,null))))}),jt=(0,Tt.forwardRef)(({bind:r,label:o,children:i},a)=>_t.createElement(PropKeyProvider,{bind:r},_t.createElement(Pt.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap",ref:a},_t.createElement(Pt.Grid,{item:!0,xs:6},_t.createElement(ControlFormLabel,null,o)),_t.createElement(Pt.Grid,{item:!0,xs:6},i)))),Bt=__toESM(i(97557)),Vt=i(97557),$t=i(2020),Ut=i(79513),Ht=i(27723),Wt=__toESM(i(97557)),qt=i(24413),Kt=i(79513),Gt=i(27723),Jt=__toESM(i(97557)),Yt=i(97557),Xt=i(79513),Qt=i(97557),Zt=i(74518),usePopoverDismiss=({isOpen:r,onClose:o})=>{const i=(0,Qt.useRef)(o);i.current=o;const a=(0,Zt.useActiveBreakpoint)(),c=(0,Zt.useBreakpoints)(),u=(0,Qt.useMemo)(()=>(r=>r.map(r=>[r.id,r.width??"",r.type??""].join(":")).join("|"))(c),[c]),p=(0,Qt.useRef)(void 0),g=(0,Qt.useRef)(null);(0,Qt.useEffect)(()=>{if(!r)return p.current=a,void(g.current=u);const o=p.current,c=g.current;(void 0!==o&&o!==a||null!==c&&c!==u)&&i.current(),p.current=a,g.current=u},[a,u,r]),(0,Qt.useEffect)(()=>{if(!r)return;const onKeyDown=r=>{"Escape"!==r.key||r.defaultPrevented||i.current()};return document.addEventListener("keydown",onKeyDown),()=>{document.removeEventListener("keydown",onKeyDown)}},[r])},en=new class{listeners=new Map;subscribe(r,o){this.listeners.has(r)||this.listeners.set(r,new Set);const i=this.listeners.get(r);i&&i.add(o)}unsubscribe(r,o){const i=this.listeners.get(r);i&&(i.delete(o),0===i.size&&this.listeners.delete(r))}emit(r,o){const i=this.listeners.get(r);i&&i.forEach(r=>r(o))}clearAll(){this.listeners.clear()}},tn=(0,i(97557).createContext)({index:-1,value:{}}),nn=(0,Yt.createContext)(null),useRepeaterContext=()=>{const r=(0,Yt.useContext)(nn),o=(0,Yt.useContext)(tn);if(!r)throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");return{...r,...o}},RepeaterContextProvider=({children:r,initial:o,propTypeUtil:i,isItemDisabled:a=()=>!1})=>{const{value:c,setValue:u}=useBoundProp(i),[p,g]=useSyncExternalState({external:c,fallback:()=>[],setExternal:u,persistWhen:()=>!0}),[v,b]=(0,Yt.useState)(()=>p?.map(()=>generateUniqueKey())??[]);(0,Yt.useEffect)(()=>{const r=p?.length??0;b(o=>{const i=o.length;return i===r?o:i>r?o.slice(0,r):[...o,...Array.from({length:r-i},generateUniqueKey)]})},[p?.length]);const k=(0,Yt.useMemo)(()=>v.map((r,o)=>({key:r,item:p[o]})).filter(({item:r})=>void 0!==r),[v,p]),[E,w]=(0,Yt.useState)(-1),[x,C]=(0,Yt.useState)(null),_=-1!==E,T=(0,Xt.usePopupState)({variant:"popover"});return usePopoverDismiss({isOpen:_,onClose:()=>{_&&(w(-1),C(null),T.close())}}),Jt.createElement(nn.Provider,{value:{isOpen:_,openItemIndex:E,setOpenItemIndex:w,items:k??[],setItems:r=>{g(r.map(({item:r})=>r))},popoverState:T,initial:o,updateItem:(r,o)=>{const i=[...p.slice(0,o),r,...p.slice(o+1)];g(i)},addItem:(r,a)=>{const c=a?.item??{...o},u=a?.index??p.length,k=generateUniqueKey(),E=[...p];E.splice(u,0,c),g(E),b([...v.slice(0,u),k,...v.slice(u)]),w(u),T.open(x??r),en.emit(`${i.key}-item-added`,{itemValue:o.value})},removeItem:r=>{const o=p[r];g(p.filter((o,i)=>i!==r)),b(v.filter((o,i)=>i!==r)),en.emit(`${i.key}-item-removed`,{itemValue:o?.value})},rowRef:x,setRowRef:C,isItemDisabled:r=>a(k[r].item)}},r)},generateUniqueKey=()=>Date.now()+Math.floor(1e6*Math.random()),rn="tiny",TooltipAddItemAction=({disabled:r=!1,enableTooltip:o=!1,tooltipContent:i=null,newItemIndex:a,ariaLabel:c})=>{const{addItem:u}=useRepeaterContext();return Wt.createElement(ConditionalToolTip,{content:i,enable:o},Wt.createElement(Kt.Box,{component:"span",sx:{cursor:r?"not-allowed":"pointer"}},Wt.createElement(Kt.IconButton,{size:rn,disabled:r,onClick:r=>u(r,{index:a}),"aria-label":(0,Gt.sprintf)((0,Gt.__)("Add %s item","elementor"),c?.toLowerCase())},Wt.createElement(qt.PlusIcon,{fontSize:rn}))))},ConditionalToolTip=({children:r,enable:o,content:i})=>o&&i?Wt.createElement(Kt.Infotip,{placement:"right",color:"secondary",content:i},r):r,an=__toESM(i(97557)),sn=__toESM(i(97557)),ln=i(24413),cn=i(79513),un=i(27723),SortableProvider=r=>sn.createElement(cn.List,{sx:{p:0,my:-.5,mx:0}},sn.createElement(cn.UnstableSortableProvider,{restrictAxis:!0,disableDragOverlay:!1,variant:"static",...r})),SortableItem=({id:r,children:o,disabled:i})=>sn.createElement(cn.UnstableSortableItem,{id:r,disabled:i,render:({itemProps:r,triggerProps:a,itemStyle:c,triggerStyle:u,showDropIndication:p,dropIndicationStyle:g})=>sn.createElement(pn,{...r,style:c,tabIndex:-1},!i&&sn.createElement(SortableTrigger,{...a,style:u}),o,p&&sn.createElement(dn,{style:g}))}),pn=(0,cn.styled)(cn.ListItem)` | |
| 2 | +!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 kx},AttributesControl:function(){return Px},BackgroundControl:function(){return vl},BoxShadowRepeaterControl:function(){return ro},ChipsControl:function(){return Lo},ClearIconButton:function(){return _x},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 Ox},EmailFormActionControl:function(){return xx},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 Bx},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 Sx},PropKeyProvider:function(){return m},PropProvider:function(){return d},QueryControl:function(){return es},RepeatableControl:function(){return kl},Repeater:function(){return Dx},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 Qx},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 ek},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)` | |
| 3 | 3 | position: relative; |
| 4 | 4 | margin-inline: 0px; |
| 5 | 5 | padding-inline: 0px; |
| 6 | - padding-block: ${({theme:r})=>r.spacing(.5)}; | |
| 6 | + padding-block: ${({theme:e})=>e.spacing(.5)}; | |
| 7 | 7 | |
| 8 | 8 | & .class-item-sortable-trigger { |
| 9 | - color: ${({theme:r})=>r.palette.action.active}; | |
| 9 | + color: ${({theme:e})=>e.palette.action.active}; | |
| 10 | 10 | height: 100%; |
| 11 | 11 | display: flex; |
| 12 | 12 | align-items: center; |
| 13 | 13 | visibility: hidden; |
| @@ -12,15 +12,15 @@ | ||
| 12 | 12 | align-items: center; |
| 13 | 13 | visibility: hidden; |
| 14 | 14 | position: absolute; |
| 15 | 15 | top: 50%; |
| 16 | - padding-inline-end: ${({theme:r})=>r.spacing(.5)}; | |
| 16 | + padding-inline-end: ${({theme:e})=>e.spacing(.5)}; | |
| 17 | 17 | transform: translate( -75%, -50% ); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | &[aria-describedby=''] > .MuiTag-root { |
| 21 | - background-color: ${({theme:r})=>r.palette.background.paper}; | |
| 22 | - box-shadow: ${({theme:r})=>r.shadows[3]}; | |
| 21 | + background-color: ${({theme:e})=>e.palette.background.paper}; | |
| 22 | + box-shadow: ${({theme:e})=>e.shadows[3]}; | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | &:hover, |
| 26 | 26 | &:focus-within { |
| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | & .class-item-sortable-trigger { |
| 28 | 28 | visibility: visible; |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | -`,SortableTrigger=r=>sn.createElement("div",{...r,role:"button",className:"class-item-sortable-trigger",tabIndex:0,"aria-label":(0,un.__)("Drag item","elementor")},sn.createElement(ln.GripVerticalIcon,{fontSize:"tiny"})),dn=(0,cn.styled)(cn.Divider)` | |
| 31 | +`,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)` | |
| 32 | 32 | height: 0px; |
| 33 | 33 | border: none; |
| 34 | 34 | overflow: visible; |
| 35 | 35 | |
| @@ -39,13 +39,13 @@ | ||
| 39 | 39 | display: block; |
| 40 | 40 | width: 100%; |
| 41 | 41 | height: var( --height ); |
| 42 | 42 | margin-block: calc( -1 * var( --height ) / 2 ); |
| 43 | - border-radius: ${({theme:r})=>r.spacing(.5)}; | |
| 44 | - background-color: ${({theme:r})=>r.palette.text.primary}; | |
| 43 | + border-radius: ${({theme:e})=>e.spacing(.5)}; | |
| 44 | + background-color: ${({theme:e})=>e.palette.text.primary}; | |
| 45 | 45 | } |
| 46 | -`,ItemsContainer=({isSortable:r=!0,children:o})=>{const{items:i,setItems:a}=useRepeaterContext(),c=i.map(({key:r})=>r);if(!o)return null;return an.createElement(an.Fragment,null,an.createElement(SortableProvider,{value:c,onChange:r=>{a(r.map(r=>{const o=i.findIndex(o=>o.key===r);return i[o]}))}},c.map((a,c)=>{const u=i[c].item;return an.createElement(SortableItem,{id:a,key:`sortable-${a}`,disabled:!r},an.createElement(tn.Provider,{value:{index:c,value:u}},o))})))},hn=__toESM(i(97557)),mn=i(97557),gn=i(79513),vn=i(27723),yn=i(97557),bn=(0,yn.createContext)(void 0),useRepeatableControlContext=()=>{const r=(0,yn.useContext)(bn);if(!r)throw new Error("useRepeatableControlContext must be used within RepeatableControl");return r},kn=__toESM(i(97557)),En=i(97557),Sn=i(79513),wn=(0,En.forwardRef)((r,o)=>kn.createElement(Sn.UnstableTag,{ref:o,fullWidth:!0,showActionsOnHover:!0,variant:"outlined",sx:{minHeight:r=>r.spacing(3.5)},...r})),xn=i(87627),{Slot:Cn,inject:_n}=(0,xn.createReplaceableLocation)(),{Slot:Tn,inject:On}=(0,xn.createReplaceableLocation)(),{Slot:Pn,inject:An}=(0,xn.createLocation)(),Item=({Label:r,Icon:o,actions:i})=>{const{popoverState:a,setRowRef:c,openItemIndex:u,setOpenItemIndex:p,index:g=-1,value:v,isItemDisabled:b}=useRepeaterContext(),k=(0,mn.useContext)(bn),E=!!k?.props?.readOnly,w=(0,gn.bindTrigger)(a);return hn.createElement(wn,{ref:r=>{r&&u===g&&r!==a.anchorEl&&(c(r),a.setAnchorEl(r))},label:hn.createElement(Tn,{value:v},hn.createElement(r,{value:v})),"aria-label":(0,vn.__)("Open item","elementor"),...w,onClick:r=>{E||b(g)||(w.onClick(r),p(g))},startIcon:hn.createElement(Cn,{value:v},hn.createElement(o,{value:v})),sx:{minHeight:r=>r.spacing(3.5),...b(g)&&{'[role="button"]':{cursor:"not-allowed"}}},actions:hn.createElement(hn.Fragment,null,hn.createElement(Pn,{index:g??-1}),i)})},Mn=__toESM(i(97557)),ControlRepeater=({children:r,initial:o,propTypeUtil:i,isItemDisabled:a})=>Mn.createElement(SectionContent,null,Mn.createElement(RepeaterContextProvider,{initial:o,propTypeUtil:i,isItemDisabled:a},r)),Nn=__toESM(i(97557)),Rn=i(24413),In=i(79513),Dn=i(27723),Ln="tiny",DisableItemAction=()=>{const{items:r,updateItem:o,index:i=-1}=useRepeaterContext();if(-1===i)return null;const a=r[i].item.disabled??!1,c=a?(0,Dn.__)("Show","elementor"):(0,Dn.__)("Hide","elementor");return Nn.createElement(In.Tooltip,{title:c,placement:"top"},Nn.createElement(In.IconButton,{size:Ln,onClick:()=>{const a=structuredClone(r[i].item);a.disabled=!a.disabled,a.disabled||delete a.disabled,o(a,i)},"aria-label":c},a?Nn.createElement(Rn.EyeOffIcon,{fontSize:Ln}):Nn.createElement(Rn.EyeIcon,{fontSize:Ln})))},Fn=__toESM(i(97557)),zn=i(24413),jn=i(79513),Bn=i(27723),Vn="tiny",DuplicateItemAction=()=>{const{items:r,addItem:o,index:i=-1,isItemDisabled:a}=useRepeaterContext();if(-1===i)return null;const c=(0,Bn.__)("Duplicate","elementor"),u=r[i]?.item;return Fn.createElement(jn.Tooltip,{title:c,placement:"top"},Fn.createElement(jn.IconButton,{size:Vn,onClick:r=>{const a=structuredClone(u);o(r,{item:a,index:i+1})},"aria-label":c,disabled:a(i)},Fn.createElement(zn.CopyIcon,{fontSize:Vn})))},$n=__toESM(i(97557)),Un=i(24413),Hn=i(79513),Wn=i(27723),qn="tiny",RemoveItemAction=()=>{const{removeItem:r,index:o=-1}=useRepeaterContext();if(-1===o)return null;const i=(0,Wn.__)("Remove","elementor");return $n.createElement(Hn.Tooltip,{title:i,placement:"top"},$n.createElement(Hn.IconButton,{size:qn,onClick:()=>r(o),"aria-label":i},$n.createElement(Un.XIcon,{fontSize:qn})))},Kn=__toESM(i(97557)),Gn=i(79513),Jn=__toESM(i(97557)),Yn=i(79513),RepeaterPopover=({children:r,width:o,...i})=>Jn.createElement(Yn.Popover,{disablePortal:!0,disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{marginBlockStart:.5,width:o,overflow:"visible"}}},...i},r),EditItemPopover=({children:r})=>{const{popoverState:o,openItemIndex:i,isOpen:a,rowRef:c,setOpenItemIndex:u,setRowRef:p}=useRepeaterContext();if(!a||!c)return null;return Kn.createElement(RepeaterPopover,{width:c.offsetWidth,...(0,Gn.bindPopover)(o),onClose:()=>{p(null),o.setAnchorEl(null),u(-1)}},Kn.createElement(PropKeyProvider,{bind:String(i)},Kn.createElement(Gn.Box,null,r)))},Xn=__toESM(i(97557)),Qn=i(79513),PopoverContent=({gap:r=1.5,children:o,...i})=>Xn.createElement(Qn.Stack,{...i,gap:r},o),Zn=i(97557),er=__toESM(i(97557)),nr=i(79513),rr=(0,Zn.forwardRef)(({gap:r=1.5,alignItems:o="center",flexWrap:i="nowrap",children:a},c)=>er.createElement(nr.Grid,{container:!0,gap:r,alignItems:o,flexWrap:i,ref:c},a)),or=__toESM(i(97557)),ir=i(97557),ar=i(79513),sr=(0,ir.forwardRef)(({label:r,children:o,adornment:i=ControlAdornments},a)=>or.createElement(ar.Stack,{direction:"row",alignItems:"center",gap:1,sx:{marginInlineEnd:-.75,py:.25},ref:a},or.createElement(ar.Box,{display:"flex",alignItems:"center",gap:1,sx:{flexGrow:1}},or.createElement(ar.Typography,{component:"label",variant:"caption",color:"text.secondary",sx:{lineHeight:1}},r),or.createElement(i,null)),o)),lr=createControl(()=>{const{propType:r,value:o,setValue:i,disabled:a}=useBoundProp($t.boxShadowPropTypeUtil);return Bt.createElement(PropProvider,{propType:r,value:o,setValue:i,isDisabled:()=>a},Bt.createElement(ControlRepeater,{initial:ur,propTypeUtil:$t.boxShadowPropTypeUtil},Bt.createElement(sr,{label:(0,Ht.__)("Box shadow","elementor")},Bt.createElement(TooltipAddItemAction,{newItemIndex:0,disabled:a,ariaLabel:"Box shadow"})),Bt.createElement(ItemsContainer,null,Bt.createElement(Item,{Icon:ItemIcon,Label:ItemLabel,actions:Bt.createElement(Bt.Fragment,null,Bt.createElement(DuplicateItemAction,null),Bt.createElement(DisableItemAction,null),Bt.createElement(RemoveItemAction,null))})),Bt.createElement(EditItemPopover,null,Bt.createElement(Content,null))))}),cr=(0,Ut.styled)(Ut.UnstableColorIndicator)(({theme:r})=>({height:"1rem",width:"1rem",borderRadius:r.shape.borderRadius/2+"px"})),ItemIcon=({value:r})=>Bt.createElement(cr,{size:"inherit",component:"span",value:r.value.color?.value}),Content=()=>{const r=useBoundProp($t.shadowPropTypeUtil),o=[(0,Vt.useRef)(null),(0,Vt.useRef)(null)],{rowRef:i}=useRepeaterContext();return Bt.createElement(PropProvider,{...r},Bt.createElement(PopoverContent,{p:1.5},Bt.createElement(rr,null,Bt.createElement(Control2,{bind:"color",label:(0,Ht.__)("Color","elementor")},Bt.createElement(Lt,{anchorEl:i})),Bt.createElement(Control2,{bind:"position",label:(0,Ht.__)("Position","elementor"),sx:{overflow:"hidden"}},Bt.createElement(_e,{options:[{label:(0,Ht.__)("Inset","elementor"),value:"inset"},{label:(0,Ht.__)("Outset","elementor"),value:null}]}))),Bt.createElement(rr,{ref:o[0]},Bt.createElement(Control2,{bind:"hOffset",label:(0,Ht.__)("Horizontal","elementor")},Bt.createElement(Ct,{anchorRef:o[0],min:-Number.MAX_SAFE_INTEGER})),Bt.createElement(Control2,{bind:"vOffset",label:(0,Ht.__)("Vertical","elementor")},Bt.createElement(Ct,{anchorRef:o[0],min:-Number.MAX_SAFE_INTEGER}))),Bt.createElement(rr,{ref:o[1]},Bt.createElement(Control2,{bind:"blur",label:(0,Ht.__)("Blur","elementor")},Bt.createElement(Ct,{anchorRef:o[1]})),Bt.createElement(Control2,{bind:"spread",label:(0,Ht.__)("Spread","elementor")},Bt.createElement(Ct,{anchorRef:o[1],min:-Number.MAX_SAFE_INTEGER})))))},Control2=({label:r,bind:o,children:i,sx:a})=>Bt.createElement(PropKeyProvider,{bind:o},Bt.createElement(Ut.Grid,{item:!0,xs:6,sx:a},Bt.createElement(Ut.Grid,{container:!0,gap:.75,alignItems:"center"},Bt.createElement(Ut.Grid,{item:!0,xs:12},Bt.createElement(Ut.FormLabel,{size:"tiny"},r)),Bt.createElement(Ut.Grid,{item:!0,xs:12},i)))),ItemLabel=({value:r})=>{const{position:o,hOffset:i,vOffset:a,blur:c,spread:u}=r.value,{size:p="",unit:g=""}=c?.value||{},{size:v="",unit:b=""}=u?.value||{},{size:k="unset",unit:E=""}=i?.value||{},{size:w="unset",unit:x=""}=a?.value||{},C=o?.value||"outset",_=[[k,E],[w,x],[p,g],[v,b]].map(([r,o])=>"custom"!==o?r+o:r||xt).join(" ");return Bt.createElement("span",{style:{textTransform:"capitalize"}},C,": ",_)},ur={$$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}},pr=__toESM(i(97557)),dr=i(2020),fr=i(27723),hr=__toESM(i(97557)),mr=i(97557),gr=i(2020),vr=i(27723),yr=i(27723),br={blur:{blur:{name:(0,yr.__)("Blur","elementor"),valueName:(0,yr.__)("Radius","elementor")}},intensity:{brightness:{name:(0,yr.__)("Brightness","elementor")},contrast:{name:(0,yr.__)("Contrast","elementor")},saturate:{name:(0,yr.__)("Saturate","elementor")}},"hue-rotate":{"hue-rotate":{name:(0,yr.__)("Hue Rotate","elementor"),valueName:(0,yr.__)("Angle","elementor")}},"color-tone":{grayscale:{name:(0,yr.__)("Grayscale","elementor")},invert:{name:(0,yr.__)("Invert","elementor")},sepia:{name:(0,yr.__)("Sepia","elementor")}},"drop-shadow":{"drop-shadow":{name:(0,yr.__)("Drop shadow","elementor"),valueName:(0,yr.__)("Drop-shadow","elementor")}}},kr=(0,vr.__)("Amount","elementor"),Er={"drop-shadow":r=>function buildDropShadowDefault(r){const o=r.shape;return{blur:o?.blur?.default,xAxis:o?.xAxis?.default,yAxis:o?.yAxis?.default,color:o?.color?.default??(o?.color).prop_types.color.default}}(r)};function buildFilterConfig(r){const o=Object.entries(br).flatMap(([o,i])=>Object.entries(i).map(([i,a])=>function createEntry(o,i,{name:a,valueName:c}){const u=function extractPropType(r,o){return r.shape?.args?.prop_types[o]}(r,o),p=Er[i]?.(u)??function buildSizeDefault(r){const o=r?.shape?.size;return{size:o?.default}}(u),g=function createDefaultValue({filterFunction:r,filterFunctionGroup:o,value:i}){return{$$type:"css-filter-func",value:{func:{$$type:"string",value:r},args:{$$type:o,value:i}}}}({filterFunction:i,filterFunctionGroup:o,value:p});return[i,{name:a,valueName:c??kr,defaultValue:g,filterFunctionGroup:o}]}(o,i,a)));return Object.fromEntries(o)}var Sr=(0,mr.createContext)(null);function FilterConfigProvider({children:r}){const o=useBoundProp(gr.cssFilterFunctionPropUtil),i=(0,mr.useMemo)(()=>{const r=buildFilterConfig(o.propType.item_prop_type),i=Object.entries(r).map(([r,o])=>({value:r,label:o.name}));return{config:r,filterOptions:i,getFilterFunctionConfig:o=>r[o],getInitialValue:()=>r.blur.defaultValue}},[o.propType]);return hr.createElement(Sr.Provider,{value:i},r)}function useFilterConfig(){const r=(0,mr.useContext)(Sr);if(!r)throw new Error("useFilterConfig must be used within FilterConfigProvider");return r}var wr=__toESM(i(97557)),xr=i(2020),Cr=i(79513),_r=i(27723),Tr=__toESM(i(97557)),Or=i(97557),Pr=i(2020),Ar=i(79513),Mr=i(27723),Nr=[{bind:"xAxis",label:(0,Mr.__)("X-axis","elementor"),rowIndex:0},{bind:"yAxis",label:(0,Mr.__)("Y-axis","elementor"),rowIndex:0},{bind:"blur",label:(0,Mr.__)("Blur","elementor"),rowIndex:1},{bind:"color",label:(0,Mr.__)("Color","elementor"),rowIndex:1}],DropShadowItemContent=({anchorEl:r})=>{const o=useBoundProp(Pr.dropShadowFilterPropTypeUtil),i=[(0,Or.useRef)(null),(0,Or.useRef)(null)];return Tr.createElement(PropProvider,{...o},Nr.map(o=>Tr.createElement(rr,{key:o.bind,ref:i[o.rowIndex]??null},Tr.createElement(PropKeyProvider,{bind:o.bind},Tr.createElement(Ar.Grid,{item:!0,xs:6},Tr.createElement(ControlFormLabel,null,o.label)),Tr.createElement(Ar.Grid,{item:!0,xs:6},"color"===o.bind?Tr.createElement(Lt,{anchorEl:r}):Tr.createElement(Ct,{anchorRef:i[o.rowIndex],enablePropTypeUnits:!0,min:"blur"===o.bind?0:-Number.MAX_SAFE_INTEGER,defaultUnit:"px"}))))))},Rr=i(97557),Ir=__toESM(i(97557)),Dr=i(2020),Lr=i(79513),Fr={blur:Dr.blurFilterPropTypeUtil,intensity:Dr.intensityFilterPropTypeUtil,"hue-rotate":Dr.hueRotateFilterPropTypeUtil,"color-tone":Dr.colorToneFilterPropTypeUtil},SingleSizeItemContent=({filterFunc:r})=>{const o=(0,Rr.useRef)(null),{getFilterFunctionConfig:i}=useFilterConfig(),{valueName:a,filterFunctionGroup:c}=i(r),u=useBoundProp(Fr[c]);return Ir.createElement(PropProvider,{...u},Ir.createElement(PropKeyProvider,{bind:c},Ir.createElement(PropKeyProvider,{bind:"size"},Ir.createElement(rr,{ref:o},Ir.createElement(Lr.Grid,{item:!0,xs:6},Ir.createElement(ControlFormLabel,null,a)),Ir.createElement(Lr.Grid,{item:!0,xs:6},Ir.createElement(Ct,{anchorRef:o,enablePropTypeUnits:!0}))))))},FilterContent=()=>{const r=useBoundProp(xr.cssFilterFunctionPropUtil),{filterOptions:o,getFilterFunctionConfig:i}=useFilterConfig();return wr.createElement(PropProvider,{...r,setValue:(o,a,c)=>{let u=structuredClone(o);const p=i(u?.func.value);"func"===c?.bind&&(u=p.defaultValue.value),u.args&&r.setValue(u)}},wr.createElement(PropKeyProvider,{bind:"css-filter-func"},wr.createElement(PopoverContent,{p:1.5},wr.createElement(rr,null,wr.createElement(Cr.Grid,{item:!0,xs:6},wr.createElement(ControlFormLabel,null,(0,_r.__)("Filter","elementor"))),wr.createElement(Cr.Grid,{item:!0,xs:6},wr.createElement(PropKeyProvider,{bind:"func"},wr.createElement(_e,{options:o})))),wr.createElement(PropKeyProvider,{bind:"args"},wr.createElement(FilterValueContent,null)))))},FilterValueContent=()=>{const{openItemIndex:r,items:o}=useRepeaterContext(),i=o[r].item.value.func.value;return"drop-shadow"===i?wr.createElement(DropShadowItemContent,null):wr.createElement(SingleSizeItemContent,{filterFunc:i})},zr=__toESM(i(97557)),jr=i(79513),FilterIcon=({value:r})=>"drop-shadow"!==r.value.func.value?null:zr.createElement(Br,{size:"inherit",component:"span",value:r.value.args.value?.color.value}),Br=(0,jr.styled)(jr.UnstableColorIndicator)(({theme:r})=>({borderRadius:r.shape.borderRadius/2+"px"})),Vr=__toESM(i(97557)),$r=__toESM(i(97557)),Ur=i(79513),Hr=i(27723),DropShadowItemLabel=({value:r})=>{const o=r.value.args.value,i=["xAxis","yAxis","blur"].map(r=>"custom"!==o[r]?.value?.unit?`${o[r]?.value?.size??0}${o[r]?.value?.unit??"px"}`:o[r]?.value?.size||xt);return $r.createElement(Ur.Box,{component:"span"},$r.createElement(Ur.Box,{component:"span",style:{textTransform:"capitalize"}},(0,Hr.__)("Drop shadow:","elementor")),` ${i.join(" ")}`)},Wr=__toESM(i(97557)),qr=i(79513),SingleSizeItemLabel=({value:r})=>{const{func:o,args:i}=r.value,{getFilterFunctionConfig:a}=useFilterConfig(),{defaultValue:c}=a(o.value??""),u=c.value.args.value?.size?.value?.unit??Xe[0],{unit:p,size:g}=i.value.size?.value??{unit:u,size:0},v=Wr.createElement(qr.Box,{component:"span",style:{textTransform:"capitalize"}},o.value??"",":");return Wr.createElement(qr.Box,{component:"span"},v," "+("custom"!==p?`${g??0}${p??u}`:g||xt))},FilterLabel=({value:r})=>"drop-shadow"===r.value.func.value?Vr.createElement(DropShadowItemLabel,{value:r}):Vr.createElement(SingleSizeItemLabel,{value:r}),Kr={filter:{propTypeUtil:dr.filterPropTypeUtil,label:(0,fr.__)("Filters","elementor")},"backdrop-filter":{propTypeUtil:dr.backdropFilterPropTypeUtil,label:(0,fr.__)("Backdrop filters","elementor")}},Gr=createControl(({filterPropName:r="filter"})=>{const{propTypeUtil:o,label:i}=function ensureFilterConfig(r){if(r&&r in Kr)return Kr[r];return Kr.filter}(r),{propType:a,value:c,setValue:u}=useBoundProp(o);return pr.createElement(FilterConfigProvider,null,pr.createElement(PropProvider,{propType:a,value:c,setValue:u},pr.createElement(Repeater,{propTypeUtil:o,label:i,filterPropName:r})))}),Repeater=({propTypeUtil:r,label:o,filterPropName:i})=>{const{getInitialValue:a}=useFilterConfig();return pr.createElement(ControlRepeater,{initial:a(),propTypeUtil:r},pr.createElement(sr,{label:o},pr.createElement(TooltipAddItemAction,{newItemIndex:0,ariaLabel:"backdrop-filter"===i?"backdrop filter":"filter"})),pr.createElement(ItemsContainer,null,pr.createElement(Item,{Label:FilterLabel,Icon:FilterIcon,actions:pr.createElement(pr.Fragment,null,pr.createElement(DuplicateItemAction,null),pr.createElement(DisableItemAction,null),pr.createElement(RemoveItemAction,null))})),pr.createElement(EditItemPopover,null,pr.createElement(FilterContent,null)))};var Jr=__toESM(i(97557)),Yr=i(97557),Xr={"off-canvas":()=>{const r=window,o=r.elementor.config.document.id,i=r.elementor.$previewContents[0].querySelectorAll(`[data-elementor-id="${o}"] .elementor-widget-off-canvas.elementor-element-edit-mode`);return Array.from(i).map(r=>({label:r.querySelector(".e-off-canvas")?.getAttribute("aria-label")??"",value:r.dataset.id}))},"form-elements":()=>{const r=window,o=r.elementor.config.document.id,i=[`[data-elementor-id="${o}"] input[id]:not([type="hidden"]):not([type="reset"]):not([type="button"])`,`[data-elementor-id="${o}"] select[id]`,`[data-elementor-id="${o}"] textarea[id]`],a=r.elementor.$previewContents[0].querySelectorAll(i.join(", "));return Array.from(a).map(r=>{const o=r.tagName.toLowerCase();return{label:`${r.id} (${"input"===o?r.getAttribute("type"):o})`,value:r.id}})}},Qr=createControl(({collectionId:r,options:o,...i})=>{const a=((r,o)=>{const[i,a]=(0,Yr.useState)(o??[]);return(0,Yr.useEffect)(()=>{r&&Xr[r]?a(Xr[r]()):a(o??[])},[r,o]),i})(r,o);return Jr.createElement(_e,{options:a,...i})}),Zr=__toESM(i(97557)),eo=i(2020),to=i(79513),no=__toESM(i(97557)),ro=i(79513);function ChipsList({getLabel:r,getTagProps:o,values:i}){return no.createElement(no.Fragment,null,i.map((i,a)=>{const{key:c,...u}=o({index:a});return no.createElement(ro.Chip,{key:c,label:r(i),size:"tiny",...u})}))}var oo=createControl(({options:r,freeChips:o})=>{const{value:i,setValue:a,disabled:c}=useBoundProp(eo.stringArrayPropTypeUtil),u=(i||[]).map(r=>eo.stringPropTypeUtil.extract(r)).filter(r=>null!==r).map(o=>((r,o)=>o.find(o=>o.value===r)??{label:r,value:r})(o,r));return Zr.createElement(ControlActions,null,Zr.createElement(to.Autocomplete,{fullWidth:!0,multiple:!0,freeSolo:o,size:"tiny",disabled:c,value:u,filterSelectedOptions:!0,onChange:(r,o)=>{a(o.map(r=>eo.stringPropTypeUtil.create("string"==typeof r?r:r.value)))},options:r,getOptionLabel:r=>"string"==typeof r?r:r.label,isOptionEqualToValue:(r,o)=>r.value===o.value,renderInput:r=>Zr.createElement(to.TextField,{...r}),renderTags:(r,o)=>Zr.createElement(ChipsList,{getLabel:r=>"string"==typeof r?r:r.label,getTagProps:o,values:r})}))}),io=__toESM(i(97557)),ao=i(2020),so=__toESM(i(97557)),lo=i(97557),co=i(24413),uo=i(79513),po=__toESM(i(97557)),fo=i(79513),ConditionalTooltip=({showTooltip:r,children:o,label:i})=>r&&i?po.createElement(fo.Tooltip,{title:i,disableFocusListener:!0,placement:"top"},o):o,ho=(0,uo.styled)(uo.ToggleButtonGroup)` | |
| 47 | - ${({justify:r})=>`justify-content: ${r};`} | |
| 46 | +`,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)` | |
| 47 | + ${({justify:e})=>`justify-content: ${e};`} | |
| 48 | 48 | button:not( :last-of-type ) { |
| 49 | 49 | border-start-end-radius: 0; |
| 50 | 50 | border-end-end-radius: 0; |
| 51 | 51 | } |
| @@ -56,11 +56,11 @@ | ||
| 56 | 56 | button:last-of-type { |
| 57 | 57 | border-start-end-radius: 8px; |
| 58 | 58 | border-end-end-radius: 8px; |
| 59 | 59 | } |
| 60 | -`,mo=(0,uo.styled)(uo.ToggleButton,{shouldForwardProp:r=>"isPlaceholder"!==r})` | |
| 61 | - ${({theme:r,isPlaceholder:o})=>o&&`\n\t\tcolor: ${r.palette.text.tertiary};\n\t\tbackground-color: ${"dark"===r.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"===r.palette.mode?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.04)"};\n\t\t}\n\t`} | |
| 62 | -`,go=so.forwardRef(({justify:r="end",size:o="tiny",value:i,onChange:a,items:c,maxItems:u,exclusive:p=!1,fullWidth:g=!1,disabled:v,placeholder:b},k)=>{const E=p&&void 0!==u&&c.length>u,w=E?c.slice(u-1):[],x=E?c.slice(0,u-1):c,C="rtl"===(0,uo.useTheme)().direction,_=(0,lo.useMemo)(()=>{const r=w?.length,o=r?x.length+1:x.length,i=r?"auto":"";return g?`repeat(${o}, 1fr) ${i}`:`repeat(${o}, minmax(0, 25%)) ${i}`},[w?.length,x.length,g]),T=p&&(null==i||""===i),P=!p&&Array.isArray(i)?i.map(r=>"string"==typeof r?r:"").join(" ").trim().split(/\s+/).filter(Boolean):[],A=!p&&0===P.length,N=(R=b,Array.isArray(R)?R.flatMap(r=>"string"==typeof r?r.trim().split(/\s+/).filter(Boolean):[]):"string"==typeof R?R.trim().split(/\s+/).filter(Boolean):[]);var R;return so.createElement(ho,{ref:k,justify:r,value:i,onChange:(r,o)=>{a(o)},exclusive:p,disabled:v,sx:{direction:C?"rtl /* @noflip */":"ltr /* @noflip */",display:"grid",gridTemplateColumns:_,width:"100%"}},x.map(({label:r,value:i,renderContent:a,showTooltip:c,disabled:u=!1})=>{const p=N.length>0&&N.includes(i)&&(T||A);return so.createElement(ConditionalTooltip,{key:i,label:r,showTooltip:c||!1},so.createElement(mo,{value:i,"aria-label":r,size:o,fullWidth:g,isPlaceholder:p,disabled:u},so.createElement(a,{size:o})))}),w.length&&p&&so.createElement(SplitButtonGroup,{size:o,value:i||null,onChange:a,items:w,fullWidth:g}))}),ControlToggleButtonGroup=r=>so.createElement(ControlActions,null,so.createElement(go,{...r})),SplitButtonGroup=({size:r="tiny",onChange:o,items:i,fullWidth:a,value:c})=>{const u=usePreviewButton(i,c),[p,g]=(0,lo.useState)(!1),v=(0,lo.useRef)(null),onMenuItemClick=r=>{g(!1),onToggleItem(r)},onToggleItem=r=>{o(r===c?null:r)};return so.createElement(so.Fragment,null,so.createElement(uo.ToggleButton,{value:u.value,"aria-label":u.label,size:r,fullWidth:a,onClick:r=>{r.preventDefault(),onMenuItemClick(u.value)}},u.renderContent({size:r})),so.createElement(uo.ToggleButton,{size:r,"aria-expanded":p?"true":void 0,"aria-haspopup":"menu","aria-pressed":void 0,onClick:r=>{g(r=>!r),r.preventDefault()},ref:v,value:"__chevron-icon-button__"},so.createElement(co.ChevronDownIcon,{fontSize:r})),so.createElement(uo.Menu,{open:p,onClose:()=>g(!1),anchorEl:v.current,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{mt:.5}},i.filter(r=>r.value!==u.value).map(({label:r,value:o})=>so.createElement(uo.MenuItem,{key:o,selected:o===c,onClick:()=>onMenuItemClick(o)},so.createElement(uo.ListItemText,null,so.createElement(uo.Typography,{sx:{fontSize:"14px"}},r))))))},usePreviewButton=(r,o)=>{const[i,a]=(0,lo.useState)(r.find(r=>r.value===o)??r[0]);return(0,lo.useEffect)(()=>{const i=r.find(r=>r.value===o);i&&a(i)},[r,o]),i},vo=__toESM(i(97557)),yo=__toESM(i(24413)),bo=createControl(({options:r,fullWidth:o=!1,size:i="tiny",exclusive:a=!0,maxItems:c,convertOptions:u=!1})=>{const{value:p,setValue:g,placeholder:v,disabled:b}=useBoundProp(ao.stringPropTypeUtil),k=u?(r=>r.map(r=>{const o=r.icon,i=yo[o];return{value:r.value,label:r.label,renderContent:({size:o})=>i?vo.createElement(i,{fontSize:o}):r.label,showTooltip:r.showTooltip,exclusive:r.exclusive}}))(r):r,E=k.filter(r=>r.exclusive).map(r=>r.value),w={items:k,maxItems:c,fullWidth:o,size:i,placeholder:v};return a?io.createElement(ControlToggleButtonGroup,{...w,value:p??null,onChange:g,disabled:b,exclusive:!0}):io.createElement(ControlToggleButtonGroup,{...w,value:p?.split(" ")??[],onChange:r=>{const o=r[r.length-1],i=E.includes(o)?[o]:r?.filter(r=>!E.includes(r));g(i?.join(" ")||null)},disabled:b,exclusive:!1})}),ko=__toESM(i(97557)),Eo=i(2020),So=i(79513),isEmptyOrNaN=r=>null==r||""===r||Number.isNaN(Number(r)),renderSuffix=r=>r.meta?.suffix?ko.createElement(So.InputAdornment,{position:"end"},ko.createElement(So.Typography,{variant:"caption",color:"text.secondary"},r.meta.suffix)):ko.createElement(ko.Fragment,null),wo=createControl(({placeholder:r,max:o=Number.MAX_SAFE_INTEGER,min:i=-Number.MAX_SAFE_INTEGER,step:a=1,shouldForceInt:c=!1,startIcon:u,disabled:p})=>{const{value:g,setValue:v,placeholder:b,disabled:k,restoreValue:E,propType:w}=useBoundProp(Eo.numberPropTypeUtil);return ko.createElement(ControlActions,null,ko.createElement(pt,{size:"tiny",type:"number",fullWidth:!0,disabled:p??k,value:isEmptyOrNaN(g)?"":g,onInput:r=>{const{value:a,validity:{valid:u}}=r.target;let p;if(isEmptyOrNaN(a))p=null;else{const r=c?+parseInt(a):Number(a);p=Math.min(Math.max(r,i??Number.MIN_SAFE_INTEGER),o??Number.MAX_SAFE_INTEGER)}v(p,void 0,{validation:()=>u})},onBlur:E,placeholder:r??(isEmptyOrNaN(b)?"":String(b)),inputProps:{step:a,min:i},InputProps:{startAdornment:u?ko.createElement(So.InputAdornment,{position:"start",disabled:p??k},u):void 0,endAdornment:renderSuffix(w)}}))}),xo=__toESM(i(97557)),Co=i(97557),_o=i(79513),To=i(27723);function EqualUnequalSizesControl({label:r,icon:o,tooltipLabel:i,items:a,multiSizePropTypeUtil:c}){const u=(0,Co.useId)(),p=(0,_o.usePopupState)({variant:"popover",popupId:u}),g=[(0,Co.useRef)(null),(0,Co.useRef)(null)],{propType:v,disabled:b}=useBoundProp(c),{value:k,setValue:E,placeholder:w}=useBoundProp(),getMultiSizeValues=r=>{if(c.isValid(r))return r.value;const o={};a.forEach(i=>{o[i.bind]=r});const i=c.create(o);return i?.value},x=!p.isOpen,C=getMultiSizeValues(k),_=getMultiSizeValues(w),isEqualValues=r=>{if(!r)return!0;const o=c.create(r),i={};a.forEach(r=>{i[r.bind]=o?.value?.[r.bind]??null});const u=Object.values(i).map(r=>JSON.stringify(r));return u.every(r=>r===u[0])},T=!k&&!isEqualValues(_),P=T||!isEqualValues(C);return xo.createElement(xo.Fragment,null,xo.createElement(_o.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap",ref:g[0]},xo.createElement(_o.Grid,{item:!0,xs:6},x?xo.createElement(ControlLabel,null,r):xo.createElement(ControlFormLabel,null,r)),xo.createElement(_o.Grid,{item:!0,xs:6},xo.createElement(_o.Stack,{direction:"row",alignItems:"center",gap:1},xo.createElement(_o.Box,{flexGrow:1},xo.createElement(Ct,{placeholder:P?(0,To.__)("Mixed","elementor"):void 0,enablePropTypeUnits:!P||!T,anchorRef:g[0]})),xo.createElement(_o.Tooltip,{title:i,placement:"top"},xo.createElement(mo,{size:"tiny",value:"check",sx:{marginLeft:"auto"},...(0,_o.bindToggle)(p),selected:p.isOpen,isPlaceholder:T,"aria-label":i},o))))),xo.createElement(_o.Popover,{disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},...(0,_o.bindPopover)(p),slotProps:{paper:{sx:{mt:.5,width:g[0].current?.getBoundingClientRect().width}}}},xo.createElement(PropProvider,{propType:v,value:C,placeholder:_,setValue:r=>{isEqualValues(r)?E(Object.values(r)?.pop()??null):E(c.create(r))},isDisabled:()=>b},xo.createElement(PopoverContent,{p:1.5},xo.createElement(rr,{ref:g[1]},xo.createElement(MultiSizeValueControl,{item:a[0],rowRef:g[1]}),xo.createElement(MultiSizeValueControl,{item:a[1],rowRef:g[1]})),xo.createElement(rr,{ref:g[2]},xo.createElement(MultiSizeValueControl,{item:a[2],rowRef:g[2]}),xo.createElement(MultiSizeValueControl,{item:a[3],rowRef:g[2]}))))))}var MultiSizeValueControl=({item:r,rowRef:o})=>{const{bind:i,label:a,icon:c,ariaLabel:u}=r;return xo.createElement(PropKeyProvider,{bind:i},xo.createElement(_o.Grid,{item:!0,xs:6},xo.createElement(_o.Grid,{container:!0,gap:.75,alignItems:"center"},xo.createElement(_o.Grid,{item:!0,xs:12},xo.createElement(ControlLabel,null,a)),xo.createElement(_o.Grid,{item:!0,xs:12},xo.createElement(Ct,{startIcon:c,ariaLabel:u,anchorRef:o})))))},Oo=__toESM(i(97557)),Po=i(97557),Ao=i(2020),Mo=i(74518),No=i(24413),Ro=i(79513),Io=i(27723),Do=__toESM(i(97557)),Lo=i(97557),Fo=i(2020),zo=__toESM(i(97557)),jo=i(97557),Bo=i(74518),Vo=i(79513),$o=__toESM(i(97557)),Uo=i(24413),Ho=i(79513),getLengthUnits=()=>window.elementor?.config?.size_units?.length??[],getAngleUnits=()=>window.elementor?.config?.size_units?.angle??[],getTimeUnits=()=>window.elementor?.config?.size_units?.time??[],isExtendedUnit=r=>(window.elementor?.config?.size_units?.extended_units??[]).includes(r),Wo=/^[a-zA-Z%]$/,isNumericValue=r=>"number"==typeof r?!isNaN(r):"string"==typeof r&&(""!==r.trim()&&!isNaN(Number(r))),qo=i(97557),Ko="",Go="auto",Jo="custom",resolveSizeOnUnitChange=(r,o)=>isExtendedUnit(o)?Ko:r,resolveFallbackUnit=(r,o,i)=>o.includes(r)?r:i&&o.includes(i)?i:o[0]??"",sanitizeSize=r=>"number"==typeof r&&isNaN(r)?Ko:r,Yo=i(97557),useSizeValue=({value:r,setValue:o,units:i,defaultUnit:a})=>{const c=(0,qo.useMemo)(()=>((r,o)=>{if(!r)return r;const{units:i,defaultUnit:a}=o,c=resolveFallbackUnit(r.unit,i,a);return c===Go?{size:Ko,unit:c}:c===Jo?{size:String(r.size??Ko),unit:c}:{size:sanitizeSize(r.size)??Ko,unit:c}})(r,{units:i,defaultUnit:a}),[r?.size,r?.unit,a]),[u,p]=useSyncExternalState({external:c,setExternal:(r,i,a)=>{null!==r&&o(r,i,a)},persistWhen:r=>hasChanged(r,c),fallback:()=>((r,o)=>{let[i]=r;return void 0!==o&&(i=resolveFallbackUnit(o,r)),{size:Ko,unit:i}})(i,a)}),[g,v]=(({sizeValue:r,setUnit:o,persistWhen:i})=>{const[a,c]=(0,Yo.useState)(r.unit);return(0,Yo.useEffect)(()=>{r.unit!==a&&c(r.unit)},[r.unit,r.size]),[a,r=>{c(r),(isExtendedUnit(r)||i())&&o(r)}]})({sizeValue:u,setUnit:r=>{p({unit:r,size:resolveSizeOnUnitChange(u.size,r)})},persistWhen:()=>Boolean(u.size)||""!==u.size||isExtendedUnit(u.unit)});return{size:u.size,setSize:(r,o=!0)=>{if(isExtendedUnit(g))return;const i=r.trim(),a=Number(i),c={unit:g,size:i&&!isNaN(a)?a:""};p(c,void 0,{validation:()=>o})},unit:g,setUnit:v}},hasChanged=(r,o)=>r?.size!==o?.size||r?.unit!==o?.unit,Xo=__toESM(i(97557)),Qo=(0,i(97557).forwardRef)(({id:r,type:o,value:i,onBlur:a,onKeyUp:c,focused:u,disabled:p,onChange:g,onKeyDown:v,InputProps:b,inputProps:k,placeholder:E},w)=>Xo.createElement(pt,{id:r,ref:w,size:"tiny",fullWidth:!0,type:o,value:i,placeholder:E,onKeyUp:c,focused:u,disabled:p,onKeyDown:v,onInput:g,onBlur:a,InputProps:b,inputProps:k,sx:getCursorStyle(b?.readOnly??!1)})),getCursorStyle=r=>({input:{cursor:r?"default !important":void 0}}),Zo=__toESM(i(97557)),ei=i(97557),ti=i(70374),ni=i(79513),ri={display:"flex",flexDirection:"column",justifyContent:"center"},UnitSelector=({value:r,isUnitHighlighted:o,onSelect:i,options:a,disabled:c,menuItemsAttributes:u={},optionLabelOverrides:p={}})=>{const g=(0,ni.usePopupState)({variant:"popover",popupId:(0,ei.useId)()});return Zo.createElement(Zo.Fragment,null,Zo.createElement(oi,{isHighlighted:o,disabled:c,size:"small",...(0,ni.bindTrigger)(g)},p[r]??r),Zo.createElement(ni.Menu,{MenuListProps:{dense:!0},...(0,ni.bindMenu)(g)},a.map(r=>Zo.createElement(ti.MenuListItem,{key:r,onClick:()=>(r=>{i(r),g.close()})(r),...u?.[r],primaryTypographyProps:{variant:"caption",sx:{...ri,lineHeight:"1"}},menuItemTextProps:{sx:ri}},p[r]??r.toUpperCase()))))},oi=(0,ni.styled)(ni.Button,{shouldForwardProp:r=>"isHighlighted"!==r})(({isHighlighted:r,theme:o})=>({color:r?o.palette.text.primary:o.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),ii={custom:$o.createElement(Uo.MathFunctionIcon,{fontSize:"tiny"})},SizeField=({value:r,focused:o,disabled:i,InputProps:a,defaultUnit:c,placeholder:u,onUnitChange:p,startIcon:g,ariaLabel:v,onKeyDown:b,setValue:k,onBlur:E,units:w,min:x,unitSelectorProps:C})=>{const{size:_,unit:T,setSize:P,setUnit:A}=useSizeValue({value:r,setValue:k,units:w,defaultUnit:c}),handleUnitChange=r=>{A(r),p?.(r)},{onUnitKeyDown:N}=(({unit:r,units:o,onUnitChange:i})=>{const{appendKey:a,startsWith:c}=useTypingBuffer();return{onUnitKeyDown:u=>{if(0===o.length)return;const{key:p,altKey:g,ctrlKey:v,metaKey:b}=u;if(g||v||b)return;if(isExtendedUnit(r)&&isNumericValue(p)){const[r]=o;return void(r&&i(r))}if(!Wo.test(p))return;u.preventDefault();const k=a(p.toLowerCase()),E=o.find(r=>c(r,k));E&&i(E)}}})({unit:T,onUnitChange:handleUnitChange,units:w}),R=isExtendedUnit(T)?"text":"number";return $o.createElement(Qo,{disabled:i,focused:o,type:R,value:_,placeholder:u,onBlur:E,onKeyDown:r=>{N(r),b?.(r)},onChange:r=>{const o=r.target.value,i=r.target.validity.valid;P(o,i)},InputProps:{...a,autoComplete:"off",readOnly:isExtendedUnit(T),startAdornment:g&&$o.createElement(Ho.InputAdornment,{position:"start",disabled:i},g),endAdornment:$o.createElement(Ho.InputAdornment,{position:"end"},$o.createElement(UnitSelector,{options:w,value:T,onSelect:handleUnitChange,isUnitHighlighted:shouldHighlightUnit({size:_,unit:T}),...C,optionLabelOverrides:ii}))},inputProps:{min:x,step:"any","aria-label":v}})},shouldHighlightUnit=r=>!!r&&(r.unit===Go||(Boolean(r.size)||0===r.size)),ai=__toESM(i(97557)),si=i(97557),li=i(70374),ci=i(24413),ui=i(79513),pi=i(27723),TextFieldPopover2=({popupState:r,anchorRef:o,value:i,onChange:a,onClose:c})=>{const u=(0,si.useRef)(null);(0,si.useEffect)(()=>{r.isOpen&&requestAnimationFrame(()=>{u.current&&u.current.focus()})},[r.isOpen]);const handleClose=()=>{c?.(),r.close()};return ai.createElement(ui.Popover,{disablePortal:!0,slotProps:{paper:{sx:{borderRadius:2,width:o.current?.offsetWidth+"px"}}},...(0,ui.bindPopover)(r),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onClose:handleClose},ai.createElement(li.PopoverHeader,{title:(0,pi.__)("CSS function","elementor"),onClose:handleClose,icon:ai.createElement(ci.MathFunctionIcon,{fontSize:"tiny"})}),ai.createElement(ui.TextField,{value:i,onChange:a,onKeyDown:r=>{"enter"===r.key.toLowerCase()&&handleClose()},size:"tiny",type:"text",fullWidth:!0,inputProps:{ref:u},sx:{pt:0,pr:1.5,pb:1.5,pl:1.5}}))},SizeComponent=({anchorRef:r,SizeFieldWrapper:o=zo.Fragment,...i})=>{const a=(0,Vo.usePopupState)({variant:"popover"}),c=(0,Bo.useActiveBreakpoint)(),u=i?.value?.unit===Jo,p=i.units.includes(Jo);(0,jo.useEffect)(()=>{a&&a.isOpen&&a.close()},[c]);const g={"aria-controls":a.isOpen?a.popupId:void 0,"aria-haspopup":!0};return zo.createElement(zo.Fragment,null,zo.createElement(o,null,zo.createElement(Vo.Box,null,zo.createElement(SizeField,{focused:!!a.isOpen||void 0,onUnitChange:o=>{o===Jo&&r?.current&&a.open(r.current)},InputProps:{...g,onClick:o=>{o.target.closest("input")&&u&&a.open(r?.current)}},unitSelectorProps:{menuItemsAttributes:p?{custom:g}:void 0},...i}))),a.isOpen&&r?.current&&zo.createElement(TextFieldPopover2,{popupState:a,anchorRef:r,value:String(i?.value?.size??""),onChange:r=>{i.setValue({size:r.target.value,unit:Jo})},onClose:()=>{}}))},di=i(2020),toUnitPlaceholder=r=>({...r,size:""}),pickFirstValid=r=>{const o=r.find(({candidate:r})=>validateSizeValue(r));return o?o.resolve(o.candidate):null},validateSizeValue=r=>{if(!r||"object"!=typeof r)return!1;const o=di.sizePropTypeUtil.create(r);return di.sizePropTypeUtil.isValid(o)},resolvePlaceholder=r=>{if("string"==typeof r)return r;const o=r?.size;return void 0!==o?"number"==typeof o?o.toString():o:void 0},getSizeUnits=(r,o)=>(r=>getPropTypeSettings(r)?.available_units)(r)??(r=>({length:getLengthUnits,angle:getAngleUnits,time:getTimeUnits}[r]()))(o),fi=[r=>Boolean(r),r=>null==r?.size||""===r?.size,r=>r?.unit!==Go,r=>r?.unit!==Jo],hi=createControl(({variant:r="length",placeholder:o,anchorRef:i,startIcon:a,ariaLabel:c,min:u})=>{const{value:p,setValue:g,propType:v,placeholder:b,restoreValue:k}=useBoundProp(Fo.sizePropTypeUtil),E=(0,Lo.useRef)(null),{sizeValue:w,placeholder:x}=((r,o,i)=>{const a=i??o;return{sizeValue:pickFirstValid([{candidate:r,resolve:r=>r},{candidate:i,resolve:toUnitPlaceholder},{candidate:o,resolve:toUnitPlaceholder}]),placeholder:Boolean(r)?void 0:resolvePlaceholder(a)}})(p??E.current,b,o),C=getSizeUnits(v,r),_=(r=>getPropTypeSettings(r)?.default_unit)(v);return Do.createElement(SizeComponent,{units:C,value:w,anchorRef:i,placeholder:x,defaultUnit:_,onBlur:()=>{const r=v.settings.required;(r=>fi.every(o=>o(r)))(p)&&!r&&g(null),r&&k()},setValue:(r,o,i)=>{if(isTransitioningFromExtendedUnit(r,p))return E.current=r,void g(null);g(r,o,{...i,validation:()=>v.settings.required?""!==r.size:!i?.validation||i.validation(r)})},SizeFieldWrapper:ControlActions,startIcon:a,ariaLabel:c,min:u})}),isTransitioningFromExtendedUnit=(r,o)=>!isExtendedUnit(r.unit)&&isExtendedUnit(o?.unit)&&""===r.size,LinkedDimensionsControl=({label:r,isSiteRtl:o=!1,min:i})=>{const a=[(0,Po.useRef)(null),(0,Po.useRef)(null)],{disabled:c}=useBoundProp(Ao.sizePropTypeUtil),{value:u,setValue:p,propType:g,placeholder:v,disabled:b}=useBoundProp(Ao.dimensionsPropTypeUtil),{value:k,placeholder:E,setValue:w}=useBoundProp(),inferIsLinked=()=>!Ao.dimensionsPropTypeUtil.isValid(k)&&!(!k&&Ao.dimensionsPropTypeUtil.isValid(E)),[x,C]=(0,Po.useState)(()=>inferIsLinked()),_=(0,Mo.useActiveBreakpoint)(),T=Ao.dimensionsPropTypeUtil.isValid(k??E);(0,Po.useLayoutEffect)(()=>{C(inferIsLinked)},[_,T]);const P=r.toLowerCase(),A=x?No.LinkIcon:No.DetachIcon,N=(0,Io.__)("Link %s","elementor").replace("%s",P),R=(0,Io.__)("Unlink %s","elementor").replace("%s",P),I=c||b,L={propType:g,value:u,placeholder:v??(x?null:{"block-start":E,"block-end":E,"inline-start":E,"inline-end":E}),setValue:r=>{const o=Object.entries(r).filter(([,r])=>Boolean(r));p(0===o.length?null:Object.fromEntries(o))},isDisabled:()=>b},z=!k&&(v||E),getEffectivePlaceholder=r=>{if(x){const r=getFirstDefined(v);return Ao.sizePropTypeUtil.extract(r)}return Ao.sizePropTypeUtil.extract(v?.[r])};return Oo.createElement(PropProvider,{...L},Oo.createElement(Ro.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},Oo.createElement(ControlFormLabel,null,r),Oo.createElement(Ro.Tooltip,{title:x?R:N,placement:"top"},Oo.createElement(mo,{"aria-label":x?R:N,size:"tiny",value:"check",selected:x,sx:{marginLeft:"auto"},onChange:()=>{if(C(r=>!r),!Ao.dimensionsPropTypeUtil.isValid(k)){const r=k||null;return r?void w(Ao.dimensionsPropTypeUtil.create({"block-start":r,"block-end":r,"inline-start":r,"inline-end":r})):void w(null)}const r=getFirstDefined(u)??null;w(r||null)},disabled:I,isPlaceholder:z},Oo.createElement(A,{fontSize:"tiny"})))),function getCssDimensionProps(r,o){return[[{bind:"block-start",label:(0,Io.__)("Top","elementor"),ariaLabel:(0,Io.sprintf)((0,Io.__)("%s top","elementor"),r),icon:Oo.createElement(No.SideTopIcon,{fontSize:"tiny"})},{bind:"inline-end",label:o?(0,Io.__)("Left","elementor"):(0,Io.__)("Right","elementor"),ariaLabel:o?(0,Io.sprintf)((0,Io.__)("%s left","elementor"),r):(0,Io.sprintf)((0,Io.__)("%s right","elementor"),r),icon:o?Oo.createElement(No.SideLeftIcon,{fontSize:"tiny"}):Oo.createElement(No.SideRightIcon,{fontSize:"tiny"})}],[{bind:"block-end",label:(0,Io.__)("Bottom","elementor"),ariaLabel:(0,Io.sprintf)((0,Io.__)("%s bottom","elementor"),r),icon:Oo.createElement(No.SideBottomIcon,{fontSize:"tiny"})},{bind:"inline-start",label:o?(0,Io.__)("Right","elementor"):(0,Io.__)("Left","elementor"),ariaLabel:o?(0,Io.sprintf)((0,Io.__)("%s right","elementor"),r):(0,Io.sprintf)((0,Io.__)("%s left","elementor"),r),icon:o?Oo.createElement(No.SideRightIcon,{fontSize:"tiny"}):Oo.createElement(No.SideLeftIcon,{fontSize:"tiny"})}]]}(r,o).map((r,o)=>Oo.createElement(Ro.Stack,{direction:"row",gap:2,flexWrap:"nowrap",key:o,ref:a[o]},r.map(({icon:r,...c})=>Oo.createElement(Ro.Grid,{container:!0,gap:.75,alignItems:"center",key:c.bind},Oo.createElement(Ro.Grid,{item:!0,xs:12},Oo.createElement(Label,{...c})),Oo.createElement(Ro.Grid,{item:!0,xs:12},Oo.createElement(Control3,{bind:c.bind,ariaLabel:c.ariaLabel,startIcon:r,isLinked:x,placeholder:getEffectivePlaceholder(c.bind)??void 0,anchorRef:a[o],min:i})))))))},Control3=({bind:r,ariaLabel:o,startIcon:i,isLinked:a,placeholder:c,anchorRef:u,min:p})=>a?Oo.createElement(hi,{ariaLabel:o,startIcon:i,anchorRef:u,placeholder:c,min:p}):Oo.createElement(PropKeyProvider,{bind:r},Oo.createElement(hi,{ariaLabel:o,startIcon:i,anchorRef:u,min:p,placeholder:c})),Label=({label:r,bind:o})=>Oo.createElement(PropKeyProvider,{bind:o},Oo.createElement(ControlLabel,null,r)),getFirstDefined=r=>r?.["block-start"]??r?.["inline-end"]??r?.["block-end"]??r?.["inline-start"];var mi=__toESM(i(97557)),gi=i(97557),vi=i(2020),yi=i(24413),bi=i(79513),ki=i(27723),Ei=__toESM(i(97557)),Si=i(97557),wi=i(70374),xi=i(79513),Ci=i(22444),_i=i(27723),ItemSelector=({itemsList:r,selectedItem:o,onItemChange:i,onClose:a,sectionWidth:c,title:u,itemStyle:p=()=>({}),onDebounce:g=()=>{},icon:v,disabledItems:b,id:k="item-selector",footer:E,categoryItemContentTemplate:w})=>{const[x,C]=(0,Si.useState)(""),_=((r,o,i)=>r.reduce((r,a)=>{const c=a.items.filter(r=>r.toLowerCase().includes(o.toLowerCase()));return c.length&&(r.push({type:"category",value:a.label}),c.forEach(o=>{r.push({type:"item",value:o,disabled:i?.includes(o)??!1})})),r},[]))(r,x,b),T=v,handleClose=()=>{C(""),a()};return Ei.createElement(wi.PopoverBody,{width:c,id:k},Ei.createElement(wi.PopoverHeader,{title:u,onClose:handleClose,icon:Ei.createElement(T,{fontSize:"tiny"})}),Ei.createElement(wi.SearchField,{value:x,onSearch:r=>{C(r)},placeholder:(0,_i.__)("Search","elementor"),id:k+"-search"}),Ei.createElement(xi.Divider,null),Ei.createElement(xi.Box,{sx:{flex:1,overflow:"auto",minHeight:0}},_.length>0?Ei.createElement(ItemList,{itemListItems:_,setSelectedItem:i,handleClose:handleClose,selectedItem:o,itemStyle:p,onDebounce:g,categoryItemContentTemplate:w}):Ei.createElement(xi.Stack,{alignItems:"center",justifyContent:"center",height:"100%",p:2.5,gap:1.5,overflow:"hidden"},Ei.createElement(T,{fontSize:"large"}),Ei.createElement(xi.Box,{sx:{maxWidth:160,overflow:"hidden"}},Ei.createElement(xi.Typography,{align:"center",variant:"subtitle2",color:"text.secondary"},(0,_i.__)("Sorry, nothing matched","elementor")),Ei.createElement(xi.Typography,{variant:"subtitle2",color:"text.secondary",sx:{display:"flex",width:"100%",justifyContent:"center"}},Ei.createElement("span",null,"“"),Ei.createElement(xi.Box,{component:"span",sx:{maxWidth:"80%",overflow:"hidden",textOverflow:"ellipsis"}},x),Ei.createElement("span",null,"”."))),Ei.createElement(xi.Typography,{align:"center",variant:"caption",color:"text.secondary",sx:{display:"flex",flexDirection:"column"}},(0,_i.__)("Try something else.","elementor"),Ei.createElement(xi.Link,{color:"secondary",variant:"caption",component:"button",onClick:()=>C("")},(0,_i.__)("Clear & try again","elementor"))))),E)},ItemList=({itemListItems:r,setSelectedItem:o,handleClose:i,selectedItem:a,itemStyle:c=()=>({}),onDebounce:u=()=>{},categoryItemContentTemplate:p})=>{const g=r.find(r=>r.value===a),v=useDebounce(r=>{r.forEach(r=>{r&&"item"===r.type&&u(r.value)})},100),b=(0,Si.useCallback)(r=>c(r),[c]);return Ei.createElement(wi.PopoverMenuList,{items:r,selectedValue:g?.value,onChange:v,onSelect:o,onClose:i,itemStyle:b,"data-testid":"item-list",categoryItemContentTemplate:p})},useDebounce=(r,o)=>{const[i]=(0,Si.useState)(()=>(0,Ci.debounce)(r,o));return(0,Si.useEffect)(()=>()=>i.cancel(),[i]),i},enqueueFont=(r,o="editor")=>{const i=window;return i.elementor?.helpers?.enqueueFont?.(r,o)??null},Ti=createControl(({fontFamilies:r,sectionWidth:o,ariaLabel:i})=>{const{value:a,setValue:c,disabled:u,placeholder:p}=useBoundProp(vi.fontFamilyPropTypeUtil),g=(0,bi.usePopupState)({variant:"popover"}),v=!a&&p,b=(0,gi.useMemo)(()=>r.map(({label:r,fonts:o})=>({label:r,items:o})),[r]);return mi.createElement(mi.Fragment,null,mi.createElement(ControlActions,null,mi.createElement(bi.UnstableTag,{id:"font-family-control",variant:"outlined",label:a||p,endIcon:mi.createElement(yi.ChevronDownIcon,{fontSize:"tiny"}),...(0,bi.bindTrigger)(g),fullWidth:!0,disabled:u,"aria-label":i,sx:v?{"& .MuiTag-label":{color:r=>r.palette.text.tertiary},textTransform:"capitalize"}:void 0})),mi.createElement(bi.Popover,{disablePortal:!0,disableScrollLock:!0,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{my:1.5},...(0,bi.bindPopover)(g)},mi.createElement(ItemSelector,{id:"font-family-selector",itemsList:b,selectedItem:a,onItemChange:c,onClose:g.close,sectionWidth:o,title:(0,ki.__)("Font family","elementor"),itemStyle:r=>({fontFamily:r.value}),onDebounce:enqueueFont,icon:yi.TextIcon})))}),Oi=__toESM(i(97557)),Pi=i(2020),Ai=i(79513),Mi=createControl(({placeholder:r,ariaLabel:o})=>{const{value:i,setValue:a,disabled:c,placeholder:u}=useBoundProp(Pi.urlPropTypeUtil),p=r??u??void 0;return Oi.createElement(ControlActions,null,Oi.createElement(Ai.TextField,{size:"tiny",fullWidth:!0,value:i??"",disabled:c,onChange:r=>a(r.target.value),placeholder:p,inputProps:{...o?{"aria-label":o}:{}}}))}),Ni=__toESM(i(97557)),Ri=i(97557),Ii=i(70975),Di=i(2020),Li=i(5527),Fi=i(24413),zi=i(78187),ji=i(79513),Bi=i(22444),Vi=i(27723),$i=__toESM(i(97557)),Ui=i(70975),Hi=i(24413),Wi=i(79513),qi=i(27723),Ki={label:(0,qi.__)("Learn More","elementor"),href:"https://go.elementor.com/element-link-inside-link-infotip"},Gi={descendant:(0,qi.__)("To add a link or action to this element, first remove the link or action from the elements inside of it.","elementor"),ancestor:(0,qi.__)("To add a link or action to this container, first remove the link or action from its parent container.","elementor")};var RestrictedLinkInfotip=({linkInLinkRestriction:r,isVisible:o,children:i})=>{const{shouldRestrict:a,reason:c,elementId:u}=r,p=!(!u||!function isTargetInCurrentDocument(r){if(!r)return!1;const o=(0,Ui.getContainer)(r)?.view?.el;if(!o)return!1;const i=o.closest("[data-elementor-id]")?.getAttribute("data-elementor-id"),a=String((0,Ui.getCurrentDocumentId)()??"");return!(!i||!a||i!==a)}(u)),g=$i.createElement(Wi.Alert,{color:"secondary",icon:$i.createElement(Hi.InfoCircleFilledIcon,null),size:"small",action:p?$i.createElement(Wi.AlertAction,{sx:{width:"fit-content"},variant:"contained",color:"secondary",onClick:()=>{u&&(0,Ui.selectElement)(u)}},(0,qi.__)("Take me there","elementor")):void 0},$i.createElement(Wi.AlertTitle,null,(0,qi.__)("Nested links","elementor")),$i.createElement(Wi.Box,{component:"span"},Gi[c??"descendant"]," ",$i.createElement(Wi.Link,{href:Ki.href,target:"_blank",color:"info.main"},Ki.label)));return a&&o?$i.createElement(Wi.Infotip,{placement:"right",content:g,color:"secondary",slotProps:{popper:{sx:{width:300}}}},$i.createElement(Wi.Box,null,i)):$i.createElement($i.Fragment,null,i)},Ji=__toESM(i(97557)),Yi=i(2020),Xi=i(24413),Qi=i(27723),Zi=__toESM(i(97557)),ea=i(97557),na=i(24413),ra=i(79513),oa=(0,ea.forwardRef)((r,o)=>{const{options:i,onOptionChange:a,onTextChange:c,allowCustomValues:u=!1,placeholder:p="",minInputLength:g=2,value:v="",startAdornment:b,disablePortal:k=!0,inputProps:E,...w}=r,x=function factoryFilter(r,o,i){if(null===r)return o;const a=String(r||"")?.toLowerCase();if(a.length<i)return new Array(0);return o.filter(r=>String(r.id).toLowerCase().includes(a)||r.label.toLowerCase().includes(a))}(v,i,g).map(({id:r})=>r),C=!!v,_=u||!!v?.toString()?.length?void 0:()=>!0,T="number"==typeof v&&!!findMatchingOption(i,v),P=(v?.toString()?.length??0)>=g&&(!u||x.length>0);return Zi.createElement(ra.Autocomplete,{...w,ref:o,forcePopupIcon:!1,disablePortal:k,disableClearable:!0,freeSolo:u,openOnFocus:!1,open:P,value:v?.toString()||"",size:"tiny",onChange:(r,o)=>a(Number(o)),readOnly:T,options:x,getOptionKey:r=>findMatchingOption(i,r)?.id||r,getOptionLabel:r=>findMatchingOption(i,r)?.label||r.toString(),groupBy:isCategorizedOptionPool(i)?r=>findMatchingOption(i,r)?.groupLabel||r:void 0,isOptionEqualToValue:_,filterOptions:()=>x,renderOption:(r,o)=>Zi.createElement(ra.Box,{component:"li",...r,key:r.id},findMatchingOption(i,o)?.label??o),renderInput:r=>Zi.createElement(TextInput,{params:r,handleChange:r=>c?.(r),allowClear:C,placeholder:p,hasSelectedValue:T,startAdornment:b,extraInputProps:E})})}),TextInput=({params:r,allowClear:o,placeholder:i,handleChange:a,hasSelectedValue:c,startAdornment:u,extraInputProps:p})=>Zi.createElement(ra.TextField,{...r,placeholder:i,onChange:r=>{a(r.target.value)},inputProps:{...r.inputProps??{},...p??{}},sx:{"& .MuiInputBase-input":{cursor:c?"default":void 0}},InputProps:{...r.InputProps,startAdornment:u||r.InputProps.startAdornment,endAdornment:Zi.createElement(ClearButton,{params:r,allowClear:o,handleChange:a})}}),ClearButton=({allowClear:r,handleChange:o,params:i})=>Zi.createElement(ra.InputAdornment,{position:"end"},r&&Zi.createElement(ra.IconButton,{size:i.size,onClick:()=>o(null),sx:{cursor:"pointer"}},Zi.createElement(na.XIcon,{fontSize:i.size})));function findMatchingOption(r,o=null){const i=(o||"").toString();return r.find(({id:r})=>i===r.toString())}function isCategorizedOptionPool(r){if(r.length<=1)return!1;return new Set(r.map(r=>r.groupLabel)).size>1}var ia=i(97557),aa=i(2020),sa=i(18998),la=i(22444);function useQueryAutocomplete({url:r,params:o={},minInputLength:i=2,initialQueryValue:a=null,excludeIds:c}){const u=(0,ia.useMemo)(()=>new Set((c??[]).map(String)),[c]),[p,g]=(0,ia.useState)(function generateFirstLoadedOption(r){const o=extractFlatOptionFromQueryValue(r);return o?[o]:[]}(a)),v=(0,ia.useMemo)(()=>(0,la.debounce)(o=>fetchOptions(r,o).then(r=>{g(formatOptions(filterExcludedOptions(r,u)))}),400),[r,u]);(0,ia.useEffect)(()=>{0===i&&r&&fetchOptions(r,{...o,term:""}).then(r=>{g(formatOptions(filterExcludedOptions(r,u)))})},[r,i,u,o]);return{options:p,updateOptions:a=>{const c=a??"";!r||c.length<i||v({...o,term:c})}}}async function fetchOptions(r,o){if(!o||!r)return[];try{const{data:i}=await(0,sa.httpService)().get(r,{params:o});return i.data.value}catch{return[]}}function formatOptions(r){const o=isCategorizedOptionPool(r)?"groupLabel":"label";return r.sort((r,i)=>r[o]&&i[o]?r[o].localeCompare(i[o]):0)}function filterExcludedOptions(r,o){return 0===o.size?r:r.filter(r=>!o.has(String(r.id)))}function extractFlatOptionFromQueryValue(r){const o=aa.numberPropTypeUtil.extract(r?.id),i=aa.stringPropTypeUtil.extract(r?.label);return null===o?null:{id:String(o),label:i||String(o)}}var ca=createControl(r=>{const{value:o,setValue:i}=useBoundProp(Yi.queryPropTypeUtil),{value:a,setValue:c,placeholder:u}=useBoundProp(Yi.urlPropTypeUtil),{allowCustomValues:p=!0,queryOptions:{url:g,params:v={}},placeholder:b=(0,Qi.__)("Search","elementor"),minInputLength:k=2,onSetValue:E,ariaLabel:w}=r||{},{options:x,updateOptions:C}=useQueryAutocomplete({url:g,params:v,minInputLength:k,initialQueryValue:o}),_=o?.id?.value??a;return Ji.createElement(ControlActions,null,Ji.createElement(oa,{options:x,allowCustomValues:p,placeholder:u??b,startAdornment:Ji.createElement(Xi.SearchIcon,{fontSize:"tiny"}),value:_,onOptionChange:r=>{if(null===r)return i(null),void E?.(null);const o={id:Yi.numberPropTypeUtil.create(r),label:Yi.stringPropTypeUtil.create(findMatchingOption(x,r)?.label||null)};i(o),E?.(Yi.queryPropTypeUtil.create(o))},onTextChange:r=>{const o=r?.trim()||"";if(!o)return c(null),void E?.(null);c(o),E?.(Yi.urlPropTypeUtil.create(o)),C(r)},minInputLength:k,disablePortal:!1,inputProps:{...w?{"aria-label":w}:{}}}))}),ua=__toESM(i(97557)),pa=i(2020),da=i(79513),fa=createControl(()=>{const{value:r,setValue:o,disabled:i,placeholder:a}=useBoundProp(pa.booleanPropTypeUtil);return ua.createElement(da.Box,{sx:{display:"flex",justifyContent:"flex-end"}},ua.createElement(da.Switch,{checked:!(!r&&!a),onChange:r=>{o(r.target.checked)},size:"small",disabled:i,inputProps:{...i?{style:{opacity:0}}:{}}}))}),ha="tiny",ma=createControl(r=>{const{value:o,path:i,setValue:a,...c}=useBoundProp(Di.linkPropTypeUtil),u=c.placeholder,[p,g]=(0,zi.useSessionStorage)(i.join("/")),[v,b]=(0,Ri.useState)(!!o||!!u),{allowCustomValues:k=!0,queryOptions:E,placeholder:w,minInputLength:x=2,context:{elementId:C},label:_=(0,Vi.__)("Link","elementor"),ariaLabel:T}=r||{},[P,A]=(0,Ri.useState)((0,Ii.getLinkInLinkRestriction)(C,o??u)),N=!v&&P.shouldRestrict,R=(0,Bi.useDebouncedCallback)(()=>{const r=(0,Ii.getLinkInLinkRestriction)(C,o??u);r.shouldRestrict&&v&&!u&&(b(!1),null!==o&&a(null)),A(o=>function isSameRestriction(r,o){return r.shouldRestrict===o.shouldRestrict&&r.reason===o.reason&&r.elementId===o.elementId}(o,r)?o:r)},300);(0,Li.__privateUseListenTo)((0,Li.commandEndEvent)("document/elements/set-settings"),()=>{R()},[R]),(0,Ri.useEffect)(()=>{R();const handleInlineLinkChanged=()=>{R()};return window.addEventListener("elementor:inline-link-changed",handleInlineLinkChanged),()=>{window.removeEventListener("elementor:inline-link-changed",handleInlineLinkChanged)}},[C,R]);return Ni.createElement(PropProvider,{...c,value:o,setValue:a},Ni.createElement(ji.Stack,{gap:1.5},Ni.createElement(ji.Stack,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center",marginInlineEnd:-.75}},Ni.createElement(ControlLabel,null,_),Ni.createElement(RestrictedLinkInfotip,{isVisible:!v,linkInLinkRestriction:P},Ni.createElement(ji.IconButton,{size:ha,onClick:()=>{if(A((0,Ii.getLinkInLinkRestriction)(C,o??u)),P.shouldRestrict&&!v)return;const r=!v;b(r),r||null===o||a(null),r&&p?.value&&a(p.value),g({value:p?.value,meta:{isEnabled:r}})},"aria-label":(0,Vi.__)("Toggle link","elementor"),disabled:N},v?Ni.createElement(Fi.MinusIcon,{fontSize:ha}):Ni.createElement(Fi.PlusIcon,{fontSize:ha})))),Ni.createElement(ji.Collapse,{in:v,timeout:"auto",unmountOnExit:!0},Ni.createElement(ji.Stack,{gap:1.5},Ni.createElement(PropKeyProvider,{bind:"destination"},Ni.createElement(ca,{queryOptions:E,allowCustomValues:k,minInputLength:x,placeholder:w,onSetValue:r=>{const i=r?{...o,destination:r}:null;g({...p,value:i})},ariaLabel:T||_})),Ni.createElement(PropKeyProvider,{bind:"isTargetBlank"},Ni.createElement(ji.Grid,{container:!0,alignItems:"center",flexWrap:"nowrap",justifyContent:"space-between"},Ni.createElement(ji.Grid,{item:!0},Ni.createElement(ControlFormLabel,null,(0,Vi.__)("Open in a new tab","elementor"))),Ni.createElement(ji.Grid,{item:!0,sx:{marginInlineEnd:-1}},Ni.createElement(fa,null))))))))});var ga=__toESM(i(97557)),va=i(70975),ya=i(2020),ba=i(70374),ka=i(79513),Ea=i(27723),Sa=__toESM(i(97557)),wa=i(70374),xa=i(79513),Ca=i(79513),_a="secondary",Ta=Sa.forwardRef(({children:r,title:o,description:i,alertProps:a,infotipProps:c,...u},p)=>{const g="rtl"===(0,xa.useTheme)().direction,v=u.isEnabled&&(o||i);return Sa.createElement(xa.Box,{ref:p},v?Sa.createElement(Ca.DirectionProvider,{rtl:g},Sa.createElement(xa.Infotip,{placement:"right",color:_a,slotProps:{popper:{modifiers:[{name:"offset",options:{offset:[0,10]}}]}},...c,content:Sa.createElement(wa.InfoAlert,{color:_a,sx:{width:300,px:1.5,py:2},...a},Sa.createElement(xa.Box,{sx:{flexDirection:"column",display:"flex",gap:.5}},Sa.createElement(xa.AlertTitle,null,o),Sa.createElement(xa.Box,null,i)))},r)):r)}),Oa=(0,ka.styled)(ka.Select)(()=>({".MuiSelect-select.Mui-disabled":{cursor:"not-allowed"}})),Pa=createControl(r=>{const{options:o,onChange:i,fallbackLabels:a={},context:{elementId:c}}=r,{value:u,setValue:p,disabled:g,placeholder:v}=useBoundProp(ya.stringPropTypeUtil),b=(0,va.getElementLabel)(c)??"element",k={title:(0,Ea.__)("HTML Tag","elementor"),description:(0,Ea.__)("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",b),isEnabled:!!g},findOptionByValue=r=>o.find(o=>o.value===r);return ga.createElement(ControlActions,null,ga.createElement(Ta,{...k},ga.createElement(Oa,{sx:{overflow:"hidden",cursor:g?"not-allowed":void 0},displayEmpty:!0,size:"tiny",renderValue:r=>{if(r)return findOptionByValue(r)?.label||a[r]||r;if(!v)return"";const o=findOptionByValue(v),i=o?.label||v;return ga.createElement(ka.Typography,{component:"span",variant:"caption",color:"text.tertiary"},i)},value:u??"",onChange:r=>{const o=r.target.value||null;i?.(o,u),p(o)},disabled:g,fullWidth:!0},o.map(({label:r,...o})=>ga.createElement(ba.MenuListItem,{key:o.value,...o,value:o.value??""},r)))))}),Aa=__toESM(i(97557)),Ma=i(97557),Na=i(2020),Ra=i(79513),Ia=i(27723),Da=(0,Na.createArrayPropUtils)(Na.queryPropTypeUtil.key,Na.queryPropTypeUtil.schema),La=createControl(r=>{const{queryOptions:o,placeholder:i,minInputLength:a=2}=r,{value:c,setValue:u,disabled:p}=useBoundProp(Da),g=(0,Ma.useMemo)(()=>function extractChips(r){if(!r)return[];return r.map(r=>extractFlatOptionFromQueryValue(r?.value)).filter(r=>null!==r)}(c),[c]),v=(0,Ma.useMemo)(()=>g.map(r=>Number(r.id)).filter(r=>Number.isFinite(r)),[g]),{options:b,updateOptions:k}=useQueryAutocomplete({url:o.url,params:o.params,minInputLength:a,excludeIds:v});return Aa.createElement(ControlActions,null,Aa.createElement(Ra.Autocomplete,{multiple:!0,fullWidth:!0,disableClearable:!0,forcePopupIcon:!1,disabled:p,size:"tiny",value:g,options:b,onChange:(r,o)=>{u(o.map(r=>Na.queryPropTypeUtil.create({id:Na.numberPropTypeUtil.create(Number(r.id)),label:Na.stringPropTypeUtil.create(r.label)})))},onInputChange:(r,o)=>{k(o||null)},getOptionLabel:r=>r.label,isOptionEqualToValue:(r,o)=>r.id===o.id,filterOptions:r=>r,renderTags:(r,o)=>Aa.createElement(ChipsList,{getLabel:r=>r.label,getTagProps:o,values:r}),renderInput:r=>Aa.createElement(Ra.TextField,{...r,placeholder:i??(0,Ia.__)("Search","elementor")})}))});var Fa=__toESM(i(97557)),za=i(97557),ja=i(70975),Ba=i(2020),Va=i(24413),$a=i(79513),Ua=i(27723),Ha=createControl(({allowedKeys:r,keyConfig:o,label:i=(0,Ua.__)("Filter","elementor"),chipsPlaceholder:a})=>{const{propType:c,value:u,setValue:p}=useBoundProp(Ba.queryFilterArrayPropTypeUtil),{settings:g}=(0,ja.useSelectedElementSettings)(),v=(0,za.useMemo)(()=>r.filter(r=>function isKeyVisible(r,o){if(!r)return!0;if(!o)return!1;const i=Ba.stringPropTypeUtil.extract((0,Ba.extractValue)(r.path,o));return null!==i&&r.in.includes(i)}(o[r]?.visibleWhen,g)),[r,o,g]),b=(0,za.useMemo)(()=>function getUsedKeys(r){const o=r.map(r=>Ba.stringPropTypeUtil.extract(r?.value?.key)).filter(r=>!!r);return new Set(o)}(u??[]),[u]),k=(0,za.useMemo)(()=>v.find(r=>!b.has(r))??null,[v,b]),E=(0,za.useMemo)(()=>r=>v.map(i=>({value:i,label:o[i]?.label??i,disabled:i!==r&&b.has(i)})),[v,o,b]),w=(0,za.useMemo)(()=>createItemForKey(v[0]??""),[v]);return Fa.createElement(PropProvider,{propType:c,value:u,setValue:p},Fa.createElement(ControlRepeater,{initial:w,propTypeUtil:Ba.queryFilterArrayPropTypeUtil},Fa.createElement(sr,{label:i},Fa.createElement(AddFilterItemAction,{nextAvailableKey:k,ariaLabel:i})),Fa.createElement(ItemsContainer,{isSortable:!1},Fa.createElement(Item,{Icon:EmptyIcon,actions:Fa.createElement(RemoveItemAction,null),Label:({value:r})=>Fa.createElement(ItemLabel2,{value:r,keyConfig:o})})),Fa.createElement(EditItemPopover,null,Fa.createElement(ItemContent,{keyConfig:o,getKeySelectOptions:E,chipsPlaceholder:a}))))}),AddFilterItemAction=({nextAvailableKey:r,ariaLabel:o})=>{const{addItem:i}=useRepeaterContext(),a=null===r;return Fa.createElement($a.Box,{component:"span",sx:{cursor:a?"not-allowed":"pointer"}},Fa.createElement($a.IconButton,{size:"tiny",disabled:a,onClick:o=>{r&&i(o,{item:createItemForKey(r),index:0})},"aria-label":(0,Ua.sprintf)((0,Ua.__)("Add %s item","elementor"),o.toLowerCase())},Fa.createElement(Va.PlusIcon,{fontSize:"tiny"})))},EmptyIcon=()=>null,ItemLabel2=({value:r,keyConfig:o})=>{const i=Ba.stringPropTypeUtil.extract(r?.value?.key),a=i&&o[i]?.label||(0,Ua.__)("Item","elementor"),c=function extractChipLabels(r){return(r?.value??[]).map(r=>Ba.stringPropTypeUtil.extract(r?.value?.label)).filter(r=>!!r)}(r?.value?.values),u=[...c,...function extractTaxonomyLabels(r,o){const i=(Ba.stringArrayPropTypeUtil.extract(r)??[]).map(r=>Ba.stringPropTypeUtil.extract(r)).filter(r=>!!r);if(!i.length)return[];const a=o?.staticOptions??[];return i.map(r=>a.find(o=>o.value===r)?.label??r)}(r?.value?.taxonomies,i?o[i]:void 0)],p=u.length>0?`: ${u.join(", ")}`:"";return Fa.createElement($a.Box,{component:"span"},a,p)};var ItemContent=({keyConfig:r,getKeySelectOptions:o,chipsPlaceholder:i})=>{const a=useBoundProp(Ba.queryFilterPropTypeUtil),c=(0,za.useRef)({}),u=Ba.stringPropTypeUtil.extract(a.value?.key),p=u?r[u]:void 0,g=p?.valueType??"chips",v=(0,za.useMemo)(()=>o(u),[o,u]);return Fa.createElement(PopoverContent,{p:1.5},Fa.createElement(PropProvider,{...a,setValue:(r,o,i)=>{if("key"!==i?.bind)return void a.setValue(r,o,i);const u=Ba.stringPropTypeUtil.extract(a.value?.key),p=Ba.stringPropTypeUtil.extract(r?.key);u&&(c.current[u]={values:a.value?.values??null,taxonomies:a.value?.taxonomies??null});const g=p?c.current[p]:void 0;a.setValue({...r,values:g?.values??null,taxonomies:g?.taxonomies??null},o,i)}},Fa.createElement(rr,{flexWrap:"wrap"},Fa.createElement($a.Grid,{item:!0,xs:12},Fa.createElement(ControlFormLabel,null,(0,Ua.__)("Type","elementor"))),Fa.createElement($a.Grid,{item:!0,xs:12},Fa.createElement(PropKeyProvider,{bind:"key"},Fa.createElement(_e,{options:v})))),"taxonomies"===g&&p?.staticOptions&&Fa.createElement(rr,{flexWrap:"wrap"},Fa.createElement($a.Grid,{item:!0,xs:12},Fa.createElement(ControlFormLabel,null,p.label)),Fa.createElement($a.Grid,{item:!0,xs:12},Fa.createElement(PropKeyProvider,{bind:"taxonomies"},Fa.createElement(oo,{options:p.staticOptions})))),"taxonomies"!==g&&p?.queryEndpoint&&Fa.createElement(rr,{flexWrap:"wrap"},Fa.createElement($a.Grid,{item:!0,xs:12},Fa.createElement(ControlFormLabel,null,p.label)),Fa.createElement($a.Grid,{item:!0,xs:12},Fa.createElement(PropKeyProvider,{bind:"values"},Fa.createElement(La,{queryOptions:{url:p.queryEndpoint.url,params:p.queryEndpoint.params??{}},placeholder:p.chipsPlaceholder??i}))))))};function createItemForKey(r){return Ba.queryFilterPropTypeUtil.create({key:Ba.stringPropTypeUtil.create(r),values:null,taxonomies:null})}var Wa=__toESM(i(97557)),qa=i(97557),Ka=i(2020),Ga=i(74518),Ja=i(24413),Ya=i(79513),Xa=i(27723),GapControl=({label:r})=>{const o=(0,qa.useRef)(null),{disabled:i}=useBoundProp(Ka.sizePropTypeUtil),{value:a,setValue:c,propType:u,placeholder:p,disabled:g}=useBoundProp(Ka.layoutDirectionPropTypeUtil),{value:v,setValue:b,placeholder:k}=useBoundProp(),inferIsLinked=()=>!Ka.layoutDirectionPropTypeUtil.isValid(v)&&!(!v&&Ka.layoutDirectionPropTypeUtil.isValid(k)),[E,w]=(0,qa.useState)(()=>inferIsLinked()),x=Ka.layoutDirectionPropTypeUtil.isValid(v??k),C=(0,Ga.useActiveBreakpoint)();(0,qa.useLayoutEffect)(()=>{w(inferIsLinked())},[C,x]);const _=r.toLowerCase(),T=E?Ja.LinkIcon:Ja.DetachIcon,P=(0,Xa.__)("Link %s","elementor").replace("%s",_),A=(0,Xa.__)("Unlink %s","elementor").replace("%s",_),N=i||g,R={propType:u,value:a??(E?null:{row:p?.row,column:p?.column}),setValue:r=>{const o=Object.entries(r).filter(([,r])=>Boolean(r));c(0===o.length?null:Object.fromEntries(o))},placeholder:p},I=!v&&(p||k),getEffectivePlaceholder=r=>{if(E){const r=p?.column??p?.row;return Ka.sizePropTypeUtil.extract(r)}return Ka.sizePropTypeUtil.extract(p?.[r])};return Wa.createElement(PropProvider,{...R},Wa.createElement(Ya.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},Wa.createElement(ControlLabel,null,r),Wa.createElement(Ya.Tooltip,{title:E?A:P,placement:"top"},Wa.createElement(mo,{"aria-label":E?A:P,size:"tiny",value:"check",selected:E,sx:{marginLeft:"auto"},onChange:()=>{if(w(r=>!r),!Ka.layoutDirectionPropTypeUtil.isValid(v)){const r=v||null;return r?void b(Ka.layoutDirectionPropTypeUtil.create({row:r,column:r})):void b(null)}b(a?.column??a?.row??null)},disabled:N,isPlaceholder:I},Wa.createElement(T,{fontSize:"tiny"})))),Wa.createElement(Ya.Stack,{direction:"row",gap:2,flexWrap:"nowrap",ref:o},Wa.createElement(Ya.Grid,{container:!0,gap:.75,alignItems:"center"},Wa.createElement(Ya.Grid,{item:!0,xs:12},Wa.createElement(ControlFormLabel,null,(0,Xa.__)("Column","elementor"))),Wa.createElement(Ya.Grid,{item:!0,xs:12},Wa.createElement(Control4,{bind:"column",ariaLabel:(0,Xa.__)("Column gap","elementor"),isLinked:E,anchorRef:o,placeholder:getEffectivePlaceholder("column")??void 0}))),Wa.createElement(Ya.Grid,{container:!0,gap:.75,alignItems:"center"},Wa.createElement(Ya.Grid,{item:!0,xs:12},Wa.createElement(ControlFormLabel,null,(0,Xa.__)("Row","elementor"))),Wa.createElement(Ya.Grid,{item:!0,xs:12},Wa.createElement(Control4,{bind:"row",ariaLabel:(0,Xa.__)("Row gap","elementor"),isLinked:E,anchorRef:o,placeholder:getEffectivePlaceholder("row")??void 0})))))},Control4=({bind:r,ariaLabel:o,isLinked:i,anchorRef:a,placeholder:c})=>i?Wa.createElement(hi,{anchorRef:a,placeholder:c,ariaLabel:o}):Wa.createElement(PropKeyProvider,{bind:r},Wa.createElement(hi,{anchorRef:a,placeholder:c,ariaLabel:o})),Qa=__toESM(i(97557)),Za=i(97557),es=i(2020),ns=i(70374),rs=i(24413),os=i(79513),as=i(27723),ss=[{label:(0,as.__)("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"}],ls="custom",cs=createControl(({label:r})=>{const{value:o,setValue:i,disabled:a,placeholder:c}=useBoundProp(es.stringPropTypeUtil),u=o??c,p=u&&!ss.some(r=>r.value===u),[g,v]=p?u.split("/"):["",""],[b,k]=(0,Za.useState)(p),[E,w]=(0,Za.useState)(g),[x,C]=(0,Za.useState)(v),[_,T]=(0,Za.useState)(p?ls:u||"");(0,Za.useEffect)(()=>{if(u&&!ss.some(r=>r.value===u)){const[r,o]=u.split("/");w(r||""),C(o||""),T(ls),k(!0)}else T(u||""),k(!1),w(""),C("")},[u]);const P=o??c,A=ss.find(r=>r.value===P);return Qa.createElement(ControlActions,null,Qa.createElement(os.Stack,{direction:"column",gap:2},Qa.createElement(os.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},Qa.createElement(os.Grid,{item:!0,xs:6},Qa.createElement(ControlLabel,null,r)),Qa.createElement(os.Grid,{item:!0,xs:6},Qa.createElement(os.Select,{size:"tiny",displayEmpty:!0,sx:{overflow:"hidden"},disabled:a,value:_,onChange:r=>{const o=r.target.value,a=o===ls;k(a),T(o),a||i(o)},renderValue:p?void 0:()=>A?.label,fullWidth:!0},[...ss,{label:(0,as.__)("Custom","elementor"),value:ls}].map(({label:r,...o})=>Qa.createElement(ns.MenuListItem,{key:o.value,...o,value:o.value??""},r))))),b&&Qa.createElement(os.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},Qa.createElement(os.Grid,{item:!0,xs:6},Qa.createElement(os.TextField,{size:"tiny",type:"number",fullWidth:!0,disabled:a,value:E,onChange:r=>{const o=r.target.value;w(o),o&&x&&i(`${o}/${x}`)},InputProps:{startAdornment:Qa.createElement(rs.ArrowsMoveHorizontalIcon,{fontSize:"tiny"})}})),Qa.createElement(os.Grid,{item:!0,xs:6},Qa.createElement(os.TextField,{size:"tiny",type:"number",fullWidth:!0,disabled:a,value:x,onChange:r=>{const o=r.target.value;C(o),E&&o&&i(`${E}/${o}`)},InputProps:{startAdornment:Qa.createElement(rs.ArrowsMoveVerticalIcon,{fontSize:"tiny"})}})))))}),us=__toESM(i(97557)),ps=i(97557),ds=i(46400),fs=i(2020),hs=i(24413),ms=i(79513),gs=i(84792),vs=i(27723),ys=__toESM(i(97557)),bs=i(97557),ks=i(79513),Es=i(27723),Ss=(0,Es.__)("Enable Unfiltered Uploads","elementor"),ws=(0,Es.__)("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"),xs=(0,Es.__)("Failed to enable unfiltered files upload.","elementor"),Cs=(0,Es.__)("You can try again, if the problem persists, please contact support.","elementor"),EnableUnfilteredModal=r=>{const{mutateAsync:o,isPending:i}=function useUpdateUnfilteredFilesUpload(){const r=(0,oe.useQueryClient)();return(0,oe.useMutation)({mutationFn:({allowUnfilteredFilesUpload:r})=>apiClient_updateElementorSetting(se,r?"1":"0"),onSuccess:()=>r.invalidateQueries(le)})}(),[a,c]=(0,bs.useState)(!1),u={...r,isPending:i,handleEnable:async()=>{try{const i=await o({allowUnfilteredFilesUpload:!0});!1===i?.data?.success?c(!0):r.onClose(!0)}catch{c(!0)}},isError:a,onClose:o=>{r.onClose(o),setTimeout(()=>c(!1),300)}};return ys.createElement(AdminDialog,{...u})},AdminDialog=({open:r,onClose:o,handleEnable:i,isPending:a,isError:c})=>ys.createElement(ks.Dialog,{open:r,maxWidth:"sm",onClose:()=>o(!1)},ys.createElement(ks.DialogHeader,{logo:!1},ys.createElement(ks.DialogTitle,null,Ss)),ys.createElement(ks.Divider,null),ys.createElement(ks.DialogContent,null,ys.createElement(ks.DialogContentText,null,c?ys.createElement(ys.Fragment,null,xs," ",ys.createElement("br",null)," ",Cs):ws)),ys.createElement(ks.DialogActions,null,ys.createElement(ks.Button,{size:"medium",color:"secondary",onClick:()=>o(!1)},(0,Es.__)("Cancel","elementor")),ys.createElement(ks.Button,{size:"medium",onClick:()=>i(),variant:"contained",color:"primary",disabled:a},a?ys.createElement(ks.CircularProgress,{size:24}):(0,Es.__)("Enable","elementor")))),_s="transparent",Ts="#c1c1c1",Os=`linear-gradient(45deg, ${Ts} 25%, ${_s} 0, ${_s} 75%, ${Ts} 0, ${Ts})`,Ps=(0,ms.styled)(ms.Card)` | |
| 60 | +`,$o=(0,i.styled)(i.ToggleButton,{shouldForwardProp:e=>"isPlaceholder"!==e})` | |
| 61 | + ${({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`} | |
| 62 | +`,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)` | |
| 63 | 63 | background-color: white; |
| 64 | 64 | background-image: ${Os}, ${Os}; |
| 65 | 65 | background-size: ${8}px ${8}px; |
| 66 | 66 | background-position: |
| @@ -66,9 +66,9 @@ | ||
| 66 | 66 | background-position: |
| 67 | 67 | 0 0, |
| 68 | 68 | ${4}px ${4}px; |
| 69 | 69 | border: none; |
| 70 | -`,As=(0,ms.styled)(ms.Stack)` | |
| 70 | +`,Ms=(0,i.styled)(i.Stack)` | |
| 71 | 71 | position: relative; |
| 72 | 72 | height: 140px; |
| 73 | 73 | object-fit: contain; |
| 74 | 74 | padding: 5px; |
| @@ -74,5 +74,5 @@ | ||
| 74 | 74 | padding: 5px; |
| 75 | 75 | justify-content: center; |
| 76 | 76 | align-items: center; |
| 77 | 77 | background-color: rgba( 255, 255, 255, 0.37 ); |
| 78 | -`,Ms={mode:"browse"},Ns={mode:"upload"},Rs=createControl(()=>{const{value:r,setValue:o}=useBoundProp(fs.svgSrcPropTypeUtil),i=r?.id,a=r?.url,{data:c,isFetching:u}=(0,gs.useWpMediaAttachment)(i?.value||null),p=c?.url??a?.value??null,{data:g}=useUnfilteredFilesUpload(),[v,b]=(0,ps.useState)(!1),{isAdmin:k}=(0,ds.useCurrentUserCapabilities)(),{open:E}=(0,gs.useWpMediaFrame)({mediaTypes:["svg"],multiple:!1,selected:i?.value||null,onSelect:r=>{o({id:{$$type:"image-attachment-id",value:r.id},url:fs.urlPropTypeUtil.create(r.url)})}}),handleClick=r=>{g||r!==Ns?E(r):b(!0)},w={title:(0,vs.__)("Sorry, you can't upload that file yet.","elementor"),description:us.createElement(us.Fragment,null,(0,vs.__)("To upload them anyway, ask the site administrator to enable unfiltered","elementor"),us.createElement("br",null),(0,vs.__)("file uploads.","elementor")),isEnabled:!k};return us.createElement(ms.Stack,{gap:1,"aria-label":"SVG Control"},us.createElement(EnableUnfilteredModal,{open:v,onClose:r=>{b(!1),r&&E(Ns)}}),us.createElement(ControlActions,null,us.createElement(Ps,{variant:"outlined"},us.createElement(As,null,u?us.createElement(ms.CircularProgress,{role:"progressbar"}):us.createElement(ms.CardMedia,{component:"img",image:p,alt:(0,vs.__)("Preview SVG","elementor"),sx:{maxHeight:"140px",width:"50px"}})),us.createElement(ms.CardOverlay,{sx:{"&:hover":{backgroundColor:"rgba( 0, 0, 0, 0.75 )"}}},us.createElement(ms.Stack,{gap:1},us.createElement(ms.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>handleClick(Ms),"aria-label":"Select SVG"},(0,vs.__)("Select SVG","elementor")),us.createElement(Ta,{...w},us.createElement("span",null,us.createElement(ms.ThemeProvider,{colorScheme:k?"light":"dark"},us.createElement(ms.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:us.createElement(hs.UploadIcon,null),disabled:!k,onClick:()=>k&&handleClick(Ns),"aria-label":"Upload SVG"},(0,vs.__)("Upload","elementor"))))))))))}),Is=__toESM(i(97557)),Ds=i(2020),Ls=i(24413),Fs=i(79513),zs=i(84792),js=i(27723),Bs=window.elementorCommon?.config?.urls?.assets+"/shapes/play-triangle.svg",Vs=createControl(()=>{const{value:r,setValue:o}=useBoundProp(Ds.videoSrcPropTypeUtil),{id:i,url:a}=r??{},{data:c,isFetching:u}=(0,zs.useWpMediaAttachment)(i?.value||null),p=c?.url??a?.value??null,{open:g}=(0,zs.useWpMediaFrame)({mediaTypes:["video"],multiple:!1,selected:i?.value||null,onSelect:r=>{o({id:{$$type:"video-attachment-id",value:r.id},url:null})}});return Is.createElement(ControlActions,null,Is.createElement(Fs.Card,{variant:"outlined"},Is.createElement(Fs.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"}},Is.createElement(VideoPreview,{isFetching:u,videoUrl:p})),Is.createElement(Fs.CardOverlay,null,Is.createElement(Fs.Stack,{gap:1},Is.createElement(Fs.Button,{size:"tiny",color:"inherit",variant:"outlined",onClick:()=>g({mode:"browse"})},(0,js.__)("Select video","elementor")),Is.createElement(Fs.Button,{size:"tiny",variant:"text",color:"inherit",startIcon:Is.createElement(Ls.UploadIcon,null),onClick:()=>g({mode:"upload"})},(0,js.__)("Upload","elementor"))))))}),VideoPreview=({isFetching:r=!1,videoUrl:o})=>r?Is.createElement(Fs.CircularProgress,null):o?Is.createElement("video",{src:o,muted:!0,preload:"metadata",style:{width:"100%",height:"100%",objectFit:"cover",pointerEvents:"none"}}):Is.createElement("img",{src:Bs,alt:"No video selected"}),$s=__toESM(i(97557)),Us=i(2020),Hs=i(79513),Ws=i(27723),qs=__toESM(i(97557)),Ks=i(2020),Gs=i(79513),Js=i(84792),Ys=i(27723),Xs=i(78806),{env:Qs}=(0,Xs.parseEnv)("@elementor/editor-controls"),Zs=__toESM(i(97557)),el=i(2020),tl=i(79513),nl=createControl(()=>{const{value:r,setValue:o}=useBoundProp(el.backgroundGradientOverlayPropTypeUtil),createTransformableValue=r=>({...r,type:el.stringPropTypeUtil.create(r.type),angle:el.numberPropTypeUtil.create(r.angle),stops:el.gradientColorStopPropTypeUtil.create(r.stops.map(({color:r,offset:o})=>el.colorStopPropTypeUtil.create({color:el.colorPropTypeUtil.create(r),offset:el.numberPropTypeUtil.create(o)})))});return Zs.createElement(tl.UnstableGradientBox,{sx:{width:"auto",padding:1.5},value:(()=>{if(!r)return;const{type:o,angle:i,stops:a,positions:c}=r;return{type:o.value,angle:i?.value||0,stops:a.value.map(({value:{color:r,offset:o}})=>({color:r.value,offset:o.value})),positions:c?.value.split(" ")}})(),onChange:r=>{const i=createTransformableValue(r);i.positions&&(i.positions=el.stringPropTypeUtil.create(r.positions.join(" "))),o(i)}})}),rl=el.backgroundGradientOverlayPropTypeUtil.create({type:el.stringPropTypeUtil.create("linear"),angle:el.numberPropTypeUtil.create(180),stops:el.gradientColorStopPropTypeUtil.create([el.colorStopPropTypeUtil.create({color:el.colorPropTypeUtil.create("rgb(0,0,0)"),offset:el.numberPropTypeUtil.create(0)}),el.colorStopPropTypeUtil.create({color:el.colorPropTypeUtil.create("rgb(255,255,255)"),offset:el.numberPropTypeUtil.create(100)})])}),ol=__toESM(i(97557)),il=i(24413),al=i(79513),sl=i(27723),ll=[{value:"fixed",label:(0,sl.__)("Fixed","elementor"),renderContent:({size:r})=>ol.createElement(il.PinIcon,{fontSize:r}),showTooltip:!0},{value:"scroll",label:(0,sl.__)("Scroll","elementor"),renderContent:({size:r})=>ol.createElement(il.PinnedOffIcon,{fontSize:r}),showTooltip:!0}],BackgroundImageOverlayAttachment=()=>ol.createElement(rr,null,ol.createElement(al.Grid,{item:!0,xs:6},ol.createElement(ControlFormLabel,null,(0,sl.__)("Attachment","elementor"))),ol.createElement(al.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end",overflow:"hidden"}},ol.createElement(bo,{options:ll}))),cl=__toESM(i(97557)),ul=i(97557),pl=i(2020),dl=i(70374),fl=i(24413),hl=i(79513),ml=i(27723),gl=[{label:(0,ml.__)("Center center","elementor"),value:"center center"},{label:(0,ml.__)("Center left","elementor"),value:"center left"},{label:(0,ml.__)("Center right","elementor"),value:"center right"},{label:(0,ml.__)("Top center","elementor"),value:"top center"},{label:(0,ml.__)("Top left","elementor"),value:"top left"},{label:(0,ml.__)("Top right","elementor"),value:"top right"},{label:(0,ml.__)("Bottom center","elementor"),value:"bottom center"},{label:(0,ml.__)("Bottom left","elementor"),value:"bottom left"},{label:(0,ml.__)("Bottom right","elementor"),value:"bottom right"},{label:(0,ml.__)("Custom","elementor"),value:"custom"}],BackgroundImageOverlayPosition=()=>{const r=useBoundProp(pl.backgroundImagePositionOffsetPropTypeUtil),o=useBoundProp(pl.stringPropTypeUtil),i=!!r.value,a=(0,ul.useRef)(null);return cl.createElement(hl.Grid,{container:!0,spacing:1.5},cl.createElement(hl.Grid,{item:!0,xs:12},cl.createElement(rr,null,cl.createElement(hl.Grid,{item:!0,xs:6},cl.createElement(ControlFormLabel,null,(0,ml.__)("Position","elementor"))),cl.createElement(hl.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end",overflow:"hidden"}},cl.createElement(ControlActions,null,cl.createElement(hl.Select,{fullWidth:!0,size:"tiny",onChange:i=>{const a=i.target.value||null;"custom"===a?r.setValue({x:null,y:null}):o.setValue(a)},disabled:o.disabled,value:(r.value?"custom":o.value)??""},gl.map(({label:r,value:o})=>cl.createElement(dl.MenuListItem,{key:o,value:o??""},r))))))),i?cl.createElement(PropProvider,{...r},cl.createElement(hl.Grid,{item:!0,xs:12},cl.createElement(hl.Grid,{container:!0,spacing:1.5,ref:a},cl.createElement(hl.Grid,{item:!0,xs:6},cl.createElement(PropKeyProvider,{bind:"x"},cl.createElement(Ct,{startIcon:cl.createElement(fl.LetterXIcon,{fontSize:"tiny"}),anchorRef:a,min:-Number.MAX_SAFE_INTEGER}))),cl.createElement(hl.Grid,{item:!0,xs:6},cl.createElement(PropKeyProvider,{bind:"y"},cl.createElement(Ct,{startIcon:cl.createElement(fl.LetterYIcon,{fontSize:"tiny"}),anchorRef:a,min:-Number.MAX_SAFE_INTEGER})))))):null)},vl=__toESM(i(97557)),yl=i(24413),bl=i(79513),kl=i(27723),El=[{value:"repeat",label:(0,kl.__)("Repeat","elementor"),renderContent:({size:r})=>vl.createElement(yl.GridDotsIcon,{fontSize:r}),showTooltip:!0},{value:"repeat-x",label:(0,kl.__)("Repeat-x","elementor"),renderContent:({size:r})=>vl.createElement(yl.DotsHorizontalIcon,{fontSize:r}),showTooltip:!0},{value:"repeat-y",label:(0,kl.__)("Repeat-y","elementor"),renderContent:({size:r})=>vl.createElement(yl.DotsVerticalIcon,{fontSize:r}),showTooltip:!0},{value:"no-repeat",label:(0,kl.__)("No-repeat","elementor"),renderContent:({size:r})=>vl.createElement(yl.XIcon,{fontSize:r}),showTooltip:!0}],BackgroundImageOverlayRepeat=()=>vl.createElement(rr,null,vl.createElement(bl.Grid,{item:!0,xs:6},vl.createElement(ControlFormLabel,null,(0,kl.__)("Repeat","elementor"))),vl.createElement(bl.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end"}},vl.createElement(bo,{options:El}))),Sl=__toESM(i(97557)),wl=i(97557),xl=i(2020),Cl=i(24413),_l=i(79513),Tl=i(27723),Ol=[{value:"auto",label:(0,Tl.__)("Auto","elementor"),renderContent:({size:r})=>Sl.createElement(Cl.LetterAIcon,{fontSize:r}),showTooltip:!0},{value:"cover",label:(0,Tl.__)("Cover","elementor"),renderContent:({size:r})=>Sl.createElement(Cl.ArrowsMaximizeIcon,{fontSize:r}),showTooltip:!0},{value:"contain",label:(0,Tl.__)("Contain","elementor"),renderContent:({size:r})=>Sl.createElement(Cl.ArrowBarBothIcon,{fontSize:r}),showTooltip:!0},{value:"custom",label:(0,Tl.__)("Custom","elementor"),renderContent:({size:r})=>Sl.createElement(Cl.PencilIcon,{fontSize:r}),showTooltip:!0}],BackgroundImageOverlaySize=()=>{const r=useBoundProp(xl.backgroundImageSizeScalePropTypeUtil),o=useBoundProp(xl.stringPropTypeUtil),i=!!r.value,a=(0,wl.useRef)(null);return Sl.createElement(_l.Grid,{container:!0,spacing:1.5},Sl.createElement(_l.Grid,{item:!0,xs:12},Sl.createElement(rr,null,Sl.createElement(_l.Grid,{item:!0,xs:6},Sl.createElement(ControlFormLabel,null,(0,Tl.__)("Size","elementor"))),Sl.createElement(_l.Grid,{item:!0,xs:6,sx:{display:"flex",justifyContent:"flex-end"}},Sl.createElement(ControlToggleButtonGroup,{exclusive:!0,items:Ol,onChange:i=>{"custom"===i?r.setValue({width:null,height:null}):o.setValue(i)},disabled:o.disabled,value:r.value?"custom":o.value})))),i?Sl.createElement(PropProvider,{...r},Sl.createElement(_l.Grid,{item:!0,xs:12,ref:a},Sl.createElement(rr,null,Sl.createElement(_l.Grid,{item:!0,xs:6},Sl.createElement(PropKeyProvider,{bind:"width"},Sl.createElement(Ct,{startIcon:Sl.createElement(Cl.ArrowsMoveHorizontalIcon,{fontSize:"tiny"}),extendedOptions:["auto"],anchorRef:a}))),Sl.createElement(_l.Grid,{item:!0,xs:6},Sl.createElement(PropKeyProvider,{bind:"height"},Sl.createElement(Ct,{startIcon:Sl.createElement(Cl.ArrowsMoveVerticalIcon,{fontSize:"tiny"}),extendedOptions:["auto"],anchorRef:a})))))):null)},Pl=i(97557),Al=i(2020),Ml=i(79513),Nl=Ks.backgroundColorOverlayPropTypeUtil.create({color:Ks.colorPropTypeUtil.create("#00000033")}),getInitialBackgroundOverlay=()=>({$$type:"background-image-overlay",value:{image:{$$type:"image",value:{src:{$$type:"image-src",value:{url:{$$type:"url",value:Qs.background_placeholder_image},id:null}},size:{$$type:"string",value:"large"}}}}}),Rl=[{label:(0,Ys.__)("Thumbnail - 150 x 150","elementor"),value:"thumbnail"},{label:(0,Ys.__)("Medium - 300 x 300","elementor"),value:"medium"},{label:(0,Ys.__)("Large 1024 x 1024","elementor"),value:"large"},{label:(0,Ys.__)("Full","elementor"),value:"full"}],Il=createControl(()=>{const{propType:r,value:o,setValue:i}=useBoundProp(Ks.backgroundOverlayPropTypeUtil);return qs.createElement(PropProvider,{propType:r,value:o,setValue:i},qs.createElement(ControlRepeater,{initial:getInitialBackgroundOverlay(),propTypeUtil:Ks.backgroundOverlayPropTypeUtil},qs.createElement(sr,{label:(0,Ys.__)("Overlay","elementor")},qs.createElement(TooltipAddItemAction,{newItemIndex:0})),qs.createElement(ItemsContainer,null,qs.createElement(Item,{Icon:ItemIcon2,Label:ItemLabel3,actions:qs.createElement(qs.Fragment,null,qs.createElement(DuplicateItemAction,null),qs.createElement(DisableItemAction,null),qs.createElement(RemoveItemAction,null))})),qs.createElement(EditItemPopover,null,qs.createElement(ItemContent2,null))))}),ItemContent2=()=>{const{getTabsProps:r,getTabProps:o,getTabPanelProps:i}=(({color:r,image:o,gradient:i})=>{const{value:a,setValue:c}=useBoundProp(Al.backgroundImageOverlayPropTypeUtil),{value:u,setValue:p}=useBoundProp(Al.backgroundColorOverlayPropTypeUtil),{value:g,setValue:v}=useBoundProp(Al.backgroundGradientOverlayPropTypeUtil),{getTabsProps:b,getTabProps:k,getTabPanelProps:E}=(0,Ml.useTabs)(u?"color":g?"gradient":"image"),w=(0,Pl.useRef)({image:o,color:r,gradient:i}),saveToHistory=(r,o)=>{o&&(w.current[r]=o)},onTabChange=(r,o)=>{switch(o){case"image":c(w.current.image),saveToHistory("color",u),saveToHistory("gradient",g);break;case"gradient":v(w.current.gradient),saveToHistory("color",u),saveToHistory("image",a);break;case"color":p(w.current.color),saveToHistory("image",a),saveToHistory("gradient",g)}return b().onChange(r,o)};return{getTabProps:k,getTabPanelProps:E,getTabsProps:()=>({...b(),onChange:onTabChange})}})({image:getInitialBackgroundOverlay().value,color:Nl.value,gradient:rl.value}),{rowRef:a}=useRepeaterContext();return qs.createElement(Gs.Box,{sx:{width:"100%"}},qs.createElement(Gs.Box,{sx:{borderBottom:1,borderColor:"divider"}},qs.createElement(Gs.Tabs,{size:"small",variant:"fullWidth",...r(),"aria-label":(0,Ys.__)("Background Overlay","elementor")},qs.createElement(Gs.Tab,{label:(0,Ys.__)("Image","elementor"),...o("image")}),qs.createElement(Gs.Tab,{label:(0,Ys.__)("Gradient","elementor"),...o("gradient")}),qs.createElement(Gs.Tab,{label:(0,Ys.__)("Color","elementor"),...o("color")}))),qs.createElement(Gs.TabPanel,{sx:{p:1.5},...i("image")},qs.createElement(PopoverContent,null,qs.createElement(ImageOverlayContent,null))),qs.createElement(Gs.TabPanel,{sx:{p:1.5},...i("gradient")},qs.createElement(nl,null)),qs.createElement(Gs.TabPanel,{sx:{p:1.5},...i("color")},qs.createElement(PopoverContent,null,qs.createElement(ColorOverlayContent,{anchorEl:a}))))},ItemIcon2=({value:r})=>{switch(r.$$type){case"background-image-overlay":return qs.createElement(ItemIconImage,{value:r});case"background-color-overlay":return qs.createElement(ItemIconColor,{value:r});case"background-gradient-overlay":return qs.createElement(ItemIconGradient,{value:r});default:return null}},extractColorFrom=r=>r?.value?.color?.value?r.value.color.value:"",ItemIconColor=({value:r})=>{const o=extractColorFrom(r);return qs.createElement(Dl,{size:"inherit",component:"span",value:o})},ItemIconImage=({value:r})=>{const{imageUrl:o}=useImage(r);return qs.createElement(Gs.CardMedia,{image:o,sx:r=>({height:"1rem",width:"1rem",borderRadius:r.shape.borderRadius/2+"px",outline:`1px solid ${r.palette.action.disabled}`})})},ItemIconGradient=({value:r})=>{const o=getGradientValue(r);return qs.createElement(Dl,{size:"inherit",component:"span",value:o})},ItemLabel3=({value:r})=>{switch(r.$$type){case"background-image-overlay":return qs.createElement(ItemLabelImage,{value:r});case"background-color-overlay":return qs.createElement(ItemLabelColor,{value:r});case"background-gradient-overlay":return qs.createElement(ItemLabelGradient,{value:r});default:return null}},ItemLabelColor=({value:r})=>{const o=extractColorFrom(r);return qs.createElement("span",null,o)},ItemLabelImage=({value:r})=>{const{imageTitle:o}=useImage(r);return qs.createElement("span",null,o)},ItemLabelGradient=({value:r})=>"linear"===r.value.type.value?qs.createElement("span",null,(0,Ys.__)("Linear Gradient","elementor")):qs.createElement("span",null,(0,Ys.__)("Radial Gradient","elementor")),ColorOverlayContent=({anchorEl:r})=>{const o=useBoundProp(Ks.backgroundColorOverlayPropTypeUtil);return qs.createElement(PropProvider,{...o},qs.createElement(PropKeyProvider,{bind:"color"},qs.createElement(Lt,{anchorEl:r})))},ImageOverlayContent=()=>{const r=useBoundProp(Ks.backgroundImageOverlayPropTypeUtil);return qs.createElement(PropProvider,{...r},qs.createElement(PropKeyProvider,{bind:"image"},qs.createElement(Te,{sizes:Rl})),qs.createElement(PropKeyProvider,{bind:"position"},qs.createElement(BackgroundImageOverlayPosition,null)),qs.createElement(PropKeyProvider,{bind:"repeat"},qs.createElement(BackgroundImageOverlayRepeat,null)),qs.createElement(PropKeyProvider,{bind:"size"},qs.createElement(BackgroundImageOverlaySize,null)),qs.createElement(PropKeyProvider,{bind:"attachment"},qs.createElement(BackgroundImageOverlayAttachment,null)))},Dl=(0,Gs.styled)(Gs.UnstableColorIndicator)(({theme:r})=>({height:"1rem",width:"1rem",borderRadius:r.shape.borderRadius/2+"px"})),useImage=r=>{let o,i=null;const a=r?.value.image.value?.src.value,{data:c}=(0,Js.useWpMediaAttachment)(a.id?.value||null);if(a.id){const r=getFileExtensionFromFilename(c?.filename);o=`${c?.title}${r}`||null,i=c?.url||null}else a.url&&(i=a.url.value,o=i?.substring(i.lastIndexOf("/")+1)||null);return{imageTitle:o,imageUrl:i}},getFileExtensionFromFilename=r=>{if(!r)return"";return`.${r.substring(r.lastIndexOf(".")+1)}`},getGradientValue=r=>{const o=r.value,i=o.stops.value?.map(({value:{color:r,offset:o}})=>`${r.value} ${o.value??0}%`)?.join(",");return"linear"===o.type.value?`linear-gradient(${o.angle.value}deg, ${i})`:`radial-gradient(circle at ${o.positions.value}, ${i})`},Ll=[{label:(0,Ws.__)("Full element","elementor"),value:"border-box"},{label:(0,Ws.__)("Padding edges","elementor"),value:"padding-box"},{label:(0,Ws.__)("Content edges","elementor"),value:"content-box"},{label:(0,Ws.__)("Text","elementor"),value:"text"}],Fl=(0,Ws.__)("Color","elementor"),zl=(0,Ws.__)("Clipping","elementor"),jl=createControl(()=>{const r=useBoundProp(Us.backgroundPropTypeUtil);return $s.createElement(PropProvider,{...r},$s.createElement(PropKeyProvider,{bind:"background-overlay"},$s.createElement(Il,null)),$s.createElement(BackgroundColorField,null),$s.createElement(BackgroundClipField,null))}),BackgroundColorField=()=>$s.createElement(PropKeyProvider,{bind:"color"},$s.createElement(Hs.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},$s.createElement(Hs.Grid,{item:!0,xs:6},$s.createElement(ControlLabel,null,Fl)),$s.createElement(Hs.Grid,{item:!0,xs:6},$s.createElement(Lt,null)))),BackgroundClipField=()=>$s.createElement(PropKeyProvider,{bind:"clip"},$s.createElement(Hs.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},$s.createElement(Hs.Grid,{item:!0,xs:6},$s.createElement(ControlLabel,null,zl)),$s.createElement(Hs.Grid,{item:!0,xs:6},$s.createElement(_e,{options:Ll})))),Bl=__toESM(i(97557)),Vl=i(97557),$l=i(2020),Ul=i(79513),Hl=/\$\{([^}]+)\}/g,Wl=createControl(({repeaterLabel:r,childControlConfig:o,showDuplicate:i,showToggle:a,initialValues:c,patternLabel:u,placeholder:p,propKey:g,isSortable:v,addItemTooltipProps:b})=>{const{propTypeUtil:k,isItemDisabled:E}=o;if(!k)return null;const w=(0,Vl.useMemo)(()=>(0,$l.createArrayPropUtils)(k.key,k.schema,g),[k.key,k.schema,g]),x=(0,Vl.useMemo)(()=>({...o,placeholder:p||"",patternLabel:u||""}),[o,p,u]),{propType:C,value:_,setValue:T}=useBoundProp(w),P=null===b?.newItemIndex?void 0:0;return Bl.createElement(PropProvider,{propType:C,value:_,setValue:T},Bl.createElement(bn.Provider,{value:x},Bl.createElement(ControlRepeater,{initial:k.create(c||null),propTypeUtil:w,isItemDisabled:E},Bl.createElement(sr,{label:r},Bl.createElement(TooltipAddItemAction,{...b,newItemIndex:P,ariaLabel:r})),Bl.createElement(ItemsContainer,{isSortable:v},Bl.createElement(Item,{Icon:ItemIcon3,Label:ItemLabel4,actions:Bl.createElement(Bl.Fragment,null,i&&Bl.createElement(DuplicateItemAction,null),a&&Bl.createElement(DisableItemAction,null),Bl.createElement(RemoveItemAction,null))})),Bl.createElement(EditItemPopover,null,Bl.createElement(Content2,null)))))}),ItemIcon3=()=>Bl.createElement(Bl.Fragment,null),Content2=()=>{const{component:r,props:o={}}=useRepeatableControlContext();return Bl.createElement(PopoverContent,{p:1.5},Bl.createElement(rr,null,Bl.createElement(r,{...o})))},getNestedValue=(r,o)=>{let i={};const a=o.split("."),c=a.slice(-1)[0];let u=a.reduce((r,o,c)=>(c===a.length-2&&(i=r),r&&"object"==typeof r?r[o]:{}),r);u=u||"";const p=i?.$$type,g=i?.value;return"unit"===c&&"size"===p&&"custom"===g?.unit?g?.size?"":xt:u},isEmptyValue=r=>"string"==typeof r?""===r.trim():!!Number.isNaN(r)||(Array.isArray(r)?0===r.length:"object"==typeof r&&null!==r&&0===Object.keys(r).length),ItemLabel4=({value:r})=>{const{placeholder:o,patternLabel:i,props:a}=useRepeatableControlContext(),c=((r,o)=>{const i=getAllProperties(r).map(r=>getNestedValue(o,r));return!(0===i.length||!i.some(r=>null==r)&&!i.every(isEmptyValue))})(i,r),u=c?o:(p=i,(g=r)?p.replace(Hl,(r,o)=>{const i=getNestedValue(g,o);return"object"!=typeof i||null===i||Array.isArray(i)?Array.isArray(i)?i.join(", "):String(i??""):"name"in i&&i.name?i.name:JSON.stringify(i)}):p);var p,g;const v=((r,o)=>r?"text.disabled":o?"text.tertiary":"text.primary")(!!a?.readOnly,c);return Bl.createElement(Ul.Box,{component:"span",color:v},u)},getAllProperties=r=>r.match(Hl)?.map(r=>r.slice(2,-1))||[],ql=__toESM(i(97557)),Kl=i(97557),Gl=i(2020),Jl=i(79513),Yl=i(27723),escapeHtmlAttr=r=>{const o={"&":"&","<":"<",">":">","'":"'",'"':"""};return r.replace(/[&<>'"]/g,r=>o[r]||r)},getInitialFieldValue=r=>{const o=r;return r&&"object"==typeof r&&"dynamic"!==o.$$type&&o.value||""},Xl=createControl((r={})=>{const{value:o,setValue:i,...a}=useBoundProp(Gl.keyValuePropTypeUtil),[c,u]=(0,Kl.useState)(""),[p,g]=(0,Kl.useState)(""),[v,b]=(0,Kl.useState)({key:getInitialFieldValue(o?.key),value:getInitialFieldValue(o?.value)}),k=r.keyName||(0,Yl.__)("Key","elementor"),E=r.valueName||(0,Yl.__)("Value","elementor"),{keyHelper:w,valueHelper:x}=r.getHelperText?.(v.key,v.value)||{keyHelper:void 0,valueHelper:void 0},[C,_,T]=(0,Kl.useMemo)(()=>[r.regexKey?new RegExp(r.regexKey):void 0,r.regexValue?new RegExp(r.regexValue):void 0,r.validationErrorMessage||(0,Yl.__)("Invalid Format","elementor")],[r.regexKey,r.regexValue,r.validationErrorMessage]);return ql.createElement(PropProvider,{...a,value:o,setValue:(r,a,c)=>{const p=c?.bind;if(!p)return;const v=r[p];if((0,Gl.isTransformable)(v)&&"dynamic"===v.$$type)return void i({...o,[p]:v});const k=Gl.stringPropTypeUtil.extract(v);b(r=>({...r,[p]:k})),k&&((r,o)=>{if("key"===o&&C){const o=C.test(r);return u(o?"":T),o}if("value"===o&&_){const o=_.test(r);return g(o?"":T),o}return!0})(k,p)?i({...o,[p]:v}):i({...o,[p]:{value:"",$$type:"string"}})}},ql.createElement(Jl.Grid,{container:!0,gap:1.5},ql.createElement(Jl.Grid,{item:!0,xs:12,display:"flex",flexDirection:"column"},ql.createElement(Jl.FormLabel,{size:"tiny",sx:{pb:1}},k),ql.createElement(PropKeyProvider,{bind:"key"},ql.createElement(Me,{inputValue:r.escapeHtml?escapeHtmlAttr(v.key):v.key,error:!!c,helperText:w})),!!c&&ql.createElement(Jl.FormHelperText,{error:!0},c)),ql.createElement(Jl.Grid,{item:!0,xs:12,display:"flex",flexDirection:"column"},ql.createElement(Jl.FormLabel,{size:"tiny",sx:{pb:1}},E),ql.createElement(PropKeyProvider,{bind:"value"},ql.createElement(Me,{inputValue:r.escapeHtml?escapeHtmlAttr(v.value):v.value,error:!!p,inputDisabled:!!c,helperText:x})),!!p&&ql.createElement(Jl.FormHelperText,{error:!0},p))))}),Ql=__toESM(i(97557)),Zl=i(2020),ec=i(70374),tc=i(24413),nc=i(79513),rc=i(27723),oc=[{label:(0,rc.__)("Center center","elementor"),value:"center center"},{label:(0,rc.__)("Center left","elementor"),value:"center left"},{label:(0,rc.__)("Center right","elementor"),value:"center right"},{label:(0,rc.__)("Top center","elementor"),value:"top center"},{label:(0,rc.__)("Top left","elementor"),value:"top left"},{label:(0,rc.__)("Top right","elementor"),value:"top right"},{label:(0,rc.__)("Bottom center","elementor"),value:"bottom center"},{label:(0,rc.__)("Bottom left","elementor"),value:"bottom left"},{label:(0,rc.__)("Bottom right","elementor"),value:"bottom right"},{label:(0,rc.__)("Custom","elementor"),value:"custom"}],PositionControl=()=>{const r=useBoundProp(Zl.positionPropTypeUtil),o=useBoundProp(Zl.stringPropTypeUtil),i=!!r.value,a=r.placeholder?"custom":o.placeholder??null;return Ql.createElement(nc.Grid,{container:!0,spacing:1.5},Ql.createElement(nc.Grid,{item:!0,xs:12},Ql.createElement(nc.Grid,{container:!0,gap:2,alignItems:"center",flexWrap:"nowrap"},Ql.createElement(nc.Grid,{item:!0,xs:6},Ql.createElement(ControlFormLabel,null,(0,rc.__)("Object position","elementor"))),Ql.createElement(nc.Grid,{item:!0,xs:6,sx:{overflow:"hidden"}},Ql.createElement(nc.Select,{size:"tiny",displayEmpty:!0,disabled:o.disabled,value:(r.value?"custom":o.value)??"",onChange:i=>{const a=i.target.value||null;"custom"===a?r.setValue({x:null,y:null}):o.setValue(a)},renderValue:r=>getSelectRenderValue(oc,a,r),fullWidth:!0},oc.map(({label:r,value:o})=>Ql.createElement(ec.MenuListItem,{key:o,value:o??""},r)))))),i&&Ql.createElement(PropProvider,{...r},Ql.createElement(nc.Grid,{item:!0,xs:12},Ql.createElement(nc.Grid,{container:!0,spacing:1.5},Ql.createElement(nc.Grid,{item:!0,xs:6},Ql.createElement(PropKeyProvider,{bind:"x"},Ql.createElement(Ct,{startIcon:Ql.createElement(tc.LetterXIcon,{fontSize:"tiny"}),min:-Number.MAX_SAFE_INTEGER}))),Ql.createElement(nc.Grid,{item:!0,xs:6},Ql.createElement(PropKeyProvider,{bind:"y"},Ql.createElement(Ct,{startIcon:Ql.createElement(tc.LetterYIcon,{fontSize:"tiny"}),min:-Number.MAX_SAFE_INTEGER})))))))},ic=__toESM(i(97557)),ac=i(97557),sc=i(2020),lc=i(24413),cc=i(79513),uc=i(27723),pc=i(2020),dc="transform-move",fc="transform-scale",hc="transform-rotate",mc="transform-skew",gc={move:{size:0,unit:"px"},scale:1,rotate:{size:0,unit:"deg"},skew:{size:0,unit:"deg"}},vc={$$type:dc,value:{x:{$$type:"size",value:{size:gc.move.size,unit:gc.move.unit}},y:{$$type:"size",value:{size:gc.move.size,unit:gc.move.unit}},z:{$$type:"size",value:{size:gc.move.size,unit:gc.move.unit}}}},yc=pc.scaleTransformPropTypeUtil.create({x:pc.numberPropTypeUtil.create(gc.scale),y:pc.numberPropTypeUtil.create(gc.scale),z:pc.numberPropTypeUtil.create(gc.scale)}),bc=pc.rotateTransformPropTypeUtil.create({x:{$$type:"size",value:{size:gc.rotate.size,unit:gc.rotate.unit}},y:{$$type:"size",value:{size:gc.rotate.size,unit:gc.rotate.unit}},z:{$$type:"size",value:{size:gc.rotate.size,unit:gc.rotate.unit}}}),kc=pc.skewTransformPropTypeUtil.create({x:{$$type:"size",value:{size:gc.skew.size,unit:gc.skew.unit}},y:{$$type:"size",value:{size:gc.skew.size,unit:gc.skew.unit}}}),Ec=__toESM(i(97557)),Sc=i(79513),wc=i(27723),xc=__toESM(i(97557)),Cc=i(97557),_c=i(2020),Tc=i(24413),Oc=i(79513),Pc=i(27723),Ac=__toESM(i(97557)),Mc=i(79513),AxisRow=({label:r,bind:o,startIcon:i,anchorRef:a,units:c,variant:u="angle"})=>{const p=r.replace(/\s+/g,"-").toLowerCase();return Ac.createElement(Mc.Grid,{item:!0,xs:12},Ac.createElement(rr,{ref:a},Ac.createElement(Mc.Grid,{item:!0,xs:6},Ac.createElement(ControlLabel,{htmlFor:p},r)),Ac.createElement(Mc.Grid,{item:!0,xs:6},Ac.createElement(PropKeyProvider,{bind:o},Ac.createElement(Ct,{anchorRef:a,startIcon:i,units:c,variant:u,min:-Number.MAX_SAFE_INTEGER,id:p})))))},Nc=[{label:(0,Pc.__)("Move X","elementor"),bind:"x",startIcon:xc.createElement(Tc.ArrowRightIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vw"]},{label:(0,Pc.__)("Move Y","elementor"),bind:"y",startIcon:xc.createElement(Tc.ArrowDownSmallIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vh"]},{label:(0,Pc.__)("Move Z","elementor"),bind:"z",startIcon:xc.createElement(Tc.ArrowDownLeftIcon,{fontSize:"tiny"}),units:["px","%","em","rem","vw","vh"]}],Move=()=>{const r=useBoundProp(_c.moveTransformPropTypeUtil),o=[(0,Cc.useRef)(null),(0,Cc.useRef)(null),(0,Cc.useRef)(null)];return xc.createElement(Oc.Grid,{container:!0,spacing:1.5},xc.createElement(PropProvider,{...r},xc.createElement(PropKeyProvider,{bind:dc},Nc.map((r,i)=>xc.createElement(AxisRow,{key:r.bind,...r,anchorRef:o[i],units:r.units,variant:"length"})))))},Rc=__toESM(i(97557)),Ic=i(97557),Dc=i(2020),Lc=i(24413),Fc=i(79513),zc=i(27723),jc=[{label:(0,zc.__)("Rotate X","elementor"),bind:"x",startIcon:Rc.createElement(Lc.Arrow360Icon,{fontSize:"tiny"})},{label:(0,zc.__)("Rotate Y","elementor"),bind:"y",startIcon:Rc.createElement(Lc.Arrow360Icon,{fontSize:"tiny",style:{transform:"scaleX(-1) rotate(-90deg)"}})},{label:(0,zc.__)("Rotate Z","elementor"),bind:"z",startIcon:Rc.createElement(Lc.RotateClockwiseIcon,{fontSize:"tiny"})}],Bc=["deg","rad","grad","turn"],Rotate=()=>{const r=useBoundProp(Dc.rotateTransformPropTypeUtil),o=[(0,Ic.useRef)(null),(0,Ic.useRef)(null),(0,Ic.useRef)(null)];return Rc.createElement(Fc.Grid,{container:!0,spacing:1.5},Rc.createElement(PropProvider,{...r},Rc.createElement(PropKeyProvider,{bind:hc},jc.map((r,i)=>Rc.createElement(AxisRow,{key:r.bind,...r,anchorRef:o[i],units:Bc})))))},Vc=__toESM(i(97557)),$c=i(97557),Uc=i(2020),Hc=i(24413),Wc=i(79513),qc=i(27723),Kc=__toESM(i(97557)),Gc=i(79513),ScaleAxisRow=({label:r,bind:o,startIcon:i,anchorRef:a})=>Kc.createElement(Gc.Grid,{item:!0,xs:12},Kc.createElement(rr,{ref:a},Kc.createElement(Gc.Grid,{item:!0,xs:6},Kc.createElement(ControlLabel,null,r)),Kc.createElement(Gc.Grid,{item:!0,xs:6},Kc.createElement(PropKeyProvider,{bind:o},Kc.createElement(wo,{step:.1,placeholder:"1",startIcon:i}))))),Jc=[{label:(0,qc.__)("Scale X","elementor"),bind:"x",startIcon:Vc.createElement(Hc.ArrowRightIcon,{fontSize:"tiny"})},{label:(0,qc.__)("Scale Y","elementor"),bind:"y",startIcon:Vc.createElement(Hc.ArrowDownSmallIcon,{fontSize:"tiny"})},{label:(0,qc.__)("Scale Z","elementor"),bind:"z",startIcon:Vc.createElement(Hc.ArrowDownLeftIcon,{fontSize:"tiny"})}],Scale=()=>{const r=useBoundProp(Uc.scaleTransformPropTypeUtil),o=[(0,$c.useRef)(null),(0,$c.useRef)(null),(0,$c.useRef)(null)];return Vc.createElement(Wc.Grid,{container:!0,spacing:1.5},Vc.createElement(PropProvider,{...r},Vc.createElement(PropKeyProvider,{bind:fc},Jc.map((r,i)=>Vc.createElement(ScaleAxisRow,{key:r.bind,...r,anchorRef:o[i]})))))},Yc=__toESM(i(97557)),Xc=i(97557),Qc=i(2020),Zc=i(24413),eu=i(79513),tu=i(27723),nu=[{label:(0,tu.__)("Skew X","elementor"),bind:"x",startIcon:Yc.createElement(Zc.ArrowRightIcon,{fontSize:"tiny"})},{label:(0,tu.__)("Skew Y","elementor"),bind:"y",startIcon:Yc.createElement(Zc.ArrowLeftIcon,{fontSize:"tiny",style:{transform:"scaleX(-1) rotate(-90deg)"}})}],ru=["deg","rad","grad","turn"],Skew=()=>{const r=useBoundProp(Qc.skewTransformPropTypeUtil),o=[(0,Xc.useRef)(null),(0,Xc.useRef)(null),(0,Xc.useRef)(null)];return Yc.createElement(eu.Grid,{container:!0,spacing:1.5},Yc.createElement(PropProvider,{...r},Yc.createElement(PropKeyProvider,{bind:mc},nu.map((r,i)=>Yc.createElement(AxisRow,{key:r.bind,...r,anchorRef:o[i],units:ru})))))},ou=i(97557),iu=i(2020),au=i(79513),TransformContent=()=>{const{getTabsProps:r,getTabProps:o,getTabPanelProps:i}=(({move:r,scale:o,rotate:i,skew:a})=>{const{value:c,setValue:u}=useBoundProp(iu.moveTransformPropTypeUtil),{value:p,setValue:g}=useBoundProp(iu.scaleTransformPropTypeUtil),{value:v,setValue:b}=useBoundProp(iu.rotateTransformPropTypeUtil),{value:k,setValue:E}=useBoundProp(iu.skewTransformPropTypeUtil),{openItemIndex:w,items:x}=useRepeaterContext(),{getTabsProps:C,getTabProps:_,getTabPanelProps:T}=(0,au.useTabs)((()=>{switch(!0){case!!p:return fc;case!!v:return hc;case!!k:return mc;default:return dc}})()),P=(0,ou.useRef)({move:r,scale:o,rotate:i,skew:a}),saveToHistory=(r,o)=>{o&&(P.current[r]=o)},onTabChange=(r,o)=>{switch(o){case dc:u(P.current.move),saveToHistory("scale",p),saveToHistory("rotate",v),saveToHistory("skew",k);break;case fc:g(P.current.scale),saveToHistory("move",c),saveToHistory("rotate",v),saveToHistory("skew",k);break;case hc:b(P.current.rotate),saveToHistory("move",c),saveToHistory("scale",p),saveToHistory("skew",k);break;case mc:E(P.current.skew),saveToHistory("move",c),saveToHistory("scale",p),saveToHistory("rotate",v)}return C().onChange(r,o)};return{getTabProps:r=>{return{..._(r),disabled:(o=r,!!x.find(({item:{$$type:r}},i)=>o===r&&i!==w))};var o},getTabPanelProps:T,getTabsProps:()=>({...C(),onChange:onTabChange})}})({move:vc.value,scale:yc.value,rotate:bc.value,skew:kc.value});return Ec.createElement(PopoverContent,null,Ec.createElement(Sc.Box,{sx:{width:"100%"}},Ec.createElement(Sc.Box,{sx:{borderBottom:1,borderColor:"divider"}},Ec.createElement(Sc.Tabs,{size:"small",variant:"fullWidth",sx:{"& .MuiTab-root":{minWidth:"62px"}},...r(),"aria-label":(0,wc.__)("Transform","elementor")},Ec.createElement(Sc.Tab,{label:(0,wc.__)("Move","elementor"),...o(dc)}),Ec.createElement(Sc.Tab,{label:(0,wc.__)("Scale","elementor"),...o(fc)}),Ec.createElement(Sc.Tab,{label:(0,wc.__)("Rotate","elementor"),...o(hc)}),Ec.createElement(Sc.Tab,{label:(0,wc.__)("Skew","elementor"),...o(mc)}))),Ec.createElement(Sc.TabPanel,{sx:{p:1.5},...i(dc)},Ec.createElement(Move,null)),Ec.createElement(Sc.TabPanel,{sx:{p:1.5},...i(fc)},Ec.createElement(Scale,null)),Ec.createElement(Sc.TabPanel,{sx:{p:1.5},...i(hc)},Ec.createElement(Rotate,null)),Ec.createElement(Sc.TabPanel,{sx:{p:1.5},...i(mc)},Ec.createElement(Skew,null))))},su=__toESM(i(97557)),lu=i(24413),TransformIcon=({value:r})=>{switch(r.$$type){case dc:return su.createElement(lu.ArrowsMaximizeIcon,{fontSize:"tiny"});case fc:return su.createElement(lu.ArrowAutofitHeightIcon,{fontSize:"tiny"});case hc:return su.createElement(lu.RotateClockwise2Icon,{fontSize:"tiny"});case mc:return su.createElement(lu.SkewXIcon,{fontSize:"tiny"});default:return null}},cu=__toESM(i(97557)),uu=i(79513),pu=i(27723),du=["x","y","z"],formatLabel=(r,o)=>du.map(i=>{const a=r[i];if("scale"===o)return a?.value||gc[o];const c=gc[o],u=a?.value?.size??c.size,p=a?.value?.unit??c.unit;return"custom"===p?u||xt:`${u}${p}`}).join(", "),TransformLabel=r=>{const{$$type:o,value:i}=r.value;switch(o){case dc:return cu.createElement(Label2,{label:(0,pu.__)("Move","elementor"),value:formatLabel(i,"move")});case fc:return cu.createElement(Label2,{label:(0,pu.__)("Scale","elementor"),value:formatLabel(i,"scale")});case hc:return cu.createElement(Label2,{label:(0,pu.__)("Rotate","elementor"),value:formatLabel(i,"rotate")});case mc:return cu.createElement(Label2,{label:(0,pu.__)("Skew","elementor"),value:formatLabel(i,"skew")});default:return""}},Label2=({label:r,value:o})=>cu.createElement(uu.Box,{component:"span"},r,": ",o),fu=__toESM(i(97557)),hu=i(70374),mu=i(24413),gu=i(79513),vu=i(27723),yu=__toESM(i(97557)),bu=i(97557),ku=i(2020),Eu=i(79513),Su=i(27723),wu=["px","%","em","rem"],xu={label:(0,Su.__)("Perspective","elementor"),bind:"perspective",units:["px","em","rem","vw","vh"]},Cu=[{label:(0,Su.__)("Origin X","elementor"),bind:"x",units:wu},{label:(0,Su.__)("Origin Y","elementor"),bind:"y",units:wu}],ChildrenPerspectiveControl=()=>yu.createElement(Eu.Stack,{direction:"column",spacing:1.5},yu.createElement(ControlFormLabel,null,(0,Su.__)("Children perspective","elementor")),yu.createElement(PerspectiveControl,null),yu.createElement(PerspectiveOriginControl,null)),PerspectiveControl=()=>yu.createElement(PropKeyProvider,{bind:"perspective"},yu.createElement(ControlFields,{control:xu,key:xu.bind})),PerspectiveOriginControl=()=>yu.createElement(PropKeyProvider,{bind:"perspective-origin"},yu.createElement(PerspectiveOriginControlProvider,null)),PerspectiveOriginControlProvider=()=>{const r=useBoundProp(ku.perspectiveOriginPropTypeUtil);return yu.createElement(PropProvider,{...r},Cu.map(r=>yu.createElement(PropKeyProvider,{bind:r.bind,key:r.bind},yu.createElement(ControlFields,{control:r}))))},ControlFields=({control:r})=>{const o=(0,bu.useRef)(null);return yu.createElement(rr,{ref:o},yu.createElement(Eu.Grid,{item:!0,xs:6},yu.createElement(ControlFormLabel,null,r.label)),yu.createElement(Eu.Grid,{item:!0,xs:6},yu.createElement(Ct,{variant:"length",units:r.units,anchorRef:o,disableCustom:!0})))},_u=__toESM(i(97557)),Tu=i(97557),Ou=i(2020),Pu=i(79513),Au=i(27723),Mu=["px","%","em","rem"],Nu=Mu.filter(r=>"%"!==r),Ru=[{label:(0,Au.__)("Origin X","elementor"),bind:"x",units:Mu},{label:(0,Au.__)("Origin Y","elementor"),bind:"y",units:Mu},{label:(0,Au.__)("Origin Z","elementor"),bind:"z",units:Nu}],TransformOriginControl=()=>_u.createElement(Pu.Stack,{direction:"column",spacing:1.5},_u.createElement(ControlFormLabel,null,(0,Au.__)("Transform","elementor")),Ru.map(r=>_u.createElement(ControlFields2,{control:r,key:r.bind}))),ControlFields2=({control:r})=>{const o=useBoundProp(Ou.transformOriginPropTypeUtil),i=(0,Tu.useRef)(null);return _u.createElement(PropProvider,{...o},_u.createElement(PropKeyProvider,{bind:r.bind},_u.createElement(rr,{ref:i},_u.createElement(Pu.Grid,{item:!0,xs:6},_u.createElement(ControlFormLabel,null,r.label)),_u.createElement(Pu.Grid,{item:!0,xs:6},_u.createElement(Ct,{variant:"length",units:r.units,anchorRef:i})))))},TransformSettingsControl=({popupState:r,anchorRef:o,showChildrenPerspective:i})=>{const a=(0,gu.bindPopover)({...r,anchorEl:o.current??void 0});return fu.createElement(gu.Popover,{disablePortal:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},slotProps:{paper:{sx:{width:(o.current?.offsetWidth||0)-6+"px",mt:.5}}},...a},fu.createElement(hu.PopoverHeader,{title:(0,vu.__)("Transform settings","elementor"),onClose:r.close,icon:fu.createElement(mu.AdjustmentsIcon,{fontSize:"tiny"})}),fu.createElement(gu.Divider,null),fu.createElement(PopoverContent,{sx:{px:2,py:1.5}},fu.createElement(PropKeyProvider,{bind:"transform-origin"},fu.createElement(TransformOriginControl,null)),i&&fu.createElement(fu.Fragment,null,fu.createElement(gu.Box,{sx:{my:.5}},fu.createElement(gu.Divider,null)),fu.createElement(ChildrenPerspectiveControl,null))))},Iu="tiny",Du=createControl(({showChildrenPerspective:r})=>{const o=useBoundProp(sc.transformPropTypeUtil),i=(0,ac.useRef)(null),a=(0,cc.usePopupState)({variant:"popover"});return ic.createElement(PropProvider,{...o},ic.createElement(TransformSettingsControl,{popupState:a,anchorRef:i,showChildrenPerspective:r}),ic.createElement(PropKeyProvider,{bind:"transform-functions"},ic.createElement(Repeater2,{headerRef:i,propType:o.propType,popupState:a})))}),Lu=ic.createElement(cc.Box,{component:"span","aria-label":void 0,sx:{display:"flex",gap:.5,p:2,width:320,borderRadius:1}},ic.createElement(lc.InfoCircleFilledIcon,{sx:{color:"secondary.main"}}),ic.createElement(cc.Typography,{variant:"body2",color:"text.secondary",fontSize:"14px"},(0,uc.__)("You can use each kind of transform only once per element.","elementor"))),Repeater2=({headerRef:r,propType:o,popupState:i})=>{const a=useBoundProp(sc.transformFunctionsPropTypeUtil),c=[vc,yc,bc,kc],{value:u,bind:p}=a,getInitialValue2=()=>c.find(r=>!u?.some(o=>o.$$type===r.$$type)),g=!getInitialValue2();return ic.createElement(PropProvider,{...a},ic.createElement(ControlRepeater,{initial:getInitialValue2()??vc,propTypeUtil:sc.transformFunctionsPropTypeUtil},ic.createElement(sr,{label:(0,uc.__)("Transform","elementor"),adornment:()=>ic.createElement(ControlAdornments,{customContext:{path:["transform"],propType:o}}),ref:r},ic.createElement(TransformBasePopoverTrigger,{popupState:i,repeaterBindKey:p}),ic.createElement(TooltipAddItemAction,{disabled:g,tooltipContent:Lu,enableTooltip:g,ariaLabel:"transform"})),ic.createElement(ItemsContainer,null,ic.createElement(Item,{Icon:TransformIcon,Label:TransformLabel,actions:ic.createElement(ic.Fragment,null,ic.createElement(DisableItemAction,null),ic.createElement(RemoveItemAction,null))})),ic.createElement(EditItemPopover,null,ic.createElement(TransformContent,null))))},TransformBasePopoverTrigger=({popupState:r,repeaterBindKey:o})=>{const{bind:i}=useBoundProp(),a=(0,uc.__)("Transform settings","elementor");return i!==o?null:ic.createElement(cc.Tooltip,{title:a,placement:"top"},ic.createElement(cc.IconButton,{size:Iu,"aria-label":a,...(0,cc.bindTrigger)(r)},ic.createElement(lc.AdjustmentsIcon,{fontSize:Iu})))},Fu=__toESM(i(97557)),zu=i(97557),ju=i(2020),Bu=i(24413),Vu=i(79513),$u=i(22444),Uu=i(27723),Hu=__toESM(i(97557)),Wu=i(97557),qu=i(2020),Ku=i(79513),Gu=createControl(({selectionLabel:r,sizeLabel:o,selectionConfig:i,sizeConfigMap:a})=>{const{value:c,setValue:u,propType:p}=useBoundProp(qu.selectionSizePropTypeUtil),g=(0,Wu.useRef)(null),v=o.replace(/\s+/g,"-").toLowerCase(),b=(0,Wu.useMemo)(()=>{switch(c.selection.$$type){case"key-value":return a[c?.selection?.value.value.value||""];case"string":return a[c?.selection?.value||""];default:return null}},[c,a]),k=i.component;return Hu.createElement(PropProvider,{value:c,setValue:u,propType:p},Hu.createElement(Ku.Grid,{container:!0,spacing:1.5,ref:g},Hu.createElement(Ku.Grid,{item:!0,xs:6,sx:{display:"flex",alignItems:"center"}},Hu.createElement(ControlFormLabel,null,r)),Hu.createElement(Ku.Grid,{item:!0,xs:6},Hu.createElement(PropKeyProvider,{bind:"selection"},Hu.createElement(k,{...i.props}))),b&&Hu.createElement(Hu.Fragment,null,Hu.createElement(Ku.Grid,{item:!0,xs:6,sx:{display:"flex",alignItems:"center"}},Hu.createElement(ControlFormLabel,{htmlFor:v},o)),Hu.createElement(Ku.Grid,{item:!0,xs:6},Hu.createElement(PropKeyProvider,{bind:"size"},Hu.createElement(Ct,{anchorRef:g,variant:b.variant,units:b.units,defaultUnit:b.defaultUnit,id:v}))))))}),Ju=i(22444),Yu=i(27723),Xu={selection:{$$type:"key-value",value:{key:{value:(0,Yu.__)("All properties","elementor"),$$type:"string"},value:{value:"all",$$type:"string"}}},size:{$$type:"size",value:{size:200,unit:"ms"}}},Qu=(()=>{const r=!!window.elementorFrontend?.config?.is_rtl,o=[{label:(0,Yu.__)("Default","elementor"),type:"category",properties:[{label:(0,Yu.__)("All properties","elementor"),value:"all"}]},{label:(0,Yu.__)("Margin","elementor"),type:"category",properties:[{label:(0,Yu.__)("Margin (all)","elementor"),value:"margin",isDisabled:!0},{label:(0,Yu.__)("Margin bottom","elementor"),value:"margin-block-end",isDisabled:!0},{label:r?(0,Yu.__)("Margin right","elementor"):(0,Yu.__)("Margin left","elementor"),value:"margin-inline-start",isDisabled:!0},{label:r?(0,Yu.__)("Margin left","elementor"):(0,Yu.__)("Margin right","elementor"),value:"margin-inline-end",isDisabled:!0},{label:(0,Yu.__)("Margin top","elementor"),value:"margin-block-start",isDisabled:!0}]},{label:(0,Yu.__)("Padding","elementor"),type:"category",properties:[{label:(0,Yu.__)("Padding (all)","elementor"),value:"padding",isDisabled:!0},{label:(0,Yu.__)("Padding bottom","elementor"),value:"padding-block-end",isDisabled:!0},{label:r?(0,Yu.__)("Padding right","elementor"):(0,Yu.__)("Padding left","elementor"),value:"padding-inline-start",isDisabled:!0},{label:r?(0,Yu.__)("Padding left","elementor"):(0,Yu.__)("Padding right","elementor"),value:"padding-inline-end",isDisabled:!0},{label:(0,Yu.__)("Padding top","elementor"),value:"padding-block-start",isDisabled:!0}]},{label:(0,Yu.__)("Flex","elementor"),type:"category",properties:[{label:(0,Yu.__)("Flex (all)","elementor"),value:"flex",isDisabled:!0},{label:(0,Yu.__)("Flex grow","elementor"),value:"flex-grow",isDisabled:!0},{label:(0,Yu.__)("Flex shrink","elementor"),value:"flex-shrink",isDisabled:!0},{label:(0,Yu.__)("Flex basis","elementor"),value:"flex-basis",isDisabled:!0}]},{label:(0,Yu.__)("Size","elementor"),type:"category",properties:[{label:(0,Yu.__)("Width","elementor"),value:"width",isDisabled:!0},{label:(0,Yu.__)("Height","elementor"),value:"height",isDisabled:!0},{label:(0,Yu.__)("Max height","elementor"),value:"max-height",isDisabled:!0},{label:(0,Yu.__)("Max width","elementor"),value:"max-width",isDisabled:!0},{label:(0,Yu.__)("Min height","elementor"),value:"min-height",isDisabled:!0},{label:(0,Yu.__)("Min width","elementor"),value:"min-width",isDisabled:!0}]},{label:(0,Yu.__)("Position","elementor"),type:"category",properties:[{label:(0,Yu.__)("Top","elementor"),value:"inset-block-start",isDisabled:!0},{label:r?(0,Yu.__)("Right","elementor"):(0,Yu.__)("Left","elementor"),value:"inset-inline-start",isDisabled:!0},{label:r?(0,Yu.__)("Left","elementor"):(0,Yu.__)("Right","elementor"),value:"inset-inline-end",isDisabled:!0},{label:(0,Yu.__)("Bottom","elementor"),value:"inset-block-end",isDisabled:!0},{label:(0,Yu.__)("Z-index","elementor"),value:"z-index",isDisabled:!0}]},{label:(0,Yu.__)("Typography","elementor"),type:"category",properties:[{label:(0,Yu.__)("Font color","elementor"),value:"color",isDisabled:!0},{label:(0,Yu.__)("Font size","elementor"),value:"font-size",isDisabled:!0},{label:(0,Yu.__)("Line height","elementor"),value:"line-height",isDisabled:!0},{label:(0,Yu.__)("Letter spacing","elementor"),value:"letter-spacing",isDisabled:!0},{label:(0,Yu.__)("Word spacing","elementor"),value:"word-spacing",isDisabled:!0},{label:(0,Yu.__)("Font variations","elementor"),value:"font-variation-settings",isDisabled:!0},{label:(0,Yu.__)("Text stroke color","elementor"),value:"-webkit-text-stroke-color",isDisabled:!0}]},{label:(0,Yu.__)("Background","elementor"),type:"category",properties:[{label:(0,Yu.__)("Background color","elementor"),value:"background-color",isDisabled:!0},{label:(0,Yu.__)("Background position","elementor"),value:"background-position",isDisabled:!0},{label:(0,Yu.__)("Box shadow","elementor"),value:"box-shadow",isDisabled:!0}]},{label:(0,Yu.__)("Border","elementor"),type:"category",properties:[{label:(0,Yu.__)("Border (all)","elementor"),value:"border",isDisabled:!0},{label:(0,Yu.__)("Border radius","elementor"),value:"border-radius",isDisabled:!0},{label:(0,Yu.__)("Border color","elementor"),value:"border-color",isDisabled:!0},{label:(0,Yu.__)("Border width","elementor"),value:"border-width",isDisabled:!0}]},{label:(0,Yu.__)("Effects","elementor"),type:"category",properties:[{label:(0,Yu.__)("Opacity","elementor"),value:"opacity",isDisabled:!0},{label:(0,Yu.__)("Transform (all)","elementor"),value:"transform",isDisabled:!0},{label:(0,Yu.__)("Filter (all)","elementor"),value:"filter",isDisabled:!0}]}];return(()=>{if(!(0,Ju.hasProInstalled)())return!0;const r=window.elementorPro?.config?.version;return!!r&&(0,Ju.isVersionGreaterOrEqual)(r,"3.35")})()?o:[o[0]]})(),Zu=Qu.map(r=>({label:r.label,items:r.properties.map(r=>r.label)})),ep=i(70975),tp=i(33176),np={eventName:"click_added_transition",location:"V4 Style Tab",secondaryLocation:"Transition control",trigger:"click"};var rp=__toESM(i(97557)),op=i(97557),ip=i(2020),ap=i(70374),sp=i(24413),lp=i(79513),cp=i(27723),pp=i(70975),dp=i(33176),getBaseEventProperties=(r,o)=>({app_type:o?.appTypes?.editor??"editor",window_name:o?.appTypes?.editor??"editor",interaction_type:o?.triggers?.click??"Click",target_name:r.target_name,target_location:r.target_location??"widget_panel",location_l1:r.location_l1??(0,pp.getSelectedElements)()[0]?.type??"",...r.location_l2&&{location_l2:r.location_l2}}),dispatchPromotionEvent=(r,o)=>{const{dispatchEvent:i,config:a}=(0,dp.getMixpanel)(),{eventName:c,interactionResult:u,interactionDescription:p}=o(a);c&&i?.(c,{...getBaseEventProperties(r,a),interaction_result:u,interaction_description:p})},trackViewPromotion=r=>{dispatchPromotionEvent(r,r=>({eventName:r?.names?.promotions?.viewPromotion,interactionResult:r?.interactionResults?.promotionViewed??"promotion_viewed",interactionDescription:"user_viewed_promotion"}))},trackUpgradePromotionClick=r=>{dispatchPromotionEvent(r,r=>({eventName:r?.names?.promotions?.upgradePromotionClick,interactionResult:r?.interactionResults?.upgradeNow??"upgrade_now",interactionDescription:"user_clicked_upgrade_now"}))};function getTransitionPropertyByValue(r){if(!r?.value)return null;for(const o of Qu)for(const i of o.properties)if(i.value===r.value)return i;return null}var includeCurrentValueInOptions=(r,o)=>o.filter(o=>o!==r.key.value),TransitionSelector=({recentlyUsedList:r=[],disabledItems:o=[],showPromotion:i=!1})=>{const{value:a,setValue:c}=useBoundProp(ip.keyValuePropTypeUtil),{key:{value:u}}=a,p=(0,op.useRef)(null),g=(0,lp.usePopupState)({variant:"popover"}),v=(0,op.useMemo)(()=>new Set(Qu.filter(r=>r.properties.some(r=>r.isDisabled)).map(r=>r.label)),[]);return rp.createElement(lp.Box,{ref:p},rp.createElement(ControlActions,null,rp.createElement(lp.UnstableTag,{variant:"outlined",label:u,endIcon:rp.createElement(sp.ChevronDownIcon,{fontSize:"tiny"}),...(0,lp.bindTrigger)(g),fullWidth:!0})),rp.createElement(lp.Popover,{disablePortal:!0,disableScrollLock:!0,...(0,lp.bindPopover)(g),anchorReference:"anchorPosition",anchorPosition:(()=>{if(!p.current)return;const r=p.current.getBoundingClientRect();return{top:r.top,left:r.right+36}})(),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}},rp.createElement(ItemSelector,{itemsList:(()=>{const o=r.map(r=>getTransitionPropertyByValue({value:r,$$type:"string"})?.label).filter(r=>!!r),i=Zu.map(r=>({...r,items:r.items.filter(r=>!o.includes(r))}));if(0===o.length)return i;const[a,...c]=i;return[a,{label:(0,cp.__)("Recently Used","elementor"),items:o},...c]})(),selectedItem:u,onItemChange:r=>{const o=(r=>{for(const o of Qu){const i=o.properties.find(o=>o.label===r);if(i)return{key:{value:i.label,$$type:"string"},value:{value:i.value,$$type:"string"}}}return null})(r);o&&(c(o),g.close())},onClose:g.close,sectionWidth:268,title:(0,cp.__)("Transition Property","elementor"),icon:sp.VariationsIcon,disabledItems:includeCurrentValueInOptions(a,o),categoryItemContentTemplate:r=>rp.createElement(lp.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},rp.createElement("span",null,r.value),i&&v.has(r.value)&&rp.createElement(ap.PromotionChip,null)),footer:i?rp.createElement(ap.PromotionAlert,{message:(0,cp.__)("Upgrade to customize transition properties and control effects.","elementor"),upgradeUrl:"https://go.elementor.com/go-pro-transitions-modal/",onCtaClick:()=>trackUpgradePromotionClick({target_name:"transition_property",location_l2:"style"})}):null})))},fp={variant:"time",units:["s","ms"],defaultUnit:"ms"},hp=(0,ju.createArrayPropUtils)(ju.selectionSizePropTypeUtil.key,ju.selectionSizePropTypeUtil.schema,"transition");!function subscribeToTransitionEvent(){en.subscribe("transition-item-added",r=>{const o=r,i=o?.itemValue?.selection?.value?.value?.value,a=(0,ep.getSelectedElements)(),c=a[0]?.type??null;(0,tp.trackEvent)({transition_type:i??"unknown",...np,widget_type:c})})}();var getSelectionSizeProps=(r,o,i)=>({selectionLabel:(0,Uu.__)("Type","elementor"),sizeLabel:(0,Uu.__)("Duration","elementor"),selectionConfig:{component:TransitionSelector,props:{recentlyUsedList:r,disabledItems:o,showPromotion:i}},sizeConfigMap:{...Qu.reduce((r,o)=>(o.properties.forEach(o=>{r[o.value]=fp}),r),{})}}),isItemDisabled=r=>{const o=getTransitionPropertyByValue(r.value.selection.value?.value);return!!o&&!!o.isDisabled},getChildControlConfig=(r,o,i)=>({propTypeUtil:ju.selectionSizePropTypeUtil,component:Gu,props:getSelectionSizeProps(r,o,i),isItemDisabled:isItemDisabled}),isPropertyUsed=(r,o)=>(r??[]).some(r=>r?.value?.selection?.value?.value?.value===o.value),getInitialValue=(r=[])=>{if(!r?.length)return Xu;for(const o of Qu)for(const i of o.properties)if(!isPropertyUsed(r,i))return{...Xu,selection:{$$type:"key-value",value:{key:{value:i.label,$$type:"string"},value:{value:i.value,$$type:"string"}}}};return Xu},mp=Fu.createElement(Vu.Alert,{sx:{width:280,gap:.5},color:"secondary",icon:Fu.createElement(Bu.InfoCircleFilledIcon,null)},Fu.createElement(Vu.AlertTitle,null,(0,Uu.__)("Transitions","elementor")),Fu.createElement(Vu.Box,{component:"span"},Fu.createElement(Vu.Typography,{variant:"body2"},(0,Uu.__)("Switch to 'Normal' state to add a transition.","elementor")))),gp=createControl(({recentlyUsedListGetter:r,currentStyleState:o})=>{const i=null===o,[a,c]=(0,zu.useState)([]),u=(0,$u.hasProInstalled)(),{value:p,setValue:g}=useBoundProp(hp),{allDisabled:v,proDisabled:b}=(0,zu.useMemo)(()=>((r=[])=>{const o=(r||[]).map(r=>r.value?.selection?.value?.key?.value),i=[];return Qu.forEach(r=>{const a=r.properties.filter(r=>r.isDisabled&&!o.includes(r.label)).map(r=>r.label);i.push(...a)}),{allDisabled:[...o,...i],proDisabled:i}})(p),[p]),k=(0,zu.useMemo)(()=>{const r=new Set;return Qu.forEach(o=>{o.properties.forEach(o=>{o.isDisabled&&!u||r.add(o.value)})}),r},[u]);(0,zu.useEffect)(()=>{if(!p||0===p.length)return;const r=p.filter(r=>{const o=r?.value?.selection?.value?.value?.value??"";return k.has(o)});r.length!==p.length&&g(r)},[k]),(0,zu.useEffect)(()=>{r().then(c)},[r]);const E=(0,zu.useMemo)(()=>((r=[])=>!!r?.length&&Qu.every(o=>o.properties.every(o=>o.isDisabled||!!r?.find(r=>r.value?.selection?.value?.value?.value===o.value))))(p),[p]),w=!i||E;return Fu.createElement(Wl,{label:(0,Uu.__)("Transitions","elementor"),repeaterLabel:(0,Uu.__)("Transitions","elementor"),patternLabel:"${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",placeholder:(0,Uu.__)("Empty Transition","elementor"),showDuplicate:!1,showToggle:!0,initialValues:getInitialValue(p),childControlConfig:getChildControlConfig(a,v,b.length>0),propKey:"transition",addItemTooltipProps:{disabled:w,enableTooltip:!i,tooltipContent:mp}})}),vp=__toESM(i(97557)),yp=__toESM(i(74353)),bp=i(2020),kp=i(2020),Ep=i(79513),Sp=createControl(({inputDisabled:r})=>{const{value:o,setValue:i,...a}=useBoundProp(kp.DateTimePropTypeUtil),handleChange=(r,a)=>{const c=a.bind,u=r[c];if((0,bp.isTransformable)(u))return i({...o,[c]:u});let p="";if(u){const r=u;p="date"===c?r.format("YYYY-MM-DD"):r.format("HH:mm")}i({...o,[c]:{$$type:"string",value:p}})};return vp.createElement(PropProvider,{...a,value:o,setValue:i},vp.createElement(ControlActions,null,vp.createElement(Ep.LocalizationProvider,null,vp.createElement(Ep.Box,{display:"flex",gap:1,alignItems:"center"},vp.createElement(PropKeyProvider,{bind:"date"},vp.createElement(Ep.DatePicker,{value:(r=>{if(!r)return null;const o=yp.default(r);return o&&"function"==typeof o.isValid&&o.isValid()?o:null})(bp.stringPropTypeUtil.extract(o?.date)),onChange:r=>handleChange({date:r},{bind:"date"}),disabled:r,slotProps:{textField:{size:"tiny"},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}}})),vp.createElement(PropKeyProvider,{bind:"time"},vp.createElement(Ep.TimePicker,{value:(r=>{if(!r)return null;const[o,i]=r.split(":"),a=Number.parseInt(o??"",10),c=Number.parseInt(i??"",10);if(Number.isNaN(a)||Number.isNaN(c))return null;return yp.default().hour(a).minute(c).second(0).millisecond(0)})(bp.stringPropTypeUtil.extract(o?.time)),onChange:r=>handleChange({time:r},{bind:"time"}),disabled:r,slotProps:{textField:{size:"tiny"},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}}}))))))}),wp=__toESM(i(97557)),xp=i(2020),Cp=i(79513),_p=i(27723),Tp=__toESM(i(97557)),Op=i(2020),Pp=i(79513),Ap=__toESM(i(74353));function isValidDayjs(r){return!!r&&"function"==typeof r.isValid&&r.isValid()}function parseDateString(r){if(!r)return null;const o=Ap.default(r);return isValidDayjs(o)?o:null}function parseTimeString(r){if(!r)return null;const[o,i,a]=r.split(":"),c=Number.parseInt(o??"",10),u=Number.parseInt(i??"",10),p=Number.parseInt(a??"0",10);if(Number.isNaN(c)||Number.isNaN(u))return null;return Ap.default().hour(c).minute(u).second(Number.isNaN(p)?0:p).millisecond(0)}var Mp=createControl(({inputDisabled:r,ariaLabel:o,error:i,coerceInvalidToNull:a=!1})=>{const{value:c,setValue:u,disabled:p}=useBoundProp(Op.dateStringPropTypeUtil),g=r??p,v={textField:{size:"tiny",fullWidth:!0,error:i,inputProps:o?{"aria-label":o}:void 0},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}};return Tp.createElement(Pp.LocalizationProvider,null,Tp.createElement(ControlActions,null,Tp.createElement(Pp.DatePicker,{value:parseDateString(c??""),onChange:r=>((r,o)=>{!r||a&&!isValidDayjs(r)?u(null):u(r.format(o))})(r,"YYYY-MM-DD"),disabled:g,slotProps:v})))}),Np={min:(0,_p.__)("Min date","elementor"),max:(0,_p.__)("Max date","elementor")},Rp=(0,_p.__)("Max date must be on or after Min date","elementor"),Ip=createControl(()=>{const{value:r,setValue:o,...i}=useBoundProp(xp.dateRangePropTypeUtil),a=xp.dateStringPropTypeUtil.extract(r?.min),c=xp.dateStringPropTypeUtil.extract(r?.max),u=(g=c,!(!(p=a)||!g)&&g<p);var p,g;return wp.createElement(PropProvider,{...i,value:r,setValue:o},wp.createElement(Cp.Stack,{gap:.75},wp.createElement(Cp.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},wp.createElement(Cp.Grid,{container:!0,gap:.75,alignItems:"center"},wp.createElement(Cp.Grid,{item:!0,xs:12},wp.createElement(ControlFormLabel,null,Np.min)),wp.createElement(Cp.Grid,{item:!0,xs:12},wp.createElement(BoundDateStringControl,{bind:"min",ariaLabel:Np.min,error:u}))),wp.createElement(Cp.Grid,{container:!0,gap:.75,alignItems:"center"},wp.createElement(Cp.Grid,{item:!0,xs:12},wp.createElement(ControlFormLabel,null,Np.max)),wp.createElement(Cp.Grid,{item:!0,xs:12},wp.createElement(BoundDateStringControl,{bind:"max",ariaLabel:Np.max,error:u})))),u&&wp.createElement(Cp.FormHelperText,{error:!0},Rp)))}),BoundDateStringControl=({bind:r,ariaLabel:o,error:i})=>wp.createElement(PropKeyProvider,{bind:r},wp.createElement(Mp,{ariaLabel:o,error:i,coerceInvalidToNull:!0})),Dp=__toESM(i(97557)),Lp=i(2020),Fp=i(79513),zp=createControl(({inputDisabled:r,ariaLabel:o,error:i,coerceInvalidToNull:a=!1})=>{const{value:c,setValue:u,disabled:p}=useBoundProp(Lp.timeStringPropTypeUtil),g=r??p,v={textField:{size:"tiny",fullWidth:!0,error:i,inputProps:o?{"aria-label":o}:void 0},openPickerButton:{size:"tiny"},openPickerIcon:{fontSize:"tiny"}};return Dp.createElement(Fp.LocalizationProvider,null,Dp.createElement(ControlActions,null,Dp.createElement(Fp.TimePicker,{value:parseTimeString(c??""),onChange:r=>((r,o)=>{!r||a&&!isValidDayjs(r)?u(null):u(r.format(o))})(r,"HH:mm"),disabled:g,slotProps:v})))}),jp=__toESM(i(97557)),Bp=i(2020),Vp=i(79513),$p=i(27723),Up={min:(0,$p.__)("Start time","elementor"),max:(0,$p.__)("End time","elementor")},Hp=createControl(()=>{const{value:r,setValue:o,...i}=useBoundProp(Bp.timeRangePropTypeUtil);return jp.createElement(PropProvider,{...i,value:r,setValue:o},jp.createElement(Vp.Stack,{direction:"row",gap:2,flexWrap:"nowrap"},jp.createElement(Vp.Grid,{container:!0,gap:.75,alignItems:"center"},jp.createElement(Vp.Grid,{item:!0,xs:12},jp.createElement(ControlFormLabel,null,Up.min)),jp.createElement(Vp.Grid,{item:!0,xs:12},jp.createElement(BoundTimeStringControl,{bind:"min",ariaLabel:Up.min}))),jp.createElement(Vp.Grid,{container:!0,gap:.75,alignItems:"center"},jp.createElement(Vp.Grid,{item:!0,xs:12},jp.createElement(ControlFormLabel,null,Up.max)),jp.createElement(Vp.Grid,{item:!0,xs:12},jp.createElement(BoundTimeStringControl,{bind:"max",ariaLabel:Up.max})))))}),BoundTimeStringControl=({bind:r,ariaLabel:o})=>jp.createElement(PropKeyProvider,{bind:r},jp.createElement(zp,{ariaLabel:o,coerceInvalidToNull:!0})),Wp=__toESM(i(97557)),qp=i(97557),Kp=i(2020),Gp=i(79513),Jp=i(22444),Yp=__toESM(i(97557)),Xp=i(97557),Qp=i(79513),Zp=__toESM(i(27096)),ed=__toESM(i(62430)),td=__toESM(i(29656)),nd=__toESM(i(74951)),rd=__toESM(i(39007)),od=__toESM(i(81531)),id=__toESM(i(5067)),ad=__toESM(i(38393)),sd=__toESM(i(5820)),ld=__toESM(i(14841)),cd=__toESM(i(50976)),ud=__toESM(i(19721)),pd=i(83574);function htmlToPlainText(r){if(!r)return"";const o=r.replace(/<br\s*\/?>/gi,"\n").replace(/<\/p>\s*<p[^>]*>/gi,"\n");return(new DOMParser).parseFromString(o,"text/html").body.textContent??""}var dd="i",fd="b",hd="u",md=Yp.forwardRef((r,o)=>{const{value:i,setValue:a,placeholder:c=null,editorProps:u={},elementClasses:p="",autofocus:g=!1,sx:v={},onBlur:b,expectedTag:k=null,onEditorCreate:E,wrapperClassName:w,onSelectionEnd:x,mountElement:C=null}=r,_=(0,Xp.useRef)(null),T=(0,Xp.useRef)(b);T.current=b;const P=k?"block+":"inline*",editedElementAttributes=r=>({...r,class:p}),A=(0,pd.useEditor)({...C?{element:C}:{},extensions:[ed.default.extend({content:P}),id.default.extend({renderHTML({HTMLAttributes:r}){return[k??"p",editedElementAttributes(r),0]}}),nd.default.extend({renderHTML({node:r,HTMLAttributes:o}){if(k)return[k,editedElementAttributes(o),0];return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,editedElementAttributes(o),0]}}).configure({levels:[1,2,3,4,5,6]}),od.default.configure({openOnClick:!1}),cd.default,Zp.default,rd.default,ad.default,ld.default,sd.default,ud.default,td.default.extend({addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.setHardBreak()}}})],content:i,onUpdate:({editor:r})=>{const o=r.getHTML();a(function isEmpty(r=""){if(!r)return!0;const o=document.createElement("div");return o.innerHTML=r,!o.textContent?.length}(o)?null:o)},autofocus:g,editorProps:{...u,handleDOMEvents:{keydown:(r,o)=>{"Escape"===o.key&&T.current?.(),!o.metaKey&&!o.ctrlKey||o.altKey||[dd,fd,hd].includes(o.key)&&o.stopPropagation()}},attributes:{...u.attributes??{},role:"textbox",...c?{"data-placeholder":htmlToPlainText(c)}:{},...null===i||""===i?{class:"is-empty"}:{}}},onCreate:E?({editor:r})=>E(r):void 0,onBlur:C?void 0:()=>T.current?.(),onSelectionUpdate:x?({editor:r})=>x(r.view):void 0});return useOnUpdate(()=>{if(!A)return;A.getHTML()!==i&&A.commands.setContent(i,{emitUpdate:!1})},[A,i]),C?null:Yp.createElement(Qp.Box,{ref:_,sx:v,className:w},Yp.createElement(pd.EditorContent,{ref:o,editor:A}))}),useOnUpdate=(r,o)=>{const i=(0,Xp.useRef)(!1);(0,Xp.useEffect)(()=>{i.current?r():i.current=!0},o)},gd=createControl(({sx:r,attributes:o,props:i})=>{const{value:a,setValue:c,placeholder:u}=useBoundProp(Kp.htmlV3PropTypeUtil),p=Kp.stringPropTypeUtil.extract(a?.content??null)??"",g=(0,qp.useMemo)(()=>(0,Jp.debounce)(r=>{const o=(0,Kp.parseHtmlChildren)(r);c({content:o.content?Kp.stringPropTypeUtil.create(o.content):null,children:o.children})},300),[c]),v=(0,qp.useCallback)(r=>{const o=r??"";c({content:o?Kp.stringPropTypeUtil.create(o):null,children:a?.children??[]}),g(o)},[c,a?.children,g]);return(0,qp.useEffect)(()=>()=>g.cancel(),[g]),Wp.createElement(ControlActions,null,Wp.createElement(Gp.Box,{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"},...r},...o,...i},Wp.createElement(md,{value:p,setValue:v,placeholder:u?.content?.value??null})))}),vd=__toESM(i(97557)),yd=i(2020),bd=i(70374),kd=i(79513),Ed=i(27723),Sd=__toESM(i(97557)),wd=i(70374),xd=i(79513),Cd=i(27723),_d=i(70975),Td=i(2020),Od=i(5527),Pd=["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 extractStringPropValue(r){return Td.stringPropTypeUtil.extract(r)}function getSettingWithDefault(r,o,i){const a=r.settings.get(i);if(null!=a)return a;const c=(0,_d.getWidgetsCache)()?.[o]?.atomic_props_schema;return c?.[i]?.default??null}function useFormFieldSuggestions(r){return(0,Od.__privateUseListenTo)([(0,Od.v1ReadyEvent)(),(0,Od.commandEndEvent)("document/elements/create"),(0,Od.commandEndEvent)("document/elements/delete"),(0,Od.commandEndEvent)("document/elements/set-settings")],()=>{const o=(0,_d.getSelectedElements)()[0];if(!o)return[];const i=function getFormContainer(r){let o=(0,_d.getContainer)(r);for(;o;){if("e-form"===o.model.get("elType"))return o;o=o.parent??null}return null}(o.id);if(!i?.children)return[];const a=[],c=new Set;return i.children.forEachRecursive?.(o=>{const i=o.model.get("widgetType");if(!i||!function isFormFieldWidgetType(r){return Pd.includes(r)}(i))return;if(r?.inputType){if(extractStringPropValue(getSettingWithDefault(o,i,"type"))!==r.inputType)return}const u=function getFieldCssId(r,o){return extractStringPropValue(getSettingWithDefault(r,o,"_cssid"))}(o,i);u&&!c.has(u)&&(c.add(u),a.push({label:u,value:u}))}),a},[])}var Ad=__toESM(i(97557)),Md=i(97557),Nd=i(2020),Rd=i(79513),Id=i(59618),Dd=i(22444),Ld=new Set([" ",","]);function isValidEmail(r){return Id.z.string().email().safeParse(r).success}var EmailChipsField=({fieldLabel:r,placeholder:o})=>{const{value:i,setValue:a,disabled:c}=useBoundProp(Nd.stringArrayPropTypeUtil),[u,p]=(0,Md.useState)(""),g=i||[],v=g.map(r=>Nd.stringPropTypeUtil.extract(r)).filter(r=>null!==r),tryAddChip=r=>{const o=r.trim();o&&!v.includes(o)&&isValidEmail(o)&&(a([...g,Nd.stringPropTypeUtil.create(o)]),p(""))},handleKeyDown=r=>{Ld.has(r.key)&&u.trim()&&(r.preventDefault(),tryAddChip(u))};return Ad.createElement(Rd.Grid,{container:!0,direction:"column",gap:.5},Ad.createElement(Rd.Grid,{item:!0},Ad.createElement(ControlFormLabel,null,r)),Ad.createElement(Rd.Grid,{item:!0},Ad.createElement(Rd.Autocomplete,{fullWidth:!0,multiple:!0,freeSolo:!0,size:"tiny",disabled:c,inputValue:u,onInputChange:(r,o,i)=>{"reset"!==i&&p(o)},value:v,onChange:(r,o)=>{const i=[];for(const r of o){const o=r.trim();o&&isValidEmail(o)&&i.push(Nd.stringPropTypeUtil.create(o))}a(i),p("")},options:[],onBlur:r=>{const o=r.target;tryAddChip(o.value),p("")},getOptionLabel:r=>r,isOptionEqualToValue:(r,o)=>r===o,renderInput:r=>Ad.createElement(Rd.TextField,{...r,placeholder:o,onKeyDown:handleKeyDown}),renderTags:(r,o)=>Ad.createElement(ChipsList,{getLabel:r=>r,getTagProps:o,values:r})})))},Fd=__toESM(i(97557)),zd=i(79513),EmailField=({bind:r,label:o,placeholder:i})=>Fd.createElement(PropKeyProvider,{bind:r},Fd.createElement(zd.Grid,{container:!0,direction:"column",gap:.5},Fd.createElement(zd.Grid,{item:!0},Fd.createElement(ControlFormLabel,null,o)),Fd.createElement(zd.Grid,{item:!0},Fd.createElement(Me,{placeholder:i})))),SendToField=({placeholder:r})=>Sd.createElement(EmailChipsField,{fieldLabel:(0,Cd.__)("Send to","elementor"),placeholder:r}),SubjectField=()=>Sd.createElement(EmailField,{bind:"subject",label:(0,Cd.__)("Email subject","elementor"),placeholder:(0,Cd.__)("New form submission","elementor")}),MessageField=()=>{const r=useFormFieldSuggestions();return Sd.createElement(PropKeyProvider,{bind:"message"},Sd.createElement(xd.Grid,{container:!0,direction:"column",gap:.5},Sd.createElement(xd.Grid,{item:!0},Sd.createElement(ControlFormLabel,null,(0,Cd.__)("Message","elementor"))),Sd.createElement(xd.Grid,{item:!0},Sd.createElement(Ve,{suggestions:r})),Sd.createElement(xd.Grid,{item:!0},Sd.createElement(wd.InfoAlert,null,(()=>{if(!(0,Dd.hasProInstalled)())return!0;const r=window.elementorPro?.config?.version;return!!r&&(0,Dd.isVersionGreaterOrEqual)(r,"4.1.0")})()?(0,Cd.__)("[all-fields] shortcode sends all fields. Type @ to insert specific fields and customize your message.","elementor"):(0,Cd.__)("[all-fields] shortcode sends all fields.","elementor")))))},FromEmailField=()=>Sd.createElement(EmailField,{bind:"from",label:(0,Cd.__)("From email","elementor"),placeholder:(0,Cd.__)("What email should appear as the sender?","elementor")}),FromNameField=()=>Sd.createElement(EmailField,{bind:"from-name",label:(0,Cd.__)("From name","elementor"),placeholder:(0,Cd.__)("What name should appear as the sender?","elementor")}),ReplyToField=()=>{const r=useFormFieldSuggestions({inputType:"email"});return Sd.createElement(PropKeyProvider,{bind:"reply-to"},Sd.createElement(xd.Grid,{container:!0,direction:"column",gap:.5},Sd.createElement(xd.Grid,{item:!0},Sd.createElement(ControlFormLabel,null,(0,Cd.__)("Reply-to","elementor"))),Sd.createElement(xd.Grid,{item:!0},Sd.createElement(Ve,{suggestions:r,rows:1,triggerPosition:"start",placeholder:(0,Cd.__)("You can type @ to insert an email field","elementor")}))))},CcField=()=>Sd.createElement(PropKeyProvider,{bind:"cc"},Sd.createElement(EmailChipsField,{fieldLabel:(0,Cd.__)("Cc","elementor")})),BccField=()=>Sd.createElement(PropKeyProvider,{bind:"bcc"},Sd.createElement(EmailChipsField,{fieldLabel:(0,Cd.__)("Bcc","elementor")})),MetaDataField=()=>Sd.createElement(PropKeyProvider,{bind:"meta-data"},Sd.createElement(xd.Stack,{gap:.5},Sd.createElement(ControlFormLabel,null,(0,Cd.__)("Metadata","elementor")),Sd.createElement(oo,{options:[{label:(0,Cd.__)("Date","elementor"),value:"date"},{label:(0,Cd.__)("Time","elementor"),value:"time"},{label:(0,Cd.__)("Page URL","elementor"),value:"page-url"},{label:(0,Cd.__)("User agent","elementor"),value:"user-agent"},{label:(0,Cd.__)("Credit","elementor"),value:"credit"}]}))),SendAsField=()=>Sd.createElement(PropKeyProvider,{bind:"send-as"},Sd.createElement(xd.Grid,{container:!0,direction:"column",gap:.5},Sd.createElement(xd.Grid,{item:!0},Sd.createElement(ControlFormLabel,null,(0,Cd.__)("Send as","elementor"))),Sd.createElement(xd.Grid,{item:!0},Sd.createElement(_e,{options:[{label:(0,Cd.__)("HTML","elementor"),value:"html"},{label:(0,Cd.__)("Plain Text","elementor"),value:"plain"}]})))),jd=createControl(({toPlaceholder:r,label:o})=>{const{value:i,setValue:a,...c}=useBoundProp(yd.emailsPropTypeUtil);return vd.createElement(PropProvider,{...c,value:i,setValue:a},vd.createElement(kd.Stack,{gap:2},vd.createElement(ControlLabel,null,o?o+" "+(0,Ed.__)("settings","elementor"):(0,Ed.__)("Email settings","elementor")),vd.createElement(PropKeyProvider,{bind:"to"},vd.createElement(SendToField,{placeholder:r})),vd.createElement(SubjectField,null),vd.createElement(MessageField,null),vd.createElement(FromEmailField,null),vd.createElement(AdvancedSettings,null)))}),AdvancedSettings=()=>vd.createElement(bd.CollapsibleContent,{defaultOpen:!1},vd.createElement(kd.Box,{sx:{pt:2}},vd.createElement(kd.Stack,{gap:2},vd.createElement(FromNameField,null),vd.createElement(ReplyToField,null),vd.createElement(CcField,null),vd.createElement(BccField,null),vd.createElement(kd.Divider,null),vd.createElement(MetaDataField,null),vd.createElement(SendAsField,null)))),Bd=__toESM(i(97557)),Vd=i(70374),$d=i(79513),Ud=i(27723),Hd=createControl(({label:r,options:o})=>Bd.createElement($d.Grid,{container:!0,direction:"column",gap:1},r&&Bd.createElement($d.Grid,{item:!0},Bd.createElement(ControlFormLabel,null,r)),Bd.createElement($d.Grid,{item:!0},Bd.createElement(_e,{options:o})),Bd.createElement($d.Grid,{item:!0},Bd.createElement(Vd.InfoAlert,null,(0,Ud.__)("Linked uploads are saved to the server. Direct attachments will not appear under Submissions.","elementor"))))),Wd=__toESM(i(97557)),qd=i(2020),Kd=i(79513),Gd=createControl(({placeholder:r,error:o,inputValue:i,inputDisabled:a,helperText:c,sx:u,ariaLabel:p})=>{const{value:g,setValue:v,disabled:b,placeholder:k}=useBoundProp(qd.spanPropTypeUtil),E=r??k??"e.g: 'span 2' or '1 / 3'";return Wd.createElement(ControlActions,null,Wd.createElement(Kd.TextField,{size:"tiny",fullWidth:!0,disabled:a??b,value:i??g??"",onChange:r=>{const o=r.target.value;v(""===o?null:o)},placeholder:E,error:o,helperText:c,sx:u,inputProps:{...p?{"aria-label":p}:{}}}))}),Jd=__toESM(i(97557)),Yd=i(97557),Xd=i(24413),Qd=i(79513),Zd=i(27723),ef=__toESM(i(97557)),tf=i(97557),nf=i(70374),rf=i(79513);var of=(0,tf.forwardRef)(({promotionKey:r,children:o,trackingData:i},a)=>{const[c,u]=(0,tf.useState)(!1),p=function getV4Promotion(r){return window.elementor?.config?.v4Promotions?.[r]}(r),g=(0,tf.useCallback)(()=>{u(r=>(r||trackViewPromotion(i),!r))},[i]);return(0,tf.useImperativeHandle)(a,()=>({toggle:g}),[g]),ef.createElement(ef.Fragment,null,p&&ef.createElement(nf.PromotionInfotip,{title:p.title,content:p.content,assetUrl:p.image,ctaUrl:p.ctaUrl,open:c,onClose:r=>{r.stopPropagation(),u(!1)},onCtaClick:()=>trackUpgradePromotionClick(i)},ef.createElement(rf.Box,{onClick:r=>{r.stopPropagation(),g()},sx:{cursor:"pointer",display:"inline-flex"}},o??ef.createElement(nf.PromotionChip,null))))}),af=(0,Zd.__)("Display Conditions","elementor"),sf={target_name:"display_conditions",location_l2:"general"},lf=createControl(()=>{const r=(0,Yd.useRef)(null);return Jd.createElement(Qd.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",alignItems:"center"}},Jd.createElement(of,{ref:r,promotionKey:"displayConditions",trackingData:sf}),Jd.createElement(Qd.Tooltip,{title:af,placement:"top"},Jd.createElement(Qd.IconButton,{size:"tiny","aria-label":af,"data-behavior":"display-conditions",onClick:()=>r.current?.toggle(),sx:{border:"1px solid",borderColor:"divider",borderRadius:1}},Jd.createElement(Xd.SitemapIcon,{fontSize:"tiny",color:"disabled"}))))}),cf=__toESM(i(97557)),uf=i(97557),pf=i(24413),df=i(79513),ff=(0,i(27723).__)("Attributes","elementor"),hf={target_name:"attributes",location_l2:"general"},mf=createControl(()=>{const r=(0,uf.useRef)(null);return cf.createElement(df.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",alignItems:"center"}},cf.createElement(of,{ref:r,promotionKey:"attributes",trackingData:hf}),cf.createElement(df.Tooltip,{title:ff,placement:"top"},cf.createElement(pf.PlusIcon,{"aria-label":ff,fontSize:"tiny",color:"disabled",onClick:()=>r.current?.toggle(),sx:{cursor:"pointer"}})))}),gf=__toESM(i(97557)),vf=i(24413),yf=i(79513),bf=(0,yf.styled)(yf.IconButton)(({theme:r})=>({width:r.spacing(2.5),height:r.spacing(2.5)})),ClearIconButton=({tooltipText:r,onClick:o,disabled:i,size:a="tiny"})=>gf.createElement(yf.Tooltip,{title:r,placement:"top",disableInteractive:!0},gf.createElement(bf,{"aria-label":r,size:a,onClick:o,disabled:i},gf.createElement(vf.BrushBigIcon,{fontSize:a}))),kf=__toESM(i(97557)),Ef=i(97557),Sf=i(24413),wf=i(79513),xf=i(27723),Cf="tiny",Repeater3=({label:r,itemSettings:o,disabled:i=!1,openOnAdd:a=!1,values:c=[],setValues:u,showDuplicate:p=!0,showToggle:g=!0,showRemove:v=!0,disableAddItemButton:b=!1,addButtonInfotipContent:k,openItem:E=-1,isSortable:w=!0})=>{const[x,C]=(0,Ef.useState)(E),_=c.map((r,i)=>w&&"getId"in o?o.getId({item:r,index:i}):String(i)),T=i||b,P=T&&k,A=kf.createElement(wf.IconButton,{size:Cf,sx:{ml:"auto"},disabled:T,onClick:()=>{const r=structuredClone(o.initialValues),i=c.length;u([...c,r],{},{action:{type:"add",payload:[{index:i,item:r}]}}),a&&C(i)},"aria-label":(0,xf.__)("Add item","elementor")},kf.createElement(Sf.PlusIcon,{fontSize:Cf}));return kf.createElement(SectionContent,{gap:2},kf.createElement(sr,{label:r,adornment:ControlAdornments},P?kf.createElement(wf.Infotip,{placement:"right",content:k,color:"secondary",slotProps:{popper:{sx:{width:300}}}},kf.createElement(wf.Box,{sx:{...T?{cursor:"not-allowed"}:{}}},A)):A),0<_.length&&kf.createElement(SortableProvider,{value:_,onChange:(r,o)=>{u(r.map(r=>c[_.indexOf(r)]),{},{action:{type:"reorder",payload:{...o}}})}},_.map(r=>{const b=_.indexOf(r),k=c[b];return k?kf.createElement(SortableItem,{id:r,key:`sortable-${r}`,disabled:!w},kf.createElement(RepeaterItem,{disabled:i,propDisabled:k?.disabled,label:kf.createElement(Tn,{value:k},kf.createElement(o.Label,{value:k,index:b})),startIcon:kf.createElement(Cn,{value:k},kf.createElement(o.Icon,{value:k})),removeItem:()=>(r=>{const o=c[r];u(c.filter((o,i)=>i!==r),{},{action:{type:"remove",payload:[{index:r,item:o}]}})})(b),duplicateItem:()=>(r=>{const o=structuredClone(c[r]),i=1+r;u([...c.slice(0,i),o,...c.slice(i)],{},{action:{type:"duplicate",payload:[{index:r,item:o}]}})})(b),toggleDisableItem:()=>(r=>{u(c.map((o,i)=>{if(i===r){const{disabled:r,...i}=o;return{...i,...r?{}:{disabled:!0}}}return o}),{},{action:{type:"toggle-disable"}})})(b),openOnMount:a&&x===b,onOpen:()=>C(-1),onPopoverOpen:o.onPopoverOpen,onPopoverClose:o.onPopoverClose,showDuplicate:p,showToggle:g,showRemove:v,actions:o.actions,value:k},r=>kf.createElement(o.Content,{...r,value:k,bind:String(b),index:b}))):null})))},RepeaterItem=({label:r,propDisabled:o,startIcon:i,children:a,removeItem:c,duplicateItem:u,toggleDisableItem:p,openOnMount:g,onOpen:v,onPopoverOpen:b,onPopoverClose:k,showDuplicate:E,showToggle:w,showRemove:x,disabled:C,actions:_,value:T})=>{const P=k?()=>k(T):void 0,{popoverState:A,popoverProps:N,ref:R,setRef:I}=usePopover(g,()=>{v(),b?.(T)},P),L=(0,wf.bindTrigger)(A);usePopoverDismiss({isOpen:A.isOpen,onClose:N.onClose});const z=(0,xf.__)("Duplicate","elementor"),j=o?(0,xf.__)("Show","elementor"):(0,xf.__)("Hide","elementor"),B=(0,xf.__)("Remove","elementor");return kf.createElement(wf.Box,{sx:{display:"contents"}},kf.createElement(wn,{disabled:C,label:r,ref:I,"aria-label":(0,xf.__)("Open item","elementor"),...L,onClick:r=>{L.onClick(r),A.isOpen||b?.(T)},startIcon:i,actions:kf.createElement(kf.Fragment,null,E&&kf.createElement(wf.Tooltip,{title:z,placement:"top"},kf.createElement(wf.IconButton,{size:Cf,onClick:u,"aria-label":z},kf.createElement(Sf.CopyIcon,{fontSize:Cf}))),w&&kf.createElement(wf.Tooltip,{title:j,placement:"top"},kf.createElement(wf.IconButton,{size:Cf,onClick:p,"aria-label":j},o?kf.createElement(Sf.EyeOffIcon,{fontSize:Cf}):kf.createElement(Sf.EyeIcon,{fontSize:Cf}))),_?.(T),x&&kf.createElement(wf.Tooltip,{title:B,placement:"top"},kf.createElement(wf.IconButton,{size:Cf,onClick:c,"aria-label":B},kf.createElement(Sf.XIcon,{fontSize:Cf}))))}),kf.createElement(RepeaterPopover,{width:R?.getBoundingClientRect().width,...N,anchorEl:R},kf.createElement(wf.Box,null,a({anchorEl:R}))))},usePopover=(r,o,i)=>{const[a,c]=(0,Ef.useState)(null),u=(0,wf.usePopupState)({variant:"popover"}),p=(0,wf.bindPopover)(u);(0,Ef.useEffect)(()=>{r&&a&&(u.open(a),o?.())},[a]);return{popoverState:u,ref:a,setRef:c,popoverProps:{...p,onClose:()=>{p.onClose?.(),i?.()}}}},_f=__toESM(i(97557)),Tf=i(97557),Of=i(70975),Pf=i(24413),Af=i(79513),Mf=i(83574),Nf=i(27723),Rf=__toESM(i(97557)),If=i(97557),Df=i(24413),Lf=i(79513),Ff=i(27723),UrlPopover=({popupState:r,restoreValue:o,anchorRef:i,value:a,onChange:c,openInNewTab:u,onToggleNewTab:p})=>{const g=(0,If.useRef)(null);(0,If.useEffect)(()=>{r.isOpen&&requestAnimationFrame(()=>g.current?.focus())},[r.isOpen]);const handleClose=()=>{o(),r.close()};return Rf.createElement(Lf.Popover,{slotProps:{paper:{sx:{borderRadius:"16px",width:i.current?.offsetWidth+"px",marginTop:-1}}},...(0,Lf.bindPopover)(r),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:handleClose},Rf.createElement(Lf.Stack,{direction:"row",alignItems:"center",gap:1,sx:{p:1.5}},Rf.createElement(Lf.TextField,{value:a,onChange:c,size:"tiny",fullWidth:!0,placeholder:(0,Ff.__)("Type a URL","elementor"),inputProps:{ref:g},color:"secondary",InputProps:{sx:{borderRadius:"8px"}},onKeyUp:r=>"Enter"===r.key&&handleClose()}),Rf.createElement(Lf.Tooltip,{title:(0,Ff.__)("Open in a new tab","elementor")},Rf.createElement(Lf.ToggleButton,{size:"tiny",value:"newTab",selected:u,onClick:p,"aria-label":(0,Ff.__)("Open in a new tab","elementor"),sx:{borderRadius:"8px"}},Rf.createElement(Df.ExternalLinkIcon,{fontSize:"tiny"})))))},InlineEditorToolbar=({editor:r,elementId:o,sx:i={}})=>{const[a,c]=(0,Tf.useState)(""),[u,p]=(0,Tf.useState)(!1),g=(0,Tf.useRef)(null),v=(0,Af.usePopupState)({variant:"popover"}),b=!!o&&checkIfElementIsClickable(o),k=(0,Mf.useEditorState)({editor:r,selector:r=>Vf.filter(o=>r.editor.isActive(o))}),E=(0,Tf.useMemo)(()=>{const r=Object.values(Bf);return b?r.filter(r=>"link"!==r.action):r},[b]);return(0,Tf.useEffect)(()=>{r?.commands?.focus()},[r]),_f.createElement(Af.Box,{ref:g,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:v.isOpen?"hidden":"visible",pointerEvents:v.isOpen?"none":"all",...i}},_f.createElement(Af.Tooltip,{title:jf.label,placement:"top",sx:{borderRadius:"8px"}},_f.createElement(Af.IconButton,{"aria-label":jf.label,onClick:()=>jf.method(r),size:"tiny"},jf.icon)),_f.createElement(Af.ToggleButtonGroup,{value:k,size:"tiny",sx:{display:"flex",gap:.5,border:"none",[`& .${Af.toggleButtonGroupClasses.firstButton}, & .${Af.toggleButtonGroupClasses.middleButton}, & .${Af.toggleButtonGroupClasses.lastButton}`]:{borderRadius:"8px",border:"none",marginLeft:0,"&.Mui-selected":{marginLeft:0},"& + &.Mui-selected":{marginLeft:0}}}},E.map(o=>_f.createElement(Af.Tooltip,{title:o.label,key:o.action,placement:"top"},_f.createElement(Af.ToggleButton,{value:o.action,"aria-label":o.label,size:"tiny",onClick:()=>{"link"===o.action?(()=>{const o=r.getAttributes("link");c(o.href||""),p("_blank"===o.target),v.open(g.current)})():o.method?.(r),r?.commands?.focus()}},o.icon)))),_f.createElement(UrlPopover,{popupState:v,anchorRef:g,restoreValue:()=>{a?r.chain().focus().setLink({href:a,target:u?"_blank":"_self"}).run():r.chain().focus().unsetLink().run(),o&&window.dispatchEvent(new CustomEvent("elementor:inline-link-changed",{detail:{elementId:o}})),v.close()},value:a,onChange:r=>{c(r.target.value)},openInNewTab:u,onToggleNewTab:()=>{p(!u)}}))},checkIfElementIsClickable=r=>{const o=(0,Of.getContainer)(r),i=o?.model.get("widgetType"),a="e-button"===i,c=!!(0,Of.getElementSetting)(r,"link")?.value?.destination;return a||c},zf={clear:{label:(0,Nf.__)("Clear","elementor"),icon:_f.createElement(Pf.MinusIcon,{fontSize:"tiny"}),action:"clear",method:r=>{r.chain().focus().clearNodes().unsetAllMarks().run()}},bold:{label:(0,Nf.__)("Bold","elementor"),icon:_f.createElement(Pf.BoldIcon,{fontSize:"tiny"}),action:"bold",method:r=>{r.chain().focus().toggleBold().run()}},italic:{label:(0,Nf.__)("Italic","elementor"),icon:_f.createElement(Pf.ItalicIcon,{fontSize:"tiny"}),action:"italic",method:r=>{r.chain().focus().toggleItalic().run()}},underline:{label:(0,Nf.__)("Underline","elementor"),icon:_f.createElement(Pf.UnderlineIcon,{fontSize:"tiny"}),action:"underline",method:r=>{r.chain().focus().toggleUnderline().run()}},strike:{label:(0,Nf.__)("Strikethrough","elementor"),icon:_f.createElement(Pf.StrikethroughIcon,{fontSize:"tiny"}),action:"strike",method:r=>{r.chain().focus().toggleStrike().run()}},superscript:{label:(0,Nf.__)("Superscript","elementor"),icon:_f.createElement(Pf.SuperscriptIcon,{fontSize:"tiny"}),action:"superscript",method:r=>{r.chain().focus().toggleSuperscript().run()}},subscript:{label:(0,Nf.__)("Subscript","elementor"),icon:_f.createElement(Pf.SubscriptIcon,{fontSize:"tiny"}),action:"subscript",method:r=>{r.chain().focus().toggleSubscript().run()}},link:{label:(0,Nf.__)("Link","elementor"),icon:_f.createElement(Pf.LinkIcon,{fontSize:"tiny"}),action:"link",method:null}},{clear:jf,...Bf}=zf,Vf=Object.keys(Bf),$f=__toESM(i(97557)),Uf=i(79513),differsFromExternal=(r,o)=>r?.size!==o?.size||r?.unit!==o?.unit,Hf=__toESM(i(97557)),Wf=i(97557),qf=i(70374),Kf=i(79513),Gf={display:"flex",flexDirection:"column",justifyContent:"center"},UnitSelect=({value:r,showPrimaryColor:o,onClick:i,options:a})=>{const c=(0,Kf.usePopupState)({variant:"popover",popupId:(0,Wf.useId)()});return Hf.createElement(Hf.Fragment,null,Hf.createElement(Jf,{isPrimaryColor:o,size:"small",...(0,Kf.bindTrigger)(c)},r),Hf.createElement(Kf.Menu,{MenuListProps:{dense:!0},...(0,Kf.bindMenu)(c)},a.map((r,o)=>Hf.createElement(qf.MenuListItem,{key:r,onClick:()=>(r=>{i(a[r]),c.close()})(o),primaryTypographyProps:{variant:"caption",sx:{...Gf,lineHeight:"1"}},menuItemTextProps:{sx:Gf}},r.toUpperCase()))))},Jf=(0,Kf.styled)(Kf.Button,{shouldForwardProp:r=>"isPrimaryColor"!==r})(({isPrimaryColor:r,theme:o})=>({color:r?o.palette.text.primary:o.palette.text.tertiary,font:"inherit",minWidth:"initial",textTransform:"uppercase"})),Yf=__toESM(i(97557)),Xf=(0,i(97557).forwardRef)(({type:r,value:o,onChange:i,onKeyDown:a,onKeyUp:c,InputProps:u,onBlur:p,focused:g,disabled:v},b)=>Yf.createElement(pt,{ref:b,size:"tiny",fullWidth:!0,type:r,value:o,onKeyUp:c,focused:g,disabled:v,onKeyDown:a,onInput:i,onBlur:p,InputProps:u,sx:getCursorStyle2(u?.readOnly??!1)})),getCursorStyle2=r=>({input:{cursor:r?"default !important":void 0}}),UnstableSizeField=({value:r,InputProps:o,onChange:i,onBlur:a,units:c,defaultUnit:u,startIcon:p})=>{const{size:g,unit:v,setSize:b,setUnit:k}=((r,o,i)=>{const[a,c]=useSyncExternalState({external:r,setExternal:r=>{null!==r&&o(r)},persistWhen:o=>differsFromExternal(o,r),fallback:()=>({size:"",unit:i??"px"})});return{size:a.size,unit:a.unit,setSize:r=>{const o={...a,size:""===r.trim()?null:Number(r)};c(o)},setUnit:r=>{const o={...a,unit:r};c(o)}}})(r,i,u);return $f.createElement(Xf,{type:"number",value:g??"",onBlur:a,onChange:r=>b(r.target.value),InputProps:{...o,startAdornment:p&&$f.createElement(Uf.InputAdornment,{position:"start"},p),endAdornment:$f.createElement(Uf.InputAdornment,{position:"end"},$f.createElement(UnitSelect,{options:c,value:v,onClick:k,showPrimaryColor:hasValue(g)}))}})},hasValue=r=>null!==r&&""!==r,Qf=i(97557),Zf=i(5527),useFontFamilies=()=>{const{groups:r,options:o}=(()=>{const{controls:r}=(0,Zf.getElementorConfig)();return r?.font??{}})();return(0,Qf.useMemo)(()=>{if(!r||!o)return[];const i=Object.keys(r),a=new Map(i.map((r,o)=>[r,o]));return Object.entries(o).reduce((o,[i,c])=>{const u=a.get(c);return void 0===u||(o[u]||(o[u]={label:r[c],fonts:[]}),o[u].fonts.push(i)),o},[]).filter(Boolean)},[r,o])}},40331:function(r,o){"use strict";const{getOwnPropertyNames:i,getOwnPropertySymbols:a}=Object,{hasOwnProperty:c}=Object.prototype;function combineComparators(r,o){return function isEqual(i,a,c){return r(i,a,c)&&o(i,a,c)}}function createIsCircular(r){return function isCircular(o,i,a){if(!o||!i||"object"!=typeof o||"object"!=typeof i)return r(o,i,a);const{cache:c}=a,u=c.get(o),p=c.get(i);if(u&&p)return u===i&&p===o;c.set(o,i),c.set(i,o);const g=r(o,i,a);return c.delete(o),c.delete(i),g}}function getStrictProperties(r){return i(r).concat(a(r))}const u=Object.hasOwn||((r,o)=>c.call(r,o));function sameValueZeroEqual(r,o){return r===o||!r&&!o&&r!=r&&o!=o}const{getOwnPropertyDescriptor:p,keys:g}=Object;function areArrayBuffersEqual(r,o){return r.byteLength===o.byteLength&&areTypedArraysEqual(new Uint8Array(r),new Uint8Array(o))}function areArraysEqual(r,o,i){let a=r.length;if(o.length!==a)return!1;for(;a-- >0;)if(!i.equals(r[a],o[a],a,a,r,o,i))return!1;return!0}function areDataViewsEqual(r,o){return r.byteLength===o.byteLength&&areTypedArraysEqual(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),new Uint8Array(o.buffer,o.byteOffset,o.byteLength))}function areDatesEqual(r,o){return sameValueZeroEqual(r.getTime(),o.getTime())}function areErrorsEqual(r,o){return r.name===o.name&&r.message===o.message&&r.cause===o.cause&&r.stack===o.stack}function areFunctionsEqual(r,o){return r===o}function areMapsEqual(r,o,i){const a=r.size;if(a!==o.size)return!1;if(!a)return!0;const c=new Array(a),u=r.entries();let p,g,v=0;for(;(p=u.next())&&!p.done;){const a=o.entries();let u=!1,b=0;for(;(g=a.next())&&!g.done;){if(c[b]){b++;continue}const a=p.value,k=g.value;if(i.equals(a[0],k[0],v,b,r,o,i)&&i.equals(a[1],k[1],a[0],k[0],r,o,i)){u=c[b]=!0;break}b++}if(!u)return!1;v++}return!0}const v=sameValueZeroEqual;function areObjectsEqual(r,o,i){const a=g(r);let c=a.length;if(g(o).length!==c)return!1;for(;c-- >0;)if(!isPropertyEqual(r,o,i,a[c]))return!1;return!0}function areObjectsEqualStrict(r,o,i){const a=getStrictProperties(r);let c,u,g,v=a.length;if(getStrictProperties(o).length!==v)return!1;for(;v-- >0;){if(c=a[v],!isPropertyEqual(r,o,i,c))return!1;if(u=p(r,c),g=p(o,c),(u||g)&&(!u||!g||u.configurable!==g.configurable||u.enumerable!==g.enumerable||u.writable!==g.writable))return!1}return!0}function arePrimitiveWrappersEqual(r,o){return sameValueZeroEqual(r.valueOf(),o.valueOf())}function areRegExpsEqual(r,o){return r.source===o.source&&r.flags===o.flags}function areSetsEqual(r,o,i){const a=r.size;if(a!==o.size)return!1;if(!a)return!0;const c=new Array(a),u=r.values();let p,g;for(;(p=u.next())&&!p.done;){const a=o.values();let u=!1,v=0;for(;(g=a.next())&&!g.done;){if(!c[v]&&i.equals(p.value,g.value,p.value,g.value,r,o,i)){u=c[v]=!0;break}v++}if(!u)return!1}return!0}function areTypedArraysEqual(r,o){let i=r.byteLength;if(o.byteLength!==i||r.byteOffset!==o.byteOffset)return!1;for(;i-- >0;)if(r[i]!==o[i])return!1;return!0}function areUrlsEqual(r,o){return r.hostname===o.hostname&&r.pathname===o.pathname&&r.protocol===o.protocol&&r.port===o.port&&r.hash===o.hash&&r.username===o.username&&r.password===o.password}function isPropertyEqual(r,o,i,a){return!("_owner"!==a&&"__o"!==a&&"__v"!==a||!r.$$typeof&&!o.$$typeof)||u(o,a)&&i.equals(r[a],o[a],a,a,r,o,i)}const b={"[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},k=Object.prototype.toString;function createEqualityComparator({areArrayBuffersEqual:r,areArraysEqual:o,areDataViewsEqual:i,areDatesEqual:a,areErrorsEqual:c,areFunctionsEqual:u,areMapsEqual:p,areNumbersEqual:g,areObjectsEqual:v,arePrimitiveWrappersEqual:E,areRegExpsEqual:w,areSetsEqual:x,areTypedArraysEqual:C,areUrlsEqual:_,unknownTagComparators:T}){return function comparator(P,A,N){if(P===A)return!0;if(null==P||null==A)return!1;const R=typeof P;if(R!==typeof A)return!1;if("object"!==R)return"number"===R?g(P,A,N):"function"===R&&u(P,A,N);const I=P.constructor;if(I!==A.constructor)return!1;if(I===Object)return v(P,A,N);if(Array.isArray(P))return o(P,A,N);if(I===Date)return a(P,A,N);if(I===RegExp)return w(P,A,N);if(I===Map)return p(P,A,N);if(I===Set)return x(P,A,N);const L=k.call(P);if("[object Date]"===L)return a(P,A,N);if("[object RegExp]"===L)return w(P,A,N);if("[object Map]"===L)return p(P,A,N);if("[object Set]"===L)return x(P,A,N);if("[object Object]"===L)return"function"!=typeof P.then&&"function"!=typeof A.then&&v(P,A,N);if("[object URL]"===L)return _(P,A,N);if("[object Error]"===L)return c(P,A,N);if("[object Arguments]"===L)return v(P,A,N);if(b[L])return C(P,A,N);if("[object ArrayBuffer]"===L)return r(P,A,N);if("[object DataView]"===L)return i(P,A,N);if("[object Boolean]"===L||"[object Number]"===L||"[object String]"===L)return E(P,A,N);if(T){let r=T[L];if(!r){const o=function getShortTag(r){return null!=r?r[Symbol.toStringTag]:void 0}(P);o&&(r=T[o])}if(r)return r(P,A,N)}return!1}}const E=createCustomEqual(),w=createCustomEqual({strict:!0}),x=createCustomEqual({circular:!0}),C=createCustomEqual({circular:!0,strict:!0}),_=createCustomEqual({createInternalComparator:()=>sameValueZeroEqual}),T=createCustomEqual({strict:!0,createInternalComparator:()=>sameValueZeroEqual}),P=createCustomEqual({circular:!0,createInternalComparator:()=>sameValueZeroEqual}),A=createCustomEqual({circular:!0,createInternalComparator:()=>sameValueZeroEqual,strict:!0});function createCustomEqual(r={}){const{circular:o=!1,createInternalComparator:i,createState:a,strict:c=!1}=r,u=function createEqualityComparatorConfig({circular:r,createCustomConfig:o,strict:i}){let a={areArrayBuffersEqual:areArrayBuffersEqual,areArraysEqual:i?areObjectsEqualStrict:areArraysEqual,areDataViewsEqual:areDataViewsEqual,areDatesEqual:areDatesEqual,areErrorsEqual:areErrorsEqual,areFunctionsEqual:areFunctionsEqual,areMapsEqual:i?combineComparators(areMapsEqual,areObjectsEqualStrict):areMapsEqual,areNumbersEqual:v,areObjectsEqual:i?areObjectsEqualStrict:areObjectsEqual,arePrimitiveWrappersEqual:arePrimitiveWrappersEqual,areRegExpsEqual:areRegExpsEqual,areSetsEqual:i?combineComparators(areSetsEqual,areObjectsEqualStrict):areSetsEqual,areTypedArraysEqual:i?combineComparators(areTypedArraysEqual,areObjectsEqualStrict):areTypedArraysEqual,areUrlsEqual:areUrlsEqual,unknownTagComparators:void 0};if(o&&(a=Object.assign({},a,o(a))),r){const r=createIsCircular(a.areArraysEqual),o=createIsCircular(a.areMapsEqual),i=createIsCircular(a.areObjectsEqual),c=createIsCircular(a.areSetsEqual);a=Object.assign({},a,{areArraysEqual:r,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:c})}return a}(r),p=createEqualityComparator(u);return function createIsEqual({circular:r,comparator:o,createState:i,equals:a,strict:c}){if(i)return function isEqual(u,p){const{cache:g=(r?new WeakMap:void 0),meta:v}=i();return o(u,p,{cache:g,equals:a,meta:v,strict:c})};if(r)return function isEqual(r,i){return o(r,i,{cache:new WeakMap,equals:a,meta:void 0,strict:c})};const u={cache:void 0,equals:a,meta:void 0,strict:c};return function isEqual(r,i){return o(r,i,u)}}({circular:o,comparator:p,createState:a,equals:i?i(p):function createInternalEqualityComparator(r){return function(o,i,a,c,u,p,g){return r(o,i,g)}}(p),strict:c})}o.circularDeepEqual=x,o.circularShallowEqual=P,o.createCustomEqual=createCustomEqual,o.deepEqual=E,o.sameValueZeroEqual=sameValueZeroEqual,o.shallowEqual=_,o.strictCircularDeepEqual=C,o.strictCircularShallowEqual=A,o.strictDeepEqual=w,o.strictShallowEqual=T},43617:function(r){"use strict";r.exports=window.ReactDOM},45643:function(r){"use strict";r.exports=window.elementorV2.query},46400:function(r){"use strict";r.exports=window.elementorV2.editorCurrentUser},49162:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(37820))},49454:function(r,o,i){"use strict";function _slicedToArray(r,o){return function _arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function _iterableToArrayLimit(r,o){var i=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=i){var a,c,u,p,g=[],v=!0,b=!1;try{if(u=(i=i.call(r)).next,0===o){if(Object(i)!==i)return;v=!1}else for(;!(v=(a=u.call(i)).done)&&(g.push(a.value),g.length!==o);v=!0);}catch(r){b=!0,c=r}finally{try{if(!v&&null!=i.return&&(p=i.return(),Object(p)!==p))return}finally{if(b)throw c}}return g}}(r,o)||_unsupportedIterableToArray(r,o)||function _nonIterableRest(){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 _createForOfIteratorHelper(r,o){var i="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=_unsupportedIterableToArray(r))||o&&r&&"number"==typeof r.length){i&&(r=i);var a=0,c=function F(){};return{s:c,n:function n(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function e(r){throw r},f:c}}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 u,p=!0,g=!1;return{s:function s(){i=i.call(r)},n:function n(){var r=i.next();return p=r.done,r},e:function e(r){g=!0,u=r},f:function f(){try{p||null==i.return||i.return()}finally{if(g)throw u}}}}function _unsupportedIterableToArray(r,o){if(r){if("string"==typeof r)return _arrayLikeToArray(r,o);var i=Object.prototype.toString.call(r).slice(8,-1);return"Object"===i&&r.constructor&&(i=r.constructor.name),"Map"===i||"Set"===i?Array.from(r):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(r,o):void 0}}function _arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=new Array(o);i<o;i++)a[i]=r[i];return a}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(r,o,i){var a=function _superPropBase(r,o){for(;!Object.prototype.hasOwnProperty.call(r,o)&&null!==(r=_getPrototypeOf(r)););return r}(r,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(arguments.length<3?r:i):c.value}},_get.apply(this,arguments)}function _inherits(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),o&&_setPrototypeOf(r,o)}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _createSuper(r){var o=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}();return function _createSuperInternal(){var i,a=_getPrototypeOf(r);if(o){var c=_getPrototypeOf(this).constructor;i=Reflect.construct(a,arguments,c)}else i=a.apply(this,arguments);return function _possibleConstructorReturn(r,o){if(o&&("object"===_typeof(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(r)}(this,i)}}function _assertThisInitialized(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,_toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _toPropertyKey(r){var o=function _toPrimitive(r,o){if("object"!==_typeof(r)||null===r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"===_typeof(o)?o:String(o)}var a=i(37820),c=i(77712),u=i(36553),p=function domIndex(r){for(var o=0;;o++)if(!(r=r.previousSibling))return o},g=function parentNode(r){var o=r.assignedSlot||r.parentNode;return o&&11==o.nodeType?o.host:o},v=null,b=function textRange(r,o,i){var a=v||(v=document.createRange());return a.setEnd(r,null==i?r.nodeValue.length:i),a.setStart(r,o||0),a},k=function isEquivalentPosition(r,o,i,a){return i&&(scanFor(r,o,i,a,-1)||scanFor(r,o,i,a,1))},E=/^(img|br|input|textarea|hr)$/i;function scanFor(r,o,i,a,c){for(var u;;){if(r==i&&o==a)return!0;if(o==(c<0?0:nodeSize(r))){var g=r.parentNode;if(!g||1!=g.nodeType||hasBlockDesc(r)||E.test(r.nodeName)||"false"==r.contentEditable)return!1;o=p(r)+(c<0?0:1),r=g}else{if(1!=r.nodeType)return!1;var v=r.childNodes[o+(c<0?-1:0)];if(1==v.nodeType&&"false"==v.contentEditable){if(!(null===(u=v.pmViewDesc)||void 0===u?void 0:u.ignoreForSelection))return!1;o+=c}else r=v,o=c<0?nodeSize(r):0}}}function nodeSize(r){return 3==r.nodeType?r.nodeValue.length:r.childNodes.length}function hasBlockDesc(r){for(var o,i=r;i&&!(o=i.pmViewDesc);i=i.parentNode);return o&&o.node&&o.node.isBlock&&(o.dom==r||o.contentDOM==r)}var w=function selectionCollapsed(r){return r.focusNode&&k(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function keyEvent(r,o){var i=document.createEvent("Event");return i.initEvent("keydown",!0,!0),i.keyCode=r,i.key=i.code=o,i}var x="undefined"!=typeof navigator?navigator:null,C="undefined"!=typeof document?document:null,_=x&&x.userAgent||"",T=/Edge\/(\d+)/.exec(_),P=/MSIE \d/.exec(_),A=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(_),N=!!(P||A||T),R=P?document.documentMode:A?+A[1]:T?+T[1]:0,I=!N&&/gecko\/(\d+)/i.test(_);I&&(/Firefox\/(\d+)/.exec(_)||[0,0])[1];var L=!N&&/Chrome\/(\d+)/.exec(_),z=!!L,j=L?+L[1]:0,B=!N&&!!x&&/Apple Computer/.test(x.vendor),V=B&&(/Mobile\/\w+/.test(_)||!!x&&x.maxTouchPoints>2),U=V||!!x&&/Mac/.test(x.platform),H=!!x&&/Win/.test(x.platform),W=/Android \d/.test(_),K=!!C&&"webkitFontSmoothing"in C.documentElement.style,G=K?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function windowRect(r){var o=r.defaultView&&r.defaultView.visualViewport;return o?{left:0,right:o.width,top:0,bottom:o.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function getSide(r,o){return"number"==typeof r?r:r[o]}function clientRect(r){var o=r.getBoundingClientRect(),i=o.width/r.offsetWidth||1,a=o.height/r.offsetHeight||1;return{left:o.left,right:o.left+r.clientWidth*i,top:o.top,bottom:o.top+r.clientHeight*a}}function scrollRectIntoView(r,o,i){for(var a=r.someProp("scrollThreshold")||0,c=r.someProp("scrollMargin")||5,u=r.dom.ownerDocument,p=i||r.dom;p;)if(1==p.nodeType){var v=p,b=v==u.body,k=b?windowRect(u):clientRect(v),E=0,w=0;if(o.top<k.top+getSide(a,"top")?w=-(k.top-o.top+getSide(c,"top")):o.bottom>k.bottom-getSide(a,"bottom")&&(w=o.bottom-o.top>k.bottom-k.top?o.top+getSide(c,"top")-k.top:o.bottom-k.bottom+getSide(c,"bottom")),o.left<k.left+getSide(a,"left")?E=-(k.left-o.left+getSide(c,"left")):o.right>k.right-getSide(a,"right")&&(E=o.right-k.right+getSide(c,"right")),E||w)if(b)u.defaultView.scrollBy(E,w);else{var x=v.scrollLeft,C=v.scrollTop;w&&(v.scrollTop+=w),E&&(v.scrollLeft+=E);var _=v.scrollLeft-x,T=v.scrollTop-C;o={left:o.left-_,top:o.top-T,right:o.right-_,bottom:o.bottom-T}}var P=b?"fixed":getComputedStyle(p).position;if(/^(fixed|sticky)$/.test(P))break;p="absolute"==P?p.offsetParent:g(p)}else p=g(p)}function scrollStack(r){for(var o=[],i=r.ownerDocument,a=r;a&&(o.push({dom:a,top:a.scrollTop,left:a.scrollLeft}),r!=i);a=g(a));return o}function restoreScrollStack(r,o){for(var i=0;i<r.length;i++){var a=r[i],c=a.dom,u=a.top,p=a.left;c.scrollTop!=u+o&&(c.scrollTop=u+o),c.scrollLeft!=p&&(c.scrollLeft=p)}}var J=null;function findOffsetInNode(r,o){for(var i,a,c,u,p=2e8,g=0,v=o.top,k=o.top,E=r.firstChild,w=0;E;E=E.nextSibling,w++){var x=void 0;if(1==E.nodeType)x=E.getClientRects();else{if(3!=E.nodeType)continue;x=b(E).getClientRects()}for(var C=0;C<x.length;C++){var _=x[C];if(_.top<=v&&_.bottom>=k){v=Math.max(_.bottom,v),k=Math.min(_.top,k);var T=_.left>o.left?_.left-o.left:_.right<o.left?o.left-_.right:0;if(T<p){i=E,p=T,a=T&&3==i.nodeType?{left:_.right<o.left?_.right:_.left,top:o.top}:o,1==E.nodeType&&T&&(g=w+(o.left>=(_.left+_.right)/2?1:0));continue}}else _.top>o.top&&!c&&_.left<=o.left&&_.right>=o.left&&(c=E,u={left:Math.max(_.left,Math.min(_.right,o.left)),top:_.top});!i&&(o.left>=_.right&&o.top>=_.top||o.left>=_.left&&o.top>=_.bottom)&&(g=w+1)}}return!i&&c&&(i=c,a=u,p=0),i&&3==i.nodeType?function findOffsetInText(r,o){for(var i,a=r.nodeValue.length,c=document.createRange(),u=0;u<a;u++){c.setEnd(r,u+1),c.setStart(r,u);var p=singleRect(c,1);if(p.top!=p.bottom&&inRect(o,p)){i={node:r,offset:u+(o.left>=(p.left+p.right)/2?1:0)};break}}return c.detach(),i||{node:r,offset:0}}(i,a):!i||p&&1==i.nodeType?{node:r,offset:g}:findOffsetInNode(i,a)}function inRect(r,o){return r.left>=o.left-1&&r.left<=o.right+1&&r.top>=o.top-1&&r.top<=o.bottom+1}function elementFromPoint(r,o,i){var a=r.childNodes.length;if(a&&i.top<i.bottom)for(var c=Math.max(0,Math.min(a-1,Math.floor(a*(o.top-i.top)/(i.bottom-i.top))-2)),u=c;;){var p=r.childNodes[u];if(1==p.nodeType)for(var g=p.getClientRects(),v=0;v<g.length;v++){var b=g[v];if(inRect(o,b))return elementFromPoint(p,o,b)}if((u=(u+1)%a)==c)break}return r}function _posAtCoords(r,o){var i,a=r.dom.ownerDocument,c=0,u=function caretFromPoint(r,o,i){if(r.caretPositionFromPoint)try{var a=r.caretPositionFromPoint(o,i);if(a)return{node:a.offsetNode,offset:Math.min(nodeSize(a.offsetNode),a.offset)}}catch(r){}if(r.caretRangeFromPoint){var c=r.caretRangeFromPoint(o,i);if(c)return{node:c.startContainer,offset:Math.min(nodeSize(c.startContainer),c.startOffset)}}}(a,o.left,o.top);u&&(i=u.node,c=u.offset);var p,v=(r.root.elementFromPoint?r.root:a).elementFromPoint(o.left,o.top);if(!v||!r.dom.contains(1!=v.nodeType?v.parentNode:v)){var b=r.dom.getBoundingClientRect();if(!inRect(o,b))return null;if(!(v=elementFromPoint(r.dom,o,b)))return null}if(B)for(var k=v;i&&k;k=g(k))k.draggable&&(i=void 0);if(v=function targetKludge(r,o){var i=r.parentNode;return i&&/^li$/i.test(i.nodeName)&&o.left<r.getBoundingClientRect().left?i:r}(v,o),i){if(I&&1==i.nodeType&&(c=Math.min(c,i.childNodes.length))<i.childNodes.length){var E,w=i.childNodes[c];"IMG"==w.nodeName&&(E=w.getBoundingClientRect()).right<=o.left&&E.bottom>o.top&&c++}var x;K&&c&&1==i.nodeType&&1==(x=i.childNodes[c-1]).nodeType&&"false"==x.contentEditable&&x.getBoundingClientRect().top>=o.top&&c--,i==r.dom&&c==i.childNodes.length-1&&1==i.lastChild.nodeType&&o.top>i.lastChild.getBoundingClientRect().bottom?p=r.state.doc.content.size:0!=c&&1==i.nodeType&&"BR"==i.childNodes[c-1].nodeName||(p=function posFromCaret(r,o,i,a){for(var c=-1,u=o,p=!1;u!=r.dom;){var g=r.docView.nearestDesc(u,!0),v=void 0;if(!g)return null;if(1==g.dom.nodeType&&(g.node.isBlock&&g.parent||!g.contentDOM)&&((v=g.dom.getBoundingClientRect()).width||v.height)&&(g.node.isBlock&&g.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(g.dom.nodeName)&&(!p&&v.left>a.left||v.top>a.top?c=g.posBefore:(!p&&v.right<a.left||v.bottom<a.top)&&(c=g.posAfter),p=!0),!g.contentDOM&&c<0&&!g.node.isText))return(g.node.isBlock?a.top<(v.top+v.bottom)/2:a.left<(v.left+v.right)/2)?g.posBefore:g.posAfter;u=g.dom.parentNode}return c>-1?c:r.docView.posFromDOM(o,i,-1)}(r,i,c,o))}null==p&&(p=function posFromElement(r,o,i){var a=findOffsetInNode(o,i),c=a.node,u=a.offset,p=-1;if(1==c.nodeType&&!c.firstChild){var g=c.getBoundingClientRect();p=g.left!=g.right&&i.left>(g.left+g.right)/2?1:-1}return r.docView.posFromDOM(c,u,p)}(r,v,o));var C=r.docView.nearestDesc(v,!0);return{pos:p,inside:C?C.posAtStart-C.border:-1}}function nonZero(r){return r.top<r.bottom||r.left<r.right}function singleRect(r,o){var i=r.getClientRects();if(i.length){var a=i[o<0?0:i.length-1];if(nonZero(a))return a}return Array.prototype.find.call(i,nonZero)||r.getBoundingClientRect()}var Y=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _coordsAtPos(r,o,i){var a=r.docView.domFromPos(o,i<0?-1:1),c=a.node,u=a.offset,p=a.atom,g=K||I;if(3==c.nodeType){if(!g||!Y.test(c.nodeValue)&&(i<0?u:u!=c.nodeValue.length)){var v=u,k=u,E=i<0?1:-1;return i<0&&!u?(k++,E=-1):i>=0&&u==c.nodeValue.length?(v--,E=1):i<0?v--:k++,flattenV(singleRect(b(c,v,k),E),E<0)}var w=singleRect(b(c,u,u),i);if(I&&u&&/\s/.test(c.nodeValue[u-1])&&u<c.nodeValue.length){var x=singleRect(b(c,u-1,u-1),-1);if(x.top==w.top){var C=singleRect(b(c,u,u+1),-1);if(C.top!=w.top)return flattenV(C,C.left<x.left)}}return w}if(!r.state.doc.resolve(o-(p||0)).parent.inlineContent){if(null==p&&u&&(i<0||u==nodeSize(c))){var _=c.childNodes[u-1];if(1==_.nodeType)return flattenH(_.getBoundingClientRect(),!1)}if(null==p&&u<nodeSize(c)){var T=c.childNodes[u];if(1==T.nodeType)return flattenH(T.getBoundingClientRect(),!0)}return flattenH(c.getBoundingClientRect(),i>=0)}if(null==p&&u&&(i<0||u==nodeSize(c))){var P=c.childNodes[u-1],A=3==P.nodeType?b(P,nodeSize(P)-(g?0:1)):1!=P.nodeType||"BR"==P.nodeName&&P.nextSibling?null:P;if(A)return flattenV(singleRect(A,1),!1)}if(null==p&&u<nodeSize(c)){for(var N=c.childNodes[u];N.pmViewDesc&&N.pmViewDesc.ignoreForCoords;)N=N.nextSibling;var R=N?3==N.nodeType?b(N,0,g?0:1):1==N.nodeType?N:null:null;if(R)return flattenV(singleRect(R,-1),!0)}return flattenV(singleRect(3==c.nodeType?b(c):c,-i),i>=0)}function flattenV(r,o){if(0==r.width)return r;var i=o?r.left:r.right;return{top:r.top,bottom:r.bottom,left:i,right:i}}function flattenH(r,o){if(0==r.height)return r;var i=o?r.top:r.bottom;return{top:i,bottom:i,left:r.left,right:r.right}}function withFlushedState(r,o,i){var a=r.state,c=r.root.activeElement;a!=o&&r.updateState(o),c!=r.dom&&r.focus();try{return i()}finally{a!=o&&r.updateState(a),c!=r.dom&&c&&c.focus()}}var X=/[\u0590-\u08ac]/;var Q=null,Z=null,ee=!1;function _endOfTextblock(r,o,i){return Q==o&&Z==i?ee:(Q=o,Z=i,ee="up"==i||"down"==i?function endOfTextblockVertical(r,o,i){var a=o.selection,c="up"==i?a.$from:a.$to;return withFlushedState(r,o,function(){for(var o=r.docView.domFromPos(c.pos,"up"==i?-1:1).node;;){var a=r.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}for(var u=_coordsAtPos(r,c.pos,1),p=o.firstChild;p;p=p.nextSibling){var g=void 0;if(1==p.nodeType)g=p.getClientRects();else{if(3!=p.nodeType)continue;g=b(p,0,p.nodeValue.length).getClientRects()}for(var v=0;v<g.length;v++){var k=g[v];if(k.bottom>k.top+1&&("up"==i?u.top-k.top>2*(k.bottom-u.top):k.bottom-u.bottom>2*(u.bottom-k.top)))return!1}}return!0})}(r,o,i):function endOfTextblockHorizontal(r,o,i){var a=o.selection.$head;if(!a.parent.isTextblock)return!1;var c=a.parentOffset,u=!c,p=c==a.parent.content.size,g=r.domSelection();return g?X.test(a.parent.textContent)&&g.modify?withFlushedState(r,o,function(){var o=r.domSelectionRange(),c=o.focusNode,u=o.focusOffset,p=o.anchorNode,v=o.anchorOffset,b=g.caretBidiLevel;g.modify("move",i,"character");var k=a.depth?r.docView.domAfterPos(a.before()):r.dom,E=r.domSelectionRange(),w=E.focusNode,x=E.focusOffset,C=w&&!k.contains(1==w.nodeType?w:w.parentNode)||c==w&&u==x;try{g.collapse(p,v),c&&(c!=p||u!=v)&&g.extend&&g.extend(c,u)}catch(r){}return null!=b&&(g.caretBidiLevel=b),C}):"left"==i||"backward"==i?u:p:a.pos==a.start()||a.pos==a.end()}(r,o,i))}var te=function(){function ViewDesc(r,o,i,a){_classCallCheck(this,ViewDesc),this.parent=r,this.children=o,this.dom=i,this.contentDOM=a,this.dirty=0,i.pmViewDesc=this}return _createClass(ViewDesc,[{key:"matchesWidget",value:function matchesWidget(r){return!1}},{key:"matchesMark",value:function matchesMark(r){return!1}},{key:"matchesNode",value:function matchesNode(r,o,i){return!1}},{key:"matchesHack",value:function matchesHack(r){return!1}},{key:"parseRule",value:function parseRule(){return null}},{key:"stopEvent",value:function stopEvent(r){return!1}},{key:"size",get:function get(){for(var r=0,o=0;o<this.children.length;o++)r+=this.children[o].size;return r}},{key:"border",get:function get(){return 0}},{key:"destroy",value:function destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var r=0;r<this.children.length;r++)this.children[r].destroy()}},{key:"posBeforeChild",value:function posBeforeChild(r){for(var o=0,i=this.posAtStart;;o++){var a=this.children[o];if(a==r)return i;i+=a.size}}},{key:"posBefore",get:function get(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function get(){return this.posBefore+this.size}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function localPosFromDOM(r,o,i){if(this.contentDOM&&this.contentDOM.contains(1==r.nodeType?r:r.parentNode)){if(i<0){var a,c;if(r==this.contentDOM)a=r.childNodes[o-1];else{for(;r.parentNode!=this.contentDOM;)r=r.parentNode;a=r.previousSibling}for(;a&&(!(c=a.pmViewDesc)||c.parent!=this);)a=a.previousSibling;return a?this.posBeforeChild(c)+c.size:this.posAtStart}var u,g;if(r==this.contentDOM)u=r.childNodes[o];else{for(;r.parentNode!=this.contentDOM;)r=r.parentNode;u=r.nextSibling}for(;u&&(!(g=u.pmViewDesc)||g.parent!=this);)u=u.nextSibling;return u?this.posBeforeChild(g):this.posAtEnd}var v;if(r==this.dom&&this.contentDOM)v=o>p(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))v=2&r.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==o)for(var b=r;;b=b.parentNode){if(b==this.dom){v=!1;break}if(b.previousSibling)break}if(null==v&&o==r.childNodes.length)for(var k=r;;k=k.parentNode){if(k==this.dom){v=!0;break}if(k.nextSibling)break}}return(null==v?i>0:v)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function nearestDesc(r){for(var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!0,a=r;a;a=a.parentNode){var c=this.getDesc(a),u=void 0;if(c&&(!o||c.node)){if(!i||!(u=c.nodeDOM)||(1==u.nodeType?u.contains(1==r.nodeType?r:r.parentNode):u==r))return c;i=!1}}}},{key:"getDesc",value:function getDesc(r){for(var o=r.pmViewDesc,i=o;i;i=i.parent)if(i==this)return o}},{key:"posFromDOM",value:function posFromDOM(r,o,i){for(var a=r;a;a=a.parentNode){var c=this.getDesc(a);if(c)return c.localPosFromDOM(r,o,i)}return-1}},{key:"descAt",value:function descAt(r){for(var o=0,i=0;o<this.children.length;o++){var a=this.children[o],c=i+a.size;if(i==r&&c!=i){for(;!a.border&&a.children.length;)for(var u=0;u<a.children.length;u++){var p=a.children[u];if(p.size){a=p;break}}return a}if(r<c)return a.descAt(r-i-a.border);i=c}}},{key:"domFromPos",value:function domFromPos(r,o){if(!this.contentDOM)return{node:this.dom,offset:0,atom:r+1};for(var i,a=0,c=0,u=0;a<this.children.length;a++){var g=this.children[a],v=u+g.size;if(v>r||g instanceof se){c=r-u;break}u=v}if(c)return this.children[a].domFromPos(c-this.children[a].border,o);for(;a&&!(i=this.children[a-1]).size&&i instanceof ne&&i.side>=0;a--);if(o<=0){for(var b,k=!0;(b=a?this.children[a-1]:null)&&b.dom.parentNode!=this.contentDOM;a--,k=!1);return b&&o&&k&&!b.border&&!b.domAtom?b.domFromPos(b.size,o):{node:this.contentDOM,offset:b?p(b.dom)+1:0}}for(var E,w=!0;(E=a<this.children.length?this.children[a]:null)&&E.dom.parentNode!=this.contentDOM;a++,w=!1);return E&&w&&!E.border&&!E.domAtom?E.domFromPos(0,o):{node:this.contentDOM,offset:E?p(E.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function parseRange(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:r,to:o,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var a=-1,c=-1,u=i,g=0;;g++){var v=this.children[g],b=u+v.size;if(-1==a&&r<=b){var k=u+v.border;if(r>=k&&o<=b-v.border&&v.node&&v.contentDOM&&this.contentDOM.contains(v.contentDOM))return v.parseRange(r,o,k);r=u;for(var E=g;E>0;E--){var w=this.children[E-1];if(w.size&&w.dom.parentNode==this.contentDOM&&!w.emptyChildAt(1)){a=p(w.dom)+1;break}r-=w.size}-1==a&&(a=0)}if(a>-1&&(b>o||g==this.children.length-1)){o=b;for(var x=g+1;x<this.children.length;x++){var C=this.children[x];if(C.size&&C.dom.parentNode==this.contentDOM&&!C.emptyChildAt(-1)){c=p(C.dom);break}o+=C.size}-1==c&&(c=this.contentDOM.childNodes.length);break}u=b}return{node:this.contentDOM,from:r,to:o,fromOffset:a,toOffset:c}}},{key:"emptyChildAt",value:function emptyChildAt(r){if(this.border||!this.contentDOM||!this.children.length)return!1;var o=this.children[r<0?0:this.children.length-1];return 0==o.size||o.emptyChildAt(r)}},{key:"domAfterPos",value:function domAfterPos(r){var o=this.domFromPos(r,0),i=o.node,a=o.offset;if(1!=i.nodeType||a==i.childNodes.length)throw new RangeError("No node after pos "+r);return i.childNodes[a]}},{key:"setSelection",value:function setSelection(r,o,i){for(var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=Math.min(r,o),u=Math.max(r,o),g=0,v=0;g<this.children.length;g++){var b=this.children[g],E=v+b.size;if(c>v&&u<E)return b.setSelection(r-v-b.border,o-v-b.border,i,a);v=E}var w=this.domFromPos(r,r?-1:1),x=o==r?w:this.domFromPos(o,o?-1:1),C=i.root.getSelection(),_=i.domSelectionRange(),T=!1;if((I||B)&&r==o){var P=w,A=P.node,N=P.offset;if(3==A.nodeType){if((T=!(!N||"\n"!=A.nodeValue[N-1]))&&N==A.nodeValue.length)for(var R,L=A;L;L=L.parentNode){if(R=L.nextSibling){"BR"==R.nodeName&&(w=x={node:R.parentNode,offset:p(R)+1});break}var z=L.pmViewDesc;if(z&&z.node&&z.node.isBlock)break}}else{var j=A.childNodes[N-1];T=j&&("BR"==j.nodeName||"false"==j.contentEditable)}}if(I&&_.focusNode&&_.focusNode!=x.node&&1==_.focusNode.nodeType){var V=_.focusNode.childNodes[_.focusOffset];V&&"false"==V.contentEditable&&(a=!0)}if(a||T&&B||!k(w.node,w.offset,_.anchorNode,_.anchorOffset)||!k(x.node,x.offset,_.focusNode,_.focusOffset)){var U=!1;if((C.extend||r==o)&&(!T||!I)){C.collapse(w.node,w.offset);try{r!=o&&C.extend(x.node,x.offset),U=!0}catch(r){}}if(!U){if(r>o){var H=w;w=x,x=H}var W=document.createRange();W.setEnd(x.node,x.offset),W.setStart(w.node,w.offset),C.removeAllRanges(),C.addRange(W)}}}},{key:"ignoreMutation",value:function ignoreMutation(r){return!this.contentDOM&&"selection"!=r.type}},{key:"contentLost",get:function get(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function markDirty(r,o){for(var i=0,a=0;a<this.children.length;a++){var c=this.children[a],u=i+c.size;if(i==u?r<=u&&o>=i:r<u&&o>i){var p=i+c.border,g=u-c.border;if(r>=p&&o<=g)return this.dirty=r==i||o==u?2:1,void(r!=p||o!=g||!c.contentLost&&c.dom.parentNode==this.contentDOM?c.markDirty(r-p,o-p):c.dirty=3);c.dirty=c.dom!=c.contentDOM||c.dom.parentNode!=this.contentDOM||c.children.length?3:2}i=u}this.dirty=2}},{key:"markParentsDirty",value:function markParentsDirty(){for(var r=1,o=this.parent;o;o=o.parent,r++){var i=1==r?2:1;o.dirty<i&&(o.dirty=i)}}},{key:"domAtom",get:function get(){return!1}},{key:"ignoreForCoords",get:function get(){return!1}},{key:"ignoreForSelection",get:function get(){return!1}},{key:"isText",value:function isText(r){return!1}}]),ViewDesc}(),ne=function(r){_inherits(WidgetViewDesc,r);var o=_createSuper(WidgetViewDesc);function WidgetViewDesc(r,i,a,c){var u;_classCallCheck(this,WidgetViewDesc);var p,g=i.type.toDOM;if("function"==typeof g&&(g=g(a,function(){return p?p.parent?p.parent.posBeforeChild(p):void 0:c})),!i.type.spec.raw){if(1!=g.nodeType){var v=document.createElement("span");v.appendChild(g),g=v}g.contentEditable="false",g.classList.add("ProseMirror-widget")}return(u=o.call(this,r,[],g,null)).widget=i,u.widget=i,p=_assertThisInitialized(u),u}return _createClass(WidgetViewDesc,[{key:"matchesWidget",value:function matchesWidget(r){return 0==this.dirty&&r.type.eq(this.widget.type)}},{key:"parseRule",value:function parseRule(){return{ignore:!0}}},{key:"stopEvent",value:function stopEvent(r){var o=this.widget.spec.stopEvent;return!!o&&o(r)}},{key:"ignoreMutation",value:function ignoreMutation(r){return"selection"!=r.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function destroy(){this.widget.type.destroy(this.dom),_get(_getPrototypeOf(WidgetViewDesc.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function get(){return!0}},{key:"ignoreForSelection",get:function get(){return!!this.widget.type.spec.relaxedSide}},{key:"side",get:function get(){return this.widget.type.side}}]),WidgetViewDesc}(te),re=function(r){_inherits(CompositionViewDesc,r);var o=_createSuper(CompositionViewDesc);function CompositionViewDesc(r,i,a,c){var u;return _classCallCheck(this,CompositionViewDesc),(u=o.call(this,r,[],i,null)).textDOM=a,u.text=c,u}return _createClass(CompositionViewDesc,[{key:"size",get:function get(){return this.text.length}},{key:"localPosFromDOM",value:function localPosFromDOM(r,o){return r!=this.textDOM?this.posAtStart+(o?this.size:0):this.posAtStart+o}},{key:"domFromPos",value:function domFromPos(r){return{node:this.textDOM,offset:r}}},{key:"ignoreMutation",value:function ignoreMutation(r){return"characterData"===r.type&&r.target.nodeValue==r.oldValue}}]),CompositionViewDesc}(te),oe=function(r){_inherits(MarkViewDesc,r);var o=_createSuper(MarkViewDesc);function MarkViewDesc(r,i,a,c,u){var p;return _classCallCheck(this,MarkViewDesc),(p=o.call(this,r,[],a,c)).mark=i,p.spec=u,p}return _createClass(MarkViewDesc,[{key:"parseRule",value:function parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}},{key:"matchesMark",value:function matchesMark(r){return 3!=this.dirty&&this.mark.eq(r)}},{key:"markDirty",value:function markDirty(r,o){if(_get(_getPrototypeOf(MarkViewDesc.prototype),"markDirty",this).call(this,r,o),0!=this.dirty){for(var i=this.parent;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function slice(r,o,i){var a=MarkViewDesc.create(this.parent,this.mark,!0,i),c=this.children,u=this.size;o<u&&(c=replaceNodes(c,o,u,i)),r>0&&(c=replaceNodes(c,0,r,i));for(var p=0;p<c.length;p++)c[p].parent=a;return a.children=c,a}},{key:"ignoreMutation",value:function ignoreMutation(r){return this.spec.ignoreMutation?this.spec.ignoreMutation(r):_get(_getPrototypeOf(MarkViewDesc.prototype),"ignoreMutation",this).call(this,r)}},{key:"destroy",value:function destroy(){this.spec.destroy&&this.spec.destroy(),_get(_getPrototypeOf(MarkViewDesc.prototype),"destroy",this).call(this)}}],[{key:"create",value:function create(r,o,i,a){var u=a.nodeViews[o.type.name],p=u&&u(o,a,i);return p&&p.dom||(p=c.DOMSerializer.renderSpec(document,o.type.spec.toDOM(o,i),null,o.attrs)),new MarkViewDesc(r,o,p.dom,p.contentDOM||p.dom,p)}}]),MarkViewDesc}(te),ie=function(r){_inherits(NodeViewDesc,r);var o=_createSuper(NodeViewDesc);function NodeViewDesc(r,i,a,c,u,p,g,v,b){var k;return _classCallCheck(this,NodeViewDesc),(k=o.call(this,r,[],u,p)).node=i,k.outerDeco=a,k.innerDeco=c,k.nodeDOM=g,k}return _createClass(NodeViewDesc,[{key:"parseRule",value:function parseRule(){var r=this;if(this.node.type.spec.reparseInView)return null;var o={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(o.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var i=this.children.length-1;i>=0;i--){var a=this.children[i];if(this.dom.contains(a.dom.parentNode)){o.contentElement=a.dom.parentNode;break}}o.contentElement||(o.getContent=function(){return c.Fragment.empty})}else o.contentElement=this.contentDOM;else o.getContent=function(){return r.node.content};return o}},{key:"matchesNode",value:function matchesNode(r,o,i){return 0==this.dirty&&r.eq(this.node)&&sameOuterDeco(o,this.outerDeco)&&i.eq(this.innerDeco)}},{key:"size",get:function get(){return this.node.nodeSize}},{key:"border",get:function get(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function updateChildren(r,o){var i=this,a=this.node.inlineContent,u=o,p=r.composing?this.localCompositionInfo(r,o):null,g=p&&p.pos>-1?p:null,v=p&&p.pos<0,b=new pe(this,g&&g.node,r);!function iterDeco(r,o,i,a){var c=o.locals(r),u=0;if(0==c.length){for(var p=0;p<r.childCount;p++){var g=r.child(p);a(g,c,o.forChild(u,g),p),u+=g.nodeSize}return}for(var v=0,b=[],k=null,E=0;;){for(var w=void 0,x=void 0;v<c.length&&c[v].to==u;){var C=c[v++];C.widget&&(w?(x||(x=[w])).push(C):w=C)}if(w)if(x){x.sort(compareSide);for(var _=0;_<x.length;_++)i(x[_],E,!!k)}else i(w,E,!!k);var T=void 0,P=void 0;if(k)P=-1,T=k,k=null;else{if(!(E<r.childCount))break;P=E,T=r.child(E++)}for(var A=0;A<b.length;A++)b[A].to<=u&&b.splice(A--,1);for(;v<c.length&&c[v].from<=u&&c[v].to>u;)b.push(c[v++]);var N=u+T.nodeSize;if(T.isText){var R=N;v<c.length&&c[v].from<R&&(R=c[v].from);for(var I=0;I<b.length;I++)b[I].to<R&&(R=b[I].to);R<N&&(k=T.cut(R-u),T=T.cut(0,R-u),N=R,P=-1)}else for(;v<c.length&&c[v].to<N;)v++;a(T,T.isInline&&!T.isLeaf?b.filter(function(r){return!r.inline}):b.slice(),o.forChild(u,T),P),u=N}}(this.node,this.innerDeco,function(o,p,g){o.spec.marks?b.syncToMarks(o.spec.marks,a,r,p):o.type.side>=0&&!g&&b.syncToMarks(p==i.node.childCount?c.Mark.none:i.node.child(p).marks,a,r,p),b.placeWidget(o,r,u)},function(o,i,c,g){var k;b.syncToMarks(o.marks,a,r,g),b.findNodeMatch(o,i,c,g)||v&&r.state.selection.from>u&&r.state.selection.to<u+o.nodeSize&&(k=b.findIndexWithChild(p.node))>-1&&b.updateNodeAt(o,i,c,k,r)||b.updateNextNode(o,i,c,r,g,u)||b.addNode(o,i,c,r,u),u+=o.nodeSize}),b.syncToMarks([],a,r,0),this.node.isTextblock&&b.addTextblockHacks(),b.destroyRest(),(b.changed||2==this.dirty)&&(g&&this.protectLocalComposition(r,g),renderDescs(this.contentDOM,this.children,r),V&&function iosHacks(r){if("UL"==r.nodeName||"OL"==r.nodeName){var o=r.style.cssText;r.style.cssText=o+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=o}}(this.dom))}},{key:"localCompositionInfo",value:function localCompositionInfo(r,o){var i=r.state.selection,c=i.from,u=i.to;if(!(r.state.selection instanceof a.TextSelection)||c<o||u>o+this.node.content.size)return null;var p=r.input.compositionNode;if(!p||!this.dom.contains(p.parentNode))return null;if(this.node.inlineContent){var g=p.nodeValue,v=function findTextInFragment(r,o,i,a){for(var c=0,u=0;c<r.childCount&&u<=a;){var p=r.child(c++),g=u;if(u+=p.nodeSize,p.isText){for(var v=p.text;c<r.childCount;){var b=r.child(c++);if(u+=b.nodeSize,!b.isText)break;v+=b.text}if(u>=i){if(u>=a&&v.slice(a-o.length-g,a-g)==o)return a-o.length;var k=g<a?v.lastIndexOf(o,a-g-1):-1;if(k>=0&&k+o.length+g>=i)return g+k;if(i==a&&v.length>=a+o.length-g&&v.slice(a-g,a-g+o.length)==o)return a}}}return-1}(this.node.content,g,c-o,u-o);return v<0?null:{node:p,pos:v,text:g}}return{node:p,pos:-1,text:""}}},{key:"protectLocalComposition",value:function protectLocalComposition(r,o){var i=o.node,a=o.pos,c=o.text;if(!this.getDesc(i)){for(var u=i;u.parentNode!=this.contentDOM;u=u.parentNode){for(;u.previousSibling;)u.parentNode.removeChild(u.previousSibling);for(;u.nextSibling;)u.parentNode.removeChild(u.nextSibling);u.pmViewDesc&&(u.pmViewDesc=void 0)}var p=new re(this,u,i,c);r.input.compositionNodes.push(p),this.children=replaceNodes(this.children,a,a+c.length,r,p)}}},{key:"update",value:function update(r,o,i,a){return!(3==this.dirty||!r.sameMarkup(this.node))&&(this.updateInner(r,o,i,a),!0)}},{key:"updateInner",value:function updateInner(r,o,i,a){this.updateOuterDeco(o),this.node=r,this.innerDeco=i,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function updateOuterDeco(r){if(!sameOuterDeco(r,this.outerDeco)){var o=1!=this.nodeDOM.nodeType,i=this.dom;this.dom=patchOuterDeco(this.dom,this.nodeDOM,computeOuterDeco(this.outerDeco,this.node,o),computeOuterDeco(r,this.node,o)),this.dom!=i&&(i.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=r}}},{key:"selectNode",value:function selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}},{key:"deselectNode",value:function deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}},{key:"domAtom",get:function get(){return this.node.isAtom}}],[{key:"create",value:function create(r,o,i,a,u,p){var g,v=u.nodeViews[o.type.name],b=v&&v(o,u,function(){return g?g.parent?g.parent.posBeforeChild(g):void 0:p},i,a),k=b&&b.dom,E=b&&b.contentDOM;if(o.isText)if(k){if(3!=k.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else k=document.createTextNode(o.text);else if(!k){var w=c.DOMSerializer.renderSpec(document,o.type.spec.toDOM(o),null,o.attrs);k=w.dom,E=w.contentDOM}E||o.isText||"BR"==k.nodeName||(k.hasAttribute("contenteditable")||(k.contentEditable="false"),o.type.spec.draggable&&(k.draggable=!0));var x=k;return k=applyOuterDeco(k,i,o),b?g=new le(r,o,i,a,k,E||null,x,b,u,p+1):o.isText?new ae(r,o,i,a,k,x,u):new NodeViewDesc(r,o,i,a,k,E||null,x,u,p+1)}}]),NodeViewDesc}(te);function docViewDesc(r,o,i,a,c){applyOuterDeco(a,o,r);var u=new ie(void 0,r,o,i,a,a,a,c,0);return u.contentDOM&&u.updateChildren(c,0),u}var ae=function(r){_inherits(TextViewDesc,r);var o=_createSuper(TextViewDesc);function TextViewDesc(r,i,a,c,u,p,g){return _classCallCheck(this,TextViewDesc),o.call(this,r,i,a,c,u,null,p,g,0)}return _createClass(TextViewDesc,[{key:"parseRule",value:function parseRule(){for(var r=this.nodeDOM.parentNode;r&&r!=this.dom&&!r.pmIsDeco;)r=r.parentNode;return{skip:r||!0}}},{key:"update",value:function update(r,o,i,a){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!r.sameMarkup(this.node))&&(this.updateOuterDeco(o),0==this.dirty&&r.text==this.node.text||r.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=r.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=r,this.dirty=0,!0)}},{key:"inParent",value:function inParent(){for(var r=this.parent.contentDOM,o=this.nodeDOM;o;o=o.parentNode)if(o==r)return!0;return!1}},{key:"domFromPos",value:function domFromPos(r){return{node:this.nodeDOM,offset:r}}},{key:"localPosFromDOM",value:function localPosFromDOM(r,o,i){return r==this.nodeDOM?this.posAtStart+Math.min(o,this.node.text.length):_get(_getPrototypeOf(TextViewDesc.prototype),"localPosFromDOM",this).call(this,r,o,i)}},{key:"ignoreMutation",value:function ignoreMutation(r){return"characterData"!=r.type&&"selection"!=r.type}},{key:"slice",value:function slice(r,o,i){var a=this.node.cut(r,o),c=document.createTextNode(a.text);return new TextViewDesc(this.parent,a,this.outerDeco,this.innerDeco,c,c,i)}},{key:"markDirty",value:function markDirty(r,o){_get(_getPrototypeOf(TextViewDesc.prototype),"markDirty",this).call(this,r,o),this.dom==this.nodeDOM||0!=r&&o!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function get(){return!1}},{key:"isText",value:function isText(r){return this.node.text==r}}]),TextViewDesc}(ie),se=function(r){_inherits(TrailingHackViewDesc,r);var o=_createSuper(TrailingHackViewDesc);function TrailingHackViewDesc(){return _classCallCheck(this,TrailingHackViewDesc),o.apply(this,arguments)}return _createClass(TrailingHackViewDesc,[{key:"parseRule",value:function parseRule(){return{ignore:!0}}},{key:"matchesHack",value:function matchesHack(r){return 0==this.dirty&&this.dom.nodeName==r}},{key:"domAtom",get:function get(){return!0}},{key:"ignoreForCoords",get:function get(){return"IMG"==this.dom.nodeName}}]),TrailingHackViewDesc}(te),le=function(r){_inherits(CustomNodeViewDesc,r);var o=_createSuper(CustomNodeViewDesc);function CustomNodeViewDesc(r,i,a,c,u,p,g,v,b,k){var E;return _classCallCheck(this,CustomNodeViewDesc),(E=o.call(this,r,i,a,c,u,p,g,b,k)).spec=v,E}return _createClass(CustomNodeViewDesc,[{key:"update",value:function update(r,o,i,a){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==r.type||this.spec.multiType)){var c=this.spec.update(r,o,i);return c&&this.updateInner(r,o,i,a),c}return!(!this.contentDOM&&!r.isLeaf)&&_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"update",this).call(this,r,o,i,a)}},{key:"selectNode",value:function selectNode(){this.spec.selectNode?this.spec.selectNode():_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function deselectNode(){this.spec.deselectNode?this.spec.deselectNode():_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function setSelection(r,o,i,a){this.spec.setSelection?this.spec.setSelection(r,o,i.root):_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"setSelection",this).call(this,r,o,i,a)}},{key:"destroy",value:function destroy(){this.spec.destroy&&this.spec.destroy(),_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function stopEvent(r){return!!this.spec.stopEvent&&this.spec.stopEvent(r)}},{key:"ignoreMutation",value:function ignoreMutation(r){return this.spec.ignoreMutation?this.spec.ignoreMutation(r):_get(_getPrototypeOf(CustomNodeViewDesc.prototype),"ignoreMutation",this).call(this,r)}}]),CustomNodeViewDesc}(ie);function renderDescs(r,o,i){for(var a=r.firstChild,c=!1,u=0;u<o.length;u++){var p=o[u],g=p.dom;if(g.parentNode==r){for(;g!=a;)a=rm(a),c=!0;a=a.nextSibling}else c=!0,r.insertBefore(g,a);if(p instanceof oe){var v=a?a.previousSibling:r.lastChild;renderDescs(p.contentDOM,p.children,i),a=v?v.nextSibling:r.firstChild}}for(;a;)a=rm(a),c=!0;c&&i.trackWrites==r&&(i.trackWrites=null)}var ce=function OuterDecoLevel(r){r&&(this.nodeName=r)};ce.prototype=Object.create(null);var ue=[new ce];function computeOuterDeco(r,o,i){if(0==r.length)return ue;for(var a=i?ue[0]:new ce,c=[a],u=0;u<r.length;u++){var p=r[u].type.attrs;if(p)for(var g in p.nodeName&&c.push(a=new ce(p.nodeName)),p){var v=p[g];null!=v&&(i&&1==c.length&&c.push(a=new ce(o.isInline?"span":"div")),"class"==g?a.class=(a.class?a.class+" ":"")+v:"style"==g?a.style=(a.style?a.style+";":"")+v:"nodeName"!=g&&(a[g]=v))}}return c}function patchOuterDeco(r,o,i,a){if(i==ue&&a==ue)return o;for(var c=o,u=0;u<a.length;u++){var p=a[u],g=i[u];if(u){var v=void 0;g&&g.nodeName==p.nodeName&&c!=r&&(v=c.parentNode)&&v.nodeName.toLowerCase()==p.nodeName||((v=document.createElement(p.nodeName)).pmIsDeco=!0,v.appendChild(c),g=ue[0]),c=v}patchAttributes(c,g||ue[0],p)}return c}function patchAttributes(r,o,i){for(var a in o)"class"==a||"style"==a||"nodeName"==a||a in i||r.removeAttribute(a);for(var c in i)"class"!=c&&"style"!=c&&"nodeName"!=c&&i[c]!=o[c]&&r.setAttribute(c,i[c]);if(o.class!=i.class){for(var u=o.class?o.class.split(" ").filter(Boolean):[],p=i.class?i.class.split(" ").filter(Boolean):[],g=0;g<u.length;g++)-1==p.indexOf(u[g])&&r.classList.remove(u[g]);for(var v=0;v<p.length;v++)-1==u.indexOf(p[v])&&r.classList.add(p[v]);0==r.classList.length&&r.removeAttribute("class")}if(o.style!=i.style){if(o.style)for(var b,k=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;b=k.exec(o.style);)r.style.removeProperty(b[1]);i.style&&(r.style.cssText+=i.style)}}function applyOuterDeco(r,o,i){return patchOuterDeco(r,r,ue,computeOuterDeco(o,i,1!=r.nodeType))}function sameOuterDeco(r,o){if(r.length!=o.length)return!1;for(var i=0;i<r.length;i++)if(!r[i].type.eq(o[i].type))return!1;return!0}function rm(r){var o=r.nextSibling;return r.parentNode.removeChild(r),o}var pe=function(){function ViewTreeUpdater(r,o,i){_classCallCheck(this,ViewTreeUpdater),this.lock=o,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=r,this.preMatch=function preMatch(r,o){var i=o,a=i.children.length,c=r.childCount,u=new Map,p=[];e:for(;c>0;){for(var g=void 0;;)if(a){var v=i.children[a-1];if(!(v instanceof oe)){g=v,a--;break}i=v,a=v.children.length}else{if(i==o)break e;a=i.parent.children.indexOf(i),i=i.parent}var b=g.node;if(b){if(b!=r.child(c-1))break;--c,u.set(g,c),p.push(g)}}return{index:c,matched:u,matches:p.reverse()}}(r.node.content,r)}return _createClass(ViewTreeUpdater,[{key:"destroyBetween",value:function destroyBetween(r,o){if(r!=o){for(var i=r;i<o;i++)this.top.children[i].destroy();this.top.children.splice(r,o-r),this.changed=!0}}},{key:"destroyRest",value:function destroyRest(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function syncToMarks(r,o,i,a){for(var c=0,u=this.stack.length>>1,p=Math.min(u,r.length);c<p&&(c==u-1?this.top:this.stack[c+1<<1]).matchesMark(r[c])&&!1!==r[c].type.spec.spanning;)c++;for(;c<u;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),u--;for(;u<r.length;){this.stack.push(this.top,this.index+1);var g=-1,v=this.top.children.length;a<this.preMatch.index&&(v=Math.min(this.index+3,v));for(var b=this.index;b<v;b++){var k=this.top.children[b];if(k.matchesMark(r[u])&&!this.isLocked(k.dom)){g=b;break}}if(g>-1)g>this.index&&(this.changed=!0,this.destroyBetween(this.index,g)),this.top=this.top.children[this.index];else{var E=oe.create(this.top,r[u],o,i);this.top.children.splice(this.index,0,E),this.top=E,this.changed=!0}this.index=0,u++}}},{key:"findNodeMatch",value:function findNodeMatch(r,o,i,a){var c,u=-1;if(a>=this.preMatch.index&&(c=this.preMatch.matches[a-this.preMatch.index]).parent==this.top&&c.matchesNode(r,o,i))u=this.top.children.indexOf(c,this.index);else for(var p=this.index,g=Math.min(this.top.children.length,p+5);p<g;p++){var v=this.top.children[p];if(v.matchesNode(r,o,i)&&!this.preMatch.matched.has(v)){u=p;break}}return!(u<0)&&(this.destroyBetween(this.index,u),this.index++,!0)}},{key:"updateNodeAt",value:function updateNodeAt(r,o,i,a,c){var u=this.top.children[a];return 3==u.dirty&&u.dom==u.contentDOM&&(u.dirty=2),!!u.update(r,o,i,c)&&(this.destroyBetween(this.index,a),this.index++,!0)}},{key:"findIndexWithChild",value:function findIndexWithChild(r){for(;;){var o=r.parentNode;if(!o)return-1;if(o==this.top.contentDOM){var i=r.pmViewDesc;if(i)for(var a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==i)return a;return-1}r=o}}},{key:"updateNextNode",value:function updateNextNode(r,o,i,a,c,u){for(var p=this.index;p<this.top.children.length;p++){var g=this.top.children[p];if(g instanceof ie){var v=this.preMatch.matched.get(g);if(null!=v&&v!=c)return!1;var b=g.dom,k=void 0,E=this.isLocked(b)&&!(r.isText&&g.node&&g.node.isText&&g.nodeDOM.nodeValue==r.text&&3!=g.dirty&&sameOuterDeco(o,g.outerDeco));if(!E&&g.update(r,o,i,a))return this.destroyBetween(this.index,p),g.dom!=b&&(this.changed=!0),this.index++,!0;if(!E&&(k=this.recreateWrapper(g,r,o,i,a,u)))return this.destroyBetween(this.index,p),this.top.children[this.index]=k,k.contentDOM&&(k.dirty=2,k.updateChildren(a,u+1),k.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}},{key:"recreateWrapper",value:function recreateWrapper(r,o,i,a,c,u){if(r.dirty||o.isAtom||!r.children.length||!r.node.content.eq(o.content)||!sameOuterDeco(i,r.outerDeco)||!a.eq(r.innerDeco))return null;var p=ie.create(this.top,o,i,a,c,u);if(p.contentDOM){p.children=r.children,r.children=[];var g,v=_createForOfIteratorHelper(p.children);try{for(v.s();!(g=v.n()).done;){g.value.parent=p}}catch(r){v.e(r)}finally{v.f()}}return r.destroy(),p}},{key:"addNode",value:function addNode(r,o,i,a,c){var u=ie.create(this.top,r,o,i,a,c);u.contentDOM&&u.updateChildren(a,c+1),this.top.children.splice(this.index++,0,u),this.changed=!0}},{key:"placeWidget",value:function placeWidget(r,o,i){var a=this.index<this.top.children.length?this.top.children[this.index]:null;if(!a||!a.matchesWidget(r)||r!=a.widget&&a.widget.type.toDOM.parentNode){var c=new ne(this.top,r,o,i);this.top.children.splice(this.index++,0,c),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function addTextblockHacks(){for(var r=this.top.children[this.index-1],o=this.top;r instanceof oe;)r=(o=r).children[o.children.length-1];(!r||!(r instanceof ae)||/\n$/.test(r.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(r.node.text))&&((B||z)&&r&&"false"==r.dom.contentEditable&&this.addHackNode("IMG",o),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function addHackNode(r,o){if(o==this.top&&this.index<o.children.length&&o.children[this.index].matchesHack(r))this.index++;else{var i=document.createElement(r);"IMG"==r&&(i.className="ProseMirror-separator",i.alt=""),"BR"==r&&(i.className="ProseMirror-trailingBreak");var a=new se(this.top,[],i,null);o!=this.top?o.children.push(a):o.children.splice(this.index++,0,a),this.changed=!0}}},{key:"isLocked",value:function isLocked(r){return this.lock&&(r==this.lock||1==r.nodeType&&r.contains(this.lock.parentNode))}}]),ViewTreeUpdater}();function compareSide(r,o){return r.type.side-o.type.side}function replaceNodes(r,o,i,a,c){for(var u=[],p=0,g=0;p<r.length;p++){var v=r[p],b=g,k=g+=v.size;b>=i||k<=o?u.push(v):(b<o&&u.push(v.slice(0,o-b,a)),c&&(u.push(c),c=void 0),k>i&&u.push(v.slice(i-b,v.size,a)))}return u}function selectionFromDOM(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=r.domSelectionRange(),c=r.state.doc;if(!i.focusNode)return null;var u=r.docView.nearestDesc(i.focusNode),g=u&&0==u.size,v=r.docView.posFromDOM(i.focusNode,i.focusOffset,1);if(v<0)return null;var b,k,E=c.resolve(v);if(w(i)){for(b=v;u&&!u.node;)u=u.parent;var x=u.node;if(u&&x.isAtom&&a.NodeSelection.isSelectable(x)&&u.parent&&(!x.isInline||!function isOnEdge(r,o,i){for(var a=0==o,c=o==nodeSize(r);a||c;){if(r==i)return!0;var u=p(r);if(!(r=r.parentNode))return!1;a=a&&0==u,c=c&&u==nodeSize(r)}}(i.focusNode,i.focusOffset,u.dom))){var C=u.posBefore;k=new a.NodeSelection(v==C?E:c.resolve(C))}}else{if(i instanceof r.dom.ownerDocument.defaultView.Selection&&i.rangeCount>1){for(var _=v,T=v,P=0;P<i.rangeCount;P++){var A=i.getRangeAt(P);_=Math.min(_,r.docView.posFromDOM(A.startContainer,A.startOffset,1)),T=Math.max(T,r.docView.posFromDOM(A.endContainer,A.endOffset,-1))}if(_<0)return null;var N=_slicedToArray(T==r.state.selection.anchor?[T,_]:[_,T],2);b=N[0],v=N[1],E=c.resolve(v)}else b=r.docView.posFromDOM(i.anchorNode,i.anchorOffset,1);if(b<0)return null}var R=c.resolve(b);k||(k=selectionBetween(r,R,E,"pointer"==o||r.state.selection.head<E.pos&&!g?1:-1));return k}function editorOwnsSelection(r){return r.editable?r.hasFocus():hasSelection(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function selectionToDOM(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=r.state.selection;if(syncNodeSelection(r,i),editorOwnsSelection(r)){if(!o&&r.input.mouseDown&&r.input.mouseDown.allowDefault&&z){var c=r.domSelectionRange(),u=r.domObserver.currentSelection;if(c.anchorNode&&u.anchorNode&&k(c.anchorNode,c.anchorOffset,u.anchorNode,u.anchorOffset))return r.input.mouseDown.delayedSelectionSync=!0,void r.domObserver.setCurSelection()}if(r.domObserver.disconnectSelection(),r.cursorWrapper)!function selectCursorWrapper(r){var o=r.domSelection();if(!o)return;var i=r.cursorWrapper.dom,a="IMG"==i.nodeName;a?o.collapse(i.parentNode,p(i)+1):o.collapse(i,0);!a&&!r.state.selection.visible&&N&&R<=11&&(i.disabled=!0,i.disabled=!1)}(r);else{var g,v,b=i.anchor,E=i.head;!de||i instanceof a.TextSelection||(i.$from.parent.inlineContent||(g=temporarilyEditableNear(r,i.from)),i.empty||i.$from.parent.inlineContent||(v=temporarilyEditableNear(r,i.to))),r.docView.setSelection(b,E,r,o),de&&(g&&resetEditable(g),v&&resetEditable(v)),i.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function removeClassOnSelectionChange(r){var o=r.dom.ownerDocument;o.removeEventListener("selectionchange",r.input.hideSelectionGuard);var i=r.domSelectionRange(),a=i.anchorNode,c=i.anchorOffset;o.addEventListener("selectionchange",r.input.hideSelectionGuard=function(){i.anchorNode==a&&i.anchorOffset==c||(o.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(function(){editorOwnsSelection(r)&&!r.state.selection.visible||r.dom.classList.remove("ProseMirror-hideselection")},20))})}(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}}var de=B||z&&j<63;function temporarilyEditableNear(r,o){var i=r.docView.domFromPos(o,0),a=i.node,c=i.offset,u=c<a.childNodes.length?a.childNodes[c]:null,p=c?a.childNodes[c-1]:null;if(B&&u&&"false"==u.contentEditable)return setEditable(u);if(!(u&&"false"!=u.contentEditable||p&&"false"!=p.contentEditable)){if(u)return setEditable(u);if(p)return setEditable(p)}}function setEditable(r){return r.contentEditable="true",B&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function resetEditable(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function syncNodeSelection(r,o){if(o instanceof a.NodeSelection){var i=r.docView.descAt(o.from);i!=r.lastSelectedViewDesc&&(clearNodeSelection(r),i&&i.selectNode(),r.lastSelectedViewDesc=i)}else clearNodeSelection(r)}function clearNodeSelection(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function selectionBetween(r,o,i,c){return r.someProp("createSelectionBetween",function(a){return a(r,o,i)})||a.TextSelection.between(o,i,c)}function hasFocusAndSelection(r){return!(r.editable&&!r.hasFocus())&&hasSelection(r)}function hasSelection(r){var o=r.domSelectionRange();if(!o.anchorNode)return!1;try{return r.dom.contains(3==o.anchorNode.nodeType?o.anchorNode.parentNode:o.anchorNode)&&(r.editable||r.dom.contains(3==o.focusNode.nodeType?o.focusNode.parentNode:o.focusNode))}catch(r){return!1}}function moveSelectionBlock(r,o){var i=r.selection,c=i.$anchor,u=i.$head,p=o>0?c.max(u):c.min(u),g=p.parent.inlineContent?p.depth?r.doc.resolve(o>0?p.after():p.before()):null:p;return g&&a.Selection.findFrom(g,o)}function apply(r,o){return r.dispatch(r.state.tr.setSelection(o).scrollIntoView()),!0}function selectHorizontally(r,o,i){var c=r.state.selection;if(!(c instanceof a.TextSelection)){if(c instanceof a.NodeSelection&&c.node.isInline)return apply(r,new a.TextSelection(o>0?c.$to:c.$from));var u=moveSelectionBlock(r.state,o);return!!u&&apply(r,u)}if(i.indexOf("s")>-1){var p=c.$head,g=p.textOffset?null:o<0?p.nodeBefore:p.nodeAfter;if(!g||g.isText||!g.isLeaf)return!1;var v=r.state.doc.resolve(p.pos+g.nodeSize*(o<0?-1:1));return apply(r,new a.TextSelection(c.$anchor,v))}if(!c.empty)return!1;if(r.endOfTextblock(o>0?"forward":"backward")){var b=moveSelectionBlock(r.state,o);return!!(b&&b instanceof a.NodeSelection)&&apply(r,b)}if(!(U&&i.indexOf("m")>-1)){var k,E=c.$head,w=E.textOffset?null:o<0?E.nodeBefore:E.nodeAfter;if(!w||w.isText)return!1;var x=o<0?E.pos-w.nodeSize:E.pos;return!!(w.isAtom||(k=r.docView.descAt(x))&&!k.contentDOM)&&(a.NodeSelection.isSelectable(w)?apply(r,new a.NodeSelection(o<0?r.state.doc.resolve(E.pos-w.nodeSize):E)):!!K&&apply(r,new a.TextSelection(r.state.doc.resolve(o<0?x:x+w.nodeSize))))}}function nodeLen(r){return 3==r.nodeType?r.nodeValue.length:r.childNodes.length}function isIgnorable(r,o){var i=r.pmViewDesc;return i&&0==i.size&&(o<0||r.nextSibling||"BR"!=r.nodeName)}function skipIgnoredNodes(r,o){return o<0?function skipIgnoredNodesBefore(r){var o=r.domSelectionRange(),i=o.focusNode,a=o.focusOffset;if(!i)return;var c,u,g=!1;I&&1==i.nodeType&&a<nodeLen(i)&&isIgnorable(i.childNodes[a],-1)&&(g=!0);for(;;)if(a>0){if(1!=i.nodeType)break;var v=i.childNodes[a-1];if(isIgnorable(v,-1))c=i,u=--a;else{if(3!=v.nodeType)break;a=(i=v).nodeValue.length}}else{if(isBlockNode(i))break;for(var b=i.previousSibling;b&&isIgnorable(b,-1);)c=i.parentNode,u=p(b),b=b.previousSibling;if(b)a=nodeLen(i=b);else{if((i=i.parentNode)==r.dom)break;a=0}}g?setSelFocus(r,i,a):c&&setSelFocus(r,c,u)}(r):function skipIgnoredNodesAfter(r){var o=r.domSelectionRange(),i=o.focusNode,a=o.focusOffset;if(!i)return;for(var c,u,g=nodeLen(i);;)if(a<g){if(1!=i.nodeType)break;if(!isIgnorable(i.childNodes[a],1))break;c=i,u=++a}else{if(isBlockNode(i))break;for(var v=i.nextSibling;v&&isIgnorable(v,1);)c=v.parentNode,u=p(v)+1,v=v.nextSibling;if(v)a=0,g=nodeLen(i=v);else{if((i=i.parentNode)==r.dom)break;a=g=0}}c&&setSelFocus(r,c,u)}(r)}function isBlockNode(r){var o=r.pmViewDesc;return o&&o.node&&o.node.isBlock}function setSelFocus(r,o,i){var a,c;3!=o.nodeType&&((c=function textNodeAfter(r,o){for(;r&&o==r.childNodes.length&&!hasBlockDesc(r);)o=p(r)+1,r=r.parentNode;for(;r&&o<r.childNodes.length;){var i=r.childNodes[o];if(3==i.nodeType)return i;if(1==i.nodeType&&"false"==i.contentEditable)break;r=i,o=0}}(o,i))?(o=c,i=0):(a=function textNodeBefore(r,o){for(;r&&!o&&!hasBlockDesc(r);)o=p(r),r=r.parentNode;for(;r&&o;){var i=r.childNodes[o-1];if(3==i.nodeType)return i;if(1==i.nodeType&&"false"==i.contentEditable)break;o=(r=i).childNodes.length}}(o,i))&&(o=a,i=a.nodeValue.length));var u=r.domSelection();if(u){if(w(u)){var g=document.createRange();g.setEnd(o,i),g.setStart(o,i),u.removeAllRanges(),u.addRange(g)}else u.extend&&u.extend(o,i);r.domObserver.setCurSelection();var v=r.state;setTimeout(function(){r.state==v&&selectionToDOM(r)},50)}}function findDirection(r,o){var i=r.state.doc.resolve(o);if(!z&&!H&&i.parent.inlineContent){var a=r.coordsAtPos(o);if(o>i.start()){var c=r.coordsAtPos(o-1),u=(c.top+c.bottom)/2;if(u>a.top&&u<a.bottom&&Math.abs(c.left-a.left)>1)return c.left<a.left?"ltr":"rtl"}if(o<i.end()){var p=r.coordsAtPos(o+1),g=(p.top+p.bottom)/2;if(g>a.top&&g<a.bottom&&Math.abs(p.left-a.left)>1)return p.left>a.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(r.dom).direction?"rtl":"ltr"}function selectVertically(r,o,i){var c=r.state.selection;if(c instanceof a.TextSelection&&!c.empty||i.indexOf("s")>-1)return!1;if(U&&i.indexOf("m")>-1)return!1;var u=c.$from,p=c.$to;if(!u.parent.inlineContent||r.endOfTextblock(o<0?"up":"down")){var g=moveSelectionBlock(r.state,o);if(g&&g instanceof a.NodeSelection)return apply(r,g)}if(!u.parent.inlineContent){var v=o<0?u:p,b=c instanceof a.AllSelection?a.Selection.near(v,o):a.Selection.findFrom(v,o);return!!b&&apply(r,b)}return!1}function stopNativeHorizontalDelete(r,o){if(!(r.state.selection instanceof a.TextSelection))return!0;var i=r.state.selection,c=i.$head,u=i.$anchor,p=i.empty;if(!c.sameParent(u))return!0;if(!p)return!1;if(r.endOfTextblock(o>0?"forward":"backward"))return!0;var g=!c.textOffset&&(o<0?c.nodeBefore:c.nodeAfter);if(g&&!g.isText){var v=r.state.tr;return o<0?v.delete(c.pos-g.nodeSize,c.pos):v.delete(c.pos,c.pos+g.nodeSize),r.dispatch(v),!0}return!1}function switchEditable(r,o,i){r.domObserver.stop(),o.contentEditable=i,r.domObserver.start()}function captureKeyDown(r,o){var i=o.keyCode,a=function getMods(r){var o="";return r.ctrlKey&&(o+="c"),r.metaKey&&(o+="m"),r.altKey&&(o+="a"),r.shiftKey&&(o+="s"),o}(o);if(8==i||U&&72==i&&"c"==a)return stopNativeHorizontalDelete(r,-1)||skipIgnoredNodes(r,-1);if(46==i&&!o.shiftKey||U&&68==i&&"c"==a)return stopNativeHorizontalDelete(r,1)||skipIgnoredNodes(r,1);if(13==i||27==i)return!0;if(37==i||U&&66==i&&"c"==a){var c=37==i?"ltr"==findDirection(r,r.state.selection.from)?-1:1:-1;return selectHorizontally(r,c,a)||skipIgnoredNodes(r,c)}if(39==i||U&&70==i&&"c"==a){var u=39==i?"ltr"==findDirection(r,r.state.selection.from)?1:-1:1;return selectHorizontally(r,u,a)||skipIgnoredNodes(r,u)}return 38==i||U&&80==i&&"c"==a?selectVertically(r,-1,a)||skipIgnoredNodes(r,-1):40==i||U&&78==i&&"c"==a?function safariDownArrowBug(r){if(!B||r.state.selection.$head.parentOffset>0)return!1;var o=r.domSelectionRange(),i=o.focusNode,a=o.focusOffset;if(i&&1==i.nodeType&&0==a&&i.firstChild&&"false"==i.firstChild.contentEditable){var c=i.firstChild;switchEditable(r,c,"true"),setTimeout(function(){return switchEditable(r,c,"false")},20)}return!1}(r)||selectVertically(r,1,a)||skipIgnoredNodes(r,1):a==(U?"m":"c")&&(66==i||73==i||89==i||90==i)}function _serializeForClipboard(r,o){r.someProp("transformCopied",function(i){o=i(o,r)});for(var i=[],a=o,u=a.content,p=a.openStart,g=a.openEnd;p>1&&g>1&&1==u.childCount&&1==u.firstChild.childCount;){p--,g--;var v=u.firstChild;i.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),u=v.content}var b=r.someProp("clipboardSerializer")||c.DOMSerializer.fromSchema(r.state.schema),k=detachedDoc(),E=k.createElement("div");E.appendChild(b.serializeFragment(u,{document:k}));for(var w,x=E.firstChild,C=0;x&&1==x.nodeType&&(w=he[x.nodeName.toLowerCase()]);){for(var _=w.length-1;_>=0;_--){for(var T=k.createElement(w[_]);E.firstChild;)T.appendChild(E.firstChild);E.appendChild(T),C++}x=E.firstChild}return x&&1==x.nodeType&&x.setAttribute("data-pm-slice","".concat(p," ").concat(g).concat(C?" -".concat(C):""," ").concat(JSON.stringify(i))),{dom:E,text:r.someProp("clipboardTextSerializer",function(i){return i(o,r)})||o.content.textBetween(0,o.content.size,"\n\n"),slice:o}}function parseFromClipboard(r,o,i,a,u){var p,g,v=u.parent.type.spec.code;if(!i&&!o)return null;var b=!!o&&(a||v||!i);if(b){if(r.someProp("transformPastedText",function(i){o=i(o,v||a,r)}),v)return g=new c.Slice(c.Fragment.from(r.state.schema.text(o.replace(/\r\n?/g,"\n"))),0,0),r.someProp("transformPasted",function(o){g=o(g,r,!0)}),g;var k=r.someProp("clipboardTextParser",function(i){return i(o,u,a,r)});if(k)g=k;else{var E=u.marks(),w=r.state.schema,x=c.DOMSerializer.fromSchema(w);p=document.createElement("div"),o.split(/(?:\r\n?|\n)+/).forEach(function(r){var o=p.appendChild(document.createElement("p"));r&&o.appendChild(x.serializeNode(w.text(r,E)))})}}else r.someProp("transformPastedHTML",function(o){i=o(i,r)}),p=function readHTML(r){var o=/^(\s*<meta [^>]*>)*/.exec(r);o&&(r=r.slice(o[0].length));var i,a=detachedDoc().createElement("div"),c=/<([a-z][^>\s]+)/i.exec(r);(i=c&&he[c[1].toLowerCase()])&&(r=i.map(function(r){return"<"+r+">"}).join("")+r+i.map(function(r){return"</"+r+">"}).reverse().join(""));if(a.innerHTML=function maybeWrapTrusted(r){var o=window.trustedTypes;if(!o)return r;ge||(ge=o.defaultPolicy||o.createPolicy("ProseMirrorClipboard",{createHTML:function createHTML(r){return r}}));return ge.createHTML(r)}(r),i)for(var u=0;u<i.length;u++)a=a.querySelector(i[u])||a;return a}(i),K&&function restoreReplacedSpaces(r){for(var o=r.querySelectorAll(z?"span:not([class]):not([style])":"span.Apple-converted-space"),i=0;i<o.length;i++){var a=o[i];1==a.childNodes.length&&" "==a.textContent&&a.parentNode&&a.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),a)}}(p);var C=p&&p.querySelector("[data-pm-slice]"),_=C&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(C.getAttribute("data-pm-slice")||"");if(_&&_[3])for(var T=+_[3];T>0;T--){for(var P=p.firstChild;P&&1!=P.nodeType;)P=P.nextSibling;if(!P)break;p=P}if(!g){var A=r.someProp("clipboardParser")||r.someProp("domParser")||c.DOMParser.fromSchema(r.state.schema);g=A.parseSlice(p,{preserveWhitespace:!(!b&&!_),context:u,ruleFromNode:function ruleFromNode(r){return"BR"!=r.nodeName||r.nextSibling||!r.parentNode||fe.test(r.parentNode.nodeName)?null:{ignore:!0}}})}if(_)g=function addContext(r,o){if(!r.size)return r;var i,a=r.content.firstChild.type.schema;try{i=JSON.parse(o)}catch(o){return r}for(var u=r.content,p=r.openStart,g=r.openEnd,v=i.length-2;v>=0;v-=2){var b=a.nodes[i[v]];if(!b||b.hasRequiredAttrs())break;u=c.Fragment.from(b.create(i[v+1],u)),p++,g++}return new c.Slice(u,p,g)}(closeSlice(g,+_[1],+_[2]),_[4]);else if(g=c.Slice.maxOpen(function normalizeSiblings(r,o){if(r.childCount<2)return r;for(var i,a=function _loop(){var i,a=o.node(u).contentMatchAt(o.index(u)),p=[];if(r.forEach(function(r){if(p){var o,c=a.findWrapping(r.type);if(!c)return p=null;if(o=p.length&&i.length&&addToSibling(c,i,r,p[p.length-1],0))p[p.length-1]=o;else{p.length&&(p[p.length-1]=closeRight(p[p.length-1],i.length));var u=withWrappers(r,c);p.push(u),a=a.matchType(u.type),i=c}}}),p)return{v:c.Fragment.from(p)}},u=o.depth;u>=0;u--)if(i=a())return i.v;return r}(g.content,u),!0),g.openStart||g.openEnd){for(var N=0,R=0,I=g.content.firstChild;N<g.openStart&&!I.type.spec.isolating;N++,I=I.firstChild);for(var L=g.content.lastChild;R<g.openEnd&&!L.type.spec.isolating;R++,L=L.lastChild);g=closeSlice(g,N,R)}return r.someProp("transformPasted",function(o){g=o(g,r,b)}),g}var fe=/^(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 withWrappers(r,o){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=o.length-1;a>=i;a--)r=o[a].create(null,c.Fragment.from(r));return r}function addToSibling(r,o,i,a,u){if(u<r.length&&u<o.length&&r[u]==o[u]){var p=addToSibling(r,o,i,a.lastChild,u+1);if(p)return a.copy(a.content.replaceChild(a.childCount-1,p));if(a.contentMatchAt(a.childCount).matchType(u==r.length-1?i.type:r[u+1]))return a.copy(a.content.append(c.Fragment.from(withWrappers(i,r,u+1))))}}function closeRight(r,o){if(0==o)return r;var i=r.content.replaceChild(r.childCount-1,closeRight(r.lastChild,o-1)),a=r.contentMatchAt(r.childCount).fillBefore(c.Fragment.empty,!0);return r.copy(i.append(a))}function closeRange(r,o,i,a,u,p){var g=o<0?r.firstChild:r.lastChild,v=g.content;return r.childCount>1&&(p=0),u<a-1&&(v=closeRange(v,o,i,a,u+1,p)),u>=i&&(v=o<0?g.contentMatchAt(0).fillBefore(v,p<=u).append(v):v.append(g.contentMatchAt(g.childCount).fillBefore(c.Fragment.empty,!0))),r.replaceChild(o<0?0:r.childCount-1,g.copy(v))}function closeSlice(r,o,i){return o<r.openStart&&(r=new c.Slice(closeRange(r.content,-1,o,r.openStart,0,r.openEnd),o,r.openEnd)),i<r.openEnd&&(r=new c.Slice(closeRange(r.content,1,i,r.openEnd,0,0),r.openStart,i)),r}var he={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},me=null;function detachedDoc(){return me||(me=document.implementation.createHTMLDocument("title"))}var ge=null;var ve={},ye={},be={touchstart:!0,touchmove:!0},ke=_createClass(function InputState(){_classCallCheck(this,InputState),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 setSelectionOrigin(r,o){r.input.lastSelectionOrigin=o,r.input.lastSelectionTime=Date.now()}function ensureListeners(r){r.someProp("handleDOMEvents",function(o){for(var i in o)r.input.eventHandlers[i]||r.dom.addEventListener(i,r.input.eventHandlers[i]=function(o){return runCustomHandler(r,o)})})}function runCustomHandler(r,o){return r.someProp("handleDOMEvents",function(i){var a=i[o.type];return!!a&&(a(r,o)||o.defaultPrevented)})}function eventCoords(r){return{left:r.clientX,top:r.clientY}}function runHandlerOnContext(r,o,i,a,c){if(-1==a)return!1;for(var u,p=r.state.doc.resolve(a),g=function _loop3(a){if(r.someProp(o,function(o){return a>p.depth?o(r,i,p.nodeAfter,p.before(a),c,!0):o(r,i,p.node(a),p.before(a),c,!1)}))return{v:!0}},v=p.depth+1;v>0;v--)if(u=g(v))return u.v;return!1}function updateSelection(r,o,i){if(r.focused||r.focus(),!r.state.selection.eq(o)){var a=r.state.tr.setSelection(o);"pointer"==i&&a.setMeta("pointer",!0),r.dispatch(a)}}function handleSingleClick(r,o,i,c,u){return runHandlerOnContext(r,"handleClickOn",o,i,c)||r.someProp("handleClick",function(i){return i(r,o,c)})||(u?function selectClickedNode(r,o){if(-1==o)return!1;var i,c,u=r.state.selection;u instanceof a.NodeSelection&&(i=u.node);for(var p=r.state.doc.resolve(o),g=p.depth+1;g>0;g--){var v=g>p.depth?p.nodeAfter:p.node(g);if(a.NodeSelection.isSelectable(v)){c=i&&u.$from.depth>0&&g>=u.$from.depth&&p.before(u.$from.depth+1)==u.$from.pos?p.before(u.$from.depth):p.before(g);break}}return null!=c&&(updateSelection(r,a.NodeSelection.create(r.state.doc,c),"pointer"),!0)}(r,i):function selectClickedLeaf(r,o){if(-1==o)return!1;var i=r.state.doc.resolve(o),c=i.nodeAfter;return!!(c&&c.isAtom&&a.NodeSelection.isSelectable(c))&&(updateSelection(r,new a.NodeSelection(i),"pointer"),!0)}(r,i))}function handleDoubleClick(r,o,i,a){return runHandlerOnContext(r,"handleDoubleClickOn",o,i,a)||r.someProp("handleDoubleClick",function(i){return i(r,o,a)})}function handleTripleClick(r,o,i,c){return runHandlerOnContext(r,"handleTripleClickOn",o,i,c)||r.someProp("handleTripleClick",function(i){return i(r,o,c)})||function defaultTripleClick(r,o,i){if(0!=i.button)return!1;var c=r.state.doc;if(-1==o)return!!c.inlineContent&&(updateSelection(r,a.TextSelection.create(c,0,c.content.size),"pointer"),!0);for(var u=c.resolve(o),p=u.depth+1;p>0;p--){var g=p>u.depth?u.nodeAfter:u.node(p),v=u.before(p);if(g.inlineContent)updateSelection(r,a.TextSelection.create(c,v+1,v+1+g.content.size),"pointer");else{if(!a.NodeSelection.isSelectable(g))continue;updateSelection(r,a.NodeSelection.create(c,v),"pointer")}return!0}}(r,i,c)}function forceDOMFlush(r){return endComposition(r)}ye.keydown=function(r,o){var i=o;if(r.input.shiftKey=16==i.keyCode||i.shiftKey,!inOrNearComposition(r,i)&&(r.input.lastKeyCode=i.keyCode,r.input.lastKeyCodeTime=Date.now(),!W||!z||13!=i.keyCode))if(229!=i.keyCode&&r.domObserver.forceFlush(),!V||13!=i.keyCode||i.ctrlKey||i.altKey||i.metaKey)r.someProp("handleKeyDown",function(o){return o(r,i)})||captureKeyDown(r,i)?i.preventDefault():setSelectionOrigin(r,"key");else{var a=Date.now();r.input.lastIOSEnter=a,r.input.lastIOSEnterFallbackTimeout=setTimeout(function(){r.input.lastIOSEnter==a&&(r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))}),r.input.lastIOSEnter=0)},200)}},ye.keyup=function(r,o){16==o.keyCode&&(r.input.shiftKey=!1)},ye.keypress=function(r,o){var i=o;if(!(inOrNearComposition(r,i)||!i.charCode||i.ctrlKey&&!i.altKey||U&&i.metaKey))if(r.someProp("handleKeyPress",function(o){return o(r,i)}))i.preventDefault();else{var c=r.state.selection;if(!(c instanceof a.TextSelection&&c.$from.sameParent(c.$to))){var u=String.fromCharCode(i.charCode),p=function deflt(){return r.state.tr.insertText(u).scrollIntoView()};/[\r\n]/.test(u)||r.someProp("handleTextInput",function(o){return o(r,c.$from.pos,c.$to.pos,u,p)})||r.dispatch(p()),i.preventDefault()}}};var Ee=U?"metaKey":"ctrlKey";ve.mousedown=function(r,o){var i=o;r.input.shiftKey=i.shiftKey;var a=forceDOMFlush(r),c=Date.now(),u="singleClick";c-r.input.lastClick.time<500&&function isNear(r,o){var i=o.x-r.clientX,a=o.y-r.clientY;return i*i+a*a<100}(i,r.input.lastClick)&&!i[Ee]&&r.input.lastClick.button==i.button&&("singleClick"==r.input.lastClick.type?u="doubleClick":"doubleClick"==r.input.lastClick.type&&(u="tripleClick")),r.input.lastClick={time:c,x:i.clientX,y:i.clientY,type:u,button:i.button};var p=r.posAtCoords(eventCoords(i));p&&("singleClick"==u?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new Se(r,p,i,!!a)):("doubleClick"==u?handleDoubleClick:handleTripleClick)(r,p.pos,p.inside,i)?i.preventDefault():setSelectionOrigin(r,"pointer"))};var Se=function(){function MouseDown(r,o,i,c){var u,p,g=this;if(_classCallCheck(this,MouseDown),this.view=r,this.pos=o,this.event=i,this.flushed=c,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=r.state.doc,this.selectNode=!!i[Ee],this.allowDefault=i.shiftKey,o.inside>-1)u=r.state.doc.nodeAt(o.inside),p=o.inside;else{var v=r.state.doc.resolve(o.pos);u=v.parent,p=v.depth?v.before():0}var b=c?null:i.target,k=b?r.docView.nearestDesc(b,!0):null;this.target=k&&1==k.nodeDOM.nodeType?k.nodeDOM:null;var E=r.state.selection;(0==i.button&&u.type.spec.draggable&&!1!==u.type.spec.selectable||E instanceof a.NodeSelection&&E.from<=p&&E.to>p)&&(this.mightDrag={node:u,pos:p,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!I||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(function(){g.view.input.mouseDown==g&&g.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),r.root.addEventListener("mouseup",this.up=this.up.bind(this)),r.root.addEventListener("mousemove",this.move=this.move.bind(this)),setSelectionOrigin(r,"pointer")}return _createClass(MouseDown,[{key:"done",value:function done(){var r=this;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(function(){return selectionToDOM(r.view)}),this.view.input.mouseDown=null}},{key:"up",value:function up(r){if(this.done(),this.view.dom.contains(r.target)){var o=this.pos;this.view.state.doc!=this.startDoc&&(o=this.view.posAtCoords(eventCoords(r))),this.updateAllowDefault(r),this.allowDefault||!o?setSelectionOrigin(this.view,"pointer"):handleSingleClick(this.view,o.pos,o.inside,r,this.selectNode)?r.preventDefault():0==r.button&&(this.flushed||B&&this.mightDrag&&!this.mightDrag.node.isAtom||z&&!this.view.state.selection.visible&&Math.min(Math.abs(o.pos-this.view.state.selection.from),Math.abs(o.pos-this.view.state.selection.to))<=2)?(updateSelection(this.view,a.Selection.near(this.view.state.doc.resolve(o.pos)),"pointer"),r.preventDefault()):setSelectionOrigin(this.view,"pointer")}}},{key:"move",value:function move(r){this.updateAllowDefault(r),setSelectionOrigin(this.view,"pointer"),0==r.buttons&&this.done()}},{key:"updateAllowDefault",value:function updateAllowDefault(r){!this.allowDefault&&(Math.abs(this.event.x-r.clientX)>4||Math.abs(this.event.y-r.clientY)>4)&&(this.allowDefault=!0)}}]),MouseDown}();function inOrNearComposition(r,o){return!!r.composing||!!(B&&Math.abs(o.timeStamp-r.input.compositionEndedAt)<500)&&(r.input.compositionEndedAt=-2e8,!0)}ve.touchstart=function(r){r.input.lastTouch=Date.now(),forceDOMFlush(r),setSelectionOrigin(r,"pointer")},ve.touchmove=function(r){r.input.lastTouch=Date.now(),setSelectionOrigin(r,"pointer")},ve.contextmenu=function(r){return forceDOMFlush(r)};var we=W?5e3:-1;function scheduleComposeEnd(r,o){clearTimeout(r.input.composingTimeout),o>-1&&(r.input.composingTimeout=setTimeout(function(){return endComposition(r)},o))}function clearComposition(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=function timestampFromCustomEvent(){var r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function findCompositionNode(r){var o=r.domSelectionRange();if(!o.focusNode)return null;var i=function textNodeBefore$1(r,o){for(;;){if(3==r.nodeType&&o)return r;if(1==r.nodeType&&o>0){if("false"==r.contentEditable)return null;o=nodeSize(r=r.childNodes[o-1])}else{if(!r.parentNode||hasBlockDesc(r))return null;o=p(r),r=r.parentNode}}}(o.focusNode,o.focusOffset),a=function textNodeAfter$1(r,o){for(;;){if(3==r.nodeType&&o<r.nodeValue.length)return r;if(1==r.nodeType&&o<r.childNodes.length){if("false"==r.contentEditable)return null;r=r.childNodes[o],o=0}else{if(!r.parentNode||hasBlockDesc(r))return null;o=p(r)+1,r=r.parentNode}}}(o.focusNode,o.focusOffset);if(i&&a&&i!=a){var c=a.pmViewDesc,u=r.domObserver.lastChangedTextNode;if(i==u||a==u)return u;if(!c||!c.isText(a.nodeValue))return a;if(r.input.compositionNode==a){var g=i.pmViewDesc;if(g&&g.isText(i.nodeValue))return a}}return i||a}function endComposition(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(W&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),clearComposition(r),o||r.docView&&r.docView.dirty){var i=selectionFromDOM(r),a=r.state.selection;return i&&!i.eq(a)?r.dispatch(r.state.tr.setSelection(i)):!r.markCursor&&!o||a.$from.node(a.$from.sharedDepth(a.to)).inlineContent?r.updateState(r.state):r.dispatch(r.state.tr.deleteSelection()),!0}return!1}}ye.compositionstart=ye.compositionupdate=function(r){if(!r.composing){r.domObserver.flush();var o=r.state,i=o.selection.$to;if(o.selection instanceof a.TextSelection&&(o.storedMarks||!i.textOffset&&i.parentOffset&&i.nodeBefore.marks.some(function(r){return!1===r.type.spec.inclusive})||z&&H&&function selectionBeforeUneditable(r){var o=r.domSelectionRange(),i=o.focusNode,a=o.focusOffset;if(!i||1!=i.nodeType||a>=i.childNodes.length)return!1;var c=i.childNodes[a];return 1==c.nodeType&&"false"==c.contentEditable}(r)))r.markCursor=r.state.storedMarks||i.marks(),endComposition(r,!0),r.markCursor=null;else if(endComposition(r,!o.selection.empty),I&&o.selection.empty&&i.parentOffset&&!i.textOffset&&i.nodeBefore.marks.length)for(var c=r.domSelectionRange(),u=c.focusNode,p=c.focusOffset;u&&1==u.nodeType&&0!=p;){var g=p<0?u.lastChild:u.childNodes[p-1];if(!g)break;if(3==g.nodeType){var v=r.domSelection();v&&v.collapse(g,g.nodeValue.length);break}u=g,p=-1}r.input.composing=!0}scheduleComposeEnd(r,we)},ye.compositionend=function(r,o){r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=o.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.badSafariComposition?r.domObserver.forceFlush():r.input.compositionPendingChanges&&Promise.resolve().then(function(){return r.domObserver.flush()}),r.input.compositionID++,scheduleComposeEnd(r,20))};var xe=N&&R<15||V&&G<604;function doPaste(r,o,i,a,u){var p=parseFromClipboard(r,o,i,a,r.state.selection.$from);if(r.someProp("handlePaste",function(o){return o(r,u,p||c.Slice.empty)}))return!0;if(!p)return!1;var g=function sliceSingleNode(r){return 0==r.openStart&&0==r.openEnd&&1==r.content.childCount?r.content.firstChild:null}(p),v=g?r.state.tr.replaceSelectionWith(g,a):r.state.tr.replaceSelection(p);return r.dispatch(v.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function getText(r){var o=r.getData("text/plain")||r.getData("Text");if(o)return o;var i=r.getData("text/uri-list");return i?i.replace(/\r?\n/g," "):""}ve.copy=ye.cut=function(r,o){var i=o,a=r.state.selection,c="cut"==i.type;if(!a.empty){var u=xe?null:i.clipboardData,p=_serializeForClipboard(r,a.content()),g=p.dom,v=p.text;u?(i.preventDefault(),u.clearData(),u.setData("text/html",g.innerHTML),u.setData("text/plain",v)):function captureCopy(r,o){if(r.dom.parentNode){var i=r.dom.parentNode.appendChild(document.createElement("div"));i.appendChild(o),i.style.cssText="position: fixed; left: -10000px; top: 10px";var a=getSelection(),c=document.createRange();c.selectNodeContents(o),r.dom.blur(),a.removeAllRanges(),a.addRange(c),setTimeout(function(){i.parentNode&&i.parentNode.removeChild(i),r.focus()},50)}}(r,g),c&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},ye.paste=function(r,o){var i=o;if(!r.composing||W){var a=xe?null:i.clipboardData,c=r.input.shiftKey&&45!=r.input.lastKeyCode;a&&doPaste(r,getText(a),a.getData("text/html"),c,i)?i.preventDefault():function capturePaste(r,o){if(r.dom.parentNode){var i=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,a=r.dom.parentNode.appendChild(document.createElement(i?"textarea":"div"));i||(a.contentEditable="true"),a.style.cssText="position: fixed; left: -10000px; top: 10px",a.focus();var c=r.input.shiftKey&&45!=r.input.lastKeyCode;setTimeout(function(){r.focus(),a.parentNode&&a.parentNode.removeChild(a),i?doPaste(r,a.value,null,c,o):doPaste(r,a.textContent,a.innerHTML,c,o)},50)}}(r,i)}};var Ce=_createClass(function Dragging(r,o,i){_classCallCheck(this,Dragging),this.slice=r,this.move=o,this.node=i}),_e=U?"altKey":"ctrlKey";function dragMoves(r,o){var i=r.someProp("dragCopies",function(r){return!r(o)});return null!=i?i:!o[_e]}for(var Te in ve.dragstart=function(r,o){var i=o,c=r.input.mouseDown;if(c&&c.done(),i.dataTransfer){var u,p=r.state.selection,g=p.empty?null:r.posAtCoords(eventCoords(i));if(g&&g.pos>=p.from&&g.pos<=(p instanceof a.NodeSelection?p.to-1:p.to));else if(c&&c.mightDrag)u=a.NodeSelection.create(r.state.doc,c.mightDrag.pos);else if(i.target&&1==i.target.nodeType){var v=r.docView.nearestDesc(i.target,!0);v&&v.node.type.spec.draggable&&v!=r.docView&&(u=a.NodeSelection.create(r.state.doc,v.posBefore))}var b=_serializeForClipboard(r,(u||r.state.selection).content()),k=b.dom,E=b.text,w=b.slice;(!i.dataTransfer.files.length||!z||j>120)&&i.dataTransfer.clearData(),i.dataTransfer.setData(xe?"Text":"text/html",k.innerHTML),i.dataTransfer.effectAllowed="copyMove",xe||i.dataTransfer.setData("text/plain",E),r.dragging=new Ce(w,dragMoves(r,i),u)}},ve.dragend=function(r){var o=r.dragging;window.setTimeout(function(){r.dragging==o&&(r.dragging=null)},50)},ye.dragover=ye.dragenter=function(r,o){return o.preventDefault()},ye.drop=function(r,o){try{!function handleDrop(r,o,i){if(!o.dataTransfer)return;var p=r.posAtCoords(eventCoords(o));if(!p)return;var g=r.state.doc.resolve(p.pos),v=i&&i.slice;v?r.someProp("transformPasted",function(o){v=o(v,r,!1)}):v=parseFromClipboard(r,getText(o.dataTransfer),xe?null:o.dataTransfer.getData("text/html"),!1,g);var b=!(!i||!dragMoves(r,o));if(r.someProp("handleDrop",function(i){return i(r,o,v||c.Slice.empty,b)}))return void o.preventDefault();if(!v)return;o.preventDefault();var k=v?u.dropPoint(r.state.doc,g.pos,v):g.pos;null==k&&(k=g.pos);var E=r.state.tr;if(b){var w=i.node;w?w.replace(E):E.deleteSelection()}var x=E.mapping.map(k),C=0==v.openStart&&0==v.openEnd&&1==v.content.childCount,_=E.doc;C?E.replaceRangeWith(x,x,v.content.firstChild):E.replaceRange(x,x,v);if(E.doc.eq(_))return;var T=E.doc.resolve(x);if(C&&a.NodeSelection.isSelectable(v.content.firstChild)&&T.nodeAfter&&T.nodeAfter.sameMarkup(v.content.firstChild))E.setSelection(new a.NodeSelection(T));else{var P=E.mapping.map(k);E.mapping.maps[E.mapping.maps.length-1].forEach(function(r,o,i,a){return P=a}),E.setSelection(selectionBetween(r,T,E.doc.resolve(P)))}r.focus(),r.dispatch(E.setMeta("uiEvent","drop"))}(r,o,r.dragging)}finally{r.dragging=null}},ve.focus=function(r){r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(function(){r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&selectionToDOM(r)},20))},ve.blur=function(r,o){var i=o;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),i.relatedTarget&&r.dom.contains(i.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)},ve.beforeinput=function(r,o){if(z&&W&&"deleteContentBackward"==o.inputType){r.domObserver.flushSoon();var i=r.input.domChangeCount;setTimeout(function(){if(r.input.domChangeCount==i&&(r.dom.blur(),r.focus(),!r.someProp("handleKeyDown",function(o){return o(r,keyEvent(8,"Backspace"))}))){var o=r.state.selection.$cursor;o&&o.pos>0&&r.dispatch(r.state.tr.delete(o.pos-1,o.pos).scrollIntoView())}},50)}},ye)ve[Te]=ye[Te];function compareObjs(r,o){if(r==o)return!0;for(var i in r)if(r[i]!==o[i])return!1;for(var a in o)if(!(a in r))return!1;return!0}var Oe=function(){function WidgetType(r,o){_classCallCheck(this,WidgetType),this.toDOM=r,this.spec=o||Re,this.side=this.spec.side||0}return _createClass(WidgetType,[{key:"map",value:function map(r,o,i,a){var c=r.mapResult(o.from+a,this.side<0?-1:1),u=c.pos;return c.deleted?null:new Me(u-i,u-i,this)}},{key:"valid",value:function valid(){return!0}},{key:"eq",value:function eq(r){return this==r||r instanceof WidgetType&&(this.spec.key&&this.spec.key==r.spec.key||this.toDOM==r.toDOM&&compareObjs(this.spec,r.spec))}},{key:"destroy",value:function destroy(r){this.spec.destroy&&this.spec.destroy(r)}}]),WidgetType}(),Pe=function(){function InlineType(r,o){_classCallCheck(this,InlineType),this.attrs=r,this.spec=o||Re}return _createClass(InlineType,[{key:"map",value:function map(r,o,i,a){var c=r.map(o.from+a,this.spec.inclusiveStart?-1:1)-i,u=r.map(o.to+a,this.spec.inclusiveEnd?1:-1)-i;return c>=u?null:new Me(c,u,this)}},{key:"valid",value:function valid(r,o){return o.from<o.to}},{key:"eq",value:function eq(r){return this==r||r instanceof InlineType&&compareObjs(this.attrs,r.attrs)&&compareObjs(this.spec,r.spec)}},{key:"destroy",value:function destroy(){}}],[{key:"is",value:function is(r){return r.type instanceof InlineType}}]),InlineType}(),Ae=function(){function NodeType(r,o){_classCallCheck(this,NodeType),this.attrs=r,this.spec=o||Re}return _createClass(NodeType,[{key:"map",value:function map(r,o,i,a){var c=r.mapResult(o.from+a,1);if(c.deleted)return null;var u=r.mapResult(o.to+a,-1);return u.deleted||u.pos<=c.pos?null:new Me(c.pos-i,u.pos-i,this)}},{key:"valid",value:function valid(r,o){var i,a=r.content.findIndex(o.from),c=a.index,u=a.offset;return u==o.from&&!(i=r.child(c)).isText&&u+i.nodeSize==o.to}},{key:"eq",value:function eq(r){return this==r||r instanceof NodeType&&compareObjs(this.attrs,r.attrs)&&compareObjs(this.spec,r.spec)}},{key:"destroy",value:function destroy(){}}]),NodeType}(),Me=function(){function Decoration(r,o,i){_classCallCheck(this,Decoration),this.from=r,this.to=o,this.type=i}return _createClass(Decoration,[{key:"copy",value:function copy(r,o){return new Decoration(r,o,this.type)}},{key:"eq",value:function eq(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(r.type)&&this.from+o==r.from&&this.to+o==r.to}},{key:"map",value:function map(r,o,i){return this.type.map(r,this,o,i)}},{key:"spec",get:function get(){return this.type.spec}},{key:"inline",get:function get(){return this.type instanceof Pe}},{key:"widget",get:function get(){return this.type instanceof Oe}}],[{key:"widget",value:function widget(r,o,i){return new Decoration(r,r,new Oe(o,i))}},{key:"inline",value:function inline(r,o,i,a){return new Decoration(r,o,new Pe(i,a))}},{key:"node",value:function node(r,o,i,a){return new Decoration(r,o,new Ae(i,a))}}]),Decoration}(),Ne=[],Re={},Ie=function(){function DecorationSet(r,o){_classCallCheck(this,DecorationSet),this.local=r.length?r:Ne,this.children=o.length?o:Ne}return _createClass(DecorationSet,[{key:"find",value:function find(r,o,i){var a=[];return this.findInner(null==r?0:r,null==o?1e9:o,a,0,i),a}},{key:"findInner",value:function findInner(r,o,i,a,c){for(var u=0;u<this.local.length;u++){var p=this.local[u];p.from<=o&&p.to>=r&&(!c||c(p.spec))&&i.push(p.copy(p.from+a,p.to+a))}for(var g=0;g<this.children.length;g+=3)if(this.children[g]<o&&this.children[g+1]>r){var v=this.children[g]+1;this.children[g+2].findInner(r-v,o-v,i,a+v,c)}}},{key:"map",value:function map(r,o,i){return this==De||0==r.maps.length?this:this.mapInner(r,o,0,0,i||Re)}},{key:"mapInner",value:function mapInner(r,o,i,a,c){for(var u,p=0;p<this.local.length;p++){var g=this.local[p].map(r,i,a);g&&g.type.valid(o,g)?(u||(u=[])).push(g):c.onRemove&&c.onRemove(this.local[p].spec)}return this.children.length?mapChildren(this.children,u||[],r,o,i,a,c):u?new DecorationSet(u.sort(byPos),Ne):De}},{key:"add",value:function add(r,o){return o.length?this==De?DecorationSet.create(r,o):this.addInner(r,o,0):this}},{key:"addInner",value:function addInner(r,o,i){var a,c=this,u=0;r.forEach(function(r,p){var g,v=p+i;if(g=takeSpansForNode(o,r,v)){for(a||(a=c.children.slice());u<a.length&&a[u]<p;)u+=3;a[u]==p?a[u+2]=a[u+2].addInner(r,g,v+1):a.splice(u,0,p,p+r.nodeSize,buildTree(g,r,v+1,Re)),u+=3}});for(var p=moveSpans(u?withoutNulls(o):o,-i),g=0;g<p.length;g++)p[g].type.valid(r,p[g])||p.splice(g--,1);return new DecorationSet(p.length?this.local.concat(p).sort(byPos):this.local,a||this.children)}},{key:"remove",value:function remove(r){return 0==r.length||this==De?this:this.removeInner(r,0)}},{key:"removeInner",value:function removeInner(r,o){for(var i=this.children,a=this.local,c=0;c<i.length;c+=3){for(var u,p=void 0,g=i[c]+o,v=i[c+1]+o,b=0;b<r.length;b++)(u=r[b])&&u.from>g&&u.to<v&&(r[b]=null,(p||(p=[])).push(u));if(p){i==this.children&&(i=this.children.slice());var k=i[c+2].removeInner(p,g+1);k!=De?i[c+2]=k:(i.splice(c,3),c-=3)}}if(a.length)for(var E,w=0;w<r.length;w++)if(E=r[w])for(var x=0;x<a.length;x++)a[x].eq(E,o)&&(a==this.local&&(a=this.local.slice()),a.splice(x--,1));return i==this.children&&a==this.local?this:a.length||i.length?new DecorationSet(a,i):De}},{key:"forChild",value:function forChild(r,o){if(this==De)return this;if(o.isLeaf)return DecorationSet.empty;for(var i,a,c=0;c<this.children.length;c+=3)if(this.children[c]>=r){this.children[c]==r&&(i=this.children[c+2]);break}for(var u=r+1,p=u+o.content.size,g=0;g<this.local.length;g++){var v=this.local[g];if(v.from<p&&v.to>u&&v.type instanceof Pe){var b=Math.max(u,v.from)-u,k=Math.min(p,v.to)-u;b<k&&(a||(a=[])).push(v.copy(b,k))}}if(a){var E=new DecorationSet(a.sort(byPos),Ne);return i?new Le([E,i]):E}return i||De}},{key:"eq",value:function eq(r){if(this==r)return!0;if(!(r instanceof DecorationSet)||this.local.length!=r.local.length||this.children.length!=r.children.length)return!1;for(var o=0;o<this.local.length;o++)if(!this.local[o].eq(r.local[o]))return!1;for(var i=0;i<this.children.length;i+=3)if(this.children[i]!=r.children[i]||this.children[i+1]!=r.children[i+1]||!this.children[i+2].eq(r.children[i+2]))return!1;return!0}},{key:"locals",value:function locals(r){return removeOverlap(this.localsInner(r))}},{key:"localsInner",value:function localsInner(r){if(this==De)return Ne;if(r.inlineContent||!this.local.some(Pe.is))return this.local;for(var o=[],i=0;i<this.local.length;i++)this.local[i].type instanceof Pe||o.push(this.local[i]);return o}},{key:"forEachSet",value:function forEachSet(r){r(this)}}],[{key:"create",value:function create(r,o){return o.length?buildTree(o,r,0,Re):De}}]),DecorationSet}();Ie.empty=new Ie([],[]),Ie.removeOverlap=removeOverlap;var De=Ie.empty,Le=function(){function DecorationGroup(r){_classCallCheck(this,DecorationGroup),this.members=r}return _createClass(DecorationGroup,[{key:"map",value:function map(r,o){var i=this.members.map(function(i){return i.map(r,o,Re)});return DecorationGroup.from(i)}},{key:"forChild",value:function forChild(r,o){if(o.isLeaf)return Ie.empty;for(var i=[],a=0;a<this.members.length;a++){var c=this.members[a].forChild(r,o);c!=De&&(c instanceof DecorationGroup?i=i.concat(c.members):i.push(c))}return DecorationGroup.from(i)}},{key:"eq",value:function eq(r){if(!(r instanceof DecorationGroup)||r.members.length!=this.members.length)return!1;for(var o=0;o<this.members.length;o++)if(!this.members[o].eq(r.members[o]))return!1;return!0}},{key:"locals",value:function locals(r){for(var o,i=!0,a=0;a<this.members.length;a++){var locals=this.members[a].localsInner(r);if(locals.length)if(o){i&&(o=o.slice(),i=!1);for(var c=0;c<locals.length;c++)o.push(locals[c])}else o=locals}return o?removeOverlap(i?o:o.sort(byPos)):Ne}},{key:"forEachSet",value:function forEachSet(r){for(var o=0;o<this.members.length;o++)this.members[o].forEachSet(r)}}],[{key:"from",value:function from(r){switch(r.length){case 0:return De;case 1:return r[0];default:return new DecorationGroup(r.every(function(r){return r instanceof Ie})?r:r.reduce(function(r,o){return r.concat(o instanceof Ie?o:o.members)},[]))}}}]),DecorationGroup}();function mapChildren(r,o,i,a,c,u,p){for(var g=r.slice(),v=function _loop4(r){var o=0;i.maps[b].forEach(function(i,a,c,u){for(var p=u-c-(a-i),v=0;v<g.length;v+=3){var b=g[v+1];if(!(b<0||i>b+r-o)){var k=g[v]+r-o;a>=k?g[v+1]=i<=k?-2:-1:i>=r&&p&&(g[v]+=p,g[v+1]+=p)}}o+=p}),r=i.maps[b].map(r,-1),k=r},b=0,k=u;b<i.maps.length;b++)v(k);for(var E=!1,w=0;w<g.length;w+=3)if(g[w+1]<0){if(-2==g[w+1]){E=!0,g[w+1]=-1;continue}var x=i.map(r[w]+u),C=x-c;if(C<0||C>=a.content.size){E=!0;continue}var _=i.map(r[w+1]+u,-1)-c,T=a.content.findIndex(C),P=T.index,A=T.offset,N=a.maybeChild(P);if(N&&A==C&&A+N.nodeSize==_){var R=g[w+2].mapInner(i,N,x+1,r[w]+u+1,p);R!=De?(g[w]=C,g[w+1]=_,g[w+2]=R):(g[w+1]=-2,E=!0)}else E=!0}if(E){var I=function mapAndGatherRemainingDecorations(r,o,i,a,c,u,p){function gather(r,o){for(var u=0;u<r.local.length;u++){var g=r.local[u].map(a,c,o);g?i.push(g):p.onRemove&&p.onRemove(r.local[u].spec)}for(var v=0;v<r.children.length;v+=3)gather(r.children[v+2],r.children[v]+o+1)}for(var g=0;g<r.length;g+=3)-1==r[g+1]&&gather(r[g+2],o[g]+u+1);return i}(g,r,o,i,c,u,p),L=buildTree(I,a,0,p);o=L.local;for(var z=0;z<g.length;z+=3)g[z+1]<0&&(g.splice(z,3),z-=3);for(var j=0,B=0;j<L.children.length;j+=3){for(var V=L.children[j];B<g.length&&g[B]<V;)B+=3;g.splice(B,0,L.children[j],L.children[j+1],L.children[j+2])}}return new Ie(o.sort(byPos),g)}function moveSpans(r,o){if(!o||!r.length)return r;for(var i=[],a=0;a<r.length;a++){var c=r[a];i.push(new Me(c.from+o,c.to+o,c.type))}return i}function takeSpansForNode(r,o,i){if(o.isLeaf)return null;for(var a,c=i+o.nodeSize,u=null,p=0;p<r.length;p++)(a=r[p])&&a.from>i&&a.to<c&&((u||(u=[])).push(a),r[p]=null);return u}function withoutNulls(r){for(var o=[],i=0;i<r.length;i++)null!=r[i]&&o.push(r[i]);return o}function buildTree(r,o,i,a){var c=[],u=!1;o.forEach(function(o,p){var g=takeSpansForNode(r,o,p+i);if(g){u=!0;var v=buildTree(g,o,i+p+1,a);v!=De&&c.push(p,p+o.nodeSize,v)}});for(var p=moveSpans(u?withoutNulls(r):r,-i).sort(byPos),g=0;g<p.length;g++)p[g].type.valid(o,p[g])||(a.onRemove&&a.onRemove(p[g].spec),p.splice(g--,1));return p.length||c.length?new Ie(p,c):De}function byPos(r,o){return r.from-o.from||r.to-o.to}function removeOverlap(r){for(var o=r,i=0;i<o.length-1;i++){var a=o[i];if(a.from!=a.to)for(var c=i+1;c<o.length;c++){var u=o[c];if(u.from!=a.from){u.from<a.to&&(o==r&&(o=r.slice()),o[i]=a.copy(a.from,u.from),insertAhead(o,c,a.copy(u.from,a.to)));break}u.to!=a.to&&(o==r&&(o=r.slice()),o[c]=u.copy(u.from,a.to),insertAhead(o,c+1,u.copy(a.to,u.to)))}}return o}function insertAhead(r,o,i){for(;o<r.length&&byPos(i,r[o])>0;)o++;r.splice(o,0,i)}function viewDecorations(r){var o=[];return r.someProp("decorations",function(i){var a=i(r.state);a&&a!=De&&o.push(a)}),r.cursorWrapper&&o.push(Ie.create(r.state.doc,[r.cursorWrapper.deco])),Le.from(o)}var Fe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ze=N&&R<=11,je=function(){function SelectionState(){_classCallCheck(this,SelectionState),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return _createClass(SelectionState,[{key:"set",value:function set(r){this.anchorNode=r.anchorNode,this.anchorOffset=r.anchorOffset,this.focusNode=r.focusNode,this.focusOffset=r.focusOffset}},{key:"clear",value:function clear(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function eq(r){return r.anchorNode==this.anchorNode&&r.anchorOffset==this.anchorOffset&&r.focusNode==this.focusNode&&r.focusOffset==this.focusOffset}}]),SelectionState}(),Be=function(){function DOMObserver(r,o){var i=this;_classCallCheck(this,DOMObserver),this.view=r,this.handleDOMChange=o,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new je,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(function(o){for(var a=0;a<o.length;a++)i.queue.push(o[a]);N&&R<=11&&o.some(function(r){return"childList"==r.type&&r.removedNodes.length||"characterData"==r.type&&r.oldValue.length>r.target.nodeValue.length})?i.flushSoon():B&&r.composing&&o.some(function(r){return"childList"==r.type&&"TR"==r.target.nodeName})?(r.input.badSafariComposition=!0,i.flushSoon()):i.flush()}),ze&&(this.onCharData=function(r){i.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),i.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return _createClass(DOMObserver,[{key:"flushSoon",value:function flushSoon(){var r=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){r.flushingSoon=-1,r.flush()},20))}},{key:"forceFlush",value:function forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Fe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function stop(){var r=this;if(this.observer){var o=this.observer.takeRecords();if(o.length){for(var i=0;i<o.length;i++)this.queue.push(o[i]);window.setTimeout(function(){return r.flush()},20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function suppressSelectionUpdates(){var r=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return r.suppressingSelectionUpdates=!1},50)}},{key:"onSelectionChange",value:function onSelectionChange(){if(hasFocusAndSelection(this.view)){if(this.suppressingSelectionUpdates)return selectionToDOM(this.view);if(N&&R<=11&&!this.view.state.selection.empty){var r=this.view.domSelectionRange();if(r.focusNode&&k(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}},{key:"ignoreSelectionChange",value:function ignoreSelectionChange(r){if(!r.focusNode)return!0;for(var o,i=new Set,a=r.focusNode;a;a=g(a))i.add(a);for(var c=r.anchorNode;c;c=g(c))if(i.has(c)){o=c;break}var u=o&&this.view.docView.nearestDesc(o);return u&&u.ignoreMutation({type:"selection",target:3==o.nodeType?o.parentNode:o})?(this.setCurSelection(),!0):void 0}},{key:"pendingRecords",value:function pendingRecords(){if(this.observer){var r,o=_createForOfIteratorHelper(this.observer.takeRecords());try{for(o.s();!(r=o.n()).done;){var i=r.value;this.queue.push(i)}}catch(r){o.e(r)}finally{o.f()}}return this.queue}},{key:"flush",value:function flush(){var r=this.view;if(r.docView&&!(this.flushingSoon>-1)){var o=this.pendingRecords();o.length&&(this.queue=[]);var i=r.domSelectionRange(),c=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&hasFocusAndSelection(r)&&!this.ignoreSelectionChange(i),u=-1,p=-1,g=!1,v=[];if(r.editable)for(var b=0;b<o.length;b++){var k=this.registerMutation(o[b],v);k&&(u=u<0?k.from:Math.min(k.from,u),p=p<0?k.to:Math.max(k.to,p),k.typeOver&&(g=!0))}if(!v.some(function(r){return"BR"==r.nodeName})||8!=r.input.lastKeyCode&&46!=r.input.lastKeyCode){if(I&&v.length){var E=v.filter(function(r){return"BR"==r.nodeName});if(2==E.length){var x=_slicedToArray(E,2),C=x[0],_=x[1];C.parentNode&&C.parentNode.parentNode==_.parentNode?_.remove():C.remove()}else{var T,P=this.currentSelection.focusNode,A=_createForOfIteratorHelper(E);try{for(A.s();!(T=A.n()).done;){var N=T.value,R=N.parentNode;!R||"LI"!=R.nodeName||P&&blockParent(r,P)==R||N.remove()}}catch(r){A.e(r)}finally{A.f()}}}}else{var L,z=_createForOfIteratorHelper(v);try{for(z.s();!(L=z.n()).done;){var j=L.value;if("BR"==j.nodeName&&j.parentNode){var B=j.nextSibling;B&&1==B.nodeType&&"false"==B.contentEditable&&j.parentNode.removeChild(j)}}}catch(r){z.e(r)}finally{z.f()}}var V=null;u<0&&c&&r.input.lastFocus>Date.now()-200&&Math.max(r.input.lastTouch,r.input.lastClick.time)<Date.now()-300&&w(i)&&(V=selectionFromDOM(r))&&V.eq(a.Selection.near(r.state.doc.resolve(0),1))?(r.input.lastFocus=0,selectionToDOM(r),this.currentSelection.set(i),r.scrollToSelection()):(u>-1||c)&&(u>-1&&(r.docView.markDirty(u,p),function checkCSS(r){if(Ve.has(r))return;if(Ve.set(r,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace)){if(r.requiresGeckoHackNode=I,$e)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."),$e=!0}}(r)),r.input.badSafariComposition&&(r.input.badSafariComposition=!1,function fixUpBadSafariComposition(r,o){var i,a,c=r.domSelectionRange(),u=c.focusNode,p=c.focusOffset,g=_createForOfIteratorHelper(o);try{for(g.s();!(a=g.n()).done;){var v=a.value;if("TR"==(null===(i=v.parentNode)||void 0===i?void 0:i.nodeName)){for(var b=v.nextSibling;b&&"TD"!=b.nodeName&&"TH"!=b.nodeName;)b=b.nextSibling;if(b){for(var k=b;;){var E=k.firstChild;if(!E||1!=E.nodeType||"false"==E.contentEditable||/^(BR|IMG)$/.test(E.nodeName))break;k=E}k.insertBefore(v,k.firstChild),u==v&&r.domSelection().collapse(v,p)}else v.parentNode.removeChild(v)}}}catch(r){g.e(r)}finally{g.f()}}(r,v)),this.handleDOMChange(u,p,g,v),r.docView&&r.docView.dirty?r.updateState(r.state):this.currentSelection.eq(i)||selectionToDOM(r),this.currentSelection.set(i))}}},{key:"registerMutation",value:function registerMutation(r,o){if(o.indexOf(r.target)>-1)return null;var i=this.view.docView.nearestDesc(r.target);if("attributes"==r.type&&(i==this.view.docView||"contenteditable"==r.attributeName||"style"==r.attributeName&&!r.oldValue&&!r.target.getAttribute("style")))return null;if(!i||i.ignoreMutation(r))return null;if("childList"==r.type){for(var a=0;a<r.addedNodes.length;a++){var c=r.addedNodes[a];o.push(c),3==c.nodeType&&(this.lastChangedTextNode=c)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(r.target))return{from:i.posBefore,to:i.posAfter};var u=r.previousSibling,g=r.nextSibling;if(N&&R<=11&&r.addedNodes.length)for(var v=0;v<r.addedNodes.length;v++){var b=r.addedNodes[v],k=b.previousSibling,E=b.nextSibling;(!k||Array.prototype.indexOf.call(r.addedNodes,k)<0)&&(u=k),(!E||Array.prototype.indexOf.call(r.addedNodes,E)<0)&&(g=E)}var w=u&&u.parentNode==r.target?p(u)+1:0,x=i.localPosFromDOM(r.target,w,-1),C=g&&g.parentNode==r.target?p(g):r.target.childNodes.length;return{from:x,to:i.localPosFromDOM(r.target,C,1)}}return"attributes"==r.type?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=r.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:r.target.nodeValue==r.oldValue})}}]),DOMObserver}(),Ve=new WeakMap,$e=!1;function rangeToSelectionRange(r,o){var i=o.startContainer,a=o.startOffset,c=o.endContainer,u=o.endOffset,p=r.domAtPos(r.state.selection.anchor);if(k(p.node,p.offset,c,u)){var g=[c,u,i,a];i=g[0],a=g[1],c=g[2],u=g[3]}return{anchorNode:i,anchorOffset:a,focusNode:c,focusOffset:u}}function blockParent(r,o){for(var i=o.parentNode;i&&i!=r.dom;i=i.parentNode){var a=r.docView.nearestDesc(i,!0);if(a&&a.node.isBlock)return i}return null}function ruleFromNode(r){var o=r.pmViewDesc;if(o)return o.parseRule();if("BR"==r.nodeName&&r.parentNode){if(B&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){var i=document.createElement("div");return i.appendChild(document.createElement("li")),{skip:i}}if(r.parentNode.lastChild==r||B&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if("IMG"==r.nodeName&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}var Ue=/^(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 readDOMChange(r,o,i,u,p){var g=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,o<0){var v=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,b=selectionFromDOM(r,v);if(b&&!r.state.selection.eq(b)){if(z&&W&&13===r.input.lastKeyCode&&Date.now()-100<r.input.lastKeyCodeTime&&r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))}))return;var k=r.state.tr.setSelection(b);"pointer"==v?k.setMeta("pointer",!0):"key"==v&&k.scrollIntoView(),g&&k.setMeta("composition",g),r.dispatch(k)}}else{var E=r.state.doc.resolve(o),x=E.sharedDepth(i);o=E.before(x+1),i=r.state.doc.resolve(i).after(x+1);var C,_,T=r.state.selection,P=function parseBetween(r,o,i){var a,u=r.docView.parseRange(o,i),p=u.node,g=u.fromOffset,v=u.toOffset,b=u.from,k=u.to,E=r.domSelectionRange(),x=E.anchorNode;if(x&&r.dom.contains(1==x.nodeType?x:x.parentNode)&&(a=[{node:x,offset:E.anchorOffset}],w(E)||a.push({node:E.focusNode,offset:E.focusOffset})),z&&8===r.input.lastKeyCode)for(var C=v;C>g;C--){var _=p.childNodes[C-1],T=_.pmViewDesc;if("BR"==_.nodeName&&!T){v=C;break}if(!T||T.size)break}var P=r.state.doc,A=r.someProp("domParser")||c.DOMParser.fromSchema(r.state.schema),N=P.resolve(b),R=null,I=A.parse(p,{topNode:N.parent,topMatch:N.parent.contentMatchAt(N.index()),topOpen:!0,from:g,to:v,preserveWhitespace:"pre"!=N.parent.type.whitespace||"full",findPositions:a,ruleFromNode:ruleFromNode,context:N});if(a&&null!=a[0].pos){var L=a[0].pos,j=a[1]&&a[1].pos;null==j&&(j=L),R={anchor:L+b,head:j+b}}return{doc:I,sel:R,from:b,to:k}}(r,o,i),A=r.state.doc,I=A.slice(P.from,P.to);8===r.input.lastKeyCode&&Date.now()-100<r.input.lastKeyCodeTime?(C=r.state.selection.to,_="end"):(C=r.state.selection.from,_="start"),r.input.lastKeyCode=null;var L=function findDiff(r,o,i,a,c){var u=r.findDiffStart(o,i);if(null==u)return null;var p=r.findDiffEnd(o,i+r.size,i+o.size),g=p.a,v=p.b;if("end"==c){a-=g+Math.max(0,u-Math.min(g,v))-u}if(g<u&&r.size<o.size){var b=a<=u&&a>=g?u-a:0;(u-=b)&&u<o.size&&isSurrogatePair(o.textBetween(u-1,u+1))&&(u+=b?1:-1),v=u+(v-g),g=u}else if(v<u){var k=a<=u&&a>=v?u-a:0;(u-=k)&&u<r.size&&isSurrogatePair(r.textBetween(u-1,u+1))&&(u+=k?1:-1),g=u+(g-v),v=u}return{start:u,endA:g,endB:v}}(I.content,P.doc.content,P.from,C,_);if(L&&r.input.domChangeCount++,(V&&r.input.lastIOSEnter>Date.now()-225||W)&&p.some(function(r){return 1==r.nodeType&&!Ue.test(r.nodeName)})&&(!L||L.endA>=L.endB)&&r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))}))r.input.lastIOSEnter=0;else{if(!L){if(!(u&&T instanceof a.TextSelection&&!T.empty&&T.$head.sameParent(T.$anchor))||r.composing||P.sel&&P.sel.anchor!=P.sel.head){if(P.sel){var j=resolveSelection(r,r.state.doc,P.sel);if(j&&!j.eq(r.state.selection)){var B=r.state.tr.setSelection(j);g&&B.setMeta("composition",g),r.dispatch(B)}}return}L={start:T.from,endA:T.to,endB:T.to}}r.state.selection.from<r.state.selection.to&&L.start==L.endB&&r.state.selection instanceof a.TextSelection&&(L.start>r.state.selection.from&&L.start<=r.state.selection.from+2&&r.state.selection.from>=P.from?L.start=r.state.selection.from:L.endA<r.state.selection.to&&L.endA>=r.state.selection.to-2&&r.state.selection.to<=P.to&&(L.endB+=r.state.selection.to-L.endA,L.endA=r.state.selection.to)),N&&R<=11&&L.endB==L.start+1&&L.endA==L.start&&L.start>P.from&&" "==P.doc.textBetween(L.start-P.from-1,L.start-P.from+1)&&(L.start--,L.endA--,L.endB--);var U=P.doc.resolveNoCache(L.start-P.from),H=P.doc.resolveNoCache(L.endB-P.from),K=A.resolve(L.start),G=U.sameParent(H)&&U.parent.inlineContent&&K.end()>=L.endA;if((V&&r.input.lastIOSEnter>Date.now()-225&&(!G||p.some(function(r){return"DIV"==r.nodeName||"P"==r.nodeName}))||!G&&U.pos<P.doc.content.size&&(!U.sameParent(H)||!U.parent.inlineContent)&&U.pos<H.pos&&!/\S/.test(P.doc.textBetween(U.pos,H.pos,"","")))&&r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))}))r.input.lastIOSEnter=0;else if(r.state.selection.anchor>L.start&&function looksLikeBackspace(r,o,i,a,c){if(i-o<=c.pos-a.pos||skipClosingAndOpening(a,!0,!1)<c.pos)return!1;var u=r.resolve(o);if(!a.parent.isTextblock){var p=u.nodeAfter;return null!=p&&i==o+p.nodeSize}if(u.parentOffset<u.parent.content.size||!u.parent.isTextblock)return!1;var g=r.resolve(skipClosingAndOpening(u,!0,!0));return!(!g.parent.isTextblock||g.pos>i||skipClosingAndOpening(g,!0,!1)<i)&&a.parent.content.cut(a.parentOffset).eq(g.parent.content)}(A,L.start,L.endA,U,H)&&r.someProp("handleKeyDown",function(o){return o(r,keyEvent(8,"Backspace"))}))W&&z&&r.domObserver.suppressSelectionUpdates();else{z&&L.endB==L.start&&(r.input.lastChromeDelete=Date.now()),W&&!G&&U.start()!=H.start()&&0==H.parentOffset&&U.depth==H.depth&&P.sel&&P.sel.anchor==P.sel.head&&P.sel.head==L.endA&&(L.endB-=2,H=P.doc.resolveNoCache(L.endB-P.from),setTimeout(function(){r.someProp("handleKeyDown",function(o){return o(r,keyEvent(13,"Enter"))})},20));var J,Y=L.start,X=L.endA,Q=function mkTr(o){var i=o||r.state.tr.replace(Y,X,P.doc.slice(L.start-P.from,L.endB-P.from));if(P.sel){var a=resolveSelection(r,i.doc,P.sel);a&&!(z&&r.composing&&a.empty&&(L.start!=L.endB||r.input.lastChromeDelete<Date.now()-100)&&(a.head==Y||a.head==i.mapping.map(X)-1)||N&&a.empty&&a.head==Y)&&i.setSelection(a)}return g&&i.setMeta("composition",g),i.scrollIntoView()};if(G)if(U.pos==H.pos){N&&R<=11&&0==U.parentOffset&&(r.domObserver.suppressSelectionUpdates(),setTimeout(function(){return selectionToDOM(r)},20));var Z=Q(r.state.tr.delete(Y,X)),ee=A.resolve(L.start).marksAcross(A.resolve(L.endA));ee&&Z.ensureMarks(ee),r.dispatch(Z)}else if(L.endA==L.endB&&(J=function isMarkChange(r,o){for(var i,a,u,p=r.firstChild.marks,g=o.firstChild.marks,v=p,b=g,k=0;k<g.length;k++)v=g[k].removeFromSet(v);for(var E=0;E<p.length;E++)b=p[E].removeFromSet(b);if(1==v.length&&0==b.length)a=v[0],i="add",u=function update(r){return r.mark(a.addToSet(r.marks))};else{if(0!=v.length||1!=b.length)return null;a=b[0],i="remove",u=function update(r){return r.mark(a.removeFromSet(r.marks))}}for(var w=[],x=0;x<o.childCount;x++)w.push(u(o.child(x)));if(c.Fragment.from(w).eq(r))return{mark:a,type:i}}(U.parent.content.cut(U.parentOffset,H.parentOffset),K.parent.content.cut(K.parentOffset,L.endA-K.start())))){var te=Q(r.state.tr);"add"==J.type?te.addMark(Y,X,J.mark):te.removeMark(Y,X,J.mark),r.dispatch(te)}else if(U.parent.child(U.index()).isText&&U.index()==H.index()-(H.textOffset?0:1)){var ne=U.parent.textBetween(U.parentOffset,H.parentOffset),re=function deflt(){return Q(r.state.tr.insertText(ne,Y,X))};r.someProp("handleTextInput",function(o){return o(r,Y,X,ne,re)})||r.dispatch(re())}else r.dispatch(Q());else r.dispatch(Q())}}}}function resolveSelection(r,o,i){return Math.max(i.anchor,i.head)>o.content.size?null:selectionBetween(r,o.resolve(i.anchor),o.resolve(i.head))}function skipClosingAndOpening(r,o,i){for(var a=r.depth,c=o?r.end():r.pos;a>0&&(o||r.indexAfter(a)==r.node(a).childCount);)a--,c++,o=!1;if(i)for(var u=r.node(a).maybeChild(r.indexAfter(a));u&&!u.isLeaf;)u=u.firstChild,c++;return c}function isSurrogatePair(r){if(2!=r.length)return!1;var o=r.charCodeAt(0),i=r.charCodeAt(1);return o>=56320&&o<=57343&&i>=55296&&i<=56319}var He=parseFromClipboard,We=endComposition,qe=function(){function EditorView(r,o){var i=this;_classCallCheck(this,EditorView),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 ke,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=o,this.state=o.state,this.directPlugins=o.plugins||[],this.directPlugins.forEach(checkStateComponent),this.dispatch=this.dispatch.bind(this),this.dom=r&&r.mount||document.createElement("div"),r&&(r.appendChild?r.appendChild(this.dom):"function"==typeof r?r(this.dom):r.mount&&(this.mounted=!0)),this.editable=getEditable(this),updateCursorWrapper(this),this.nodeViews=buildNodeViews(this),this.docView=docViewDesc(this.state.doc,computeDocDeco(this),viewDecorations(this),this.dom,this),this.domObserver=new Be(this,function(r,o,a,c){return readDOMChange(i,r,o,a,c)}),this.domObserver.start(),function initInput(r){var o=function _loop2(){var o=ve[i];r.dom.addEventListener(i,r.input.eventHandlers[i]=function(i){!function eventBelongsToView(r,o){if(!o.bubbles)return!0;if(o.defaultPrevented)return!1;for(var i=o.target;i!=r.dom;i=i.parentNode)if(!i||11==i.nodeType||i.pmViewDesc&&i.pmViewDesc.stopEvent(o))return!1;return!0}(r,i)||runCustomHandler(r,i)||!r.editable&&i.type in ye||o(r,i)},be[i]?{passive:!0}:void 0)};for(var i in ve)o();B&&r.dom.addEventListener("input",function(){return null}),ensureListeners(r)}(this),this.updatePluginViews()}return _createClass(EditorView,[{key:"composing",get:function get(){return this.input.composing}},{key:"props",get:function get(){if(this._props.state!=this.state){var r=this._props;for(var o in this._props={},r)this._props[o]=r[o];this._props.state=this.state}return this._props}},{key:"update",value:function update(r){r.handleDOMEvents!=this._props.handleDOMEvents&&ensureListeners(this);var o=this._props;this._props=r,r.plugins&&(r.plugins.forEach(checkStateComponent),this.directPlugins=r.plugins),this.updateStateInner(r.state,o)}},{key:"setProps",value:function setProps(r){var o={};for(var i in this._props)o[i]=this._props[i];for(var a in o.state=this.state,r)o[a]=r[a];this.update(o)}},{key:"updateState",value:function updateState(r){this.updateStateInner(r,this._props)}},{key:"updateStateInner",value:function updateStateInner(r,o){var i,a=this.state,c=!1,u=!1;r.storedMarks&&this.composing&&(clearComposition(this),u=!0),this.state=r;var p=a.plugins!=r.plugins||this._props.plugins!=o.plugins;if(p||this._props.plugins!=o.plugins||this._props.nodeViews!=o.nodeViews){var g=buildNodeViews(this);(function changedNodeViews(r,o){var i=0,a=0;for(var c in r){if(r[c]!=o[c])return!0;i++}for(var u in o)a++;return i!=a})(g,this.nodeViews)&&(this.nodeViews=g,c=!0)}(p||o.handleDOMEvents!=this._props.handleDOMEvents)&&ensureListeners(this),this.editable=getEditable(this),updateCursorWrapper(this);var v=viewDecorations(this),b=computeDocDeco(this),E=a.plugins==r.plugins||a.doc.eq(r.doc)?r.scrollToSelection>a.scrollToSelection?"to selection":"preserve":"reset",w=c||!this.docView.matchesNode(r.doc,b,v);!w&&r.selection.eq(a.selection)||(u=!0);var x="preserve"==E&&u&&null==this.dom.style.overflowAnchor&&function storeScrollPos(r){for(var o,i,a=r.dom.getBoundingClientRect(),c=Math.max(0,a.top),u=(a.left+a.right)/2,p=c+1;p<Math.min(innerHeight,a.bottom);p+=5){var g=r.root.elementFromPoint(u,p);if(g&&g!=r.dom&&r.dom.contains(g)){var v=g.getBoundingClientRect();if(v.top>=c-20){o=g,i=v.top;break}}}return{refDOM:o,refTop:i,stack:scrollStack(r.dom)}}(this);if(u){this.domObserver.stop();var C=w&&(N||z)&&!this.composing&&!a.selection.empty&&!r.selection.empty&&function selectionContextChanged(r,o){var i=Math.min(r.$anchor.sharedDepth(r.head),o.$anchor.sharedDepth(o.head));return r.$anchor.start(i)!=o.$anchor.start(i)}(a.selection,r.selection);if(w){var _=z?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=findCompositionNode(this)),!c&&this.docView.update(r.doc,b,v,this)||(this.docView.updateOuterDeco(b),this.docView.destroy(),this.docView=docViewDesc(r.doc,b,v,this.dom,this)),!_||this.trackWrites&&this.dom.contains(this.trackWrites)||(C=!0)}C||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function anchorInRightPlace(r){var o=r.docView.domFromPos(r.state.selection.anchor,0),i=r.domSelectionRange();return k(o.node,o.offset,i.anchorNode,i.anchorOffset)}(this))?selectionToDOM(this,C):(syncNodeSelection(this,r.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(a),(null===(i=this.dragging)||void 0===i?void 0:i.node)&&!a.doc.eq(r.doc)&&this.updateDraggedNode(this.dragging,a),"reset"==E?this.dom.scrollTop=0:"to selection"==E?this.scrollToSelection():x&&function resetScrollPos(r){var o=r.refDOM,i=r.refTop,a=r.stack,c=o?o.getBoundingClientRect().top:0;restoreScrollStack(a,0==c?0:c-i)}(x)}},{key:"scrollToSelection",value:function scrollToSelection(){var r=this,o=this.domSelectionRange().focusNode;if(o&&this.dom.contains(1==o.nodeType?o:o.parentNode))if(this.someProp("handleScrollToSelection",function(o){return o(r)}));else if(this.state.selection instanceof a.NodeSelection){var i=this.docView.domAfterPos(this.state.selection.from);1==i.nodeType&&scrollRectIntoView(this,i.getBoundingClientRect(),o)}else scrollRectIntoView(this,this.coordsAtPos(this.state.selection.head,1),o);else;}},{key:"destroyPluginViews",value:function destroyPluginViews(){for(var r;r=this.pluginViews.pop();)r.destroy&&r.destroy()}},{key:"updatePluginViews",value:function updatePluginViews(r){if(r&&r.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var o=0;o<this.pluginViews.length;o++){var i=this.pluginViews[o];i.update&&i.update(this,r)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var a=0;a<this.directPlugins.length;a++){var c=this.directPlugins[a];c.spec.view&&this.pluginViews.push(c.spec.view(this))}for(var u=0;u<this.state.plugins.length;u++){var p=this.state.plugins[u];p.spec.view&&this.pluginViews.push(p.spec.view(this))}}}},{key:"updateDraggedNode",value:function updateDraggedNode(r,o){var i=r.node,c=-1;if(this.state.doc.nodeAt(i.from)==i.node)c=i.from;else{var u=i.from+(this.state.doc.content.size-o.doc.content.size);(u>0&&this.state.doc.nodeAt(u))==i.node&&(c=u)}this.dragging=new Ce(r.slice,r.move,c<0?void 0:a.NodeSelection.create(this.state.doc,c))}},{key:"someProp",value:function someProp(r,o){var i,a=this._props&&this._props[r];if(null!=a&&(i=o?o(a):a))return i;for(var c=0;c<this.directPlugins.length;c++){var u=this.directPlugins[c].props[r];if(null!=u&&(i=o?o(u):u))return i}var p=this.state.plugins;if(p)for(var g=0;g<p.length;g++){var v=p[g].props[r];if(null!=v&&(i=o?o(v):v))return i}}},{key:"hasFocus",value:function hasFocus(){if(N){var r=this.root.activeElement;if(r==this.dom)return!0;if(!r||!this.dom.contains(r))return!1;for(;r&&this.dom!=r&&this.dom.contains(r);){if("false"==r.contentEditable)return!1;r=r.parentElement}return!0}return this.root.activeElement==this.dom}},{key:"focus",value:function focus(){this.domObserver.stop(),this.editable&&function focusPreventScroll(r){if(r.setActive)return r.setActive();if(J)return r.focus(J);var o=scrollStack(r);r.focus(null==J?{get preventScroll(){return J={preventScroll:!0},!0}}:void 0),J||(J=!1,restoreScrollStack(o,0))}(this.dom),selectionToDOM(this),this.domObserver.start()}},{key:"root",get:function get(){var r=this,o=this._root;if(null==o)for(var i,a=function _loop5(o){if(9==o.nodeType||11==o.nodeType&&o.host)return o.getSelection||(Object.getPrototypeOf(o).getSelection=function(){return o.ownerDocument.getSelection()}),{v:r._root=o}},c=this.dom.parentNode;c;c=c.parentNode)if(i=a(c))return i.v;return o||document}},{key:"updateRoot",value:function updateRoot(){this._root=null}},{key:"posAtCoords",value:function posAtCoords(r){return _posAtCoords(this,r)}},{key:"coordsAtPos",value:function coordsAtPos(r){return _coordsAtPos(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}},{key:"domAtPos",value:function domAtPos(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(r,o)}},{key:"nodeDOM",value:function nodeDOM(r){var o=this.docView.descAt(r);return o?o.nodeDOM:null}},{key:"posAtDOM",value:function posAtDOM(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=this.docView.posFromDOM(r,o,i);if(null==a)throw new RangeError("DOM position not inside the editor");return a}},{key:"endOfTextblock",value:function endOfTextblock(r,o){return _endOfTextblock(this,o||this.state,r)}},{key:"pasteHTML",value:function pasteHTML(r,o){return doPaste(this,"",r,!1,o||new ClipboardEvent("paste"))}},{key:"pasteText",value:function pasteText(r,o){return doPaste(this,r,null,!0,o||new ClipboardEvent("paste"))}},{key:"serializeForClipboard",value:function serializeForClipboard(r){return _serializeForClipboard(this,r)}},{key:"destroy",value:function destroy(){this.docView&&(function destroyInput(r){for(var o in r.domObserver.stop(),r.input.eventHandlers)r.dom.removeEventListener(o,r.input.eventHandlers[o]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],viewDecorations(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,function clearReusedRange(){v=null}())}},{key:"isDestroyed",get:function get(){return null==this.docView}},{key:"dispatchEvent",value:function dispatchEvent(r){return function _dispatchEvent(r,o){runCustomHandler(r,o)||!ve[o.type]||!r.editable&&o.type in ye||ve[o.type](r,o)}(this,r)}},{key:"domSelectionRange",value:function domSelectionRange(){var r=this.domSelection();return r?B&&11===this.root.nodeType&&function deepActiveElement(r){for(var o=r.activeElement;o&&o.shadowRoot;)o=o.shadowRoot.activeElement;return o}(this.dom.ownerDocument)==this.dom&&function safariShadowSelectionRange(r,o){if(o.getComposedRanges){var i=o.getComposedRanges(r.root)[0];if(i)return rangeToSelectionRange(r,i)}var a;function read(r){r.preventDefault(),r.stopImmediatePropagation(),a=r.getTargetRanges()[0]}return r.dom.addEventListener("beforeinput",read,!0),document.execCommand("indent"),r.dom.removeEventListener("beforeinput",read,!0),a?rangeToSelectionRange(r,a):null}(this,r)||r:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}},{key:"domSelection",value:function domSelection(){return this.root.getSelection()}}]),EditorView}();function computeDocDeco(r){var o=Object.create(null);return o.class="ProseMirror",o.contenteditable=String(r.editable),r.someProp("attributes",function(i){if("function"==typeof i&&(i=i(r.state)),i)for(var a in i)"class"==a?o.class+=" "+i[a]:"style"==a?o.style=(o.style?o.style+";":"")+i[a]:o[a]||"contenteditable"==a||"nodeName"==a||(o[a]=String(i[a]))}),o.translate||(o.translate="no"),[Me.node(0,r.state.doc.content.size,o)]}function updateCursorWrapper(r){if(r.markCursor){var o=document.createElement("img");o.className="ProseMirror-separator",o.setAttribute("mark-placeholder","true"),o.setAttribute("alt",""),r.cursorWrapper={dom:o,deco:Me.widget(r.state.selection.from,o,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function getEditable(r){return!r.someProp("editable",function(o){return!1===o(r.state)})}function buildNodeViews(r){var o=Object.create(null);function add(r){for(var i in r)Object.prototype.hasOwnProperty.call(o,i)||(o[i]=r[i])}return r.someProp("nodeViews",add),r.someProp("markViews",add),o}function checkStateComponent(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}qe.prototype.dispatch=function(r){var o=this._props.dispatchTransaction;o?o.call(this,r):this.updateState(this.state.apply(r))},o.Decoration=Me,o.DecorationSet=Ie,o.EditorView=qe,o.__endComposition=We,o.__parseFromClipboard=He},50976:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Text:()=>b,default:()=>k}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248).Node.create({name:"text",group:"inline",parseMarkdown:r=>({type:"text",text:r.text||""}),renderMarkdown:r=>r.text||""}),k=b},54631:function(r,o,i){"use strict";i.r(o),i.d(o,{MultiToken:function(){return MultiToken},Options:function(){return Options},State:function(){return State},createTokenClass:function(){return createTokenClass},find:function(){return find},init:function(){return init},multi:function(){return Ze},options:function(){return Ge},regexp:function(){return je},registerCustomProtocol:function(){return registerCustomProtocol},registerPlugin:function(){return registerPlugin},registerTokenPlugin:function(){return registerTokenPlugin},reset:function(){return reset},stringToArray:function(){return stringToArray},test:function(){return test},text:function(){return Ze},tokenize:function(){return tokenize}});const a="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",c="ελ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",u="numeric",p="ascii",g="alpha",v="asciinumeric",b="alphanumeric",k="domain",E="emoji",w="scheme",x="slashscheme",C="whitespace";function registerGroup(r,o){return r in o||(o[r]=[]),o[r]}function addToGroups(r,o,i){o[u]&&(o[v]=!0,o[b]=!0),o[p]&&(o[v]=!0,o[g]=!0),o[v]&&(o[b]=!0),o[g]&&(o[b]=!0),o[b]&&(o[k]=!0),o[E]&&(o[k]=!0);for(const a in o){const o=registerGroup(a,i);o.indexOf(r)<0&&o.push(r)}}function State(r=null){this.j={},this.jr=[],this.jd=null,this.t=r}State.groups={},State.prototype={accepts(){return!!this.t},go(r){const o=this,i=o.j[r];if(i)return i;for(let i=0;i<o.jr.length;i++){const a=o.jr[i][0],c=o.jr[i][1];if(c&&a.test(r))return c}return o.jd},has(r,o=!1){return o?r in this.j:!!this.go(r)},ta(r,o,i,a){for(let c=0;c<r.length;c++)this.tt(r[c],o,i,a)},tr(r,o,i,a){let c;return a=a||State.groups,o&&o.j?c=o:(c=new State(o),i&&a&&addToGroups(o,i,a)),this.jr.push([r,c]),c},ts(r,o,i,a){let c=this;const u=r.length;if(!u)return c;for(let o=0;o<u-1;o++)c=c.tt(r[o]);return c.tt(r[u-1],o,i,a)},tt(r,o,i,a){a=a||State.groups;const c=this;if(o&&o.j)return c.j[r]=o,o;const u=o;let p,g=c.go(r);if(g?(p=new State,Object.assign(p.j,g.j),p.jr.push.apply(p.jr,g.jr),p.jd=g.jd,p.t=g.t):p=new State,u){if(a)if(p.t&&"string"==typeof p.t){const r=Object.assign(function flagsForToken(r,o){const i={};for(const a in o)o[a].indexOf(r)>=0&&(i[a]=!0);return i}(p.t,a),i);addToGroups(u,r,a)}else i&&addToGroups(u,i,a);p.t=u}return c.j[r]=p,p}};const ta=(r,o,i,a,c)=>r.ta(o,i,a,c),tr=(r,o,i,a,c)=>r.tr(o,i,a,c),ts=(r,o,i,a,c)=>r.ts(o,i,a,c),tt=(r,o,i,a,c)=>r.tt(o,i,a,c),_="WORD",T="UWORD",P="ASCIINUMERICAL",A="ALPHANUMERICAL",N="LOCALHOST",R="TLD",I="UTLD",L="SCHEME",z="SLASH_SCHEME",j="NUM",B="WS",V="NL",U="OPENBRACE",H="CLOSEBRACE",W="OPENBRACKET",K="CLOSEBRACKET",G="OPENPAREN",J="CLOSEPAREN",Y="OPENANGLEBRACKET",X="CLOSEANGLEBRACKET",Q="FULLWIDTHLEFTPAREN",Z="FULLWIDTHRIGHTPAREN",ee="LEFTCORNERBRACKET",te="RIGHTCORNERBRACKET",ne="LEFTWHITECORNERBRACKET",re="RIGHTWHITECORNERBRACKET",oe="FULLWIDTHLESSTHAN",ie="FULLWIDTHGREATERTHAN",ae="AMPERSAND",se="APOSTROPHE",le="ASTERISK",ce="AT",ue="BACKSLASH",pe="BACKTICK",de="CARET",fe="COLON",he="COMMA",me="DOLLAR",ge="DOT",ve="EQUALS",ye="EXCLAMATION",be="HYPHEN",ke="PERCENT",Ee="PIPE",Se="PLUS",we="POUND",xe="QUERY",Ce="QUOTE",_e="FULLWIDTHMIDDLEDOT",Te="SEMI",Oe="SLASH",Pe="TILDE",Ae="UNDERSCORE",Me="EMOJI",Ne="SYM";var Re=Object.freeze({__proto__:null,ALPHANUMERICAL:A,AMPERSAND:ae,APOSTROPHE:se,ASCIINUMERICAL:P,ASTERISK:le,AT:ce,BACKSLASH:ue,BACKTICK:pe,CARET:de,CLOSEANGLEBRACKET:X,CLOSEBRACE:H,CLOSEBRACKET:K,CLOSEPAREN:J,COLON:fe,COMMA:he,DOLLAR:me,DOT:ge,EMOJI:Me,EQUALS:ve,EXCLAMATION:ye,FULLWIDTHGREATERTHAN:ie,FULLWIDTHLEFTPAREN:Q,FULLWIDTHLESSTHAN:oe,FULLWIDTHMIDDLEDOT:_e,FULLWIDTHRIGHTPAREN:Z,HYPHEN:be,LEFTCORNERBRACKET:ee,LEFTWHITECORNERBRACKET:ne,LOCALHOST:N,NL:V,NUM:j,OPENANGLEBRACKET:Y,OPENBRACE:U,OPENBRACKET:W,OPENPAREN:G,PERCENT:ke,PIPE:Ee,PLUS:Se,POUND:we,QUERY:xe,QUOTE:Ce,RIGHTCORNERBRACKET:te,RIGHTWHITECORNERBRACKET:re,SCHEME:L,SEMI:Te,SLASH:Oe,SLASH_SCHEME:z,SYM:Ne,TILDE:Pe,TLD:R,UNDERSCORE:Ae,UTLD:I,UWORD:T,WORD:_,WS:B});const Ie=/[a-z]/,De=/\p{L}/u,Le=/\p{Emoji}/u,Fe=/\d/,ze=/\s/;var je=Object.freeze({__proto__:null,ASCII_LETTER:Ie,DIGIT:Fe,EMOJI:Le,EMOJI_VARIATION:/\ufe0f/,LETTER:De,SPACE:ze});const Be="\r",Ve="\n",$e="️",Ue="",He="";let We=null,qe=null;function run$1(r,o){const i=stringToArray(o.replace(/[A-Z]/g,r=>r.toLowerCase())),a=i.length,c=[];let u=0,p=0;for(;p<a;){let g=r,v=null,b=0,k=null,E=-1,w=-1;for(;p<a&&(v=g.go(i[p]));)g=v,g.accepts()?(E=0,w=0,k=g):E>=0&&(E+=i[p].length,w++),b+=i[p].length,u+=i[p].length,p++;u-=E,p-=w,b-=E,c.push({t:k.t,v:o.slice(u-b,u),s:u-b,e:u})}return c}function stringToArray(r){const o=[],i=r.length;let a=0;for(;a<i;){let c,u=r.charCodeAt(a),p=u<55296||u>56319||a+1===i||(c=r.charCodeAt(a+1))<56320||c>57343?r[a]:r.slice(a,a+2);o.push(p),a+=p.length}return o}function fastts(r,o,i,a,c){let u;const p=o.length;for(let i=0;i<p-1;i++){const p=o[i];r.j[p]?u=r.j[p]:(u=new State(a),u.jr=c.slice(),r.j[p]=u),r=u}return u=new State(i),u.jr=c.slice(),r.j[o[p-1]]=u,u}function decodeTlds(r){const o=[],i=[];let a=0;for(;a<r.length;){let c=0;for(;"0123456789".indexOf(r[a+c])>=0;)c++;if(c>0){o.push(i.join(""));for(let o=parseInt(r.substring(a,a+c),10);o>0;o--)i.pop();a+=c}else i.push(r[a]),a++}return o}const Ke={defaultProtocol:"http",events:null,format:noop,formatHref:noop,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Options(r,o=null){let i=Object.assign({},Ke);r&&(i=Object.assign(i,r instanceof Options?r.o:r));const a=i.ignoreTags,c=[];for(let r=0;r<a.length;r++)c.push(a[r].toUpperCase());this.o=i,o&&(this.defaultRender=o),this.ignoreTags=c}function noop(r){return r}Options.prototype={o:Ke,ignoreTags:[],defaultRender(r){return r},check(r){return this.get("validate",r.toString(),r)},get(r,o,i){const a=null!=o;let c=this.o[r];return c?("object"==typeof c?(c=i.t in c?c[i.t]:Ke[r],"function"==typeof c&&a&&(c=c(o,i))):"function"==typeof c&&a&&(c=c(o,i.t,i)),c):c},getObj(r,o,i){let a=this.o[r];return"function"==typeof a&&null!=o&&(a=a(o,i.t,i)),a},render(r){const o=r.render(this);return(this.get("render",null,r)||this.defaultRender)(o,r.t,r)}};var Ge=Object.freeze({__proto__:null,Options:Options,defaults:Ke});function MultiToken(r,o){this.t="token",this.v=r,this.tk=o}function createTokenClass(r,o){class Token extends MultiToken{constructor(o,i){super(o,i),this.t=r}}for(const r in o)Token.prototype[r]=o[r];return Token.t=r,Token}MultiToken.prototype={isLink:!1,toString(){return this.v},toHref(r){return this.toString()},toFormattedString(r){const o=this.toString(),i=r.get("truncate",o,this),a=r.get("format",o,this);return i&&a.length>i?a.substring(0,i)+"…":a},toFormattedHref(r){return r.get("formatHref",this.toHref(r.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(r=Ke.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(r),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(r){return{type:this.t,value:this.toFormattedString(r),isLink:this.isLink,href:this.toFormattedHref(r),start:this.startIndex(),end:this.endIndex()}},validate(r){return r.get("validate",this.toString(),this)},render(r){const o=this,i=this.toHref(r.get("defaultProtocol")),a=r.get("formatHref",i,this),c=r.get("tagName",i,o),u=this.toFormattedString(r),p={},g=r.get("className",i,o),v=r.get("target",i,o),b=r.get("rel",i,o),k=r.getObj("attributes",i,o),E=r.getObj("events",i,o);return p.href=a,g&&(p.class=g),v&&(p.target=v),b&&(p.rel=b),k&&Object.assign(p,k),{tagName:c,attributes:p,content:u,eventListeners:E}}};const Je=createTokenClass("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ye=createTokenClass("text"),Xe=createTokenClass("nl"),Qe=createTokenClass("url",{isLink:!0,toHref(r=Ke.defaultProtocol){return this.hasProtocol()?this.v:`${r}://${this.v}`},hasProtocol(){const r=this.tk;return r.length>=2&&r[0].t!==N&&r[1].t===fe}});var Ze=Object.freeze({__proto__:null,Base:MultiToken,Email:Je,MultiToken:MultiToken,Nl:Xe,Text:Ye,Url:Qe,createTokenClass:createTokenClass});const makeState=r=>new State(r);function initMultiToken(r,o,i){const a=i[0].s,c=i[i.length-1].e;return new r(o.slice(a,c),i)}const et="undefined"!=typeof console&&console&&console.warn||(()=>{}),nt="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",rt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function reset(){return State.groups={},rt.scanner=null,rt.parser=null,rt.tokenQueue=[],rt.pluginQueue=[],rt.customSchemes=[],rt.initialized=!1,rt}function registerTokenPlugin(r,o){if("function"!=typeof o)throw new Error(`linkifyjs: Invalid token plugin ${o} (expects function)`);for(let i=0;i<rt.tokenQueue.length;i++)if(r===rt.tokenQueue[i][0])return et(`linkifyjs: token plugin "${r}" already registered - will be overwritten`),void(rt.tokenQueue[i]=[r,o]);rt.tokenQueue.push([r,o]),rt.initialized&&et(`linkifyjs: already initialized - will not register token plugin "${r}" ${nt}`)}function registerPlugin(r,o){if("function"!=typeof o)throw new Error(`linkifyjs: Invalid plugin ${o} (expects function)`);for(let i=0;i<rt.pluginQueue.length;i++)if(r===rt.pluginQueue[i][0])return et(`linkifyjs: plugin "${r}" already registered - will be overwritten`),void(rt.pluginQueue[i]=[r,o]);rt.pluginQueue.push([r,o]),rt.initialized&&et(`linkifyjs: already initialized - will not register plugin "${r}" ${nt}`)}function registerCustomProtocol(r,o=!1){if(rt.initialized&&et(`linkifyjs: already initialized - will not register custom scheme "${r}" ${nt}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(r))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');rt.customSchemes.push([r,o])}function init(){rt.scanner=function init$2(r=[]){const o={};State.groups=o;const i=new State;null==We&&(We=decodeTlds(a)),null==qe&&(qe=decodeTlds(c)),tt(i,"'",se),tt(i,"{",U),tt(i,"}",H),tt(i,"[",W),tt(i,"]",K),tt(i,"(",G),tt(i,")",J),tt(i,"<",Y),tt(i,">",X),tt(i,"(",Q),tt(i,")",Z),tt(i,"「",ee),tt(i,"」",te),tt(i,"『",ne),tt(i,"』",re),tt(i,"<",oe),tt(i,">",ie),tt(i,"&",ae),tt(i,"*",le),tt(i,"@",ce),tt(i,"`",pe),tt(i,"^",de),tt(i,":",fe),tt(i,",",he),tt(i,"$",me),tt(i,".",ge),tt(i,"=",ve),tt(i,"!",ye),tt(i,"-",be),tt(i,"%",ke),tt(i,"|",Ee),tt(i,"+",Se),tt(i,"#",we),tt(i,"?",xe),tt(i,'"',Ce),tt(i,"/",Oe),tt(i,";",Te),tt(i,"~",Pe),tt(i,"_",Ae),tt(i,"\\",ue),tt(i,"・",_e);const je=tr(i,Fe,j,{[u]:!0});tr(je,Fe,je);const Ke=tr(je,Ie,P,{[v]:!0}),Ge=tr(je,De,A,{[b]:!0}),Je=tr(i,Ie,_,{[p]:!0});tr(Je,Fe,Ke),tr(Je,Ie,Je),tr(Ke,Fe,Ke),tr(Ke,Ie,Ke);const Ye=tr(i,De,T,{[g]:!0});tr(Ye,Ie),tr(Ye,Fe,Ge),tr(Ye,De,Ye),tr(Ge,Fe,Ge),tr(Ge,Ie),tr(Ge,De,Ge);const Xe=tt(i,Ve,V,{[C]:!0}),Qe=tt(i,Be,B,{[C]:!0}),Ze=tr(i,ze,B,{[C]:!0});tt(i,He,Ze),tt(Qe,Ve,Xe),tt(Qe,He,Ze),tr(Qe,ze,Ze),tt(Ze,Be),tt(Ze,Ve),tr(Ze,ze,Ze),tt(Ze,He,Ze);const et=tr(i,Le,Me,{[E]:!0});tt(et,"#"),tr(et,Le,et),tt(et,$e,et);const nt=tt(et,Ue);tt(nt,"#"),tr(nt,Le,et);const rt=[[Ie,Je],[Fe,Ke]],ot=[[Ie,null],[De,Ye],[Fe,Ge]];for(let r=0;r<We.length;r++)fastts(i,We[r],R,_,rt);for(let r=0;r<qe.length;r++)fastts(i,qe[r],I,T,ot);addToGroups(R,{tld:!0,ascii:!0},o),addToGroups(I,{utld:!0,alpha:!0},o),fastts(i,"file",L,_,rt),fastts(i,"mailto",L,_,rt),fastts(i,"http",z,_,rt),fastts(i,"https",z,_,rt),fastts(i,"ftp",z,_,rt),fastts(i,"ftps",z,_,rt),addToGroups(L,{scheme:!0,ascii:!0},o),addToGroups(z,{slashscheme:!0,ascii:!0},o),r=r.sort((r,o)=>r[0]>o[0]?1:-1);for(let o=0;o<r.length;o++){const a=r[o][0],c=r[o][1]?{[w]:!0}:{[x]:!0};a.indexOf("-")>=0?c[k]=!0:Ie.test(a)?Fe.test(a)?c[v]=!0:c[p]=!0:c[u]=!0,ts(i,a,a,c)}return ts(i,"localhost",N,{ascii:!0}),i.jd=new State(Ne),{start:i,tokens:Object.assign({groups:o},Re)}}(rt.customSchemes);for(let r=0;r<rt.tokenQueue.length;r++)rt.tokenQueue[r][1]({scanner:rt.scanner});rt.parser=function init$1({groups:r}){const o=r.domain.concat([ae,le,ce,ue,pe,de,me,ve,be,j,ke,Ee,Se,we,Oe,Ne,Pe,Ae]),i=[se,fe,he,ge,ye,ke,xe,Ce,Te,Y,X,U,H,K,W,G,J,Q,Z,ee,te,ne,re,oe,ie],a=[ae,se,le,ue,pe,de,me,ve,be,U,H,ke,Ee,Se,we,xe,Oe,Ne,Pe,Ae],c=makeState(),u=tt(c,Pe);ta(u,a,u),ta(u,r.domain,u);const p=makeState(),g=makeState(),v=makeState();ta(c,r.domain,p),ta(c,r.scheme,g),ta(c,r.slashscheme,v),ta(p,a,u),ta(p,r.domain,p);const b=tt(p,ce);tt(u,ce,b),tt(g,ce,b),tt(v,ce,b);const k=tt(u,ge);ta(k,a,u),ta(k,r.domain,u);const E=makeState();ta(b,r.domain,E),ta(E,r.domain,E);const w=tt(E,ge);ta(w,r.domain,E);const x=makeState(Je);ta(w,r.tld,x),ta(w,r.utld,x),tt(b,N,x);const C=tt(E,be);tt(C,be,C),ta(C,r.domain,E),ta(x,r.domain,E),tt(x,ge,w),tt(x,be,C);const _=tt(x,fe);ta(_,r.numeric,Je);const T=tt(p,be),P=tt(p,ge);tt(T,be,T),ta(T,r.domain,p),ta(P,a,u),ta(P,r.domain,p);const A=makeState(Qe);ta(P,r.tld,A),ta(P,r.utld,A),ta(A,r.domain,p),ta(A,a,u),tt(A,ge,P),tt(A,be,T),tt(A,ce,b);const R=tt(A,fe),I=makeState(Qe);ta(R,r.numeric,I);const L=makeState(Qe),z=makeState();ta(L,o,L),ta(L,i,z),ta(z,o,L),ta(z,i,z),tt(A,Oe,L),tt(I,Oe,L);const B=tt(g,fe),_e=tt(v,fe),Me=tt(_e,Oe),Ie=tt(Me,Oe);ta(g,r.domain,p),tt(g,ge,P),tt(g,be,T),ta(v,r.domain,p),tt(v,ge,P),tt(v,be,T),ta(B,r.domain,L),tt(B,Oe,L),tt(B,xe,L),ta(Ie,r.domain,L),ta(Ie,o,L),tt(Ie,Oe,L);const De=[[U,H],[W,K],[G,J],[Y,X],[Q,Z],[ee,te],[ne,re],[oe,ie]];for(let r=0;r<De.length;r++){const[a,c]=De[r],u=tt(L,a);tt(z,a,u),tt(u,c,L);const p=makeState(Qe);ta(u,o,p);const g=makeState();ta(u,i),ta(p,o,p),ta(p,i,g),ta(g,o,p),ta(g,i,g),tt(p,c,L),tt(g,c,L)}return tt(c,N,A),tt(c,V,Xe),{start:c,tokens:Re}}(rt.scanner.tokens);for(let r=0;r<rt.pluginQueue.length;r++)rt.pluginQueue[r][1]({scanner:rt.scanner,parser:rt.parser});return rt.initialized=!0,rt}function tokenize(r){return rt.initialized||init(),function run(r,o,i){let a=i.length,c=0,u=[],p=[];for(;c<a;){let g=r,v=null,b=null,k=0,E=null,w=-1;for(;c<a&&!(v=g.go(i[c].t));)p.push(i[c++]);for(;c<a&&(b=v||g.go(i[c].t));)v=null,g=b,g.accepts()?(w=0,E=g):w>=0&&w++,c++,k++;if(w<0)c-=k,c<a&&(p.push(i[c]),c++);else{p.length>0&&(u.push(initMultiToken(Ye,o,p)),p=[]),c-=w,k-=w;const r=E.t,a=i.slice(c-k,c);u.push(initMultiToken(r,o,a))}}return p.length>0&&u.push(initMultiToken(Ye,o,p)),u}(rt.parser.start,r,run$1(rt.scanner.start,r))}function find(r,o=null,i=null){if(o&&"object"==typeof o){if(i)throw Error(`linkifyjs: Invalid link type ${o}; must be a string`);i=o,o=null}const a=new Options(i),c=tokenize(r),u=[];for(let r=0;r<c.length;r++){const i=c[r];!i.isLink||o&&i.t!==o||!a.check(i)||u.push(i.toFormattedObject(a))}return u}function test(r,o=null){const i=tokenize(r);return 1===i.length&&i[0].isLink&&(!o||i[0].t===o)}tokenize.scan=run$1},57449:function(r,o,i){"use strict";var a=i(36553),c=i(77712),u=i(37820),p=function deleteSelection(r,o){return!r.selection.empty&&(o&&o(r.tr.deleteSelection().scrollIntoView()),!0)};function atBlockStart(r,o){var i=r.selection.$cursor;return!i||(o?!o.endOfTextblock("backward",r):i.parentOffset>0)?null:i}var g=function joinBackward(r,o,i){var p=atBlockStart(r,i);if(!p)return!1;var g=findCutBefore(p);if(!g){var v=p.blockRange(),b=v&&a.liftTarget(v);return null!=b&&(o&&o(r.tr.lift(v,b).scrollIntoView()),!0)}var k=g.nodeBefore;if(deleteBarrier(r,g,o,-1))return!0;if(0==p.parent.content.size&&(textblockAt(k,"end")||u.NodeSelection.isSelectable(k)))for(var E=p.depth;;E--){var w=a.replaceStep(r.doc,p.before(E),p.after(E),c.Slice.empty);if(w&&w.slice.size<w.to-w.from){if(o){var x=r.tr.step(w);x.setSelection(textblockAt(k,"end")?u.Selection.findFrom(x.doc.resolve(x.mapping.map(g.pos,-1)),-1):u.NodeSelection.create(x.doc,g.pos-k.nodeSize)),o(x.scrollIntoView())}return!0}if(1==E||p.node(E-1).childCount>1)break}return!(!k.isAtom||g.depth!=p.depth-1)&&(o&&o(r.tr.delete(g.pos-k.nodeSize,g.pos).scrollIntoView()),!0)};function joinTextblocksAround(r,o,i){for(var p=o.nodeBefore,g=o.pos-1;!p.isTextblock;g--){if(p.type.spec.isolating)return!1;var v=p.lastChild;if(!v)return!1;p=v}for(var b=o.nodeAfter,k=o.pos+1;!b.isTextblock;k++){if(b.type.spec.isolating)return!1;var E=b.firstChild;if(!E)return!1;b=E}var w=a.replaceStep(r.doc,g,k,c.Slice.empty);if(!w||w.from!=g||w instanceof a.ReplaceStep&&w.slice.size>=k-g)return!1;if(i){var x=r.tr.step(w);x.setSelection(u.TextSelection.create(x.doc,g)),i(x.scrollIntoView())}return!0}function textblockAt(r,o){for(var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=r;a;a="start"==o?a.firstChild:a.lastChild){if(a.isTextblock)return!0;if(i&&1!=a.childCount)return!1}return!1}var v=function selectNodeBackward(r,o,i){var a=r.selection,c=a.$head,p=c;if(!a.empty)return!1;if(c.parent.isTextblock){if(i?!i.endOfTextblock("backward",r):c.parentOffset>0)return!1;p=findCutBefore(c)}var g=p&&p.nodeBefore;return!(!g||!u.NodeSelection.isSelectable(g))&&(o&&o(r.tr.setSelection(u.NodeSelection.create(r.doc,p.pos-g.nodeSize)).scrollIntoView()),!0)};function findCutBefore(r){if(!r.parent.type.spec.isolating)for(var o=r.depth-1;o>=0;o--){if(r.index(o)>0)return r.doc.resolve(r.before(o+1));if(r.node(o).type.spec.isolating)break}return null}function atBlockEnd(r,o){var i=r.selection.$cursor;return!i||(o?!o.endOfTextblock("forward",r):i.parentOffset<i.parent.content.size)?null:i}var b=function joinForward(r,o,i){var p=atBlockEnd(r,i);if(!p)return!1;var g=findCutAfter(p);if(!g)return!1;var v=g.nodeAfter;if(deleteBarrier(r,g,o,1))return!0;if(0==p.parent.content.size&&(textblockAt(v,"start")||u.NodeSelection.isSelectable(v))){var b=a.replaceStep(r.doc,p.before(),p.after(),c.Slice.empty);if(b&&b.slice.size<b.to-b.from){if(o){var k=r.tr.step(b);k.setSelection(textblockAt(v,"start")?u.Selection.findFrom(k.doc.resolve(k.mapping.map(g.pos)),1):u.NodeSelection.create(k.doc,k.mapping.map(g.pos))),o(k.scrollIntoView())}return!0}}return!(!v.isAtom||g.depth!=p.depth-1)&&(o&&o(r.tr.delete(g.pos,g.pos+v.nodeSize).scrollIntoView()),!0)},k=function selectNodeForward(r,o,i){var a=r.selection,c=a.$head,p=c;if(!a.empty)return!1;if(c.parent.isTextblock){if(i?!i.endOfTextblock("forward",r):c.parentOffset<c.parent.content.size)return!1;p=findCutAfter(c)}var g=p&&p.nodeAfter;return!(!g||!u.NodeSelection.isSelectable(g))&&(o&&o(r.tr.setSelection(u.NodeSelection.create(r.doc,p.pos)).scrollIntoView()),!0)};function findCutAfter(r){if(!r.parent.type.spec.isolating)for(var o=r.depth-1;o>=0;o--){var i=r.node(o);if(r.index(o)+1<i.childCount)return r.doc.resolve(r.after(o+1));if(i.type.spec.isolating)break}return null}var E=function newlineInCode(r,o){var i=r.selection,a=i.$head,c=i.$anchor;return!(!a.parent.type.spec.code||!a.sameParent(c))&&(o&&o(r.tr.insertText("\n").scrollIntoView()),!0)};function defaultBlockAt(r){for(var o=0;o<r.edgeCount;o++){var i=r.edge(o).type;if(i.isTextblock&&!i.hasRequiredAttrs())return i}return null}var w=function exitCode(r,o){var i=r.selection,a=i.$head,c=i.$anchor;if(!a.parent.type.spec.code||!a.sameParent(c))return!1;var p=a.node(-1),g=a.indexAfter(-1),v=defaultBlockAt(p.contentMatchAt(g));if(!v||!p.canReplaceWith(g,g,v))return!1;if(o){var b=a.after(),k=r.tr.replaceWith(b,b,v.createAndFill());k.setSelection(u.Selection.near(k.doc.resolve(b),1)),o(k.scrollIntoView())}return!0},x=function createParagraphNear(r,o){var i=r.selection,a=i.$from,c=i.$to;if(i instanceof u.AllSelection||a.parent.inlineContent||c.parent.inlineContent)return!1;var p=defaultBlockAt(c.parent.contentMatchAt(c.indexAfter()));if(!p||!p.isTextblock)return!1;if(o){var g=(!a.parentOffset&&c.index()<c.parent.childCount?a:c).pos,v=r.tr.insert(g,p.createAndFill());v.setSelection(u.TextSelection.create(v.doc,g+1)),o(v.scrollIntoView())}return!0},C=function liftEmptyBlock(r,o){var i=r.selection.$cursor;if(!i||i.parent.content.size)return!1;if(i.depth>1&&i.after()!=i.end(-1)){var c=i.before();if(a.canSplit(r.doc,c))return o&&o(r.tr.split(c).scrollIntoView()),!0}var u=i.blockRange(),p=u&&a.liftTarget(u);return null!=p&&(o&&o(r.tr.lift(u,p).scrollIntoView()),!0)};function splitBlockAs(r){return function(o,i){var c=o.selection,p=c.$from,g=c.$to;if(o.selection instanceof u.NodeSelection&&o.selection.node.isBlock)return!(!p.parentOffset||!a.canSplit(o.doc,p.pos))&&(i&&i(o.tr.split(p.pos).scrollIntoView()),!0);if(!p.depth)return!1;for(var v,b,k=[],E=!1,w=!1,x=p.depth;;x--){if(p.node(x).isBlock){E=p.end(x)==p.pos+(p.depth-x),w=p.start(x)==p.pos-(p.depth-x),b=defaultBlockAt(p.node(x-1).contentMatchAt(p.indexAfter(x-1)));var C=r&&r(g.parent,E,p);k.unshift(C||(E&&b?{type:b}:null)),v=x;break}if(1==x)return!1;k.unshift(null)}var _=o.tr;(o.selection instanceof u.TextSelection||o.selection instanceof u.AllSelection)&&_.deleteSelection();var T=_.mapping.map(p.pos),P=a.canSplit(_.doc,T,k.length,k);if(P||(k[0]=b?{type:b}:null,P=a.canSplit(_.doc,T,k.length,k)),!P)return!1;if(_.split(T,k.length,k),!E&&w&&p.node(v).type!=b){var A=_.mapping.map(p.before(v)),N=_.doc.resolve(A);b&&p.node(v-1).canReplaceWith(N.index(),N.index()+1,b)&&_.setNodeMarkup(_.mapping.map(p.before(v)),b)}return i&&i(_.scrollIntoView()),!0}}var _=splitBlockAs(),T=function selectAll(r,o){return o&&o(r.tr.setSelection(new u.AllSelection(r.doc))),!0};function deleteBarrier(r,o,i,p){var g,v,b=o.nodeBefore,k=o.nodeAfter,E=b.type.spec.isolating||k.type.spec.isolating;if(!E&&function joinMaybeClear(r,o,i){var c=o.nodeBefore,u=o.nodeAfter,p=o.index();return!(!(c&&u&&c.type.compatibleContent(u.type))||(!c.content.size&&o.parent.canReplace(p-1,p)?(i&&i(r.tr.delete(o.pos-c.nodeSize,o.pos).scrollIntoView()),0):!o.parent.canReplace(p,p+1)||!u.isTextblock&&!a.canJoin(r.doc,o.pos)||(i&&i(r.tr.join(o.pos).scrollIntoView()),0)))}(r,o,i))return!0;var w=!E&&o.parent.canReplace(o.index(),o.index()+1);if(w&&(g=(v=b.contentMatchAt(b.childCount)).findWrapping(k.type))&&v.matchType(g[0]||k.type).validEnd){if(i){for(var x=o.pos+k.nodeSize,C=c.Fragment.empty,_=g.length-1;_>=0;_--)C=c.Fragment.from(g[_].create(null,C));C=c.Fragment.from(b.copy(C));var T=r.tr.step(new a.ReplaceAroundStep(o.pos-1,x,o.pos,x,new c.Slice(C,1,0),g.length,!0)),P=T.doc.resolve(x+2*g.length);P.nodeAfter&&P.nodeAfter.type==b.type&&a.canJoin(T.doc,P.pos)&&T.join(P.pos),i(T.scrollIntoView())}return!0}var A=k.type.spec.isolating||p>0&&E?null:u.Selection.findFrom(o,1),N=A&&A.$from.blockRange(A.$to),R=N&&a.liftTarget(N);if(null!=R&&R>=o.depth)return i&&i(r.tr.lift(N,R).scrollIntoView()),!0;if(w&&textblockAt(k,"start",!0)&&textblockAt(b,"end")){for(var I=b,L=[];L.push(I),!I.isTextblock;)I=I.lastChild;for(var z=k,j=1;!z.isTextblock;z=z.firstChild)j++;if(I.canReplace(I.childCount,I.childCount,z.content)){if(i){for(var B=c.Fragment.empty,V=L.length-1;V>=0;V--)B=c.Fragment.from(L[V].copy(B));i(r.tr.step(new a.ReplaceAroundStep(o.pos-L.length,o.pos+k.nodeSize,o.pos+j,o.pos+k.nodeSize-j,new c.Slice(B,L.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function selectTextblockSide(r){return function(o,i){for(var a=o.selection,c=r<0?a.$from:a.$to,p=c.depth;c.node(p).isInline;){if(!p)return!1;p--}return!!c.node(p).isTextblock&&(i&&i(o.tr.setSelection(u.TextSelection.create(o.doc,r<0?c.start(p):c.end(p)))),!0)}}var P=selectTextblockSide(-1),A=selectTextblockSide(1);function chainCommands(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return function(r,i,a){for(var c=0;c<o.length;c++)if(o[c](r,i,a))return!0;return!1}}var N=chainCommands(p,g,v),R=chainCommands(p,b,k),I={Enter:chainCommands(E,x,C,_),"Mod-Enter":w,Backspace:N,"Mod-Backspace":N,"Shift-Backspace":N,Delete:R,"Mod-Delete":R,"Mod-a":T},L={"Ctrl-h":I.Backspace,"Alt-Backspace":I["Mod-Backspace"],"Ctrl-d":I.Delete,"Ctrl-Alt-Backspace":I["Mod-Delete"],"Alt-Delete":I["Mod-Delete"],"Alt-d":I["Mod-Delete"],"Ctrl-a":P,"Ctrl-e":A};for(var z in I)L[z]=I[z];var j=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?L:I;o.autoJoin=function autoJoin(r,o){var i=Array.isArray(o)?function(r){return o.indexOf(r.type.name)>-1}:o;return function(o,c,u){return r(o,c&&function wrapDispatchForJoin(r,o){return function(i){if(!i.isGeneric)return r(i);for(var c=[],u=0;u<i.mapping.maps.length;u++){for(var p=i.mapping.maps[u],g=0;g<c.length;g++)c[g]=p.map(c[g]);p.forEach(function(r,o,i,a){return c.push(i,a)})}for(var v=[],b=0;b<c.length;b+=2)for(var k=c[b],E=c[b+1],w=i.doc.resolve(k),x=w.sharedDepth(E),C=w.node(x),_=w.indexAfter(x),T=w.after(x+1);T<=E;++_){var P=C.maybeChild(_);if(!P)break;if(_&&-1==v.indexOf(T)){var A=C.child(_-1);A.type==P.type&&o(A,P)&&v.push(T)}T+=P.nodeSize}v.sort(function(r,o){return r-o});for(var N=v.length-1;N>=0;N--)a.canJoin(i.doc,v[N])&&i.join(v[N]);r(i)}}(c,i),u)}},o.baseKeymap=j,o.chainCommands=chainCommands,o.createParagraphNear=x,o.deleteSelection=p,o.exitCode=w,o.joinBackward=g,o.joinDown=function joinDown(r,o){var i,c=r.selection;if(c instanceof u.NodeSelection){if(c.node.isTextblock||!a.canJoin(r.doc,c.to))return!1;i=c.to}else if(null==(i=a.joinPoint(r.doc,c.to,1)))return!1;return o&&o(r.tr.join(i).scrollIntoView()),!0},o.joinForward=b,o.joinTextblockBackward=function joinTextblockBackward(r,o,i){var a=atBlockStart(r,i);if(!a)return!1;var c=findCutBefore(a);return!!c&&joinTextblocksAround(r,c,o)},o.joinTextblockForward=function joinTextblockForward(r,o,i){var a=atBlockEnd(r,i);if(!a)return!1;var c=findCutAfter(a);return!!c&&joinTextblocksAround(r,c,o)},o.joinUp=function joinUp(r,o){var i,c=r.selection,p=c instanceof u.NodeSelection;if(p){if(c.node.isTextblock||!a.canJoin(r.doc,c.from))return!1;i=c.from}else if(null==(i=a.joinPoint(r.doc,c.from,-1)))return!1;if(o){var g=r.tr.join(i);p&&g.setSelection(u.NodeSelection.create(g.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),o(g.scrollIntoView())}return!0},o.lift=function lift(r,o){var i=r.selection,c=i.$from,u=i.$to,p=c.blockRange(u),g=p&&a.liftTarget(p);return null!=g&&(o&&o(r.tr.lift(p,g).scrollIntoView()),!0)},o.liftEmptyBlock=C,o.macBaseKeymap=L,o.newlineInCode=E,o.pcBaseKeymap=I,o.selectAll=T,o.selectNodeBackward=v,o.selectNodeForward=k,o.selectParentNode=function selectParentNode(r,o){var i,a=r.selection,c=a.$from,p=a.to,g=c.sharedDepth(p);return 0!=g&&(i=c.before(g),o&&o(r.tr.setSelection(u.NodeSelection.create(r.doc,i))),!0)},o.selectTextblockEnd=A,o.selectTextblockStart=P,o.setBlockType=function setBlockType(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(i,a){for(var c=!1,u=0;u<i.selection.ranges.length&&!c;u++){var p=i.selection.ranges[u],g=p.$from.pos,v=p.$to.pos;i.doc.nodesBetween(g,v,function(a,u){if(c)return!1;if(a.isTextblock&&!a.hasMarkup(r,o))if(a.type==r)c=!0;else{var p=i.doc.resolve(u),g=p.index();c=p.parent.canReplaceWith(g,g+1,r)}})}if(!c)return!1;if(a){for(var b=i.tr,k=0;k<i.selection.ranges.length;k++){var E=i.selection.ranges[k],w=E.$from.pos,x=E.$to.pos;b.setBlockType(w,x,r,o)}a(b.scrollIntoView())}return!0}},o.splitBlock=_,o.splitBlockAs=splitBlockAs,o.splitBlockKeepMarks=function splitBlockKeepMarks(r,o){return _(r,o&&function(i){var a=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();a&&i.ensureMarks(a),o(i)})},o.toggleMark=function toggleMark(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,a=!1!==(i&&i.removeWhenPresent),c=!1!==(i&&i.enterInlineAtoms),p=!(i&&i.includeWhitespace);return function(i,g){var v=i.selection,b=v.empty,k=v.$cursor,E=v.ranges;if(b&&!k||!function markApplies(r,o,i,a){for(var c,u=function _loop(){var c=o[p],u=c.$from,g=c.$to,v=0==u.depth&&r.inlineContent&&r.type.allowsMarkType(i);if(r.nodesBetween(u.pos,g.pos,function(r,o){if(v||!a&&r.isAtom&&r.isInline&&o>=u.pos&&o+r.nodeSize<=g.pos)return!1;v=r.inlineContent&&r.type.allowsMarkType(i)}),v)return{v:!0}},p=0;p<o.length;p++)if(c=u())return c.v;return!1}(i.doc,E,r,c))return!1;if(g)if(k)r.isInSet(i.storedMarks||k.marks())?g(i.tr.removeStoredMark(r)):g(i.tr.addStoredMark(r.create(o)));else{var w,x=i.tr;c||(E=function removeInlineAtoms(r){for(var o=[],i=function _loop2(){var i=r[a],c=i.$from,p=i.$to;c.doc.nodesBetween(c.pos,p.pos,function(r,i){if(r.isAtom&&r.content.size&&r.isInline&&i>=c.pos&&i+r.nodeSize<=p.pos)return i+1>c.pos&&o.push(new u.SelectionRange(c,c.doc.resolve(i+1))),c=c.doc.resolve(i+1+r.content.size),!1}),c.pos<p.pos&&o.push(new u.SelectionRange(c,p))},a=0;a<r.length;a++)i();return o}(E)),w=a?!E.some(function(o){return i.doc.rangeHasMark(o.$from.pos,o.$to.pos,r)}):!E.every(function(o){var i=!1;return x.doc.nodesBetween(o.$from.pos,o.$to.pos,function(a,c,u){if(i)return!1;i=!r.isInSet(a.marks)&&!!u&&u.type.allowsMarkType(r)&&!(a.isText&&/^\s*$/.test(a.textBetween(Math.max(0,o.$from.pos-c),Math.min(a.nodeSize,o.$to.pos-c))))}),!i});for(var C=0;C<E.length;C++){var _=E[C],T=_.$from,P=_.$to;if(w){var A=T.pos,N=P.pos,R=T.nodeAfter,I=P.nodeBefore,L=p&&R&&R.isText?/^\s*/.exec(R.text)[0].length:0,z=p&&I&&I.isText?/\s*$/.exec(I.text)[0].length:0;A+L<N&&(A+=L,N-=z),x.addMark(A,N,r.create(o))}else x.removeMark(T.pos,P.pos,r)}g(x.scrollIntoView())}return!0}},o.wrapIn=function wrapIn(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(i,c){var u=i.selection,p=u.$from,g=u.$to,v=p.blockRange(g),b=v&&a.findWrapping(v,r,o);return!!b&&(c&&c(i.tr.wrap(v,b).scrollIntoView()),!0)}}},58493:function(r,o,i){"use strict";var a=i(97557);var c="function"==typeof Object.is?Object.is:function is(r,o){return r===o&&(0!==r||1/r==1/o)||r!=r&&o!=o},u=a.useState,p=a.useEffect,g=a.useLayoutEffect,v=a.useDebugValue;function checkIfSnapshotChanged(r){var o=r.getSnapshot;r=r.value;try{var i=o();return!c(r,i)}catch(r){return!0}}var b="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function useSyncExternalStore$1(r,o){return o()}:function useSyncExternalStore$2(r,o){var i=o(),a=u({inst:{value:i,getSnapshot:o}}),c=a[0].inst,b=a[1];return g(function(){c.value=i,c.getSnapshot=o,checkIfSnapshotChanged(c)&&b({inst:c})},[r,i,o]),p(function(){return checkIfSnapshotChanged(c)&&b({inst:c}),r(function(){checkIfSnapshotChanged(c)&&b({inst:c})})},[r]),v(i),i};o.useSyncExternalStore=void 0!==a.useSyncExternalStore?a.useSyncExternalStore:b},59618:function(r){"use strict";r.exports=window.elementorV2.schema},62430:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Document:()=>b,default:()=>k}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248).Node.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(r,o)=>r.content?o.renderChildren(r.content,"\n\n"):""}),k=b},63717:function(r){"use strict";function OrderedMap(r){this.content=r}OrderedMap.prototype={constructor:OrderedMap,find:function(r){for(var o=0;o<this.content.length;o+=2)if(this.content[o]===r)return o;return-1},get:function(r){var o=this.find(r);return-1==o?void 0:this.content[o+1]},update:function(r,o,i){var a=i&&i!=r?this.remove(i):this,c=a.find(r),u=a.content.slice();return-1==c?u.push(i||r,o):(u[c+1]=o,i&&(u[c]=i)),new OrderedMap(u)},remove:function(r){var o=this.find(r);if(-1==o)return this;var i=this.content.slice();return i.splice(o,2),new OrderedMap(i)},addToStart:function(r,o){return new OrderedMap([r,o].concat(this.remove(r).content))},addToEnd:function(r,o){var i=this.remove(r).content.slice();return i.push(r,o),new OrderedMap(i)},addBefore:function(r,o,i){var a=this.remove(o),c=a.content.slice(),u=a.find(r);return c.splice(-1==u?c.length:u,0,o,i),new OrderedMap(c)},forEach:function(r){for(var o=0;o<this.content.length;o+=2)r(this.content[o],this.content[o+1])},prepend:function(r){return(r=OrderedMap.from(r)).size?new OrderedMap(r.content.concat(this.subtract(r).content)):this},append:function(r){return(r=OrderedMap.from(r)).size?new OrderedMap(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var o=this;r=OrderedMap.from(r);for(var i=0;i<r.content.length;i+=2)o=o.remove(r.content[i]);return o},toObject:function(){var r={};return this.forEach(function(o,i){r[o]=i}),r},get size(){return this.content.length>>1}},OrderedMap.from=function(r){if(r instanceof OrderedMap)return r;var o=[];if(r)for(var i in r)o.push(i,r[i]);return new OrderedMap(o)},r.exports=OrderedMap},69242:function(r,o,i){"use strict";r.exports=i(22162)},70374:function(r){"use strict";r.exports=window.elementorV2.editorUi},70975:function(r){"use strict";r.exports=window.elementorV2.editorElements},74353:function(r){r.exports=function(){"use strict";var r=1e3,o=6e4,i=36e5,a="millisecond",c="second",u="minute",p="hour",g="day",v="week",b="month",k="quarter",E="year",w="date",x="Invalid Date",C=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|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,T={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(r){var o=["th","st","nd","rd"],i=r%100;return"["+r+(o[(i-20)%10]||o[i]||o[0])+"]"}},m=function(r,o,i){var a=String(r);return!a||a.length>=o?r:""+Array(o+1-a.length).join(i)+r},P={s:m,z:function(r){var o=-r.utcOffset(),i=Math.abs(o),a=Math.floor(i/60),c=i%60;return(o<=0?"+":"-")+m(a,2,"0")+":"+m(c,2,"0")},m:function t(r,o){if(r.date()<o.date())return-t(o,r);var i=12*(o.year()-r.year())+(o.month()-r.month()),a=r.clone().add(i,b),c=o-a<0,u=r.clone().add(i+(c?-1:1),b);return+(-(i+(o-a)/(c?a-u:u-a))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:b,y:E,w:v,d:g,D:w,h:p,m:u,s:c,ms:a,Q:k}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return void 0===r}},A="en",N={};N[A]=T;var R="$isDayjsObject",S=function(r){return r instanceof z||!(!r||!r[R])},I=function t(r,o,i){var a;if(!r)return A;if("string"==typeof r){var c=r.toLowerCase();N[c]&&(a=c),o&&(N[c]=o,a=c);var u=r.split("-");if(!a&&u.length>1)return t(u[0])}else{var p=r.name;N[p]=r,a=p}return!i&&a&&(A=a),a||!i&&A},O=function(r,o){if(S(r))return r.clone();var i="object"==typeof o?o:{};return i.date=r,i.args=arguments,new z(i)},L=P;L.l=I,L.i=S,L.w=function(r,o){return O(r,{locale:o.$L,utc:o.$u,x:o.$x,$offset:o.$offset})};var z=function(){function M(r){this.$L=I(r.locale,null,!0),this.parse(r),this.$x=this.$x||r.x||{},this[R]=!0}var T=M.prototype;return T.parse=function(r){this.$d=function(r){var o=r.date,i=r.utc;if(null===o)return new Date(NaN);if(L.u(o))return new Date;if(o instanceof Date)return new Date(o);if("string"==typeof o&&!/Z$/i.test(o)){var a=o.match(C);if(a){var c=a[2]-1||0,u=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,u)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,u)}}return new Date(o)}(r),this.init()},T.init=function(){var r=this.$d;this.$y=r.getFullYear(),this.$M=r.getMonth(),this.$D=r.getDate(),this.$W=r.getDay(),this.$H=r.getHours(),this.$m=r.getMinutes(),this.$s=r.getSeconds(),this.$ms=r.getMilliseconds()},T.$utils=function(){return L},T.isValid=function(){return!(this.$d.toString()===x)},T.isSame=function(r,o){var i=O(r);return this.startOf(o)<=i&&i<=this.endOf(o)},T.isAfter=function(r,o){return O(r)<this.startOf(o)},T.isBefore=function(r,o){return this.endOf(o)<O(r)},T.$g=function(r,o,i){return L.u(r)?this[o]:this.set(i,r)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(r,o){var i=this,a=!!L.u(o)||o,k=L.p(r),l=function(r,o){var c=L.w(i.$u?Date.UTC(i.$y,o,r):new Date(i.$y,o,r),i);return a?c:c.endOf(g)},$=function(r,o){return L.w(i.toDate()[r].apply(i.toDate("s"),(a?[0,0,0,0]:[23,59,59,999]).slice(o)),i)},x=this.$W,C=this.$M,_=this.$D,T="set"+(this.$u?"UTC":"");switch(k){case E:return a?l(1,0):l(31,11);case b:return a?l(1,C):l(0,C+1);case v:var P=this.$locale().weekStart||0,A=(x<P?x+7:x)-P;return l(a?_-A:_+(6-A),C);case g:case w:return $(T+"Hours",0);case p:return $(T+"Minutes",1);case u:return $(T+"Seconds",2);case c:return $(T+"Milliseconds",3);default:return this.clone()}},T.endOf=function(r){return this.startOf(r,!1)},T.$set=function(r,o){var i,v=L.p(r),k="set"+(this.$u?"UTC":""),x=(i={},i[g]=k+"Date",i[w]=k+"Date",i[b]=k+"Month",i[E]=k+"FullYear",i[p]=k+"Hours",i[u]=k+"Minutes",i[c]=k+"Seconds",i[a]=k+"Milliseconds",i)[v],C=v===g?this.$D+(o-this.$W):o;if(v===b||v===E){var _=this.clone().set(w,1);_.$d[x](C),_.init(),this.$d=_.set(w,Math.min(this.$D,_.daysInMonth())).$d}else x&&this.$d[x](C);return this.init(),this},T.set=function(r,o){return this.clone().$set(r,o)},T.get=function(r){return this[L.p(r)]()},T.add=function(a,k){var w,x=this;a=Number(a);var C=L.p(k),y=function(r){var o=O(x);return L.w(o.date(o.date()+Math.round(r*a)),x)};if(C===b)return this.set(b,this.$M+a);if(C===E)return this.set(E,this.$y+a);if(C===g)return y(1);if(C===v)return y(7);var _=(w={},w[u]=o,w[p]=i,w[c]=r,w)[C]||1,T=this.$d.getTime()+a*_;return L.w(T,this)},T.subtract=function(r,o){return this.add(-1*r,o)},T.format=function(r){var o=this,i=this.$locale();if(!this.isValid())return i.invalidDate||x;var a=r||"YYYY-MM-DDTHH:mm:ssZ",c=L.z(this),u=this.$H,p=this.$m,g=this.$M,v=i.weekdays,b=i.months,k=i.meridiem,h=function(r,i,c,u){return r&&(r[i]||r(o,a))||c[i].slice(0,u)},d=function(r){return L.s(u%12||12,r,"0")},E=k||function(r,o,i){var a=r<12?"AM":"PM";return i?a.toLowerCase():a};return a.replace(_,function(r,a){return a||function(r){switch(r){case"YY":return String(o.$y).slice(-2);case"YYYY":return L.s(o.$y,4,"0");case"M":return g+1;case"MM":return L.s(g+1,2,"0");case"MMM":return h(i.monthsShort,g,b,3);case"MMMM":return h(b,g);case"D":return o.$D;case"DD":return L.s(o.$D,2,"0");case"d":return String(o.$W);case"dd":return h(i.weekdaysMin,o.$W,v,2);case"ddd":return h(i.weekdaysShort,o.$W,v,3);case"dddd":return v[o.$W];case"H":return String(u);case"HH":return L.s(u,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return E(u,p,!0);case"A":return E(u,p,!1);case"m":return String(p);case"mm":return L.s(p,2,"0");case"s":return String(o.$s);case"ss":return L.s(o.$s,2,"0");case"SSS":return L.s(o.$ms,3,"0");case"Z":return c}return null}(r)||c.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(a,w,x){var C,_=this,T=L.p(w),P=O(a),A=(P.utcOffset()-this.utcOffset())*o,N=this-P,D=function(){return L.m(_,P)};switch(T){case E:C=D()/12;break;case b:C=D();break;case k:C=D()/3;break;case v:C=(N-A)/6048e5;break;case g:C=(N-A)/864e5;break;case p:C=N/i;break;case u:C=N/o;break;case c:C=N/r;break;default:C=N}return x?C:L.a(C)},T.daysInMonth=function(){return this.endOf(b).$D},T.$locale=function(){return N[this.$L]},T.locale=function(r,o){if(!r)return this.$L;var i=this.clone(),a=I(r,o,!0);return a&&(i.$L=a),i},T.clone=function(){return L.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},M}(),j=z.prototype;return O.prototype=j,[["$ms",a],["$s",c],["$m",u],["$H",p],["$W",g],["$M",b],["$y",E],["$D",w]].forEach(function(r){j[r[1]]=function(o){return this.$g(o,r[0],r[1])}}),O.extend=function(r,o){return r.$i||(r(o,z,O),r.$i=!0),O},O.locale=I,O.isDayjs=S,O.unix=function(r){return O(1e3*r)},O.en=N[A],O.Ls=N,O.p={},O}()},74518:function(r){"use strict";r.exports=window.elementorV2.editorResponsive},74848:function(r,o,i){"use strict";r.exports=i(21020)},74951:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Heading:()=>k,default:()=>E}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=b.Node.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(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:o}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,(0,b.mergeAttributes)(this.options.HTMLAttributes,o),0]},parseMarkdown:(r,o)=>o.createNode("heading",{level:r.depth||1},o.parseInline(r.tokens||[])),renderMarkdown:(r,o)=>{var i;const a=(null==(i=r.attrs)?void 0:i.level)?parseInt(r.attrs.level,10):1,c="#".repeat(a);return r.content?`${c} ${o.renderChildren(r.content)}`:""},addCommands(){return{setHeading:r=>({commands:o})=>!!this.options.levels.includes(r.level)&&o.setNode(this.name,r),toggleHeading:r=>({commands:o})=>!!this.options.levels.includes(r.level)&&o.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return this.options.levels.reduce((r,o)=>({...r,[`Mod-Alt-${o}`]:()=>this.editor.commands.toggleHeading({level:o})}),{})},addInputRules(){return this.options.levels.map(r=>(0,b.textblockTypeInputRule)({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}}),E=k},76237:function(r,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});for(var i={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:"'"},a={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},c="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),u="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),p=0;p<10;p++)i[48+p]=i[96+p]=String(p);for(p=1;p<=24;p++)i[p+111]="F"+p;for(p=65;p<=90;p++)i[p]=String.fromCharCode(p+32),a[p]=String.fromCharCode(p);for(var g in i)a.hasOwnProperty(g)||(a[g]=i[g]);o.base=i,o.keyName=function keyName(r){var o=!(c&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||u&&r.shiftKey&&r.key&&1==r.key.length||"Unidentified"==r.key)&&r.key||(r.shiftKey?a:i)[r.keyCode]||r.key||"Unidentified";return"Esc"==o&&(o="Escape"),"Del"==o&&(o="Delete"),"Left"==o&&(o="ArrowLeft"),"Up"==o&&(o="ArrowUp"),"Right"==o&&(o="ArrowRight"),"Down"==o&&(o="ArrowDown"),o},o.shift=a},77048:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(88136))},77712:function(r,o,i){"use strict";function _createForOfIteratorHelper(r,o){var i="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=function _unsupportedIterableToArray(r,o){if(!r)return;if("string"==typeof r)return _arrayLikeToArray(r,o);var i=Object.prototype.toString.call(r).slice(8,-1);"Object"===i&&r.constructor&&(i=r.constructor.name);if("Map"===i||"Set"===i)return Array.from(r);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(r,o)}(r))||o&&r&&"number"==typeof r.length){i&&(r=i);var a=0,c=function F(){};return{s:c,n:function n(){return a>=r.length?{done:!0}:{done:!1,value:r[a++]}},e:function e(r){throw r},f:c}}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 u,p=!0,g=!1;return{s:function s(){i=i.call(r)},n:function n(){var r=i.next();return p=r.done,r},e:function e(r){g=!0,u=r},f:function f(){try{p||null==i.return||i.return()}finally{if(g)throw u}}}}function _arrayLikeToArray(r,o){(null==o||o>r.length)&&(o=r.length);for(var i=0,a=new Array(o);i<o;i++)a[i]=r[i];return a}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(r,o,i){var a=function _superPropBase(r,o){for(;!Object.prototype.hasOwnProperty.call(r,o)&&null!==(r=_getPrototypeOf(r)););return r}(r,o);if(a){var c=Object.getOwnPropertyDescriptor(a,o);return c.get?c.get.call(arguments.length<3?r:i):c.value}},_get.apply(this,arguments)}function _inherits(r,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(o&&o.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),o&&_setPrototypeOf(r,o)}function _createSuper(r){var o=_isNativeReflectConstruct();return function _createSuperInternal(){var i,a=_getPrototypeOf(r);if(o){var c=_getPrototypeOf(this).constructor;i=Reflect.construct(a,arguments,c)}else i=a.apply(this,arguments);return function _possibleConstructorReturn(r,o){if(o&&("object"===_typeof(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,i)}}function _wrapNativeSuper(r){var o="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(r){if(null===r||!function _isNativeFunction(r){try{return-1!==Function.toString.call(r).indexOf("[native code]")}catch(o){return"function"==typeof r}}(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(r))return o.get(r);o.set(r,Wrapper)}function Wrapper(){return _construct(r,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(r.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,r)},_wrapNativeSuper(r)}function _construct(r,o,i){return _construct=_isNativeReflectConstruct()?Reflect.construct.bind():function _construct(r,o,i){var a=[null];a.push.apply(a,o);var c=new(Function.bind.apply(r,a));return i&&_setPrototypeOf(c,i.prototype),c},_construct.apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function _setPrototypeOf(r,o){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(r,o){return r.__proto__=o,r},_setPrototypeOf(r,o)}function _getPrototypeOf(r){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf(r)}function _typeof(r){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_typeof(r)}function _classCallCheck(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(r,o){for(var i=0;i<o.length;i++){var a=o[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,_toPropertyKey(a.key),a)}}function _createClass(r,o,i){return o&&_defineProperties(r.prototype,o),i&&_defineProperties(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function _toPropertyKey(r){var o=function _toPrimitive(r,o){if("object"!==_typeof(r)||null===r)return r;var i=r[Symbol.toPrimitive];if(void 0!==i){var a=i.call(r,o||"default");if("object"!==_typeof(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(r)}(r,"string");return"symbol"===_typeof(o)?o:String(o)}var a=i(63717);function _findDiffStart(r,o,i){for(var a=0;;a++){if(a==r.childCount||a==o.childCount)return r.childCount==o.childCount?null:i;var c=r.child(a),u=o.child(a);if(c!=u){if(!c.sameMarkup(u))return i;if(c.isText&&c.text!=u.text){for(var p=0;c.text[p]==u.text[p];p++)i++;return i}if(c.content.size||u.content.size){var g=_findDiffStart(c.content,u.content,i+1);if(null!=g)return g}i+=c.nodeSize}else i+=c.nodeSize}}function _findDiffEnd(r,o,i,a){for(var c=r.childCount,u=o.childCount;;){if(0==c||0==u)return c==u?null:{a:i,b:a};var p=r.child(--c),g=o.child(--u),v=p.nodeSize;if(p!=g){if(!p.sameMarkup(g))return{a:i,b:a};if(p.isText&&p.text!=g.text){for(var b=0,k=Math.min(p.text.length,g.text.length);b<k&&p.text[p.text.length-b-1]==g.text[g.text.length-b-1];)b++,i--,a--;return{a:i,b:a}}if(p.content.size||g.content.size){var E=_findDiffEnd(p.content,g.content,i-1,a-1);if(E)return E}i-=v,a-=v}else i-=v,a-=v}}var c=function(){function Fragment(r,o){if(_classCallCheck(this,Fragment),this.content=r,this.size=o||0,null==o)for(var i=0;i<r.length;i++)this.size+=r[i].nodeSize}return _createClass(Fragment,[{key:"nodesBetween",value:function nodesBetween(r,o,i){for(var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=arguments.length>4?arguments[4]:void 0,u=0,p=0;p<o;u++){var g=this.content[u],v=p+g.nodeSize;if(v>r&&!1!==i(g,a+p,c||null,u)&&g.content.size){var b=p+1;g.nodesBetween(Math.max(0,r-b),Math.min(g.content.size,o-b),i,a+b)}p=v}}},{key:"descendants",value:function descendants(r){this.nodesBetween(0,this.size,r)}},{key:"textBetween",value:function textBetween(r,o,i,a){var c="",u=!0;return this.nodesBetween(r,o,function(p,g){var v=p.isText?p.text.slice(Math.max(r,g)-g,o-g):p.isLeaf?a?"function"==typeof a?a(p):a:p.type.spec.leafText?p.type.spec.leafText(p):"":"";p.isBlock&&(p.isLeaf&&v||p.isTextblock)&&i&&(u?u=!1:c+=i),c+=v},0),c}},{key:"append",value:function append(r){if(!r.size)return this;if(!this.size)return r;var o=this.lastChild,i=r.firstChild,a=this.content.slice(),c=0;for(o.isText&&o.sameMarkup(i)&&(a[a.length-1]=o.withText(o.text+i.text),c=1);c<r.content.length;c++)a.push(r.content[c]);return new Fragment(a,this.size+r.size)}},{key:"cut",value:function cut(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==r&&o==this.size)return this;var i=[],a=0;if(o>r)for(var c=0,u=0;u<o;c++){var p=this.content[c],g=u+p.nodeSize;g>r&&((u<r||g>o)&&(p=p.isText?p.cut(Math.max(0,r-u),Math.min(p.text.length,o-u)):p.cut(Math.max(0,r-u-1),Math.min(p.content.size,o-u-1))),i.push(p),a+=p.nodeSize),u=g}return new Fragment(i,a)}},{key:"cutByIndex",value:function cutByIndex(r,o){return r==o?Fragment.empty:0==r&&o==this.content.length?this:new Fragment(this.content.slice(r,o))}},{key:"replaceChild",value:function replaceChild(r,o){var i=this.content[r];if(i==o)return this;var a=this.content.slice(),c=this.size+o.nodeSize-i.nodeSize;return a[r]=o,new Fragment(a,c)}},{key:"addToStart",value:function addToStart(r){return new Fragment([r].concat(this.content),this.size+r.nodeSize)}},{key:"addToEnd",value:function addToEnd(r){return new Fragment(this.content.concat(r),this.size+r.nodeSize)}},{key:"eq",value:function eq(r){if(this.content.length!=r.content.length)return!1;for(var o=0;o<this.content.length;o++)if(!this.content[o].eq(r.content[o]))return!1;return!0}},{key:"firstChild",get:function get(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function get(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function get(){return this.content.length}},{key:"child",value:function child(r){var o=this.content[r];if(!o)throw new RangeError("Index "+r+" out of range for "+this);return o}},{key:"maybeChild",value:function maybeChild(r){return this.content[r]||null}},{key:"forEach",value:function forEach(r){for(var o=0,i=0;o<this.content.length;o++){var a=this.content[o];r(a,i,o),i+=a.nodeSize}}},{key:"findDiffStart",value:function findDiffStart(r){return _findDiffStart(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}},{key:"findDiffEnd",value:function findDiffEnd(r){return _findDiffEnd(this,r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.size)}},{key:"findIndex",value:function findIndex(r){if(0==r)return retIndex(0,r);if(r==this.size)return retIndex(this.content.length,r);if(r>this.size||r<0)throw new RangeError("Position ".concat(r," outside of fragment (").concat(this,")"));for(var o=0,i=0;;o++){var a=i+this.child(o).nodeSize;if(a>=r)return a==r?retIndex(o+1,a):retIndex(o,i);i=a}}},{key:"toString",value:function toString(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function toStringInner(){return this.content.join(", ")}},{key:"toJSON",value:function toJSON(){return this.content.length?this.content.map(function(r){return r.toJSON()}):null}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o)return Fragment.empty;if(!Array.isArray(o))throw new RangeError("Invalid input for Fragment.fromJSON");return new Fragment(o.map(r.nodeFromJSON))}},{key:"fromArray",value:function fromArray(r){if(!r.length)return Fragment.empty;for(var o,i=0,a=0;a<r.length;a++){var c=r[a];i+=c.nodeSize,a&&c.isText&&r[a-1].sameMarkup(c)?(o||(o=r.slice(0,a)),o[o.length-1]=c.withText(o[o.length-1].text+c.text)):o&&o.push(c)}return new Fragment(o||r,i)}},{key:"from",value:function from(r){if(!r)return Fragment.empty;if(r instanceof Fragment)return r;if(Array.isArray(r))return this.fromArray(r);if(r.attrs)return new Fragment([r],r.nodeSize);throw new RangeError("Can not convert "+r+" to a Fragment"+(r.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),Fragment}();c.empty=new c([],0);var u={index:0,offset:0};function retIndex(r,o){return u.index=r,u.offset=o,u}function compareDeep(r,o){if(r===o)return!0;if(!r||"object"!=_typeof(r)||!o||"object"!=_typeof(o))return!1;var i=Array.isArray(r);if(Array.isArray(o)!=i)return!1;if(i){if(r.length!=o.length)return!1;for(var a=0;a<r.length;a++)if(!compareDeep(r[a],o[a]))return!1}else{for(var c in r)if(!(c in o)||!compareDeep(r[c],o[c]))return!1;for(var u in o)if(!(u in r))return!1}return!0}var p=function(){function Mark(r,o){_classCallCheck(this,Mark),this.type=r,this.attrs=o}return _createClass(Mark,[{key:"addToSet",value:function addToSet(r){for(var o,i=!1,a=0;a<r.length;a++){var c=r[a];if(this.eq(c))return r;if(this.type.excludes(c.type))o||(o=r.slice(0,a));else{if(c.type.excludes(this.type))return r;!i&&c.type.rank>this.type.rank&&(o||(o=r.slice(0,a)),o.push(this),i=!0),o&&o.push(c)}}return o||(o=r.slice()),i||o.push(this),o}},{key:"removeFromSet",value:function removeFromSet(r){for(var o=0;o<r.length;o++)if(this.eq(r[o]))return r.slice(0,o).concat(r.slice(o+1));return r}},{key:"isInSet",value:function isInSet(r){for(var o=0;o<r.length;o++)if(this.eq(r[o]))return!0;return!1}},{key:"eq",value:function eq(r){return this==r||this.type==r.type&&compareDeep(this.attrs,r.attrs)}},{key:"toJSON",value:function toJSON(){var r={type:this.type.name};for(var o in this.attrs){r.attrs=this.attrs;break}return r}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o)throw new RangeError("Invalid input for Mark.fromJSON");var i=r.marks[o.type];if(!i)throw new RangeError("There is no mark type ".concat(o.type," in this schema"));var a=i.create(o.attrs);return i.checkAttrs(a.attrs),a}},{key:"sameSet",value:function sameSet(r,o){if(r==o)return!0;if(r.length!=o.length)return!1;for(var i=0;i<r.length;i++)if(!r[i].eq(o[i]))return!1;return!0}},{key:"setFrom",value:function setFrom(r){if(!r||Array.isArray(r)&&0==r.length)return Mark.none;if(r instanceof Mark)return[r];var o=r.slice();return o.sort(function(r,o){return r.type.rank-o.type.rank}),o}}]),Mark}();p.none=[];var g=function(r){_inherits(ReplaceError,r);var o=_createSuper(ReplaceError);function ReplaceError(){return _classCallCheck(this,ReplaceError),o.apply(this,arguments)}return _createClass(ReplaceError)}(_wrapNativeSuper(Error)),v=function(){function Slice(r,o,i){_classCallCheck(this,Slice),this.content=r,this.openStart=o,this.openEnd=i}return _createClass(Slice,[{key:"size",get:function get(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function insertAt(r,o){var i=insertInto(this.content,r+this.openStart,o);return i&&new Slice(i,this.openStart,this.openEnd)}},{key:"removeBetween",value:function removeBetween(r,o){return new Slice(removeRange(this.content,r+this.openStart,o+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function eq(r){return this.content.eq(r.content)&&this.openStart==r.openStart&&this.openEnd==r.openEnd}},{key:"toString",value:function toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function toJSON(){if(!this.content.size)return null;var r={content:this.content.toJSON()};return this.openStart>0&&(r.openStart=this.openStart),this.openEnd>0&&(r.openEnd=this.openEnd),r}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o)return Slice.empty;var i=o.openStart||0,a=o.openEnd||0;if("number"!=typeof i||"number"!=typeof a)throw new RangeError("Invalid input for Slice.fromJSON");return new Slice(c.fromJSON(r,o.content),i,a)}},{key:"maxOpen",value:function maxOpen(r){for(var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=0,a=0,c=r.firstChild;c&&!c.isLeaf&&(o||!c.type.spec.isolating);c=c.firstChild)i++;for(var u=r.lastChild;u&&!u.isLeaf&&(o||!u.type.spec.isolating);u=u.lastChild)a++;return new Slice(r,i,a)}}]),Slice}();function removeRange(r,o,i){var a=r.findIndex(o),c=a.index,u=a.offset,p=r.maybeChild(c),g=r.findIndex(i),v=g.index,b=g.offset;if(u==o||p.isText){if(b!=i&&!r.child(v).isText)throw new RangeError("Removing non-flat range");return r.cut(0,o).append(r.cut(i))}if(c!=v)throw new RangeError("Removing non-flat range");return r.replaceChild(c,p.copy(removeRange(p.content,o-u-1,i-u-1)))}function insertInto(r,o,i,a){var c=r.findIndex(o),u=c.index,p=c.offset,g=r.maybeChild(u);if(p==o||g.isText)return a&&!a.canReplace(u,u,i)?null:r.cut(0,o).append(i).append(r.cut(o));var v=insertInto(g.content,o-p-1,i,g);return v&&r.replaceChild(u,g.copy(v))}function _replace(r,o,i){if(i.openStart>r.depth)throw new g("Inserted content deeper than insertion position");if(r.depth-i.openStart!=o.depth-i.openEnd)throw new g("Inconsistent open depths");return replaceOuter(r,o,i,0)}function replaceOuter(r,o,i,a){var u=r.index(a),p=r.node(a);if(u==o.index(a)&&a<r.depth-i.openStart){var g=replaceOuter(r,o,i,a+1);return p.copy(p.content.replaceChild(u,g))}if(i.content.size){if(i.openStart||i.openEnd||r.depth!=a||o.depth!=a){var v=function prepareSliceForReplace(r,o){for(var i=o.depth-r.openStart,a=o.node(i).copy(r.content),u=i-1;u>=0;u--)a=o.node(u).copy(c.from(a));return{start:a.resolveNoCache(r.openStart+i),end:a.resolveNoCache(a.content.size-r.openEnd-i)}}(i,r);return close(p,replaceThreeWay(r,v.start,v.end,o,a))}var b=r.parent,k=b.content;return close(b,k.cut(0,r.parentOffset).append(i.content).append(k.cut(o.parentOffset)))}return close(p,replaceTwoWay(r,o,a))}function checkJoin(r,o){if(!o.type.compatibleContent(r.type))throw new g("Cannot join "+o.type.name+" onto "+r.type.name)}function joinable(r,o,i){var a=r.node(i);return checkJoin(a,o.node(i)),a}function addNode(r,o){var i=o.length-1;i>=0&&r.isText&&r.sameMarkup(o[i])?o[i]=r.withText(o[i].text+r.text):o.push(r)}function addRange(r,o,i,a){var c=(o||r).node(i),u=0,p=o?o.index(i):c.childCount;r&&(u=r.index(i),r.depth>i?u++:r.textOffset&&(addNode(r.nodeAfter,a),u++));for(var g=u;g<p;g++)addNode(c.child(g),a);o&&o.depth==i&&o.textOffset&&addNode(o.nodeBefore,a)}function close(r,o){return r.type.checkContent(o),r.copy(o)}function replaceThreeWay(r,o,i,a,u){var p=r.depth>u&&joinable(r,o,u+1),g=a.depth>u&&joinable(i,a,u+1),v=[];return addRange(null,r,u,v),p&&g&&o.index(u)==i.index(u)?(checkJoin(p,g),addNode(close(p,replaceThreeWay(r,o,i,a,u+1)),v)):(p&&addNode(close(p,replaceTwoWay(r,o,u+1)),v),addRange(o,i,u,v),g&&addNode(close(g,replaceTwoWay(i,a,u+1)),v)),addRange(a,null,u,v),new c(v)}function replaceTwoWay(r,o,i){var a=[];(addRange(null,r,i,a),r.depth>i)&&addNode(close(joinable(r,o,i+1),replaceTwoWay(r,o,i+1)),a);return addRange(o,null,i,a),new c(a)}v.empty=new v(c.empty,0,0);var b=function(){function ResolvedPos(r,o,i){_classCallCheck(this,ResolvedPos),this.pos=r,this.path=o,this.parentOffset=i,this.depth=o.length/3-1}return _createClass(ResolvedPos,[{key:"resolveDepth",value:function resolveDepth(r){return null==r?this.depth:r<0?this.depth+r:r}},{key:"parent",get:function get(){return this.node(this.depth)}},{key:"doc",get:function get(){return this.node(0)}},{key:"node",value:function node(r){return this.path[3*this.resolveDepth(r)]}},{key:"index",value:function index(r){return this.path[3*this.resolveDepth(r)+1]}},{key:"indexAfter",value:function indexAfter(r){return r=this.resolveDepth(r),this.index(r)+(r!=this.depth||this.textOffset?1:0)}},{key:"start",value:function start(r){return 0==(r=this.resolveDepth(r))?0:this.path[3*r-1]+1}},{key:"end",value:function end(r){return r=this.resolveDepth(r),this.start(r)+this.node(r).content.size}},{key:"before",value:function before(r){if(!(r=this.resolveDepth(r)))throw new RangeError("There is no position before the top-level node");return r==this.depth+1?this.pos:this.path[3*r-1]}},{key:"after",value:function after(r){if(!(r=this.resolveDepth(r)))throw new RangeError("There is no position after the top-level node");return r==this.depth+1?this.pos:this.path[3*r-1]+this.path[3*r].nodeSize}},{key:"textOffset",get:function get(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function get(){var r=this.parent,o=this.index(this.depth);if(o==r.childCount)return null;var i=this.pos-this.path[this.path.length-1],a=r.child(o);return i?r.child(o).cut(i):a}},{key:"nodeBefore",get:function get(){var r=this.index(this.depth),o=this.pos-this.path[this.path.length-1];return o?this.parent.child(r).cut(0,o):0==r?null:this.parent.child(r-1)}},{key:"posAtIndex",value:function posAtIndex(r,o){o=this.resolveDepth(o);for(var i=this.path[3*o],a=0==o?0:this.path[3*o-1]+1,c=0;c<r;c++)a+=i.child(c).nodeSize;return a}},{key:"marks",value:function marks(){var r=this.parent,o=this.index();if(0==r.content.size)return p.none;if(this.textOffset)return r.child(o).marks;var i=r.maybeChild(o-1),a=r.maybeChild(o);if(!i){var c=i;i=a,a=c}for(var marks=i.marks,u=0;u<marks.length;u++)!1!==marks[u].type.spec.inclusive||a&&marks[u].isInSet(a.marks)||(marks=marks[u--].removeFromSet(marks));return marks}},{key:"marksAcross",value:function marksAcross(r){var o=this.parent.maybeChild(this.index());if(!o||!o.isInline)return null;for(var i=o.marks,a=r.parent.maybeChild(r.index()),c=0;c<i.length;c++)!1!==i[c].type.spec.inclusive||a&&i[c].isInSet(a.marks)||(i=i[c--].removeFromSet(i));return i}},{key:"sharedDepth",value:function sharedDepth(r){for(var o=this.depth;o>0;o--)if(this.start(o)<=r&&this.end(o)>=r)return o;return 0}},{key:"blockRange",value:function blockRange(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,o=arguments.length>1?arguments[1]:void 0;if(r.pos<this.pos)return r.blockRange(this);for(var i=this.depth-(this.parent.inlineContent||this.pos==r.pos?1:0);i>=0;i--)if(r.pos<=this.end(i)&&(!o||o(this.node(i))))return new x(this,r,i);return null}},{key:"sameParent",value:function sameParent(r){return this.pos-this.parentOffset==r.pos-r.parentOffset}},{key:"max",value:function max(r){return r.pos>this.pos?r:this}},{key:"min",value:function min(r){return r.pos<this.pos?r:this}},{key:"toString",value:function toString(){for(var r="",o=1;o<=this.depth;o++)r+=(r?"/":"")+this.node(o).type.name+"_"+this.index(o-1);return r+":"+this.parentOffset}}],[{key:"resolve",value:function resolve(r,o){if(!(o>=0&&o<=r.content.size))throw new RangeError("Position "+o+" out of range");for(var i=[],a=0,c=o,u=r;;){var p=u.content.findIndex(c),g=p.index,v=p.offset,b=c-v;if(i.push(u,g,a+v),!b)break;if((u=u.child(g)).isText)break;c=b-1,a+=v+1}return new ResolvedPos(o,i,c)}},{key:"resolveCached",value:function resolveCached(r,o){var i=w.get(r);if(i)for(var a=0;a<i.elts.length;a++){var c=i.elts[a];if(c.pos==o)return c}else w.set(r,i=new k);var u=i.elts[i.i]=ResolvedPos.resolve(r,o);return i.i=(i.i+1)%E,u}}]),ResolvedPos}(),k=_createClass(function ResolveCache(){_classCallCheck(this,ResolveCache),this.elts=[],this.i=0}),E=12,w=new WeakMap,x=function(){function NodeRange(r,o,i){_classCallCheck(this,NodeRange),this.$from=r,this.$to=o,this.depth=i}return _createClass(NodeRange,[{key:"start",get:function get(){return this.$from.before(this.depth+1)}},{key:"end",get:function get(){return this.$to.after(this.depth+1)}},{key:"parent",get:function get(){return this.$from.node(this.depth)}},{key:"startIndex",get:function get(){return this.$from.index(this.depth)}},{key:"endIndex",get:function get(){return this.$to.indexAfter(this.depth)}}]),NodeRange}(),C=Object.create(null),_=function(){function Node(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:p.none;_classCallCheck(this,Node),this.type=r,this.attrs=o,this.marks=a,this.content=i||c.empty}return _createClass(Node,[{key:"children",get:function get(){return this.content.content}},{key:"nodeSize",get:function get(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function get(){return this.content.childCount}},{key:"child",value:function child(r){return this.content.child(r)}},{key:"maybeChild",value:function maybeChild(r){return this.content.maybeChild(r)}},{key:"forEach",value:function forEach(r){this.content.forEach(r)}},{key:"nodesBetween",value:function nodesBetween(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(r,o,i,a,this)}},{key:"descendants",value:function descendants(r){this.nodesBetween(0,this.content.size,r)}},{key:"textContent",get:function get(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function textBetween(r,o,i,a){return this.content.textBetween(r,o,i,a)}},{key:"firstChild",get:function get(){return this.content.firstChild}},{key:"lastChild",get:function get(){return this.content.lastChild}},{key:"eq",value:function eq(r){return this==r||this.sameMarkup(r)&&this.content.eq(r.content)}},{key:"sameMarkup",value:function sameMarkup(r){return this.hasMarkup(r.type,r.attrs,r.marks)}},{key:"hasMarkup",value:function hasMarkup(r,o,i){return this.type==r&&compareDeep(this.attrs,o||r.defaultAttrs||C)&&p.sameSet(this.marks,i||p.none)}},{key:"copy",value:function copy(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return r==this.content?this:new Node(this.type,this.attrs,r,this.marks)}},{key:"mark",value:function mark(r){return r==this.marks?this:new Node(this.type,this.attrs,this.content,r)}},{key:"cut",value:function cut(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==r&&o==this.content.size?this:this.copy(this.content.cut(r,o))}},{key:"slice",value:function slice(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(r==o)return v.empty;var a=this.resolve(r),c=this.resolve(o),u=i?0:a.sharedDepth(o),p=a.start(u),g=a.node(u).content.cut(a.pos-p,c.pos-p);return new v(g,a.depth-u,c.depth-u)}},{key:"replace",value:function replace(r,o,i){return _replace(this.resolve(r),this.resolve(o),i)}},{key:"nodeAt",value:function nodeAt(r){for(var o=this;;){var i=o.content.findIndex(r),a=i.index,c=i.offset;if(!(o=o.maybeChild(a)))return null;if(c==r||o.isText)return o;r-=c+1}}},{key:"childAfter",value:function childAfter(r){var o=this.content.findIndex(r),i=o.index,a=o.offset;return{node:this.content.maybeChild(i),index:i,offset:a}}},{key:"childBefore",value:function childBefore(r){if(0==r)return{node:null,index:0,offset:0};var o=this.content.findIndex(r),i=o.index,a=o.offset;if(a<r)return{node:this.content.child(i),index:i,offset:a};var c=this.content.child(i-1);return{node:c,index:i-1,offset:a-c.nodeSize}}},{key:"resolve",value:function resolve(r){return b.resolveCached(this,r)}},{key:"resolveNoCache",value:function resolveNoCache(r){return b.resolve(this,r)}},{key:"rangeHasMark",value:function rangeHasMark(r,o,i){var a=!1;return o>r&&this.nodesBetween(r,o,function(r){return i.isInSet(r.marks)&&(a=!0),!a}),a}},{key:"isBlock",get:function get(){return this.type.isBlock}},{key:"isTextblock",get:function get(){return this.type.isTextblock}},{key:"inlineContent",get:function get(){return this.type.inlineContent}},{key:"isInline",get:function get(){return this.type.isInline}},{key:"isText",get:function get(){return this.type.isText}},{key:"isLeaf",get:function get(){return this.type.isLeaf}},{key:"isAtom",get:function get(){return this.type.isAtom}},{key:"toString",value:function toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var r=this.type.name;return this.content.size&&(r+="("+this.content.toStringInner()+")"),wrapMarks(this.marks,r)}},{key:"contentMatchAt",value:function contentMatchAt(r){var o=this.type.contentMatch.matchFragment(this.content,0,r);if(!o)throw new Error("Called contentMatchAt on a node with invalid content");return o}},{key:"canReplace",value:function canReplace(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.empty,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.childCount,p=this.contentMatchAt(r).matchFragment(i,a,u),g=p&&p.matchFragment(this.content,o);if(!g||!g.validEnd)return!1;for(var v=a;v<u;v++)if(!this.type.allowsMarks(i.child(v).marks))return!1;return!0}},{key:"canReplaceWith",value:function canReplaceWith(r,o,i,a){if(a&&!this.type.allowsMarks(a))return!1;var c=this.contentMatchAt(r).matchType(i),u=c&&c.matchFragment(this.content,o);return!!u&&u.validEnd}},{key:"canAppend",value:function canAppend(r){return r.content.size?this.canReplace(this.childCount,this.childCount,r.content):this.type.compatibleContent(r.type)}},{key:"check",value:function check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);for(var r=p.none,o=0;o<this.marks.length;o++){var i=this.marks[o];i.type.checkAttrs(i.attrs),r=i.addToSet(r)}if(!p.sameSet(r,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map(function(r){return r.type.name})));this.content.forEach(function(r){return r.check()})}},{key:"toJSON",value:function toJSON(){var r={type:this.type.name};for(var o in this.attrs){r.attrs=this.attrs;break}return this.content.size&&(r.content=this.content.toJSON()),this.marks.length&&(r.marks=this.marks.map(function(r){return r.toJSON()})),r}}],[{key:"fromJSON",value:function fromJSON(r,o){if(!o)throw new RangeError("Invalid input for Node.fromJSON");var i=void 0;if(o.marks){if(!Array.isArray(o.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=o.marks.map(r.markFromJSON)}if("text"==o.type){if("string"!=typeof o.text)throw new RangeError("Invalid text node in JSON");return r.text(o.text,i)}var a=c.fromJSON(r,o.content),u=r.nodeType(o.type).create(o.attrs,a,i);return u.type.checkAttrs(u.attrs),u}}]),Node}();_.prototype.text=void 0;var T=function(r){_inherits(TextNode,r);var o=_createSuper(TextNode);function TextNode(r,i,a,c){var u;if(_classCallCheck(this,TextNode),u=o.call(this,r,i,null,c),!a)throw new RangeError("Empty text nodes are not allowed");return u.text=a,u}return _createClass(TextNode,[{key:"toString",value:function toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wrapMarks(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function get(){return this.text}},{key:"textBetween",value:function textBetween(r,o){return this.text.slice(r,o)}},{key:"nodeSize",get:function get(){return this.text.length}},{key:"mark",value:function mark(r){return r==this.marks?this:new TextNode(this.type,this.attrs,this.text,r)}},{key:"withText",value:function withText(r){return r==this.text?this:new TextNode(this.type,this.attrs,r,this.marks)}},{key:"cut",value:function cut(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==r&&o==this.text.length?this:this.withText(this.text.slice(r,o))}},{key:"eq",value:function eq(r){return this.sameMarkup(r)&&this.text==r.text}},{key:"toJSON",value:function toJSON(){var r=_get(_getPrototypeOf(TextNode.prototype),"toJSON",this).call(this);return r.text=this.text,r}}]),TextNode}(_);function wrapMarks(r,o){for(var i=r.length-1;i>=0;i--)o=r[i].type.name+"("+o+")";return o}var P=function(){function ContentMatch(r){_classCallCheck(this,ContentMatch),this.validEnd=r,this.next=[],this.wrapCache=[]}return _createClass(ContentMatch,[{key:"matchType",value:function matchType(r){for(var o=0;o<this.next.length;o++)if(this.next[o].type==r)return this.next[o].next;return null}},{key:"matchFragment",value:function matchFragment(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.childCount,a=this,c=o;a&&c<i;c++)a=a.matchType(r.child(c).type);return a}},{key:"inlineContent",get:function get(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function get(){for(var r=0;r<this.next.length;r++){var o=this.next[r].type;if(!o.isText&&!o.hasRequiredAttrs())return o}return null}},{key:"compatible",value:function compatible(r){for(var o=0;o<this.next.length;o++)for(var i=0;i<r.next.length;i++)if(this.next[o].type==r.next[i].type)return!0;return!1}},{key:"fillBefore",value:function fillBefore(r){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=[this];return function search(u,p){var g=u.matchFragment(r,i);if(g&&(!o||g.validEnd))return c.from(p.map(function(r){return r.createAndFill()}));for(var v=0;v<u.next.length;v++){var b=u.next[v],k=b.type,E=b.next;if(!k.isText&&!k.hasRequiredAttrs()&&-1==a.indexOf(E)){a.push(E);var w=search(E,p.concat(k));if(w)return w}}return null}(this,[])}},{key:"findWrapping",value:function findWrapping(r){for(var o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==r)return this.wrapCache[o+1];var i=this.computeWrapping(r);return this.wrapCache.push(r,i),i}},{key:"computeWrapping",value:function computeWrapping(r){for(var o=Object.create(null),i=[{match:this,type:null,via:null}];i.length;){var a=i.shift(),c=a.match;if(c.matchType(r)){for(var u=[],p=a;p.type;p=p.via)u.push(p.type);return u.reverse()}for(var g=0;g<c.next.length;g++){var v=c.next[g],b=v.type,k=v.next;b.isLeaf||b.hasRequiredAttrs()||b.name in o||a.type&&!k.validEnd||(i.push({match:b.contentMatch,type:b,via:a}),o[b.name]=!0)}}return null}},{key:"edgeCount",get:function get(){return this.next.length}},{key:"edge",value:function edge(r){if(r>=this.next.length)throw new RangeError("There's no ".concat(r,"th edge in this content match"));return this.next[r]}},{key:"toString",value:function toString(){var r=[];return function scan(o){r.push(o);for(var i=0;i<o.next.length;i++)-1==r.indexOf(o.next[i].next)&&scan(o.next[i].next)}(this),r.map(function(o,i){for(var a=i+(o.validEnd?"*":" ")+" ",c=0;c<o.next.length;c++)a+=(c?", ":"")+o.next[c].type.name+"->"+r.indexOf(o.next[c].next);return a}).join("\n")}}],[{key:"parse",value:function parse(r,o){var i=new A(r,o);if(null==i.next)return ContentMatch.empty;var a=parseExpr(i);i.next&&i.err("Unexpected trailing text");var c=dfa(function nfa(r){var o=[[]];return connect(compile(r,0),node()),o;function node(){return o.push([])-1}function edge(r,i,a){var c={term:a,to:i};return o[r].push(c),c}function connect(r,o){r.forEach(function(r){return r.to=o})}function compile(r,o){if("choice"==r.type)return r.exprs.reduce(function(r,i){return r.concat(compile(i,o))},[]);if("seq"!=r.type){if("star"==r.type){var i=node();return edge(o,i),connect(compile(r.expr,i),i),[edge(i)]}if("plus"==r.type){var a=node();return connect(compile(r.expr,o),a),connect(compile(r.expr,a),a),[edge(a)]}if("opt"==r.type)return[edge(o)].concat(compile(r.expr,o));if("range"==r.type){for(var c=o,u=0;u<r.min;u++){var p=node();connect(compile(r.expr,c),p),c=p}if(-1==r.max)connect(compile(r.expr,c),c);else for(var g=r.min;g<r.max;g++){var v=node();edge(c,v),connect(compile(r.expr,c),v),c=v}return[edge(c)]}if("name"==r.type)return[edge(o,void 0,r.value)];throw new Error("Unknown expr type")}for(var b=0;;b++){var k=compile(r.exprs[b],o);if(b==r.exprs.length-1)return k;connect(k,o=node())}}}(a));return function checkForDeadEnds(r,o){for(var i=0,a=[r];i<a.length;i++){for(var c=a[i],u=!c.validEnd,p=[],g=0;g<c.next.length;g++){var v=c.next[g],b=v.type,k=v.next;p.push(b.name),!u||b.isText||b.hasRequiredAttrs()||(u=!1),-1==a.indexOf(k)&&a.push(k)}u&&o.err("Only non-generatable nodes ("+p.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(c,i),c}}]),ContentMatch}();P.empty=new P(!0);var A=function(){function TokenStream(r,o){_classCallCheck(this,TokenStream),this.string=r,this.nodeTypes=o,this.inline=null,this.pos=0,this.tokens=r.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return _createClass(TokenStream,[{key:"next",get:function get(){return this.tokens[this.pos]}},{key:"eat",value:function eat(r){return this.next==r&&(this.pos++||!0)}},{key:"err",value:function err(r){throw new SyntaxError(r+" (in content expression '"+this.string+"')")}}]),TokenStream}();function parseExpr(r){var o=[];do{o.push(parseExprSeq(r))}while(r.eat("|"));return 1==o.length?o[0]:{type:"choice",exprs:o}}function parseExprSeq(r){var o=[];do{o.push(parseExprSubscript(r))}while(r.next&&")"!=r.next&&"|"!=r.next);return 1==o.length?o[0]:{type:"seq",exprs:o}}function parseExprSubscript(r){for(var o=function parseExprAtom(r){if(r.eat("(")){var o=parseExpr(r);return r.eat(")")||r.err("Missing closing paren"),o}if(!/\W/.test(r.next)){var i=function resolveName(r,o){var i=r.nodeTypes,a=i[o];if(a)return[a];var c=[];for(var u in i){var p=i[u];p.isInGroup(o)&&c.push(p)}0==c.length&&r.err("No node type or group '"+o+"' found");return c}(r,r.next).map(function(o){return null==r.inline?r.inline=o.isInline:r.inline!=o.isInline&&r.err("Mixing inline and block content"),{type:"name",value:o}});return r.pos++,1==i.length?i[0]:{type:"choice",exprs:i}}r.err("Unexpected token '"+r.next+"'")}(r);;)if(r.eat("+"))o={type:"plus",expr:o};else if(r.eat("*"))o={type:"star",expr:o};else if(r.eat("?"))o={type:"opt",expr:o};else{if(!r.eat("{"))break;o=parseExprRange(r,o)}return o}function parseNum(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");var o=Number(r.next);return r.pos++,o}function parseExprRange(r,o){var i=parseNum(r),a=i;return r.eat(",")&&(a="}"!=r.next?parseNum(r):-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:i,max:a,expr:o}}function cmp(r,o){return o-r}function nullFrom(r,o){var i=[];return function scan(o){var a=r[o];if(1==a.length&&!a[0].term)return scan(a[0].to);i.push(o);for(var c=0;c<a.length;c++){var u=a[c],p=u.term,g=u.to;p||-1!=i.indexOf(g)||scan(g)}}(o),i.sort(cmp)}function dfa(r){var o=Object.create(null);return function explore(i){var a=[];i.forEach(function(o){r[o].forEach(function(o){var i=o.term,c=o.to;if(i){for(var u,p=0;p<a.length;p++)a[p][0]==i&&(u=a[p][1]);nullFrom(r,c).forEach(function(r){u||a.push([i,u=[]]),-1==u.indexOf(r)&&u.push(r)})}})});for(var c=o[i.join(",")]=new P(i.indexOf(r.length-1)>-1),u=0;u<a.length;u++){var p=a[u][1].sort(cmp);c.next.push({type:a[u][0],next:o[p.join(",")]||explore(p)})}return c}(nullFrom(r,0))}function defaultAttrs(r){var o=Object.create(null);for(var i in r){var a=r[i];if(!a.hasDefault)return null;o[i]=a.default}return o}function _computeAttrs(r,o){var i=Object.create(null);for(var a in r){var c=o&&o[a];if(void 0===c){var u=r[a];if(!u.hasDefault)throw new RangeError("No value supplied for attribute "+a);c=u.default}i[a]=c}return i}function _checkAttrs(r,o,i,a){for(var c in o)if(!(c in r))throw new RangeError("Unsupported attribute ".concat(c," for ").concat(i," of type ").concat(c));for(var u in r){var p=r[u];p.validate&&p.validate(o[u])}}function initAttrs(r,o){var i=Object.create(null);if(o)for(var a in o)i[a]=new R(r,a,o[a]);return i}var N=function(){function NodeType(r,o,i){_classCallCheck(this,NodeType),this.name=r,this.schema=o,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=initAttrs(r,i.attrs),this.defaultAttrs=defaultAttrs(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==r),this.isText="text"==r}return _createClass(NodeType,[{key:"isInline",get:function get(){return!this.isBlock}},{key:"isTextblock",get:function get(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function get(){return this.contentMatch==P.empty}},{key:"isAtom",get:function get(){return this.isLeaf||!!this.spec.atom}},{key:"isInGroup",value:function isInGroup(r){return this.groups.indexOf(r)>-1}},{key:"whitespace",get:function get(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function hasRequiredAttrs(){for(var r in this.attrs)if(this.attrs[r].isRequired)return!0;return!1}},{key:"compatibleContent",value:function compatibleContent(r){return this==r||this.contentMatch.compatible(r.contentMatch)}},{key:"computeAttrs",value:function computeAttrs(r){return!r&&this.defaultAttrs?this.defaultAttrs:_computeAttrs(this.attrs,r)}},{key:"create",value:function create(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new _(this,this.computeAttrs(r),c.from(o),p.setFrom(i))}},{key:"createChecked",value:function createChecked(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;return o=c.from(o),this.checkContent(o),new _(this,this.computeAttrs(r),o,p.setFrom(i))}},{key:"createAndFill",value:function createAndFill(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;if(r=this.computeAttrs(r),(o=c.from(o)).size){var a=this.contentMatch.fillBefore(o);if(!a)return null;o=a.append(o)}var u=this.contentMatch.matchFragment(o),g=u&&u.fillBefore(c.empty,!0);return g?new _(this,r,o.append(g),p.setFrom(i)):null}},{key:"validContent",value:function validContent(r){var o=this.contentMatch.matchFragment(r);if(!o||!o.validEnd)return!1;for(var i=0;i<r.childCount;i++)if(!this.allowsMarks(r.child(i).marks))return!1;return!0}},{key:"checkContent",value:function checkContent(r){if(!this.validContent(r))throw new RangeError("Invalid content for node ".concat(this.name,": ").concat(r.toString().slice(0,50)))}},{key:"checkAttrs",value:function checkAttrs(r){_checkAttrs(this.attrs,r,"node",this.name)}},{key:"allowsMarkType",value:function allowsMarkType(r){return null==this.markSet||this.markSet.indexOf(r)>-1}},{key:"allowsMarks",value:function allowsMarks(r){if(null==this.markSet)return!0;for(var o=0;o<r.length;o++)if(!this.allowsMarkType(r[o].type))return!1;return!0}},{key:"allowedMarks",value:function allowedMarks(r){if(null==this.markSet)return r;for(var o,i=0;i<r.length;i++)this.allowsMarkType(r[i].type)?o&&o.push(r[i]):o||(o=r.slice(0,i));return o?o.length?o:p.none:r}}],[{key:"compile",value:function compile(r,o){var i=Object.create(null);r.forEach(function(r,a){return i[r]=new NodeType(r,o,a)});var a=o.spec.topNode||"doc";if(!i[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(var c in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}}]),NodeType}();var R=function(){function Attribute(r,o,i){_classCallCheck(this,Attribute),this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate="string"==typeof i.validate?function validateType(r,o,i){var a=i.split("|");return function(i){var c=null===i?"null":_typeof(i);if(a.indexOf(c)<0)throw new RangeError("Expected value of type ".concat(a," for attribute ").concat(o," on type ").concat(r,", got ").concat(c))}}(r,o,i.validate):i.validate}return _createClass(Attribute,[{key:"isRequired",get:function get(){return!this.hasDefault}}]),Attribute}(),I=function(){function MarkType(r,o,i,a){_classCallCheck(this,MarkType),this.name=r,this.rank=o,this.schema=i,this.spec=a,this.attrs=initAttrs(r,a.attrs),this.excluded=null;var c=defaultAttrs(this.attrs);this.instance=c?new p(this,c):null}return _createClass(MarkType,[{key:"create",value:function create(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!r&&this.instance?this.instance:new p(this,_computeAttrs(this.attrs,r))}},{key:"removeFromSet",value:function removeFromSet(r){for(var o=0;o<r.length;o++)r[o].type==this&&(r=r.slice(0,o).concat(r.slice(o+1)),o--);return r}},{key:"isInSet",value:function isInSet(r){for(var o=0;o<r.length;o++)if(r[o].type==this)return r[o]}},{key:"checkAttrs",value:function checkAttrs(r){_checkAttrs(this.attrs,r,"mark",this.name)}},{key:"excludes",value:function excludes(r){return this.excluded.indexOf(r)>-1}}],[{key:"compile",value:function compile(r,o){var i=Object.create(null),a=0;return r.forEach(function(r,c){return i[r]=new MarkType(r,a++,o,c)}),i}}]),MarkType}(),L=function(){function Schema(r){var o=this;_classCallCheck(this,Schema),this.linebreakReplacement=null,this.cached=Object.create(null);var i=this.spec={};for(var c in r)i[c]=r[c];i.nodes=a.from(r.nodes),i.marks=a.from(r.marks||{}),this.nodes=N.compile(this.spec.nodes,this),this.marks=I.compile(this.spec.marks,this);var u=Object.create(null);for(var g in this.nodes){if(g in this.marks)throw new RangeError(g+" can not be both a node and a mark");var v=this.nodes[g],b=v.spec.content||"",k=v.spec.marks;if(v.contentMatch=u[b]||(u[b]=P.parse(b,this.nodes)),v.inlineContent=v.contentMatch.inlineContent,v.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!v.isInline||!v.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=v}v.markSet="_"==k?null:k?gatherMarks(this,k.split(" ")):""!=k&&v.inlineContent?null:[]}for(var E in this.marks){var w=this.marks[E],x=w.spec.excludes;w.excluded=null==x?[w]:""==x?[]:gatherMarks(this,x.split(" "))}this.nodeFromJSON=function(r){return _.fromJSON(o,r)},this.markFromJSON=function(r){return p.fromJSON(o,r)},this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}return _createClass(Schema,[{key:"node",value:function node(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;if("string"==typeof r)r=this.nodeType(r);else{if(!(r instanceof N))throw new RangeError("Invalid node type: "+r);if(r.schema!=this)throw new RangeError("Node type from different schema used ("+r.name+")")}return r.createChecked(o,i,a)}},{key:"text",value:function text(r,o){var i=this.nodes.text;return new T(i,i.defaultAttrs,r,p.setFrom(o))}},{key:"mark",value:function mark(r,o){return"string"==typeof r&&(r=this.marks[r]),r.create(o)}},{key:"nodeType",value:function nodeType(r){var o=this.nodes[r];if(!o)throw new RangeError("Unknown node type: "+r);return o}}]),Schema}();function gatherMarks(r,o){for(var i=[],a=0;a<o.length;a++){var c=o[a],u=r.marks[c],p=u;if(u)i.push(u);else for(var g in r.marks){var v=r.marks[g];("_"==c||v.spec.group&&v.spec.group.split(" ").indexOf(c)>-1)&&i.push(p=v)}if(!p)throw new SyntaxError("Unknown mark type: '"+o[a]+"'")}return i}var z=function(){function DOMParser(r,o){var i=this;_classCallCheck(this,DOMParser),this.schema=r,this.rules=o,this.tags=[],this.styles=[];var a=this.matchedStyles=[];o.forEach(function(r){if(function isTagRule(r){return null!=r.tag}(r))i.tags.push(r);else if(function isStyleRule(r){return null!=r.style}(r)){var o=/[^=]*/.exec(r.style)[0];a.indexOf(o)<0&&a.push(o),i.styles.push(r)}}),this.normalizeLists=!this.tags.some(function(o){if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;var i=r.nodes[o.node];return i.contentMatch.matchType(i)})}return _createClass(DOMParser,[{key:"parse",value:function parse(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new H(this,o,!1);return i.addAll(r,p.none,o.from,o.to),i.finish()}},{key:"parseSlice",value:function parseSlice(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new H(this,o,!0);return i.addAll(r,p.none,o.from,o.to),v.maxOpen(i.finish())}},{key:"matchTag",value:function matchTag(r,o,i){for(var a=i?this.tags.indexOf(i)+1:0;a<this.tags.length;a++){var c=this.tags[a];if(matches(r,c.tag)&&(void 0===c.namespace||r.namespaceURI==c.namespace)&&(!c.context||o.matchesContext(c.context))){if(c.getAttrs){var u=c.getAttrs(r);if(!1===u)continue;c.attrs=u||void 0}return c}}}},{key:"matchStyle",value:function matchStyle(r,o,i,a){for(var c=a?this.styles.indexOf(a)+1:0;c<this.styles.length;c++){var u=this.styles[c],p=u.style;if(!(0!=p.indexOf(r)||u.context&&!i.matchesContext(u.context)||p.length>r.length&&(61!=p.charCodeAt(r.length)||p.slice(r.length+1)!=o))){if(u.getAttrs){var g=u.getAttrs(o);if(!1===g)continue;u.attrs=g||void 0}return u}}}}],[{key:"schemaRules",value:function schemaRules(r){var o=[];function insert(r){for(var i=null==r.priority?50:r.priority,a=0;a<o.length;a++){var c=o[a];if((null==c.priority?50:c.priority)<i)break}o.splice(a,0,r)}var i=function _loop2(o){var i=r.marks[o].spec.parseDOM;i&&i.forEach(function(r){insert(r=copy(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})};for(var a in r.marks)i(a);var c=function _loop3(o){var i=r.nodes[o].spec.parseDOM;i&&i.forEach(function(r){insert(r=copy(r)),r.node||r.ignore||r.mark||(r.node=o)})};for(var u in r.nodes)c(u);return o}},{key:"fromSchema",value:function fromSchema(r){return r.cached.domParser||(r.cached.domParser=new DOMParser(r,DOMParser.schemaRules(r)))}}]),DOMParser}(),j={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},B={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},V={ol:!0,ul:!0};function wsOptionsFor(r,o,i){return null!=o?(o?1:0)|("full"===o?2:0):r&&"pre"==r.whitespace?3:-5&i}var U=function(){function NodeContext(r,o,i,a,c,u){_classCallCheck(this,NodeContext),this.type=r,this.attrs=o,this.marks=i,this.solid=a,this.options=u,this.content=[],this.activeMarks=p.none,this.match=c||(4&u?null:r.contentMatch)}return _createClass(NodeContext,[{key:"findWrapping",value:function findWrapping(r){if(!this.match){if(!this.type)return[];var o=this.type.contentMatch.fillBefore(c.from(r));if(!o){var i,a=this.type.contentMatch;return(i=a.findWrapping(r.type))?(this.match=a,i):null}this.match=this.type.contentMatch.matchFragment(o)}return this.match.findWrapping(r.type)}},{key:"finish",value:function finish(r){if(!(1&this.options)){var o,i=this.content[this.content.length-1];if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){var a=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-o[0].length))}}var u=c.from(this.content);return!r&&this.match&&(u=u.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,u,this.marks):u}},{key:"inlineContext",value:function inlineContext(r){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:r.parentNode&&!j.hasOwnProperty(r.parentNode.nodeName.toLowerCase())}}]),NodeContext}(),H=function(){function ParseContext(r,o,i){_classCallCheck(this,ParseContext),this.parser=r,this.options=o,this.isOpen=i,this.open=0,this.localPreserveWS=!1;var a,c=o.topNode,u=wsOptionsFor(null,o.preserveWhitespace,0)|(i?4:0);a=c?new U(c.type,c.attrs,p.none,!0,o.topMatch||c.type.contentMatch,u):new U(i?null:r.schema.topNodeType,null,p.none,!0,null,u),this.nodes=[a],this.find=o.findPositions,this.needsBlock=!1}return _createClass(ParseContext,[{key:"top",get:function get(){return this.nodes[this.open]}},{key:"addDOM",value:function addDOM(r,o){3==r.nodeType?this.addTextNode(r,o):1==r.nodeType&&this.addElement(r,o)}},{key:"addTextNode",value:function addTextNode(r,o){var i=r.nodeValue,a=this.top,c=2&a.options?"full":this.localPreserveWS||(1&a.options)>0,u=this.parser.schema;if("full"===c||a.inlineContext(r)||/[^ \t\r\n\u000c]/.test(i)){if(c)if("full"===c)i=i.replace(/\r\n?/g,"\n");else if(u.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(u.linebreakReplacement.create())){for(var p=i.split(/\r?\n|\r/),g=0;g<p.length;g++)g&&this.insertNode(u.linebreakReplacement.create(),o,!0),p[g]&&this.insertNode(u.text(p[g]),o,!/\S/.test(p[g]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){var v=a.content[a.content.length-1],b=r.previousSibling;(!v||b&&"BR"==b.nodeName||v.isText&&/[ \t\r\n\u000c]$/.test(v.text))&&(i=i.slice(1))}i&&this.insertNode(u.text(i),o,!/\S/.test(i)),this.findInText(r)}else this.findInside(r)}},{key:"addElement",value:function addElement(r,o,i){var a=this.localPreserveWS,c=this.top;("PRE"==r.tagName||/pre/.test(r.style&&r.style.whiteSpace))&&(this.localPreserveWS=!0);var u,p=r.nodeName.toLowerCase();V.hasOwnProperty(p)&&this.parser.normalizeLists&&function normalizeList(r){for(var o=r.firstChild,i=null;o;o=o.nextSibling){var a=1==o.nodeType?o.nodeName.toLowerCase():null;a&&V.hasOwnProperty(a)&&i?(i.appendChild(o),o=i):"li"==a?i=o:a&&(i=null)}}(r);var g=this.options.ruleFromNode&&this.options.ruleFromNode(r)||(u=this.parser.matchTag(r,this,i));e:if(g?g.ignore:B.hasOwnProperty(p))this.findInside(r),this.ignoreFallback(r,o);else if(!g||g.skip||g.closeParent){g&&g.closeParent?this.open=Math.max(0,this.open-1):g&&g.skip.nodeType&&(r=g.skip);var v,b=this.needsBlock;if(j.hasOwnProperty(p))c.content.length&&c.content[0].isInline&&this.open&&(this.open--,c=this.top),v=!0,c.type||(this.needsBlock=!0);else if(!r.firstChild){this.leafFallback(r,o);break e}var k=g&&g.skip?o:this.readStyles(r,o);k&&this.addAll(r,k),v&&this.sync(c),this.needsBlock=b}else{var E=this.readStyles(r,o);E&&this.addElementByRule(r,g,E,!1===g.consuming?u:void 0)}this.localPreserveWS=a}},{key:"leafFallback",value:function leafFallback(r,o){"BR"==r.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(r.ownerDocument.createTextNode("\n"),o)}},{key:"ignoreFallback",value:function ignoreFallback(r,o){"BR"!=r.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),o,!0)}},{key:"readStyles",value:function readStyles(r,o){var i=this,a=r.style;if(a&&a.length)for(var c=0;c<this.parser.matchedStyles.length;c++){var u=this.parser.matchedStyles[c],p=a.getPropertyValue(u);if(p)for(var g,v=function _loop4(r){var a=i.parser.matchStyle(u,p,i,r);return a?a.ignore?{v:null}:(o=a.clearMark?o.filter(function(r){return!a.clearMark(r)}):o.concat(i.parser.schema.marks[a.mark].create(a.attrs)),!1!==a.consuming?(b=r,0):void(b=r=a)):(b=r,0)},b=void 0;0!==(g=v(b));)if(g)return g.v}return o}},{key:"addElementByRule",value:function addElementByRule(r,o,i,a){var c,u,p=this;if(o.node)if((u=this.parser.schema.nodes[o.node]).isLeaf)this.insertNode(u.create(o.attrs),i,"BR"==r.nodeName)||this.leafFallback(r,i);else{var g=this.enter(u,o.attrs||null,i,o.preserveWhitespace);g&&(c=!0,i=g)}else{var v=this.parser.schema.marks[o.mark];i=i.concat(v.create(o.attrs))}var b=this.top;if(u&&u.isLeaf)this.findInside(r);else if(a)this.addElement(r,i,a);else if(o.getContent)this.findInside(r),o.getContent(r,this.parser.schema).forEach(function(r){return p.insertNode(r,i,!1)});else{var k=r;"string"==typeof o.contentElement?k=r.querySelector(o.contentElement):"function"==typeof o.contentElement?k=o.contentElement(r):o.contentElement&&(k=o.contentElement),this.findAround(r,k,!0),this.addAll(k,i),this.findAround(r,k,!1)}c&&this.sync(b)&&this.open--}},{key:"addAll",value:function addAll(r,o,i,a){for(var c=i||0,u=i?r.childNodes[i]:r.firstChild,p=null==a?null:r.childNodes[a];u!=p;u=u.nextSibling,++c)this.findAtPoint(r,c),this.addDOM(u,o);this.findAtPoint(r,c)}},{key:"findPlace",value:function findPlace(r,o,i){for(var a,c,u=this.open,p=0;u>=0;u--){var g=this.nodes[u],v=g.findWrapping(r);if(v&&(!a||a.length>v.length+p)&&(a=v,c=g,!v.length))break;if(g.solid){if(i)break;p+=2}}if(!a)return null;this.sync(c);for(var b=0;b<a.length;b++)o=this.enterInner(a[b],null,o,!1);return o}},{key:"insertNode",value:function insertNode(r,o,i){if(r.isInline&&this.needsBlock&&!this.top.type){var a=this.textblockFromContext();a&&(o=this.enterInner(a,null,o))}var c=this.findPlace(r,o,i);if(c){this.closeExtra();var u=this.top;u.match&&(u.match=u.match.matchType(r.type));var g,v=p.none,b=_createForOfIteratorHelper(c.concat(r.marks));try{for(b.s();!(g=b.n()).done;){var k=g.value;(u.type?u.type.allowsMarkType(k.type):markMayApply(k.type,r.type))&&(v=k.addToSet(v))}}catch(r){b.e(r)}finally{b.f()}return u.content.push(r.mark(v)),!0}return!1}},{key:"enter",value:function enter(r,o,i,a){var c=this.findPlace(r.create(o),i,!1);return c&&(c=this.enterInner(r,o,i,!0,a)),c}},{key:"enterInner",value:function enterInner(r,o,i){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=arguments.length>4?arguments[4]:void 0;this.closeExtra();var u=this.top;u.match=u.match&&u.match.matchType(r);var g=wsOptionsFor(r,c,u.options);4&u.options&&0==u.content.length&&(g|=4);var v=p.none;return i=i.filter(function(o){return!(u.type?u.type.allowsMarkType(o.type):markMayApply(o.type,r))||(v=o.addToSet(v),!1)}),this.nodes.push(new U(r,o,v,a,null,g)),this.open++,i}},{key:"closeExtra",value:function closeExtra(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=this.nodes.length-1;if(o>this.open){for(;o>this.open;o--)this.nodes[o-1].content.push(this.nodes[o].finish(r));this.nodes.length=this.open+1}}},{key:"finish",value:function finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}},{key:"sync",value:function sync(r){for(var o=this.open;o>=0;o--){if(this.nodes[o]==r)return this.open=o,!0;this.localPreserveWS&&(this.nodes[o].options|=1)}return!1}},{key:"currentPos",get:function get(){this.closeExtra();for(var r=0,o=this.open;o>=0;o--){for(var i=this.nodes[o].content,a=i.length-1;a>=0;a--)r+=i[a].nodeSize;o&&r++}return r}},{key:"findAtPoint",value:function findAtPoint(r,o){if(this.find)for(var i=0;i<this.find.length;i++)this.find[i].node==r&&this.find[i].offset==o&&(this.find[i].pos=this.currentPos)}},{key:"findInside",value:function findInside(r){if(this.find)for(var o=0;o<this.find.length;o++)null==this.find[o].pos&&1==r.nodeType&&r.contains(this.find[o].node)&&(this.find[o].pos=this.currentPos)}},{key:"findAround",value:function findAround(r,o,i){if(r!=o&&this.find)for(var a=0;a<this.find.length;a++){if(null==this.find[a].pos&&1==r.nodeType&&r.contains(this.find[a].node))o.compareDocumentPosition(this.find[a].node)&(i?2:4)&&(this.find[a].pos=this.currentPos)}}},{key:"findInText",value:function findInText(r){if(this.find)for(var o=0;o<this.find.length;o++)this.find[o].node==r&&(this.find[o].pos=this.currentPos-(r.nodeValue.length-this.find[o].offset))}},{key:"matchesContext",value:function matchesContext(r){var o=this;if(r.indexOf("|")>-1)return r.split(/\s*\|\s*/).some(this.matchesContext,this);var i=r.split("/"),a=this.options.context,c=!(this.isOpen||a&&a.parent.type!=this.nodes[0].type),u=-(a?a.depth+1:0)+(c?0:1);return function match(r,p){for(;r>=0;r--){var g=i[r];if(""==g){if(r==i.length-1||0==r)continue;for(;p>=u;p--)if(match(r-1,p))return!0;return!1}var v=p>0||0==p&&c?o.nodes[p].type:a&&p>=u?a.node(p-u).type:null;if(!v||v.name!=g&&!v.isInGroup(g))return!1;p--}return!0}(i.length-1,this.open)}},{key:"textblockFromContext",value:function textblockFromContext(){var r=this.options.context;if(r)for(var o=r.depth;o>=0;o--){var i=r.node(o).contentMatchAt(r.indexAfter(o)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(var a in this.parser.schema.nodes){var c=this.parser.schema.nodes[a];if(c.isTextblock&&c.defaultAttrs)return c}}}]),ParseContext}();function matches(r,o){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,o)}function copy(r){var o={};for(var i in r)o[i]=r[i];return o}function markMayApply(r,o){var i,a=o.schema.nodes,c=function _loop5(){var i=a[u];if(!i.allowsMarkType(r))return 0;var c=[];return function scan(r){c.push(r);for(var i=0;i<r.edgeCount;i++){var a=r.edge(i),u=a.type,p=a.next;if(u==o)return!0;if(c.indexOf(p)<0&&scan(p))return!0}}(i.contentMatch)?{v:!0}:void 0};for(var u in a)if(0!==(i=c())&&i)return i.v}var W=function(){function DOMSerializer(r,o){_classCallCheck(this,DOMSerializer),this.nodes=r,this.marks=o}return _createClass(DOMSerializer,[{key:"serializeFragment",value:function serializeFragment(r){var o=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;a||(a=doc(i).createDocumentFragment());var c=a,u=[];return r.forEach(function(r){if(u.length||r.marks.length){for(var a=0,p=0;a<u.length&&p<r.marks.length;){var g=r.marks[p];if(o.marks[g.type.name]){if(!g.eq(u[a][0])||!1===g.type.spec.spanning)break;a++,p++}else p++}for(;a<u.length;)c=u.pop()[1];for(;p<r.marks.length;){var v=r.marks[p++],b=o.serializeMark(v,r.isInline,i);b&&(u.push([v,c]),c.appendChild(b.dom),c=b.contentDOM||b.dom)}}c.appendChild(o.serializeNodeInner(r,i))}),a}},{key:"serializeNodeInner",value:function serializeNodeInner(r,o){var i=_renderSpec(doc(o),this.nodes[r.type.name](r),null,r.attrs),a=i.dom,c=i.contentDOM;if(c){if(r.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(r.content,o,c)}return a}},{key:"serializeNode",value:function serializeNode(r){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.serializeNodeInner(r,o),a=r.marks.length-1;a>=0;a--){var c=this.serializeMark(r.marks[a],r.isInline,o);c&&((c.contentDOM||c.dom).appendChild(i),i=c.dom)}return i}},{key:"serializeMark",value:function serializeMark(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=this.marks[r.type.name];return a&&_renderSpec(doc(i),a(r,o),null,r.attrs)}}],[{key:"renderSpec",value:function renderSpec(r,o){return _renderSpec(r,o,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0)}},{key:"fromSchema",value:function fromSchema(r){return r.cached.domSerializer||(r.cached.domSerializer=new DOMSerializer(this.nodesFromSchema(r),this.marksFromSchema(r)))}},{key:"nodesFromSchema",value:function nodesFromSchema(r){var o=gatherToDOM(r.nodes);return o.text||(o.text=function(r){return r.text}),o}},{key:"marksFromSchema",value:function marksFromSchema(r){return gatherToDOM(r.marks)}}]),DOMSerializer}();function gatherToDOM(r){var o={};for(var i in r){var a=r[i].spec.toDOM;a&&(o[i]=a)}return o}function doc(r){return r.document||window.document}var K=new WeakMap;function suspiciousAttributes(r){var o=K.get(r);return void 0===o&&K.set(r,o=function suspiciousAttributesInner(r){var o=null;function scan(r){if(r&&"object"==_typeof(r))if(Array.isArray(r))if("string"==typeof r[0])o||(o=[]),o.push(r);else for(var i=0;i<r.length;i++)scan(r[i]);else for(var a in r)scan(r[a])}return scan(r),o}(r)),o}function _renderSpec(r,o,i,a){if("string"==typeof o)return{dom:r.createTextNode(o)};if(null!=o.nodeType)return{dom:o};if(o.dom&&null!=o.dom.nodeType)return o;var c,u=o[0];if("string"!=typeof u)throw new RangeError("Invalid array passed to renderSpec");if(a&&(c=suspiciousAttributes(a))&&c.indexOf(o)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");var p,g=u.indexOf(" ");g>0&&(i=u.slice(0,g),u=u.slice(g+1));var v=i?r.createElementNS(i,u):r.createElement(u),b=o[1],k=1;if(b&&"object"==_typeof(b)&&null==b.nodeType&&!Array.isArray(b))for(var E in k=2,b)if(null!=b[E]){var w=E.indexOf(" ");w>0?v.setAttributeNS(E.slice(0,w),E.slice(w+1),b[E]):"style"==E&&v.style?v.style.cssText=b[E]:v.setAttribute(E,b[E])}for(var x=k;x<o.length;x++){var C=o[x];if(0===C){if(x<o.length-1||x>k)throw new RangeError("Content hole must be the only child of its parent node");return{dom:v,contentDOM:v}}var _=_renderSpec(r,C,i,a),T=_.dom,P=_.contentDOM;if(v.appendChild(T),P){if(p)throw new RangeError("Multiple content holes");p=P}}return{dom:v,contentDOM:p}}o.ContentMatch=P,o.DOMParser=z,o.DOMSerializer=W,o.Fragment=c,o.Mark=p,o.MarkType=I,o.Node=_,o.NodeRange=x,o.NodeType=N,o.ReplaceError=g,o.ResolvedPos=b,o.Schema=L,o.Slice=v},78187:function(r){"use strict";r.exports=window.elementorV2.session},78806:function(r){"use strict";r.exports=window.elementorV2.env},79513:function(r){"use strict";r.exports=window.elementorV2.ui},81531:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,v={};((r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})})(v,{Link:()=>z,default:()=>j,isAllowedUri:()=>isAllowedUri,pasteRegex:()=>L}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=i(99248),k=i(54631),E=i(99248),w=i(49162),x=i(54631),C="[\0- -\u2029 ]",_=new RegExp(C),T=new RegExp(`${C}$`),P=new RegExp(C,"g");var A=i(99248),N=i(49162);var R=i(49162),I=i(54631);var L=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;function isAllowedUri(r,o){const i=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return o&&o.forEach(r=>{const o="string"==typeof r?r:r.scheme;o&&i.push(o)}),!r||r.replace(P,"").match(new RegExp(`^(?:(?:${i.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var z=b.Mark.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(r=>{"string"!=typeof r?(0,k.registerCustomProtocol)(r.scheme,r.optionalSlashes):(0,k.registerCustomProtocol)(r)})},onDestroy(){(0,k.reset)()},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:(r,o)=>!!isAllowedUri(r,o.protocols),validate:r=>!!r,shouldAutoLink:r=>{const o=/^[a-z][a-z0-9+.-]*:\/\//i.test(r),i=/^[a-z][a-z0-9+.-]*:/i.test(r);if(o||i&&!r.includes("@"))return!0;const a=(r.includes("@")?r.split("@").pop():r).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(a)&&!!/\./.test(a)}}},addAttributes(){return{href:{default:null,parseHTML(r){return r.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:r=>{const o=r.getAttribute("href");return!(!o||!this.options.isAllowedUri(o,{defaultValidate:r=>!!isAllowedUri(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:r}){return this.options.isAllowedUri(r.href,{defaultValidate:r=>!!isAllowedUri(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,b.mergeAttributes)(this.options.HTMLAttributes,r),0]:["a",(0,b.mergeAttributes)(this.options.HTMLAttributes,{...r,href:""}),0]},markdownTokenName:"link",parseMarkdown:(r,o)=>o.applyMark("link",o.parseInline(r.tokens||[]),{href:r.href,title:r.title||null}),renderMarkdown:(r,o)=>{var i,a,c,u;const p=null!=(a=null==(i=r.attrs)?void 0:i.href)?a:"",g=null!=(u=null==(c=r.attrs)?void 0:c.title)?u:"",v=o.renderChildren(r);return g?`[${v}](${p} "${g}")`:`[${v}](${p})`},addCommands(){return{setLink:r=>({chain:o})=>{const{href:i}=r;return!!this.options.isAllowedUri(i,{defaultValidate:r=>!!isAllowedUri(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&o().setMark(this.name,r).setMeta("preventAutolink",!0).run()},toggleLink:r=>({chain:o})=>{const{href:i}=r||{};return!(i&&!this.options.isAllowedUri(i,{defaultValidate:r=>!!isAllowedUri(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&o().toggleMark(this.name,r,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:r})=>r().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,b.markPasteRule)({find:r=>{const o=[];if(r){const{protocols:i,defaultProtocol:a}=this.options,c=(0,k.find)(r).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:r=>!!isAllowedUri(r,i),protocols:i,defaultProtocol:a}));c.length&&c.forEach(r=>{this.options.shouldAutoLink(r.value)&&o.push({text:r.value,data:{href:r.href},index:r.start})})}return o},type:this.type,getAttributes:r=>{var o;return{href:null==(o=r.data)?void 0:o.href}}})]},addProseMirrorPlugins(){const r=[],{protocols:o,defaultProtocol:i}=this.options;return this.options.autolink&&r.push(function autolink(r){return new w.Plugin({key:new w.PluginKey("autolink"),appendTransaction:(o,i,a)=>{const c=o.some(r=>r.docChanged)&&!i.doc.eq(a.doc),u=o.some(r=>r.getMeta("preventAutolink"));if(!c||u)return;const{tr:p}=a,g=(0,E.combineTransactionSteps)(i.doc,[...o]);return(0,E.getChangedRanges)(g).forEach(({newRange:o})=>{const i=(0,E.findChildrenInRange)(a.doc,o,r=>r.isTextblock);let c,u;if(i.length>1)c=i[0],u=a.doc.textBetween(c.pos,c.pos+c.node.nodeSize,void 0," ");else if(i.length){const r=a.doc.textBetween(o.from,o.to," "," ");if(!T.test(r))return;c=i[0],u=a.doc.textBetween(c.pos,o.to,void 0," ")}if(c&&u){const o=u.split(_).filter(Boolean);if(o.length<=0)return!1;const i=o[o.length-1],g=c.pos+u.lastIndexOf(i);if(!i)return!1;const v=(0,x.tokenize)(i).map(o=>o.toObject(r.defaultProtocol));if(!function isValidLinkStructure(r){return 1===r.length?r[0].isLink:!(3!==r.length||!r[1].isLink)&&["()","[]"].includes(r[0].value+r[2].value)}(v))return!1;v.filter(r=>r.isLink).map(r=>({...r,from:g+r.start+1,to:g+r.end+1})).filter(r=>!a.schema.marks.code||!a.doc.rangeHasMark(r.from,r.to,a.schema.marks.code)).filter(o=>r.validate(o.value)).filter(o=>r.shouldAutoLink(o.value)).forEach(o=>{(0,E.getMarksBetween)(o.from,o.to,a.doc).some(o=>o.mark.type===r.type)||p.addMark(o.from,o.to,r.type.create({href:o.href}))})}}),p.steps.length?p:void 0}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:r=>!!isAllowedUri(r,o),protocols:o,defaultProtocol:i}),shouldAutoLink:this.options.shouldAutoLink})),r.push(function clickHandler(r){return new N.Plugin({key:new N.PluginKey("handleClickLink"),props:{handleClick:(o,i,a)=>{var c,u;if(0!==a.button)return!1;if(!o.editable)return!1;let p=null;if(a.target instanceof HTMLAnchorElement)p=a.target;else{const o=a.target;if(!o)return!1;const i=r.editor.view.dom;p=o.closest("a"),p&&!i.contains(p)&&(p=null)}if(!p)return!1;let g=!1;if(r.enableClickSelection&&(g=r.editor.commands.extendMarkRange(r.type.name)),r.openOnClick){const i=(0,A.getAttributes)(o.state,r.type.name),a=null!=(c=p.href)?c:i.href,v=null!=(u=p.target)?u:i.target;a&&(window.open(a,v),g=!0)}return g}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&r.push(function pasteHandler(r){return new R.Plugin({key:new R.PluginKey("handlePasteLink"),props:{handlePaste:(o,i,a)=>{const{shouldAutoLink:c}=r,{state:u}=o,{selection:p}=u,{empty:g}=p;if(g)return!1;let v="";a.content.forEach(r=>{v+=r.textContent});const b=(0,I.find)(v,{defaultProtocol:r.defaultProtocol}).find(r=>r.isLink&&r.value===v);return!(!v||!b||void 0!==c&&!c(b.value))&&r.editor.commands.setMark(r.type,{href:b.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),r}}),j=z},83574:function(r,o,i){"use strict";var a,c=Object.create,u=Object.defineProperty,p=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,__copyProps=(r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of g(o))b.call(r,c)||c===i||u(r,c,{get:()=>o[c],enumerable:!(a=p(o,c))||a.enumerable});return r},__toESM=(r,o,i)=>(i=null!=r?c(v(r)):{},__copyProps(!o&&r&&r.__esModule?i:u(i,"default",{value:r,enumerable:!0}),r)),k={};((r,o)=>{for(var i in o)u(r,i,{get:o[i],enumerable:!0})})(k,{EditorConsumer:()=>J,EditorContent:()=>A,EditorContext:()=>G,EditorProvider:()=>EditorProvider,MarkViewContent:()=>MarkViewContent,NodeViewContent:()=>NodeViewContent,NodeViewWrapper:()=>te,PureEditorContent:()=>T,ReactMarkView:()=>ue,ReactMarkViewContext:()=>ce,ReactMarkViewRenderer:()=>ReactMarkViewRenderer,ReactNodeView:()=>he,ReactNodeViewContentProvider:()=>ReactNodeViewContentProvider,ReactNodeViewContext:()=>X,ReactNodeViewRenderer:()=>ReactNodeViewRenderer,ReactRenderer:()=>se,Tiptap:()=>ye,TiptapContent:()=>TiptapContent,TiptapContext:()=>ve,TiptapWrapper:()=>TiptapWrapper,useCurrentEditor:()=>useCurrentEditor,useEditor:()=>useEditor,useEditorState:()=>useEditorState,useReactNodeView:()=>useReactNodeView,useTiptap:()=>useTiptap,useTiptapState:()=>useTiptapState}),r.exports=(a=k,__copyProps(u({},"__esModule",{value:!0}),a));var E=i(97557),w=__toESM(i(97557),1),x=__toESM(i(43617),1),C=i(19888),_=i(74848),mergeRefs=(...r)=>o=>{r.forEach(r=>{"function"==typeof r?r(o):r&&(r.current=o)})},Portals=({contentComponent:r})=>{const o=(0,C.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getServerSnapshot);return(0,_.jsx)(_.Fragment,{children:Object.values(o)})};var T=class extends w.default.Component{constructor(r){var o;super(r),this.editorContentRef=w.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(o=r.editor)?void 0:o.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var r;const o=this.props.editor;if(o&&!o.isDestroyed&&(null==(r=o.view.dom)?void 0:r.parentNode)){if(o.contentComponent)return;const r=this.editorContentRef.current;r.append(...o.view.dom.parentNode.childNodes),o.setOptions({element:r}),o.contentComponent=function getInstance(){const r=new Set;let o={};return{subscribe(o){return r.add(o),()=>{r.delete(o)}},getSnapshot(){return o},getServerSnapshot(){return o},setRenderer(i,a){o={...o,[i]:x.default.createPortal(a.reactElement,a.element,i)},r.forEach(r=>r())},removeRenderer(i){const a={...o};delete a[i],o=a,r.forEach(r=>r())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=o.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),o.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var r;const o=this.props.editor;if(o){this.initialized=!1,o.isDestroyed||o.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),o.contentComponent=null;try{if(!(null==(r=o.view.dom)?void 0:r.parentNode))return;const i=document.createElement("div");i.append(...o.view.dom.parentNode.childNodes),o.setOptions({element:i})}catch{}}}render(){const{editor:r,innerRef:o,...i}=this.props;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{ref:mergeRefs(o,this.editorContentRef),...i}),(null==r?void 0:r.contentComponent)&&(0,_.jsx)(Portals,{contentComponent:r.contentComponent})]})}},P=(0,w.forwardRef)((r,o)=>{const i=w.default.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[r.editor]);return w.default.createElement(T,{key:i,innerRef:o,...r})}),A=w.default.memo(P),N=i(99248),R=i(97557),I=i(19888),L=i(40331),z=i(97557),j=i(69242),B="undefined"!=typeof window?z.useLayoutEffect:z.useEffect,V=class{constructor(r){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=r,this.lastSnapshot={editor:r,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(r){return this.subscribers.add(r),()=>{this.subscribers.delete(r)}}watch(r){if(this.editor=r,this.editor){const fn=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},r=this.editor;return r.on("transaction",fn),()=>{r.off("transaction",fn)}}}};function useEditorState(r){var o;const[i]=(0,z.useState)(()=>new V(r.editor)),a=(0,j.useSyncExternalStoreWithSelector)(i.subscribe,i.getSnapshot,i.getServerSnapshot,r.selector,null!=(o=r.equalityFn)?o:L.deepEqual);return B(()=>i.watch(r.editor),[r.editor,i]),(0,z.useDebugValue)(a),a}var U="undefined"==typeof window,H=U||Boolean("undefined"!=typeof window&&window.next),W=class _EditorInstanceManager{constructor(r){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=r,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(r){this.editor=r,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?U||H?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const r={...this.options.current,onBeforeCreate:(...r)=>{var o,i;return null==(i=(o=this.options.current).onBeforeCreate)?void 0:i.call(o,...r)},onBlur:(...r)=>{var o,i;return null==(i=(o=this.options.current).onBlur)?void 0:i.call(o,...r)},onCreate:(...r)=>{var o,i;return null==(i=(o=this.options.current).onCreate)?void 0:i.call(o,...r)},onDestroy:(...r)=>{var o,i;return null==(i=(o=this.options.current).onDestroy)?void 0:i.call(o,...r)},onFocus:(...r)=>{var o,i;return null==(i=(o=this.options.current).onFocus)?void 0:i.call(o,...r)},onSelectionUpdate:(...r)=>{var o,i;return null==(i=(o=this.options.current).onSelectionUpdate)?void 0:i.call(o,...r)},onTransaction:(...r)=>{var o,i;return null==(i=(o=this.options.current).onTransaction)?void 0:i.call(o,...r)},onUpdate:(...r)=>{var o,i;return null==(i=(o=this.options.current).onUpdate)?void 0:i.call(o,...r)},onContentError:(...r)=>{var o,i;return null==(i=(o=this.options.current).onContentError)?void 0:i.call(o,...r)},onDrop:(...r)=>{var o,i;return null==(i=(o=this.options.current).onDrop)?void 0:i.call(o,...r)},onPaste:(...r)=>{var o,i;return null==(i=(o=this.options.current).onPaste)?void 0:i.call(o,...r)},onDelete:(...r)=>{var o,i;return null==(i=(o=this.options.current).onDelete)?void 0:i.call(o,...r)}};return new N.Editor(r)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(r){return this.subscriptions.add(r),()=>{this.subscriptions.delete(r)}}static compareOptions(r,o){return Object.keys(r).every(i=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(i)||("extensions"===i&&r.extensions&&o.extensions?r.extensions.length===o.extensions.length&&r.extensions.every((r,i)=>{var a;return r===(null==(a=o.extensions)?void 0:a[i])}):r[i]===o[i]))}onRender(r){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===r.length?_EditorInstanceManager.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(r),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(r){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=r);if(this.previousDeps.length===r.length&&this.previousDeps.every((o,i)=>o===r[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=r}scheduleDestroy(){const r=this.instanceId,o=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===r?o&&o.setOptions(this.options.current):o&&!o.isDestroyed&&(o.destroy(),this.instanceId===r&&this.setEditor(null))},1)}};function useEditor(r={},o=[]){const i=(0,R.useRef)(r);i.current=r;const[a]=(0,R.useState)(()=>new W(i)),c=(0,I.useSyncExternalStore)(a.subscribe,a.getEditor,a.getServerSnapshot);return(0,R.useDebugValue)(c),(0,R.useEffect)(a.onRender(o)),useEditorState({editor:c,selector:({transactionNumber:o})=>!1===r.shouldRerenderOnTransaction||void 0===r.shouldRerenderOnTransaction?null:r.immediatelyRender&&0===o?0:o+1}),c}var K=i(74848),G=(0,E.createContext)({editor:null}),J=G.Consumer,useCurrentEditor=()=>(0,E.useContext)(G);function EditorProvider({children:r,slotAfter:o,slotBefore:i,editorContainerProps:a={},...c}){const u=useEditor(c),p=(0,E.useMemo)(()=>({editor:u}),[u]);return u?(0,K.jsxs)(G.Provider,{value:p,children:[i,(0,K.jsx)(J,{children:({editor:r})=>(0,K.jsx)(A,{editor:r,...a})}),r,o]}):null}var Y=i(97557),X=(0,Y.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),ReactNodeViewContentProvider=({children:r,content:o})=>(0,Y.createElement)(X.Provider,{value:{nodeViewContentChildren:o}},r),useReactNodeView=()=>(0,Y.useContext)(X),Q=i(74848);function NodeViewContent({as:r="div",...o}){const{nodeViewContentRef:i,nodeViewContentChildren:a}=useReactNodeView();return(0,Q.jsx)(r,{...o,ref:i,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...o.style},children:a})}var Z=__toESM(i(97557),1),ee=i(74848),te=Z.default.forwardRef((r,o)=>{const{onDragStart:i}=useReactNodeView(),a=r.as||"div";return(0,ee.jsx)(a,{...r,ref:o,"data-node-view-wrapper":"",onDragStart:i,style:{whiteSpace:"normal",...r.style}})}),ne=i(99248),re=__toESM(i(97557),1),oe=i(97557),ie=i(43617),ae=i(74848);function isClassComponent(r){return!("function"!=typeof r||!r.prototype||!r.prototype.isReactComponent)}function isForwardRefComponent(r){return!("object"!=typeof r||!r.$$typeof||"Symbol(react.forward_ref)"!==r.$$typeof.toString()&&"react.forward_ref"!==r.$$typeof.description)}var se=class{constructor(r,{editor:o,props:i={},as:a="div",className:c=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=r,this.editor=o,this.props=i,this.element=document.createElement(a),this.element.classList.add("react-renderer"),c&&this.element.classList.add(...c.split(" ")),this.editor.isInitialized?(0,ie.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var r;if(this.destroyed)return;const o=this.component,i=this.props,a=this.editor,c=function isReact19Plus(){try{if(oe.version)return parseInt(oe.version.split(".")[0],10)>=19}catch{}return!1}(),u=function canReceiveRef(r){if(isClassComponent(r))return!0;if(isForwardRefComponent(r))return!0;if(function isMemoComponent(r){return!("object"!=typeof r||!r.$$typeof||"Symbol(react.memo)"!==r.$$typeof.toString()&&"react.memo"!==r.$$typeof.description)}(r)){const o=r.type;if(o)return isClassComponent(o)||isForwardRefComponent(o)}return!1}(o),p={...i};!p.ref||c||u||delete p.ref,p.ref||!c&&!u||(p.ref=r=>{this.ref=r}),this.reactElement=(0,ae.jsx)(o,{...p}),null==(r=null==a?void 0:a.contentComponent)||r.setRenderer(this.id,this)}updateProps(r={}){this.destroyed||(this.props={...this.props,...r},this.render())}destroy(){var r;this.destroyed=!0;const o=this.editor;null==(r=null==o?void 0:o.contentComponent)||r.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(r){Object.keys(r).forEach(o=>{this.element.setAttribute(o,r[o])})}},le=i(74848),ce=re.default.createContext({markViewContentRef:()=>{}}),MarkViewContent=r=>{const{as:o="span",...i}=r,{markViewContentRef:a}=re.default.useContext(ce);return(0,le.jsx)(o,{...i,ref:a,"data-mark-view-content":""})},ue=class extends ne.MarkView{constructor(r,o,i){super(r,o,i);const{as:a="span",attrs:c,className:u=""}=i||{},p={...o,updateAttributes:this.updateAttributes.bind(this)};this.contentDOMElement=document.createElement("span");const g={markViewContentRef:r=>{r&&!r.contains(this.contentDOMElement)&&r.appendChild(this.contentDOMElement)}},v=re.default.memo(o=>(0,le.jsx)(ce.Provider,{value:g,children:re.default.createElement(r,o)}));v.displayName="ReactMarkView",this.renderer=new se(v,{editor:o.editor,props:p,as:a,className:`mark-${o.mark.type.name} ${u}`.trim()}),c&&this.renderer.updateAttributes(c)}get dom(){return this.renderer.element}get contentDOM(){return this.contentDOMElement}};function ReactMarkViewRenderer(r,o={}){return i=>new ue(r,i,o)}var pe=i(99248),de=i(97557),fe=i(74848),he=class extends pe.NodeView{constructor(r,o,i){if(super(r,o,i),this.selectionRafId=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const r=this.editor,o=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(o,{get(i,a,c){var u;return"storage"===a?null!=(u=r.storage[o.name])?u:{}:Reflect.get(i,a,c)}})}return this.cachedExtensionWithSyncedStorage}mount(){const r={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(r={})=>this.updateAttributes(r),deleteNode:()=>this.deleteNode(),ref:(0,de.createRef)()};if(!this.component.displayName){const capitalizeFirstChar=r=>r.charAt(0).toUpperCase()+r.substring(1);this.component.displayName=capitalizeFirstChar(this.extension.name)}const o={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:r=>{r&&this.contentDOMElement&&r.firstChild!==this.contentDOMElement&&(r.hasAttribute("data-node-view-wrapper")&&r.removeAttribute("data-node-view-wrapper"),r.appendChild(this.contentDOMElement))}},i=this.component,a=(0,de.memo)(r=>(0,fe.jsx)(X.Provider,{value:o,children:(0,de.createElement)(i,r)}));a.displayName="ReactNodeView";let c=this.node.isInline?"span":"div";this.options.as&&(c=this.options.as);const{className:u=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new se(a,{editor:this.editor,props:r,as:c,className:`node-${this.node.type.name} ${u}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var r;if(this.renderer.element.firstElementChild&&!(null==(r=this.renderer.element.firstElementChild)?void 0:r.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:r,to:o}=this.editor.state.selection,i=this.getPos();if("number"==typeof i)if(r<=i&&o>=i+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(r,o,i){const rerenderComponent=r=>{this.renderer.updateProps(r),"function"==typeof this.options.attrs&&this.updateElementAttributes()};if(r.type!==this.node.type)return!1;if("function"==typeof this.options.update){const a=this.node,c=this.decorations,u=this.innerDecorations;return this.node=r,this.decorations=o,this.innerDecorations=i,this.options.update({oldNode:a,oldDecorations:c,newNode:r,newDecorations:o,oldInnerDecorations:u,innerDecorations:i,updateProps:()=>rerenderComponent({node:r,decorations:o,innerDecorations:i,extension:this.extensionWithSyncedStorage})})}return r===this.node&&this.decorations===o&&this.innerDecorations===i||(this.node=r,this.decorations=o,this.innerDecorations=i,rerenderComponent({node:r,decorations:o,innerDecorations:i,extension:this.extensionWithSyncedStorage})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let r={};if("function"==typeof this.options.attrs){const o=this.editor.extensionManager.attributes,i=(0,pe.getRenderedAttributes)(this.node,o);r=this.options.attrs({node:this.node,HTMLAttributes:i})}else r=this.options.attrs;this.renderer.updateAttributes(r)}}};function ReactNodeViewRenderer(r,o){return i=>i.editor.contentComponent?new he(r,i,o):{}}var me=i(97557),ge=i(74848),ve=(0,me.createContext)({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});ve.displayName="TiptapContext";var useTiptap=()=>(0,me.useContext)(ve);function useTiptapState(r,o){const{editor:i}=useTiptap();return useEditorState({editor:i,selector:r,equalityFn:o})}function TiptapWrapper({editor:r,instance:o,children:i}){const a=null!=r?r:o;if(!a)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const c=(0,me.useMemo)(()=>({editor:a}),[a]),u=(0,me.useMemo)(()=>({editor:a}),[a]);return(0,ge.jsx)(G.Provider,{value:u,children:(0,ge.jsx)(ve.Provider,{value:c,children:i})})}function TiptapContent({...r}){const{editor:o}=useTiptap();return(0,ge.jsx)(A,{editor:o,...r})}TiptapWrapper.displayName="Tiptap",TiptapContent.displayName="Tiptap.Content";var ye=Object.assign(TiptapWrapper,{Content:TiptapContent});((r,o,i)=>{__copyProps(r,o,"default"),i&&__copyProps(i,o,"default")})(k,i(99248),r.exports)},84792:function(r){"use strict";r.exports=window.elementorV2.wpMedia},87627:function(r){"use strict";r.exports=window.elementorV2.locations},88136:function(r,o,i){"use strict";var a=i(76237),c=i(37820),u="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),p="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function normalizeKeyName(r){var o,i,a,c,p=r.split(/-(?!$)/),g=p[p.length-1];"Space"==g&&(g=" ");for(var v=0;v<p.length-1;v++){var b=p[v];if(/^(cmd|meta|m)$/i.test(b))c=!0;else if(/^a(lt)?$/i.test(b))o=!0;else if(/^(c|ctrl|control)$/i.test(b))i=!0;else if(/^s(hift)?$/i.test(b))a=!0;else{if(!/^mod$/i.test(b))throw new Error("Unrecognized modifier name: "+b);u?c=!0:i=!0}}return o&&(g="Alt-"+g),i&&(g="Ctrl-"+g),c&&(g="Meta-"+g),a&&(g="Shift-"+g),g}function modifiers(r,o){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return o.altKey&&(r="Alt-"+r),o.ctrlKey&&(r="Ctrl-"+r),o.metaKey&&(r="Meta-"+r),i&&o.shiftKey&&(r="Shift-"+r),r}function keydownHandler(r){var o=function normalize(r){var o=Object.create(null);for(var i in r)o[normalizeKeyName(i)]=r[i];return o}(r);return function(r,i){var c,u=a.keyName(i),g=o[modifiers(u,i)];if(g&&g(r.state,r.dispatch,r))return!0;if(1==u.length&&" "!=u){if(i.shiftKey){var v=o[modifiers(u,i,!1)];if(v&&v(r.state,r.dispatch,r))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(p&&i.ctrlKey&&i.altKey)&&(c=a.base[i.keyCode])&&c!=u){var b=o[modifiers(c,i)];if(b&&b(r.state,r.dispatch,r))return!0}}return!1}}o.keydownHandler=keydownHandler,o.keymap=function keymap(r){return new c.Plugin({props:{handleKeyDown:keydownHandler(r)}})}},90990:function(r,o,i){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),function _createStarExport(r){Object.keys(r).filter(r=>"default"!==r&&"__esModule"!==r).forEach(i=>{o.hasOwnProperty(i)||Object.defineProperty(o,i,{enumerable:!0,configurable:!0,get:()=>r[i]})})}(i(49454))},97557:function(r){"use strict";r.exports=window.React},99248:function(r,o,i){"use strict";var a,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,__export=(r,o)=>{for(var i in o)c(r,i,{get:o[i],enumerable:!0})},v={};function createChainableState(r){const{state:o,transaction:i}=r;let{selection:a}=i,{doc:c}=i,{storedMarks:u}=i;return{...o,apply:o.apply.bind(o),applyTransaction:o.applyTransaction.bind(o),plugins:o.plugins,schema:o.schema,reconfigure:o.reconfigure.bind(o),toJSON:o.toJSON.bind(o),get storedMarks(){return u},get selection(){return a},get doc(){return c},get tr(){return a=i.selection,c=i.doc,u=i.storedMarks,i}}}__export(v,{CommandManager:()=>b,Editor:()=>it,Extendable:()=>Oe,Extension:()=>Fe,Fragment:()=>Fragment6,InputRule:()=>Te,MappablePosition:()=>le,Mark:()=>Pe,MarkView:()=>pt,Node:()=>dt,NodePos:()=>ot,NodeView:()=>ht,PasteRule:()=>Ne,ResizableNodeView:()=>st,ResizableNodeview:()=>lt,Tracker:()=>mt,callOrReturn:()=>callOrReturn,canInsertNode:()=>canInsertNode,combineTransactionSteps:()=>combineTransactionSteps,commands:()=>k,createAtomBlockMarkdownSpec:()=>createAtomBlockMarkdownSpec,createBlockMarkdownSpec:()=>createBlockMarkdownSpec,createChainableState:()=>createChainableState,createDocument:()=>createDocument,createElement:()=>h,createInlineMarkdownSpec:()=>createInlineMarkdownSpec,createMappablePosition:()=>createMappablePosition,createNodeFromContent:()=>createNodeFromContent,createStyleTag:()=>createStyleTag,defaultBlockAt:()=>defaultBlockAt,deleteProps:()=>deleteProps,elementFromString:()=>elementFromString,escapeForRegEx:()=>escapeForRegEx,extensions:()=>De,findChildren:()=>findChildren,findChildrenInRange:()=>findChildrenInRange,findDuplicates:()=>findDuplicates,findParentNode:()=>findParentNode,findParentNodeClosestToPos:()=>findParentNodeClosestToPos,flattenExtensions:()=>flattenExtensions,fromString:()=>fromString,generateHTML:()=>generateHTML,generateJSON:()=>generateJSON,generateText:()=>generateText,getAttributes:()=>getAttributes,getAttributesFromExtensions:()=>getAttributesFromExtensions,getChangedRanges:()=>getChangedRanges,getDebugJSON:()=>getDebugJSON,getExtensionField:()=>getExtensionField,getHTMLFromFragment:()=>getHTMLFromFragment,getMarkAttributes:()=>getMarkAttributes,getMarkRange:()=>getMarkRange,getMarkType:()=>getMarkType,getMarksBetween:()=>getMarksBetween,getNodeAtPosition:()=>getNodeAtPosition,getNodeAttributes:()=>getNodeAttributes,getNodeType:()=>getNodeType,getRenderedAttributes:()=>getRenderedAttributes,getSchema:()=>getSchema,getSchemaByResolvedExtensions:()=>getSchemaByResolvedExtensions,getSchemaTypeByName:()=>getSchemaTypeByName,getSchemaTypeNameByName:()=>getSchemaTypeNameByName,getSplittedAttributes:()=>getSplittedAttributes,getText:()=>getText,getTextBetween:()=>getTextBetween,getTextContentFromNodes:()=>getTextContentFromNodes,getTextSerializersFromSchema:()=>getTextSerializersFromSchema,getUpdatedPosition:()=>getUpdatedPosition,h:()=>h,injectExtensionAttributesToParseRule:()=>injectExtensionAttributesToParseRule,inputRulesPlugin:()=>inputRulesPlugin,isActive:()=>isActive,isAndroid:()=>isAndroid,isAtEndOfNode:()=>isAtEndOfNode,isAtStartOfNode:()=>isAtStartOfNode,isEmptyObject:()=>isEmptyObject,isExtensionRulesEnabled:()=>isExtensionRulesEnabled,isFirefox:()=>isFirefox,isFunction:()=>isFunction,isList:()=>isList,isMacOS:()=>isMacOS,isMarkActive:()=>isMarkActive,isNodeActive:()=>isNodeActive,isNodeEmpty:()=>isNodeEmpty,isNodeSelection:()=>isNodeSelection,isNumber:()=>isNumber,isPlainObject:()=>isPlainObject,isRegExp:()=>isRegExp,isSafari:()=>isSafari,isString:()=>isString,isTextSelection:()=>isTextSelection,isiOS:()=>isiOS,markInputRule:()=>markInputRule,markPasteRule:()=>markPasteRule,markdown:()=>ut,mergeAttributes:()=>mergeAttributes,mergeDeep:()=>mergeDeep,minMax:()=>minMax,nodeInputRule:()=>nodeInputRule,nodePasteRule:()=>nodePasteRule,objectIncludes:()=>objectIncludes,parseAttributes:()=>parseAttributes,parseIndentedBlocks:()=>parseIndentedBlocks,pasteRulesPlugin:()=>pasteRulesPlugin,posToDOMRect:()=>posToDOMRect,removeDuplicates:()=>removeDuplicates,renderNestedMarkdownContent:()=>renderNestedMarkdownContent,resolveExtensions:()=>resolveExtensions,resolveFocusPosition:()=>resolveFocusPosition,rewriteUnknownContent:()=>rewriteUnknownContent,selectionToInsertionEnd:()=>selectionToInsertionEnd,serializeAttributes:()=>serializeAttributes,sortExtensions:()=>sortExtensions,splitExtensions:()=>splitExtensions,textInputRule:()=>textInputRule,textPasteRule:()=>textPasteRule,textblockTypeInputRule:()=>textblockTypeInputRule,updateMarkViewAttributes:()=>updateMarkViewAttributes,wrappingInputRule:()=>wrappingInputRule}),r.exports=(a=v,((r,o,i,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let v of p(o))g.call(r,v)||v===i||c(r,v,{get:()=>o[v],enumerable:!(a=u(o,v))||a.enumerable});return r})(c({},"__esModule",{value:!0}),a));var b=class{constructor(r){this.editor=r.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=r.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:r,editor:o,state:i}=this,{view:a}=o,{tr:c}=i,u=this.buildProps(c);return Object.fromEntries(Object.entries(r).map(([r,o])=>[r,(...r)=>{const i=o(...r)(u);return c.getMeta("preventDispatch")||this.hasCustomState||a.dispatch(c),i}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(r,o=!0){const{rawCommands:i,editor:a,state:c}=this,{view:u}=a,p=[],g=!!r,v=r||c.tr,b={...Object.fromEntries(Object.entries(i).map(([r,i])=>[r,(...r)=>{const a=this.buildProps(v,o),c=i(...r)(a);return p.push(c),b}])),run:()=>(g||!o||v.getMeta("preventDispatch")||this.hasCustomState||u.dispatch(v),p.every(r=>!0===r))};return b}createCan(r){const{rawCommands:o,state:i}=this,a=!1,c=r||i.tr,u=this.buildProps(c,a);return{...Object.fromEntries(Object.entries(o).map(([r,o])=>[r,(...r)=>o(...r)({...u,dispatch:void 0})])),chain:()=>this.createChain(c,a)}}buildProps(r,o=!0){const{rawCommands:i,editor:a,state:c}=this,{view:u}=a,p={tr:r,editor:a,view:u,state:createChainableState({state:c,transaction:r}),dispatch:o?()=>{}:void 0,chain:()=>this.createChain(r,o),can:()=>this.createCan(r),get commands(){return Object.fromEntries(Object.entries(i).map(([r,o])=>[r,(...r)=>o(...r)(p)]))}};return p}},k={};__export(k,{blur:()=>blur,clearContent:()=>clearContent,clearNodes:()=>clearNodes,command:()=>command,createParagraphNear:()=>createParagraphNear,cut:()=>cut,deleteCurrentNode:()=>deleteCurrentNode,deleteNode:()=>deleteNode,deleteRange:()=>deleteRange,deleteSelection:()=>deleteSelection,enter:()=>enter,exitCode:()=>exitCode,extendMarkRange:()=>extendMarkRange,first:()=>first,focus:()=>focus,forEach:()=>forEach,insertContent:()=>insertContent,insertContentAt:()=>insertContentAt,joinBackward:()=>joinBackward,joinDown:()=>joinDown,joinForward:()=>joinForward,joinItemBackward:()=>joinItemBackward,joinItemForward:()=>joinItemForward,joinTextblockBackward:()=>joinTextblockBackward,joinTextblockForward:()=>joinTextblockForward,joinUp:()=>joinUp,keyboardShortcut:()=>keyboardShortcut,lift:()=>lift,liftEmptyBlock:()=>liftEmptyBlock,liftListItem:()=>liftListItem,newlineInCode:()=>newlineInCode,resetAttributes:()=>resetAttributes,scrollIntoView:()=>scrollIntoView,selectAll:()=>selectAll,selectNodeBackward:()=>selectNodeBackward,selectNodeForward:()=>selectNodeForward,selectParentNode:()=>selectParentNode,selectTextblockEnd:()=>selectTextblockEnd,selectTextblockStart:()=>selectTextblockStart,setContent:()=>setContent,setMark:()=>setMark,setMeta:()=>setMeta,setNode:()=>setNode,setNodeSelection:()=>setNodeSelection,setTextDirection:()=>setTextDirection,setTextSelection:()=>setTextSelection,sinkListItem:()=>sinkListItem,splitBlock:()=>splitBlock,splitListItem:()=>splitListItem,toggleList:()=>toggleList,toggleMark:()=>toggleMark,toggleNode:()=>toggleNode,toggleWrap:()=>toggleWrap,undoInputRule:()=>undoInputRule,unsetAllMarks:()=>unsetAllMarks,unsetMark:()=>unsetMark,unsetTextDirection:()=>unsetTextDirection,updateAttributes:()=>updateAttributes,wrapIn:()=>wrapIn,wrapInList:()=>wrapInList});var blur=()=>({editor:r,view:o})=>(requestAnimationFrame(()=>{var i;r.isDestroyed||(o.dom.blur(),null==(i=null==window?void 0:window.getSelection())||i.removeAllRanges())}),!0),clearContent=(r=!0)=>({commands:o})=>o.setContent("",{emitUpdate:r}),E=i(26401),clearNodes=()=>({state:r,tr:o,dispatch:i})=>{const{selection:a}=o,{ranges:c}=a;return!i||(c.forEach(({$from:i,$to:a})=>{r.doc.nodesBetween(i.pos,a.pos,(r,i)=>{if(r.type.isText)return;const{doc:a,mapping:c}=o,u=a.resolve(c.map(i)),p=a.resolve(c.map(i+r.nodeSize)),g=u.blockRange(p);if(!g)return;const v=(0,E.liftTarget)(g);if(r.type.isTextblock){const{defaultType:r}=u.parent.contentMatchAt(u.index());o.setNodeMarkup(g.start,r)}(v||0===v)&&o.lift(g,v)})}),!0)},command=r=>o=>r(o),w=i(24007),createParagraphNear=()=>({state:r,dispatch:o})=>(0,w.createParagraphNear)(r,o),x=i(49162),cut=(r,o)=>({editor:i,tr:a})=>{const{state:c}=i,u=c.doc.slice(r.from,r.to);a.deleteRange(r.from,r.to);const p=a.mapping.map(o);return a.insert(p,u.content),a.setSelection(new x.TextSelection(a.doc.resolve(Math.max(p-1,0)))),!0},deleteCurrentNode=()=>({tr:r,dispatch:o})=>{const{selection:i}=r,a=i.$anchor.node();if(a.content.size>0)return!1;const c=r.selection.$anchor;for(let i=c.depth;i>0;i-=1){if(c.node(i).type===a.type){if(o){const o=c.before(i),a=c.after(i);r.delete(o,a).scrollIntoView()}return!0}}return!1};function getNodeType(r,o){if("string"==typeof r){if(!o.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return o.nodes[r]}return r}var deleteNode=r=>({tr:o,state:i,dispatch:a})=>{const c=getNodeType(r,i.schema),u=o.selection.$anchor;for(let r=u.depth;r>0;r-=1){if(u.node(r).type===c){if(a){const i=u.before(r),a=u.after(r);o.delete(i,a).scrollIntoView()}return!0}}return!1},deleteRange=r=>({tr:o,dispatch:i})=>{const{from:a,to:c}=r;return i&&o.delete(a,c),!0},C=i(24007),deleteSelection=()=>({state:r,dispatch:o})=>(0,C.deleteSelection)(r,o),enter=()=>({commands:r})=>r.keyboardShortcut("Enter"),_=i(24007),exitCode=()=>({state:r,dispatch:o})=>(0,_.exitCode)(r,o),T=i(49162);function isRegExp(r){return"[object RegExp]"===Object.prototype.toString.call(r)}function objectIncludes(r,o,i={strict:!0}){const a=Object.keys(o);return!a.length||a.every(a=>i.strict?o[a]===r[a]:isRegExp(o[a])?o[a].test(r[a]):o[a]===r[a])}function findMarkInSet(r,o,i={}){return r.find(r=>r.type===o&&objectIncludes(Object.fromEntries(Object.keys(i).map(o=>[o,r.attrs[o]])),i))}function isMarkInSet(r,o,i={}){return!!findMarkInSet(r,o,i)}function getMarkRange(r,o,i){var a;if(!r||!o)return;let c=r.parent.childAfter(r.parentOffset);if(c.node&&c.node.marks.some(r=>r.type===o)||(c=r.parent.childBefore(r.parentOffset)),!c.node||!c.node.marks.some(r=>r.type===o))return;i=i||(null==(a=c.node.marks[0])?void 0:a.attrs);if(!findMarkInSet([...c.node.marks],o,i))return;let u=c.index,p=r.start()+c.offset,g=u+1,v=p+c.node.nodeSize;for(;u>0&&isMarkInSet([...r.parent.child(u-1).marks],o,i);)u-=1,p-=r.parent.child(u).nodeSize;for(;g<r.parent.childCount&&isMarkInSet([...r.parent.child(g).marks],o,i);)v+=r.parent.child(g).nodeSize,g+=1;return{from:p,to:v}}function getMarkType(r,o){if("string"==typeof r){if(!o.marks[r])throw Error(`There is no mark type named '${r}'. Maybe you forgot to add the extension?`);return o.marks[r]}return r}var extendMarkRange=(r,o={})=>({tr:i,state:a,dispatch:c})=>{const u=getMarkType(r,a.schema),{doc:p,selection:g}=i,{$from:v,from:b,to:k}=g;if(c){const r=getMarkRange(v,u,o);if(r&&r.from<=b&&r.to>=k){const o=T.TextSelection.create(p,r.from,r.to);i.setSelection(o)}}return!0},first=r=>o=>{const i="function"==typeof r?r(o):r;for(let r=0;r<i.length;r+=1)if(i[r](o))return!0;return!1},P=i(49162);function isTextSelection(r){return r instanceof P.TextSelection}var A=i(49162);function minMax(r=0,o=0,i=0){return Math.min(Math.max(r,o),i)}function resolveFocusPosition(r,o=null){if(!o)return null;const i=A.Selection.atStart(r),a=A.Selection.atEnd(r);if("start"===o||!0===o)return i;if("end"===o)return a;const c=i.from,u=a.to;return"all"===o?A.TextSelection.create(r,minMax(0,c,u),minMax(r.content.size,c,u)):A.TextSelection.create(r,minMax(o,c,u),minMax(o,c,u))}function isAndroid(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function isiOS(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function isSafari(){return"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var focus=(r=null,o={})=>({editor:i,view:a,tr:c,dispatch:u})=>{o={scrollIntoView:!0,...o};const delayedFocus=()=>{(isiOS()||isAndroid())&&a.dom.focus(),!isSafari()||isiOS()||isAndroid()||a.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{i.isDestroyed||(a.focus(),(null==o?void 0:o.scrollIntoView)&&i.commands.scrollIntoView())})};try{if(a.hasFocus()&&null===r||!1===r)return!0}catch{return!1}if(u&&null===r&&!isTextSelection(i.state.selection))return delayedFocus(),!0;const p=resolveFocusPosition(c.doc,r)||i.state.selection,g=i.state.selection.eq(p);return u&&(g||c.setSelection(p),g&&c.storedMarks&&c.setStoredMarks(c.storedMarks),delayedFocus()),!0},forEach=(r,o)=>i=>r.every((r,a)=>o(r,{...i,index:a})),insertContent=(r,o)=>({tr:i,commands:a})=>a.insertContentAt({from:i.selection.from,to:i.selection.to},r,o),N=i(32386),R=i(32386),removeWhitespaces=r=>{const o=r.childNodes;for(let i=o.length-1;i>=0;i-=1){const a=o[i];3===a.nodeType&&a.nodeValue&&/^(\n\s\s|\n)$/.test(a.nodeValue)?r.removeChild(a):1===a.nodeType&&removeWhitespaces(a)}return r};function elementFromString(r){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const o=`<body>${r}</body>`,i=(new window.DOMParser).parseFromString(o,"text/html").body;return removeWhitespaces(i)}function createNodeFromContent(r,o,i){if(r instanceof R.Node||r instanceof R.Fragment)return r;i={slice:!0,parseOptions:{},...i};const a="string"==typeof r;if("object"==typeof r&&null!==r)try{if(Array.isArray(r)&&r.length>0)return R.Fragment.fromArray(r.map(r=>o.nodeFromJSON(r)));const a=o.nodeFromJSON(r);return i.errorOnInvalidContent&&a.check(),a}catch(a){if(i.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",a),createNodeFromContent("",o,i)}if(a){if(i.errorOnInvalidContent){let a=!1,c="";const u=new R.Schema({topNode:o.spec.topNode,marks:o.spec.marks,nodes:o.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:r=>(a=!0,c="string"==typeof r?r:r.outerHTML,null)}]}})});if(i.slice?R.DOMParser.fromSchema(u).parseSlice(elementFromString(r),i.parseOptions):R.DOMParser.fromSchema(u).parse(elementFromString(r),i.parseOptions),i.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const a=R.DOMParser.fromSchema(o);return i.slice?a.parseSlice(elementFromString(r),i.parseOptions).content:a.parse(elementFromString(r),i.parseOptions)}return createNodeFromContent("",o,i)}var I=i(49162),L=i(26401);function selectionToInsertionEnd(r,o,i){const a=r.steps.length-1;if(a<o)return;const c=r.steps[a];if(!(c instanceof L.ReplaceStep||c instanceof L.ReplaceAroundStep))return;const u=r.mapping.maps[a];let p=0;u.forEach((r,o,i,a)=>{0===p&&(p=a)}),r.setSelection(I.Selection.near(r.doc.resolve(p),i))}var insertContentAt=(r,o,i)=>({tr:a,dispatch:c,editor:u})=>{var p;if(c){let c;const emitContentError=r=>{u.emit("contentError",{editor:u,error:r,disableCollaboration:()=>{"collaboration"in u.storage&&"object"==typeof u.storage.collaboration&&u.storage.collaboration&&(u.storage.collaboration.isDisabled=!0)}})},g={preserveWhitespace:"full",...(i={parseOptions:u.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...i}).parseOptions};if(!i.errorOnInvalidContent&&!u.options.enableContentCheck&&u.options.emitContentError)try{createNodeFromContent(o,u.schema,{parseOptions:g,errorOnInvalidContent:!0})}catch(r){emitContentError(r)}try{c=createNodeFromContent(o,u.schema,{parseOptions:g,errorOnInvalidContent:null!=(p=i.errorOnInvalidContent)?p:u.options.enableContentCheck})}catch(r){return emitContentError(r),!1}let{from:v,to:b}="number"==typeof r?{from:r,to:r}:{from:r.from,to:r.to},k=!0,E=!0;if(("type"in c?[c]:c).forEach(r=>{r.check(),k=!!k&&(r.isText&&0===r.marks.length),E=!!E&&r.isBlock}),v===b&&E){const{parent:r}=a.doc.resolve(v);r.isTextblock&&!r.type.spec.code&&!r.childCount&&(v-=1,b+=1)}let w;if(k){if(Array.isArray(o))w=o.map(r=>r.text||"").join("");else if(o instanceof N.Fragment){let r="";o.forEach(o=>{o.text&&(r+=o.text)}),w=r}else w="object"==typeof o&&o&&o.text?o.text:o;a.insertText(w,v,b)}else{w=c;const r=a.doc.resolve(v),o=r.node(),i=0===r.parentOffset,u=o.isText||o.isTextblock,p=o.content.size>0;i&&u&&p&&(v=Math.max(0,v-1)),a.replaceWith(v,b,w)}i.updateSelection&&selectionToInsertionEnd(a,a.steps.length-1,-1),i.applyInputRules&&a.setMeta("applyInputRules",{from:v,text:w}),i.applyPasteRules&&a.setMeta("applyPasteRules",{from:v,text:w})}return!0},z=i(24007),joinUp=()=>({state:r,dispatch:o})=>(0,z.joinUp)(r,o),joinDown=()=>({state:r,dispatch:o})=>(0,z.joinDown)(r,o),joinBackward=()=>({state:r,dispatch:o})=>(0,z.joinBackward)(r,o),joinForward=()=>({state:r,dispatch:o})=>(0,z.joinForward)(r,o),j=i(26401),joinItemBackward=()=>({state:r,dispatch:o,tr:i})=>{try{const a=(0,j.joinPoint)(r.doc,r.selection.$from.pos,-1);return null!=a&&(i.join(a,2),o&&o(i),!0)}catch{return!1}},B=i(26401),joinItemForward=()=>({state:r,dispatch:o,tr:i})=>{try{const a=(0,B.joinPoint)(r.doc,r.selection.$from.pos,1);return null!=a&&(i.join(a,2),o&&o(i),!0)}catch{return!1}},V=i(24007),joinTextblockBackward=()=>({state:r,dispatch:o})=>(0,V.joinTextblockBackward)(r,o),U=i(24007),joinTextblockForward=()=>({state:r,dispatch:o})=>(0,U.joinTextblockForward)(r,o);function isMacOS(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var keyboardShortcut=r=>({editor:o,view:i,tr:a,dispatch:c})=>{const u=function normalizeKeyName(r){const o=r.split(/-(?!$)/);let i,a,c,u,p=o[o.length-1];"Space"===p&&(p=" ");for(let r=0;r<o.length-1;r+=1){const p=o[r];if(/^(cmd|meta|m)$/i.test(p))u=!0;else if(/^a(lt)?$/i.test(p))i=!0;else if(/^(c|ctrl|control)$/i.test(p))a=!0;else if(/^s(hift)?$/i.test(p))c=!0;else{if(!/^mod$/i.test(p))throw new Error(`Unrecognized modifier name: ${p}`);isiOS()||isMacOS()?u=!0:a=!0}}return i&&(p=`Alt-${p}`),a&&(p=`Ctrl-${p}`),u&&(p=`Meta-${p}`),c&&(p=`Shift-${p}`),p}(r).split(/-(?!$)/),p=u.find(r=>!["Alt","Ctrl","Meta","Shift"].includes(r)),g=new KeyboardEvent("keydown",{key:"Space"===p?" ":p,altKey:u.includes("Alt"),ctrlKey:u.includes("Ctrl"),metaKey:u.includes("Meta"),shiftKey:u.includes("Shift"),bubbles:!0,cancelable:!0}),v=o.captureTransaction(()=>{i.someProp("handleKeyDown",r=>r(i,g))});return null==v||v.steps.forEach(r=>{const o=r.map(a.mapping);o&&c&&a.maybeStep(o)}),!0},H=i(24007);function isNodeActive(r,o,i={}){const{from:a,to:c,empty:u}=r.selection,p=o?getNodeType(o,r.schema):null,g=[];r.doc.nodesBetween(a,c,(r,o)=>{if(r.isText)return;const i=Math.max(a,o),u=Math.min(c,o+r.nodeSize);g.push({node:r,from:i,to:u})});const v=c-a,b=g.filter(r=>!p||p.name===r.node.type.name).filter(r=>objectIncludes(r.node.attrs,i,{strict:!1}));if(u)return!!b.length;return b.reduce((r,o)=>r+o.to-o.from,0)>=v}var lift=(r,o={})=>({state:i,dispatch:a})=>!!isNodeActive(i,getNodeType(r,i.schema),o)&&(0,H.lift)(i,a),W=i(24007),liftEmptyBlock=()=>({state:r,dispatch:o})=>(0,W.liftEmptyBlock)(r,o),K=i(35423),liftListItem=r=>({state:o,dispatch:i})=>{const a=getNodeType(r,o.schema);return(0,K.liftListItem)(a)(o,i)},G=i(24007),newlineInCode=()=>({state:r,dispatch:o})=>(0,G.newlineInCode)(r,o);function getSchemaTypeNameByName(r,o){return o.nodes[r]?"node":o.marks[r]?"mark":null}function deleteProps(r,o){const i="string"==typeof o?[o]:o;return Object.keys(r).reduce((o,a)=>(i.includes(a)||(o[a]=r[a]),o),{})}var resetAttributes=(r,o)=>({tr:i,state:a,dispatch:c})=>{let u=null,p=null;const g=getSchemaTypeNameByName("string"==typeof r?r:r.name,a.schema);if(!g)return!1;"node"===g&&(u=getNodeType(r,a.schema)),"mark"===g&&(p=getMarkType(r,a.schema));let v=!1;return i.selection.ranges.forEach(r=>{a.doc.nodesBetween(r.$from.pos,r.$to.pos,(r,a)=>{u&&u===r.type&&(v=!0,c&&i.setNodeMarkup(a,void 0,deleteProps(r.attrs,o))),p&&r.marks.length&&r.marks.forEach(u=>{p===u.type&&(v=!0,c&&i.addMark(a,a+r.nodeSize,p.create(deleteProps(u.attrs,o))))})})}),v},scrollIntoView=()=>({tr:r,dispatch:o})=>(o&&r.scrollIntoView(),!0),J=i(49162),selectAll=()=>({tr:r,dispatch:o})=>{if(o){const o=new J.AllSelection(r.doc);r.setSelection(o)}return!0},Y=i(24007),selectNodeBackward=()=>({state:r,dispatch:o})=>(0,Y.selectNodeBackward)(r,o),X=i(24007),selectNodeForward=()=>({state:r,dispatch:o})=>(0,X.selectNodeForward)(r,o),Q=i(24007),selectParentNode=()=>({state:r,dispatch:o})=>(0,Q.selectParentNode)(r,o),Z=i(24007),selectTextblockEnd=()=>({state:r,dispatch:o})=>(0,Z.selectTextblockEnd)(r,o),ee=i(24007),selectTextblockStart=()=>({state:r,dispatch:o})=>(0,ee.selectTextblockStart)(r,o);function createDocument(r,o,i={},a={}){return createNodeFromContent(r,o,{slice:!1,parseOptions:i,errorOnInvalidContent:a.errorOnInvalidContent})}var setContent=(r,{errorOnInvalidContent:o,emitUpdate:i=!0,parseOptions:a={}}={})=>({editor:c,tr:u,dispatch:p,commands:g})=>{const{doc:v}=u;if("full"!==a.preserveWhitespace){const g=createDocument(r,c.schema,a,{errorOnInvalidContent:null!=o?o:c.options.enableContentCheck});return p&&u.replaceWith(0,v.content.size,g).setMeta("preventUpdate",!i),!0}return p&&u.setMeta("preventUpdate",!i),g.insertContentAt({from:0,to:v.content.size},r,{parseOptions:a,errorOnInvalidContent:null!=o?o:c.options.enableContentCheck})};function getMarkAttributes(r,o){const i=getMarkType(o,r.schema),{from:a,to:c,empty:u}=r.selection,p=[];u?(r.storedMarks&&p.push(...r.storedMarks),p.push(...r.selection.$head.marks())):r.doc.nodesBetween(a,c,r=>{p.push(...r.marks)});const g=p.find(r=>r.type.name===i.name);return g?{...g.attrs}:{}}var te=i(26401);function combineTransactionSteps(r,o){const i=new te.Transform(r);return o.forEach(r=>{r.steps.forEach(r=>{i.step(r)})}),i}function defaultBlockAt(r){for(let o=0;o<r.edgeCount;o+=1){const{type:i}=r.edge(o);if(i.isTextblock&&!i.hasRequiredAttrs())return i}return null}function findChildren(r,o){const i=[];return r.descendants((r,a)=>{o(r)&&i.push({node:r,pos:a})}),i}function findChildrenInRange(r,o,i){const a=[];return r.nodesBetween(o.from,o.to,(r,o)=>{i(r)&&a.push({node:r,pos:o})}),a}function findParentNodeClosestToPos(r,o){for(let i=r.depth;i>0;i-=1){const a=r.node(i);if(o(a))return{pos:i>0?r.before(i):0,start:r.start(i),depth:i,node:a}}}function findParentNode(r){return o=>findParentNodeClosestToPos(o.$from,r)}function getExtensionField(r,o,i){if(void 0===r.config[o]&&r.parent)return getExtensionField(r.parent,o,i);if("function"==typeof r.config[o]){return r.config[o].bind({...i,parent:r.parent?getExtensionField(r.parent,o,i):null})}return r.config[o]}function flattenExtensions(r){return r.map(r=>{const o=getExtensionField(r,"addExtensions",{name:r.name,options:r.options,storage:r.storage});return o?[r,...flattenExtensions(o())]:r}).flat(10)}var ne=i(32386),re=i(32386);function getHTMLFromFragment(r,o){const i=re.DOMSerializer.fromSchema(o).serializeFragment(r),a=document.implementation.createHTMLDocument().createElement("div");return a.appendChild(i),a.innerHTML}var oe=i(32386);function isFunction(r){return"function"==typeof r}function callOrReturn(r,o=void 0,...i){return isFunction(r)?o?r.bind(o)(...i):r(...i):r}function isEmptyObject(r={}){return 0===Object.keys(r).length&&r.constructor===Object}function splitExtensions(r){return{baseExtensions:r.filter(r=>"extension"===r.type),nodeExtensions:r.filter(r=>"node"===r.type),markExtensions:r.filter(r=>"mark"===r.type)}}function getAttributesFromExtensions(r){const o=[],{nodeExtensions:i,markExtensions:a}=splitExtensions(r),c=[...i,...a],u={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},p=i.filter(r=>"text"!==r.name).map(r=>r.name),g=a.map(r=>r.name),v=[...p,...g];return r.forEach(r=>{const i=getExtensionField(r,"addGlobalAttributes",{name:r.name,options:r.options,storage:r.storage,extensions:c});if(!i)return;i().forEach(r=>{let i;i=Array.isArray(r.types)?r.types:"*"===r.types?v:"nodes"===r.types?p:"marks"===r.types?g:[],i.forEach(i=>{Object.entries(r.attributes).forEach(([r,a])=>{o.push({type:i,name:r,attribute:{...u,...a}})})})})}),c.forEach(r=>{const i={name:r.name,options:r.options,storage:r.storage},a=getExtensionField(r,"addAttributes",i);if(!a)return;const c=a();Object.entries(c).forEach(([i,a])=>{const c={...u,...a};"function"==typeof(null==c?void 0:c.default)&&(c.default=c.default()),(null==c?void 0:c.isRequired)&&void 0===(null==c?void 0:c.default)&&delete c.default,o.push({type:r.name,name:i,attribute:c})})}),o}function mergeAttributes(...r){return r.filter(r=>!!r).reduce((r,o)=>{const i={...r};return Object.entries(o).forEach(([r,o])=>{if(i[r])if("class"===r){const a=o?String(o).split(" "):[],c=i[r]?i[r].split(" "):[],u=a.filter(r=>!c.includes(r));i[r]=[...c,...u].join(" ")}else if("style"===r){const a=o?o.split(";").map(r=>r.trim()).filter(Boolean):[],c=i[r]?i[r].split(";").map(r=>r.trim()).filter(Boolean):[],u=new Map;c.forEach(r=>{const[o,i]=r.split(":").map(r=>r.trim());u.set(o,i)}),a.forEach(r=>{const[o,i]=r.split(":").map(r=>r.trim());u.set(o,i)}),i[r]=Array.from(u.entries()).map(([r,o])=>`${r}: ${o}`).join("; ")}else i[r]=o;else i[r]=o}),i},{})}function getRenderedAttributes(r,o){return o.filter(o=>o.type===r.type.name).filter(r=>r.attribute.rendered).map(o=>o.attribute.renderHTML?o.attribute.renderHTML(r.attrs)||{}:{[o.name]:r.attrs[o.name]}).reduce((r,o)=>mergeAttributes(r,o),{})}function fromString(r){return"string"!=typeof r?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r}function injectExtensionAttributesToParseRule(r,o){return"style"in r?r:{...r,getAttrs:i=>{const a=r.getAttrs?r.getAttrs(i):r.attrs;if(!1===a)return!1;const c=o.reduce((r,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(i):fromString(i.getAttribute(o.name));return null==a?r:{...r,[o.name]:a}},{});return{...a,...c}}}}function cleanUpSchemaItem(r){return Object.fromEntries(Object.entries(r).filter(([r,o])=>("attrs"!==r||!isEmptyObject(o))&&null!=o))}function buildAttributeSpec(r){var o,i;const a={};return!(null==(o=null==r?void 0:r.attribute)?void 0:o.isRequired)&&"default"in((null==r?void 0:r.attribute)||{})&&(a.default=r.attribute.default),void 0!==(null==(i=null==r?void 0:r.attribute)?void 0:i.validate)&&(a.validate=r.attribute.validate),[r.name,a]}function getSchemaByResolvedExtensions(r,o){var i;const a=getAttributesFromExtensions(r),{nodeExtensions:c,markExtensions:u}=splitExtensions(r),p=null==(i=c.find(r=>getExtensionField(r,"topNode")))?void 0:i.name,g=Object.fromEntries(c.map(i=>{const c=a.filter(r=>r.type===i.name),u={name:i.name,options:i.options,storage:i.storage,editor:o},p=cleanUpSchemaItem({...r.reduce((r,o)=>{const a=getExtensionField(o,"extendNodeSchema",u);return{...r,...a?a(i):{}}},{}),content:callOrReturn(getExtensionField(i,"content",u)),marks:callOrReturn(getExtensionField(i,"marks",u)),group:callOrReturn(getExtensionField(i,"group",u)),inline:callOrReturn(getExtensionField(i,"inline",u)),atom:callOrReturn(getExtensionField(i,"atom",u)),selectable:callOrReturn(getExtensionField(i,"selectable",u)),draggable:callOrReturn(getExtensionField(i,"draggable",u)),code:callOrReturn(getExtensionField(i,"code",u)),whitespace:callOrReturn(getExtensionField(i,"whitespace",u)),linebreakReplacement:callOrReturn(getExtensionField(i,"linebreakReplacement",u)),defining:callOrReturn(getExtensionField(i,"defining",u)),isolating:callOrReturn(getExtensionField(i,"isolating",u)),attrs:Object.fromEntries(c.map(buildAttributeSpec))}),g=callOrReturn(getExtensionField(i,"parseHTML",u));g&&(p.parseDOM=g.map(r=>injectExtensionAttributesToParseRule(r,c)));const v=getExtensionField(i,"renderHTML",u);v&&(p.toDOM=r=>v({node:r,HTMLAttributes:getRenderedAttributes(r,c)}));const b=getExtensionField(i,"renderText",u);return b&&(p.toText=b),[i.name,p]})),v=Object.fromEntries(u.map(i=>{const c=a.filter(r=>r.type===i.name),u={name:i.name,options:i.options,storage:i.storage,editor:o},p=cleanUpSchemaItem({...r.reduce((r,o)=>{const a=getExtensionField(o,"extendMarkSchema",u);return{...r,...a?a(i):{}}},{}),inclusive:callOrReturn(getExtensionField(i,"inclusive",u)),excludes:callOrReturn(getExtensionField(i,"excludes",u)),group:callOrReturn(getExtensionField(i,"group",u)),spanning:callOrReturn(getExtensionField(i,"spanning",u)),code:callOrReturn(getExtensionField(i,"code",u)),attrs:Object.fromEntries(c.map(buildAttributeSpec))}),g=callOrReturn(getExtensionField(i,"parseHTML",u));g&&(p.parseDOM=g.map(r=>injectExtensionAttributesToParseRule(r,c)));const v=getExtensionField(i,"renderHTML",u);return v&&(p.toDOM=r=>v({mark:r,HTMLAttributes:getRenderedAttributes(r,c)})),[i.name,p]}));return new oe.Schema({topNode:p,nodes:g,marks:v})}function findDuplicates(r){const o=r.filter((o,i)=>r.indexOf(o)!==i);return Array.from(new Set(o))}function sortExtensions(r){return r.sort((r,o)=>{const i=getExtensionField(r,"priority")||100,a=getExtensionField(o,"priority")||100;return i>a?-1:i<a?1:0})}function resolveExtensions(r){const o=sortExtensions(flattenExtensions(r)),i=findDuplicates(o.map(r=>r.name));return i.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${i.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),o}function getSchema(r,o){return getSchemaByResolvedExtensions(resolveExtensions(r),o)}function generateHTML(r,o){const i=getSchema(o);return getHTMLFromFragment(ne.Node.fromJSON(i,r).content,i)}var ie=i(32386);function generateJSON(r,o){const i=getSchema(o),a=elementFromString(r);return ie.DOMParser.fromSchema(i).parse(a).toJSON()}var ae=i(32386);function getTextBetween(r,o,i){const{from:a,to:c}=o,{blockSeparator:u="\n\n",textSerializers:p={}}=i||{};let g="";return r.nodesBetween(a,c,(r,i,v,b)=>{var k;r.isBlock&&i>a&&(g+=u);const E=null==p?void 0:p[r.type.name];if(E)return v&&(g+=E({node:r,pos:i,parent:v,index:b,range:o})),!1;r.isText&&(g+=null==(k=null==r?void 0:r.text)?void 0:k.slice(Math.max(a,i)-i,c-i))}),g}function getText(r,o){return getTextBetween(r,{from:0,to:r.content.size},o)}function getTextSerializersFromSchema(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,r])=>r.spec.toText).map(([r,o])=>[r,o.spec.toText]))}function generateText(r,o,i){const{blockSeparator:a="\n\n",textSerializers:c={}}=i||{},u=getSchema(o);return getText(ae.Node.fromJSON(u,r),{blockSeparator:a,textSerializers:{...getTextSerializersFromSchema(u),...c}})}function getNodeAttributes(r,o){const i=getNodeType(o,r.schema),{from:a,to:c}=r.selection,u=[];r.doc.nodesBetween(a,c,r=>{u.push(r)});const p=u.reverse().find(r=>r.type.name===i.name);return p?{...p.attrs}:{}}function getAttributes(r,o){const i=getSchemaTypeNameByName("string"==typeof o?o:o.name,r.schema);return"node"===i?getNodeAttributes(r,o):"mark"===i?getMarkAttributes(r,o):{}}function removeDuplicates(r,o=JSON.stringify){const i={};return r.filter(r=>{const a=o(r);return!Object.prototype.hasOwnProperty.call(i,a)&&(i[a]=!0)})}function getChangedRanges(r){const{mapping:o,steps:i}=r,a=[];return o.maps.forEach((r,c)=>{const u=[];if(r.ranges.length)r.forEach((r,o)=>{u.push({from:r,to:o})});else{const{from:r,to:o}=i[c];if(void 0===r||void 0===o)return;u.push({from:r,to:o})}u.forEach(({from:r,to:i})=>{const u=o.slice(c).map(r,-1),p=o.slice(c).map(i),g=o.invert().map(u,-1),v=o.invert().map(p);a.push({oldRange:{from:g,to:v},newRange:{from:u,to:p}})})}),function simplifyChangedRanges(r){const o=removeDuplicates(r);return 1===o.length?o:o.filter((r,i)=>!o.filter((r,o)=>o!==i).some(o=>r.oldRange.from>=o.oldRange.from&&r.oldRange.to<=o.oldRange.to&&r.newRange.from>=o.newRange.from&&r.newRange.to<=o.newRange.to))}(a)}function getDebugJSON(r,o=0){const i=r.type===r.type.schema.topNodeType?0:1,a=o,c=a+r.nodeSize,u=r.marks.map(r=>{const o={type:r.type.name};return Object.keys(r.attrs).length&&(o.attrs={...r.attrs}),o}),p={...r.attrs},g={type:r.type.name,from:a,to:c};return Object.keys(p).length&&(g.attrs=p),u.length&&(g.marks=u),r.content.childCount&&(g.content=[],r.forEach((r,a)=>{var c;null==(c=g.content)||c.push(getDebugJSON(r,o+a+i))})),r.text&&(g.text=r.text),g}function getMarksBetween(r,o,i){const a=[];return r===o?i.resolve(r).marks().forEach(o=>{const c=getMarkRange(i.resolve(r),o.type);c&&a.push({mark:o,...c})}):i.nodesBetween(r,o,(r,o)=>{r&&void 0!==(null==r?void 0:r.nodeSize)&&a.push(...r.marks.map(i=>({from:o,to:o+r.nodeSize,mark:i})))}),a}var getNodeAtPosition=(r,o,i,a=20)=>{const c=r.doc.resolve(i);let u=a,p=null;for(;u>0&&null===p;){const r=c.node(u);(null==r?void 0:r.type.name)===o?p=r:u-=1}return[p,u]};function getSchemaTypeByName(r,o){return o.nodes[r]||o.marks[r]||null}function getSplittedAttributes(r,o,i){return Object.fromEntries(Object.entries(i).filter(([i])=>{const a=r.find(r=>r.type===o&&r.name===i);return!!a&&a.attribute.keepOnSplit}))}var getTextContentFromNodes=(r,o=500)=>{let i="";const a=r.parentOffset;return r.parent.nodesBetween(Math.max(0,a-o),a,(r,o,c,u)=>{var p,g;const v=(null==(g=(p=r.type.spec).toText)?void 0:g.call(p,{node:r,pos:o,parent:c,index:u}))||r.textContent||"%leaf%";i+=r.isAtom&&!r.isText?v:v.slice(0,Math.max(0,a-o))}),i};function isMarkActive(r,o,i={}){const{empty:a,ranges:c}=r.selection,u=o?getMarkType(o,r.schema):null;if(a)return!!(r.storedMarks||r.selection.$from.marks()).filter(r=>!u||u.name===r.type.name).find(r=>objectIncludes(r.attrs,i,{strict:!1}));let p=0;const g=[];if(c.forEach(({$from:o,$to:i})=>{const a=o.pos,c=i.pos;r.doc.nodesBetween(a,c,(r,o)=>{if(u&&r.inlineContent&&!r.type.allowsMarkType(u))return!1;if(!r.isText&&!r.marks.length)return;const i=Math.max(a,o),v=Math.min(c,o+r.nodeSize);p+=v-i,g.push(...r.marks.map(r=>({mark:r,from:i,to:v})))})}),0===p)return!1;const v=g.filter(r=>!u||u.name===r.mark.type.name).filter(r=>objectIncludes(r.mark.attrs,i,{strict:!1})).reduce((r,o)=>r+o.to-o.from,0),b=g.filter(r=>!u||r.mark.type!==u&&r.mark.type.excludes(u)).reduce((r,o)=>r+o.to-o.from,0);return(v>0?v+b:v)>=p}function isActive(r,o,i={}){if(!o)return isNodeActive(r,null,i)||isMarkActive(r,null,i);const a=getSchemaTypeNameByName(o,r.schema);return"node"===a?isNodeActive(r,o,i):"mark"===a&&isMarkActive(r,o,i)}var isAtEndOfNode=(r,o)=>{const{$from:i,$to:a,$anchor:c}=r.selection;if(o){const i=findParentNode(r=>r.type.name===o)(r.selection);if(!i)return!1;const a=r.doc.resolve(i.pos+1);return c.pos+1===a.end()}return!(a.parentOffset<a.parent.nodeSize-2||i.pos!==a.pos)},isAtStartOfNode=r=>{const{$from:o,$to:i}=r.selection;return!(o.parentOffset>0||o.pos!==i.pos)};function isExtensionRulesEnabled(r,o){return Array.isArray(o)?o.some(o=>("string"==typeof o?o:o.name)===r.name):o}function isList(r,o){const{nodeExtensions:i}=splitExtensions(o),a=i.find(o=>o.name===r);if(!a)return!1;const c=callOrReturn(getExtensionField(a,"group",{name:a.name,options:a.options,storage:a.storage}));return"string"==typeof c&&c.split(" ").includes("list")}function isNodeEmpty(r,{checkChildren:o=!0,ignoreWhitespace:i=!1}={}){var a;if(i){if("hardBreak"===r.type.name)return!0;if(r.isText)return/^\s*$/m.test(null!=(a=r.text)?a:"")}if(r.isText)return!r.text;if(r.isAtom||r.isLeaf)return!1;if(0===r.content.childCount)return!0;if(o){let a=!0;return r.content.forEach(r=>{!1!==a&&(isNodeEmpty(r,{ignoreWhitespace:i,checkChildren:o})||(a=!1))}),a}return!1}var se=i(49162);function isNodeSelection(r){return r instanceof se.NodeSelection}var le=class _MappablePosition{constructor(r){this.position=r}static fromJSON(r){return new _MappablePosition(r.position)}toJSON(){return{position:this.position}}};function getUpdatedPosition(r,o){const i=o.mapping.mapResult(r.position);return{position:new le(i.pos),mapResult:i}}function createMappablePosition(r){return new le(r)}function posToDOMRect(r,o,i){const a=r.state.doc.content.size,c=minMax(o,0,a),u=minMax(i,0,a),p=r.coordsAtPos(c),g=r.coordsAtPos(u,-1),v=Math.min(p.top,g.top),b=Math.max(p.bottom,g.bottom),k=Math.min(p.left,g.left),E=Math.max(p.right,g.right),w={top:v,bottom:b,left:k,right:E,width:E-k,height:b-v,x:k,y:v};return{...w,toJSON:()=>w}}function rewriteUnknownContentInner({json:r,validMarks:o,validNodes:i,options:a,rewrittenContent:c=[]}){return r.marks&&Array.isArray(r.marks)&&(r.marks=r.marks.filter(r=>{const i="string"==typeof r?r:r.type;return!!o.has(i)||(c.push({original:JSON.parse(JSON.stringify(r)),unsupported:i}),!1)})),r.content&&Array.isArray(r.content)&&(r.content=r.content.map(r=>rewriteUnknownContentInner({json:r,validMarks:o,validNodes:i,options:a,rewrittenContent:c}).json).filter(r=>null!=r)),r.type&&!i.has(r.type)?(c.push({original:JSON.parse(JSON.stringify(r)),unsupported:r.type}),r.content&&Array.isArray(r.content)&&!1!==(null==a?void 0:a.fallbackToParagraph)?(r.type="paragraph",{json:r,rewrittenContent:c}):{json:null,rewrittenContent:c}):{json:r,rewrittenContent:c}}function rewriteUnknownContent(r,o,i){return rewriteUnknownContentInner({json:r,validNodes:new Set(Object.keys(o.nodes)),validMarks:new Set(Object.keys(o.marks)),options:i})}var setMark=(r,o={})=>({tr:i,state:a,dispatch:c})=>{const{selection:u}=i,{empty:p,ranges:g}=u,v=getMarkType(r,a.schema);if(c)if(p){const r=getMarkAttributes(a,v);i.addStoredMark(v.create({...r,...o}))}else g.forEach(r=>{const c=r.$from.pos,u=r.$to.pos;a.doc.nodesBetween(c,u,(r,a)=>{const p=Math.max(a,c),g=Math.min(a+r.nodeSize,u);r.marks.find(r=>r.type===v)?r.marks.forEach(r=>{v===r.type&&i.addMark(p,g,v.create({...r.attrs,...o}))}):i.addMark(p,g,v.create(o))})});return function canSetMark(r,o,i){var a;const{selection:c}=o;let u=null;if(isTextSelection(c)&&(u=c.$cursor),u){const o=null!=(a=r.storedMarks)?a:u.marks();return u.parent.type.allowsMarkType(i)&&(!!i.isInSet(o)||!o.some(r=>r.type.excludes(i)))}const{ranges:p}=c;return p.some(({$from:o,$to:a})=>{let c=0===o.depth&&r.doc.inlineContent&&r.doc.type.allowsMarkType(i);return r.doc.nodesBetween(o.pos,a.pos,(r,o,a)=>{if(c)return!1;if(r.isInline){const o=!a||a.type.allowsMarkType(i),u=!!i.isInSet(r.marks)||!r.marks.some(r=>r.type.excludes(i));c=o&&u}return!c}),c})}(a,i,v)},setMeta=(r,o)=>({tr:i})=>(i.setMeta(r,o),!0),ce=i(24007),setNode=(r,o={})=>({state:i,dispatch:a,chain:c})=>{const u=getNodeType(r,i.schema);let p;return i.selection.$anchor.sameParent(i.selection.$head)&&(p=i.selection.$anchor.parent.attrs),u.isTextblock?c().command(({commands:r})=>!!(0,ce.setBlockType)(u,{...p,...o})(i)||r.clearNodes()).command(({state:r})=>(0,ce.setBlockType)(u,{...p,...o})(r,a)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ue=i(49162),setNodeSelection=r=>({tr:o,dispatch:i})=>{if(i){const{doc:i}=o,a=minMax(r,0,i.content.size),c=ue.NodeSelection.create(i,a);o.setSelection(c)}return!0},setTextDirection=(r,o)=>({tr:i,state:a,dispatch:c})=>{const{selection:u}=a;let p,g;return"number"==typeof o?(p=o,g=o):o&&"from"in o&&"to"in o?(p=o.from,g=o.to):(p=u.from,g=u.to),c&&i.doc.nodesBetween(p,g,(o,a)=>{o.isText||i.setNodeMarkup(a,void 0,{...o.attrs,dir:r})}),!0},pe=i(49162),setTextSelection=r=>({tr:o,dispatch:i})=>{if(i){const{doc:i}=o,{from:a,to:c}="number"==typeof r?{from:r,to:r}:r,u=pe.TextSelection.atStart(i).from,p=pe.TextSelection.atEnd(i).to,g=minMax(a,u,p),v=minMax(c,u,p),b=pe.TextSelection.create(i,g,v);o.setSelection(b)}return!0},de=i(35423),sinkListItem=r=>({state:o,dispatch:i})=>{const a=getNodeType(r,o.schema);return(0,de.sinkListItem)(a)(o,i)},fe=i(49162),he=i(26401);function ensureMarks(r,o){const i=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(i){const a=i.filter(r=>null==o?void 0:o.includes(r.type.name));r.tr.ensureMarks(a)}}var splitBlock=({keepMarks:r=!0}={})=>({tr:o,state:i,dispatch:a,editor:c})=>{const{selection:u,doc:p}=o,{$from:g,$to:v}=u,b=getSplittedAttributes(c.extensionManager.attributes,g.node().type.name,g.node().attrs);if(u instanceof fe.NodeSelection&&u.node.isBlock)return!(!g.parentOffset||!(0,he.canSplit)(p,g.pos))&&(a&&(r&&ensureMarks(i,c.extensionManager.splittableMarks),o.split(g.pos).scrollIntoView()),!0);if(!g.parent.isBlock)return!1;const k=v.parentOffset===v.parent.content.size,E=0===g.depth?void 0:defaultBlockAt(g.node(-1).contentMatchAt(g.indexAfter(-1)));let w=k&&E?[{type:E,attrs:b}]:void 0,x=(0,he.canSplit)(o.doc,o.mapping.map(g.pos),1,w);if(w||x||!(0,he.canSplit)(o.doc,o.mapping.map(g.pos),1,E?[{type:E}]:void 0)||(x=!0,w=E?[{type:E,attrs:b}]:void 0),a){if(x&&(u instanceof fe.TextSelection&&o.deleteSelection(),o.split(o.mapping.map(g.pos),1,w),E&&!k&&!g.parentOffset&&g.parent.type!==E)){const r=o.mapping.map(g.before()),i=o.doc.resolve(r);g.node(-1).canReplaceWith(i.index(),i.index()+1,E)&&o.setNodeMarkup(o.mapping.map(g.before()),E)}r&&ensureMarks(i,c.extensionManager.splittableMarks),o.scrollIntoView()}return x},me=i(32386),ge=i(49162),ve=i(26401),splitListItem=(r,o={})=>({tr:i,state:a,dispatch:c,editor:u})=>{var p;const g=getNodeType(r,a.schema),{$from:v,$to:b}=a.selection,k=a.selection.node;if(k&&k.isBlock||v.depth<2||!v.sameParent(b))return!1;const E=v.node(-1);if(E.type!==g)return!1;const w=u.extensionManager.attributes;if(0===v.parent.content.size&&v.node(-1).childCount===v.indexAfter(-1)){if(2===v.depth||v.node(-3).type!==g||v.index(-2)!==v.node(-2).childCount-1)return!1;if(c){let r=me.Fragment.empty;const a=v.index(-1)?1:v.index(-2)?2:3;for(let o=v.depth-a;o>=v.depth-3;o-=1)r=me.Fragment.from(v.node(o).copy(r));const c=v.indexAfter(-1)<v.node(-2).childCount?1:v.indexAfter(-2)<v.node(-3).childCount?2:3,u={...getSplittedAttributes(w,v.node().type.name,v.node().attrs),...o},b=(null==(p=g.contentMatch.defaultType)?void 0:p.createAndFill(u))||void 0;r=r.append(me.Fragment.from(g.createAndFill(null,b)||void 0));const k=v.before(v.depth-(a-1));i.replace(k,v.after(-c),new me.Slice(r,4-a,0));let E=-1;i.doc.nodesBetween(k,i.doc.content.size,(r,o)=>{if(E>-1)return!1;r.isTextblock&&0===r.content.size&&(E=o+1)}),E>-1&&i.setSelection(ge.TextSelection.near(i.doc.resolve(E))),i.scrollIntoView()}return!0}const x=b.pos===v.end()?E.contentMatchAt(0).defaultType:null,C={...getSplittedAttributes(w,E.type.name,E.attrs),...o},_={...getSplittedAttributes(w,v.node().type.name,v.node().attrs),...o};i.delete(v.pos,b.pos);const T=x?[{type:g,attrs:C},{type:x,attrs:_}]:[{type:g,attrs:C}];if(!(0,ve.canSplit)(i.doc,v.pos,2))return!1;if(c){const{selection:r,storedMarks:o}=a,{splittableMarks:p}=u.extensionManager,g=o||r.$to.parentOffset&&r.$from.marks();if(i.split(v.pos,2,T).scrollIntoView(),!g||!c)return!0;const b=g.filter(r=>p.includes(r.type.name));i.ensureMarks(b)}return!0},ye=i(26401),joinListBackwards=(r,o)=>{const i=findParentNode(r=>r.type===o)(r.selection);if(!i)return!0;const a=r.doc.resolve(Math.max(0,i.pos-1)).before(i.depth);if(void 0===a)return!0;const c=r.doc.nodeAt(a);return i.node.type!==(null==c?void 0:c.type)||!(0,ye.canJoin)(r.doc,i.pos)||(r.join(i.pos),!0)},joinListForwards=(r,o)=>{const i=findParentNode(r=>r.type===o)(r.selection);if(!i)return!0;const a=r.doc.resolve(i.start).after(i.depth);if(void 0===a)return!0;const c=r.doc.nodeAt(a);return i.node.type!==(null==c?void 0:c.type)||!(0,ye.canJoin)(r.doc,a)||(r.join(a),!0)},toggleList=(r,o,i,a={})=>({editor:c,tr:u,state:p,dispatch:g,chain:v,commands:b,can:k})=>{const{extensions:E,splittableMarks:w}=c.extensionManager,x=getNodeType(r,p.schema),C=getNodeType(o,p.schema),{selection:_,storedMarks:T}=p,{$from:P,$to:A}=_,N=P.blockRange(A),R=T||_.$to.parentOffset&&_.$from.marks();if(!N)return!1;const I=findParentNode(r=>isList(r.type.name,E))(_);if(N.depth>=1&&I&&N.depth-I.depth<=1){if(I.node.type===x)return b.liftListItem(C);if(isList(I.node.type.name,E)&&x.validContent(I.node.content)&&g)return v().command(()=>(u.setNodeMarkup(I.pos,x),!0)).command(()=>joinListBackwards(u,x)).command(()=>joinListForwards(u,x)).run()}return i&&R&&g?v().command(()=>{const r=k().wrapInList(x,a),o=R.filter(r=>w.includes(r.type.name));return u.ensureMarks(o),!!r||b.clearNodes()}).wrapInList(x,a).command(()=>joinListBackwards(u,x)).command(()=>joinListForwards(u,x)).run():v().command(()=>!!k().wrapInList(x,a)||b.clearNodes()).wrapInList(x,a).command(()=>joinListBackwards(u,x)).command(()=>joinListForwards(u,x)).run()},toggleMark=(r,o={},i={})=>({state:a,commands:c})=>{const{extendEmptyMarkRange:u=!1}=i,p=getMarkType(r,a.schema);return isMarkActive(a,p,o)?c.unsetMark(p,{extendEmptyMarkRange:u}):c.setMark(p,o)},toggleNode=(r,o,i={})=>({state:a,commands:c})=>{const u=getNodeType(r,a.schema),p=getNodeType(o,a.schema),g=isNodeActive(a,u,i);let v;return a.selection.$anchor.sameParent(a.selection.$head)&&(v=a.selection.$anchor.parent.attrs),g?c.setNode(p,v):c.setNode(u,{...v,...i})},toggleWrap=(r,o={})=>({state:i,commands:a})=>{const c=getNodeType(r,i.schema);return isNodeActive(i,c,o)?a.lift(c):a.wrapIn(c,o)},undoInputRule=()=>({state:r,dispatch:o})=>{const i=r.plugins;for(let a=0;a<i.length;a+=1){const c=i[a];let u;if(c.spec.isInputRules&&(u=c.getState(r))){if(o){const o=r.tr,i=u.transform;for(let r=i.steps.length-1;r>=0;r-=1)o.step(i.steps[r].invert(i.docs[r]));if(u.text){const i=o.doc.resolve(u.from).marks();o.replaceWith(u.from,u.to,r.schema.text(u.text,i))}else o.delete(u.from,u.to)}return!0}}return!1},unsetAllMarks=()=>({tr:r,dispatch:o})=>{const{selection:i}=r,{empty:a,ranges:c}=i;return a||o&&c.forEach(o=>{r.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark=(r,o={})=>({tr:i,state:a,dispatch:c})=>{var u;const{extendEmptyMarkRange:p=!1}=o,{selection:g}=i,v=getMarkType(r,a.schema),{$from:b,empty:k,ranges:E}=g;if(!c)return!0;if(k&&p){let{from:r,to:o}=g;const a=null==(u=b.marks().find(r=>r.type===v))?void 0:u.attrs,c=getMarkRange(b,v,a);c&&(r=c.from,o=c.to),i.removeMark(r,o,v)}else E.forEach(r=>{i.removeMark(r.$from.pos,r.$to.pos,v)});return i.removeStoredMark(v),!0},unsetTextDirection=r=>({tr:o,state:i,dispatch:a})=>{const{selection:c}=i;let u,p;return"number"==typeof r?(u=r,p=r):r&&"from"in r&&"to"in r?(u=r.from,p=r.to):(u=c.from,p=c.to),a&&o.doc.nodesBetween(u,p,(r,i)=>{if(r.isText)return;const a={...r.attrs};delete a.dir,o.setNodeMarkup(i,void 0,a)}),!0},updateAttributes=(r,o={})=>({tr:i,state:a,dispatch:c})=>{let u=null,p=null;const g=getSchemaTypeNameByName("string"==typeof r?r:r.name,a.schema);if(!g)return!1;"node"===g&&(u=getNodeType(r,a.schema)),"mark"===g&&(p=getMarkType(r,a.schema));let v=!1;return i.selection.ranges.forEach(r=>{const g=r.$from.pos,b=r.$to.pos;let k,E,w,x;i.selection.empty?a.doc.nodesBetween(g,b,(r,o)=>{u&&u===r.type&&(v=!0,w=Math.max(o,g),x=Math.min(o+r.nodeSize,b),k=o,E=r)}):a.doc.nodesBetween(g,b,(r,a)=>{a<g&&u&&u===r.type&&(v=!0,w=Math.max(a,g),x=Math.min(a+r.nodeSize,b),k=a,E=r),a>=g&&a<=b&&(u&&u===r.type&&(v=!0,c&&i.setNodeMarkup(a,void 0,{...r.attrs,...o})),p&&r.marks.length&&r.marks.forEach(u=>{if(p===u.type&&(v=!0,c)){const c=Math.max(a,g),v=Math.min(a+r.nodeSize,b);i.addMark(c,v,p.create({...u.attrs,...o}))}}))}),E&&(void 0!==k&&c&&i.setNodeMarkup(k,void 0,{...E.attrs,...o}),p&&E.marks.length&&E.marks.forEach(r=>{p===r.type&&c&&i.addMark(w,x,p.create({...r.attrs,...o}))}))}),v},be=i(24007),wrapIn=(r,o={})=>({state:i,dispatch:a})=>{const c=getNodeType(r,i.schema);return(0,be.wrapIn)(c,o)(i,a)},ke=i(35423),wrapInList=(r,o={})=>({state:i,dispatch:a})=>{const c=getNodeType(r,i.schema);return(0,ke.wrapInList)(c,o)(i,a)},Ee=i(49162),Se=i(90990),we=class{constructor(){this.callbacks={}}on(r,o){return this.callbacks[r]||(this.callbacks[r]=[]),this.callbacks[r].push(o),this}emit(r,...o){const i=this.callbacks[r];return i&&i.forEach(r=>r.apply(this,o)),this}off(r,o){const i=this.callbacks[r];return i&&(o?this.callbacks[r]=i.filter(r=>r!==o):delete this.callbacks[r]),this}once(r,o){const onceFn=(...i)=>{this.off(r,onceFn),o.apply(this,i)};return this.on(r,onceFn)}removeAllListeners(){this.callbacks={}}},xe=i(77048),Ce=i(32386),_e=i(49162),Te=class{constructor(r){var o;this.find=r.find,this.handler=r.handler,this.undoable=null==(o=r.undoable)||o}},inputRuleMatcherHandler=(r,o)=>{if(isRegExp(o))return o.exec(r);const i=o(r);if(!i)return null;const a=[i.text];return a.index=i.index,a.input=r,a.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),a.push(i.replaceWith)),a};function run(r){var o;const{editor:i,from:a,to:c,text:u,rules:p,plugin:g}=r,{view:v}=i;if(v.composing)return!1;const k=v.state.doc.resolve(a);if(k.parent.type.spec.code||(null==(o=k.nodeBefore||k.nodeAfter)?void 0:o.marks.find(r=>r.type.spec.code)))return!1;let E=!1;const w=getTextContentFromNodes(k)+u;return p.forEach(r=>{if(E)return;const o=inputRuleMatcherHandler(w,r.find);if(!o)return;const p=v.state.tr,k=createChainableState({state:v.state,transaction:p}),x={from:a-(o[0].length-u.length),to:c},{commands:C,chain:_,can:T}=new b({editor:i,state:k});null!==r.handler({state:k,range:x,match:o,commands:C,chain:_,can:T})&&p.steps.length&&(r.undoable&&p.setMeta(g,{transform:p,from:a,to:c,text:u}),v.dispatch(p),E=!0)}),E}function inputRulesPlugin(r){const{editor:o,rules:i}=r,a=new _e.Plugin({state:{init(){return null},apply(r,c,u){const p=r.getMeta(a);if(p)return p;const g=r.getMeta("applyInputRules");return!!g&&setTimeout(()=>{let{text:r}=g;"string"==typeof r||(r=getHTMLFromFragment(Ce.Fragment.from(r),u.schema));const{from:c}=g,p=c+r.length;run({editor:o,from:c,to:p,text:r,rules:i,plugin:a})}),r.selectionSet||r.docChanged?null:c}},props:{handleTextInput(r,c,u,p){return run({editor:o,from:c,to:u,text:p,rules:i,plugin:a})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:c}=r.state.selection;c&&run({editor:o,from:c.pos,to:c.pos,text:"",rules:i,plugin:a})}),!1)},handleKeyDown(r,c){if("Enter"!==c.key)return!1;const{$cursor:u}=r.state.selection;return!!u&&run({editor:o,from:u.pos,to:u.pos,text:"\n",rules:i,plugin:a})}},isInputRules:!0});return a}function isPlainObject(r){return"Object"===function getType(r){return Object.prototype.toString.call(r).slice(8,-1)}(r)&&(r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype)}function mergeDeep(r,o){const i={...r};return isPlainObject(r)&&isPlainObject(o)&&Object.keys(o).forEach(a=>{isPlainObject(o[a])&&isPlainObject(r[a])?i[a]=mergeDeep(r[a],o[a]):i[a]=o[a]}),i}var Oe=class{constructor(r={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...r},this.name=this.config.name}get options(){return{...callOrReturn(getExtensionField(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...callOrReturn(getExtensionField(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(r={}){const o=this.extend({...this.config,addOptions:()=>mergeDeep(this.options,r)});return o.name=this.name,o.parent=this.parent,o}extend(r={}){const o=new this.constructor({...this.config,...r});return o.parent=this,this.child=o,o.name="name"in r?r.name:o.parent.name,o}},Pe=class _Mark extends Oe{constructor(){super(...arguments),this.type="mark"}static create(r={}){const o="function"==typeof r?r():r;return new _Mark(o)}static handleExit({editor:r,mark:o}){const{tr:i}=r.state,a=r.state.selection.$from;if(a.pos===a.end()){const c=a.marks();if(!!!c.find(r=>(null==r?void 0:r.type.name)===o.name))return!1;const u=c.find(r=>(null==r?void 0:r.type.name)===o.name);return u&&i.removeStoredMark(u),i.insertText(" ",a.pos),r.view.dispatch(i),!0}return!1}configure(r){return super.configure(r)}extend(r){const o="function"==typeof r?r():r;return super.extend(o)}},Ae=i(32386),Me=i(49162);function isNumber(r){return"number"==typeof r}var Ne=class{constructor(r){this.find=r.find,this.handler=r.handler}},pasteRuleMatcherHandler=(r,o,i)=>{if(isRegExp(o))return[...r.matchAll(o)];const a=o(r,i);return a?a.map(o=>{const i=[o.text];return i.index=o.index,i.input=r,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};var Re=null,createClipboardPasteEvent=r=>{var o;const i=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(o=i.clipboardData)||o.setData("text/html",r),i};function pasteRulesPlugin(r){const{editor:o,rules:i}=r;let a,c=null,u=!1,p=!1,g="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{a="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{a=null}const processEvent=({state:r,from:i,to:c,rule:u,pasteEvt:p})=>{const v=r.tr,k=createChainableState({state:r,transaction:v}),E=function run2(r){const{editor:o,state:i,from:a,to:c,rule:u,pasteEvent:p,dropEvent:g}=r,{commands:v,chain:k,can:E}=new b({editor:o,state:i}),w=[];return i.doc.nodesBetween(a,c,(r,o)=>{var b,x,C,_,T;if((null==(x=null==(b=r.type)?void 0:b.spec)?void 0:x.code)||!(r.isText||r.isTextblock||r.isInline))return;const P=null!=(T=null!=(_=null==(C=r.content)?void 0:C.size)?_:r.nodeSize)?T:0,A=Math.max(a,o),N=Math.min(c,o+P);if(A>=N)return;const R=r.isText?r.text||"":r.textBetween(A-o,N-o,void 0,"");pasteRuleMatcherHandler(R,u.find,p).forEach(r=>{if(void 0===r.index)return;const o=A+r.index+1,a=o+r[0].length,c={from:i.tr.mapping.map(o),to:i.tr.mapping.map(a)},b=u.handler({state:i,range:c,match:r,commands:v,chain:k,can:E,pasteEvent:p,dropEvent:g});w.push(b)})}),w.every(r=>null!==r)}({editor:o,state:k,from:Math.max(i-1,0),to:c.b-1,rule:u,pasteEvent:p,dropEvent:a});if(E&&v.steps.length){try{a="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{a=null}return g="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,v}};return i.map(r=>new Me.Plugin({view(r){const handleDragstart=i=>{var a;c=(null==(a=r.dom.parentElement)?void 0:a.contains(i.target))?r.dom.parentElement:null,c&&(Re=o)},handleDragend=()=>{Re&&(Re=null)};return window.addEventListener("dragstart",handleDragstart),window.addEventListener("dragend",handleDragend),{destroy(){window.removeEventListener("dragstart",handleDragstart),window.removeEventListener("dragend",handleDragend)}}},props:{handleDOMEvents:{drop:(r,o)=>{if(p=c===r.dom.parentElement,a=o,!p){const r=Re;(null==r?void 0:r.isEditable)&&setTimeout(()=>{const o=r.state.selection;o&&r.commands.deleteRange({from:o.from,to:o.to})},10)}return!1},paste:(r,o)=>{var i;const a=null==(i=o.clipboardData)?void 0:i.getData("text/html");return g=o,u=!!(null==a?void 0:a.includes("data-pm-slice")),!1}}},appendTransaction:(o,i,a)=>{const c=o[0],v="paste"===c.getMeta("uiEvent")&&!u,b="drop"===c.getMeta("uiEvent")&&!p,k=c.getMeta("applyPasteRules"),E=!!k;if(!v&&!b&&!E)return;if(E){let{text:o}=k;"string"==typeof o||(o=getHTMLFromFragment(Ae.Fragment.from(o),a.schema));const{from:i}=k,c=i+o.length,u=createClipboardPasteEvent(o);return processEvent({rule:r,state:a,from:i,to:{b:c},pasteEvt:u})}const w=i.doc.content.findDiffStart(a.doc.content),x=i.doc.content.findDiffEnd(a.doc.content);return isNumber(w)&&x&&w!==x.b?processEvent({rule:r,state:a,from:w,to:x,pasteEvt:g}):void 0}}))}var Ie=class{constructor(r,o){this.splittableMarks=[],this.editor=o,this.baseExtensions=r,this.extensions=resolveExtensions(r),this.schema=getSchemaByResolvedExtensions(this.extensions,o),this.setupExtensions()}get commands(){return this.extensions.reduce((r,o)=>{const i=getExtensionField(o,"addCommands",{name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:this.editor,type:getSchemaTypeByName(o.name,this.schema)});return i?{...r,...i()}:r},{})}get plugins(){const{editor:r}=this;return sortExtensions([...this.extensions].reverse()).flatMap(o=>{const i={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:r,type:getSchemaTypeByName(o.name,this.schema)},a=[],c=getExtensionField(o,"addKeyboardShortcuts",i);let u={};if("mark"===o.type&&getExtensionField(o,"exitable",i)&&(u.ArrowRight=()=>Pe.handleExit({editor:r,mark:o})),c){const o=Object.fromEntries(Object.entries(c()).map(([o,i])=>[o,()=>i({editor:r})]));u={...u,...o}}const p=(0,xe.keymap)(u);a.push(p);const g=getExtensionField(o,"addInputRules",i);if(isExtensionRulesEnabled(o,r.options.enableInputRules)&&g){const o=g();if(o&&o.length){const i=inputRulesPlugin({editor:r,rules:o}),c=Array.isArray(i)?i:[i];a.push(...c)}}const v=getExtensionField(o,"addPasteRules",i);if(isExtensionRulesEnabled(o,r.options.enablePasteRules)&&v){const o=v();if(o&&o.length){const i=pasteRulesPlugin({editor:r,rules:o});a.push(...i)}}const b=getExtensionField(o,"addProseMirrorPlugins",i);if(b){const r=b();a.push(...r)}return a})}get attributes(){return getAttributesFromExtensions(this.extensions)}get nodeViews(){const{editor:r}=this,{nodeExtensions:o}=splitExtensions(this.extensions);return Object.fromEntries(o.filter(r=>!!getExtensionField(r,"addNodeView")).map(o=>{const i=this.attributes.filter(r=>r.type===o.name),a={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:r,type:getNodeType(o.name,this.schema)},c=getExtensionField(o,"addNodeView",a);if(!c)return[];const u=c();if(!u)return[];return[o.name,(a,c,p,g,v)=>{const b=getRenderedAttributes(a,i);return u({node:a,view:c,getPos:p,decorations:g,innerDecorations:v,editor:r,extension:o,HTMLAttributes:b})}]}))}dispatchTransaction(r){const{editor:o}=this;return sortExtensions([...this.extensions].reverse()).reduceRight((r,i)=>{const a={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:o,type:getSchemaTypeByName(i.name,this.schema)},c=getExtensionField(i,"dispatchTransaction",a);return c?o=>{c.call(a,{transaction:o,next:r})}:r},r)}transformPastedHTML(r){const{editor:o}=this;return sortExtensions([...this.extensions]).reduce((r,i)=>{const a={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:o,type:getSchemaTypeByName(i.name,this.schema)},c=getExtensionField(i,"transformPastedHTML",a);return c?(o,i)=>{const u=r(o,i);return c.call(a,u)}:r},r||(r=>r))}get markViews(){const{editor:r}=this,{markExtensions:o}=splitExtensions(this.extensions);return Object.fromEntries(o.filter(r=>!!getExtensionField(r,"addMarkView")).map(o=>{const i=this.attributes.filter(r=>r.type===o.name),a={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:r,type:getMarkType(o.name,this.schema)},c=getExtensionField(o,"addMarkView",a);if(!c)return[];return[o.name,(a,u,p)=>{const g=getRenderedAttributes(a,i);return c()({mark:a,view:u,inline:p,editor:r,extension:o,HTMLAttributes:g,updateAttributes:o=>{updateMarkViewAttributes(a,r,o)}})}]}))}setupExtensions(){const r=this.extensions;this.editor.extensionStorage=Object.fromEntries(r.map(r=>[r.name,r.storage])),r.forEach(r=>{var o;const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:this.editor,type:getSchemaTypeByName(r.name,this.schema)};if("mark"===r.type){(null==(o=callOrReturn(getExtensionField(r,"keepOnSplit",i)))||o)&&this.splittableMarks.push(r.name)}const a=getExtensionField(r,"onBeforeCreate",i),c=getExtensionField(r,"onCreate",i),u=getExtensionField(r,"onUpdate",i),p=getExtensionField(r,"onSelectionUpdate",i),g=getExtensionField(r,"onTransaction",i),v=getExtensionField(r,"onFocus",i),b=getExtensionField(r,"onBlur",i),k=getExtensionField(r,"onDestroy",i);a&&this.editor.on("beforeCreate",a),c&&this.editor.on("create",c),u&&this.editor.on("update",u),p&&this.editor.on("selectionUpdate",p),g&&this.editor.on("transaction",g),v&&this.editor.on("focus",v),b&&this.editor.on("blur",b),k&&this.editor.on("destroy",k)})}};Ie.resolve=resolveExtensions,Ie.sort=sortExtensions,Ie.flatten=flattenExtensions;var De={};__export(De,{ClipboardTextSerializer:()=>ze,Commands:()=>je,Delete:()=>Ve,Drop:()=>Ue,Editable:()=>We,FocusEvents:()=>Ge,Keymap:()=>Ye,Paste:()=>Qe,Tabindex:()=>et,TextDirection:()=>rt,focusEventsPluginKey:()=>Ke});var Le=i(49162),Fe=class _Extension extends Oe{constructor(){super(...arguments),this.type="extension"}static create(r={}){const o="function"==typeof r?r():r;return new _Extension(o)}configure(r){return super.configure(r)}extend(r){const o="function"==typeof r?r():r;return super.extend(o)}},ze=Fe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Le.Plugin({key:new Le.PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:o,schema:i}=r,{doc:a,selection:c}=o,{ranges:u}=c,p=Math.min(...u.map(r=>r.$from.pos)),g=Math.max(...u.map(r=>r.$to.pos)),v=getTextSerializersFromSchema(i);return getTextBetween(a,{from:p,to:g},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:v})}}})]}}),je=Fe.create({name:"commands",addCommands(){return{...k}}}),Be=i(26401),Ve=Fe.create({name:"delete",onUpdate({transaction:r,appendedTransactions:o}){var i,a,c;const callback=()=>{var i,a,c,u;if(null!=(u=null==(c=null==(a=null==(i=this.editor.options.coreExtensionOptions)?void 0:i.delete)?void 0:a.filterTransaction)?void 0:c.call(a,r))?u:r.getMeta("y-sync$"))return;const p=combineTransactionSteps(r.before,[r,...o]);getChangedRanges(p).forEach(o=>{p.mapping.mapResult(o.oldRange.from).deletedAfter&&p.mapping.mapResult(o.oldRange.to).deletedBefore&&p.before.nodesBetween(o.oldRange.from,o.oldRange.to,(i,a)=>{const c=a+i.nodeSize-2,u=o.oldRange.from<=a&&c<=o.oldRange.to;this.editor.emit("delete",{type:"node",node:i,from:a,to:c,newFrom:p.mapping.map(a),newTo:p.mapping.map(c),deletedRange:o.oldRange,newRange:o.newRange,partial:!u,editor:this.editor,transaction:r,combinedTransform:p})})});const g=p.mapping;p.steps.forEach((o,i)=>{var a,c;if(o instanceof Be.RemoveMarkStep){const u=g.slice(i).map(o.from,-1),v=g.slice(i).map(o.to),b=g.invert().map(u,-1),k=g.invert().map(v),E=null==(a=p.doc.nodeAt(u-1))?void 0:a.marks.some(r=>r.eq(o.mark)),w=null==(c=p.doc.nodeAt(v))?void 0:c.marks.some(r=>r.eq(o.mark));this.editor.emit("delete",{type:"mark",mark:o.mark,from:o.from,to:o.to,deletedRange:{from:b,to:k},newRange:{from:u,to:v},partial:Boolean(w||E),editor:this.editor,transaction:r,combinedTransform:p})}})};null==(c=null==(a=null==(i=this.editor.options.coreExtensionOptions)?void 0:i.delete)?void 0:a.async)||c?setTimeout(callback,0):callback()}}),$e=i(49162),Ue=Fe.create({name:"drop",addProseMirrorPlugins(){return[new $e.Plugin({key:new $e.PluginKey("tiptapDrop"),props:{handleDrop:(r,o,i,a)=>{this.editor.emit("drop",{editor:this.editor,event:o,slice:i,moved:a})}}})]}}),He=i(49162),We=Fe.create({name:"editable",addProseMirrorPlugins(){return[new He.Plugin({key:new He.PluginKey("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qe=i(49162),Ke=new qe.PluginKey("focusEvents"),Ge=Fe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new qe.Plugin({key:Ke,props:{handleDOMEvents:{focus:(o,i)=>{r.isFocused=!0;const a=r.state.tr.setMeta("focus",{event:i}).setMeta("addToHistory",!1);return o.dispatch(a),!1},blur:(o,i)=>{r.isFocused=!1;const a=r.state.tr.setMeta("blur",{event:i}).setMeta("addToHistory",!1);return o.dispatch(a),!1}}}})]}}),Je=i(49162),Ye=Fe.create({name:"keymap",addKeyboardShortcuts(){const handleBackspace=()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:o})=>{const{selection:i,doc:a}=o,{empty:c,$anchor:u}=i,{pos:p,parent:g}=u,v=u.parent.isTextblock&&p>0?o.doc.resolve(p-1):u,b=v.parent.type.spec.isolating,k=u.pos-u.parentOffset,E=b&&1===v.parent.childCount?k===u.pos:Je.Selection.atStart(a).from===p;return!(!c||!g.type.isTextblock||g.textContent.length||!E||E&&"paragraph"===u.parent.type.name)&&r.clearNodes()}),()=>r.deleteSelection(),()=>r.joinBackward(),()=>r.selectNodeBackward()]),handleDelete=()=>this.editor.commands.first(({commands:r})=>[()=>r.deleteSelection(),()=>r.deleteCurrentNode(),()=>r.joinForward(),()=>r.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:r})=>[()=>r.newlineInCode(),()=>r.createParagraphNear(),()=>r.liftEmptyBlock(),()=>r.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:handleBackspace,"Mod-Backspace":handleBackspace,"Shift-Backspace":handleBackspace,Delete:handleDelete,"Mod-Delete":handleDelete,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":handleBackspace,"Alt-Backspace":handleBackspace,"Ctrl-d":handleDelete,"Ctrl-Alt-Backspace":handleDelete,"Alt-Delete":handleDelete,"Alt-d":handleDelete,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return isiOS()||isMacOS()?i:o},addProseMirrorPlugins(){return[new Je.Plugin({key:new Je.PluginKey("clearDocument"),appendTransaction:(r,o,i)=>{if(r.some(r=>r.getMeta("composition")))return;const a=r.some(r=>r.docChanged)&&!o.doc.eq(i.doc),c=r.some(r=>r.getMeta("preventClearDocument"));if(!a||c)return;const{empty:u,from:p,to:g}=o.selection,v=Je.Selection.atStart(o.doc).from,k=Je.Selection.atEnd(o.doc).to;if(u||!(p===v&&g===k))return;if(!isNodeEmpty(i.doc))return;const E=i.tr,w=createChainableState({state:i,transaction:E}),{commands:x}=new b({editor:this.editor,state:w});return x.clearNodes(),E.steps.length?E:void 0}})]}}),Xe=i(49162),Qe=Fe.create({name:"paste",addProseMirrorPlugins(){return[new Xe.Plugin({key:new Xe.PluginKey("tiptapPaste"),props:{handlePaste:(r,o,i)=>{this.editor.emit("paste",{editor:this.editor,event:o,slice:i})}}})]}}),Ze=i(49162),et=Fe.create({name:"tabindex",addProseMirrorPlugins(){return[new Ze.Plugin({key:new Ze.PluginKey("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),nt=i(49162),rt=Fe.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:r}=splitExtensions(this.extensions);return[{types:r.filter(r=>"text"!==r.name).map(r=>r.name),attributes:{dir:{default:this.options.direction,parseHTML:r=>{const o=r.getAttribute("dir");return!o||"ltr"!==o&&"rtl"!==o&&"auto"!==o?this.options.direction:o},renderHTML:r=>r.dir?{dir:r.dir}:{}}}}]},addProseMirrorPlugins(){return[new nt.Plugin({key:new nt.PluginKey("textDirection"),props:{attributes:()=>{const r=this.options.direction;return r?{dir:r}:{}}}})]}}),ot=class _NodePos{constructor(r,o,i=!1,a=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=r,this.editor=o,this.currentNode=a}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 r;return null!=(r=this.actualDepth)?r:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(r){let o=this.from,i=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}`);o=this.from+1,i=this.to-1}this.editor.commands.insertContentAt({from:o,to:i},r)}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 r=this.resolvedPos.start(this.resolvedPos.depth-1),o=this.resolvedPos.doc.resolve(r);return new _NodePos(o,this.editor)}get before(){let r=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return r.depth!==this.depth&&(r=this.resolvedPos.doc.resolve(this.from-3)),new _NodePos(r,this.editor)}get after(){let r=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return r.depth!==this.depth&&(r=this.resolvedPos.doc.resolve(this.to+3)),new _NodePos(r,this.editor)}get children(){const r=[];return this.node.content.forEach((o,i)=>{const a=o.isBlock&&!o.isTextblock,c=o.isAtom&&!o.isText,u=o.isInline,p=this.pos+i+(c?0:1);if(p<0||p>this.resolvedPos.doc.nodeSize-2)return;const g=this.resolvedPos.doc.resolve(p);if(!a&&!u&&g.depth<=this.depth)return;const v=new _NodePos(g,this.editor,a,a||u?o:null);a&&(v.actualDepth=this.depth+1),r.push(v)}),r}get firstChild(){return this.children[0]||null}get lastChild(){const r=this.children;return r[r.length-1]||null}closest(r,o={}){let i=null,a=this.parent;for(;a&&!i;){if(a.node.type.name===r)if(Object.keys(o).length>0){const r=a.node.attrs,i=Object.keys(o);for(let a=0;a<i.length;a+=1){const c=i[a];if(r[c]!==o[c])break}}else i=a;a=a.parent}return i}querySelector(r,o={}){return this.querySelectorAll(r,o,!0)[0]||null}querySelectorAll(r,o={},i=!1){let a=[];if(!this.children||0===this.children.length)return a;const c=Object.keys(o);return this.children.forEach(u=>{if(!(i&&a.length>0)){if(u.node.type.name===r){c.every(r=>o[r]===u.node.attrs[r])&&a.push(u)}i&&a.length>0||(a=a.concat(u.querySelectorAll(r,o,i)))}}),a}setAttribute(r){const{tr:o}=this.editor.state;o.setNodeMarkup(this.from,void 0,{...this.node.attrs,...r}),this.editor.view.dispatch(o)}};function createStyleTag(r,o,i){const a=document.querySelector(`style[data-tiptap-style${i?`-${i}`:""}]`);if(null!==a)return a;const c=document.createElement("style");return o&&c.setAttribute("nonce",o),c.setAttribute("data-tiptap-style"+(i?`-${i}`:""),""),c.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(c),c}var it=class extends we{constructor(r={}){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:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:getUpdatedPosition,createMappablePosition:createMappablePosition},this.setOptions(r),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:r,slice:o,moved:i})=>this.options.onDrop(r,o,i)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const o=this.createDoc(),i=resolveFocusPosition(o,this.options.autofocus);this.editorState=Ee.EditorState.create({doc:o,schema:this.schema,selection:i||void 0}),this.options.element&&this.mount(this.options.element)}mount(r){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(r),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 r=this.editorView.dom;(null==r?void 0:r.editor)&&delete r.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(r){console.warn("Failed to remove CSS element:",r)}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=createStyleTag('.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}',this.options.injectNonce))}setOptions(r={}){this.options={...this.options,...r},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(r,o=!0){this.setOptions({editable:r}),o&&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:r=>{this.editorState=r},dispatch:r=>{this.dispatchTransaction(r)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(r,o)=>{if(this.editorView)return this.editorView[o];if("state"===o)return this.editorState;if(o in r)return Reflect.get(r,o);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${o}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(r,o){const i=isFunction(o)?o(r,[...this.state.plugins]):[...this.state.plugins,r],a=this.state.reconfigure({plugins:i});return this.view.updateState(a),a}unregisterPlugin(r){if(this.isDestroyed)return;const o=this.state.plugins;let i=o;if([].concat(r).forEach(r=>{const o="string"==typeof r?`${r}$`:r.key;i=i.filter(r=>!r.key.startsWith(o))}),o.length===i.length)return;const a=this.state.reconfigure({plugins:i});return this.view.updateState(a),a}createExtensionManager(){var r,o;const i=[...this.options.enableCoreExtensions?[We,ze.configure({blockSeparator:null==(o=null==(r=this.options.coreExtensionOptions)?void 0:r.clipboardTextSerializer)?void 0:o.blockSeparator}),je,Ge,Ye,et,Ue,Qe,Ve,rt.configure({direction:this.options.textDirection})].filter(r=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[r.name]):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(null==r?void 0:r.type));this.extensionManager=new Ie(i,this)}createCommandManager(){this.commandManager=new b({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let r;try{r=createDocument(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message)))throw o;this.emit("contentError",{editor:this,error:o,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(r=>"collaboration"!==r.name),this.createExtensionManager()}}),r=createDocument(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return r}createView(r){const{editorProps:o,enableExtensionDispatchTransaction:i}=this.options,a=o.dispatchTransaction||this.dispatchTransaction.bind(this),c=i?this.extensionManager.dispatchTransaction(a):a,u=o.transformPastedHTML,p=this.extensionManager.transformPastedHTML(u);this.editorView=new Se.EditorView(r,{...o,attributes:{role:"textbox",...null==o?void 0:o.attributes},dispatchTransaction:c,transformPastedHTML:p,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const g=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(g),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(r){this.isCapturingTransaction=!0,r(),this.isCapturingTransaction=!1;const o=this.capturedTransaction;return this.capturedTransaction=null,o}dispatchTransaction(r){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void r.steps.forEach(r=>{var o;return null==(o=this.capturedTransaction)?void 0:o.step(r)}):void(this.capturedTransaction=r);const{state:o,transactions:i}=this.state.applyTransaction(r),a=!this.state.selection.eq(o.selection),c=i.includes(r),u=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:r,nextState:o}),!c)return;this.view.updateState(o),this.emit("transaction",{editor:this,transaction:r,appendedTransactions:i.slice(1)}),a&&this.emit("selectionUpdate",{editor:this,transaction:r});const p=i.findLast(r=>r.getMeta("focus")||r.getMeta("blur")),g=null==p?void 0:p.getMeta("focus"),v=null==p?void 0:p.getMeta("blur");g&&this.emit("focus",{editor:this,event:g.event,transaction:p}),v&&this.emit("blur",{editor:this,event:v.event,transaction:p}),r.getMeta("preventUpdate")||!i.some(r=>r.docChanged)||u.doc.eq(o.doc)||this.emit("update",{editor:this,transaction:r,appendedTransactions:i.slice(1)})}getAttributes(r){return getAttributes(this.state,r)}isActive(r,o){const i="string"==typeof r?r:null,a="string"==typeof r?o:r;return isActive(this.state,i,a)}getJSON(){return this.state.doc.toJSON()}getHTML(){return getHTMLFromFragment(this.state.doc.content,this.schema)}getText(r){const{blockSeparator:o="\n\n",textSerializers:i={}}=r||{};return getText(this.state.doc,{blockSeparator:o,textSerializers:{...getTextSerializersFromSchema(this.schema),...i}})}get isEmpty(){return isNodeEmpty(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var r,o;return null==(o=null==(r=this.editorView)?void 0:r.isDestroyed)||o}$node(r,o){var i;return(null==(i=this.$doc)?void 0:i.querySelector(r,o))||null}$nodes(r,o){var i;return(null==(i=this.$doc)?void 0:i.querySelectorAll(r,o))||null}$pos(r){const o=this.state.doc.resolve(r);return new ot(o,this)}get $doc(){return this.$pos(0)}};function markInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a})=>{const c=callOrReturn(r.getAttributes,void 0,a);if(!1===c||null===c)return null;const{tr:u}=o,p=a[a.length-1],g=a[0];if(p){const a=g.search(/\S/),v=i.from+g.indexOf(p),b=v+p.length;if(getMarksBetween(i.from,i.to,o.doc).filter(o=>o.mark.type.excluded.find(i=>i===r.type&&i!==o.mark.type)).filter(r=>r.to>v).length)return null;b<i.to&&u.delete(b,i.to),v>i.from&&u.delete(i.from+a,v);const k=i.from+a+p.length;u.addMark(i.from+a,k,r.type.create(c||{})),u.removeStoredMark(r.type)}},undoable:r.undoable})}function nodeInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a})=>{const c=callOrReturn(r.getAttributes,void 0,a)||{},{tr:u}=o,p=i.from;let g=i.to;const v=r.type.create(c);if(a[1]){let r=p+a[0].lastIndexOf(a[1]);r>g?r=g:g=r+a[1].length;const o=a[0][a[0].length-1];u.insertText(o,p+a[0].length-1),u.replaceWith(r,g,v)}else if(a[0]){const o=r.type.isInline?p:p-1;u.insert(o,r.type.create(c)).delete(u.mapping.map(p),u.mapping.map(g))}u.scrollIntoView()},undoable:r.undoable})}function textblockTypeInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a})=>{const c=o.doc.resolve(i.from),u=callOrReturn(r.getAttributes,void 0,a)||{};if(!c.node(-1).canReplaceWith(c.index(-1),c.indexAfter(-1),r.type))return null;o.tr.delete(i.from,i.to).setBlockType(i.from,i.from,r.type,u)},undoable:r.undoable})}function textInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a})=>{let c=r.replace,u=i.from;const p=i.to;if(a[1]){const r=a[0].lastIndexOf(a[1]);c+=a[0].slice(r+a[1].length),u+=r;const o=u-p;o>0&&(c=a[0].slice(r-o,r)+c,u=p)}o.tr.insertText(c,u,p)},undoable:r.undoable})}var at=i(26401);function wrappingInputRule(r){return new Te({find:r.find,handler:({state:o,range:i,match:a,chain:c})=>{const u=callOrReturn(r.getAttributes,void 0,a)||{},p=o.tr.delete(i.from,i.to),g=p.doc.resolve(i.from).blockRange(),v=g&&(0,at.findWrapping)(g,r.type,u);if(!v)return null;if(p.wrap(g,v),r.keepMarks&&r.editor){const{selection:i,storedMarks:a}=o,{splittableMarks:c}=r.editor.extensionManager,u=a||i.$to.parentOffset&&i.$from.marks();if(u){const r=u.filter(r=>c.includes(r.type.name));p.ensureMarks(r)}}if(r.keepAttributes){const o="bulletList"===r.type.name||"orderedList"===r.type.name?"listItem":"taskList";c().updateAttributes(o,u).run()}const b=p.doc.resolve(i.from-1).nodeBefore;b&&b.type===r.type&&(0,at.canJoin)(p.doc,i.from-1)&&(!r.joinPredicate||r.joinPredicate(a,b))&&p.join(i.from-1)},undoable:r.undoable})}function Fragment6(r){return r.children}var h=(r,o)=>{if("slot"===r)return 0;if(r instanceof Function)return r(o);const{children:i,...a}=null!=o?o:{};if("svg"===r)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[r,a,i]},st=class{constructor(r){var o,i,a,c,u,p;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=r=>{if(!this.isResizing||!this.activeHandle)return;const o=r.clientX-this.startX,i=r.clientY-this.startY;this.handleResize(o,i)},this.handleTouchMove=r=>{if(!this.isResizing||!this.activeHandle)return;const o=r.touches[0];if(!o)return;const i=o.clientX-this.startX,a=o.clientY-this.startY;this.handleResize(i,a)},this.handleMouseUp=()=>{if(!this.isResizing)return;const r=this.element.offsetWidth,o=this.element.offsetHeight;this.onCommit(r,o),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=r=>{"Shift"===r.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=r=>{"Shift"===r.key&&(this.isShiftKeyPressed=!1)},this.node=r.node,this.editor=r.editor,this.element=r.element,this.contentElement=r.contentElement,this.getPos=r.getPos,this.onResize=r.onResize,this.onCommit=r.onCommit,this.onUpdate=r.onUpdate,(null==(o=r.options)?void 0:o.min)&&(this.minSize={...this.minSize,...r.options.min}),(null==(i=r.options)?void 0:i.max)&&(this.maxSize=r.options.max),(null==(a=null==r?void 0:r.options)?void 0:a.directions)&&(this.directions=r.options.directions),(null==(c=r.options)?void 0:c.preserveAspectRatio)&&(this.preserveAspectRatio=r.options.preserveAspectRatio),(null==(u=r.options)?void 0:u.className)&&(this.classNames={container:r.options.className.container||"",wrapper:r.options.className.wrapper||"",handle:r.options.className.handle||"",resizing:r.options.className.resizing||""}),(null==(p=r.options)?void 0:p.createCustomHandle)&&(this.createCustomHandle=r.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var r;return null!=(r=this.contentElement)?r:null}handleEditorUpdate(){const r=this.editor.isEditable;r!==this.lastEditableState&&(this.lastEditableState=r,r?r&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(r,o,i){return r.type===this.node.type&&(this.node=r,!this.onUpdate||this.onUpdate(r,o,i))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const r=document.createElement("div");return r.dataset.resizeContainer="",r.dataset.node=this.node.type.name,r.style.display="flex",this.classNames.container&&(r.className=this.classNames.container),r.appendChild(this.wrapper),r}createWrapper(){const r=document.createElement("div");return r.style.position="relative",r.style.display="block",r.dataset.resizeWrapper="",this.classNames.wrapper&&(r.className=this.classNames.wrapper),r.appendChild(this.element),r}createHandle(r){const o=document.createElement("div");return o.dataset.resizeHandle=r,o.style.position="absolute",this.classNames.handle&&(o.className=this.classNames.handle),o}positionHandle(r,o){const i=o.includes("top"),a=o.includes("bottom"),c=o.includes("left"),u=o.includes("right");i&&(r.style.top="0"),a&&(r.style.bottom="0"),c&&(r.style.left="0"),u&&(r.style.right="0"),"top"!==o&&"bottom"!==o||(r.style.left="0",r.style.right="0"),"left"!==o&&"right"!==o||(r.style.top="0",r.style.bottom="0")}attachHandles(){this.directions.forEach(r=>{let o;o=this.createCustomHandle?this.createCustomHandle(r):this.createHandle(r),o instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${r}") did not return an HTMLElement. Falling back to default handle.`),o=this.createHandle(r)),this.createCustomHandle||this.positionHandle(o,r),o.addEventListener("mousedown",o=>this.handleResizeStart(o,r)),o.addEventListener("touchstart",o=>this.handleResizeStart(o,r)),this.handleMap.set(r,o),this.wrapper.appendChild(o)})}removeHandles(){this.handleMap.forEach(r=>r.remove()),this.handleMap.clear()}applyInitialSize(){const r=this.node.attrs.width,o=this.node.attrs.height;r?(this.element.style.width=`${r}px`,this.initialWidth=r):this.initialWidth=this.element.offsetWidth,o?(this.element.style.height=`${o}px`,this.initialHeight=o):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(r,o){r.preventDefault(),r.stopPropagation(),this.isResizing=!0,this.activeHandle=o,"touches"in r?(this.startX=r.touches[0].clientX,this.startY=r.touches[0].clientY):(this.startX=r.clientX,this.startY=r.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight);this.getPos();this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(r,o){if(!this.activeHandle)return;const i=this.preserveAspectRatio||this.isShiftKeyPressed,{width:a,height:c}=this.calculateNewDimensions(this.activeHandle,r,o),u=this.applyConstraints(a,c,i);this.element.style.width=`${u.width}px`,this.element.style.height=`${u.height}px`,this.onResize&&this.onResize(u.width,u.height)}calculateNewDimensions(r,o,i){let a=this.startWidth,c=this.startHeight;const u=r.includes("right"),p=r.includes("left"),g=r.includes("bottom"),v=r.includes("top");u?a=this.startWidth+o:p&&(a=this.startWidth-o),g?c=this.startHeight+i:v&&(c=this.startHeight-i),"right"!==r&&"left"!==r||(a=this.startWidth+(u?o:-o)),"top"!==r&&"bottom"!==r||(c=this.startHeight+(g?i:-i));return this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(a,c,r):{width:a,height:c}}applyConstraints(r,o,i){var a,c,u,p;if(!i){let i=Math.max(this.minSize.width,r),u=Math.max(this.minSize.height,o);return(null==(a=this.maxSize)?void 0:a.width)&&(i=Math.min(this.maxSize.width,i)),(null==(c=this.maxSize)?void 0:c.height)&&(u=Math.min(this.maxSize.height,u)),{width:i,height:u}}let g=r,v=o;return g<this.minSize.width&&(g=this.minSize.width,v=g/this.aspectRatio),v<this.minSize.height&&(v=this.minSize.height,g=v*this.aspectRatio),(null==(u=this.maxSize)?void 0:u.width)&&g>this.maxSize.width&&(g=this.maxSize.width,v=g/this.aspectRatio),(null==(p=this.maxSize)?void 0:p.height)&&v>this.maxSize.height&&(v=this.maxSize.height,g=v*this.aspectRatio),{width:g,height:v}}applyAspectRatio(r,o,i){const a="top"===i||"bottom"===i;return"left"===i||"right"===i?{width:r,height:r/this.aspectRatio}:a?{width:o*this.aspectRatio,height:o}:{width:r,height:r/this.aspectRatio}}},lt=st,ct=i(49162);function canInsertNode(r,o){const{selection:i}=r,{$from:a}=i;if(i instanceof ct.NodeSelection){const r=a.index();return a.parent.canReplaceWith(r,r+1,o)}let c=a.depth;for(;c>=0;){const r=a.index(c);if(a.node(c).contentMatchAt(r).matchType(o))return!0;c-=1}return!1}function escapeForRegEx(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function isFirefox(){return"undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent)}function isString(r){return"string"==typeof r}var ut={};function parseAttributes(r){if(!(null==r?void 0:r.trim()))return{};const o={},i=[],a=r.replace(/["']([^"']*)["']/g,r=>(i.push(r),`__QUOTED_${i.length-1}__`)),c=a.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(c){const r=c.map(r=>r.trim().slice(1));o.class=r.join(" ")}const u=a.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);u&&(o.id=u[1]);Array.from(a.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,r,a])=>{var c;const u=parseInt((null==(c=a.match(/__QUOTED_(\d+)__/))?void 0:c[1])||"0",10),p=i[u];p&&(o[r]=p.slice(1,-1))});const p=a.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();if(p){p.split(/\s+/).filter(Boolean).forEach(r=>{r.match(/^[a-zA-Z][\w-]*$/)&&(o[r]=!0)})}return o}function serializeAttributes(r){if(!r||0===Object.keys(r).length)return"";const o=[];if(r.class){String(r.class).split(/\s+/).filter(Boolean).forEach(r=>o.push(`.${r}`))}return r.id&&o.push(`#${r.id}`),Object.entries(r).forEach(([r,i])=>{"class"!==r&&"id"!==r&&(!0===i?o.push(r):!1!==i&&null!=i&&o.push(`${r}="${String(i)}"`))}),o.join(" ")}function createAtomBlockMarkdownSpec(r){const{nodeName:o,name:i,parseAttributes:a=parseAttributes,serializeAttributes:c=serializeAttributes,defaultAttributes:u={},requiredAttributes:p=[],allowedAttributes:g}=r,v=i||o;return{parseMarkdown:(r,i)=>{const a={...u,...r.attributes};return i.createNode(o,a,[])},markdownTokenizer:{name:o,level:"block",start(r){var o;const i=new RegExp(`^:::${v}(?:\\s|$)`,"m"),a=null==(o=r.match(i))?void 0:o.index;return void 0!==a?a:-1},tokenize(r,i,c){const u=new RegExp(`^:::${v}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),g=r.match(u);if(!g)return;const b=g[1]||"",k=a(b);return p.find(r=>!(r in k))?void 0:{type:o,raw:g[0],attributes:k}}},renderMarkdown:r=>{const o=(r=>{if(!g)return r;const o={};return g.forEach(i=>{i in r&&(o[i]=r[i])}),o})(r.attrs||{}),i=c(o);return`:::${v}${i?` {${i}}`:""} :::`}}}function createBlockMarkdownSpec(r){const{nodeName:o,name:i,getContent:a,parseAttributes:c=parseAttributes,serializeAttributes:u=serializeAttributes,defaultAttributes:p={},content:g="block",allowedAttributes:v}=r,b=i||o;return{parseMarkdown:(r,i)=>{let c;if(a){const o=a(r);c="string"==typeof o?[{type:"text",text:o}]:o}else c="block"===g?i.parseChildren(r.tokens||[]):i.parseInline(r.tokens||[]);const u={...p,...r.attributes};return i.createNode(o,u,c)},markdownTokenizer:{name:o,level:"block",start(r){var o;const i=new RegExp(`^:::${b}`,"m"),a=null==(o=r.match(i))?void 0:o.index;return void 0!==a?a:-1},tokenize(r,i,a){var u;const p=new RegExp(`^:::${b}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),v=r.match(p);if(!v)return;const[k,E=""]=v,w=c(E);let x=1;const C=k.length;let _="";const T=/^:::([\w-]*)(\s.*)?/gm,P=r.slice(C);for(T.lastIndex=0;;){const i=T.exec(P);if(null===i)break;const c=i.index,p=i[1];if(!(null==(u=i[2])?void 0:u.endsWith(":::")))if(p)x+=1;else if(x-=1,0===x){const u=P.slice(0,c);_=u.trim();const p=r.slice(0,C+c+i[0].length);let v=[];if(_)if("block"===g)for(v=a.blockTokens(u),v.forEach(r=>{!r.text||r.tokens&&0!==r.tokens.length||(r.tokens=a.inlineTokens(r.text))});v.length>0;){const r=v[v.length-1];if("paragraph"!==r.type||r.text&&""!==r.text.trim())break;v.pop()}else v=a.inlineTokens(_);return{type:o,raw:p,attributes:w,content:_,tokens:v}}}}},renderMarkdown:(r,o)=>{const i=(r=>{if(!v)return r;const o={};return v.forEach(i=>{i in r&&(o[i]=r[i])}),o})(r.attrs||{}),a=u(i),c=a?` {${a}}`:"",p=o.renderChildren(r.content||[],"\n\n");return`:::${b}${c}\n\n${p}\n\n:::`}}}function parseShortcodeAttributes(r){if(!r.trim())return{};const o={},i=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let a=i.exec(r);for(;null!==a;){const[,c,u,p]=a;o[c]=u||p,a=i.exec(r)}return o}function serializeShortcodeAttributes(r){return Object.entries(r).filter(([,r])=>null!=r).map(([r,o])=>`${r}="${o}"`).join(" ")}function createInlineMarkdownSpec(r){const{nodeName:o,name:i,getContent:a,parseAttributes:c=parseShortcodeAttributes,serializeAttributes:u=serializeShortcodeAttributes,defaultAttributes:p={},selfClosing:g=!1,allowedAttributes:v}=r,b=i||o,k=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(r,i)=>{const c={...p,...r.attributes};if(g)return i.createNode(o,c);const u=a?a(r):r.content||"";return u?i.createNode(o,c,[i.createTextNode(u)]):i.createNode(o,c,[])},markdownTokenizer:{name:o,level:"inline",start(r){const o=g?new RegExp(`\\[${k}\\s*[^\\]]*\\]`):new RegExp(`\\[${k}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${k}\\]`),i=r.match(o),a=null==i?void 0:i.index;return void 0!==a?a:-1},tokenize(r,i,a){const u=g?new RegExp(`^\\[${k}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${k}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${k}\\]`),p=r.match(u);if(!p)return;let v="",b="";if(g){const[,r]=p;b=r}else{const[,r,o]=p;b=r,v=o||""}const E=c(b.trim());return{type:o,raw:p[0],content:v.trim(),attributes:E}}},renderMarkdown:r=>{let o="";a?o=a(r):r.content&&r.content.length>0&&(o=r.content.filter(r=>"text"===r.type).map(r=>r.text).join(""));const i=(r=>{if(!v)return r;const o={};return v.forEach(i=>{const a="string"==typeof i?i:i.name,c="string"==typeof i?void 0:i.skipIfDefault;if(a in r){const i=r[a];if(void 0!==c&&i===c)return;o[a]=i}}),o})(r.attrs||{}),c=u(i),p=c?` ${c}`:"";return g?`[${b}${p}]`:`[${b}${p}]${o}[/${b}]`}}}function parseIndentedBlocks(r,o,i){var a,c,u,p;const g=r.split("\n"),v=[];let b="",k=0;const E=o.baseIndentSize||2;for(;k<g.length;){const r=g[k],w=r.match(o.itemPattern);if(!w){if(v.length>0)break;if(""===r.trim()){k+=1,b=`${b}${r}\n`;continue}return}const x=o.extractItemData(w),{indentLevel:C,mainContent:_}=x;b=`${b}${r}\n`;const T=[_];for(k+=1;k<g.length;){const r=g[k];if(""===r.trim()){const o=g.slice(k+1).findIndex(r=>""!==r.trim());if(-1===o)break;if(((null==(c=null==(a=g[k+1+o].match(/^(\s*)/))?void 0:a[1])?void 0:c.length)||0)>C){T.push(r),b=`${b}${r}\n`,k+=1;continue}break}if(!(((null==(p=null==(u=r.match(/^(\s*)/))?void 0:u[1])?void 0:p.length)||0)>C))break;T.push(r),b=`${b}${r}\n`,k+=1}let P;const A=T.slice(1);if(A.length>0){const r=A.map(r=>r.slice(C+E)).join("\n");r.trim()&&(P=o.customNestedParser?o.customNestedParser(r):i.blockTokens(r))}const N=o.createToken(x,P);v.push(N)}if(0!==v.length)return{items:v,raw:b}}function renderNestedMarkdownContent(r,o,i,a){if(!r||!Array.isArray(r.content))return"";const c="function"==typeof i?i(a):i,[u,...p]=r.content,g=[`${c}${o.renderChildren([u])}`];return p&&p.length>0&&p.forEach(r=>{const i=o.renderChildren([r]);if(i){const r=i.split("\n").map(r=>r?o.indent(r):"").join("\n");g.push(r)}}),g.join("\n")}function updateMarkViewAttributes(r,o,i={}){const{state:a}=o,{doc:c,tr:u}=a,p=r;c.descendants((o,a)=>{const c=u.mapping.map(a),g=u.mapping.map(a)+o.nodeSize;let v=null;if(o.marks.forEach(r=>{if(r!==p)return!1;v=r}),!v)return;let b=!1;if(Object.keys(i).forEach(r=>{i[r]!==v.attrs[r]&&(b=!0)}),b){const o=r.type.create({...r.attrs,...i});u.removeMark(c,g,r.type),u.addMark(c,g,o)}}),u.docChanged&&o.view.dispatch(u)}__export(ut,{createAtomBlockMarkdownSpec:()=>createAtomBlockMarkdownSpec,createBlockMarkdownSpec:()=>createBlockMarkdownSpec,createInlineMarkdownSpec:()=>createInlineMarkdownSpec,parseAttributes:()=>parseAttributes,parseIndentedBlocks:()=>parseIndentedBlocks,renderNestedMarkdownContent:()=>renderNestedMarkdownContent,serializeAttributes:()=>serializeAttributes});var pt=class{constructor(r,o,i){this.component=r,this.editor=o.editor,this.options={...i},this.mark=o.mark,this.HTMLAttributes=o.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(r,o){updateMarkViewAttributes(o||this.mark,this.editor,r)}ignoreMutation(r){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:r});if("selection"===r.type)return!1;if(this.dom.contains(r.target)&&"childList"===r.type&&(isiOS()||isAndroid())&&this.editor.isFocused){if([...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(r=>r.isContentEditable))return!1}return this.contentDOM===r.target&&"attributes"===r.type||!this.contentDOM.contains(r.target)}},dt=class _Node extends Oe{constructor(){super(...arguments),this.type="node"}static create(r={}){const o="function"==typeof r?r():r;return new _Node(o)}configure(r){return super.configure(r)}extend(r){const o="function"==typeof r?r():r;return super.extend(o)}},ft=i(49162),ht=class{constructor(r,o,i){this.isDragging=!1,this.component=r,this.editor=o.editor,this.options={stopEvent:null,ignoreMutation:null,...i},this.extension=o.extension,this.node=o.node,this.decorations=o.decorations,this.innerDecorations=o.innerDecorations,this.view=o.view,this.HTMLAttributes=o.HTMLAttributes,this.getPos=o.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(r){var o,i,a,c,u,p,g;const{view:v}=this.editor,b=r.target,k=3===b.nodeType?null==(o=b.parentElement)?void 0:o.closest("[data-drag-handle]"):b.closest("[data-drag-handle]");if(!this.dom||(null==(i=this.contentDOM)?void 0:i.contains(b))||!k)return;let E=0,w=0;if(this.dom!==k){const o=this.dom.getBoundingClientRect(),i=k.getBoundingClientRect(),g=null!=(c=r.offsetX)?c:null==(a=r.nativeEvent)?void 0:a.offsetX,v=null!=(p=r.offsetY)?p:null==(u=r.nativeEvent)?void 0:u.offsetY;E=i.x-o.x+g,w=i.y-o.y+v}const x=this.dom.cloneNode(!0);try{const r=this.dom.getBoundingClientRect();x.style.width=`${Math.round(r.width)}px`,x.style.height=`${Math.round(r.height)}px`,x.style.boxSizing="border-box",x.style.pointerEvents="none"}catch{}let C=null;try{C=document.createElement("div"),C.style.position="absolute",C.style.top="-9999px",C.style.left="-9999px",C.style.pointerEvents="none",C.appendChild(x),document.body.appendChild(C),null==(g=r.dataTransfer)||g.setDragImage(x,E,w)}finally{C&&setTimeout(()=>{try{null==C||C.remove()}catch{}},0)}const _=this.getPos();if("number"!=typeof _)return;const T=ft.NodeSelection.create(v.state.doc,_),P=v.state.tr.setSelection(T);v.dispatch(P)}stopEvent(r){var o;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:r});const i=r.target;if(!(this.dom.contains(i)&&!(null==(o=this.contentDOM)?void 0:o.contains(i))))return!1;const a=r.type.startsWith("drag"),c="drop"===r.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(i.tagName)||i.isContentEditable)&&!c&&!a)return!0;const{isEditable:u}=this.editor,{isDragging:p}=this,g=!!this.node.type.spec.draggable,v=ft.NodeSelection.isSelectable(this.node),b="copy"===r.type,k="paste"===r.type,E="cut"===r.type,w="mousedown"===r.type;if(!g&&v&&a&&r.target===this.dom&&r.preventDefault(),g&&a&&!p&&r.target===this.dom)return r.preventDefault(),!1;if(g&&u&&!p&&w){const r=i.closest("[data-drag-handle]");r&&(this.dom===r||this.dom.contains(r))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(p||c||b||k||E||w&&v)}ignoreMutation(r){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:r});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===r.type)return!1;if(this.dom.contains(r.target)&&"childList"===r.type&&(isiOS()||isAndroid())&&this.editor.isFocused){if([...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(r=>r.isContentEditable))return!1}return this.contentDOM===r.target&&"attributes"===r.type||!this.contentDOM.contains(r.target)}updateAttributes(r){this.editor.commands.command(({tr:o})=>{const i=this.getPos();return"number"==typeof i&&(o.setNodeMarkup(i,void 0,{...this.node.attrs,...r}),!0)})}deleteNode(){const r=this.getPos();if("number"!=typeof r)return;const o=r+this.node.nodeSize;this.editor.commands.deleteRange({from:r,to:o})}};function markPasteRule(r){return new Ne({find:r.find,handler:({state:o,range:i,match:a,pasteEvent:c})=>{const u=callOrReturn(r.getAttributes,void 0,a,c);if(!1===u||null===u)return null;const{tr:p}=o,g=a[a.length-1],v=a[0];let b=i.to;if(g){const a=v.search(/\S/),c=i.from+v.indexOf(g),k=c+g.length;if(getMarksBetween(i.from,i.to,o.doc).filter(o=>o.mark.type.excluded.find(i=>i===r.type&&i!==o.mark.type)).filter(r=>r.to>c).length)return null;k<i.to&&p.delete(k,i.to),c>i.from&&p.delete(i.from+a,c),b=i.from+a+g.length,p.addMark(i.from+a,b,r.type.create(u||{})),p.removeStoredMark(r.type)}}})}function nodePasteRule(r){return new Ne({find:r.find,handler({match:o,chain:i,range:a,pasteEvent:c}){const u=callOrReturn(r.getAttributes,void 0,o,c),p=callOrReturn(r.getContent,void 0,u);if(!1===u||null===u)return null;const g={type:r.type.name,attrs:u};p&&(g.content=p),o.input&&i().deleteRange(a).insertContentAt(a.from,g)}})}function textPasteRule(r){return new Ne({find:r.find,handler:({state:o,range:i,match:a})=>{let c=r.replace,u=i.from;const p=i.to;if(a[1]){const r=a[0].lastIndexOf(a[1]);c+=a[0].slice(r+a[1].length),u+=r;const o=u-p;o>0&&(c=a[0].slice(r-o,r)+c,u=p)}o.tr.insertText(c,u,p)}})}var mt=class{constructor(r){this.transaction=r,this.currentStep=this.transaction.steps.length}map(r){let o=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((r,i)=>{const a=i.getMap().mapResult(r);return a.deleted&&(o=!0),a.pos},r),deleted:o}}}}},o={};function __webpack_require__(i){var a=o[i];if(void 0!==a)return a.exports;var c=o[i]={exports:{}};return r[i].call(c.exports,c,c.exports,__webpack_require__),c.exports}__webpack_require__.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return __webpack_require__.d(o,{a:o}),o},__webpack_require__.d=function(r,o){for(var i in o)__webpack_require__.o(o,i)&&!__webpack_require__.o(r,i)&&Object.defineProperty(r,i,{enumerable:!0,get:o[i]})},__webpack_require__.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},__webpack_require__.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var i=__webpack_require__(40002);(window.elementorV2=window.elementorV2||{}).editorControls=i}(),window.elementorV2.editorControls?.init?.(); | |
| 78 | +`,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(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=(0,Ui.getContainer)(t.id);if(!n?.children)return[];const r=[];return n.children.forEachRecursive?.(t=>{const n=t.model.get("widgetType");if(!n||!lx.includes(n))return;if(e?.inputType){const n=t.settings.get("type");if(((0,o.isTransformable)(n)?n.value:n)!==e.inputType)return}const i=t.settings.get("_cssid"),s=(0,o.isTransformable)(i)?i.value:i;s&&"string"==typeof s&&r.push({label:s,value:s})}),r},[])}function cx(){return cx=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},cx.apply(null,arguments)}const ux=({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})))),px=({placeholder:t})=>e.createElement(ux,{bind:"to",label:(0,s.__)("Send to","elementor"),placeholder:t}),dx=()=>e.createElement(ux,{bind:"subject",label:(0,s.__)("Email subject","elementor"),placeholder:(0,s.__)("New form submission","elementor")}),hx=()=>{const t=ax();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")))))},fx=()=>e.createElement(ux,{bind:"from",label:(0,s.__)("From email","elementor"),placeholder:(0,s.__)("What email should appear as the sender?","elementor")}),mx=()=>e.createElement(ux,{bind:"from-name",label:(0,s.__)("From name","elementor"),placeholder:(0,s.__)("What name should appear as the sender?","elementor")}),gx=()=>{const t=ax({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")}))))},yx=()=>e.createElement(ux,{bind:"cc",label:(0,s.__)("Cc","elementor")}),vx=()=>e.createElement(ux,{bind:"bcc",label:(0,s.__)("Bcc","elementor")}),bx=()=>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"}]}))),Ex=()=>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"}]})))),wx=()=>e.createElement(G.CollapsibleContent,{defaultOpen:!1},e.createElement(i.Box,{sx:{pt:2}},e.createElement(i.Stack,{gap:2},e.createElement(mx,null),e.createElement(gx,null),e.createElement(yx,null),e.createElement(vx,null),e.createElement(i.Divider,null),e.createElement(bx,null),e.createElement(Ex,null)))),xx=D(({toPlaceholder:t})=>{const{value:n,setValue:r,...l}=b(o.emailPropTypeUtil);return e.createElement(d,cx({},l,{value:n,setValue:r}),e.createElement(i.Stack,{gap:2},e.createElement(A,null,(0,s.__)("Email settings","elementor")),e.createElement(px,{placeholder:t}),e.createElement(dx,null),e.createElement(hx,null),e.createElement(fx,null),e.createElement(wx,null)))}),kx=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"))))),Sx=(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))))}),Cx=(0,s.__)("Display Conditions","elementor"),Tx={target_name:"display_conditions",location_l2:"general"},Ox=D(()=>{const t=(0,e.useRef)(null);return e.createElement(i.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",alignItems:"center"}},e.createElement(Sx,{ref:t,promotionKey:"displayConditions",trackingData:Tx}),e.createElement(i.Tooltip,{title:Cx,placement:"top"},e.createElement(i.IconButton,{size:"tiny","aria-label":Cx,"data-behavior":"display-conditions",onClick:()=>t.current?.toggle(),sx:{border:"1px solid",borderColor:"divider",borderRadius:1}},e.createElement(H.SitemapIcon,{fontSize:"tiny",color:"disabled"}))))}),Ax=(0,s.__)("Attributes","elementor"),Mx={target_name:"attributes",location_l2:"general"},Px=D(()=>{const t=(0,e.useRef)(null);return e.createElement(i.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",alignItems:"center"}},e.createElement(Sx,{ref:t,promotionKey:"attributes",trackingData:Mx}),e.createElement(i.Tooltip,{title:Ax,placement:"top"},e.createElement(H.PlusIcon,{"aria-label":Ax,fontSize:"tiny",color:"disabled",onClick:()=>t.current?.toggle(),sx:{cursor:"pointer"}})))}),Ix=(0,i.styled)(i.IconButton)(({theme:e})=>({width:e.spacing(2.5),height:e.spacing(2.5)})),_x=({tooltipText:t,onClick:n,disabled:r,size:o="tiny"})=>e.createElement(i.Tooltip,{title:t,placement:"top",disableInteractive:!0},e.createElement(Ix,{"aria-label":t,size:o,onClick:n,disabled:r},e.createElement(H.BrushBigIcon,{fontSize:o})));function Nx(){return Nx=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},Nx.apply(null,arguments)}const Rx="tiny",Dx=({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:Rx,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:Rx}));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(Lx,{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,Nx({},t,{value:s,bind:String(i),index:i})))):null})))},Lx=({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}=zx(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,Nx({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:Rx,onClick:a,"aria-label":T},e.createElement(H.CopyIcon,{fontSize:Rx}))),m&&e.createElement(i.Tooltip,{title:O,placement:"top"},e.createElement(i.IconButton,{size:Rx,onClick:c,"aria-label":O},n?e.createElement(H.EyeOffIcon,{fontSize:Rx}):e.createElement(H.EyeIcon,{fontSize:Rx}))),v?.(b),g&&e.createElement(i.Tooltip,{title:A,placement:"top"},e.createElement(i.IconButton,{size:Rx,onClick:l,"aria-label":A},e.createElement(H.XIcon,{fontSize:Rx}))))})),e.createElement(Yr,Nx({width:k?.getBoundingClientRect().width},x,{anchorEl:k}),e.createElement(i.Box,null,o({anchorEl:k}))))},zx=(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 jx(){return jx=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},jx.apply(null,arguments)}const $x=({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,jx({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"})))))},Bx=({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&&Fx(n),d=Hw({editor:t,selector:e=>Wx.filter(t=>e.editor.isActive(t))}),h=(0,e.useMemo)(()=>{const e=Object.values(Hx);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:Vx.label,placement:"top",sx:{borderRadius:"8px"}},e.createElement(i.IconButton,{"aria-label":Vx.label,onClick:()=>Vx.method(t),size:"tiny"},Vx.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($x,{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)}}))},Fx=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},Ux={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:Vx,...Hx}=Ux,Wx=Object.keys(Hx);function Gx(){return Gx=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},Gx.apply(null,arguments)}const Kx={display:"flex",flexDirection:"column",justifyContent:"center"},qx=({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(Jx,Gx({isPrimaryColor:n,size:"small"},(0,i.bindTrigger)(s)),t),e.createElement(i.Menu,Gx({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:{...Kx,lineHeight:"1"}},menuItemTextProps:{sx:Kx}},t.toUpperCase()))))},Jx=(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"})),Yx=(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:Xx(s?.readOnly??!1)})),Xx=e=>({input:{cursor:e?"default !important":void 0}}),Qx=({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(Yx,{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(qx,{options:s,value:u,onClick:d,showPrimaryColor:Zx(c)}))}})},Zx=e=>null!==e&&""!==e,ek=()=>{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?.(); | |