@yoopta/link 4.9.9 → 6.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { SlateEditor, YooEditor } from '@yoopta/editor';
2
- import { Location } from 'slate';
3
- import { LinkElement, LinkElementProps } from '../types';
1
+ import type { SlateEditor, YooEditor } from '@yoopta/editor';
2
+ import type { Location } from 'slate';
3
+ import type { LinkElement, LinkElementProps } from '../types';
4
4
  type LinkElementOptions = {
5
5
  props: Omit<LinkElementProps, 'nodeType'>;
6
6
  };
@@ -18,4 +18,4 @@ export type LinkCommands = {
18
18
  };
19
19
  export declare const LinkCommands: LinkCommands;
20
20
  export {};
21
- //# sourceMappingURL=index.d.ts.map
21
+ //# sourceMappingURL=link-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-commands.d.ts","sourceRoot":"","sources":["../../src/commands/link-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE9D,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;CAC3C,CAAC;AAEF,KAAK,iBAAiB,GAAG,kBAAkB,GAAG;IAC5C,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,WAAW,CAAC;IACnF,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpE,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACxE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAgF1B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,6 @@
1
- import { Link } from './plugin';
2
- import './styles.css';
1
+ import { Link } from './plugin/link-plugin';
3
2
  import { LinkElement, LinkElementProps } from './types';
4
- declare module 'slate' {
5
- interface CustomTypes {
6
- Element: LinkElement;
7
- }
8
- }
9
- export { LinkCommands } from './commands';
3
+ export { LinkCommands } from './commands/link-commands';
10
4
  export { LinkElement, LinkElementProps };
11
5
  export default Link;
