sykpcomposer 0.0.261 → 0.0.262

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.
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as a, v as m } from "./index-bd14e205.js";
1
+ import { E as a, v as m } from "./index-61a46ad5.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  export {
package/dist/index.umd.js CHANGED
@@ -133,7 +133,7 @@ Valid keys: `+JSON.stringify(Object.keys(J),null," "));var X=Z(q,Y,G,B,$+"."+Y,
133
133
  background-color: #fff !important;
134
134
  font-weight: normal;
135
135
  }
136
- `})})},Bk="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDE1IDE1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMDAwMDEgOC4zMzMzM0wxLjkwMDAxIDEzLjhMMS4xMDAwMSAxMy4yTDUuMzc1MDEgNy41TDEuMTAwMDEgMS44TDEuOTAwMDEgMS4yTDYuMDAwMDEgNi42NjY2N0wxMC4xIDEuMkwxMC45IDEuOEw2LjYyNTAxIDcuNUwxMC45IDEzLjJMMTAuMSAxMy44TDYuMDAwMDEgOC4zMzMzM1pNMTIgMTIuNUMxMiAxMS42NzE2IDEyLjY3MTYgMTEgMTMuNSAxMUgxMy43OTI5QzE0LjQ1OTYgMTEgMTUgMTEuNTQwNCAxNSAxMi4yMDcxQzE1IDEy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MS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",xM="",j1=ar.createContext(null),N1=4;function pa({children:p,className:t,onClick:i,title:e}){const s=ve.useRef(null),r=ar.useContext(j1);if(r===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:n}=r;return ve.useEffect(()=>{s&&s.current&&n(s)},[s,n]),_e.jsx("button",{className:t,onClick:i,ref:s,title:e,type:"button",children:p})}function Uk({children:p,dropDownRef:t,onClose:i}){const[e,s]=ve.useState(),[r,n]=ve.useState(),o=ve.useCallback(u=>{s(c=>c?[...c,u]:[u])},[s]),l=u=>{if(!e)return;const c=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(c)&&u.preventDefault(),c==="Escape"||c==="Tab"?i():c==="ArrowUp"?n(f=>{if(!f)return e[0];const d=e.indexOf(f)-1;return e[d===-1?e.length-1:d]}):c==="ArrowDown"&&n(f=>f?e[e.indexOf(f)+1]:e[0])},a=ve.useMemo(()=>({registerItem:o}),[o]);return ve.useEffect(()=>{e&&!r&&n(e[0]),r&&r.current&&r.current.focus()},[e,r]),_e.jsx(j1.Provider,{value:a,children:_e.jsx("div",{className:"dropdown",ref:t,onKeyDown:l,children:p})})}function bm({disabled:p=!1,buttonLabel:t,buttonAriaLabel:i,buttonClassName:e,buttonIconClassName:s,children:r,stopCloseOnClickSelf:n}){const o=ve.useRef(null),l=ve.useRef(null),[a,u]=ve.useState(!1),c=()=>{u(!1),l&&l.current&&l.current.focus()};return ve.useEffect(()=>{const f=l.current,d=o.current;if(a&&f!==null&&d!==null){const{top:h,left:m}=f.getBoundingClientRect();d.style.top=`${h+f.offsetHeight+N1}px`,d.style.left=`${Math.min(m,window.innerWidth-d.offsetWidth-20)}px`}},[o,l,a]),ve.useEffect(()=>{const f=l.current;if(f!==null&&a){const d=h=>{const m=h.target;n&&o.current&&o.current.contains(m)||f.contains(m)||u(!1)};return document.addEventListener("click",d),()=>{document.removeEventListener("click",d)}}},[o,l,a,n]),ve.useEffect(()=>{const f=()=>{if(a){const d=l.current,h=o.current;if(d!==null&&h!==null){const{top:m}=d.getBoundingClientRect(),g=m+d.offsetHeight+N1;g!==h.getBoundingClientRect().top&&(h.style.top=`${g}px`)}}};return document.addEventListener("scroll",f),()=>{document.removeEventListener("scroll",f)}},[l,o,a]),_e.jsxs(_e.Fragment,{children:[_e.jsxs("button",{type:"button",disabled:p,"aria-label":i||t,className:e,onClick:()=>u(!a),ref:l,children:[s&&_e.jsx("span",{className:s}),t&&_e.jsx("span",{className:"text dropdown-button-text",children:t}),_e.jsx("i",{className:"chevron-down"})]}),a&&ro.createPortal(_e.jsx(Uk,{dropDownRef:o,onClose:c,children:r}),document.body)]})}function P1(){return _e.jsx("div",{className:"divider"})}const I1=8,M1=72,za={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",paragraph:"Normal"},Hk=({selectionFontSize:p,disabled:t,editor:i,blockType:e,styleConfig:s,isenterPressed:r,currentElementClick:n,currentElementSelect:o})=>{const[l,a]=ar.useState(p),[u,c]=ar.useState(e),[f,d]=ar.useState("");ar.useState([]),ar.useState("");const h=b=>{b&&b.title&&i.update(()=>{if(i.isEditable()){const S=Ot();S&&bv(S,b)}})},m=b=>{a(b.target.value)},g=()=>{const b=Number(l);if(!isNaN(b)){const S=Math.min(Math.max(b,I1),M1);a(String(S)),h({"font-size":`${S}px`})}},_=b=>{d(b),i.update(()=>{const x=Ot();Et(x)&&IC(x,()=>dc(b))});const{heading:S}=s;let E=null;if(S)switch(b){case"h1":E=S.find(x=>x.title==="Heading1").fontSize;break;case"h2":E=S.find(x=>x.title==="Heading2").fontSize;break;case"h3":E=S.find(x=>x.title==="Heading3").fontSize;break;case"h4":E=S.find(x=>x.title==="Heading4").fontSize;break;case"h5":E=S.find(x=>x.title==="Heading5").fontSize;break;case"paragraph":E=11;break;default:E=11}a(E),d(b),c(b)},v=()=>{a("11")};return ar.useEffect(()=>{v()},[r]),ar.useEffect(()=>{const b=()=>{i.update(()=>{const S=Ot();if(S!==null){const x=S.getNodes()[0];if(!qt(x)){const y=x.getType();y in za&&c(y)}}})};return i.registerUpdateListener(b),()=>{i.registerUpdateListener(b)}},[i]),ar.useEffect(()=>{switch(n.tagName){case"P":a("11");break;case"H1":c("h1"),a(s.heading.find(b=>b.title==="Heading1").fontSize);break;case"H2":c("h2"),a(s.heading.find(b=>b.title==="Heading2").fontSize);break;case"H3":c("h3"),a(s.heading.find(b=>b.title==="Heading3").fontSize);break;case"H4":c("h4"),a(s.heading.find(b=>b.title==="Heading4").fontSize);break;case"H5":c("h5"),a(s.heading.find(b=>b.title==="Heading5").fontSize);break;case"default":c("paragraph"),a("11");break}},[n]),ar.useEffect(()=>{switch(o||(a("11"),c("paragraph")),o&&o.trim(" ")){case"P":a("11"),c("paragraph");break;case"h1":c("h1"),a(s.heading.find(b=>b.title==="Heading1").fontSize);break;case"h2":c("h2"),a(s.heading.find(b=>b.title==="Heading2").fontSize);break;case"h3":c("h3"),a(s.heading.find(b=>b.title==="Heading3").fontSize);break;case"h4":c("h4"),a(s.heading.find(b=>b.title==="Heading4").fontSize);break;case"h5":c("h5"),a(s.heading.find(b=>b.title==="Heading5").fontSize);break;case"default":c("paragraph"),a("11");break}},[o]),_e.jsxs(_e.Fragment,{children:[_e.jsx("input",{title:"Font Size",type:"number",value:l,disabled:t,readOnly:!0,className:"toolbar-item font-size-input",min:I1,max:M1,onChange:m,onBlur:g}),_e.jsx(P1,{}),s&&s.heading?_e.jsxs("div",{title:za[u],className:"symbol-dropdown cust-head-dropDown",children:[_e.jsxs(bm,{disabled:t,buttonClassName:"toolbar-item block-controls",buttonAriaLabel:"Formatting options for text style",buttonIconClassName:"icon block-type "+u,buttonLabel:za[u],children:[_e.jsxs(pa,{className:`item ${u==="paragraph"?"active":""}`,onClick:()=>_("paragraph"),children:[_e.jsx("i",{className:"icon paragraph"}),_e.jsx("span",{className:"text",children:za.paragraph})]}),s.heading&&s.heading.find(b=>b.title==="Heading1")&&_e.jsxs(pa,{className:`item ${u==="h1"?"active":""}`,onClick:()=>_("h1"),children:[_e.jsx("i",{className:"icon h1"}),_e.jsx("span",{className:"text",children:za.h1})]}),s.heading&&s.heading.find(b=>b.title==="Heading2")&&_e.jsxs(pa,{className:`item ${u==="h2"?"active":""}`,onClick:()=>_("h2"),children:[_e.jsx("i",{className:"icon h2"}),_e.jsx("span",{className:"text",children:za.h2})]}),s.heading&&s.heading.find(b=>b.title==="Heading3")&&_e.jsxs(pa,{className:`item ${u==="h3"?"active":""}`,onClick:()=>_("h3"),children:[_e.jsx("i",{className:"icon h3"}),_e.jsx("span",{className:"text",children:za.h3})]}),s.heading&&s.heading.find(b=>b.title==="Heading4")&&_e.jsxs(pa,{className:`item ${u==="h4"?"active":""}`,onClick:()=>_("h4"),children:[_e.jsx("i",{className:"icon h4"}),_e.jsx("span",{className:"text",children:za.h4})]}),s.heading&&s.heading.find(b=>b.title==="Heading5")&&_e.jsxs(pa,{className:`item ${u==="h5"?"active":""}`,onClick:()=>_("h5"),children:[_e.jsx("i",{className:"icon h5"}),_e.jsx("span",{className:"text",children:za.h5})]})]}),_e.jsx(P1,{})]}):""]})},sp="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMS4xIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLi0tPjxwYXRoIGQ9Ik0wIDI1NkMwIDExNC42IDExNC42IDAgMjU2IDBzMjU2IDExNC42IDI1NiAyNTYtMTE0LjYgMjU2LTI1NiAyNTZTMCAzOTcuNCAwIDI1NnptMTc1LTQ3LjkgNDcuMSA0N0wxNzUgMzAzYy05LjMgOS40LTkuMyAyNC42IDAgMzMuMSA5LjQgMTAuMiAyNC42IDEwLjIgMzMuMSAwbDQ3LTQ2LjIgNDcuOSA0Ni4yYzkuNCAxMC4yIDI0LjYgMTAuMiAzMy4xIDAgMTAuMi04LjUgMTAuMi0yMy43IDAtMzMuMWwtNDYuMi00Ny45IDQ2LjItNDdjMTAuMi04LjUgMTAuMi0yMy43IDAtMzMuMS04LjUtOS4zLTIzLjctOS4zLTMzLjEgMGwtNDcuOSA0Ny4xLTQ3LTQ3LjFjLTguNS05LjMtMjMuNy05LjMtMzMuMSAwLTkuMyA5LjQtOS4zIDI0LjYgMCAzMy4xeiIvPjwvc3ZnPg==";function $k({onClose:p}){const[t,i]=ve.useState("4"),[e,s]=ve.useState("4"),[r,n]=ve.useState(!0);ve.useState();const[o]=Yn(),l=()=>{!t||!e||(o.update(()=>{const u=kv(t,e,!0);wv(u)}),p==null||p())},a=()=>{n(!1),p==null||p()};return _e.jsx(_e.Fragment,{children:r&&_e.jsx("div",{className:"modal-overlay",children:_e.jsxs("div",{className:"modal-content",children:[_e.jsx("h3",{children:"Select Table Dimensions"}),_e.jsx("button",{className:"modal-buttons-close",onClick:()=>a(),children:_e.jsx("img",{src:sp,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),_e.jsxs("div",{className:"select-table-container",children:[_e.jsx("label",{children:"Rows"}),_e.jsx("input",{type:"number",value:t,onChange:u=>i(Number(u.target.value))})]}),_e.jsxs("div",{className:"select-table-container",children:[_e.jsx("label",{children:"Column"}),_e.jsx("input",{type:"number",value:e,onChange:u=>s(Number(u.target.value))})]}),_e.jsx("div",{children:_e.jsx("div",{className:"modal-buttons",children:_e.jsx("button",{className:"toolbar-item",onClick:l,children:"Confirm"})})})]})})})}const qk=[{letter:"",uppercase:"A",lowercase:"α"},{letter:"Beta",uppercase:"Β",lowercase:"β"},{letter:"Gamma",uppercase:"Γ",lowercase:"γ"},{letter:"Delta",uppercase:"Δ",lowercase:"δ"},{letter:"Epsilon",uppercase:"Ε",lowercase:"ε"},{letter:"Zeta",uppercase:"Ζ",lowercase:"ζ"},{letter:" Eta ",uppercase:"Η",lowercase:"η"},{letter:"Theta",uppercase:"Θ",lowercase:"θ"},{letter:"Iota",uppercase:"Ι",lowercase:"ι"},{letter:"Kappa",uppercase:"Κ",lowercase:"κ"}];function Wk(){const[p]=Yn(),[t,i]=ve.useState(!1),e=s=>{p.update(()=>{var n;const r=Ot();if(Et(r)){const o=r.anchor.getNode();let l="inherit";if(o instanceof Wi){const u=o.getStyle();l=((n=u==null?void 0:u.match(/font-size:\s*(\S+);/))==null?void 0:n[1])||l}const a=sr(s);r.insertNodes([a])}}),i(!1)};return _e.jsx("div",{title:"Symbols",className:"symbol-dropdown cust-head-dropDown",children:_e.jsx(bm,{buttonClassName:"toolbar-item block-controls",buttonAriaLabel:"For appying Symbols",buttonLabel:"Symbols",children:_e.jsx("div",{className:"symbol-Flex-container",children:qk.map(({letter:s,uppercase:r,lowercase:n})=>_e.jsxs("div",{className:"symbol-items",children:[_e.jsx(pa,{className:"terr",onClick:()=>e(n),children:n}),_e.jsx(pa,{className:"terr",onClick:()=>e(r),children:r})]},s))})})})}const Vk=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function Jk(p){return{initialValueFn:()=>p.isEditable(),subscribe:t=>p.registerEditableListener(t)}}function td(){return function(p){const[t]=Yn(),i=ve.useMemo(()=>p(t),[t,p]),e=ve.useRef(i.initialValueFn()),[s,r]=ve.useState(e.current);return Vk(()=>{const{initialValueFn:n,subscribe:o}=i,l=n();return e.current!==l&&(e.current=l,r(l)),o(a=>{e.current=a,r(a)})},[i,p]),s}(Jk)}const R1="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNCAxMkgyME0xMiA0VjIwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==",D1="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNiAxMkwxOCAxMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4=";var Gk=typeof global=="object"&&global&&global.Object===Object&&global;const Kk=Gk;var Yk=typeof self=="object"&&self&&self.Object===Object&&self,Zk=Kk||Yk||Function("return this")();const L1=Zk;var Qk=L1.Symbol;const lp=Qk;var F1=Object.prototype,Xk=F1.hasOwnProperty,eT=F1.toString,nd=lp?lp.toStringTag:void 0;function tT(p){var t=Xk.call(p,nd),i=p[nd];try{p[nd]=void 0;var e=!0}catch{}var s=eT.call(p);return e&&(t?p[nd]=i:delete p[nd]),s}var nT=Object.prototype,rT=nT.toString;function oT(p){return rT.call(p)}var iT="[object Null]",aT="[object Undefined]",B1=lp?lp.toStringTag:void 0;function sT(p){return p==null?p===void 0?aT:iT:B1&&B1 in Object(p)?tT(p):oT(p)}function lT(p){return p!=null&&typeof p=="object"}var cT="[object Symbol]";function uT(p){return typeof p=="symbol"||lT(p)&&sT(p)==cT}var dT=/\s/;function fT(p){for(var t=p.length;t--&&dT.test(p.charAt(t)););return t}var pT=/^\s+/;function hT(p){return p&&p.slice(0,fT(p)+1).replace(pT,"")}function vm(p){var t=typeof p;return p!=null&&(t=="object"||t=="function")}var z1=0/0,gT=/^[-+]0x[0-9a-f]+$/i,mT=/^0b[01]+$/i,yT=/^0o[0-7]+$/i,bT=parseInt;function U1(p){if(typeof p=="number")return p;if(uT(p))return z1;if(vm(p)){var t=typeof p.valueOf=="function"?p.valueOf():p;p=vm(t)?t+"":t}if(typeof p!="string")return p===0?p:+p;p=hT(p);var i=mT.test(p);return i||yT.test(p)?bT(p.slice(2),i?2:8):gT.test(p)?z1:+p}var vT=function(){return L1.Date.now()};const _m=vT;var _T="Expected a function",xT=Math.max,wT=Math.min;function ST(p,t,i){var e,s,r,n,o,l,a=0,u=!1,c=!1,f=!0;if(typeof p!="function")throw new TypeError(_T);t=U1(t)||0,vm(i)&&(u=!!i.leading,c="maxWait"in i,r=c?xT(U1(i.maxWait)||0,t):r,f="trailing"in i?!!i.trailing:f);function d(x){var y=e,w=s;return e=s=void 0,a=x,n=p.apply(w,y),n}function h(x){return a=x,o=setTimeout(_,t),u?d(x):n}function m(x){var y=x-l,w=x-a,C=t-y;return c?wT(C,r-w):C}function g(x){var y=x-l,w=x-a;return l===void 0||y>=t||y<0||c&&w>=r}function _(){var x=_m();if(g(x))return v(x);o=setTimeout(_,m(x))}function v(x){return o=void 0,f&&e?d(x):(e=s=void 0,n)}function b(){o!==void 0&&clearTimeout(o),a=0,e=l=s=o=void 0}function S(){return o===void 0?n:v(_m())}function E(){var x=_m(),y=g(x);if(e=arguments,s=this,l=x,y){if(o===void 0)return h(l);if(c)return clearTimeout(o),o=setTimeout(_,t),d(l)}return o===void 0&&(o=setTimeout(_,t)),n}return E.cancel=b,E.flush=S,E}function ET(p,t,i){const e=ve.useRef(null);return e.current=p,ve.useMemo(()=>ST((...s)=>{e.current&&e.current(...s)},t,{maxWait:i}),[t,i])}const H1=20;function CT({anchorElem:p}){const[t]=Yn(),i=td(),[e,s]=ve.useState(!1),[r,n]=ve.useState(!1),[o,l]=ve.useState(!0),[a,u]=ve.useState({}),c=ve.useRef(new Set),f=ve.useRef(null),d=ET(_=>{const{isOutside:v,tableDOMNode:b}=kT(_);if(v){s(!1),n(!1);return}if(!b)return;f.current=b;let S=null,E=null,x=null;if(t.update(()=>{var w;const y=Jr(b);if(En(y)){const C=er(y,j=>jr(j));if(!jr(C))return;if(x=t.getElementByKey(C==null?void 0:C.getKey()),x){const j=C.getChildrenSize(),P=(w=C.getChildAtIndex(0))==null?void 0:w.getChildrenSize(),F=Ov(y),I=Gg(y);F===j-1?S=y:I===P-1&&(E=y)}}}),x){const{width:y,y:w,right:C,left:j,bottom:P,height:F}=x.getBoundingClientRect(),{y:I,left:D}=p.getBoundingClientRect();S?(n(!1),s(!0),u({height:H1,left:j-D,top:P-I+25,width:y})):E&&(n(!0),s(!1),u({height:F,left:C-D+10,top:w-I-2,width:H1}))}},50,250),h=ve.useMemo(()=>new ResizeObserver(()=>{s(!1),n(!1)}),[]);ve.useEffect(()=>{if(o)return document.addEventListener("mousemove",d),()=>{s(!1),n(!1),d.cancel(),document.removeEventListener("mousemove",d)}},[o,d]),ve.useEffect(()=>Mr(t.registerMutationListener(Ji,_=>{t.getEditorState().read(()=>{for(const[v,b]of _){const S=t.getElementByKey(v);switch(b){case"created":c.current.add(v),l(c.current.size>0),S&&h.observe(S);break;case"destroyed":c.current.delete(v),l(c.current.size>0),h.disconnect(),c.current.forEach(E=>{const x=t.getElementByKey(E);x&&h.observe(x)});break}}})})),[t,h]);const m=_=>{t.update(()=>{if(f.current){const v=Jr(f.current);v==null||v.selectEnd(),_?(VC(),s(!1)):(JC(),n(!1))}})},g=_=>{t.update(()=>{if(f.current){const v=Jr(f.current);v==null||v.selectEnd(),_?(GC(),s(!1)):(KC(),n(!1))}})};return i?_e.jsxs(_e.Fragment,{children:[e&&_e.jsxs("div",{children:[_e.jsx("button",{className:"PlaygroundEditorTheme__tableAddRows",style:{...a,flex:"50%",padding:"20px"},onClick:()=>m(!0),children:_e.jsx("img",{src:R1,height:14,width:14,style:{backgroundColor:"#90EE90",marginLeft:"-3px",borderRadius:"20px"}})}),_e.jsx("button",{className:"PlaygroundEditorTheme__tableAddRows",style:{...a,flex:"50%"},onClick:()=>g(!0),children:_e.jsx("img",{src:D1,height:14,width:14,style:{backgroundColor:"#FFCCCB",marginLeft:"-3px",borderRadius:"20px"}})})]}),r&&_e.jsxs("div",{className:"table-add-row-flex-container",children:[_e.jsx("button",{className:"PlaygroundEditorTheme__tableAddColumns table-add-row-flex-children",style:{...a,flex:"50%",padding:"20px"},onClick:()=>m(!1),children:_e.jsx("img",{src:R1,height:14,width:14,style:{backgroundColor:"#90EE90",marginLeft:"3px",borderRadius:"20px",border:"green"}})}),_e.jsx("button",{className:"PlaygroundEditorTheme__tableAddColumns table-add-row-flex-children",style:{...a,flex:"30%"},onClick:()=>g(!1),children:_e.jsx("img",{src:D1,height:14,width:14,style:{backgroundColor:"#FFCCCB",marginLeft:"-3px",borderRadius:"20px",border:"green"}})})]})]}):null}function kT(p){const t=p.target;if(t&&t instanceof HTMLElement){const i=t.closest("td.PlaygroundEditorTheme__tableCell, th.PlaygroundEditorTheme__tableCell");return{isOutside:!(i||t.closest("button.PlaygroundEditorTheme__tableAddRows")||t.closest("button.PlaygroundEditorTheme__tableAddColumns")||t.closest("div.TableCellResizer__resizer")),tableDOMNode:i}}else return{isOutside:!0,tableDOMNode:null}}function TT({anchorElem:p=document.body}){return td()?ro.createPortal(_e.jsx(CT,{anchorElem:p}),p):null}const wM="";function OT({onClose:p,children:t,title:i,closeOnClickOutside:e}){const s=ve.useRef(null);return ve.useEffect(()=>{s.current!==null&&s.current.focus()},[]),ve.useEffect(()=>{let r=null;const n=a=>{a.key==="Escape"&&p()},o=a=>{const u=a.target;s.current!==null&&!s.current.contains(u)&&e&&p()},l=s.current;return l!==null&&(r=l.parentElement,r!==null&&r.addEventListener("click",o)),window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n),r!==null&&(r==null||r.removeEventListener("click",o))}},[e,p]),_e.jsx("div",{className:"Modal__overlay",role:"dialog",children:_e.jsxs("div",{className:"Modal__modal",tabIndex:-1,ref:s,children:[_e.jsx("h2",{className:"Modal__title",children:i}),_e.jsx("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:p,children:"X"}),_e.jsx("div",{className:"Modal__content",children:t})]})})}function AT({onClose:p,children:t,title:i,closeOnClickOutside:e=!1}){return ro.createPortal(_e.jsx(OT,{onClose:p,title:i,closeOnClickOutside:e,children:t}),document.body)}function cp(){const[p,t]=ve.useState(null),i=ve.useCallback(()=>{t(null)},[]),e=ve.useMemo(()=>{if(p===null)return null;const{title:r,content:n,closeOnClickOutside:o}=p;return _e.jsx(AT,{onClose:i,title:r,closeOnClickOutside:o,children:n})},[p,i]),s=ve.useCallback((r,n,o=!1)=>{t({closeOnClickOutside:o,content:n(i),title:r})},[i]);return[e,s]}const jT="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxpdmVsbG9fMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDojNDFBNUVFO30gLnN0MXtmaWxsOiMyQjdDRDM7fSAuc3Qye2ZpbGw6IzE4NUFCRDt9IC5zdDN7ZmlsbDojMTAzRjkxO30gLnN0NHtvcGFjaXR5OjAuMTtlbmFibGUtYmFja2dyb3VuZDpuZXcgO30gLnN0NXtvcGFjaXR5OjAuMjtlbmFibGUtYmFja2dyb3VuZDpuZXcgO30gLnN0NntmaWxsOnVybCgjU1ZHSURfMV8pO30gLnN0N3tmaWxsOiNGRkZGRkY7fTwvc3R5bGU+PHBhdGggY2xhc3M9InN0MCIgZD0iTTQ5MC4xNywxOS4ySDE0MC45Yy0xMi4wNSwwLTIxLjgzLDkuNzItMjEuODMsMjEuN2wwLDB2OTYuN2wyMDIuNDIsNTkuMkw1MTIsMTM3LjZWNDAuOQlDNTEyLDI4LjkxLDUwMi4yMywxOS4yLDQ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uMzljMC40NC01Ljk3LDEuMjctMTEuOSwyLjQ4LTE3Ljc2bDE4Ljk5LTk3LjZoMjcuMDIJbC0zMy4zNiwxNDEuMTNIMTU3LjFsLTIyLjYyLTkzLjQ3Yy0wLjY1LTIuNjktMS40LTYuMi0yLjIzLTEwLjUzcy0xLjMzLTcuNDgtMS41NC05LjQ3aC0wLjM5Yy0wLjI2LDIuMy0wLjc3LDUuNzEtMS41NCwxMC4yMwljLTAuNzYsNC41Mi0xLjM3LDcuODctMS44MywxMC4wNGwtMjEuMjcsOTMuMTdoLTMyLjFMNDAuMDQsMTg1LjQ2aDI3LjVsMjAuNjgsOTguNjlDODguNywyODYuMTcsODkuMTQsMjg4Ljg3LDg5LjU2LDI5Mi4yMXoiLz48L3N2Zz4=",NT=({htmlPasteModalOpen:p,onlUser:t,collabApiKey:i,sethtmlPasteModalOpen:e,onPaste:s,source:r})=>{const n=ve.useRef(null),[o,l]=ve.useState(""),[a,u]=ve.useState(),[c]=Yn();ve.useRef(null);const f=()=>{u({root:{type:"root",version:1,children:[{children:[],direction:"ltr",format:"",indent:0,type:"text",version:1}],direction:"ltr",format:"",indent:0}}),l("")};ve.useEffect(()=>{f()},[]);const d=()=>{e(!1),l(" "),f()},h=j=>{const P=/display:\s*([^;]+);/,F=j.match(P);if(F)return F[1]};function m(){const[j]=Yn(),P=(I,D)=>{j.update(()=>{const N=lr(),k=sr(`${I}`);k.setStyle(D.style),k.setFormat(D.format),N.append(k),j.getRootElement()&&I&&I.length>0&&j.getEditorState().read(()=>yr()).append(N)})},F=()=>{E(o).root.children.map((D,N)=>{D&&D.text&&D.text.trim("")&&D.text.trim("").length>1&&D.style&&D.style.length>10&&h(D.style)==="block"&&(P(D.text.trim(""),D),o.includes("table")&&console.log("yes"))}),setTimeout(()=>{r==="local"&&location.reload(),r==="remote"&&s()},1e3),d()};return _e.jsx("button",{className:`green-button-paste ${o.length>100?"":"disable-btn"}`,onClick:F,children:"Insert Node"})}function g(j,P){const F=/font-weight:\s*([a-zA-Z0-9\-]+);/,I=/text-decoration:\s*([^;]+?)(?=\s*;|\s*$)/,D=/font-style:\s*([a-zA-Z0-9\-]+);/,N=/font-size:\s*([\d.]+(?:px|pt|em|rem|%)?)/,k=/color:\s*([^;]+)/,A=j.match(F),R=j.match(I),L=j.match(D),J=j.match(N),O=j.match(k),z=A?A[1]:null,W=R?R[1]:null,G=L?L[1]:null,B=J?J[1]:null,$=O?O[1]:null;let H={"font-weight":z&&z!==null?z:"none","text-decoration":W&&W!==null?W:"none","font-style":G&&G!==null?G:"none","font-size":"none",display:["span","table","tbody","tr","td"].includes(P)?"block":"none",color:$&&$!=="transparent"?$:"black"};function K(Z){return Object.entries(Z).map(([X,ee])=>`${X}: ${ee};`).join(" ")}return{cssString:K(H),fontSize:B&&B!==null?B:"none",fontWeight:z&&z!==null?z:"none",fontStyle:G&&G!==null?G:"none",textDecoration:W&&W!==null?W:"none"}}const _=(j,P)=>{const F=new RegExp(`${P}:\\s*([^;]+)`),I=j.match(F);return I?I[1].trim():null};function v(j){return console.log("Processing Table:",j),Array.from(j.querySelectorAll("tr")).map(I=>Array.from(I.querySelectorAll("td")).map(N=>{let R=Array.from(N.querySelectorAll("span")).map(O=>{const z=O.getAttribute("style")||"";return{text:O.innerText.trim(),style:z}}).map(O=>O.style).filter(O=>O).map(O=>O.split(";").map(z=>z.trim()).filter(z=>!z.startsWith("font-family")).filter(z=>!z.startsWith("font-size")).filter(z=>!z.startsWith("border")).filter(z=>!z.startsWith("width")).join("; ")).join("; ");const L=_(R,"font-weight"),J=_(R,"font-style");return R=`${R};font-weight:${L}`,R=`${R};font-style:${J}`,R=`${R};color:black`,{text:N.innerText.trim(),style:R}}))}const b=j=>{const F=new DOMParser().parseFromString(j,"text/html"),I=F.querySelectorAll("img"),D=Array.from(I).map(O=>O.src),N=O=>O.getAttribute("style")||"",k=F.querySelectorAll("ol"),A=F.querySelectorAll("ul"),R=O=>{const z=Array.from(O.querySelectorAll("li")).map(W=>({text:W.innerText.trim(),style:N(W)}));return{listStyle:N(O),items:z}},L=Array.from(k).map(O=>R(O)),J=Array.from(A).map(O=>R(O));console.log("orderedLists","unorderedLists",L,J),console.log("getImageSrcFromHTML",D)};function S(j,P){P.update(()=>{const F=Kf();j.forEach(D=>{const N=pl();D.forEach(k=>{const A=ua(),R=sr(k.text);k.style&&R.setStyle(k.style),A.append(R),N.append(A)}),F.append(N)}),P.getEditorState().read(()=>yr()).append(F)})}function E(j){const F=new DOMParser().parseFromString(j,"text/html");F.querySelectorAll("table").forEach(A=>{const R=v(A);S(R,c),A.remove()});const D=F.querySelectorAll("*"),N=Array.from(D).filter(A=>!A.closest("table")).map(A=>({elemText:A.innerText,tagName:A.tagName.toLowerCase(),style:A.getAttribute("style")||""}));let k=a;return N.map(A=>{let R=g(A.style,A.tagName);const{cssString:L,fontSize:J,fontWeight:O,textDecoration:z,fontStyle:W,border:G}=R||{};if(A.style&&A.style.length>0&&A.elemText.trim(" ").length&&J!=="none"&&O!==null&&z!==null&&W!==null){let B=O==="bold"&&W==="italic"&&z==="underline line-through"?15:z==="underline line-through"?12:W==="italic"&&z=="line-through"?6:W==="italic"&&z==="underline"?10:O==="bold"&&z==="line-through"?5:O==="bold"&&z==="underline"?9:O==="bold"&&W==="italic"?3:O==="bold"?1:W==="italic"?2:A.style.includes("text-decoration: underline")?8:A.style.includes("text-decoration: line-through")?4:0;k.root.children.push({detail:0,format:B,mode:"normal",style:`${L}`,text:`${A.elemText}`,type:"text",version:1})}}),k}const x=j=>{if(j){j.preventDefault();const F=(j.clipboardData||window.clipboardData).getData("text/html");F&&l(F),b(F)}},y=()=>{l("")};ve.useEffect(()=>()=>{l(" ")},[]);const w=()=>{e(!0)},C=()=>{e(!1),l("")};return _e.jsxs(_e.Fragment,{children:[_e.jsx("button",{title:"MS-Word content paste",className:"toolbar-item space insert-ms-word-btn",onClick:w,children:_e.jsx("img",{src:jT,height:16,width:16})}),t&&t.length>0?p&&_e.jsx("div",{className:"modal-overlay",children:_e.jsxs("div",{className:"modal-content custom-paste-modal-content",children:[_e.jsx("h3",{children:"Paste MS Word Content below"}),_e.jsx("button",{className:"modal-buttons-close",onClick:C,children:_e.jsx("img",{src:sp,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),_e.jsxs("div",{className:"select-table-container",children:[o.length>100,_e.jsx("textarea",{onPaste:x,className:o&&o.length>100?"small-paste-area":"enlarge-paste-area"}),_e.jsx("div",{contentEditable:!0,className:o&&o.length>100?"enlarge-paste-area":"small-paste-area",ref:n,dangerouslySetInnerHTML:{__html:o}})]}),_e.jsx("div",{children:_e.jsxs("div",{className:"modal-buttons",children:[_e.jsx("button",{className:`red-button-paste ${o.length>100?"":"disable-btn"}`,onClick:y,children:"Reset"}),_e.jsx(m,{})]})})]})}):p&&_e.jsx("div",{className:"modal-overlay",children:i?_e.jsxs("div",{className:"modal-content custom-paste-modal-content",children:[_e.jsx("h3",{children:"Paste MS Word Content below"}),_e.jsx("button",{className:"modal-buttons-close",onClick:C,children:_e.jsx("img",{src:sp,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),_e.jsxs("div",{className:"select-table-container",children:[o.length>100,_e.jsx("div",{className:"text-area-loading",children:"Loading..."})]})]}):_e.jsxs("div",{className:"modal-content custom-paste-modal-content",children:[_e.jsx("h3",{children:"Paste MS Word Content below"}),_e.jsx("button",{className:"modal-buttons-close",onClick:C,children:_e.jsx("img",{src:sp,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),_e.jsxs("div",{className:"select-table-container",children:[o.length>100,_e.jsx("textarea",{onPaste:x,className:o&&o.length>100?"small-paste-area":"enlarge-paste-area"}),_e.jsx("div",{contentEditable:!0,className:o&&o.length>100?"enlarge-paste-area":"small-paste-area",ref:n,dangerouslySetInnerHTML:{__html:o}})]}),_e.jsx("div",{children:_e.jsxs("div",{className:"modal-buttons",children:[_e.jsx("button",{className:`red-button-paste ${o.length>100?"":"disable-btn"}`,onClick:y,children:"Reset"}),_e.jsx(m,{})]})})]})})]})},PT="data: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cuNDk0eiAgIE0xNzYuNDQzLDIxMS4wNjFsMzMuNjgzLTMyLjMyM2w3NC42NTQsNjkuMDVoLTc5LjY3TDE3Ni40NDMsMjExLjA2MXogTTMyNSw5Ni41NzRjLTYuMzg0LDIuMjY5LTEzLjA4NSwzLjQyNi0yMCwzLjQyNiAgYy0zMy4wODQsMC02MC0yNi45MTYtNjAtNjBjMC02LjkxMSwxLjE1Ni0xMy42MTIsMy40MjItMjBIMzI1Vjk2LjU3NHogTTI1LDIwaDIwMi41MTZDMjI1Ljg0NSwyNi40NzksMjI1LDMzLjE2NiwyMjUsNDAgIGMwLDQ0LjExMiwzNS44ODgsODAsODAsODBjNi44MzcsMCwxMy41MjMtMC44NDYsMjAtMi41MTh2MTMwLjMwNmgtMTAuNzY3bC0xMDQuMzU5LTk2LjUyNmwtNDUuODAxLDQzLjk1MUwxMjAsMTM4Ljc0OCAgbC04NS4xMDksMTA5LjA0SDI1VjIweiIvPgo8L3N2Zz4=",rd=1;function gc(){return _e.jsx("div",{className:"divider"})}function MT({onlUser:p,styleConfig:t,collabApiKey:i,onPaste:e,source:s}){const[r]=Yn(),n=ve.useRef(null),[o,l]=ve.useState(!1),[a,u]=ve.useState(!1),[c,f]=ve.useState(!1),[d,h]=ve.useState(!1),[m,g]=ve.useState(!1),[_,v]=ve.useState(!1),[b,S]=ve.useState(!1),[E,x]=ve.useState(!1),[y,w]=ve.useState("11px"),[C,j]=ve.useState(()=>r.isEditable()),[P,F]=ve.useState(""),[I,D]=ve.useState(""),[N,k]=ve.useState(""),[A,R]=cp(),[L,J]=ve.useState(!1),O=ve.useCallback(()=>{const G=Ot();Et(G)&&(f(G.hasFormat("bold")),h(G.hasFormat("italic")),g(G.hasFormat("underline")),v(G.hasFormat("strikethrough")),S(G.hasFormat("subscript")),x(G.hasFormat("superscript")))},[]),z=G=>{r.update(()=>{const B=Ot();Et(B)&&B.getNodes().forEach(q=>{if(qt(q)){let K=q.getStyle()||"";for(const[Y,Z]of Object.entries(G)){const X=new RegExp(`${Y}:\\s*[^;]+;?`,"g");K=K.replace(X,""),K+=`${Y}: ${Z}; `}q.setStyle(K.trim())}})})},W=ve.useCallback(()=>{var B,$;const G=Ot();if(Et(G)){const q=(($=(B=Ot())==null?void 0:B.getNodes()[0])==null?void 0:$.__style)??"",H=["font-weight","font-style","text-decoration"],K={};if(q.split(";").map(Z=>Z.trim()).forEach(Z=>{const[X,ee]=Z.split(":").map(ne=>ne.trim());H.includes(X)&&(K[X]=ee)}),K["font-weight"]==="bold"){const Z=Ot();Et(Z)&&c===Z.hasFormat("bold")&&z({"font-weight":"400"})}else{const Z=Ot();Et(Z)&&c!==Z.hasFormat("bold")&&z({"font-weight":"bold"})}if(K["font-style"]==="italic"){const Z=Ot();Et(Z)&&d===Z.hasFormat("italic")&&z({"font-style":"normal"})}else{const Z=Ot();Et(Z)&&d!==Z.hasFormat("italic")&&z({"font-style":"italic"})}if(K["text-decoration"]==="line-through"){const Z=Ot();Et(Z)&&_===Z.hasFormat("strikethrough")&&z({"text-decoration":_?"line-through":"none"})}else{const Z=Ot();Et(Z)&&_!==Z.hasFormat("strikethrough")&&z({"text-decoration":_!==Z.hasFormat("strikethrough")&&m!==Z.hasFormat("underline")?"underline line-through":_?"none":"line-through"})}if(K["text-decoration"]==="underline"){const Z=Ot();Et(Z)&&m===Z.hasFormat("underline")&&z({"text-decoration":m?"underline":"none"})}else{const Z=Ot();Et(Z)&&m!==Z.hasFormat("underline")&&z({"text-decoration":_!==Z.hasFormat("strikethrough")&&m!==Z.hasFormat("underline")?"underline line-through":m?"none":"underline"})}}},[]);return ve.useEffect(()=>Mr(r.registerUpdateListener(({editorState:G})=>{G.read(()=>{O()})}),r.registerCommand(zo,(G,B)=>{var H;F("");const $=(H=Ot())==null?void 0:H.getNodes()[0].__parent;return r.getEditorState()._nodeMap.forEach((K,Y)=>{Y===$&&k(K.__tag)}),O(),W(),!1},rd),r.registerCommand(ls,G=>(D(G.target),W(),!1),rd),r.registerCommand(Wl,G=>(l(G),!1),rd),r.registerCommand(ql,G=>(u(G),!1),rd),r.registerCommand(aa,G=>(F("Enter"),!0),rd)),[r,O,W]),_e.jsxs("div",{className:"toolbar",ref:n,children:[_e.jsx("button",{title:"Undo",disabled:!o,onClick:()=>{r.dispatchCommand(Su,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:_e.jsx("i",{className:"format undo"})}),_e.jsx("button",{title:"Redo",disabled:!a,onClick:()=>{r.dispatchCommand(Eu,void 0)},className:"toolbar-item","aria-label":"Redo",children:_e.jsx("i",{className:"format redo"})}),_e.jsx(gc,{}),_e.jsx(Hk,{currentElementClick:I,selectionFontSize:y.slice(0,-2),editor:r,disabled:!C,blockType:"paragraph",styleConfig:t,isenterPressed:P,currentElementSelect:N}),_e.jsx(gc,{}),_e.jsx("button",{title:"Bold",onClick:()=>{r.dispatchCommand(Vr,"bold")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Bold",children:_e.jsx("i",{className:"format bold"})}),_e.jsx("button",{title:"Italic",onClick:()=>{r.dispatchCommand(Vr,"italic")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Italics",children:_e.jsx("i",{className:"format italic"})}),_e.jsx("button",{title:"Underline",onClick:()=>{r.dispatchCommand(Vr,"underline")},className:"toolbar-item spaced "+(m?"active":""),"aria-label":"Format Underline",children:_e.jsx("i",{className:"format underline"})}),_e.jsx("button",{title:"Strikethrough",onClick:()=>{r.dispatchCommand(Vr,"strikethrough")},className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Format Strikethrough",children:_e.jsx("i",{className:"format strikethrough"})}),_e.jsx("button",{title:"SuperScript",onClick:()=>{r.dispatchCommand(Vr,"superscript")},className:"toolbar-item spaced "+(E?"active":""),"aria-label":"Format SuperScript",children:_e.jsx("img",{src:zk,height:16,width:16,style:{marginTop:"1px"}})}),_e.jsx("button",{title:"SubScript",onClick:()=>{r.dispatchCommand(Vr,"subscript")},className:"toolbar-item spaced "+(b?"active":""),"aria-label":"Format SubScript",children:_e.jsx("img",{src:Bk,height:16,width:16,style:{marginTop:"1px"}})}),_e.jsx(gc,{}),_e.jsx("button",{title:"Left Align",onClick:()=>{r.dispatchCommand($l,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:_e.jsx("i",{className:"format left-align"})}),_e.jsx("button",{title:"Center Align",onClick:()=>{r.dispatchCommand($l,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:_e.jsx("i",{className:"format center-align"})}),_e.jsx("button",{title:"Right Align",onClick:()=>{r.dispatchCommand($l,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:_e.jsx("i",{className:"format right-align"})}),_e.jsx("button",{title:"Justify Align",onClick:()=>{r.dispatchCommand($l,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:_e.jsx("i",{className:"format justify-align"})}),_e.jsx(gc,{}),_e.jsx(Wk,{}),_e.jsx(NT,{source:s,onPaste:e,htmlPasteModalOpen:L,sethtmlPasteModalOpen:J,onlUser:p,collabApiKey:i}),_e.jsx(gc,{}),_e.jsx(TT,{}),_e.jsxs(bm,{disabled:!C,buttonClassName:"toolbar-item spaced",buttonLabel:"Insert",buttonAriaLabel:"Insert specialized editor node",buttonIconClassName:"icon plus",children:[_e.jsx(pa,{onClick:()=>{R("Insert Image",G=>_e.jsx(C2,{activeEditor:r,onClose:G}))},className:"item",children:_e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[_e.jsx("img",{className:"add-toolbar-image-icon",src:IT,alt:"Add Image",style:{height:"16px",width:"16px"}}),_e.jsx("span",{className:"text",children:"Image"})]})}),_e.jsx(pa,{onClick:()=>{R("Insert Table",G=>_e.jsx($k,{onClose:G}))},className:"item",children:_e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[_e.jsx("img",{className:"add-toolbar-table-icon",src:PT,alt:"Add Table",style:{height:"16px",width:"16px"}}),_e.jsx("span",{className:"text",children:"Table"})]})})]}),_e.jsx(gc,{}),_e.jsx("div",{className:"flex-container-onluser",children:p}),A]})}function xm(){return yr().getTextContent()}function wm(p,t=!0){if(p)return!1;let i=xm();return t&&(i=i.trim()),i===""}function RT(p){if(!wm(p,!1))return!1;const t=yr().getChildren(),i=t.length;if(i>1)return!1;for(let e=0;e<i;e++){const s=t[e];if(ur(s))return!1;if(Nt(s)){if(!ca(s)||s.__indent!==0)return!1;const r=s.getChildren(),n=r.length;for(let o=0;o<n;o++){const l=r[e];if(!qt(l))return!1}}}return!0}function $1(p){return()=>RT(p)}function DT(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}DT(function(p){const t=new URLSearchParams;t.append("code",p);for(let i=1;i<arguments.length;i++)t.append("v",arguments[i]);throw Error(`Minified Lexical error #${p}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function q1(p){const t=window.location.origin,i=e=>{if(e.origin!==t)return;const s=p.getRootElement();if(document.activeElement!==s)return;const r=e.data;if(typeof r=="string"){let n;try{n=JSON.parse(r)}catch{return}if(n&&n.protocol==="nuanria_messaging"&&n.type==="request"){const o=n.payload;if(o&&o.functionId==="makeChanges"){const l=o.args;if(l){const[a,u,c,f,d,h]=l;p.update(()=>{const m=Ot();if(Et(m)){const g=m.anchor;let _=g.getNode(),v=0,b=0;if(qt(_)&&a>=0&&u>=0&&(v=a,b=a+u,m.setTextNodeRange(_,v,_,b)),v===b&&c===""||(m.insertRawText(c),_=g.getNode()),qt(_)){v=f,b=f+d;const S=_.getTextContentSize();v=v>S?S:v,b=b>S?S:b,m.setTextNodeRange(_,v,_,b)}e.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",i,!0),()=>{window.removeEventListener("message",i,!0)}}const Sm=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function W1(p){return p.getEditorState().read($1(p.isComposing()))}function up({contentEditable:p,placeholder:t,ErrorBoundary:i}){const[e]=Yn(),s=function(r,n){const[o,l]=ve.useState(()=>r.getDecorators());return Sm(()=>r.registerDecoratorListener(a=>{ro.flushSync(()=>{l(a)})}),[r]),ve.useEffect(()=>{l(r.getDecorators())},[r]),ve.useMemo(()=>{const a=[],u=Object.keys(o);for(let c=0;c<u.length;c++){const f=u[c],d=_e.jsx(n,{onError:m=>r._onError(m),children:_e.jsx(ve.Suspense,{fallback:null,children:o[f]})}),h=r.getElementByKey(f);h!==null&&a.push(ro.createPortal(d,h,f))}return a},[n,o,r])}(e,i);return function(r){Sm(()=>Mr(b2(r),q1(r)),[r])}(e),_e.jsxs(_e.Fragment,{children:[p,_e.jsx(LT,{content:t}),s]})}function LT({content:p}){const[t]=Yn(),i=function(s){const[r,n]=ve.useState(()=>W1(s));return Sm(()=>{function o(){const l=W1(s);n(l)}return o(),Mr(s.registerUpdateListener(()=>{o()}),s.registerEditableListener(()=>{o()}))},[s]),r}(t),e=td();return i?typeof p=="function"?p(e):p:null}function Em(p,t){return Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},Em(p,t)}var V1={error:null},FT=function(p){var t,i;function e(){for(var r,n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return(r=p.call.apply(p,[this].concat(o))||this).state=V1,r.resetErrorBoundary=function(){for(var a,u=arguments.length,c=new Array(u),f=0;f<u;f++)c[f]=arguments[f];r.props.onReset==null||(a=r.props).onReset.apply(a,c),r.reset()},r}i=p,(t=e).prototype=Object.create(i.prototype),t.prototype.constructor=t,Em(t,i),e.getDerivedStateFromError=function(r){return{error:r}};var s=e.prototype;return s.reset=function(){this.setState(V1)},s.componentDidCatch=function(r,n){var o,l;(o=(l=this.props).onError)==null||o.call(l,r,n)},s.componentDidUpdate=function(r,n){var o,l,a,u,c=this.state.error,f=this.props.resetKeys;c!==null&&n.error!==null&&((a=r.resetKeys)===void 0&&(a=[]),(u=f)===void 0&&(u=[]),a.length!==u.length||a.some(function(d,h){return!Object.is(d,u[h])}))&&((o=(l=this.props).onResetKeysChange)==null||o.call(l,r.resetKeys,f),this.reset())},s.render=function(){var r=this.state.error,n=this.props,o=n.fallbackRender,l=n.FallbackComponent,a=n.fallback;if(r!==null){var u={error:r,resetErrorBoundary:this.resetErrorBoundary};if(ar.isValidElement(a))return a;if(typeof o=="function")return o(u);if(l)return ar.createElement(l,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(ar.Component);function mc({children:p,onError:t}){return _e.jsx(FT,{fallback:_e.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:p})}function dp({defaultSelection:p}){const[t]=Yn();return ve.useEffect(()=>{t.focus(()=>{const i=document.activeElement,e=t.getRootElement();e===null||i!==null&&e.contains(i)||e.focus({preventScroll:!0})},{defaultSelection:p})},[p,t]),null}const BT=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function fp({ariaActiveDescendant:p,ariaAutoComplete:t,ariaControls:i,ariaDescribedBy:e,ariaExpanded:s,ariaLabel:r,ariaLabelledBy:n,ariaMultiline:o,ariaOwns:l,ariaRequired:a,autoCapitalize:u,className:c,id:f,role:d="textbox",spellCheck:h=!0,style:m,tabIndex:g,"data-testid":_,...v}){const[b]=Yn(),[S,E]=ve.useState(!1),x=ve.useCallback(y=>{y&&y.ownerDocument&&y.ownerDocument.defaultView&&b.setRootElement(y)},[b]);return BT(()=>(E(b.isEditable()),b.registerEditableListener(y=>{E(y)})),[b]),_e.jsx("div",{...v,"aria-activedescendant":S?p:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?i:void 0,"aria-describedby":e,"aria-expanded":S&&d==="combobox"?!!s:void 0,"aria-label":r,"aria-labelledby":n,"aria-multiline":o,"aria-owns":S?l:void 0,"aria-readonly":!S||void 0,"aria-required":a,autoCapitalize:u,className:c,contentEditable:S,"data-testid":_,id:f,ref:x,role:d,spellCheck:h,style:m,tabIndex:g})}const zT=33,UT=50;function HT({editor:p}){const t=ve.useRef(null),i=ve.useRef(null),e=ve.useRef(null),s=ve.useRef(null),[r,n]=ve.useState(null),[o,l]=ve.useState(null),[a,u]=ve.useState(!1),[c,f]=ve.useState(null);ve.useEffect(()=>p.registerCommand(zo,E=>{const x=Ot(),y=Rr(x);return a!==y&&u(y),!1},pi));const d=ve.useCallback(()=>{l(null),t.current=null,f(null),s.current=null,e.current=null},[]);ve.useEffect(()=>{const E=x=>{setTimeout(()=>{const y=x.target;if(c){n({x:x.clientX,y:x.clientY});return}if(!(i.current&&i.current.contains(y))&&t.current!==y){t.current=y;const w=Yg(y);w&&o!==w?p.update(()=>{const C=Jr(w.elem);if(!C)throw new Error("TableCellResizer: Table cell node not found.");const j=qf(C),P=p.getElementByKey(j.getKey());if(!P)throw new Error("TableCellResizer: Table element not found.");t.current=y,e.current=P.getBoundingClientRect(),l(w)}):w==null&&d()}},0)};return document.addEventListener("mousemove",E),()=>{document.removeEventListener("mousemove",E)}},[o,c,p,d]);const h=E=>E==="bottom",m=ve.useCallback(E=>{if(!o)throw new Error("TableCellResizer: Expected active cell.");p.update(()=>{const x=Jr(o.elem);if(!En(x))throw new Error("TableCellResizer: Table cell node not found.");const y=qf(x),w=Ov(x),C=y.getChildren();if(w>=C.length||w<0)throw new Error("Expected table cell to be inside of table row.");const j=C[w];if(!Xr(j))throw new Error("Expected table row");j.setHeight(E)})},[o,p]),g=ve.useCallback(E=>{if(!o)throw new Error("TableCellResizer: Expected active cell.");p.update(()=>{const x=Jr(o.elem);if(!En(x))throw new Error("TableCellResizer: Table cell node not found.");const y=qf(x),w=Gg(x),C=y.getChildren();for(let j=0;j<C.length;j++){const P=C[j];if(!Xr(P))throw new Error("Expected table row");const F=P.getChildren(),N=F.map(A=>A.getColSpan()).reduce((A,R)=>{const L=A[A.length-1]??0;return A.push(L+R),A},[]).findIndex(A=>A>w);if(N>=F.length||N<0)throw new Error("Expected table cell to be inside of table row.");const k=F[N];if(!En(k))throw new Error("Expected table cell");k.setWidth(E)}})},[o,p]),_=ve.useCallback(E=>{const x=y=>{if(y.preventDefault(),y.stopPropagation(),!o)throw new Error("TableCellResizer: Expected active cell.");if(s.current){const{x:w,y:C}=s.current;if(o===null)return;if(h(E)){const j=o.elem.getBoundingClientRect().height,P=Math.abs(y.clientY-C),F=E==="bottom"&&C>y.clientY;m(Math.max(F?j-P:P+j,zT))}else{const j=getComputedStyle(o.elem);let P=o.elem.clientWidth;P-=parseFloat(j.paddingLeft)+parseFloat(j.paddingRight);const F=Math.abs(y.clientX-w),I=E==="right"&&w>y.clientX;g(Math.max(I?P-F:F+P,UT))}d(),document.removeEventListener("mouseup",x)}};return x},[o,d,g,m]),v=ve.useCallback(E=>x=>{if(x.preventDefault(),x.stopPropagation(),!o)throw new Error("TableCellResizer: Expected active cell.");s.current={x:x.clientX,y:x.clientY},n(s.current),f(E),document.addEventListener("mouseup",_(E))},[o,_]),S=ve.useCallback(()=>{if(o){const{height:E,width:x,top:y,left:w}=o.elem.getBoundingClientRect(),C={bottom:{backgroundColor:"none",cursor:"row-resize",height:"10px",left:`${window.pageXOffset+w}px`,top:`${window.pageYOffset+y+E}px`,width:`${x}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${E}px`,left:`${window.pageXOffset+w+x}px`,top:`${window.pageYOffset+y}px`,width:"10px"}},j=e.current;return c&&r&&j&&(h(c)?(C[c].left=`${window.pageXOffset+j.left}px`,C[c].top=`${window.pageYOffset+r.y}px`,C[c].height="3px",C[c].width=`${j.width}px`):(C[c].top=`${window.pageYOffset+j.top}px`,C[c].left=`${window.pageXOffset+r.x}px`,C[c].width="3px",C[c].height=`${j.height}px`),C[c].backgroundColor="#adf"),C}return{bottom:null,left:null,right:null,top:null}},[o,c,r])();return _e.jsx("div",{ref:i,children:o!=null&&!a&&_e.jsxs(_e.Fragment,{children:[_e.jsx("div",{className:"TableCellResizer__resizer TableCellResizer__ui",style:S.right||void 0,onMouseDown:v("right")}),_e.jsx("div",{className:"TableCellResizer__resizer TableCellResizer__ui",style:S.bottom||void 0,onMouseDown:v("bottom")})]})})}function $T(){const[p]=Yn(),t=td();return ve.useMemo(()=>t?ro.createPortal(_e.jsx(HT,{editor:p}),document.body):null,[p,t])}const qT=new Set(["http:","https:","mailto:","sms:","tel:"]);let J1=class yE extends fi{static getType(){return"link"}static clone(t){return new yE(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t,i={},e){super(e);const{target:s=null,rel:r=null,title:n=null}=i;this.__url=t,this.__target=s,this.__rel=r,this.__title=n}createDOM(t){const i=document.createElement("a");return i.href=this.sanitizeUrl(this.__url),this.__target!==null&&(i.target=this.__target),this.__rel!==null&&(i.rel=this.__rel),this.__title!==null&&(i.title=this.__title),hi(i,t.theme.link),i}updateDOM(t,i,e){if(i instanceof HTMLAnchorElement){const s=this.__url,r=this.__target,n=this.__rel,o=this.__title;s!==t.__url&&(i.href=s),r!==t.__target&&(r?i.target=r:i.removeAttribute("target")),n!==t.__rel&&(n?i.rel=n:i.removeAttribute("rel")),o!==t.__title&&(o?i.title=o:i.removeAttribute("title"))}return!1}static importDOM(){return{a:t=>({conversion:WT,priority:1})}}static importJSON(t){const i=Cm(t.url,{rel:t.rel,target:t.target,title:t.title});return i.setFormat(t.format),i.setIndent(t.indent),i.setDirection(t.direction),i}sanitizeUrl(t){try{const i=new URL(t);if(!qT.has(i.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(t){this.getWritable().__url=t}getTarget(){return this.getLatest().__target}setTarget(t){this.getWritable().__target=t}getRel(){return this.getLatest().__rel}setRel(t){this.getWritable().__rel=t}getTitle(){return this.getLatest().__title}setTitle(t){this.getWritable().__title=t}insertNewAfter(t,i=!0){const e=Cm(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(e,i),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,i,e){if(!Et(i))return!1;const s=i.anchor.getNode(),r=i.focus.getNode();return this.isParentOf(s)&&this.isParentOf(r)&&i.getTextContent().length>0}};function WT(p){let t=null;if(sC(p)){const i=p.textContent;(i!==null&&i!==""||p.children.length>0)&&(t=Cm(p.getAttribute("href")||"",{rel:p.getAttribute("rel"),target:p.getAttribute("target"),title:p.getAttribute("title")}))}return{node:t}}function Cm(p,t){return So(new J1(p,t))}function km(p){return p instanceof J1}const G1=Yo();let od=class bE extends fi{static getType(){return"mark"}static clone(t){return new bE(Array.from(t.__ids),t.__key)}static importDOM(){return null}static importJSON(t){const i=id(t.ids);return i.setFormat(t.format),i.setIndent(t.indent),i.setDirection(t.direction),i}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(t,i){super(i),this.__ids=t||[]}createDOM(t){const i=document.createElement("mark");return hi(i,t.theme.mark),this.__ids.length>1&&hi(i,t.theme.markOverlap),i}updateDOM(t,i,e){const s=t.__ids,r=this.__ids,n=s.length,o=r.length,l=e.theme.markOverlap;return n!==o&&(n===1?o===2&&hi(i,l):o===1&&Vg(i,l)),!1}hasID(t){const i=this.getIDs();for(let e=0;e<i.length;e++)if(t===i[e])return!0;return!1}getIDs(){const t=this.getLatest();return ha(t)?t.__ids:[]}addID(t){const i=this.getWritable();if(ha(i)){const e=i.__ids;i.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return;e.push(t)}}deleteID(t){const i=this.getWritable();if(ha(i)){const e=i.__ids;i.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return void e.splice(s,1)}}insertNewAfter(t,i=!0){const e=id(this.__ids);return this.insertAfter(e,i),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,i,e){if(!Et(i)||e==="html")return!1;const s=i.anchor,r=i.focus,n=s.getNode(),o=r.getNode(),l=i.isBackward()?s.offset-r.offset:r.offset-s.offset;return this.isParentOf(n)&&this.isParentOf(o)&&this.getTextContent().length===l}excludeFromCopy(t){return t!=="clone"}};function id(p){return So(new od(p))}function ha(p){return p instanceof od}function K1(p){const t=p.getChildren();let i=null;for(let e=0;e<t.length;e++){const s=t[e];i===null?p.insertBefore(s):i.insertAfter(s),i=s}p.remove()}function Y1(p,t,i,e){const s=p.getNodes(),r=p.anchor.offset,n=p.focus.offset,o=s.length,l=t?n:r,a=t?r:n;let u,c;for(let f=0;f<o;f++){const d=s[f];if(Nt(c)&&c.isParentOf(d))continue;const h=f===0,m=f===o-1;let g=null;if(qt(d)){const _=d.getTextContentSize(),v=h?l:0,b=m?a:_;if(v===0&&b===0)continue;const S=d.splitText(v,b);g=S.length>1&&(S.length===3||h&&!m||b===_)?S[1]:S[0]}else{if(ha(d))continue;Nt(d)&&d.isInline()&&(g=d)}if(g!==null){if(g&&g.is(u))continue;const _=g.getParent();_!=null&&_.is(u)||(c=void 0),u=_,c===void 0&&(c=(e||id)([i]),g.insertBefore(c)),c.append(g)}else u=void 0,c=void 0}Nt(c)&&(t?c.selectStart():c.selectEnd())}function Z1(p,t){let i=p;for(;i!==null;){if(ha(i))return i.getIDs();if(qt(i)&&t===i.getTextContentSize()){const e=i.getNextSibling();if(ha(e))return e.getIDs()}i=i.getParent()}return null}const Q1=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],X1=Q1[Math.floor(Math.random()*Q1.length)],VT=ve.createContext({clientID:0,color:X1[1],isCollabActive:!1,name:X1[0],yjsDocMap:new Map});function pp(p,t){const i=ve.useContext(VT);return p!=null&&(i.name=p),t!=null&&(i.color=t),i}const JT=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function e_({onClear:p}){const[t]=Yn();return JT(()=>t.registerCommand(af,i=>(t.update(()=>{if(p==null){const e=yr(),s=Ot(),r=lr();e.clear(),e.append(r),s!==null&&r.select(),Et(s)&&(s.format=0)}else p()}),!0),Tn),[t,p]),null}const hp=0,Tm=1,Om=2,Ki=0,GT=1,t_=2,KT=3,YT=4;function ZT(p,t,i,e,s){if(p===null||i.size===0&&e.size===0&&!s)return Ki;const r=t._selection,n=p._selection;if(s)return GT;if(!(Et(r)&&Et(n)&&n.isCollapsed()&&r.isCollapsed()))return Ki;const o=function(_,v,b){const S=_._nodeMap,E=[];for(const x of v){const y=S.get(x);y!==void 0&&E.push(y)}for(const[x,y]of b){if(!y)continue;const w=S.get(x);w===void 0||Ao(w)||E.push(w)}return E}(t,i,e);if(o.length===0)return Ki;if(o.length>1){const _=t._nodeMap,v=_.get(r.anchor.key),b=_.get(n.anchor.key);return v&&b&&!p._nodeMap.has(v.__key)&&qt(v)&&v.__text.length===1&&r.anchor.offset===1?t_:Ki}const l=o[0],a=p._nodeMap.get(l.__key);if(!qt(a)||!qt(l)||a.__mode!==l.__mode)return Ki;const u=a.__text,c=l.__text;if(u===c)return Ki;const f=r.anchor,d=n.anchor;if(f.key!==d.key||f.type!=="text")return Ki;const h=f.offset,m=d.offset,g=c.length-u.length;return g===1&&m===h-1?t_:g===-1&&m===h+1?KT:g===-1&&m===h?YT:Ki}function QT(p,t){let i=Date.now(),e=Ki;return(s,r,n,o,l,a)=>{const u=Date.now();if(a.has("historic"))return e=Ki,i=u,Om;const c=ZT(s,r,o,l,p.isComposing()),f=(()=>{const d=n===null||n.editor===p,h=a.has("history-push");if(!h&&d&&a.has("history-merge"))return hp;if(s===null)return Tm;const m=r._selection;return o.size>0||l.size>0?h===!1&&c!==Ki&&c===e&&u<i+t&&d||o.size===1&&function(g,_,v){const b=_._nodeMap.get(g),S=v._nodeMap.get(g),E=_._selection,x=v._selection;let y=!1;return Et(E)&&Et(x)&&(y=E.anchor.type==="element"&&E.focus.type==="element"&&x.anchor.type==="text"&&x.focus.type==="text"),!(y||!qt(b)||!qt(S))&&b.__type===S.__type&&b.__text===S.__text&&b.__mode===S.__mode&&b.__detail===S.__detail&&b.__style===S.__style&&b.__format===S.__format&&b.__parent===S.__parent}(Array.from(o)[0],s,r)?hp:Tm:m!==null?hp:Om})();return i=u,e=c,f}}function n_(p){p.undoStack=[],p.redoStack=[],p.current=null}function XT(p,t,i){const e=QT(p,i);return Mr(p.registerCommand(Su,()=>(function(r,n){const o=n.redoStack,l=n.undoStack;if(l.length!==0){const a=n.current,u=l.pop();a!==null&&(o.push(a),r.dispatchCommand(ql,!0)),l.length===0&&r.dispatchCommand(Wl,!1),n.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(p,t),!0),Tn),p.registerCommand(Eu,()=>(function(r,n){const o=n.redoStack,l=n.undoStack;if(o.length!==0){const a=n.current;a!==null&&(l.push(a),r.dispatchCommand(Wl,!0));const u=o.pop();o.length===0&&r.dispatchCommand(ql,!1),n.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(p,t),!0),Tn),p.registerCommand(af,()=>(n_(t),!1),Tn),p.registerCommand(jE,()=>(n_(t),p.dispatchCommand(ql,!1),p.dispatchCommand(Wl,!1),!0),Tn),p.registerUpdateListener(({editorState:r,prevEditorState:n,dirtyLeaves:o,dirtyElements:l,tags:a})=>{const u=t.current,c=t.redoStack,f=t.undoStack,d=u===null?null:u.editorState;if(u!==null&&r===d)return;const h=e(n,r,u,o,l,a);if(h===Tm)c.length!==0&&(t.redoStack=[],p.dispatchCommand(ql,!1)),u!==null&&(f.push({...u}),p.dispatchCommand(Wl,!0));else if(h===Om)return;t.current={editor:p,editorState:r}}))}function eO(){return{current:null,redoStack:[],undoStack:[]}}function gp({externalHistoryState:p}){const[t]=Yn();return function(i,e,s=1e3){const r=ve.useMemo(()=>e||eO(),[e]);ve.useEffect(()=>XT(i,r,s),[s,i,r])}(t,p),null}const tO=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function Am({ignoreHistoryMergeTagChange:p=!0,ignoreSelectionChange:t=!1,onChange:i}){const[e]=Yn();return tO(()=>{if(i)return e.registerUpdateListener(({editorState:s,dirtyElements:r,dirtyLeaves:n,prevEditorState:o,tags:l})=>{t&&r.size===0&&n.size===0||p&&l.has("history-merge")||o.isEmpty()||i(s,e,l)})},[e,p,t,i]),null}const yc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,nO=yc&&"documentMode"in document?document.documentMode:null,rO=!(!yc||!("InputEvent"in window)||nO)&&"getTargetRanges"in new window.InputEvent("input"),oO=yc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),iO=yc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,aO=yc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),sO=yc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!aO;function r_(p,t){t.update(()=>{if(p!==null){const i=ws(p,KeyboardEvent)?null:p.clipboardData,e=Ot();if(e!==null&&i!=null){p.preventDefault();const s=Wv(t);s!==null&&i.setData("text/html",s),i.setData("text/plain",e.getTextContent())}}})}function lO(p){return Mr(p.registerCommand(Bi,t=>{const i=Ot();return!!Et(i)&&(i.deleteCharacter(t),!0)},Tn),p.registerCommand(ol,t=>{const i=Ot();return!!Et(i)&&(i.deleteWord(t),!0)},Tn),p.registerCommand(ds,t=>{const i=Ot();return!!Et(i)&&(i.deleteLine(t),!0)},Tn),p.registerCommand(us,t=>{const i=Ot();if(!Et(i))return!1;if(typeof t=="string")i.insertText(t);else{const e=t.dataTransfer;if(e!=null)Vv(e,i);else{const s=t.data;s&&i.insertText(s)}}return!0},Tn),p.registerCommand(tf,()=>{const t=Ot();return!!Et(t)&&(t.removeText(),!0)},Tn),p.registerCommand(cs,t=>{const i=Ot();return!!Et(i)&&(i.insertLineBreak(t),!0)},Tn),p.registerCommand(Hl,()=>{const t=Ot();return!!Et(t)&&(t.insertLineBreak(),!0)},Tn),p.registerCommand(ku,t=>{const i=Ot();if(!Et(i))return!1;const e=t,s=e.shiftKey;return!!Hf(i,!0)&&(e.preventDefault(),$f(i,s,!0),!0)},Tn),p.registerCommand(Cu,t=>{const i=Ot();if(!Et(i))return!1;const e=t,s=e.shiftKey;return!!Hf(i,!1)&&(e.preventDefault(),$f(i,s,!1),!0)},Tn),p.registerCommand(zi,t=>{const i=Ot();return!!Et(i)&&(t.preventDefault(),p.dispatchCommand(Bi,!0))},Tn),p.registerCommand(Ma,t=>{const i=Ot();return!!Et(i)&&(t.preventDefault(),p.dispatchCommand(Bi,!1))},Tn),p.registerCommand(aa,t=>{const i=Ot();if(!Et(i))return!1;if(t!==null){if((iO||oO||sO)&&rO)return!1;t.preventDefault()}return p.dispatchCommand(cs,!1)},Tn),p.registerCommand(of,()=>(pb(),!0),Tn),p.registerCommand(ju,t=>{const i=Ot();return!!Et(i)&&(r_(t,p),!0)},Tn),p.registerCommand(Nu,t=>{const i=Ot();return!!Et(i)&&(function(e,s){r_(e,s),s.update(()=>{const r=Ot();Et(r)&&r.removeText()})}(t,p),!0)},Tn),p.registerCommand(rl,t=>{const i=Ot();return!!Et(i)&&(function(e,s){e.preventDefault(),s.update(()=>{const r=Ot(),{clipboardData:n}=e;n!=null&&Et(r)&&Vv(n,r)},{tag:"paste"})}(t,p),!0)},Tn),p.registerCommand(Au,t=>{const i=Ot();return!!Et(i)&&(t.preventDefault(),!0)},Tn),p.registerCommand(il,t=>{const i=Ot();return!!Et(i)&&(t.preventDefault(),!0)},Tn))}const jm=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function o_(p){return p.getEditorState().read($1(p.isComposing()))}function i_({contentEditable:p,placeholder:t,ErrorBoundary:i}){const[e]=Yn(),s=function(r,n){const[o,l]=ve.useState(()=>r.getDecorators());return jm(()=>r.registerDecoratorListener(a=>{ro.flushSync(()=>{l(a)})}),[r]),ve.useEffect(()=>{l(r.getDecorators())},[r]),ve.useMemo(()=>{const a=[],u=Object.keys(o);for(let c=0;c<u.length;c++){const f=u[c],d=_e.jsx(n,{onError:m=>r._onError(m),children:_e.jsx(ve.Suspense,{fallback:null,children:o[f]})}),h=r.getElementByKey(f);h!==null&&a.push(ro.createPortal(d,h,f))}return a},[n,o,r])}(e,i);return function(r){jm(()=>Mr(lO(r),q1(r)),[r])}(e),_e.jsxs(_e.Fragment,{children:[p,_e.jsx(cO,{content:t}),s]})}function cO({content:p}){const[t]=Yn(),i=function(s){const[r,n]=ve.useState(()=>o_(s));return jm(()=>{function o(){const l=o_(s);n(l)}return o(),Mr(s.registerUpdateListener(()=>{o()}),s.registerEditableListener(()=>{o()}))},[s]),r}(t),e=td();return i?typeof p=="function"?p(e):p:null}var uO={967:(p,t,i)=>{const e=["docId","username","apiKey","domain","hooks","editorInstanceHooks","appServer","demo"];function s(d,h){var m=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(_){return Object.getOwnPropertyDescriptor(d,_).enumerable})),m.push.apply(m,g)}return m}function r(d){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?s(Object(m),!0).forEach(function(g){n(d,g,m[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(m)):s(Object(m)).forEach(function(g){Object.defineProperty(d,g,Object.getOwnPropertyDescriptor(m,g))})}return d}function n(d,h,m){return(h=function(g){var _=function(v){if(typeof v!="object"||!v)return v;var b=v[Symbol.toPrimitive];if(b!==void 0){var S=b.call(v,"string");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}(g);return typeof _=="symbol"?_:_+""}(h))in d?Object.defineProperty(d,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[h]=m,d}let o;o=i(668);let l=null;t.conf=function(d){d.autoStart=!1,l&&l.init(d)};const a=async function(d){if(l)return l.start(d)};t.start=a;const u=function(d){l&&(l.stop(),l=null)};t.stop=u;const c=function(d,h){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l)return l.diff({state1:d,state2:h,config:m})};t.diff=c;const f=function(){if(l)return l.sync(...arguments)};t.sync=f,t.initSync=function(d){return l?l.initSync(d):d},p.exports={start:a,sync:f,diff:c,stop:u,createConfig:d=>{let{docId:h,username:m,apiKey:g,domain:_,hooks:v,editorInstanceHooks:b,appServer:S={},demo:E=!1}=d;return r(r({},function(x,y){if(x==null)return{};var w,C,j=function(F,I){if(F==null)return{};var D={};for(var N in F)if({}.hasOwnProperty.call(F,N)){if(I.includes(N))continue;D[N]=F[N]}return D}(x,y);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(x);for(C=0;C<P.length;C++)w=P[C],y.includes(w)||{}.propertyIsEnumerable.call(x,w)&&(j[w]=x[w])}return j}(d,e)),{},{docId:h,username:m,apiKey:g,autoStart:!0,demo:E,domain:_,hooks:v,editorInstance:r({type:"lexical"},b),app:"json",json:{keyNames:{default:"codoxId"},filters:{version:!0},appServer:S,semantics:{paths:{"state.root.children.children.text":"MERGE","state.root.children.children.children.text":"MERGE"},string:"MERGE"}}})},get instance(){return l},createNewInstance:()=>{l=new o,window.codoxInstance=l}}},668:(p,t,i)=>{p.exports=function e(s,r,n){function o(u,c){if(!r[u]){if(!s[u]){var f=void 0;if(!c&&f)return require(u,!0);if(l)return l(u,!0);throw(c=new Error("Cannot find module '"+u+"'")).code="MODULE_NOT_FOUND",c}f=r[u]={exports:{}},s[u][0].call(f.exports,function(d){return o(s[u][1][d]||d)},f,f.exports,e,s,r,n)}return r[u].exports}for(var l=void 0,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,s,r){s.exports=function(n,o){(o==null||o>n.length)&&(o=n.length);for(var l=0,a=new Array(o);l<o;l++)a[l]=n[l];return a},s.exports.__esModule=!0,s.exports.default=s.exports},{}],2:[function(e,s,r){s.exports=function(n){if(Array.isArray(n))return n},s.exports.__esModule=!0,s.exports.default=s.exports},{}],3:[function(e,s,r){var n=e("./arrayLikeToArray.js");s.exports=function(o){if(Array.isArray(o))return n(o)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayLikeToArray.js":1}],4:[function(e,s,r){s.exports=function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n},s.exports.__esModule=!0,s.exports.default=s.exports},{}],5:[function(e,s,r){s.exports=function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")},s.exports.__esModule=!0,s.exports.default=s.exports},{}],6:[function(e,s,r){var n=e("./setPrototypeOf.js"),o=e("./isNativeReflectConstruct.js");function l(a,u,c){return o()?s.exports=l=Reflect.construct.bind():s.exports=l=function(f,d,h){var m=[null];return m.push.apply(m,d),d=new(Function.bind.apply(f,m)),h&&n(d,h.prototype),d},s.exports.__esModule=!0,s.exports.default=s.exports,l.apply(null,arguments)}s.exports=l,s.exports.__esModule=!0,s.exports.default=s.exports},{"./isNativeReflectConstruct.js":13,"./setPrototypeOf.js":19}],7:[function(e,s,r){function n(o,l){for(var a=0;a<l.length;a++){var u=l[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}s.exports=function(o,l,a){return l&&n(o.prototype,l),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o},s.exports.__esModule=!0,s.exports.default=s.exports},{}],8:[function(e,s,r){s.exports=function(n,o,l){return o in n?Object.defineProperty(n,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[o]=l,n},s.exports.__esModule=!0,s.exports.default=s.exports},{}],9:[function(e,s,r){function n(o){return s.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},s.exports.__esModule=!0,s.exports.default=s.exports,n(o)}s.exports=n,s.exports.__esModule=!0,s.exports.default=s.exports},{}],10:[function(e,s,r){var n=e("./setPrototypeOf.js");s.exports=function(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),l&&n(o,l)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./setPrototypeOf.js":19}],11:[function(e,s,r){s.exports=function(n){return n&&n.__esModule?n:{default:n}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],12:[function(e,s,r){s.exports=function(n){return Function.toString.call(n).indexOf("[native code]")!==-1},s.exports.__esModule=!0,s.exports.default=s.exports},{}],13:[function(e,s,r){s.exports=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],14:[function(e,s,r){s.exports=function(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)},s.exports.__esModule=!0,s.exports.default=s.exports},{}],15:[function(e,s,r){s.exports=function(n,o){var l=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(l!=null){var a,u,c=[],f=!0,d=!1;try{for(l=l.call(n);!(f=(a=l.next()).done)&&(c.push(a.value),!o||c.length!==o);f=!0);}catch(h){d=!0,u=h}finally{try{f||l.return==null||l.return()}finally{if(d)throw u}}return c}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],16:[function(e,s,r){s.exports=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
136
+ `})})},Bk="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZ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45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",xM="",j1=ar.createContext(null),N1=4;function pa({children:p,className:t,onClick:i,title:e}){const s=ve.useRef(null),r=ar.useContext(j1);if(r===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:n}=r;return ve.useEffect(()=>{s&&s.current&&n(s)},[s,n]),_e.jsx("button",{className:t,onClick:i,ref:s,title:e,type:"button",children:p})}function Uk({children:p,dropDownRef:t,onClose:i}){const[e,s]=ve.useState(),[r,n]=ve.useState(),o=ve.useCallback(u=>{s(c=>c?[...c,u]:[u])},[s]),l=u=>{if(!e)return;const c=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(c)&&u.preventDefault(),c==="Escape"||c==="Tab"?i():c==="ArrowUp"?n(f=>{if(!f)return e[0];const d=e.indexOf(f)-1;return e[d===-1?e.length-1:d]}):c==="ArrowDown"&&n(f=>f?e[e.indexOf(f)+1]:e[0])},a=ve.useMemo(()=>({registerItem:o}),[o]);return ve.useEffect(()=>{e&&!r&&n(e[0]),r&&r.current&&r.current.focus()},[e,r]),_e.jsx(j1.Provider,{value:a,children:_e.jsx("div",{className:"dropdown",ref:t,onKeyDown:l,children:p})})}function bm({disabled:p=!1,buttonLabel:t,buttonAriaLabel:i,buttonClassName:e,buttonIconClassName:s,children:r,stopCloseOnClickSelf:n}){const o=ve.useRef(null),l=ve.useRef(null),[a,u]=ve.useState(!1),c=()=>{u(!1),l&&l.current&&l.current.focus()};return ve.useEffect(()=>{const f=l.current,d=o.current;if(a&&f!==null&&d!==null){const{top:h,left:m}=f.getBoundingClientRect();d.style.top=`${h+f.offsetHeight+N1}px`,d.style.left=`${Math.min(m,window.innerWidth-d.offsetWidth-20)}px`}},[o,l,a]),ve.useEffect(()=>{const f=l.current;if(f!==null&&a){const d=h=>{const m=h.target;n&&o.current&&o.current.contains(m)||f.contains(m)||u(!1)};return document.addEventListener("click",d),()=>{document.removeEventListener("click",d)}}},[o,l,a,n]),ve.useEffect(()=>{const f=()=>{if(a){const d=l.current,h=o.current;if(d!==null&&h!==null){const{top:m}=d.getBoundingClientRect(),g=m+d.offsetHeight+N1;g!==h.getBoundingClientRect().top&&(h.style.top=`${g}px`)}}};return document.addEventListener("scroll",f),()=>{document.removeEventListener("scroll",f)}},[l,o,a]),_e.jsxs(_e.Fragment,{children:[_e.jsxs("button",{type:"button",disabled:p,"aria-label":i||t,className:e,onClick:()=>u(!a),ref:l,children:[s&&_e.jsx("span",{className:s}),t&&_e.jsx("span",{className:"text dropdown-button-text",children:t}),_e.jsx("i",{className:"chevron-down"})]}),a&&ro.createPortal(_e.jsx(Uk,{dropDownRef:o,onClose:c,children:r}),document.body)]})}function P1(){return _e.jsx("div",{className:"divider"})}const I1=8,M1=72,za={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",paragraph:"Normal"},Hk=({selectionFontSize:p,disabled:t,editor:i,blockType:e,styleConfig:s,isenterPressed:r,currentElementClick:n,currentElementSelect:o})=>{const[l,a]=ar.useState(p),[u,c]=ar.useState(e),[f,d]=ar.useState("");ar.useState([]),ar.useState("");const h=b=>{b&&b.title&&i.update(()=>{if(i.isEditable()){const S=Ot();S&&bv(S,b)}})},m=b=>{a(b.target.value)},g=()=>{const b=Number(l);if(!isNaN(b)){const S=Math.min(Math.max(b,I1),M1);a(String(S)),h({"font-size":`${S}px`})}},_=b=>{d(b),i.update(()=>{const x=Ot();Et(x)&&IC(x,()=>dc(b))});const{heading:S}=s;let E=null;if(S)switch(b){case"h1":E=S.find(x=>x.title==="Heading1").fontSize;break;case"h2":E=S.find(x=>x.title==="Heading2").fontSize;break;case"h3":E=S.find(x=>x.title==="Heading3").fontSize;break;case"h4":E=S.find(x=>x.title==="Heading4").fontSize;break;case"h5":E=S.find(x=>x.title==="Heading5").fontSize;break;case"paragraph":E=11;break;default:E=11}a(E),d(b),c(b)},v=()=>{a("11")};return ar.useEffect(()=>{v()},[r]),ar.useEffect(()=>{const b=()=>{i.update(()=>{const S=Ot();if(S!==null){const x=S.getNodes()[0];if(!qt(x)){const y=x.getType();y in za&&c(y)}}})};return i.registerUpdateListener(b),()=>{i.registerUpdateListener(b)}},[i]),ar.useEffect(()=>{switch(n.tagName){case"P":a("11");break;case"H1":c("h1"),a(s.heading.find(b=>b.title==="Heading1").fontSize);break;case"H2":c("h2"),a(s.heading.find(b=>b.title==="Heading2").fontSize);break;case"H3":c("h3"),a(s.heading.find(b=>b.title==="Heading3").fontSize);break;case"H4":c("h4"),a(s.heading.find(b=>b.title==="Heading4").fontSize);break;case"H5":c("h5"),a(s.heading.find(b=>b.title==="Heading5").fontSize);break;case"default":c("paragraph"),a("11");break}},[n]),ar.useEffect(()=>{switch(o||(a("11"),c("paragraph")),o&&o.trim(" ")){case"P":a("11"),c("paragraph");break;case"h1":c("h1"),a(s.heading.find(b=>b.title==="Heading1").fontSize);break;case"h2":c("h2"),a(s.heading.find(b=>b.title==="Heading2").fontSize);break;case"h3":c("h3"),a(s.heading.find(b=>b.title==="Heading3").fontSize);break;case"h4":c("h4"),a(s.heading.find(b=>b.title==="Heading4").fontSize);break;case"h5":c("h5"),a(s.heading.find(b=>b.title==="Heading5").fontSize);break;case"default":c("paragraph"),a("11");break}},[o]),_e.jsxs(_e.Fragment,{children:[_e.jsx("input",{title:"Font Size",type:"number",value:l,disabled:t,readOnly:!0,className:"toolbar-item font-size-input",min:I1,max:M1,onChange:m,onBlur:g}),_e.jsx(P1,{}),s&&s.heading?_e.jsxs("div",{title:za[u],className:"symbol-dropdown cust-head-dropDown",children:[_e.jsxs(bm,{disabled:t,buttonClassName:"toolbar-item block-controls",buttonAriaLabel:"Formatting options for text style",buttonIconClassName:"icon block-type "+u,buttonLabel:za[u],children:[_e.jsxs(pa,{className:`item ${u==="paragraph"?"active":""}`,onClick:()=>_("paragraph"),children:[_e.jsx("i",{className:"icon paragraph"}),_e.jsx("span",{className:"text",children:za.paragraph})]}),s.heading&&s.heading.find(b=>b.title==="Heading1")&&_e.jsxs(pa,{className:`item ${u==="h1"?"active":""}`,onClick:()=>_("h1"),children:[_e.jsx("i",{className:"icon h1"}),_e.jsx("span",{className:"text",children:za.h1})]}),s.heading&&s.heading.find(b=>b.title==="Heading2")&&_e.jsxs(pa,{className:`item ${u==="h2"?"active":""}`,onClick:()=>_("h2"),children:[_e.jsx("i",{className:"icon h2"}),_e.jsx("span",{className:"text",children:za.h2})]}),s.heading&&s.heading.find(b=>b.title==="Heading3")&&_e.jsxs(pa,{className:`item ${u==="h3"?"active":""}`,onClick:()=>_("h3"),children:[_e.jsx("i",{className:"icon h3"}),_e.jsx("span",{className:"text",children:za.h3})]}),s.heading&&s.heading.find(b=>b.title==="Heading4")&&_e.jsxs(pa,{className:`item ${u==="h4"?"active":""}`,onClick:()=>_("h4"),children:[_e.jsx("i",{className:"icon h4"}),_e.jsx("span",{className:"text",children:za.h4})]}),s.heading&&s.heading.find(b=>b.title==="Heading5")&&_e.jsxs(pa,{className:`item ${u==="h5"?"active":""}`,onClick:()=>_("h5"),children:[_e.jsx("i",{className:"icon h5"}),_e.jsx("span",{className:"text",children:za.h5})]})]}),_e.jsx(P1,{})]}):""]})},sp="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMS4xIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLi0tPjxwYXRoIGQ9Ik0wIDI1NkMwIDExNC42IDExNC42IDAgMjU2IDBzMjU2IDExNC42IDI1NiAyNTYtMTE0LjYgMjU2LTI1NiAyNTZTMCAzOTcuNCAwIDI1NnptMTc1LTQ3LjkgNDcuMSA0N0wxNzUgMzAzYy05LjMgOS40LTkuMyAyNC42IDAgMzMuMSA5LjQgMTAuMiAyNC42IDEwLjIgMzMuMSAwbDQ3LTQ2LjIgNDcuOSA0Ni4yYzkuNCAxMC4yIDI0LjYgMTAuMiAzMy4xIDAgMTAuMi04LjUgMTAuMi0yMy43IDAtMzMuMWwtNDYuMi00Ny45IDQ2LjItNDdjMTAuMi04LjUgMTAuMi0yMy43IDAtMzMuMS04LjUtOS4zLTIzLjctOS4zLTMzLjEgMGwtNDcuOSA0Ny4xLTQ3LTQ3LjFjLTguNS05LjMtMjMuNy05LjMtMzMuMSAwLTkuMyA5LjQtOS4zIDI0LjYgMCAzMy4xeiIvPjwvc3ZnPg==";function $k({onClose:p}){const[t,i]=ve.useState("4"),[e,s]=ve.useState("4"),[r,n]=ve.useState(!0);ve.useState();const[o]=Yn(),l=()=>{!t||!e||(o.update(()=>{const u=kv(t,e,!0);wv(u)}),p==null||p())},a=()=>{n(!1),p==null||p()};return _e.jsx(_e.Fragment,{children:r&&_e.jsx("div",{className:"modal-overlay",children:_e.jsxs("div",{className:"modal-content",children:[_e.jsx("h3",{children:"Select Table Dimensions"}),_e.jsx("button",{className:"modal-buttons-close",onClick:()=>a(),children:_e.jsx("img",{src:sp,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),_e.jsxs("div",{className:"select-table-container",children:[_e.jsx("label",{children:"Rows"}),_e.jsx("input",{type:"number",value:t,onChange:u=>i(Number(u.target.value))})]}),_e.jsxs("div",{className:"select-table-container",children:[_e.jsx("label",{children:"Column"}),_e.jsx("input",{type:"number",value:e,onChange:u=>s(Number(u.target.value))})]}),_e.jsx("div",{children:_e.jsx("div",{className:"modal-buttons",children:_e.jsx("button",{className:"toolbar-item",onClick:l,children:"Confirm"})})})]})})})}const qk=[{letter:"",uppercase:"A",lowercase:"α"},{letter:"Beta",uppercase:"Β",lowercase:"β"},{letter:"Gamma",uppercase:"Γ",lowercase:"γ"},{letter:"Delta",uppercase:"Δ",lowercase:"δ"},{letter:"Epsilon",uppercase:"Ε",lowercase:"ε"},{letter:"Zeta",uppercase:"Ζ",lowercase:"ζ"},{letter:" Eta ",uppercase:"Η",lowercase:"η"},{letter:"Theta",uppercase:"Θ",lowercase:"θ"},{letter:"Iota",uppercase:"Ι",lowercase:"ι"},{letter:"Kappa",uppercase:"Κ",lowercase:"κ"}];function Wk(){const[p]=Yn(),[t,i]=ve.useState(!1),e=s=>{p.update(()=>{var n;const r=Ot();if(Et(r)){const o=r.anchor.getNode();let l="inherit";if(o instanceof Wi){const u=o.getStyle();l=((n=u==null?void 0:u.match(/font-size:\s*(\S+);/))==null?void 0:n[1])||l}const a=sr(s);r.insertNodes([a])}}),i(!1)};return _e.jsx("div",{title:"Symbols",className:"symbol-dropdown cust-head-dropDown",children:_e.jsx(bm,{buttonClassName:"toolbar-item block-controls",buttonAriaLabel:"For appying Symbols",buttonLabel:"Symbols",children:_e.jsx("div",{className:"symbol-Flex-container",children:qk.map(({letter:s,uppercase:r,lowercase:n})=>_e.jsxs("div",{className:"symbol-items",children:[_e.jsx(pa,{className:"terr",onClick:()=>e(n),children:n}),_e.jsx(pa,{className:"terr",onClick:()=>e(r),children:r})]},s))})})})}const Vk=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function Jk(p){return{initialValueFn:()=>p.isEditable(),subscribe:t=>p.registerEditableListener(t)}}function td(){return function(p){const[t]=Yn(),i=ve.useMemo(()=>p(t),[t,p]),e=ve.useRef(i.initialValueFn()),[s,r]=ve.useState(e.current);return Vk(()=>{const{initialValueFn:n,subscribe:o}=i,l=n();return e.current!==l&&(e.current=l,r(l)),o(a=>{e.current=a,r(a)})},[i,p]),s}(Jk)}const R1="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNCAxMkgyME0xMiA0VjIwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==",D1="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNiAxMkwxOCAxMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4=";var Gk=typeof global=="object"&&global&&global.Object===Object&&global;const Kk=Gk;var Yk=typeof self=="object"&&self&&self.Object===Object&&self,Zk=Kk||Yk||Function("return this")();const L1=Zk;var Qk=L1.Symbol;const lp=Qk;var F1=Object.prototype,Xk=F1.hasOwnProperty,eT=F1.toString,nd=lp?lp.toStringTag:void 0;function tT(p){var t=Xk.call(p,nd),i=p[nd];try{p[nd]=void 0;var e=!0}catch{}var s=eT.call(p);return e&&(t?p[nd]=i:delete p[nd]),s}var nT=Object.prototype,rT=nT.toString;function oT(p){return rT.call(p)}var iT="[object Null]",aT="[object Undefined]",B1=lp?lp.toStringTag:void 0;function sT(p){return p==null?p===void 0?aT:iT:B1&&B1 in Object(p)?tT(p):oT(p)}function lT(p){return p!=null&&typeof p=="object"}var cT="[object Symbol]";function uT(p){return typeof p=="symbol"||lT(p)&&sT(p)==cT}var dT=/\s/;function fT(p){for(var t=p.length;t--&&dT.test(p.charAt(t)););return t}var pT=/^\s+/;function hT(p){return p&&p.slice(0,fT(p)+1).replace(pT,"")}function vm(p){var t=typeof p;return p!=null&&(t=="object"||t=="function")}var z1=0/0,gT=/^[-+]0x[0-9a-f]+$/i,mT=/^0b[01]+$/i,yT=/^0o[0-7]+$/i,bT=parseInt;function U1(p){if(typeof p=="number")return p;if(uT(p))return z1;if(vm(p)){var t=typeof p.valueOf=="function"?p.valueOf():p;p=vm(t)?t+"":t}if(typeof p!="string")return p===0?p:+p;p=hT(p);var i=mT.test(p);return i||yT.test(p)?bT(p.slice(2),i?2:8):gT.test(p)?z1:+p}var vT=function(){return L1.Date.now()};const _m=vT;var _T="Expected a function",xT=Math.max,wT=Math.min;function ST(p,t,i){var e,s,r,n,o,l,a=0,u=!1,c=!1,f=!0;if(typeof p!="function")throw new TypeError(_T);t=U1(t)||0,vm(i)&&(u=!!i.leading,c="maxWait"in i,r=c?xT(U1(i.maxWait)||0,t):r,f="trailing"in i?!!i.trailing:f);function d(x){var y=e,w=s;return e=s=void 0,a=x,n=p.apply(w,y),n}function h(x){return a=x,o=setTimeout(_,t),u?d(x):n}function m(x){var y=x-l,w=x-a,C=t-y;return c?wT(C,r-w):C}function g(x){var y=x-l,w=x-a;return l===void 0||y>=t||y<0||c&&w>=r}function _(){var x=_m();if(g(x))return v(x);o=setTimeout(_,m(x))}function v(x){return o=void 0,f&&e?d(x):(e=s=void 0,n)}function b(){o!==void 0&&clearTimeout(o),a=0,e=l=s=o=void 0}function S(){return o===void 0?n:v(_m())}function E(){var x=_m(),y=g(x);if(e=arguments,s=this,l=x,y){if(o===void 0)return h(l);if(c)return clearTimeout(o),o=setTimeout(_,t),d(l)}return o===void 0&&(o=setTimeout(_,t)),n}return E.cancel=b,E.flush=S,E}function ET(p,t,i){const e=ve.useRef(null);return e.current=p,ve.useMemo(()=>ST((...s)=>{e.current&&e.current(...s)},t,{maxWait:i}),[t,i])}const H1=20;function CT({anchorElem:p}){const[t]=Yn(),i=td(),[e,s]=ve.useState(!1),[r,n]=ve.useState(!1),[o,l]=ve.useState(!0),[a,u]=ve.useState({}),c=ve.useRef(new Set),f=ve.useRef(null),d=ET(_=>{const{isOutside:v,tableDOMNode:b}=kT(_);if(v){s(!1),n(!1);return}if(!b)return;f.current=b;let S=null,E=null,x=null;if(t.update(()=>{var w;const y=Jr(b);if(En(y)){const C=er(y,j=>jr(j));if(!jr(C))return;if(x=t.getElementByKey(C==null?void 0:C.getKey()),x){const j=C.getChildrenSize(),P=(w=C.getChildAtIndex(0))==null?void 0:w.getChildrenSize(),F=Ov(y),I=Gg(y);F===j-1?S=y:I===P-1&&(E=y)}}}),x){const{width:y,y:w,right:C,left:j,bottom:P,height:F}=x.getBoundingClientRect(),{y:I,left:D}=p.getBoundingClientRect();S?(n(!1),s(!0),u({height:H1,left:j-D,top:P-I+25,width:y})):E&&(n(!0),s(!1),u({height:F,left:C-D+10,top:w-I-2,width:H1}))}},50,250),h=ve.useMemo(()=>new ResizeObserver(()=>{s(!1),n(!1)}),[]);ve.useEffect(()=>{if(o)return document.addEventListener("mousemove",d),()=>{s(!1),n(!1),d.cancel(),document.removeEventListener("mousemove",d)}},[o,d]),ve.useEffect(()=>Mr(t.registerMutationListener(Ji,_=>{t.getEditorState().read(()=>{for(const[v,b]of _){const S=t.getElementByKey(v);switch(b){case"created":c.current.add(v),l(c.current.size>0),S&&h.observe(S);break;case"destroyed":c.current.delete(v),l(c.current.size>0),h.disconnect(),c.current.forEach(E=>{const x=t.getElementByKey(E);x&&h.observe(x)});break}}})})),[t,h]);const m=_=>{t.update(()=>{if(f.current){const v=Jr(f.current);v==null||v.selectEnd(),_?(VC(),s(!1)):(JC(),n(!1))}})},g=_=>{t.update(()=>{if(f.current){const v=Jr(f.current);v==null||v.selectEnd(),_?(GC(),s(!1)):(KC(),n(!1))}})};return i?_e.jsxs(_e.Fragment,{children:[e&&_e.jsxs("div",{children:[_e.jsx("button",{className:"PlaygroundEditorTheme__tableAddRows",style:{...a,flex:"50%",padding:"20px"},onClick:()=>m(!0),children:_e.jsx("img",{src:R1,height:14,width:14,style:{backgroundColor:"#90EE90",marginLeft:"-3px",borderRadius:"20px"}})}),_e.jsx("button",{className:"PlaygroundEditorTheme__tableAddRows",style:{...a,flex:"50%"},onClick:()=>g(!0),children:_e.jsx("img",{src:D1,height:14,width:14,style:{backgroundColor:"#FFCCCB",marginLeft:"-3px",borderRadius:"20px"}})})]}),r&&_e.jsxs("div",{className:"table-add-row-flex-container",children:[_e.jsx("button",{className:"PlaygroundEditorTheme__tableAddColumns table-add-row-flex-children",style:{...a,flex:"50%",padding:"20px"},onClick:()=>m(!1),children:_e.jsx("img",{src:R1,height:14,width:14,style:{backgroundColor:"#90EE90",marginLeft:"3px",borderRadius:"20px",border:"green"}})}),_e.jsx("button",{className:"PlaygroundEditorTheme__tableAddColumns table-add-row-flex-children",style:{...a,flex:"30%"},onClick:()=>g(!1),children:_e.jsx("img",{src:D1,height:14,width:14,style:{backgroundColor:"#FFCCCB",marginLeft:"-3px",borderRadius:"20px",border:"green"}})})]})]}):null}function kT(p){const t=p.target;if(t&&t instanceof HTMLElement){const i=t.closest("td.PlaygroundEditorTheme__tableCell, th.PlaygroundEditorTheme__tableCell");return{isOutside:!(i||t.closest("button.PlaygroundEditorTheme__tableAddRows")||t.closest("button.PlaygroundEditorTheme__tableAddColumns")||t.closest("div.TableCellResizer__resizer")),tableDOMNode:i}}else return{isOutside:!0,tableDOMNode:null}}function TT({anchorElem:p=document.body}){return td()?ro.createPortal(_e.jsx(CT,{anchorElem:p}),p):null}const wM="";function OT({onClose:p,children:t,title:i,closeOnClickOutside:e}){const s=ve.useRef(null);return ve.useEffect(()=>{s.current!==null&&s.current.focus()},[]),ve.useEffect(()=>{let r=null;const n=a=>{a.key==="Escape"&&p()},o=a=>{const u=a.target;s.current!==null&&!s.current.contains(u)&&e&&p()},l=s.current;return l!==null&&(r=l.parentElement,r!==null&&r.addEventListener("click",o)),window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n),r!==null&&(r==null||r.removeEventListener("click",o))}},[e,p]),_e.jsx("div",{className:"Modal__overlay",role:"dialog",children:_e.jsxs("div",{className:"Modal__modal",tabIndex:-1,ref:s,children:[_e.jsx("h2",{className:"Modal__title",children:i}),_e.jsx("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:p,children:"X"}),_e.jsx("div",{className:"Modal__content",children:t})]})})}function AT({onClose:p,children:t,title:i,closeOnClickOutside:e=!1}){return ro.createPortal(_e.jsx(OT,{onClose:p,title:i,closeOnClickOutside:e,children:t}),document.body)}function cp(){const[p,t]=ve.useState(null),i=ve.useCallback(()=>{t(null)},[]),e=ve.useMemo(()=>{if(p===null)return null;const{title:r,content:n,closeOnClickOutside:o}=p;return _e.jsx(AT,{onClose:i,title:r,closeOnClickOutside:o,children:n})},[p,i]),s=ve.useCallback((r,n,o=!1)=>{t({closeOnClickOutside:o,content:n(i),title:r})},[i]);return[e,s]}const jT="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxpdmVsbG9fMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3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3N2Zz4=",NT=({htmlPasteModalOpen:p,onlUser:t,collabApiKey:i,sethtmlPasteModalOpen:e,onPaste:s,source:r})=>{const n=ve.useRef(null),[o,l]=ve.useState(""),[a,u]=ve.useState(),[c]=Yn();ve.useRef(null);const f=()=>{u({root:{type:"root",version:1,children:[{children:[],direction:"ltr",format:"",indent:0,type:"text",version:1}],direction:"ltr",format:"",indent:0}}),l("")};ve.useEffect(()=>{f()},[]);const d=()=>{e(!1),l(" "),f()},h=j=>{const P=/display:\s*([^;]+);/,F=j.match(P);if(F)return F[1]};function m(){const[j]=Yn(),P=(I,D)=>{j.update(()=>{const N=lr(),k=sr(`${I}`);k.setStyle(D.style),k.setFormat(D.format),N.append(k),j.getRootElement()&&I&&I.length>0&&j.getEditorState().read(()=>yr()).append(N)})},F=()=>{E(o).root.children.map((D,N)=>{D&&D.text&&D.text.trim("")&&D.text.trim("").length>1&&D.style&&D.style.length>10&&h(D.style)==="block"&&(P(D.text.trim(""),D),o.includes("table")&&console.log("yes"))}),setTimeout(()=>{r==="local"&&location.reload(),r==="remote"&&s()},1e3),d()};return _e.jsx("button",{className:`green-button-paste ${o.length>100?"":"disable-btn"}`,onClick:F,children:"Insert Node"})}function g(j,P){const F=/font-weight:\s*([a-zA-Z0-9\-]+);/,I=/text-decoration:\s*([^;]+?)(?=\s*;|\s*$)/,D=/font-style:\s*([a-zA-Z0-9\-]+);/,N=/font-size:\s*([\d.]+(?:px|pt|em|rem|%)?)/,k=/color:\s*([^;]+)/,A=j.match(F),R=j.match(I),L=j.match(D),J=j.match(N),O=j.match(k),z=A?A[1]:null,W=R?R[1]:null,G=L?L[1]:null,B=J?J[1]:null,$=O?O[1]:null;let H={"font-weight":z&&z!==null?z:"none","text-decoration":W&&W!==null?W:"none","font-style":G&&G!==null?G:"none","font-size":"none",display:["span","table","tbody","tr","td"].includes(P)?"block":"none",color:$&&$!=="transparent"?$:"black"};function K(Z){return Object.entries(Z).map(([X,ee])=>`${X}: ${ee};`).join(" ")}return{cssString:K(H),fontSize:B&&B!==null?B:"none",fontWeight:z&&z!==null?z:"none",fontStyle:G&&G!==null?G:"none",textDecoration:W&&W!==null?W:"none"}}const _=(j,P)=>{const F=new RegExp(`${P}:\\s*([^;]+)`),I=j.match(F);return I?I[1].trim():null};function v(j){return console.log("Processing Table:",j),Array.from(j.querySelectorAll("tr")).map(I=>Array.from(I.querySelectorAll("td")).map(N=>{let R=Array.from(N.querySelectorAll("span")).map(O=>{const z=O.getAttribute("style")||"";return{text:O.innerText.trim(),style:z}}).map(O=>O.style).filter(O=>O).map(O=>O.split(";").map(z=>z.trim()).filter(z=>!z.startsWith("font-family")).filter(z=>!z.startsWith("font-size")).filter(z=>!z.startsWith("border")).filter(z=>!z.startsWith("width")).join("; ")).join("; ");const L=_(R,"font-weight"),J=_(R,"font-style");return R=`${R};font-weight:${L}`,R=`${R};font-style:${J}`,R=`${R};color:black`,{text:N.innerText.trim(),style:R}}))}const b=j=>{const F=new DOMParser().parseFromString(j,"text/html"),I=F.querySelectorAll("img"),D=Array.from(I).map(O=>O.src),N=O=>O.getAttribute("style")||"",k=F.querySelectorAll("ol"),A=F.querySelectorAll("ul"),R=O=>{const z=Array.from(O.querySelectorAll("li")).map(W=>({text:W.innerText.trim(),style:N(W)}));return{listStyle:N(O),items:z}},L=Array.from(k).map(O=>R(O)),J=Array.from(A).map(O=>R(O));console.log("orderedLists","unorderedLists",L,J),console.log("getImageSrcFromHTML",D)};function S(j,P){P.update(()=>{const F=Kf();j.forEach(D=>{const N=pl();D.forEach(k=>{const A=ua(),R=sr(k.text);k.style&&R.setStyle(k.style),A.append(R),N.append(A)}),F.append(N)}),P.getEditorState().read(()=>yr()).append(F)})}function E(j){const F=new DOMParser().parseFromString(j,"text/html");F.querySelectorAll("table").forEach(A=>{const R=v(A);S(R,c),A.remove()});const D=F.querySelectorAll("*"),N=Array.from(D).filter(A=>!A.closest("table")).map(A=>({elemText:A.innerText,tagName:A.tagName.toLowerCase(),style:A.getAttribute("style")||""}));let k=a;return N.map(A=>{let R=g(A.style,A.tagName);const{cssString:L,fontSize:J,fontWeight:O,textDecoration:z,fontStyle:W,border:G}=R||{};if(A.style&&A.style.length>0&&A.elemText.trim(" ").length&&J!=="none"&&O!==null&&z!==null&&W!==null){let B=O==="bold"&&W==="italic"&&z==="underline line-through"?15:z==="underline line-through"?12:W==="italic"&&z=="line-through"?6:W==="italic"&&z==="underline"?10:O==="bold"&&z==="line-through"?5:O==="bold"&&z==="underline"?9:O==="bold"&&W==="italic"?3:O==="bold"?1:W==="italic"?2:A.style.includes("text-decoration: underline")?8:A.style.includes("text-decoration: line-through")?4:0;k.root.children.push({detail:0,format:B,mode:"normal",style:`${L}`,text:`${A.elemText}`,type:"text",version:1})}}),k}const x=j=>{if(j){j.preventDefault();const F=(j.clipboardData||window.clipboardData).getData("text/html");F&&(console.log(F),l(F)),b(F)}},y=()=>{l("")};ve.useEffect(()=>()=>{l(" ")},[]);const w=()=>{e(!0)},C=()=>{e(!1),l("")};return _e.jsxs(_e.Fragment,{children:[_e.jsx("button",{title:"MS-Word content paste",className:"toolbar-item space insert-ms-word-btn",onClick:w,children:_e.jsx("img",{src:jT,height:16,width:16})}),t&&t.length>0?p&&_e.jsx("div",{className:"modal-overlay",children:_e.jsxs("div",{className:"modal-content custom-paste-modal-content",children:[_e.jsx("h3",{children:"Paste MS Word Content below"}),_e.jsx("button",{className:"modal-buttons-close",onClick:C,children:_e.jsx("img",{src:sp,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),_e.jsxs("div",{className:"select-table-container",children:[o.length>100,_e.jsx("textarea",{onPaste:x,className:o&&o.length>100?"small-paste-area":"enlarge-paste-area"}),_e.jsx("div",{contentEditable:!0,className:o&&o.length>100?"enlarge-paste-area":"small-paste-area",ref:n,dangerouslySetInnerHTML:{__html:o}})]}),_e.jsx("div",{children:_e.jsxs("div",{className:"modal-buttons",children:[_e.jsx("button",{className:`red-button-paste ${o.length>100?"":"disable-btn"}`,onClick:y,children:"Reset"}),_e.jsx(m,{})]})})]})}):p&&_e.jsx("div",{className:"modal-overlay",children:i?_e.jsxs("div",{className:"modal-content custom-paste-modal-content",children:[_e.jsx("h3",{children:"Paste MS Word Content below"}),_e.jsx("button",{className:"modal-buttons-close",onClick:C,children:_e.jsx("img",{src:sp,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),_e.jsxs("div",{className:"select-table-container",children:[o.length>100,_e.jsx("div",{className:"text-area-loading",children:"Loading..."})]})]}):_e.jsxs("div",{className:"modal-content custom-paste-modal-content",children:[_e.jsx("h3",{children:"Paste MS Word Content below"}),_e.jsx("button",{className:"modal-buttons-close",onClick:C,children:_e.jsx("img",{src:sp,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),_e.jsxs("div",{className:"select-table-container",children:[o.length>100,_e.jsx("textarea",{onPaste:x,className:o&&o.length>100?"small-paste-area":"enlarge-paste-area"}),_e.jsx("div",{contentEditable:!0,className:o&&o.length>100?"enlarge-paste-area":"small-paste-area",ref:n,dangerouslySetInnerHTML:{__html:o}})]}),_e.jsx("div",{children:_e.jsxs("div",{className:"modal-buttons",children:[_e.jsx("button",{className:`red-button-paste ${o.length>100?"":"disable-btn"}`,onClick:y,children:"Reset"}),_e.jsx(m,{})]})})]})})]})},PT="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iY3VycmVudENvbG9yIiBjbGFzcz0iYmkgYmktdGFibGUiPjxwYXRoIGQ9Ik0wIDJhMiAyIDAgMCAxIDItMmgxMmEyIDIgMCAwIDEgMiAydjEyYTIgMiAwIDAgMS0yIDJIMmEyIDIgMCAwIDEtMi0yVjJ6bTE1IDJoLTR2M2g0VjR6bTAgNGgtNHYzaDRWOHptMCA0aC00djNoM2ExIDEgMCAwIDAgMS0xdi0yem0tNSAzdi0zSDZ2M2g0em0tNSAwdi0zSDF2MmExIDEgMCAwIDAgMSAxaDN6b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TMwLjMwNmgtMTAuNzY3bC0xMDQuMzU5LTk2LjUyNmwtNDUuODAxLDQzLjk1MUwxMjAsMTM4Ljc0OCAgbC04NS4xMDksMTA5LjA0SDI1VjIweiIvPgo8L3N2Zz4=",rd=1;function gc(){return _e.jsx("div",{className:"divider"})}function MT({onlUser:p,styleConfig:t,collabApiKey:i,onPaste:e,source:s}){const[r]=Yn(),n=ve.useRef(null),[o,l]=ve.useState(!1),[a,u]=ve.useState(!1),[c,f]=ve.useState(!1),[d,h]=ve.useState(!1),[m,g]=ve.useState(!1),[_,v]=ve.useState(!1),[b,S]=ve.useState(!1),[E,x]=ve.useState(!1),[y,w]=ve.useState("11px"),[C,j]=ve.useState(()=>r.isEditable()),[P,F]=ve.useState(""),[I,D]=ve.useState(""),[N,k]=ve.useState(""),[A,R]=cp(),[L,J]=ve.useState(!1),O=ve.useCallback(()=>{const G=Ot();Et(G)&&(f(G.hasFormat("bold")),h(G.hasFormat("italic")),g(G.hasFormat("underline")),v(G.hasFormat("strikethrough")),S(G.hasFormat("subscript")),x(G.hasFormat("superscript")))},[]),z=G=>{r.update(()=>{const B=Ot();Et(B)&&B.getNodes().forEach(q=>{if(qt(q)){let K=q.getStyle()||"";for(const[Y,Z]of Object.entries(G)){const X=new RegExp(`${Y}:\\s*[^;]+;?`,"g");K=K.replace(X,""),K+=`${Y}: ${Z}; `}q.setStyle(K.trim())}})})},W=ve.useCallback(()=>{var B,$;const G=Ot();if(Et(G)){const q=(($=(B=Ot())==null?void 0:B.getNodes()[0])==null?void 0:$.__style)??"",H=["font-weight","font-style","text-decoration"],K={};if(q.split(";").map(Z=>Z.trim()).forEach(Z=>{const[X,ee]=Z.split(":").map(ne=>ne.trim());H.includes(X)&&(K[X]=ee)}),K["font-weight"]==="bold"){const Z=Ot();Et(Z)&&c===Z.hasFormat("bold")&&z({"font-weight":"400"})}else{const Z=Ot();Et(Z)&&c!==Z.hasFormat("bold")&&z({"font-weight":"bold"})}if(K["font-style"]==="italic"){const Z=Ot();Et(Z)&&d===Z.hasFormat("italic")&&z({"font-style":"normal"})}else{const Z=Ot();Et(Z)&&d!==Z.hasFormat("italic")&&z({"font-style":"italic"})}if(K["text-decoration"]==="line-through"){const Z=Ot();Et(Z)&&_===Z.hasFormat("strikethrough")&&z({"text-decoration":_?"line-through":"none"})}else{const Z=Ot();Et(Z)&&_!==Z.hasFormat("strikethrough")&&z({"text-decoration":_!==Z.hasFormat("strikethrough")&&m!==Z.hasFormat("underline")?"underline line-through":_?"none":"line-through"})}if(K["text-decoration"]==="underline"){const Z=Ot();Et(Z)&&m===Z.hasFormat("underline")&&z({"text-decoration":m?"underline":"none"})}else{const Z=Ot();Et(Z)&&m!==Z.hasFormat("underline")&&z({"text-decoration":_!==Z.hasFormat("strikethrough")&&m!==Z.hasFormat("underline")?"underline line-through":m?"none":"underline"})}}},[]);return ve.useEffect(()=>Mr(r.registerUpdateListener(({editorState:G})=>{G.read(()=>{O()})}),r.registerCommand(zo,(G,B)=>{var H;F("");const $=(H=Ot())==null?void 0:H.getNodes()[0].__parent;return r.getEditorState()._nodeMap.forEach((K,Y)=>{Y===$&&k(K.__tag)}),O(),W(),!1},rd),r.registerCommand(ls,G=>(D(G.target),W(),!1),rd),r.registerCommand(Wl,G=>(l(G),!1),rd),r.registerCommand(ql,G=>(u(G),!1),rd),r.registerCommand(aa,G=>(F("Enter"),!0),rd)),[r,O,W]),_e.jsxs("div",{className:"toolbar",ref:n,children:[_e.jsx("button",{title:"Undo",disabled:!o,onClick:()=>{r.dispatchCommand(Su,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:_e.jsx("i",{className:"format undo"})}),_e.jsx("button",{title:"Redo",disabled:!a,onClick:()=>{r.dispatchCommand(Eu,void 0)},className:"toolbar-item","aria-label":"Redo",children:_e.jsx("i",{className:"format redo"})}),_e.jsx(gc,{}),_e.jsx(Hk,{currentElementClick:I,selectionFontSize:y.slice(0,-2),editor:r,disabled:!C,blockType:"paragraph",styleConfig:t,isenterPressed:P,currentElementSelect:N}),_e.jsx(gc,{}),_e.jsx("button",{title:"Bold",onClick:()=>{r.dispatchCommand(Vr,"bold")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Bold",children:_e.jsx("i",{className:"format bold"})}),_e.jsx("button",{title:"Italic",onClick:()=>{r.dispatchCommand(Vr,"italic")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Italics",children:_e.jsx("i",{className:"format italic"})}),_e.jsx("button",{title:"Underline",onClick:()=>{r.dispatchCommand(Vr,"underline")},className:"toolbar-item spaced "+(m?"active":""),"aria-label":"Format Underline",children:_e.jsx("i",{className:"format underline"})}),_e.jsx("button",{title:"Strikethrough",onClick:()=>{r.dispatchCommand(Vr,"strikethrough")},className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Format Strikethrough",children:_e.jsx("i",{className:"format strikethrough"})}),_e.jsx("button",{title:"SuperScript",onClick:()=>{r.dispatchCommand(Vr,"superscript")},className:"toolbar-item spaced "+(E?"active":""),"aria-label":"Format SuperScript",children:_e.jsx("img",{src:zk,height:16,width:16,style:{marginTop:"1px"}})}),_e.jsx("button",{title:"SubScript",onClick:()=>{r.dispatchCommand(Vr,"subscript")},className:"toolbar-item spaced "+(b?"active":""),"aria-label":"Format SubScript",children:_e.jsx("img",{src:Bk,height:16,width:16,style:{marginTop:"1px"}})}),_e.jsx(gc,{}),_e.jsx("button",{title:"Left Align",onClick:()=>{r.dispatchCommand($l,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:_e.jsx("i",{className:"format left-align"})}),_e.jsx("button",{title:"Center Align",onClick:()=>{r.dispatchCommand($l,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:_e.jsx("i",{className:"format center-align"})}),_e.jsx("button",{title:"Right Align",onClick:()=>{r.dispatchCommand($l,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:_e.jsx("i",{className:"format right-align"})}),_e.jsx("button",{title:"Justify Align",onClick:()=>{r.dispatchCommand($l,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:_e.jsx("i",{className:"format justify-align"})}),_e.jsx(gc,{}),_e.jsx(Wk,{}),_e.jsx(NT,{source:s,onPaste:e,htmlPasteModalOpen:L,sethtmlPasteModalOpen:J,onlUser:p,collabApiKey:i}),_e.jsx(gc,{}),_e.jsx(TT,{}),_e.jsxs(bm,{disabled:!C,buttonClassName:"toolbar-item spaced",buttonLabel:"Insert",buttonAriaLabel:"Insert specialized editor node",buttonIconClassName:"icon plus",children:[_e.jsx(pa,{onClick:()=>{R("Insert Image",G=>_e.jsx(C2,{activeEditor:r,onClose:G}))},className:"item",children:_e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[_e.jsx("img",{className:"add-toolbar-image-icon",src:IT,alt:"Add Image",style:{height:"16px",width:"16px"}}),_e.jsx("span",{className:"text",children:"Image"})]})}),_e.jsx(pa,{onClick:()=>{R("Insert Table",G=>_e.jsx($k,{onClose:G}))},className:"item",children:_e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[_e.jsx("img",{className:"add-toolbar-table-icon",src:PT,alt:"Add Table",style:{height:"16px",width:"16px"}}),_e.jsx("span",{className:"text",children:"Table"})]})})]}),_e.jsx(gc,{}),_e.jsx("div",{className:"flex-container-onluser",children:p}),A]})}function xm(){return yr().getTextContent()}function wm(p,t=!0){if(p)return!1;let i=xm();return t&&(i=i.trim()),i===""}function RT(p){if(!wm(p,!1))return!1;const t=yr().getChildren(),i=t.length;if(i>1)return!1;for(let e=0;e<i;e++){const s=t[e];if(ur(s))return!1;if(Nt(s)){if(!ca(s)||s.__indent!==0)return!1;const r=s.getChildren(),n=r.length;for(let o=0;o<n;o++){const l=r[e];if(!qt(l))return!1}}}return!0}function $1(p){return()=>RT(p)}function DT(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}DT(function(p){const t=new URLSearchParams;t.append("code",p);for(let i=1;i<arguments.length;i++)t.append("v",arguments[i]);throw Error(`Minified Lexical error #${p}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function q1(p){const t=window.location.origin,i=e=>{if(e.origin!==t)return;const s=p.getRootElement();if(document.activeElement!==s)return;const r=e.data;if(typeof r=="string"){let n;try{n=JSON.parse(r)}catch{return}if(n&&n.protocol==="nuanria_messaging"&&n.type==="request"){const o=n.payload;if(o&&o.functionId==="makeChanges"){const l=o.args;if(l){const[a,u,c,f,d,h]=l;p.update(()=>{const m=Ot();if(Et(m)){const g=m.anchor;let _=g.getNode(),v=0,b=0;if(qt(_)&&a>=0&&u>=0&&(v=a,b=a+u,m.setTextNodeRange(_,v,_,b)),v===b&&c===""||(m.insertRawText(c),_=g.getNode()),qt(_)){v=f,b=f+d;const S=_.getTextContentSize();v=v>S?S:v,b=b>S?S:b,m.setTextNodeRange(_,v,_,b)}e.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",i,!0),()=>{window.removeEventListener("message",i,!0)}}const Sm=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function W1(p){return p.getEditorState().read($1(p.isComposing()))}function up({contentEditable:p,placeholder:t,ErrorBoundary:i}){const[e]=Yn(),s=function(r,n){const[o,l]=ve.useState(()=>r.getDecorators());return Sm(()=>r.registerDecoratorListener(a=>{ro.flushSync(()=>{l(a)})}),[r]),ve.useEffect(()=>{l(r.getDecorators())},[r]),ve.useMemo(()=>{const a=[],u=Object.keys(o);for(let c=0;c<u.length;c++){const f=u[c],d=_e.jsx(n,{onError:m=>r._onError(m),children:_e.jsx(ve.Suspense,{fallback:null,children:o[f]})}),h=r.getElementByKey(f);h!==null&&a.push(ro.createPortal(d,h,f))}return a},[n,o,r])}(e,i);return function(r){Sm(()=>Mr(b2(r),q1(r)),[r])}(e),_e.jsxs(_e.Fragment,{children:[p,_e.jsx(LT,{content:t}),s]})}function LT({content:p}){const[t]=Yn(),i=function(s){const[r,n]=ve.useState(()=>W1(s));return Sm(()=>{function o(){const l=W1(s);n(l)}return o(),Mr(s.registerUpdateListener(()=>{o()}),s.registerEditableListener(()=>{o()}))},[s]),r}(t),e=td();return i?typeof p=="function"?p(e):p:null}function Em(p,t){return Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},Em(p,t)}var V1={error:null},FT=function(p){var t,i;function e(){for(var r,n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];return(r=p.call.apply(p,[this].concat(o))||this).state=V1,r.resetErrorBoundary=function(){for(var a,u=arguments.length,c=new Array(u),f=0;f<u;f++)c[f]=arguments[f];r.props.onReset==null||(a=r.props).onReset.apply(a,c),r.reset()},r}i=p,(t=e).prototype=Object.create(i.prototype),t.prototype.constructor=t,Em(t,i),e.getDerivedStateFromError=function(r){return{error:r}};var s=e.prototype;return s.reset=function(){this.setState(V1)},s.componentDidCatch=function(r,n){var o,l;(o=(l=this.props).onError)==null||o.call(l,r,n)},s.componentDidUpdate=function(r,n){var o,l,a,u,c=this.state.error,f=this.props.resetKeys;c!==null&&n.error!==null&&((a=r.resetKeys)===void 0&&(a=[]),(u=f)===void 0&&(u=[]),a.length!==u.length||a.some(function(d,h){return!Object.is(d,u[h])}))&&((o=(l=this.props).onResetKeysChange)==null||o.call(l,r.resetKeys,f),this.reset())},s.render=function(){var r=this.state.error,n=this.props,o=n.fallbackRender,l=n.FallbackComponent,a=n.fallback;if(r!==null){var u={error:r,resetErrorBoundary:this.resetErrorBoundary};if(ar.isValidElement(a))return a;if(typeof o=="function")return o(u);if(l)return ar.createElement(l,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(ar.Component);function mc({children:p,onError:t}){return _e.jsx(FT,{fallback:_e.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:p})}function dp({defaultSelection:p}){const[t]=Yn();return ve.useEffect(()=>{t.focus(()=>{const i=document.activeElement,e=t.getRootElement();e===null||i!==null&&e.contains(i)||e.focus({preventScroll:!0})},{defaultSelection:p})},[p,t]),null}const BT=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function fp({ariaActiveDescendant:p,ariaAutoComplete:t,ariaControls:i,ariaDescribedBy:e,ariaExpanded:s,ariaLabel:r,ariaLabelledBy:n,ariaMultiline:o,ariaOwns:l,ariaRequired:a,autoCapitalize:u,className:c,id:f,role:d="textbox",spellCheck:h=!0,style:m,tabIndex:g,"data-testid":_,...v}){const[b]=Yn(),[S,E]=ve.useState(!1),x=ve.useCallback(y=>{y&&y.ownerDocument&&y.ownerDocument.defaultView&&b.setRootElement(y)},[b]);return BT(()=>(E(b.isEditable()),b.registerEditableListener(y=>{E(y)})),[b]),_e.jsx("div",{...v,"aria-activedescendant":S?p:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?i:void 0,"aria-describedby":e,"aria-expanded":S&&d==="combobox"?!!s:void 0,"aria-label":r,"aria-labelledby":n,"aria-multiline":o,"aria-owns":S?l:void 0,"aria-readonly":!S||void 0,"aria-required":a,autoCapitalize:u,className:c,contentEditable:S,"data-testid":_,id:f,ref:x,role:d,spellCheck:h,style:m,tabIndex:g})}const zT=33,UT=50;function HT({editor:p}){const t=ve.useRef(null),i=ve.useRef(null),e=ve.useRef(null),s=ve.useRef(null),[r,n]=ve.useState(null),[o,l]=ve.useState(null),[a,u]=ve.useState(!1),[c,f]=ve.useState(null);ve.useEffect(()=>p.registerCommand(zo,E=>{const x=Ot(),y=Rr(x);return a!==y&&u(y),!1},pi));const d=ve.useCallback(()=>{l(null),t.current=null,f(null),s.current=null,e.current=null},[]);ve.useEffect(()=>{const E=x=>{setTimeout(()=>{const y=x.target;if(c){n({x:x.clientX,y:x.clientY});return}if(!(i.current&&i.current.contains(y))&&t.current!==y){t.current=y;const w=Yg(y);w&&o!==w?p.update(()=>{const C=Jr(w.elem);if(!C)throw new Error("TableCellResizer: Table cell node not found.");const j=qf(C),P=p.getElementByKey(j.getKey());if(!P)throw new Error("TableCellResizer: Table element not found.");t.current=y,e.current=P.getBoundingClientRect(),l(w)}):w==null&&d()}},0)};return document.addEventListener("mousemove",E),()=>{document.removeEventListener("mousemove",E)}},[o,c,p,d]);const h=E=>E==="bottom",m=ve.useCallback(E=>{if(!o)throw new Error("TableCellResizer: Expected active cell.");p.update(()=>{const x=Jr(o.elem);if(!En(x))throw new Error("TableCellResizer: Table cell node not found.");const y=qf(x),w=Ov(x),C=y.getChildren();if(w>=C.length||w<0)throw new Error("Expected table cell to be inside of table row.");const j=C[w];if(!Xr(j))throw new Error("Expected table row");j.setHeight(E)})},[o,p]),g=ve.useCallback(E=>{if(!o)throw new Error("TableCellResizer: Expected active cell.");p.update(()=>{const x=Jr(o.elem);if(!En(x))throw new Error("TableCellResizer: Table cell node not found.");const y=qf(x),w=Gg(x),C=y.getChildren();for(let j=0;j<C.length;j++){const P=C[j];if(!Xr(P))throw new Error("Expected table row");const F=P.getChildren(),N=F.map(A=>A.getColSpan()).reduce((A,R)=>{const L=A[A.length-1]??0;return A.push(L+R),A},[]).findIndex(A=>A>w);if(N>=F.length||N<0)throw new Error("Expected table cell to be inside of table row.");const k=F[N];if(!En(k))throw new Error("Expected table cell");k.setWidth(E)}})},[o,p]),_=ve.useCallback(E=>{const x=y=>{if(y.preventDefault(),y.stopPropagation(),!o)throw new Error("TableCellResizer: Expected active cell.");if(s.current){const{x:w,y:C}=s.current;if(o===null)return;if(h(E)){const j=o.elem.getBoundingClientRect().height,P=Math.abs(y.clientY-C),F=E==="bottom"&&C>y.clientY;m(Math.max(F?j-P:P+j,zT))}else{const j=getComputedStyle(o.elem);let P=o.elem.clientWidth;P-=parseFloat(j.paddingLeft)+parseFloat(j.paddingRight);const F=Math.abs(y.clientX-w),I=E==="right"&&w>y.clientX;g(Math.max(I?P-F:F+P,UT))}d(),document.removeEventListener("mouseup",x)}};return x},[o,d,g,m]),v=ve.useCallback(E=>x=>{if(x.preventDefault(),x.stopPropagation(),!o)throw new Error("TableCellResizer: Expected active cell.");s.current={x:x.clientX,y:x.clientY},n(s.current),f(E),document.addEventListener("mouseup",_(E))},[o,_]),S=ve.useCallback(()=>{if(o){const{height:E,width:x,top:y,left:w}=o.elem.getBoundingClientRect(),C={bottom:{backgroundColor:"none",cursor:"row-resize",height:"10px",left:`${window.pageXOffset+w}px`,top:`${window.pageYOffset+y+E}px`,width:`${x}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${E}px`,left:`${window.pageXOffset+w+x}px`,top:`${window.pageYOffset+y}px`,width:"10px"}},j=e.current;return c&&r&&j&&(h(c)?(C[c].left=`${window.pageXOffset+j.left}px`,C[c].top=`${window.pageYOffset+r.y}px`,C[c].height="3px",C[c].width=`${j.width}px`):(C[c].top=`${window.pageYOffset+j.top}px`,C[c].left=`${window.pageXOffset+r.x}px`,C[c].width="3px",C[c].height=`${j.height}px`),C[c].backgroundColor="#adf"),C}return{bottom:null,left:null,right:null,top:null}},[o,c,r])();return _e.jsx("div",{ref:i,children:o!=null&&!a&&_e.jsxs(_e.Fragment,{children:[_e.jsx("div",{className:"TableCellResizer__resizer TableCellResizer__ui",style:S.right||void 0,onMouseDown:v("right")}),_e.jsx("div",{className:"TableCellResizer__resizer TableCellResizer__ui",style:S.bottom||void 0,onMouseDown:v("bottom")})]})})}function $T(){const[p]=Yn(),t=td();return ve.useMemo(()=>t?ro.createPortal(_e.jsx(HT,{editor:p}),document.body):null,[p,t])}const qT=new Set(["http:","https:","mailto:","sms:","tel:"]);let J1=class yE extends fi{static getType(){return"link"}static clone(t){return new yE(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t,i={},e){super(e);const{target:s=null,rel:r=null,title:n=null}=i;this.__url=t,this.__target=s,this.__rel=r,this.__title=n}createDOM(t){const i=document.createElement("a");return i.href=this.sanitizeUrl(this.__url),this.__target!==null&&(i.target=this.__target),this.__rel!==null&&(i.rel=this.__rel),this.__title!==null&&(i.title=this.__title),hi(i,t.theme.link),i}updateDOM(t,i,e){if(i instanceof HTMLAnchorElement){const s=this.__url,r=this.__target,n=this.__rel,o=this.__title;s!==t.__url&&(i.href=s),r!==t.__target&&(r?i.target=r:i.removeAttribute("target")),n!==t.__rel&&(n?i.rel=n:i.removeAttribute("rel")),o!==t.__title&&(o?i.title=o:i.removeAttribute("title"))}return!1}static importDOM(){return{a:t=>({conversion:WT,priority:1})}}static importJSON(t){const i=Cm(t.url,{rel:t.rel,target:t.target,title:t.title});return i.setFormat(t.format),i.setIndent(t.indent),i.setDirection(t.direction),i}sanitizeUrl(t){try{const i=new URL(t);if(!qT.has(i.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(t){this.getWritable().__url=t}getTarget(){return this.getLatest().__target}setTarget(t){this.getWritable().__target=t}getRel(){return this.getLatest().__rel}setRel(t){this.getWritable().__rel=t}getTitle(){return this.getLatest().__title}setTitle(t){this.getWritable().__title=t}insertNewAfter(t,i=!0){const e=Cm(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(e,i),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,i,e){if(!Et(i))return!1;const s=i.anchor.getNode(),r=i.focus.getNode();return this.isParentOf(s)&&this.isParentOf(r)&&i.getTextContent().length>0}};function WT(p){let t=null;if(sC(p)){const i=p.textContent;(i!==null&&i!==""||p.children.length>0)&&(t=Cm(p.getAttribute("href")||"",{rel:p.getAttribute("rel"),target:p.getAttribute("target"),title:p.getAttribute("title")}))}return{node:t}}function Cm(p,t){return So(new J1(p,t))}function km(p){return p instanceof J1}const G1=Yo();let od=class bE extends fi{static getType(){return"mark"}static clone(t){return new bE(Array.from(t.__ids),t.__key)}static importDOM(){return null}static importJSON(t){const i=id(t.ids);return i.setFormat(t.format),i.setIndent(t.indent),i.setDirection(t.direction),i}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(t,i){super(i),this.__ids=t||[]}createDOM(t){const i=document.createElement("mark");return hi(i,t.theme.mark),this.__ids.length>1&&hi(i,t.theme.markOverlap),i}updateDOM(t,i,e){const s=t.__ids,r=this.__ids,n=s.length,o=r.length,l=e.theme.markOverlap;return n!==o&&(n===1?o===2&&hi(i,l):o===1&&Vg(i,l)),!1}hasID(t){const i=this.getIDs();for(let e=0;e<i.length;e++)if(t===i[e])return!0;return!1}getIDs(){const t=this.getLatest();return ha(t)?t.__ids:[]}addID(t){const i=this.getWritable();if(ha(i)){const e=i.__ids;i.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return;e.push(t)}}deleteID(t){const i=this.getWritable();if(ha(i)){const e=i.__ids;i.__ids=e;for(let s=0;s<e.length;s++)if(t===e[s])return void e.splice(s,1)}}insertNewAfter(t,i=!0){const e=id(this.__ids);return this.insertAfter(e,i),e}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,i,e){if(!Et(i)||e==="html")return!1;const s=i.anchor,r=i.focus,n=s.getNode(),o=r.getNode(),l=i.isBackward()?s.offset-r.offset:r.offset-s.offset;return this.isParentOf(n)&&this.isParentOf(o)&&this.getTextContent().length===l}excludeFromCopy(t){return t!=="clone"}};function id(p){return So(new od(p))}function ha(p){return p instanceof od}function K1(p){const t=p.getChildren();let i=null;for(let e=0;e<t.length;e++){const s=t[e];i===null?p.insertBefore(s):i.insertAfter(s),i=s}p.remove()}function Y1(p,t,i,e){const s=p.getNodes(),r=p.anchor.offset,n=p.focus.offset,o=s.length,l=t?n:r,a=t?r:n;let u,c;for(let f=0;f<o;f++){const d=s[f];if(Nt(c)&&c.isParentOf(d))continue;const h=f===0,m=f===o-1;let g=null;if(qt(d)){const _=d.getTextContentSize(),v=h?l:0,b=m?a:_;if(v===0&&b===0)continue;const S=d.splitText(v,b);g=S.length>1&&(S.length===3||h&&!m||b===_)?S[1]:S[0]}else{if(ha(d))continue;Nt(d)&&d.isInline()&&(g=d)}if(g!==null){if(g&&g.is(u))continue;const _=g.getParent();_!=null&&_.is(u)||(c=void 0),u=_,c===void 0&&(c=(e||id)([i]),g.insertBefore(c)),c.append(g)}else u=void 0,c=void 0}Nt(c)&&(t?c.selectStart():c.selectEnd())}function Z1(p,t){let i=p;for(;i!==null;){if(ha(i))return i.getIDs();if(qt(i)&&t===i.getTextContentSize()){const e=i.getNextSibling();if(ha(e))return e.getIDs()}i=i.getParent()}return null}const Q1=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],X1=Q1[Math.floor(Math.random()*Q1.length)],VT=ve.createContext({clientID:0,color:X1[1],isCollabActive:!1,name:X1[0],yjsDocMap:new Map});function pp(p,t){const i=ve.useContext(VT);return p!=null&&(i.name=p),t!=null&&(i.color=t),i}const JT=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function e_({onClear:p}){const[t]=Yn();return JT(()=>t.registerCommand(af,i=>(t.update(()=>{if(p==null){const e=yr(),s=Ot(),r=lr();e.clear(),e.append(r),s!==null&&r.select(),Et(s)&&(s.format=0)}else p()}),!0),Tn),[t,p]),null}const hp=0,Tm=1,Om=2,Ki=0,GT=1,t_=2,KT=3,YT=4;function ZT(p,t,i,e,s){if(p===null||i.size===0&&e.size===0&&!s)return Ki;const r=t._selection,n=p._selection;if(s)return GT;if(!(Et(r)&&Et(n)&&n.isCollapsed()&&r.isCollapsed()))return Ki;const o=function(_,v,b){const S=_._nodeMap,E=[];for(const x of v){const y=S.get(x);y!==void 0&&E.push(y)}for(const[x,y]of b){if(!y)continue;const w=S.get(x);w===void 0||Ao(w)||E.push(w)}return E}(t,i,e);if(o.length===0)return Ki;if(o.length>1){const _=t._nodeMap,v=_.get(r.anchor.key),b=_.get(n.anchor.key);return v&&b&&!p._nodeMap.has(v.__key)&&qt(v)&&v.__text.length===1&&r.anchor.offset===1?t_:Ki}const l=o[0],a=p._nodeMap.get(l.__key);if(!qt(a)||!qt(l)||a.__mode!==l.__mode)return Ki;const u=a.__text,c=l.__text;if(u===c)return Ki;const f=r.anchor,d=n.anchor;if(f.key!==d.key||f.type!=="text")return Ki;const h=f.offset,m=d.offset,g=c.length-u.length;return g===1&&m===h-1?t_:g===-1&&m===h+1?KT:g===-1&&m===h?YT:Ki}function QT(p,t){let i=Date.now(),e=Ki;return(s,r,n,o,l,a)=>{const u=Date.now();if(a.has("historic"))return e=Ki,i=u,Om;const c=ZT(s,r,o,l,p.isComposing()),f=(()=>{const d=n===null||n.editor===p,h=a.has("history-push");if(!h&&d&&a.has("history-merge"))return hp;if(s===null)return Tm;const m=r._selection;return o.size>0||l.size>0?h===!1&&c!==Ki&&c===e&&u<i+t&&d||o.size===1&&function(g,_,v){const b=_._nodeMap.get(g),S=v._nodeMap.get(g),E=_._selection,x=v._selection;let y=!1;return Et(E)&&Et(x)&&(y=E.anchor.type==="element"&&E.focus.type==="element"&&x.anchor.type==="text"&&x.focus.type==="text"),!(y||!qt(b)||!qt(S))&&b.__type===S.__type&&b.__text===S.__text&&b.__mode===S.__mode&&b.__detail===S.__detail&&b.__style===S.__style&&b.__format===S.__format&&b.__parent===S.__parent}(Array.from(o)[0],s,r)?hp:Tm:m!==null?hp:Om})();return i=u,e=c,f}}function n_(p){p.undoStack=[],p.redoStack=[],p.current=null}function XT(p,t,i){const e=QT(p,i);return Mr(p.registerCommand(Su,()=>(function(r,n){const o=n.redoStack,l=n.undoStack;if(l.length!==0){const a=n.current,u=l.pop();a!==null&&(o.push(a),r.dispatchCommand(ql,!0)),l.length===0&&r.dispatchCommand(Wl,!1),n.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(p,t),!0),Tn),p.registerCommand(Eu,()=>(function(r,n){const o=n.redoStack,l=n.undoStack;if(o.length!==0){const a=n.current;a!==null&&(l.push(a),r.dispatchCommand(Wl,!0));const u=o.pop();o.length===0&&r.dispatchCommand(ql,!1),n.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(p,t),!0),Tn),p.registerCommand(af,()=>(n_(t),!1),Tn),p.registerCommand(jE,()=>(n_(t),p.dispatchCommand(ql,!1),p.dispatchCommand(Wl,!1),!0),Tn),p.registerUpdateListener(({editorState:r,prevEditorState:n,dirtyLeaves:o,dirtyElements:l,tags:a})=>{const u=t.current,c=t.redoStack,f=t.undoStack,d=u===null?null:u.editorState;if(u!==null&&r===d)return;const h=e(n,r,u,o,l,a);if(h===Tm)c.length!==0&&(t.redoStack=[],p.dispatchCommand(ql,!1)),u!==null&&(f.push({...u}),p.dispatchCommand(Wl,!0));else if(h===Om)return;t.current={editor:p,editorState:r}}))}function eO(){return{current:null,redoStack:[],undoStack:[]}}function gp({externalHistoryState:p}){const[t]=Yn();return function(i,e,s=1e3){const r=ve.useMemo(()=>e||eO(),[e]);ve.useEffect(()=>XT(i,r,s),[s,i,r])}(t,p),null}const tO=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function Am({ignoreHistoryMergeTagChange:p=!0,ignoreSelectionChange:t=!1,onChange:i}){const[e]=Yn();return tO(()=>{if(i)return e.registerUpdateListener(({editorState:s,dirtyElements:r,dirtyLeaves:n,prevEditorState:o,tags:l})=>{t&&r.size===0&&n.size===0||p&&l.has("history-merge")||o.isEmpty()||i(s,e,l)})},[e,p,t,i]),null}const yc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,nO=yc&&"documentMode"in document?document.documentMode:null,rO=!(!yc||!("InputEvent"in window)||nO)&&"getTargetRanges"in new window.InputEvent("input"),oO=yc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),iO=yc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,aO=yc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),sO=yc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!aO;function r_(p,t){t.update(()=>{if(p!==null){const i=ws(p,KeyboardEvent)?null:p.clipboardData,e=Ot();if(e!==null&&i!=null){p.preventDefault();const s=Wv(t);s!==null&&i.setData("text/html",s),i.setData("text/plain",e.getTextContent())}}})}function lO(p){return Mr(p.registerCommand(Bi,t=>{const i=Ot();return!!Et(i)&&(i.deleteCharacter(t),!0)},Tn),p.registerCommand(ol,t=>{const i=Ot();return!!Et(i)&&(i.deleteWord(t),!0)},Tn),p.registerCommand(ds,t=>{const i=Ot();return!!Et(i)&&(i.deleteLine(t),!0)},Tn),p.registerCommand(us,t=>{const i=Ot();if(!Et(i))return!1;if(typeof t=="string")i.insertText(t);else{const e=t.dataTransfer;if(e!=null)Vv(e,i);else{const s=t.data;s&&i.insertText(s)}}return!0},Tn),p.registerCommand(tf,()=>{const t=Ot();return!!Et(t)&&(t.removeText(),!0)},Tn),p.registerCommand(cs,t=>{const i=Ot();return!!Et(i)&&(i.insertLineBreak(t),!0)},Tn),p.registerCommand(Hl,()=>{const t=Ot();return!!Et(t)&&(t.insertLineBreak(),!0)},Tn),p.registerCommand(ku,t=>{const i=Ot();if(!Et(i))return!1;const e=t,s=e.shiftKey;return!!Hf(i,!0)&&(e.preventDefault(),$f(i,s,!0),!0)},Tn),p.registerCommand(Cu,t=>{const i=Ot();if(!Et(i))return!1;const e=t,s=e.shiftKey;return!!Hf(i,!1)&&(e.preventDefault(),$f(i,s,!1),!0)},Tn),p.registerCommand(zi,t=>{const i=Ot();return!!Et(i)&&(t.preventDefault(),p.dispatchCommand(Bi,!0))},Tn),p.registerCommand(Ma,t=>{const i=Ot();return!!Et(i)&&(t.preventDefault(),p.dispatchCommand(Bi,!1))},Tn),p.registerCommand(aa,t=>{const i=Ot();if(!Et(i))return!1;if(t!==null){if((iO||oO||sO)&&rO)return!1;t.preventDefault()}return p.dispatchCommand(cs,!1)},Tn),p.registerCommand(of,()=>(pb(),!0),Tn),p.registerCommand(ju,t=>{const i=Ot();return!!Et(i)&&(r_(t,p),!0)},Tn),p.registerCommand(Nu,t=>{const i=Ot();return!!Et(i)&&(function(e,s){r_(e,s),s.update(()=>{const r=Ot();Et(r)&&r.removeText()})}(t,p),!0)},Tn),p.registerCommand(rl,t=>{const i=Ot();return!!Et(i)&&(function(e,s){e.preventDefault(),s.update(()=>{const r=Ot(),{clipboardData:n}=e;n!=null&&Et(r)&&Vv(n,r)},{tag:"paste"})}(t,p),!0)},Tn),p.registerCommand(Au,t=>{const i=Ot();return!!Et(i)&&(t.preventDefault(),!0)},Tn),p.registerCommand(il,t=>{const i=Ot();return!!Et(i)&&(t.preventDefault(),!0)},Tn))}const jm=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?ve.useLayoutEffect:ve.useEffect;function o_(p){return p.getEditorState().read($1(p.isComposing()))}function i_({contentEditable:p,placeholder:t,ErrorBoundary:i}){const[e]=Yn(),s=function(r,n){const[o,l]=ve.useState(()=>r.getDecorators());return jm(()=>r.registerDecoratorListener(a=>{ro.flushSync(()=>{l(a)})}),[r]),ve.useEffect(()=>{l(r.getDecorators())},[r]),ve.useMemo(()=>{const a=[],u=Object.keys(o);for(let c=0;c<u.length;c++){const f=u[c],d=_e.jsx(n,{onError:m=>r._onError(m),children:_e.jsx(ve.Suspense,{fallback:null,children:o[f]})}),h=r.getElementByKey(f);h!==null&&a.push(ro.createPortal(d,h,f))}return a},[n,o,r])}(e,i);return function(r){jm(()=>Mr(lO(r),q1(r)),[r])}(e),_e.jsxs(_e.Fragment,{children:[p,_e.jsx(cO,{content:t}),s]})}function cO({content:p}){const[t]=Yn(),i=function(s){const[r,n]=ve.useState(()=>o_(s));return jm(()=>{function o(){const l=o_(s);n(l)}return o(),Mr(s.registerUpdateListener(()=>{o()}),s.registerEditableListener(()=>{o()}))},[s]),r}(t),e=td();return i?typeof p=="function"?p(e):p:null}var uO={967:(p,t,i)=>{const e=["docId","username","apiKey","domain","hooks","editorInstanceHooks","appServer","demo"];function s(d,h){var m=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(_){return Object.getOwnPropertyDescriptor(d,_).enumerable})),m.push.apply(m,g)}return m}function r(d){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?s(Object(m),!0).forEach(function(g){n(d,g,m[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(m)):s(Object(m)).forEach(function(g){Object.defineProperty(d,g,Object.getOwnPropertyDescriptor(m,g))})}return d}function n(d,h,m){return(h=function(g){var _=function(v){if(typeof v!="object"||!v)return v;var b=v[Symbol.toPrimitive];if(b!==void 0){var S=b.call(v,"string");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}(g);return typeof _=="symbol"?_:_+""}(h))in d?Object.defineProperty(d,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[h]=m,d}let o;o=i(668);let l=null;t.conf=function(d){d.autoStart=!1,l&&l.init(d)};const a=async function(d){if(l)return l.start(d)};t.start=a;const u=function(d){l&&(l.stop(),l=null)};t.stop=u;const c=function(d,h){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(l)return l.diff({state1:d,state2:h,config:m})};t.diff=c;const f=function(){if(l)return l.sync(...arguments)};t.sync=f,t.initSync=function(d){return l?l.initSync(d):d},p.exports={start:a,sync:f,diff:c,stop:u,createConfig:d=>{let{docId:h,username:m,apiKey:g,domain:_,hooks:v,editorInstanceHooks:b,appServer:S={},demo:E=!1}=d;return r(r({},function(x,y){if(x==null)return{};var w,C,j=function(F,I){if(F==null)return{};var D={};for(var N in F)if({}.hasOwnProperty.call(F,N)){if(I.includes(N))continue;D[N]=F[N]}return D}(x,y);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(x);for(C=0;C<P.length;C++)w=P[C],y.includes(w)||{}.propertyIsEnumerable.call(x,w)&&(j[w]=x[w])}return j}(d,e)),{},{docId:h,username:m,apiKey:g,autoStart:!0,demo:E,domain:_,hooks:v,editorInstance:r({type:"lexical"},b),app:"json",json:{keyNames:{default:"codoxId"},filters:{version:!0},appServer:S,semantics:{paths:{"state.root.children.children.text":"MERGE","state.root.children.children.children.text":"MERGE"},string:"MERGE"}}})},get instance(){return l},createNewInstance:()=>{l=new o,window.codoxInstance=l}}},668:(p,t,i)=>{p.exports=function e(s,r,n){function o(u,c){if(!r[u]){if(!s[u]){var f=void 0;if(!c&&f)return require(u,!0);if(l)return l(u,!0);throw(c=new Error("Cannot find module '"+u+"'")).code="MODULE_NOT_FOUND",c}f=r[u]={exports:{}},s[u][0].call(f.exports,function(d){return o(s[u][1][d]||d)},f,f.exports,e,s,r,n)}return r[u].exports}for(var l=void 0,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,s,r){s.exports=function(n,o){(o==null||o>n.length)&&(o=n.length);for(var l=0,a=new Array(o);l<o;l++)a[l]=n[l];return a},s.exports.__esModule=!0,s.exports.default=s.exports},{}],2:[function(e,s,r){s.exports=function(n){if(Array.isArray(n))return n},s.exports.__esModule=!0,s.exports.default=s.exports},{}],3:[function(e,s,r){var n=e("./arrayLikeToArray.js");s.exports=function(o){if(Array.isArray(o))return n(o)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayLikeToArray.js":1}],4:[function(e,s,r){s.exports=function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n},s.exports.__esModule=!0,s.exports.default=s.exports},{}],5:[function(e,s,r){s.exports=function(n,o){if(!(n instanceof o))throw new TypeError("Cannot call a class as a function")},s.exports.__esModule=!0,s.exports.default=s.exports},{}],6:[function(e,s,r){var n=e("./setPrototypeOf.js"),o=e("./isNativeReflectConstruct.js");function l(a,u,c){return o()?s.exports=l=Reflect.construct.bind():s.exports=l=function(f,d,h){var m=[null];return m.push.apply(m,d),d=new(Function.bind.apply(f,m)),h&&n(d,h.prototype),d},s.exports.__esModule=!0,s.exports.default=s.exports,l.apply(null,arguments)}s.exports=l,s.exports.__esModule=!0,s.exports.default=s.exports},{"./isNativeReflectConstruct.js":13,"./setPrototypeOf.js":19}],7:[function(e,s,r){function n(o,l){for(var a=0;a<l.length;a++){var u=l[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}s.exports=function(o,l,a){return l&&n(o.prototype,l),a&&n(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o},s.exports.__esModule=!0,s.exports.default=s.exports},{}],8:[function(e,s,r){s.exports=function(n,o,l){return o in n?Object.defineProperty(n,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[o]=l,n},s.exports.__esModule=!0,s.exports.default=s.exports},{}],9:[function(e,s,r){function n(o){return s.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},s.exports.__esModule=!0,s.exports.default=s.exports,n(o)}s.exports=n,s.exports.__esModule=!0,s.exports.default=s.exports},{}],10:[function(e,s,r){var n=e("./setPrototypeOf.js");s.exports=function(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(l&&l.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),l&&n(o,l)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./setPrototypeOf.js":19}],11:[function(e,s,r){s.exports=function(n){return n&&n.__esModule?n:{default:n}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],12:[function(e,s,r){s.exports=function(n){return Function.toString.call(n).indexOf("[native code]")!==-1},s.exports.__esModule=!0,s.exports.default=s.exports},{}],13:[function(e,s,r){s.exports=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],14:[function(e,s,r){s.exports=function(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)},s.exports.__esModule=!0,s.exports.default=s.exports},{}],15:[function(e,s,r){s.exports=function(n,o){var l=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(l!=null){var a,u,c=[],f=!0,d=!1;try{for(l=l.call(n);!(f=(a=l.next()).done)&&(c.push(a.value),!o||c.length!==o);f=!0);}catch(h){d=!0,u=h}finally{try{f||l.return==null||l.return()}finally{if(d)throw u}}return c}},s.exports.__esModule=!0,s.exports.default=s.exports},{}],16:[function(e,s,r){s.exports=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
137
137
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},s.exports.__esModule=!0,s.exports.default=s.exports},{}],17:[function(e,s,r){s.exports=function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
138
138
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},s.exports.__esModule=!0,s.exports.default=s.exports},{}],18:[function(e,s,r){var n=e("./typeof.js").default,o=e("./assertThisInitialized.js");s.exports=function(l,a){if(a&&(n(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return o(l)},s.exports.__esModule=!0,s.exports.default=s.exports},{"./assertThisInitialized.js":4,"./typeof.js":22}],19:[function(e,s,r){function n(o,l){return s.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,u){return a.__proto__=u,a},s.exports.__esModule=!0,s.exports.default=s.exports,n(o,l)}s.exports=n,s.exports.__esModule=!0,s.exports.default=s.exports},{}],20:[function(e,s,r){var n=e("./arrayWithHoles.js"),o=e("./iterableToArrayLimit.js"),l=e("./unsupportedIterableToArray.js"),a=e("./nonIterableRest.js");s.exports=function(u,c){return n(u)||o(u,c)||l(u,c)||a()},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayWithHoles.js":2,"./iterableToArrayLimit.js":15,"./nonIterableRest.js":16,"./unsupportedIterableToArray.js":23}],21:[function(e,s,r){var n=e("./arrayWithoutHoles.js"),o=e("./iterableToArray.js"),l=e("./unsupportedIterableToArray.js"),a=e("./nonIterableSpread.js");s.exports=function(u){return n(u)||o(u)||l(u)||a()},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayWithoutHoles.js":3,"./iterableToArray.js":14,"./nonIterableSpread.js":17,"./unsupportedIterableToArray.js":23}],22:[function(e,s,r){function n(o){return s.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},s.exports.__esModule=!0,s.exports.default=s.exports,n(o)}s.exports=n,s.exports.__esModule=!0,s.exports.default=s.exports},{}],23:[function(e,s,r){var n=e("./arrayLikeToArray.js");s.exports=function(o,l){var a;if(o)return typeof o=="string"?n(o,l):(a=(a=Object.prototype.toString.call(o).slice(8,-1))==="Object"&&o.constructor?o.constructor.name:a)==="Map"||a==="Set"?Array.from(o):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(o,l):void 0},s.exports.__esModule=!0,s.exports.default=s.exports},{"./arrayLikeToArray.js":1}],24:[function(e,s,r){var n=e("./getPrototypeOf.js"),o=e("./setPrototypeOf.js"),l=e("./isNativeFunction.js"),a=e("./construct.js");function u(c){var f=typeof Map=="function"?new Map:void 0;return s.exports=u=function(d){if(d===null||!l(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(f!==void 0){if(f.has(d))return f.get(d);f.set(d,h)}function h(){return a(d,arguments,n(this).constructor)}return h.prototype=Object.create(d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),o(h,d)},s.exports.__esModule=!0,s.exports.default=s.exports,u(c)}s.exports=u,s.exports.__esModule=!0,s.exports.default=s.exports},{"./construct.js":6,"./getPrototypeOf.js":9,"./isNativeFunction.js":12,"./setPrototypeOf.js":19}],25:[function(e,s,r){s.exports=function n(o,l){if(o===l)return!0;if(o&&l&&typeof o=="object"&&typeof l=="object"){if(o.constructor!==l.constructor)return!1;var a,u,c;if(Array.isArray(o)){if((a=o.length)!=l.length)return!1;for(u=a;u--!=0;)if(!n(o[u],l[u]))return!1}else{if(o.constructor===RegExp)return o.source===l.source&&o.flags===l.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===l.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===l.toString();if((a=(c=Object.keys(o)).length)!==Object.keys(l).length)return!1;for(u=a;u--!=0;)if(!Object.prototype.hasOwnProperty.call(l,c[u]))return!1;for(u=a;u--!=0;){var f=c[u];if(!n(o[f],l[f]))return!1}}return!0}return o!=o&&l!=l}},{}],26:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return h.default}});var n=m(e("./v1.js")),o=m(e("./v3.js")),l=m(e("./v4.js")),a=m(e("./v5.js")),u=m(e("./nil.js")),c=m(e("./version.js")),f=m(e("./validate.js")),d=m(e("./stringify.js")),h=m(e("./parse.js"));function m(g){return g&&g.__esModule?g:{default:g}}},{"./nil.js":28,"./parse.js":29,"./stringify.js":33,"./v1.js":34,"./v3.js":35,"./v4.js":37,"./v5.js":38,"./validate.js":39,"./version.js":40}],27:[function(e,s,r){function n(d){return 14+(d+64>>>9<<4)+1}function o(d,h){var m=(65535&d)+(65535&h);return(d>>16)+(h>>16)+(m>>16)<<16|65535&m}function l(d,h,m,g,_,v){return o((h=o(o(h,d),o(g,v)))<<_|h>>>32-_,m)}function a(d,h,m,g,_,v,b){return l(h&m|~h&g,d,h,_,v,b)}function u(d,h,m,g,_,v,b){return l(h&g|m&~g,d,h,_,v,b)}function c(d,h,m,g,_,v,b){return l(h^m^g,d,h,_,v,b)}function f(d,h,m,g,_,v,b){return l(m^(h|~g),d,h,_,v,b)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=function(d){if(typeof d=="string"){var h=unescape(encodeURIComponent(d));d=new Uint8Array(h.length);for(let S=0;S<h.length;++S)d[S]=h.charCodeAt(S)}var m=((S,E)=>{S[E>>5]|=128<<E%32,S[n(E)-1]=E;let x=1732584193,y=-271733879,w=-1732584194,C=271733878;for(let D=0;D<S.length;D+=16){var j=x,P=y,F=w,I=C;x=a(x,y,w,C,S[D],7,-680876936),C=a(C,x,y,w,S[D+1],12,-389564586),w=a(w,C,x,y,S[D+2],17,606105819),y=a(y,w,C,x,S[D+3],22,-1044525330),x=a(x,y,w,C,S[D+4],7,-176418897),C=a(C,x,y,w,S[D+5],12,1200080426),w=a(w,C,x,y,S[D+6],17,-1473231341),y=a(y,w,C,x,S[D+7],22,-45705983),x=a(x,y,w,C,S[D+8],7,1770035416),C=a(C,x,y,w,S[D+9],12,-1958414417),w=a(w,C,x,y,S[D+10],17,-42063),y=a(y,w,C,x,S[D+11],22,-1990404162),x=a(x,y,w,C,S[D+12],7,1804603682),C=a(C,x,y,w,S[D+13],12,-40341101),w=a(w,C,x,y,S[D+14],17,-1502002290),y=a(y,w,C,x,S[D+15],22,1236535329),x=u(x,y,w,C,S[D+1],5,-165796510),C=u(C,x,y,w,S[D+6],9,-1069501632),w=u(w,C,x,y,S[D+11],14,643717713),y=u(y,w,C,x,S[D],20,-373897302),x=u(x,y,w,C,S[D+5],5,-701558691),C=u(C,x,y,w,S[D+10],9,38016083),w=u(w,C,x,y,S[D+15],14,-660478335),y=u(y,w,C,x,S[D+4],20,-405537848),x=u(x,y,w,C,S[D+9],5,568446438),C=u(C,x,y,w,S[D+14],9,-1019803690),w=u(w,C,x,y,S[D+3],14,-187363961),y=u(y,w,C,x,S[D+8],20,1163531501),x=u(x,y,w,C,S[D+13],5,-1444681467),C=u(C,x,y,w,S[D+2],9,-51403784),w=u(w,C,x,y,S[D+7],14,1735328473),y=u(y,w,C,x,S[D+12],20,-1926607734),x=c(x,y,w,C,S[D+5],4,-378558),C=c(C,x,y,w,S[D+8],11,-2022574463),w=c(w,C,x,y,S[D+11],16,1839030562),y=c(y,w,C,x,S[D+14],23,-35309556),x=c(x,y,w,C,S[D+1],4,-1530992060),C=c(C,x,y,w,S[D+4],11,1272893353),w=c(w,C,x,y,S[D+7],16,-155497632),y=c(y,w,C,x,S[D+10],23,-1094730640),x=c(x,y,w,C,S[D+13],4,681279174),C=c(C,x,y,w,S[D],11,-358537222),w=c(w,C,x,y,S[D+3],16,-722521979),y=c(y,w,C,x,S[D+6],23,76029189),x=c(x,y,w,C,S[D+9],4,-640364487),C=c(C,x,y,w,S[D+12],11,-421815835),w=c(w,C,x,y,S[D+15],16,530742520),y=c(y,w,C,x,S[D+2],23,-995338651),x=f(x,y,w,C,S[D],6,-198630844),C=f(C,x,y,w,S[D+7],10,1126891415),w=f(w,C,x,y,S[D+14],15,-1416354905),y=f(y,w,C,x,S[D+5],21,-57434055),x=f(x,y,w,C,S[D+12],6,1700485571),C=f(C,x,y,w,S[D+3],10,-1894986606),w=f(w,C,x,y,S[D+10],15,-1051523),y=f(y,w,C,x,S[D+1],21,-2054922799),x=f(x,y,w,C,S[D+8],6,1873313359),C=f(C,x,y,w,S[D+15],10,-30611744),w=f(w,C,x,y,S[D+6],15,-1560198380),y=f(y,w,C,x,S[D+13],21,1309151649),x=f(x,y,w,C,S[D+4],6,-145523070),C=f(C,x,y,w,S[D+11],10,-1120210379),w=f(w,C,x,y,S[D+2],15,718787259),y=f(y,w,C,x,S[D+9],21,-343485551),x=o(x,j),y=o(y,P),w=o(w,F),C=o(C,I)}return[x,y,w,C]})((S=>{if(S.length===0)return[];var E=8*S.length,x=new Uint32Array(n(E));for(let y=0;y<E;y+=8)x[y>>5]|=(255&S[y/8])<<y%32;return x})(d),8*d.length),g=[],_=32*m.length,v="0123456789abcdef";for(let S=0;S<_;S+=8){var b=m[S>>5]>>>S%32&255;b=parseInt(v.charAt(b>>>4&15)+v.charAt(15&b),16),g.push(b)}return g}},{}],28:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default="00000000-0000-0000-0000-000000000000"},{}],29:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("./validate.js"))&&e.__esModule?e:{default:e};r.default=function(o){var l,a;if((0,n.default)(o))return(a=new Uint8Array(16))[0]=(l=parseInt(o.slice(0,8),16))>>>24,a[1]=l>>>16&255,a[2]=l>>>8&255,a[3]=255&l,a[4]=(l=parseInt(o.slice(9,13),16))>>>8,a[5]=255&l,a[6]=(l=parseInt(o.slice(14,18),16))>>>8,a[7]=255&l,a[8]=(l=parseInt(o.slice(19,23),16))>>>8,a[9]=255&l,a[10]=(l=parseInt(o.slice(24,36),16))/1099511627776&255,a[11]=l/4294967296&255,a[12]=l>>>24&255,a[13]=l>>>16&255,a[14]=l>>>8&255,a[15]=255&l,a;throw TypeError("Invalid UUID")}},{"./validate.js":39}],30:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},{}],31:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if(!n&&!(n=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(o)};let n,o=new Uint8Array(16)},{}],32:[function(e,s,r){function n(o,l){return o<<l|o>>>32-l}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=function(o){var l=[1518500249,1859775393,2400959708,3395469782],a=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof o=="string"){var u=unescape(encodeURIComponent(o));o=[];for(let _=0;_<u.length;++_)o.push(u.charCodeAt(_))}else Array.isArray(o)||(o=Array.prototype.slice.call(o));o.push(128);var c=o.length/4+2,f=Math.ceil(c/16),d=new Array(f);for(let _=0;_<f;++_){var h=new Uint32Array(16);for(let v=0;v<16;++v)h[v]=o[64*_+4*v]<<24|o[64*_+4*v+1]<<16|o[64*_+4*v+2]<<8|o[64*_+4*v+3];d[_]=h}d[f-1][14]=8*(o.length-1)/Math.pow(2,32),d[f-1][14]=Math.floor(d[f-1][14]),d[f-1][15]=8*(o.length-1)&4294967295;for(let _=0;_<f;++_){var m=new Uint32Array(80);for(let y=0;y<16;++y)m[y]=d[_][y];for(let y=16;y<80;++y)m[y]=n(m[y-3]^m[y-8]^m[y-14]^m[y-16],1);let v=a[0],b=a[1],S=a[2],E=a[3],x=a[4];for(let y=0;y<80;++y){var g=Math.floor(y/20);g=n(v,5)+((w,C,j,P)=>{switch(w){case 0:return C&j^~C&P;case 1:case 3:return C^j^P;case 2:return C&j^C&P^j&P}})(g,b,S,E)+x+l[g]+m[y]>>>0,x=E,E=S,S=n(b,30)>>>0,b=v,v=g}a[0]=a[0]+v>>>0,a[1]=a[1]+b>>>0,a[2]=a[2]+S>>>0,a[3]=a[3]+E>>>0,a[4]=a[4]+x>>>0}return[a[0]>>24&255,a[0]>>16&255,a[0]>>8&255,255&a[0],a[1]>>24&255,a[1]>>16&255,a[1]>>8&255,255&a[1],a[2]>>24&255,a[2]>>16&255,a[2]>>8&255,255&a[2],a[3]>>24&255,a[3]>>16&255,a[3]>>8&255,255&a[3],a[4]>>24&255,a[4]>>16&255,a[4]>>8&255,255&a[4]]}},{}],33:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("./validate.js"))&&e.__esModule?e:{default:e};let o=[];for(let l=0;l<256;++l)o.push((l+256).toString(16).substr(1));r.default=function(l){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(l=(o[l[a+0]]+o[l[a+1]]+o[l[a+2]]+o[l[a+3]]+"-"+o[l[a+4]]+o[l[a+5]]+"-"+o[l[a+6]]+o[l[a+7]]+"-"+o[l[a+8]]+o[l[a+9]]+"-"+o[l[a+10]]+o[l[a+11]]+o[l[a+12]]+o[l[a+13]]+o[l[a+14]]+o[l[a+15]]).toLowerCase(),(0,n.default)(l))return l;throw TypeError("Stringified UUID is invalid")}},{"./validate.js":39}],34:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=l(e("./rng.js")),o=l(e("./stringify.js"));function l(d){return d&&d.__esModule?d:{default:d}}let a,u,c=0,f=0;r.default=function(d,h,m){var g=h&&m||0,_=h||new Array(16);let v=(d=d||{}).node||a,b=d.clockseq!==void 0?d.clockseq:u,S=(v!=null&&b!=null||(m=d.random||(d.rng||n.default)(),v==null&&(v=a=[1|m[0],m[1],m[2],m[3],m[4],m[5]]),b==null&&(b=u=16383&(m[6]<<8|m[7]))),m=d.msecs!==void 0?d.msecs:Date.now(),d.nsecs!==void 0?d.nsecs:f+1);var E=m-c+(S-f)/1e4;if(E<0&&d.clockseq===void 0&&(b=b+1&16383),1e4<=(S=(E<0||m>c)&&d.nsecs===void 0?0:S))throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=m,f=S,u=b,E=(1e4*(268435455&(m+=122192928e5))+S)%4294967296,_[g++]=E>>>24&255,_[g++]=E>>>16&255,_[g++]=E>>>8&255,_[g++]=255&E,_[g++]=(d=m/4294967296*1e4&268435455)>>>8&255,_[g++]=255&d,_[g++]=d>>>24&15|16,_[g++]=d>>>16&255,_[g++]=b>>>8|128,_[g++]=255&b;for(let x=0;x<6;++x)_[g+x]=v[x];return h||(0,o.default)(_)}},{"./rng.js":31,"./stringify.js":33}],35:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./v35.js"));function o(l){return l&&l.__esModule?l:{default:l}}e=o(e("./md5.js")),n=(0,n.default)("v3",48,e.default),r.default=n},{"./md5.js":27,"./v35.js":36}],36:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(c,f,d){function h(m,g,_,v){if(typeof m=="string"&&(m=(S=>{S=unescape(encodeURIComponent(S));var E=[];for(let x=0;x<S.length;++x)E.push(S.charCodeAt(x));return E})(m)),(g=typeof g=="string"?(0,o.default)(g):g).length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let b=new Uint8Array(16+m.length);if(b.set(g),b.set(m,g.length),(b=d(b))[6]=15&b[6]|f,b[8]=63&b[8]|128,_){v=v||0;for(let S=0;S<16;++S)_[v+S]=b[S];return _}return(0,n.default)(b)}try{h.name=c}catch{}return h.DNS=a,h.URL=u,h},r.URL=r.DNS=void 0;var n=l(e("./stringify.js")),o=l(e("./parse.js"));function l(c){return c&&c.__esModule?c:{default:c}}let a="6ba7b810-9dad-11d1-80b4-00c04fd430c8",u=(r.DNS=a,"6ba7b811-9dad-11d1-80b4-00c04fd430c8");r.URL=u},{"./parse.js":29,"./stringify.js":33}],37:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=l(e("./rng.js")),o=l(e("./stringify.js"));function l(a){return a&&a.__esModule?a:{default:a}}r.default=function(a,u,c){var f=(a=a||{}).random||(a.rng||n.default)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,u){c=c||0;for(let d=0;d<16;++d)u[c+d]=f[d];return u}return(0,o.default)(f)}},{"./rng.js":31,"./stringify.js":33}],38:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./v35.js"));function o(l){return l&&l.__esModule?l:{default:l}}e=o(e("./sha1.js")),n=(0,n.default)("v5",80,e.default),r.default=n},{"./sha1.js":32,"./v35.js":36}],39:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("./regex.js"))&&e.__esModule?e:{default:e};r.default=function(o){return typeof o=="string"&&n.default.test(o)}},{"./regex.js":30}],40:[function(e,s,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(e=e("./validate.js"))&&e.__esModule?e:{default:e};r.default=function(o){if((0,n.default)(o))return parseInt(o.substr(14,1),16);throw TypeError("Invalid UUID")}},{"./validate.js":39}],41:[function(e,s,r){var n=(l=e("@babel/runtime/helpers/interopRequireDefault"))(e("@babel/runtime/helpers/toConsumableArray")),o=l(e("@babel/runtime/helpers/classCallCheck")),l=l(e("@babel/runtime/helpers/createClass")),a=e("./logger").log4,u=(v=e("./type")).isRealObject,c=v.isObjectId,f=v.isDefined,d=v.isPrimitiveArray,h=v.getType,m=e("./utils"),g=e("./path").samePath,_=e("./errors").OperationError,v=(0,l.default)(function b(S){(0,o.default)(this,b),this._config=S,this._utils=new m(S)},[{key:"isMatchingObjects",value:function(b,S,E){return S=(b=this._utils.getObjectIdentifiers({input:b,output:S,path:E})).inputId,E=b.outputId,b=b.sameId,c(S)&&c(E)&&b}},{key:"haveObjectIds",value:function(b,S,E){return!!(b.li&&S.ld||b.ld&&S.li)&&(!!(Array.isArray(b.ld)&&Array.isArray(S.li)||Array.isArray(S.ld)&&Array.isArray(b.li))||(b=this._utils.getOpTargetObject(b),S=this._utils.getOpTargetObject(S),S=(b=this._utils.getObjectIdentifiers({input:b,output:S,path:E})).inputId,E=b.outputId,c(S)&&c(E)))}},{key:"isMatchingOpPair",value:function(b,S,E){return!!((b.li&&S.ld||b.ld&&S.li)&&(Array.isArray(b.ld)&&Array.isArray(S.li)&&this.sameTargetArray(b.ld,S.li)||Array.isArray(S.ld)&&Array.isArray(b.li)&&this.sameTargetArray(S.ld,b.li)||this.isMatchingObjects(this._utils.getOpTargetObject(b),this._utils.getOpTargetObject(S),E)))}},{key:"isObjReplace",value:function(b,S){return!(!b||!S||b.oi!=null||b.od===void 0||S.od!=null||S.oi===void 0||!g(b.p,S.p))}},{key:"isReplace",value:function(b,S){return!(!b||!S||!((b.li&&S.ld||b.ld&&S.li)&&g(b.p,S.p)&&this.haveObjectIds(b,S,b.p)))}},{key:"isMove",value:function(b,S){return!(!b||!S||g(b.p,S.p)||!this.isMatchingOpPair(b,S,b.p))}},{key:"isIdentity",value:function(b,S){return a("isIdentity",b,S,!0),!(!b||!S)&&g(b.p,S.p)&&this.isMatchingOpPair(b,S,b.p)}},{key:"arrayDiff",value:function(b,S){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:[],x=3<arguments.length?arguments[3]:void 0;if(a("Start performing arrayDiff: beforeState = ",b,!0),a("Start performing arrayDiff: afterState",S,!0),!Array.isArray(b))throw new _("beforeState snapshot is not an array");if(!Array.isArray(S))throw new _("afterState snapshot is not an array");var y=[],w=0,C=0,j=0,P=0;for(w=0,C=0;C<S.length&&w<b.length;w++){a("arrayDiff: loop at",{i:w,j:C},!0);var F,I=b[w],D=w-j;D=[].concat((0,n.default)(E),[D]),this.isMatchingObjects(b[w],S[C],E)?(F=x(I,S[C],D),a("arrayDiff: same target object (id) -> recursively diff result = ",{r:F},!0),y=y.concat(F),C++):(F={p:D,ld:this._utils.deLabel(I)},y.push(F),a("arrayDiff: different target object (id) -> create a ld op = ",{op:F,i:w,dCount:++j},!0))}for(var N=w;N<b.length;N++){var k=b[N],A=N-j;A={p:[].concat((0,n.default)(E),[A]),ld:m.deLabel(k)},y.push(A),a("arrayDiff: handle beforeState tail, create a ld op",{op:A,pos:N},!0),j++}for(var R=C;R<S.length;R++){var L=S[R],J=R;J={p:[].concat((0,n.default)(E),[J]),li:m.deLabel(L)},y.push(J),a("arrayDiff: handle afterState tail, create a li op",{op:J,pos:R},!0),P++}return{ops:y,dCount:j,iCount:P}}},{key:"arrayOfArrayDiff",value:function(){var b,S,E=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},x=E.before,y=E.after,w=E.path,C=E.commonHeaderLen,j=E.diff,P=E.isObjectArray,F=E.isInternal,I=[],D=0,N=0,k=0;for(D=0,N=0;N<y.length&&D<x.length;D++)!P&&(this.sameTargetArray(x[D],y[N])||d(x[D])&&d(y[N])||h(x[D])=="array"&&h(y[N]=="array"))||P&&this.isMatchingObjects(x[D],y[N],w)?(a(`
139
139
  arrayOfArrayDiff: the same array -> recursive invocation of diff: i = `+D+"; j = "+N),a("before[i] = ",x[D]),a("after[j] = ",y[N]),b=j(x[D],y[N],[].concat((0,n.default)(w),[D+C-k]),F),I=I.concat(b),a("arrayOfArrayDiff: the same array -> recursively generate r = ",b),a("arrayOfArrayDiff: the same array -> ops = ",I),N++):(b=D-k+C,S={p:[].concat((0,n.default)(w),[b]),ld:x[D]},I.push(S),a(`