exports.id=7097,exports.ids=[7097],exports.modules={11571:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});var d=c(60687),e=c(43210);function f({value:a,onChange:b,placeholder:c="Enter text...",disabled:f=!1,className:g="",minHeight:h="120px",rows:i=6}){let j=(0,e.useRef)(null),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)("14"),[q,r]=(0,e.useState)({bold:!1,italic:!1,underline:!1,strikeThrough:!1,justifyLeft:!1,justifyCenter:!1,justifyRight:!1,justifyFull:!1,insertUnorderedList:!1,insertOrderedList:!1}),s=()=>{j.current&&(b(j.current.innerHTML),t())},t=()=>{if(j.current)try{let a=document.queryCommandState("justifyLeft"),b=document.queryCommandState("justifyCenter"),c=document.queryCommandState("justifyRight"),d=document.queryCommandState("justifyFull");r({bold:document.queryCommandState("bold"),italic:document.queryCommandState("italic"),underline:document.queryCommandState("underline"),strikeThrough:document.queryCommandState("strikeThrough"),justifyLeft:a||!b&&!c&&!d,justifyCenter:b,justifyRight:c,justifyFull:d,insertUnorderedList:document.queryCommandState("insertUnorderedList"),insertOrderedList:document.queryCommandState("insertOrderedList")})}catch(a){console.warn("queryCommandState not supported:",a)}},u=(a,b)=>{!f&&(document.execCommand(a,!1,b),j.current&&(j.current.focus(),s(),setTimeout(t,10)))},v={display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"1px solid transparent",background:"#ffffff",borderRadius:"4px",cursor:"pointer",fontSize:"14px",fontWeight:"600",color:"#564B43",transition:"all 0.2s ease",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)"},w={height:"28px",minHeight:"28px",border:"1px solid #E6E6E6",borderRadius:"4px",background:"#ffffff",fontSize:"12px",padding:"0 8px",color:"#564B43",cursor:"pointer",minWidth:"85px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)",transition:"all 0.2s ease"},x={width:"28px",height:"28px",minHeight:"28px",border:"1px solid #E6E6E6",borderRadius:"4px",cursor:"pointer",background:"#ffffff",padding:0,boxShadow:"0 1px 2px rgba(0, 0, 0, 0.05)",transition:"all 0.2s ease",overflow:"hidden"},y=a=>({...v,background:a?"#EF7310":"#ffffff",color:a?"#ffffff":"#564B43",borderColor:a?"#EF7310":"transparent",opacity:f?.5:1,cursor:f?"not-allowed":"pointer"}),z=(a,b,c)=>{!f&&(b&&!c?(a.currentTarget.style.background="#EF7310",a.currentTarget.style.color="#ffffff",a.currentTarget.style.borderColor="#EF7310",a.currentTarget.style.transform="translateY(-1px)",a.currentTarget.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.1)"):b||c||(a.currentTarget.style.background="#ffffff",a.currentTarget.style.color="#564B43",a.currentTarget.style.borderColor="transparent",a.currentTarget.style.transform="translateY(0)",a.currentTarget.style.boxShadow="0 1px 2px rgba(0, 0, 0, 0.05)"))};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("style",{children:`
        .rich-textarea-wrapper:focus-within {
          border-color: #EF7310 !important;
          box-shadow: 0 0 0 0.2rem rgba(239, 115, 16, 0.25) !important;
        }
        .rich-editor[contenteditable]:empty:before {
          content: attr(data-placeholder);
          color: #999;
          opacity: 0.7;
          pointer-events: none;
        }
        .rich-editor p {
          margin: 0 0 12px 0;
        }
        .rich-editor p:last-child {
          margin-bottom: 0;
        }
        .rich-editor ul, .rich-editor ol {
          margin: 0 0 12px 0;
          padding-left: 24px;
        }
        .rich-editor li {
          margin-bottom: 4px;
        }
        .rich-editor strong {
          font-weight: 700;
        }
        .rich-editor em {
          font-style: italic;
        }
        .rich-editor u {
          text-decoration: underline;
        }
        .rich-editor s {
          text-decoration: line-through;
        }
        .rich-editor h1, .rich-editor h2, .rich-editor h3 {
          margin: 16px 0 8px 0;
          font-weight: bold;
        }
        .rich-editor h1 {
          font-size: 2em;
        }
        .rich-editor h2 {
          font-size: 1.5em;
        }
        .rich-editor h3 {
          font-size: 1.25em;
        }
        .rich-editor a {
          color: #EF7310;
          text-decoration: underline;
        }
        .rich-editor a:hover {
          text-decoration: none;
        }
      `}),(0,d.jsxs)("div",{className:`rich-textarea-wrapper ${g}`,style:{border:"1px solid #E6E6E6",borderRadius:"6px",background:"#ffffff",overflow:"hidden",transition:"border-color 0.3s ease",padding:"0px"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"12px 16px",background:"#F8F9FA",borderBottom:"1px solid #E6E6E6",gap:"8px",flexWrap:"wrap"},children:[(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("bold"),title:"Bold (Ctrl+B)",disabled:f,style:y(q.bold),onMouseEnter:a=>z(a,!0,q.bold),onMouseLeave:a=>z(a,!1,q.bold),children:(0,d.jsx)("strong",{children:"B"})}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("italic"),title:"Italic (Ctrl+I)",disabled:f,style:y(q.italic),onMouseEnter:a=>z(a,!0,q.italic),onMouseLeave:a=>z(a,!1,q.italic),children:(0,d.jsx)("em",{children:"I"})}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("underline"),title:"Underline (Ctrl+U)",disabled:f,style:y(q.underline),onMouseEnter:a=>z(a,!0,q.underline),onMouseLeave:a=>z(a,!1,q.underline),children:(0,d.jsx)("u",{children:"U"})}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("strikeThrough"),title:"Strikethrough",disabled:f,style:y(q.strikeThrough),onMouseEnter:a=>z(a,!0,q.strikeThrough),onMouseLeave:a=>z(a,!1,q.strikeThrough),children:(0,d.jsx)("s",{children:"S"})}),(0,d.jsx)("div",{style:{width:"1px",height:"24px",background:"#E6E6E6",margin:"0 8px"}}),(0,d.jsxs)("select",{onChange:a=>u("formatBlock",a.target.value),disabled:f,defaultValue:"",style:{...w,maxWidth:"90px",opacity:f?.5:1,cursor:f?"not-allowed":"pointer"},children:[(0,d.jsx)("option",{value:"",children:"Format"}),(0,d.jsx)("option",{value:"h1",children:"Heading 1"}),(0,d.jsx)("option",{value:"h2",children:"Heading 2"}),(0,d.jsx)("option",{value:"h3",children:"Heading 3"}),(0,d.jsx)("option",{value:"p",children:"Paragraph"})]}),(0,d.jsxs)("select",{onChange:a=>(a=>{if(f)return;p(a),document.execCommand("fontSize",!1,"7");let b=j.current?.querySelectorAll('font[size="7"]');b?.forEach(b=>{b.removeAttribute("size"),b.style.fontSize=a+"px"}),j.current&&(j.current.focus(),s())})(a.target.value),disabled:f,value:o,style:{...w,maxWidth:"30px",opacity:f?.5:1,cursor:f?"not-allowed":"pointer"},children:[(0,d.jsx)("option",{value:"12",children:"12px"}),(0,d.jsx)("option",{value:"14",children:"14px"}),(0,d.jsx)("option",{value:"16",children:"16px"}),(0,d.jsx)("option",{value:"18",children:"18px"}),(0,d.jsx)("option",{value:"20",children:"20px"}),(0,d.jsx)("option",{value:"24",children:"24px"})]}),(0,d.jsx)("div",{style:{width:"1px",height:"24px",background:"#E6E6E6",margin:"0 8px"}}),(0,d.jsx)("input",{type:"color",onChange:a=>u("foreColor",a.target.value),title:"Text Color",disabled:f,style:{...x,opacity:f?.5:1,cursor:f?"not-allowed":"pointer"}}),(0,d.jsx)("input",{type:"color",onChange:a=>u("backColor",a.target.value),title:"Background Color",disabled:f,defaultValue:"#ffffff",style:{...x,opacity:f?.5:1,cursor:f?"not-allowed":"pointer"}}),(0,d.jsx)("div",{style:{width:"1px",height:"24px",background:"#E6E6E6",margin:"0 8px"}}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("justifyLeft"),title:"Align Left",disabled:f,style:y(q.justifyLeft),onMouseEnter:a=>z(a,!0,q.justifyLeft),onMouseLeave:a=>z(a,!1,q.justifyLeft),children:"⬅"}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("justifyCenter"),title:"Center",disabled:f,style:y(q.justifyCenter),onMouseEnter:a=>z(a,!0,q.justifyCenter),onMouseLeave:a=>z(a,!1,q.justifyCenter),children:"↔"}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("justifyRight"),title:"Align Right",disabled:f,style:y(q.justifyRight),onMouseEnter:a=>z(a,!0,q.justifyRight),onMouseLeave:a=>z(a,!1,q.justifyRight),children:"➡"}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("justifyFull"),title:"Justify",disabled:f,style:y(q.justifyFull),onMouseEnter:a=>z(a,!0,q.justifyFull),onMouseLeave:a=>z(a,!1,q.justifyFull),children:"⬌"}),(0,d.jsx)("div",{style:{width:"1px",height:"24px",background:"#E6E6E6",margin:"0 8px"}}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("insertUnorderedList"),title:"Bullet List",disabled:f,style:y(q.insertUnorderedList),onMouseEnter:a=>z(a,!0,q.insertUnorderedList),onMouseLeave:a=>z(a,!1,q.insertUnorderedList),children:"•"}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("insertOrderedList"),title:"Numbered List",disabled:f,style:y(q.insertOrderedList),onMouseEnter:a=>z(a,!0,q.insertOrderedList),onMouseLeave:a=>z(a,!1,q.insertOrderedList),children:"1."}),(0,d.jsx)("div",{style:{width:"1px",height:"24px",background:"#E6E6E6",margin:"0 8px"}}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>{if(f)return;let a=window.getSelection();if(a&&a.toString())l(!0);else{let a=prompt("Enter URL:");if(a){let b=prompt("Enter link text:")||a;document.execCommand("insertHTML",!1,`<a href="${a}" target="_blank">${b}</a>`),j.current&&(j.current.focus(),s())}}},title:"Insert Link",disabled:f,style:{...v,opacity:f?.5:1,cursor:f?"not-allowed":"pointer"},onMouseEnter:a=>z(a,!0,!1),onMouseLeave:a=>z(a,!1,!1),children:"\uD83D\uDD17"}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("undo"),title:"Undo (Ctrl+Z)",disabled:f,style:{...v,opacity:f?.5:1,cursor:f?"not-allowed":"pointer"},onMouseEnter:a=>z(a,!0,!1),onMouseLeave:a=>z(a,!1,!1),children:"↶"}),(0,d.jsx)("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>u("redo"),title:"Redo (Ctrl+Shift+Z)",disabled:f,style:{...v,opacity:f?.5:1,cursor:f?"not-allowed":"pointer"},onMouseEnter:a=>z(a,!0,!1),onMouseLeave:a=>z(a,!1,!1),children:"↷"})]}),(0,d.jsx)("div",{ref:j,contentEditable:!f,className:"rich-editor",style:{minHeight:h,padding:"12px",outline:"none",fontSize:"16px",lineHeight:"1.6",color:"#564B43",fontFamily:'"Manrope", sans-serif',overflowY:"auto",maxHeight:"400px"},onInput:s,onKeyDown:a=>{if(!f){if(a.ctrlKey||a.metaKey)switch(a.key){case"b":a.preventDefault(),document.execCommand("bold",!1);break;case"i":a.preventDefault(),document.execCommand("italic",!1);break;case"u":a.preventDefault(),document.execCommand("underline",!1);break;case"z":a.preventDefault(),a.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1)}if("Enter"===a.key&&!a.shiftKey&&!a.ctrlKey&&!a.metaKey){let a=window.getSelection();if(a&&a.rangeCount>0){let b=a.getRangeAt(0).commonAncestorContainer,c=b.nodeType===Node.TEXT_NODE?b.parentElement:b;for(;c&&c!==j.current;){if("LI"===c.tagName)return;c=c.parentElement}}}}},"data-placeholder":c,suppressContentEditableWarning:!0}),(0,d.jsx)("input",{type:"hidden",value:j.current&&j.current.textContent||"",readOnly:!0}),k&&(0,d.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:(0,d.jsxs)("div",{style:{background:"#ffffff",padding:"24px",borderRadius:"8px",boxShadow:"0 10px 30px rgba(0, 0, 0, 0.3)",minWidth:"320px",maxWidth:"400px"},children:[(0,d.jsx)("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",fontWeight:"600",color:"#564B43"},children:"Insert Link"}),(0,d.jsx)("input",{type:"url",value:m,onChange:a=>n(a.target.value),placeholder:"Enter URL",style:{width:"100%",padding:"12px",border:"1px solid #E6E6E6",borderRadius:"6px",fontSize:"14px",marginBottom:"16px",outline:"none"},autoFocus:!0}),(0,d.jsxs)("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[(0,d.jsx)("button",{onClick:()=>{m&&(document.execCommand("createLink",!1,m),l(!1),n(""),j.current&&(j.current.focus(),s()))},style:{padding:"8px 16px",border:"none",borderRadius:"4px",fontSize:"14px",cursor:"pointer",transition:"all 0.2s ease",background:"#EF7310",color:"white"},children:"Apply"}),(0,d.jsx)("button",{onClick:()=>{l(!1),n("")},style:{padding:"8px 16px",border:"none",borderRadius:"4px",fontSize:"14px",cursor:"pointer",transition:"all 0.2s ease",background:"#F1F5F9",color:"#564B43"},children:"Cancel"})]})]})})]})]})}},33363:()=>{}};