@arkyn/components 1.3.121 → 1.3.122

Sign up to get free protection for your applications and to get access to all the features.
package/dist/bundle.js CHANGED
@@ -15220,10 +15220,10 @@ function SD(t) {
15220
15220
  })(Bf);
15221
15221
  const Cl = /* @__PURE__ */ Ci(Bf), PD = Cl.default || Cl, $a = (t) => {
15222
15222
  if (typeof t == "string") return { text: t || "" };
15223
- function e(r) {
15224
- return r.map((i) => $a(i));
15223
+ function e(i) {
15224
+ return i.map((a) => $a(a));
15225
15225
  }
15226
- const n = Array.isArray(t.props.children) ? e(t.props.children) : [{ text: t.props.children }];
15226
+ const n = Array.isArray(t.props.children) ? e(t.props.children) : [{ text: t.props.children }], r = typeof t.props.children == "string" ? t.props.children : "";
15227
15227
  switch (t.type) {
15228
15228
  case "p":
15229
15229
  return { type: "paragraph", children: n };
@@ -15240,15 +15240,15 @@ const Cl = /* @__PURE__ */ Ci(Bf), PD = Cl.default || Cl, $a = (t) => {
15240
15240
  case "ol":
15241
15241
  return { type: "numberedList", children: n };
15242
15242
  case "strong":
15243
- return { text: "", children: n, bold: !0 };
15243
+ return { text: r, bold: !0 };
15244
15244
  case "code":
15245
- return { text: "", children: n, code: !0 };
15245
+ return { text: r, code: !0 };
15246
15246
  case "em":
15247
- return { text: "", children: n, italic: !0 };
15247
+ return { text: r, italic: !0 };
15248
15248
  case "u":
15249
- return { text: "", children: n, underline: !0 };
15249
+ return { text: r, underline: !0 };
15250
15250
  default:
15251
- return { text: "", children: n };
15251
+ return { text: r };
15252
15252
  }
15253
15253
  }, MD = (t) => {
15254
15254
  const e = PD(t);
@@ -89,7 +89,7 @@ React keys must be passed directly to JSX without using spread:
89
89
  `?c.createElement(Ul,{isTrailing:!0,text:n.text}):c.createElement(Ul,{text:n.text})},Ul=t=>{var{text:e,isTrailing:n=!1}=t,r=c.useRef(null),i=()=>"".concat(e??"").concat(n?`
90
90
  `:""),[a]=c.useState(i);return sr(()=>{var o=i();r.current&&r.current.textContent!==o&&(r.current.textContent=o)}),c.createElement(yy,{ref:r},a)},yy=c.memo(c.forwardRef((t,e)=>c.createElement("span",{"data-slate-string":!0,ref:e},t.children))),Fa=t=>{var{length:e=0,isLineBreak:n=!1,isMarkPlaceholder:r=!1}=t,i={"data-slate-zero-width":n?"n":"z","data-slate-length":e};return r&&(i["data-slate-mark-placeholder"]=!0),c.createElement("span",gy({},i),!(vt||wl)||!n?"\uFEFF":null,n?c.createElement("br",null):null)};function Hl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Hl(Object(n),!0).forEach(function(r){Pt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Cy=vt?300:0;function Dy(t,e){t.current&&(t.current.disconnect(),e&&(t.current=null))}function ql(t){t.current&&(clearTimeout(t.current),t.current=null)}var by=t=>{var{leaf:e,isLast:n,text:r,parent:i,renderPlaceholder:a,renderLeaf:o=x=>c.createElement(wy,Vl({},x))}=t,s=Qt(),u=c.useRef(null),l=c.useRef(null),[f,h]=c.useState(!1),p=c.useRef(null),g=c.useCallback(x=>{if(Dy(u,x==null),x==null){var E;wa.delete(s),(E=e.onPlaceholderResize)===null||E===void 0||E.call(e,null)}else{if(wa.set(s,x),!u.current){var O=window.ResizeObserver||S0;u.current=new O(()=>{var b;(b=e.onPlaceholderResize)===null||b===void 0||b.call(e,x)})}u.current.observe(x),l.current=x}},[l,e,s]),y=c.createElement(my,{isLast:n,leaf:e,parent:i,text:r}),v=!!e[Rn];if(c.useEffect(()=>(v?p.current||(p.current=setTimeout(()=>{h(!0),p.current=null},Cy)):(ql(p),h(!1)),()=>ql(p)),[v,h]),v&&f){var d={children:e.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:Dn?"inherit":void 0},contentEditable:!1,ref:g}};y=c.createElement(c.Fragment,null,a(d),y)}var D={"data-slate-leaf":!0};return o({attributes:D,children:y,leaf:e,text:r})},Ey=c.memo(by,(t,e)=>e.parent===t.parent&&e.isLast===t.isLast&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&e.text===t.text&&ce.equals(e.leaf,t.leaf)&&e.leaf[Rn]===t.leaf[Rn]),wy=t=>{var{attributes:e,children:n}=t;return c.createElement("span",Vl({},e),n)},xy=t=>{for(var{decorations:e,isLast:n,parent:r,renderPlaceholder:i,renderLeaf:a,text:o}=t,s=Qt(),u=c.useRef(null),l=ce.decorations(o,e),f=Z.findKey(s,o),h=[],p=0;p<l.length;p++){var g=l[p];h.push(c.createElement(Ey,{isLast:n&&p===l.length-1,key:"".concat(f.id,"-").concat(p),renderPlaceholder:i,leaf:g,text:o,parent:r,renderLeaf:a}))}var y=c.useCallback(v=>{var d=Kr.get(s);v?(d==null||d.set(f,v),bn.set(o,v),ir.set(v,o)):(d==null||d.delete(f),bn.delete(o),u.current&&ir.delete(u.current)),u.current=v},[u,s,f,o]);return c.createElement("span",{"data-slate-node":"text",ref:y},h)},Gl=c.memo(xy,(t,e)=>e.parent===t.parent&&e.isLast===t.isLast&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&e.text===t.text&&vy(e.decorations,t.decorations));function Yl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ka(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Yl(Object(n),!0).forEach(function(r){Pt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var By=t=>{var{decorations:e,element:n,renderElement:r=x=>c.createElement(Ay,ka({},x)),renderPlaceholder:i,renderLeaf:a,selection:o}=t,s=Qt(),u=Py(),l=s.isInline(n),f=Z.findKey(s,n),h=c.useCallback(x=>{var E=Kr.get(s);x?(E==null||E.set(f,x),bn.set(n,x),ir.set(x,n)):(E==null||E.delete(f),bn.delete(n))},[s,f,n]),p=Kl({decorations:e,node:n,renderElement:r,renderPlaceholder:i,renderLeaf:a,selection:o}),g={"data-slate-node":"element",ref:h};if(l&&(g["data-slate-inline"]=!0),!l&&m.hasInlines(s,n)){var y=ie.string(n),v=Yu(y);v==="rtl"&&(g.dir=v)}if(m.isVoid(s,n)){g["data-slate-void"]=!0,!u&&l&&(g.contentEditable=!1);var d=l?"span":"div",[[D]]=ie.texts(n);p=c.createElement(d,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},c.createElement(Gl,{renderPlaceholder:i,decorations:[],isLast:!1,parent:n,text:D})),ba.set(D,0),Ea.set(D,n)}return r({attributes:g,children:p,element:n})},Sy=c.memo(By,(t,e)=>t.element===e.element&&t.renderElement===e.renderElement&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&hy(t.decorations,e.decorations)&&(t.selection===e.selection||!!t.selection&&!!e.selection&&q.equals(t.selection,e.selection))),Ay=t=>{var{attributes:e,children:n,element:r}=t,i=Qt(),a=i.isInline(r)?"span":"div";return c.createElement(a,ka(ka({},e),{},{style:{position:"relative"}}),n)},Zl=c.createContext(()=>[]),Ly=()=>c.useContext(Zl),Oy=c.createContext(!1),Kl=t=>{for(var{decorations:e,node:n,renderElement:r,renderPlaceholder:i,renderLeaf:a,selection:o}=t,s=Ly(),u=Qt(),l=Z.findPath(u,n),f=[],h=le.isElement(n)&&!u.isInline(n)&&m.hasInlines(u,n),p=0;p<n.children.length;p++){var g=l.concat(p),y=n.children[p],v=Z.findKey(u,y),d=m.range(u,g),D=o&&q.intersection(d,o),x=s([y,g]);for(var E of e){var O=q.intersection(E,d);O&&x.push(O)}le.isElement(y)?f.push(c.createElement(Oy.Provider,{key:"provider-".concat(v.id),value:!!D},c.createElement(Sy,{decorations:x,element:y,key:v.id,renderElement:r,renderPlaceholder:i,renderLeaf:a,selection:D}))):f.push(c.createElement(Gl,{decorations:x,key:v.id,isLast:h&&p===n.children.length-1,parent:n,renderPlaceholder:i,renderLeaf:a,text:y})),ba.set(y,p),Ea.set(y,n)}return f},Xl=c.createContext(!1),Py=()=>c.useContext(Xl),Jl=c.createContext(null),Ta=()=>{var t=c.useContext(Jl);if(!t)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");var{editor:e}=t;return e};function My(){var t=Qt(),e=c.useRef(!1),n=c.useRef(0),r=c.useCallback(()=>{if(!e.current){e.current=!0;var i=Z.getWindow(t);i.cancelAnimationFrame(n.current),n.current=i.requestAnimationFrame(()=>{e.current=!1})}},[t]);return c.useEffect(()=>()=>cancelAnimationFrame(n.current),[]),{receivedUserInput:e,onUserInput:r}}var Fy=3,ky={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},Ty={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Ry={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ke=t=>{var e=ky[t],n=Ty[t],r=Ry[t],i=e&&Ki(e),a=n&&Ki(n),o=r&&Ki(r);return s=>!!(i&&i(s)||xl&&a&&a(s)||!xl&&o&&o(s))},Qe={isBold:Ke("bold"),isCompose:Ke("compose"),isMoveBackward:Ke("moveBackward"),isMoveForward:Ke("moveForward"),isDeleteBackward:Ke("deleteBackward"),isDeleteForward:Ke("deleteForward"),isDeleteLineBackward:Ke("deleteLineBackward"),isDeleteLineForward:Ke("deleteLineForward"),isDeleteWordBackward:Ke("deleteWordBackward"),isDeleteWordForward:Ke("deleteWordForward"),isExtendBackward:Ke("extendBackward"),isExtendForward:Ke("extendForward"),isExtendLineBackward:Ke("extendLineBackward"),isExtendLineForward:Ke("extendLineForward"),isItalic:Ke("italic"),isMoveLineBackward:Ke("moveLineBackward"),isMoveLineForward:Ke("moveLineForward"),isMoveWordBackward:Ke("moveWordBackward"),isMoveWordForward:Ke("moveWordForward"),isRedo:Ke("redo"),isSoftBreak:Ke("insertSoftBreak"),isSplitBlock:Ke("splitBlock"),isTransposeCharacter:Ke("transposeCharacter"),isUndo:Ke("undo")},Iy=(t,e)=>{var n=[],r=()=>{n=[]},i=o=>{if(e.current){var s=o.filter(u=>Oa(t,u,o));n.push(...s)}};function a(){n.length>0&&(n.reverse().forEach(o=>{o.type!=="characterData"&&(o.removedNodes.forEach(s=>{o.target.insertBefore(s,o.nextSibling)}),o.addedNodes.forEach(s=>{o.target.removeChild(s)}))}),r())}return{registerMutations:i,restoreDOM:a,clear:r}},jy={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class Ql extends c.Component{constructor(){super(...arguments),Pt(this,"context",null),Pt(this,"manager",null),Pt(this,"mutationObserver",null)}observe(){var e,{node:n}=this.props;if(!n.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");(e=this.mutationObserver)===null||e===void 0||e.observe(n.current,jy)}componentDidMount(){var{receivedUserInput:e}=this.props,n=this.context;this.manager=Iy(n,e),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var e,n,r,i=(e=this.mutationObserver)===null||e===void 0?void 0:e.takeRecords();if(i!=null&&i.length){var a;(a=this.manager)===null||a===void 0||a.registerMutations(i)}return(n=this.mutationObserver)===null||n===void 0||n.disconnect(),(r=this.manager)===null||r===void 0||r.restoreDOM(),null}componentDidUpdate(){var e;(e=this.manager)===null||e===void 0||e.clear(),this.observe()}componentWillUnmount(){var e;(e=this.mutationObserver)===null||e===void 0||e.disconnect()}render(){return this.props.children}}Pt(Ql,"contextType",ya);var Ny=vt?Ql:t=>{var{children:e}=t;return c.createElement(c.Fragment,null,e)},_y=c.createContext(!1),zy=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],Wy=["text"];function $l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function jt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$l(Object(n),!0).forEach(function(r){Pt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Uy=t=>c.createElement(c.Fragment,null,Kl(t)),Hy=c.forwardRef((t,e)=>{var n=c.useCallback(C=>c.createElement(Vy,jt({},C)),[]),{autoFocus:r,decorate:i=qy,onDOMBeforeInput:a,placeholder:o,readOnly:s=!1,renderElement:u,renderLeaf:l,renderPlaceholder:f=n,scrollSelectionIntoView:h=Gy,style:p={},as:g="div",disableDefaultStyles:y=!1}=t,v=kn(t,zy),d=Ta(),[D,x]=c.useState(!1),E=c.useRef(null),O=c.useRef([]),[b,w]=c.useState(),A=c.useRef(!1),{onUserInput:M,receivedUserInput:V}=My(),[,P]=c.useReducer(C=>C+1,0);Al.set(d,P),xa.set(d,s);var _=c.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);c.useEffect(()=>{E.current&&r&&E.current.focus()},[r]);var R=c.useRef(),N=c.useMemo(()=>n0(()=>{var C=Z.toDOMNode(d,d),U=C.getRootNode();if(!A.current&&Dn&&U instanceof ShadowRoot){A.current=!0;var W=V0();W?document.execCommand("indent"):ee.deselect(d),A.current=!1;return}var F=R.current;if((vt||!Z.isComposing(d))&&(!_.isUpdatingSelection||F!=null&&F.isFlushing())&&!_.isDraggingInternally){var J=Z.findDocumentOrShadowRoot(d),{activeElement:ne}=J,Y=Z.toDOMNode(d,d),ue=or(J);if(ne===Y?(_.latestElement=ne,en.set(d,!0)):en.delete(d),!ue)return ee.deselect(d);var{anchorNode:ae,focusNode:de}=ue,pe=Z.hasEditableTarget(d,ae)||Z.isTargetInsideNonReadonlyVoid(d,ae),Ce=Z.hasTarget(d,de);if(pe&&Ce){var ye=Z.toSlateRange(d,ue,{exactMatch:!1,suppressThrow:!0});ye&&(!Z.isComposing(d)&&!(F!=null&&F.hasPendingChanges())&&!(F!=null&&F.isFlushing())?ee.select(d,ye):F==null||F.handleUserSelect(ye))}s&&(!pe||!Ce)&&ee.deselect(d)}},100),[d,s,_]),T=c.useMemo(()=>Xm(N,0),[N]);R.current=cy({node:E,onDOMSelectionChange:N,scheduleOnDOMSelectionChange:T}),sr(()=>{var C,U,W;E.current&&(W=Aa(E.current))?(Sl.set(d,W),Yr.set(d,E.current),bn.set(d,E.current),ir.set(E.current,d)):bn.delete(d);var{selection:F}=d,J=Z.findDocumentOrShadowRoot(d),ne=or(J);if(!(!ne||!Z.isFocused(d)||(C=R.current)!==null&&C!==void 0&&C.hasPendingAction())){var Y=pe=>{var Ce=ne.type!=="None";if(!(!F&&!Ce)){var ye=ne.focusNode,ge;if(Tn&&ne.rangeCount>1){var ve=ne.getRangeAt(0),Ne=ne.getRangeAt(ne.rangeCount-1);ve.startContainer===ye?ge=Ne.endContainer:ge=ve.startContainer}else ge=ne.anchorNode;var se=Yr.get(d),_e=!1;if(se.contains(ge)&&se.contains(ye)&&(_e=!0),Ce&&_e&&F&&!pe){var fe=Z.toSlateRange(d,ne,{exactMatch:!0,suppressThrow:!0});if(fe&&q.equals(fe,F)){var we;if(!_.hasMarkPlaceholder||(we=ge)!==null&&we!==void 0&&(we=we.parentElement)!==null&&we!==void 0&&we.hasAttribute("data-slate-mark-placeholder"))return}}if(F&&!Z.hasRange(d,F)){d.selection=Z.toSlateRange(d,ne,{exactMatch:!1,suppressThrow:!0});return}_.isUpdatingSelection=!0;var ke=F&&Z.toDOMRange(d,F);return ke?(Z.isComposing(d)&&!vt?ne.collapseToEnd():q.isBackward(F)?ne.setBaseAndExtent(ke.endContainer,ke.endOffset,ke.startContainer,ke.startOffset):ne.setBaseAndExtent(ke.startContainer,ke.startOffset,ke.endContainer,ke.endOffset),h(d,ke)):ne.removeAllRanges(),ke}};ne.rangeCount<=1&&Y();var ue=((U=R.current)===null||U===void 0?void 0:U.isFlushing())==="action";if(!vt||!ue){setTimeout(()=>{_.isUpdatingSelection=!1});return}var ae=null,de=requestAnimationFrame(()=>{if(ue){var pe=Ce=>{try{var ye=Z.toDOMNode(d,d);ye.focus(),Y(Ce)}catch{}};pe(),ae=setTimeout(()=>{pe(!0),_.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(de),ae&&clearTimeout(ae)}}});var j=c.useCallback(C=>{var U=Z.toDOMNode(d,d),W=U.getRootNode();if(A!=null&&A.current&&Dn&&W instanceof ShadowRoot){var F=C.getTargetRanges(),J=F[0],ne=new window.Range;ne.setStart(J.startContainer,J.startOffset),ne.setEnd(J.endContainer,J.endOffset);var Y=Z.toSlateRange(d,ne,{exactMatch:!1,suppressThrow:!1});ee.select(d,Y),C.preventDefault(),C.stopImmediatePropagation();return}if(M(),!s&&Z.hasEditableTarget(d,C.target)&&!Yy(C,a)){var ue;if(R.current)return R.current.handleDOMBeforeInput(C);T.flush(),N.flush();var{selection:ae}=d,{inputType:de}=C,pe=C.dataTransfer||C.data||void 0,Ce=de==="insertCompositionText"||de==="deleteCompositionText";if(Ce&&Z.isComposing(d))return;var ye=!1;if(de==="insertText"&&ae&&q.isCollapsed(ae)&&C.data&&C.data.length===1&&/[a-z ]/i.test(C.data)&&ae.anchor.offset!==0){var ge,ve;ye=!0,d.marks&&(ye=!1);var{anchor:Ne}=ae,[se,_e]=Z.toDOMPoint(d,Ne),fe=(ge=se.parentElement)===null||ge===void 0?void 0:ge.closest("a"),we=Z.getWindow(d);if(ye&&fe&&Z.hasDOMNode(d,fe)){var ke,Ve=we==null?void 0:we.document.createTreeWalker(fe,NodeFilter.SHOW_TEXT).lastChild();Ve===se&&((ke=Ve.textContent)===null||ke===void 0?void 0:ke.length)===_e&&(ye=!1)}if(ye&&se.parentElement&&(we==null||(ve=we.getComputedStyle(se.parentElement))===null||ve===void 0?void 0:ve.whiteSpace)==="pre"){var Ye=m.above(d,{at:Ne.path,match:Lt=>le.isElement(Lt)&&m.isBlock(d,Lt)});Ye&&ie.string(Ye[0]).includes(" ")&&(ye=!1)}}if(!de.startsWith("delete")||de.startsWith("deleteBy")){var[Ee]=C.getTargetRanges();if(Ee){var ct=Z.toSlateRange(d,Ee,{exactMatch:!1,suppressThrow:!1});if(!ae||!q.equals(ae,ct)){ye=!1;var st=!Ce&&d.selection&&m.rangeRef(d,d.selection);ee.select(d,ct),st&&ar.set(d,st)}}}if(Ce)return;if(ye||C.preventDefault(),ae&&q.isExpanded(ae)&&de.startsWith("delete")){var Tt=de.endsWith("Backward")?"backward":"forward";m.deleteFragment(d,{direction:Tt});return}switch(de){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":{m.deleteFragment(d);break}case"deleteContent":case"deleteContentForward":{m.deleteForward(d);break}case"deleteContentBackward":{m.deleteBackward(d);break}case"deleteEntireSoftLine":{m.deleteBackward(d,{unit:"line"}),m.deleteForward(d,{unit:"line"});break}case"deleteHardLineBackward":{m.deleteBackward(d,{unit:"block"});break}case"deleteSoftLineBackward":{m.deleteBackward(d,{unit:"line"});break}case"deleteHardLineForward":{m.deleteForward(d,{unit:"block"});break}case"deleteSoftLineForward":{m.deleteForward(d,{unit:"line"});break}case"deleteWordBackward":{m.deleteBackward(d,{unit:"word"});break}case"deleteWordForward":{m.deleteForward(d,{unit:"word"});break}case"insertLineBreak":m.insertSoftBreak(d);break;case"insertParagraph":{m.insertBreak(d);break}case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":{de==="insertFromComposition"&&Z.isComposing(d)&&(x(!1),En.set(d,!1)),(pe==null?void 0:pe.constructor.name)==="DataTransfer"?Z.insertData(d,pe):typeof pe=="string"&&(ye?O.current.push(()=>m.insertText(d,pe)):m.insertText(d,pe));break}}var yt=(ue=ar.get(d))===null||ue===void 0?void 0:ue.unref();ar.delete(d),yt&&(!d.selection||!q.equals(d.selection,yt))&&ee.select(d,yt)}},[d,N,M,a,s,T]),X=c.useCallback(C=>{C==null?(N.cancel(),T.cancel(),Yr.delete(d),bn.delete(d),E.current&&$t&&E.current.removeEventListener("beforeinput",j)):$t&&C.addEventListener("beforeinput",j),E.current=C,typeof e=="function"?e(C):e&&(e.current=C)},[N,T,d,j,e]);sr(()=>{var C=Z.getWindow(d);C.document.addEventListener("selectionchange",T);var U=()=>{_.isDraggingInternally=!1};return C.document.addEventListener("dragend",U),C.document.addEventListener("drop",U),()=>{C.document.removeEventListener("selectionchange",T),C.document.removeEventListener("dragend",U),C.document.removeEventListener("drop",U)}},[T,_]);var z=i([d,[]]),$=o&&d.children.length===1&&Array.from(ie.texts(d)).length===1&&ie.string(d)===""&&!D,re=c.useCallback(C=>{if(C&&$){var U;w((U=C.getBoundingClientRect())===null||U===void 0?void 0:U.height)}else w(void 0)},[$]);if($){var k=m.start(d,[]);z.push({[Rn]:!0,placeholder:o,onPlaceholderResize:re,anchor:k,focus:k})}var{marks:I}=d;if(_.hasMarkPlaceholder=!1,d.selection&&q.isCollapsed(d.selection)&&I){var{anchor:G}=d.selection,H=ie.leaf(d,G.path),Q=kn(H,Wy);if(!ce.equals(H,I,{loose:!0})){_.hasMarkPlaceholder=!0;var K=Object.fromEntries(Object.keys(Q).map(C=>[C,null]));z.push(jt(jt(jt({[Ll]:!0},K),I),{},{anchor:G,focus:G}))}}return c.useEffect(()=>{setTimeout(()=>{var{selection:C}=d;if(C){var{anchor:U}=C,W=ie.leaf(d,U.path);if(I&&!ce.equals(W,I,{loose:!0})){Ft.set(d,I);return}}Ft.delete(d)})}),c.createElement(Xl.Provider,{value:s},c.createElement(_y.Provider,{value:D},c.createElement(Zl.Provider,{value:i},c.createElement(Ny,{node:E,receivedUserInput:V},c.createElement(g,jt(jt({role:s?void 0:"textbox","aria-multiline":s?void 0:!0},v),{},{spellCheck:$t||!Gr?v.spellCheck:!1,autoCorrect:$t||!Gr?v.autoCorrect:"false",autoCapitalize:$t||!Gr?v.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!s,zindex:-1,suppressContentEditableWarning:!0,ref:X,style:jt(jt({},y?{}:jt({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},b?{minHeight:b}:{})),p),onBeforeInput:c.useCallback(C=>{if(!$t&&!s&&!gt(C,v.onBeforeInput)&&Z.hasSelectableTarget(d,C.target)&&(C.preventDefault(),!Z.isComposing(d))){var U=C.data;m.insertText(d,U)}},[v.onBeforeInput,d,s]),onInput:c.useCallback(C=>{if(!gt(C,v.onInput)){if(R.current){R.current.handleInput();return}for(var U of O.current)U();O.current=[]}},[v.onInput]),onBlur:c.useCallback(C=>{if(!(s||_.isUpdatingSelection||!Z.hasSelectableTarget(d,C.target)||gt(C,v.onBlur))){var U=Z.findDocumentOrShadowRoot(d);if(_.latestElement!==U.activeElement){var{relatedTarget:W}=C,F=Z.toDOMNode(d,d);if(W!==F&&!(Mt(W)&&W.hasAttribute("data-slate-spacer"))){if(W!=null&&rn(W)&&Z.hasDOMNode(d,W)){var J=Z.toSlateNode(d,W);if(le.isElement(J)&&!d.isVoid(J))return}if(Dn){var ne=or(U);ne==null||ne.removeAllRanges()}en.delete(d)}}}},[s,_.isUpdatingSelection,_.latestElement,d,v.onBlur]),onClick:c.useCallback(C=>{if(Z.hasTarget(d,C.target)&&!gt(C,v.onClick)&&rn(C.target)){var U=Z.toSlateNode(d,C.target),W=Z.findPath(d,U);if(!m.hasPath(d,W)||ie.get(d,W)!==U)return;if(C.detail===Fy&&W.length>=1){var F=W;if(!(le.isElement(U)&&m.isBlock(d,U))){var J,ne=m.above(d,{match:ye=>le.isElement(ye)&&m.isBlock(d,ye),at:W});F=(J=ne==null?void 0:ne[1])!==null&&J!==void 0?J:W.slice(0,1)}var Y=m.range(d,F);ee.select(d,Y);return}if(s)return;var ue=m.start(d,W),ae=m.end(d,W),de=m.void(d,{at:ue}),pe=m.void(d,{at:ae});if(de&&pe&&L.equals(de[1],pe[1])){var Ce=m.range(d,ue);ee.select(d,Ce)}}},[d,v.onClick,s]),onCompositionEnd:c.useCallback(C=>{if(Z.hasSelectableTarget(d,C.target)){var U;if(Z.isComposing(d)&&Promise.resolve().then(()=>{x(!1),En.set(d,!1)}),(U=R.current)===null||U===void 0||U.handleCompositionEnd(C),gt(C,v.onCompositionEnd)||vt)return;if(!Dn&&!k0&&!wl&&!R0&&!T0&&C.data){var W=Ft.get(d);Ft.delete(d),W!==void 0&&(Vt.set(d,d.marks),d.marks=W),m.insertText(d,C.data);var F=Vt.get(d);Vt.delete(d),F!==void 0&&(d.marks=F)}}},[v.onCompositionEnd,d]),onCompositionUpdate:c.useCallback(C=>{Z.hasSelectableTarget(d,C.target)&&!gt(C,v.onCompositionUpdate)&&(Z.isComposing(d)||(x(!0),En.set(d,!0)))},[v.onCompositionUpdate,d]),onCompositionStart:c.useCallback(C=>{if(Z.hasSelectableTarget(d,C.target)){var U;if((U=R.current)===null||U===void 0||U.handleCompositionStart(C),gt(C,v.onCompositionStart)||vt)return;x(!0);var{selection:W}=d;if(W&&q.isExpanded(W)){m.deleteFragment(d);return}}},[v.onCompositionStart,d]),onCopy:c.useCallback(C=>{Z.hasSelectableTarget(d,C.target)&&!gt(C,v.onCopy)&&!ec(C)&&(C.preventDefault(),Z.setFragmentData(d,C.clipboardData,"copy"))},[v.onCopy,d]),onCut:c.useCallback(C=>{if(!s&&Z.hasSelectableTarget(d,C.target)&&!gt(C,v.onCut)&&!ec(C)){C.preventDefault(),Z.setFragmentData(d,C.clipboardData,"cut");var{selection:U}=d;if(U)if(q.isExpanded(U))m.deleteFragment(d);else{var W=ie.parent(d,U.anchor.path);m.isVoid(d,W)&&ee.delete(d)}}},[s,d,v.onCut]),onDragOver:c.useCallback(C=>{if(Z.hasTarget(d,C.target)&&!gt(C,v.onDragOver)){var U=Z.toSlateNode(d,C.target);le.isElement(U)&&m.isVoid(d,U)&&C.preventDefault()}},[v.onDragOver,d]),onDragStart:c.useCallback(C=>{if(!s&&Z.hasTarget(d,C.target)&&!gt(C,v.onDragStart)){var U=Z.toSlateNode(d,C.target),W=Z.findPath(d,U),F=le.isElement(U)&&m.isVoid(d,U)||m.void(d,{at:W,voids:!0});if(F){var J=m.range(d,W);ee.select(d,J)}_.isDraggingInternally=!0,Z.setFragmentData(d,C.dataTransfer,"drag")}},[s,d,v.onDragStart,_]),onDrop:c.useCallback(C=>{if(!s&&Z.hasTarget(d,C.target)&&!gt(C,v.onDrop)){C.preventDefault();var U=d.selection,W=Z.findEventRange(d,C),F=C.dataTransfer;ee.select(d,W),_.isDraggingInternally&&U&&!q.equals(U,W)&&!m.void(d,{at:W,voids:!0})&&ee.delete(d,{at:U}),Z.insertData(d,F),Z.isFocused(d)||Z.focus(d)}},[s,d,v.onDrop,_]),onDragEnd:c.useCallback(C=>{!s&&_.isDraggingInternally&&v.onDragEnd&&Z.hasTarget(d,C.target)&&v.onDragEnd(C)},[s,_,v,d]),onFocus:c.useCallback(C=>{if(!s&&!_.isUpdatingSelection&&Z.hasEditableTarget(d,C.target)&&!gt(C,v.onFocus)){var U=Z.toDOMNode(d,d),W=Z.findDocumentOrShadowRoot(d);if(_.latestElement=W.activeElement,Tn&&C.target!==U){U.focus();return}en.set(d,!0)}},[s,_,d,v.onFocus]),onKeyDown:c.useCallback(C=>{if(!s&&Z.hasEditableTarget(d,C.target)){var U;(U=R.current)===null||U===void 0||U.handleKeyDown(C);var{nativeEvent:W}=C;if(Z.isComposing(d)&&W.isComposing===!1&&(En.set(d,!1),x(!1)),gt(C,v.onKeyDown)||Z.isComposing(d))return;var{selection:F}=d,J=d.children[F!==null?F.focus.path[0]:0],ne=Yu(ie.string(J))==="rtl";if(Qe.isRedo(W)){C.preventDefault();var Y=d;typeof Y.redo=="function"&&Y.redo();return}if(Qe.isUndo(W)){C.preventDefault();var ue=d;typeof ue.undo=="function"&&ue.undo();return}if(Qe.isMoveLineBackward(W)){C.preventDefault(),ee.move(d,{unit:"line",reverse:!0});return}if(Qe.isMoveLineForward(W)){C.preventDefault(),ee.move(d,{unit:"line"});return}if(Qe.isExtendLineBackward(W)){C.preventDefault(),ee.move(d,{unit:"line",edge:"focus",reverse:!0});return}if(Qe.isExtendLineForward(W)){C.preventDefault(),ee.move(d,{unit:"line",edge:"focus"});return}if(Qe.isMoveBackward(W)){C.preventDefault(),F&&q.isCollapsed(F)?ee.move(d,{reverse:!ne}):ee.collapse(d,{edge:ne?"end":"start"});return}if(Qe.isMoveForward(W)){C.preventDefault(),F&&q.isCollapsed(F)?ee.move(d,{reverse:ne}):ee.collapse(d,{edge:ne?"start":"end"});return}if(Qe.isMoveWordBackward(W)){C.preventDefault(),F&&q.isExpanded(F)&&ee.collapse(d,{edge:"focus"}),ee.move(d,{unit:"word",reverse:!ne});return}if(Qe.isMoveWordForward(W)){C.preventDefault(),F&&q.isExpanded(F)&&ee.collapse(d,{edge:"focus"}),ee.move(d,{unit:"word",reverse:ne});return}if($t){if((Bl||Dn)&&F&&(Qe.isDeleteBackward(W)||Qe.isDeleteForward(W))&&q.isCollapsed(F)){var ae=ie.parent(d,F.anchor.path);if(le.isElement(ae)&&m.isVoid(d,ae)&&(m.isInline(d,ae)||m.isBlock(d,ae))){C.preventDefault(),m.deleteBackward(d,{unit:"block"});return}}}else{if(Qe.isBold(W)||Qe.isItalic(W)||Qe.isTransposeCharacter(W)){C.preventDefault();return}if(Qe.isSoftBreak(W)){C.preventDefault(),m.insertSoftBreak(d);return}if(Qe.isSplitBlock(W)){C.preventDefault(),m.insertBreak(d);return}if(Qe.isDeleteBackward(W)){C.preventDefault(),F&&q.isExpanded(F)?m.deleteFragment(d,{direction:"backward"}):m.deleteBackward(d);return}if(Qe.isDeleteForward(W)){C.preventDefault(),F&&q.isExpanded(F)?m.deleteFragment(d,{direction:"forward"}):m.deleteForward(d);return}if(Qe.isDeleteLineBackward(W)){C.preventDefault(),F&&q.isExpanded(F)?m.deleteFragment(d,{direction:"backward"}):m.deleteBackward(d,{unit:"line"});return}if(Qe.isDeleteLineForward(W)){C.preventDefault(),F&&q.isExpanded(F)?m.deleteFragment(d,{direction:"forward"}):m.deleteForward(d,{unit:"line"});return}if(Qe.isDeleteWordBackward(W)){C.preventDefault(),F&&q.isExpanded(F)?m.deleteFragment(d,{direction:"backward"}):m.deleteBackward(d,{unit:"word"});return}if(Qe.isDeleteWordForward(W)){C.preventDefault(),F&&q.isExpanded(F)?m.deleteFragment(d,{direction:"forward"}):m.deleteForward(d,{unit:"word"});return}}}},[s,d,v.onKeyDown]),onPaste:c.useCallback(C=>{!s&&Z.hasEditableTarget(d,C.target)&&!gt(C,v.onPaste)&&(!$t||N0(C.nativeEvent)||Dn)&&(C.preventDefault(),Z.insertData(d,C.clipboardData))},[s,d,v.onPaste])}),c.createElement(Uy,{decorations:z,node:d,renderElement:u,renderPlaceholder:f,renderLeaf:l,selection:d.selection}))))))}),Vy=t=>{var{attributes:e,children:n}=t;return c.createElement("span",jt({},e),n,vt&&c.createElement("br",null))},qy=()=>[],Gy=(t,e)=>{if(e.getBoundingClientRect&&(!t.selection||t.selection&&q.isCollapsed(t.selection))){var n=e.startContainer.parentElement;n.getBoundingClientRect=e.getBoundingClientRect.bind(e),a0(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},gt=(t,e)=>{if(!e)return!1;var n=e(t);return n??(t.isDefaultPrevented()||t.isPropagationStopped())},ec=t=>rn(t.target)&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement),Yy=(t,e)=>{if(!e)return!1;var n=e(t);return n??t.defaultPrevented},Zy=c.createContext(!1),Ky=c.createContext({});function Xy(t){var e=c.useRef([]).current,n=c.useRef({editor:t}).current,r=c.useCallback(a=>{n.editor=a,e.forEach(o=>o(a))},[e,n]),i=c.useMemo(()=>({getSlate:()=>n.editor,addEventListener:a=>(e.push(a),()=>{e.splice(e.indexOf(a),1)})}),[e,n]);return{selectorContext:i,onChange:r}}var Jy=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],Qy=t=>{var{editor:e,children:n,onChange:r,onSelectionChange:i,onValueChange:a,initialValue:o}=t,s=kn(t,Jy),[u,l]=c.useState(()=>{if(!ie.isNodeList(o))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(lt.stringify(o)));if(!m.isEditor(e))throw new Error("[Slate] editor is invalid! You passed: ".concat(lt.stringify(e)));return e.children=o,Object.assign(e,s),{v:0,editor:e}}),{selectorContext:f,onChange:h}=Xy(e),p=c.useCallback(v=>{var d;switch(r&&r(e.children),v==null||(d=v.operation)===null||d===void 0?void 0:d.type){case"set_selection":i==null||i(e.selection);break;default:a==null||a(e.children)}l(D=>({v:D.v+1,editor:e})),h(e)},[e,h,r,i,a]);c.useEffect(()=>(Ba.set(e,p),()=>{Ba.set(e,()=>{})}),[e,p]);var[g,y]=c.useState(Z.isFocused(e));return c.useEffect(()=>{y(Z.isFocused(e))},[e]),sr(()=>{var v=()=>y(Z.isFocused(e));return El>=17?(document.addEventListener("focusin",v),document.addEventListener("focusout",v),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",v)}):(document.addEventListener("focus",v,!0),document.addEventListener("blur",v,!0),()=>{document.removeEventListener("focus",v,!0),document.removeEventListener("blur",v,!0)})},[]),c.createElement(Ky.Provider,{value:f},c.createElement(Jl.Provider,{value:u},c.createElement(ya.Provider,{value:u.editor},c.createElement(Zy.Provider,{value:g},n))))},tc=(t,e)=>{var n=(e.top+e.bottom)/2;return t.top<=n&&t.bottom>=n},nc=(t,e,n)=>{var r=Z.toDOMRange(t,e).getBoundingClientRect(),i=Z.toDOMRange(t,n).getBoundingClientRect();return tc(r,i)&&tc(i,r)},$y=(t,e)=>{var n=m.range(t,q.end(e)),r=Array.from(m.positions(t,{at:e})),i=0,a=r.length,o=Math.floor(a/2);if(nc(t,m.range(t,r[i]),n))return m.range(t,r[i],n);if(r.length<2)return m.range(t,r[r.length-1],n);for(;o!==r.length&&o!==i;)nc(t,m.range(t,r[o]),n)?a=o:i=o,o=Math.floor((i+a)/2);return m.range(t,r[a],n)};function rc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ic(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?rc(Object(n),!0).forEach(function(r){Pt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rc(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var eC=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x-slate-fragment",r=e,{apply:i,onChange:a,deleteBackward:o,addMark:s,removeMark:u}=r;return Kr.set(r,new WeakMap),r.addMark=(l,f)=>{var h,p;(h=Sa.get(r))===null||h===void 0||h(),!Ft.get(r)&&(p=bt.get(r))!==null&&p!==void 0&&p.length&&Ft.set(r,null),Vt.delete(r),s(l,f)},r.removeMark=l=>{var f;!Ft.get(r)&&(f=bt.get(r))!==null&&f!==void 0&&f.length&&Ft.set(r,null),Vt.delete(r),u(l)},r.deleteBackward=l=>{if(l!=="line")return o(l);if(r.selection&&q.isCollapsed(r.selection)){var f=m.above(r,{match:y=>le.isElement(y)&&m.isBlock(r,y),at:r.selection});if(f){var[,h]=f,p=m.range(r,h,r.selection.anchor),g=$y(r,p);q.isCollapsed(g)||ee.delete(r,{at:g})}}},r.apply=l=>{var f=[],h=[],p=bt.get(r);if(p!=null&&p.length){var g=p.map(T=>$0(T,l)).filter(Boolean);bt.set(r,g)}var y=nn.get(r);y&&nn.set(r,jl(r,y,l));var v=tn.get(r);if(v!=null&&v.at){var d=Le.isPoint(v==null?void 0:v.at)?Ma(r,v.at,l):jl(r,v.at,l);tn.set(r,d?ic(ic({},v),{},{at:d}):null)}switch(l.type){case"insert_text":case"remove_text":case"set_node":case"split_node":{f.push(...In(r,l.path));break}case"set_selection":{var D;(D=ar.get(r))===null||D===void 0||D.unref(),ar.delete(r);break}case"insert_node":case"remove_node":{f.push(...In(r,L.parent(l.path)));break}case"merge_node":{var x=L.previous(l.path);f.push(...In(r,x));break}case"move_node":{var E=L.common(L.parent(l.path),L.parent(l.newPath));f.push(...In(r,E));var O;L.isBefore(l.path,l.newPath)?(f.push(...In(r,L.parent(l.path))),O=l.newPath):(f.push(...In(r,L.parent(l.newPath))),O=l.path);var b=ie.get(e,L.parent(O)),w=Z.findKey(r,b),A=m.pathRef(r,L.parent(O));h.push([A,w]);break}}i(l);for(var[M,V]of f){var[P]=m.node(r,M);Zr.set(P,V)}for(var[_,R]of h)if(_.current){var[N]=m.node(r,_.current);Zr.set(N,R)}},r.setFragmentData=l=>{var{selection:f}=r;if(f){var[h,p]=q.edges(f),g=m.void(r,{at:h.path}),y=m.void(r,{at:p.path});if(!(q.isCollapsed(f)&&!g)){var v=Z.toDOMRange(r,f),d=v.cloneContents(),D=d.childNodes[0];if(d.childNodes.forEach(P=>{P.textContent&&P.textContent.trim()!==""&&(D=P)}),y){var[x]=y,E=v.cloneRange(),O=Z.toDOMNode(r,x);E.setEndAfter(O),d=E.cloneContents()}if(g&&(D=d.querySelector("[data-slate-spacer]")),Array.from(d.querySelectorAll("[data-slate-zero-width]")).forEach(P=>{var _=P.getAttribute("data-slate-zero-width")==="n";P.textContent=_?`
91
91
  `:""}),Pl(D)){var b=D.ownerDocument.createElement("span");b.style.whiteSpace="pre",b.appendChild(D),d.appendChild(b),D=b}var w=r.getFragment(),A=JSON.stringify(w),M=window.btoa(encodeURIComponent(A));D.setAttribute("data-slate-fragment",M),l.setData("application/".concat(n),M);var V=d.ownerDocument.createElement("div");return V.appendChild(d),V.setAttribute("hidden","true"),d.ownerDocument.body.appendChild(V),l.setData("text/html",V.innerHTML),l.setData("text/plain",Fl(V)),d.ownerDocument.body.removeChild(V),l}}},r.insertData=l=>{r.insertFragmentData(l)||r.insertTextData(l)},r.insertFragmentData=l=>{var f=l.getData("application/".concat(n))||H0(l);if(f){var h=decodeURIComponent(window.atob(f)),p=JSON.parse(h);return r.insertFragment(p),!0}return!1},r.insertTextData=l=>{var f=l.getData("text/plain");if(f){var h=f.split(/\r\n|\r|\n/),p=!1;for(var g of h)p&&ee.splitNodes(r,{always:!0}),r.insertText(g),p=!0;return!0}return!1},r.onChange=l=>{var f=El<18?Yt.unstable_batchedUpdates:h=>h();f(()=>{var h=Ba.get(r);h&&h(l),a(l)})},r},In=(t,e)=>{var n=[];for(var[r,i]of m.levels(t,{at:e})){var a=Z.findKey(t,r);n.push([i,a])}return n};function ac(t,e,n="type"){const{selection:r}=t;if(!r)return!1;const[i]=Array.from(m.nodes(t,{at:m.unhangRange(t,r),match:a=>!m.isEditor(a)&&le.isElement(a)&&a[n]===e}));return!!i}const oc=["listItem","numberedList"],Jr=["left","center","right","justify"];function tC(t,e){const n=Jr.includes(e)?"align":"type",r=ac(t,e,n),i=oc.includes(e);ee.unwrapNodes(t,{match:o=>!m.isEditor(o)&&le.isElement(o)&&oc.includes(o.type)&&!Jr.includes(e),split:!0});let a;if(Jr.includes(e)?a={align:r?void 0:e}:a={type:r?"paragraph":i?"listItem":e},ee.setNodes(t,a),!r&&i){const o={type:e,children:[]};ee.wrapNodes(t,o)}}function wn({format:t,icon:e}){const n=Ta(),r=Jr.includes(t)?"align":"type",a=ac(n,t,r)?"activeTrue":"activeFalse";function o(s){s.preventDefault(),tC(n,t)}return B.jsx("button",{type:"button",className:"arkynRichTextBlockButton "+a,onMouseDown:o,children:B.jsx(e,{})})}function nC({attributes:t,children:e,element:n}){const r={textAlign:n.align};switch(n.type){case"blockQuote":return B.jsx("blockquote",{className:"arkynElementBlockquote",style:r,...t,children:e});case"bulletedList":return B.jsx("ul",{className:"arkynElementBulletList",style:r,...t,children:e});case"headingOne":return B.jsx("h1",{className:"arkynElementHeadingOne",style:r,...t,children:e});case"headingTwo":return B.jsx("h2",{className:"arkynElementHeadingTwo",style:r,...t,children:e});case"listItem":return B.jsx("li",{className:"arkynElementListItem",style:r,...t,children:e});case"numberedList":return B.jsx("ol",{className:"arkynElementNumberedList",style:r,...t,children:e});default:return B.jsx("p",{className:"arkynElementParagraph",style:r,...t,children:e})}}function rC({attributes:t,children:e,leaf:n}){return n.bold&&(e=B.jsx("strong",{children:e})),n.code&&(e=B.jsx("code",{children:e})),n.italic&&(e=B.jsx("em",{children:e})),n.underline&&(e=B.jsx("u",{children:e})),B.jsx("span",{...t,children:e})}function sc(t,e){const n=m.marks(t);return n?n[e]===!0:!1}function uc(t,e){sc(t,e)?m.removeMark(t,e):m.addMark(t,e,!0)}function Qr({format:t,icon:e}){const n=Ta(),i=sc(n,t)?"activeTrue":"activeFalse";function a(o){o.preventDefault(),uc(n,t)}return B.jsx("button",{type:"button",className:"arkynRichTextMarkButton "+i,onMouseDown:a,children:B.jsx(e,{})})}function iC({children:t}){return B.jsx("div",{className:"arkynRichTextToolbar",children:t})}const lc={"mod+b":"bold","mod+i":"italic","mod+u":"underline","mod+`":"code"},aC=[{type:"paragraph",children:[{text:""}]}];var cc={},Ra={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.default=lC;var fc="html",dc="head",$r="body",oC=/<([a-zA-Z]+[0-9]?)/,pc=/<head[^]*>/i,hc=/<body[^]*>/i,ei=function(t,e){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},ja=function(t,e){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},vc=typeof window=="object"&&window.DOMParser;if(typeof vc=="function"){var sC=new vc,uC="text/html";ja=function(t,e){return e&&(t="<".concat(e,">").concat(t,"</").concat(e,">")),sC.parseFromString(t,uC)},ei=ja}if(typeof document=="object"&&document.implementation){var ti=document.implementation.createHTMLDocument();ei=function(t,e){if(e){var n=ti.documentElement.querySelector(e);return n&&(n.innerHTML=t),ti}return ti.documentElement.innerHTML=t,ti}}var ni=typeof document=="object"&&document.createElement("template"),Na;ni&&ni.content&&(Na=function(t){return ni.innerHTML=t,ni.content.childNodes});function lC(t){var e,n,r=t.match(oC),i=r&&r[1]?r[1].toLowerCase():"";switch(i){case fc:{var a=ja(t);if(!pc.test(t)){var o=a.querySelector(dc);(e=o==null?void 0:o.parentNode)===null||e===void 0||e.removeChild(o)}if(!hc.test(t)){var o=a.querySelector($r);(n=o==null?void 0:o.parentNode)===null||n===void 0||n.removeChild(o)}return a.querySelectorAll(fc)}case dc:case $r:{var s=ei(t).querySelectorAll(i);return hc.test(t)&&pc.test(t)?s[0].parentNode.childNodes:s}default:{if(Na)return Na(t);var o=ei(t,$r).querySelector($r);return o.childNodes}}}var ri={},_a={},za={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0;var e;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(e=t.ElementType||(t.ElementType={}));function n(r){return r.type===e.Tag||r.type===e.Script||r.type===e.Style}t.isTag=n,t.Root=e.Root,t.Text=e.Text,t.Directive=e.Directive,t.Comment=e.Comment,t.Script=e.Script,t.Style=e.Style,t.Tag=e.Tag,t.CDATA=e.CDATA,t.Doctype=e.Doctype})(za);var Fe={},an=qe&&qe.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ur=qe&&qe.__assign||function(){return ur=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ur.apply(this,arguments)};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.cloneNode=Fe.hasChildren=Fe.isDocument=Fe.isDirective=Fe.isComment=Fe.isText=Fe.isCDATA=Fe.isTag=Fe.Element=Fe.Document=Fe.CDATA=Fe.NodeWithChildren=Fe.ProcessingInstruction=Fe.Comment=Fe.Text=Fe.DataNode=Fe.Node=void 0;var Et=za,Wa=function(){function t(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),t.prototype.cloneNode=function(e){return e===void 0&&(e=!1),Ua(this,e)},t}();Fe.Node=Wa;var ii=function(t){an(e,t);function e(n){var r=t.call(this)||this;return r.data=n,r}return Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.data},set:function(n){this.data=n},enumerable:!1,configurable:!0}),e}(Wa);Fe.DataNode=ii;var gc=function(t){an(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=Et.ElementType.Text,n}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),e}(ii);Fe.Text=gc;var mc=function(t){an(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=Et.ElementType.Comment,n}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),e}(ii);Fe.Comment=mc;var yc=function(t){an(e,t);function e(n,r){var i=t.call(this,r)||this;return i.name=n,i.type=Et.ElementType.Directive,i}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),e}(ii);Fe.ProcessingInstruction=yc;var ai=function(t){an(e,t);function e(n){var r=t.call(this)||this;return r.children=n,r}return Object.defineProperty(e.prototype,"firstChild",{get:function(){var n;return(n=this.children[0])!==null&&n!==void 0?n:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.children},set:function(n){this.children=n},enumerable:!1,configurable:!0}),e}(Wa);Fe.NodeWithChildren=ai;var Cc=function(t){an(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=Et.ElementType.CDATA,n}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),e}(ai);Fe.CDATA=Cc;var Dc=function(t){an(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=Et.ElementType.Root,n}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),e}(ai);Fe.Document=Dc;var bc=function(t){an(e,t);function e(n,r,i,a){i===void 0&&(i=[]),a===void 0&&(a=n==="script"?Et.ElementType.Script:n==="style"?Et.ElementType.Style:Et.ElementType.Tag);var o=t.call(this,i)||this;return o.name=n,o.attribs=r,o.type=a,o}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.name},set:function(n){this.name=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){var n=this;return Object.keys(this.attribs).map(function(r){var i,a;return{name:r,value:n.attribs[r],namespace:(i=n["x-attribsNamespace"])===null||i===void 0?void 0:i[r],prefix:(a=n["x-attribsPrefix"])===null||a===void 0?void 0:a[r]}})},enumerable:!1,configurable:!0}),e}(ai);Fe.Element=bc;function Ec(t){return(0,Et.isTag)(t)}Fe.isTag=Ec;function wc(t){return t.type===Et.ElementType.CDATA}Fe.isCDATA=wc;function xc(t){return t.type===Et.ElementType.Text}Fe.isText=xc;function Bc(t){return t.type===Et.ElementType.Comment}Fe.isComment=Bc;function Sc(t){return t.type===Et.ElementType.Directive}Fe.isDirective=Sc;function Ac(t){return t.type===Et.ElementType.Root}Fe.isDocument=Ac;function cC(t){return Object.prototype.hasOwnProperty.call(t,"children")}Fe.hasChildren=cC;function Ua(t,e){e===void 0&&(e=!1);var n;if(xc(t))n=new gc(t.data);else if(Bc(t))n=new mc(t.data);else if(Ec(t)){var r=e?Ha(t.children):[],i=new bc(t.name,ur({},t.attribs),r);r.forEach(function(u){return u.parent=i}),t.namespace!=null&&(i.namespace=t.namespace),t["x-attribsNamespace"]&&(i["x-attribsNamespace"]=ur({},t["x-attribsNamespace"])),t["x-attribsPrefix"]&&(i["x-attribsPrefix"]=ur({},t["x-attribsPrefix"])),n=i}else if(wc(t)){var r=e?Ha(t.children):[],a=new Cc(r);r.forEach(function(l){return l.parent=a}),n=a}else if(Ac(t)){var r=e?Ha(t.children):[],o=new Dc(r);r.forEach(function(l){return l.parent=o}),t["x-mode"]&&(o["x-mode"]=t["x-mode"]),n=o}else if(Sc(t)){var s=new yc(t.name,t.data);t["x-name"]!=null&&(s["x-name"]=t["x-name"],s["x-publicId"]=t["x-publicId"],s["x-systemId"]=t["x-systemId"]),n=s}else throw new Error("Not implemented yet: ".concat(t.type));return n.startIndex=t.startIndex,n.endIndex=t.endIndex,t.sourceCodeLocation!=null&&(n.sourceCodeLocation=t.sourceCodeLocation),n}Fe.cloneNode=Ua;function Ha(t){for(var e=t.map(function(r){return Ua(r,!0)}),n=1;n<e.length;n++)e[n].prev=e[n-1],e[n-1].next=e[n];return e}(function(t){var e=qe&&qe.__createBinding||(Object.create?function(s,u,l,f){f===void 0&&(f=l);var h=Object.getOwnPropertyDescriptor(u,l);(!h||("get"in h?!u.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(s,f,h)}:function(s,u,l,f){f===void 0&&(f=l),s[f]=u[l]}),n=qe&&qe.__exportStar||function(s,u){for(var l in s)l!=="default"&&!Object.prototype.hasOwnProperty.call(u,l)&&e(u,s,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var r=za,i=Fe;n(Fe,t);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},o=function(){function s(u,l,f){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof l=="function"&&(f=l,l=a),typeof u=="object"&&(l=u,u=void 0),this.callback=u??null,this.options=l??a,this.elementCB=f??null}return s.prototype.onparserinit=function(u){this.parser=u},s.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},s.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},s.prototype.onerror=function(u){this.handleCallback(u)},s.prototype.onclosetag=function(){this.lastNode=null;var u=this.tagStack.pop();this.options.withEndIndices&&(u.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(u)},s.prototype.onopentag=function(u,l){var f=this.options.xmlMode?r.ElementType.Tag:void 0,h=new i.Element(u,l,void 0,f);this.addNode(h),this.tagStack.push(h)},s.prototype.ontext=function(u){var l=this.lastNode;if(l&&l.type===r.ElementType.Text)l.data+=u,this.options.withEndIndices&&(l.endIndex=this.parser.endIndex);else{var f=new i.Text(u);this.addNode(f),this.lastNode=f}},s.prototype.oncomment=function(u){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=u;return}var l=new i.Comment(u);this.addNode(l),this.lastNode=l},s.prototype.oncommentend=function(){this.lastNode=null},s.prototype.oncdatastart=function(){var u=new i.Text(""),l=new i.CDATA([u]);this.addNode(l),u.parent=l,this.lastNode=u},s.prototype.oncdataend=function(){this.lastNode=null},s.prototype.onprocessinginstruction=function(u,l){var f=new i.ProcessingInstruction(u,l);this.addNode(f)},s.prototype.handleCallback=function(u){if(typeof this.callback=="function")this.callback(u,this.dom);else if(u)throw u},s.prototype.addNode=function(u){var l=this.tagStack[this.tagStack.length-1],f=l.children[l.children.length-1];this.options.withStartIndices&&(u.startIndex=this.parser.startIndex),this.options.withEndIndices&&(u.endIndex=this.parser.endIndex),l.children.push(u),f&&(u.prev=f,f.next=u),u.parent=l,this.lastNode=null},s}();t.DomHandler=o,t.default=o})(_a);var Lc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,n){return e[n.toLowerCase()]=n,e},{})})(Lc),Object.defineProperty(ri,"__esModule",{value:!0}),ri.formatAttributes=Oc,ri.formatDOM=Pc;var oi=_a,fC=Lc;function dC(t){return fC.CASE_SENSITIVE_TAG_NAMES_MAP[t]}function Oc(t){for(var e={},n=0,r=t.length;n<r;n++){var i=t[n];e[i.name]=i.value}return e}function pC(t){t=t.toLowerCase();var e=dC(t);return e||t}function Pc(t,e,n){e===void 0&&(e=null);for(var r=[],i,a=0,o=t.length;a<o;a++){var s=t[a];switch(s.nodeType){case 1:{var u=pC(s.nodeName);i=new oi.Element(u,Oc(s.attributes)),i.children=Pc(u==="template"?s.content.childNodes:s.childNodes,i);break}case 3:i=new oi.Text(s.nodeValue);break;case 8:i=new oi.Comment(s.nodeValue);break;default:continue}var l=r[a-1]||null;l&&(l.next=i),i.parent=e,i.prev=l,i.next=null,r.push(i)}return n&&(i=new oi.ProcessingInstruction(n.substring(0,n.indexOf(" ")).toLowerCase(),n),i.next=r[0]||null,i.parent=e,r.unshift(i),r[1]&&(r[1].prev=r[0])),r}var hC=qe&&qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.default=yC;var vC=hC(Ia),gC=ri,mC=/<(![a-zA-Z\s]+)>/;function yC(t){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];var e=t.match(mC),n=e?e[1]:void 0;return(0,gC.formatDOM)((0,vC.default)(t),null,n)}var si={},kt={},ui={},CC=0;ui.SAME=CC;var DC=1;ui.CAMELCASE=DC,ui.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};const Mc=0,on=1,li=2,ci=3,Va=4,Fc=5,kc=6;function bC(t){return ft.hasOwnProperty(t)?ft[t]:null}function mt(t,e,n,r,i,a,o){this.acceptsBooleans=e===li||e===ci||e===Va,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=o}const ft={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(t=>{ft[t]=new mt(t,Mc,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([t,e])=>{ft[t]=new mt(t,on,!1,e,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(t=>{ft[t]=new mt(t,li,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(t=>{ft[t]=new mt(t,li,!1,t,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(t=>{ft[t]=new mt(t,ci,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(t=>{ft[t]=new mt(t,ci,!0,t,null,!1,!1)}),["capture","download"].forEach(t=>{ft[t]=new mt(t,Va,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(t=>{ft[t]=new mt(t,kc,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(t=>{ft[t]=new mt(t,Fc,!1,t.toLowerCase(),null,!1,!1)});const qa=/[\-\:]([a-z])/g,Ga=t=>t[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(t=>{const e=t.replace(qa,Ga);ft[e]=new mt(e,on,!1,t,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(t=>{const e=t.replace(qa,Ga);ft[e]=new mt(e,on,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(t=>{const e=t.replace(qa,Ga);ft[e]=new mt(e,on,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(t=>{ft[t]=new mt(t,on,!1,t.toLowerCase(),null,!1,!1)});const EC="xlinkHref";ft[EC]=new mt("xlinkHref",on,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(t=>{ft[t]=new mt(t,on,!1,t.toLowerCase(),null,!0,!0)});const{CAMELCASE:wC,SAME:xC,possibleStandardNames:Tc}=ui,BC=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",SC=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+BC+"]*$")),AC=Object.keys(Tc).reduce((t,e)=>{const n=Tc[e];return n===xC?t[e]=e:n===wC?t[e.toLowerCase()]=e:t[e]=n,t},{});kt.BOOLEAN=ci,kt.BOOLEANISH_STRING=li,kt.NUMERIC=Fc,kt.OVERLOADED_BOOLEAN=Va,kt.POSITIVE_NUMERIC=kc,kt.RESERVED=Mc,kt.STRING=on,kt.getPropertyInfo=bC,kt.isCustomAttribute=SC,kt.possibleStandardNames=AC;var Ya={},Za={},Rc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,LC=/\n/g,OC=/^\s*/,PC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,MC=/^:\s*/,FC=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,kC=/^[;\s]*/,TC=/^\s+|\s+$/g,RC=`
92
- `,Ic="/",jc="*",xn="",IC="comment",jC="declaration",NC=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(y){var v=y.match(LC);v&&(n+=v.length);var d=y.lastIndexOf(RC);r=~d?y.length-d:r+y.length}function a(){var y={line:n,column:r};return function(v){return v.position=new o(y),l(),v}}function o(y){this.start=y,this.end={line:n,column:r},this.source=e.source}o.prototype.content=t;function s(y){var v=new Error(e.source+":"+n+":"+r+": "+y);if(v.reason=y,v.filename=e.source,v.line=n,v.column=r,v.source=t,!e.silent)throw v}function u(y){var v=y.exec(t);if(v){var d=v[0];return i(d),t=t.slice(d.length),v}}function l(){u(OC)}function f(y){var v;for(y=y||[];v=h();)v!==!1&&y.push(v);return y}function h(){var y=a();if(!(Ic!=t.charAt(0)||jc!=t.charAt(1))){for(var v=2;xn!=t.charAt(v)&&(jc!=t.charAt(v)||Ic!=t.charAt(v+1));)++v;if(v+=2,xn===t.charAt(v-1))return s("End of comment missing");var d=t.slice(2,v-2);return r+=2,i(d),t=t.slice(v),r+=2,y({type:IC,comment:d})}}function p(){var y=a(),v=u(PC);if(v){if(h(),!u(MC))return s("property missing ':'");var d=u(FC),D=y({type:jC,property:Nc(v[0].replace(Rc,xn)),value:d?Nc(d[0].replace(Rc,xn)):xn});return u(kC),D}}function g(){var y=[];f(y);for(var v;v=p();)v!==!1&&(y.push(v),f(y));return y}return l(),g()};function Nc(t){return t?t.replace(TC,xn):xn}var _C=qe&&qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=WC;var zC=_C(NC);function WC(t,e){var n=null;if(!t||typeof t!="string")return n;var r=(0,zC.default)(t),i=typeof e=="function";return r.forEach(function(a){if(a.type==="declaration"){var o=a.property,s=a.value;i?e(o,s,a):s&&(n=n||{},n[o]=s)}}),n}var fi={};Object.defineProperty(fi,"__esModule",{value:!0}),fi.camelCase=void 0;var UC=/^--[a-zA-Z0-9-]+$/,HC=/-([a-z])/g,VC=/^[^-]+$/,qC=/^-(webkit|moz|ms|o|khtml)-/,GC=/^-(ms)-/,YC=function(t){return!t||VC.test(t)||UC.test(t)},ZC=function(t,e){return e.toUpperCase()},_c=function(t,e){return"".concat(e,"-")},KC=function(t,e){return e===void 0&&(e={}),YC(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(GC,_c):t=t.replace(qC,_c),t.replace(HC,ZC))};fi.camelCase=KC;var XC=qe&&qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},JC=XC(Za),QC=fi;function Ka(t,e){var n={};return!t||typeof t!="string"||(0,JC.default)(t,function(r,i){r&&i&&(n[(0,QC.camelCase)(r,e)]=i)}),n}Ka.default=Ka;var $C=Ka;(function(t){var e=qe&&qe.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=a,t.setStyleProp=s;var n=c,r=e($C),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function a(f,h){return f.includes("-")?!i.has(f):!!(h&&typeof h.is=="string")}var o={reactCompat:!0};function s(f,h){if(typeof f=="string"){if(!f.trim()){h.style={};return}try{h.style=(0,r.default)(f,o)}catch{h.style={}}}}t.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var u=function(f){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(f.name)};t.canTextBeChildOfNode=u;var l=function(f){return f};t.returnFirstArg=l})(Ya),Object.defineProperty(si,"__esModule",{value:!0}),si.default=rD;var lr=kt,zc=Ya,eD=["checked","value"],tD=["input","select","textarea"],nD={reset:!0,submit:!0};function rD(t,e){t===void 0&&(t={});var n={},r=!!(t.type&&nD[t.type]);for(var i in t){var a=t[i];if((0,lr.isCustomAttribute)(i)){n[i]=a;continue}var o=i.toLowerCase(),s=Wc(o);if(s){var u=(0,lr.getPropertyInfo)(s);switch(eD.includes(s)&&tD.includes(e)&&!r&&(s=Wc("default"+o)),n[s]=a,u&&u.type){case lr.BOOLEAN:n[s]=!0;break;case lr.OVERLOADED_BOOLEAN:a===""&&(n[s]=!0);break}continue}zc.PRESERVE_CUSTOM_ATTRIBUTES&&(n[i]=a)}return(0,zc.setStyleProp)(t.style,n),n}function Wc(t){return lr.possibleStandardNames[t]}var Xa={},iD=qe&&qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.default=Uc;var Ja=c,aD=iD(si),cr=Ya,oD={cloneElement:Ja.cloneElement,createElement:Ja.createElement,isValidElement:Ja.isValidElement};function Uc(t,e){e===void 0&&(e={});for(var n=[],r=typeof e.replace=="function",i=e.transform||cr.returnFirstArg,a=e.library||oD,o=a.cloneElement,s=a.createElement,u=a.isValidElement,l=t.length,f=0;f<l;f++){var h=t[f];if(r){var p=e.replace(h,f);if(u(p)){l>1&&(p=o(p,{key:p.key||f})),n.push(i(p,h,f));continue}}if(h.type==="text"){var g=!h.data.trim().length;if(g&&h.parent&&!(0,cr.canTextBeChildOfNode)(h.parent)||e.trim&&g)continue;n.push(i(h.data,h,f));continue}var y=h,v={};sD(y)?((0,cr.setStyleProp)(y.attribs.style,y.attribs),v=y.attribs):y.attribs&&(v=(0,aD.default)(y.attribs,y.name));var d=void 0;switch(h.type){case"script":case"style":h.children[0]&&(v.dangerouslySetInnerHTML={__html:h.children[0].data});break;case"tag":h.name==="textarea"&&h.children[0]?v.defaultValue=h.children[0].data:h.children&&h.children.length&&(d=Uc(h.children,e));break;default:continue}l>1&&(v.key=f),n.push(i(s(h.name,v,d),h,f))}return n.length===1?n[0]:n}function sD(t){return cr.PRESERVE_CUSTOM_ATTRIBUTES&&t.type==="tag"&&(0,cr.isCustomComponent)(t.name,t.attribs)}(function(t){var e=qe&&qe.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=s;var n=e(Ra);t.htmlToDOM=n.default;var r=e(si);t.attributesToProps=r.default;var i=e(Xa);t.domToReact=i.default;var a=_a;Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return a.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return a.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return a.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return a.Text}});var o={lowerCaseAttributeNames:!1};function s(u,l){if(typeof u!="string")throw new TypeError("First argument must be a string");return u?(0,i.default)((0,n.default)(u,(l==null?void 0:l.htmlparser2)||o),l):[]}})(cc);const Hc=Er(cc),uD=Hc.default||Hc,Qa=t=>{if(typeof t=="string")return{text:t||""};function e(r){return r.map(i=>Qa(i))}const n=Array.isArray(t.props.children)?e(t.props.children):[{text:t.props.children}];switch(t.type){case"p":return{type:"paragraph",children:n};case"blockquote":return{type:"blockQuote",children:n};case"ul":return{type:"bulletedList",children:n};case"h1":return{type:"headingOne",children:n};case"h2":return{type:"headingTwo",children:n};case"li":return{type:"listItem",children:n};case"ol":return{type:"numberedList",children:n};case"strong":return{text:"",children:n,bold:!0};case"code":return{text:"",children:n,code:!0};case"em":return{text:"",children:n,italic:!0};case"u":return{text:"",children:n,underline:!0};default:return{text:"",children:n}}},lD=t=>{const e=uD(t);return Array.isArray(e)?e.flatMap(n=>typeof n=="string"?{text:n}:Qa(n)):typeof e=="string"?[{text:e}]:[Qa(e)]};function Vc(t){return t.map(e=>ie.string(e)).join("")}const qc=t=>{if(ce.isText(t)){let e=t.text;return t.bold&&(e=`<strong>${e}</strong>`),t.code&&(e=`<code>${e}</code>`),t.italic&&(e=`<em>${e}</em>`),t.underline&&(e=`<u>${e}</u>`),e}if(le.isElement(t)){const e=t.children.map(n=>qc(n)).join("");switch(t.type){case"paragraph":return`<p>${e}</p>`;case"blockQuote":return`<blockquote>${e}</blockquote>`;case"bulletedList":return`<ul>${e}</ul>`;case"headingOne":return`<h1>${e}</h1>`;case"headingTwo":return`<h2>${e}</h2>`;case"listItem":return`<li>${e}</li>`;case"numberedList":return`<ol>${e}</ol>`;default:return e}}return""},Gc=t=>t.children.map(e=>qc(e)).join("");function cD({name:t,defaultValue:e,enforceCharacterLimit:n=!1,onChangeCharactersCount:r,maxLimit:i=2e3,onValueChange:a,onChange:o,isError:s}){const u=c.useMemo(()=>qg(eC(Ug())),[]),{id:l,inputRef:f,error:h}=xt(),p=c.useRef(null),g=e?lD(e):aC,y=Vc(g),[v,d]=c.useState(y.length),[D,x]=c.useState(e),[E,O]=c.useState(!1),b=f||p,w=s||!!h,A=c.useCallback(rC,[]),M=c.useCallback(nC,[]);function V(T){const j=Vc(T);d(j.length),r&&r(j.length),!(n&&j.length>=i)&&(x(Gc(u)),o&&o(T),a&&a(Gc(u)),u.children=T,ee.setNodes(u,{children:T}))}const P=E?"focusTrue":"focusFalse",R=`arkynRichText ${w||i<v?"errorTrue":"errorFalse"} ${P}`,N=i-v;return B.jsxs(Qy,{editor:u,initialValue:g,onChange:V,onValueChange:V,children:[B.jsxs("div",{className:R,children:[B.jsxs(iC,{children:[B.jsx(wn,{format:"headingOne",icon:Ae.Heading1}),B.jsx(wn,{format:"headingTwo",icon:Ae.Heading2}),B.jsx(wn,{format:"blockQuote",icon:Ae.Quote}),B.jsx(Qr,{format:"bold",icon:Ae.Bold}),B.jsx(Qr,{format:"italic",icon:Ae.Italic}),B.jsx(Qr,{format:"underline",icon:Ae.Underline}),B.jsx(Qr,{format:"code",icon:Ae.Code}),B.jsx(wn,{format:"left",icon:Ae.AlignLeft}),B.jsx(wn,{format:"right",icon:Ae.AlignRight}),B.jsx(wn,{format:"center",icon:Ae.AlignCenter}),B.jsx(wn,{format:"justify",icon:Ae.AlignJustify})]}),B.jsx(Hy,{className:"editorContainer",renderElement:M,renderLeaf:A,spellCheck:!0,id:l,onFocus:()=>O(!0),onBlur:()=>O(!1),onKeyDown:T=>{for(const j in lc)if(ch(j,T)){T.preventDefault();const X=lc[j];uc(u,X)}}}),N<0&&B.jsx("div",{className:"restatesCharacters",children:N})]}),B.jsx("input",{ref:b,type:"hidden",name:t,value:D}),B.jsx("input",{type:"hidden",name:`${t}Count`,value:v})]})}function fD(t,e){const{isLoading:n,isError:r,size:i="md",className:a="",variant:o="solid",prefix:s,leftIcon:u,disabled:l,readOnly:f,onFocus:h,onBlur:p,title:g,style:y,closeOnSelect:v=!0,...d}=t,b=`arkyn_select ${s?"hasPrefix":""} ${o} ${i} ${l||f||n?"opacity":""} ${r?"errored":""} ${e?"focused":""} ${a}`,A={md:20,lg:20}[i];return{isLoading:n,className:b,prefix:cd(s,A,"prefix"),LeftIcon:u,disabled:l||n||f,onFocus:h,onBlur:p,title:g,closeOnSelect:v,style:y,iconSize:A,Spinner:B.jsx(Ae.Loader2,{className:"spinner",size:A,strokeWidth:2.5}),...d}}function dD(t){var G;const[e,n]=c.useState(!1),{inputRef:r,id:i,error:a}=xt(),o=c.useRef(null),s=r||o,u=t.isError||!!a,{disabled:l,title:f,style:h,className:p,prefix:g,iconSize:y,isLoading:v,LeftIcon:d,value:D=null,defaultValue:x="",onFocus:E,onBlur:O,Spinner:b,name:w,placeholder:A,onSelect:M,options:V,optionMaxHeight:P,closeOnSelect:_,...R}=fD({...t,id:i,isError:u},e),[N,T]=c.useState(x);function j(){l||!(s!=null&&s.current)||e||(n(!0),s.current.focus())}function X(H){e||(n(!0),E&&E(H))}function z(){n(!1),O&&s.current&&s.current.blur()}function $(H){const{label:Q,value:K}=H;T(N!==K?K:""),M&&M({label:Q,value:K}),_&&z()}const re=typeof D=="string"?D:N,k=((G=V.find(H=>H.value===re))==null?void 0:G.label)||"",I=()=>{if(!e&&k)return!0;if(!e&&!k)return!1;if(e&&k)return!0;if(e&&!k)return!1};return B.jsxs(B.Fragment,{children:[B.jsxs("section",{title:f,style:h,onClick:j,className:`${p} placeholder_dark_${I()}`,children:[g,d&&B.jsx(d,{size:y,strokeWidth:2.5}),B.jsx("input",{disabled:l,readOnly:!0,placeholder:k||A,onFocus:X,...R}),B.jsx("input",{type:"hidden",ref:s,name:w,value:re||"",readOnly:!0}),e&&B.jsxs("div",{className:"arkyn_select_content",style:{overflow:"auto",maxHeight:P},children:[V.map(({label:H,value:Q})=>B.jsxs("div",{onClick:()=>$({label:H,value:Q}),className:re===Q?"arkyn_select_option active":"arkyn_select_option",children:[H," ",B.jsx(Ae.Check,{})]},Q)),V.length<=0&&B.jsx("p",{children:"Sem opções disponíveis"})]}),!v&&B.jsx(Ae.ChevronDown,{className:"arkyn_select_arrow",size:y,strokeWidth:2.5}),v&&b]}),e&&B.jsx("aside",{className:"arkyn_select_overlay",onClick:z})]})}function pD(t){const{size:e="lg",defaultChecked:n=!1,checked:r=null,value:i,unCheckedValue:a="",name:o,className:s="",onCheck:u,...l}=t,[f,h]=c.useState(n),{id:p,inputRef:g}=xt(),y=typeof r=="boolean"?r:f;function v(){h(!f),u&&u(y?a:i||"checked")}const D=`arkynSwitch ${y?"checkedTrue":"checkedFalse"} ${e} ${s}`;return B.jsx("button",{type:"button",onClick:v,className:D,...l,children:B.jsx("input",{id:p,type:"hidden",name:o,ref:g,onClick:v,value:y?i||"checked":a})})}function hD(t){const{variant:e="solid",size:n="md",className:r,disabled:i=!1,readOnly:a=!1,onFocus:o,onBlur:s,title:u,style:l,...f}=t,[h,p]=c.useState(!1),{inputRef:g,id:y,error:v}=xt(),d=c.useRef(null),D=g||d,E=t.isError||!!v?"errorTrue":"errorFalse",w=`arkynTextarea ${e} ${n} ${i||a?"opacityTrue":"opacityFalse"} ${E} ${h?"focusedTrue":"focusedFalse"} ${r}`;function A(){i||!(D!=null&&D.current)||(p(!0),D.current.focus())}function M(P){p(!0),o&&o(P)}function V(P){p(!1),s&&s(P)}return B.jsx("section",{title:u,style:l,onClick:A,className:w,children:B.jsx("textarea",{id:y,disabled:i,readOnly:a,ref:D,onFocus:M,onBlur:V,...f})})}function vD(t){const{className:e="",...n}=t,r=`arkynBreadcrumbContainer ${e}`;return B.jsx("nav",{className:r,...n})}function gD(t){const{pathname:e}=Ln.useLocation(),{className:n="",disabled:r=!1,children:i,to:a,...o}=t,u=`arkynBreadcrumbLink ${e===a?"active":"inactive"} ${n}`;return r?B.jsxs("p",{className:u,children:[B.jsx(Ae.ChevronRight,{size:14,strokeWidth:2.5}),i]}):B.jsxs(Ln.Link,{to:a,className:u,...o,children:[B.jsx(Ae.ChevronRight,{size:14,strokeWidth:2.5}),i]})}function Yc(t=""){const e=Ln.useLocation(),n=new URLSearchParams(e.search),r=t?`${t}:`:"",i=a=>{Object.entries(a).forEach(([o,s])=>{s===void 0?n.delete(`${r}${o}`):n.set(`${r}${o}`,String(s))})};return{getParam:a=>n.get(`${r}${a}`),getScopedSearch:a=>{i(a);let o=n.toString();return o&&(o="?"+o),o}}}function mD(t){const{scope:e,totalCountRegisters:n,perPageKey:r="per_page",pageKey:i="page",siblingsCount:a=2,...o}=t,s=Ln.useNavigate(),{getParam:u,getScopedSearch:l}=Yc(e),f=Number(u(i))||1,h=Number(u(r))||20,p=Math.ceil(n/h),g=ld(f,a),y=ud(f,a,p);function v(d){s(l({page:d}))}return B.jsxs("div",{className:"arkynPagination",...o,children:[B.jsx("button",{className:"arkynPaginationIconButton",disabled:f<=1,onClick:()=>v(f-1),children:B.jsx(Ae.ChevronLeft,{})}),f>1+a&&B.jsxs(B.Fragment,{children:[B.jsx("button",{className:"arkynPaginationPageButton",onClick:()=>v(1),children:"1"}),f>2+a&&B.jsx("button",{disabled:!0,className:"arkynPaginationSpread",children:B.jsx(Ae.Ellipsis,{})})]}),g.map((d,D)=>B.jsx("button",{onClick:()=>v(d),className:"arkynPaginationPageButton",children:d},D)),B.jsx("button",{className:"arkynPaginationCurrent",disabled:!0,children:f}),y.map((d,D)=>B.jsx("button",{onClick:()=>v(d),className:"arkynPaginationPageButton",children:d},D)),f+a<p&&B.jsxs(B.Fragment,{children:[f+1+a<p&&B.jsx("button",{disabled:!0,className:"arkynPaginationSpread",children:B.jsx(Ae.Ellipsis,{})}),B.jsx("button",{className:"arkynPaginationPageButton",onClick:()=>v(p),children:p})]}),B.jsx("button",{className:"arkynPaginationIconButton",disabled:f>=p,onClick:()=>v(f+1),children:B.jsx(Ae.ChevronRight,{})})]})}const $a=c.createContext({});function yD(){if(!$a)throw new Error("useTabContext must be used within a TabProvider");return c.useContext($a)}function CD(t){const{children:e,onClick:n,defaultActive:r,className:i,...a}=t,[o,s]=c.useState(r||""),[u,l]=c.useState(!0),f=c.useRef(null),h=`arkynTabContainer ${i||""}`,[p,g]=c.useState({width:"0px",left:"0px",transition:"none"}),y=(d,D)=>{const x=d.getBoundingClientRect(),E=f.current.getBoundingClientRect(),O=D?void 0:"none";l(!1),g({transition:O,width:`${x.width}px`,left:`${x.left-E.left}px`})};c.useEffect(()=>{const d=f.current;if(!d)return;let D=null;D=d.querySelector("button.activeTrue"),D&&y(D)},[]);const v=d=>{const D=d.target;D&&(s(D.value),D.classList.add("activeTrue"),y(D,!0),n&&n(D.value))};return B.jsxs("nav",{ref:f,className:h.trim(),...a,children:[B.jsx($a.Provider,{value:{handleTabClick:v,showInitialTab:u,value:o},children:e}),B.jsx("div",{className:"activeLine",style:p})]})}function DD(t){const{children:e,className:n="",onClick:r,...i}=t,{value:a,showInitialTab:o,handleTabClick:s}=yD(),u=a===i.value&&a?"activeTrue":"activeFalse",f=`arkynTabButton ${a===i.value&&o?"showBorderBottom":""} ${u} ${n}`;function h(p){s(p),r&&r(p)}return B.jsx("button",{onClick:h,className:f.trim(),...i,children:e})}const Zc=c.createContext({});function bD(t){const{isVisibled:e,makeInvisible:n,orientation:r="left",children:i,className:a,...o}=t,s=r==="left"?"-100%":"100%",l=`arkynDrawerContainer ${r} ${e?"visibleTrue":"visibleFalse"} ${a}`;return B.jsx(Zc.Provider,{value:{makeInvisible:n},children:B.jsx(cn.AnimatePresence,{children:e&&B.jsxs("aside",{className:l.trim(),...o,children:[B.jsx(cn.motion.div,{className:"arkynDrawerContainerOverlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n}),B.jsx(cn.motion.div,{className:"arkynDrawerContainerContent",transition:{ease:"easeOut",duration:.15},initial:{transform:`translateX(${s})`},animate:{transform:"translateX(0px)"},exit:{transform:`translateX(${s})`},children:i})]})})})}function ED(t){const{showCloseButton:e=!0,className:n,children:r,...i}=t,{makeInvisible:a}=c.useContext(Zc),o=`arkynDrawerHeader ${n}`;return B.jsxs("header",{className:o.trim(),...i,children:[r,e&&B.jsx("button",{className:"arkynDrawerHeaderCloseButton",type:"button",onClick:a,"aria-label":"Close drawer",children:B.jsx(Ae.X,{size:24})})]})}const Kc=c.createContext({});function wD(t){const{isVisibled:e,makeInvisible:n,children:r,className:i="",...a}=t,s=`arkynModalContainer ${e?"visibleTrue":"visibleFalse"} ${i}`;return B.jsx(Kc.Provider,{value:{makeInvisible:n},children:B.jsx(cn.AnimatePresence,{children:e&&B.jsxs("aside",{className:s.trim(),...a,children:[B.jsx(cn.motion.div,{className:"arkynModalContainerOverlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n}),B.jsx(cn.motion.div,{className:"arkynModalContainerContent",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0,scale:.75},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},children:r})]})})})}function xD(t){const{alignment:e="right",className:n,...r}=t,i=`arkynModalFooter ${e} ${n}`;return B.jsx("footer",{className:i.trim(),...r})}function BD(t){const{showCloseButton:e=!0,className:n,children:r,...i}=t,{makeInvisible:a}=c.useContext(Kc),o=`arkynModalHeader ${n}`;return B.jsxs("header",{className:o.trim(),...i,children:[r,e&&B.jsx("button",{type:"button",onClick:a,"aria-label":"Close modal button",className:"arkynModalHeaderCloseButton",children:B.jsx(Ae.X,{size:24})})]})}function SD(t){const{children:e,button:n,closeOnClick:r,orientation:i="bottomLeft"}=t,[a,o]=c.useState(!1),u=`arkynPopover ${i} ${a?"visibleTrue":"visibleFalse"}`;function l(){a||o(!0)}return B.jsxs("div",{className:u,onClick:l,children:[n,B.jsx(cn.motion.div,{style:{visibility:a?"visible":"hidden"},transition:{ease:"easeOut",duration:0},initial:{opacity:0},animate:{opacity:a?1:0},exit:{opacity:0},onClick:()=>r&&o(!1),className:"arkynPopoverContent",children:e}),a&&B.jsx("div",{onClick:()=>o(!1),className:"arkynPopoverOverlay"})]})}function Xc(t){const{message:e,title:n,type:r,size:i="lg"}=t,a=`arkynToast ${r} ${i}`;function o(){switch(r){case"info":return B.jsx(Ae.Info,{});case"success":return B.jsx(Ae.CheckCircle2,{});case"danger":return B.jsx(Ae.XCircle,{});case"warning":return B.jsx(Ae.AlertCircle,{});default:return B.jsx(Ae.Info,{})}}return B.jsxs("aside",{className:a,children:[B.jsxs("div",{children:[B.jsx("div",{className:"bg"}),B.jsx(o,{})]}),B.jsxs("p",{children:[B.jsx("strong",{title:n,children:n}),B.jsx("span",{children:e})]})]})}function AD(t){const{text:e,size:n="lg",children:r,orientation:i="top",className:a="",...o}=t,s=`arkynTooltip ${n} ${i} ${a}`;return B.jsxs("div",{className:s.trim(),...o,children:[r,B.jsx("div",{className:"arkynTooltipText",children:e})]})}var nt={},eo={},fr={},dr={},Jc="Expected a function",Qc=NaN,LD="[object Symbol]",OD=/^\s+|\s+$/g,PD=/^[-+]0x[0-9a-f]+$/i,MD=/^0b[01]+$/i,FD=/^0o[0-7]+$/i,kD=parseInt,TD=typeof qe=="object"&&qe&&qe.Object===Object&&qe,RD=typeof self=="object"&&self&&self.Object===Object&&self,ID=TD||RD||Function("return this")(),jD=Object.prototype,ND=jD.toString,_D=Math.max,zD=Math.min,to=function(){return ID.Date.now()};function WD(t,e,n){var r,i,a,o,s,u,l=0,f=!1,h=!1,p=!0;if(typeof t!="function")throw new TypeError(Jc);e=$c(e)||0,di(n)&&(f=!!n.leading,h="maxWait"in n,a=h?_D($c(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p);function g(w){var A=r,M=i;return r=i=void 0,l=w,o=t.apply(M,A),o}function y(w){return l=w,s=setTimeout(D,e),f?g(w):o}function v(w){var A=w-u,M=w-l,V=e-A;return h?zD(V,a-M):V}function d(w){var A=w-u,M=w-l;return u===void 0||A>=e||A<0||h&&M>=a}function D(){var w=to();if(d(w))return x(w);s=setTimeout(D,v(w))}function x(w){return s=void 0,p&&r?g(w):(r=i=void 0,o)}function E(){s!==void 0&&clearTimeout(s),l=0,r=u=i=s=void 0}function O(){return s===void 0?o:x(to())}function b(){var w=to(),A=d(w);if(r=arguments,i=this,u=w,A){if(s===void 0)return y(u);if(h)return s=setTimeout(D,e),g(u)}return s===void 0&&(s=setTimeout(D,e)),o}return b.cancel=E,b.flush=O,b}function UD(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(Jc);return di(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),WD(t,e,{leading:r,maxWait:e,trailing:i})}function di(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function HD(t){return!!t&&typeof t=="object"}function VD(t){return typeof t=="symbol"||HD(t)&&ND.call(t)==LD}function $c(t){if(typeof t=="number")return t;if(VD(t))return Qc;if(di(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=di(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(OD,"");var n=MD.test(t);return n||FD.test(t)?kD(t.slice(2),n?2:8):PD.test(t)?Qc:+t}var qD=UD,pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.addPassiveEventListener=function(e,n,r){var i=r.name;i||(i=n,console.warn("Listener must be a named function.")),pi.has(n)||pi.set(n,new Set);var a=pi.get(n);if(!a.has(i)){var o=function(){var s=!1;try{var u=Object.defineProperty({},"passive",{get:function(){s=!0}});window.addEventListener("test",null,u)}catch{}return s}();e.addEventListener(n,r,o?{passive:!0}:!1),a.add(i)}},pr.removePassiveEventListener=function(e,n,r){e.removeEventListener(n,r),pi.get(n).delete(r.name||n)};var pi=new Map;Object.defineProperty(dr,"__esModule",{value:!0});var GD=qD,YD=KD(GD),ZD=pr;function KD(t){return t&&t.__esModule?t:{default:t}}var XD=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66;return(0,YD.default)(e,n)},$e={spyCallbacks:[],spySetState:[],scrollSpyContainers:[],mount:function(e,n){if(e){var r=XD(function(i){$e.scrollHandler(e)},n);$e.scrollSpyContainers.push(e),(0,ZD.addPassiveEventListener)(e,"scroll",r)}},isMounted:function(e){return $e.scrollSpyContainers.indexOf(e)!==-1},currentPositionX:function(e){if(e===document){var n=window.pageYOffset!==void 0,r=(document.compatMode||"")==="CSS1Compat";return n?window.pageXOffset:r?document.documentElement.scrollLeft:document.body.scrollLeft}else return e.scrollLeft},currentPositionY:function(e){if(e===document){var n=window.pageXOffset!==void 0,r=(document.compatMode||"")==="CSS1Compat";return n?window.pageYOffset:r?document.documentElement.scrollTop:document.body.scrollTop}else return e.scrollTop},scrollHandler:function(e){var n=$e.scrollSpyContainers[$e.scrollSpyContainers.indexOf(e)].spyCallbacks||[];n.forEach(function(r){return r($e.currentPositionX(e),$e.currentPositionY(e))})},addStateHandler:function(e){$e.spySetState.push(e)},addSpyHandler:function(e,n){var r=$e.scrollSpyContainers[$e.scrollSpyContainers.indexOf(n)];r.spyCallbacks||(r.spyCallbacks=[]),r.spyCallbacks.push(e),e($e.currentPositionX(n),$e.currentPositionY(n))},updateStates:function(){$e.spySetState.forEach(function(e){return e()})},unmount:function(e,n){$e.scrollSpyContainers.forEach(function(r){return r.spyCallbacks&&r.spyCallbacks.length&&r.spyCallbacks.indexOf(n)>-1&&r.spyCallbacks.splice(r.spyCallbacks.indexOf(n),1)}),$e.spySetState&&$e.spySetState.length&&$e.spySetState.indexOf(e)>-1&&$e.spySetState.splice($e.spySetState.indexOf(e),1),document.removeEventListener("scroll",$e.scrollHandler)},update:function(){return $e.scrollSpyContainers.forEach(function(e){return $e.scrollHandler(e)})}};dr.default=$e;var jn={},hr={};Object.defineProperty(hr,"__esModule",{value:!0});var JD=function(e,n){var r=e.indexOf("#")===0?e.substring(1):e,i=r?"#"+r:"",a=window&&window.location,o=i?a.pathname+a.search+i:a.pathname+a.search;n?history.pushState(history.state,"",o):history.replaceState(history.state,"",o)},QD=function(){return window.location.hash.replace(/^#/,"")},$D=function(e){return function(n){return e.contains?e!=n&&e.contains(n):!!(e.compareDocumentPosition(n)&16)}},eb=function(e){return getComputedStyle(e).position!=="static"},no=function(e,n){for(var r=e.offsetTop,i=e.offsetParent;i&&!n(i);)r+=i.offsetTop,i=i.offsetParent;return{offsetTop:r,offsetParent:i}},tb=function(e,n,r){if(r)return e===document?n.getBoundingClientRect().left+(window.scrollX||window.pageXOffset):getComputedStyle(e).position!=="static"?n.offsetLeft:n.offsetLeft-e.offsetLeft;if(e===document)return n.getBoundingClientRect().top+(window.scrollY||window.pageYOffset);if(eb(e)){if(n.offsetParent!==e){var i=function(f){return f===e||f===document},a=no(n,i),o=a.offsetTop,s=a.offsetParent;if(s!==e)throw new Error("Seems containerElement is not an ancestor of the Element");return o}return n.offsetTop}if(n.offsetParent===e.offsetParent)return n.offsetTop-e.offsetTop;var u=function(f){return f===document};return no(n,u).offsetTop-no(e,u).offsetTop};hr.default={updateHash:JD,getHash:QD,filterElementInContainer:$D,scrollOffset:tb};var hi={},ro={};Object.defineProperty(ro,"__esModule",{value:!0}),ro.default={defaultEasing:function(e){return e<.5?Math.pow(e*2,2)/2:1-Math.pow((1-e)*2,2)/2},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}};var io={};Object.defineProperty(io,"__esModule",{value:!0});var nb=pr,rb=["mousedown","mousewheel","touchmove","keydown"];io.default={subscribe:function(e){return typeof document<"u"&&rb.forEach(function(n){return(0,nb.addPassiveEventListener)(document,n,e)})}};var vr={};Object.defineProperty(vr,"__esModule",{value:!0});var ao={registered:{},scrollEvent:{register:function(e,n){ao.registered[e]=n},remove:function(e){ao.registered[e]=null}}};vr.default=ao,Object.defineProperty(hi,"__esModule",{value:!0});var ib=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ab=hr;vi(ab);var ob=ro,ef=vi(ob),sb=io,ub=vi(sb),lb=vr,Nt=vi(lb);function vi(t){return t&&t.__esModule?t:{default:t}}var tf=function(e){return ef.default[e.smooth]||ef.default.defaultEasing},cb=function(e){return typeof e=="function"?e:function(){return e}},fb=function(){if(typeof window<"u")return window.requestAnimationFrame||window.webkitRequestAnimationFrame},oo=function(){return fb()||function(t,e,n){window.setTimeout(t,n||1e3/60,new Date().getTime())}}(),nf=function(){return{currentPosition:0,startPosition:0,targetPosition:0,progress:0,duration:0,cancel:!1,target:null,containerElement:null,to:null,start:null,delta:null,percent:null,delayTimeout:null}},rf=function(e){var n=e.data.containerElement;if(n&&n!==document&&n!==document.body)return n.scrollLeft;var r=window.pageXOffset!==void 0,i=(document.compatMode||"")==="CSS1Compat";return r?window.pageXOffset:i?document.documentElement.scrollLeft:document.body.scrollLeft},af=function(e){var n=e.data.containerElement;if(n&&n!==document&&n!==document.body)return n.scrollTop;var r=window.pageXOffset!==void 0,i=(document.compatMode||"")==="CSS1Compat";return r?window.pageYOffset:i?document.documentElement.scrollTop:document.body.scrollTop},db=function(e){var n=e.data.containerElement;if(n&&n!==document&&n!==document.body)return n.scrollWidth-n.offsetWidth;var r=document.body,i=document.documentElement;return Math.max(r.scrollWidth,r.offsetWidth,i.clientWidth,i.scrollWidth,i.offsetWidth)},pb=function(e){var n=e.data.containerElement;if(n&&n!==document&&n!==document.body)return n.scrollHeight-n.offsetHeight;var r=document.body,i=document.documentElement;return Math.max(r.scrollHeight,r.offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight)},hb=function t(e,n,r){var i=n.data;if(!n.ignoreCancelEvents&&i.cancel){Nt.default.registered.end&&Nt.default.registered.end(i.to,i.target,i.currentPositionY);return}if(i.delta=Math.round(i.targetPosition-i.startPosition),i.start===null&&(i.start=r),i.progress=r-i.start,i.percent=i.progress>=i.duration?1:e(i.progress/i.duration),i.currentPosition=i.startPosition+Math.ceil(i.delta*i.percent),i.containerElement&&i.containerElement!==document&&i.containerElement!==document.body?n.horizontal?i.containerElement.scrollLeft=i.currentPosition:i.containerElement.scrollTop=i.currentPosition:n.horizontal?window.scrollTo(i.currentPosition,0):window.scrollTo(0,i.currentPosition),i.percent<1){var a=t.bind(null,e,n);oo.call(window,a);return}Nt.default.registered.end&&Nt.default.registered.end(i.to,i.target,i.currentPosition)},so=function(e){e.data.containerElement=e?e.containerId?document.getElementById(e.containerId):e.container&&e.container.nodeType?e.container:document:null},gr=function(e,n,r,i){n.data=n.data||nf(),window.clearTimeout(n.data.delayTimeout);var a=function(){n.data.cancel=!0};if(ub.default.subscribe(a),so(n),n.data.start=null,n.data.cancel=!1,n.data.startPosition=n.horizontal?rf(n):af(n),n.data.targetPosition=n.absolute?e:e+n.data.startPosition,n.data.startPosition===n.data.targetPosition){Nt.default.registered.end&&Nt.default.registered.end(n.data.to,n.data.target,n.data.currentPosition);return}n.data.delta=Math.round(n.data.targetPosition-n.data.startPosition),n.data.duration=cb(n.duration)(n.data.delta),n.data.duration=isNaN(parseFloat(n.data.duration))?1e3:parseFloat(n.data.duration),n.data.to=r,n.data.target=i;var o=tf(n),s=hb.bind(null,o,n);if(n&&n.delay>0){n.data.delayTimeout=window.setTimeout(function(){Nt.default.registered.begin&&Nt.default.registered.begin(n.data.to,n.data.target),oo.call(window,s)},n.delay);return}Nt.default.registered.begin&&Nt.default.registered.begin(n.data.to,n.data.target),oo.call(window,s)},gi=function(e){return e=ib({},e),e.data=e.data||nf(),e.absolute=!0,e},vb=function(e){gr(0,gi(e))},gb=function(e,n){gr(e,gi(n))},mb=function(e){e=gi(e),so(e),gr(e.horizontal?db(e):pb(e),e)},yb=function(e,n){n=gi(n),so(n);var r=n.horizontal?rf(n):af(n);gr(e+r,n)};hi.default={animateTopScroll:gr,getAnimationType:tf,scrollToTop:vb,scrollToBottom:mb,scrollTo:gb,scrollMore:yb},Object.defineProperty(jn,"__esModule",{value:!0});var Cb=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Db=hr,bb=uo(Db),Eb=hi,wb=uo(Eb),xb=vr,mi=uo(xb);function uo(t){return t&&t.__esModule?t:{default:t}}var yi={},of=void 0;jn.default={unmount:function(){yi={}},register:function(e,n){yi[e]=n},unregister:function(e){delete yi[e]},get:function(e){return yi[e]||document.getElementById(e)||document.getElementsByName(e)[0]||document.getElementsByClassName(e)[0]},setActiveLink:function(e){return of=e},getActiveLink:function(){return of},scrollTo:function(e,n){var r=this.get(e);if(!r){console.warn("target Element not found");return}n=Cb({},n,{absolute:!1});var i=n.containerId,a=n.container,o=void 0;i?o=document.getElementById(i):a&&a.nodeType?o=a:o=document,n.absolute=!0;var s=n.horizontal,u=bb.default.scrollOffset(o,r,s)+(n.offset||0);if(!n.smooth){mi.default.registered.begin&&mi.default.registered.begin(e,r),o===document?n.horizontal?window.scrollTo(u,0):window.scrollTo(0,u):o.scrollTop=u,mi.default.registered.end&&mi.default.registered.end(e,r);return}wb.default.animateTopScroll(u,n,e,r)}};var lo={exports:{}},Ci={exports:{}},Ue={};/** @license React v16.13.1
92
+ `,Ic="/",jc="*",xn="",IC="comment",jC="declaration",NC=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(y){var v=y.match(LC);v&&(n+=v.length);var d=y.lastIndexOf(RC);r=~d?y.length-d:r+y.length}function a(){var y={line:n,column:r};return function(v){return v.position=new o(y),l(),v}}function o(y){this.start=y,this.end={line:n,column:r},this.source=e.source}o.prototype.content=t;function s(y){var v=new Error(e.source+":"+n+":"+r+": "+y);if(v.reason=y,v.filename=e.source,v.line=n,v.column=r,v.source=t,!e.silent)throw v}function u(y){var v=y.exec(t);if(v){var d=v[0];return i(d),t=t.slice(d.length),v}}function l(){u(OC)}function f(y){var v;for(y=y||[];v=h();)v!==!1&&y.push(v);return y}function h(){var y=a();if(!(Ic!=t.charAt(0)||jc!=t.charAt(1))){for(var v=2;xn!=t.charAt(v)&&(jc!=t.charAt(v)||Ic!=t.charAt(v+1));)++v;if(v+=2,xn===t.charAt(v-1))return s("End of comment missing");var d=t.slice(2,v-2);return r+=2,i(d),t=t.slice(v),r+=2,y({type:IC,comment:d})}}function p(){var y=a(),v=u(PC);if(v){if(h(),!u(MC))return s("property missing ':'");var d=u(FC),D=y({type:jC,property:Nc(v[0].replace(Rc,xn)),value:d?Nc(d[0].replace(Rc,xn)):xn});return u(kC),D}}function g(){var y=[];f(y);for(var v;v=p();)v!==!1&&(y.push(v),f(y));return y}return l(),g()};function Nc(t){return t?t.replace(TC,xn):xn}var _C=qe&&qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Za,"__esModule",{value:!0}),Za.default=WC;var zC=_C(NC);function WC(t,e){var n=null;if(!t||typeof t!="string")return n;var r=(0,zC.default)(t),i=typeof e=="function";return r.forEach(function(a){if(a.type==="declaration"){var o=a.property,s=a.value;i?e(o,s,a):s&&(n=n||{},n[o]=s)}}),n}var fi={};Object.defineProperty(fi,"__esModule",{value:!0}),fi.camelCase=void 0;var UC=/^--[a-zA-Z0-9-]+$/,HC=/-([a-z])/g,VC=/^[^-]+$/,qC=/^-(webkit|moz|ms|o|khtml)-/,GC=/^-(ms)-/,YC=function(t){return!t||VC.test(t)||UC.test(t)},ZC=function(t,e){return e.toUpperCase()},_c=function(t,e){return"".concat(e,"-")},KC=function(t,e){return e===void 0&&(e={}),YC(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(GC,_c):t=t.replace(qC,_c),t.replace(HC,ZC))};fi.camelCase=KC;var XC=qe&&qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},JC=XC(Za),QC=fi;function Ka(t,e){var n={};return!t||typeof t!="string"||(0,JC.default)(t,function(r,i){r&&i&&(n[(0,QC.camelCase)(r,e)]=i)}),n}Ka.default=Ka;var $C=Ka;(function(t){var e=qe&&qe.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=a,t.setStyleProp=s;var n=c,r=e($C),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function a(f,h){return f.includes("-")?!i.has(f):!!(h&&typeof h.is=="string")}var o={reactCompat:!0};function s(f,h){if(typeof f=="string"){if(!f.trim()){h.style={};return}try{h.style=(0,r.default)(f,o)}catch{h.style={}}}}t.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var u=function(f){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(f.name)};t.canTextBeChildOfNode=u;var l=function(f){return f};t.returnFirstArg=l})(Ya),Object.defineProperty(si,"__esModule",{value:!0}),si.default=rD;var lr=kt,zc=Ya,eD=["checked","value"],tD=["input","select","textarea"],nD={reset:!0,submit:!0};function rD(t,e){t===void 0&&(t={});var n={},r=!!(t.type&&nD[t.type]);for(var i in t){var a=t[i];if((0,lr.isCustomAttribute)(i)){n[i]=a;continue}var o=i.toLowerCase(),s=Wc(o);if(s){var u=(0,lr.getPropertyInfo)(s);switch(eD.includes(s)&&tD.includes(e)&&!r&&(s=Wc("default"+o)),n[s]=a,u&&u.type){case lr.BOOLEAN:n[s]=!0;break;case lr.OVERLOADED_BOOLEAN:a===""&&(n[s]=!0);break}continue}zc.PRESERVE_CUSTOM_ATTRIBUTES&&(n[i]=a)}return(0,zc.setStyleProp)(t.style,n),n}function Wc(t){return lr.possibleStandardNames[t]}var Xa={},iD=qe&&qe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.default=Uc;var Ja=c,aD=iD(si),cr=Ya,oD={cloneElement:Ja.cloneElement,createElement:Ja.createElement,isValidElement:Ja.isValidElement};function Uc(t,e){e===void 0&&(e={});for(var n=[],r=typeof e.replace=="function",i=e.transform||cr.returnFirstArg,a=e.library||oD,o=a.cloneElement,s=a.createElement,u=a.isValidElement,l=t.length,f=0;f<l;f++){var h=t[f];if(r){var p=e.replace(h,f);if(u(p)){l>1&&(p=o(p,{key:p.key||f})),n.push(i(p,h,f));continue}}if(h.type==="text"){var g=!h.data.trim().length;if(g&&h.parent&&!(0,cr.canTextBeChildOfNode)(h.parent)||e.trim&&g)continue;n.push(i(h.data,h,f));continue}var y=h,v={};sD(y)?((0,cr.setStyleProp)(y.attribs.style,y.attribs),v=y.attribs):y.attribs&&(v=(0,aD.default)(y.attribs,y.name));var d=void 0;switch(h.type){case"script":case"style":h.children[0]&&(v.dangerouslySetInnerHTML={__html:h.children[0].data});break;case"tag":h.name==="textarea"&&h.children[0]?v.defaultValue=h.children[0].data:h.children&&h.children.length&&(d=Uc(h.children,e));break;default:continue}l>1&&(v.key=f),n.push(i(s(h.name,v,d),h,f))}return n.length===1?n[0]:n}function sD(t){return cr.PRESERVE_CUSTOM_ATTRIBUTES&&t.type==="tag"&&(0,cr.isCustomComponent)(t.name,t.attribs)}(function(t){var e=qe&&qe.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=s;var n=e(Ra);t.htmlToDOM=n.default;var r=e(si);t.attributesToProps=r.default;var i=e(Xa);t.domToReact=i.default;var a=_a;Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return a.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return a.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return a.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return a.Text}});var o={lowerCaseAttributeNames:!1};function s(u,l){if(typeof u!="string")throw new TypeError("First argument must be a string");return u?(0,i.default)((0,n.default)(u,(l==null?void 0:l.htmlparser2)||o),l):[]}})(cc);const Hc=Er(cc),uD=Hc.default||Hc,Qa=t=>{if(typeof t=="string")return{text:t||""};function e(i){return i.map(a=>Qa(a))}const n=Array.isArray(t.props.children)?e(t.props.children):[{text:t.props.children}],r=typeof t.props.children=="string"?t.props.children:"";switch(t.type){case"p":return{type:"paragraph",children:n};case"blockquote":return{type:"blockQuote",children:n};case"ul":return{type:"bulletedList",children:n};case"h1":return{type:"headingOne",children:n};case"h2":return{type:"headingTwo",children:n};case"li":return{type:"listItem",children:n};case"ol":return{type:"numberedList",children:n};case"strong":return{text:r,bold:!0};case"code":return{text:r,code:!0};case"em":return{text:r,italic:!0};case"u":return{text:r,underline:!0};default:return{text:r}}},lD=t=>{const e=uD(t);return Array.isArray(e)?e.flatMap(n=>typeof n=="string"?{text:n}:Qa(n)):typeof e=="string"?[{text:e}]:[Qa(e)]};function Vc(t){return t.map(e=>ie.string(e)).join("")}const qc=t=>{if(ce.isText(t)){let e=t.text;return t.bold&&(e=`<strong>${e}</strong>`),t.code&&(e=`<code>${e}</code>`),t.italic&&(e=`<em>${e}</em>`),t.underline&&(e=`<u>${e}</u>`),e}if(le.isElement(t)){const e=t.children.map(n=>qc(n)).join("");switch(t.type){case"paragraph":return`<p>${e}</p>`;case"blockQuote":return`<blockquote>${e}</blockquote>`;case"bulletedList":return`<ul>${e}</ul>`;case"headingOne":return`<h1>${e}</h1>`;case"headingTwo":return`<h2>${e}</h2>`;case"listItem":return`<li>${e}</li>`;case"numberedList":return`<ol>${e}</ol>`;default:return e}}return""},Gc=t=>t.children.map(e=>qc(e)).join("");function cD({name:t,defaultValue:e,enforceCharacterLimit:n=!1,onChangeCharactersCount:r,maxLimit:i=2e3,onValueChange:a,onChange:o,isError:s}){const u=c.useMemo(()=>qg(eC(Ug())),[]),{id:l,inputRef:f,error:h}=xt(),p=c.useRef(null),g=e?lD(e):aC,y=Vc(g),[v,d]=c.useState(y.length),[D,x]=c.useState(e),[E,O]=c.useState(!1),b=f||p,w=s||!!h,A=c.useCallback(rC,[]),M=c.useCallback(nC,[]);function V(T){const j=Vc(T);d(j.length),r&&r(j.length),!(n&&j.length>=i)&&(x(Gc(u)),o&&o(T),a&&a(Gc(u)),u.children=T,ee.setNodes(u,{children:T}))}const P=E?"focusTrue":"focusFalse",R=`arkynRichText ${w||i<v?"errorTrue":"errorFalse"} ${P}`,N=i-v;return B.jsxs(Qy,{editor:u,initialValue:g,onChange:V,onValueChange:V,children:[B.jsxs("div",{className:R,children:[B.jsxs(iC,{children:[B.jsx(wn,{format:"headingOne",icon:Ae.Heading1}),B.jsx(wn,{format:"headingTwo",icon:Ae.Heading2}),B.jsx(wn,{format:"blockQuote",icon:Ae.Quote}),B.jsx(Qr,{format:"bold",icon:Ae.Bold}),B.jsx(Qr,{format:"italic",icon:Ae.Italic}),B.jsx(Qr,{format:"underline",icon:Ae.Underline}),B.jsx(Qr,{format:"code",icon:Ae.Code}),B.jsx(wn,{format:"left",icon:Ae.AlignLeft}),B.jsx(wn,{format:"right",icon:Ae.AlignRight}),B.jsx(wn,{format:"center",icon:Ae.AlignCenter}),B.jsx(wn,{format:"justify",icon:Ae.AlignJustify})]}),B.jsx(Hy,{className:"editorContainer",renderElement:M,renderLeaf:A,spellCheck:!0,id:l,onFocus:()=>O(!0),onBlur:()=>O(!1),onKeyDown:T=>{for(const j in lc)if(ch(j,T)){T.preventDefault();const X=lc[j];uc(u,X)}}}),N<0&&B.jsx("div",{className:"restatesCharacters",children:N})]}),B.jsx("input",{ref:b,type:"hidden",name:t,value:D}),B.jsx("input",{type:"hidden",name:`${t}Count`,value:v})]})}function fD(t,e){const{isLoading:n,isError:r,size:i="md",className:a="",variant:o="solid",prefix:s,leftIcon:u,disabled:l,readOnly:f,onFocus:h,onBlur:p,title:g,style:y,closeOnSelect:v=!0,...d}=t,b=`arkyn_select ${s?"hasPrefix":""} ${o} ${i} ${l||f||n?"opacity":""} ${r?"errored":""} ${e?"focused":""} ${a}`,A={md:20,lg:20}[i];return{isLoading:n,className:b,prefix:cd(s,A,"prefix"),LeftIcon:u,disabled:l||n||f,onFocus:h,onBlur:p,title:g,closeOnSelect:v,style:y,iconSize:A,Spinner:B.jsx(Ae.Loader2,{className:"spinner",size:A,strokeWidth:2.5}),...d}}function dD(t){var G;const[e,n]=c.useState(!1),{inputRef:r,id:i,error:a}=xt(),o=c.useRef(null),s=r||o,u=t.isError||!!a,{disabled:l,title:f,style:h,className:p,prefix:g,iconSize:y,isLoading:v,LeftIcon:d,value:D=null,defaultValue:x="",onFocus:E,onBlur:O,Spinner:b,name:w,placeholder:A,onSelect:M,options:V,optionMaxHeight:P,closeOnSelect:_,...R}=fD({...t,id:i,isError:u},e),[N,T]=c.useState(x);function j(){l||!(s!=null&&s.current)||e||(n(!0),s.current.focus())}function X(H){e||(n(!0),E&&E(H))}function z(){n(!1),O&&s.current&&s.current.blur()}function $(H){const{label:Q,value:K}=H;T(N!==K?K:""),M&&M({label:Q,value:K}),_&&z()}const re=typeof D=="string"?D:N,k=((G=V.find(H=>H.value===re))==null?void 0:G.label)||"",I=()=>{if(!e&&k)return!0;if(!e&&!k)return!1;if(e&&k)return!0;if(e&&!k)return!1};return B.jsxs(B.Fragment,{children:[B.jsxs("section",{title:f,style:h,onClick:j,className:`${p} placeholder_dark_${I()}`,children:[g,d&&B.jsx(d,{size:y,strokeWidth:2.5}),B.jsx("input",{disabled:l,readOnly:!0,placeholder:k||A,onFocus:X,...R}),B.jsx("input",{type:"hidden",ref:s,name:w,value:re||"",readOnly:!0}),e&&B.jsxs("div",{className:"arkyn_select_content",style:{overflow:"auto",maxHeight:P},children:[V.map(({label:H,value:Q})=>B.jsxs("div",{onClick:()=>$({label:H,value:Q}),className:re===Q?"arkyn_select_option active":"arkyn_select_option",children:[H," ",B.jsx(Ae.Check,{})]},Q)),V.length<=0&&B.jsx("p",{children:"Sem opções disponíveis"})]}),!v&&B.jsx(Ae.ChevronDown,{className:"arkyn_select_arrow",size:y,strokeWidth:2.5}),v&&b]}),e&&B.jsx("aside",{className:"arkyn_select_overlay",onClick:z})]})}function pD(t){const{size:e="lg",defaultChecked:n=!1,checked:r=null,value:i,unCheckedValue:a="",name:o,className:s="",onCheck:u,...l}=t,[f,h]=c.useState(n),{id:p,inputRef:g}=xt(),y=typeof r=="boolean"?r:f;function v(){h(!f),u&&u(y?a:i||"checked")}const D=`arkynSwitch ${y?"checkedTrue":"checkedFalse"} ${e} ${s}`;return B.jsx("button",{type:"button",onClick:v,className:D,...l,children:B.jsx("input",{id:p,type:"hidden",name:o,ref:g,onClick:v,value:y?i||"checked":a})})}function hD(t){const{variant:e="solid",size:n="md",className:r,disabled:i=!1,readOnly:a=!1,onFocus:o,onBlur:s,title:u,style:l,...f}=t,[h,p]=c.useState(!1),{inputRef:g,id:y,error:v}=xt(),d=c.useRef(null),D=g||d,E=t.isError||!!v?"errorTrue":"errorFalse",w=`arkynTextarea ${e} ${n} ${i||a?"opacityTrue":"opacityFalse"} ${E} ${h?"focusedTrue":"focusedFalse"} ${r}`;function A(){i||!(D!=null&&D.current)||(p(!0),D.current.focus())}function M(P){p(!0),o&&o(P)}function V(P){p(!1),s&&s(P)}return B.jsx("section",{title:u,style:l,onClick:A,className:w,children:B.jsx("textarea",{id:y,disabled:i,readOnly:a,ref:D,onFocus:M,onBlur:V,...f})})}function vD(t){const{className:e="",...n}=t,r=`arkynBreadcrumbContainer ${e}`;return B.jsx("nav",{className:r,...n})}function gD(t){const{pathname:e}=Ln.useLocation(),{className:n="",disabled:r=!1,children:i,to:a,...o}=t,u=`arkynBreadcrumbLink ${e===a?"active":"inactive"} ${n}`;return r?B.jsxs("p",{className:u,children:[B.jsx(Ae.ChevronRight,{size:14,strokeWidth:2.5}),i]}):B.jsxs(Ln.Link,{to:a,className:u,...o,children:[B.jsx(Ae.ChevronRight,{size:14,strokeWidth:2.5}),i]})}function Yc(t=""){const e=Ln.useLocation(),n=new URLSearchParams(e.search),r=t?`${t}:`:"",i=a=>{Object.entries(a).forEach(([o,s])=>{s===void 0?n.delete(`${r}${o}`):n.set(`${r}${o}`,String(s))})};return{getParam:a=>n.get(`${r}${a}`),getScopedSearch:a=>{i(a);let o=n.toString();return o&&(o="?"+o),o}}}function mD(t){const{scope:e,totalCountRegisters:n,perPageKey:r="per_page",pageKey:i="page",siblingsCount:a=2,...o}=t,s=Ln.useNavigate(),{getParam:u,getScopedSearch:l}=Yc(e),f=Number(u(i))||1,h=Number(u(r))||20,p=Math.ceil(n/h),g=ld(f,a),y=ud(f,a,p);function v(d){s(l({page:d}))}return B.jsxs("div",{className:"arkynPagination",...o,children:[B.jsx("button",{className:"arkynPaginationIconButton",disabled:f<=1,onClick:()=>v(f-1),children:B.jsx(Ae.ChevronLeft,{})}),f>1+a&&B.jsxs(B.Fragment,{children:[B.jsx("button",{className:"arkynPaginationPageButton",onClick:()=>v(1),children:"1"}),f>2+a&&B.jsx("button",{disabled:!0,className:"arkynPaginationSpread",children:B.jsx(Ae.Ellipsis,{})})]}),g.map((d,D)=>B.jsx("button",{onClick:()=>v(d),className:"arkynPaginationPageButton",children:d},D)),B.jsx("button",{className:"arkynPaginationCurrent",disabled:!0,children:f}),y.map((d,D)=>B.jsx("button",{onClick:()=>v(d),className:"arkynPaginationPageButton",children:d},D)),f+a<p&&B.jsxs(B.Fragment,{children:[f+1+a<p&&B.jsx("button",{disabled:!0,className:"arkynPaginationSpread",children:B.jsx(Ae.Ellipsis,{})}),B.jsx("button",{className:"arkynPaginationPageButton",onClick:()=>v(p),children:p})]}),B.jsx("button",{className:"arkynPaginationIconButton",disabled:f>=p,onClick:()=>v(f+1),children:B.jsx(Ae.ChevronRight,{})})]})}const $a=c.createContext({});function yD(){if(!$a)throw new Error("useTabContext must be used within a TabProvider");return c.useContext($a)}function CD(t){const{children:e,onClick:n,defaultActive:r,className:i,...a}=t,[o,s]=c.useState(r||""),[u,l]=c.useState(!0),f=c.useRef(null),h=`arkynTabContainer ${i||""}`,[p,g]=c.useState({width:"0px",left:"0px",transition:"none"}),y=(d,D)=>{const x=d.getBoundingClientRect(),E=f.current.getBoundingClientRect(),O=D?void 0:"none";l(!1),g({transition:O,width:`${x.width}px`,left:`${x.left-E.left}px`})};c.useEffect(()=>{const d=f.current;if(!d)return;let D=null;D=d.querySelector("button.activeTrue"),D&&y(D)},[]);const v=d=>{const D=d.target;D&&(s(D.value),D.classList.add("activeTrue"),y(D,!0),n&&n(D.value))};return B.jsxs("nav",{ref:f,className:h.trim(),...a,children:[B.jsx($a.Provider,{value:{handleTabClick:v,showInitialTab:u,value:o},children:e}),B.jsx("div",{className:"activeLine",style:p})]})}function DD(t){const{children:e,className:n="",onClick:r,...i}=t,{value:a,showInitialTab:o,handleTabClick:s}=yD(),u=a===i.value&&a?"activeTrue":"activeFalse",f=`arkynTabButton ${a===i.value&&o?"showBorderBottom":""} ${u} ${n}`;function h(p){s(p),r&&r(p)}return B.jsx("button",{onClick:h,className:f.trim(),...i,children:e})}const Zc=c.createContext({});function bD(t){const{isVisibled:e,makeInvisible:n,orientation:r="left",children:i,className:a,...o}=t,s=r==="left"?"-100%":"100%",l=`arkynDrawerContainer ${r} ${e?"visibleTrue":"visibleFalse"} ${a}`;return B.jsx(Zc.Provider,{value:{makeInvisible:n},children:B.jsx(cn.AnimatePresence,{children:e&&B.jsxs("aside",{className:l.trim(),...o,children:[B.jsx(cn.motion.div,{className:"arkynDrawerContainerOverlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n}),B.jsx(cn.motion.div,{className:"arkynDrawerContainerContent",transition:{ease:"easeOut",duration:.15},initial:{transform:`translateX(${s})`},animate:{transform:"translateX(0px)"},exit:{transform:`translateX(${s})`},children:i})]})})})}function ED(t){const{showCloseButton:e=!0,className:n,children:r,...i}=t,{makeInvisible:a}=c.useContext(Zc),o=`arkynDrawerHeader ${n}`;return B.jsxs("header",{className:o.trim(),...i,children:[r,e&&B.jsx("button",{className:"arkynDrawerHeaderCloseButton",type:"button",onClick:a,"aria-label":"Close drawer",children:B.jsx(Ae.X,{size:24})})]})}const Kc=c.createContext({});function wD(t){const{isVisibled:e,makeInvisible:n,children:r,className:i="",...a}=t,s=`arkynModalContainer ${e?"visibleTrue":"visibleFalse"} ${i}`;return B.jsx(Kc.Provider,{value:{makeInvisible:n},children:B.jsx(cn.AnimatePresence,{children:e&&B.jsxs("aside",{className:s.trim(),...a,children:[B.jsx(cn.motion.div,{className:"arkynModalContainerOverlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:n}),B.jsx(cn.motion.div,{className:"arkynModalContainerContent",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0,scale:.75},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},children:r})]})})})}function xD(t){const{alignment:e="right",className:n,...r}=t,i=`arkynModalFooter ${e} ${n}`;return B.jsx("footer",{className:i.trim(),...r})}function BD(t){const{showCloseButton:e=!0,className:n,children:r,...i}=t,{makeInvisible:a}=c.useContext(Kc),o=`arkynModalHeader ${n}`;return B.jsxs("header",{className:o.trim(),...i,children:[r,e&&B.jsx("button",{type:"button",onClick:a,"aria-label":"Close modal button",className:"arkynModalHeaderCloseButton",children:B.jsx(Ae.X,{size:24})})]})}function SD(t){const{children:e,button:n,closeOnClick:r,orientation:i="bottomLeft"}=t,[a,o]=c.useState(!1),u=`arkynPopover ${i} ${a?"visibleTrue":"visibleFalse"}`;function l(){a||o(!0)}return B.jsxs("div",{className:u,onClick:l,children:[n,B.jsx(cn.motion.div,{style:{visibility:a?"visible":"hidden"},transition:{ease:"easeOut",duration:0},initial:{opacity:0},animate:{opacity:a?1:0},exit:{opacity:0},onClick:()=>r&&o(!1),className:"arkynPopoverContent",children:e}),a&&B.jsx("div",{onClick:()=>o(!1),className:"arkynPopoverOverlay"})]})}function Xc(t){const{message:e,title:n,type:r,size:i="lg"}=t,a=`arkynToast ${r} ${i}`;function o(){switch(r){case"info":return B.jsx(Ae.Info,{});case"success":return B.jsx(Ae.CheckCircle2,{});case"danger":return B.jsx(Ae.XCircle,{});case"warning":return B.jsx(Ae.AlertCircle,{});default:return B.jsx(Ae.Info,{})}}return B.jsxs("aside",{className:a,children:[B.jsxs("div",{children:[B.jsx("div",{className:"bg"}),B.jsx(o,{})]}),B.jsxs("p",{children:[B.jsx("strong",{title:n,children:n}),B.jsx("span",{children:e})]})]})}function AD(t){const{text:e,size:n="lg",children:r,orientation:i="top",className:a="",...o}=t,s=`arkynTooltip ${n} ${i} ${a}`;return B.jsxs("div",{className:s.trim(),...o,children:[r,B.jsx("div",{className:"arkynTooltipText",children:e})]})}var nt={},eo={},fr={},dr={},Jc="Expected a function",Qc=NaN,LD="[object Symbol]",OD=/^\s+|\s+$/g,PD=/^[-+]0x[0-9a-f]+$/i,MD=/^0b[01]+$/i,FD=/^0o[0-7]+$/i,kD=parseInt,TD=typeof qe=="object"&&qe&&qe.Object===Object&&qe,RD=typeof self=="object"&&self&&self.Object===Object&&self,ID=TD||RD||Function("return this")(),jD=Object.prototype,ND=jD.toString,_D=Math.max,zD=Math.min,to=function(){return ID.Date.now()};function WD(t,e,n){var r,i,a,o,s,u,l=0,f=!1,h=!1,p=!0;if(typeof t!="function")throw new TypeError(Jc);e=$c(e)||0,di(n)&&(f=!!n.leading,h="maxWait"in n,a=h?_D($c(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p);function g(w){var A=r,M=i;return r=i=void 0,l=w,o=t.apply(M,A),o}function y(w){return l=w,s=setTimeout(D,e),f?g(w):o}function v(w){var A=w-u,M=w-l,V=e-A;return h?zD(V,a-M):V}function d(w){var A=w-u,M=w-l;return u===void 0||A>=e||A<0||h&&M>=a}function D(){var w=to();if(d(w))return x(w);s=setTimeout(D,v(w))}function x(w){return s=void 0,p&&r?g(w):(r=i=void 0,o)}function E(){s!==void 0&&clearTimeout(s),l=0,r=u=i=s=void 0}function O(){return s===void 0?o:x(to())}function b(){var w=to(),A=d(w);if(r=arguments,i=this,u=w,A){if(s===void 0)return y(u);if(h)return s=setTimeout(D,e),g(u)}return s===void 0&&(s=setTimeout(D,e)),o}return b.cancel=E,b.flush=O,b}function UD(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(Jc);return di(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),WD(t,e,{leading:r,maxWait:e,trailing:i})}function di(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function HD(t){return!!t&&typeof t=="object"}function VD(t){return typeof t=="symbol"||HD(t)&&ND.call(t)==LD}function $c(t){if(typeof t=="number")return t;if(VD(t))return Qc;if(di(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=di(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(OD,"");var n=MD.test(t);return n||FD.test(t)?kD(t.slice(2),n?2:8):PD.test(t)?Qc:+t}var qD=UD,pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.addPassiveEventListener=function(e,n,r){var i=r.name;i||(i=n,console.warn("Listener must be a named function.")),pi.has(n)||pi.set(n,new Set);var a=pi.get(n);if(!a.has(i)){var o=function(){var s=!1;try{var u=Object.defineProperty({},"passive",{get:function(){s=!0}});window.addEventListener("test",null,u)}catch{}return s}();e.addEventListener(n,r,o?{passive:!0}:!1),a.add(i)}},pr.removePassiveEventListener=function(e,n,r){e.removeEventListener(n,r),pi.get(n).delete(r.name||n)};var pi=new Map;Object.defineProperty(dr,"__esModule",{value:!0});var GD=qD,YD=KD(GD),ZD=pr;function KD(t){return t&&t.__esModule?t:{default:t}}var XD=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66;return(0,YD.default)(e,n)},$e={spyCallbacks:[],spySetState:[],scrollSpyContainers:[],mount:function(e,n){if(e){var r=XD(function(i){$e.scrollHandler(e)},n);$e.scrollSpyContainers.push(e),(0,ZD.addPassiveEventListener)(e,"scroll",r)}},isMounted:function(e){return $e.scrollSpyContainers.indexOf(e)!==-1},currentPositionX:function(e){if(e===document){var n=window.pageYOffset!==void 0,r=(document.compatMode||"")==="CSS1Compat";return n?window.pageXOffset:r?document.documentElement.scrollLeft:document.body.scrollLeft}else return e.scrollLeft},currentPositionY:function(e){if(e===document){var n=window.pageXOffset!==void 0,r=(document.compatMode||"")==="CSS1Compat";return n?window.pageYOffset:r?document.documentElement.scrollTop:document.body.scrollTop}else return e.scrollTop},scrollHandler:function(e){var n=$e.scrollSpyContainers[$e.scrollSpyContainers.indexOf(e)].spyCallbacks||[];n.forEach(function(r){return r($e.currentPositionX(e),$e.currentPositionY(e))})},addStateHandler:function(e){$e.spySetState.push(e)},addSpyHandler:function(e,n){var r=$e.scrollSpyContainers[$e.scrollSpyContainers.indexOf(n)];r.spyCallbacks||(r.spyCallbacks=[]),r.spyCallbacks.push(e),e($e.currentPositionX(n),$e.currentPositionY(n))},updateStates:function(){$e.spySetState.forEach(function(e){return e()})},unmount:function(e,n){$e.scrollSpyContainers.forEach(function(r){return r.spyCallbacks&&r.spyCallbacks.length&&r.spyCallbacks.indexOf(n)>-1&&r.spyCallbacks.splice(r.spyCallbacks.indexOf(n),1)}),$e.spySetState&&$e.spySetState.length&&$e.spySetState.indexOf(e)>-1&&$e.spySetState.splice($e.spySetState.indexOf(e),1),document.removeEventListener("scroll",$e.scrollHandler)},update:function(){return $e.scrollSpyContainers.forEach(function(e){return $e.scrollHandler(e)})}};dr.default=$e;var jn={},hr={};Object.defineProperty(hr,"__esModule",{value:!0});var JD=function(e,n){var r=e.indexOf("#")===0?e.substring(1):e,i=r?"#"+r:"",a=window&&window.location,o=i?a.pathname+a.search+i:a.pathname+a.search;n?history.pushState(history.state,"",o):history.replaceState(history.state,"",o)},QD=function(){return window.location.hash.replace(/^#/,"")},$D=function(e){return function(n){return e.contains?e!=n&&e.contains(n):!!(e.compareDocumentPosition(n)&16)}},eb=function(e){return getComputedStyle(e).position!=="static"},no=function(e,n){for(var r=e.offsetTop,i=e.offsetParent;i&&!n(i);)r+=i.offsetTop,i=i.offsetParent;return{offsetTop:r,offsetParent:i}},tb=function(e,n,r){if(r)return e===document?n.getBoundingClientRect().left+(window.scrollX||window.pageXOffset):getComputedStyle(e).position!=="static"?n.offsetLeft:n.offsetLeft-e.offsetLeft;if(e===document)return n.getBoundingClientRect().top+(window.scrollY||window.pageYOffset);if(eb(e)){if(n.offsetParent!==e){var i=function(f){return f===e||f===document},a=no(n,i),o=a.offsetTop,s=a.offsetParent;if(s!==e)throw new Error("Seems containerElement is not an ancestor of the Element");return o}return n.offsetTop}if(n.offsetParent===e.offsetParent)return n.offsetTop-e.offsetTop;var u=function(f){return f===document};return no(n,u).offsetTop-no(e,u).offsetTop};hr.default={updateHash:JD,getHash:QD,filterElementInContainer:$D,scrollOffset:tb};var hi={},ro={};Object.defineProperty(ro,"__esModule",{value:!0}),ro.default={defaultEasing:function(e){return e<.5?Math.pow(e*2,2)/2:1-Math.pow((1-e)*2,2)/2},linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:-1+(4-2*e)*e},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}};var io={};Object.defineProperty(io,"__esModule",{value:!0});var nb=pr,rb=["mousedown","mousewheel","touchmove","keydown"];io.default={subscribe:function(e){return typeof document<"u"&&rb.forEach(function(n){return(0,nb.addPassiveEventListener)(document,n,e)})}};var vr={};Object.defineProperty(vr,"__esModule",{value:!0});var ao={registered:{},scrollEvent:{register:function(e,n){ao.registered[e]=n},remove:function(e){ao.registered[e]=null}}};vr.default=ao,Object.defineProperty(hi,"__esModule",{value:!0});var ib=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ab=hr;vi(ab);var ob=ro,ef=vi(ob),sb=io,ub=vi(sb),lb=vr,Nt=vi(lb);function vi(t){return t&&t.__esModule?t:{default:t}}var tf=function(e){return ef.default[e.smooth]||ef.default.defaultEasing},cb=function(e){return typeof e=="function"?e:function(){return e}},fb=function(){if(typeof window<"u")return window.requestAnimationFrame||window.webkitRequestAnimationFrame},oo=function(){return fb()||function(t,e,n){window.setTimeout(t,n||1e3/60,new Date().getTime())}}(),nf=function(){return{currentPosition:0,startPosition:0,targetPosition:0,progress:0,duration:0,cancel:!1,target:null,containerElement:null,to:null,start:null,delta:null,percent:null,delayTimeout:null}},rf=function(e){var n=e.data.containerElement;if(n&&n!==document&&n!==document.body)return n.scrollLeft;var r=window.pageXOffset!==void 0,i=(document.compatMode||"")==="CSS1Compat";return r?window.pageXOffset:i?document.documentElement.scrollLeft:document.body.scrollLeft},af=function(e){var n=e.data.containerElement;if(n&&n!==document&&n!==document.body)return n.scrollTop;var r=window.pageXOffset!==void 0,i=(document.compatMode||"")==="CSS1Compat";return r?window.pageYOffset:i?document.documentElement.scrollTop:document.body.scrollTop},db=function(e){var n=e.data.containerElement;if(n&&n!==document&&n!==document.body)return n.scrollWidth-n.offsetWidth;var r=document.body,i=document.documentElement;return Math.max(r.scrollWidth,r.offsetWidth,i.clientWidth,i.scrollWidth,i.offsetWidth)},pb=function(e){var n=e.data.containerElement;if(n&&n!==document&&n!==document.body)return n.scrollHeight-n.offsetHeight;var r=document.body,i=document.documentElement;return Math.max(r.scrollHeight,r.offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight)},hb=function t(e,n,r){var i=n.data;if(!n.ignoreCancelEvents&&i.cancel){Nt.default.registered.end&&Nt.default.registered.end(i.to,i.target,i.currentPositionY);return}if(i.delta=Math.round(i.targetPosition-i.startPosition),i.start===null&&(i.start=r),i.progress=r-i.start,i.percent=i.progress>=i.duration?1:e(i.progress/i.duration),i.currentPosition=i.startPosition+Math.ceil(i.delta*i.percent),i.containerElement&&i.containerElement!==document&&i.containerElement!==document.body?n.horizontal?i.containerElement.scrollLeft=i.currentPosition:i.containerElement.scrollTop=i.currentPosition:n.horizontal?window.scrollTo(i.currentPosition,0):window.scrollTo(0,i.currentPosition),i.percent<1){var a=t.bind(null,e,n);oo.call(window,a);return}Nt.default.registered.end&&Nt.default.registered.end(i.to,i.target,i.currentPosition)},so=function(e){e.data.containerElement=e?e.containerId?document.getElementById(e.containerId):e.container&&e.container.nodeType?e.container:document:null},gr=function(e,n,r,i){n.data=n.data||nf(),window.clearTimeout(n.data.delayTimeout);var a=function(){n.data.cancel=!0};if(ub.default.subscribe(a),so(n),n.data.start=null,n.data.cancel=!1,n.data.startPosition=n.horizontal?rf(n):af(n),n.data.targetPosition=n.absolute?e:e+n.data.startPosition,n.data.startPosition===n.data.targetPosition){Nt.default.registered.end&&Nt.default.registered.end(n.data.to,n.data.target,n.data.currentPosition);return}n.data.delta=Math.round(n.data.targetPosition-n.data.startPosition),n.data.duration=cb(n.duration)(n.data.delta),n.data.duration=isNaN(parseFloat(n.data.duration))?1e3:parseFloat(n.data.duration),n.data.to=r,n.data.target=i;var o=tf(n),s=hb.bind(null,o,n);if(n&&n.delay>0){n.data.delayTimeout=window.setTimeout(function(){Nt.default.registered.begin&&Nt.default.registered.begin(n.data.to,n.data.target),oo.call(window,s)},n.delay);return}Nt.default.registered.begin&&Nt.default.registered.begin(n.data.to,n.data.target),oo.call(window,s)},gi=function(e){return e=ib({},e),e.data=e.data||nf(),e.absolute=!0,e},vb=function(e){gr(0,gi(e))},gb=function(e,n){gr(e,gi(n))},mb=function(e){e=gi(e),so(e),gr(e.horizontal?db(e):pb(e),e)},yb=function(e,n){n=gi(n),so(n);var r=n.horizontal?rf(n):af(n);gr(e+r,n)};hi.default={animateTopScroll:gr,getAnimationType:tf,scrollToTop:vb,scrollToBottom:mb,scrollTo:gb,scrollMore:yb},Object.defineProperty(jn,"__esModule",{value:!0});var Cb=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Db=hr,bb=uo(Db),Eb=hi,wb=uo(Eb),xb=vr,mi=uo(xb);function uo(t){return t&&t.__esModule?t:{default:t}}var yi={},of=void 0;jn.default={unmount:function(){yi={}},register:function(e,n){yi[e]=n},unregister:function(e){delete yi[e]},get:function(e){return yi[e]||document.getElementById(e)||document.getElementsByName(e)[0]||document.getElementsByClassName(e)[0]},setActiveLink:function(e){return of=e},getActiveLink:function(){return of},scrollTo:function(e,n){var r=this.get(e);if(!r){console.warn("target Element not found");return}n=Cb({},n,{absolute:!1});var i=n.containerId,a=n.container,o=void 0;i?o=document.getElementById(i):a&&a.nodeType?o=a:o=document,n.absolute=!0;var s=n.horizontal,u=bb.default.scrollOffset(o,r,s)+(n.offset||0);if(!n.smooth){mi.default.registered.begin&&mi.default.registered.begin(e,r),o===document?n.horizontal?window.scrollTo(u,0):window.scrollTo(0,u):o.scrollTop=u,mi.default.registered.end&&mi.default.registered.end(e,r);return}wb.default.animateTopScroll(u,n,e,r)}};var lo={exports:{}},Ci={exports:{}},Ue={};/** @license React v16.13.1
93
93
  * react-is.production.min.js
94
94
  *
95
95
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1 +1 @@
1
- {"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../../../../src/components/RichText/functions/deserialize.ts"],"names":[],"mappings":"AA8CA,QAAA,MAAM,gBAAgB,SAAU,MAAM,mFAarC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../../../../src/components/RichText/functions/deserialize.ts"],"names":[],"mappings":"AAiDA,QAAA,MAAM,gBAAgB,SAAU,MAAM,mFAarC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -8,6 +8,7 @@ const deserialize = (el) => {
8
8
  const children = Array.isArray(el.props.children)
9
9
  ? parsedChildren(el.props.children)
10
10
  : [{ text: el.props.children }];
11
+ const childrenString = typeof el.props.children === "string" ? el.props.children : "";
11
12
  switch (el.type) {
12
13
  case "p":
13
14
  return { type: "paragraph", children };
@@ -24,15 +25,15 @@ const deserialize = (el) => {
24
25
  case "ol":
25
26
  return { type: "numberedList", children };
26
27
  case "strong":
27
- return { text: "", children, bold: true };
28
+ return { text: childrenString, bold: true };
28
29
  case "code":
29
- return { text: "", children, code: true };
30
+ return { text: childrenString, code: true };
30
31
  case "em":
31
- return { text: "", children, italic: true };
32
+ return { text: childrenString, italic: true };
32
33
  case "u":
33
- return { text: "", children, underline: true };
34
+ return { text: childrenString, underline: true };
34
35
  default:
35
- return { text: "", children };
36
+ return { text: childrenString };
36
37
  }
37
38
  };
38
39
  const getSlateFromHtml = (html) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/components",
3
- "version": "1.3.121",
3
+ "version": "1.3.122",
4
4
  "main": "./dist/bundle.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Lucas Gonçalves",
@@ -16,6 +16,9 @@ const deserialize = (el: ParseElement): Descendant => {
16
16
  ? parsedChildren(el.props.children)
17
17
  : [{ text: el.props.children }];
18
18
 
19
+ const childrenString =
20
+ typeof el.props.children === "string" ? el.props.children : "";
21
+
19
22
  switch (el.type) {
20
23
  case "p":
21
24
  return { type: "paragraph", children };
@@ -32,15 +35,15 @@ const deserialize = (el: ParseElement): Descendant => {
32
35
  case "ol":
33
36
  return { type: "numberedList", children };
34
37
  case "strong":
35
- return { text: "", children, bold: true };
38
+ return { text: childrenString, bold: true };
36
39
  case "code":
37
- return { text: "", children, code: true };
40
+ return { text: childrenString, code: true };
38
41
  case "em":
39
- return { text: "", children, italic: true };
42
+ return { text: childrenString, italic: true };
40
43
  case "u":
41
- return { text: "", children, underline: true };
44
+ return { text: childrenString, underline: true };
42
45
  default:
43
- return { text: "", children };
46
+ return { text: childrenString };
44
47
  }
45
48
  };
46
49
 
@@ -77,8 +77,8 @@ function RichText({
77
77
 
78
78
  function handleChange(value: Descendant[]) {
79
79
  const text = extractText(value);
80
- setCharactersCount(text.length);
81
80
 
81
+ setCharactersCount(text.length);
82
82
  onChangeCharactersCount && onChangeCharactersCount(text.length);
83
83
 
84
84
  if (enforceCharacterLimit && text.length >= maxLimit) {