PageSourceSearch

https://educaler.us/_next/static/chunks/7914-f88cb4b507e6e206.js

js educaler.us collected 2026-10-02 01:10:59 UTC 86,065 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7914],{60282:function(e,t,n){n.d(t,{v:function(){return a}});var r=n(85893);function a(){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",children:(0,r.jsx)("path",{d:"M4.65346 5.27321L4.65351 5.27326C4.74613 5.36315 4.87487 5.41626 5.01218 5.41634L4.65346 5.27321ZM4.65346 5.27321L0.653461 1.39227L0.653513 1.39221M4.65346 5.27321L0.653513 1.39221M0.653513 1.39221L0.647178 1.38628M0.653513 1.39221L0.647178 1.38628M0.647178 1.38628C0.600049 1.34211 0.563329 1.29012 0.53838 1.23377C0.513448 1.17746 0.500558 1.11747 0.500018 1.0572C0.499478 0.996917 0.511292 0.936773 0.53518 0.880124C0.559084 0.823437 0.594812 0.770914 0.641065 0.726037C0.687352 0.681129 0.743225 0.644826 0.805809 0.619983C0.868417 0.595131 0.935999 0.582449 1.00447 0.583027C1.07295 0.583604 1.14025 0.597422 1.20234 0.623298C1.2644 0.649163 1.31953 0.686352 1.36493 0.731958L1.36488 0.732011M0.647178 1.38628L1.36488 0.732011M1.36488 0.732011L1.37112 0.738063M1.36488 0.732011L1.37112 0.738063M1.37112 0.738063L4.66411 3.93305L5.01229 4.27086M1.37112 0.738063L5.01229 4.27086M5.01229 4.27086L5.36046 3.93305M5.01229 4.27086L5.36046 3.93305M5.36046 3.93305L8.6498 0.741616C8.74294 0.65561 8.86992 0.605738 9.00447 0.606872C9.14029 0.608017 9.26731 0.660982 9.35893 0.749883C9.45007 0.838307 9.49892 0.954719 9.49998 1.07314C9.50103 1.19042 9.45518 1.30638 9.36745 1.39582L5.37112 5.27321L5.37106 5.27326M5.36046 3.93305L5.37106 5.27326M5.37106 5.27326C5.27844 5.36315 5.1497 5.41626 5.01239 5.41634L5.37106 5.27326Z",fill:"#6B7280",stroke:"#6B7280"})})}n(67294)},67914:function(e,t,n){n.d(t,{Z:function(){return tw}});var r,a,l=n(85893),i=n(67294),s=n(70573),o=n(88560),c=n(21041),d=n(40999),u=n(46895),m=n(16177),h=n(89357),g=n(20740),p=n(68218),x=n(87012),f=n(42693),b=n(16451),w=n(3506),v=n(12242),j=n(3858),C=n(23605),y=n(79380),k=n(24953),N=n(19135),_=n(18824),E=n(61084);function L(e){let t=window.getComputedStyle(e).getPropertyValue("grid-template-columns");return t?{node:new S(t)}:null}class S extends E.HX{static getType(){return"layout-container"}static clone(e){return new S(e.__templateColumns,e.__key)}createDOM(e){let t=document.createElement("div");return t.style.gridTemplateColumns=this.__templateColumns,"string"==typeof e.theme.layoutContainer&&(0,_.Yo)(t,e.theme.layoutContainer),t}exportDOM(){let e=document.createElement("div");return e.style.gridTemplateColumns=this.__templateColumns,e.setAttribute("data-lexical-layout-container","true"),{element:e}}updateDOM(e,t){return e.__templateColumns!==this.__templateColumns&&(t.style.gridTemplateColumns=this.__templateColumns),!1}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-layout-container")?{conversion:L,priority:2}:null}}static importJSON(e){return new S(e.templateColumns)}isShadowRoot(){return!0}canBeEmpty(){return!1}exportJSON(){return{...super.exportJSON(),templateColumns:this.__templateColumns,type:"layout-container",version:1}}getTemplateColumns(){return this.getLatest().__templateColumns}setTemplateColumns(e){this.getWritable().__templateColumns=e}constructor(e,t){super(t),this.__templateColumns=e}}function A(e){return e instanceof S}class M extends E.HX{static getType(){return"layout-item"}static clone(e){return new M(e.__key)}createDOM(e){let t=document.createElement("div");return"string"==typeof e.theme.layoutItem&&(0,_.Yo)(t,e.theme.layoutItem),t}updateDOM(){return!1}static importDOM(){return{}}static importJSON(){return I()}isShadowRoot(){return!0}exportJSON(){return{...super.exportJSON(),type:"layout-item",version:1}}}function I(){return new M}function B(e){return e instanceof M}var T=n(3421);function O(e){let{nodeKey:t}=e,[n]=(0,u.g)(),[r,a,l]=(0,T.y)(t),s=(0,i.useCallback)(e=>{if(e.preventDefault(),r&&(0,E.iO)((0,E.dL)())){let e=(0,E.gI)(t);if(e instanceof R)return e.remove(),!0}return!1},[r,t]);return(0,i.useEffect)(()=>(0,_.qV)(n.registerCommand(E.Kr,e=>{let i=n.getElementByKey(t);return e.target===i&&(e.shiftKey||l(),a(!r),!0)},E.KB),n.registerCommand(E.MK,s,E.KB),n.registerCommand(E.aR,s,E.KB)),[l,n,r,t,s,a]),(0,i.useEffect)(()=>{let e=n.getElementByKey(t);null!==e&&(e.className=r?"selected":"")},[n,r,t]),null}
1class R extends E.Ij{static getType(){return"page-break"}static clone(e){return new R(e.__key)}static importJSON(e){return P()}static importDOM(){return{figure:e=>e.getAttribute("type")!==this.getType()?null:{conversion:D,priority:E.Eo}}}exportJSON(){return{type:this.getType(),version:1}}createDOM(){let e=document.createElement("figure");return e.style.pageBreakAfter="always",e.setAttribute("type",this.getType()),e}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return(0,l.jsx)(O,{nodeKey:this.__key})}}function D(){return{node:P()}}function P(){return new R}var F=n(22587),z=n(57729);function H(e){let{className:t,format:n,nodeKey:r,videoID:a}=e;return(0,l.jsx)(F.U,{className:t,format:n,nodeKey:r,children:(0,l.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube-nocookie.com/embed/".concat(a),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"YouTube video"})})}function W(e){let t=e.getAttribute("data-lexical-youtube");return t?{node:new K(t)}:null}class K extends z.K{static getType(){return"youtube"}static clone(e){return new K(e.__id,e.__format,e.__key)}static importJSON(e){let t=new K(e.videoID);return t.setFormat(e.format),t}exportJSON(){return{...super.exportJSON(),type:"youtube",version:1,videoID:this.__id}}exportDOM(){let e=document.createElement("iframe");return e.setAttribute("data-lexical-youtube",this.__id),e.setAttribute("width","560"),e.setAttribute("height","315"),e.setAttribute("src","https://www.youtube-nocookie.com/embed/".concat(this.__id)),e.setAttribute("frameborder","0"),e.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),e.setAttribute("allowfullscreen","true"),e.setAttribute("title","YouTube video"),{element:e}}static importDOM(){return{iframe:e=>e.hasAttribute("data-lexical-youtube")?{conversion:W,priority:1}:null}}updateDOM(){return!1}getId(){return this.__id}getTextContent(e,t){return"https://www.youtube.com/watch?v=".concat(this.__id)}decorate(e,t){var n,r,a;let i=null!==(n=t.theme.embedBlock)&&void 0!==n?n:{},s={base:null!==(r=i.base)&&void 0!==r?r:"",focus:null!==(a=i.focus)&&void 0!==a?a:""};return(0,l.jsx)(H,{className:s,format:this.__format,nodeKey:this.getKey(),videoID:this.__id})}constructor(e,t,n){super(t,n),this.__id=e}}var q=n(89853),U=n(73935),Z=n(99510),V=n(89476);let J=(0,E.fA)("INSERT_YOUTUBE_COMMAND");function Y(){let[e]=(0,u.g)();return(0,i.useEffect)(()=>{if(!e.hasNodes([K]))throw Error("YouTubePlugin: YouTubeNode not registered on editor");return e.registerCommand(J,e=>{let t=new K(e);return(0,_.z8)(t),!0},E.VN)},[e]),null}var $=n(12416);let X=[{contentName:"V\xeddeo do Youtube",exampleUrl:"https://www.youtube.com/watch?v=jNQXAC9IVRw",icon:(0,l.jsx)("i",{className:"icon youtube"}),insertNode:(e,t)=>{e.dispatchCommand(J,t.id)},keywords:["youtube","video"],parseUrl:async e=>{let t=/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/.exec(e),n=t&&(null==t?void 0:t[2].length)===11?t[2]:null;return null!=n?{id:n,url:e}:null},type:"youtube-video"}];function G(e){let{index:t,isSelected:n,onClick:r,onMouseEnter:a,option:i}=e,s="item";return n&&(s+=" selected"),(0,l.jsx)("li",{tabIndex:-1,className:s,ref:i.setRefElement,role:"option","aria-selected":n,id:"typeahead-item-"+t,onMouseEnter:a,onClick:r,children:(0,l.jsx)("span",{className:"text",children:i.title})},i.key)}function Q(e){let{options:t,selectedItemIndex:n,onOptionClick:r,onOptionMouseEnter:a}=e;return(0,l.jsx)("div",{className:"typeahead-popover",children:(0,l.jsx)("ul",{children:t.map((e,t)=>(0,l.jsx)(G,{index:t,isSelected:n===t,onClick:()=>r(e,t),onMouseEnter:()=>a(t),option:e},e.key))})})}let ee=(e,t)=>{let n;return r=>{window.clearTimeout(n),n=window.setTimeout(()=>{e(r)},t)}};function et(e){let{embedConfig:t,onClose:n}=e,[r,a]=(0,i.useState)(""),[s]=(0,u.g)(),[o,c]=(0,i.useState)(null),d=(0,i.useMemo)(()=>ee(e=>{let n=q.HI.exec(e);null!=t&&null!=e&&null!=n?Promise.resolve(t.parseUrl(e)).then(e=>{c(e)}):null!=o&&c(null)},200),[t,o]);return(0,l.jsxs)("div",{className:"flex max-w-md flex-col",children:[(0,l.jsx)("div",{className:"mb-2 block",children:(0,l.jsx)($.__,{value:"URL do V\xeddeo"})}),(0,l.jsx)($.oi,{type:"text",placeholder:t.exampleUrl,value:r,onChange:e=>{let{value:t}=e.target;a(t),d(t)}}),(0,l.jsx)(V.k,{children:(0,l.jsx)($.zx,{className:"mt-6",disabled:!o,onClick:()=>
1{null!=o&&(t.insertNode(s,o),n())},"data-test-id":"".concat(t.type,"-embed-modal-submit-btn"),children:"Adicionar V\xeddeo"})})]})}function en(){let[e,t]=(0,Z.Z)();return(0,l.jsxs)(l.Fragment,{children:[e,(0,l.jsx)(q.vK,{embedConfigs:X,onOpenEmbedModalForConfig:e=>{t("Embed ".concat(e.contentName),t=>(0,l.jsx)(et,{embedConfig:e,onClose:t}))},getMenuOptions:(e,t,n)=>[new q.WX("Dismiss",{onSelect:n}),new q.WX("Embed ".concat(e.contentName),{onSelect:t})],menuRenderFn:(e,t)=>{let{selectedIndex:n,options:r,selectOptionAndCleanUp:a,setHighlightedIndex:i}=t;return e.current?U.createPortal((0,l.jsx)("div",{className:"typeahead-popover auto-embed-menu",style:{marginLeft:"".concat(Math.max(parseFloat(e.current.style.width)-200,0),"px"),width:200},children:(0,l.jsx)(Q,{options:r,selectedItemIndex:n,onOptionClick:(e,t)=>{i(t),a(e)},onOptionMouseEnter:e=>{i(e)}})}),e.current):null}})]})}var er=n(2451);let ea=[(0,er.v)(/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,e=>e.startsWith("http")?e:"https://".concat(e)),(0,er.v)(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,e=>"mailto:".concat(e))];function el(){return(0,l.jsx)(er.$,{matchers:ea})}let ei=e=>{var t;return void 0!==(null==e?void 0:null===(t=e.document)||void 0===t?void 0:t.createElement)};function es(e){let{accept:t,label:n,onChange:r,"data-test-id":a}=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-2 block",children:(0,l.jsx)($.__,{htmlFor:"file-upload",value:n})}),(0,l.jsx)($.S2,{id:"file-upload",accept:t,itemType:"file",onChange:e=>r(e.target.files)})]})}var eo=n(64438);let ec=e=>ei(e)?(null!=e?e:window).getSelection():null,ed=(0,E.fA)("INSERT_IMAGE_COMMAND");function eu(e){let{onClick:t}=e,[n,r]=(0,i.useState)(""),[a,s]=(0,i.useState)("");return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(eo.Z,{label:"URL da Imagem",placeholder:"Ex.: https://source.unsplash.com/random",onChange:r,value:n,"data-test-id":"image-modal-url-input"}),(0,l.jsx)(eo.Z,{label:"Descri\xe7\xe3o da Imagem",placeholder:"Minha Imagem",onChange:s,value:a,"data-test-id":"image-modal-alt-text-input"}),(0,l.jsx)(V.k,{children:(0,l.jsx)($.zx,{className:"mt-4","data-test-id":"image-modal-confirm-btn",disabled:""===n,onClick:()=>t({altText:a,src:n}),children:"Inserir Imagem"})})]})}function em(e){let{onClick:t}=e,[n,r]=(0,i.useState)(""),[a,s]=(0,i.useState)("");return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(es,{label:"Imagem",onChange:e=>{let t=new FileReader;t.onload=function(){return"string"==typeof t.result&&r(t.result),""},null!==e&&t.readAsDataURL(e[0])},accept:"image/*","data-test-id":"image-modal-file-upload"}),(0,l.jsx)(eo.Z,{label:"Descri\xe7\xe3o da Imagem",placeholder:"Minha Imagem",onChange:s,value:a,"data-test-id":"image-modal-alt-text-input"}),(0,l.jsx)(V.k,{children:(0,l.jsx)($.zx,{className:"mt-4","data-test-id":"image-modal-file-upload-btn",disabled:""===n,onClick:()=>t({altText:a,src:n}),children:"Inserir Imagem"})})]})}function eh(e){let{activeEditor:t,onClose:n}=e,[r,a]=(0,i.useState)(null),s=(0,i.useRef)(!1);(0,i.useEffect)(()=>{s.current=!1;let e=e=>{s.current=e.altKey};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);let o=e=>{t.dispatchCommand(ed,e),n()};return(0,l.jsxs)(l.Fragment,{children:[!r&&(0,l.jsxs)(V.a,{children:[(0,l.jsx)("p",{className:"text-base leading-relaxed text-gray-500",children:"Qual tipo de imagem deseja adicionar?"}),(0,l.jsxs)("div",{className:"mt-4 flex flex-row gap-4",children:[(0,l.jsx)($.zx,{"data-test-id":"image-modal-option-url",onClick:()=>a("url"),children:"URL"}),(0,l.jsx)($.zx,{"data-test-id":"image-modal-option-file",onClick:()=>a("file"),children:"Arquivo"})]})]}),"url"===r&&(0,l.jsx)(eu,{onClick:o}),"file"===r&&(0,l.jsx)(em,{onClick:o})]})}function eg(e){let{captionsEnabled:t}=e,[n]=(0,u.g)();return(0,i.useEffect)(()=>{if(!n.hasNodes([k.HJ]))throw Error("ImagesPlugin: ImageNode not registered on editor");return(0,_.qV)(n.registerCommand(ed,e=>{let t=(0,k.HB)(e);return(0,E.od)([t]),(0,E._v)(t.getParentOrThrow())&&(0,_.JB)(t,E.BE).selectEnd(),!0},E.VN),n.registerCommand(E.XI,e=>(function(e){let t=ep();if(!t)return!1;let n=e.dataTransfer;return!!n&&(n.setData("text/plain","_"),n.setDragImage(img,0,0),n.setData("application/x-lexical-drag",JSON.stringify({data:{altText:t.__altText,caption:t.__caption,height:t.__height,key:t.getKey(),maxWidth:t.__maxWidth,showCaption:t.__showCaption,src:t.__src,width:t.__width},type:"image"})),!0)})(e),E.Eo),n.registerCommand(E.kE,e=>!!ep()&&(ex(e)||e.preventDefault(),!0),E.KB),n.registerCommand(E.zD,e=>(function(e,t){let n=ep();if(!n)return!1;let r=function(e){var t;let n=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("application/x-lexical-drag");if(!n)return null;let{type:r,data:a}=JSON.parse(n);return"image"!==r?null:a}(e);if(!r)return!1;if(e.preventDefault(),ex(e)){let a=function(e){let t;let n=e.target,r=ec(null==n?null:9===n.nodeType?n.defaultView:n.ownerDocument.defaultView);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&null!==r)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}(e);n.remove();let l=(0,E.vN)();null!=a&&l.applyDOMRange(a),(0,E.oq)(l),t.dispatchCommand(ed,r)}return!0})(e,n),E.Eo))},[t,n]),null}function ep(){let e=(0,E.dL)();if(!(0,E.iO)(e))return null;let t=e.getNodes()[0];return(0,k.dP)(t)?t:null}function ex(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}"undefined"!=typeof document&&(document.createElement("img").src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
1let ef=["image/","image/heic","image/heif","image/gif","image/webp"];function eb(){let[e]=(0,u.g)();return(0,i.useEffect)(()=>e.registerCommand(C.BD,t=>((async()=>{for(let{file:n,result:r}of(await (0,_.j5)(t,[ef].flatMap(e=>e))))(0,_.tV)(n,ef)&&e.dispatchCommand(ed,{altText:n.name,src:r})})(),!0),E.KB),[e]),null}var ew=n(79378);function ev(e){let t=e.anchor,n=e.focus,r=e.anchor.getNode(),a=e.focus.getNode();return r===a?r:e.isBackward()?(0,ew.P4)(n)?r:a:(0,ew.P4)(t)?r:a}function ej(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5,l=n.parentElement;if(null===e||!l){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=l.getBoundingClientRect(),c=e.top-r,d=e.left-a;c<o.top&&(c+=i.height+e.height+2*r),d+i.width>o.right&&(d=o.right-i.width-a),c-=s.top,d-=s.left,t.style.opacity="1",t.style.transform="translate(".concat(d,"px, ").concat(c,"px)")}var eC=n(12401);function ey(e){let{editor:t,isLink:n,setIsLink:r,anchorElem:a,isLinkEditMode:s,setIsLinkEditMode:o}=e,c=(0,i.useRef)(null),d=(0,i.useRef)(null),[u,m]=(0,i.useState)(""),[h,g]=(0,i.useState)("https://"),[p,x]=(0,i.useState)(null),b=(0,i.useCallback)(()=>{let e=(0,E.dL)();if((0,E.OP)(e)){let t=ev(e),n=(0,_.$s)(t,f.Pq);n?m(n.getURL()):(0,f.Pq)(t)?m(t.getURL()):m(""),s&&g(u)}let n=c.current,r=window.getSelection(),l=document.activeElement;if(null===n)return;let i=t.getRootElement();if(null!==e&&null!==r&&null!==i&&i.contains(r.anchorNode)&&t.isEditable()){var d,h;let t=null===(h=r.focusNode)||void 0===h?void 0:null===(d=h.parentElement)||void 0===d?void 0:d.getBoundingClientRect();t&&(t.y+=40,ej(t,n,a)),x(e)}else l&&"link-input"===l.className||(null!==i&&ej(null,n,a),x(null),o(!1),m(""));return!0},[a,t,o,s,u]);(0,i.useEffect)(()=>{let e=a.parentElement,n=()=>{t.getEditorState().read(()=>{b()})};return window.addEventListener("resize",n),e&&e.addEventListener("scroll",n),()=>{window.removeEventListener("resize",n),e&&e.removeEventListener("scroll",n)}},[a.parentElement,t,b]),(0,i.useEffect)(()=>(0,_.qV)(t.registerUpdateListener(e=>{let{editorState:t}=e;t.read(()=>{b()})}),t.registerCommand(E.oj,()=>(b(),!0),E.KB),t.registerCommand(E.Zq,()=>!!n&&(r(!1),!0),E.Eo)),[t,b,r,n]),(0,i.useEffect)(()=>{t.getEditorState().read(()=>{b()})},[t,b]),(0,i.useEffect)(()=>{s&&d.current&&d.current.focus()},[s,n]);let w=e=>{"Enter"===e.key?(e.preventDefault(),v()):"Escape"===e.key&&(e.preventDefault(),o(!1))},v=()=>{null!==p&&(""!==u&&(t.dispatchCommand(f.k0,(0,eC.N)(h)),t.update(()=>{let e=(0,E.dL)();if((0,E.OP)(e)){let t=ev(e).getParent();if((0,f.Xp)(t)){let e=(0,f.zV)(t.getURL(),{rel:t.__rel,target:t.__target,title:t.__title});t.replace(e,!0)}}})),g("https://"),o(!1))};return n?(0,l.jsx)("div",{ref:c,className:"absolute left-0 top-0 z-10 flex h-8 w-full max-w-xs transform-none rounded-b-lg bg-white opacity-0 shadow-md transition-opacity duration-500",children:n?s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("input",{ref:d,className:"link-input",value:h,onChange:e=>{g(e.target.value)},onKeyDown:e=>{w(e)}}),(0,l.jsxs)("div",{className:"flex flex-row items-center",children:[(0,l.jsx)("div",{className:"link-cancel mx-2 inline-block cursor-pointer rounded-md",role:"button",tabIndex:0,onMouseDown:e=>e.preventDefault(),onClick:()=>{o(!1)},children:(0,l.jsx)("svg",{className:"h-5 w-5 text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m15 9-6 6m0-6 6 6m6-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}),(0,l.jsx)("div",{className:"link-confirm mx-2 inline-block cursor-pointer rounded-md",role:"button",tabIndex:0,onMouseDown:e=>e.preventDefault(),onClick:v,children:(0,l.jsx)("svg",{className:"h-5 w-5 text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8.5 11.5 11 14l4-4m6 2a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})})]})]}):(0,l.jsxs)("div",{className:"flex w-full flex-row items-center gap-2 pr-4",children:[(0,l.jsx)("a",{href:(0,e
1C.N)(u),target:"_blank",rel:"noopener noreferrer",children:u}),(0,l.jsx)("div",{className:"grow"}),(0,l.jsx)("div",{className:"link-edit",role:"button",tabIndex:0,onMouseDown:e=>e.preventDefault(),onClick:()=>{g(u),o(!0)},children:(0,l.jsx)("svg",{className:"h-5 w-5 text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m14.304 4.844 2.852 2.852M7 7H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4.5m2.409-9.91a2.017 2.017 0 0 1 0 2.853l-6.844 6.844L8 14l.713-3.565 6.844-6.844a2.015 2.015 0 0 1 2.852 0Z"})})}),(0,l.jsx)("div",{className:"link-trash",role:"button",tabIndex:0,onMouseDown:e=>e.preventDefault(),onClick:()=>{t.dispatchCommand(f.k0,null)},children:(0,l.jsx)("svg",{className:"h-5 w-5 text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 7h14m-9 3v8m4-8v8M10 3h4a1 1 0 0 1 1 1v3H9V4a1 1 0 0 1 1-1ZM6 7h12v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7Z"})})})]}):null}):(0,l.jsx)("div",{})}function ek(e){let{anchorElem:t=document.body,isLinkEditMode:n,setIsLinkEditMode:r}=e,[a]=(0,u.g)();return function(e,t,n,r){let[a,s]=(0,i.useState)(e),[o,c]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{function t(){let e=(0,E.dL)();if((0,E.OP)(e)){let t=ev(e),n=(0,_.$s)(t,f.Pq),r=(0,_.$s)(t,f.Xp);if(!(null!=n?n:r)){c(!1);return}e.getNodes().filter(e=>!(0,E.A3)(e)).find(e=>{var t,a,l;let i=(0,_.$s)(e,f.Pq),s=(0,_.$s)(e,f.Xp);return null!==(l=null!==(a=null!==(t=n&&!n.is(i))&&void 0!==t?t:i&&!i.is(n))&&void 0!==a?a:r&&!r.is(s))&&void 0!==l?l:s&&!s.is(r)})?c(!1):c(!0)}}return(0,_.qV)(e.registerUpdateListener(e=>{let{editorState:n}=e;n.read(()=>{t()})}),e.registerCommand(E.oj,(e,n)=>(t(),s(n),!1),E.jw),e.registerCommand(E.Kr,e=>{let t=(0,E.dL)();if((0,E.OP)(t)){let n=ev(t),r=(0,_.$s)(n,f.Pq);if((0,f.Pq)(r)&&(e.metaKey||e.ctrlKey))return window.open(r.getURL(),"_blank"),!0}return!1},E.KB))},[e]),(0,U.createPortal)((0,l.jsx)(ey,{editor:a,isLink:o,anchorElem:t,setIsLink:c,isLinkEditMode:n,setIsLinkEditMode:r}),t)}(a,t,n,r)}var eN=n(20102);let e_=e=>ei(e)?(null!=e?e:window).getSelection():null,eE=(0,E.fA)("INSERT_INLINE_IMAGE_COMMAND");function eL(e){let{activeEditor:t,onClose:n}=e,r=(0,i.useRef)(!1),[a,s]=(0,i.useState)(""),[o,c]=(0,i.useState)(""),[d,u]=(0,i.useState)(!1),[m,h]=(0,i.useState)("left");(0,i.useEffect)(()=>{r.current=!1;let e=e=>{r.current=e.altKey};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t]);let g=()=>{t.dispatchCommand(eE,{altText:o,position:m,showCaption:d,src:a}),n()};return(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{style:{marginBottom:"1em"},children:(0,l.jsx)(es,{label:"Image Upload",onChange:e=>{let t=new FileReader;t.onload=function(){return"string"==typeof t.result&&s(t.result),""},null!==e&&t.readAsDataURL(e[0])},accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,l.jsx)("div",{style:{marginBottom:"1em"},children:(0,l.jsx)(eo.Z,{label:"Alt Text",placeholder:"Descriptive alternative text",onChange:c,value:o,"data-test-id":"image-modal-alt-text-input"})}),(0,l.jsxs)(eN.Z,{label:"Posicionamento",name:"position",id:"position-select",onChange:e=>{h(e.target.value)},children:[(0,l.jsx)("option",{value:"left",children:"Esquerda"}),(0,l.jsx)("option",{value:"right",children:"Direita"}),(0,l.jsx)("option",{value:"full",children:"Largura Completa"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)($.XZ,{id:"caption",checked:d,onChange:e=>{u(e.target.checked)}}),(0,l.jsx)($.__,{htmlFor:"caption",children:"Exibir Descri\xe7\xe3o"})]}),(0,l.jsx)(V.k,{children:(0,l.jsx)($.zx,{"data-test-id":"image-modal-file-upload-btn",disabled:""===a,onClick:()=>g(),children:"Inserir Imagem"})})]})}function eS(){let[e]=(0,u.g)();return(0,i.useEffect)(()=>
1{if(!e.hasNodes([N.jy]))throw Error("ImagesPlugin: ImageNode not registered on editor");return(0,_.qV)(e.registerCommand(eE,e=>{let t=(0,N.nU)(e);return(0,E.od)([t]),(0,E._v)(t.getParentOrThrow())&&(0,_.JB)(t,E.BE).selectEnd(),!0},E.VN),e.registerCommand(E.XI,e=>(function(e){let t=eA();if(!t)return!1;let n=e.dataTransfer;return!!n&&(n.setData("text/plain","_"),n.setDragImage(img,0,0),n.setData("application/x-lexical-drag",JSON.stringify({data:{altText:t.__altText,caption:t.__caption,height:t.__height,key:t.getKey(),showCaption:t.__showCaption,src:t.__src,width:t.__width},type:"image"})),!0)})(e),E.Eo),e.registerCommand(E.kE,e=>!!eA()&&(eM(e)||e.preventDefault(),!0),E.KB),e.registerCommand(E.zD,t=>(function(e,t){let n=eA();if(!n)return!1;let r=function(e){var t;let n=null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("application/x-lexical-drag");if(!n)return null;let{type:r,data:a}=JSON.parse(n);return"image"!==r?null:a}(e);if(!r)return!1;if(e.preventDefault(),eM(e)){let a=function(e){let t;let n=e.target,r=e_(null==n?null:9===n.nodeType?n.defaultView:n.ownerDocument.defaultView);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&null!==r)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}(e);n.remove();let l=(0,E.vN)();null!=a&&l.applyDOMRange(a),(0,E.oq)(l),t.dispatchCommand(eE,r)}return!0})(t,e),E.Eo))},[e]),null}function eA(){let e=(0,E.dL)();if(!(0,E.iO)(e))return null;let t=e.getNodes()[0];return(0,N.sU)(t)?t:null}function eM(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}"undefined"!=typeof document&&(document.createElement("img").src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");var eI=n(70564);let eB=i.createContext(null);function eT(e){let{children:t,className:n,onClick:r,title:a}=e,s=(0,i.useRef)(null),o=i.useContext(eB);if(null===o)throw Error("DropDownItem must be used within a DropDown");let{registerItem:c}=o;return(0,i.useEffect)(()=>{s&&s.current&&c(s)},[s,c]),(0,l.jsx)("button",{className:n,onClick:r,ref:s,title:a,type:"button",children:t})}function eO(e){let{disabled:t=!1,buttonLabel:n,buttonAriaLabel:r,buttonClassName:a,buttonIconClassName:s,children:o,stopCloseOnClickSelf:c}=e,d=(0,i.useRef)(null),u=(0,i.useRef)(null),[m,h]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=u.current,t=d.current;if(m&&null!==e&&null!==t){let{top:n,left:r}=e.getBoundingClientRect();t.style.top="".concat(n+40,"px"),t.style.left="".concat(Math.min(r,window.innerWidth-t.offsetWidth-20),"px")}},[d,u,m]),(0,i.useEffect)(()=>{let e=u.current;if(null!==e&&m){let t=t=>{let n=t.target;!(c&&d.current&&d.current.contains(n))&&(e.contains(n)||h(!1))};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}}},[d,u,m,c]),(0,l.jsx)($.Lt,{label:s,children:(0,l.jsx)($.Lt.Header,{children:o})})}let eR=(0,E.fA)(),eD=(0,E.fA)();function eP(){let[e]=(0,u.g)();return(0,i.useEffect)(()=>{if(!e.hasNodes([S,M]))throw Error("LayoutPlugin: LayoutContainerNode, or LayoutItemNode not registered on editor");let t=e=>{let t=(0,E.dL)();if((0,E.OP)(t)&&t.isCollapsed()&&0===t.anchor.offset){let a=(0,_.$s)(t.anchor.getNode(),A);if(A(a)){var n,r;let l=a.getParent(),i=l&&(e?l.getFirstChild():null==l?void 0:l.getLastChild()),s=e?null===(n=a.getFirstDescendant())||void 0===n?void 0:n.getKey():null===(r=a.getLastDescendant())||void 0===r?void 0:r.getKey();null!==l&&i===a&&t.anchor.key===s&&(e?a.insertBefore((0,E.BE)()):a.insertAfter((0,E.BE)()))}}return!1};return(0,_.qV)(e.registerCommand(E.Zb,()=>t(!1),E.KB),e.registerCommand(E.Nm,()=>t(!1),E.KB),e.registerCommand(E._0,()=>t(!0),E.KB),e.registerCommand(E.u$,()=>t(!0),E.KB),e.registerCommand(eR,t=>(e.update(()=>{let e=new S(t),n=eF(t);for(let t=0;t<n;t++)e.append(I().append((0,E.BE)()));(0,_.z8)(e),e.selectStart()}),!0),E.VN),e.registerCommand(eD,t=>{let{template:n,nodeKey:r}=t;return e.update(()=>{let e=(0,E.gI)(r);if(!A(e))return;let t=eF(n),a=eF(e.getTemplateColumns());if(t>a)for(let n=a;n<t;n++)e.append(I().append((0,E.BE)()));else if(t<a)for(let n=a-1;n>=t;n--){let t=e.getChildAtIndex(n);B(t)&&t.remove()}e.setTemplateColumns(n)}),!0},E.VN),e.registerNodeTransform(M,e=>{if(!A(e.getParent())){for(let t of e.getChildren())e.insertBefore(t);e.remove()}}),e.registerNodeTransform(S,e=>{let t=e.getChildren();if(!t.every(B)){for(let n of t)e.insertBefore(n);e.remove()}}))},[e]),null}function eF(e){return e.trim().split(/\s+/).length}let ez=[{label:"2 colunas (mesma largura)",value:"1fr 1fr"},{label:"2 colunas (25% - 75%)",value:"1fr 3fr"},{label:"3 colunas (mesma largura)",value:"1fr 1fr 1fr"},{label:"3 colunas (25% - 50% - 25%)",value:"1fr 2fr 1fr"},{label:"4 colunas (mesma largura)",value:"1fr 1fr 1fr 1fr"}];function eH(e){var t;let{activeEditor:n,onClose:r}=e,[a,s]=(0,i.useState)(ez[0].value);return null===(t=ez.find(e=>e.value===a))||void 0===t||t.label,(0,l.jsxs)("div",{className:"max-w-md",children:[(0,l.jsx)("div",{className:"mb-2 block",children:(0,l.jsx)($.__,{htmlFor:"column-layout",value:"Quantidade de Colunas"})}),(0,l.jsx)($.Ph,{id:"column-layout",onChange:e=>s(e.target.value),children:ez.map(e=>{let{label:t,value:n}=e;return(0,l.jsx)("option",{value:n,className:"item",children:t},n)})}),(0,l.jsx)($.zx,{className:"mt-6",onClick:()=>{n.dispatchCommand(eR,a),r()},children:"Inserir Colunas"})]})}let eW=(0,E.fA)();function eK(){let[e]=(0,u.g)();return(0,i.useEffect)(()=>
1{if(!e.hasNodes([R]))throw Error("PageBreakPlugin: PageBreakNode is not registered on editor");return(0,_.qV)(e.registerCommand(eW,()=>{let e=(0,E.dL)();if(!(0,E.OP)(e))return!1;if(null!==e.focus.getNode()){let e=P();(0,_.z8)(e)}return!0},E.VN))},[e]),null}function eq(e){let{activeEditor:t,onClose:n}=e,[r,a]=(0,i.useState)("5"),[s,o]=(0,i.useState)("5"),[c,d]=(0,i.useState)(!0);return(0,i.useEffect)(()=>{let e=Number(r),t=Number(s);e&&e>0&&e<=500&&t&&t>0&&t<=50?d(!1):d(!0)},[r,s]),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsxs)("div",{className:"flex flex-row gap-8",children:[(0,l.jsx)(eU,{value:Number(r),onChange:e=>a(e.toString()),minValue:1,maxValue:99,disabled:!1,label:"Linhas:"}),(0,l.jsx)(eU,{value:Number(s),onChange:e=>o(e.toString()),minValue:1,maxValue:50,disabled:!1,label:"Colunas:"})]}),(0,l.jsx)(V.k,{"data-test-id":"table-model-confirm-insert",children:(0,l.jsx)($.zx,{disabled:c,onClick:()=>{t.dispatchCommand(y.bF,{columns:s,rows:r}),n()},className:"mt-6",children:"Inserir Tabela"})})]})}function eU(e){let{label:t,minValue:n,maxValue:r,disabled:a,value:i,onChange:s}=e;return(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("label",{htmlFor:"quantity-input",className:"mb-2 block text-sm font-medium text-gray-900",children:t}),(0,l.jsxs)("div",{className:"relative flex max-w-[7rem] items-center py-1",children:[(0,l.jsx)("button",{type:"button",id:"decrement-button","data-input-counter-decrement":"quantity-input",disabled:a||Number(i)<=n,onClick:()=>s(i-1),className:"h-8 rounded-s-lg border border-gray-300 bg-gray-100 p-2 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-100",children:(0,l.jsx)("svg",{className:"h-3 w-3 text-gray-900","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 2",children:(0,l.jsx)("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M1 1h16"})})}),(0,l.jsx)("input",{type:"number",id:"quantity-input","data-input-counter":!0,value:i,disabled:a,"aria-describedby":"helper-text-explanation",className:"block h-8 w-full border-x-0 border-gray-300 bg-gray-50 py-2.5 text-center text-sm text-gray-900 [appearance:textfield] focus:border-blue-500 focus:ring-blue-500 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",min:n,max:r,onChange:e=>{let t=Number(e.target.value);if(t<n){s(n);return}if(t>r){s(r);return}s(Number(e.target.value))},required:!0}),(0,l.jsx)("button",{type:"button",id:"increment-button","data-input-counter-increment":"quantity-input",disabled:a||Number(i)>=r,onClick:()=>s(i+1),className:"h-8 rounded-e-lg border border-gray-300 bg-gray-100 p-2 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-100",children:(0,l.jsx)("svg",{className:"h-3 w-3 text-gray-900","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 18",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 1v16M1 9h16"})})})]}),(0,l.jsxs)("p",{id:"helper-text-explanation",className:"mt-2 text-sm text-gray-500",children:["Insira um valor entre ",n," e ",r,"."]})]})}function eZ(e){let{selectionFontSize:t,disabled:n,editor:r}=e,[a,s]=i.useState(t),o=(e,t)=>{if(!t)return e;let n=e;switch(t){case 2:switch(!0){case e>72:n=72;break;case e>=48:n-=12;break;case e>=24:n-=4;break;case e>=14:n-=2;break;case e>=9:n-=1;break;default:n=8}break;case 1:switch(!0){case e<8:n=8;break;case e<12:n+=1;break;case e<20:n+=2;break;case e<36:n+=4;break;case e<=60:n+=12;break;default:n=72}}return n},c=i.useCallback((e,t)=>{let n=e=>{e||(e="".concat(15,"px"));let n=o(Number(e=e.slice(0,-2)),t);return"".concat(n,"px")};r.update(()=>{if(r.isEditable()){let t=(0,E.dL)();null!==t&&(0,ew.yD)(t,{"font-size":null!=e?e:n})}})},[r]),d=e=>{""!==a?c(String(o(Number(a),e))+"px",null):c(null,e)};return i.useEffect(()=>{s(t)},[t]),(0,l.jsxs)("div",{className:"relative flex max-w-[7rem] items-center py-1",children:[(0,l.jsx)("button",{type:"button",id:"decrement-button","data-input-counter-decrement":"quantity-input",disabled:n||""!==t&&8>=Number(a),onClick:()=>d(2),className:"h-8 rounded-s-lg border border-gray-300 bg-gray-100 p-2 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-gray-700",children:(0,l.jsx)("svg",{className:"h-3 w-3 text-gray-900 dark:text-white","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 2",children:(0,l.jsx)("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M1 1h16"})})}),(0,l.jsx)("input",{type:"number",id:"quantity-input","data-input-counter"
1:!0,value:a,disabled:n,"aria-describedby":"helper-text-explanation",className:"block h-8 w-full border-x-0 border-gray-300 bg-gray-50 py-2.5 text-center text-sm text-gray-900 [appearance:textfield] focus:border-blue-500 focus:ring-blue-500 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",min:8,max:72,onChange:e=>s(e.target.value),onKeyDown:e=>{let t=Number(a);if(["e","E","+","-"].includes(e.key)||isNaN(t)){e.preventDefault(),s("");return}if("Enter"===e.key){e.preventDefault();let n=t;t>72?n=72:t<8&&(n=8),s(String(n)),c(String(n)+"px",null)}},required:!0}),(0,l.jsx)("button",{type:"button",id:"increment-button","data-input-counter-increment":"quantity-input",disabled:n||""!==t&&Number(a)>=72,onClick:()=>d(1),className:"h-8 rounded-e-lg border border-gray-300 bg-gray-100 p-2 hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-100",children:(0,l.jsx)("svg",{className:"h-3 w-3 text-gray-900","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 18",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 1v16M1 9h16"})})})]})}(0,E.fA)("INSERT_NEW_TABLE_COMMAND"),(r=a||(a={}))[r.increment=1]="increment",r[r.decrement=2]="decrement";var eV=n(60282);function eJ(e){let{className:t}=e;return(0,l.jsx)("svg",{className:t,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 9h13a5 5 0 0 1 0 10H7M3 9l4-4M3 9l4 4"})})}function eY(e){let{className:t}=e;return(0,l.jsx)("svg",{className:t,"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 9H8a5 5 0 0 0 0 10h9m4-10-4-4m4 4-4 4"})})}let e$=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"];function eX(e){let{color:t,onChange:n}=e,[r,a]=(0,i.useState)(e2("hex",t)),[s,o]=(0,i.useState)(t),c=(0,i.useRef)(null);return(0,i.useMemo)(()=>({x:r.hsv.s/100*214,y:(100-r.hsv.v)/100*150}),[r.hsv.s,r.hsv.v]),(0,i.useMemo)(()=>({x:r.hsv.h/360*214}),[r.hsv]),(0,i.useEffect)(()=>{null!==c.current&&n&&(n(r.hex,!1),o(r.hex))},[r,n]),(0,i.useEffect)(()=>{if(void 0===t)return;let e=e2("hex",t);a(e),o(e.hex)},[t]),(0,l.jsxs)("div",{className:"color-picker-wrapper",style:{width:214},ref:c,children:[(0,l.jsx)(eo.Z,{label:"Hex",onChange:e=>{o(e),/^#[0-9A-Fa-f]{6}$/i.test(e)&&a(e2("hex",e))},value:s}),(0,l.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:e$.map(e=>(0,l.jsx)("button",{className:"h-5 w-5 rounded-md ".concat(e===r.hex?"border-2 border-black":"border border-gray-500"),style:{backgroundColor:e},onClick:()=>{o(e),a(e2("hex",e))}},e))}),(0,l.jsx)("input",{type:"color",className:"mt-4 w-full cursor-pointer rounded-lg bg-transparent disabled:pointer-events-none disabled:opacity-50",id:"hs-color-input",value:r.hex,title:"Choose your color",onChange:e=>{a(e2("hex",e.target.value))}})]})}function eG(e){if(e.startsWith("#")){if(4===e.length||5===e.length)return e=e.split("").map((e,t)=>t?e+e:"#").join("");if(7===e.length||9===e.length)return e}else{let t=document.createElement("canvas").getContext("2d");if(!t)throw Error("2d context not supported or canvas already initialized");return t.fillStyle=e,t.fillStyle}return"#000000"}function eQ(e){var t;let n=(null!==(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(e,t,n,r)=>"#"+t+t+n+n+r+r).substring(1).match(/.{2}/g))&&void 0!==t?t:[]).map(e=>parseInt(e,16));return{b:n[2],g:n[1],r:n[0]}}function e0(e){let{r:t,g:n,b:r}=e,a=Math.max(t/=255,n/=255,r/=255),l=a-Math.min(t,n,r);return{h:l?(a===t?(n-r)/l+(n<r?6:0):a===n?2+(r-t)/l:4+(t-n)/l)*60:0,s:a?l/a*100:0,v:100*a}}function e1(e){let{b:t,g:n,r}=e;return"#"+[r,n,t].map(e=>e.toString(16).padStart(2,"0")).join("")}function e2(e,t){let n=eG("#121212"),r=eQ(n),a=e0(r);return"hex"===e?a=e0(r=eQ(n=eG(t))):"rgb"===e?(n=e1(r=t),a=e0(r)):"hsv"===e&&(n=e1(r=function(e){let{h:t,
1s:n,v:r}=e,a=~~(t/60),l=t/60-a,i=(r/=100)*(1-(n/=100)),s=r*(1-n*l),o=r*(1-n*(1-l)),c=a%6,d=Math.round(255*[r,s,i,i,o,r][c]),u=Math.round(255*[o,r,r,s,i,i][c]);return{b:Math.round(255*[i,i,o,r,r,s][c]),g:u,r:d}}(a=t))),{hex:n,hsv:a,rgb:r}}let e4={bullet:"Lista com Marcadores",check:"Check List",code:"Code Block",h1:"H1",h2:"H2",h3:"H3",h4:"H4",h5:"H5",h6:"H6",number:"Lista Numerada",paragraph:"Normal",quote:"Cita\xe7\xe3o"},e3=function(){let e=[];for(let[t,n]of Object.entries(x.Wq))e.push([t,n]);return e}(),e5={center:{icon:"center-align",iconRTL:"center-align",name:"Alinhar no Centro"},end:{icon:"right-align",iconRTL:"left-align",name:"End Align"},justify:{icon:"justify-align",iconRTL:"justify-align",name:"Justificar"},left:{icon:"left-align",iconRTL:"left-align",name:"Alinhar \xe0 Esquerda"},right:{icon:"right-align",iconRTL:"right-align",name:"Alinhar \xe0 Direita"},start:{icon:"left-align",iconRTL:"right-align",name:"Start Align"}};function e9(e){return e?"active dropdown-item-active":""}function e6(e){let{editor:t,blockType:n,rootType:r,disabled:a=!1}=e,i=()=>{t.update(()=>{let e=(0,E.dL)();(0,E.OP)(e)&&(0,ew.Hz)(e,()=>(0,E.BE)())})},s=e=>{n!==e&&t.update(()=>{let t=(0,E.dL)();(0,ew.Hz)(t,()=>(0,C.V1)(e))})};return(0,l.jsxs)($.Lt,{label:"",dismissOnClick:!1,renderTrigger:()=>(0,l.jsxs)("span",{className:"flex cursor-pointer flex-row items-center gap-2 text-sm",children:[e4[n]," ",(0,l.jsx)(eV.v,{})]}),disabled:a,children:[(0,l.jsxs)($.Lt.Item,{className:"item "+e9("paragraph"===n),onClick:i,children:[(0,l.jsx)("i",{className:"icon paragraph"}),(0,l.jsx)("span",{className:"text",children:"Normal"})]}),(0,l.jsxs)($.Lt.Item,{className:"item "+e9("h1"===n),onClick:()=>s("h1"),children:[(0,l.jsx)("i",{className:"icon h1"}),(0,l.jsx)("span",{className:"text",children:"H1"})]}),(0,l.jsxs)($.Lt.Item,{className:"item "+e9("h2"===n),onClick:()=>s("h2"),children:[(0,l.jsx)("i",{className:"icon h2"}),(0,l.jsx)("span",{className:"text",children:"H2"})]}),(0,l.jsxs)($.Lt.Item,{className:"item "+e9("h3"===n),onClick:()=>s("h3"),children:[(0,l.jsx)("i",{className:"icon h3"}),(0,l.jsx)("span",{className:"text",children:"H3"})]}),(0,l.jsxs)($.Lt.Item,{className:"item "+e9("bullet"===n),onClick:()=>{"bullet"!==n?t.dispatchCommand(o.A3,void 0):i()},children:[(0,l.jsx)("i",{className:"icon bullet-list"}),(0,l.jsx)("span",{className:"text",children:"Lista com Marcadores"})]}),(0,l.jsxs)($.Lt.Item,{className:"item "+e9("number"===n),onClick:()=>{"number"!==n?t.dispatchCommand(o.B3,void 0):i()},children:[(0,l.jsx)("i",{className:"icon numbered-list"}),(0,l.jsx)("span",{className:"text",children:"Lista Numerada"})]}),(0,l.jsxs)($.Lt.Item,{className:"item "+e9("quote"===n),onClick:()=>{"quote"!==n&&t.update(()=>{let e=(0,E.dL)();(0,ew.Hz)(e,()=>(0,C.Z1)())})},children:[(0,l.jsx)("i",{className:"icon quote"}),(0,l.jsx)("span",{className:"text",children:"Cita\xe7\xe3o"})]})]})}function e8(){return(0,l.jsx)("div",{className:"inline-block h-8 w-px bg-gray-200"})}function e7(e){let{editor:t,value:n,isRTL:r,disabled:a=!1}=e,i=e5[n||"left"];return(0,l.jsxs)($.Lt,{disabled:a,label:"",renderTrigger:()=>(0,l.jsxs)("span",{className:"flex cursor-pointer flex-row items-center gap-2 text-sm",children:[i.name," ",(0,l.jsx)(eV.v,{})]}),children:[(0,l.jsxs)($.Lt.Item,{onClick:()=>{t.dispatchCommand(E.RO,"left")},className:"item",children:[(0,l.jsx)("i",{className:"icon left-align"}),(0,l.jsx)("span",{className:"text",children:"Alinhar \xe0 Esquerda"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{t.dispatchCommand(E.RO,"center")},className:"item",children:[(0,l.jsx)("i",{className:"icon center-align"}),(0,l.jsx)("span",{className:"text",children:"Alinhar no Centro"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{t.dispatchCommand(E.RO,"right")},className:"item",children:[(0,l.jsx)("i",{className:"icon right-align"}),(0,l.jsx)("span",{className:"text",children:"Alinhar \xe0 Direita"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{t.dispatchCommand(E.RO,"justify")},className:"item",children:[(0,l.jsx)("i",{className:"icon justify-align"}),(0,l.jsx)("span",{className:"text",children:"Justificar"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{t.dispatchCommand(E.cz,void 0)},className:"item",children:[(0,l.jsx)("i",{className:"icon "+(r?"indent":"outdent")}),(0,l.jsx)("span",{className:"text",children:"Diminuir Recuo"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{t.dispatchCommand(E.PU,void 0)},className:"item",children:[(0,l.jsx)("i",{className:"icon "+(r?"outdent":"indent")}),(0,l.jsx)("span",{className:"text",children:"Aumentar Recuo"})]})]})}function te(e){let{setIsLinkEditMode:t}=e,[n]=(0,u.g)(),[r,a]=(0,i.useState)(n),[s,c]=(0,i.useState)("paragraph"),[d,m]=(0,i.useState)("root"),[h,g]=(0,i.useState)(null),[p,b]=(0,i.useState)("15px"),[v,j]=(0,i.useState)("#000"),[k,N]=(0,i.useState)("#fff"),[L,S]=(0,i.useState)("Arial"),[A,M]=(0,i.useState)("left"),[I,B]=(0,i.useState)(!1),[T,O]=(0,i.useState)(!1),[R,D]=(0,i.useState)(!1),[P,F]=(0,i.useState)(!1),[H,W]=(0,i.useState)(!1),[K,U]=(0,i.useState)(!1),[V,J]=(0,i.useState)(!1),[Y,G]=(0,i.useState)(!1),[Q,ee]=(0,i.useState)(!1),[et,en]=(0,i.useState)(!1),[er,ea]=(0,Z.Z)(),[el,ei]=(0,i.useState)(!1),[es,eo]=(0,i.useState)(""),[ec,ed]=(0,i.useState)(()=>n.isEditable()),eu=(0,i.useCallback)(()=>{let e=(0,E.dL)();if((0,E.OP)(e)){let t;let n=e.anchor.getNode(),a="root"===n.getKey()?n:(0,_.$s)(n,e=>{let t=e.getParent();return null!==t&&(0,E._v)(t)});null===a&&(a=n.getTopLevelElementOrThrow());let l=a.getKey(),i=r.getElementByKey(l);O(e.hasFormat("bold")),D(e.hasFormat("italic")),F(e.hasFormat("underline")),W(e.hasFormat("strikethrough")),U(e.hasFormat("subscript")),J(e.hasFormat("superscript")),G(e.hasFormat("code")),ei((0,ew.Vx)(e));let s=ev(e),d=s.getParent();(0,f.Pq)(d)||(0,f.Pq)(s)?B(!0):B(!1);let u=(0,_.$s)(s,y.di);
1if((0,y.di)(u)?m("table"):m("root"),null!==i){if(g(l),(0,o.I3)(a)){let e=(0,_.yD)(n,o.EG);c(e?e.getListType():a.getListType())}else{let e=(0,C.rc)(a)?a.getTag():a.getType();if(e in e4&&c(e),(0,x.Pe)(a)){let e=a.getLanguage();eo(e?x.md[e]||e:"");return}}}b((0,ew.ui)(e,"font-size","15px")),j((0,ew.ui)(e,"color","#000")),N((0,ew.ui)(e,"background-color","#fff")),S((0,ew.ui)(e,"font-family","Arial")),(0,f.Pq)(d)&&(t=(0,_.$s)(s,e=>(0,E.F7)(e)&&!e.isInline())),M((0,E.F7)(t)?t.getFormatType():(0,E.F7)(s)?s.getFormatType():(null==d?void 0:d.getFormatType())||"left")}},[r]);(0,i.useEffect)(()=>n.registerCommand(E.oj,(e,t)=>(eu(),a(t),!1),E.jw),[n,eu]),(0,i.useEffect)(()=>(0,_.qV)(n.registerEditableListener(e=>{ed(e)}),r.registerUpdateListener(e=>{let{editorState:t}=e;t.read(()=>{eu()})}),r.registerCommand(E.yn,e=>(ee(e),!1),E.jw),r.registerCommand(E.r0,e=>(en(e),!1),E.jw)),[eu,r,n]),(0,i.useEffect)(()=>r.registerCommand(E.yb,e=>{let{code:n,ctrlKey:a,metaKey:l}=e;if("KeyK"===n&&(a||l)){let n;return e.preventDefault(),I?(t(!1),n=null):(t(!0),n=(0,eC.N)("https://")),r.dispatchCommand(f.k0,n)}return!1},E.u6),[r,I,t]);let em=(0,i.useCallback)((e,t)=>{r.update(()=>{let t=(0,E.dL)();null!==t&&(0,ew.yD)(t,e)},t?{tag:"historic"}:{})},[r]),eg=(0,i.useCallback)(()=>{r.update(()=>{let e=(0,E.dL)();if((0,E.OP)(e)||(0,y.zO)(e)){let t=e.anchor,n=e.focus,r=e.getNodes(),a=e.extract();if(t.key===n.key&&t.offset===n.offset)return;r.forEach((e,l)=>{if((0,E.Gg)(e)){let i=e;0===l&&0!==t.offset&&(i=i.splitText(t.offset)[1]||i),l===r.length-1&&(i=i.splitText(n.offset)[0]||i);let s=a[0];1===r.length&&(0,E.Gg)(s)&&(i=s),""!==i.__style&&i.setStyle(""),0!==i.__format&&(i.setFormat(0),(0,_.f8)(i).setFormat("")),e=i}else(0,C.rc)(e)||(0,C.O)(e)?e.replace((0,E.BE)(),!0):(0,z.F)(e)&&e.setFormat("")})}})},[r]),ep=(0,i.useCallback)((e,t)=>{em({color:e},t)},[em]),ex=(0,i.useCallback)((e,t)=>{em({"background-color":e},t)},[em]),ef=(0,i.useCallback)(()=>{I?(t(!1),n.dispatchCommand(f.k0,null)):(t(!0),n.dispatchCommand(f.k0,(0,eC.N)("https://")))},[n,I,t]),eb=(0,i.useCallback)(e=>{r.update(()=>{if(null!==h){let t=(0,E.gI)(h);(0,x.Pe)(t)&&t.setLanguage(e)}})},[r,h]);return(0,l.jsxs)("div",{className:"toolbar flex flex-row items-center gap-2 rounded-t-lg border border-gray-200 bg-gray-50 px-4",children:[(0,l.jsxs)("button",{disabled:!Q||!ec,onClick:()=>{r.dispatchCommand(E.$l,void 0)},title:"Undo (Ctrl+Z)",type:"button",className:"toolbar-item spaced","aria-label":"Undo",children:[(0,l.jsx)("i",{className:"format undo"}),(0,l.jsx)(eJ,{className:"h-5 w-5 ".concat(Q?"text-gray-900":"cursor-not-allowed text-gray-500")})]}),(0,l.jsxs)("button",{disabled:!et||!ec,onClick:()=>{r.dispatchCommand(E.zq,void 0)},title:"Redo (Ctrl+Y)",type:"button",className:"toolbar-item","aria-label":"Redo",children:[(0,l.jsx)("i",{className:"format redo"}),(0,l.jsx)(eY,{className:"h-5 w-5 ".concat(et?"text-gray-900":"cursor-not-allowed text-gray-500")})]}),(0,l.jsx)(e8,{}),s in e4&&r===n&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e6,{disabled:!ec,blockType:s,rootType:d,editor:n}),(0,l.jsx)(e8,{})]}),"code"===s?(0,l.jsx)(eO,{disabled:!ec,buttonClassName:"toolbar-item code-language",buttonLabel:(0,x.zP)(es),buttonAriaLabel:"Select language",children:e3.map(e=>{let[t,n]=e;return(0,l.jsx)(eT,{className:"item ".concat(e9(t===es)),onClick:()=>eb(t),children:(0,l.jsx)("span",{className:"text",children:n})},t)})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eZ,{selectionFontSize:p.slice(0,-2),editor:n,disabled:!ec}),(0,l.jsx)(e8,{}),(0,l.jsx)("button",{disabled:!ec,onClick:()=>{r.dispatchCommand(E.Ew,"bold")},className:"toolbar-item spaced "+(T?"active":""),title:"Bold (Ctrl+B)",type:"button","aria-label":"Format text as bold. Shortcut: Ctrl+B",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(T?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})})}),(0,l.jsx)("button",{disabled:!ec,onClick:()=>
1{r.dispatchCommand(E.Ew,"italic")},className:"toolbar-item spaced "+(R?"active":""),title:"Italic (Ctrl+I)",type:"button","aria-label":"Format text as italics. Shortcut: Ctrl+I",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(R?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})})}),(0,l.jsx)("button",{disabled:!ec,onClick:()=>{r.dispatchCommand(E.Ew,"underline")},className:"toolbar-item spaced "+(P?"active":""),title:"Underline (Ctrl+U)",type:"button","aria-label":"Format text to underlined. Shortcut: Ctrl+U",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(P?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M6 19h12M8 5v9a4 4 0 0 0 8 0V5M6 5h4m4 0h4"})})}),(0,l.jsx)("button",{disabled:!ec,onClick:ef,className:"toolbar-item spaced "+(I?"active":""),"aria-label":"Insert link",title:"Insert link",type:"button",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(I?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})})}),(0,l.jsx)($.Lt,{label:"",trigger:"hover",renderTrigger:()=>(0,l.jsxs)("span",{className:"flex cursor-pointer flex-row items-center gap-2",children:[(0,l.jsx)("svg",{className:"h-5 w-5 text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M7.111 20A3.111 3.111 0 0 1 4 16.889v-12C4 4.398 4.398 4 4.889 4h4.444a.89.89 0 0 1 .89.889v12A3.111 3.111 0 0 1 7.11 20Zm0 0h12a.889.889 0 0 0 .889-.889v-4.444a.889.889 0 0 0-.889-.89h-4.389a.889.889 0 0 0-.62.253l-3.767 3.665a.933.933 0 0 0-.146.185c-.868 1.433-1.581 1.858-3.078 2.12Zm0-3.556h.009m7.933-10.927 3.143 3.143a.889.889 0 0 1 0 1.257l-7.974 7.974v-8.8l3.574-3.574a.889.889 0 0 1 1.257 0Z"})}),(0,l.jsx)(eV.v,{})]}),children:(0,l.jsx)($.Lt.Header,{children:(0,l.jsx)(eX,{color:v,onChange:ep})})}),(0,l.jsx)($.Lt,{label:"",trigger:"hover",renderTrigger:()=>(0,l.jsxs)("span",{className:"flex cursor-pointer flex-row items-center gap-2",children:[(0,l.jsx)("svg",{className:"h-5 w-5 text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 7h.01m3.486 1.513h.01m-6.978 0h.01M6.99 12H7m9 4h2.706a1.957 1.957 0 0 0 1.883-1.325A9 9 0 1 0 3.043 12.89 9.1 9.1 0 0 0 8.2 20.1a8.62 8.62 0 0 0 3.769.9 2.013 2.013 0 0 0 2.03-2v-.857A2.036 2.036 0 0 1 16 16Z"})}),(0,l.jsx)(eV.v,{})]}),children:(0,l.jsx)($.Lt.Header,{children:(0,l.jsx)(eX,{color:k,onChange:ex})})}),(0,l.jsxs)($.Lt,{disabled:!ec,label:"",renderTrigger:()=>(0,l.jsxs)("span",{className:"flex cursor-pointer flex-row items-center gap-2",children:[(0,l.jsx)("svg",{className:"h-5 w-5 text-gray-500","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 6.2V5h11v1.2M8 5v14m-3 0h6m2-6.8V11h8v1.2M17 11v8m-1.5 0h3"})}),(0,l.jsx)(eV.v,{})]}),children:[(0,l.jsxs)($.Lt.Item,{onClick:()=>{r.dispatchCommand(E.Ew,"strikethrough")},className:"item "+e9(H),title:"Strikethrough","aria-label":"Format text with a strikethrough",children:[(0,l.jsx)("i",{className:"icon strikethrough"}),(0,l.jsx)("span",{className:"text",children:"Tachar"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>
1{r.dispatchCommand(E.Ew,"subscript")},className:"item "+e9(K),title:"Subscript","aria-label":"Format text with a subscript",children:[(0,l.jsx)("i",{className:"icon subscript"}),(0,l.jsx)("span",{className:"text",children:"Subscrito"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{r.dispatchCommand(E.Ew,"superscript")},className:"item "+e9(V),title:"Superscript","aria-label":"Format text with a superscript",children:[(0,l.jsx)("i",{className:"icon superscript"}),(0,l.jsx)("span",{className:"text",children:"Sobrescrito"})]}),(0,l.jsxs)($.Lt.Item,{onClick:eg,className:"item",title:"Clear text formatting","aria-label":"Clear all text formatting",children:[(0,l.jsx)("i",{className:"icon clear"}),(0,l.jsx)("span",{className:"text",children:"Limpar Formata\xe7\xe3o"})]})]}),(0,l.jsx)(e8,{}),(0,l.jsxs)($.Lt,{disabled:!ec,label:"",renderTrigger:()=>(0,l.jsxs)("span",{className:"flex cursor-pointer flex-row items-center gap-2 text-sm",children:["Inserir ",(0,l.jsx)(eV.v,{})]}),children:[(0,l.jsxs)($.Lt.Item,{onClick:()=>{r.dispatchCommand(w.qL,void 0)},className:"item",children:[(0,l.jsx)("i",{className:"icon horizontal-rule"}),(0,l.jsx)("span",{className:"text",children:"R\xe9gua Horizontal"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{r.dispatchCommand(eW,void 0)},className:"item",children:[(0,l.jsx)("i",{className:"icon page-break"}),(0,l.jsx)("span",{className:"text",children:"Quebra de P\xe1gina"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{ea("Inserir Imagem",e=>(0,l.jsx)(eh,{activeEditor:r,onClose:e}))},className:"item",children:[(0,l.jsx)("i",{className:"icon image"}),(0,l.jsx)("span",{className:"text",children:"Imagem"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{ea("Inserir Imagem em Linha",e=>(0,l.jsx)(eL,{activeEditor:r,onClose:e}))},className:"item",children:[(0,l.jsx)("i",{className:"icon image"}),(0,l.jsx)("span",{className:"text",children:"Imagem em Linha"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{ea("Inserir Tabela",e=>(0,l.jsx)(eq,{activeEditor:r,onClose:e}))},className:"item",children:[(0,l.jsx)("i",{className:"icon table"}),(0,l.jsx)("span",{className:"text",children:"Tabela"})]}),(0,l.jsxs)($.Lt.Item,{onClick:()=>{ea("Inserir Layout em Colunas",e=>(0,l.jsx)(eH,{activeEditor:r,onClose:e}))},className:"item",children:[(0,l.jsx)("i",{className:"icon columns"}),(0,l.jsx)("span",{className:"text",children:"Layout em Colunas"})]}),X.map(e=>(0,l.jsxs)($.Lt.Item,{onClick:()=>{r.dispatchCommand(q.v3,e.type)},className:"item",children:[e.icon,(0,l.jsx)("span",{className:"text",children:e.contentName})]},e.type))]})]}),(0,l.jsx)(e8,{}),(0,l.jsx)(e7,{disabled:!ec,value:A,editor:n,isRTL:el}),er]})}var tt=n(393),tn=n(77219);function tr(e){let{editor:t,anchorElem:n,isLink:r,isBold:a,isItalic:s,isUnderline:o,isCode:c,isStrikethrough:d,isSubscript:u,isSuperscript:m,setIsLinkEditMode:h}=e,g=(0,i.useRef)(null),p=(0,i.useCallback)(()=>{r?(h(!1),t.dispatchCommand(f.k0,null)):(h(!0),t.dispatchCommand(f.k0,"https://"))},[t,r,h]);function x(e){if((null==g?void 0:g.current)&&(1===e.buttons||3===e.buttons)&&"none"!==g.current.style.pointerEvents){let t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);g.current.contains(r)||(g.current.style.pointerEvents="none")}}function b(e){(null==g?void 0:g.current)&&"auto"!==g.current.style.pointerEvents&&(g.current.style.pointerEvents="auto")}(0,i.useEffect)(()=>{if(null==g?void 0:g.current)return document.addEventListener("mousemove",x),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",b)}},[g]);let w=(0,i.useCallback)(()=>{let e=(0,E.dL)(),a=g.current,l=window.getSelection();if(null===a)return;let i=t.getRootElement();null!==e&&null!==l&&!l.isCollapsed&&null!==i&&i.contains(l.anchorNode)&&function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5,i=n.parentElement;if(null===e||!i){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let s=t.getBoundingClientRect(),o=n.getBoundingClientRect(),c=i.getBoundingClientRect(),d=e.top-s.height-a,u=e.left-l;d<c.top&&(d+=s.height+e.height+a*(r?9:2)),u+s.width>c.right&&(u=c.right-s.width-l),d-=o.top,u-=o.left,t.style.opacity="1",t.style.transform="translate(".concat(u,"px, ").concat(d,"px)")}(function(e,t){let n;let r=e.getRangeAt(0);if(e.anchorNode===t){let e=t;for(;
1null!=e.firstElementChild;)e=e.firstElementChild;n=e.getBoundingClientRect()}else n=r.getBoundingClientRect();return n}(l,i),a,n,r)},[t,n,r]);return(0,i.useEffect)(()=>{let e=n.parentElement,r=()=>{t.getEditorState().read(()=>{w()})};return window.addEventListener("resize",r),e&&e.addEventListener("scroll",r),()=>{window.removeEventListener("resize",r),e&&e.removeEventListener("scroll",r)}},[t,w,n]),(0,i.useEffect)(()=>(t.getEditorState().read(()=>{w()}),(0,_.qV)(t.registerUpdateListener(e=>{let{editorState:t}=e;t.read(()=>{w()})}),t.registerCommand(E.oj,()=>(w(),!1),E.KB))),[t,w]),(0,l.jsx)("div",{ref:g,className:"absolute left-0 top-0 z-10 flex h-9 items-center rounded bg-white p-4 opacity-0 shadow-md transition-opacity duration-500",children:t.isEditable()&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",onClick:()=>{t.dispatchCommand(E.Ew,"bold")},className:"mr-2 flex cursor-pointer items-center rounded-2xl border-0 bg-transparent p-2"+(a?"active":""),"aria-label":"Format text as bold",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(a?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})})}),(0,l.jsx)("button",{type:"button",onClick:()=>{t.dispatchCommand(E.Ew,"italic")},className:"mr-2 flex cursor-pointer items-center rounded-2xl border-0 bg-transparent p-2 "+(s?"active":""),"aria-label":"Format text as italics",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(s?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})})}),(0,l.jsx)("button",{type:"button",onClick:()=>{t.dispatchCommand(E.Ew,"underline")},className:"mr-2 flex cursor-pointer items-center rounded-2xl border-0 bg-transparent p-2 "+(o?"active":""),"aria-label":"Format text to underlined",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(o?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M6 19h12M8 5v9a4 4 0 0 0 8 0V5M6 5h4m4 0h4"})})}),(0,l.jsx)("button",{type:"button",onClick:()=>{t.dispatchCommand(E.Ew,"strikethrough")},className:"mr-2 flex cursor-pointer items-center rounded-2xl border-0 bg-transparent p-2 "+(d?"active":""),"aria-label":"Format text with a strikethrough",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(d?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M7 6.2V5h12v1.2M7 19h6m.2-14-1.677 6.523M9.6 19l1.029-4M5 5l6.523 6.523M19 19l-7.477-7.477"})})}),(0,l.jsx)("button",{type:"button",onClick:()=>{t.dispatchCommand(E.Ew,"subscript")},className:"mr-2 flex cursor-pointer items-center rounded-2xl border-0 bg-transparent p-2 "+(u?"active":""),title:"Subscript","aria-label":"Format Subscript",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",className:"h-5 w-5 ".concat(u?"text-gray-900":"text-gray-500"),viewBox:"0 0 16 16",children:(0,l.jsx)("path",{stroke:"currentColor",strokeWidth:"0.1",d:"m3.266 12.496.96-2.853H7.76l.96 2.853H10L6.62 3H5.38L2 12.496zm2.748-8.063 1.419 4.23h-2.88l1.426-4.23zm6.132 7.203v-.075c0-.332.234-.618.619-.618.354 0 .618.256.618.58 0 .362-.271.649-.52.898l-1.788 1.832V15h3.59v-.958h-1.923v-.045l.973-1.04c.415-.438.867-.845.867-1.547 0-.8-.701-1.41-1.787-1.41-1.23 0-1.795.8-1.795 1.576v.06z"})})}),(0,l.jsx)("button",{type:"button",onClick:()=>{t.dispatchCommand(E.Ew,"superscript")},className:"mr-2 flex cursor-pointer items-center rounded-2xl border-0 bg-transparent p-2 "+(m?"active":""),title:"Superscript","aria-label":"Format Superscript",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",className:"h-5 w-5 ".concat(m?"text-gray-900":"text-gray-500"),viewBox:"0 0 16 16",children:(0,l.jsx)("path",{stroke:"currentColor",strokeWidth:"0.1",d:"m4.266 12.496.96-2.853H8.76l.96 2.853H11L7.62 3H6.38L3 12.496zm2.748-8.063 1.419 4.23h-2.88l1.426-4.23zm5.132-1.797v-.075c0-.332.234-.618.619-.618.354 0 .618.256.618.58 0 .362-.271.649-.52.898l-1.788 1.832V6h3.59v-.958h-1.923v-.045l.973-1.04c.415-.438.867-.845.867-1.547 0-.8-.701-1.41-1.787-1.41C11.565 1 11 1.8 11 2.576v.06z"})})}),(0,l.jsx)("button",{type:"button",onClick:p,className:"mr-2 flex cursor-pointer items-center rounded-2xl border-0 bg-transparent p-2 "+(r?"active":""),"aria-label":"Insert link",children:(0,l.jsx)("svg",{className:"h-5 w-5 ".concat(r?"text-gray-900":"text-gray-500"),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})})})]})})}function ta(e){let{anchorElem:t=document.body,setIsLinkEditMode:n}=e,[r]=(0,u.g)();return function(e,t,n){let[r,a]=(0,i.useState)(!1),[s,o]=(0,i.useState)(!1),[c,d]=(0,i.useState)(!1),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[p,b]=(0,i.useState)(!1),[w,v]=(0,i.useState)(!1),[j,C]=(0,i.useState)(!1),[y,k]=(0,i.useState)(!1),N=(0,i.useCallback)(()=>{e.getEditorState().read(()=>
1{if(e.isComposing())return;let t=(0,E.dL)(),n=window.getSelection(),r=e.getRootElement();if(null!==n&&(!(0,E.OP)(t)||null===r||!r.contains(n.anchorNode))){a(!1);return}if(!(0,E.OP)(t))return;let l=ev(t);d(t.hasFormat("bold")),m(t.hasFormat("italic")),g(t.hasFormat("underline")),b(t.hasFormat("strikethrough")),v(t.hasFormat("subscript")),C(t.hasFormat("superscript")),k(t.hasFormat("code"));let i=l.getParent();(0,f.Pq)(i)||(0,f.Pq)(l)?o(!0):o(!1),(0,x.jZ)(t.anchor.getNode())||""===t.getTextContent()?a(!1):a((0,E.Gg)(l)||(0,E.Rl)(l));let s=t.getTextContent().replace(/\n/g,"");if(!t.isCollapsed()&&""===s){a(!1);return}})},[e]);return((0,i.useEffect)(()=>(document.addEventListener("selectionchange",N),()=>{document.removeEventListener("selectionchange",N)}),[N]),(0,i.useEffect)(()=>(0,_.qV)(e.registerUpdateListener(()=>{N()}),e.registerRootListener(()=>{null===e.getRootElement()&&a(!1)})),[e,N]),r)?(0,U.createPortal)((0,l.jsx)(tr,{editor:e,anchorElem:t,isLink:s,isBold:c,isItalic:u,isStrikethrough:p,isSubscript:w,isSuperscript:j,isUnderline:h,isCode:y,setIsLinkEditMode:n}),t):null}(r,t,n)}let tl=0,ti=!1;function ts(){let[e]=(0,u.g)();return(0,i.useEffect)(()=>(ti||(window.addEventListener("keydown",e=>{"Tab"===e.key&&(tl=e.timeStamp)},!0),ti=!0),e.registerCommand(E.m$,e=>{let t=(0,E.dL)();return(0,E.OP)(t)&&tl+100>e.timeStamp&&(0,E.oq)(t.clone()),!1},1)),[e]),null}var to=n(92044);function tc(e){let t=e.getShape();return{columns:t.toX-t.fromX+1,rows:t.toY-t.fromY+1}}function td(e){if(1!==e.getChildrenSize())return!1;let t=e.getFirstChildOrThrow();return!!((0,E.Rl)(t)&&t.isEmpty())}function tu(e){return e.getEditorState().read(()=>{let e=(0,E.dL)();if((0,E.OP)(e)||(0,y.zO)(e)){let[t]=(0,y.$r)(e.anchor);if((0,y.TF)(t))return t.getBackgroundColor()}return null})}function tm(e){let{onClose:t,tableCellNode:n,setIsMenuOpen:r,contextRef:a,cellMerge:s,showColorPickerModal:o}=e,[c]=(0,u.g)(),d=(0,i.useRef)(null),[m,h]=(0,i.useState)(n),[g,p]=(0,i.useState)({columns:1,rows:1}),[x,f]=(0,i.useState)(!1),[b,w]=(0,i.useState)(!1),[v,j]=(0,i.useState)(()=>tu(c)||"");(0,i.useEffect)(()=>c.registerMutationListener(y.Cr,e=>{"updated"===e.get(m.getKey())&&(c.getEditorState().read(()=>{h(m.getLatest())}),j(tu(c)||""))}),[c,m]),(0,i.useEffect)(()=>{c.getEditorState().read(()=>{let e=(0,E.dL)();if((0,y.zO)(e)){let t=tc(e);p(tc(e)),f(function(e){let t=e.getNodes(),n=[],r=null,a=null,l=0;for(let e=0;e<t.length;e++){let i=t[e];if((0,y.TF)(i)){let e=i.getParentOrThrow();if(function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];if(!e)throw Error("Internal Lexical error: invariant() is meant to be replaced at compile time. There is no runtime version. Error: "+t)}((0,y.to)(e),"Expected CellNode to have a RowNode parent"),r!==e){if(null!==a&&l!==a)return!1;null!==r&&(a=l),r=e,l=0}let t=i.__colSpan;for(let e=0;e<t;e++)void 0===n[l+e]&&(n[l+e]=0),n[l+e]+=i.__rowSpan;l+=t}}return(null===a||l===a)&&n.every(e=>e===n[0])}(e)&&(t.columns>1||t.rows>1))}w(function(){let e=(0,E.dL)();if((0,E.OP)(e)&&!e.isCollapsed()||(0,y.zO)(e)&&!e.anchor.is(e.focus)||!(0,E.OP)(e)&&!(0,y.zO)(e))return!1;let[t]=(0,y.$r)(e.anchor);return t.__colSpan>1||t.__rowSpan>1}())})},[c]),(0,i.useEffect)(()=>{let e=a.current,t=d.current,n=c.getRootElement();if(null!=e&&null!=t&&null!=n){let r=n.getBoundingClientRect(),a=e.getBoundingClientRect();t.style.opacity="1";let l=t.getBoundingClientRect(),i=a.right+5;if(i+l.width>window.innerWidth||i+l.width>r.right){let e=a.left-l.width-5;i=(e<0?5:e)+window.pageXOffset}t.style.left="".concat(i+window.pageXOffset,"px");let s=a.top;if(s+l.height>window.innerHeight){let e=a.bottom-l.height;s=(e<0?5:e)+window.pageYOffset}t.style.top="".concat(s+ +window.pageYOffset,"px")}},[a,d,c]),(0,i.useEffect)(()=>{function e(e){null==d.current||null==a.current||d.current.contains(e.target)||a.current.contains(e.target)||r(!1)}return window.addEventListener("click",e),()=>window.removeEventListener("click",e)},[r,a]);let C=(0,i.useCallback)(()=>{c.update(()=>{if(m.isAttached()){let e=(0,y.Yp)(m),t=c.getElementByKey(e.getKey());if(!t)throw Error("Expected to find tableElement in DOM");let n=(0,y.ng)(t);null!==n&&n.clearHighlight(),e.markDirty(),h(m.getLatest())}(0,E.Gv)().selectStart()})}
1,[c,m]),k=()=>{c.update(()=>{let e=(0,E.dL)();if((0,y.zO)(e)){let{columns:n,rows:r}=tc(e),a=e.getNodes(),l=null;for(let e=0;e<a.length;e++){let t=a[e];if((0,y.TF)(t)){if(null===l){let e;t.setColSpan(n).setRowSpan(r),l=t,td(t)&&(0,E.Rl)(e=t.getFirstChild())&&e.remove()}else(0,y.TF)(l)&&(td(t)||l.append(...t.getChildren()),t.remove())}}null!==l&&(0===l.getChildrenSize()&&l.append((0,E.BE)()),function(e){let t=e.getLastDescendant();(0,E.Gg)(t)?t.select():(0,E.F7)(t)?t.selectEnd():null!==t&&t.selectNext()}(l)),t()}})},N=()=>{c.update(()=>{(0,y.eb)()})},_=(0,i.useCallback)(e=>{c.update(()=>{(0,y.EX)(e),t()})},[c,t]),L=(0,i.useCallback)(e=>{c.update(()=>{for(let t=0;t<g.columns;t++)(0,y.rU)(e);t()})},[c,t,g.columns]),S=(0,i.useCallback)(()=>{c.update(()=>{(0,y.kS)(),t()})},[c,t]),A=(0,i.useCallback)(()=>{c.update(()=>{(0,y.Yp)(m).remove(),C(),t()})},[c,m,C,t]),M=(0,i.useCallback)(()=>{c.update(()=>{(0,y.bk)(),t()})},[c,t]),I=(0,i.useCallback)(()=>{c.update(()=>{let e=(0,y.Yp)(m),n=(0,y.q1)(m),r=e.getChildren();if(n>=r.length||n<0)throw Error("Expected table cell to be inside of table row.");let a=r[n];if(!(0,y.to)(a))throw Error("Expected table row");
1a.getChildren().forEach(e=>{if(!(0,y.TF)(e))throw Error("Expected table cell");e.toggleHeaderStyle(y.xo.ROW)}),C(),t()})},[c,m,C,t]),B=(0,i.useCallback)(()=>{c.update(()=>{let e=(0,y.Yp)(m),n=(0,y.yb)(m),r=e.getChildren();if(n>=Math.max(...r.map(e=>e.getChildren().length))||n<0)throw Error("Expected table cell to be inside of table row.");for(let e=0;e<r.length;e++){let t=r[e];if(!(0,y.to)(t))throw Error("Expected table row");let a=t.getChildren();if(n>=a.length)continue;let l=a[n];if(!(0,y.TF)(l))throw Error("Expected table cell");l.toggleHeaderStyle(y.xo.COLUMN)}C(),t()})},[c,m,C,t]),T=(0,i.useCallback)(e=>{c.update(()=>{let t=(0,E.dL)();if((0,E.OP)(t)||(0,y.zO)(t)){let[n]=(0,y.$r)(t.anchor);if((0,y.TF)(n)&&n.setBackgroundColor(e),(0,y.zO)(t)){let n=t.getNodes();for(let t=0;t<n.length;t++){let r=n[t];(0,y.TF)(r)&&r.setBackgroundColor(e)}}}})},[c]),O=null;return s&&(x?O=(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>k(),"data-test-id":"table-merge-cells",children:"Merge cells"}):b&&(O=(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>N(),"data-test-id":"table-unmerge-cells",children:"Unmerge cells"}))),(0,U.createPortal)((0,l.jsxs)("div",{className:"dropdown",ref:d,onClick:e=>{e.stopPropagation()},children:[O,(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>o("Cell background color",()=>(0,l.jsx)(eX,{color:v,onChange:T})),"data-test-id":"table-background-color",children:(0,l.jsx)("span",{className:"text",children:"Backgroun
1d color"})}),(0,l.jsx)("hr",{}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>_(!1),"data-test-id":"table-insert-row-above",children:(0,l.jsxs)("span",{className:"text",children:["Insert"," ",1===g.rows?"row":"".concat(g.rows," rows")," ","above"]})}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>_(!0),"data-test-id":"table-insert-row-below",children:(0,l.jsxs)("span",{className:"text",children:["Insert"," ",1===g.rows?"row":"".concat(g.rows," rows")," ","below"]})}),(0,l.jsx)("hr",{}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>L(!1),"data-test-id":"table-insert-column-before",children:(0,l.jsxs)("span",{className:"text",children:["Insert"," ",1===g.columns?"column":"".concat(g.columns," columns")," ","left"]})}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>L(!0),"data-test-id":"table-insert-column-after",children:(0,l.jsxs)("span",{className:"text",children:["Insert"," ",1===g.columns?"column":"".concat(g.columns," columns")," ","right"]})}),(0,l.jsx)("hr",{}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>M(),"data-test-id":"table-delete-columns",children:(0,l.jsx)("span",{className:"text",children:"Delete column"})}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>S(),"data-test-id":"table-delete-rows",children:(0,l.jsx)("span",{className:"text",children:"Delete row"})}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>A(),"data-test-id":"table-delete",children:(0,l.jsx)("span",{className:"text",children:"Delete table"})}),(0,l.jsx)("hr",{}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>I(),children:(0,l.jsxs)("span",{className:"text",children:[(m.__headerState&y.xo.ROW)===y.xo.ROW?"Remove":"Add"," ","row header"]})}),(0,l.jsx)("button",{type:"button",className:"item",onClick:()=>B(),"data-test-id":"table-column-header",children:(0,l.jsxs)("span",{className:"text",children:[(m.__headerState&y.xo.COLUMN)===y.xo.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function th(e){let{anchorElem:t,cellMerge:n}=e,[r]=(0,u.g)(),a=(0,i.useRef)(null),s=(0,i.useRef)(null),[o,c]=(0,i.useState)(!1),[d,m]=(0,i.useState)(null),[h,g]=(0,Z.Z)(),p=(0,i.useCallback)(()=>{let e=a.current,t=(0,E.dL)(),n=window.getSelection(),l=document.activeElement;if(null==t||null==e){m(null);return}let i=r.getRootElement();if((0,E.OP)(t)&&null!==i&&null!==n&&i.contains(n.anchorNode)){let e=(0,y.Fk)(t.anchor.getNode());if(null==e||null==r.getElementByKey(e.getKey())){m(null);return}m(e)}else l||m(null)},[r]);(0,i.useEffect)(()=>r.registerUpdateListener(()=>{r.getEditorState().read(()=>{p()})})),(0,i.useEffect)(()=>{let e=a.current;if(null!=e&&null!=d){let n=r.getElementByKey(d.getKey());if(null!=n){let r=n.getBoundingClientRect(),a=e.getBoundingClientRect(),l=t.getBoundingClientRect(),i=r.top-l.top+4,s=r.right-a.width-10-l.left;e.style.opacity="1",e.style.transform="translate(".concat(s,"px, ").concat(i,"px)")}else e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)"}},[a,d,r,t]);let x=(0,i.useRef)(d);return(0,i.useEffect)(()=>{x.current!==d&&c(!1),x.current=d},[x,d]),(0,l.jsx)("div",{className:"table-cell-action-button-container",ref:a,children:null!=d&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"table-cell-action-button chevron-down",onClick:e=>{e.stopPropagation(),c(!o)},ref:s,children:(0,l.jsx)("i",{className:"chevron-down"})}),h,o&&(0,l.jsx)(tm,{contextRef:s,setIsMenuOpen:c,onClose:()=>c(!1),tableCellNode:d,cellMerge:n,showColorPickerModal:g})]})})}function tg(e){let{anchorElem:t=document.body,cellMerge:n=!1}=e,r=(0,to.Z)();return(0,U.createPortal)(r?(0,l.jsx)(th,{anchorElem:t,cellMerge:n}):null,t)}function tp(e){let{onChange:t,previousContent:n}=e,[r,a]=(0,i.useState)(),[l]=(0,u.g)();return(0,i.useEffect)(()=>l.registerUpdateListener(e=>{let{editorState:n}=e,r="",a={};n.read(()=>{r=(0,s.S)(l,null),a=n.toJSON()}),t(n,a,r)}),[l,t]),(0,i.useEffect)(()=>{n&&a(e=>e!=n?n:e)},[n]),(0,i.useEffect)(()=>{r&&l.update(()=>{let e=new DOMParser().parseFromString(r,"text/html"),t=(0,s.s)(l,e);(0,E.od)(t)})},[r]),null}let tx={ltr:"ltr",rtl:"rtl",placeholder:"editor-placeholder",paragraph:"mb-2 relative",quote:"ml-20 mb-10 text-base text-gray-600 border-l-4 border-gray-300 pl-4",heading:{h1:"text-3xl font-extrabold dark:text-white",h2:"text-2xl font-bold dark:text-white",h3:"text-xl font-bold dark:text-white",h4:"text-lg font-bold dark:text-white",h5:"font-bold dark:text-white"},list:{nested:{listitem:"pl-5 mt-2 space-y-1 list-decimal list-inside dark:text-white"}
1,ol:"max-w-md space-y-1 text-gray-500 list-decimal list-inside dark:text-white",ul:"max-w-md space-y-1 text-gray-500 list-disc list-inside dark:text-white",listitem:"dark:text-white"},image:"editor-image",table:"table-fixed border-collapse border-spacing-0 overflow-y-scroll overflow-x-scroll w-max-content my-30",tableAddColumns:"absolute top-0 w-20 bg-gray-200 h-full right-0 animate-table-controls cursor-pointer",tableAddRows:"absolute bottom-0 w-full bg-gray-200 h-20 left-0 animate-table-controls cursor-pointer",tableCell:"border border-gray-300 w-75 min-w-75 align-top text-left px-6 py-8 relative outline-none",tableCellActionButton:"bg-gray-200 block border-0 rounded-full w-20 h-20 text-gray-800 cursor-pointer",tableCellActionButtonContainer:"block right-5 top-6 absolute z-4 w-20 h-20",tableCellEditing:"shadow-md rounded-md",tableCellHeader:"bg-gray-100 text-left",tableCellPrimarySelected:"border-2 border-blue-400 block absolute inset-0 z-2",tableCellResizer:"absolute right-0 h-full w-8 cursor-ew-resize z-10 top-0",tableCellSelected:"bg-blue-100",tableCellSortedIndicator:"block opacity-50 absolute bottom-0 left-0 w-full h-4 bg-gray-900",tableResizeRuler:"block absolute w-1 bg-blue-400 h-full top-0",tableSelected:"outline-2 border-blue-400",tableSelection:"bg-transparent",layoutContainer:"grid gap-10 m-10",layoutItem:"border border-dashed border-gray-300 p-2 md:p-4",link:"font-medium text-blue-600 dark:text-blue-500 hover:underline",text:{bold:"font-bold",italic:"italic",overflowed:"editor-text-overflowed",hashtag:"editor-text-hashtag",underline:"underline",strikethrough:"line-through",underlineStrikethrough:"underline line-through",code:"font-mono text-[94%] bg-gray-100 dark:bg-gray-600 dark:text-white p-1 rounded"},code:"bg-white dark:bg-gray-600 font-mono block py-2 px-8 leading-1 m-0 mt-2 mb-2 tab-2 overflow-x-auto relative before:absolute before:content-[attr(data-gutter)] before:bg-gray-200 dark:before:bg-gray-700 before:left-0 before:top-0 before:p-2 before:min-w-[25px] before:whitespace-pre-wrap before:text-right after:content-[attr(data-highlight-langrage)] after:right-3 after:absolute",codeHighlight:{atrule:"text-[#07a] dark:text-cyan-400",attr:"text-[#07a] dark:text-cyan-400",boolean:"text-pink-700 dark:text-pink-400",builtin:"text-[#690]",cdata:"bg-slate-600",char:"text-[#690]",class:"text-[#dd4a68]","class-name":"text-[#dd4a68]",comment:"bg-slate-600 dark:bg-gray-600",constant:"text-pink-700 dark:text-pink-400",deleted:"text-pink-700 dark:text-pink-400",doctype:"bg-slate-600",entity:"text-[#9a6e3a]",function:"text-[#dd4a68]",important:"text-[#e90]",inserted:"text-[#690]",keyword:"text-[#07a] dark:text-cyan-400",namespace:"text-[#e90] dark:text-blue-400",number:"text-pink-700 dark:text-pink-400",operator:"text-[#9a6e3a]",prolog:"bg-slate-600",property:"text-pink-700 dark:text-pink-400",punctuation:"text-[#999]",regex:"text-[#e90] dark:text-blue-400",selector:"text-[#690]",string:"text-[#690] dark:text-orange-500",symbol:"text-pink-700 dark:text-pink-400",tag:"text-pink-700 dark:text-pink-400",url:"text-[#9a6e3a]",variable:"text-[#e90] dark:text-blue-400"}};function tf(e){console.error(e)}function tb(){return(0,l.jsx)("div",{className:"editor-placeholder"})}function tw(e){let{onChange:t,previousContent:n}=e,r={namespace:"MyEditor",theme:tx,onError:tf,nodes:[C.c2,o.EG,o.NK,w.HY,C.rT,x.wg,x.o0,y.Fh,y.Cr,y.g0,R,f.qp,f.GR,k.HJ,N.jy,K,S,M]},[a,s]=(0,i.useState)(),[u,_]=(0,i.useState)(null),[E,L]=(0,i.useState)(!1);return(0,l.jsx)("div",{className:"mb-8 flex flex-col",children:(0,l.jsx)(d.R,{initialConfig:r,children:(0,l.jsxs)("div",{className:"editor-container rounded-lg border border-gray-200 bg-gray-50 ",children:[(0,l.jsx)(te,{setIsLinkEditMode:L}),(0,l.jsxs)("div",{className:"editor-inner",children:[(0,l.jsx)(p.B,{contentEditable:(0,l.jsx)("div",{className:"editor-scroller",children:(0,l.jsx)("div",{className:"editor",ref:e=>{null!==e&&_(e)},children:(0,l.jsx)(m.f,{className:"editor-input min-h-[200px] resize-none rounded-b-lg bg-white p-2 px-4 outline-0"})})}),placeholder:(0,l.jsx)(tb,{}),ErrorBoundary:h.Z}),(0,l.jsx)(g.e,{}),(0,l.jsx)(c.C,{}),(0,l.jsx)(tp,{onChange:function(e,n,r){s(e),t(e,n,r)},previousContent:n}),u&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ek,{anchorElem:u,isLinkEditMode:E,setIsLinkEditMode:L}),(0,l.jsx)(tg,{anchorElem:u,cellMerge:!0}
1),(0,l.jsx)(ta,{anchorElem:u,setIsLinkEditMode:L})]}),(0,l.jsx)(v.B,{}),(0,l.jsx)(eI.Z,{}),(0,l.jsx)(eb,{}),(0,l.jsx)(en,{}),(0,l.jsx)(el,{}),(0,l.jsx)(j.l,{hasCellMerge:!0,hasCellBackgroundColor:!0}),(0,l.jsx)(eg,{}),(0,l.jsx)(eS,{}),(0,l.jsx)(Y,{}),(0,l.jsx)(b.Z,{}),(0,l.jsx)(tt.f,{}),(0,l.jsx)(ts,{}),(0,l.jsx)(tn.u,{}),(0,l.jsx)(eK,{}),(0,l.jsx)(eP,{})]})]})})})}},99510:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(85893),a=n(67294),l=n(12416);function i(){let[e,t]=(0,a.useState)(!1),[n,i]=(0,a.useState)(null),s=(0,a.useCallback)(()=>{i(null)},[]);return[(0,a.useMemo)(()=>{if(null===n)return null;let{title:a,content:i,closeOnClickOutside:o}=n;return(0,r.jsxs)(l.u_,{show:e,onClose:()=>{t(!1),s()},children:[(0,r.jsx)(l.u_.Header,{children:a}),(0,r.jsx)(l.u_.Body,{children:i})]})},[n,s]),(0,a.useCallback)(function(e,n){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t(!0),i({closeOnClickOutside:r,content:n(s),title:e})},[s])]}},24953:function(e,t,n){n.d(t,{HB:function(){return c},HJ:function(){return o},dP:function(){return d}});var r=n(85893),a=n(61084),l=n(67294);let i=l.lazy(()=>n.e(5496).then(n.bind(n,95496)));function s(e){if(e.src.startsWith("file:///"))return null;let{alt:t,src:n,width:r,height:a}=e;return{node:c({altText:t,height:a,src:n,width:r})}}class o extends a.Ij{static getType(){return"image"}static clone(e){return new o(e.__src,e.__altText,e.__maxWidth,e.__width,e.__height,e.__showCaption,e.__caption,e.__captionsEnabled,e.__key)}static importJSON(e){let{altText:t,height:n,width:r,maxWidth:a,caption:l,src:i,showCaption:s}=e,o=c({altText:t,height:n,maxWidth:a,showCaption:s,src:i,width:r}),d=o.__caption,u=d.parseEditorState(l.editorState);return u.isEmpty()||d.setEditorState(u),o}exportDOM(){let e=document.createElement("img");return e.setAttribute("src",this.__src),e.setAttribute("alt",this.__altText),e.setAttribute("width",this.__width.toString()),e.setAttribute("height",this.__height.toString()),{element:e}}static importDOM(){return{img:e=>({conversion:s,priority:0})}}exportJSON(){return{altText:this.getAltText(),caption:this.__caption.toJSON(),height:"inherit"===this.__height?0:this.__height,maxWidth:this.__maxWidth,showCaption:this.__showCaption,src:this.getSrc(),type:"image",version:1,width:"inherit"===this.__width?0:this.__width}}setWidthAndHeight(e,t){let n=this.getWritable();n.__width=e,n.__height=t}setShowCaption(e){this.getWritable().__showCaption=e}createDOM(e){let t=document.createElement("span"),n=e.theme.image;return void 0!==n&&(t.className=n),t}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__altText}decorate(){return(0,r.jsx)(l.Suspense,{fallback:null,children:(0,r.jsx)(i,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth,nodeKey:this.getKey(),showCaption:this.__showCaption,caption:this.__caption,captionsEnabled:this.__captionsEnabled,resizable:!0})})}constructor(e,t,n,r,l,i,s,o,c){super(c),this.__src=e,this.__altText=t,this.__maxWidth=n,this.__width=null!=r?r:"inherit",this.__height=null!=l?l:"inherit",this.__showCaption=null!=i&&i,this.__caption=null!=s?s:(0,a.Jh)(),this.__captionsEnabled=null!=o?o:void 0===o}}function c(e){let{altText:t,height:n,maxWidth:r=500,captionsEnabled:l,src:i,width:s,showCaption:c,caption:d,key:u}=e;return(0,a.U2)(new o(i,t,r,s,n,c,d,l,u))}function d(e){return e instanceof o}},19135:function(e,t,n){n.d(t,{jy:function(){return o},nU:function(){return c},sU:function(){return d}});var r=n(85893),a=n(61084),l=n(67294);let i=l.lazy(()=>n.e(9073).then(n.bind(n,69073)));function s(e){if(e instanceof HTMLImageElement){let{alt:t,src:n,width:r,height:a}=e;return{node:c({altText:t,height:a,src:n,width:r})}}return null}class o extends a.Ij{static getType(){return"inline-image"}static clone(e){return new o(e.__src,e.__altText,e.__position,e.__width,e.__height,e.__showCaption,e.__caption,e.__key)}static importJSON(e){let{altText:t,height:n,width:r,caption:a,src:l,showCaption:i,position:s}=e,o=c({altText:t,height:n,position:s,showCaption:i,src:l,width:r}),d=o.__caption,u=d.parseEditorState(a.editorState);return u.isEmpty()||d.setEditorState(u),o}static importDOM(){return{img:e=>({conversion:s,priority:0})}}exportDOM(){let e=document.createElement("img");return e.setAttribute("src",this.__src),e.setAttribute("alt",this.__altText),e.setAttribute("width",this.__width.toString()),e.setAttribute("height",this.__height.toString()),{element:e}}exportJSON(){return{altText:this.getAltText(),caption:this.__caption.toJSON(),height:"inherit"===this.__height?0:this.__height,position:this.__position,showCaption:this.__showCaption,src:this.getSrc(),type:"inline-image",version:1,width:"inherit"===this.__width?0:this.__width}}getSrc(){return this.__src}getAltText(){return this.__altText}setAltText(e){this.getWritable().__altText=e}setWidthAndHeight(e,t){let n=this.getWritable();n.__width=e,n.__height=t}getShowCaption(){return this.__showCaption}setShowCaption(e){this.getWritable().__showCaption=e}getPosition(){return this.__position}setPosition(e){this.getWritable().__position=e}update(e){let t=this.getWritable(),{altText:n,showCaption:r,position:a}=e;void 0!==n&&(t.__altText=n),void 0!==r&&(t.__showCaption=r),void 0!==a&&(t.__position=a)}createDOM(e){let t=document.createElement("span"),n="".concat(e.theme.inlineImage," position-").concat(this.__position);return void 0!==n&&(t.className=n),t}updateDOM(e,t,n){let r=this.__position;if(r!==e.__position){let e="".concat(n.theme.inlineImage," position-").concat(r);void 0!==e&&(t.className=e)}return!1}decorate(){return(0,r.jsx)(l.Suspense,{fallback:null,children:(0,r.jsx)(i,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,nodeKey:this.getKey(),showCaption:this.__showCaption,caption:this.__caption,position:this.__position})})}constructor(e,t,n,r,l,i,s,o){super(o),this.__src=e,this.__altText=t,this.__width=r||"inherit",this.__height=l||"inherit",this.__showCaption=i||!1,this.__caption=s||(0,a.Jh)(),this.__position=n}}function c(e){let{altText:t,position:n,height:r,src:l,width:i,showCaption:s,caption:c,key:d}=e;return(0,a.U2)(new o(l,t,n,i,r,s,c,d))}function d(e){return e instanceof o}},70564:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(85893),a=n(58385);n(67294);var l=n(12401);function i(){return(0,r.jsx)(a.H,{validateUrl:l.m})}},89476:function(e,t,n){n.d(t,{a:function(){return a},k:function(){return l}});var r=n(85893);function a(e){let{children:t}=e;return(0,r.jsx)("div",{className:"DialogButtonsList",children:t})}function l(e){let{"data-test-id":t,children:n}=e;return(0,r.jsx)("div",{className:"DialogActions","data-test-id":t,children:n})}n(67294)},20102:function(e,t,n){n.d(t,{Z:function(){return l}});var r=n(85893);n(67294);var a=n(12416);function l(e){let{children:t,label:n,className:l,...i}=e;return(0,r.jsxs)("div",{className:"max-w-sm",children:[(0,r.jsx)("div",{className:"mb-2 block",children:(0,r.jsx)(a.__,{value:n})}),(0,r.jsx)(a.Ph,{children:t})]})}},64438:function(e,t,n){n.d(t,{Z:function(){return l}});var r=n(85893),a=n(12416);function l(e){let{label:t,value:n,onChange:l,placeholder:i="","data-test-id":s,type:o="text"}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-2 block",children:(0,r.jsx)(a.__,{value:t})}),(0,r.jsx)(a.oi,{type:o,placeholder:i,value:n,onChange:e=>{l(e.target.value)}})]})}n(67294)},12401:function(e,t,n){n.d(t,{N:function(){return a},m:function(){return i}});let r=new Set(["http:","https:","mailto:","sms:","tel:"]);function a(e){try{let t=new URL(e);if(!r.has(t.protocol))return"about:blank"}catch(e){}return e}let l=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function i(e){return"https://"===e||l.test(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.