12
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,WAAW,CAAC;KACtB;CACF;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;AAEzC,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;AAEzC,eAAe,IAAI,CAAC"}
package/dist/index.js CHANGED
@@ -1,32 +1 @@
1
- import{generateId as e,useYooptaEditor as t,useYooptaTools as n,Blocks as r,UI as o,Elements as i,findSlateBySelectionPath as s,useYooptaReadOnly as a,YooptaPlugin as l,serializeTextNodes as c,deserializeTextNodes as f}from"@yoopta/editor";import{jsxs as u,jsx as p}from"react/jsx-runtime";import*as d from"react";import{forwardRef as h,createElement as g,useLayoutEffect as y,useEffect as m,useRef as v,useState as b}from"react";import*as w from"react-dom";
2
- /*!
3
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4
- *
5
- * Copyright (c) 2014-2017, Jon Schlinkert.
6
- * Released under the MIT License.
7
- */function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e){var t,n;return!1!==x(e)&&(void 0===(t=e.constructor)||!1!==x(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}var _=Symbol.for("immer-nothing"),P=Symbol.for("immer-draftable"),k=Symbol.for("immer-state");function j(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var E=Object.getPrototypeOf;function S(e){return!!e&&!!e[k]}function R(e){return!!e&&(T(e)||Array.isArray(e)||!!e[P]||!!e.constructor?.[P]||z(e)||M(e))}var A=Object.prototype.constructor.toString();function T(e){if(!e||"object"!=typeof e)return!1;const t=E(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===A}function C(e,t){0===N(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function N(e){const t=e[k];return t?t.type_:Array.isArray(e)?1:z(e)?2:M(e)?3:0}function L(e,t){return 2===N(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function D(e,t,n){const r=N(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function z(e){return e instanceof Map}function M(e){return e instanceof Set}function F(e){return e.copy_||e.base_}function B(e,t){if(z(e))return new Map(e);if(M(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&T(e)){if(!E(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[k];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const o=r[t],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(E(e),n)}function q(e,t=!1){return V(e)||S(e)||!R(e)||(N(e)>1&&(e.set=e.add=e.clear=e.delete=W),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>q(t,!0)))),e}function W(){j(2)}function V(e){return Object.isFrozen(e)}var I,$={};function H(e){const t=$[e];return t||j(0),t}function Z(){return I}function J(e,t){t&&(H("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function K(e){U(e),e.drafts_.forEach(Y),e.drafts_=null}function U(e){e===I&&(I=e.parent_)}function X(e){return I={drafts_:[],parent_:I,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Y(e){const t=e[k];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function G(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[k].modified_&&(K(t),j(4)),R(e)&&(e=Q(t,e),t.parent_||te(t,e)),t.patches_&&H("Patches").generateReplacementPatches_(n[k].base_,e,t.patches_,t.inversePatches_)):e=Q(t,n,[]),K(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_?e:void 0}function Q(e,t,n){if(V(t))return t;const r=t[k];if(!r)return C(t,((o,i)=>ee(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return te(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),C(o,((o,s)=>ee(e,r,t,o,s,n,i))),te(e,t,!1),n&&e.patches_&&H("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ee(e,t,n,r,o,i,s){if(S(o)){const s=Q(e,o,i&&t&&3!==t.type_&&!L(t.assigned_,r)?i.concat(r):void 0);if(D(n,r,s),!S(s))return;e.canAutoFreeze_=!1}else s&&n.add(o);if(R(o)&&!V(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Q(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||te(e,o)}}function te(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&q(t,n)}var ne={get(e,t){if(t===k)return e;const n=F(e);if(!L(n,t))return function(e,t,n){const r=ie(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!R(r)?r:r===oe(e.base_,t)?(ae(e),e.copy_[t]=le(r,e)):r},has:(e,t)=>t in F(e),ownKeys:e=>Reflect.ownKeys(F(e)),set(e,t,n){const r=ie(F(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=oe(F(e),t),s=r?.[k];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||L(e.base_,t)))return!0;ae(e),se(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==oe(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ae(e),se(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=F(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){j(11)},getPrototypeOf:e=>E(e.base_),setPrototypeOf(){j(12)}},re={};function oe(e,t){const n=e[k];return(n?F(n):e)[t]}function ie(e,t){if(!(t in e))return;let n=E(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=E(n)}}function se(e){e.modified_||(e.modified_=!0,e.parent_&&se(e.parent_))}function ae(e){e.copy_||(e.copy_=B(e.base_,e.scope_.immer_.useStrictShallowCopy_))}C(ne,((e,t)=>{re[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),re.deleteProperty=function(e,t){return re.set.call(this,e,t,void 0)},re.set=function(e,t,n){return ne.set.call(this,e[0],t,n,e[0])};function le(e,t){const n=z(e)?H("MapSet").proxyMap_(e,t):M(e)?H("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Z(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ne;n&&(o=[r],i=re);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:Z()).drafts_.push(n),n}function ce(e){if(!R(e)||V(e))return e;const t=e[k];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=B(e,t.scope_.immer_.useStrictShallowCopy_)}else n=B(e,!0);return C(n,((e,t)=>{D(n,e,ce(t))})),t&&(t.finalized_=!1),n}var fe=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&j(6),void 0!==n&&"function"!=typeof n&&j(7),R(e)){const o=X(this),i=le(e,void 0);let s=!0;try{r=t(i),s=!1}finally{s?K(o):U(o)}return J(o,n),G(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===_&&(r=void 0),this.autoFreeze_&&q(r,!0),n){const t=[],o=[];H("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}j(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){R(e)||j(8),S(e)&&(e=function(e){S(e)||j(10);return ce(e)}(e));const t=X(this),n=le(e,void 0);return n[k].isManual_=!0,U(t),n}finishDraft(e,t){const n=e&&e[k];n&&n.isManual_||j(9);const{scope_:r}=n;return J(r,t),G(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=H("Patches").applyPatches_;return S(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},ue=fe.produce;fe.produceWithPatches.bind(fe),fe.setAutoFreeze.bind(fe),fe.setUseStrictShallowCopy.bind(fe),fe.applyPatches.bind(fe);var pe=fe.createDraft.bind(fe),de=fe.finishDraft.bind(fe),he={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=he.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r];if(o!==t[r])break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],s=t[n];return he.equals(r,o)&&i>s},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return he.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],s=t[n];return he.equals(r,o)&&i<s},equals:(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===he.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===he.compare(e,t),isBefore:(e,t)=>-1===he.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===he.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===he.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===he.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===he.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&he.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!he.isAncestor(t,e)&&!he.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(he.equals(i,r)||he.endsBefore(i,r)||he.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:s}=t;if(he.equals(s,r)||he.isAncestor(s,r))return null;he.endsBefore(s,r)&&(r[s.length-1]-=1);break;case"merge_node":var{path:a,position:l}=t;he.equals(a,r)||he.endsBefore(a,r)?r[a.length-1]-=1:he.isAncestor(a,r)&&(r[a.length-1]-=1,r[a.length]+=l);break;case"split_node":var{path:c,position:f}=t;if(he.equals(c,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else he.endsBefore(c,r)?r[c.length-1]+=1:he.isAncestor(c,r)&&e[c.length]>=f&&(r[c.length-1]+=1,r[c.length]-=f);break;case"move_node":var{path:u,newPath:p}=t;if(he.equals(u,p))return r;if(he.isAncestor(u,r)||he.equals(u,r)){var d=p.slice();return he.endsBefore(u,p)&&u.length<p.length&&(d[u.length-1]-=1),d.concat(r.slice(u.length))}he.isSibling(u,p)&&(he.isAncestor(p,r)||he.equals(p,r))?he.endsBefore(u,r)?r[u.length-1]-=1:r[u.length-1]+=1:he.endsBefore(p,r)||he.equals(p,r)||he.isAncestor(p,r)?(he.endsBefore(u,r)&&(r[u.length-1]-=1),r[p.length-1]+=1):he.endsBefore(u,r)&&(he.equals(p,r)&&(r[p.length-1]+=1),r[u.length-1]-=1)}return r}};function ge(e){return ge="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},ge(e)}function ye(e){var t=function(e,t){if("object"!==ge(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ge(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ge(t)?t:String(t)}function me(e,t,n){return(t=ye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var we={transform(e,t){e.children=pe(e.children);var n=e.selection&&pe(e.selection);try{n=((e,t,n)=>{switch(n.type){case"insert_node":var{path:r,node:o}=n,i=Ne.parent(e,r),s=r[r.length-1];if(s>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));if(i.children.splice(s,0,o),t)for(var[a,l]of Ee.points(t))t[l]=We.transform(a,n);break;case"insert_text":var{path:c,offset:f,text:u}=n;if(0===u.length)break;var p=Ne.leaf(e,c),d=p.text.slice(0,f),h=p.text.slice(f);if(p.text=d+u+h,t)for(var[g,y]of Ee.points(t))t[y]=We.transform(g,n);break;case"merge_node":var{path:m}=n,v=Ne.get(e,m),b=he.previous(m),w=Ne.get(e,b),x=Ne.parent(e,m),O=m[m.length-1];if(Ue.isText(v)&&Ue.isText(w))w.text+=v.text;else{if(Ue.isText(v)||Ue.isText(w))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(m,"] to nodes of different interfaces: ").concat(Ie.stringify(v)," ").concat(Ie.stringify(w)));w.children.push(...v.children)}if(x.children.splice(O,1),t)for(var[_,P]of Ee.points(t))t[P]=We.transform(_,n);break;case"move_node":var{path:k,newPath:j}=n;if(he.isAncestor(k,j))throw new Error("Cannot move a path [".concat(k,"] to new path [").concat(j,"] because the destination is inside itself."));var E=Ne.get(e,k),S=Ne.parent(e,k),R=k[k.length-1];S.children.splice(R,1);var A=he.transform(k,n),T=Ne.get(e,he.parent(A)),C=A[A.length-1];if(T.children.splice(C,0,E),t)for(var[N,L]of Ee.points(t))t[L]=We.transform(N,n);break;case"remove_node":var{path:D}=n,z=D[D.length-1];if(Ne.parent(e,D).children.splice(z,1),t)for(var[M,F]of Ee.points(t)){var B=We.transform(M,n);if(null!=t&&null!=B)t[F]=B;else{var q=void 0,W=void 0;for(var[V,I]of Ne.texts(e)){if(-1!==he.compare(I,D)){W=[V,I];break}q=[V,I]}var $=!1;q&&W&&($=he.equals(W[1],D)?!he.hasPrevious(W[1]):he.common(q[1],D).length<he.common(W[1],D).length),q&&!$?(M.path=q[1],M.offset=q[0].text.length):W?(M.path=W[1],M.offset=0):t=null}}break;case"remove_text":var{path:H,offset:Z,text:J}=n;if(0===J.length)break;var K=Ne.leaf(e,H),U=K.text.slice(0,Z),X=K.text.slice(Z+J.length);if(K.text=U+X,t)for(var[Y,G]of Ee.points(t))t[G]=We.transform(Y,n);break;case"set_node":var{path:Q,properties:ee,newProperties:te}=n;if(0===Q.length)throw new Error("Cannot set properties on the root node!");var ne=Ne.get(e,Q);for(var re in te){if("children"===re||"text"===re)throw new Error('Cannot set the "'.concat(re,'" property of nodes!'));var oe=te[re];null==oe?delete ne[re]:ne[re]=oe}for(var ie in ee)te.hasOwnProperty(ie)||delete ne[ie];break;case"set_selection":var{newProperties:se}=n;if(null==se)t=se;else{if(null==t){if(!Ee.isRange(se))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Ie.stringify(se)," when there is no current selection."));t=be({},se)}for(var ae in se){var le=se[ae];if(null==le){if("anchor"===ae||"focus"===ae)throw new Error('Cannot remove the "'.concat(ae,'" selection property'));delete t[ae]}else t[ae]=le}}break;case"split_node":var{path:ce,position:fe,properties:ue}=n;if(0===ce.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(ce,"] because the root node cannot be split."));var pe,de=Ne.get(e,ce),ge=Ne.parent(e,ce),ye=ce[ce.length-1];if(Ue.isText(de)){var me=de.text.slice(0,fe),ve=de.text.slice(fe);de.text=me,pe=be(be({},ue),{},{text:ve})}else{var we=de.children.slice(0,fe),xe=de.children.slice(fe);de.children=we,pe=be(be({},ue),{},{children:xe})}if(ge.children.splice(ye+1,0,pe),t)for(var[Oe,_e]of Ee.points(t))t[_e]=We.transform(Oe,n)}return t})(e,n,t)}finally{e.children=de(e.children),e.selection=n?S(n)?de(n):n:null}}},xe={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},Oe={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},_e=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(O(r)&&O(o)){if(!_e(r,o))return!1}else if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(r!==o)return!1}for(var s in t)if(void 0===e[s]&&void 0!==t[s])return!1;return!0};function Pe(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var ke=["anchor","focus"];function je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Ee={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return Ee.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=Ee.edges(e);return t},equals:(e,t)=>We.equals(e.anchor,t.anchor)&&We.equals(e.focus,t.focus),includes(e,t){if(Ee.isRange(t)){if(Ee.includes(e,t.anchor)||Ee.includes(e,t.focus))return!0;var[n,r]=Ee.edges(e),[o,i]=Ee.edges(t);return We.isBefore(n,o)&&We.isAfter(r,i)}var[s,a]=Ee.edges(e),l=!1,c=!1;return We.isPoint(t)?(l=We.compare(t,s)>=0,c=We.compare(t,a)<=0):(l=he.compare(t,s.path)>=0,c=he.compare(t,a.path)<=0),l&&c},intersection(e,t){var n=Pe(e,ke),[r,o]=Ee.edges(e),[i,s]=Ee.edges(t),a=We.isBefore(r,i)?i:r,l=We.isBefore(o,s)?o:s;return We.isBefore(l,a)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({anchor:a,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return We.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return We.equals(t,n)},isExpanded:e=>!Ee.isCollapsed(e),isForward:e=>!Ee.isBackward(e),isRange:e=>O(e)&&We.isPoint(e.anchor)&&We.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Ee.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ue(e,(e=>{if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var s=Ee.isCollapsed(e);Ee.isForward(e)?(r="forward",o=s?r:"backward"):(r="backward",o=s?r:"forward")}else"outward"===i?Ee.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var a=We.transform(e.anchor,t,{affinity:r}),l=We.transform(e.focus,t,{affinity:o});if(!a||!l)return null;e.anchor=a,e.focus=l}))}},Se=e=>O(e)&&Ne.isNodeList(e.children)&&!Fe.isEditor(e),Re={isAncestor:e=>O(e)&&Ne.isNodeList(e.children),isElement:Se,isElementList:e=>Array.isArray(e)&&e.every((e=>Re.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Se(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Ae=["children"],Te=["text"],Ce=new WeakMap,Ne={ancestor(e,t){var n=Ne.get(e,t);if(Ue.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Ie.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of he.ancestors(t,n)){var o=[Ne.ancestor(e,r),r];yield o}}()},child(e,t){if(Ue.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Ie.stringify(e)));var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Ie.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=Ne.ancestor(e,t),{children:i}=o,s=r?i.length-1:0;r?s>=0:s<i.length;){var a=Ne.child(o,s),l=t.concat(s);yield[a,l],s=r?s-1:s+1}}()},common(e,t,n){var r=he.common(t,n);return[Ne.get(e,r),r]},descendant(e,t){var n=Ne.get(e,t);if(Fe.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Ie.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Ne.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Ne.nodes(e,t))Re.isElement(n)&&(yield[n,r])}()},extractProps:e=>Re.isAncestor(e)?Pe(e,Ae):Pe(e,Te),first(e,t){for(var n=t.slice(),r=Ne.get(e,n);r&&!Ue.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){if(Ue.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Ie.stringify(e)));var n=ue({children:e.children},(e=>{var[n,r]=Ee.edges(t),o=Ne.nodes(e,{reverse:!0,pass:e=>{var[,n]=e;return!Ee.includes(t,n)}});for(var[,i]of o){if(!Ee.includes(t,i)){var s=Ne.parent(e,i),a=i[i.length-1];s.children.splice(a,1)}if(he.equals(i,r.path)){var l=Ne.leaf(e,i);l.text=l.text.slice(0,r.offset)}if(he.equals(i,n.path)){var c=Ne.leaf(e,i);c.text=c.text.slice(n.offset)}}Fe.isEditor(e)&&(e.selection=null)}));return n.children},get(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(Ue.isText(n)||!n.children[o])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Ie.stringify(e)));n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(Ue.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isNode:e=>Ue.isText(e)||Re.isElement(e)||Fe.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1;var t=Ce.get(e);if(void 0!==t)return t;var n=e.every((e=>Ne.isNode(e)));return Ce.set(e,n),n},last(e,t){for(var n=t.slice(),r=Ne.get(e,n);r&&!Ue.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=Ne.get(e,t);if(!Ue.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Ie.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of he.levels(t,n)){var o=Ne.get(e,r);yield[o,r]}}()},matches:(e,t)=>Re.isElement(e)&&Re.isElementProps(t)&&Re.matches(e,t)||Ue.isText(e)&&Ue.isTextProps(t)&&Ue.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,s=new Set,a=[],l=e;!i||!(r?he.isBefore(a,i):he.isAfter(a,i));)if(s.has(l)||(yield[l,a]),s.has(l)||Ue.isText(l)||0===l.children.length||null!=n&&!1!==n([l,a])){if(0===a.length)break;if(!r){var c=he.next(a);if(Ne.has(e,c)){a=c,l=Ne.get(e,a);continue}}if(r&&0!==a[a.length-1])a=he.previous(a),l=Ne.get(e,a);else a=he.parent(a),l=Ne.get(e,a),s.add(l)}else{s.add(l);var f=r?l.children.length-1:0;he.isAncestor(a,o)&&(f=o[a.length]),a=a.concat(f),l=Ne.get(e,a)}}()},parent(e,t){var n=he.parent(t),r=Ne.get(e,n);if(Ue.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>Ue.isText(e)?e.text:e.children.map(Ne.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Ne.nodes(e,t))Ue.isText(n)&&(yield[n,r])}()}};function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function De(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ze={isNodeOperation:e=>ze.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!O(e))return!1;switch(e.type){case"insert_node":case"remove_node":return he.isPath(e.path)&&Ne.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&he.isPath(e.path);case"merge_node":return"number"==typeof e.position&&he.isPath(e.path)&&O(e.properties);case"move_node":return he.isPath(e.path)&&he.isPath(e.newPath);case"set_node":return he.isPath(e.path)&&O(e.properties)&&O(e.newProperties);case"set_selection":return null===e.properties&&Ee.isRange(e.newProperties)||null===e.newProperties&&Ee.isRange(e.properties)||O(e.properties)&&O(e.newProperties);case"split_node":return he.isPath(e.path)&&"number"==typeof e.position&&O(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>ze.isOperation(e))),isSelectionOperation:e=>ze.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>ze.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return De(De({},e),{},{type:"remove_node"});case"insert_text":return De(De({},e),{},{type:"remove_text"});case"merge_node":return De(De({},e),{},{type:"split_node",path:he.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(he.equals(t,n))return e;if(he.isSibling(n,t))return De(De({},e),{},{path:t,newPath:n});var r=he.transform(n,e),o=he.transform(he.next(n),e);return De(De({},e),{},{path:r,newPath:o});case"remove_node":return De(De({},e),{},{type:"insert_node"});case"remove_text":return De(De({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:s}=e;return De(De({},e),{},{properties:s,newProperties:i});case"set_selection":var{properties:a,newProperties:l}=e;return De(De({},e),{},null==a?{properties:l,newProperties:null}:null==l?{properties:null,newProperties:a}:{properties:l,newProperties:a});case"split_node":return De(De({},e),{},{type:"merge_node",path:he.next(e.path)})}}},Me=new WeakMap,Fe={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:e=>(e=>{var t=Me.get(e);if(void 0!==t)return t;if(!O(e))return!1;var n="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||O(e.marks))&&(null===e.selection||Ee.isRange(e.selection))&&Ne.isNodeList(e.children)&&ze.isOperationList(e.operations);return Me.set(e,n),n})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)}};function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var We={compare(e,t){var n=he.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===We.compare(e,t),isBefore:(e,t)=>-1===We.compare(e,t),equals:(e,t)=>e.offset===t.offset&&he.equals(e.path,t.path),isPoint:e=>O(e)&&"number"==typeof e.offset&&he.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ue(e,(e=>{if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":e.path=he.transform(o,t,n);break;case"insert_text":he.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(e.offset+=t.text.length);break;case"merge_node":he.equals(t.path,o)&&(e.offset+=t.position),e.path=he.transform(o,t,n);break;case"remove_text":he.equals(t.path,o)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(he.equals(t.path,o)||he.isAncestor(t.path,o))return null;e.path=he.transform(o,t,n);break;case"split_node":if(he.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position<i||t.position===i&&"forward"===r)&&(e.offset-=t.position,e.path=he.transform(o,t,qe(qe({},n),{},{affinity:"forward"})))}else e.path=he.transform(o,t,n)}}))}},Ve=void 0,Ie={setScrubber(e){Ve=e},stringify:e=>JSON.stringify(e,Ve)},$e=["text"],He=["anchor","focus"];function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ke,Ue={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){return Pe(e,$e)}return _e(r?o(e):e,r?o(t):t)},isText:e=>O(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>Ue.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[Je({},e)];for(var r of t){var o=Pe(r,He),[i,s]=Ee.edges(r),a=[],l=0,c=i.offset,f=s.offset;for(var u of n){var{length:p}=u.text,d=l;if(l+=p,c<=d&&l<=f)Object.assign(u,o),a.push(u);else if(c!==f&&(c===l||f===d)||c>l||f<d||f===d&&0!==d)a.push(u);else{var h=u,g=void 0,y=void 0;if(f<l){var m=f-d;y=Je(Je({},h),{},{text:h.text.slice(m)}),h=Je(Je({},h),{},{text:h.text.slice(0,m)})}if(c>d){var v=c-d;g=Je(Je({},h),{},{text:h.text.slice(0,v)}),h=Je(Je({},h),{},{text:h.text.slice(v)})}Object.assign(h,o),g&&a.push(g),a.push(h),y&&a.push(y)}}n=a}return n}},Xe=e=>e.selection?e.selection:e.children.length>0?Fe.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Ke||(Ke={})),Ke.L,Ke.L,Ke.V,Ke.LV,Ke.LVT,Ke.LV,Ke.V,Ke.V,Ke.T,Ke.LVT,Ke.T,Ke.T,Ke.Any,Ke.Extend,Ke.ZWJ,Ke.Any,Ke.SpacingMark,Ke.Prepend,Ke.Any,Ke.ZWJ,Ke.ExtPict,Ke.RI,Ke.RI;var Ye={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Fe.withoutNormalizing(e,(()=>{var{voids:r=!1}=n,{at:o=Xe(e)}=n;if(he.isPath(o)&&(o=Fe.range(e,o)),Ee.isRange(o))if(Ee.isCollapsed(o))o=o.anchor;else{var i=Ee.end(o);if(!r&&Fe.void(e,{at:i}))return;var s=Ee.start(o),a=Fe.pointRef(e,s),l=Fe.pointRef(e,i);et.delete(e,{at:o,voids:r});var c=a.unref(),f=l.unref();o=c||f,et.setSelection(e,{anchor:o,focus:o})}if(!(!r&&Fe.void(e,{at:o})||Fe.elementReadOnly(e,{at:o}))){var{path:u,offset:p}=o;t.length>0&&e.apply({type:"insert_text",path:u,offset:p,text:t})}}))}};function Ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var et=Qe(Qe(Qe(Qe({},we),xe),Oe),Ye);const tt={buildLinkElements:(t,n)=>{const{props:r}=n||{},o=Object.assign(Object.assign({},r),{nodeType:"inline"});return{id:e(),type:"link",children:[{text:(null==r?void 0:r.title)||(null==r?void 0:r.url)||""}],props:o}},insertLink:(e,t)=>{let{props:n,slate:r}=t||{};if(!r||!r.selection)return;const o=Fe.string(r,r.selection),i=Object.assign(Object.assign({},n),{title:n.title||o||n.url||"",nodeType:"inline"}),s=tt.buildLinkElements(e,{props:n}),[a]=Fe.nodes(r,{at:r.selection,match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&"link"===e.type});if(a){const[e,t]=a;return et.setNodes(r,{props:Object.assign(Object.assign(Object.assign({},null==e?void 0:e.props),i),{nodeType:"inline"})},{match:e=>Re.isElement(e)&&"link"===e.type,at:t}),Fe.insertText(r,i.title||i.url||"",{at:r.selection}),void et.collapse(r,{edge:"end"})}et.wrapNodes(r,s,{split:!0,at:r.selection}),et.setNodes(r,{text:(null==n?void 0:n.title)||(null==n?void 0:n.url)||""},{at:r.selection,mode:"lowest",match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&"link"===e.type}),Fe.insertText(r,(null==n?void 0:n.title)||(null==n?void 0:n.url)||"",{at:r.selection}),et.collapse(r,{edge:"end"})},deleteLink:(e,t)=>{try{const{slate:e}=t;if(!e||!e.selection)return;const[n]=Fe.nodes(e,{at:e.selection,match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&"link"===e.type});n&&et.unwrapNodes(e,{match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&"link"===e.type,at:e.selection})}catch(e){}}};function nt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;
8
- /**
9
- * @license lucide-react v0.453.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */
14
- const rt=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" ")
15
- /**
16
- * @license lucide-react v0.453.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */;var ot={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
21
- /**
22
- * @license lucide-react v0.453.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const it=h((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>g("svg",{ref:l,...ot,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:rt("lucide",o),...a},[...s.map((([e,t])=>g(e,t))),...Array.isArray(i)?i:[i]]))),st=(e,t)=>{const n=h((({className:n,...r},o)=>{return g(it,{ref:o,iconNode:t,className:rt(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},at=st("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),lt=st("SquareArrowOutUpRight",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]);
27
- /**
28
- * @license lucide-react v0.453.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */function ct(e){return pt(e)?(e.nodeName||"").toLowerCase():"#document"}function ft(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ut(e){var t;return null==(t=(pt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function pt(e){return e instanceof Node||e instanceof ft(e).Node}function dt(e){return e instanceof Element||e instanceof ft(e).Element}function ht(e){return e instanceof HTMLElement||e instanceof ft(e).HTMLElement}function gt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof ft(e).ShadowRoot)}function yt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function mt(e){return["table","td","th"].includes(ct(e))}function vt(e){const t=bt(),n=xt(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function bt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function wt(e){return["html","body","#document"].includes(ct(e))}function xt(e){return ft(e).getComputedStyle(e)}function Ot(e){return dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function _t(e){if("html"===ct(e))return e;const t=e.assignedSlot||e.parentNode||gt(e)&&e.host||ut(e);return gt(t)?t.host:t}function Pt(e){const t=_t(e);return wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ht(t)&&yt(t)?t:Pt(t)}function kt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Pt(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=ft(o);return i?t.concat(s,s.visualViewport||[],yt(o)?o:[],s.frameElement&&n?kt(s.frameElement):[]):t.concat(o,kt(o,[],n))}const jt=Math.min,Et=Math.max,St=Math.round,Rt=Math.floor,At=e=>({x:e,y:e}),Tt={left:"right",right:"left",bottom:"top",top:"bottom"},Ct={start:"end",end:"start"};function Nt(e,t,n){return Et(e,jt(t,n))}function Lt(e,t){return"function"==typeof e?e(t):e}function Dt(e){return e.split("-")[0]}function zt(e){return e.split("-")[1]}function Mt(e){return"x"===e?"y":"x"}function Ft(e){return"y"===e?"height":"width"}function Bt(e){return["top","bottom"].includes(Dt(e))?"y":"x"}function qt(e){return Mt(Bt(e))}function Wt(e){return e.replace(/start|end/g,(e=>Ct[e]))}function Vt(e){return e.replace(/left|right|bottom|top/g,(e=>Tt[e]))}function It(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function $t(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ht(e,t,n){let{reference:r,floating:o}=e;const i=Bt(t),s=qt(t),a=Ft(s),l=Dt(t),c="y"===i,f=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-o.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:u};break;case"left":d={x:r.x-o.width,y:u};break;default:d={x:r.x,y:r.y}}switch(zt(t)){case"start":d[s]-=p*(n&&c?-1:1);break;case"end":d[s]+=p*(n&&c?-1:1)}return d}async function Zt(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=Lt(t,e),h=It(d),g=a[p?"floating"===u?"reference":"floating":u],y=$t(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:l})),m="floating"===u?{...s.floating,x:r,y:o}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=$t(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:v,strategy:l}):m);return{top:(y.top-w.top+h.top)/b.y,bottom:(w.bottom-y.bottom+h.bottom)/b.y,left:(y.left-w.left+h.left)/b.x,right:(w.right-y.right+h.right)/b.x}}function Jt(e){const t=jt(...e.map((e=>e.left))),n=jt(...e.map((e=>e.top)));return{x:t,y:n,width:Et(...e.map((e=>e.right)))-t,height:Et(...e.map((e=>e.bottom)))-n}}const Kt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=Dt(n),a=zt(n),l="y"===Bt(n),c=["left","top"].includes(s)?-1:1,f=i&&l?-1:1,u=Lt(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof h&&(d="end"===a?-1*h:h),l?{x:d*f,y:p*c}:{x:p*c,y:d*f}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}};function Ut(e){const t=xt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ht(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=St(n)!==i||St(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Xt(e){return dt(e)?e:e.contextElement}function Yt(e){const t=Xt(e);if(!ht(t))return At(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ut(t);let s=(i?St(n.width):n.width)/r,a=(i?St(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Gt=At(0);function Qt(e){const t=ft(e);return bt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Gt}function en(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Xt(e);let s=At(1);t&&(r?dt(r)&&(s=Yt(r)):s=Yt(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ft(e))&&t}(i,n,r)?Qt(i):At(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,f=o.width/s.x,u=o.height/s.y;if(i){const e=ft(i),t=r&&dt(r)?ft(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=Yt(o),t=o.getBoundingClientRect(),r=xt(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,f*=e.x,u*=e.y,l+=i,c+=s,n=ft(o),o=n.frameElement}}return $t({width:f,height:u,x:l,y:c})}const tn=[":popover-open",":modal"];function nn(e){return tn.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function rn(e){return en(ut(e)).left+Ot(e).scrollLeft}function on(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ft(e),r=ut(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=bt();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=ut(e),n=Ot(e),r=e.ownerDocument.body,o=Et(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Et(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+rn(e);const a=-n.scrollTop;return"rtl"===xt(r).direction&&(s+=Et(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(ut(e));else if(dt(t))r=function(e,t){const n=en(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ht(e)?Yt(e):At(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Qt(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return $t(r)}function sn(e,t){const n=_t(e);return!(n===t||!dt(n)||wt(n))&&("fixed"===xt(n).position||sn(n,t))}function an(e,t,n){const r=ht(t),o=ut(t),i="fixed"===n,s=en(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=At(0);if(r||!r&&!i)if(("body"!==ct(t)||yt(o))&&(a=Ot(t)),r){const e=en(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=rn(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function ln(e,t){return ht(e)&&"fixed"!==xt(e).position?t?t(e):e.offsetParent:null}function cn(e,t){const n=ft(e);if(!ht(e)||nn(e))return n;let r=ln(e,t);for(;r&&mt(r)&&"static"===xt(r).position;)r=ln(r,t);return r&&("html"===ct(r)||"body"===ct(r)&&"static"===xt(r).position&&!vt(r))?n:r||function(e){let t=_t(e);for(;ht(t)&&!wt(t);){if(vt(t))return t;t=_t(t)}return null}(e)||n}const fn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=ut(r),a=!!t&&nn(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=At(1);const f=At(0),u=ht(r);if((u||!u&&!i)&&(("body"!==ct(r)||yt(s))&&(l=Ot(r)),ht(r))){const e=en(r);c=Yt(r),f.x=e.x+r.clientLeft,f.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x,y:n.y*c.y-l.scrollTop*c.y+f.y}},getDocumentElement:ut,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=kt(e,[],!1).filter((e=>dt(e)&&"body"!==ct(e))),o=null;const i="fixed"===xt(e).position;let s=i?_t(e):e;for(;dt(s)&&!wt(s);){const t=xt(s),n=vt(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||yt(s)&&!n&&sn(e,s))?r=r.filter((e=>e!==s)):o=t,s=_t(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=on(t,n,o);return e.top=Et(r.top,e.top),e.right=jt(r.right,e.right),e.bottom=jt(r.bottom,e.bottom),e.left=Et(r.left,e.left),e}),on(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:cn,getElementRects:async function(e){const t=this.getOffsetParent||cn,n=this.getDimensions;return{reference:an(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ut(e);return{width:t,height:n}},getScale:Yt,isElement:dt,isRTL:function(e){return"rtl"===xt(e).direction}};function un(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Xt(e),f=o||i?[...c?kt(c):[],...kt(t)]:[];f.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=c&&a?function(e,t){let n,r=null;const o=ut(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:f,width:u,height:p}=e.getBoundingClientRect();if(a||t(),!u||!p)return;const d={rootMargin:-Rt(f)+"px "+-Rt(o.clientWidth-(c+u))+"px "+-Rt(o.clientHeight-(f+p))+"px "+-Rt(c)+"px",threshold:Et(0,jt(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),100)}h=!1}try{r=new IntersectionObserver(g,{...d,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,d)}r.observe(e)}(!0),i}(c,n):null;let p,d=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let g=l?en(e):null;return l&&function t(){const r=en(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const pn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lt(e,t),c={x:n,y:r},f=await Zt(t,l),u=Bt(Dt(o)),p=Mt(u);let d=c[p],h=c[u];if(i){const e="y"===p?"bottom":"right";d=Nt(d+f["y"===p?"top":"left"],d,d-f[e])}if(s){const e="y"===u?"bottom":"right";h=Nt(h+f["y"===u?"top":"left"],h,h-f[e])}const g=a.fn({...t,[p]:d,[u]:h});return{...g,data:{x:g.x-n,y:g.y-r}}}}},dn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...y}=Lt(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const m=Dt(o),v=Dt(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(v||!g?[Vt(a)]:function(e){const t=Vt(e);return[Wt(e),t,Wt(t)]}(a));p||"none"===h||w.push(...function(e,t,n,r){const o=zt(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(Dt(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Wt)))),i}(a,g,h,b));const x=[a,...w],O=await Zt(t,y),_=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(f&&_.push(O[m]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=zt(e),o=qt(e),i=Ft(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Vt(s)),[s,Vt(s)]}(o,s,b);_.push(O[e[0]],O[e[1]])}if(P=[...P,{placement:o,overflows:_}],!_.every((e=>e<=0))){var k,j;const e=((null==(k=i.flip)?void 0:k.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(j=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:j.placement;if(!n)switch(d){case"bestFit":{var E;const e=null==(E=P.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},hn=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=t,{padding:a=2,x:l,y:c}=Lt(e,t),f=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(r.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let r=null;for(let e=0;e<t.length;e++){const o=t[e];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map((e=>$t(Jt(e))))}(f),p=$t(Jt(f)),d=It(a);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=l&&null!=c)return u.find((e=>l>e.left-d.left&&l<e.right+d.right&&c>e.top-d.top&&c<e.bottom+d.bottom))||p;if(u.length>=2){if("y"===Bt(n)){const e=u[0],t=u[u.length-1],r="top"===Dt(n),o=e.top,i=t.bottom,s=r?e.left:t.left,a=r?e.right:t.right;return{top:o,bottom:i,left:s,right:a,width:a-s,height:i-o,x:s,y:o}}const e="left"===Dt(n),t=Et(...u.map((e=>e.right))),r=jt(...u.map((e=>e.left))),o=u.filter((n=>e?n.left===r:n.right===t)),i=o[0].top,s=o[o.length-1].bottom;return{top:i,bottom:s,left:r,right:t,width:t-r,height:s-i,x:r,y:i}}return p}},floating:r.floating,strategy:s});return o.reference.x!==h.reference.x||o.reference.y!==h.reference.y||o.reference.width!==h.reference.width||o.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},gn=(e,t,n)=>{const r=new Map,o={platform:fn,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:u}=Ht(c,r,l),p=r,d={},h=0;for(let n=0;n<a.length;n++){const{name:i,fn:g}=a[n],{x:y,y:m,data:v,reset:b}=await g({x:f,y:u,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:s,elements:{reference:e,floating:t}});f=null!=y?y:f,u=null!=m?m:u,d={...d,[i]:{...d[i],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:f,y:u}=Ht(c,p,l))),n=-1)}return{x:f,y:u,placement:p,strategy:o,middlewareData:d}})(e,t,{...o,platform:i})};var yn="undefined"!=typeof document?y:m;function mn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!mn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!mn(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function vn(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bn(e,t){const n=vn(e);return Math.round(t*n)/n}function wn(e){const t=d.useRef(e);return yn((()=>{t.current=e})),t}const xn=d["useInsertionEffect".toString()]||(e=>e());var On="undefined"!=typeof document?y:m;let _n=!1,Pn=0;const kn=()=>"floating-ui-"+Pn++;const jn=d["useId".toString()]||function(){const[e,t]=d.useState((()=>_n?kn():void 0));return On((()=>{null==e&&t(kn())}),[]),d.useEffect((()=>{_n||(_n=!0)}),[]),e};const En=d.createContext(null),Sn=d.createContext(null);function Rn(e){const t=v(e);return On((()=>{t.current=e})),t}function An(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:r,nodeId:o}=e,[i,s]=d.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||i,l=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[f,u]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=d.useState(r);mn(p,r)||h(r);const[g,y]=d.useState(null),[m,v]=d.useState(null),b=d.useCallback((e=>{e!==P.current&&(P.current=e,y(e))}),[]),x=d.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),O=i||g,_=s||m,P=d.useRef(null),k=d.useRef(null),j=d.useRef(f),E=null!=l,S=wn(l),R=wn(o),A=d.useCallback((()=>{if(!P.current||!k.current)return;const e={placement:t,strategy:n,middleware:p};R.current&&(e.platform=R.current),gn(P.current,k.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!mn(j.current,t)&&(j.current=t,w.flushSync((()=>{u(t)})))}))}),[p,t,n,R]);yn((()=>{!1===c&&j.current.isPositioned&&(j.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const T=d.useRef(!1);yn((()=>(T.current=!0,()=>{T.current=!1})),[]),yn((()=>{if(O&&(P.current=O),_&&(k.current=_),O&&_){if(S.current)return S.current(O,_,A);A()}}),[O,_,A,S,E]);const C=d.useMemo((()=>({reference:P,floating:k,setReference:b,setFloating:x})),[b,x]),N=d.useMemo((()=>({reference:O,floating:_})),[O,_]),L=d.useMemo((()=>{const e={position:n,left:0,top:0};if(!N.floating)return e;const t=bn(N.floating,f.x),r=bn(N.floating,f.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...vn(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,N.floating,f.x,f.y]);return d.useMemo((()=>({...f,update:A,refs:C,elements:N,floatingStyles:L})),[f,A,C,N,L])}(e),c=d.useContext(Sn),f=null!=((null==(u=d.useContext(En))?void 0:u.id)||null);var u;const p=function(e){const t=d.useRef((()=>{}));return xn((()=>{t.current=e})),d.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}(((e,t,n)=>{e&&(g.current.openEvent=t),y.emit("openchange",{open:e,event:t,reason:n,nested:f}),null==r||r(e,t,n)})),h=d.useRef(null),g=d.useRef({}),y=d.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],m=jn(),v=d.useCallback((e=>{const t=dt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l.refs.setReference(t)}),[l.refs]),b=d.useCallback((e=>{(dt(e)||null===e)&&(h.current=e,s(e)),(dt(l.refs.reference.current)||null===l.refs.reference.current||null!==e&&!dt(e))&&l.refs.setReference(e)}),[l.refs]),x=d.useMemo((()=>({...l.refs,setReference:b,setPositionReference:v,domReference:h})),[l.refs,b,v]),O=d.useMemo((()=>({...l.elements,domReference:a})),[l.elements,a]),_=d.useMemo((()=>({...l,refs:x,elements:O,dataRef:g,nodeId:o,floatingId:m,events:y,open:n,onOpenChange:p})),[l,o,m,y,n,p,x,O]);return On((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===o));e&&(e.context=_)})),d.useMemo((()=>({...l,context:_,refs:x,elements:O})),[l,x,O,_])}const Tn=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Cn(e,t){return"function"==typeof e?e(t):e}function Nn(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[s,a]=d.useState(!1),[l,c]=d.useState("unmounted"),f=function(e,t){const[n,r]=d.useState(e);return e&&!n&&r(!0),d.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return On((()=>{s&&!f&&c("unmounted")}),[s,f]),On((()=>{if(r){if(n){c("initial");const e=requestAnimationFrame((()=>{c("open")}));return()=>{cancelAnimationFrame(e)}}a(!0),c("close")}}),[n,r]),{isMounted:f,status:l}}function Ln(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:s=250}=t,a=e.placement,l=a.split("-")[0],c=d.useMemo((()=>({side:l,placement:a})),[l,a]),f="number"==typeof s,u=(f?s:s.open)||0,p=(f?s:s.close)||0,[h,g]=d.useState((()=>({...Cn(i,c),...Cn(n,c)}))),{isMounted:y,status:m}=Nn(e,{duration:s}),v=Rn(n),b=Rn(r),w=Rn(o),x=Rn(i);return On((()=>{const e=Cn(v.current,c),t=Cn(w.current,c),n=Cn(x.current,c),r=Cn(b.current,c)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===m&&g((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===m&&g({transitionProperty:Object.keys(r).map(Tn).join(","),transitionDuration:u+"ms",...n,...r}),"close"===m){const r=t||e;g({transitionProperty:Object.keys(r).map(Tn).join(","),transitionDuration:p+"ms",...n,...r})}}),[p,w,v,b,x,u,m,c]),{isMounted:y,styles:h}}const{Overlay:Dn,Portal:zn}=o,Mn=({style:e,setFloating:o,element:a,setHoldLinkTool:l,blockId:c,onClose:f})=>{const d=t(),h=n(),[g,y]=b(!1),{refs:m,floatingStyles:v,context:w}=An({placement:"bottom",open:g,onOpenChange:e=>{y(e)},middleware:[hn(),dn(),pn(),Kt(10)],whileElementsMounted:un}),{isMounted:x,styles:O}=Ln(w,{duration:{open:100,close:100}}),_=Object.assign(Object.assign(Object.assign({},v),O),{maxWidth:400}),P=null==h?void 0:h.LinkTool,k=!!P;return u(zn,Object.assign({id:"yoopta-link-preview"},{children:[x&&k&&p(zn,Object.assign({id:"yoopta-link-tool"},{children:p(Dn,Object.assign({lockScroll:!0,className:"yoo-link-z-[100]",onClick:f},{children:p("div",Object.assign({ref:m.setFloating,style:_,onClick:e=>e.stopPropagation()},{children:p(P,{editor:d,link:a.props,onSave:e=>{i.updateElement(d,c,{type:a.type,props:Object.assign(Object.assign({},a.props),e)}),y(!1),f()},onDelete:()=>{const e=s(d),t=i.getElementPath(d,c,a);if(!e)return;const n=i.getElementEntry(d,c,{path:t,type:a.type});n&&et.unwrapNodes(e,{match:e=>!Fe.isEditor(e)&&Re.isElement(e)&&e.type===a.type,at:t||(null==n?void 0:n[1])})},withTitle:!1})}))}))})),u("div",Object.assign({className:"yoopta-link-preview",style:e,ref:o},{children:[p("span",Object.assign({className:"yoopta-link-preview-text"},{children:a.props.url})),p("span",{className:"yoopta-link-preview-separator"}),p("button",Object.assign({type:"button",onClick:()=>{navigator.clipboard.writeText(a.props.url)},className:"yoopta-button"},{children:p(at,{size:14,strokeWidth:1})})),p("span",{className:"yoopta-link-preview-separator"}),p("button",Object.assign({type:"button",onClick:()=>{window.open(a.props.url,a.props.target||"_self")},className:"yoopta-button"},{children:p(lt,{size:14,strokeWidth:1})})),p("span",{className:"yoopta-link-preview-separator"}),p("button",Object.assign({ref:m.setReference,type:"button",className:"yoopta-button yoopta-link-edit-button",onClick:()=>{const e=r.getBlock(d,{id:c});e&&d.setPath({current:e.meta.order}),l((e=>!e)),y((e=>!e))}},{children:"Edit"}))]}))]}))},Fn=["_blank","_self","_parent","_top","framename"],Bn=new l({type:"LinkPlugin",elements:{link:{render:e=>{var{extendRender:t}=e,n=nt(e,["extendRender"]);const[r,o]=b(!1),[i,s]=b(!1),l=n.HTMLAttributes||{},{className:c=""}=l,f=nt(l,["className"]),{refs:d,floatingStyles:h,context:g}=An({placement:"bottom",open:r,onOpenChange:o,middleware:[hn(),dn(),pn(),Kt(0)],whileElementsMounted:un}),{isMounted:y,styles:m}=Ln(g,{duration:{open:200,close:100}}),v=Object.assign(Object.assign({},h),m),{url:w,target:x="",rel:O}=n.element.props||{},_=a(),P={rel:O,target:x};Fn.includes(x)||delete P.target,"string"==typeof O&&0!==(null==O?void 0:O.length)||delete P.rel;const k=()=>{s(!1),o(!1)};return u("span",Object.assign({ref:d.setReference,onMouseOver:()=>{o(!0)},onMouseOut:()=>{i||k()}},{children:[t?t(n):p("a",Object.assign({},P,f,n.attributes,{draggable:!1,href:w||"",className:`yoopta-link ${c}`},{children:n.children})),y&&!_&&p(Mn,{style:v,setFloating:d.setFloating,element:n.element,setHoldLinkTool:s,onClose:k,blockId:n.blockId})]}))},props:{url:null,target:"_self",rel:"noopener noreferrer",nodeType:"inline",title:null}}},options:{display:{title:"Link",description:"Create link"}},commands:tt,parsers:{html:{serialize:(e,t)=>{const{url:n,target:r,rel:o,title:i}=e.props;return`<a href="${n}" target="${r}" rel="${o}">${c(e.children)}</a>`},deserialize:{nodeNames:["A"],parse:(t,n)=>{if("A"===t.nodeName){const r=t.getAttribute("href")||"",o=n.plugins.LinkPlugin.elements.link.props,i={url:r,target:t.getAttribute("target")||o.target,rel:t.getAttribute("rel")||o.rel,title:t.textContent||"",nodeType:"inline"};return{id:e(),type:"link",props:i,children:f(n,t.childNodes)}}}}},email:{serialize:(e,t)=>{const{url:n,target:r,rel:o,title:i}=e.props;return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <a href="${n}" target="${r}" rel="${o}">${c(e.children)}</a>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}});!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".yoo-link-z-\\[100\\]{z-index:100}.yoopta-link{--tw-text-opacity:1;color:rgb(0 122 255/var(--tw-text-opacity));cursor:pointer;position:relative;text-decoration-line:underline;text-underline-offset:4px}.yoopta-link:hover{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.yoopta-link-preview{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);align-items:center;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(227 227 227/var(--tw-border-opacity));border-radius:.375rem;border-style:solid;border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);display:flex;padding:6px;z-index:50}.yoopta-link-preview-text{font-size:.875rem;line-height:1.25rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.yoopta-link-preview-separator{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity));height:20px;margin-left:5px;margin-right:5px;width:1px}.yoopta-link-edit-button{cursor:pointer;font-size:.875rem;line-height:1.25rem}");export{tt as LinkCommands,Bn as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{generateId as t,YooptaPlugin as r,serializeTextNodes as n,deserializeTextNodes as o}from"@yoopta/editor";var i={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=i.levels(e,t);return n=r?n.slice(1):n.slice(0,-1)},common(e,t){for(var r=[],n=0;n<e.length&&n<t.length;n++){var o=e[n];if(o!==t[n])break;r.push(o)}return r},compare(e,t){for(var r=Math.min(e.length,t.length),n=0;n<r;n++){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return 0},endsAfter(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),s=e[r],a=t[r];return i.equals(n,o)&&s>a},endsAt(e,t){var r=e.length,n=e.slice(0,r),o=t.slice(0,r);return i.equals(n,o)},endsBefore(e,t){var r=e.length-1,n=e.slice(0,r),o=t.slice(0,r),s=e[r],a=t[r];return i.equals(n,o)&&s<a},equals:(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===i.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===i.compare(e,t),isBefore:(e,t)=>-1===i.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===i.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===i.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===i.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===i.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1;var r=e.slice(0,-1),n=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&i.equals(r,n)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,n=[],o=0;o<=e.length;o++)n.push(e.slice(0,o));return r&&n.reverse(),n},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!i.isAncestor(t,e)&&!i.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var n=[...e],{affinity:o="forward"}=r;if(0===e.length)return n;switch(t.type){case"insert_node":var{path:s}=t;(i.equals(s,n)||i.endsBefore(s,n)||i.isAncestor(s,n))&&(n[s.length-1]+=1);break;case"remove_node":var{path:a}=t;if(i.equals(a,n)||i.isAncestor(a,n))return null;i.endsBefore(a,n)&&(n[a.length-1]-=1);break;case"merge_node":var{path:l,position:c}=t;i.equals(l,n)||i.endsBefore(l,n)?n[l.length-1]-=1:i.isAncestor(l,n)&&(n[l.length-1]-=1,n[l.length]+=c);break;case"split_node":var{path:f,position:p}=t;if(i.equals(f,n)){if("forward"===o)n[n.length-1]+=1;else if("backward"!==o)return null}else i.endsBefore(f,n)?n[f.length-1]+=1:i.isAncestor(f,n)&&e[f.length]>=p&&(n[f.length-1]+=1,n[f.length]-=p);break;case"move_node":var{path:u,newPath:d}=t;if(i.equals(u,d))return n;if(i.isAncestor(u,n)||i.equals(u,n)){var h=d.slice();return i.endsBefore(u,d)&&u.length<d.length&&(h[u.length-1]-=1),h.concat(n.slice(u.length))}i.isSibling(u,d)&&(i.isAncestor(d,n)||i.equals(d,n))?i.endsBefore(u,n)?n[u.length-1]-=1:n[u.length-1]+=1:i.endsBefore(d,n)||i.equals(d,n)||i.isAncestor(d,n)?(i.endsBefore(u,n)&&(n[u.length-1]-=1),n[d.length-1]+=1):i.endsBefore(u,n)&&(i.equals(d,n)&&(n[d.length-1]+=1),n[u.length-1]-=1)}return n}};function s(e){return s="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},s(e)}function a(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}function l(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var f=["anchor","focus"];function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var u={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:r=!1}=t,{anchor:n,focus:o}=e;return u.isBackward(e)===r?[n,o]:[o,n]},end(e){var[,t]=u.edges(e);return t},equals:(e,t)=>A.equals(e.anchor,t.anchor)&&A.equals(e.focus,t.focus),surrounds(e,t){var r=u.intersection(e,t);return!!r&&u.equals(r,t)},includes(e,t){if(u.isRange(t)){if(u.includes(e,t.anchor)||u.includes(e,t.focus))return!0;var[r,n]=u.edges(e),[o,s]=u.edges(t);return A.isBefore(r,o)&&A.isAfter(n,s)}var[a,l]=u.edges(e),c=!1,f=!1;return A.isPoint(t)?(c=A.compare(t,a)>=0,f=A.compare(t,l)<=0):(c=i.compare(t,a.path)>=0,f=i.compare(t,l.path)<=0),c&&f},intersection(e,t){var r=c(e,f),[n,o]=u.edges(e),[i,s]=u.edges(t),a=A.isBefore(n,i)?i:n,d=A.isBefore(o,s)?o:s;return A.isBefore(d,a)?null:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({anchor:a,focus:d},r)},isBackward(e){var{anchor:t,focus:r}=e;return A.isAfter(t,r)},isCollapsed(e){var{anchor:t,focus:r}=e;return A.equals(t,r)},isExpanded:e=>!u.isCollapsed(e),isForward:e=>!u.isBackward(e),isRange:e=>j(e)&&A.isPoint(e.anchor)&&A.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=u.edges(e);return t},transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var n,o,{affinity:i="inward"}=r;if("inward"===i){var s=u.isCollapsed(e);u.isForward(e)?(n="forward",o=s?n:"backward"):(n="backward",o=s?n:"forward")}else"outward"===i?u.isForward(e)?(n="backward",o="forward"):(n="forward",o="backward"):(n=i,o=i);var a=A.transform(e.anchor,t,{affinity:n}),l=A.transform(e.focus,t,{affinity:o});return a&&l?{anchor:a,focus:l}:null}},d=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!j(e)&&("function"!=typeof e.apply&&(t?b.isNodeList(e.children):Array.isArray(e.children)))},h={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return j(e)&&b.isNodeList(e.children,{deep:t})},isElement:d,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>h.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return d(e)&&e[r]===t},matches(e,t){for(var r in t)if("children"!==r&&e[r]!==t[r])return!1;return!0}},g=["children"],v=["text"];function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var b={ancestor(e,t){var r=b.get(e,t);if(L.isText(r))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(q.stringify(r)));return r},ancestors(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of i.ancestors(t,r)){var o=[b.ancestor(e,n),n];yield o}}()},child(e,t){if(L.isText(e))throw new Error("Cannot get the child of a text node: ".concat(q.stringify(e)));var r=e.children[t];if(null==r)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(q.stringify(e)));return r},children(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:n=!1}=r,o=b.ancestor(e,t),{children:i}=o,s=n?i.length-1:0;n?s>=0:s<i.length;){var a=b.child(o,s),l=t.concat(s);yield[a,l],s=n?s-1:s+1}}()},common(e,t,r){var n=i.common(t,r);return[b.get(e,n),n]},descendant(e,t){var r=b.get(e,t);if(_.isEditor(r))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(q.stringify(r)));return r},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of b.nodes(e,t))0!==n.length&&(yield[r,n])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of b.nodes(e,t))h.isElement(r)&&(yield[r,n])}()},extractProps:e=>h.isAncestor(e)?c(e,g):c(e,v),first(e,t){for(var r=t.slice(),n=b.get(e,r);n&&!L.isText(n)&&0!==n.children.length;)n=n.children[0],r.push(0);return[n,r]},fragment(e,t){var r={children:e.children},[n,o]=u.edges(t),s=b.nodes(r,{reverse:!0,pass:e=>{var[,r]=e;return!u.includes(t,r)}}),a=function(){if(!u.includes(t,l)){var e=l[l.length-1];W(r,i.parent(l),t=>I(t,e,1))}i.equals(l,o.path)&&J(r,l,e=>{var t=e.text.slice(0,o.offset);return m(m({},e),{},{text:t})}),i.equals(l,n.path)&&J(r,l,e=>{var t=e.text.slice(n.offset);return m(m({},e),{},{text:t})})};for(var[,l]of s)a();return r.children},get(e,t){var r=b.getIf(e,t);if(void 0===r)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(q.stringify(e)));return r},getIf(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(L.isText(r)||!r.children[o])return;r=r.children[o]}return r},has(e,t){for(var r=e,n=0;n<t.length;n++){var o=t[n];if(L.isText(r)||!r.children[o])return!1;r=r.children[o]}return!0},isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return L.isText(e)||h.isElement(e,{deep:t})||_.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>b.isNode(e,{deep:t}))},last(e,t){for(var r=t.slice(),n=b.get(e,r);n&&!L.isText(n)&&0!==n.children.length;){var o=n.children.length-1;n=n.children[o],r.push(o)}return[n,r]},leaf(e,t){var r=b.get(e,t);if(!L.isText(r))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(q.stringify(r)));return r},levels(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var n of i.levels(t,r)){var o=b.get(e,n);yield[o,n]}}()},matches:(e,t)=>h.isElement(e)&&h.isElementProps(t)&&h.matches(e,t)||L.isText(e)&&L.isTextProps(t)&&L.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:r,reverse:n=!1}=t,{from:o=[],to:s}=t,a=new Set,l=[],c=e;!s||!(n?i.isBefore(l,s):i.isAfter(l,s));)if(a.has(c)||(yield[c,l]),a.has(c)||L.isText(c)||0===c.children.length||null!=r&&!1!==r([c,l])){if(0===l.length)break;if(!n){var f=i.next(l);if(b.has(e,f)){l=f,c=b.get(e,l);continue}}if(n&&0!==l[l.length-1])l=i.previous(l),c=b.get(e,l);else l=i.parent(l),c=b.get(e,l),a.add(c)}else{a.add(c);var p=n?c.children.length-1:0;i.isAncestor(l,o)&&(p=o[l.length]),l=l.concat(p),c=b.get(e,l)}}()},parent(e,t){var r=i.parent(t),n=b.get(e,r);if(L.isText(n))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return n},string:e=>L.isText(e)?e.text:e.children.map(b.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[r,n]of b.nodes(e,t))L.isText(r)&&(yield[r,n])}()}};function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var P,x={isNodeOperation:e=>x.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!j(e))return!1;switch(e.type){case"insert_node":case"remove_node":return i.isPath(e.path)&&b.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&i.isPath(e.path);case"merge_node":return"number"==typeof e.position&&i.isPath(e.path)&&j(e.properties);case"move_node":return i.isPath(e.path)&&i.isPath(e.newPath);case"set_node":return i.isPath(e.path)&&j(e.properties)&&j(e.newProperties);case"set_selection":return null===e.properties&&u.isRange(e.newProperties)||null===e.newProperties&&u.isRange(e.properties)||j(e.properties)&&j(e.newProperties);case"split_node":return i.isPath(e.path)&&"number"==typeof e.position&&j(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>x.isOperation(e)),isSelectionOperation:e=>x.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>x.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return w(w({},e),{},{type:"remove_node"});case"insert_text":return w(w({},e),{},{type:"remove_text"});case"merge_node":return w(w({},e),{},{type:"split_node",path:i.previous(e.path)});case"move_node":var{newPath:t,path:r}=e;if(i.equals(t,r))return e;if(i.isSibling(r,t))return w(w({},e),{},{path:t,newPath:r});var n=i.transform(r,e),o=i.transform(i.next(r),e);return w(w({},e),{},{path:n,newPath:o});case"remove_node":return w(w({},e),{},{type:"insert_node"});case"remove_text":return w(w({},e),{},{type:"insert_text"});case"set_node":var{properties:s,newProperties:a}=e;return w(w({},e),{},{properties:a,newProperties:s});case"set_selection":var{properties:l,newProperties:c}=e;return w(w({},e),{},null==l?{properties:c,newProperties:null}:null==c?{properties:null,newProperties:l}:{properties:c,newProperties:l});case"split_node":return w(w({},e),{},{type:"merge_node",path:i.next(e.path)})}}},j=e=>"object"==typeof e&&null!==e,k=(e,t)=>{for(var r in e){var n=e[r],o=t[r];if(Array.isArray(n)&&Array.isArray(o)){if(n.length!==o.length)return!1;for(var i=0;i<n.length;i++)if(n[i]!==o[i])return!1}else if(j(n)&&j(o)){if(!k(n,o))return!1}else if(n!==o)return!1}for(var s in t)if(void 0===e[s]&&void 0!==t[s])return!1;return!0},E=e=>e.selection?e.selection:e.children.length>0?_.end(e,[]):[0];!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(P||(P={})),P.L,P.L,P.V,P.LV,P.LVT,P.LV,P.V,P.V,P.T,P.LVT,P.T,P.T,P.Any,P.Extend,P.ZWJ,P.Any,P.SpacingMark,P.Prepend,P.Any,P.ZWJ,P.ExtPict,P.RI,P.RI;var _={above:(e,t)=>e.above(t),addMark(e,t,r){e.addMark(t,r)},after:(e,t,r)=>e.after(t,r),before:(e,t,r)=>e.before(t,r),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteBackward(r)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:r="character"}=t;e.deleteForward(r)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,r){e.insertFragment(t,r)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,r)=>e.isEdge(t,r),isEditor:e=>function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!j(e))return!1;var r="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||j(e.marks))&&(null===e.selection||u.isRange(e.selection))&&(!t||b.isNodeList(e.children))&&x.isOperationList(e.operations);return r}(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,r)=>e.isEnd(t,r),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,r)=>e.isStart(t,r),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,r)=>e.leaf(t,r),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,r)=>e.node(t,r),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,r)=>e.parent(t,r),path:(e,t,r)=>e.path(t,r),pathRef:(e,t,r)=>e.pathRef(t,r),pathRefs:e=>e.pathRefs(),point:(e,t,r)=>e.point(t,r),pointRef:(e,t,r)=>e.pointRef(t,r),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,r)=>e.range(t,r),rangeRef:(e,t,r)=>e.rangeRef(t,r),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,r)=>e.string(t,r),unhangRange:(e,t,r)=>e.unhangRange(t,r),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,r)=>e.shouldMergeNodesRemovePrevNode(t,r)};function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var A={compare(e,t){var r=i.compare(e.path,t.path);return 0===r?e.offset<t.offset?-1:e.offset>t.offset?1:0:r},isAfter:(e,t)=>1===A.compare(e,t),isBefore:(e,t)=>-1===A.compare(e,t),equals:(e,t)=>e.offset===t.offset&&i.equals(e.path,t.path),isPoint:e=>j(e)&&"number"==typeof e.offset&&i.isPath(e.path),transform(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:n="forward"}=r,{path:o,offset:s}=e;switch(t.type){case"insert_node":case"move_node":o=i.transform(o,t,r);break;case"insert_text":i.equals(t.path,o)&&(t.offset<s||t.offset===s&&"forward"===n)&&(s+=t.text.length);break;case"merge_node":i.equals(t.path,o)&&(s+=t.position),o=i.transform(o,t,r);break;case"remove_text":i.equals(t.path,o)&&t.offset<=s&&(s-=Math.min(s-t.offset,t.text.length));break;case"remove_node":if(i.equals(t.path,o)||i.isAncestor(t.path,o))return null;o=i.transform(o,t,r);break;case"split_node":if(i.equals(t.path,o)){if(t.position===s&&null==n)return null;(t.position<s||t.position===s&&"forward"===n)&&(s-=t.position,o=i.transform(o,t,T(T({},r),{},{affinity:"forward"})))}else o=i.transform(o,t,r);break;default:return e}return{path:o,offset:s}}},S=void 0,q={setScrubber(e){S=e},stringify:e=>JSON.stringify(e,S)},R=["text"],D=["anchor","focus","merge"];function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var L={equals(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:n=!1}=r;function o(e){return c(e,R)}return k(n?o(e):e,n?o(t):t)},isText:e=>j(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>L.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var r in t)if("text"!==r&&(!e.hasOwnProperty(r)||e[r]!==t[r]))return!1;return!0},decorations(e,t){var r=[{leaf:B({},e)}];for(var n of t){var{anchor:o,focus:i,merge:s}=n,a=c(n,D),[l,f]=u.edges(n),p=[],d=0,h=l.offset,g=f.offset,v=null!=s?s:Object.assign;for(var{leaf:y}of r){var{length:m}=y.text,b=d;if(d+=m,h<=b&&d<=g)v(y,a),p.push({leaf:y});else if(h!==g&&(h===d||g===b)||h>d||g<b||g===b&&0!==b)p.push({leaf:y});else{var O=y,w=void 0,P=void 0;if(g<d){var x=g-b;P={leaf:B(B({},O),{},{text:O.text.slice(x)})},O=B(B({},O),{},{text:O.text.slice(0,x)})}if(h>b){var j=h-b;w={leaf:B(B({},O),{},{text:O.text.slice(0,j)})},O=B(B({},O),{},{text:O.text.slice(j)})}v(O,a),w&&p.push(w),p.push({leaf:O}),P&&p.push(P)}}r=p}if(r.length>1){var k=0;for(var[E,_]of r.entries()){var N=k,T=N+_.leaf.text.length,A={start:N,end:T};0===E&&(A.isFirst=!0),E===r.length-1&&(A.isLast=!0),_.position=A,k=T}}return r}};function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var M=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];return[...e.slice(0,t),...n,...e.slice(t)]},z=function(e,t,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];return[...e.slice(0,t),...o,...e.slice(t+r)]},I=z,$=(e,t,r)=>{if(0===t.length)throw new Error("Cannot modify the editor");for(var n=b.get(e,t),o=t.slice(),i=r(n);o.length>1;){var s=o.pop(),a=b.get(e,o);i=F(F({},a),{},{children:z(a.children,s,1,i)})}var l=o.pop();e.children=z(e.children,l,1,i)},W=(e,t,r)=>{0===t.length?e.children=r(e.children):$(e,t,e=>{if(L.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(q.stringify(e)));return F(F({},e),{},{children:r(e.children)})})},J=(e,t,r)=>$(e,t,e=>{if(!L.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(q.stringify(e)));return r(e)});function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var H={transform(e,t){var r=!1;switch(t.type){case"insert_node":var{path:n,node:o}=t;W(e,i.parent(n),e=>{var t=n[n.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(n,"] because the destination is past the end of the node."));return M(e,t,o)}),r=!0;break;case"insert_text":var{path:s,offset:a,text:l}=t;if(0===l.length)break;J(e,s,e=>{var t=e.text.slice(0,a),r=e.text.slice(a);return G(G({},e),{},{text:t+l+r})}),r=!0;break;case"merge_node":var{path:c}=t,f=c[c.length-1],p=i.previous(c),d=p[p.length-1];W(e,i.parent(c),e=>{var t,r=e[f],n=e[d];if(L.isText(r)&&L.isText(n))t=G(G({},n),{},{text:n.text+r.text});else{if(L.isText(r)||L.isText(n))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(c,"] to nodes of different interfaces: ").concat(q.stringify(r)," ").concat(q.stringify(n)));t=G(G({},n),{},{children:n.children.concat(r.children)})}return z(e,d,2,t)}),r=!0;break;case"move_node":var{path:h,newPath:g}=t,v=h[h.length-1];if(i.isAncestor(h,g))throw new Error("Cannot move a path [".concat(h,"] to new path [").concat(g,"] because the destination is inside itself."));var y=b.get(e,h);W(e,i.parent(h),e=>I(e,v,1));var m=i.transform(h,t),O=m[m.length-1];W(e,i.parent(m),e=>M(e,O,y)),r=!0;break;case"remove_node":var{path:w}=t,P=w[w.length-1];if(W(e,i.parent(w),e=>I(e,P,1)),e.selection){var x=G({},e.selection);for(var[j,k]of u.points(x)){var E=A.transform(j,t);if(null!=x&&null!=E)x[k]=E;else{var _=void 0,N=void 0;for(var[T,S]of b.texts(e)){if(-1!==i.compare(S,w)){N=[T,S];break}_=[T,S]}var R=!1;_&&N&&(R=!i.isSibling(_[1],w)&&(!!i.equals(N[1],w)||i.common(_[1],w).length<i.common(N[1],w).length)),_&&!R?x[k]={path:_[1],offset:_[0].text.length}:N?x[k]={path:N[1],offset:0}:x=null}}x&&u.equals(x,e.selection)||(e.selection=x)}break;case"remove_text":var{path:D,offset:C,text:B}=t;if(0===B.length)break;J(e,D,e=>{var t=e.text.slice(0,C),r=e.text.slice(C+B.length);return G(G({},e),{},{text:t+r})}),r=!0;break;case"set_node":var{path:V,properties:F,newProperties:Z}=t;if(0===V.length)throw new Error("Cannot set properties on the root node!");$(e,V,e=>{var t=G({},e);for(var r in Z){if("children"===r||"text"===r)throw new Error('Cannot set the "'.concat(r,'" property of nodes!'));var n=Z[r];null==n?delete t[r]:t[r]=n}for(var o in F)Z.hasOwnProperty(o)||delete t[o];return t});break;case"set_selection":var{newProperties:H}=t;if(null==H){e.selection=null;break}if(null==e.selection){if(!u.isRange(H))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(q.stringify(H)," when there is no current selection."));e.selection=G({},H);break}var K=G({},e.selection);for(var Q in H){var U=H[Q];if(null==U){if("anchor"===Q||"focus"===Q)throw new Error('Cannot remove the "'.concat(Q,'" selection property'));delete K[Q]}else K[Q]=U}e.selection=K;break;case"split_node":var{path:X,position:Y,properties:ee}=t,te=X[X.length-1];if(0===X.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(X,"] because the root node cannot be split."));W(e,i.parent(X),e=>{var t,r,n=e[te];if(L.isText(n)){var o=n.text.slice(0,Y),i=n.text.slice(Y);t=G(G({},n),{},{text:o}),r=G(G({},ee),{},{text:i})}else{var s=n.children.slice(0,Y),a=n.children.slice(Y);t=G(G({},n),{},{children:s}),r=G(G({},ee),{},{children:a})}return z(e,te,1,t,r)}),r=!0}if(r&&e.selection){var re=G({},e.selection);for(var[ne,oe]of u.points(re))re[oe]=A.transform(ne,t);u.equals(re,e.selection)||(e.selection=re)}}},K={insertNodes(e,t,r){e.insertNodes(t,r)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,r){e.setNodes(t,r)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,r){e.unsetNodes(t,r)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,r){e.wrapNodes(t,r)}},Q={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,r){e.setPoint(t,r)},setSelection(e,t){e.setSelection(t)}},U={delete(e,t){e.delete(t)},insertFragment(e,t,r){e.insertFragment(t,r)},insertText(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_.withoutNormalizing(e,()=>{var{voids:n=!1}=r,{at:o=E(e)}=r;if(i.isPath(o)&&(o=_.range(e,o)),u.isRange(o))if(u.isCollapsed(o))o=o.anchor;else{var s=u.end(o);if(!n&&_.void(e,{at:s}))return;var a=u.start(o),l=_.pointRef(e,a),c=_.pointRef(e,s);ee.delete(e,{at:o,voids:n});var f=l.unref(),p=c.unref();o=f||p,ee.setSelection(e,{anchor:o,focus:o})}if(!(!n&&_.void(e,{at:o})||_.elementReadOnly(e,{at:o}))){var{path:d,offset:h}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:h,text:t})}})}};function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ee=Y(Y(Y(Y({},H),K),Q),U);const te={buildLinkElements:(e,r)=>{const{props:n}=r||{},o=Object.assign(Object.assign({},n),{nodeType:"inline"});return{id:t(),type:"link",children:[{text:(null==n?void 0:n.title)||(null==n?void 0:n.url)||""}],props:o}},insertLink:(e,t)=>{const{props:r,slate:n}=t||{};if(!n||!n.selection)return;const o=_.string(n,n.selection),i=Object.assign(Object.assign({},r),{title:r.title||o||r.url||"",nodeType:"inline"}),s=te.buildLinkElements(e,{props:r}),[a]=_.nodes(n,{at:n.selection,match:e=>!_.isEditor(e)&&h.isElement(e)&&"link"===e.type});if(a){const[e,t]=a;return ee.setNodes(n,{props:Object.assign(Object.assign(Object.assign({},null==e?void 0:e.props),i),{nodeType:"inline"})},{match:e=>h.isElement(e)&&"link"===e.type,at:t}),_.insertText(n,i.title||i.url||"",{at:n.selection}),void ee.collapse(n,{edge:"end"})}ee.wrapNodes(n,s,{split:!0,at:n.selection}),ee.setNodes(n,{text:(null==r?void 0:r.title)||(null==r?void 0:r.url)||""},{at:n.selection,mode:"lowest",match:e=>!_.isEditor(e)&&h.isElement(e)&&"link"===e.type}),_.insertText(n,(null==r?void 0:r.title)||(null==r?void 0:r.url)||"",{at:n.selection}),ee.collapse(n,{edge:"end"})},deleteLink:(e,t)=>{try{const{slate:e}=t;if(!e||!e.selection)return;const[r]=_.nodes(e,{at:e.selection,match:e=>!_.isEditor(e)&&h.isElement(e)&&"link"===e.type});r&&ee.unwrapNodes(e,{match:e=>!_.isEditor(e)&&h.isElement(e)&&"link"===e.type,at:e.selection})}catch(e){}}},re=new r({type:"Link",elements:e("link",{render:t=>e("a",Object.assign({},t.attributes,{href:t.element.props.url,target:t.element.props.target,rel:t.element.props.rel,title:t.element.props.title},{children:t.children})),props:{url:null,target:"_self",rel:"noopener noreferrer",title:""},nodeType:"inline"}),options:{display:{title:"Link",description:"Create link"}},commands:te,parsers:{html:{serialize:e=>{const{url:t,target:r,rel:o}=e.props;return`<a href="${t}" target="${r}" rel="${o}">${n(e.children)}</a>`},deserialize:{nodeNames:["A"],parse:(e,r)=>{if("A"===e.nodeName){const n=e.getAttribute("href")||"",i=r.plugins.Link.elements.link.props,s={url:n,target:e.getAttribute("target")||i.target,rel:e.getAttribute("rel")||i.rel,title:e.textContent||"",nodeType:"inline"};return{id:t(),type:"link",props:s,children:o(r,e.childNodes)}}}}},email:{serialize:e=>{const{url:t,target:r,rel:o}=e.props;return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td>\n <a href="${t}" target="${r}" rel="${o}">${n(e.children)}</a>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}});export{te as LinkCommands,re as default};
@@ -1,5 +1,5 @@
1
1
  import { YooptaPlugin } from '@yoopta/editor';
2
- import { LinkElementMap } from '../types';
2
+ import type { LinkElementMap } from '../types';
3
3
  declare const Link: YooptaPlugin<LinkElementMap, Record<string, unknown>>;
4
4
  export { Link };
5
- //# sourceMappingURL=index.d.ts.map
5
+ //# sourceMappingURL=link-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/link-plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAwD,MAAM,gBAAgB,CAAC;AAGpG,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,UAAU,CAAC;AAoBjE,QAAA,MAAM,IAAI,uDAmER,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { SlateElement } from '@yoopta/editor';
1
+ import type { SlateElement } from '@yoopta/editor';
2
2
  export type LinkPluginElementKeys = 'link';
3
3
  export type LinkElementProps = {
4
4
  url: string | null;
5
5
  target?: string;
6
6
  rel?: string;
7
- nodeType: string;
8
7
  title?: string | null;
8
+ nodeType?: 'inline';
9
9
  };
10
10
  export type LinkElement = SlateElement<'link', LinkElementProps>;
11
11
  export type LinkElementMap = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAC3C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAC3C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/link",
3
- "version": "4.9.9",
3
+ "version": "6.0.0-beta.2",
4
4
  "description": "Link plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
@@ -14,12 +14,13 @@
14
14
  "dist/"
15
15
  ],
16
16
  "peerDependencies": {
17
- "@yoopta/editor": ">=4.0.0",
18
- "react": ">=17.0.2",
19
- "react-dom": ">=17.0.2"
17
+ "@yoopta/editor": ">=4.9.9",
18
+ "react": ">=18.2.0",
19
+ "react-dom": ">=18.2.0"
20
20
  },
21
21
  "publishConfig": {
22
- "registry": "https://registry.npmjs.org"
22
+ "registry": "https://registry.npmjs.org",
23
+ "access": "public"
23
24
  },
24
25
  "repository": {
25
26
  "type": "git",
@@ -34,8 +35,5 @@
34
35
  "bugs": {
35
36
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
36
37
  },
37
- "dependencies": {
38
- "lucide-react": "^0.379.0"
39
- },
40
- "gitHead": "e8260945d74e2b26e8c66a3ddf4da8ceb45bc74d"
38
+ "gitHead": "58d2c0e3b3b615017e0adb353b80dc493a571186"
41
39
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAmB,QAAQ,EAAoB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzD,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;CAC3C,CAAC;AAEF,KAAK,iBAAiB,GAAG,kBAAkB,GAAG;IAC5C,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,WAAW,CAAC;IACnF,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpE,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACxE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAgF1B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwD,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEpG,OAAO,EAAE,cAAc,EAAoB,MAAM,UAAU,CAAC;AAG5D,QAAA,MAAM,IAAI,uDA0ER,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -1,10 +0,0 @@
1
- declare const LinkHoverPreview: ({ style, setFloating, element, setHoldLinkTool, blockId, onClose }: {
2
- style: any;
3
- setFloating: any;
4
- element: any;
5
- setHoldLinkTool: any;
6
- blockId: any;
7
- onClose: any;
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export { LinkHoverPreview };
10
- //# sourceMappingURL=LinkHoverPreview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkHoverPreview.d.ts","sourceRoot":"","sources":["../../src/ui/LinkHoverPreview.tsx"],"names":[],"mappings":"AAiBA,QAAA,MAAM,gBAAgB;;;;;;;6CAyGrB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- import { PluginElementRenderProps } from '@yoopta/editor';
2
- declare const LinkRender: ({ extendRender, ...props }: PluginElementRenderProps) => import("react/jsx-runtime").JSX.Element;
3
- export { LinkRender };
4
- //# sourceMappingURL=LinkRender.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkRender.d.ts","sourceRoot":"","sources":["../../src/ui/LinkRender.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAqB,MAAM,gBAAgB,CAAC;AAQ7E,QAAA,MAAM,UAAU,+BAAgC,wBAAwB,4CAoFvE,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}