| 1 |
(globalThis.webpackChunkbooktics=globalThis.webpackChunkbooktics||[]).push([[8731],{659:(e,t,n)=>{var o=n(51873),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,s=o?o.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var o=!0}catch(e){}var r=a.call(e);return o&&(t?e[s]=n:delete e[s]),r}},1882:(e,t,n)=>{var o=n(72552),r=n(23805);e.exports=function(e){if(!r(e))return!1;var t=o(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},2404:(e,t,n)=>{var o=n(60270);e.exports=function(e,t){return o(e,t)}},3650:(e,t,n)=>{var o=n(74335)(Object.keys,Object);e.exports=o},3656:(e,t,n)=>{e=n.nmd(e);var o=n(9325),r=n(89935),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?o.Buffer:void 0,l=(s?s.isBuffer:void 0)||r;e.exports=l},4509:(e,t,n)=>{var o=n(12651);e.exports=function(e){return o(this,e).has(e)}},4664:(e,t,n)=>{var o=n(79770),r=n(63345),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),o(a(e),function(t){return i.call(e,t)}))}:r;e.exports=s},4901:(e,t,n)=>{var o=n(72552),r=n(30294),i=n(40346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&r(e.length)&&!!a[o(e)]}},5861:(e,t,n)=>{var o=n(55580),r=n(68223),i=n(32804),a=n(76545),s=n(28303),l=n(72552),c=n(47473),u="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",g=c(o),y=c(r),m=c(i),v=c(a),b=c(s),w=l;(o&&w(new o(new ArrayBuffer(1)))!=p||r&&w(new r)!=u||i&&w(i.resolve())!=d||a&&w(new a)!=f||s&&w(new s)!=h)&&(w=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,o=n?c(n):"";if(o)switch(o){case g:return p;case y:return u;case m:return d;case v:return f;case b:return h}return t}),e.exports=w},8999:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},9325:(e,t,n)=>{var o=n(34840),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();e.exports=i},10392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},12651:(e,t,n)=>{var o=n(74218);e.exports=function(e,t){var n=e.__data__;return o(t)?n["string"==typeof t?"string":"hash"]:n.map}},12749:(e,t,n)=>{var o=n(81042),r=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return o?void 0!==t[e]:r.call(t,e)}},14248:e=>{e.exports=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1}},14528:e=>{e.exports=function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}},17670:(e,t,n)=>{var o=n(12651);e.exports=function(e){var t=o(this,e).delete(e);return this.size-=t?1:0,t}},19219:e=>{e.exports=function(e,t){return e.has(t)}},20317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,o){n[++t]=[o,e]}),n}},21020:(e,t,n)=>{"use strict";var o=n(51609),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var o,i={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,o)&&!l.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:r,type:e,key:c,ref:u,props:i,_owner:s.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},21549:(e,t,n)=>{var o=n(22032),r=n(63862),i=n(66721),a=n(12749),s=n(35749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}l.prototype.clear=o,l.prototype.delete=r,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},21986:(e,t,n)=>{var o=n(51873),r=n(37828),i=n(75288),a=n(25911),s=n(20317),l=n(84247),c=o?o.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,o,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=s;case"[object Set]":var p=1&o;if(h||(h=l),e.size!=t.size&&!p)return!1;var g=f.get(e);if(g)return g==t;o|=2,f.set(e,t);var y=a(h(e),h(t),o,c,d,f);return f.delete(e),y;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},22032:(e,t,n)=>{var o=n(81042);e.exports=function(){this.__data__=o?o(null):{},this.size=0}},23805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},24739:(e,t,n)=>{var o=n(26025);e.exports=function(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]}},25911:(e,t,n)=>{var o=n(38859),r=n(14248),i=n(19219);e.exports=function(e,t,n,a,s,l){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=l.get(e),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,g=!0,y=2&n?new o:void 0;for(l.set(e,t),l.set(t,e);++p<u;){var m=e[p],v=t[p];if(a)var b=c?a(v,m,p,t,e,l):a(m,v,p,e,t,l);if(void 0!==b){if(b)continue;g=!1;break}if(y){if(!r(t,function(e,t){if(!i(y,t)&&(m===e||s(m,e,n,a,l)))return y.push(t)})){g=!1;break}}else if(m!==v&&!s(m,v,n,a,l)){g=!1;break}}return l.delete(e),l.delete(t),g}},26025:(e,t,n)=>{var o=n(75288);e.exports=function(e,t){for(var n=e.length;n--;)if(o(e[n][0],t))return n;return-1}},27301:e=>{e.exports=function(e){return function(t){return e(t)}}},27534:(e,t,n)=>{var o=n(72552),r=n(40346);e.exports=function(e){return r(e)&&"[object Arguments]"==o(e)}},28303:(e,t,n)=>{var o=n(56110)(n(9325),"WeakMap");e.exports=o},29817:e=>{e.exports=function(e){return this.__data__.has(e)}},30294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},30361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var o=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==o||"symbol"!=o&&t.test(e))&&e>-1&&e%1==0&&e<n}},31175:(e,t,n)=>{var o=n(26025);e.exports=function(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}},32804:(e,t,n)=>{var o=n(56110)(n(9325),"Promise");e.exports=o},34840:(e,t,n)=>{var o="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=o},35749:(e,t,n)=>{var o=n(81042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=o&&void 0===t?"__lodash_hash_undefined__":t,this}},37167:(e,t,n)=>{var o=n(4901),r=n(27301),i=n(86009),a=i&&i.isTypedArray,s=a?r(a):o;e.exports=s},37217:(e,t,n)=>{var o=n(80079),r=n(51420),i=n(90938),a=n(63605),s=n(29817),l=n(80945);function c(e){var t=this.__data__=new o(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=l,e.exports=c},37828:(e,t,n)=>{var o=n(9325).Uint8Array;e.exports=o},38859:(e,t,n)=>{var o=n(53661),r=n(8999),i=n(51459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new o;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,e.exports=a},40346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},45083:(e,t,n)=>{var o=n(1882),r=n(87296),i=n(23805),a=n(47473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,f=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||r(e))&&(o(e)?f:s).test(a(e))}},45708:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},o(e,t)},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)},a=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},l=s(n(51609)),c=s(n(75795)),u=s(n(2404)),d=s(n(91574)),f=function(e){function t(t){var n=e.call(this,t)||this;n.dirtyProps=["modules","formats","bounds","theme","children"],n.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],n.state={generation:0},n.selection=null,n.onEditorChange=function(e,t,o,r){var i,a,s,l;"text-change"===e?null===(a=(i=n).onEditorChangeText)||void 0===a||a.call(i,n.editor.root.innerHTML,t,r,n.unprivilegedEditor):"selection-change"===e&&(null===(l=(s=n).onEditorChangeSelection)||void 0===l||l.call(s,t,r,n.unprivilegedEditor))};var o=n.isControlled()?t.value:t.defaultValue;return n.value=null!=o?o:"",n}return r(t,e),t.prototype.validateProps=function(e){var t;if(l.default.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(l.default.Children.count(e.children)&&"textarea"===(null===(t=l.default.Children.only(e.children))||void 0===t?void 0:t.type))throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.");if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")},t.prototype.shouldComponentUpdate=function(e,t){var n,o=this;if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if("value"in e){var r=this.getEditorContents(),i=null!=(n=e.value)?n:"";this.isEqualValue(i,r)||this.setEditorContents(this.editor,i)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),a(this.cleanProps,this.dirtyProps).some(function(t){return!u.default(e[t],o.props[t])})},t.prototype.shouldComponentRegenerate=function(e){var t=this;return this.dirtyProps.some(function(n){return!u.default(e[n],t.props[n])})},t.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},t.prototype.componentWillUnmount=function(){this.destroyEditor()},t.prototype.componentDidUpdate=function(e,t){var n=this;if(this.editor&&this.shouldComponentRegenerate(e)){var o=this.editor.getContents(),r=this.editor.getSelection();this.regenerationSnapshot={delta:o,selection:r},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){var i=this.regenerationSnapshot,a=(o=i.delta,i.selection);delete this.regenerationSnapshot,this.instantiateEditor();var s=this.editor;s.setContents(o),h(function(){return n.setEditorSelection(s,a)})}},t.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},t.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},t.prototype.isControlled=function(){return"value"in this.props},t.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},t.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},t.prototype.createEditor=function(e,t){var n=new d.default(e,t);return null!=t.tabIndex&&this.setEditorTabIndex(n,t.tabIndex),this.hookEditor(n),n},t.prototype.hookEditor=function(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on("editor-change",this.onEditorChange)},t.prototype.unhookEditor=function(e){e.off("editor-change",this.onEditorChange)},t.prototype.getEditorContents=function(){return this.value},t.prototype.getEditorSelection=function(){return this.selection},t.prototype.isDelta=function(e){return e&&e.ops},t.prototype.isEqualValue=function(e,t){return this.isDelta(e)&&this.isDelta(t)?u.default(e.ops,t.ops):u.default(e,t)},t.prototype.setEditorContents=function(e,t){var n=this;this.value=t;var o=this.getEditorSelection();"string"==typeof t?e.setContents(e.clipboard.convert(t)):e.setContents(t),h(function(){return n.setEditorSelection(e,o)})},t.prototype.setEditorSelection=function(e,t){if(this.selection=t,t){var n=e.getLength();t.index=Math.max(0,Math.min(t.index,n-1)),t.length=Math.max(0,Math.min(t.length,n-1-t.index)),e.setSelection(t)}},t.prototype.setEditorTabIndex=function(e,t){var n,o;(null===(o=null===(n=e)||void 0===n?void 0:n.scroll)||void 0===o?void 0:o.domNode)&&(e.scroll.domNode.tabIndex=t)},t.prototype.setEditorReadOnly=function(e,t){t?e.disable():e.enable()},t.prototype.makeUnprivilegedEditor=function(e){var t=e;return{getHTML:function(){return t.root.innerHTML},getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}},t.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var e=c.default.findDOMNode(this.editingArea);if(!e)throw new Error("Cannot find element for editing area");if(3===e.nodeType)throw new Error("Editing area cannot be a text node");return e},t.prototype.renderEditingArea=function(){var e=this,t=this.props,n=t.children,o=t.preserveWhitespace,r={key:this.state.generation,ref:function(t){e.editingArea=t}};return l.default.Children.count(n)?l.default.cloneElement(l.default.Children.only(n),r):o?l.default.createElement("pre",i({},r)):l.default.createElement("div",i({},r))},t.prototype.render=function(){var e;return l.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(e=this.props.className,null!=e?e:""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},t.prototype.onEditorChangeText=function(e,t,n,o){var r,i;if(this.editor){var a=this.isDelta(this.value)?o.getContents():o.getHTML();a!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=a,null===(i=(r=this.props).onChange)||void 0===i||i.call(r,e,t,n,o))}},t.prototype.onEditorChangeSelection=function(e,t,n){var o,r,i,a,s,l;if(this.editor){var c=this.getEditorSelection(),d=!c&&e,f=c&&!e;u.default(e,c)||(this.selection=e,null===(r=(o=this.props).onChangeSelection)||void 0===r||r.call(o,e,t,n),d?null===(a=(i=this.props).onFocus)||void 0===a||a.call(i,e,t,n):f&&(null===(l=(s=this.props).onBlur)||void 0===l||l.call(s,c,t,n)))}},t.prototype.focus=function(){this.editor&&this.editor.focus()},t.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},t.displayName="React Quill",t.Quill=d.default,t.defaultProps={theme:"snow",modules:{},readOnly:!1},t}(l.default.Component);function h(e){Promise.resolve().then(e)}e.exports=f},47473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},48655:(e,t,n)=>{var o=n(26025);e.exports=function(e){return o(this.__data__,e)>-1}},50002:(e,t,n)=>{var o=n(82199),r=n(4664),i=n(95950);e.exports=function(e){return o(e,i,r)}},50689:(e,t,n)=>{var o=n(50002),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,a,s){var l=1&n,c=o(e),u=c.length;if(u!=o(t).length&&!l)return!1;for(var d=u;d--;){var f=c[d];if(!(l?f in t:r.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var y=l;++d<u;){var m=e[f=c[d]],v=t[f];if(i)var b=l?i(v,m,f,t,e,s):i(m,v,f,e,t,s);if(!(void 0===b?m===v||a(m,v,n,i,s):b)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var w=e.constructor,x=t.constructor;w==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof x&&x instanceof x||(g=!1)}return s.delete(e),s.delete(t),g}},51420:(e,t,n)=>{var o=n(80079);e.exports=function(){this.__data__=new o,this.size=0}},51459:e=>{e.exports=function(e){return this.__data__.has(e)}},51873:(e,t,n)=>{var o=n(9325).Symbol;e.exports=o},53661:(e,t,n)=>{var o=n(63040),r=n(17670),i=n(90289),a=n(4509),s=n(72949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}l.prototype.clear=o,l.prototype.delete=r,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},55481:(e,t,n)=>{var o=n(9325)["__core-js_shared__"];e.exports=o},55527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},55580:(e,t,n)=>{var o=n(56110)(n(9325),"DataView");e.exports=o},56110:(e,t,n)=>{var o=n(45083),r=n(10392);e.exports=function(e,t){var n=r(e,t);return o(n)?n:void 0}},56449:e=>{var t=Array.isArray;e.exports=t},59350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},60270:(e,t,n)=>{var o=n(87068),r=n(40346);e.exports=function e(t,n,i,a,s){return t===n||(null==t||null==n||!r(t)&&!r(n)?t!=t&&n!=n:o(t,n,i,a,e,s))}},63040:(e,t,n)=>{var o=n(21549),r=n(80079),i=n(68223);e.exports=function(){this.size=0,this.__data__={hash:new o,map:new(i||r),string:new o}}},63345:e=>{e.exports=function(){return[]}},63605:e=>{e.exports=function(e){return this.__data__.get(e)}},63702:e=>{e.exports=function(){this.__data__=[],this.size=0}},63862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},64894:(e,t,n)=>{var o=n(1882),r=n(30294);e.exports=function(e){return null!=e&&r(e.length)&&!o(e)}},66721:(e,t,n)=>{var o=n(81042),r=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(o){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return r.call(t,e)?t[e]:void 0}},68223:(e,t,n)=>{var o=n(56110)(n(9325),"Map");e.exports=o},70080:(e,t,n)=>{var o=n(26025),r=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=o(t,e);return!(n<0||(n==t.length-1?t.pop():r.call(t,n,1),--this.size,0))}},70695:(e,t,n)=>{var o=n(78096),r=n(72428),i=n(56449),a=n(3656),s=n(30361),l=n(37167),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),u=!n&&r(e),d=!n&&!u&&a(e),f=!n&&!u&&!d&&l(e),h=n||u||d||f,p=h?o(e.length,String):[],g=p.length;for(var y in e)!t&&!c.call(e,y)||h&&("length"==y||d&&("offset"==y||"parent"==y)||f&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,g))||p.push(y);return p}},72428:(e,t,n)=>{var o=n(27534),r=n(40346),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,l=o(function(){return arguments}())?o:function(e){return r(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},72552:(e,t,n)=>{var o=n(51873),r=n(659),i=n(59350),a=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?r(e):i(e)}},72949:(e,t,n)=>{var o=n(12651);e.exports=function(e,t){var n=o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}},74218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},74335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},74848:(e,t,n)=>{"use strict";e.exports=n(21020)},75288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},76545:(e,t,n)=>{var o=n(56110)(n(9325),"Set");e.exports=o},78096:e=>{e.exports=function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}},79770:e=>{e.exports=function(e,t){for(var n=-1,o=null==e?0:e.length,r=0,i=[];++n<o;){var a=e[n];t(a,n,e)&&(i[r++]=a)}return i}},80079:(e,t,n)=>{var o=n(63702),r=n(70080),i=n(24739),a=n(48655),s=n(31175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}l.prototype.clear=o,l.prototype.delete=r,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},80945:(e,t,n)=>{var o=n(80079),r=n(68223),i=n(53661);e.exports=function(e,t){var n=this.__data__;if(n instanceof o){var a=n.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},81042:(e,t,n)=>{var o=n(56110)(Object,"create");e.exports=o},82199:(e,t,n)=>{var o=n(14528),r=n(56449);e.exports=function(e,t,n){var i=t(e);return r(e)?i:o(i,n(e))}},84247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},86009:(e,t,n)=>{e=n.nmd(e);var o=n(34840),r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,a=i&&i.exports===r&&o.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},87068:(e,t,n)=>{var o=n(37217),r=n(25911),i=n(21986),a=n(50689),s=n(5861),l=n(56449),c=n(3656),u=n(37167),d="[object Arguments]",f="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,y,m){var v=l(e),b=l(t),w=v?f:s(e),x=b?f:s(t),_=(w=w==d?h:w)==h,k=(x=x==d?h:x)==h,E=w==x;if(E&&c(e)){if(!c(t))return!1;v=!0,_=!1}if(E&&!_)return m||(m=new o),v||u(e)?r(e,t,n,g,y,m):i(e,t,w,n,g,y,m);if(!(1&n)){var C=_&&p.call(e,"__wrapped__"),N=k&&p.call(t,"__wrapped__");if(C||N){var S=C?e.value():e,O=N?t.value():t;return m||(m=new o),y(S,O,n,g,m)}}return!!E&&(m||(m=new o),a(e,t,n,g,y,m))}},87296:(e,t,n)=>{var o,r=n(55481),i=(o=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";e.exports=function(e){return!!i&&i in e}},88984:(e,t,n)=>{var o=n(55527),r=n(3650),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!o(e))return r(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},89935:e=>{e.exports=function(){return!1}},90289:(e,t,n)=>{var o=n(12651);e.exports=function(e){return o(this,e).get(e)}},90938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},91574:function(e){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=109)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),r=n(18),i=n(19),a=n(45),s=n(46),l=n(47),c=n(48),u=n(49),d=n(12),f=n(32),h=n(33),p=n(31),g=n(1),y={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:o.default,Format:r.default,Leaf:i.default,Embed:c.default,Scroll:a.default,Block:l.default,Inline:s.default,Text:u.default,Attributor:{Attribute:d.default,Class:f.default,Style:h.default,Store:p.default}};t.default=y},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var n=this;return t="[Parchment] "+t,(n=e.call(this,t)||this).message=t,n.name=n.constructor.name,n}return r(t,e),t}(Error);t.ParchmentError=i;var a,s={},l={},c={},u={};function d(e,t){var n;if(void 0===t&&(t=a.ANY),"string"==typeof e)n=u[e]||s[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)n=u.text;else if("number"==typeof e)e&a.LEVEL&a.BLOCK?n=u.block:e&a.LEVEL&a.INLINE&&(n=u.inline);else if(e instanceof HTMLElement){var o=(e.getAttribute("class")||"").split(/\s+/);for(var r in o)if(n=l[o[r]])break;n=n||c[e.tagName]}return null==n?null:t&a.LEVEL&n.scope&&t&a.TYPE&n.scope?n:null}t.DATA_KEY="__blot",function(e){e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY"}(a=t.Scope||(t.Scope={})),t.create=function(e,t){var n=d(e);if(null==n)throw new i("Unable to create "+e+" blot");var o=n,r=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:o.create(t);return new o(r,t)},t.find=function e(n,o){return void 0===o&&(o=!1),null==n?null:null!=n[t.DATA_KEY]?n[t.DATA_KEY].blot:o?e(n.parentNode,o):null},t.query=d,t.register=function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length>1)return t.map(function(t){return e(t)});var o=t[0];if("string"!=typeof o.blotName&&"string"!=typeof o.attrName)throw new i("Invalid definition");if("abstract"===o.blotName)throw new i("Cannot register abstract class");return u[o.blotName||o.attrName]=o,"string"==typeof o.keyName?s[o.keyName]=o:(null!=o.className&&(l[o.className]=o),null!=o.tagName&&(Array.isArray(o.tagName)?o.tagName=o.tagName.map(function(e){return e.toUpperCase()}):o.tagName=o.tagName.toUpperCase(),(Array.isArray(o.tagName)?o.tagName:[o.tagName]).forEach(function(e){null!=c[e]&&null!=o.className||(c[e]=o)}))),o}},function(e,t,n){var o=n(51),r=n(11),i=n(3),a=n(20),s=String.fromCharCode(0),l=function(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]};l.prototype.insert=function(e,t){var n={};return 0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},l.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},l.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},l.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=i(!0,{},e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,"object"!=typeof(n=this.ops[t-1])))return this.ops.unshift(e),this;if(r(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},l.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},l.prototype.filter=function(e){return this.ops.filter(e)},l.prototype.forEach=function(e){this.ops.forEach(e)},l.prototype.map=function(e){return this.ops.map(e)},l.prototype.partition=function(e){var t=[],n=[];return this.forEach(function(o){(e(o)?t:n).push(o)}),[t,n]},l.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},l.prototype.changeLength=function(){return this.reduce(function(e,t){return t.insert?e+a.length(t):t.delete?e-t.delete:e},0)},l.prototype.length=function(){return this.reduce(function(e,t){return e+a.length(t)},0)},l.prototype.slice=function(e,t){e=e||0,"number"!=typeof t&&(t=1/0);for(var n=[],o=a.iterator(this.ops),r=0;r<t&&o.hasNext();){var i;r<e?i=o.next(e-r):(i=o.next(t-r),n.push(i)),r+=a.length(i)}return new l(n)},l.prototype.compose=function(e){var t=a.iterator(this.ops),n=a.iterator(e.ops),o=[],i=n.peek();if(null!=i&&"number"==typeof i.retain&&null==i.attributes){for(var s=i.retain;"insert"===t.peekType()&&t.peekLength()<=s;)s-=t.peekLength(),o.push(t.next());i.retain-s>0&&n.next(i.retain-s)}for(var c=new l(o);t.hasNext()||n.hasNext();)if("insert"===n.peekType())c.push(n.next());else if("delete"===t.peekType())c.push(t.next());else{var u=Math.min(t.peekLength(),n.peekLength()),d=t.next(u),f=n.next(u);if("number"==typeof f.retain){var h={};"number"==typeof d.retain?h.retain=u:h.insert=d.insert;var p=a.attributes.compose(d.attributes,f.attributes,"number"==typeof d.retain);if(p&&(h.attributes=p),c.push(h),!n.hasNext()&&r(c.ops[c.ops.length-1],h)){var g=new l(t.rest());return c.concat(g).chop()}}else"number"==typeof f.delete&&"number"==typeof d.retain&&c.push(f)}return c.chop()},l.prototype.concat=function(e){var t=new l(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t},l.prototype.diff=function(e,t){if(this.ops===e.ops)return new l;var n=[this,e].map(function(t){return t.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:s;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")}),i=new l,c=o(n[0],n[1],t),u=a.iterator(this.ops),d=a.iterator(e.ops);return c.forEach(function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case o.INSERT:n=Math.min(d.peekLength(),t),i.push(d.next(n));break;case o.DELETE:n=Math.min(t,u.peekLength()),u.next(n),i.delete(n);break;case o.EQUAL:n=Math.min(u.peekLength(),d.peekLength(),t);var s=u.next(n),l=d.next(n);r(s.insert,l.insert)?i.retain(n,a.attributes.diff(s.attributes,l.attributes)):i.push(l).delete(n)}t-=n}}),i.chop()},l.prototype.eachLine=function(e,t){t=t||"\n";for(var n=a.iterator(this.ops),o=new l,r=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),s=a.length(i)-n.peekLength(),c="string"==typeof i.insert?i.insert.indexOf(t,s)-s:-1;if(c<0)o.push(n.next());else if(c>0)o.push(n.next(c));else{if(!1===e(o,n.next(1).attributes||{},r))return;r+=1,o=new l}}o.length()>0&&e(o,{},r)},l.prototype.transform=function(e,t){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);for(var n=a.iterator(this.ops),o=a.iterator(e.ops),r=new l;n.hasNext()||o.hasNext();)if("insert"!==n.peekType()||!t&&"insert"===o.peekType())if("insert"===o.peekType())r.push(o.next());else{var i=Math.min(n.peekLength(),o.peekLength()),s=n.next(i),c=o.next(i);if(s.delete)continue;c.delete?r.push(c):r.retain(i,a.attributes.transform(s.attributes,c.attributes,t))}else r.retain(a.length(n.next()));return r.chop()},l.prototype.transformPosition=function(e,t){t=!!t;for(var n=a.iterator(this.ops),o=0;n.hasNext()&&o<=e;){var r=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(o<e||!t)&&(e+=r),o+=r):e-=Math.min(r,e-o)}return e},e.exports=l},function(e,t){"use strict";var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===o.call(e)},s=function(e){if(!e||"[object Object]"!==o.call(e))return!1;var t,r=n.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!i)return!1;for(t in e);return void 0===t||n.call(e,t)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(i)return i(e,t).value}return e[t]};e.exports=function e(){var t,n,o,r,i,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)o=c(d,n),d!==(r=c(t,n))&&(p&&r&&(s(r)||(i=a(r)))?(i?(i=!1,u=o&&a(o)?o:[]):u=o&&s(o)?o:{},l(d,{name:n,newValue:e(p,u,r)})):void 0!==r&&l(d,{name:n,newValue:r}));return d}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BlockEmbed=t.bubbleFormats=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=d(n(3)),a=d(n(2)),s=d(n(0)),l=d(n(16)),c=d(n(6)),u=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(){return f(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),o(t,[{key:"attach",value:function(){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"attach",this).call(this),this.attributes=new s.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return(new a.default).insert(this.value(),(0,i.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(e,t){var n=s.default.query(e,s.default.Scope.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}},{key:"formatAt",value:function(e,t,n,o){this.format(n,o)}},{key:"insertAt",value:function(e,n,o){if("string"==typeof n&&n.endsWith("\n")){var i=s.default.create(y.blotName);this.parent.insertBefore(i,0===e?this:this.next),i.insertAt(0,n.slice(0,-1))}else r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,o)}}]),t}(s.default.Embed);g.scope=s.default.Scope.BLOCK_BLOT;var y=function(e){function t(e){f(this,t);var n=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.cache={},n}return p(t,e),o(t,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=this.descendants(s.default.Leaf).reduce(function(e,t){return 0===t.length()?e:e.insert(t.value(),m(t))},new a.default).insert("\n",m(this))),this.cache.delta}},{key:"deleteAt",value:function(e,n){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"deleteAt",this).call(this,e,n),this.cache={}}},{key:"formatAt",value:function(e,n,o,i){n<=0||(s.default.query(o,s.default.Scope.BLOCK)?e+n===this.length()&&this.format(o,i):r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,Math.min(n,this.length()-e-1),o,i),this.cache={})}},{key:"insertAt",value:function(e,n,o){if(null!=o)return r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,o);if(0!==n.length){var i=n.split("\n"),a=i.shift();a.length>0&&(e<this.length()-1||null==this.children.tail?r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,Math.min(e,this.length()-1),a):this.children.tail.insertAt(this.children.tail.length(),a),this.cache={});var s=this;i.reduce(function(e,t){return(s=s.split(e,!0)).insertAt(0,t),t.length},e+a.length)}}},{key:"insertBefore",value:function(e,n){var o=this.children.head;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n),o instanceof l.default&&o.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"length",this).call(this)+1),this.cache.length}},{key:"moveChildren",value:function(e,n){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"moveChildren",this).call(this,e,n),this.cache={}}},{key:"optimize",value:function(e){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.cache={}}},{key:"path",value:function(e){return r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e,!0)}},{key:"removeChild",value:function(e){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"removeChild",this).call(this,e),this.cache={}}},{key:"split",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===e||e>=this.length()-1)){var o=this.clone();return 0===e?(this.parent.insertBefore(o,this),this):(this.parent.insertBefore(o,this.next),o)}var i=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"split",this).call(this,e,n);return this.cache={},i}}]),t}(s.default.Block);function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==e?t:("function"==typeof e.formats&&(t=(0,i.default)(t,e.formats())),null==e.parent||"scroll"==e.parent.blotName||e.parent.statics.scope!==e.statics.scope?t:m(e.parent,t))}y.blotName="block",y.tagName="P",y.defaultChild="break",y.allowedChildren=[c.default,s.default.Embed,u.default],t.bubbleFormats=m,t.BlockEmbed=g,t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.overload=t.expandConfig=void 0;var o="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},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();n(50);var a=y(n(2)),s=y(n(14)),l=y(n(8)),c=y(n(9)),u=y(n(0)),d=n(15),f=y(d),h=y(n(3)),p=y(n(10)),g=y(n(34));function y(e){return e&&e.__esModule?e:{default:e}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=(0,p.default)("quill"),b=function(){function e(t){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=w(t,o),this.container=this.options.container,null==this.container)return v.error("Invalid Quill container",t);this.options.debug&&e.debug(this.options.debug);var r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new l.default,this.scroll=u.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new f.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(l.default.events.EDITOR_CHANGE,function(e){e===l.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(l.default.events.SCROLL_UPDATE,function(e,t){var o=n.selection.lastRange,r=o&&0===o.length?o.index:void 0;x.call(n,function(){return n.editor.update(null,t,r)},e)});var i=this.clipboard.convert("<div class='ql-editor' style=\"white-space: normal;\">"+r+"<p><br></p></div>");this.setContents(i),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return i(e,null,[{key:"debug",value:function(e){!0===e&&(e="log"),p.default.level(e)}},{key:"find",value:function(e){return e.__quill||u.default.find(e)}},{key:"import",value:function(e){return null==this.imports[e]&&v.error("Cannot import "+e+". Are you sure it was registered?"),this.imports[e]}},{key:"register",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e){var r=e.attrName||e.blotName;"string"==typeof r?this.register("formats/"+r,e,t):Object.keys(e).forEach(function(o){n.register(o,e[o],t)})}else null==this.imports[e]||o||v.warn("Overwriting "+e+" with",t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&"abstract"!==t.blotName?u.default.register(t):e.startsWith("modules")&&"function"==typeof t.register&&t.register()}}]),i(e,[{key:"addContainer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){var n=e;(e=document.createElement("div")).classList.add(n)}return this.container.insertBefore(e,t),e}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(e,t,n){var o=this,i=_(e,t,n),a=r(i,4);return e=a[0],t=a[1],n=a[3],x.call(this,function(){return o.editor.deleteText(e,t)},n,e,-1*t)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}},{key:"focus",value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=e,this.scrollIntoView()}},{key:"format",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;return x.call(this,function(){var o=n.getSelection(!0),r=new a.default;if(null==o)return r;if(u.default.query(e,u.default.Scope.BLOCK))r=n.editor.formatLine(o.index,o.length,m({},e,t));else{if(0===o.length)return n.selection.format(e,t),r;r=n.editor.formatText(o.index,o.length,m({},e,t))}return n.setSelection(o,l.default.sources.SILENT),r},o)}},{key:"formatLine",value:function(e,t,n,o,i){var a,s=this,l=_(e,t,n,o,i),c=r(l,4);return e=c[0],t=c[1],a=c[2],i=c[3],x.call(this,function(){return s.editor.formatLine(e,t,a)},i,e,0)}},{key:"formatText",value:function(e,t,n,o,i){var a,s=this,l=_(e,t,n,o,i),c=r(l,4);return e=c[0],t=c[1],a=c[2],i=c[3],x.call(this,function(){return s.editor.formatText(e,t,a)},i,e,0)}},{key:"getBounds",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t="number"==typeof e?this.selection.getBounds(e,n):this.selection.getBounds(e.index,e.length);var o=this.container.getBoundingClientRect();return{bottom:t.bottom-o.top,height:t.height,left:t.left-o.left,right:t.right-o.left,top:t.top-o.top,width:t.width}}},{key:"getContents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=_(e,t),o=r(n,2);return e=o[0],t=o[1],this.editor.getContents(e,t)}},{key:"getFormat",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}},{key:"getIndex",value:function(e){return e.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(e){return this.scroll.leaf(e)}},{key:"getLine",value:function(e){return this.scroll.line(e)}},{key:"getLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}},{key:"getModule",value:function(e){return this.theme.modules[e]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=_(e,t),o=r(n,2);return e=o[0],t=o[1],this.editor.getText(e,t)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(t,n,o){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.sources.API;return x.call(this,function(){return r.editor.insertEmbed(t,n,o)},i,t)}},{key:"insertText",value:function(e,t,n,o,i){var a,s=this,l=_(e,0,n,o,i),c=r(l,4);return e=c[0],a=c[2],i=c[3],x.call(this,function(){return s.editor.insertText(e,t,a)},i,e,t.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(e,t,n){this.clipboard.dangerouslyPasteHTML(e,t,n)}},{key:"removeFormat",value:function(e,t,n){var o=this,i=_(e,t,n),a=r(i,4);return e=a[0],t=a[1],n=a[3],x.call(this,function(){return o.editor.removeFormat(e,t)},n,e)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return x.call(this,function(){e=new a.default(e);var n=t.getLength(),o=t.editor.deleteText(0,n),r=t.editor.applyDelta(e),i=r.ops[r.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(t.editor.deleteText(t.getLength()-1,1),r.delete(1)),o.compose(r)},n)}},{key:"setSelection",value:function(t,n,o){if(null==t)this.selection.setRange(null,n||e.sources.API);else{var i=_(t,n,o),a=r(i,4);t=a[0],n=a[1],o=a[3],this.selection.setRange(new d.Range(t,n),o),o!==l.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API,n=(new a.default).insert(e);return this.setContents(n,t)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}},{key:"updateContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return x.call(this,function(){return e=new a.default(e),t.editor.applyDelta(e,n)},n,!0)}}]),e}();function w(e,t){if((t=(0,h.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,history:!0}},t)).theme&&t.theme!==b.DEFAULTS.theme){if(t.theme=b.import("themes/"+t.theme),null==t.theme)throw new Error("Invalid theme "+t.theme+". Did you register it?")}else t.theme=g.default;var n=(0,h.default)(!0,{},t.theme.DEFAULTS);[n,t].forEach(function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach(function(t){!0===e.modules[t]&&(e.modules[t]={})})});var o=Object.keys(n.modules).concat(Object.keys(t.modules)).reduce(function(e,t){var n=b.import("modules/"+t);return null==n?v.error("Cannot load "+t+" module. Are you sure you registered it?"):e[t]=n.DEFAULTS||{},e},{});return null!=t.modules&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object&&(t.modules.toolbar={container:t.modules.toolbar}),t=(0,h.default)(!0,{},b.DEFAULTS,{modules:o},n,t),["bounds","container","scrollingContainer"].forEach(function(e){"string"==typeof t[e]&&(t[e]=document.querySelector(t[e]))}),t.modules=Object.keys(t.modules).reduce(function(e,n){return t.modules[n]&&(e[n]=t.modules[n]),e},{}),t}function x(e,t,n,o){if(this.options.strict&&!this.isEnabled()&&t===l.default.sources.USER)return new a.default;var r=null==n?null:this.getSelection(),i=this.editor.delta,s=e();if(null!=r&&(!0===n&&(n=r.index),null==o?r=k(r,s,t):0!==o&&(r=k(r,n,o,t)),this.setSelection(r,l.default.sources.SILENT)),s.length()>0){var c,u,d=[l.default.events.TEXT_CHANGE,s,i,t];(c=this.emitter).emit.apply(c,[l.default.events.EDITOR_CHANGE].concat(d)),t!==l.default.sources.SILENT&&(u=this.emitter).emit.apply(u,d)}return s}function _(e,t,n,r,i){var a={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(i=r,r=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(i=r,r=n,n=t,t=0),"object"===(void 0===n?"undefined":o(n))?(a=n,i=r):"string"==typeof n&&(null!=r?a[n]=r:i=n),[e,t,a,i=i||l.default.sources.API]}function k(e,t,n,o){if(null==e)return null;var i=void 0,s=void 0;if(t instanceof a.default){var c=[e.index,e.index+e.length].map(function(e){return t.transformPosition(e,o!==l.default.sources.USER)}),u=r(c,2);i=u[0],s=u[1]}else{var f=[e.index,e.index+e.length].map(function(e){return e<t||e===t&&o===l.default.sources.USER?e:n>=0?e+n:Math.max(t,e+n)}),h=r(f,2);i=h[0],s=h[1]}return new d.Range(i,s-i)}b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},b.events=l.default.events,b.sources=l.default.sources,b.version="1.3.7",b.imports={delta:a.default,parchment:u.default,"core/module":c.default,"core/theme":g.default},t.expandConfig=w,t.overload=_,t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=s(n(7)),a=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"formatAt",value:function(e,n,o,i){if(t.compare(this.statics.blotName,o)<0&&a.default.query(o,a.default.Scope.BLOT)){var s=this.isolate(e,n);i&&s.wrap(o,i)}else r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,o,i)}},{key:"optimize",value:function(e){if(r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.parent instanceof t&&t.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(e,n){var o=t.order.indexOf(e),r=t.order.indexOf(n);return o>=0||r>=0?o-r:e===n?0:e<n?-1:1}}]),t}(a.default.Inline);l.allowedChildren=[l,a.default.Embed,i.default],l.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(0))&&o.__esModule?o:{default:o}).default.Text);t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=a(n(54));function a(e){return e&&e.__esModule?e:{default:e}}var s=(0,a(n(10)).default)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(function(e){document.addEventListener(e,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(e){var n;e.__quill&&e.__quill.emitter&&(n=e.__quill.emitter).handleDOM.apply(n,t)})})});var l=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.listeners={},e.on("error",s.error),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"emit",value:function(){s.log.apply(s,arguments),r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];(this.listeners[e.type]||[]).forEach(function(t){var o=t.node,r=t.handler;(e.target===o||o.contains(e.target))&&r.apply(void 0,[e].concat(n))})}},{key:"listenDOM",value:function(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push({node:t,handler:n})}}]),t}(i.default);l.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},l.sources={API:"api",SILENT:"silent",USER:"user"},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.quill=t,this.options=n};o.DEFAULTS={},t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=["error","warn","log","info"],r="warn";function i(e){if(o.indexOf(e)<=o.indexOf(r)){for(var t,n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];(t=console)[e].apply(t,i)}}function a(e){return o.reduce(function(t,n){return t[n]=i.bind(console,n,e),t},{})}i.level=a.level=function(e){r=e},t.default=a},function(e,t,n){var o=Array.prototype.slice,r=n(52),i=n(53),a=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:function(e,t,n){var c,u;if(s(e)||s(t))return!1;if(e.prototype!==t.prototype)return!1;if(i(e))return!!i(t)&&(e=o.call(e),t=o.call(t),a(e,t,n));if(l(e)){if(!l(t))return!1;if(e.length!==t.length)return!1;for(c=0;c<e.length;c++)if(e[c]!==t[c])return!1;return!0}try{var d=r(e),f=r(t)}catch(e){return!1}if(d.length!=f.length)return!1;for(d.sort(),f.sort(),c=d.length-1;c>=0;c--)if(d[c]!=f[c])return!1;for(c=d.length-1;c>=0;c--)if(u=d[c],!a(e[u],t[u],n))return!1;return typeof e==typeof t}(e,t,n))};function s(e){return null==e}function l(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length||"function"!=typeof e.copy||"function"!=typeof e.slice||e.length>0&&"number"!=typeof e[0])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),r=function(){function e(e,t,n){void 0===n&&(n={}),this.attrName=e,this.keyName=t;var r=o.Scope.TYPE&o.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&o.Scope.LEVEL|r:this.scope=o.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})},e.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)},e.prototype.canAdd=function(e,t){return null!=o.query(e,o.Scope.BLOT&(this.scope|o.Scope.TYPE))&&(null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1))},e.prototype.remove=function(e){e.removeAttribute(this.keyName)},e.prototype.value=function(e){var t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""},e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Code=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=d(n(2)),s=d(n(0)),l=d(n(4)),c=d(n(6)),u=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=function(e){function t(){return f(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),t}(c.default);g.blotName="code",g.tagName="CODE";var y=function(e){function t(){return f(this,t),h(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return p(t,e),r(t,[{key:"delta",value:function(){var e=this,t=this.domNode.textContent;return t.endsWith("\n")&&(t=t.slice(0,-1)),t.split("\n").reduce(function(t,n){return t.insert(n).insert("\n",e.formats())},new a.default)}},{key:"format",value:function(e,n){if(e!==this.statics.blotName||!n){var r=this.descendant(u.default,this.length()-1),a=o(r,1)[0];null!=a&&a.deleteAt(a.length()-1,1),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}},{key:"formatAt",value:function(e,n,o,r){if(0!==n&&null!=s.default.query(o,s.default.Scope.BLOCK)&&(o!==this.statics.blotName||r!==this.statics.formats(this.domNode))){var i=this.newlineIndex(e);if(!(i<0||i>=e+n)){var a=this.newlineIndex(e,!0)+1,l=i-a+1,c=this.isolate(a,l),u=c.next;c.format(o,r),u instanceof t&&u.formatAt(0,e-a+n-l,o,r)}}}},{key:"insertAt",value:function(e,t,n){if(null==n){var r=this.descendant(u.default,e),i=o(r,2),a=i[0],s=i[1];a.insertAt(s,t)}}},{key:"length",value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?e:e+1}},{key:"newlineIndex",value:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,e).lastIndexOf("\n");var t=this.domNode.textContent.slice(e).indexOf("\n");return t>-1?e+t:-1}},{key:"optimize",value:function(e){this.domNode.textContent.endsWith("\n")||this.appendChild(s.default.create("text","\n")),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(e),n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(e){var t=s.default.find(e);null==t?e.parentNode.removeChild(e):t instanceof s.default.Embed?t.remove():t.unwrap()})}}],[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),t}(l.default);y.blotName="code-block",y.tagName="PRE",y.TAB=" ",t.Code=g,t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="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},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=m(n(2)),s=m(n(20)),l=m(n(0)),c=m(n(13)),u=m(n(24)),d=n(4),f=m(d),h=m(n(16)),p=m(n(21)),g=m(n(11)),y=m(n(3));function m(e){return e&&e.__esModule?e:{default:e}}var v=/^[ -~]*$/,b=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scroll=t,this.delta=this.getDelta()}return i(e,[{key:"applyDelta",value:function(e){var t=this,n=!1;this.scroll.update();var i=this.scroll.length();return this.scroll.batchStart(),(e=function(e){return e.reduce(function(e,t){if(1===t.insert){var n=(0,p.default)(t.attributes);return delete n.image,e.insert({image:t.attributes.image},n)}if(null==t.attributes||!0!==t.attributes.list&&!0!==t.attributes.bullet||((t=(0,p.default)(t)).attributes.list?t.attributes.list="ordered":(t.attributes.list="bullet",delete t.attributes.bullet)),"string"==typeof t.insert){var o=t.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e.insert(o,t.attributes)}return e.push(t)},new a.default)}(e)).reduce(function(e,a){var c=a.retain||a.delete||a.insert.length||1,u=a.attributes||{};if(null!=a.insert){if("string"==typeof a.insert){var h=a.insert;h.endsWith("\n")&&n&&(n=!1,h=h.slice(0,-1)),e>=i&&!h.endsWith("\n")&&(n=!0),t.scroll.insertAt(e,h);var p=t.scroll.line(e),g=r(p,2),m=g[0],v=g[1],b=(0,y.default)({},(0,d.bubbleFormats)(m));if(m instanceof f.default){var w=m.descendant(l.default.Leaf,v),x=r(w,1)[0];b=(0,y.default)(b,(0,d.bubbleFormats)(x))}u=s.default.attributes.diff(b,u)||{}}else if("object"===o(a.insert)){var _=Object.keys(a.insert)[0];if(null==_)return e;t.scroll.insertAt(e,_,a.insert[_])}i+=c}return Object.keys(u).forEach(function(n){t.scroll.formatAt(e,c,n,u[n])}),e+c},0),e.reduce(function(e,n){return"number"==typeof n.delete?(t.scroll.deleteAt(e,n.delete),e):e+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(e)}},{key:"deleteText",value:function(e,t){return this.scroll.deleteAt(e,t),this.update((new a.default).retain(e).delete(t))}},{key:"formatLine",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(o).forEach(function(r){if(null==n.scroll.whitelist||n.scroll.whitelist[r]){var i=n.scroll.lines(e,Math.max(t,1)),a=t;i.forEach(function(t){var i=t.length();if(t instanceof c.default){var s=e-t.offset(n.scroll),l=t.newlineIndex(s+a)-s+1;t.formatAt(s,l,r,o[r])}else t.format(r,o[r]);a-=i})}}),this.scroll.optimize(),this.update((new a.default).retain(e).retain(t,(0,p.default)(o)))}},{key:"formatText",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(o).forEach(function(r){n.scroll.formatAt(e,t,r,o[r])}),this.update((new a.default).retain(e).retain(t,(0,p.default)(o)))}},{key:"getContents",value:function(e,t){return this.delta.slice(e,e+t)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new a.default)}},{key:"getFormat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],o=[];0===t?this.scroll.path(e).forEach(function(e){var t=r(e,1)[0];t instanceof f.default?n.push(t):t instanceof l.default.Leaf&&o.push(t)}):(n=this.scroll.lines(e,t),o=this.scroll.descendants(l.default.Leaf,e,t));var i=[n,o].map(function(e){if(0===e.length)return{};for(var t=(0,d.bubbleFormats)(e.shift());Object.keys(t).length>0;){var n=e.shift();if(null==n)return t;t=w((0,d.bubbleFormats)(n),t)}return t});return y.default.apply(y.default,i)}},{key:"getText",value:function(e,t){return this.getContents(e,t).filter(function(e){return"string"==typeof e.insert}).map(function(e){return e.insert}).join("")}},{key:"insertEmbed",value:function(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new a.default).retain(e).insert(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,n)))}},{key:"insertText",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(o).forEach(function(r){n.scroll.formatAt(e,t.length,r,o[r])}),this.update((new a.default).retain(e).insert(t,(0,p.default)(o)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var e=this.scroll.children.head;return e.statics.blotName===f.default.blotName&&!(e.children.length>1)&&e.children.head instanceof h.default}},{key:"removeFormat",value:function(e,t){var n=this.getText(e,t),o=this.scroll.line(e+t),i=r(o,2),s=i[0],l=i[1],u=0,d=new a.default;null!=s&&(u=s instanceof c.default?s.newlineIndex(l)-l+1:s.length()-l,d=s.delta().slice(l,l+u-1).insert("\n"));var f=this.getContents(e,t+u).diff((new a.default).insert(n).concat(d)),h=(new a.default).retain(e).concat(f);return this.applyDelta(h)}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(v)&&l.default.find(t[0].target)){var r=l.default.find(t[0].target),i=(0,d.bubbleFormats)(r),s=r.offset(this.scroll),c=t[0].oldValue.replace(u.default.CONTENTS,""),f=(new a.default).insert(c),h=(new a.default).insert(r.value());e=(new a.default).retain(s).concat(f.diff(h,n)).reduce(function(e,t){return t.insert?e.insert(t.insert,i):e.push(t)},new a.default),this.delta=o.compose(e)}else this.delta=this.getDelta(),e&&(0,g.default)(o.compose(e),this.delta)||(e=o.diff(this.delta,n));return e}}]),e}();function w(e,t){return Object.keys(t).reduce(function(n,o){return null==e[o]||(t[o]===e[o]?n[o]=t[o]:Array.isArray(t[o])?t[o].indexOf(e[o])<0&&(n[o]=t[o].concat([e[o]])):n[o]=[t[o],e[o]]),n},{})}t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Range=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=c(n(0)),a=c(n(21)),s=c(n(11)),l=c(n(8));function c(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var f=(0,c(n(10)).default)("quill:selection"),h=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;d(this,e),this.index=t,this.length=n},p=function(){function e(t,n){var o=this;d(this,e),this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=i.default.create("cursor",this),this.lastRange=this.savedRange=new h(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){o.mouseDown||setTimeout(o.update.bind(o,l.default.sources.USER),1)}),this.emitter.on(l.default.events.EDITOR_CHANGE,function(e,t){e===l.default.events.TEXT_CHANGE&&t.length()>0&&o.update(l.default.sources.SILENT)}),this.emitter.on(l.default.events.SCROLL_BEFORE_UPDATE,function(){if(o.hasFocus()){var e=o.getNativeRange();null!=e&&e.start.node!==o.cursor.textNode&&o.emitter.once(l.default.events.SCROLL_UPDATE,function(){try{o.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch(e){}})}}),this.emitter.on(l.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var n=t.range,r=n.startNode,i=n.startOffset,a=n.endNode,s=n.endOffset;o.setNativeRange(r,i,a,s)}}),this.update(l.default.sources.SILENT)}return r(e,[{key:"handleComposition",value:function(){var e=this;this.root.addEventListener("compositionstart",function(){e.composing=!0}),this.root.addEventListener("compositionend",function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();if(!t)return;setTimeout(function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}},{key:"handleDragging",value:function(){var e=this;this.emitter.listenDOM("mousedown",document.body,function(){e.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){e.mouseDown=!1,e.update(l.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(e,t){if(null==this.scroll.whitelist||this.scroll.whitelist[e]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!i.default.query(e,i.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var o=i.default.find(n.start.node,!1);if(null==o)return;if(o instanceof i.default.Leaf){var r=o.split(n.start.offset);o.parent.insertBefore(this.cursor,r)}else o.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;var r=void 0,i=this.scroll.leaf(e),a=o(i,2),s=a[0],l=a[1];if(null==s)return null;var c=s.position(l,!0),u=o(c,2);r=u[0],l=u[1];var d=document.createRange();if(t>0){d.setStart(r,l);var f=this.scroll.leaf(e+t),h=o(f,2);if(s=h[0],l=h[1],null==s)return null;var p=s.position(l,!0),g=o(p,2);return r=g[0],l=g[1],d.setEnd(r,l),d.getBoundingClientRect()}var y="left",m=void 0;return r instanceof Text?(l<r.data.length?(d.setStart(r,l),d.setEnd(r,l+1)):(d.setStart(r,l-1),d.setEnd(r,l),y="right"),m=d.getBoundingClientRect()):(m=s.domNode.getBoundingClientRect(),l>0&&(y="right")),{bottom:m.top+m.height,height:m.height,left:m[y],right:m[y],top:m.top,width:0}}},{key:"getNativeRange",value:function(){var e=document.getSelection();if(null==e||e.rangeCount<=0)return null;var t=e.getRangeAt(0);if(null==t)return null;var n=this.normalizeNative(t);return f.info("getNativeRange",n),n}},{key:"getRange",value:function(){var e=this.getNativeRange();return null==e?[null,null]:[this.normalizedToRange(e),e]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(e){var t=this,n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var r=n.map(function(e){var n=o(e,2),r=n[0],a=n[1],s=i.default.find(r,!0),l=s.offset(t.scroll);return 0===a?l:s instanceof i.default.Container?l+s.length():l+s.index(r,a)}),a=Math.min(Math.max.apply(Math,u(r)),this.scroll.length()-1),s=Math.min.apply(Math,[a].concat(u(r)));return new h(s,a-s)}},{key:"normalizeNative",value:function(e){if(!g(this.root,e.startContainer)||!e.collapsed&&!g(this.root,e.endContainer))return null;var t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(function(e){for(var t=e.node,n=e.offset;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;n=(t=t.lastChild)instanceof Text?t.data.length:t.childNodes.length+1}e.node=t,e.offset=n}),t}},{key:"rangeToNative",value:function(e){var t=this,n=e.collapsed?[e.index]:[e.index,e.index+e.length],r=[],i=this.scroll.length();return n.forEach(function(e,n){e=Math.min(i-1,e);var a,s=t.scroll.leaf(e),l=o(s,2),c=l[0],u=l[1],d=c.position(u,0!==n),f=o(d,2);a=f[0],u=f[1],r.push(a,u)}),r.length<2&&(r=r.concat(r)),r}},{key:"scrollIntoView",value:function(e){var t=this.lastRange;if(null!=t){var n=this.getBounds(t.index,t.length);if(null!=n){var r=this.scroll.length()-1,i=this.scroll.line(Math.min(t.index,r)),a=o(i,1)[0],s=a;if(t.length>0){var l=this.scroll.line(Math.min(t.index+t.length,r));s=o(l,1)[0]}if(null!=a&&null!=s){var c=e.getBoundingClientRect();n.top<c.top?e.scrollTop-=c.top-n.top:n.bottom>c.bottom&&(e.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(f.info("setNativeRange",e,t,n,o),null==e||null!=this.root.parentNode&&null!=e.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=e){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||r||e!==a.startContainer||t!==a.startOffset||n!==a.endContainer||o!==a.endOffset){"BR"==e.tagName&&(t=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),"BR"==n.tagName&&(o=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(e,t),s.setEnd(n,o),i.removeAllRanges(),i.addRange(s)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"==typeof t&&(n=t,t=!1),f.info("setRange",e),null!=e){var o=this.rangeToNative(e);this.setNativeRange.apply(this,u(o).concat([t]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,t=this.lastRange,n=this.getRange(),r=o(n,2),i=r[0],c=r[1];if(this.lastRange=i,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,s.default)(t,this.lastRange)){var u;!this.composing&&null!=c&&c.native.collapsed&&c.start.node!==this.cursor.textNode&&this.cursor.restore();var d,f=[l.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(t),e];(u=this.emitter).emit.apply(u,[l.default.events.EDITOR_CHANGE].concat(f)),e!==l.default.sources.SILENT&&(d=this.emitter).emit.apply(d,f)}}}]),e}();function g(e,t){try{t.parentNode}catch(e){return!1}return t instanceof Text&&(t=t.parentNode),e.contains(t)}t.Range=h,t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"insertInto",value:function(e,n){0===e.children.length?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertInto",this).call(this,e,n):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),t}(((o=n(0))&&o.__esModule?o:{default:o}).default.Embed);a.blotName="break",a.tagName="BR",t.default=a},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(44),a=n(30),s=n(1),l=function(e){function t(t){var n=e.call(this,t)||this;return n.build(),n}return r(t,e),t.prototype.appendChild=function(e){this.insertBefore(e)},t.prototype.attach=function(){e.prototype.attach.call(this),this.children.forEach(function(e){e.attach()})},t.prototype.build=function(){var e=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(t){try{var n=c(t);e.insertBefore(n,e.children.head||void 0)}catch(e){if(e instanceof s.ParchmentError)return;throw e}})},t.prototype.deleteAt=function(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,function(e,t,n){e.deleteAt(t,n)})},t.prototype.descendant=function(e,n){var o=this.children.find(n),r=o[0],i=o[1];return null==e.blotName&&e(r)||null!=e.blotName&&r instanceof e?[r,i]:r instanceof t?r.descendant(e,i):[null,-1]},t.prototype.descendants=function(e,n,o){void 0===n&&(n=0),void 0===o&&(o=Number.MAX_VALUE);var r=[],i=o;return this.children.forEachAt(n,o,function(n,o,a){(null==e.blotName&&e(n)||null!=e.blotName&&n instanceof e)&&r.push(n),n instanceof t&&(r=r.concat(n.descendants(e,o,i))),i-=a}),r},t.prototype.detach=function(){this.children.forEach(function(e){e.detach()}),e.prototype.detach.call(this)},t.prototype.formatAt=function(e,t,n,o){this.children.forEachAt(e,t,function(e,t,r){e.formatAt(t,r,n,o)})},t.prototype.insertAt=function(e,t,n){var o=this.children.find(e),r=o[0],i=o[1];if(r)r.insertAt(i,t,n);else{var a=null==n?s.create("text",t):s.create(t,n);this.appendChild(a)}},t.prototype.insertBefore=function(e,t){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(t){return e instanceof t}))throw new s.ParchmentError("Cannot insert "+e.statics.blotName+" into "+this.statics.blotName);e.insertInto(this,t)},t.prototype.length=function(){return this.children.reduce(function(e,t){return e+t.length()},0)},t.prototype.moveChildren=function(e,t){this.children.forEach(function(n){e.insertBefore(n,t)})},t.prototype.optimize=function(t){if(e.prototype.optimize.call(this,t),0===this.children.length)if(null!=this.statics.defaultChild){var n=s.create(this.statics.defaultChild);this.appendChild(n),n.optimize(t)}else this.remove()},t.prototype.path=function(e,n){void 0===n&&(n=!1);var o=this.children.find(e,n),r=o[0],i=o[1],a=[[this,e]];return r instanceof t?a.concat(r.path(i,n)):(null!=r&&a.push([r,i]),a)},t.prototype.removeChild=function(e){this.children.remove(e)},t.prototype.replace=function(n){n instanceof t&&n.moveChildren(this),e.prototype.replace.call(this,n)},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(e,this.length(),function(e,o,r){e=e.split(o,t),n.appendChild(e)}),n},t.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},t.prototype.update=function(e,t){var n=this,o=[],r=[];e.forEach(function(e){e.target===n.domNode&&"childList"===e.type&&(o.push.apply(o,e.addedNodes),r.push.apply(r,e.removedNodes))}),r.forEach(function(e){if(!(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var t=s.find(e);null!=t&&(null!=t.domNode.parentNode&&t.domNode.parentNode!==n.domNode||t.detach())}}),o.filter(function(e){return e.parentNode==n.domNode}).sort(function(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(e){var t=null;null!=e.nextSibling&&(t=s.find(e.nextSibling));var o=c(e);o.next==t&&null!=o.next||(null!=o.parent&&o.parent.removeChild(n),n.insertBefore(o,t||void 0))})},t}(a.default);function c(e){var t=s.find(e);if(null==t)try{t=s.create(e)}catch(n){t=s.create(s.Scope.INLINE),[].slice.call(e.childNodes).forEach(function(e){t.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(t.domNode,e),t.attach()}return t}t.default=l},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),a=n(31),s=n(17),l=n(1),c=function(e){function t(t){var n=e.call(this,t)||this;return n.attributes=new a.default(n.domNode),n}return r(t,e),t.formats=function(e){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?e.tagName.toLowerCase():void 0)},t.prototype.format=function(e,t){var n=l.query(e);n instanceof i.default?this.attributes.attribute(n,t):t&&(null==n||e===this.statics.blotName&&this.formats()[e]===t||this.replaceWith(e,t))},t.prototype.formats=function(){var e=this.attributes.values(),t=this.statics.formats(this.domNode);return null!=t&&(e[this.statics.blotName]=t),e},t.prototype.replaceWith=function(t,n){var o=e.prototype.replaceWith.call(this,t,n);return this.attributes.copy(o),o},t.prototype.update=function(t,n){var o=this;e.prototype.update.call(this,t,n),t.some(function(e){return e.target===o.domNode&&"attributes"===e.type})&&this.attributes.build()},t.prototype.wrap=function(n,o){var r=e.prototype.wrap.call(this,n,o);return r instanceof t&&r.statics.scope===this.statics.scope&&this.attributes.move(r),r},t}(s.default);t.default=c},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(30),a=n(1),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.value=function(e){return!0},t.prototype.index=function(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1},t.prototype.position=function(e,t){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]},t.prototype.value=function(){var e;return(e={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,e},t.scope=a.Scope.INLINE_BLOT,t}(i.default);t.default=s},function(e,t,n){var o=n(11),r=n(3),i={attributes:{compose:function(e,t,n){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var o=r(!0,{},t);for(var i in n||(o=Object.keys(o).reduce(function(e,t){return null!=o[t]&&(e[t]=o[t]),e},{})),e)void 0!==e[i]&&void 0===t[i]&&(o[i]=e[i]);return Object.keys(o).length>0?o:void 0},diff:function(e,t){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce(function(n,r){return o(e[r],t[r])||(n[r]=void 0===t[r]?null:t[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(e,t,n){if("object"!=typeof e)return t;if("object"==typeof t){if(!n)return t;var o=Object.keys(t).reduce(function(n,o){return void 0===e[o]&&(n[o]=t[o]),n},{});return Object.keys(o).length>0?o:void 0}}},iterator:function(e){return new a(e)},length:function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"string"==typeof e.insert?e.insert.length:1}};function a(e){this.ops=e,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(e){e||(e=1/0);var t=this.ops[this.index];if(t){var n=this.offset,o=i.length(t);if(e>=o-n?(e=o-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};var r={};return t.attributes&&(r.attributes=t.attributes),"number"==typeof t.retain?r.retain=e:"string"==typeof t.insert?r.insert=t.insert.substr(n,e):r.insert=t.insert,r}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?i.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},a.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),o=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(o)}return[]},e.exports=i},function(e,t){var n=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,o;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{o=Promise}catch(e){o=function(){}}function r(i,s,l,c,u){"object"==typeof s&&(l=s.depth,c=s.prototype,u=s.includeNonEnumerable,s=s.circular);var d=[],f=[],h="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===l&&(l=1/0),function i(l,p){if(null===l)return null;if(0===p)return l;var g,y;if("object"!=typeof l)return l;if(e(l,t))g=new t;else if(e(l,n))g=new n;else if(e(l,o))g=new o(function(e,t){l.then(function(t){e(i(t,p-1))},function(e){t(i(e,p-1))})});else if(r.__isArray(l))g=[];else if(r.__isRegExp(l))g=new RegExp(l.source,a(l)),l.lastIndex&&(g.lastIndex=l.lastIndex);else if(r.__isDate(l))g=new Date(l.getTime());else{if(h&&Buffer.isBuffer(l))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(l.length):new Buffer(l.length),l.copy(g),g;e(l,Error)?g=Object.create(l):void 0===c?(y=Object.getPrototypeOf(l),g=Object.create(y)):(g=Object.create(c),y=c)}if(s){var m=d.indexOf(l);if(-1!=m)return f[m];d.push(l),f.push(g)}for(var v in e(l,t)&&l.forEach(function(e,t){var n=i(t,p-1),o=i(e,p-1);g.set(n,o)}),e(l,n)&&l.forEach(function(e){var t=i(e,p-1);g.add(t)}),l){var b;y&&(b=Object.getOwnPropertyDescriptor(y,v)),b&&null==b.set||(g[v]=i(l[v],p-1))}if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(l);for(v=0;v<w.length;v++){var x=w[v];(!(k=Object.getOwnPropertyDescriptor(l,x))||k.enumerable||u)&&(g[x]=i(l[x],p-1),k.enumerable||Object.defineProperty(g,x,{enumerable:!1}))}}if(u){var _=Object.getOwnPropertyNames(l);for(v=0;v<_.length;v++){var k,E=_[v];(k=Object.getOwnPropertyDescriptor(l,E))&&k.enumerable||(g[E]=i(l[E],p-1),Object.defineProperty(g,E,{enumerable:!1}))}}return g}(i,l)}function i(e){return Object.prototype.toString.call(e)}function a(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return r.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},r.__objToStr=i,r.__isDate=function(e){return"object"==typeof e&&"[object Date]"===i(e)},r.__isArray=function(e){return"object"==typeof e&&"[object Array]"===i(e)},r.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===i(e)},r.__getRegExpFlags=a,r}();"object"==typeof e&&e.exports&&(e.exports=n)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=h(n(0)),s=h(n(8)),l=n(4),c=h(l),u=h(n(16)),d=h(n(13)),f=h(n(25));function h(e){return e&&e.__esModule?e:{default:e}}function p(e){return e instanceof c.default||e instanceof l.BlockEmbed}var g=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.emitter=n.emitter,Array.isArray(n.whitelist)&&(o.whitelist=n.whitelist.reduce(function(e,t){return e[t]=!0,e},{})),o.domNode.addEventListener("DOMNodeInserted",function(){}),o.optimize(),o.enable(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(e,n){var r=this.line(e),a=o(r,2),s=a[0],c=a[1],f=this.line(e+n),h=o(f,1)[0];if(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"deleteAt",this).call(this,e,n),null!=h&&s!==h&&c>0){if(s instanceof l.BlockEmbed||h instanceof l.BlockEmbed)return void this.optimize();if(s instanceof d.default){var p=s.newlineIndex(s.length(),!0);if(p>-1&&(s=s.split(p+1))===h)return void this.optimize()}else if(h instanceof d.default){var g=h.newlineIndex(0);g>-1&&h.split(g+1)}var y=h.children.head instanceof u.default?null:h.children.head;s.moveChildren(h,y),s.remove()}this.optimize()}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e)}},{key:"formatAt",value:function(e,n,o,r){(null==this.whitelist||this.whitelist[o])&&(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,o,r),this.optimize())}},{key:"insertAt",value:function(e,n,o){if(null==o||null==this.whitelist||this.whitelist[n]){if(e>=this.length())if(null==o||null==a.default.query(n,a.default.Scope.BLOCK)){var r=a.default.create(this.statics.defaultChild);this.appendChild(r),null==o&&n.endsWith("\n")&&(n=n.slice(0,-1)),r.insertAt(0,n,o)}else{var s=a.default.create(n,o);this.appendChild(s)}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,o);this.optimize()}}},{key:"insertBefore",value:function(e,n){if(e.statics.scope===a.default.Scope.INLINE_BLOT){var o=a.default.create(this.statics.defaultChild);o.appendChild(e),e=o}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n)}},{key:"leaf",value:function(e){return this.path(e).pop()||[null,-1]}},{key:"line",value:function(e){return e===this.length()?this.line(e-1):this.descendant(p,e)}},{key:"lines",value:function(){return function e(t,n,o){var r=[],i=o;return t.children.forEachAt(n,o,function(t,n,o){p(t)?r.push(t):t instanceof a.default.Container&&(r=r.concat(e(t,n,i))),i-=o}),r}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}},{key:"optimize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e,n),e.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,e,n))}},{key:"path",value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e).slice(1)}},{key:"update",value:function(e){if(!0!==this.batch){var n=s.default.sources.USER;"string"==typeof e&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,e),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"update",this).call(this,e.concat([])),e.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,e)}}}]),t}(a.default.Scroll);g.blotName="scroll",g.className="ql-editor",g.tagName="DIV",g.defaultChild="block",g.allowedChildren=[c.default,l.BlockEmbed,f.default],t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHORTKEY=t.default=void 0;var o="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},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=g(n(21)),s=g(n(11)),l=g(n(3)),c=g(n(2)),u=g(n(20)),d=g(n(0)),f=g(n(5)),h=g(n(10)),p=g(n(9));function g(e){return e&&e.__esModule?e:{default:e}}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=(0,h.default)("quill:keyboard"),v=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",b=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.bindings={},Object.keys(o.options.bindings).forEach(function(t){("list autofill"!==t||null==e.scroll.whitelist||e.scroll.whitelist.list)&&o.options.bindings[t]&&o.addBinding(o.options.bindings[t])}),o.addBinding({key:t.keys.ENTER,shiftKey:null},E),o.addBinding({key:t.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(o.addBinding({key:t.keys.BACKSPACE},{collapsed:!0},x),o.addBinding({key:t.keys.DELETE},{collapsed:!0},_)):(o.addBinding({key:t.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},x),o.addBinding({key:t.keys.DELETE},{collapsed:!0,suffix:/^.?$/},_)),o.addBinding({key:t.keys.BACKSPACE},{collapsed:!1},k),o.addBinding({key:t.keys.DELETE},{collapsed:!1},k),o.addBinding({key:t.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},x),o.listen(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,null,[{key:"match",value:function(e,t){return t=S(t),!["altKey","ctrlKey","metaKey","shiftKey"].some(function(n){return!!t[n]!==e[n]&&null!==t[n]})&&t.key===(e.which||e.keyCode)}}]),i(t,[{key:"addBinding",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=S(e);if(null==o||null==o.key)return m.warn("Attempted to add invalid keyboard binding",o);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n}),o=(0,l.default)(o,t,n),this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)}},{key:"listen",value:function(){var e=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var i=n.which||n.keyCode,a=(e.bindings[i]||[]).filter(function(e){return t.match(n,e)});if(0!==a.length){var l=e.quill.getSelection();if(null!=l&&e.quill.hasFocus()){var c=e.quill.getLine(l.index),u=r(c,2),f=u[0],h=u[1],p=e.quill.getLeaf(l.index),g=r(p,2),y=g[0],m=g[1],v=0===l.length?[y,m]:e.quill.getLeaf(l.index+l.length),b=r(v,2),w=b[0],x=b[1],_=y instanceof d.default.Text?y.value().slice(0,m):"",k=w instanceof d.default.Text?w.value().slice(x):"",E={collapsed:0===l.length,empty:0===l.length&&f.length()<=1,format:e.quill.getFormat(l),offset:h,prefix:_,suffix:k};a.some(function(t){if(null!=t.collapsed&&t.collapsed!==E.collapsed)return!1;if(null!=t.empty&&t.empty!==E.empty)return!1;if(null!=t.offset&&t.offset!==E.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(function(e){return null==E.format[e]}))return!1}else if("object"===o(t.format)&&!Object.keys(t.format).every(function(e){return!0===t.format[e]?null!=E.format[e]:!1===t.format[e]?null==E.format[e]:(0,s.default)(t.format[e],E.format[e])}))return!1;return!(null!=t.prefix&&!t.prefix.test(E.prefix)||null!=t.suffix&&!t.suffix.test(E.suffix)||!0===t.handler.call(e,l,E))})&&n.preventDefault()}}}})}}]),t}(p.default);function w(e,t){var n,o=e===b.keys.LEFT?"prefix":"suffix";return y(n={key:e,shiftKey:t,altKey:null},o,/^$/),y(n,"handler",function(n){var o=n.index;e===b.keys.RIGHT&&(o+=n.length+1);var i=this.quill.getLeaf(o);return!(r(i,1)[0]instanceof d.default.Embed&&(e===b.keys.LEFT?t?this.quill.setSelection(n.index-1,n.length+1,f.default.sources.USER):this.quill.setSelection(n.index-1,f.default.sources.USER):t?this.quill.setSelection(n.index,n.length+1,f.default.sources.USER):this.quill.setSelection(n.index+n.length+1,f.default.sources.USER),1))}),n}function x(e,t){if(!(0===e.index||this.quill.getLength()<=1)){var n=this.quill.getLine(e.index),o=r(n,1)[0],i={};if(0===t.offset){var a=this.quill.getLine(e.index-1),s=r(a,1)[0];if(null!=s&&s.length()>1){var l=o.formats(),c=this.quill.getFormat(e.index-1,1);i=u.default.attributes.diff(l,c)||{}}}var d=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-d,d,f.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(e.index-d,d,i,f.default.sources.USER),this.quill.focus()}}function _(e,t){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(!(e.index>=this.quill.getLength()-n)){var o={},i=0,a=this.quill.getLine(e.index),s=r(a,1)[0];if(t.offset>=s.length()-1){var l=this.quill.getLine(e.index+1),c=r(l,1)[0];if(c){var d=s.formats(),h=this.quill.getFormat(e.index,1);o=u.default.attributes.diff(d,h)||{},i=c.length()}}this.quill.deleteText(e.index,n,f.default.sources.USER),Object.keys(o).length>0&&this.quill.formatLine(e.index+i-1,n,o,f.default.sources.USER)}}function k(e){var t=this.quill.getLines(e),n={};if(t.length>1){var o=t[0].formats(),r=t[t.length-1].formats();n=u.default.attributes.diff(r,o)||{}}this.quill.deleteText(e,f.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(e.index,1,n,f.default.sources.USER),this.quill.setSelection(e.index,f.default.sources.SILENT),this.quill.focus()}function E(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var o=Object.keys(t.format).reduce(function(e,n){return d.default.query(n,d.default.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{});this.quill.insertText(e.index,"\n",o,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(function(e){null==o[e]&&(Array.isArray(t.format[e])||"link"!==e&&n.quill.format(e,t.format[e],f.default.sources.USER))})}function C(e){return{key:b.keys.TAB,shiftKey:!e,format:{"code-block":!0},handler:function(t){var n=d.default.query("code-block"),o=t.index,i=t.length,a=this.quill.scroll.descendant(n,o),s=r(a,2),l=s[0],c=s[1];if(null!=l){var u=this.quill.getIndex(l),h=l.newlineIndex(c,!0)+1,p=l.newlineIndex(u+c+i),g=l.domNode.textContent.slice(h,p).split("\n");c=0,g.forEach(function(t,r){e?(l.insertAt(h+c,n.TAB),c+=n.TAB.length,0===r?o+=n.TAB.length:i+=n.TAB.length):t.startsWith(n.TAB)&&(l.deleteAt(h+c,n.TAB.length),c-=n.TAB.length,0===r?o-=n.TAB.length:i-=n.TAB.length),c+=t.length+1}),this.quill.update(f.default.sources.USER),this.quill.setSelection(o,i,f.default.sources.SILENT)}}}}function N(e){return{key:e[0].toUpperCase(),shortKey:!0,handler:function(t,n){this.quill.format(e,!n.format[e],f.default.sources.USER)}}}function S(e){if("string"==typeof e||"number"==typeof e)return S({key:e});if("object"===(void 0===e?"undefined":o(e))&&(e=(0,a.default)(e,!1)),"string"==typeof e.key)if(null!=b.keys[e.key.toUpperCase()])e.key=b.keys[e.key.toUpperCase()];else{if(1!==e.key.length)return null;e.key=e.key.toUpperCase().charCodeAt(0)}return e.shortKey&&(e[v]=e.shortKey,delete e.shortKey),e}b.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},b.DEFAULTS={bindings:{bold:N("bold"),italic:N("italic"),underline:N("underline"),indent:{key:b.keys.TAB,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","+1",f.default.sources.USER)}},outdent:{key:b.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","-1",f.default.sources.USER)}},"outdent backspace":{key:b.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(e,t){null!=t.format.indent?this.quill.format("indent","-1",f.default.sources.USER):null!=t.format.list&&this.quill.format("list",!1,f.default.sources.USER)}},"indent code-block":C(!0),"outdent code-block":C(!1),"remove tab":{key:b.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(e){this.quill.deleteText(e.index-1,1,f.default.sources.USER)}},tab:{key:b.keys.TAB,handler:function(e){this.quill.history.cutoff();var t=(new c.default).retain(e.index).delete(e.length).insert("\t");this.quill.updateContents(t,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,f.default.sources.SILENT)}},"list empty enter":{key:b.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(e,t){this.quill.format("list",!1,f.default.sources.USER),t.format.indent&&this.quill.format("indent",!1,f.default.sources.USER)}},"checklist enter":{key:b.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(e){var t=this.quill.getLine(e.index),n=r(t,2),o=n[0],i=n[1],a=(0,l.default)({},o.formats(),{list:"checked"}),s=(new c.default).retain(e.index).insert("\n",a).retain(o.length()-i-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:b.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(e,t){var n=this.quill.getLine(e.index),o=r(n,2),i=o[0],a=o[1],s=(new c.default).retain(e.index).insert("\n",t.format).retain(i.length()-a-1).retain(1,{header:null});this.quill.updateContents(s,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(e,t){var n=t.prefix.length,o=this.quill.getLine(e.index),i=r(o,2),a=i[0],s=i[1];if(s>n)return!0;var l=void 0;switch(t.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(e.index," ",f.default.sources.USER),this.quill.history.cutoff();var u=(new c.default).retain(e.index-s).delete(n+1).retain(a.length()-2-s).retain(1,{list:l});this.quill.updateContents(u,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,f.default.sources.SILENT)}},"code exit":{key:b.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(e){var t=this.quill.getLine(e.index),n=r(t,2),o=n[0],i=n[1],a=(new c.default).retain(e.index+o.length()-i-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,f.default.sources.USER)}},"embed left":w(b.keys.LEFT,!1),"embed left shift":w(b.keys.LEFT,!0),"embed right":w(b.keys.RIGHT,!1),"embed right shift":w(b.keys.RIGHT,!0)}},t.default=b,t.SHORTKEY=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=s(n(0)),a=s(n(7));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.selection=n,o.textNode=document.createTextNode(t.CONTENTS),o.domNode.appendChild(o.textNode),o._length=0,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,null,[{key:"value",value:function(){}}]),r(t,[{key:"detach",value:function(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function(e,n){if(0!==this._length)return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n);for(var r=this,a=0;null!=r&&r.statics.scope!==i.default.Scope.BLOCK_BLOT;)a+=r.offset(r.parent),r=r.parent;null!=r&&(this._length=t.CONTENTS.length,r.optimize(),r.formatAt(a,t.CONTENTS.length,e,n),this._length=0)}},{key:"index",value:function(e,n){return e===this.textNode?0:o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"index",this).call(this,e,n)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!this.selection.composing&&null!=this.parent){var e=this.textNode,n=this.selection.getNativeRange(),o=void 0,r=void 0,s=void 0;if(null!=n&&n.start.node===e&&n.end.node===e){var l=[e,n.start.offset,n.end.offset];o=l[0],r=l[1],s=l[2]}for(;null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==t.CONTENTS){var c=this.textNode.data.split(t.CONTENTS).join("");this.next instanceof a.default?(o=this.next.domNode,this.next.insertAt(0,c),this.textNode.data=t.CONTENTS):(this.textNode.data=c,this.parent.insertBefore(i.default.create(this.textNode),this),this.textNode=document.createTextNode(t.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),null!=r){var u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}([r,s].map(function(e){return Math.max(0,Math.min(o.data.length,e-1))}),2);return r=u[0],s=u[1],{startNode:o,startOffset:r,endNode:o,endOffset:s}}}}},{key:"update",value:function(e,t){var n=this;if(e.some(function(e){return"characterData"===e.type&&e.target===n.textNode})){var o=this.restore();o&&(t.range=o)}}},{key:"value",value:function(){return""}}]),t}(i.default.Embed);l.blotName="cursor",l.className="ql-cursor",l.tagName="span",l.CONTENTS="\ufeff",t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(0)),r=n(4),i=a(r);function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(o.default.Container);s.allowedChildren=[i.default,r.BlockEmbed,s],t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorStyle=t.ColorClass=t.ColorAttributor=void 0;var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=(o=n(0))&&o.__esModule?o:{default:o},s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"value",value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e);return n.startsWith("rgb(")?"#"+(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"")).split(",").map(function(e){return("00"+parseInt(e).toString(16)).slice(-2)}).join(""):n}}]),t}(a.default.Attributor.Style),l=new a.default.Attributor.Class("color","ql-color",{scope:a.default.Scope.INLINE}),c=new s("color","color",{scope:a.default.Scope.INLINE});t.ColorAttributor=s,t.ColorClass=l,t.ColorStyle=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sanitize=t.default=void 0;var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"format",value:function(e,n){if(e!==this.statics.blotName||!n)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n);n=this.constructor.sanitize(n),this.domNode.setAttribute("href",n)}}],[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return e=this.sanitize(e),n.setAttribute("href",e),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}},{key:"formats",value:function(e){return e.getAttribute("href")}},{key:"sanitize",value:function(e){return s(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}}]),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);function s(e,t){var n=document.createElement("a");n.href=e;var o=n.href.slice(0,n.href.indexOf(":"));return t.indexOf(o)>-1}a.blotName="link",a.tagName="A",a.SANITIZED_URL="about:blank",a.PROTOCOL_WHITELIST=["http","https","mailto","tel"],t.default=a,t.sanitize=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="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},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=s(n(23)),a=s(n(107));function s(e){return e&&e.__esModule?e:{default:e}}var l=0;function c(e,t){e.setAttribute(t,!("true"===e.getAttribute(t)))}var u=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){n.togglePicker()}),this.label.addEventListener("keydown",function(e){switch(e.keyCode){case i.default.keys.ENTER:n.togglePicker();break;case i.default.keys.ESCAPE:n.escape(),e.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}return r(e,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),c(this.label,"aria-expanded"),c(this.options,"aria-hidden")}},{key:"buildItem",value:function(e){var t=this,n=document.createElement("span");return n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item"),e.hasAttribute("value")&&n.setAttribute("data-value",e.getAttribute("value")),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",function(){t.selectItem(n,!0)}),n.addEventListener("keydown",function(e){switch(e.keyCode){case i.default.keys.ENTER:t.selectItem(n,!0),e.preventDefault();break;case i.default.keys.ESCAPE:t.escape(),e.preventDefault()}}),n}},{key:"buildLabel",value:function(){var e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=a.default,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}},{key:"buildOptions",value:function(){var e=this,t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id="ql-picker-options-"+l,l+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,[].slice.call(this.select.options).forEach(function(n){var o=e.buildItem(n);t.appendChild(o),!0===n.selected&&e.selectItem(o)}),this.container.appendChild(t)}},{key:"buildPicker",value:function(){var e=this;[].slice.call(this.select.attributes).forEach(function(t){e.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var e=this;this.close(),setTimeout(function(){return e.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(e.parentNode.children,e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":o(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}},{key:"update",value:function(){var e=void 0;if(this.select.selectedIndex>-1){var t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);var n=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=m(n(0)),r=m(n(5)),i=n(4),a=m(i),s=m(n(16)),l=m(n(25)),c=m(n(24)),u=m(n(35)),d=m(n(6)),f=m(n(22)),h=m(n(7)),p=m(n(55)),g=m(n(42)),y=m(n(23));function m(e){return e&&e.__esModule?e:{default:e}}r.default.register({"blots/block":a.default,"blots/block/embed":i.BlockEmbed,"blots/break":s.default,"blots/container":l.default,"blots/cursor":c.default,"blots/embed":u.default,"blots/inline":d.default,"blots/scroll":f.default,"blots/text":h.default,"modules/clipboard":p.default,"modules/history":g.default,"modules/keyboard":y.default}),o.default.register(a.default,s.default,c.default,d.default,f.default,h.default),t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),r=function(){function e(e){this.domNode=e,this.domNode[o.DATA_KEY]={blot:this}}return Object.defineProperty(e.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),e.create=function(e){if(null==this.tagName)throw new o.ParchmentError("Blot definition missing tagName");var t;return Array.isArray(this.tagName)?("string"==typeof e&&(e=e.toUpperCase(),parseInt(e).toString()===e&&(e=parseInt(e))),t="number"==typeof e?document.createElement(this.tagName[e-1]):this.tagName.indexOf(e)>-1?document.createElement(e):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t},e.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},e.prototype.clone=function(){var e=this.domNode.cloneNode(!1);return o.create(e)},e.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[o.DATA_KEY]},e.prototype.deleteAt=function(e,t){this.isolate(e,t).remove()},e.prototype.formatAt=function(e,t,n,r){var i=this.isolate(e,t);if(null!=o.query(n,o.Scope.BLOT)&&r)i.wrap(n,r);else if(null!=o.query(n,o.Scope.ATTRIBUTE)){var a=o.create(this.statics.scope);i.wrap(a),a.format(n,r)}},e.prototype.insertAt=function(e,t,n){var r=null==n?o.create("text",t):o.create(t,n),i=this.split(e);this.parent.insertBefore(r,i)},e.prototype.insertInto=function(e,t){void 0===t&&(t=null),null!=this.parent&&this.parent.children.remove(this);var n=null;e.children.insertBefore(this,t),null!=t&&(n=t.domNode),this.domNode.parentNode==e.domNode&&this.domNode.nextSibling==n||e.domNode.insertBefore(this.domNode,n),this.parent=e,this.attach()},e.prototype.isolate=function(e,t){var n=this.split(e);return n.split(t),n},e.prototype.length=function(){return 1},e.prototype.offset=function(e){return void 0===e&&(e=this.parent),null==this.parent||this==e?0:this.parent.children.offset(this)+this.parent.offset(e)},e.prototype.optimize=function(e){null!=this.domNode[o.DATA_KEY]&&delete this.domNode[o.DATA_KEY].mutations},e.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},e.prototype.replace=function(e){null!=e.parent&&(e.parent.insertBefore(this,e.next),e.remove())},e.prototype.replaceWith=function(e,t){var n="string"==typeof e?o.create(e,t):e;return n.replace(this),n},e.prototype.split=function(e,t){return 0===e?this:this.next},e.prototype.update=function(e,t){},e.prototype.wrap=function(e,t){var n="string"==typeof e?o.create(e,t):e;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},e.blotName="abstract",e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(12),r=n(32),i=n(33),a=n(1),s=function(){function e(e){this.attributes={},this.domNode=e,this.build()}return e.prototype.attribute=function(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])},e.prototype.build=function(){var e=this;this.attributes={};var t=o.default.keys(this.domNode),n=r.default.keys(this.domNode),s=i.default.keys(this.domNode);t.concat(n).concat(s).forEach(function(t){var n=a.query(t,a.Scope.ATTRIBUTE);n instanceof o.default&&(e.attributes[n.attrName]=n)})},e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(n){var o=t.attributes[n].value(t.domNode);e.format(n,o)})},e.prototype.move=function(e){var t=this;this.copy(e),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,n){return t[n]=e.attributes[n].value(e.domNode),t},{})},e}();t.default=s},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});function i(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(function(e){return 0===e.indexOf(t+"-")})}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.keys=function(e){return(e.getAttribute("class")||"").split(/\s+/).map(function(e){return e.split("-").slice(0,-1).join("-")})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(this.keyName+"-"+t),!0)},t.prototype.remove=function(e){i(e,this.keyName).forEach(function(t){e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")},t.prototype.value=function(e){var t=(i(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=a},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});function i(e){var t=e.split("-"),n=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("");return t[0]+n}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.keys=function(e){return(e.getAttribute("style")||"").split(";").map(function(e){return e.split(":")[0].trim()})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.style[i(this.keyName)]=t,!0)},t.prototype.remove=function(e){e.style[i(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")},t.prototype.value=function(e){var t=e.style[i(this.keyName)];return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.quill=t,this.options=n,this.modules={}}return o(e,[{key:"init",value:function(){var e=this;Object.keys(this.options.modules).forEach(function(t){null==e.modules[t]&&e.addModule(t)})}},{key:"addModule",value:function(e){var t=this.quill.constructor.import("modules/"+e);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}]),e}();r.DEFAULTS={modules:{}},r.themes={default:r},t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=s(n(0)),a=s(n(7));function s(e){return e&&e.__esModule?e:{default:e}}var l="\ufeff",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.contentNode=document.createElement("span"),n.contentNode.setAttribute("contenteditable",!1),[].slice.call(n.domNode.childNodes).forEach(function(e){n.contentNode.appendChild(e)}),n.leftGuard=document.createTextNode(l),n.rightGuard=document.createTextNode(l),n.domNode.appendChild(n.leftGuard),n.domNode.appendChild(n.contentNode),n.domNode.appendChild(n.rightGuard),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"index",value:function(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"index",this).call(this,e,n)}},{key:"restore",value:function(e){var t=void 0,n=void 0,o=e.data.split(l).join("");if(e===this.leftGuard)if(this.prev instanceof a.default){var r=this.prev.length();this.prev.insertAt(r,o),t={startNode:this.prev.domNode,startOffset:r+o.length}}else n=document.createTextNode(o),this.parent.insertBefore(i.default.create(n),this),t={startNode:n,startOffset:o.length};else e===this.rightGuard&&(this.next instanceof a.default?(this.next.insertAt(0,o),t={startNode:this.next.domNode,startOffset:o.length}):(n=document.createTextNode(o),this.parent.insertBefore(i.default.create(n),this.next),t={startNode:n,startOffset:o.length}));return e.data=l,t}},{key:"update",value:function(e,t){var n=this;e.forEach(function(e){if("characterData"===e.type&&(e.target===n.leftGuard||e.target===n.rightGuard)){var o=n.restore(e.target);o&&(t.range=o)}})}}]),t}(i.default.Embed);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlignStyle=t.AlignClass=t.AlignAttribute=void 0;var o,r=(o=n(0))&&o.__esModule?o:{default:o},i={scope:r.default.Scope.BLOCK,whitelist:["right","center","justify"]},a=new r.default.Attributor.Attribute("align","align",i),s=new r.default.Attributor.Class("align","ql-align",i),l=new r.default.Attributor.Style("align","text-align",i);t.AlignAttribute=a,t.AlignClass=s,t.AlignStyle=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackgroundStyle=t.BackgroundClass=void 0;var o,r=(o=n(0))&&o.__esModule?o:{default:o},i=n(26),a=new r.default.Attributor.Class("background","ql-bg",{scope:r.default.Scope.INLINE}),s=new i.ColorAttributor("background","background-color",{scope:r.default.Scope.INLINE});t.BackgroundClass=a,t.BackgroundStyle=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectionStyle=t.DirectionClass=t.DirectionAttribute=void 0;var o,r=(o=n(0))&&o.__esModule?o:{default:o},i={scope:r.default.Scope.BLOCK,whitelist:["rtl"]},a=new r.default.Attributor.Attribute("direction","dir",i),s=new r.default.Attributor.Class("direction","ql-direction",i),l=new r.default.Attributor.Style("direction","direction",i);t.DirectionAttribute=a,t.DirectionClass=s,t.DirectionStyle=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontClass=t.FontStyle=void 0;var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=(o=n(0))&&o.__esModule?o:{default:o},s={scope:a.default.Scope.INLINE,whitelist:["serif","monospace"]},l=new a.default.Attributor.Class("font","ql-font",s),c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"value",value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e).replace(/["']/g,"")}}]),t}(a.default.Attributor.Style),u=new c("font","font-family",s);t.FontStyle=u,t.FontClass=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SizeStyle=t.SizeClass=void 0;var o,r=(o=n(0))&&o.__esModule?o:{default:o},i=new r.default.Attributor.Class("size","ql-size",{scope:r.default.Scope.INLINE,whitelist:["small","large","huge"]}),a=new r.default.Attributor.Style("size","font-size",{scope:r.default.Scope.INLINE,whitelist:["10px","18px","32px"]});t.SizeClass=i,t.SizeStyle=a},function(e,t,n){"use strict";e.exports={align:{"":n(76),center:n(77),right:n(78),justify:n(79)},background:n(80),blockquote:n(81),bold:n(82),clean:n(83),code:n(58),"code-block":n(58),color:n(84),direction:{"":n(85),rtl:n(86)},float:{center:n(87),full:n(88),left:n(89),right:n(90)},formula:n(91),header:{1:n(92),2:n(93)},italic:n(94),image:n(95),indent:{"+1":n(96),"-1":n(97)},link:n(98),list:{ordered:n(99),bullet:n(100),check:n(101)},script:{sub:n(102),super:n(103)},strike:n(104),underline:n(105),video:n(106)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLastChangeIndex=t.default=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=a(n(0)),i=a(n(5));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.lastRecorded=0,o.ignoreChange=!1,o.clear(),o.quill.on(i.default.events.EDITOR_CHANGE,function(e,t,n,r){e!==i.default.events.TEXT_CHANGE||o.ignoreChange||(o.options.userOnly&&r!==i.default.sources.USER?o.transform(t):o.record(t,n))}),o.quill.keyboard.addBinding({key:"Z",shortKey:!0},o.undo.bind(o)),o.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},o.redo.bind(o)),/Win/i.test(navigator.platform)&&o.quill.keyboard.addBinding({key:"Y",shortKey:!0},o.redo.bind(o)),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"change",value:function(e,t){if(0!==this.stack[e].length){var n=this.stack[e].pop();this.stack[t].push(n),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n[e],i.default.sources.USER),this.ignoreChange=!1;var o=l(n[e]);this.quill.setSelection(o)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(e,t){if(0!==e.ops.length){this.stack.redo=[];var n=this.quill.getContents().diff(t),o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){var r=this.stack.undo.pop();n=n.compose(r.undo),e=r.redo.compose(e)}else this.lastRecorded=o;this.stack.undo.push({redo:e,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(e){this.stack.undo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}),this.stack.redo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),t}(a(n(9)).default);function l(e){var t=e.reduce(function(e,t){return e+(t.delete||0)},0),n=e.length()-t;return function(e){var t=e.ops[e.ops.length-1];return null!=t&&(null!=t.insert?"string"==typeof t.insert&&t.insert.endsWith("\n"):null!=t.attributes&&Object.keys(t.attributes).some(function(e){return null!=r.default.query(e,r.default.Scope.BLOCK)}))}(e)&&(n-=1),n}s.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},t.default=s,t.getLastChangeIndex=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BaseTooltip=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=p(n(3)),a=p(n(2)),s=p(n(8)),l=p(n(23)),c=p(n(34)),u=p(n(59)),d=p(n(60)),f=p(n(28)),h=p(n(61));function p(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var v=[!1,"center","right","justify"],b=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],w=[!1,"serif","monospace"],x=["1","2","3",!1],_=["small",!1,"large","huge"],k=function(e){function t(e,n){g(this,t);var o=y(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return e.emitter.listenDOM("click",document.body,function t(n){if(!document.body.contains(e.root))return document.body.removeEventListener("click",t);null==o.tooltip||o.tooltip.root.contains(n.target)||document.activeElement===o.tooltip.textbox||o.quill.hasFocus()||o.tooltip.hide(),null!=o.pickers&&o.pickers.forEach(function(e){e.container.contains(n.target)||e.close()})}),o}return m(t,e),o(t,[{key:"addModule",value:function(e){var n=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"addModule",this).call(this,e);return"toolbar"===e&&this.extendToolbar(n),n}},{key:"buildButtons",value:function(e,t){e.forEach(function(e){(e.getAttribute("class")||"").split(/\s+/).forEach(function(n){if(n.startsWith("ql-")&&(n=n.slice(3),null!=t[n]))if("direction"===n)e.innerHTML=t[n][""]+t[n].rtl;else if("string"==typeof t[n])e.innerHTML=t[n];else{var o=e.value||"";null!=o&&t[n][o]&&(e.innerHTML=t[n][o])}})})}},{key:"buildPickers",value:function(e,t){var n=this;this.pickers=e.map(function(e){if(e.classList.contains("ql-align"))return null==e.querySelector("option")&&C(e,v),new d.default(e,t.align);if(e.classList.contains("ql-background")||e.classList.contains("ql-color")){var n=e.classList.contains("ql-background")?"background":"color";return null==e.querySelector("option")&&C(e,b,"background"===n?"#ffffff":"#000000"),new u.default(e,t[n])}return null==e.querySelector("option")&&(e.classList.contains("ql-font")?C(e,w):e.classList.contains("ql-header")?C(e,x):e.classList.contains("ql-size")&&C(e,_)),new f.default(e)}),this.quill.on(s.default.events.EDITOR_CHANGE,function(){n.pickers.forEach(function(e){e.update()})})}}]),t}(c.default);k.DEFAULTS=(0,i.default)(!0,{},c.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var e=this,t=this.container.querySelector("input.ql-image[type=file]");null==t&&((t=document.createElement("input")).setAttribute("type","file"),t.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),t.classList.add("ql-image"),t.addEventListener("change",function(){if(null!=t.files&&null!=t.files[0]){var n=new FileReader;n.onload=function(n){var o=e.quill.getSelection(!0);e.quill.updateContents((new a.default).retain(o.index).delete(o.length).insert({image:n.target.result}),s.default.sources.USER),e.quill.setSelection(o.index+1,s.default.sources.SILENT),t.value=""},n.readAsDataURL(t.files[0])}}),this.container.appendChild(t)),t.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var E=function(e){function t(e,n){g(this,t);var o=y(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.textbox=o.root.querySelector('input[type="text"]'),o.listen(),o}return m(t,e),o(t,[{key:"listen",value:function(){var e=this;this.textbox.addEventListener("keydown",function(t){l.default.match(t,"enter")?(e.save(),t.preventDefault()):l.default.match(t,"escape")&&(e.cancel(),t.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+e)||""),this.root.setAttribute("data-mode",e)}},{key:"restoreFocus",value:function(){var e=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=e}},{key:"save",value:function(){var e,t,n=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var o=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",n,s.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",n,s.default.sources.USER)),this.quill.root.scrollTop=o;break;case"video":n=(t=(e=n).match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/))?(t[1]||"https")+"://www.youtube.com/embed/"+t[2]+"?showinfo=0":(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/":e;case"formula":if(!n)break;var r=this.quill.getSelection(!0);if(null!=r){var i=r.index+r.length;this.quill.insertEmbed(i,this.root.getAttribute("data-mode"),n,s.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(i+1," ",s.default.sources.USER),this.quill.setSelection(i+2,s.default.sources.USER)}}this.textbox.value="",this.hide()}}]),t}(h.default);function C(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach(function(t){var o=document.createElement("option");t===n?o.setAttribute("selected","selected"):o.setAttribute("value",t),e.appendChild(o)})}t.BaseTooltip=E,t.default=k},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){this.head=this.tail=null,this.length=0}return e.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.insertBefore(e[0],null),e.length>1&&this.append.apply(this,e.slice(1))},e.prototype.contains=function(e){for(var t,n=this.iterator();t=n();)if(t===e)return!0;return!1},e.prototype.insertBefore=function(e,t){e&&(e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)},e.prototype.offset=function(e){for(var t=0,n=this.head;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1},e.prototype.remove=function(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)},e.prototype.iterator=function(e){return void 0===e&&(e=this.head),function(){var t=e;return null!=e&&(e=e.next),t}},e.prototype.find=function(e,t){void 0===t&&(t=!1);for(var n,o=this.iterator();n=o();){var r=n.length();if(e<r||t&&e===r&&(null==n.next||0!==n.next.length()))return[n,e];e-=r}return[null,0]},e.prototype.forEach=function(e){for(var t,n=this.iterator();t=n();)e(t)},e.prototype.forEachAt=function(e,t,n){if(!(t<=0))for(var o,r=this.find(e),i=r[0],a=e-r[1],s=this.iterator(i);(o=s())&&a<e+t;){var l=o.length();e>a?n(o,e-a,Math.min(t,a+l-e)):n(o,0,Math.min(l,e+t-a)),a+=l}},e.prototype.map=function(e){return this.reduce(function(t,n){return t.push(e(n)),t},[])},e.prototype.reduce=function(e,t){for(var n,o=this.iterator();n=o();)t=e(t,n);return t},e}();t.default=o},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(17),a=n(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},l=function(e){function t(t){var n=e.call(this,t)||this;return n.scroll=n,n.observer=new MutationObserver(function(e){n.update(e)}),n.observer.observe(n.domNode,s),n.attach(),n}return r(t,e),t.prototype.detach=function(){e.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(t,n){this.update(),0===t&&n===this.length()?this.children.forEach(function(e){e.remove()}):e.prototype.deleteAt.call(this,t,n)},t.prototype.formatAt=function(t,n,o,r){this.update(),e.prototype.formatAt.call(this,t,n,o,r)},t.prototype.insertAt=function(t,n,o){this.update(),e.prototype.insertAt.call(this,t,n,o)},t.prototype.optimize=function(t,n){var o=this;void 0===t&&(t=[]),void 0===n&&(n={}),e.prototype.optimize.call(this,n);for(var r=[].slice.call(this.observer.takeRecords());r.length>0;)t.push(r.pop());for(var s=function(e,t){void 0===t&&(t=!0),null!=e&&e!==o&&null!=e.domNode.parentNode&&(null==e.domNode[a.DATA_KEY].mutations&&(e.domNode[a.DATA_KEY].mutations=[]),t&&s(e.parent))},l=function(e){null!=e.domNode[a.DATA_KEY]&&null!=e.domNode[a.DATA_KEY].mutations&&(e instanceof i.default&&e.children.forEach(l),e.optimize(n))},c=t,u=0;c.length>0;u+=1){if(u>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(c.forEach(function(e){var t=a.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(s(a.find(e.previousSibling,!1)),[].forEach.call(e.addedNodes,function(e){var t=a.find(e,!1);s(t,!1),t instanceof i.default&&t.children.forEach(function(e){s(e,!1)})})):"attributes"===e.type&&s(t.prev)),s(t))}),this.children.forEach(l),r=(c=[].slice.call(this.observer.takeRecords())).slice();r.length>0;)t.push(r.pop())}},t.prototype.update=function(t,n){var o=this;void 0===n&&(n={}),(t=t||this.observer.takeRecords()).map(function(e){var t=a.find(e.target,!0);return null==t?null:null==t.domNode[a.DATA_KEY].mutations?(t.domNode[a.DATA_KEY].mutations=[e],t):(t.domNode[a.DATA_KEY].mutations.push(e),null)}).forEach(function(e){null!=e&&e!==o&&null!=e.domNode[a.DATA_KEY]&&e.update(e.domNode[a.DATA_KEY].mutations||[],n)}),null!=this.domNode[a.DATA_KEY].mutations&&e.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(t,n)},t.blotName="scroll",t.defaultChild="block",t.scope=a.Scope.BLOCK_BLOT,t.tagName="DIV",t}(i.default);t.default=l},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(1),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(n){if(n.tagName!==t.tagName)return e.formats.call(this,n)},t.prototype.format=function(n,o){var r=this;n!==this.statics.blotName||o?e.prototype.format.call(this,n,o):(this.children.forEach(function(e){e instanceof i.default||(e=e.wrap(t.blotName,!0)),r.attributes.copy(e)}),this.unwrap())},t.prototype.formatAt=function(t,n,o,r){null!=this.formats()[o]||a.query(o,a.Scope.ATTRIBUTE)?this.isolate(t,n).format(o,r):e.prototype.formatAt.call(this,t,n,o,r)},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n);var o=this.formats();if(0===Object.keys(o).length)return this.unwrap();var r=this.next;r instanceof t&&r.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}(o,r.formats())&&(r.moveChildren(this),r.remove())},t.blotName="inline",t.scope=a.Scope.INLINE_BLOT,t.tagName="SPAN",t}(i.default);t.default=s},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(1),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(n){var o=a.query(t.blotName).tagName;if(n.tagName!==o)return e.formats.call(this,n)},t.prototype.format=function(n,o){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||o?e.prototype.format.call(this,n,o):this.replaceWith(t.blotName))},t.prototype.formatAt=function(t,n,o,r){null!=a.query(o,a.Scope.BLOCK)?this.format(o,r):e.prototype.formatAt.call(this,t,n,o,r)},t.prototype.insertAt=function(t,n,o){if(null==o||null!=a.query(n,a.Scope.INLINE))e.prototype.insertAt.call(this,t,n,o);else{var r=this.split(t),i=a.create(n,o);r.parent.insertBefore(i,r)}},t.prototype.update=function(t,n){navigator.userAgent.match(/Trident/)?this.build():e.prototype.update.call(this,t,n)},t.blotName="block",t.scope=a.Scope.BLOCK_BLOT,t.tagName="P",t}(i.default);t.default=s},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(e){},t.prototype.format=function(t,n){e.prototype.formatAt.call(this,0,this.length(),t,n)},t.prototype.formatAt=function(t,n,o,r){0===t&&n===this.length()?this.format(o,r):e.prototype.formatAt.call(this,t,n,o,r)},t.prototype.formats=function(){return this.statics.formats(this.domNode)},t}(n(19).default);t.default=i},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(19),a=n(1),s=function(e){function t(t){var n=e.call(this,t)||this;return n.text=n.statics.value(n.domNode),n}return r(t,e),t.create=function(e){return document.createTextNode(e)},t.value=function(e){var t=e.data;return t.normalize&&(t=t.normalize()),t},t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)},t.prototype.index=function(e,t){return this.domNode===e?t:-1},t.prototype.insertAt=function(t,n,o){null==o?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):e.prototype.insertAt.call(this,t,n,o)},t.prototype.length=function(){return this.text.length},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},t.prototype.position=function(e,t){return void 0===t&&(t=!1),[this.domNode,e]},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=a.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},t.prototype.update=function(e,t){var n=this;e.some(function(e){return"characterData"===e.type&&e.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},t.prototype.value=function(){return this.text},t.blotName="text",t.scope=a.Scope.INLINE_BLOT,t}(i.default);t.default=s},function(e,t,n){"use strict";var o=document.createElement("div");if(o.classList.toggle("test-class",!1),o.classList.contains("test-class")){var r=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return arguments.length>1&&!this.contains(e)==!t?t:r.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var o=n.indexOf(e,t);return-1!==o&&o===t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var t,n=Object(this),o=n.length>>>0,r=arguments[1],i=0;i<o;i++)if(t=n[i],e.call(r,t,i,n))return t}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(e,t){var n=-1;function o(e,t,l){if(e==t)return e?[[0,e]]:[];(l<0||e.length<l)&&(l=null);var u=i(e,t),d=e.substring(0,u);u=a(e=e.substring(u),t=t.substring(u));var f=e.substring(e.length-u),h=function(e,t){var s;if(!e)return[[1,t]];if(!t)return[[n,e]];var l=e.length>t.length?e:t,c=e.length>t.length?t:e,u=l.indexOf(c);if(-1!=u)return s=[[1,l.substring(0,u)],[0,c],[1,l.substring(u+c.length)]],e.length>t.length&&(s[0][0]=s[2][0]=n),s;if(1==c.length)return[[n,e],[1,t]];var d=function(e,t){var n=e.length>t.length?e:t,o=e.length>t.length?t:e;if(n.length<4||2*o.length<n.length)return null;function r(e,t,n){for(var o,r,s,l,c=e.substring(n,n+Math.floor(e.length/4)),u=-1,d="";-1!=(u=t.indexOf(c,u+1));){var f=i(e.substring(n),t.substring(u)),h=a(e.substring(0,n),t.substring(0,u));d.length<h+f&&(d=t.substring(u-h,u)+t.substring(u,u+f),o=e.substring(0,n-h),r=e.substring(n+f),s=t.substring(0,u-h),l=t.substring(u+f))}return 2*d.length>=e.length?[o,r,s,l,d]:null}var s,l,c,u,d,f=r(n,o,Math.ceil(n.length/4)),h=r(n,o,Math.ceil(n.length/2));return f||h?(s=h?f&&f[4].length>h[4].length?f:h:f,e.length>t.length?(l=s[0],c=s[1],u=s[2],d=s[3]):(u=s[0],d=s[1],l=s[2],c=s[3]),[l,c,u,d,s[4]]):null}(e,t);if(d){var f=d[0],h=d[1],p=d[2],g=d[3],y=d[4],m=o(f,p),v=o(h,g);return m.concat([[0,y]],v)}return function(e,t){for(var o=e.length,i=t.length,a=Math.ceil((o+i)/2),s=a,l=2*a,c=new Array(l),u=new Array(l),d=0;d<l;d++)c[d]=-1,u[d]=-1;c[s+1]=0,u[s+1]=0;for(var f=o-i,h=f%2!=0,p=0,g=0,y=0,m=0,v=0;v<a;v++){for(var b=-v+p;b<=v-g;b+=2){for(var w=s+b,x=(N=b==-v||b!=v&&c[w-1]<c[w+1]?c[w+1]:c[w-1]+1)-b;N<o&&x<i&&e.charAt(N)==t.charAt(x);)N++,x++;if(c[w]=N,N>o)g+=2;else if(x>i)p+=2;else if(h&&(E=s+f-b)>=0&&E<l&&-1!=u[E]&&N>=(k=o-u[E]))return r(e,t,N,x)}for(var _=-v+y;_<=v-m;_+=2){for(var k,E=s+_,C=(k=_==-v||_!=v&&u[E-1]<u[E+1]?u[E+1]:u[E-1]+1)-_;k<o&&C<i&&e.charAt(o-k-1)==t.charAt(i-C-1);)k++,C++;if(u[E]=k,k>o)m+=2;else if(C>i)y+=2;else if(!h){var N;if((w=s+f-_)>=0&&w<l&&-1!=c[w]&&(x=s+(N=c[w])-w,N>=(k=o-k)))return r(e,t,N,x)}}}return[[n,e],[1,t]]}(e,t)}(e=e.substring(0,e.length-u),t=t.substring(0,t.length-u));return d&&h.unshift([0,d]),f&&h.push([0,f]),s(h),null!=l&&(h=function(e,t){var o=function(e,t){if(0===t)return[0,e];for(var o=0,r=0;r<e.length;r++){var i=e[r];if(i[0]===n||0===i[0]){var a=o+i[1].length;if(t===a)return[r+1,e];if(t<a){e=e.slice();var s=t-o,l=[i[0],i[1].slice(0,s)],c=[i[0],i[1].slice(s)];return e.splice(r,1,l,c),[r+1,e]}o=a}}throw new Error("cursor_pos is out of bounds!")}(e,t),r=o[1],i=o[0],a=r[i],s=r[i+1];if(null==a)return e;if(0!==a[0])return e;if(null!=s&&a[1]+s[1]===s[1]+a[1])return r.splice(i,2,s,a),c(r,i,2);if(null!=s&&0===s[1].indexOf(a[1])){r.splice(i,2,[s[0],a[1]],[0,a[1]]);var l=s[1].slice(a[1].length);return l.length>0&&r.splice(i+2,0,[s[0],l]),c(r,i,3)}return e}(h,l)),function(e){for(var t=!1,o=function(e){return e.charCodeAt(0)>=56320&&e.charCodeAt(0)<=57343},r=function(e){return e.charCodeAt(e.length-1)>=55296&&e.charCodeAt(e.length-1)<=56319},i=2;i<e.length;i+=1)0===e[i-2][0]&&r(e[i-2][1])&&e[i-1][0]===n&&o(e[i-1][1])&&1===e[i][0]&&o(e[i][1])&&(t=!0,e[i-1][1]=e[i-2][1].slice(-1)+e[i-1][1],e[i][1]=e[i-2][1].slice(-1)+e[i][1],e[i-2][1]=e[i-2][1].slice(0,-1));if(!t)return e;var a=[];for(i=0;i<e.length;i+=1)e[i][1].length>0&&a.push(e[i]);return a}(h)}function r(e,t,n,r){var i=e.substring(0,n),a=t.substring(0,r),s=e.substring(n),l=t.substring(r),c=o(i,a),u=o(s,l);return c.concat(u)}function i(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,o=Math.min(e.length,t.length),r=o,i=0;n<r;)e.substring(i,r)==t.substring(i,r)?i=n=r:o=r,r=Math.floor((o-n)/2+n);return r}function a(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,o=Math.min(e.length,t.length),r=o,i=0;n<r;)e.substring(e.length-r,e.length-i)==t.substring(t.length-r,t.length-i)?i=n=r:o=r,r=Math.floor((o-n)/2+n);return r}function s(e){e.push([0,""]);for(var t,o=0,r=0,l=0,c="",u="";o<e.length;)switch(e[o][0]){case 1:l++,u+=e[o][1],o++;break;case n:r++,c+=e[o][1],o++;break;case 0:r+l>1?(0!==r&&0!==l&&(0!==(t=i(u,c))&&(o-r-l>0&&0==e[o-r-l-1][0]?e[o-r-l-1][1]+=u.substring(0,t):(e.splice(0,0,[0,u.substring(0,t)]),o++),u=u.substring(t),c=c.substring(t)),0!==(t=a(u,c))&&(e[o][1]=u.substring(u.length-t)+e[o][1],u=u.substring(0,u.length-t),c=c.substring(0,c.length-t))),0===r?e.splice(o-l,r+l,[1,u]):0===l?e.splice(o-r,r+l,[n,c]):e.splice(o-r-l,r+l,[n,c],[1,u]),o=o-r-l+(r?1:0)+(l?1:0)+1):0!==o&&0==e[o-1][0]?(e[o-1][1]+=e[o][1],e.splice(o,1)):o++,l=0,r=0,c="",u=""}""===e[e.length-1][1]&&e.pop();var d=!1;for(o=1;o<e.length-1;)0==e[o-1][0]&&0==e[o+1][0]&&(e[o][1].substring(e[o][1].length-e[o-1][1].length)==e[o-1][1]?(e[o][1]=e[o-1][1]+e[o][1].substring(0,e[o][1].length-e[o-1][1].length),e[o+1][1]=e[o-1][1]+e[o+1][1],e.splice(o-1,1),d=!0):e[o][1].substring(0,e[o+1][1].length)==e[o+1][1]&&(e[o-1][1]+=e[o+1][1],e[o][1]=e[o][1].substring(e[o+1][1].length)+e[o+1][1],e.splice(o+1,1),d=!0)),o++;d&&s(e)}var l=o;function c(e,t,n){for(var o=t+n-1;o>=0&&o>=t-1;o--)if(o+1<e.length){var r=e[o],i=e[o+1];r[0]===i[1]&&e.splice(o,2,[r[0],r[1]+i[1]])}return e}l.INSERT=1,l.DELETE=n,l.EQUAL=0,e.exports=l},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}(e.exports="function"==typeof Object.keys?Object.keys:n).shim=n},function(e,t){var n="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function o(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=n?o:r).supported=o,t.unsupported=r},function(e,t){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(o=!1)),a.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);i<a;i++)s[i]=r[i].fn;return s},a.prototype.emit=function(e,t,n,r,i,a){var s=o?o+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,i),!0;case 6:return u.fn.call(u.context,t,n,r,i,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var f,h=u.length;for(c=0;c<h;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,r);break;default:if(!l)for(f=1,l=new Array(d-1);f<d;f++)l[f-1]=arguments[f];u[c].fn.apply(u[c].context,l)}}return!0},a.prototype.on=function(e,t,n){var r=new i(t,n||this),a=o?o+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],r]:this._events[a].push(r):(this._events[a]=r,this._eventsCount++),this},a.prototype.once=function(e,t,n){var r=new i(t,n||this,!0),a=o?o+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],r]:this._events[a].push(r):(this._events[a]=r,this._eventsCount++),this},a.prototype.removeListener=function(e,t,n,i){var a=o?o+e:e;if(!this._events[a])return this;if(!t)return 0===--this._eventsCount?this._events=new r:delete this._events[a],this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||(0===--this._eventsCount?this._events=new r:delete this._events[a]);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||i&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[a]=1===c.length?c[0]:c:0===--this._eventsCount?this._events=new r:delete this._events[a]}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&(0===--this._eventsCount?this._events=new r:delete this._events[t])):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prototype.setMaxListeners=function(){return this},a.prefixed=o,a.EventEmitter=a,void 0!==e&&(e.exports=a)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchText=t.matchSpacing=t.matchNewline=t.matchBlot=t.matchAttributor=t.default=void 0;var o="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},r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=b(n(3)),s=b(n(2)),l=b(n(0)),c=b(n(5)),u=b(n(10)),d=b(n(9)),f=n(36),h=n(37),p=b(n(13)),g=n(26),y=n(38),m=n(39),v=n(40);function b(e){return e&&e.__esModule?e:{default:e}}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x=(0,u.default)("quill:clipboard"),_="__ql-matcher",k=[[Node.TEXT_NODE,q],[Node.TEXT_NODE,D],["br",function(e,t){return j(t,"\n")||t.insert("\n"),t}],[Node.ELEMENT_NODE,D],[Node.ELEMENT_NODE,L],[Node.ELEMENT_NODE,I],[Node.ELEMENT_NODE,M],[Node.ELEMENT_NODE,function(e,t){var n={},o=e.style||{};return o.fontStyle&&"italic"===O(e).fontStyle&&(n.italic=!0),o.fontWeight&&(O(e).fontWeight.startsWith("bold")||parseInt(O(e).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(t=S(t,n)),parseFloat(o.textIndent||0)>0&&(t=(new s.default).insert("\t").concat(t)),t}],["li",function(e,t){var n=l.default.query(e);if(null==n||"list-item"!==n.blotName||!j(t,"\n"))return t;for(var o=-1,r=e.parentNode;!r.classList.contains("ql-clipboard");)"list"===(l.default.query(r)||{}).blotName&&(o+=1),r=r.parentNode;return o<=0?t:t.compose((new s.default).retain(t.length()-1).retain(1,{indent:o}))}],["b",T.bind(T,"bold")],["i",T.bind(T,"italic")],["style",function(){return new s.default}]],E=[f.AlignAttribute,y.DirectionAttribute].reduce(function(e,t){return e[t.keyName]=t,e},{}),C=[f.AlignStyle,h.BackgroundStyle,g.ColorStyle,y.DirectionStyle,m.FontStyle,v.SizeStyle].reduce(function(e,t){return e[t.keyName]=t,e},{}),N=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.quill.root.addEventListener("paste",o.onPaste.bind(o)),o.container=o.quill.addContainer("ql-clipboard"),o.container.setAttribute("contenteditable",!0),o.container.setAttribute("tabindex",-1),o.matchers=[],k.concat(o.options.matchers).forEach(function(e){var t=r(e,2),i=t[0],a=t[1];(n.matchVisual||a!==I)&&o.addMatcher(i,a)}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"addMatcher",value:function(e,t){this.matchers.push([e,t])}},{key:"convert",value:function(e){if("string"==typeof e)return this.container.innerHTML=e.replace(/\>\r?\n +\</g,"><"),this.convert();var t=this.quill.getFormat(this.quill.selection.savedRange.index);if(t[p.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new s.default).insert(n,w({},p.default.blotName,t[p.default.blotName]))}var o=this.prepareMatching(),i=r(o,2),a=i[0],l=i[1],c=P(this.container,a,l);return j(c,"\n")&&null==c.ops[c.ops.length-1].attributes&&(c=c.compose((new s.default).retain(c.length()-1).delete(1))),x.log("convert",this.container.innerHTML,c),this.container.innerHTML="",c}},{key:"dangerouslyPasteHTML",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.default.sources.API;if("string"==typeof e)this.quill.setContents(this.convert(e),t),this.quill.setSelection(0,c.default.sources.SILENT);else{var o=this.convert(t);this.quill.updateContents((new s.default).retain(e).concat(o),n),this.quill.setSelection(e+o.length(),c.default.sources.SILENT)}}},{key:"onPaste",value:function(e){var t=this;if(!e.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),o=(new s.default).retain(n.index),r=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(c.default.sources.SILENT),setTimeout(function(){o=o.concat(t.convert()).delete(n.length),t.quill.updateContents(o,c.default.sources.USER),t.quill.setSelection(o.length()-n.length,c.default.sources.SILENT),t.quill.scrollingContainer.scrollTop=r,t.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var e=this,t=[],n=[];return this.matchers.forEach(function(o){var i=r(o,2),a=i[0],s=i[1];switch(a){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:t.push(s);break;default:[].forEach.call(e.container.querySelectorAll(a),function(e){e[_]=e[_]||[],e[_].push(s)})}}),[t,n]}}]),t}(d.default);function S(e,t,n){return"object"===(void 0===t?"undefined":o(t))?Object.keys(t).reduce(function(e,n){return S(e,n,t[n])},e):e.reduce(function(e,o){return o.attributes&&o.attributes[t]?e.push(o):e.insert(o.insert,(0,a.default)({},w({},t,n),o.attributes))},new s.default)}function O(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t="__ql-computed-style";return e[t]||(e[t]=window.getComputedStyle(e))}function j(e,t){for(var n="",o=e.ops.length-1;o>=0&&n.length<t.length;--o){var r=e.ops[o];if("string"!=typeof r.insert)break;n=r.insert+n}return n.slice(-1*t.length)===t}function A(e){if(0===e.childNodes.length)return!1;var t=O(e);return["block","list-item"].indexOf(t.display)>-1}function P(e,t,n){return e.nodeType===e.TEXT_NODE?n.reduce(function(t,n){return n(e,t)},new s.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],function(o,r){var i=P(r,t,n);return r.nodeType===e.ELEMENT_NODE&&(i=t.reduce(function(e,t){return t(r,e)},i),i=(r[_]||[]).reduce(function(e,t){return t(r,e)},i)),o.concat(i)},new s.default):new s.default}function T(e,t,n){return S(n,e,!0)}function M(e,t){var n=l.default.Attributor.Attribute.keys(e),o=l.default.Attributor.Class.keys(e),r=l.default.Attributor.Style.keys(e),i={};return n.concat(o).concat(r).forEach(function(t){var n=l.default.query(t,l.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(e),i[n.attrName])||(null==(n=E[t])||n.attrName!==t&&n.keyName!==t||(i[n.attrName]=n.value(e)||void 0),null==(n=C[t])||n.attrName!==t&&n.keyName!==t||(n=C[t],i[n.attrName]=n.value(e)||void 0))}),Object.keys(i).length>0&&(t=S(t,i)),t}function L(e,t){var n=l.default.query(e);if(null==n)return t;if(n.prototype instanceof l.default.Embed){var o={},r=n.value(e);null!=r&&(o[n.blotName]=r,t=(new s.default).insert(o,n.formats(e)))}else"function"==typeof n.formats&&(t=S(t,n.blotName,n.formats(e)));return t}function D(e,t){return j(t,"\n")||(A(e)||t.length()>0&&e.nextSibling&&A(e.nextSibling))&&t.insert("\n"),t}function I(e,t){if(A(e)&&null!=e.nextElementSibling&&!j(t,"\n\n")){var n=e.offsetHeight+parseFloat(O(e).marginTop)+parseFloat(O(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+1.5*n&&t.insert("\n")}return t}function q(e,t){var n=e.data;if("O:P"===e.parentNode.tagName)return t.insert(n.trim());if(0===n.trim().length&&e.parentNode.classList.contains("ql-clipboard"))return t;if(!O(e.parentNode).whiteSpace.startsWith("pre")){var o=function(e,t){return(t=t.replace(/[^\u00a0]/g,"")).length<1&&e?" ":t};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,o.bind(o,!0)),(null==e.previousSibling&&A(e.parentNode)||null!=e.previousSibling&&A(e.previousSibling))&&(n=n.replace(/^\s+/,o.bind(o,!1))),(null==e.nextSibling&&A(e.parentNode)||null!=e.nextSibling&&A(e.nextSibling))&&(n=n.replace(/\s+$/,o.bind(o,!1)))}return t.insert(n)}N.DEFAULTS={matchers:[],matchVisual:!0},t.default=N,t.matchAttributor=M,t.matchBlot=L,t.matchNewline=D,t.matchSpacing=I,t.matchText=q},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"optimize",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);a.blotName="bold",a.tagName=["STRONG","B"],t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addControls=t.default=void 0;var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=u(n(2)),a=u(n(0)),s=u(n(5)),l=u(n(10)),c=u(n(9));function u(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=(0,l.default)("quill:toolbar"),h=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r,i=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(Array.isArray(i.options.container)){var a=document.createElement("div");g(a,i.options.container),e.container.parentNode.insertBefore(a,e.container),i.container=a}else"string"==typeof i.options.container?i.container=document.querySelector(i.options.container):i.container=i.options.container;return i.container instanceof HTMLElement?(i.container.classList.add("ql-toolbar"),i.controls=[],i.handlers={},Object.keys(i.options.handlers).forEach(function(e){i.addHandler(e,i.options.handlers[e])}),[].forEach.call(i.container.querySelectorAll("button, select"),function(e){i.attach(e)}),i.quill.on(s.default.events.EDITOR_CHANGE,function(e,t){e===s.default.events.SELECTION_CHANGE&&i.update(t)}),i.quill.on(s.default.events.SCROLL_OPTIMIZE,function(){var e=i.quill.selection.getRange(),t=o(e,1)[0];i.update(t)}),i):(r=f.error("Container required for toolbar",i.options),d(i,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"addHandler",value:function(e,t){this.handlers[e]=t}},{key:"attach",value:function(e){var t=this,n=[].find.call(e.classList,function(e){return 0===e.indexOf("ql-")});if(n){if(n=n.slice(3),"BUTTON"===e.tagName&&e.setAttribute("type","button"),null==this.handlers[n]){if(null!=this.quill.scroll.whitelist&&null==this.quill.scroll.whitelist[n])return void f.warn("ignoring attaching to disabled format",n,e);if(null==a.default.query(n))return void f.warn("ignoring attaching to nonexistent format",n,e)}var r="SELECT"===e.tagName?"change":"click";e.addEventListener(r,function(r){var l=void 0;if("SELECT"===e.tagName){if(e.selectedIndex<0)return;var c=e.options[e.selectedIndex];l=!c.hasAttribute("selected")&&(c.value||!1)}else l=!e.classList.contains("ql-active")&&(e.value||!e.hasAttribute("value")),r.preventDefault();t.quill.focus();var u=t.quill.selection.getRange(),d=o(u,1)[0];if(null!=t.handlers[n])t.handlers[n].call(t,l);else if(a.default.query(n).prototype instanceof a.default.Embed){if(!(l=prompt("Enter "+n)))return;t.quill.updateContents((new i.default).retain(d.index).delete(d.length).insert(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},n,l)),s.default.sources.USER)}else t.quill.format(n,l,s.default.sources.USER);t.update(d)}),this.controls.push([n,e])}}},{key:"update",value:function(e){var t=null==e?{}:this.quill.getFormat(e);this.controls.forEach(function(n){var r=o(n,2),i=r[0],a=r[1];if("SELECT"===a.tagName){var s=void 0;if(null==e)s=null;else if(null==t[i])s=a.querySelector("option[selected]");else if(!Array.isArray(t[i])){var l=t[i];"string"==typeof l&&(l=l.replace(/\"/g,'\\"')),s=a.querySelector('option[value="'+l+'"]')}null==s?(a.value="",a.selectedIndex=-1):s.selected=!0}else if(null==e)a.classList.remove("ql-active");else if(a.hasAttribute("value")){var c=t[i]===a.getAttribute("value")||null!=t[i]&&t[i].toString()===a.getAttribute("value")||null==t[i]&&!a.getAttribute("value");a.classList.toggle("ql-active",c)}else a.classList.toggle("ql-active",null!=t[i])})}}]),t}(c.default);function p(e,t,n){var o=document.createElement("button");o.setAttribute("type","button"),o.classList.add("ql-"+t),null!=n&&(o.value=n),e.appendChild(o)}function g(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(function(t){var n=document.createElement("span");n.classList.add("ql-formats"),t.forEach(function(e){if("string"==typeof e)p(n,e);else{var t=Object.keys(e)[0],o=e[t];Array.isArray(o)?function(e,t,n){var o=document.createElement("select");o.classList.add("ql-"+t),n.forEach(function(e){var t=document.createElement("option");!1!==e?t.setAttribute("value",e):t.setAttribute("selected","selected"),o.appendChild(t)}),e.appendChild(o)}(n,t,o):p(n,t,o)}}),e.appendChild(n)})}h.DEFAULTS={},h.DEFAULTS={container:null,handlers:{clean:function(){var e=this,t=this.quill.getSelection();if(null!=t)if(0==t.length){var n=this.quill.getFormat();Object.keys(n).forEach(function(t){null!=a.default.query(t,a.default.Scope.INLINE)&&e.quill.format(t,!1)})}else this.quill.removeFormat(t,s.default.sources.USER)},direction:function(e){var t=this.quill.getFormat().align;"rtl"===e&&null==t?this.quill.format("align","right",s.default.sources.USER):e||"right"!==t||this.quill.format("align",!1,s.default.sources.USER),this.quill.format("direction",e,s.default.sources.USER)},indent:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t),o=parseInt(n.indent||0);if("+1"===e||"-1"===e){var r="+1"===e?1:-1;"rtl"===n.direction&&(r*=-1),this.quill.format("indent",o+r,s.default.sources.USER)}},link:function(e){!0===e&&(e=prompt("Enter link URL:")),this.quill.format("link",e,s.default.sources.USER)},list:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t);"check"===e?"checked"===n.list||"unchecked"===n.list?this.quill.format("list",!1,s.default.sources.USER):this.quill.format("list","unchecked",s.default.sources.USER):this.quill.format("list",e,s.default.sources.USER)}}},t.default=h,t.addControls=g},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.label.innerHTML=n,o.container.classList.add("ql-color-picker"),[].slice.call(o.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(e){e.classList.add("ql-primary")}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"buildItem",value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"buildItem",this).call(this,e);return n.style.backgroundColor=e.getAttribute("value")||"",n}},{key:"selectItem",value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"selectItem",this).call(this,e,n);var o=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";o&&("line"===o.tagName?o.style.stroke=r:o.style.fill=r)}}]),t}(((o=n(28))&&o.__esModule?o:{default:o}).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.container.classList.add("ql-icon-picker"),[].forEach.call(o.container.querySelectorAll(".ql-picker-item"),function(e){e.innerHTML=n[e.getAttribute("data-value")||""]}),o.defaultItem=o.container.querySelector(".ql-selected"),o.selectItem(o.defaultItem),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"selectItem",value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"selectItem",this).call(this,e,n),e=e||this.defaultItem,this.label.innerHTML=e.innerHTML}}]),t}(((o=n(28))&&o.__esModule?o:{default:o}).default);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.quill=t,this.boundsContainer=n||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){o.root.style.marginTop=-1*o.quill.root.scrollTop+"px"}),this.hide()}return o(e,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(e){var t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=t+"px",this.root.style.top=n+"px",this.root.classList.remove("ql-flip");var o=this.boundsContainer.getBoundingClientRect(),r=this.root.getBoundingClientRect(),i=0;if(r.right>o.right&&(i=o.right-r.right,this.root.style.left=t+i+"px"),r.left<o.left&&(i=o.left-r.left,this.root.style.left=t+i+"px"),r.bottom>o.bottom){var a=r.bottom-r.top,s=e.bottom-e.top+a;this.root.style.top=n-s+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=f(n(3)),a=f(n(8)),s=n(43),l=f(s),c=f(n(27)),u=n(15),d=f(n(41));function f(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var y=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],m=function(e){function t(e,n){h(this,t),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=y);var o=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.quill.container.classList.add("ql-snow"),o}return g(t,e),r(t,[{key:"extendToolbar",value:function(e){e.container.classList.add("ql-snow"),this.buildButtons([].slice.call(e.container.querySelectorAll("button")),d.default),this.buildPickers([].slice.call(e.container.querySelectorAll("select")),d.default),this.tooltip=new v(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(t,n){e.handlers.link.call(e,!n.format.link)})}}]),t}(l.default);m.DEFAULTS=(0,i.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){if(e){var t=this.quill.getSelection();if(null==t||0==t.length)return;var n=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(n)&&0!==n.indexOf("mailto:")&&(n="mailto:"+n),this.quill.theme.tooltip.edit("link",n)}else this.quill.format("link",!1)}}}}});var v=function(e){function t(e,n){h(this,t);var o=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.preview=o.root.querySelector("a.ql-preview"),o}return g(t,e),r(t,[{key:"listen",value:function(){var e=this;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(t){e.root.classList.contains("ql-editing")?e.save():e.edit("link",e.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(t){if(null!=e.linkRange){var n=e.linkRange;e.restoreFocus(),e.quill.formatText(n,"link",!1,a.default.sources.USER),delete e.linkRange}t.preventDefault(),e.hide()}),this.quill.on(a.default.events.SELECTION_CHANGE,function(t,n,o){if(null!=t){if(0===t.length&&o===a.default.sources.USER){var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],_n=!0,o=!1,r=void 0;try{for(var i,a=e[Symbol.iterator]();!(_n=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);_n=!0);}catch(e){o=!0,r=e}finally{try{!_n&&a.return&&a.return()}finally{if(o)throw r}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e.quill.scroll.descendant(c.default,t.index),2),i=r[0],s=r[1];if(null!=i){e.linkRange=new u.Range(t.index-s,i.length());var l=c.default.formats(i.domNode);return e.preview.textContent=l,e.preview.setAttribute("href",l),e.show(),void e.position(e.quill.getBounds(e.linkRange))}}else delete e.linkRange;e.hide()}})}},{key:"show",value:function(){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),t}(s.BaseTooltip);v.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=D(n(29)),r=n(36),i=n(38),a=n(64),s=D(n(65)),l=D(n(66)),c=n(67),u=D(c),d=n(37),f=n(26),h=n(39),p=n(40),g=D(n(56)),y=D(n(68)),m=D(n(27)),v=D(n(69)),b=D(n(70)),w=D(n(71)),x=D(n(72)),_=D(n(73)),k=n(13),E=D(k),C=D(n(74)),N=D(n(75)),S=D(n(57)),O=D(n(41)),j=D(n(28)),A=D(n(59)),P=D(n(60)),T=D(n(61)),M=D(n(108)),L=D(n(62));function D(e){return e&&e.__esModule?e:{default:e}}o.default.register({"attributors/attribute/direction":i.DirectionAttribute,"attributors/class/align":r.AlignClass,"attributors/class/background":d.BackgroundClass,"attributors/class/color":f.ColorClass,"attributors/class/direction":i.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":r.AlignStyle,"attributors/style/background":d.BackgroundStyle,"attributors/style/color":f.ColorStyle,"attributors/style/direction":i.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":p.SizeStyle},!0),o.default.register({"formats/align":r.AlignClass,"formats/direction":i.DirectionClass,"formats/indent":a.IndentClass,"formats/background":d.BackgroundStyle,"formats/color":f.ColorStyle,"formats/font":h.FontClass,"formats/size":p.SizeClass,"formats/blockquote":s.default,"formats/code-block":E.default,"formats/header":l.default,"formats/list":u.default,"formats/bold":g.default,"formats/code":k.Code,"formats/italic":y.default,"formats/link":m.default,"formats/script":v.default,"formats/strike":b.default,"formats/underline":w.default,"formats/image":x.default,"formats/video":_.default,"formats/list/item":c.ListItem,"modules/formula":C.default,"modules/syntax":N.default,"modules/toolbar":S.default,"themes/bubble":M.default,"themes/snow":L.default,"ui/icons":O.default,"ui/picker":j.default,"ui/icon-picker":P.default,"ui/color-picker":A.default,"ui/tooltip":T.default},!0),t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentClass=void 0;var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=(o=n(0))&&o.__esModule?o:{default:o},s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"add",value:function(e,n){if("+1"===n||"-1"===n){var o=this.value(e)||0;n="+1"===n?o+1:o-1}return 0===n?(this.remove(e),!0):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"add",this).call(this,e,n)}},{key:"canAdd",value:function(e,n){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"canAdd",this).call(this,e,n)||i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"canAdd",this).call(this,e,parseInt(n))}},{key:"value",value:function(e){return parseInt(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this).call(this,e))||void 0}}]),t}(a.default.Attributor.Class),l=new s("indent","ql-indent",{scope:a.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});t.IndentClass=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(4))&&o.__esModule?o:{default:o}).default);r.blotName="blockquote",r.tagName="blockquote",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,null,[{key:"formats",value:function(e){return this.tagName.indexOf(e.tagName)+1}}]),t}(((o=n(4))&&o.__esModule?o:{default:o}).default);i.blotName="header",i.tagName=["H1","H2","H3","H4","H5","H6"],t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ListItem=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=l(n(0)),a=l(n(4)),s=l(n(25));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(){return c(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),o(t,[{key:"format",value:function(e,n){e!==h.blotName||n?r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n):this.replaceWith(i.default.create(this.statics.scope))}},{key:"remove",value:function(){null==this.prev&&null==this.next?this.parent.remove():r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(e,n){return this.parent.isolate(this.offset(this.parent),this.length()),e===this.parent.statics.blotName?(this.parent.replaceWith(e,n),this):(this.parent.unwrap(),r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replaceWith",this).call(this,e,n))}}],[{key:"formats",value:function(e){return e.tagName===this.tagName?void 0:r(t.__proto__||Object.getPrototypeOf(t),"formats",this).call(this,e)}}]),t}(a.default);f.blotName="list-item",f.tagName="LI";var h=function(e){function t(e){c(this,t);var n=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),o=function(t){if(t.target.parentNode===e){var o=n.statics.formats(e),r=i.default.find(t.target);"checked"===o?r.format("list","unchecked"):"unchecked"===o&&r.format("list","checked")}};return e.addEventListener("touchstart",o),e.addEventListener("mousedown",o),n}return d(t,e),o(t,null,[{key:"create",value:function(e){var n="ordered"===e?"OL":"UL",o=r(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,n);return"checked"!==e&&"unchecked"!==e||o.setAttribute("data-checked","checked"===e),o}},{key:"formats",value:function(e){return"OL"===e.tagName?"ordered":"UL"===e.tagName?e.hasAttribute("data-checked")?"true"===e.getAttribute("data-checked")?"checked":"unchecked":"bullet":void 0}}]),o(t,[{key:"format",value:function(e,t){this.children.length>0&&this.children.tail.format(e,t)}},{key:"formats",value:function(){return e={},t=this.statics.blotName,n=this.statics.formats(this.domNode),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n}},{key:"insertBefore",value:function(e,n){if(e instanceof f)r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n);else{var o=null==n?this.length():n.offset(this),i=this.split(o);i.parent.insertBefore(e,i)}}},{key:"optimize",value:function(e){r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){if(e.statics.blotName!==this.statics.blotName){var n=i.default.create(this.statics.defaultChild);e.moveChildren(n),this.appendChild(n)}r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e)}}]),t}(s.default);h.blotName="list",h.scope=i.default.Scope.BLOCK_BLOT,h.tagName=["OL","UL"],h.defaultChild="list-item",h.allowedChildren=[f],t.ListItem=f,t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(56))&&o.__esModule?o:{default:o}).default);r.blotName="italic",r.tagName=["EM","I"],t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,null,[{key:"create",value:function(e){return"super"===e?document.createElement("sup"):"sub"===e?document.createElement("sub"):i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e)}},{key:"formats",value:function(e){return"SUB"===e.tagName?"sub":"SUP"===e.tagName?"super":void 0}}]),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);a.blotName="script",a.tagName=["SUB","SUP"],t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);r.blotName="strike",r.tagName="S",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((o=n(6))&&o.__esModule?o:{default:o}).default);r.blotName="underline",r.tagName="U",t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=(o=n(0))&&o.__esModule?o:{default:o},s=n(27),l=["alt","height","width"],c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"format",value:function(e,n){l.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return l.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"match",value:function(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}},{key:"sanitize",value:function(e){return(0,s.sanitize)(e,["http","https","data"])?e:"//:0"}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(a.default.Embed);c.blotName="image",c.tagName="IMG",t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},a=n(4),s=(o=n(27))&&o.__esModule?o:{default:o},l=["height","width"],c=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"format",value:function(e,n){l.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return l.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"sanitize",value:function(e){return s.default.sanitize(e)}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(a.BlockEmbed);c.blotName="video",c.className="ql-video",c.tagName="IFRAME",t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FormulaBlot=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=l(n(35)),a=l(n(5)),s=l(n(9));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(){return c(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),o(t,null,[{key:"create",value:function(e){var n=r(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}},{key:"value",value:function(e){return e.getAttribute("data-value")}}]),t}(i.default);f.blotName="formula",f.className="ql-formula",f.tagName="SPAN";var h=function(e){function t(){c(this,t);var e=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(null==window.katex)throw new Error("Formula module requires KaTeX.");return e}return d(t,e),o(t,null,[{key:"register",value:function(){a.default.register(f,!0)}}]),t}(s.default);t.FormulaBlot=f,t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CodeToken=t.CodeBlock=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},i=l(n(0)),a=l(n(5)),s=l(n(9));function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){function t(){return c(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return d(t,e),o(t,[{key:"replaceWith",value:function(e){this.domNode.textContent=this.domNode.textContent,this.attach(),r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replaceWith",this).call(this,e)}},{key:"highlight",value:function(e){var t=this.domNode.textContent;this.cachedText!==t&&((t.trim().length>0||null==this.cachedText)&&(this.domNode.innerHTML=e(t),this.domNode.normalize(),this.attach()),this.cachedText=t)}}]),t}(l(n(13)).default);f.className="ql-syntax";var h=new i.default.Attributor.Class("token","hljs",{scope:i.default.Scope.INLINE}),p=function(e){function t(e,n){c(this,t);var o=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if("function"!=typeof o.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var r=null;return o.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(r),r=setTimeout(function(){o.highlight(),r=null},o.options.interval)}),o.highlight(),o}return d(t,e),o(t,null,[{key:"register",value:function(){a.default.register(h,!0),a.default.register(f,!0)}}]),o(t,[{key:"highlight",value:function(){var e=this;if(!this.quill.selection.composing){this.quill.update(a.default.sources.USER);var t=this.quill.getSelection();this.quill.scroll.descendants(f).forEach(function(t){t.highlight(e.options.highlight)}),this.quill.update(a.default.sources.SILENT),null!=t&&this.quill.setSelection(t,a.default.sources.SILENT)}}}]),t}(s.default);p.DEFAULTS={highlight:null==window.hljs?null:function(e){return window.hljs.highlightAuto(e).value},interval:1e3},t.CodeBlock=f,t.CodeToken=h,t.default=p},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(e,t){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(e,t){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(e,t){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(e,t){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(e,t){e.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BubbleTooltip=void 0;var o=function e(t,n,o){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,o)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(o):void 0},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=d(n(3)),a=d(n(8)),s=n(43),l=d(s),c=n(15),u=d(n(41));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var g=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],y=function(e){function t(e,n){f(this,t),null!=n.modules.toolbar&&null==n.modules.toolbar.container&&(n.modules.toolbar.container=g);var o=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.quill.container.classList.add("ql-bubble"),o}return p(t,e),r(t,[{key:"extendToolbar",value:function(e){this.tooltip=new m(this.quill,this.options.bounds),this.tooltip.root.appendChild(e.container),this.buildButtons([].slice.call(e.container.querySelectorAll("button")),u.default),this.buildPickers([].slice.call(e.container.querySelectorAll("select")),u.default)}}]),t}(l.default);y.DEFAULTS=(0,i.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var m=function(e){function t(e,n){f(this,t);var o=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o.quill.on(a.default.events.EDITOR_CHANGE,function(e,t,n,r){if(e===a.default.events.SELECTION_CHANGE)if(null!=t&&t.length>0&&r===a.default.sources.USER){o.show(),o.root.style.left="0px",o.root.style.width="",o.root.style.width=o.root.offsetWidth+"px";var i=o.quill.getLines(t.index,t.length);if(1===i.length)o.position(o.quill.getBounds(t));else{var s=i[i.length-1],l=o.quill.getIndex(s),u=Math.min(s.length()-1,t.index+t.length-l),d=o.quill.getBounds(new c.Range(l,u));o.position(d)}}else document.activeElement!==o.textbox&&o.quill.hasFocus()&&o.hide()}),o}return p(t,e),r(t,[{key:"listen",value:function(){var e=this;o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){e.root.classList.remove("ql-editing")}),this.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!e.root.classList.contains("ql-hidden")){var t=e.quill.getSelection();null!=t&&e.position(e.quill.getBounds(t))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(e){var n=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"position",this).call(this,e),r=this.root.querySelector(".ql-tooltip-arrow");if(r.style.marginLeft="",0===n)return n;r.style.marginLeft=-1*n-r.offsetWidth/2+"px"}}]),t}(s.BaseTooltip);m.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),t.BubbleTooltip=m,t.default=y},function(e,t,n){e.exports=n(63)}]).default},e.exports=t()},95950:(e,t,n)=>{var o=n(70695),r=n(88984),i=n(64894);e.exports=function(e){return i(e)?o(e):r(e)}},98731:(e,t,n)=>{"use strict";n.d(t,{eb:()=>Xc,fB:()=>d,gI:()=>Gc,tL:()=>Wc});var o=n(74848),r=n(51609),i=n(86087),a=n(56427),s=n(27723),l=n(75795),c=n(45708);let u={prefix:"pt",theme:{mode:"light",primaryColor:"#f45925",secondaryColor:"oklch(0.97 0 0)",successColor:"#10b981",warningColor:"#f59e0b",errorColor:"#ef4444"},helpDocUrl:"https://docs.arraytics.com/",helpVideoUrl:"https://www.youtube.com/embed/9gV6MZeT164?si=tK8gw9fJzZxvtRWR",translationDomain:""};const d=e=>{const t=e.theme?{...u.theme,...e.theme}:u.theme;u={...u,...e,theme:t},"undefined"!=typeof window&&Promise.resolve().then(function(){return m}).then(({injectThemeVariables:e})=>{e()})},f=()=>{return{...u,prefix:(e=u.prefix,`${e}_ens_data`),theme:u.theme,helpDocUrl:u.helpDocUrl,helpVideoUrl:u.helpVideoUrl,translationDomain:u.translationDomain};var e},h={light:{bgPrimary:"#ffffff",bgSecondary:"#f9fafb",bgTertiary:"#f3f4f6",bgCanvas:"#f8fcfe",textPrimary:"#1f2937",textSecondary:"#6b7280",textTertiary:"#9ca3af",borderPrimary:"#e5e7eb",borderSecondary:"#d1d5db",borderLight:"#f0f0f0",hoverBg:"#f3f4f6",activeBg:"#e5e7eb",disabledBg:"#f9fafb",disabledText:"#9ca3af",shadowColor:"rgba(0, 0, 0, 0.1)"},dark:{bgPrimary:"oklch(0.2686 0 0)",bgSecondary:"oklch(0.205 0 0)",bgTertiary:"oklch(0.269 0 0)",bgCanvas:"oklch(0.145 0 0)",textPrimary:"oklch(0.985 0 0)",textSecondary:"oklch(0.708 0 0)",textTertiary:"oklch(0.439 0 0)",borderPrimary:"oklch(0.438 0.0106 264.46)",borderSecondary:"oklch(0.439 0 0)",borderLight:"oklch(0.3 0 0)",hoverBg:"oklch(0.269 0 0)",activeBg:"oklch(0.439 0 0)",disabledBg:"oklch(0.205 0 0)",disabledText:"oklch(0.439 0 0)",shadowColor:"rgba(0, 0, 0, 0.3)"}},p=()=>{const{theme:e}=f();let{mode:t="light"}=e;"system"===t&&(t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");const n=h[t];let o=document.getElementById("notif-flow-theme-variables");o||(o=document.createElement("style"),o.id="notif-flow-theme-variables",document.head.appendChild(o));const r=`\n\t\t:root {\n\t\t\t/* Brand Colors (from plugin) */\n\t\t\t--notif-flow-primary-color: ${e.primaryColor};\n\t\t\t--notif-flow-primary-hover: ${g(e.primaryColor,-10)};\n\t\t\t--notif-flow-primary-shadow: ${y(e.primaryColor,.3)};\n\t\t\t--notif-flow-primary-light: ${y(e.primaryColor,.1)};\n\t\t\t\n\t\t\t--notif-flow-secondary-color: ${e.secondaryColor};\n\t\t\t--notif-flow-secondary-hover: ${g(e.secondaryColor,-10)};\n\t\t\t\n\t\t\t--notif-flow-success-color: ${e.successColor};\n\t\t\t--notif-flow-success-hover: ${g(e.successColor,-10)};\n\t\t\t--notif-flow-success-shadow: ${y(e.successColor,.3)};\n\t\t\t\n\t\t\t--notif-flow-warning-color: ${e.warningColor};\n\t\t\t--notif-flow-warning-hover: ${g(e.warningColor,-10)};\n\t\t\t--notif-flow-warning-shadow: ${y(e.warningColor,.3)};\n\t\t\t\n\t\t\t--notif-flow-error-color: ${e.errorColor};\n\t\t\t--notif-flow-error-hover: ${g(e.errorColor,-10)};\n\t\t\t--notif-flow-error-shadow: ${y(e.errorColor,.3)};\n\n\t\t\t\n\t\t\t/* Semantic UI Colors (based on mode) */\n\t\t\t--notif-flow-bg-primary: ${n.bgPrimary};\n\t\t\t--notif-flow-bg-secondary: ${n.bgSecondary};\n\t\t\t--notif-flow-bg-tertiary: ${n.bgTertiary};\n\t\t\t--notif-flow-bg-canvas: ${n.bgCanvas};\n\t\t\t--notif-flow-text-primary: ${n.textPrimary};\n\t\t\t--notif-flow-text-secondary: ${n.textSecondary};\n\t\t\t--notif-flow-text-tertiary: ${n.textTertiary};\n\t\t\t--notif-flow-border-primary: ${n.borderPrimary};\n\t\t\t--notif-flow-border-secondary: ${n.borderSecondary};\n\t\t\t--notif-flow-border-light: ${n.borderLight};\n\t\t\t--notif-flow-hover-bg: ${n.hoverBg};\n\t\t\t--notif-flow-active-bg: ${n.activeBg};\n\t\t\t--notif-flow-disabled-bg: ${n.disabledBg};\n\t\t\t--notif-flow-disabled-text: ${n.disabledText};\n\t\t\t--notif-flow-shadow: ${n.shadowColor};\n\t\t\t--notif-flow-error-color: ${e.errorColor};\n\t\t}\n\t`;o.textContent=r};function g(e,t){if(!e||!e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return e;e=e.replace("#","");const n=parseInt(e.substr(0,2),16),o=parseInt(e.substr(2,2),16),r=parseInt(e.substr(4,2),16),i=Math.max(0,Math.min(255,n+n*t/100)),a=Math.max(0,Math.min(255,o+o*t/100)),s=Math.max(0,Math.min(255,r+r*t/100)),l=e=>{const t=Math.round(e).toString(16);return 1===t.length?"0"+t:t};return`#${l(i)}${l(a)}${l(s)}`}function y(e,t){return e&&e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)?(e=e.replace("#",""),`rgba(${parseInt(e.substr(0,2),16)}, ${parseInt(e.substr(2,2),16)}, ${parseInt(e.substr(4,2),16)}, ${t})`):e}var m=Object.freeze({__proto__:null,injectThemeVariables:p});const v=({type:e,variant:t="primary",size:n="medium",disabled:r=!1,isBusy:i=!1,icon:a,children:s,onClick:l,className:c="",style:u,danger:d=!1,htmlType:f="button"})=>{const h=`notif-flow-button notif-flow-button--${e||t} notif-flow-button--${n}${d?" notif-flow-button--danger":""}${i?" notif-flow-button--loading":""}`;return(0,o.jsxs)("button",{type:f,className:c?`${h} ${c}`:h,disabled:r||i,onClick:l,style:u,children:[i&&(0,o.jsx)("span",{className:"notif-flow-button__spinner",children:(0,o.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"notif-flow-spinner",children:(0,o.jsxs)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"31.416",children:[(0,o.jsx)("animate",{attributeName:"stroke-dasharray",dur:"2s",values:"0 31.416;15.708 15.708;0 31.416",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"stroke-dashoffset",dur:"2s",values:"0;-15.708;-31.416",repeatCount:"indefinite"})]})})}),a&&!i&&(0,o.jsx)("span",{className:"notif-flow-button__icon",children:a}),s&&(0,o.jsx)("span",{className:"notif-flow-button__text",children:s})]})},b=({active:e=!1,width:t,height:n=20,round:r=!1,className:i="",style:a})=>{const s=["wp-skeleton",e?"wp-skeleton-active":"",r?"wp-skeleton-round":"",i].filter(Boolean).join(" "),l={width:"number"==typeof t?`${t}px`:t,height:"number"==typeof n?`${n}px`:n,...a};return(0,o.jsx)("div",{className:s,style:l,"aria-hidden":"true"})},w=e=>(0,o.jsx)(b,{...e,className:`wp-skeleton-input ${e.className||""}`}),x=e=>(0,o.jsx)(b,{...e,className:`wp-skeleton-button ${e.className||""}`}),_=({size:e="medium",direction:t="horizontal",align:n="center",wrap:i=!1,children:a,className:s="",style:l})=>{const c="number"==typeof e?`${e}px`:"small"===e?"8px":"large"===e?"16px":"12px",u=["wp-space",`wp-space-${t}`,`wp-space-align-${n}`,i?"wp-space-wrap":"",s].filter(Boolean).join(" "),d={"--wp-space-size":c,...l};return(0,o.jsx)("div",{className:u,style:d,children:r.Children.map(a,(e,t)=>(0,o.jsxs)(r.Fragment,{children:[e,t<r.Children.count(a)-1&&(0,o.jsx)("div",{className:"wp-space-item"})]},t))})},k=({size:e="default",tip:t,spinning:n=!0,children:r,className:i="",style:a})=>{const s=["wp-spin",{small:"wp-spin-small",default:"wp-spin-default",large:"wp-spin-large"}[e],n?"":"wp-spin-hidden",i].filter(Boolean).join(" "),l=(0,o.jsxs)("div",{className:"wp-spin-container",children:[(0,o.jsx)("div",{className:"wp-spin-spinner",children:(0,o.jsx)("svg",{className:"wp-spin-svg",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("circle",{className:"wp-spin-circle",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"31.416"})})}),t&&(0,o.jsx)("div",{className:"wp-spin-tip",children:t})]});return r?(0,o.jsxs)("div",{className:`wp-spin-wrapper ${i}`,style:a,children:[r,n&&(0,o.jsx)("div",{className:"wp-spin-overlay",children:l})]}):(0,o.jsx)("div",{className:s,style:a,children:l})},E=(0,r.forwardRef)(({value:e,onChange:t,onPressEnter:n,onBlur:r,onFocus:i,placeholder:a,disabled:s=!1,size:l="middle",variant:c="outlined",className:u="",style:d,type:f="text",autoFocus:h=!1,allowClear:p=!1,onSearch:g,defaultValue:y,min:m,max:v,step:b},w)=>{var x;const _=`notif-flow-input notif-flow-input--${l} notif-flow-input--${c}`,k=u?`${_} ${u}`:_;return"search"===f||g?(0,o.jsxs)("div",{className:"notif-flow-input-search-wrapper",children:[(0,o.jsx)("input",{ref:w,type:"search",value:null!==(x=null!=e?e:y)&&void 0!==x?x:"",onChange:e=>{const n=e.target.value;null==t||t(n),null==g||g(n)},onKeyDown:e=>{"Enter"===e.key&&n&&n(e),"Enter"===e.key&&g&&g(e.currentTarget.value)},onBlur:r,onFocus:i,placeholder:a,disabled:s,autoFocus:h,className:k,style:d}),p&&e&&(0,o.jsx)("button",{type:"button",className:"notif-flow-input-clear",onClick:()=>{null==t||t(""),g&&g("")},children:(0,o.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,o.jsx)("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}):(0,o.jsx)("input",{ref:w,type:f,value:null!=e?e:"",defaultValue:y,onChange:e=>{if("number"===f){const n=e.target.value,o=""===n?"":Number(n);if("number"==typeof o){if(void 0!==m&&o<m)return;if(void 0!==v&&o>v)return}null==t||t(o)}else null==t||t(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&n&&n(e)},onBlur:r,onFocus:i,placeholder:a,disabled:s,autoFocus:h,className:k,style:d,min:m,max:v,step:b})});E.displayName="Input";const C=(0,i.forwardRef)(({value:e,onChange:t,onBlur:n,onFocus:o,placeholder:r,disabled:s=!1,size:l="middle",className:c="",style:u,autoFocus:d=!1,format:f="YYYY-MM-DD",showTime:h=!1},p)=>(0,i.createElement)(a.DateTimePicker,{value:e,onChange:t,placeholder:r,disabled:s,className:c,style:u,autoFocus:d,format:f,showTime:h,onBlur:n,onFocus:o,__nextHasNoMarginBottom:!0}));C.displayName="DatePicker";const N=({children:e,className:t="",style:n,strong:r=!1,italic:i=!1,underline:a=!1,delete:s=!1,mark:l=!1,code:c=!1,keyboard:u=!1})=>{const d=["wp-typography",r?"wp-typography-strong":"",i?"wp-typography-italic":"",a?"wp-typography-underline":"",s?"wp-typography-delete":"",l?"wp-typography-mark":"",c?"wp-typography-code":"",u?"wp-typography-keyboard":"",t].filter(Boolean).join(" ");return(0,o.jsx)("span",{className:d,style:n,children:e})},S=e=>(0,o.jsx)(N,{...e}),O=({value:e,defaultValue:t,onChange:n,options:r=[],placeholder:i,disabled:a=!1,className:s="",style:l,allowClear:c=!1,searchable:u=!1,multiple:d=!1,size:f="middle",children:h,name:p})=>{const g=e||t,y=`notif-flow-select notif-flow-select--${f}`,m=s?`${y} ${s}`:y;return(0,o.jsxs)("select",{name:p,value:(null==g?void 0:g.toString())||"",onChange:e=>{const t=e.target.value;if(n){const e=r.find(e=>e.value.toString()===t);n((null==e?void 0:e.value)||t)}},disabled:a,className:m,style:l,children:[i&&(0,o.jsx)("option",{value:"",disabled:!0,children:i}),r.map(e=>(0,o.jsx)("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))]})},j=e=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",width:"1em",height:"1em",...e,children:(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M328 112L184 256l144 144"})}),A=({className:e="",style:t})=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em",className:e,style:t,children:(0,o.jsx)("path",{fill:"currentColor",d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448s448-200.6 448-448S759.4 64 512 64m0 708c-22.1 0-40-17.9-40-40s17.9-40 40-40s40 17.9 40 40s-17.9 40-40 40m62.9-219.5a48.3 48.3 0 0 0-30.9 44.8V620c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-21.5c0-23.1 6.7-45.9 19.9-64.9c12.9-18.6 30.9-32.8 52.1-40.9c34-13.1 56-41.6 56-72.7c0-44.1-43.1-80-96-80s-96 35.9-96 80v7.6c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V420c0-39.3 17.2-76 48.4-103.3C430.4 290.4 470 276 512 276s81.6 14.5 111.6 40.7C654.8 344 672 380.7 672 420c0 57.8-38.1 109.8-97.1 132.5"})}),P=({className:e="",style:t})=>(0,o.jsxs)("svg",{className:`wp-icon wp-icon-question-circle ${e}`,style:t,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),(0,o.jsx)("path",{d:"M9.09 9C9.3251 8.33167 9.78915 7.76811 10.4 7.40913C11.0108 7.05016 11.7289 6.91894 12.4272 7.03871C13.1255 7.15849 13.7588 7.52152 14.2151 8.06353C14.6713 8.60553 14.9211 9.29152 14.92 10C14.92 12 11.92 13 11.92 13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M12 17H12.01",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),T=e=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,o.jsx)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 16H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2m-6 12h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2"})}),M=e=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,o.jsxs)("g",{fill:"none",children:[(0,o.jsx)("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),(0,o.jsx)("path",{fill:"currentColor",d:"M14.28 2a2 2 0 0 1 1.897 1.368L16.72 5H20a1 1 0 1 1 0 2l-.003.071l-.867 12.143A3 3 0 0 1 16.138 22H7.862a3 3 0 0 1-2.992-2.786L4.003 7.07L4 7a1 1 0 0 1 0-2h3.28l.543-1.632A2 2 0 0 1 9.721 2zm3.717 5H6.003l.862 12.071a1 1 0 0 0 .997.929h8.276a1 1 0 0 0 .997-.929zM10 10a1 1 0 0 1 .993.883L11 11v5a1 1 0 0 1-1.993.117L9 16v-5a1 1 0 0 1 1-1m4 0a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1m.28-6H9.72l-.333 1h5.226z"})]})});function L(e){return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-square-pen-icon lucide-square-pen",children:[(0,o.jsx)("path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,o.jsx)("path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"})]})}const D=({className:e="",style:t})=>(0,i.createElement)("svg",{className:`wp-icon wp-icon-exclamation-circle-filled ${e}`,style:t,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[(0,i.createElement)("circle",{key:"circle1",cx:"12",cy:"12",r:"10"}),(0,i.createElement)("path",{key:"path1",d:"M12 8v4",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.createElement)("path",{key:"path2",d:"M12 16h.01",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]);function I(e){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,o.jsx)("path",{fill:"currentColor",d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2"})})}const q=({className:e="",style:t})=>(0,i.createElement)("svg",{className:`wp-icon wp-icon-plus ${e}`,style:t,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[(0,i.createElement)("line",{key:"line1",x1:"12",y1:"5",x2:"12",y2:"19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.createElement)("line",{key:"line2",x1:"5",y1:"12",x2:"19",y2:"12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]),R=({className:e="",style:t})=>(0,i.createElement)("svg",{className:`wp-icon wp-icon-check-circle-filled ${e}`,style:t,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[(0,i.createElement)("path",{key:"path1",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})]),B=e=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,o.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.464 3.464C2 4.93 2 7.286 2 12s0 7.071 1.464 8.535C4.93 22 7.286 22 12 22s7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536C19.072 2 16.714 2 12 2S4.929 2 3.464 3.464M12 5.75a.75.75 0 0 1 .75.75v6A3.25 3.25 0 0 0 16 15.75h.19l-.22-.22a.75.75 0 1 1 1.06-1.06l1.5 1.5a.75.75 0 0 1 0 1.06l-1.5 1.5a.75.75 0 1 1-1.06-1.06l.22-.22H16a4.75 4.75 0 0 1-4-2.187a4.75 4.75 0 0 1-4 2.187h-.19l.22.22a.75.75 0 1 1-1.06 1.06l-1.5-1.5a.75.75 0 0 1 0-1.06l1.5-1.5a.75.75 0 0 1 1.06 1.06l-.22.22H8a3.25 3.25 0 0 0 3.25-3.25v-6a.75.75 0 0 1 .75-.75",clipRule:"evenodd"})}),$=({className:e="",style:t})=>(0,i.createElement)("svg",{className:`wp-icon wp-icon-bell ${e}`,style:t,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[(0,i.createElement)("path",{key:"path1",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z",fill:"currentColor"})]),z=({className:e="",style:t})=>(0,i.createElement)("svg",{className:`wp-icon wp-icon-close ${e}`,style:t,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[(0,i.createElement)("line",{key:"line1",x1:"18",y1:"6",x2:"6",y2:"18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.createElement)("line",{key:"line2",x1:"6",y1:"6",x2:"18",y2:"18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]);function F(e){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,o.jsx)("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m1-10V7h-2v7h6v-2z"})})}const H=e=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,o.jsx)("path",{fill:"currentColor",d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-.4 4.25l-7.07 4.42c-.32.2-.74.2-1.06 0L4.4 8.25a.85.85 0 1 1 .9-1.44L12 11l6.7-4.19a.85.85 0 1 1 .9 1.44"})}),V=({className:e="",style:t})=>(0,i.createElement)("svg",{className:`wp-icon wp-icon-flag ${e}`,style:t,width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[(0,i.createElement)("path",{key:"path1",d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.createElement)("line",{key:"line1",x1:"4",y1:"22",x2:"4",y2:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]),U=e=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,o.jsx)("path",{fill:"currentColor",d:"M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2v2a8 8 0 1 1-5.135 1.865L9 8V2H3l2.446 2.447A9.98 9.98 0 0 0 2 12"})}),Z=(0,r.memo)(({columns:e,hasSelection:t,allSelected:n,onSelectAll:r})=>(0,o.jsx)("thead",{className:"notif-flow-table-head",children:(0,o.jsxs)("tr",{className:"notif-flow-table-row notif-flow-table-header-row",children:[t&&(0,o.jsx)("th",{className:"notif-flow-table-cell notif-flow-table-selection-cell",children:(0,o.jsx)("input",{type:"checkbox",checked:n,onChange:e=>r(e.target.checked)})}),e.map((e,t)=>(0,o.jsx)("th",{className:"notif-flow-table-cell notif-flow-table-header-cell "+(e.align?`notif-flow-table-align-${e.align}`:""),style:e.width?{width:e.width}:void 0,children:e.title},e.key||t))]})}));Z.displayName="TableHeader";const K=(0,r.memo)(({record:e,columns:t,rowKey:n,index:r,hasSelection:i,isSelected:a,onSelect:s,onRow:l,selectionType:c})=>{const u=(null==l?void 0:l(e,r))||{};return(0,o.jsxs)("tr",{className:"notif-flow-table-row notif-flow-table-data-row",onClick:u.onClick,onDoubleClick:u.onDoubleClick,children:[i&&(0,o.jsx)("td",{className:"notif-flow-table-cell notif-flow-table-selection-cell",children:(0,o.jsx)("input",{type:c||"checkbox",checked:a,onChange:t=>s(e,t.target.checked)})}),t.map((t,n)=>{const i=e[t.dataIndex],a=t.render?t.render(i,e,r):i;return(0,o.jsx)("td",{className:"notif-flow-table-cell notif-flow-table-data-cell "+(t.align?`notif-flow-table-align-${t.align}`:""),children:a},`cell-${t.key||n}`)})]})});K.displayName="TableRow";const W=({dataSource:e=[],columns:t=[],rowKey:n="id",loading:i=!1,pagination:a=!1,rowSelection:l,className:c="",style:u,onRow:d,onClearFilters:f})=>{const[h,p]=(0,r.useState)((null==l?void 0:l.selectedRowKeys)||[]),g=(0,r.useCallback)((t,o)=>{const r=t[n];let i;if(i=o?[...h,r]:h.filter(e=>e!==r),p(i),null==l?void 0:l.onChange){const t=e.filter(e=>i.includes(e[n]));l.onChange(i,t)}},[e,n,l,h]),y=(0,r.useCallback)(t=>{const o=t?e.map(e=>e[n]):[];if(p(o),null==l?void 0:l.onChange){const n=t?e:[];l.onChange(o,n)}},[e,n,l]);return(0,o.jsxs)("div",{className:`notif-flow-table-container ${c}`,style:u,children:[i&&(0,o.jsx)("div",{className:"notif-flow-table-loading-overlay",children:(0,o.jsx)("div",{className:"notif-flow-table-loading-spinner",children:(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,o.jsxs)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"31.416",strokeDashoffset:"31.416",children:[(0,o.jsx)("animate",{attributeName:"stroke-dasharray",dur:"2s",values:"0 31.416;15.708 15.708;0 31.416",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"stroke-dashoffset",dur:"2s",values:"0;-15.708;-31.416",repeatCount:"indefinite"})]})})})}),(0,o.jsxs)("table",{className:"notif-flow-table "+(i?"notif-flow-table-loading":""),children:[(0,o.jsx)(Z,{columns:t,hasSelection:!!l,allSelected:h.length===e.length&&e.length>0,onSelectAll:y}),(0,o.jsx)("tbody",{className:"notif-flow-table-body",children:0===e.length?(0,o.jsx)("tr",{children:(0,o.jsx)("td",{colSpan:t.length+(l?1:0),className:"notif-flow-table-empty-cell",children:(0,o.jsxs)("div",{className:"notif-flow-table-empty",children:[(0,o.jsx)("div",{className:"notif-flow-table-empty-icon",children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",width:"1em",height:"1em",children:(0,o.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M1 11.27q0-.371.099-.73l1.523-5.521A2.75 2.75 0 0 1 5.273 3h9.454a2.75 2.75 0 0 1 2.651 2.019l1.523 5.52q.099.36.099.732V15a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm3.068-5.852A1.25 1.25 0 0 1 5.273 4.5h9.454a1.25 1.25 0 0 1 1.205.918l1.523 5.52l.015.062H14a1 1 0 0 0-.86.49l-.606 1.02a1 1 0 0 1-.86.49H8.236a1 1 0 0 1-.894-.553l-.448-.894A1 1 0 0 0 6 11H2.53l.015-.062z",clipRule:"evenodd"})})}),(0,o.jsx)("div",{className:"notif-flow-table-empty-text",children:(0,s.__)(i?"Loading...":"No data found","wpcafe")}),(0,o.jsx)("div",{className:"notif-flow-table-empty-action",children:i?null:(0,o.jsx)(v,{className:"notif-flow-button",onClick:f,icon:i?null:(0,o.jsx)(U,{}),type:"secondary",children:(0,s.__)("Clear Search","wpcafe")})})]})})}):e.map((e,r)=>(0,o.jsx)(K,{record:e,columns:t,rowKey:n,index:r,hasSelection:!!l,isSelected:h.includes(e[n]),onSelect:g,onRow:d,selectionType:null==l?void 0:l.type},e[n]||r))})]})]})};W.displayName="Table";const Y=({open:e,onClose:t,title:n,children:i,footer:a,width:s=520,centered:c=!1,className:u="",style:d,destroyOnClose:f=!1,closable:h=!0,maskClosable:p=!0})=>{const g=(0,r.useRef)(null),y=(0,r.useRef)(null);if((0,r.useEffect)(()=>{e?(y.current=document.activeElement,setTimeout(()=>{if(g.current){const e=g.current.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e&&e.focus()}},100)):y.current&&y.current.focus()},[e]),(0,r.useEffect)(()=>{const n=n=>{"Escape"===n.key&&e&&h&&t()};return e&&(document.addEventListener("keydown",n),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",n),document.body.style.overflow="unset"}},[e,h,t]),!e&&f)return null;const m=(0,o.jsx)("div",{className:`notif-flow-custom-modal-overlay ${e?"notif-flow-custom-modal-open":""} ${c?"notif-flow-custom-modal-centered":"notif-flow-custom-modal-top"}`,onClick:e=>{e.target===e.currentTarget&&p&&t()},children:(0,o.jsxs)("div",{ref:g,className:`notif-flow-custom-modal ${"number"==typeof s&&s>=600?"notif-flow-custom-modal--form-modal":""} ${u}`,onClick:e=>{e.stopPropagation()},style:{width:"number"==typeof s?`${s}px`:s,...d},children:[(n||h)&&(0,o.jsxs)("div",{className:"notif-flow-custom-modal-header",children:[n&&(0,o.jsx)("h3",{className:"notif-flow-custom-modal-title",children:n}),h&&(0,o.jsx)("button",{className:"notif-flow-custom-modal-close",onClick:t,children:(0,o.jsx)(z,{})})]}),(0,o.jsx)("div",{className:"notif-flow-custom-modal-body",children:i}),a&&(0,o.jsx)("div",{className:"notif-flow-custom-modal-footer",children:a})]})});return(0,l.createPortal)(m,document.body)},X=({checked:e=!1,onChange:t,disabled:n=!1,loading:i=!1,size:a="default",className:s="",style:l,children:c,label:u})=>{const[d,f]=(0,r.useState)(e),h=(0,r.useRef)(null);r.useEffect(()=>{f(e)},[e]);const p=()=>{if(n||i)return;const e=!d;f(e),t&&t(e)};return(0,o.jsxs)("div",{className:`notif-flow-switch-wrapper ${s}`,style:l,children:[u&&(0,o.jsx)("label",{className:"notif-flow-switch-label",children:u}),(0,o.jsx)("div",{ref:h,className:`notif-flow-switch ${(()=>{switch(a){case"small":return"notif-flow-switch-small";case"large":return"notif-flow-switch-large";default:return"notif-flow-switch-default"}})()} ${(()=>{const e=[];return d&&e.push("notif-flow-switch-checked"),n&&e.push("notif-flow-switch-disabled"),i&&e.push("notif-flow-switch-loading"),e.join(" ")})()}`,onClick:p,onKeyDown:e=>{" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),p())},tabIndex:n||i?-1:0,role:"switch","aria-checked":d,"aria-disabled":n||i,"aria-label":u||(null==c?void 0:c.toString()),children:(0,o.jsx)("div",{className:"notif-flow-switch-track",children:(0,o.jsx)("div",{className:"notif-flow-switch-thumb",children:i&&(0,o.jsx)("div",{className:"notif-flow-switch-loading-spinner"})})})}),c&&!u&&(0,o.jsx)("span",{className:"notif-flow-switch-children",children:c})]})},G=({trigger:e=["click"],menu:t={items:[]},children:n,placement:i="bottomLeft",disabled:a=!1,className:s="",style:c})=>{const[u,d]=(0,r.useState)(!1),[f,h]=(0,r.useState)({top:0,left:0}),p=(0,r.useRef)(null),g=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e;if(u&&p.current){const n=p.current.getBoundingClientRect(),o=160,r=40*((null===(e=t.items)||void 0===e?void 0:e.length)||0);let a=0,s=0;switch(i){case"bottomRight":a=n.bottom+4,s=n.right-o;break;case"bottomCenter":a=n.bottom+4,s=n.left+n.width/2-o/2;break;case"topLeft":a=n.top-r-4,s=n.left;break;case"topRight":a=n.top-r-4,s=n.right-o;break;case"topCenter":a=n.top-r-4,s=n.left+n.width/2-o/2;break;default:a=n.bottom+4,s=n.left}const l=window.innerWidth;s+o>l&&(s=l-o-8),s<8&&(s=8),a+r>window.innerHeight&&(a=n.top-r-4),a<8&&(a=n.bottom+4),h({top:a,left:s})}},[u,i,t.items]),(0,r.useEffect)(()=>{const e=e=>{p.current&&!p.current.contains(e.target)&&g.current&&!g.current.contains(e.target)&&d(!1)};return u&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]),(0,r.useEffect)(()=>{const e=()=>{u&&d(!1)};return u&&(window.addEventListener("scroll",e,!0),window.addEventListener("resize",e)),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[u]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:`notif-flow-dropdown ${s}`,style:c,children:(0,o.jsx)("div",{ref:p,className:"notif-flow-dropdown-trigger "+(a?"notif-flow-dropdown-disabled":""),onClick:()=>{a||e.includes("click")&&d(!u)},onMouseEnter:()=>{e.includes("hover")&&!a&&d(!0)},onMouseLeave:()=>{e.includes("hover")&&!a&&d(!1)},children:n})}),(()=>{if(!u||!t.items||0===t.items.length)return null;const e=(0,o.jsx)("div",{ref:g,className:"notif-flow-dropdown-menu notif-flow-dropdown-portal",style:{position:"fixed",top:`${f.top}px`,left:`${f.left}px`,zIndex:9999},children:t.items.map(e=>(0,o.jsxs)("div",{className:`notif-flow-dropdown-item ${e.disabled?"notif-flow-dropdown-item-disabled":""} ${e.danger?"notif-flow-dropdown-item-danger":""}`,onClick:()=>{var t;(t=e).disabled||(t.onClick&&t.onClick(),d(!1))},children:[e.icon&&(0,o.jsx)("span",{className:"notif-flow-dropdown-item-icon",children:e.icon}),(0,o.jsx)("span",{className:"notif-flow-dropdown-item-label",children:e.label})]},e.key))});return(0,l.createPortal)(e,document.body)})()]})},Q=(0,r.createContext)(void 0),J=(0,r.forwardRef)(({form:e,layout:t="vertical",children:n,className:i="",style:a,onFinish:s,onFinishFailed:l,initialValues:c={}},u)=>{const[d,f]=(0,r.useState)(c),[h,p]=(0,r.useState)({}),g=(0,r.useRef)(null),y=(e,t)=>{f(n=>({...n,[e]:t})),p(t=>({...t,[e]:void 0}))},m=(e,t,n)=>{for(const o of t){if(o.required&&(null==n||""===n))return o.message||`${e} is required`;if("email"===o.type&&n&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n))return o.message||"Please enter a valid email address";if(o.min&&n&&n.length<o.min)return o.message||`${e} must be at least ${o.min} characters`;if(o.max&&n&&n.length>o.max)return o.message||`${e} must be at most ${o.max} characters`;if(o.pattern&&n&&!o.pattern.test(n))return o.message||`${e} format is invalid`}},v=async()=>{let e=!1;const t={},o=r.Children.toArray(n).filter(e=>{var t;return e.type===ee||"FormItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)});for(const n of o){const o=n.props;if(o.name&&o.rules){const n=d[o.name],r=m(o.name,o.rules,n);r&&(t[o.name]=r,e=!0)}}if(p(t),e){const e={values:d,errorFields:Object.keys(t).map(e=>({name:[e],errors:[t[e]]}))};throw null==l||l(e),e}return d},b={validateFields:v,resetFields:()=>{f(c),p({})},setFieldsValue:e=>{f(t=>({...t,...e}))},getFieldsValue:()=>d,getFieldValue:e=>d[e],setFieldValue:y};return(0,r.useImperativeHandle)(u,()=>b),e&&Object.assign(e,b),(0,o.jsx)(Q.Provider,{value:{values:d,errors:h,setFieldValue:y,setFieldError:(e,t)=>{p(n=>({...n,[e]:t}))},validateField:m,formRef:g},children:(0,o.jsx)("form",{className:`notif-flow-form notif-flow-form-${t} ${i}`,style:a,onSubmit:async e=>{e.preventDefault();try{const e=await v();null==s||s(e)}catch(e){}},children:n})})});J.displayName="Form";const ee=({label:e,name:t,rules:n=[],children:i,className:a="",style:s})=>{const l=(0,r.useContext)(Q);if(!l)return console.error("Form.Item must be used within a Form component."),null;const{values:c,errors:u,setFieldValue:d,validateField:f}=l,h=t?c[t]:void 0,p=t?u[t]:void 0,g=r.Children.only(i),y={};return t&&(y.value=h,y.onChange=e=>{if(t){d(t,e);const o=f(t,n,e);l.setFieldError(t,o)}}),(0,o.jsxs)("div",{className:`notif-flow-form-item ${a} ${p?"notif-flow-form-item-has-error":""}`,style:s,children:[e&&(0,o.jsx)("label",{className:"notif-flow-form-item-label",htmlFor:t,children:e}),(0,o.jsx)("div",{className:"notif-flow-form-item-control",children:r.cloneElement(g,y)}),p&&(0,o.jsx)("div",{className:"notif-flow-form-item-error",children:p})]})};ee.displayName="FormItem";const te=J;te.useForm=()=>{const[e]=(0,r.useState)({validateFields:async()=>({}),resetFields:()=>{},setFieldsValue:e=>{},getFieldsValue:()=>({}),getFieldValue:e=>{},setFieldValue:(e,t)=>{}});return[e]},te.Item=ee;const ne=(e,t)=>{const n=new CustomEvent("wp-toast",{detail:{type:"success",message:e,duration:t}});window.dispatchEvent(n)},oe=(e,t)=>{const n=new CustomEvent("wp-toast",{detail:{type:"error",message:e,duration:t}});window.dispatchEvent(n)},re=({children:e})=>{const[t,n]=(0,r.useState)([]);return(0,r.useEffect)(()=>{const e=e=>{const{type:t,message:o,duration:r}=e.detail,i={id:Math.random().toString(36).substr(2,9),type:t,message:o,duration:r||4e3};n(e=>[...e,i])};return window.addEventListener("wp-toast",e),()=>{window.removeEventListener("wp-toast",e)}},[]),(0,r.useEffect)(()=>{var e;const o=setInterval(()=>{if(t.length>0){const e=t[0];e.duration&&e.duration>0&&n(e=>e.slice(1))}},(null===(e=t[0])||void 0===e?void 0:e.duration)||4e3);return()=>clearInterval(o)},[t]),(0,o.jsxs)(o.Fragment,{children:[e,(0,o.jsx)(ie,{toasts:t,onRemove:e=>{n(t=>t.filter(t=>t.id!==e))}})]})},ie=({toasts:e,onRemove:t})=>0===e.length?null:(0,o.jsx)("div",{className:"notif-flow-toast-container",style:{position:"fixed",bottom:"20px",right:"20px",zIndex:999999,display:"flex",flexDirection:"column",gap:"12px",maxWidth:"400px"},children:e.map(e=>(0,o.jsx)(ae,{toast:e,onRemove:t},e.id))}),ae=({toast:e,onRemove:t})=>{const[n,i]=(0,r.useState)(!1),[a,s]=(0,r.useState)(!1);(0,r.useEffect)(()=>{const e=setTimeout(()=>i(!0),10);return()=>clearTimeout(e)},[]);const l=()=>{a||(s(!0),i(!1),setTimeout(()=>{t(e.id)},300))};return(0,o.jsxs)("div",{className:`notif-flow-toast notif-flow-toast-${e.type}`,style:(()=>{const t={display:"flex",alignItems:"center",gap:"12px",padding:"12px 16px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",fontSize:"14px",fontWeight:"500",minWidth:"300px",maxWidth:"400px",cursor:"pointer",transition:"all 0.3s ease",transform:n&&!a?"translateX(0)":"translateX(100%)",opacity:n&&!a?1:0,marginBottom:"8px"};switch(e.type){case"success":return{...t,backgroundColor:"#ecfdf5",border:"1px solid #d1fae5",color:"#065f46"};case"error":return{...t,backgroundColor:"#fef2f2",border:"1px solid #fecaca",color:"#991b1b"};case"warning":return{...t,backgroundColor:"#fffbeb",border:"1px solid #fed7aa",color:"#92400e"};default:return{...t,backgroundColor:"#eff6ff",border:"1px solid #dbeafe",color:"#1e40af"}}})(),onClick:l,children:[(()=>{const t={fontSize:"16px"};switch(e.type){case"success":return(0,o.jsx)(R,{style:{...t,color:"#10b981"}});case"error":return(0,o.jsx)(A,{style:{...t,color:"#ef4444"}});case"warning":return(0,o.jsx)(D,{style:{...t,color:"#f59e0b"}});default:return(0,o.jsx)(A,{style:{...t,color:"#3b82f6"}})}})(),(0,o.jsx)("span",{style:{flex:1},children:e.message}),(0,o.jsx)("button",{style:{background:"none",border:"none",color:"inherit",cursor:"pointer",padding:"4px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",lineHeight:1},onClick:e=>{e.stopPropagation(),l()},"aria-label":"Close toast",children:"×"})]})},se=({open:e=!1,onClose:t,title:n,children:r,placement:i="right",width:a=400,height:s="100%",className:l="",style:c,destroyOnClose:u=!1,footer:d,zIndex:f})=>{if(!e&&u)return null;const h={width:"left"===i||"right"===i?a:"100%",height:"top"===i||"bottom"===i?s:"100%",...f&&{zIndex:f},...c},p={opacity:e?1:0,visibility:e?"visible":"hidden",...f&&{zIndex:f-1}};return(0,o.jsxs)("div",{className:`notif-flow-drawer-wrapper ${l}`,children:[(0,o.jsx)("div",{className:"notif-flow-drawer-mask",style:p,onClick:t}),(0,o.jsxs)("div",{className:`notif-flow-drawer notif-flow-drawer-${i} ${e?"open":""}`,style:h,children:[n&&(0,o.jsxs)("div",{className:"notif-flow-drawer-header",children:[(0,o.jsx)("div",{className:"notif-flow-drawer-title",children:n}),(0,o.jsx)("button",{className:"notif-flow-drawer-close",onClick:t,children:"×"})]}),(0,o.jsx)("div",{className:"notif-flow-drawer-body",children:r}),d&&(0,o.jsx)("div",{className:"notif-flow-drawer-footer",children:d})]})]})},le=({count:e,children:t,className:n="",style:r,color:i,dot:a=!1,offset:s,showZero:l=!1,status:c="default",text:u,size:d="default"})=>{const f=void 0!==e&&e>0||l||a||u||c;if(!t)return(0,o.jsx)("span",{className:`notif-flow-badge notif-flow-badge-status notif-flow-badge-${c} notif-flow-badge-${d} ${n}`,style:{backgroundColor:i,...r},children:u||(void 0!==e?e:"")});const h=s?{top:`${s[1]}px`,right:`${s[0]}px`}:{};return(0,o.jsxs)("span",{className:`notif-flow-badge-wrapper ${n}`,style:r,children:[t,f&&(0,o.jsx)("span",{className:`notif-flow-badge notif-flow-badge-count ${a?"notif-flow-badge-dot":""} notif-flow-badge-${c} notif-flow-badge-${d}`,style:{backgroundColor:i,...h},children:!a&&(u||e)})]})},ce=({onCreateClick:e,onHelpClick:t,videoUrl:n="https://www.youtube.com/embed/dQw4w9WgXcQ",videoTooltip:i=(0,s.__)("Play video","wpcafe")})=>{const[a,l]=(0,r.useState)(""),{theme:{mode:c}}=f(),u=()=>{const e=`${n}${n.includes("?")?"&":"?"}autoplay=1`;l(e)};return(0,o.jsx)("div",{className:"notif-flow-empty-list-screen",children:(0,o.jsxs)("div",{className:"notif-flow-empty-list-screen__card",children:[(0,o.jsx)("div",{className:"notif-flow-empty-list-screen__video-section",children:(0,o.jsx)("div",{className:"notif-flow-empty-list-screen__video",children:a?(0,o.jsx)("div",{className:"notif-flow-empty-list-screen__video-iframe",children:(0,o.jsx)("iframe",{className:"notif-flow-empty-list-screen__iframe",src:a,title:(0,s.__)("YouTube video player","wpcafe"),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}):(0,o.jsxs)("div",{className:"notif-flow-empty-list-screen__video-thumbnail",onClick:u,children:[(0,o.jsx)("div",{className:"notif-flow-empty-list-screen__video-bg",children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 400 300",width:"100%",height:"100%",children:[(0,o.jsx)("rect",{width:"400",height:"300",fill:"dark"===c?"#1a1a1a":"#f8f9fa"}),(0,o.jsx)("ellipse",{cx:"200",cy:"180",rx:"120",ry:"40",fill:"#e5e7eb"}),(0,o.jsx)("ellipse",{cx:"200",cy:"170",rx:"120",ry:"40",fill:"#f3f4f6"}),(0,o.jsx)("ellipse",{cx:"180",cy:"160",rx:"60",ry:"25",fill:"#fef3c7"}),(0,o.jsx)("ellipse",{cx:"220",cy:"160",rx:"60",ry:"25",fill:"#fef3c7"}),(0,o.jsx)("rect",{x:"150",y:"140",width:"8",height:"30",fill:"#f97316",rx:"4"}),(0,o.jsx)("rect",{x:"170",y:"135",width:"8",height:"35",fill:"#f97316",rx:"4"}),(0,o.jsx)("rect",{x:"190",y:"145",width:"8",height:"25",fill:"#f97316",rx:"4"}),(0,o.jsx)("rect",{x:"210",y:"140",width:"8",height:"30",fill:"#f97316",rx:"4"}),(0,o.jsx)("rect",{x:"230",y:"135",width:"8",height:"35",fill:"#f97316",rx:"4"}),(0,o.jsx)("rect",{x:"250",y:"145",width:"8",height:"25",fill:"#f97316",rx:"4"}),(0,o.jsx)("circle",{cx:"160",cy:"130",r:"3",fill:"#10b981"}),(0,o.jsx)("circle",{cx:"180",cy:"125",r:"3",fill:"#10b981"}),(0,o.jsx)("circle",{cx:"200",cy:"130",r:"3",fill:"#10b981"}),(0,o.jsx)("circle",{cx:"220",cy:"125",r:"3",fill:"#10b981"}),(0,o.jsx)("circle",{cx:"240",cy:"130",r:"3",fill:"#10b981"})]})}),(0,o.jsx)("div",{className:"notif-flow-empty-list-screen__play-button",children:(0,o.jsx)("button",{className:"notif-flow-empty-list-screen__play-btn",onClick:u,title:i,children:(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:(0,o.jsx)("path",{d:"M8 5v14l11-7z"})})})})]})})}),(0,o.jsxs)("div",{className:"notif-flow-empty-list-screen__content-section",children:[(0,o.jsx)("h3",{className:"notif-flow-empty-list-screen__heading",children:(0,s.__)("No automations found","wpcafe")}),(0,o.jsx)("p",{className:"notif-flow-empty-list-screen__description",children:(0,s.__)("You haven't created any automations yet. Click on the button below to create your first automation.","wpcafe")}),(0,o.jsxs)("div",{className:"notif-flow-empty-list-screen__actions",children:[(0,o.jsxs)(v,{type:"secondary",onClick:t,className:"notif-flow-empty-list-screen__help-button",children:["Read Documentation",(0,o.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:(0,o.jsx)("path",{d:"M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"})})]}),(0,o.jsx)(v,{type:"primary",icon:(0,o.jsx)(q,{}),onClick:e,className:"notif-flow-empty-list-screen__create-button",children:"Create Automation"})]})]})]})})},ue=({isOpen:e,onClose:t,onConfirm:n,title:r="Delete Confirmation",content:i="Are you sure you want to delete this item?"})=>(0,o.jsx)(Y,{open:e,onClose:t,width:420,centered:!0,closable:!0,title:r,footer:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v,{variant:"secondary",onClick:t,children:"Cancel"}),(0,o.jsx)(v,{onClick:()=>{n(),t()},danger:!0,children:"Delete"})]}),children:(0,o.jsx)("p",{children:i})}),de=({open:e,onClose:t,onConfirm:n,currentTrigger:r,newTrigger:i})=>(0,o.jsx)(Y,{open:e,onClose:t,title:"Change Trigger",width:500,centered:!0,closable:!0,maskClosable:!0,footer:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v,{variant:"secondary",onClick:()=>{t()},children:"Cancel"}),(0,o.jsx)(v,{type:"primary",onClick:()=>{n()},children:"Confirm Change"})]}),children:(0,o.jsxs)("div",{className:"trigger-change-warning",children:[(0,o.jsx)("div",{className:"warning-icon",children:(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M12 9V13M12 17H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",stroke:"#F59E0B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,o.jsxs)("div",{className:"warning-content",children:[(0,o.jsxs)("p",{children:["Changing the trigger from ",(0,o.jsxs)("strong",{children:['"',r,'"']})," to"," ",(0,o.jsxs)("strong",{children:['"',i,'"']})," will reset your entire flow to its initial state as"]}),(0,o.jsxs)("div",{className:"warning-details",children:[(0,o.jsx)("p",{children:"This action will:"}),(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{children:"Remove all existing nodes and connections"}),(0,o.jsx)("li",{children:"Create a fresh flow with the new trigger"}),(0,o.jsx)("li",{children:"Reset all customizations and configurations"})]})]})]})]})});class fe{constructor({baseUrl:e,pluginSlug:t="poptics",apiVersion:n="v1",nonce:o=""}){this.baseUrl=e,this.pluginSlug=t,this.apiVersion=n,this.nonce=o}getApiUrl(e){return`${this.baseUrl}/wp-json/${this.pluginSlug}/${this.apiVersion}/${e}`}async fetchWithAuth(e,t={}){const n=this.getApiUrl(e),o={"Content-Type":"application/json",...this.nonce?{"X-WP-Nonce":this.nonce}:{},...t.headers},r=await fetch(n,{...t,headers:o,credentials:"include"});if(!r.ok){const e=await r.text();throw new Error(`API Error (${r.status}): ${e}`)}return r.json()}async getFlowById(e){return this.fetchWithAuth(`notification-flow/${e}`)}async updateFlow(e,t){return this.fetchWithAuth(`notification-flow/${e}`,{method:"PUT",body:JSON.stringify(t)})}async createFlow(e){return this.fetchWithAuth("notification-flow",{method:"POST",body:JSON.stringify(e)})}async deleteFlow(e){return this.fetchWithAuth(`notification-flow/${e}`,{method:"DELETE"})}async bulkDeleteFlow(e){return this.fetchWithAuth("notification-flow",{method:"DELETE",body:JSON.stringify(e)})}async cloneFlow(e){return this.fetchWithAuth(`notification-flow/${e}/clone`,{method:"POST"})}async getFilteredFlows(e){const t=new URLSearchParams;e.trigger&&t.append("trigger",e.trigger),e.status&&t.append("status",e.status),e.searchKey&&t.append("search_key",e.searchKey);const n=t.toString(),o="notification-flow"+(n?`?${n}`:"");return this.fetchWithAuth(o)}}const he={poptics_ens_data:{nonce:"a8ad90e706",api_version:"v1",plugin_slug:"poptics",base_url:"http://poptics-demo.local",triggers:[{trigger_label:"Order Completed",trigger_value:"order_completed",trigger_data:[{label:"Order Amount",value:"order_amount",type:"number"},{label:"Order Status",value:"order_status",type:"string"},{label:"Order Date",value:"order_date",type:"date"},{label:"email",value:"email",type:"string"}],delay_dependencies:[{label:"Order Date",value:"order_date"},{label:"Event Date",value:"event_date"}],email_receivers:[{label:"User Email",value:"user_email"},{label:"Admin Email",value:"admin_email"},{label:"Custom Email",value:"custom_email"}]},{trigger_label:"Event Created",trigger_value:"event_created",trigger_data:[{label:"Purchase Price",value:"purchase_price",type:"number"},{label:"Purchase Status",value:"purchase_status",type:"string"},{label:"Purchase Date",value:"purchase_date",type:"date"},{label:"email",value:"email",type:"string"}],delay_dependencies:[{label:"Order Date",value:"order_date"}],email_receivers:[{label:"User Email",value:"user_email"},{label:"Admin Email",value:"admin_email"}]}]}},pe=[{label:"Send Email",value:"send_email"},{label:"Add Delay",value:"add_delay"}],ge={send_email:{label:"Send Email",formFields:[{name:"receiverType",label:"Receiver Type",component:"Select",required:!0,props:{style:{width:"100%"},options:[],placeholder:"Select user type",getPopupContainer:e=>e.parentNode},rules:[{required:!0,message:"Please select a user type"}]},{name:"custom_receivers_emails",label:"Custom Email Addresses",component:"TagInput",required:!0,props:{style:{width:"100%"},placeholder:"Type and enter a mail"},rules:[{required:!0,message:"Please add at least one email address"},{validator:(e,t)=>t&&t.length>0?Promise.resolve():Promise.reject(new Error("Please add at least one email address"))}],shouldRender:e=>"custom_email"===(null==e?void 0:e.receiverType)},{name:"from",label:"From Address",component:"Input",required:!1,props:{style:{width:"100%"},placeholder:"Enter from address",type:"email"},rules:[{required:!1,type:"email",message:"Please enter a valid email address"}]},{name:"subject",label:"Email Subject",component:"Input",required:!0,props:{style:{width:"100%"},placeholder:"Enter email subject"},rules:[{required:!0,message:"Please enter email subject"}]},{name:"body",label:"Email Body",component:"richText",required:!0,props:{style:{height:"200px"},modules:{toolbar:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]}],["link","image"],["clean"]]}},rules:[{required:!0,message:"Please enter email content"}]}]},add_delay:{label:"Add Delay",formFields:[{name:"delay",label:"Wait Time",component:"Input",required:!0,props:{style:{width:"100%"},min:0,type:"number",placeholder:"Delay amount in number"},rules:[{required:!0,message:"Please enter delay amount"}]},{name:"delayUnit",label:"Wait Time Unit",component:"Select",required:!0,props:{style:{width:"100%"},options:[{value:"minutes",label:"Minutes"},{value:"hours",label:"Hours"},{value:"days",label:"Days"},{value:"weeks",label:"Weeks"}],placeholder:"Select time unit",getPopupContainer:e=>e.parentNode},rules:[{required:!0,message:"Please select a time unit"}]},{name:"delayCondition",label:"Delay condition",component:"Select",required:!1,tooltip:{title:"Select when the delay should be calculated from. This determines the reference point for your wait time.",icon:"info",placement:"topRight"},props:{style:{width:"100%"},options:[],placeholder:"Select delay condition",getPopupContainer:e=>e.parentNode}}]}},ye=[{label:"Equal to (=)",value:"equal"},{label:"Not equal to (≠)",value:"not_equal"},{label:"Greater than (>)",value:"greater_then"},{label:"Greater than or equal to (≥)",value:"greater_equal"},{label:"Less than (<)",value:"less_then"},{label:"Less than or equal to (≤)",value:"less_equal"}],me=[{label:"Equal to (=)",value:"equal"},{label:"Not equal to (≠)",value:"not_equal"}],ve=[{label:"Equal to (=)",value:"equal"},{label:"Not equal to (≠)",value:"not_equal"},{label:"Before (<)",value:"less_then"},{label:"After (>)",value:"greater_then"}];function be(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,o=0;o<e.length;o++)""!==(n=be(e[o]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var we={value:()=>{}};function xe(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new _e(o)}function _e(e){this._=e}function ke(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}function Ee(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=we,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}_e.prototype=xe.prototype={constructor:_e,on:function(e,t){var n,o,r=this._,i=(o=r,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!o.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<s;)if(n=(e=i[a]).type)r[n]=Ee(r[n],e.name,t);else if(null==t)for(n in r)r[n]=Ee(r[n],e.name,null);return this}for(;++a<s;)if((n=(e=i[a]).type)&&(n=ke(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _e(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=new Array(n),i=0;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(o=this._[e]).length;i<n;++i)o[i].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};var Ce="http://www.w3.org/1999/xhtml",Ne={svg:"http://www.w3.org/2000/svg",xhtml:Ce,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Se(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Ne.hasOwnProperty(t)?{space:Ne[t],local:e}:e}function Oe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ce&&t.documentElement.namespaceURI===Ce?t.createElement(e):t.createElementNS(n,e)}}function je(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ae(e){var t=Se(e);return(t.local?je:Oe)(t)}function Pe(){}function Te(e){return null==e?Pe:function(){return this.querySelector(e)}}function Me(){return[]}function Le(e){return null==e?Me:function(){return this.querySelectorAll(e)}}function De(e){return function(){return this.matches(e)}}function Ie(e){return function(t){return t.matches(e)}}var qe=Array.prototype.find;function Re(){return this.firstElementChild}var Be=Array.prototype.filter;function $e(){return Array.from(this.children)}function ze(e){return new Array(e.length)}function Fe(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function He(e,t,n,o,r,i){for(var a,s=0,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Fe(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Ve(e,t,n,o,r,i,a){var s,l,c,u=new Map,d=t.length,f=i.length,h=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(h[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?r[s]=l:u.set(c,l));for(s=0;s<f;++s)c=a.call(e,i[s],s,i)+"",(l=u.get(c))?(o[s]=l,l.__data__=i[s],u.delete(c)):n[s]=new Fe(e,i[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(h[s])===l&&(r[s]=l)}function Ue(e){return e.__data__}function Ze(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Ke(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function We(e){return function(){this.removeAttribute(e)}}function Ye(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xe(e,t){return function(){this.setAttribute(e,t)}}function Ge(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Qe(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function Je(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function et(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function tt(e){return function(){this.style.removeProperty(e)}}function nt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ot(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function rt(e,t){return e.style.getPropertyValue(t)||et(e).getComputedStyle(e,null).getPropertyValue(t)}function it(e){return function(){delete this[e]}}function at(e,t){return function(){this[e]=t}}function st(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function lt(e){return e.trim().split(/^|\s+/)}function ct(e){return e.classList||new ut(e)}function ut(e){this._node=e,this._names=lt(e.getAttribute("class")||"")}function dt(e,t){for(var n=ct(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function ft(e,t){for(var n=ct(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function ht(e){return function(){dt(this,e)}}function pt(e){return function(){ft(this,e)}}function gt(e,t){return function(){(t.apply(this,arguments)?dt:ft)(this,e)}}function yt(){this.textContent=""}function mt(e){return function(){this.textContent=e}}function vt(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function bt(){this.innerHTML=""}function wt(e){return function(){this.innerHTML=e}}function xt(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function _t(){this.nextSibling&&this.parentNode.appendChild(this)}function kt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Et(){return null}function Ct(){var e=this.parentNode;e&&e.removeChild(this)}function Nt(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function St(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ot(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,i=t.length;o<i;++o)n=t[o],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function jt(e,t,n){return function(){var o,r=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(r)for(var a=0,s=r.length;a<s;++a)if((o=r[a]).type===e.type&&o.name===e.name)return this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),void(o.value=t);this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function At(e,t,n){var o=et(e),r=o.CustomEvent;"function"==typeof r?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Pt(e,t){return function(){return At(this,e,t)}}function Tt(e,t){return function(){return At(this,e,t.apply(this,arguments))}}Fe.prototype={constructor:Fe,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},ut.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Mt=[null];function Lt(e,t){this._groups=e,this._parents=t}function Dt(){return new Lt([[document.documentElement]],Mt)}function It(e){return"string"==typeof e?new Lt([[document.querySelector(e)]],[document.documentElement]):new Lt([[e]],Mt)}function qt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}Lt.prototype=Dt.prototype={constructor:Lt,select:function(e){"function"!=typeof e&&(e=Te(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a,s=t[r],l=s.length,c=o[r]=new Array(l),u=0;u<l;++u)(i=s[u])&&(a=e.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new Lt(o,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(e):Le(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var a,s=t[i],l=s.length,c=0;c<l;++c)(a=s[c])&&(o.push(e.call(a,a.__data__,c,s)),r.push(a));return new Lt(o,r)},selectChild:function(e){return this.select(null==e?Re:function(e){return function(){return qe.call(this.children,e)}}("function"==typeof e?e:Ie(e)))},selectChildren:function(e){return this.selectAll(null==e?$e:function(e){return function(){return Be.call(this.children,e)}}("function"==typeof e?e:Ie(e)))},filter:function(e){"function"!=typeof e&&(e=De(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a=t[r],s=a.length,l=o[r]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new Lt(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,Ue);var n,o=t?Ve:He,r=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=r[u],f=i[u],h=f.length,p=Ze(e.call(d,d&&d.__data__,u,r)),g=p.length,y=l[u]=new Array(g),m=s[u]=new Array(g);o(d,f,y,m,c[u]=new Array(h),p,t);for(var v,b,w=0,x=0;w<g;++w)if(v=y[w]){for(w>=x&&(x=w+1);!(b=m[x])&&++x<g;);v._next=b||null}}return(s=new Lt(s,r))._enter=l,s._exit=c,s},enter:function(){return new Lt(this._enter||this._groups.map(ze),this._parents)},exit:function(){return new Lt(this._exit||this._groups.map(ze),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,i=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==n?i.remove():n(i),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,a=Math.min(r,i),s=new Array(r),l=0;l<a;++l)for(var c,u=n[l],d=o[l],f=u.length,h=s[l]=new Array(f),p=0;p<f;++p)(c=u[p]||d[p])&&(h[p]=c);for(;l<r;++l)s[l]=n[l];return new Lt(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],i=r.length-1,a=r[i];--i>=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Ke);for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var a,s=n[i],l=s.length,c=r[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new Lt(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var a=o[r];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,i=t[n],a=0,s=i.length;a<s;++a)(r=i[a])&&e.call(r,r.__data__,a,i);return this},attr:function(e,t){var n=Se(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?Ye:We:"function"==typeof t?n.local?Je:Qe:n.local?Ge:Xe)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?tt:"function"==typeof t?ot:nt)(e,t,null==n?"":n)):rt(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?it:"function"==typeof t?st:at)(e,t)):this.node()[e]},classed:function(e,t){var n=lt(e+"");if(arguments.length<2){for(var o=ct(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?gt:t?ht:pt)(n,t))},text:function(e){return arguments.length?this.each(null==e?yt:("function"==typeof e?vt:mt)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?bt:("function"==typeof e?xt:wt)(e)):this.node().innerHTML},raise:function(){return this.each(_t)},lower:function(){return this.each(kt)},append:function(e){var t="function"==typeof e?e:Ae(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Ae(e),o=null==t?Et:"function"==typeof t?t:Te(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(Ct)},clone:function(e){return this.select(e?St:Nt)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,i=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),a=i.length;if(!(arguments.length<2)){for(s=t?jt:Ot,o=0;o<a;++o)this.each(s(i[o],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(o=0,l=s[c];o<a;++o)if((r=i[o]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?Tt:Pt)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],i=0,a=r.length;i<a;++i)(o=r[i])&&(yield o)}};const Rt={passive:!1},Bt={capture:!0,passive:!1};function $t(e){e.stopImmediatePropagation()}function zt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ft(e){var t=e.document.documentElement,n=It(e).on("dragstart.drag",zt,Bt);"onselectstart"in t?n.on("selectstart.drag",zt,Bt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ht(e,t){var n=e.document.documentElement,o=It(e).on("dragstart.drag",null);t&&(o.on("click.drag",zt,Bt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Vt=e=>()=>e;function Ut(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:a,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function Zt(e){return!e.ctrlKey&&!e.button}function Kt(){return this.parentNode}function Wt(e,t){return null==t?{x:e.x,y:e.y}:t}function Yt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xt(){var e,t,n,o,r=Zt,i=Kt,a=Wt,s=Yt,l={},c=xe("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",h).filter(s).on("touchstart.drag",y).on("touchmove.drag",m,Rt).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(a,s){if(!o&&r.call(this,a,s)){var l=b(this,i.call(this,a,s),a,s,"mouse");l&&(It(a.view).on("mousemove.drag",p,Bt).on("mouseup.drag",g,Bt),Ft(a.view),$t(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function p(o){if(zt(o),!n){var r=o.clientX-e,i=o.clientY-t;n=r*r+i*i>d}l.mouse("drag",o)}function g(e){It(e.view).on("mousemove.drag mouseup.drag",null),Ht(e.view,n),zt(e),l.mouse("end",e)}function y(e,t){if(r.call(this,e,t)){var n,o,a=e.changedTouches,s=i.call(this,e,t),l=a.length;for(n=0;n<l;++n)(o=b(this,s,e,t,a[n].identifier,a[n]))&&($t(e),o("start",e,a[n]))}}function m(e){var t,n,o=e.changedTouches,r=o.length;for(t=0;t<r;++t)(n=l[o[t].identifier])&&(zt(e),n("drag",e,o[t]))}function v(e){var t,n,r=e.changedTouches,i=r.length;for(o&&clearTimeout(o),o=setTimeout(function(){o=null},500),t=0;t<i;++t)(n=l[r[t].identifier])&&($t(e),n("end",e,r[t]))}function b(e,t,n,o,r,i){var s,d,h,p=c.copy(),g=qt(i||n,t);if(null!=(h=a.call(e,new Ut("beforestart",{sourceEvent:n,target:f,identifier:r,active:u,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),o)))return s=h.x-g[0]||0,d=h.y-g[1]||0,function n(i,a,c){var y,m=g;switch(i){case"start":l[r]=n,y=u++;break;case"end":delete l[r],--u;case"drag":g=qt(c||a,t),y=u}p.call(i,e,new Ut(i,{sourceEvent:a,subject:h,target:f,identifier:r,active:y,x:g[0]+s,y:g[1]+d,dx:g[0]-m[0],dy:g[1]-m[1],dispatch:p}),o)}}return f.filter=function(e){return arguments.length?(r="function"==typeof e?e:Vt(!!e),f):r},f.container=function(e){return arguments.length?(i="function"==typeof e?e:Vt(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:Vt(e),f):a},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Vt(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Gt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Qt(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Jt(){}Ut.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var en=.7,tn=1/en,nn="\\s*([+-]?\\d+)\\s*",on="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",rn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",an=/^#([0-9a-f]{3,8})$/,sn=new RegExp(`^rgb\\(${nn},${nn},${nn}\\)$`),ln=new RegExp(`^rgb\\(${rn},${rn},${rn}\\)$`),cn=new RegExp(`^rgba\\(${nn},${nn},${nn},${on}\\)$`),un=new RegExp(`^rgba\\(${rn},${rn},${rn},${on}\\)$`),_n=new RegExp(`^hsl\\(${on},${rn},${rn}\\)$`),dn=new RegExp(`^hsla\\(${on},${rn},${rn},${on}\\)$`),fn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function hn(){return this.rgb().formatHex()}function pn(){return this.rgb().formatRgb()}function gn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=an.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?yn(t):3===n?new bn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?mn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?mn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=sn.exec(e))?new bn(t[1],t[2],t[3],1):(t=ln.exec(e))?new bn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=cn.exec(e))?mn(t[1],t[2],t[3],t[4]):(t=un.exec(e))?mn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=_n.exec(e))?Nn(t[1],t[2]/100,t[3]/100,1):(t=dn.exec(e))?Nn(t[1],t[2]/100,t[3]/100,t[4]):fn.hasOwnProperty(e)?yn(fn[e]):"transparent"===e?new bn(NaN,NaN,NaN,0):null}function yn(e){return new bn(e>>16&255,e>>8&255,255&e,1)}function mn(e,t,n,o){return o<=0&&(e=t=n=NaN),new bn(e,t,n,o)}function vn(e,t,n,o){return 1===arguments.length?((r=e)instanceof Jt||(r=gn(r)),r?new bn((r=r.rgb()).r,r.g,r.b,r.opacity):new bn):new bn(e,t,n,null==o?1:o);var r}function bn(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function wn(){return`#${Cn(this.r)}${Cn(this.g)}${Cn(this.b)}`}function xn(){const e=kn(this.opacity);return`${1===e?"rgb(":"rgba("}${En(this.r)}, ${En(this.g)}, ${En(this.b)}${1===e?")":`, ${e})`}`}function kn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function En(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cn(e){return((e=En(e))<16?"0":"")+e.toString(16)}function Nn(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new On(e,t,n,o)}function Sn(e){if(e instanceof On)return new On(e.h,e.s,e.l,e.opacity);if(e instanceof Jt||(e=gn(e)),!e)return new On;if(e instanceof On)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),a=NaN,s=i-r,l=(i+r)/2;return s?(a=t===i?(n-o)/s+6*(n<o):n===i?(o-t)/s+2:(t-n)/s+4,s/=l<.5?i+r:2-i-r,a*=60):s=l>0&&l<1?0:a,new On(a,s,l,e.opacity)}function On(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function jn(e){return(e=(e||0)%360)<0?e+360:e}function An(e){return Math.max(0,Math.min(1,e||0))}function Pn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Gt(Jt,gn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hn,formatHex:hn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Sn(this).formatHsl()},formatRgb:pn,toString:pn}),Gt(bn,vn,Qt(Jt,{brighter(e){return e=null==e?tn:Math.pow(tn,e),new bn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?en:Math.pow(en,e),new bn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bn(En(this.r),En(this.g),En(this.b),kn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wn,formatHex:wn,formatHex8:function(){return`#${Cn(this.r)}${Cn(this.g)}${Cn(this.b)}${Cn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:xn,toString:xn})),Gt(On,function(e,t,n,o){return 1===arguments.length?Sn(e):new On(e,t,n,null==o?1:o)},Qt(Jt,{brighter(e){return e=null==e?tn:Math.pow(tn,e),new On(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?en:Math.pow(en,e),new On(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new bn(Pn(e>=240?e-240:e+120,r,o),Pn(e,r,o),Pn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new On(jn(this.h),An(this.s),An(this.l),kn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=kn(this.opacity);return`${1===e?"hsl(":"hsla("}${jn(this.h)}, ${100*An(this.s)}%, ${100*An(this.l)}%${1===e?")":`, ${e})`}`}}));var Tn=e=>()=>e;function Mn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Tn(isNaN(e)?t:e)}var Ln=function e(t){var n=function(e){return 1===(e=+e)?Mn:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}(t,n,e):Tn(isNaN(t)?n:t)}}(t);function o(e,t){var o=n((e=vn(e)).r,(t=vn(t)).r),r=n(e.g,t.g),i=n(e.b,t.b),a=Mn(e.opacity,t.opacity);return function(t){return e.r=o(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function Dn(e,t){t||(t=[]);var n,o=e?Math.min(t.length,e.length):0,r=t.slice();return function(i){for(n=0;n<o;++n)r[n]=e[n]*(1-i)+t[n]*i;return r}}function In(e,t){var n,o=t?t.length:0,r=e?Math.min(o,e.length):0,i=new Array(r),a=new Array(o);for(n=0;n<r;++n)i[n]=Hn(e[n],t[n]);for(;n<o;++n)a[n]=t[n];return function(e){for(n=0;n<r;++n)a[n]=i[n](e);return a}}function qn(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Rn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Bn(e,t){var n,o={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?o[n]=Hn(e[n],t[n]):r[n]=t[n];return function(e){for(n in o)r[n]=o[n](e);return r}}var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zn=new RegExp($n.source,"g");function Fn(e,t){var n,o,r,i=$n.lastIndex=zn.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=$n.exec(e))&&(o=zn.exec(t));)(r=o.index)>i&&(r=t.slice(i,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:Rn(n,o)})),i=zn.lastIndex;return i<t.length&&(r=t.slice(i),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,o=0;o<t;++o)s[(n=l[o]).i]=n.x(e);return s.join("")})}function Hn(e,t){var n,o,r=typeof t;return null==t||"boolean"===r?Tn(t):("number"===r?Rn:"string"===r?(n=gn(t))?(t=n,Ln):Fn:t instanceof gn?Ln:t instanceof Date?qn:(o=t,!ArrayBuffer.isView(o)||o instanceof DataView?Array.isArray(t)?In:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Bn:Rn:Dn))(e,t)}var Vn,Un=180/Math.PI,Zn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Kn(e,t,n,o,r,i){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Un,skewX:Math.atan(l)*Un,scaleX:a,scaleY:s}}function Wn(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(i,a){var s=[],l=[];return i=e(i),a=e(a),function(e,o,r,i,a,s){if(e!==r||o!==i){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:Rn(e,r)},{i:l-2,x:Rn(o,i)})}else(r||i)&&a.push("translate("+r+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(r(n)+"rotate(",null,o)-2,x:Rn(e,t)})):t&&n.push(r(n)+"rotate("+t+o)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(r(n)+"skewX(",null,o)-2,x:Rn(e,t)}):t&&n.push(r(n)+"skewX("+t+o)}(i.skewX,a.skewX,s,l),function(e,t,n,o,i,a){if(e!==n||t!==o){var s=i.push(r(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Rn(e,n)},{i:s-2,x:Rn(t,o)})}else 1===n&&1===o||i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,o=l.length;++n<o;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var Yn=Wn(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Zn:Kn(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),Xn=Wn(function(e){return null==e?Zn:(Vn||(Vn=document.createElementNS("http://www.w3.org/2000/svg","g")),Vn.setAttribute("transform",e),(e=Vn.transform.baseVal.consolidate())?Kn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):Zn)},", ",")",")");function Gn(e){return((e=Math.exp(e))+1/e)/2}var Qn,Jn,eo=function e(t,n,o){function r(e,r){var i,a,s=e[0],l=e[1],c=e[2],u=r[0],d=r[1],f=r[2],h=u-s,p=d-l,g=h*h+p*p;if(g<1e-12)a=Math.log(f/c)/t,i=function(e){return[s+e*h,l+e*p,c*Math.exp(t*e*a)]};else{var y=Math.sqrt(g),m=(f*f-c*c+o*g)/(2*c*n*y),v=(f*f-c*c-o*g)/(2*f*n*y),b=Math.log(Math.sqrt(m*m+1)-m),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-b)/t,i=function(e){var o,r=e*a,i=Gn(b),u=c/(n*y)*(i*(o=t*r+b,((o=Math.exp(2*o))-1)/(o+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*h,l+u*p,c*i/Gn(t*r+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4),to=0,no=0,oo=0,ro=0,io=0,ao=0,so="object"==typeof performance&&performance.now?performance:Date,lo="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function co(){return io||(lo(uo),io=so.now()+ao)}function uo(){io=0}function fo(){this._call=this._time=this._next=null}function ho(e,t,n){var o=new fo;return o.restart(e,t,n),o}function po(){io=(ro=so.now())+ao,to=no=0;try{!function(){co(),++to;for(var e,t=Qn;t;)(e=io-t._time)>=0&&t._call.call(void 0,e),t=t._next;--to}()}finally{to=0,function(){for(var e,t,n=Qn,o=1/0;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Qn=t);Jn=e,yo(o)}(),io=0}}function go(){var e=so.now(),t=e-ro;t>1e3&&(ao-=t,ro=e)}function yo(e){to||(no&&(no=clearTimeout(no)),e-io>24?(e<1/0&&(no=setTimeout(po,e-so.now()-ao)),oo&&(oo=clearInterval(oo))):(oo||(ro=so.now(),oo=setInterval(go,1e3)),to=1,lo(po)))}function mo(e,t,n){var o=new fo;return t=null==t?0:+t,o.restart(n=>{o.stop(),e(n+t)},t,n),o}fo.prototype=ho.prototype={constructor:fo,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?co():+n)+(null==t?0:+t),this._next||Jn===this||(Jn?Jn._next=this:Qn=this,Jn=this),this._call=e,this._time=n,yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,yo())}};var vo=xe("start","end","cancel","interrupt"),bo=[];function wo(e,t,n,o,r,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function i(l){var c,u,d,f;if(1!==n.state)return s();for(c in r)if((f=r[c]).name===n.name){if(3===f.state)return mo(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[c])}if(mo(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,o=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++u]=f);o.length=u+1}}function a(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),i=-1,a=o.length;++i<a;)o[i].call(e,r);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var o in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=ho(function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)},0,n.time)}(e,n,{name:t,index:o,group:r,on:vo,tween:bo,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function xo(e,t){var n=ko(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function _o(e,t){var n=ko(e,t);if(n.state>3)throw new Error("too late; already running");return n}function ko(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Eo(e,t){var n,o,r,i=e.__transition,a=!0;if(i){for(r in t=null==t?null:t+"",i)(n=i[r]).name===t?(o=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[r]):a=!1;a&&delete e.__transition}}function Co(e,t){var n,o;return function(){var r=_o(this,e),i=r.tween;if(i!==n)for(var a=0,s=(o=n=i).length;a<s;++a)if(o[a].name===t){(o=o.slice()).splice(a,1);break}r.tween=o}}function No(e,t,n){var o,r;if("function"!=typeof n)throw new Error;return function(){var i=_o(this,e),a=i.tween;if(a!==o){r=(o=a).slice();for(var s={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=s;break}l===c&&r.push(s)}i.tween=r}}function So(e,t,n){var o=e._id;return e.each(function(){var e=_o(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return ko(e,o).value[t]}}function Oo(e,t){var n;return("number"==typeof t?Rn:t instanceof gn?Ln:(n=gn(t))?(t=n,Ln):Fn)(e,t)}function jo(e){return function(){this.removeAttribute(e)}}function Ao(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Po(e,t,n){var o,r,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}}function To(e,t,n){var o,r,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}function Mo(e,t,n){var o,r,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===o&&s===r?i:(r=s,i=t(o=a,l));this.removeAttribute(e)}}function Lo(e,t,n){var o,r,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===o&&s===r?i:(r=s,i=t(o=a,l));this.removeAttributeNS(e.space,e.local)}}function Do(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,r)),n}return r._value=t,r}function Io(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,r)),n}return r._value=t,r}function qo(e,t){return function(){xo(this,e).delay=+t.apply(this,arguments)}}function Ro(e,t){return t=+t,function(){xo(this,e).delay=t}}function Bo(e,t){return function(){_o(this,e).duration=+t.apply(this,arguments)}}function $o(e,t){return t=+t,function(){_o(this,e).duration=t}}var zo=Dt.prototype.constructor;function Fo(e){return function(){this.style.removeProperty(e)}}var Ho=0;function Vo(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Uo(){return++Ho}var Zo=Dt.prototype;Vo.prototype={constructor:Vo,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Te(e));for(var o=this._groups,r=o.length,i=new Array(r),a=0;a<r;++a)for(var s,l,c=o[a],u=c.length,d=i[a]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,wo(d[f],t,n,f,d,ko(s,n)));return new Vo(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Le(e));for(var o=this._groups,r=o.length,i=[],a=[],s=0;s<r;++s)for(var l,c=o[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,h=e.call(l,l.__data__,d,c),p=ko(l,n),g=0,y=h.length;g<y;++g)(f=h[g])&&wo(f,t,n,g,h,p);i.push(h),a.push(l)}return new Vo(i,a,t,n)},selectChild:Zo.selectChild,selectChildren:Zo.selectChildren,filter:function(e){"function"!=typeof e&&(e=De(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i,a=t[r],s=a.length,l=o[r]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new Vo(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),a=new Array(o),s=0;s<i;++s)for(var l,c=t[s],u=n[s],d=c.length,f=a[s]=new Array(d),h=0;h<d;++h)(l=c[h]||u[h])&&(f[h]=l);for(;s<o;++s)a[s]=t[s];return new Vo(a,this._parents,this._name,this._id)},selection:function(){return new zo(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Uo(),o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=ko(a,t);wo(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Vo(o,this._parents,e,n)},call:Zo.call,nodes:Zo.nodes,node:Zo.node,size:Zo.size,empty:Zo.empty,each:Zo.each,on:function(e,t){var n=this._id;return arguments.length<2?ko(this.node(),n).on.on(e):this.each(function(e,t,n){var o,r,i=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?xo:_o;return function(){var a=i(this,e),s=a.on;s!==o&&(r=(o=s).copy()).on(t,n),a.on=r}}(n,e,t))},attr:function(e,t){var n=Se(e),o="transform"===n?Xn:Oo;return this.attrTween(e,"function"==typeof t?(n.local?Lo:Mo)(n,o,So(this,"attr."+e,t)):null==t?(n.local?Ao:jo)(n):(n.local?To:Po)(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var o=Se(e);return this.tween(n,(o.local?Do:Io)(o,t))},style:function(e,t,n){var o="transform"==(e+="")?Yn:Oo;return null==t?this.styleTween(e,function(e,t){var n,o,r;return function(){var i=rt(this,e),a=(this.style.removeProperty(e),rt(this,e));return i===a?null:i===n&&a===o?r:r=t(n=i,o=a)}}(e,o)).on("end.style."+e,Fo(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var o,r,i;return function(){var a=rt(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=rt(this,e)),a===l?null:a===o&&l===r?i:(r=l,i=t(o=a,s))}}(e,o,So(this,"style."+e,t))).each(function(e,t){var n,o,r,i,a="style."+t,s="end."+a;return function(){var l=_o(this,e),c=l.on,u=null==l.value[a]?i||(i=Fo(t)):void 0;c===n&&r===u||(o=(n=c).copy()).on(s,r=u),l.on=o}}(this._id,e)):this.styleTween(e,function(e,t,n){var o,r,i=n+"";return function(){var a=rt(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}(e,o,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw new Error;return this.tween(o,function(e,t,n){var o,r;function i(){var i=t.apply(this,arguments);return i!==r&&(o=(r=i)&&function(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}(e,i,n)),o}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(So(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){return function(t){this.textContent=e.call(this,t)}}(o)),t}return o._value=e,o}(e))},remove:function(){return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}));var e},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=ko(this.node(),n).tween,i=0,a=r.length;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((null==t?Co:No)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?qo:Ro)(t,e)):ko(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Bo:$o)(t,e)):ko(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){_o(this,e).ease=t}}(t,e)):ko(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;_o(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,a){var s={value:a},l={value:function(){0===--r&&i()}};n.each(function(){var n=_o(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===r&&i()})},[Symbol.iterator]:Zo[Symbol.iterator]};var Ko={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Wo(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}Dt.prototype.interrupt=function(e){return this.each(function(){Eo(this,e)})},Dt.prototype.transition=function(e){var t,n;e instanceof Vo?(t=e._id,e=e._name):(t=Uo(),(n=Ko).time=co(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var a,s=o[i],l=s.length,c=0;c<l;++c)(a=s[c])&&wo(a,e,t,c,s,n||Wo(a,t));return new Vo(o,this._parents,e,t)};var Yo=e=>()=>e;function Xo(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Go(e,t,n){this.k=e,this.x=t,this.y=n}Go.prototype={constructor:Go,scale:function(e){return 1===e?this:new Go(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Go(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Qo=new Go(1,0,0);function Jo(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Qo;return e.__zoom}function er(e){e.stopImmediatePropagation()}function tr(e){e.preventDefault(),e.stopImmediatePropagation()}function nr(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function or(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function rr(){return this.__zoom||Qo}function ir(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ar(){return navigator.maxTouchPoints||"ontouchstart"in this}function sr(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function lr(){var e,t,n,o=nr,r=or,i=sr,a=ir,s=ar,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=eo,f=xe("start","zoom","end"),h=0,p=10;function g(e){e.property("__zoom",rr).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",E).filter(s).on("touchstart.zoom",C).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",S).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new Go(t,e.x,e.y)}function m(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new Go(e.k,o,r)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,o){e.on("start.zoom",function(){w(this,arguments).event(o).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(o).end()}).tween("zoom",function(){var e=this,i=arguments,a=w(e,i).event(o),s=r.apply(e,i),l=null==n?v(s):"function"==typeof n?n.apply(e,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,i):t,h=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=h(e),n=c/t[2];e=new Go(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function _(e,...t){if(o.apply(this,arguments)){var n=w(this,t).event(e),r=this.__zoom,s=Math.max(l[0],Math.min(l[1],r.k*Math.pow(2,a.apply(this,arguments)))),u=qt(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=r.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[u,r.invert(u)],Eo(this),n.start()}tr(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(m(y(r,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function k(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,a=w(this,t,!0).event(e),s=It(e.view).on("mousemove.zoom",function(e){if(tr(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>h}a.event(e).zoom("mouse",i(m(a.that.__zoom,a.mouse[0]=qt(e,r),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),Ht(e.view,a.moved),tr(e),a.event(e).end()},!0),l=qt(e,r),u=e.clientX,d=e.clientY;Ft(e.view),er(e),a.mouse=[l,this.__zoom.invert(l)],Eo(this),a.start()}}function E(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,a=qt(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),l=n.k*(e.shiftKey?.5:2),d=i(m(y(n,l),a,s),r.apply(this,t),c);tr(e),u>0?It(this).transition().duration(u).call(b,d,a,e):It(this).call(g.transform,d,a,e)}}function C(n,...r){if(o.apply(this,arguments)){var i,a,s,l,c=n.touches,u=c.length,d=w(this,r,n.changedTouches.length===u).event(n);for(er(n),a=0;a<u;++a)l=[l=qt(s=c[a],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Eo(this),d.start())}}function N(e,...t){if(this.__zooming){var n,o,r,a,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(tr(e),n=0;n<u;++n)r=qt(o=l[n],this),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=r:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=r);if(o=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],h=s.touch1[0],p=s.touch1[1],g=(g=h[0]-d[0])*g+(g=h[1]-d[1])*g,v=(v=p[0]-f[0])*v+(v=p[1]-f[1])*v;o=y(o,Math.sqrt(g/v)),r=[(d[0]+h[0])/2,(d[1]+h[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!s.touch0)return;r=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(m(o,r,a),s.extent,c))}}function S(e,...o){if(this.__zooming){var r,i,a=w(this,o).event(e),s=e.changedTouches,l=s.length;for(er(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),r=0;r<l;++r)i=s[r],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=qt(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<p)){var c=It(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return g.transform=function(e,t,n,o){var r=e.selection?e.selection():e;r.property("__zoom",rr),e!==r?b(e,t,n,o):r.interrupt().each(function(){w(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},g.scaleBy=function(e,t,n,o){g.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,o)},g.scaleTo=function(e,t,n,o){g.transform(e,function(){var e=r.apply(this,arguments),o=this.__zoom,a=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(a),l="function"==typeof t?t.apply(this,arguments):t;return i(m(y(o,l),a,s),e,c)},n,o)},g.translateBy=function(e,t,n,o){g.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),c)},null,o)},g.translateTo=function(e,t,n,o,a){g.transform(e,function(){var e=r.apply(this,arguments),a=this.__zoom,s=null==o?v(e):"function"==typeof o?o.apply(this,arguments):o;return i(Qo.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},o,a)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=It(this.that).datum();f.call(e,this.that,new Xo(e,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:f}),t)}},g.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:Yo(+e),g):a},g.filter=function(e){return arguments.length?(o="function"==typeof e?e:Yo(!!e),g):o},g.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Yo(!!e),g):s},g.extent=function(e){return arguments.length?(r="function"==typeof e?e:Yo([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),g):r},g.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],g):[l[0],l[1]]},g.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],g):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},g.constrain=function(e){return arguments.length?(i=e,g):i},g.duration=function(e){return arguments.length?(u=+e,g):u},g.interpolate=function(e){return arguments.length?(d=e,g):d},g.on=function(){var e=f.on.apply(f,arguments);return e===f?g:e},g.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,g):Math.sqrt(h)},g.tapDistance=function(e){return arguments.length?(p=+e,g):p},g}Jo.prototype=Go.prototype;const cr=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ur=["Enter"," ","Escape"],dr={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var fr,hr,pr,gr;(gr=fr||(fr={})).Strict="strict",gr.Loose="loose",function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(hr||(hr={})),function(e){e.Partial="partial",e.Full="full"}(pr||(pr={}));const yr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var mr,vr,br;!function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(mr||(mr={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(vr||(vr={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(br||(br={}));const wr={[br.Left]:br.Right,[br.Right]:br.Left,[br.Top]:br.Bottom,[br.Bottom]:br.Top};function xr(e){return null===e?null:e?"valid":"invalid"}const _r=e=>"id"in e&&"source"in e&&"target"in e,kr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Er=(e,t=[0,0])=>{const{width:n,height:o}=Xr(e),r=e.origin??t,i=n*r[0],a=o*r[1];return{x:e.position.x-i,y:e.position.y-a}},Cr=(e,t={})=>{if(0===e.size)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(e=>{if(void 0===t.filter||t.filter(e)){const t=qr(e);n=Mr(n,t)}}),Dr(n)},Nr=(e,t,[n,o,r]=[0,0,1],i=!1,a=!1)=>{const s={...Vr(t,[n,o,r]),width:t.width/r,height:t.height/r},l=[];for(const t of e.values()){const{measured:e,selectable:n=!0,hidden:o=!1}=t;if(a&&!n||o)continue;const r=e.width??t.width??t.initialWidth??null,c=e.height??t.height??t.initialHeight??null,u=Br(s,Ir(t)),d=(r??0)*(c??0),f=i&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&l.push(t)}return l};function Sr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const a=n.get(e),s=a.parentId?n.get(a.parentId):void 0,{x:l,y:c}=s?s.internals.positionAbsolute:{x:0,y:0},u=a.origin??o;let d=a.extent||r;if("parent"!==a.extent||a.expandParent)s&&Yr(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+c],[a.extent[1][0]+l,a.extent[1][1]+c]]);else if(s){const e=s.measured.width,t=s.measured.height;e&&t&&(d=[[l,c],[l+e,c+t]])}else i?.("005","Only child nodes can use a parent extent.");const f=Yr(d)?jr(t,d,a.measured):t;return void 0!==a.measured.width&&void 0!==a.measured.height||i?.("015","It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."),{position:{x:f.x-l+(a.measured.width??0)*u[0],y:f.y-c+(a.measured.height??0)*u[1]},positionAbsolute:f}}const Or=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),jr=(e={x:0,y:0},t,n)=>({x:Or(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Or(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ar(e,t,n){const{width:o,height:r}=Xr(n),{x:i,y:a}=n.internals.positionAbsolute;return jr(e,[[i,a],[i+o,a+r]],t)}const Pr=(e,t,n)=>e<t?Or(Math.abs(e-t),1,t)/t:e>n?-Or(Math.abs(e-n),1,t)/t:0,Tr=(e,t,n=15,o=40)=>[Pr(e.x,o,t.width-o)*n,Pr(e.y,o,t.height-o)*n],Mr=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Lr=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Dr=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),Ir=(e,t=[0,0])=>{const{x:n,y:o}=kr(e)?e.internals.positionAbsolute:Er(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},qr=(e,t=[0,0])=>{const{x:n,y:o}=kr(e)?e.internals.positionAbsolute:Er(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Rr=(e,t)=>Dr(Mr(Lr(e),Lr(t))),Br=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},$r=e=>zr(e.width)&&zr(e.height)&&zr(e.x)&&zr(e.y),zr=e=>!isNaN(e)&&isFinite(e),Fr=(e,t)=>{},Hr=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Vr=({x:e,y:t},[n,o,r],i=!1,a=[1,1])=>{const s={x:(e-n)/r,y:(t-o)/r};return i?Hr(s,a):s},Ur=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Zr(e,t){if("number"==typeof e)return Math.floor(.5*(t-t/(1+e)));if("string"==typeof e&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}const Kr=(e,t,n,o,r,i)=>{const a=function(e,t,n){if("string"==typeof e||"number"==typeof e){const o=Zr(e,n),r=Zr(e,t);return{top:o,right:r,bottom:o,left:r,x:2*r,y:2*o}}if("object"==typeof e){const o=Zr(e.top??e.y??0,n),r=Zr(e.bottom??e.y??0,n),i=Zr(e.left??e.x??0,t),a=Zr(e.right??e.x??0,t);return{top:o,right:a,bottom:r,left:i,x:i+a,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),s=(t-a.x)/e.width,l=(n-a.y)/e.height,c=Math.min(s,l),u=Or(c,o,r),d=t/2-(e.x+e.width/2)*u,f=n/2-(e.y+e.height/2)*u,h=function(e,t,n,o,r,i){const{x:a,y:s}=Ur(e,[t,n,o]),{x:l,y:c}=Ur({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,d=i-c;return{left:Math.floor(a),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}(e,d,f,u,t,n),p=Math.min(h.left-a.left,0),g=Math.min(h.top-a.top,0);return{x:d-p+Math.min(h.right-a.right,0),y:f-g+Math.min(h.bottom-a.bottom,0),zoom:u}},Wr=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function Yr(e){return null!=e&&"parent"!==e}function Xr(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Gr(e){return void 0!==(e.measured?.width??e.width??e.initialWidth)&&void 0!==(e.measured?.height??e.height??e.initialHeight)}function Qr(e,t={width:0,height:0},n,o,r){const i={...e},a=o.get(n);if(a){const e=a.origin||r;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function Jr(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ei(e){return{...dr,...e||{}}}function ti(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:a}=si(e),s=Vr({x:i-(r?.left??0),y:a-(r?.top??0)},o),{x:l,y:c}=n?Hr(s,t):s;return{xSnapped:l,ySnapped:c,...s}}const ni=e=>({width:e.offsetWidth,height:e.offsetHeight}),oi=e=>e?.getRootNode?.()||window?.document,ri=["INPUT","SELECT","TEXTAREA"];function ii(e){const t=e.composedPath?.()?.[0]||e.target;return 1===t?.nodeType&&(ri.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}const ai=e=>"clientX"in e,si=(e,t)=>{const n=ai(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},li=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map(t=>{const i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:r,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/o,y:(i.top-n.top)/o,...ni(t)}}):null};function ci({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*r+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*o;return[l,c,Math.abs(l-e),Math.abs(c-t)]}function ui(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function di({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case br.Left:return[t-ui(t-o,i),n];case br.Right:return[t+ui(o-t,i),n];case br.Top:return[t,n-ui(n-r,i)];case br.Bottom:return[t,n+ui(r-n,i)]}}function fi({sourceX:e,sourceY:t,sourcePosition:n=br.Bottom,targetX:o,targetY:r,targetPosition:i=br.Top,curvature:a=.25}){const[s,l]=di({pos:n,x1:e,y1:t,x2:o,y2:r,c:a}),[c,u]=di({pos:i,x1:o,y1:r,x2:e,y2:t,c:a}),[d,f,h,p]=ci({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${o},${r}`,d,f,h,p]}function hi({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,a=Math.abs(o-t)/2;return[i,o<t?o+a:o-a,r,a]}function pi({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=Mr(qr(e),qr(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return Br(a,Dr(i))>0}const gi=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`;function yi({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,a,s]=hi({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,a,s]}const mi={[br.Left]:{x:-1,y:0},[br.Right]:{x:1,y:0},[br.Top]:{x:0,y:-1},[br.Bottom]:{x:0,y:1}},vi=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function bi({sourceX:e,sourceY:t,sourcePosition:n=br.Bottom,targetX:o,targetY:r,targetPosition:i=br.Top,borderRadius:a=5,centerX:s,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,h,p,g]=function({source:e,sourcePosition:t=br.Bottom,target:n,targetPosition:o=br.Top,center:r,offset:i,stepPosition:a}){const s=mi[t],l=mi[o],c={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},d=(({source:e,sourcePosition:t=br.Bottom,target:n})=>t===br.Left||t===br.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:c,sourcePosition:t,target:u}),f=0!==d.x?"x":"y",h=d[f];let p,g,y=[];const m={x:0,y:0},v={x:0,y:0},[,,b,w]=hi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){"x"===f?(p=r.x??c.x+(u.x-c.x)*a,g=r.y??(c.y+u.y)/2):(p=r.x??(c.x+u.x)/2,g=r.y??c.y+(u.y-c.y)*a);const e=[{x:p,y:c.y},{x:p,y:u.y}],t=[{x:c.x,y:g},{x:u.x,y:g}];y=s[f]===h?"x"===f?e:t:"x"===f?t:e}else{const r=[{x:c.x,y:u.y}],a=[{x:u.x,y:c.y}];if(y="x"===f?s.x===h?a:r:s.y===h?r:a,t===o){const t=Math.abs(e[f]-n[f]);if(t<=i){const o=Math.min(i-1,i-t);s[f]===h?m[f]=(c[f]>e[f]?-1:1)*o:v[f]=(u[f]>n[f]?-1:1)*o}}if(t!==o){const e="x"===f?"y":"x",t=s[f]===l[e],n=c[e]>u[e],o=c[e]<u[e];(1===s[f]&&(!t&&n||t&&o)||1!==s[f]&&(!t&&o||t&&n))&&(y="x"===f?r:a)}const d={x:c.x+m.x,y:c.y+m.y},b={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-y[0].x),Math.abs(b.x-y[0].x))>=Math.max(Math.abs(d.y-y[0].y),Math.abs(b.y-y[0].y))?(p=(d.x+b.x)/2,g=y[0].y):(p=y[0].x,g=(d.y+b.y)/2)}return[[e,{x:c.x+m.x,y:c.y+m.y},...y,{x:u.x+v.x,y:u.y+v.y},n],p,g,b,w]}({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:s,y:l},offset:c,stepPosition:u});return[d.reduce((e,t,n)=>{let o="";return o=n>0&&n<d.length-1?function(e,t,n,o){const r=Math.min(vi(e,t)/2,vi(t,n)/2,o),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+r*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+r*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${i},${a+r*(e.y<n.y?-1:1)}Q ${i},${a} ${i+r*s},${a}`}(d[n-1],t,d[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+o},""),f,h,p,g]}function wi(e){return e&&!(!e.internals.handleBounds&&!e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function xi(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,"source"===o.type?t.push(o):"target"===o.type&&n.push(o);return{source:t,target:n}}function _i(e,t,n=br.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:s}=t??Xr(e);if(o)return{x:r+a/2,y:i+s/2};switch(t?.position??n){case br.Top:return{x:r+a/2,y:i};case br.Right:return{x:r+a,y:i+s/2};case br.Bottom:return{x:r+a/2,y:i+s};case br.Left:return{x:r,y:i+s/2}}}function ki(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function Ei(e,t){return e?"string"==typeof e?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`:""}const Ci={nodeOrigin:[0,0],nodeExtent:cr,elevateNodesOnSelect:!0,defaults:{}},Ni={...Ci,checkEquality:!0};function Si(e,t){const n={...e};for(const e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function Oi(e,t,n,o){const r=Si(Ni,o);let i=e.length>0;const a=new Map(t),s=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const l of e){let e=a.get(l.id);if(r.checkEquality&&l===e?.internals.userNode)t.set(l.id,e);else{const n=Er(l,r.nodeOrigin),o=Yr(l.extent)?l.extent:r.nodeExtent,i=jr(n,o,Xr(l));e={...r.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:i,handleBounds:l.measured?e?.internals.handleBounds:void 0,z:Ai(l,s),userNode:l}},t.set(l.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(i=!1),l.parentId&&ji(e,t,n,o)}return i}function ji(e,t,n,o){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:a}=Si(Ci,o),s=e.parentId,l=t.get(s);if(!l)return void console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n);const c=r?1e3:0,{x:u,y:d,z:f}=function(e,t,n,o,r){const{x:i,y:a}=t.internals.positionAbsolute,s=Xr(e),l=Er(e,n),c=Yr(e.extent)?jr(l,e.extent,s):l;let u=jr({x:i+c.x,y:a+c.y},o,s);"parent"===e.extent&&(u=Ar(u,s,t));const d=Ai(e,r),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>=d?f+1:d}}(e,l,i,a,c),{positionAbsolute:h}=e.internals,p=u!==h.x||d!==h.y;(p||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:p?{x:u,y:d}:h,z:f}})}function Ai(e,t){return(zr(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Pi(e,t,n,o=[0,0]){const r=[],i=new Map;for(const n of e){const e=t.get(n.parentId);if(!e)continue;const o=i.get(n.parentId)?.expandedRect??Ir(e),r=Rr(o,n.rect);i.set(n.parentId,{expandedRect:r,parent:e})}return i.size>0&&i.forEach(({expandedRect:t,parent:i},a)=>{const s=i.internals.positionAbsolute,l=Xr(i),c=i.origin??o,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(l.width,Math.round(t.width)),h=Math.max(l.height,Math.round(t.height)),p=(f-l.width)*c[0],g=(h-l.height)*c[1];(u>0||d>0||p||g)&&(r.push({id:a,type:"position",position:{x:i.position.x-u+p,y:i.position.y-d+g}}),n.get(a)?.forEach(t=>{e.some(e=>e.id===t.id)||r.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})})),(l.width<t.width||l.height<t.height||u||d)&&r.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:f+(u?c[0]*u-p:0),height:h+(d?c[1]*d-g:0)}})}),r}function Ti(e,t,n,o,r,i){let a=r;const s=o.get(a)||new Map;o.set(a,s.set(n,t)),a=`${r}-${e}`;const l=o.get(a)||new Map;if(o.set(a,l.set(n,t)),i){a=`${r}-${e}-${i}`;const s=o.get(a)||new Map;o.set(a,s.set(n,t))}}function Mi(e,t,n){e.clear(),t.clear();for(const o of n){const{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=o,s={edgeId:o.id,source:n,target:r,sourceHandle:i,targetHandle:a},l=`${n}-${i}--${r}-${a}`;Ti("source",s,`${r}-${a}--${n}-${i}`,e,n,i),Ti("target",s,l,e,r,a),t.set(o.id,o)}}function Li(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return!!n&&(!!n.selected||Li(n,t))}function Di(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function Ii({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[e,i]of t){const t=n.get(e)?.internals.userNode;t&&r.push({...t,position:i.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function qi(e,t,n,o,r,i=!1){const a=o.get(e);if(!a)return null;const s="strict"===r?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?s?.find(e=>e.id===n):s?.[0])??null;return l&&i?{...l,..._i(a,l,l.position,!0)}:l}function Ri(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}const Bi=()=>!0;function $i(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:a,lib:s,flowId:l,isValidConnection:c=Bi,nodeLookup:u}){const d="target"===i,f=t?a.querySelector(`.${s}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:p}=si(e),g=a.elementFromPoint(h,p),y=g?.classList.contains(`${s}-flow__handle`)?g:f,m={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const e=Ri(void 0,y),t=y.getAttribute("data-nodeid"),i=y.getAttribute("data-handleid"),a=y.classList.contains("connectable"),s=y.classList.contains("connectableend");if(!t||!e)return m;const l={source:d?t:o,sourceHandle:d?i:r,target:d?o:t,targetHandle:d?r:i};m.connection=l;const f=a&&s&&(n===fr.Strict?d&&"source"===e||!d&&"target"===e:t!==o||i!==r);m.isValid=f&&c(l),m.toHandle=qi(t,e,i,u,n,!0)}return m}const zi={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:a,domNode:s,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:h,onConnectStart:p,onConnect:g,onConnectEnd:y,isValidConnection:m=Bi,onReconnectEnd:v,updateConnection:b,getTransform:w,getFromHandle:x,autoPanSpeed:_,dragThreshold:k=1,handleDomNode:E}){const C=oi(e.target);let N,S=0;const{x:O,y:j}=si(e),A=Ri(i,E),P=s?.getBoundingClientRect();let T=!1;if(!P||!A)return;const M=qi(r,A,o,l,t);if(!M)return;let L=si(e,P),D=!1,I=null,q=!1,R=null;function B(){if(!u||!P)return;const[e,t]=Tr(L,P,_);f({x:e,y:t}),S=requestAnimationFrame(B)}const $={...M,nodeId:r,type:A,position:M.position},z=l.get(r);let F={inProgress:!0,isValid:null,from:_i(z,$,br.Left,!0),fromHandle:$,fromPosition:$.position,fromNode:z,to:L,toHandle:null,toPosition:wr[$.position],toNode:null};function H(){T=!0,b(F),p?.(e,{nodeId:r,handleId:o,handleType:A})}function V(e){if(!T){const{x:t,y:n}=si(e),o=t-O,r=n-j;if(!(o*o+r*r>k*k))return;H()}if(!x()||!$)return void U(e);const i=w();L=si(e,P),N=function(e,t,n,o){let r=[],i=1/0;const a=function(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(const e of t.values())Br(r,Ir(e))>0&&o.push(e);return o}(e,n,t+250);for(const n of a){const a=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(const s of a){if(o.nodeId===s.nodeId&&o.type===s.type&&o.id===s.id)continue;const{x:a,y:l}=_i(n,s,s.position,!0),c=Math.sqrt(Math.pow(a-e.x,2)+Math.pow(l-e.y,2));c>t||(c<i?(r=[{...s,x:a,y:l}],i=c):c===i&&r.push({...s,x:a,y:l}))}}if(!r.length)return null;if(r.length>1){const e="source"===o.type?"target":"source";return r.find(t=>t.type===e)??r[0]}return r[0]}(Vr(L,i,!1,[1,1]),n,l,$),D||(B(),D=!0);const s=$i(e,{handle:N,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:a?"target":"source",isValidConnection:m,doc:C,lib:c,flowId:d,nodeLookup:l});R=s.handleDomNode,I=s.connection,q=function(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}(!!N,s.isValid);const u={...F,isValid:q,to:s.toHandle&&q?Ur({x:s.toHandle.x,y:s.toHandle.y},i):L,toHandle:s.toHandle,toPosition:q&&s.toHandle?s.toHandle.position:wr[$.position],toNode:s.toHandle?l.get(s.toHandle.nodeId):null};q&&N&&F.toHandle&&u.toHandle&&F.toHandle.type===u.toHandle.type&&F.toHandle.nodeId===u.toHandle.nodeId&&F.toHandle.id===u.toHandle.id&&F.to.x===u.to.x&&F.to.y===u.to.y||(b(u),F=u)}function U(e){if(T){(N||R)&&I&&q&&g?.(I);const{inProgress:t,...n}=F,o={...n,toPosition:F.toHandle?F.toPosition:null};y?.(e,o),i&&v?.(e,o)}h(),cancelAnimationFrame(S),D=!1,q=!1,I=null,R=null,C.removeEventListener("mousemove",V),C.removeEventListener("mouseup",U),C.removeEventListener("touchmove",V),C.removeEventListener("touchend",U)}0===k&&H(),C.addEventListener("mousemove",V),C.addEventListener("mouseup",U),C.addEventListener("touchmove",V),C.addEventListener("touchend",U)},isValid:$i},Fi=e=>({x:e.x,y:e.y,zoom:e.k}),Hi=({x:e,y:t,zoom:n})=>Qo.translate(e,t).scale(n),Vi=(e,t)=>e.target.closest(`.${t}`),Ui=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Zi=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ki=(e,t=0,n=Zi,o=()=>{})=>{const r="number"==typeof t&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Wi=e=>{const t=e.ctrlKey&&Wr()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};var Yi;function Xi(e,t){return Math.max(0,t-e)}function Gi(e,t){return Math.max(0,e-t)}function Qi(e,t,n){return Math.max(0,t-e,e-n)}function Ji(e,t){return e?!t:t}!function(e){e.Line="line",e.Handle="handle"}(Yi||(Yi={}));const ea={width:0,height:0,x:0,y:0},ta={...ea,pointerX:0,pointerY:0,aspectRatio:1};function na(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,s=n[0]*i,l=n[1]*a;return[[o-s,r-l],[o+i-s,r+a-l]]}function oa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var ra,ia,aa,sa={exports:{}},la={},ca={exports:{}},ua={};sa.exports=function(){if(aa)return la;aa=1;var e=r,t=(ia||(ia=1,ca.exports=function(){if(ra)return ua;ra=1;var e=r,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!t(e,o)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),l=n({inst:{value:r,getSnapshot:t}}),c=l[0].inst,u=l[1];return i(function(){c.value=r,c.getSnapshot=t,s(c)&&u({inst:c})},[e,r,t]),o(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),a(r),r};return ua.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,ua}()),ca.exports),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return la.useSyncExternalStoreWithSelector=function(e,t,r,c,u){var d=i(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!a){if(a=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,n(o,e))return t;var r=c(e);return void 0!==u&&u(t,r)?(o=e,t):(o=e,i=r)}var o,i,a=!1,s=void 0===r?null:r;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,r,c,u]);var h=o(e,d[0],d[1]);return a(function(){f.hasValue=!0,f.value=h},[h]),l(h),h},la}();var da=oa(sa.exports);const fa=e=>{let t;const n=new Set,o=(e,o)=>{const r="function"==typeof e?e(t):e;if(!Object.is(r,t)){const e=t;t=(null!=o?o:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,i={setState:o,getState:r,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(o,r,i);return i},{useDebugValue:ha}=r,{useSyncExternalStoreWithSelector:pa}=da,ga=e=>e;function ya(e,t=ga,n){const o=pa(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ha(o),o}const ma=(e,t)=>{const n=(e=>e?fa(e):fa)(e),o=(e,o=t)=>ya(n,e,o);return Object.assign(o,n),o};function va(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const ba=(0,r.createContext)(null),wa=ba.Provider,xa="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function _a(e,t){const n=(0,r.useContext)(ba);if(null===n)throw new Error(xa);return ya(n,e,t)}function ka(){const e=(0,r.useContext)(ba);if(null===e)throw new Error(xa);return(0,r.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Ea={display:"none"},Ca={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Na="react-flow__node-desc",Sa="react-flow__edge-desc",Oa=e=>e.ariaLiveMessage,ja=e=>e.ariaLabelConfig;function Aa({rfId:e}){const t=_a(Oa);return(0,o.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Ca,children:t})}function Pa({rfId:e,disableKeyboardA11y:t}){const n=_a(ja);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{id:`${Na}-${e}`,style:Ea,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,o.jsx)("div",{id:`${Sa}-${e}`,style:Ea,children:n["edge.a11yDescription.default"]}),!t&&(0,o.jsx)(Aa,{rfId:e})]})}const Ta=(0,r.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const s=`${e}`.split("-");return(0,o.jsx)("div",{className:be(["react-flow__panel",n,...s]),style:r,ref:a,...i,children:t})});function Ma({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,o.jsx)(Ta,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:(0,o.jsx)("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}Ta.displayName="Panel";const La=e=>{const t=[],n=[];for(const[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(const[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Da=e=>e.id;function Ia(e,t){return va(e.selectedNodes.map(Da),t.selectedNodes.map(Da))&&va(e.selectedEdges.map(Da),t.selectedEdges.map(Da))}function qa({onSelectionChange:e}){const t=ka(),{selectedNodes:n,selectedEdges:o}=_a(La,Ia);return(0,r.useEffect)(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(e=>e(r))},[n,o,e]),null}const Ra=e=>!!e.onSelectionChangeHandlers;function Ba({onSelectionChange:e}){const t=_a(Ra);return e||t?(0,o.jsx)(qa,{onSelectionChange:e}):null}const $a=[0,0],za={x:0,y:0,zoom:1},Fa=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig","rfId"],Ha=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),Va={translateExtent:cr,nodeOrigin:$a,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Ua(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:c,setPaneClickDistance:u}=_a(Ha,va),d=ka();(0,r.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{f.current=Va,l()}),[]);const f=(0,r.useRef)(Va);return(0,r.useEffect)(()=>{for(const r of Fa){const l=e[r];l!==f.current[r]&&void 0!==e[r]&&("nodes"===r?t(l):"edges"===r?n(l):"minZoom"===r?o(l):"maxZoom"===r?i(l):"translateExtent"===r?a(l):"nodeExtent"===r?s(l):"paneClickDistance"===r?u(l):"ariaLabelConfig"===r?d.setState({ariaLabelConfig:ei(l)}):"fitView"===r?d.setState({fitViewQueued:l}):"fitViewOptions"===r?d.setState({fitViewOptions:l}):d.setState({[r]:l}))}f.current=e},Fa.map(t=>e[t])),null}function Za(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}const Ka="undefined"!=typeof document?document:null;function Wa(e=null,t={target:Ka,actInsideInputWithModifier:!0}){const[n,o]=(0,r.useState)(!1),i=(0,r.useRef)(!1),a=(0,r.useRef)(new Set([])),[s,l]=(0,r.useMemo)(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,r.useEffect)(()=>{const n=t?.target??Ka,r=t?.actInsideInputWithModifier??!0;if(null!==e){const e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!r)&&ii(e))return!1;const n=Xa(e.code,l);if(a.current.add(e[n]),Ya(s,a.current,!1)){const n=e.composedPath?.()?.[0]||e.target,r="BUTTON"===n?.nodeName||"A"===n?.nodeName;!1===t.preventDefault||!i.current&&r||e.preventDefault(),o(!0)}},c=e=>{const t=Xa(e.code,l);Ya(s,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),o(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,o]),n}function Ya(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Xa(e,t){return t.includes(e)?"code":"key"}function Ga(e,t){const n=[],o=new Map,r=[];for(const t of e)if("add"!==t.type)if("remove"===t.type||"replace"===t.type)o.set(t.id,[t]);else{const e=o.get(t.id);e?e.push(t):o.set(t.id,[t])}else r.push(t);for(const e of t){const t=o.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}const r={...e};for(const e of t)Qa(e,r);n.push(r)}return r.length&&r.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function Qa(e,t){switch(e.type){case"select":t.selected=e.selected;break;case"position":void 0!==e.position&&(t.position=e.position),void 0!==e.dragging&&(t.dragging=e.dragging);break;case"dimensions":void 0!==e.dimensions&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(!0!==e.setAttributes&&"width"!==e.setAttributes||(t.width=e.dimensions.width),!0!==e.setAttributes&&"height"!==e.setAttributes||(t.height=e.dimensions.height))),"boolean"==typeof e.resizing&&(t.resizing=e.resizing)}}function Ja(e,t){return Ga(e,t)}function es(e,t){return Ga(e,t)}function ts(e,t){return{id:e,type:"select",selected:t}}function ns(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const e=t.has(r);void 0===i.selected&&!e||i.selected===e||(n&&(i.selected=e),o.push(ts(i.id,e)))}return o}function os({items:e=[],lookup:t}){const n=[],o=new Map(e.map(e=>[e.id,e]));for(const[o,r]of e.entries()){const e=t.get(r.id),i=e?.internals?.userNode??e;void 0!==i&&i!==r&&n.push({id:r.id,item:r,type:"replace"}),void 0===i&&n.push({item:r,type:"add",index:o})}for(const[e]of t)void 0===o.get(e)&&n.push({id:e,type:"remove"});return n}function rs(e){return{id:e.id,type:"remove"}}const is=e=>(e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e))(e);function as(e){return(0,r.forwardRef)(e)}const ss="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function ls(e){const[t,n]=(0,r.useState)(BigInt(0)),[o]=(0,r.useState)(()=>function(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}(()=>n(e=>e+BigInt(1))));return ss(()=>{const t=o.get();t.length&&(e(t),o.reset())},[t]),o}const cs=(0,r.createContext)(null);function us({children:e}){const t=ka(),n=ls((0,r.useCallback)(e=>{const{nodes:n=[],setNodes:o,hasDefaultNodes:r,onNodesChange:i,nodeLookup:a,fitViewQueued:s}=t.getState();let l=n;for(const t of e)l="function"==typeof t?t(l):t;const c=os({items:l,lookup:a});r&&o(l),c.length>0?i?.(c):s&&window.requestAnimationFrame(()=>{const{fitViewQueued:e,nodes:n,setNodes:o}=t.getState();e&&o(n)})},[])),i=ls((0,r.useCallback)(e=>{const{edges:n=[],setEdges:o,hasDefaultEdges:r,onEdgesChange:i,edgeLookup:a}=t.getState();let s=n;for(const t of e)s="function"==typeof t?t(s):t;r?o(s):i&&i(os({items:s,lookup:a}))},[])),a=(0,r.useMemo)(()=>({nodeQueue:n,edgeQueue:i}),[]);return(0,o.jsx)(cs.Provider,{value:a,children:e})}const ds=e=>!!e.panZoom;function fs(){const e=(()=>{const e=ka();return(0,r.useMemo)(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:a,panZoom:s}=e.getState(),l=Kr(t,o,r,i,a,n?.padding??.1);return s?(await s.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:s,y:l}=a.getBoundingClientRect(),c={x:t.x-s,y:t.y-l},u=n.snapGrid??r,d=n.snapToGrid??i;return Vr(c,o,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),a=Ur(t,n);return{x:a.x+r,y:a.y+i}}}),[])})(),t=ka(),n=function(){const e=(0,r.useContext)(cs);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),o=_a(ds),i=(0,r.useMemo)(()=>{const e=e=>t.getState().nodeLookup.get(e),o=e=>{n.nodeQueue.push(e)},r=e=>{n.edgeQueue.push(e)},i=e=>{const{nodeLookup:n,nodeOrigin:o}=t.getState(),r=is(e)?e:n.get(e.id),i=r.parentId?Qr(r.position,r.measured,r.parentId,n,o):r.position,a={...r,position:i,width:r.measured?.width??r.width,height:r.measured?.height??r.height};return Ir(a)},a=(e,t,n={replace:!1})=>{o(o=>o.map(o=>{if(o.id===e){const e="function"==typeof t?t(o):t;return n.replace&&is(e)?e:{...o,...e}}return o}))},s=(e,t,n={replace:!1})=>{r(o=>o.map(o=>{if(o.id===e){const e="function"==typeof t?t(o):t;return n.replace&&_r(e)?e:{...o,...e}}return o}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:o,setEdges:r,addNodes:e=>{const t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{const t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{const{nodes:e=[],edges:n=[],transform:o}=t.getState(),[r,i,a]=o;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:r,y:i,zoom:a}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{const{nodes:o,edges:r,onNodesDelete:i,onEdgesDelete:a,triggerNodeChanges:s,triggerEdgeChanges:l,onDelete:c,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await async function({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(e=>e.id)),a=[];for(const e of n){if(!1===e.deletable)continue;const t=i.has(e.id),n=!t&&e.parentId&&a.find(t=>t.id===e.parentId);(t||n)&&a.push(e)}const s=new Set(t.map(e=>e.id)),l=o.filter(e=>!1!==e.deletable),c=((e,t)=>{const n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))})(a,l),u=c;for(const e of l)s.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!r)return{edges:u,nodes:a};const d=await r({nodes:a,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:a}:{edges:[],nodes:[]}:d}({nodesToRemove:e,edgesToRemove:n,nodes:o,edges:r,onBeforeDelete:u}),h=f.length>0,p=d.length>0;if(h){const e=f.map(rs);a?.(f),l(e)}if(p){const e=d.map(rs);i?.(d),s(e)}return(p||h)&&c?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,o)=>{const r=$r(e),a=r?e:i(e),s=void 0!==o;return a?(o||t.getState().nodes).filter(o=>{const i=t.getState().nodeLookup.get(o.id);if(i&&!r&&(o.id===e.id||!i.internals.positionAbsolute))return!1;const l=Ir(s?o:i),c=Br(l,a);return n&&c>0||c>=l.width*l.height||c>=a.width*a.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{const o=$r(e)?e:i(e);if(!o)return!1;const r=Br(o,t);return n&&r>0||r>=o.width*o.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,e=>{const o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{const o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},getNodesBounds:e=>{const{nodeLookup:n,nodeOrigin:o}=t.getState();return((e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const o="string"==typeof n;let r=t.nodeLookup||o?void 0:n;t.nodeLookup&&(r=o?t.nodeLookup.get(n):kr(n)?n:t.nodeLookup.get(n.id));const i=r?qr(r,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Mr(e,i)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Dr(n)})(e,{nodeLookup:n,nodeOrigin:o})},getHandleConnections:({type:e,id:n,nodeId:o})=>Array.from(t.getState().connectionLookup.get(`${o}-${e}${n?`-${n}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:o})=>Array.from(t.getState().connectionLookup.get(`${o}${e?n?`-${e}-${n}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{const o=t.getState().fitViewResolver??function(){let e,t;return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:o}),n.nodeQueue.push(e=>[...e]),o.promise}}},[]);return(0,r.useMemo)(()=>({...i,...e,viewportInitialized:o}),[o])}const hs=e=>e.selected,ps="undefined"!=typeof window?window:void 0,gs={position:"absolute",width:"100%",height:"100%",top:0,left:0},ys=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function ms({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:s=hr.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:u,translateExtent:d,minZoom:f,maxZoom:h,zoomActivationKeyCode:p,preventScrolling:g=!0,children:y,noWheelClassName:m,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:x}){const _=ka(),k=(0,r.useRef)(null),{userSelectionActive:E,lib:C}=_a(ys,va),N=Wa(p),S=(0,r.useRef)();!function(e){const t=ka();(0,r.useEffect)(()=>{const n=()=>{if(!e.current)return!1;const n=ni(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004","The React Flow parent container needs a width and a height to render the graph."),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener("resize",n);const t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener("resize",n),t&&e.current&&t.unobserve(e.current)}}},[])}(k);const O=(0,r.useCallback)(e=>{b?.({x:e[0],y:e[1],zoom:e[2]}),w||_.setState({transform:e})},[b,w]);return(0,r.useEffect)(()=>{if(k.current){S.current=function({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:o,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=lr().clickDistance(!zr(o)||o<0?0:o).scaleExtent([t,n]).translateExtent(r),h=It(e).call(f);v({x:i.x,y:i.y,zoom:Or(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),g=h.on("dblclick.zoom");function y(e,t){return h?new Promise(n=>{f?.interpolate("linear"===t?.interpolate?Hn:eo).transform(Ki(h,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function m(){f.on("zoom",null)}async function v(e,t,n){const o=Hi(e),r=f?.constrain()(o,t,n);return r&&await y(r),new Promise(e=>e(r))}return f.wheelDelta(Wi),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:o,panOnScroll:r,panOnDrag:i,panOnScrollMode:d,panOnScrollSpeed:y,preventScrolling:v,zoomOnPinch:b,zoomOnScroll:w,zoomOnDoubleClick:x,zoomActivationKeyPressed:_,lib:k,onTransformChange:E}){o&&!u.isZoomingOrPanning&&m();const C=!r||_||o?function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i="wheel"===o.type,a=!t&&i&&!o.ctrlKey,s=Vi(o,e);if(o.ctrlKey&&i&&s&&o.preventDefault(),a||s)return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p}):function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:s,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Vi(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&a){const e=qt(u),t=Wi(u),r=d*Math.pow(2,t);return void o.scaleTo(n,r,e,u)}const f=1===u.deltaMode?20:1;let h=r===hr.Vertical?0:u.deltaX*f,p=r===hr.Horizontal?0:u.deltaY*f;!Wr()&&u.shiftKey&&r!==hr.Vertical&&(h=u.deltaY*f,p=0),o.translateBy(n,-h/d*i,-p/d*i,{internal:!0});const g=Fi(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,s?.(u,g)),e.isPanScrolling&&(l?.(u,g),e.panScrollTimeout=setTimeout(()=>{c?.(u,g),e.isPanScrolling=!1},150))}}({zoomPanValues:u,noWheelClassName:e,d3Selection:h,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:y,zoomOnPinch:b,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:l});if(h.on("wheel.zoom",C,{passive:!1}),!o){const e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=Fi(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,"mousedown"===o.sourceEvent?.type&&t(!0),n&&n?.(o.sourceEvent,r)}}({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:s});f.on("start",e);const t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!(!n||!Ui(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Fi(i.transform))}}({zoomPanValues:u,panOnDrag:i,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:E});f.on("zoom",t);const o=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{var s,l;if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Ui(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,o(!1),r&&(s=e.prevViewport,l=a.transform,s.x!==l.x||s.y!==l.y||s.zoom!==l.k))){const t=Fi(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(a.sourceEvent,t)},n?150:0)}}}({zoomPanValues:u,panOnDrag:i,panOnScroll:r,onPaneContextMenu:n,onPanZoomEnd:l,onDraggingChange:c});f.on("end",o)}const N=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:l,lib:c}){return u=>{const d=e||t,f=n&&u.ctrlKey;if(1===u.button&&"mousedown"===u.type&&(Vi(u,`${c}-flow__node`)||Vi(u,`${c}-flow__edge`)))return!0;if(!(o||d||r||i||n))return!1;if(a)return!1;if(Vi(u,s)&&"wheel"===u.type)return!1;if(Vi(u,l)&&("wheel"!==u.type||r&&"wheel"===u.type&&!e))return!1;if(!n&&u.ctrlKey&&"wheel"===u.type)return!1;if(!n&&"touchstart"===u.type&&u.touches?.length>1)return u.preventDefault(),!1;if(!d&&!r&&!f&&"wheel"===u.type)return!1;if(!o&&("mousedown"===u.type||"touchstart"===u.type))return!1;if(Array.isArray(o)&&!o.includes(u.button)&&"mousedown"===u.type)return!1;const h=Array.isArray(o)&&o.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||"wheel"===u.type)&&h}}({zoomActivationKeyPressed:_,panOnDrag:i,zoomOnScroll:w,panOnScroll:r,zoomOnDoubleClick:x,zoomOnPinch:b,userSelectionActive:o,noPanClassName:t,noWheelClassName:e,lib:k});f.filter(N),x?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)},destroy:m,setViewport:async function(e,t){const n=Hi(e);return await y(n,t),new Promise(e=>e(n))},setViewportConstrained:v,getViewport:function(){const e=h?Jo(h.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return h?new Promise(n=>{f?.interpolate("linear"===t?.interpolate?Hn:eo).scaleTo(Ki(h,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return h?new Promise(n=>{f?.interpolate("linear"===t?.interpolate?Hn:eo).scaleBy(Ki(h,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){f?.scaleExtent(e)},setTranslateExtent:function(e){f?.translateExtent(e)},syncViewport:function(e){if(h){const t=Hi(e),n=h.property("__zoom");n.k===e.zoom&&n.x===e.x&&n.y===e.y||f?.transform(h,t,null,{sync:!0})}},setClickDistance:function(e){const t=!zr(e)||e<0?0:e;f?.clickDistance(t)}}}({domNode:k.current,minZoom:f,maxZoom:h,translateExtent:d,viewport:u,paneClickDistance:x,onDraggingChange:e=>_.setState({paneDragging:e}),onPanZoomStart:(e,t)=>{const{onViewportChangeStart:n,onMoveStart:o}=_.getState();o?.(e,t),n?.(t)},onPanZoom:(e,t)=>{const{onViewportChange:n,onMove:o}=_.getState();o?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{const{onViewportChangeEnd:n,onMoveEnd:o}=_.getState();o?.(e,t),n?.(t)}});const{x:e,y:t,zoom:n}=S.current.getViewport();return _.setState({panZoom:S.current,transform:[e,t,n],domNode:k.current.closest(".react-flow")}),()=>{S.current?.destroy()}}},[]),(0,r.useEffect)(()=>{S.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:a,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:N,preventScrolling:g,noPanClassName:v,userSelectionActive:E,noWheelClassName:m,lib:C,onTransformChange:O})},[e,t,n,i,a,s,l,c,N,g,v,E,m,C,O]),(0,o.jsx)("div",{className:"react-flow__renderer",ref:k,style:gs,children:y})}const vs=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function bs(){const{userSelectionActive:e,userSelectionRect:t}=_a(vs,va);return e&&t?(0,o.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const ws=(e,t)=>n=>{n.target===t.current&&e?.(n)},xs=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function _s({isSelecting:e,selectionKeyPressed:t,selectionMode:n=pr.Full,panOnDrag:i,selectionOnDrag:a,onSelectionStart:s,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:p,children:g}){const y=ka(),{userSelectionActive:m,elementsSelectable:v,dragging:b,connectionInProgress:w}=_a(xs,va),x=v&&(e||m),_=(0,r.useRef)(null),k=(0,r.useRef)(),E=(0,r.useRef)(new Set),C=(0,r.useRef)(new Set),N=(0,r.useRef)(!1),S=(0,r.useRef)(!1),O=e=>{N.current||w?N.current=!1:(c?.(e),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1}))},j=d?e=>d(e):void 0,A=!0===i||Array.isArray(i)&&i.includes(0);return(0,o.jsxs)("div",{className:be(["react-flow__pane",{draggable:A,dragging:b,selection:e}]),onClick:x?void 0:ws(O,_),onContextMenu:ws(e=>{Array.isArray(i)&&i?.includes(2)?e.preventDefault():u?.(e)},_),onWheel:ws(j,_),onPointerEnter:x?void 0:f,onPointerDown:x?t=>{const{resetSelectedElements:n,domNode:o}=y.getState();if(k.current=o?.getBoundingClientRect(),!v||!e||0!==t.button||t.target!==_.current||!k.current)return;t.target?.setPointerCapture?.(t.pointerId),S.current=!0,N.current=!1;const{x:r,y:i}=si(t.nativeEvent,k.current);n(),y.setState({userSelectionRect:{width:0,height:0,startX:r,startY:i,x:r,y:i}}),s?.(t)}:h,onPointerMove:x?e=>{const{userSelectionRect:t,transform:o,nodeLookup:r,edgeLookup:i,connectionLookup:a,triggerNodeChanges:s,triggerEdgeChanges:l,defaultEdgeOptions:c}=y.getState();if(!k.current||!t)return;N.current=!0;const{x:u,y:d}=si(e.nativeEvent,k.current),{startX:f,startY:h}=t,p={startX:f,startY:h,x:u<f?u:f,y:d<h?d:h,width:Math.abs(u-f),height:Math.abs(d-h)},g=E.current,m=C.current;E.current=new Set(Nr(r,p,o,n===pr.Partial,!0).map(e=>e.id)),C.current=new Set;const v=c?.selectable??!0;for(const e of E.current){const t=a.get(e);if(t)for(const{edgeId:e}of t.values()){const t=i.get(e);t&&(t.selectable??v)&&C.current.add(e)}}Jr(g,E.current)||s(ns(r,E.current,!0)),Jr(m,C.current)||l(ns(i,C.current)),y.setState({userSelectionRect:p,userSelectionActive:!0,nodesSelectionActive:!1})}:h,onPointerUp:x?e=>{if(0!==e.button||!S.current)return;e.target?.releasePointerCapture?.(e.pointerId);const{userSelectionRect:n}=y.getState();!m&&n&&e.target===_.current&&O?.(e),y.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:E.current.size>0}),l?.(e),(t||a)&&(N.current=!1),S.current=!1}:void 0,onPointerLeave:p,ref:_,style:gs,children:[g,(0,o.jsx)(bs,{})]})}function ks({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])):l?.("012",(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`)(e))}function Es({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:i,isSelectable:a,nodeClickDistance:s}){const l=ka(),[c,u]=(0,r.useState)(!1),d=(0,r.useRef)();return(0,r.useEffect)(()=>{d.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},a=0,s=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,h=!1,p=!1,g=null;return{update:function({noDragClassName:y,handleSelector:m,domNode:v,isSelectable:b,nodeId:w,nodeClickDistance:x=0}){function _({x:e,y:n}){const{nodeLookup:r,nodeExtent:a,snapGrid:l,snapToGrid:c,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:h,updateNodePositions:y}=t();i={x:e,y:n};let m=!1;const v=s.size>1,b=v&&a?Lr(Cr(s)):null,x=v&&c?function({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},a=Hr(i,t);return{x:a.x-i.x,y:a.y-i.y}}({dragItems:s,snapGrid:l,x:e,y:n}):null;for(const[t,o]of s){if(!r.has(t))continue;let i={x:e-o.distance.x,y:n-o.distance.y};c&&(i=x?{x:Math.round(i.x+x.x),y:Math.round(i.y+x.y)}:Hr(i,l));let s=null;if(v&&a&&!o.extent&&b){const{positionAbsolute:e}=o.internals,t=e.x-b.x+a[0][0],n=e.x+o.measured.width-b.x2+a[1][0];s=[[t,e.y-b.y+a[0][1]],[n,e.y+o.measured.height-b.y2+a[1][1]]]}const{position:d,positionAbsolute:f}=Sr({nodeId:t,nextPosition:i,nodeLookup:r,nodeExtent:s||a,nodeOrigin:u,onError:h});m=m||o.position.x!==d.x||o.position.y!==d.y,o.position=d,o.internals.positionAbsolute=f}if(p=p||m,m&&(y(s,!0),g&&(o||d||!w&&f))){const[e,t]=Ii({nodeId:w,dragItems:s,nodeLookup:r});o?.(g,s,e,t),d?.(g,e,t),w||f?.(g,t)}}async function k(){if(!u)return;const{transform:e,panBy:n,autoPanSpeed:o,autoPanOnNodeDrag:r}=t();if(!r)return l=!1,void cancelAnimationFrame(a);const[s,d]=Tr(c,u,o);0===s&&0===d||(i.x=(i.x??0)-s/e[2],i.y=(i.y??0)-d/e[2],await n({x:s,y:d})&&_(i)),a=requestAnimationFrame(k)}function E(o){const{nodeLookup:r,multiSelectionActive:a,nodesDraggable:l,transform:c,snapGrid:f,snapToGrid:h,selectNodesOnDrag:p,onNodeDragStart:g,onSelectionDragStart:y,unselectNodesAndEdges:m}=t();d=!0,p&&b||a||!w||r.get(w)?.selected||m(),b&&p&&w&&e?.(w);const v=ti(o.sourceEvent,{transform:c,snapGrid:f,snapToGrid:h,containerBounds:u});if(i=v,s=function(e,t,n,o){const r=new Map;for(const[i,a]of e)if((a.selected||a.id===o)&&(!a.parentId||!Li(a,e))&&(a.draggable||t&&void 0===a.draggable)){const t=e.get(i);t&&r.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return r}(r,l,v,w),s.size>0&&(n||g||!w&&y)){const[e,t]=Ii({nodeId:w,dragItems:s,nodeLookup:r});n?.(o.sourceEvent,s,e,t),g?.(o.sourceEvent,e,t),w||y?.(o.sourceEvent,t)}}f=It(v);const C=Xt().clickDistance(x).on("start",e=>{const{domNode:n,nodeDragThreshold:o,transform:r,snapGrid:a,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,h=!1,p=!1,g=e.sourceEvent,0===o&&E(e);const l=ti(e.sourceEvent,{transform:r,snapGrid:a,snapToGrid:s,containerBounds:u});i=l,c=si(e.sourceEvent,u)}).on("drag",e=>{const{autoPanOnNodeDrag:n,transform:o,snapGrid:r,snapToGrid:a,nodeDragThreshold:f,nodeLookup:p}=t(),y=ti(e.sourceEvent,{transform:o,snapGrid:r,snapToGrid:a,containerBounds:u});if(g=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||w&&!p.has(w))&&(h=!0),!h){if(!l&&n&&d&&(l=!0,k()),!d){const t=y.xSnapped-(i.x??0),n=y.ySnapped-(i.y??0);Math.sqrt(t*t+n*n)>f&&E(e)}(i.x!==y.xSnapped||i.y!==y.ySnapped)&&s&&d&&(c=si(e.sourceEvent,u),_(y))}}).on("end",e=>{if(d&&!h&&(l=!1,d=!1,cancelAnimationFrame(a),s.size>0)){const{nodeLookup:n,updateNodePositions:o,onNodeDragStop:i,onSelectionDragStop:a}=t();if(p&&(o(s,!1),p=!1),r||i||!w&&a){const[t,o]=Ii({nodeId:w,dragItems:s,nodeLookup:n,dragging:!1});r?.(e.sourceEvent,s,t,o),i?.(e.sourceEvent,t,o),w||a?.(e.sourceEvent,o)}}}).filter(e=>{const t=e.target;return!e.button&&(!y||!Di(t,`.${y}`,v))&&(!m||Di(t,m,v))});f.call(C)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{ks({id:t,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),(0,r.useEffect)(()=>{if(t)d.current?.destroy();else if(e.current)return d.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:s}),()=>{d.current?.destroy()}},[n,o,t,a,e,i]),c}function Cs(){const e=ka();return(0,r.useCallback)(t=>{const{nodeExtent:n,snapToGrid:o,snapGrid:r,nodesDraggable:i,onError:a,updateNodePositions:s,nodeLookup:l,nodeOrigin:c}=e.getState(),u=new Map,d=(e=>t=>t.selected&&(t.draggable||e&&void 0===t.draggable))(i),f=o?r[0]:5,h=o?r[1]:5,p=t.direction.x*f*t.factor,g=t.direction.y*h*t.factor;for(const[,e]of l){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+g};o&&(t=Hr(t,r));const{position:i,positionAbsolute:s}=Sr({nodeId:e.id,nextPosition:t,nodeLookup:l,nodeExtent:n,nodeOrigin:c,onError:a});e.position=i,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}const Ns=(0,r.createContext)(null),Ss=Ns.Provider;Ns.Consumer;const Os=()=>(0,r.useContext)(Ns),js=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),As=(0,r.memo)(as(function({type:e="source",position:t=br.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:s,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){const g=s||null,y="target"===e,m=ka(),v=Os(),{connectOnClick:b,noPanClassName:w,rfId:x}=_a(js,va),{connectingFrom:_,connectingTo:k,clickConnecting:E,isPossibleEndHandle:C,connectionInProcess:N,clickConnectionInProcess:S,valid:O}=_a(((e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:a}=o,{fromHandle:s,toHandle:l,isValid:c}=a,u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===fr.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!r,valid:u&&c}})(v,g,e),va);v||m.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");const j=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=m.getState(),r={...t,...e};if(o){const{edges:e,setEdges:t}=m.getState();t(((e,t)=>{if(!e.source||!e.target)return t;let n;return n=_r(e)?{...e}:{...e,id:gi(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(n,t)?t:(null===n.sourceHandle&&delete n.sourceHandle,null===n.targetHandle&&delete n.targetHandle,t.concat(n))})(r,e))}n?.(r),l?.(r)},A=e=>{if(!v)return;const t=ai(e.nativeEvent);if(i&&(t&&0===e.button||!t)){const t=m.getState();zi.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:y,handleId:g,nodeId:v,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:j,isValidConnection:n||t.isValidConnection,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?d?.(e):f?.(e)};return(0,o.jsx)("div",{"data-handleid":g,"data-nodeid":v,"data-handlepos":t,"data-id":`${x}-${v}-${g}-${e}`,className:be(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,u,{source:!y,target:y,connectable:r,connectablestart:i,connectableend:a,clickconnecting:E,connectingfrom:_,connectingto:k,valid:O,connectionindicator:r&&(!N||C)&&(N||S?a:i)}]),onMouseDown:A,onTouchStart:A,onClick:b?t=>{const{onClickConnectStart:o,onClickConnectEnd:r,connectionClickStartHandle:a,connectionMode:s,isValidConnection:l,lib:c,rfId:u,nodeLookup:d,connection:f}=m.getState();if(!v||!a&&!i)return;if(!a)return o?.(t.nativeEvent,{nodeId:v,handleId:g,handleType:e}),void m.setState({connectionClickStartHandle:{nodeId:v,type:e,id:g}});const h=oi(t.target),p=n||l,{connection:y,isValid:b}=zi.isValid(t.nativeEvent,{handle:{nodeId:v,id:g,type:e},connectionMode:s,fromNodeId:a.nodeId,fromHandleId:a.id||null,fromType:a.type,isValidConnection:p,flowId:u,doc:h,lib:c,nodeLookup:d});b&&y&&j(y);const w=structuredClone(f);delete w.inProgress,w.toPosition=w.toHandle?w.toHandle.position:null,r?.(t,w),m.setState({connectionClickStartHandle:null})}:void 0,ref:p,...h,children:c})})),Ps={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ts={input:function({data:e,isConnectable:t,sourcePosition:n=br.Bottom}){return(0,o.jsxs)(o.Fragment,{children:[e?.label,(0,o.jsx)(As,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=br.Top,sourcePosition:r=br.Bottom}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(As,{type:"target",position:n,isConnectable:t}),e?.label,(0,o.jsx)(As,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=br.Top}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(As,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},Ms=e=>{const{width:t,height:n,x:o,y:r}=Cr(e.nodeLookup,{filter:e=>!!e.selected});return{width:zr(t)?t:null,height:zr(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function Ls({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=ka(),{width:a,height:s,transformString:l,userSelectionActive:c}=_a(Ms,va),u=Cs(),d=(0,r.useRef)(null);if((0,r.useEffect)(()=>{n||d.current?.focus({preventScroll:!0})},[n]),Es({nodeRef:d}),c||!a||!s)return null;const f=e?t=>{const n=i.getState().nodes.filter(e=>e.selected);e(t,n)}:void 0;return(0,o.jsx)("div",{className:be(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:(0,o.jsx)("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Ps,e.key)&&(e.preventDefault(),u({direction:Ps[e.key],factor:e.shiftKey?4:1}))},style:{width:a,height:s}})})}const Ds="undefined"!=typeof window?window:void 0,Is=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function qs({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:m,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:_,panOnScrollSpeed:k,panOnScrollMode:E,zoomOnDoubleClick:C,panOnDrag:N,defaultViewport:S,translateExtent:O,minZoom:j,maxZoom:A,preventScrolling:P,onSelectionContextMenu:T,noWheelClassName:M,noPanClassName:L,disableKeyboardA11y:D,onViewportChange:I,isControlledViewport:q}){const{nodesSelectionActive:R,userSelectionActive:B}=_a(Is),$=Wa(d,{target:Ds}),z=Wa(m,{target:Ds}),F=z||N,H=z||_,V=f&&!0!==F,U=$||B||V;return function({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ka(),{deleteElements:o}=fs(),i=Wa(e,{actInsideInputWithModifier:!1}),a=Wa(t,{target:ps});(0,r.useEffect)(()=>{if(i){const{edges:e,nodes:t}=n.getState();o({nodes:t.filter(hs),edges:e.filter(hs)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,r.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}({deleteKeyCode:u,multiSelectionKeyCode:y}),(0,o.jsx)(ms,{onPaneContextMenu:s,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:H,panOnScrollSpeed:k,panOnScrollMode:E,zoomOnDoubleClick:C,panOnDrag:!$&&F,defaultViewport:S,translateExtent:O,minZoom:j,maxZoom:A,zoomActivationKeyCode:v,preventScrolling:P,noWheelClassName:M,noPanClassName:L,onViewportChange:I,isControlledViewport:q,paneClickDistance:c,children:(0,o.jsxs)(_s,{onSelectionStart:p,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:F,isSelecting:!!U,selectionMode:h,selectionKeyPressed:$,selectionOnDrag:V,children:[e,R&&(0,o.jsx)(Ls,{onSelectionContextMenu:T,noPanClassName:L,disableKeyboardA11y:D})]})})}qs.displayName="FlowRenderer";const Rs=(0,r.memo)(qs),Bs=e=>e.updateNodeInternals;function $s({id:e,onClick:t,onMouseEnter:n,onMouseMove:i,onMouseLeave:a,onContextMenu:s,onDoubleClick:l,nodesDraggable:c,elementsSelectable:u,nodesConnectable:d,nodesFocusable:f,resizeObserver:h,noDragClassName:p,noPanClassName:g,disableKeyboardA11y:y,rfId:m,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:x,internals:_,isParent:k}=_a(t=>{const n=t.nodeLookup.get(e),o=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:o}},va);let E=x.type||"default",C=v?.[E]||Ts[E];void 0===C&&(w?.("003",(e=>`Node type "${e}" not found. Using fallback type "default".`)(E)),E="default",C=v?.default||Ts.default);const N=!!(x.draggable||c&&void 0===x.draggable),S=!!(x.selectable||u&&void 0===x.selectable),O=!!(x.connectable||d&&void 0===x.connectable),j=!!(x.focusable||f&&void 0===x.focusable),A=ka(),P=Gr(x),T=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const i=ka(),a=(0,r.useRef)(null),s=(0,r.useRef)(null),l=(0,r.useRef)(e.sourcePosition),c=(0,r.useRef)(e.targetPosition),u=(0,r.useRef)(t),d=n&&!!e.internals.handleBounds;return(0,r.useEffect)(()=>{!a.current||e.hidden||d&&s.current===a.current||(s.current&&o?.unobserve(s.current),o?.observe(a.current),s.current=a.current)},[d,e.hidden]),(0,r.useEffect)(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),(0,r.useEffect)(()=>{if(a.current){const n=u.current!==t,o=l.current!==e.sourcePosition,r=c.current!==e.targetPosition;(n||o||r)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}({node:x,nodeType:E,hasDimensions:P,resizeObserver:h}),M=Es({nodeRef:T,disabled:x.hidden||!N,noDragClassName:p,handleSelector:x.dragHandle,nodeId:e,isSelectable:S,nodeClickDistance:b}),L=Cs();if(x.hidden)return null;const D=Xr(x),I=function(e){return void 0===e.internals.handleBounds?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}(x),q=S||N||t||n||i||a,R=n?e=>n(e,{..._.userNode}):void 0,B=i?e=>i(e,{..._.userNode}):void 0,$=a?e=>a(e,{..._.userNode}):void 0,z=s?e=>s(e,{..._.userNode}):void 0,F=l?e=>l(e,{..._.userNode}):void 0;return(0,o.jsx)("div",{className:be(["react-flow__node",`react-flow__node-${E}`,{[g]:N},x.className,{selected:x.selected,selectable:S,parent:k,draggable:N,dragging:M}]),ref:T,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:P?"visible":"hidden",...x.style,...I},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:B,onMouseLeave:$,onContextMenu:z,onClick:n=>{const{selectNodesOnDrag:o,nodeDragThreshold:r}=A.getState();S&&(!o||!N||r>0)&&ks({id:e,store:A,nodeRef:T}),t&&t(n,{..._.userNode})},onDoubleClick:F,onKeyDown:j?t=>{if(!ii(t.nativeEvent)&&!y)if(ur.includes(t.key)&&S){const n="Escape"===t.key;ks({id:e,store:A,unselect:n,nodeRef:T})}else if(N&&x.selected&&Object.prototype.hasOwnProperty.call(Ps,t.key)){t.preventDefault();const{ariaLabelConfig:e}=A.getState();A.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),L({direction:Ps[t.key],factor:t.shiftKey?4:1})}}:void 0,tabIndex:j?0:void 0,onFocus:j?()=>{if(y||!T.current?.matches(":focus-visible"))return;const{transform:t,width:n,height:o,autoPanOnNodeFocus:r,setCenter:i}=A.getState();r&&(Nr(new Map([[e,x]]),{x:0,y:0,width:n,height:o},t,!0).length>0||i(x.position.x+D.width/2,x.position.y+D.height/2,{zoom:t[2]}))}:void 0,role:x.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Na}-${m}`,"aria-label":x.ariaLabel,...x.domAttributes,children:(0,o.jsx)(Ss,{value:e,children:(0,o.jsx)(C,{id:e,data:x.data,type:E,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:x.selected??!1,selectable:S,draggable:N,deletable:x.deletable??!0,isConnectable:O,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:M,dragHandle:x.dragHandle,zIndex:_.z,parentId:x.parentId,...D})})})}const zs=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Fs(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:a,onError:s}=_a(zs,va),l=function(e){return _a((0,r.useCallback)((e=>t=>e?Nr(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys()))(e),[e]),va)}(e.onlyRenderVisibleElements),c=function(){const e=_a(Bs),[t]=(0,r.useState)(()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver(t=>{const n=new Map;t.forEach(e=>{const t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,r.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,o.jsx)("div",{className:"react-flow__nodes",style:gs,children:l.map(r=>(0,o.jsx)($s,{id:r,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:s},r))})}Fs.displayName="NodeRenderer";const Hs=(0,r.memo)(Fs),Vs={[vr.Arrow]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return(0,o.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[vr.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,o.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},Us=({id:e,type:t,color:n,width:i=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=ka();return(0,r.useMemo)(()=>Object.prototype.hasOwnProperty.call(Vs,e)?Vs[e]:(t.getState().onError?.("009",(e=>`Marker type "${e}" doesn't exist.`)(e)),null),[e])}(t);return u?(0,o.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:(0,o.jsx)(u,{color:n,strokeWidth:l})}):null},Zs=({defaultColor:e,rfId:t})=>{const n=_a(e=>e.edges),i=_a(e=>e.defaultEdgeOptions),a=(0,r.useMemo)(()=>{const o=function(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((e,a)=>([a.markerStart||o,a.markerEnd||r].forEach(o=>{if(o&&"object"==typeof o){const r=Ei(o,t);i.has(r)||(e.push({id:r,color:o.color||n,...o}),i.add(r))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}(n,{id:t,defaultColor:e,defaultMarkerStart:i?.markerStart,defaultMarkerEnd:i?.markerEnd});return o},[n,i,t,e]);return a.length?(0,o.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,o.jsx)("defs",{children:a.map(e=>(0,o.jsx)(Us,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};Zs.displayName="MarkerDefinitions";var Ks=(0,r.memo)(Zs);function Ws({x:e,y:t,label:n,labelStyle:i,labelShowBg:a=!0,labelBgStyle:s,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:d,...f}){const[h,p]=(0,r.useState)({x:1,y:0,width:0,height:0}),g=be(["react-flow__edge-textwrapper",d]),y=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(y.current){const e=y.current.getBBox();p({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,o.jsxs)("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...f,children:[a&&(0,o.jsx)("rect",{width:h.width+2*l[0],x:-l[0],y:-l[1],height:h.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),(0,o.jsx)("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:y,style:i,children:n}),u]}):null}Ws.displayName="EdgeText";const Ys=(0,r.memo)(Ws);function Xs({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{...d,d:e,fill:"none",className:be(["react-flow__edge-path",d.className])}),u?(0,o.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&zr(t)&&zr(n)?(0,o.jsx)(Ys,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function Gs({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===br.Left||e===br.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function Qs({sourceX:e,sourceY:t,sourcePosition:n=br.Bottom,targetX:o,targetY:r,targetPosition:i=br.Top}){const[a,s]=Gs({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=Gs({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,d,f,h]=ci({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${s} ${l},${c} ${o},${r}`,u,d,f,h]}function Js(e){return(0,r.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:s,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:m,interactionWidth:v})=>{const[b,w,x]=Qs({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:a,targetPosition:l}),_=e.isInternal?void 0:t;return(0,o.jsx)(Xs,{id:_,path:b,labelX:w,labelY:x,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:m,interactionWidth:v})})}const el=Js({isInternal:!1}),tl=Js({isInternal:!0});function nl(e){return(0,r.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=br.Bottom,targetPosition:g=br.Top,markerEnd:y,markerStart:m,pathOptions:v,interactionWidth:b})=>{const[w,x,_]=bi({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:g,borderRadius:v?.borderRadius,offset:v?.offset,stepPosition:v?.stepPosition}),k=e.isInternal?void 0:t;return(0,o.jsx)(Xs,{id:k,path:w,labelX:x,labelY:_,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:m,interactionWidth:b})})}el.displayName="SimpleBezierEdge",tl.displayName="SimpleBezierEdgeInternal";const ol=nl({isInternal:!1}),rl=nl({isInternal:!0});function il(e){return(0,r.memo)(({id:t,...n})=>{const i=e.isInternal?void 0:t;return(0,o.jsx)(ol,{...n,id:i,pathOptions:(0,r.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}ol.displayName="SmoothStepEdge",rl.displayName="SmoothStepEdgeInternal";const al=il({isInternal:!1}),sl=il({isInternal:!0});function ll(e){return(0,r.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:y})=>{const[m,v,b]=yi({sourceX:n,sourceY:r,targetX:i,targetY:a}),w=e.isInternal?void 0:t;return(0,o.jsx)(Xs,{id:w,path:m,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:g,interactionWidth:y})})}al.displayName="StepEdge",sl.displayName="StepEdgeInternal";const cl=ll({isInternal:!1}),ul=ll({isInternal:!0});function dl(e){return(0,r.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:s=br.Bottom,targetPosition:l=br.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:m,pathOptions:v,interactionWidth:b})=>{const[w,x,_]=fi({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:a,targetPosition:l,curvature:v?.curvature}),k=e.isInternal?void 0:t;return(0,o.jsx)(Xs,{id:k,path:w,labelX:x,labelY:_,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:g,markerEnd:y,markerStart:m,interactionWidth:b})})}cl.displayName="StraightEdge",ul.displayName="StraightEdgeInternal";const fl=dl({isInternal:!1}),hl=dl({isInternal:!0});fl.displayName="BezierEdge",hl.displayName="BezierEdgeInternal";const pl={default:hl,straight:ul,step:sl,smoothstep:rl,simplebezier:tl},gl={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},yl=(e,t,n)=>n===br.Left?e-t:n===br.Right?e+t:e,ml=(e,t,n)=>n===br.Top?e-t:n===br.Bottom?e+t:e,vl="react-flow__edgeupdater";function bl({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:l}){return(0,o.jsx)("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:s,className:be([vl,`${vl}-${l}`]),cx:yl(t,r,e),cy:ml(n,r,e),r,stroke:"transparent",fill:"transparent"})}function wl({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:s,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const g=ka(),y=(e,t)=>{if(0!==e.button)return;const{autoPanOnConnect:o,domNode:r,isValidConnection:i,connectionMode:a,connectionRadius:s,lib:l,onConnectStart:c,onConnectEnd:p,cancelConnection:y,nodeLookup:m,rfId:v,panBy:b,updateConnection:w}=g.getState(),x="target"===t.type;zi.onPointerDown(e.nativeEvent,{autoPanOnConnect:o,connectionMode:a,connectionRadius:s,domNode:r,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:x,edgeUpdaterType:t.type,lib:l,flowId:v,cancelConnection:y,panBy:b,isValidConnection:i,onConnect:e=>u?.(n,e),onConnectStart:(o,r)=>{h(!0),d?.(e,n,t.type),c?.(o,r)},onConnectEnd:p,onReconnectEnd:(e,o)=>{h(!1),f?.(e,n,t.type,o)},updateConnection:w,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},m=()=>p(!0),v=()=>p(!1);return(0,o.jsxs)(o.Fragment,{children:[(!0===e||"source"===e)&&(0,o.jsx)(bl,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:e=>y(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:m,onMouseOut:v,type:"source"}),(!0===e||"target"===e)&&(0,o.jsx)(bl,{position:c,centerX:a,centerY:s,radius:t,onMouseDown:e=>y(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:m,onMouseOut:v,type:"target"})]})}function xl({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:i,onClick:a,onDoubleClick:s,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,reconnectRadius:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:g,rfId:y,edgeTypes:m,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let x=_a(t=>t.edgeLookup.get(e));const _=_a(e=>e.defaultEdgeOptions);x=_?{..._,...x}:x;let k=x.type||"default",E=m?.[k]||pl[k];void 0===E&&(b?.("011",(e=>`Edge type "${e}" not found. Using fallback type "default".`)(k)),k="default",E=m?.default||pl.default);const C=!!(x.focusable||t&&void 0===x.focusable),N=void 0!==h&&(x.reconnectable||n&&void 0===x.reconnectable),S=!!(x.selectable||i&&void 0===x.selectable),O=(0,r.useRef)(null),[j,A]=(0,r.useState)(!1),[P,T]=(0,r.useState)(!1),M=ka(),{zIndex:L,sourceX:D,sourceY:I,targetX:q,targetY:R,sourcePosition:B,targetPosition:$}=_a((0,r.useCallback)(t=>{const n=t.nodeLookup.get(x.source),o=t.nodeLookup.get(x.target);if(!n||!o)return{zIndex:x.zIndex,...gl};const r=function(e){const{sourceNode:t,targetNode:n}=e;if(!wi(t)||!wi(n))return null;const o=t.internals.handleBounds||xi(t.handles),r=n.internals.handleBounds||xi(n.handles),i=ki(o?.source??[],e.sourceHandle),a=ki(e.connectionMode===fr.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!a)return e.onError?.("008",((e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:o}", edge id: ${t}.`)(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const s=i?.position||br.Bottom,l=a?.position||br.Top,c=_i(t,i,s),u=_i(n,a,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:l}}({id:e,sourceNode:n,targetNode:o,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:t.connectionMode,onError:b}),i=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o,elevateOnSelect:r=!1}){return void 0!==o?o:(r&&n?1e3:0)+Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0)}({selected:x.selected,zIndex:x.zIndex,sourceNode:n,targetNode:o,elevateOnSelect:t.elevateEdgesOnSelect});return{zIndex:i,...r||gl}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),va),z=(0,r.useMemo)(()=>x.markerStart?`url('#${Ei(x.markerStart,y)}')`:void 0,[x.markerStart,y]),F=(0,r.useMemo)(()=>x.markerEnd?`url('#${Ei(x.markerEnd,y)}')`:void 0,[x.markerEnd,y]);if(x.hidden||null===D||null===I||null===q||null===R)return null;const H=s?e=>{s(e,{...x})}:void 0,V=l?e=>{l(e,{...x})}:void 0,U=c?e=>{c(e,{...x})}:void 0,Z=u?e=>{u(e,{...x})}:void 0,K=d?e=>{d(e,{...x})}:void 0;return(0,o.jsx)("svg",{style:{zIndex:L},children:(0,o.jsxs)("g",{className:be(["react-flow__edge",`react-flow__edge-${k}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!S&&!a,updating:j,selectable:S}]),onClick:t=>{const{addSelectedEdges:n,unselectNodesAndEdges:o,multiSelectionActive:r}=M.getState();S&&(M.setState({nodesSelectionActive:!1}),x.selected&&r?(o({nodes:[],edges:[x]}),O.current?.blur()):n([e])),a&&a(t,x)},onDoubleClick:H,onContextMenu:V,onMouseEnter:U,onMouseMove:Z,onMouseLeave:K,onKeyDown:C?t=>{if(!w&&ur.includes(t.key)&&S){const{unselectNodesAndEdges:n,addSelectedEdges:o}=M.getState();"Escape"===t.key?(O.current?.blur(),n({edges:[x]})):o([e])}}:void 0,tabIndex:C?0:void 0,role:x.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===x.ariaLabel?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":C?`${Sa}-${y}`:void 0,ref:O,...x.domAttributes,children:[!P&&(0,o.jsx)(E,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:S,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:D,sourceY:I,targetX:q,targetY:R,sourcePosition:B,targetPosition:$,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:z,markerEnd:F,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),N&&(0,o.jsx)(wl,{edge:x,isReconnectable:N,reconnectRadius:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:g,sourceX:D,sourceY:I,targetX:q,targetY:R,sourcePosition:B,targetPosition:$,setUpdateHover:A,setReconnecting:T})]})})}const _l=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function kl({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:i,noPanClassName:a,onReconnect:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,reconnectRadius:h,onEdgeDoubleClick:p,onReconnectStart:g,onReconnectEnd:y,disableKeyboardA11y:m}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:x}=_a(_l,va),_=_a((0,r.useCallback)(e=>{if(!k)return e.edges.map(e=>e.id);const t=[];if(e.width&&e.height)for(const n of e.edges){const o=e.nodeLookup.get(n.source),r=e.nodeLookup.get(n.target);o&&r&&pi({sourceNode:o,targetNode:r,width:e.width,height:e.height,transform:e.transform})&&t.push(n.id)}return t},[k=t]),va);var k;return(0,o.jsxs)("div",{className:"react-flow__edges",children:[(0,o.jsx)(Ks,{defaultColor:e,rfId:n}),_.map(e=>(0,o.jsx)(xl,{id:e,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:a,onReconnect:s,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:d,onClick:f,reconnectRadius:h,onDoubleClick:p,onReconnectStart:g,onReconnectEnd:y,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:m},e))]})}kl.displayName="EdgeRenderer";const El=(0,r.memo)(kl),Cl=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Nl({children:e}){const t=_a(Cl);return(0,o.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}const Sl=e=>e.panZoom?.syncViewport;function Ol(e){return e.connection.inProgress?{...e.connection,to:Vr(e.connection.to,e.transform)}:{...e.connection}}const jl=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Al({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:s,isValid:l,inProgress:c}=_a(jl,va);return a&&i&&c?(0,o.jsx)("svg",{style:e,width:a,height:s,className:"react-flow__connectionline react-flow__container",children:(0,o.jsx)("g",{className:be(["react-flow__connection",xr(l)]),children:(0,o.jsx)(Pl,{style:t,type:n,CustomComponent:r,isValid:l})})}):null}const Pl=({style:e,type:t=mr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:s,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h}=_a(Ol,va);if(!i)return;if(n)return(0,o.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:a.x,fromY:a.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:xr(r),toNode:d,toHandle:f});let p="";const g={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case mr.Bezier:[p]=fi(g);break;case mr.SimpleBezier:[p]=Qs(g);break;case mr.Step:[p]=bi({...g,borderRadius:0});break;case mr.SmoothStep:[p]=bi(g);break;default:[p]=yi(g)}return(0,o.jsx)("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};Pl.displayName="ConnectionLine";const Tl={};function Ml(e=Tl){(0,r.useRef)(e),ka(),(0,r.useEffect)(()=>{},[e])}function Ll({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:s,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,onSelectionContextMenu:h,onSelectionStart:p,onSelectionEnd:g,connectionLineType:y,connectionLineStyle:m,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:x,selectionMode:_,multiSelectionKeyCode:k,panActivationKeyCode:E,zoomActivationKeyCode:C,deleteKeyCode:N,onlyRenderVisibleElements:S,elementsSelectable:O,defaultViewport:j,translateExtent:A,minZoom:P,maxZoom:T,preventScrolling:M,defaultMarkerColor:L,zoomOnScroll:D,zoomOnPinch:I,panOnScroll:q,panOnScrollSpeed:R,panOnScrollMode:B,zoomOnDoubleClick:$,panOnDrag:z,onPaneClick:F,onPaneMouseEnter:H,onPaneMouseMove:V,onPaneMouseLeave:U,onPaneScroll:Z,onPaneContextMenu:K,paneClickDistance:W,nodeClickDistance:Y,onEdgeContextMenu:X,onEdgeMouseEnter:G,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,noDragClassName:re,noWheelClassName:ie,noPanClassName:ae,disableKeyboardA11y:se,nodeExtent:le,rfId:ce,viewport:ue,onViewportChange:de}){return Ml(e),Ml(t),ka(),(0,r.useRef)(!1),(0,r.useEffect)(()=>{},[]),function(e){const t=fs(),n=(0,r.useRef)(!1);(0,r.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(n),function(e){const t=_a(Sl),n=ka();(0,r.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t])}(ue),(0,o.jsx)(Rs,{onPaneClick:F,onPaneMouseEnter:H,onPaneMouseMove:V,onPaneMouseLeave:U,onPaneContextMenu:K,onPaneScroll:Z,paneClickDistance:W,deleteKeyCode:N,selectionKeyCode:w,selectionOnDrag:x,selectionMode:_,onSelectionStart:p,onSelectionEnd:g,multiSelectionKeyCode:k,panActivationKeyCode:E,zoomActivationKeyCode:C,elementsSelectable:O,zoomOnScroll:D,zoomOnPinch:I,zoomOnDoubleClick:$,panOnScroll:q,panOnScrollSpeed:R,panOnScrollMode:B,panOnDrag:z,defaultViewport:j,translateExtent:A,minZoom:P,maxZoom:T,onSelectionContextMenu:h,preventScrolling:M,noDragClassName:re,noWheelClassName:ie,noPanClassName:ae,disableKeyboardA11y:se,onViewportChange:de,isControlledViewport:!!ue,children:(0,o.jsxs)(Nl,{children:[(0,o.jsx)(El,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:te,onReconnectStart:ne,onReconnectEnd:oe,onlyRenderVisibleElements:S,onEdgeContextMenu:X,onEdgeMouseEnter:G,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,defaultMarkerColor:L,noPanClassName:ae,disableKeyboardA11y:se,rfId:ce}),(0,o.jsx)(Al,{style:m,type:y,component:v,containerStyle:b}),(0,o.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,o.jsx)(Hs,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:d,onNodeContextMenu:f,nodeClickDistance:Y,onlyRenderVisibleElements:S,noPanClassName:ae,noDragClassName:re,disableKeyboardA11y:se,nodeExtent:le,rfId:ce}),(0,o.jsx)("div",{className:"react-flow__viewport-portal"})]})})}Ll.displayName="GraphView";const Dl=(0,r.memo)(Ll),Il=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,fitViewOptions:s,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d}={})=>{const f=new Map,h=new Map,p=new Map,g=new Map,y=o??t??[],m=n??e??[],v=u??[0,0],b=d??cr;Mi(p,g,y);const w=Oi(m,f,h,{nodeOrigin:v,nodeExtent:b,elevateNodesOnSelect:!1});let x=[0,0,1];if(a&&r&&i){const e=Cr(f,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),{x:t,y:n,zoom:o}=Kr(e,r,i,l,c,s?.padding??.1);x=[t,n,o]}return{rfId:"1",width:0,height:0,transform:x,nodes:m,nodesInitialized:w,nodeLookup:f,parentLookup:h,edges:y,edgeLookup:g,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==o,panZoom:null,minZoom:l,maxZoom:c,translateExtent:cr,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:fr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:s,fitViewResolver:null,connection:{...yr},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Fr,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:dr}};function ql({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:i,initialWidth:a,initialHeight:s,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:u,fitView:d,nodeOrigin:f,nodeExtent:h,children:p}){const[g]=(0,r.useState)(()=>(({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d})=>{return f=(f,h)=>{async function p(){const{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:o,width:r,height:i,minZoom:a,maxZoom:s}=h();t&&(await async function({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},a){if(0===e.size)return Promise.resolve(!0);const s=function(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{!e.measured.width||!e.measured.height||!t?.includeHiddenNodes&&e.hidden||o&&!o.has(e.id)||n.set(e.id,e)}),n}(e,a),l=Cr(s),c=Kr(l,t,n,a?.minZoom??r,a?.maxZoom??i,a?.padding??.1);return await o.setViewport(c,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)}({nodes:e,width:r,height:i,panZoom:t,minZoom:a,maxZoom:s},n),o?.resolve(!0),f({fitViewResolver:null}))}return{...Il({nodes:e,edges:t,width:r,height:i,fitView:a,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:o}),setNodes:e=>{const{nodeLookup:t,parentLookup:n,nodeOrigin:o,elevateNodesOnSelect:r,fitViewQueued:i}=h(),a=Oi(e,t,n,{nodeOrigin:o,nodeExtent:d,elevateNodesOnSelect:r,checkEquality:!0});i&&a?(p(),f({nodes:e,nodesInitialized:a,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:e,nodesInitialized:a})},setEdges:e=>{const{connectionLookup:t,edgeLookup:n}=h();Mi(t,n,e),f({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){const{setNodes:t}=h();t(e),f({hasDefaultNodes:!0})}if(t){const{setEdges:e}=h();e(t),f({hasDefaultEdges:!0})}},updateNodeInternals:e=>{const{triggerNodeChanges:t,nodeLookup:n,parentLookup:o,domNode:r,nodeOrigin:i,nodeExtent:a,debug:s,fitViewQueued:l}=h(),{changes:c,updatedInternals:u}=function(e,t,n,o,r,i){const a=o?.querySelector(".xyflow__viewport");let s=!1;if(!a)return{changes:[],updatedInternals:s};const l=[],c=window.getComputedStyle(a),{m22:u}=new window.DOMMatrixReadOnly(c.transform),d=[];for(const o of e.values()){const e=t.get(o.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),s=!0;continue}const a=ni(o.nodeElement),c=e.measured.width!==a.width||e.measured.height!==a.height;if(a.width&&a.height&&(c||!e.internals.handleBounds||o.force)){const f=o.nodeElement.getBoundingClientRect(),h=Yr(e.extent)?e.extent:i;let{positionAbsolute:p}=e.internals;e.parentId&&"parent"===e.extent?p=Ar(p,a,t.get(e.parentId)):h&&(p=jr(p,h,a));const g={...e,measured:a,internals:{...e.internals,positionAbsolute:p,handleBounds:{source:li("source",o.nodeElement,f,u,e.id),target:li("target",o.nodeElement,f,u,e.id)}}};t.set(e.id,g),e.parentId&&ji(g,t,n,{nodeOrigin:r}),s=!0,c&&(l.push({id:e.id,type:"dimensions",dimensions:a}),e.expandParent&&e.parentId&&d.push({id:e.id,parentId:e.parentId,rect:Ir(g,r)}))}}if(d.length>0){const e=Pi(d,t,n,r);l.push(...e)}return{changes:l,updatedInternals:s}}(e,n,o,r,i,a);u&&(function(e,t,n){const o=Si(Ci,n);for(const n of e.values())if(n.parentId)ji(n,e,t,o);else{const e=Er(n,o.nodeOrigin),t=Yr(n.extent)?n.extent:o.nodeExtent,r=jr(e,t,Xr(n));n.internals.positionAbsolute=r}}(n,o,{nodeOrigin:i,nodeExtent:a}),l?(p(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),c?.length>0&&(s&&console.log("React Flow: trigger node changes",c),t?.(c)))},updateNodePositions:(e,t=!1)=>{const n=[],o=[],{nodeLookup:r,triggerNodeChanges:i}=h();for(const[i,a]of e){const e=r.get(i),s=!!(e?.expandParent&&e?.parentId&&a?.position),l={id:i,type:"position",position:s?{x:Math.max(0,a.position.x),y:Math.max(0,a.position.y)}:a.position,dragging:t};s&&e.parentId&&n.push({id:i,parentId:e.parentId,rect:{...a.internals.positionAbsolute,width:a.measured.width??0,height:a.measured.height??0}}),o.push(l)}if(n.length>0){const{parentLookup:e,nodeOrigin:t}=h(),i=Pi(n,r,e,t);o.push(...i)}i(o)},triggerNodeChanges:e=>{const{onNodesChange:t,setNodes:n,nodes:o,hasDefaultNodes:r,debug:i}=h();e?.length&&(r&&n(Ja(e,o)),i&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{const{onEdgesChange:t,setEdges:n,edges:o,hasDefaultEdges:r,debug:i}=h();e?.length&&(r&&n(es(e,o)),i&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=h();t?r(e.map(e=>ts(e,!0))):(r(ns(o,new Set([...e]),!0)),i(ns(n)))},addSelectedEdges:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=h();t?i(e.map(e=>ts(e,!0))):(i(ns(n,new Set([...e]))),r(ns(o,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{const{edges:n,nodes:o,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=h(),s=t||n,l=(e||o).map(e=>{const t=r.get(e.id);return t&&(t.selected=!1),ts(e.id,!1)}),c=s.map(e=>ts(e.id,!1));i(l),a(c)},setMinZoom:e=>{const{panZoom:t,maxZoom:n}=h();t?.setScaleExtent([e,n]),f({minZoom:e})},setMaxZoom:e=>{const{panZoom:t,minZoom:n}=h();t?.setScaleExtent([n,e]),f({maxZoom:e})},setTranslateExtent:e=>{h().panZoom?.setTranslateExtent(e),f({translateExtent:e})},setPaneClickDistance:e=>{h().panZoom?.setClickDistance(e)},resetSelectedElements:()=>{const{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:o,elementsSelectable:r}=h();if(!r)return;const i=t.reduce((e,t)=>t.selected?[...e,ts(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,ts(t.id,!1)]:e,[]);n(i),o(a)},setNodeExtent:e=>{const{nodes:t,nodeLookup:n,parentLookup:o,nodeOrigin:r,elevateNodesOnSelect:i,nodeExtent:a}=h();e[0][0]===a[0][0]&&e[0][1]===a[0][1]&&e[1][0]===a[1][0]&&e[1][1]===a[1][1]||(Oi(t,n,o,{nodeOrigin:r,nodeExtent:e,elevateNodesOnSelect:i,checkEquality:!1}),f({nodeExtent:e}))},panBy:e=>{const{transform:t,width:n,height:o,panZoom:r,translateExtent:i}=h();return async function({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),s=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(s)}({delta:e,panZoom:r,transform:t,translateExtent:i,width:n,height:o})},setCenter:async(e,t,n)=>{const{width:o,height:r,maxZoom:i,panZoom:a}=h();if(!a)return Promise.resolve(!1);const s=void 0!==n?.zoom?n.zoom:i;return await a.setViewport({x:o/2-e*s,y:r/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...yr}})},updateConnection:e=>{f({connection:e})},reset:()=>f({...Il()})}},h=Object.is,f?ma(f,h):ma;var f,h})({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,width:a,height:s,fitView:d,minZoom:l,maxZoom:c,fitViewOptions:u,nodeOrigin:f,nodeExtent:h}));return(0,o.jsx)(wa,{value:g,children:(0,o.jsx)(us,{children:p})})}function Rl({children:e,nodes:t,edges:n,defaultNodes:i,defaultEdges:a,width:s,height:l,fitView:c,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:h,nodeExtent:p}){return(0,r.useContext)(ba)?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsx)(ql,{initialNodes:t,initialEdges:n,defaultNodes:i,defaultEdges:a,initialWidth:s,initialHeight:l,fitView:c,initialFitViewOptions:u,initialMinZoom:d,initialMaxZoom:f,nodeOrigin:h,nodeExtent:p,children:e})}const Bl={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var $l=as(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:i,className:a,nodeTypes:s,edgeTypes:l,onNodeClick:c,onEdgeClick:u,onInit:d,onMove:f,onMoveStart:h,onMoveEnd:p,onConnect:g,onConnectStart:y,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:E,onNodeDragStart:C,onNodeDrag:N,onNodeDragStop:S,onNodesDelete:O,onEdgesDelete:j,onDelete:A,onSelectionChange:P,onSelectionDragStart:T,onSelectionDrag:M,onSelectionDragStop:L,onSelectionContextMenu:D,onSelectionStart:I,onSelectionEnd:q,onBeforeDelete:R,connectionMode:B,connectionLineType:$=mr.Bezier,connectionLineStyle:z,connectionLineComponent:F,connectionLineContainerStyle:H,deleteKeyCode:V="Backspace",selectionKeyCode:U="Shift",selectionOnDrag:Z=!1,selectionMode:K=pr.Full,panActivationKeyCode:W="Space",multiSelectionKeyCode:Y=(Wr()?"Meta":"Control"),zoomActivationKeyCode:X=(Wr()?"Meta":"Control"),snapToGrid:G,snapGrid:Q,onlyRenderVisibleElements:J=!1,selectNodesOnDrag:ee,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:oe,nodesFocusable:re,nodeOrigin:ie=$a,edgesFocusable:ae,edgesReconnectable:se,elementsSelectable:le=!0,defaultViewport:ce=za,minZoom:ue=.5,maxZoom:de=2,translateExtent:fe=cr,preventScrolling:he=!0,nodeExtent:pe,defaultMarkerColor:ge="#b1b1b7",zoomOnScroll:ye=!0,zoomOnPinch:me=!0,panOnScroll:ve=!1,panOnScrollSpeed:we=.5,panOnScrollMode:xe=hr.Free,zoomOnDoubleClick:_e=!0,panOnDrag:ke=!0,onPaneClick:Ee,onPaneMouseEnter:Ce,onPaneMouseMove:Ne,onPaneMouseLeave:Se,onPaneScroll:Oe,onPaneContextMenu:je,paneClickDistance:Ae=0,nodeClickDistance:Pe=0,children:Te,onReconnect:Me,onReconnectStart:Le,onReconnectEnd:De,onEdgeContextMenu:Ie,onEdgeDoubleClick:qe,onEdgeMouseEnter:Re,onEdgeMouseMove:Be,onEdgeMouseLeave:$e,reconnectRadius:ze=10,onNodesChange:Fe,onEdgesChange:He,noDragClassName:Ve="nodrag",noWheelClassName:Ue="nowheel",noPanClassName:Ze="nopan",fitView:Ke,fitViewOptions:We,connectOnClick:Ye,attributionPosition:Xe,proOptions:Ge,defaultEdgeOptions:Qe,elevateNodesOnSelect:Je,elevateEdgesOnSelect:et,disableKeyboardA11y:tt=!1,autoPanOnConnect:nt,autoPanOnNodeDrag:ot,autoPanSpeed:rt,connectionRadius:it,isValidConnection:at,onError:st,style:lt,id:ct,nodeDragThreshold:ut,connectionDragThreshold:dt,viewport:ft,onViewportChange:ht,width:pt,height:gt,colorMode:yt="light",debug:mt,onScroll:vt,ariaLabelConfig:bt,...wt},xt){const _t=ct||"1",kt=function(e){const[t,n]=(0,r.useState)("system"===e?null:e);return(0,r.useEffect)(()=>{if("system"!==e)return void n(e);const t=Za(),o=()=>n(t?.matches?"dark":"light");return o(),t?.addEventListener("change",o),()=>{t?.removeEventListener("change",o)}},[e]),null!==t?t:Za()?.matches?"dark":"light"}(yt),Et=(0,r.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),vt?.(e)},[vt]);return(0,o.jsx)("div",{"data-testid":"rf__wrapper",...wt,onScroll:Et,style:{...lt,...Bl},ref:xt,className:be(["react-flow",a,kt]),id:ct,role:"application",children:(0,o.jsxs)(Rl,{nodes:e,edges:t,width:pt,height:gt,fitView:Ke,fitViewOptions:We,minZoom:ue,maxZoom:de,nodeOrigin:ie,nodeExtent:pe,children:[(0,o.jsx)(Dl,{onInit:d,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:_,onNodeContextMenu:k,onNodeDoubleClick:E,nodeTypes:s,edgeTypes:l,connectionLineType:$,connectionLineStyle:z,connectionLineComponent:F,connectionLineContainerStyle:H,selectionKeyCode:U,selectionOnDrag:Z,selectionMode:K,deleteKeyCode:V,multiSelectionKeyCode:Y,panActivationKeyCode:W,zoomActivationKeyCode:X,onlyRenderVisibleElements:J,defaultViewport:ce,translateExtent:fe,minZoom:ue,maxZoom:de,preventScrolling:he,zoomOnScroll:ye,zoomOnPinch:me,zoomOnDoubleClick:_e,panOnScroll:ve,panOnScrollSpeed:we,panOnScrollMode:xe,panOnDrag:ke,onPaneClick:Ee,onPaneMouseEnter:Ce,onPaneMouseMove:Ne,onPaneMouseLeave:Se,onPaneScroll:Oe,onPaneContextMenu:je,paneClickDistance:Ae,nodeClickDistance:Pe,onSelectionContextMenu:D,onSelectionStart:I,onSelectionEnd:q,onReconnect:Me,onReconnectStart:Le,onReconnectEnd:De,onEdgeContextMenu:Ie,onEdgeDoubleClick:qe,onEdgeMouseEnter:Re,onEdgeMouseMove:Be,onEdgeMouseLeave:$e,reconnectRadius:ze,defaultMarkerColor:ge,noDragClassName:Ve,noWheelClassName:Ue,noPanClassName:Ze,rfId:_t,disableKeyboardA11y:tt,nodeExtent:pe,viewport:ft,onViewportChange:ht}),(0,o.jsx)(Ua,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:g,onConnectStart:y,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:oe,nodesFocusable:re,edgesFocusable:ae,edgesReconnectable:se,elementsSelectable:le,elevateNodesOnSelect:Je,elevateEdgesOnSelect:et,minZoom:ue,maxZoom:de,nodeExtent:pe,onNodesChange:Fe,onEdgesChange:He,snapToGrid:G,snapGrid:Q,connectionMode:B,translateExtent:fe,connectOnClick:Ye,defaultEdgeOptions:Qe,fitView:Ke,fitViewOptions:We,onNodesDelete:O,onEdgesDelete:j,onDelete:A,onNodeDragStart:C,onNodeDrag:N,onNodeDragStop:S,onSelectionDrag:M,onSelectionDragStart:T,onSelectionDragStop:L,onMove:f,onMoveStart:h,onMoveEnd:p,noPanClassName:Ze,nodeOrigin:ie,rfId:_t,autoPanOnConnect:nt,autoPanOnNodeDrag:ot,autoPanSpeed:rt,onError:st,connectionRadius:it,isValidConnection:at,selectNodesOnDrag:ee,nodeDragThreshold:ut,connectionDragThreshold:dt,onBeforeDelete:R,paneClickDistance:Ae,debug:mt,ariaLabelConfig:bt}),(0,o.jsx)(Ba,{onSelectionChange:P}),Te,(0,o.jsx)(Ma,{proOptions:Ge,position:Xe}),(0,o.jsx)(Pa,{rfId:_t,disableKeyboardA11y:tt})]})})});const zl=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function Fl({children:e}){const t=_a(zl);return t?(0,l.createPortal)(e,t):null}function Hl({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,o.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:be(["react-flow__background-pattern",n,r])})}function Vl({radius:e,className:t}){return(0,o.jsx)("circle",{cx:e,cy:e,r:e,className:be(["react-flow__background-pattern","dots",t])})}var Ul;!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(Ul||(Ul={}));const Zl={[Ul.Dots]:1,[Ul.Lines]:1,[Ul.Cross]:6},Kl=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Wl({id:e,variant:t=Ul.Dots,gap:n=20,size:i,lineWidth:a=1,offset:s=0,color:l,bgColor:c,style:u,className:d,patternClassName:f}){const h=(0,r.useRef)(null),{transform:p,patternId:g}=_a(Kl,va),y=i||Zl[t],m=t===Ul.Dots,v=t===Ul.Cross,b=Array.isArray(n)?n:[n,n],w=[b[0]*p[2]||1,b[1]*p[2]||1],x=y*p[2],_=Array.isArray(s)?s:[s,s],k=v?[x,x]:w,E=[_[0]*p[2]||1+k[0]/2,_[1]*p[2]||1+k[1]/2],C=`${g}${e||""}`;return(0,o.jsxs)("svg",{className:be(["react-flow__background",d]),style:{...u,...gs,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:h,"data-testid":"rf__background",children:[(0,o.jsx)("pattern",{id:C,x:p[0]%w[0],y:p[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:m?(0,o.jsx)(Vl,{radius:x/2,className:f}):(0,o.jsx)(Hl,{dimensions:k,lineWidth:a,variant:t,className:f})}),(0,o.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}Wl.displayName="Background";const Yl=(0,r.memo)(Wl);function Xl(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,o.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Gl(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,o.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function Ql(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,o.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Jl(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,o.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function ec(){return(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,o.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function tc({children:e,className:t,...n}){return(0,o.jsx)("button",{type:"button",className:be(["react-flow__controls-button",t]),...n,children:e})}const nc=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function oc({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:s,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const g=ka(),{isInteractive:y,minZoomReached:m,maxZoomReached:v,ariaLabelConfig:b}=_a(nc,va),{zoomIn:w,zoomOut:x,fitView:_}=fs();return(0,o.jsxs)(Ta,{className:be(["react-flow__controls","horizontal"===h?"horizontal":"vertical",u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??b["controls.ariaLabel"],children:[t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tc,{onClick:()=>{w(),a?.()},className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:v,children:(0,o.jsx)(Xl,{})}),(0,o.jsx)(tc,{onClick:()=>{x(),s?.()},className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:m,children:(0,o.jsx)(Gl,{})})]}),n&&(0,o.jsx)(tc,{className:"react-flow__controls-fitview",onClick:()=>{_(i),l?.()},title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:(0,o.jsx)(Ql,{})}),r&&(0,o.jsx)(tc,{className:"react-flow__controls-interactive",onClick:()=>{g.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),c?.(!y)},title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:(0,o.jsx)(y?ec:Jl,{})}),d]})}oc.displayName="Controls";const rc=(0,r.memo)(oc),ic=(0,r.memo)(function({id:e,x:t,y:n,width:r,height:i,style:a,color:s,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:g,backgroundColor:y}=a||{},m=s||g||y;return(0,o.jsx)("rect",{className:be(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:m,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?t=>p(t,e):void 0})}),ac=e=>e.nodes.map(e=>e.id),sc=e=>e instanceof Function?e:()=>e,lc=(0,r.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:s,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=_a(t=>{const{internals:n}=t.nodeLookup.get(e),o=n.userNode,{x:r,y:i}=n.positionAbsolute,{width:a,height:s}=Xr(o);return{node:o,x:r,y:i,width:a,height:s}},va);return u&&!u.hidden&&Gr(u)?(0,o.jsx)(l,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:a,shapeRendering:s,onClick:c,id:u.id}):null});var cc=(0,r.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=ic,onClick:s}){const l=_a(ac,va),c=sc(t),u=sc(e),d=sc(n),f="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,o.jsx)(o.Fragment,{children:l.map(e=>(0,o.jsx)(lc,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:s,shapeRendering:f},e))})});const uc=e=>!e.hidden,dc=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Rr(Cr(e.nodeLookup,{filter:uc}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}};function fc({style:e,className:t,nodeStrokeColor:n,nodeColor:i,nodeClassName:a="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:u,maskColor:d,maskStrokeColor:f,maskStrokeWidth:h,position:p="bottom-right",onClick:g,onNodeClick:y,pannable:m=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:x=1,offsetScale:_=5}){const k=ka(),E=(0,r.useRef)(null),{boundingRect:C,viewBB:N,rfId:S,panZoom:O,translateExtent:j,flowWidth:A,flowHeight:P,ariaLabelConfig:T}=_a(dc,va),M=e?.width??200,L=e?.height??150,D=C.width/M,I=C.height/L,q=Math.max(D,I),R=q*M,B=q*L,$=_*q,z=C.x-(R-C.width)/2-$,F=C.y-(B-C.height)/2-$,H=R+2*$,V=B+2*$,U=`react-flow__minimap-desc-${S}`,Z=(0,r.useRef)(0),K=(0,r.useRef)();Z.current=q,(0,r.useEffect)(()=>{if(E.current&&O)return K.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=It(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:s=1,pannable:l=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0];const f=lr().on("start",e=>{"mousedown"!==e.sourceEvent.type&&"touchstart"!==e.sourceEvent.type||(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",l?r=>{const s=n();if("mousemove"!==r.sourceEvent.type&&"touchmove"!==r.sourceEvent.type||!t)return;const l=[r.sourceEvent.clientX??r.sourceEvent.touches[0].clientX,r.sourceEvent.clientY??r.sourceEvent.touches[0].clientY],c=[l[0]-d[0],l[1]-d[1]];d=l;const f=o()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),h={x:s[0]-c[0]*f,y:s[1]-c[1]*f},p=[[0,0],[i,a]];t.setViewportConstrained({x:h.x,y:h.y,zoom:s[2]},p,e)}:null).on("zoom.wheel",c?e=>{if("wheel"!==e.sourceEvent.type||!t)return;const o=n(),r=e.sourceEvent.ctrlKey&&Wr()?10:1,i=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,a=o[2]*Math.pow(2,i*r);t.scaleTo(a)}:null);r.call(f,{})},destroy:function(){r.on("zoom",null)},pointer:qt}}({domNode:E.current,panZoom:O,getTransform:()=>k.getState().transform,getViewScale:()=>Z.current}),()=>{K.current?.destroy()}},[O]),(0,r.useEffect)(()=>{K.current?.update({translateExtent:j,width:A,height:P,inversePan:w,pannable:m,zoomStep:x,zoomable:v})},[m,v,w,x,j,A,P]);const W=g?e=>{const[t,n]=K.current?.pointer(e)||[0,0];g(e,{x:t,y:n})}:void 0,Y=y?(0,r.useCallback)((e,t)=>{const n=k.getState().nodeLookup.get(t).internals.userNode;y(e,n)},[]):void 0,X=b??T["minimap.ariaLabel"];return(0,o.jsx)(Ta,{position:p,style:{...e,"--xy-minimap-background-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof d?d:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof f?f:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof h?h*q:void 0,"--xy-minimap-node-background-color-props":"string"==typeof i?i:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof l?l:void 0},className:be(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,o.jsxs)("svg",{width:M,height:L,viewBox:`${z} ${F} ${H} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":U,ref:E,onClick:W,children:[X&&(0,o.jsx)("title",{id:U,children:X}),(0,o.jsx)(cc,{onClick:Y,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:c}),(0,o.jsx)("path",{className:"react-flow__minimap-mask",d:`M${z-$},${F-$}h${H+2*$}v${V+2*$}h${-H-2*$}z\n M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}fc.displayName="MiniMap",(0,r.memo)(fc);const hc={[Yi.Line]:"right",[Yi.Handle]:"bottom-right"};(0,r.memo)(function({nodeId:e,position:t,variant:n=Yi.Handle,className:i,style:a,children:s,color:l,minWidth:c=10,minHeight:u=10,maxWidth:d=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:p,autoScale:g=!0,shouldResize:y,onResizeStart:m,onResize:v,onResizeEnd:b}){const w=Os(),x="string"==typeof e?e:w,_=ka(),k=(0,r.useRef)(null),E=n===Yi.Handle,C=_a((0,r.useCallback)((N=E&&g,e=>N?`${Math.max(1/e.transform[2],1)}`:void 0),[E,g]),va);var N;const S=(0,r.useRef)(null),O=t??hc[n];(0,r.useEffect)(()=>{if(k.current&&x)return S.current||(S.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=It(e);return{update:function({controlPosition:e,boundaries:a,keepAspectRatio:s,resizeDirection:l,onResizeStart:c,onResize:u,onResizeEnd:d,shouldResize:f}){let h={...ea},p={...ta};const g=function(e){return{isHorizontal:e.includes("right")||e.includes("left"),isVertical:e.includes("bottom")||e.includes("top"),affectsX:e.includes("left"),affectsY:e.includes("top")}}(e);let y,m,v,b,w=null,x=[];const _=Xt().on("start",e=>{const{nodeLookup:o,transform:r,snapGrid:i,snapToGrid:a,nodeOrigin:s,paneDomNode:l}=n();if(y=o.get(t),!y)return;w=l?.getBoundingClientRect()??null;const{xSnapped:u,ySnapped:d}=ti(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a,containerBounds:w});h={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},p={...h,pointerX:u,pointerY:d,aspectRatio:h.width/h.height},m=void 0,y.parentId&&("parent"===y.extent||y.expandParent)&&(m=o.get(y.parentId),v=m&&"parent"===y.extent?function(e){return[[0,0],[e.measured.width,e.measured.height]]}(m):void 0),x=[],b=void 0;for(const[e,n]of o)if(n.parentId===t&&(x.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const e=na(n,y,n.origin??s);b=b?[[Math.min(e[0][0],b[0][0]),Math.min(e[0][1],b[0][1])],[Math.max(e[1][0],b[1][0]),Math.max(e[1][1],b[1][1])]]:e}c?.(e,{...h})}).on("drag",e=>{const{transform:t,snapGrid:r,snapToGrid:i,nodeOrigin:c}=n(),d=ti(e.sourceEvent,{transform:t,snapGrid:r,snapToGrid:i,containerBounds:w}),_=[];if(!y)return;const{x:k,y:E,width:C,height:N}=h,S={},O=y.origin??c,{width:j,height:A,x:P,y:T}=function(e,t,n,o,r,i,a,s){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:h,ySnapped:p}=n,{minWidth:g,maxWidth:y,minHeight:m,maxHeight:v}=o,{x:b,y:w,width:x,height:_,aspectRatio:k}=e;let E=Math.floor(u?h-e.pointerX:0),C=Math.floor(d?p-e.pointerY:0);const N=x+(l?-E:E),S=_+(c?-C:C),O=-i[0]*x,j=-i[1]*_;let A=Qi(N,g,y),P=Qi(S,m,v);if(a){let e=0,t=0;l&&E<0?e=Xi(b+E+O,a[0][0]):!l&&E>0&&(e=Gi(b+N+O,a[1][0])),c&&C<0?t=Xi(w+C+j,a[0][1]):!c&&C>0&&(t=Gi(w+S+j,a[1][1])),A=Math.max(A,e),P=Math.max(P,t)}if(s){let e=0,t=0;l&&E>0?e=Gi(b+E,s[0][0]):!l&&E<0&&(e=Xi(b+N,s[1][0])),c&&C>0?t=Gi(w+C,s[0][1]):!c&&C<0&&(t=Xi(w+S,s[1][1])),A=Math.max(A,e),P=Math.max(P,t)}if(r){if(u){const e=Qi(N/k,m,v)*k;if(A=Math.max(A,e),a){let e=0;e=!l&&!c||l&&!c&&f?Gi(w+j+N/k,a[1][1])*k:Xi(w+j+(l?E:-E)/k,a[0][1])*k,A=Math.max(A,e)}if(s){let e=0;e=!l&&!c||l&&!c&&f?Xi(w+N/k,s[1][1])*k:Gi(w+(l?E:-E)/k,s[0][1])*k,A=Math.max(A,e)}}if(d){const e=Qi(S*k,g,y)/k;if(P=Math.max(P,e),a){let e=0;e=!l&&!c||c&&!l&&f?Gi(b+S*k+O,a[1][0])/k:Xi(b+(c?C:-C)*k+O,a[0][0])/k,P=Math.max(P,e)}if(s){let e=0;e=!l&&!c||c&&!l&&f?Xi(b+S*k,s[1][0])/k:Gi(b+(c?C:-C)*k,s[0][0])/k,P=Math.max(P,e)}}}C+=C<0?P:-P,E+=E<0?A:-A,r&&(f?N>S*k?C=(Ji(l,c)?-E:E)/k:E=(Ji(l,c)?-C:C)*k:u?(C=E/k,c=l):(E=C*k,l=c));const T=l?b+E:b,M=c?w+C:w;return{width:x+(l?-E:E),height:_+(c?-C:C),x:i[0]*E*(l?-1:1)+T,y:i[1]*C*(c?-1:1)+M}}(p,g,d,a,s,O,v,b),M=j!==C,L=A!==N,D=P!==k&&M,I=T!==E&&L;if(!(D||I||M||L))return;if((D||I||1===O[0]||1===O[1])&&(S.x=D?P:h.x,S.y=I?T:h.y,h.x=S.x,h.y=S.y,x.length>0)){const e=P-k,t=T-E;for(const n of x)n.position={x:n.position.x-e+O[0]*(j-C),y:n.position.y-t+O[1]*(A-N)},_.push(n)}if((M||L)&&(S.width=!M||l&&"horizontal"!==l?h.width:j,S.height=!L||l&&"vertical"!==l?h.height:A,h.width=S.width,h.height=S.height),m&&y.expandParent){const e=O[0]*(S.width??0);S.x&&S.x<e&&(h.x=e,p.x=p.x-(S.x-e));const t=O[1]*(S.height??0);S.y&&S.y<t&&(h.y=t,p.y=p.y-(S.y-t))}const q=function({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const a=e-t,s=n-o,l=[a>0?1:a<0?-1:0,s>0?1:s<0?-1:0];return a&&r&&(l[0]=-1*l[0]),s&&i&&(l[1]=-1*l[1]),l}({width:h.width,prevWidth:C,height:h.height,prevHeight:N,affectsX:g.affectsX,affectsY:g.affectsY}),R={...h,direction:q},B=f?.(e,R);!1!==B&&(u?.(e,R),o(S,_))}).on("end",e=>{d?.(e,{...h}),r?.({...h})});i.call(_)},destroy:function(){i.on(".drag",null)}}}({domNode:k.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:o,nodeOrigin:r,domNode:i}=_.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:o,nodeOrigin:r,paneDomNode:i}},onChange:(e,t)=>{const{triggerNodeChanges:n,nodeLookup:o,parentLookup:r,nodeOrigin:i}=_.getState(),a=[],s={x:e.x,y:e.y},l=o.get(x);if(l&&l.expandParent&&l.parentId){const t=l.origin??i,n=e.width??l.measured.width??0,c=e.height??l.measured.height??0,u=Pi([{id:l.id,parentId:l.parentId,rect:{width:n,height:c,...Qr({x:e.x??l.position.x,y:e.y??l.position.y},{width:n,height:c},l.parentId,o,t)}}],o,r,i);a.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==s.x&&void 0!==s.y){const e={id:x,type:"position",position:{...s}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){const t={id:x,type:"dimensions",resizing:!0,setAttributes:!p||("horizontal"===p?"width":"height"),dimensions:{width:e.width,height:e.height}};a.push(t)}for(const e of t){const t={...e,type:"position"};a.push(t)}n(a)},onEnd:({width:e,height:t})=>{const n={id:x,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}};_.getState().triggerNodeChanges([n])}})),S.current.update({controlPosition:O,boundaries:{minWidth:c,minHeight:u,maxWidth:d,maxHeight:f},keepAspectRatio:h,resizeDirection:p,onResizeStart:m,onResize:v,onResizeEnd:b,shouldResize:y}),()=>{S.current?.destroy()}},[O,c,u,d,f,h,m,v,b,y]);const j=O.split("-");return(0,o.jsx)("div",{className:be(["react-flow__resize-control","nodrag",...j,n,i]),ref:k,style:{...a,scale:C,...l&&{[E?"backgroundColor":"borderColor"]:l}},children:s})});const pc=e=>{const t=gc(),n=null==t?void 0:t.find(t=>t.trigger_value===e),o=`On "${null==n?void 0:n.trigger_label}" event fires`||"Trigger";return{nodes:[{id:"node_1",type:"trigger",position:{x:300,y:100},data:{label:`trigger: ${e}`,subtitle:o,triggerValue:e}},{id:"end_1",type:"end",position:{x:315,y:348},data:{label:"end_flow",subtitle:"Automation stops here"}}],edges:[{id:"edge_node_1-end_1",source:"node_1",target:"end_1",type:"smoothstep",markerEnd:{type:vr.ArrowClosed},style:{strokeWidth:2,stroke:"#94a3b8"},data:{}}]}};function gc(){var e;const{prefix:t}=f();return"undefined"!=typeof window&&window[t]&&Array.isArray(window[t].triggers)?window[t].triggers:(console.warn("Error accessing triggers data, using fallback"),(null===(e=he.poptics_ens_data)||void 0===e?void 0:e.triggers)||[])}const yc=(e,t)=>e.map(e=>{var n;const o={...e};if("receiverType"===e.name&&(null==t?void 0:t.email_receivers)&&(o.props={...e.props,options:t.email_receivers}),"delayUnit"===e.name&&(o.props={...e.props}),"delayCondition"===e.name&&(null==t?void 0:t.delay_dependencies)){const r=(null===(n=e.props)||void 0===n?void 0:n.options)||[],i=t.delay_dependencies||[];o.props={...e.props,options:[...r,...i]}}return o}),mc=(0,r.createContext)(void 0),vc=({children:e})=>{const[t,n]=(0,r.useState)([]),[i,a]=(0,r.useState)(null),[s,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)("insert"),[d,f]=(0,r.useState)(""),[h,p]=(0,r.useState)(!1),[g,y]=(0,r.useState)(null),m=(0,r.useMemo)(()=>gc(),[]),v=(0,r.useCallback)(()=>d?m.find(e=>e.trigger_value===d):null,[d,m]),b=(0,r.useCallback)(()=>{var e;return(null===(e=m.find(e=>e.trigger_value===d))||void 0===e?void 0:e.conditional_dependencies)||[]},[d,m]),w=(0,r.useCallback)(()=>{if(!i)return null;if("condition"===i.type){const e=i.data.conditionField||"";return b().find(t=>t.value===e)||null}if("action"===i.type){const e=i.data.actionType,t=v();return{type:"action",actionType:e,...(e=>{if(e)return ge[e]})(e),triggerData:t}}return null},[i,v,b]),x={flows:t,setFlows:n,addFlow:e=>{n(t=>[...t,e])},updateFlow:(e,t)=>{n(n=>n.map(n=>n.id===e?{...n,...t}:n))},removeFlow:e=>{n(t=>t.filter(t=>t.id!==e))},selectedNode:i,setSelectedNode:a,sidebarVisible:s,setSidebarVisible:l,sidebarMode:c,setSidebarMode:u,selectedTrigger:d,setSelectedTrigger:f,getTriggerData:v,getAvailableConditions:b,getCustomizationSettings:w,isLoading:h,setIsLoading:p,error:g,setError:y};return(0,o.jsx)(mc.Provider,{value:x,children:e})},bc=()=>{const e=(0,r.useContext)(mc);if(void 0===e)throw new Error("useNotificationFlowContext must be used within a NotificationFlowProvider");return e},wc=()=>{const{prefix:e}=f(),{flows:t,setFlows:n,addFlow:o,updateFlow:i,removeFlow:a,setIsLoading:s,setError:l}=bc(),c=(0,r.useRef)({listFlows:null,getFlow:null,updateFlow:null,deleteFlow:null,bulkDelete:null,cloneFlow:null,createFlow:null}),{api_version:u="",base_url:d="",plugin_slug:h="",nonce:p=""}="undefined"!=typeof window&&window[e]?window[e]:he.poptics_ens_data,g=new fe({baseUrl:d,apiVersion:u,pluginSlug:h,nonce:p}),[y,m]=(0,r.useState)({}),[v,b]=(0,r.useState)(),[w,x]=(0,r.useState)({trigger:"",status:"",searchKey:""}),_=e=>{m(t=>({...t,[e]:!0}))},k=e=>{m(t=>({...t,[e]:!1}))},E=e=>!!y[e],C=(0,r.useCallback)(async e=>{if(c.current.listFlows)return c.current.listFlows;_("listFlows");const t=e||w,o=(async()=>{var e,o,r;try{const{data:i}=await g.getFilteredFlows(t);return n((null==i?void 0:i.items)||[]),b({draft:(null===(e=null==i?void 0:i.status_count)||void 0===e?void 0:e.draft)||0,trash:(null===(o=null==i?void 0:i.status_count)||void 0===o?void 0:o.trash)||0,publish:(null===(r=null==i?void 0:i.status_count)||void 0===r?void 0:r.publish)||0}),{data:i}}catch(e){return console.error("Error fetching flows:",e),oe("Failed to load flows"),l("Failed to load flows"),{error:e}}finally{k("listFlows"),c.current.listFlows=null}})();return c.current.listFlows=o,o},[w]),N=(0,r.useCallback)(async e=>{_("getFlow");try{return await g.getFlowById(e)}catch(e){return console.error("Error fetching flow:",e),oe("Failed to load flow"),{error:e}}finally{k("getFlow")}},[g]),S=(0,r.useCallback)(async(e,t,n=!1)=>{_("updateFlow");try{const o=await g.updateFlow(e,t);ne("Flow saved successfully!"),i(e,o.data||t),n&&await C()}catch(e){return console.error("Error updating flow:",e),oe("Failed to save flow. Please try again."),l("Failed to save flow"),{error:e}}finally{k("updateFlow")}},[g,i,C]),O=(0,r.useCallback)(async e=>{_("deleteFlow");try{await g.deleteFlow(e),ne("Flow deleted successfully"),a(e)}catch(e){oe("Failed to delete flow: "+(e instanceof Error?e.message:"Unknown error")),l("Failed to delete flow"),console.error("Error deleting flow:",e)}finally{k("deleteFlow")}},[a]),j=(0,r.useCallback)(async e=>{_("cloneFlow");try{await g.cloneFlow(e),await C(),ne("Flow cloned successfully")}catch(e){oe("Failed to clone flow: "+(e instanceof Error?e.message:"Unknown error")),console.error("Error cloning flow:",e)}finally{k("cloneFlow")}},[C]),A=(0,r.useCallback)(async e=>{_("createFlow");try{const t=await g.createFlow(e);return ne("Flow created successfully"),(null==t?void 0:t.data)&&o(t.data),null==t?void 0:t.data}catch(e){oe("Failed to create flow: "+(e instanceof Error?e.message:"Unknown error")),l("Failed to create flow"),console.error("Error creating flow:",e)}finally{k("createFlow")}},[o]),P=(0,r.useCallback)(async e=>{_("bulkDelete");try{await g.bulkDeleteFlow(e),ne(`${e.length} flows deleted successfully`);const o=t.filter(t=>!e.includes(Number(null==t?void 0:t.id)));n(o)}catch(e){oe("Failed to delete flows: "+(e instanceof Error?e.message:"Unknown error")),l("Failed to delete flows"),console.error("Error bulk deleting flows:",e)}finally{k("bulkDelete")}},[a]),T=(0,r.useCallback)(e=>{x(t=>{const n={...t,...e};return C(n),n})},[]),M=(0,r.useCallback)(function(){let e=null;return(...t)=>{e&&clearTimeout(e),e=setTimeout(()=>{(e=>{T({searchKey:e})})(...t),e=null},500)}}(),[]),L=(0,r.useCallback)(e=>{T({status:e})},[]),D=(0,r.useCallback)(e=>{T({trigger:e})},[]);return{notificationFlows:t,fetchFlows:C,editFlow:S,cloneFlow:j,createFlow:A,getFlowById:N,deleteFlow:O,bulkDeleteFlows:P,refresh:C,statusCount:v,isFlowListLoading:()=>E("listFlows"),isFlowLoading:()=>E("getFlow"),isFlowSaving:()=>E("updateFlow"),isFlowDeleting:()=>E("deleteFlow"),isFlowCloning:()=>E("cloneFlow"),isFlowCreating:()=>E("createFlow"),isFlowBulkDeleting:()=>E("bulkDelete"),filterFlows:T,searchFlows:M,filterByStatus:L,filterByTrigger:D,currentFilters:w,isFilterApplied:!!(w.status||w.trigger||w.searchKey),resetFilters:()=>{const e={trigger:"",status:"",searchKey:""};x(e),C(e)}}},xc=({status:e,onChange:t,loading:n})=>{const{translationDomain:r}=f(),i="publish"===e;return(0,o.jsx)(v,{type:"secondary",onClick:()=>t(!i),isBusy:n,disabled:n,icon:(0,o.jsx)(i?_c:kc,{}),children:(0,s.__)(i?"Active":"Inactive",r)})};function _c(){return(0,o.jsx)("span",{className:"anticon",children:(0,o.jsxs)("svg",{width:"33",height:"18",viewBox:"0 0 33 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"switch-icon switch-icon--on",children:[(0,o.jsx)("rect",{width:"32.5",height:"20",rx:"10",className:"switch-background"}),(0,o.jsx)("circle",{cx:"22",cy:"10",r:"7.5",fill:"white"})]})})}function kc(){return(0,o.jsx)("span",{className:"anticon",children:(0,o.jsxs)("svg",{width:"33",height:"18",viewBox:"0 0 33 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("rect",{width:"32.5",height:"20",rx:"10",fill:"#c9cacc"}),(0,o.jsx)("circle",{cx:"10",cy:"10",r:"7.5",fill:"white"})]})})}const Ec=({flowName:e,flowStatus:t,onFlowNameChange:n,isLoading:i})=>{const[a,s]=(0,r.useState)(!1),[l,c]=(0,r.useState)(e),u=(0,r.useRef)(null),d=async()=>{l.trim()&&l.trim()!==e&&n(l.trim()),s(!1)};return(0,o.jsx)("div",{className:"flow-name-section",children:(0,o.jsxs)("div",a?{className:"flow-name-edit-mode",children:[(0,o.jsx)(E,{ref:u,value:l,onChange:e=>c(e),onPressEnter:d,onBlur:d,variant:"outlined",placeholder:"Enter flow name",className:"flow-name-input",size:"middle",disabled:i}),(0,o.jsx)("div",{className:"flow-name-actions",children:(0,o.jsx)(v,{size:"small",onClick:()=>{c(e),s(!1)},children:"Cancel"})})]}:{className:"flow-name-display",children:[(0,o.jsx)(S,{className:"flow-name",strong:!0,children:e}),(0,o.jsx)(le,{status:"publish"===t?"published":"draft",text:t.charAt(0).toUpperCase()+t.slice(1),size:"large"}),(0,o.jsx)(v,{type:"secondary",size:"small",icon:(0,o.jsx)(L,{}),onClick:()=>{s(!0),c(e),setTimeout(()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.focus()},0)},className:"edit-button",disabled:i})]})})},Cc=({flowName:e,onFlowNameChange:t,flowData:n,flowStatus:r,setFlowStatus:i,reactFlowInstanceRef:a,onBack:l})=>{const{editFlow:c,isFlowSaving:u}=wc(),{translationDomain:d}=f();return(0,o.jsxs)("div",{className:"notif-flow-top-navbar",children:[(0,o.jsxs)("div",{className:"notif-flow-top-navbar__left",children:[(0,o.jsx)(v,{type:"default",size:"small",icon:(0,o.jsx)(j,{}),onClick:()=>{l?l():window.history.length>1?window.history.back():window.location.href=window.location.origin+window.location.pathname.replace(/\/edit\/.*/,"")},className:"back-button"}),(0,o.jsx)(Ec,{flowName:e,flowStatus:r,onFlowNameChange:async e=>{if(t(e),(null==n?void 0:n.id)&&e.trim())try{await c(n.id,{...n,name:e.trim()},!1)}catch(e){console.error("Error saving flow name:",e)}},isLoading:u()})]}),(0,o.jsx)("div",{className:"notif-flow-top-navbar__right",children:(0,o.jsxs)(_,{children:[(0,o.jsx)(xc,{status:r,onChange:async e=>{const t=e?"publish":"draft";await c(n.id,{...n,status:t},!1),i(t)},loading:u()}),(0,o.jsx)(v,{type:"primary",onClick:async()=>{if(!a.current)return console.error("React Flow instance or flow ID not available"),void oe("Unable to save: Flow instance not available");const{getNodes:t,getEdges:o}=a.current,i=t(),s=o(),l=((e,t,n,o="draft")=>({name:e,status:o,flow_config:{nodes:t.map(e=>{var t,n,o,r,i;const a=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.label)||"";switch(e.type){case"trigger":return{id:e.id,type:"trigger",name:"trigger",data:{...e.data},position:e.position};case"condition":return{id:e.id,type:"condition",name:"condition",data:{field:(null===(n=e.data)||void 0===n?void 0:n.conditionField)||"",operator:(null===(o=e.data)||void 0===o?void 0:o.operator)||"==",value:(null===(r=e.data)||void 0===r?void 0:r.value)||"",...e.data},position:e.position};case"action":return{id:e.id,type:"action",name:"send_email"===a?"email":"delay",data:{actionType:(null===(i=e.data)||void 0===i?void 0:i.actionType)||"",...e.data},position:e.position};case"end":return{id:e.id,type:"end",name:"end",data:{...e.data},position:e.position};default:return{id:e.id,type:e.type||"action",name:a,data:{...e.data},position:e.position}}}),edges:n.map(e=>{const{source:t,target:n,sourceHandle:o,targetHandle:r,data:i,label:a,...s}=e;return{...s,source:t,target:n,...o?{sourceHandle:o}:{},...r?{targetHandle:r}:{},...i?{data:i}:{},...a?{label:a}:{}}})}}))(e,i,s,r);try{await c(null==n?void 0:n.id,l,!1)}catch(t){console.error("Error saving flow:",t)}},isBusy:u(),disabled:u(),children:u()?(0,s.__)("Saving...",d):(0,s.__)("Save Now",d)})]})})]})},Nc=({id:e,data:t,isConnectable:n,type:i})=>{const{translationDomain:a}=f(),[l,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)(!1),h=i||"end",p="end"!==h,g="trigger"!==h,y="condition"===h,m="trigger"!==h&&"end"!==h,v=((e,t)=>{switch(e){case"trigger":return"Automation Starts";case"condition":return"Conditional";case"end":return"End Automation";case"action":if("send_email"===t.actionType)return"Send Email";if("add_delay"===t.actionType)return"Add Delay";default:return"End"}})(h,t);return(0,o.jsxs)("div",{className:`flow-node flow-node--${h}`,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[m&&l&&(0,o.jsx)("button",{className:"node-delete-button",onClick:e=>{e.stopPropagation(),d(!0)},"aria-label":"Delete node",children:(0,o.jsx)(z,{})}),g&&(0,o.jsx)(As,{type:"target",position:br.Top,isConnectable:!!n}),(0,o.jsxs)("div",{className:"flow-node__content",children:[(0,o.jsx)("div",{className:"flow-node__icon",children:(()=>{switch(h){case"trigger":return(0,o.jsx)($,{});case"condition":return(0,o.jsx)(B,{});case"end":default:return(0,o.jsx)(V,{});case"action":return"send_email"===t.actionType?(0,o.jsx)(H,{}):(0,o.jsx)(F,{})}})()}),(0,o.jsxs)("div",{className:"flow-node__details",children:[(0,o.jsx)("div",{className:"flow-node__title",children:v}),(null==t?void 0:t.subtitle)&&(0,o.jsx)("div",{className:"flow-node__subtitle",children:t.subtitle})]})]}),p&&!y&&(0,o.jsx)(As,{type:"source",position:br.Bottom,isConnectable:!!n}),y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(As,{id:"false",type:"source",position:br.Left,isConnectable:!!n,className:"condition-handle-false",style:{left:-8}}),(0,o.jsx)(As,{id:"true",type:"source",position:br.Right,isConnectable:!!n,className:"condition-handle-true",style:{right:-8}})]}),(0,o.jsx)(ue,{isOpen:u,onClose:()=>d(!1),onConfirm:()=>{t.onDeleteNode&&t.onDeleteNode(e)},title:(0,s.__)("Delete Step",a),content:(0,s.__)("Are you sure you want to delete this step? This action cannot be undone.",a)})]})},Sc=({id:e,sourceX:t,sourceY:n,targetX:r,targetY:i,sourcePosition:a,targetPosition:s,style:l={},label:c,data:u,markerEnd:d})=>{const[f,h,p]=bi({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:i,targetPosition:s}),g=null==u?void 0:u.onPlusClick,y=null==u?void 0:u.condition,m=(null==u?void 0:u.animated)||!1,v={...l,...m&&{animation:"edgePulse 1s ease-in-out infinite, edgeGlow 1s ease-in-out infinite"},strokeWidth:2,stroke:"#94a3b8"};"true"===y?(v.stroke="#22B855",v.strokeWidth=m?4:2):"false"===y&&(v.stroke="#EF4444",v.strokeWidth=m?4:2);const b=g?-20:0,w=c?25:0;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Xs,{path:f,markerEnd:d,style:v,strokeWidth:2,className:m?"animated-edge":""}),c&&(0,o.jsx)(Fl,{children:(0,o.jsx)("div",{style:{position:"absolute",transform:`translate(-50%, -50%) translate(${h}px, ${p+b}px)`,background:"true"===y?"#22B855":"false"===y?"#EF4444":"#ffffff",color:y?"#ffffff":"#000000",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",fontWeight:500,pointerEvents:"all",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",zIndex:1001},children:c})}),g&&(0,o.jsx)(Fl,{children:(0,o.jsx)("div",{style:{position:"absolute",transform:`translate(-50%, -50%) translate(${h}px, ${p+w}px)`,pointerEvents:"all",zIndex:1e3},children:(0,o.jsx)("button",{className:"notif-flow-edge-plus-button",onClick:t=>{t.stopPropagation(),g(e)},"aria-label":"Add condition",children:(0,o.jsx)(q,{})})})})]})},Oc=e=>({autoFitView:(0,r.useCallback)(()=>{(null==e?void 0:e.current)&&setTimeout(()=>{e.current.fitView({padding:.1,duration:800})},100)},[e])}),jc={trigger:e=>(0,o.jsx)(Nc,{...e,type:"trigger"}),action:e=>(0,o.jsx)(Nc,{...e,type:"action"}),condition:e=>(0,o.jsx)(Nc,{...e,type:"condition"}),end:e=>(0,o.jsx)(Nc,{...e,type:"end"})},Ac=({onNodeClick:e,onPlusButtonClick:t,onInit:n})=>{const[i,a,s]=function(){const[e,t]=(0,r.useState)([]),n=(0,r.useCallback)(e=>t(t=>Ja(e,t)),[]);return[e,t,n]}(),[l,c,u]=function(){const[e,t]=(0,r.useState)([]),n=(0,r.useCallback)(e=>t(t=>es(e,t)),[]);return[e,t,n]}(),[d,f]=(0,r.useState)(null),{handleDeleteNode:h}=((e,t,n,o,i)=>{const{autoFitView:a}=Oc(i),s=(0,r.useCallback)((e,n=new Set)=>{if(n.has(e))return[];n.add(e);const o=[e];return t.filter(t=>t.source===e).forEach(e=>{const t=s(e.target,n);o.push(...t)}),o},[t]),l=(0,r.useCallback)(r=>{const i=t.filter(e=>e.target===r),l=s(r),c=e.filter(e=>!l.includes(e.id)),u=`end_${c.length+1}`,d={id:u,type:"end",position:{x:200,y:400},data:{label:"End Flow",subtitle:"Automation stops here"}},f=i.map(t=>{var n;const o=e.find(e=>e.id===t.source),r="condition"===(null==o?void 0:o.type);return{id:`edge_${t.source}_${u}`,source:t.source,target:u,type:t.type||"default",markerEnd:t.markerEnd,...r&&t.sourceHandle?{sourceHandle:t.sourceHandle}:{},...t.label?{label:t.label}:{},data:{...(null===(n=t.data)||void 0===n?void 0:n.condition)?{condition:t.data.condition}:{}}}});n([...c,d]),o(e=>[...e.filter(e=>!l.includes(e.source)&&!l.includes(e.target)),...f]),a()},[t,e,n,o,s,a]),c=(0,r.useCallback)(r=>{const i=t.filter(e=>e.target===r),s=t.filter(e=>e.source===r),l=[];i.forEach(t=>{s.forEach(n=>{var o;const r=e.find(e=>e.id===t.source),i="condition"===(null==r?void 0:r.type);l.push({id:`edge_${t.source}_${n.target}`,source:t.source,target:n.target,type:t.type||"default",...i&&t.sourceHandle?{sourceHandle:t.sourceHandle}:{},markerEnd:t.markerEnd,...t.label?{label:t.label}:{},data:{...(null===(o=t.data)||void 0===o?void 0:o.condition)?{condition:t.data.condition}:{}}})})}),n(e=>e.filter(e=>e.id!==r)),o(e=>[...e.filter(e=>e.source!==r&&e.target!==r),...l]),a()},[t,e,n,o,a]);return{handleDeleteNode:(0,r.useCallback)(t=>{const n=e.find(e=>e.id===t);"condition"===(null==n?void 0:n.type)?l(t):c(t)},[e,l,c])}})(i,l,a,c,d),p=(0,r.useCallback)((t,n)=>{"end"!==n.type&&e(n)},[e]),g=i.map(e=>({...e,data:{...e.data,onDeleteNode:h}})),y={default:Sc,smoothstep:Sc,straight:Sc,curved:Sc},m=l.map(e=>{var n,o;return{...e,data:{...e.data,onPlusClick:t,...(null===(n=e.data)||void 0===n?void 0:n.condition)?{condition:e.data.condition}:{}},...(null===(o=e.data)||void 0===o?void 0:o.condition)&&!e.label?{label:e.data.condition}:{}}}),v=(0,r.useCallback)(e=>{f({current:e}),n&&n(e)},[n]);return(0,o.jsxs)($l,{nodes:g,edges:m,onNodeClick:p,onNodesChange:s,onEdgesChange:u,nodeTypes:jc,edgeTypes:y,fitView:!0,onInit:v,connectionLineType:mr.SmoothStep,defaultEdgeOptions:{type:"default",markerEnd:{type:vr.ArrowClosed}},children:[(0,o.jsx)(Yl,{}),(0,o.jsx)(rc,{})]})},Pc=({onInsert:e})=>{const{getAvailableConditions:t}=bc(),n=t(),[i,a]=(0,r.useState)("action"),{translationDomain:l}=f();return(0,o.jsxs)("div",{className:"node-insertion-content",children:[(0,o.jsxs)("div",{className:"node-type-tabs",children:[(0,o.jsxs)("button",{className:"tab-button "+("action"===i?"active":""),onClick:()=>a("action"),children:["action"===i&&(0,o.jsx)(R,{className:"check-icon"}),"Action"]}),(0,o.jsxs)("button",{className:"tab-button "+("condition"===i?"active":""),onClick:()=>a("condition"),children:["condition"===i&&(0,o.jsx)(R,{className:"check-icon"}),"Condition"]})]}),(0,o.jsx)("div",{className:"node-type-header",children:(0,o.jsx)("h4",{children:"action"===i?"Available Actions":"Available Conditions"})}),(0,o.jsxs)("div",{className:"notif-flow-node-type-options",children:["condition"===i&&0===n.length&&(0,o.jsx)("p",{className:"notif-flow-no-conditions-message",children:(0,s.__)("No conditions available for this trigger.",l)}),(0,o.jsxs)("div",{className:"node-options-grid",children:["action"===i&&(0,o.jsx)(o.Fragment,{children:pe.map(t=>(0,o.jsx)("button",{className:"node-option",onClick:()=>null==e?void 0:e({type:"action",value:t.value,label:t.label}),children:t.label},t.value))}),"condition"===i&&(0,o.jsx)(o.Fragment,{children:n.map(t=>(0,o.jsx)("button",{className:"node-option",onClick:()=>null==e?void 0:e({type:"condition",value:t.value,label:t.label}),children:t.label},t.value))})]})]})]})},Tc=({onTriggerChange:e})=>{const{selectedTrigger:t}=bc(),[n,i]=(0,r.useState)(t),a=gc();(0,r.useEffect)(()=>{i(t)},[t]);const s=a.map(e=>({label:e.trigger_label,value:e.trigger_value}));return(0,o.jsx)("div",{className:"trigger-form",children:(0,o.jsxs)("div",{className:"trigger-form-field",children:[(0,o.jsxs)("label",{className:"trigger-form-label",children:["Select Trigger",(0,o.jsx)("span",{className:"required",children:"*"})]}),(0,o.jsx)(O,{value:n,placeholder:"Choose a trigger",options:s,onChange:t=>{const n=t.toString();i(n),e(n)}})]})})};var Mc=oa({exports:{}}.exports=function(){var e=6e4,t=36e5,n="millisecond",o="second",r="minute",i="hour",a="day",s="week",l="month",c="quarter",u="year",d="date",f="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|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,g={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])+"]"}},y=function(e,t,n){var o=String(e);return!o||o.length>=t?e:""+Array(t+1-o.length).join(n)+e},m={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),o=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+y(o,2,"0")+":"+y(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var o=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(o,l),i=n-r<0,a=t.clone().add(o+(i?-1:1),l);return+(-(o+(n-r)/(i?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:u,w:s,d:a,D:d,h:i,m:r,s:o,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},v="en",b={};b[v]=g;var w="$isDayjsObject",x=function(e){return e instanceof C||!(!e||!e[w])},_=function e(t,n,o){var r;if(!t)return v;if("string"==typeof t){var i=t.toLowerCase();b[i]&&(r=i),n&&(b[i]=n,r=i);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var s=t.name;b[s]=t,r=s}return!o&&r&&(v=r),r||!o&&v},k=function(e,t){if(x(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},E=m;E.l=_,E.i=x,E.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function g(e){this.$L=_(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[w]=!0}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var o=t.match(h);if(o){var r=o[2]-1||0,i=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],r,o[3]||1,o[4]||0,o[5]||0,o[6]||0,i)):new Date(o[1],r,o[3]||1,o[4]||0,o[5]||0,o[6]||0,i)}}return new Date(t)}(e),this.init()},y.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()},y.$utils=function(){return E},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return k(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<k(e)},y.$g=function(e,t,n){return E.u(e)?this[t]:this.set(n,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var n=this,c=!!E.u(t)||t,f=E.p(e),h=function(e,t){var o=E.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?o:o.endOf(a)},p=function(e,t){return E.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,y=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case u:return c?h(1,0):h(31,11);case l:return c?h(1,y):h(0,y+1);case s:var b=this.$locale().weekStart||0,w=(g<b?g+7:g)-b;return h(c?m-w:m+(6-w),y);case a:case d:return p(v+"Hours",0);case i:return p(v+"Minutes",1);case r:return p(v+"Seconds",2);case o:return p(v+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var s,c=E.p(e),f="set"+(this.$u?"UTC":""),h=(s={},s[a]=f+"Date",s[d]=f+"Date",s[l]=f+"Month",s[u]=f+"FullYear",s[i]=f+"Hours",s[r]=f+"Minutes",s[o]=f+"Seconds",s[n]=f+"Milliseconds",s)[c],p=c===a?this.$D+(t-this.$W):t;if(c===l||c===u){var g=this.clone().set(d,1);g.$d[h](p),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[E.p(e)]()},y.add=function(n,c){var d,f=this;n=Number(n);var h=E.p(c),p=function(e){var t=k(f);return E.w(t.date(t.date()+Math.round(e*n)),f)};if(h===l)return this.set(l,this.$M+n);if(h===u)return this.set(u,this.$y+n);if(h===a)return p(1);if(h===s)return p(7);var g=(d={},d[r]=e,d[i]=t,d[o]=1e3,d)[h]||1,y=this.$d.getTime()+n*g;return E.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var o=e||"YYYY-MM-DDTHH:mm:ssZ",r=E.z(this),i=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=n.meridiem,d=function(e,n,r,i){return e&&(e[n]||e(t,o))||r[n].slice(0,i)},h=function(e){return E.s(i%12||12,e,"0")},g=u||function(e,t,n){var o=e<12?"AM":"PM";return n?o.toLowerCase():o};return o.replace(p,function(e,o){return o||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return s+1;case"MM":return E.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,c,3);case"MMMM":return d(c,s);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(i);case"HH":return E.s(i,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return g(i,a,!0);case"A":return g(i,a,!1);case"m":return String(a);case"mm":return E.s(a,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,d,f){var h,p=this,g=E.p(d),y=k(n),m=(y.utcOffset()-this.utcOffset())*e,v=this-y,b=function(){return E.m(p,y)};switch(g){case u:h=b()/12;break;case l:h=b();break;case c:h=b()/3;break;case s:h=(v-m)/6048e5;break;case a:h=(v-m)/864e5;break;case i:h=v/t;break;case r:h=v/e;break;case o:h=v/1e3;break;default:h=v}return f?h:E.a(h)},y.daysInMonth=function(){return this.endOf(l).$D},y.$locale=function(){return b[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),o=_(e,t,!0);return o&&(n.$L=o),n},y.clone=function(){return E.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),N=C.prototype;return k.prototype=N,[["$ms",n],["$s",o],["$m",r],["$H",i],["$W",a],["$M",l],["$y",u],["$D",d]].forEach(function(e){N[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=_,k.isDayjs=x,k.unix=function(e){return k(1e3*e)},k.en=b[v],k.Ls=b,k.p={},k}());const Lc=({label:e,tooltip:t,className:n=""})=>(0,o.jsxs)("span",{className:`form-field-label ${n}`,style:{display:"flex",alignItems:"center"},children:[e,(()=>{if(!t)return null;const e="question"===t.icon?P:A;return(0,o.jsx)(a.Tooltip,{text:t.title,placement:t.placement||"top",delay:100,children:(0,o.jsx)("div",{children:(0,o.jsx)(e,{className:"form-field-tooltip-icon",style:{marginLeft:4,color:"#8c8c8c",cursor:"pointer",fontSize:"13px",display:"inline-flex",alignItems:"center"}})})})})()]}),Dc={Select:O,Input:E},Ic=()=>{const{getCustomizationSettings:e}=bc(),t=e(),n=(null==t?void 0:t.formFields)||[],r=null==t?void 0:t.triggerData,i=yc(n,r);return(0,o.jsx)("div",{className:"delay-action-form",children:(0,o.jsx)("div",{className:"delay-form-row",children:i.map((e,t)=>{const n=Dc[e.component];return n?(0,o.jsx)(te.Item,{name:e.name,label:e.tooltip?(0,o.jsx)(Lc,{label:e.label,tooltip:e.tooltip,required:e.required}):e.label,rules:e.rules,className:"notif-flow-form-item",children:(0,o.jsx)(n,{...e.props,className:`notif-flow-${e.component.toLowerCase()}`})},t):null})})})},qc=({triggerType:e,onVariableSelect:t})=>{var n;const r=gc(),i=(null===(n=null==r?void 0:r.find(t=>t.trigger_value===e))||void 0===n?void 0:n.trigger_data)||[];return 0===i.length?(0,o.jsx)("div",{className:"dynamic-variables-empty",children:"No variables available for this trigger"}):(0,o.jsx)("div",{className:"dynamic-variables-container",children:i.map(e=>(0,o.jsx)(a.Tooltip,{text:`Insert ${e.label} variable`,placement:"top",delay:100,children:(0,o.jsx)("div",{style:{display:"inline-block",position:"relative"},children:(0,o.jsx)(v,{className:"dynamic-variable-chip",onClick:()=>t(`{%${e.value}%}`),children:`{%${e.value}%}`})})},e.value))})},Rc={Select:O,Input:E,TagInput:({value:e=[],onChange:t,placeholder:n="Type and enter to add",disabled:i=!1,className:a="",style:s})=>{const[l,c]=(0,r.useState)(""),[u,d]=(0,r.useState)("");return(0,o.jsxs)("div",{className:`notif-flow-tag-input ${a}`,style:s,children:[(0,o.jsxs)("div",{className:`notif-flow-tag-input__container ${i?"notif-flow-tag-input__container--disabled":""} ${u?"notif-flow-tag-input__container--error":""}`,children:[e.map((n,r)=>(0,o.jsxs)("div",{className:"notif-flow-tag-input__tag",children:[(0,o.jsx)("span",{className:"notif-flow-tag-input__tag-text",children:n}),!i&&(0,o.jsx)("button",{type:"button",className:"notif-flow-tag-input__tag-remove",onClick:()=>(n=>{const o=e.filter((e,t)=>t!==n);null==t||t(o)})(r),"aria-label":`Remove ${n}`,children:"×"})]},r)),(0,o.jsx)("input",{type:"text",value:l,onChange:e=>{c(e.target.value),u&&d("")},onKeyDown:n=>{"Enter"===n.key&&l.trim()&&(n.preventDefault(),(()=>{const n=l.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.trim()))return void d("Please enter a valid email address");if(e.includes(n))return void d("This email address is already added");const o=[...e,n];null==t||t(o),c(""),d("")})())},placeholder:n,disabled:i,className:"notif-flow-tag-input__input"})]}),u&&(0,o.jsx)("div",{className:"notif-flow-tag-input__error",children:u})]})},richText:c},Bc=({setQuillRef:e,onVariableInsert:t})=>{const{getCustomizationSettings:n,selectedTrigger:i}=bc(),a=n(),s=(null==a?void 0:a.triggerData)||{},{values:l}=(()=>{const e=(0,r.useContext)(Q);if(!e)throw new Error("useFormContext must be used within a Form component");return e})();if(!s)return null;const c=yc(a.formFields||[],s);return(0,o.jsx)("div",{className:"notification-flow-customization-form-field",children:c.map(n=>{if(n.shouldRender&&!n.shouldRender(l))return null;const r=Rc[n.component];return r?"richText"===n.component?(0,o.jsxs)("div",{className:"notification-flow-email-body",children:[(0,o.jsx)(te.Item,{name:n.name,label:n.tooltip?(0,o.jsx)(Lc,{label:n.label,tooltip:n.tooltip}):n.label,rules:n.rules,className:"notif-flow-rich-text-form-item",children:(0,o.jsx)(r,{theme:"snow",...n.props||{},ref:t=>e(t)})}),(0,o.jsxs)("div",{className:"email-variable-section",children:[(0,o.jsx)("div",{className:"email-variable-header",children:(0,o.jsx)("p",{children:"Variables for Email Body Content"})}),(0,o.jsx)(qc,{triggerType:i,onVariableSelect:t})]})]},n.name):(0,o.jsx)(te.Item,{name:n.name,label:n.tooltip?(0,o.jsx)(Lc,{label:n.label,tooltip:n.tooltip}):n.label,rules:n.rules,className:"notif-flow-form-item",children:(0,o.jsx)(r,{...n.props,className:`notif-flow-${n.component.toLowerCase()}`})},n.name):null})})},$c=({nodeData:e,quillRef:t,setQuillRef:n,onVariableInsert:r})=>{if(!e)return null;const i=e.actionType;return i?"add_delay"===i?(0,o.jsx)(Ic,{}):(0,o.jsx)(Bc,{quillRef:t,setQuillRef:n,onVariableInsert:r}):null},zc=()=>{const{getCustomizationSettings:e}=bc(),t=e();if(!t)return null;const{type:n}=t,r=(e=>{switch(e){case"number":return ye;case"string":default:return me;case"date":return ve}})(n);return(0,o.jsx)("div",{className:"condition-form",children:(0,o.jsxs)("div",{className:"condition-form-row",children:[(0,o.jsx)(te.Item,{name:"operator",label:"Operator",className:"condition-operator",rules:[{required:!0,message:"Please select an operator"}],children:(0,o.jsx)(O,{options:r})}),"date"===n||(null==n?void 0:n.includes("date"))?(0,o.jsx)(te.Item,{name:"dateValue",label:"Value",className:"condition-value",rules:[{required:!0,message:"Please select a date"}],children:(0,o.jsx)(C,{style:{width:"100%"}})}):(0,o.jsx)(te.Item,{name:"value",label:"Value",className:"condition-value",rules:[{required:!0,message:"Please enter a value"}],children:(0,o.jsx)(E,{type:"number"===n?"number":"text",style:{width:"100%"}})})]})})},Fc=({visible:e,onClose:t,nodeType:n,nodeData:i,onSave:a,mode:s="edit",onInsert:l,onTriggerChange:c})=>{const[u]=te.useForm(),[d,f]=(0,r.useState)(null),{handleVariableInsert:h}=(e=>({handleVariableInsert:(0,r.useCallback)(t=>{if(e){const n=e.getEditor(),o=n.getSelection(),r=o?o.index:0;n.insertText(r,t),n.setSelection(r+t.length)}},[e])}))(d),{initializeForm:p}=((e,t,n,o)=>{const{getCustomizationSettings:i}=bc(),a=i();return{initializeForm:(0,r.useCallback)(()=>{if(n&&"edit"===o){e.resetFields();const n={label:(null==t?void 0:t.label)||"",subtitle:(null==t?void 0:t.subtitle)||"",operator:(null==t?void 0:t.operator)||"=",value:(null==t?void 0:t.value)||"",..."date"===(null==a?void 0:a.type)&&(null==t?void 0:t.value)?{dateValue:t.value?Mc(t.value,"YYYY-MM-DD"):null}:{}};t&&Object.keys(t).forEach(e=>{"label"!==e&&"subtitle"!==e&&(n[e]=t[e])}),e.setFieldsValue(n)}},[n,t,a,e,o])}})(u,i,e,s),{handleSave:g}=((e,t,n,o)=>{const{getCustomizationSettings:i}=bc(),a=i();return{handleSave:(0,r.useCallback)(()=>{e.validateFields().then(e=>{var r,i,s;if("date"===(null==a?void 0:a.type)&&e.dateValue&&(e.value=Mc(e.dateValue).format("YYYY-MM-DD"),delete e.dateValue),"condition"===t&&a){const t=a.label||"",n=(e=>{switch(e){case"equal":return"=";case"not_equal":return"≠";case"greater_then":return">";case"greater_equal":return"≥";case"less_then":return"<";case"less_equal":return"≤";case"before":return"before";case"after":return"after";default:return e}})(e.operator),o="date"===(null==a?void 0:a.type)?new Date(e.value).toLocaleDateString():e.value||"";e.subtitle=`${t} ${n} ${o}`}if("action"===t){const t=(null==n?void 0:n.actionType)||"";if("add_delay"===t&&e.delay&&e.delayUnit){let t=`Wait for ${e.delay} ${e.delayUnit}`;if(e.delayCondition&&e.delayDependency){const n=(null===(s=null===(i=null===(r=null==a?void 0:a.triggerData)||void 0===r?void 0:r.delay_dependencies)||void 0===i?void 0:i.find(t=>t.value===e.delayDependency))||void 0===s?void 0:s.label)||e.delayDependency;t+=` ${e.delayCondition} ${n}`}e.subtitle=t}else"send_email"===t&&e.from&&(e.subtitle=`From: ${e.from}`)}null==o||o(e)})},[e,t,a,n,o])}})(u,n,i,a);(0,r.useEffect)(()=>{p()},[e,i,u,s]);const y="send_email"===(null==i?void 0:i.actionType)?520:460;return(0,o.jsx)(se,{open:e,width:y,zIndex:99999,title:(0,o.jsx)(Vc,{mode:s,nodeType:n}),placement:"right",onClose:t,className:"notif-flow-node-sidebar "+("insert"===s?"insert-mode":"edit-mode"),footer:(0,o.jsx)(Uc,{mode:s,onClose:t,onSave:g,nodeType:n}),children:"insert"===s?(0,o.jsx)(Pc,{onInsert:l}):"trigger"===n?(0,o.jsx)(Tc,{onTriggerChange:c||(()=>{})}):(0,o.jsx)(Zc,{form:u,nodeType:n,nodeData:i,quillRef:d,setQuillRef:f,onVariableInsert:h})})},{translationDomain:Hc}=f(),Vc=({mode:e,nodeType:t})=>{const{getCustomizationSettings:n}=bc(),r=n();return"insert"===e?(0,o.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:(0,s.__)("Add New Node",Hc)}):"trigger"===t?(0,o.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:(0,s.__)("Change Trigger",Hc)}):(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.__)("Edit",Hc)," ",null==r?void 0:r.label]})},Uc=({mode:e,onClose:t,onSave:n,nodeType:r})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v,{variant:"secondary",onClick:t,children:(0,s.__)("Cancel",Hc)}),"edit"===e&&"trigger"!==r&&(0,o.jsx)(v,{type:"primary",onClick:n,children:(0,s.__)("Save",Hc)}),"edit"===e&&"trigger"===r&&(0,o.jsx)(v,{type:"primary",onClick:n,children:(0,s.__)("Change Trigger",Hc)})]}),Zc=({form:e,nodeType:t,nodeData:n,quillRef:r,setQuillRef:i,onVariableInsert:a})=>(0,o.jsxs)(te,{form:e,layout:"vertical",children:["condition"===t&&(0,o.jsx)(zc,{}),"action"===t&&(0,o.jsx)($c,{nodeData:n,quillRef:r,setQuillRef:i,onVariableInsert:a})]}),Kc=()=>(0,o.jsxs)("div",{className:"builder-page-skeleton",children:[(0,o.jsxs)("div",{className:"notif-flow-top-navbar",children:[(0,o.jsxs)("div",{className:"notif-flow-top-navbar__left",children:[(0,o.jsx)(v,{type:"tertiary",icon:(0,o.jsx)(j,{}),disabled:!0}),(0,o.jsx)(w,{active:!0,style:{width:200}})]}),(0,o.jsx)("div",{className:"notif-flow-top-navbar__right",children:(0,o.jsxs)(_,{children:[(0,o.jsx)(x,{active:!0}),(0,o.jsx)(x,{active:!0})]})})]}),(0,o.jsx)("div",{className:"builder-page__body",style:{height:"calc(100vh - 64px)",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,o.jsx)(k,{size:"large",tip:"Loading flow data..."})})]}),Wc=({flowId:e,onBack:t})=>{const[n,i]=(0,r.useState)("Untitled"),[a,s]=(0,r.useState)("draft"),[l,c]=(0,r.useState)(null),[u,d]=(0,r.useState)(null),f=(0,r.useRef)(null),{getFlowById:h,isFlowLoading:p}=wc(),{selectedNode:g,setSelectedNode:y,sidebarVisible:m,setSidebarVisible:v,sidebarMode:b,setSelectedTrigger:w}=bc(),{edgeToSplit:x,setEdgeToSplit:_,handleSidebarClose:k,handleNodeClick:E,handlePlusButtonClick:C}=(e=>{const{setSidebarVisible:t,sidebarMode:n,setSidebarMode:o}=bc(),[i,a]=(0,r.useState)(null),s=(0,r.useCallback)(n=>{e(n),n.type,o("edit"),t(!0)},[e,o,t]),l=(0,r.useCallback)(e=>{e&&a(e),o("insert"),t(!0)},[o,t]),c=(0,r.useCallback)(()=>{t(!1),"insert"===n&&a(null)},[n]);return{edgeToSplit:i,setEdgeToSplit:a,handleSidebarClose:c,handleNodeClick:s,handlePlusButtonClick:l}})(y),{loadFlowData:N}=((e,t,n,o,i,a,s)=>({loadFlowData:(0,r.useCallback)(async()=>{if(e)try{const{data:r}=await t(e);if(r&&(n(r.name||"Untitled"),o(r.trigger||""),i(r.status||"draft"),a(r),r.flow_config&&s)){const{setNodes:e,setEdges:t}=s;Array.isArray(r.flow_config.nodes)&&e(r.flow_config.nodes),Array.isArray(r.flow_config.edges)&&t(r.flow_config.edges.map(e=>{var t,n;return"true"===(null===(t=e.data)||void 0===t?void 0:t.condition)?{...e,sourceHandle:"true"}:"false"===(null===(n=e.data)||void 0===n?void 0:n.condition)?{...e,sourceHandle:"false"}:e}))}}catch(e){console.error("Error loading flow:",e)}},[e,t,n,o,i,a,s])}))(e,h,i,w,s,c,u),{handleInsertNode:S}=((e,t,n)=>{const{setSelectedNode:o,setSidebarMode:i,setSidebarVisible:a}=bc(),s=gc(),{autoFitView:l}=Oc(e),c=(0,r.useCallback)(t=>{const n=t.map(e=>({...e,data:{...e.data,animated:!0}}));return setTimeout(()=>{if(e.current){const{setEdges:t}=e.current;t(e=>e.map(e=>({...e,data:{...e.data,animated:!1}})))}},2e3),n},[e]),u=(0,r.useCallback)((e,t,n,o)=>({id:e,type:t.type,position:n,data:{label:"condition"===t.type?(null==o?void 0:o.value)||"Conditional":t.value,subtitle:t.label,..."condition"===t.type&&{operator:"=",value:"",conditionField:t.value},..."action"===t.type&&{actionType:t.value}}}),[]),d=(0,r.useCallback)((e,t,n)=>{var o;return{id:`edge_${e.id}-${t}`,source:e.id,target:t,type:n.type||"default",markerEnd:n.markerEnd,...n.sourceHandle&&{sourceHandle:n.sourceHandle},data:{...(null===(o=n.data)||void 0===o?void 0:o.condition)&&{condition:n.data.condition}}}},[]),f=(0,r.useCallback)((t,n,o,r,i,a=300,s=180)=>{var u;const{getNodes:d,setNodes:f,setEdges:h}=e.current,p={...n,position:{x:t.position.x+a,y:t.position.y+s}},g={id:`end_${(null===(u=d())||void 0===u?void 0:u.length)+1}`,type:"end",position:{x:t.position.x-a,y:t.position.y+s},data:{label:"End Flow",subtitle:"Automation stops here"}},y={id:`edge_${t.id}-${n.id}_true`,source:t.id,sourceHandle:"true",target:n.id,type:"smoothstep",markerEnd:{type:vr.ArrowClosed},label:"True",data:{condition:"true",conditionInfo:i?{field:i.label,operator:"=",value:""}:void 0}},m={id:`edge_${t.id}-${g.id}_false`,source:t.id,sourceHandle:"false",target:g.id,type:"smoothstep",markerEnd:{type:vr.ArrowClosed},label:"false",data:{condition:"false",conditionInfo:i?{field:i.label,operator:"=",value:""}:void 0}},v=d().map(e=>e.id===n.id?p:e),b=c([o,y,m]);f([...v,t,g]),h(e=>[...e.filter(e=>e.id!==r),...b]),l()},[e,l,c]),h=(0,r.useCallback)((t,n,o,r,i,a=180)=>{var s,u,d;const{getNodes:f,setNodes:h,setEdges:p}=e.current,g={id:`edge_${t.id}-${n.id}`,source:t.id,target:n.id,type:"smoothstep",markerEnd:i.markerEnd,...(null===(s=i.data)||void 0===s?void 0:s.condition)&&{label:null===(u=i.data)||void 0===u?void 0:u.condition},data:{...(null===(d=i.data)||void 0===d?void 0:d.condition)&&{condition:i.data.condition}}},y={...n,position:{x:n.position.x,y:t.position.y+a}},m=f().map(e=>e.id===n.id?y:e),v=c([o,g]);h([...m,t]),p(e=>[...e.filter(e=>e.id!==r),...v]),l()},[e,l,c]);return{handleInsertNode:(0,r.useCallback)(r=>{var l,c;if(!e.current||!t)return console.error("React Flow instance or edge not available"),a(!1),void n(null);const{getNodes:p,getEdges:g}=e.current,y=g().find(e=>e.id===t);if(!y)return console.error("Edge not found:",t),a(!1),void n(null);const m=p().find(e=>e.id===y.source),v=p().find(e=>e.id===y.target);if(!m||!v)return console.error("Source or target node not found"),a(!1),void n(null);const b=(m.position.x+v.position.x)/2,w=m.position.y+180,x=(null===(l=s.find(e=>""===e.trigger_value))||void 0===l?void 0:l.conditional_dependencies)||[];let _;"condition"===r.type&&(_=x.find(e=>e.value===r.value));const k=`node_${(null===(c=p())||void 0===c?void 0:c.length)+1}`,E=u(k,r,{x:b,y:w},_),C=d(m,k,y);"condition"===r.type?f(E,v,C,t,_,300,180):h(E,v,C,t,y,180),o(E),i("edit"),a(!0),n(null)},[e,t,s,u,d,f,h,o,i,a,n,l,c])}})(f,x,_),O=(0,r.useCallback)(e=>{w(e),l&&c(t=>({...t,trigger:e}))},[w,l]),{showConfirmation:j,newTrigger:A,currentTrigger:P,handleTriggerChange:T,handleTriggerSave:M,handleConfirmTriggerChange:L,handleCancelTriggerChange:D}=((e,t,n,o)=>{const[i,a]=(0,r.useState)(!1),[s,l]=(0,r.useState)(""),[c,u]=(0,r.useState)(""),d=(0,r.useCallback)(e=>{l(e)},[]),f=(0,r.useCallback)(()=>{var t,o,r,i;const s=(null===(i=null===(r=null===(o=null===(t=e.current)||void 0===t?void 0:t.getNodes())||void 0===o?void 0:o[0])||void 0===r?void 0:r.data)||void 0===i?void 0:i.label)||"";u(s),n&&n(),setTimeout(()=>{a(!0)},100)},[e,n]),h=(0,r.useCallback)(()=>{if(!e.current)return;const{setNodes:r,setEdges:i}=e.current,l=pc(s);r(l.nodes),i(l.edges),t(s),o&&o(l.nodes[0]),a(!1),n&&n()},[s,e,t,n,o]),p=(0,r.useCallback)(()=>{a(!1),l(""),u("")},[]);return{showConfirmation:i,newTrigger:s,currentTrigger:c,handleTriggerChange:d,handleTriggerSave:f,handleConfirmTriggerChange:h,handleCancelTriggerChange:p}})(f,O,k,y);(0,r.useEffect)(()=>{e&&N()},[e]);const I=(0,r.useCallback)(e=>{if(g&&f.current){if("trigger"===g.type)return void M();const{setNodes:t}=f.current;t(t=>t.map(t=>t.id===g.id?{...t,data:{...t.data,...e,..."action"===t.type&&{actionType:t.data.actionType}}}:t)),v(!1),y(null)}},[g,v,y,M]),q=(0,r.useCallback)(e=>{if(d(e),f.current=e,null==l?void 0:l.flow_config){const{setNodes:t,setEdges:n}=e;Array.isArray(l.flow_config.nodes)&&t(l.flow_config.nodes),Array.isArray(l.flow_config.edges)&&n(l.flow_config.edges)}},[l]);return p()?(0,o.jsx)(Kc,{}):(0,o.jsxs)(re,{children:[(0,o.jsxs)("div",{className:"builder-page",children:[(0,o.jsx)(Cc,{flowName:n,onFlowNameChange:i,flowData:l,flowStatus:a,setFlowStatus:s,reactFlowInstanceRef:f,onBack:t}),(0,o.jsxs)("div",{className:"builder-page__body",children:[(0,o.jsx)("div",{className:"builder-page__canvas",children:(0,o.jsx)(Ac,{onNodeClick:E,onPlusButtonClick:C,onInit:q})}),(0,o.jsx)(Fc,{visible:m,onClose:k,nodeType:g?(R=g.type,R?["trigger","end","condition","action"].includes(R)?R:"end":"action"):void 0,nodeData:null==g?void 0:g.data,onSave:I,mode:b,onInsert:S,onTriggerChange:T})]})]}),(0,o.jsx)(de,{open:j,onClose:D,onConfirm:L,currentTrigger:P,newTrigger:A})]});var R},Yc=({open:e,onClose:t,onCreate:n})=>{const[r]=te.useForm(),{createFlow:i,isFlowCreating:a}=wc(),s=gc(),l=()=>{r.resetFields(),t()},c=(0,o.jsxs)("div",{className:"form-actions__buttons",children:[(0,o.jsx)(v,{type:"secondary",onClick:l,children:"Cancel"}),(0,o.jsx)(v,{type:"primary",isBusy:a(),onClick:async()=>{try{const e=await r.validateFields(),o=pc(e.trigger),a={...e,flow_config:{nodes:o.nodes,edges:o.edges}},s=await i(a);r.resetFields(),t(),s&&s.id&&n(s.id)}catch(e){console.error("Error creating flow:",e)}},children:"Create"})]});return(0,o.jsx)(Y,{open:e,title:"Create New Automation",onClose:l,footer:c,className:"create-flow-modal",centered:!0,width:520,children:(0,o.jsxs)(te,{form:r,layout:"vertical",children:[(0,o.jsx)(ee,{label:"Flow Name",name:"name",rules:[{required:!0,message:"Please enter flow name"}],children:(0,o.jsx)(E,{placeholder:"e.g. Welcome Email for Signup",size:"large"})}),(0,o.jsx)(ee,{label:"Trigger Event",name:"trigger",rules:[{required:!0,message:"Please select a trigger"}],children:(0,o.jsx)(O,{placeholder:"Select a trigger",size:"large",options:(null==s?void 0:s.map(e=>({value:e.trigger_value,label:e.trigger_label})))||[]})})]})})},Xc=({onEdit:e})=>{const{translationDomain:t}=f(),{flows:n}=bc(),{cloneFlow:i,deleteFlow:a,bulkDeleteFlows:l,editFlow:c,isFlowListLoading:u,isFlowSaving:d,statusCount:h,isFlowCloning:p,isFlowDeleting:g,fetchFlows:y,filterByStatus:m,searchFlows:b,isFilterApplied:w,resetFilters:x,isFlowBulkDeleting:_}=wc(),{helpDocUrl:k,helpVideoUrl:C}=f(),[N,S]=(0,r.useState)(!1),[j,A]=(0,r.useState)([]),[P,D]=(0,r.useState)(!1),[R,B]=(0,r.useState)(!1),[$,z]=(0,r.useState)(null),[F,H]=(0,r.useState)(""),[V,U]=(0,r.useState)(""),Z=h,K=[{title:"Automations",dataIndex:"name",key:"name",render:(t,n)=>(0,o.jsx)("span",{onClick:()=>e(n.id),className:"notif-flow-automation-name",children:t})},{title:"Trigger",dataIndex:"trigger",key:"trigger"},{title:"Status",dataIndex:"status",key:"status",render:e=>(0,o.jsx)(le,{status:"publish"===e?"published":"draft",text:e.charAt(0).toUpperCase()+e.slice(1),size:"large"})},{title:"Draft/Published",dataIndex:"status",key:"status-toggle",render:(e,t)=>(0,o.jsx)(X,{checked:"publish"===e,onChange:async e=>{const n=e?"publish":"draft";await c(t.id,{...t,status:n},!0)},size:"small"})},{title:"Action",key:"actions",dataIndex:"id",render:t=>(0,o.jsxs)("div",{className:"wp-table-actions",children:[(0,o.jsx)(v,{type:"primary",size:"small",variant:"secondary",icon:(0,o.jsx)(L,{}),onClick:()=>{e(t)},children:"Edit"}),(0,o.jsx)(G,{trigger:["click"],menu:{items:[{key:"clone",label:"Clone",icon:(0,o.jsx)(T,{}),onClick:()=>{i(t)}},{key:"delete",label:"Delete",icon:(0,o.jsx)(M,{}),onClick:()=>(e=>{z(e),D(!0)})(t)}]},style:{position:"relative"},className:"notif-flow-dropdown-relative",children:(0,o.jsx)(v,{type:"secondary",size:"small",icon:(0,o.jsx)(I,{}),className:"automation-more-btn"})})]})}],Y={selectedRowKeys:j,onChange:e=>{A(e)}};return(0,r.useEffect)(()=>{y()},[]),(0,o.jsx)(re,{children:(0,o.jsxs)("div",{className:"automation-list",children:[u()||n&&0!==n.length||w?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"automation-list__header",children:[(0,o.jsxs)("div",{className:"filter-search-group",children:[(0,o.jsx)(O,{value:V,placeholder:"All",className:"status-filter-select",onChange:e=>{U(e),m(e)},options:[{value:"",label:"All"},{value:"publish",label:(0,s.__)("Publish",t)+` (${null==Z?void 0:Z.publish})`},{value:"draft",label:(0,s.__)("Draft",t)+` (${null==Z?void 0:Z.draft})`}],disabled:u()}),(0,o.jsx)(E,{type:"search",placeholder:"Search",className:"automation-search",value:F,onChange:e=>{const t=e.toString();H(t),b(t)},allowClear:!0,disabled:u()})]}),(0,o.jsx)(v,{type:"primary",onClick:()=>S(!0),icon:(0,o.jsx)(q,{}),children:(0,s.__)("Create New Automation",t)})]}),j.length>0&&(0,o.jsxs)("div",{className:"bulk-actions-bar",children:[(0,o.jsx)(v,{danger:!0,type:"primary",className:"bulk-delete-btn",onClick:()=>{j.length>0&&B(!0)},children:(0,s.__)("Bulk Delete",t)}),(0,o.jsxs)("span",{className:"selected-count",children:[j.length," ",(0,s.__)("item",t),1!==j.length?"s":""," ",(0,s.__)("selected",t)]})]}),(0,o.jsx)(W,{className:"automation-list__table",dataSource:n,rowSelection:Y,columns:K,rowKey:"id",onClearFilters:()=>{H(""),x()},pagination:!1,loading:u()||d()||p()||g()||_()||u(),onRow:t=>({onClick:n=>{const o=n.target,r=o.closest(".notif-flow-dropdown-item")||o.closest(".notif-flow-dropdown-menu")||o.closest(".notif-flow-dropdown-trigger");o.closest(".wp-table-actions")||o.closest(".notif-flow-table-selection-cell")||o.closest(".notif-flow-switch")||o.closest("input[type='checkbox']")||o.closest("button")||r||e(t.id)}})})]}):(0,o.jsx)(ce,{onCreateClick:()=>S(!0),onHelpClick:()=>{window.open(k,"_blank")},videoUrl:C,videoTooltip:(0,s.__)("How to create an email automation",t)}),(0,o.jsx)(Yc,{open:N,onClose:()=>S(!1),onCreate:t=>{S(!1),e(t)}}),(0,o.jsx)(ue,{isOpen:P,onClose:()=>D(!1),onConfirm:async()=>{$&&(await a($),z(null))},title:(0,s.__)("Delete Flow",t),content:(0,s.__)("Are you sure you want to delete this flow?",t)}),(0,o.jsx)(ue,{isOpen:R,onClose:()=>B(!1),onConfirm:async()=>{try{await l(j),A([])}catch(e){console.error("Bulk delete failed:",e)}},title:(0,s.__)("Delete Selected Items",t),content:`${(0,s.__)("Are you sure you want to delete",t)} ${j.length} ${(0,s.__)("item",t)}${1!==j.length?"s":""}?`})]})})},Gc=({children:e})=>(0,o.jsx)(vc,{children:e});p()}}]); |