1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7374],{7220:(e,a,s)=>{s.d(a,{I:()=>h,SQ:()=>m,_2:()=>f,lp:()=>x,mB:()=>g,rI:()=>c,ty:()=>u});var t=s(95155),n=s(12115),r=s(14161),i=s(27937),l=s(5917),o=s(99051),d=s(25016);let c=r.bL,u=r.l9,h=r.YJ;r.ZL,r.Pb,r.z6,n.forwardRef((e,a)=>{let{className:s,inset:n,children:l,...o}=e;return(0,t.jsxs)(r.ZP,{ref:a,className:(0,d.cn)("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",s),...o,children:[l,(0,t.jsx)(i.A,{className:"ml-auto"})]})}).displayName=r.ZP.displayName,n.forwardRef((e,a)=>{let{className:s,...n}=e;return(0,t.jsx)(r.G5,{ref:a,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-white p-1 text-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",s),...n})}).displayName=r.G5.displayName;let m=n.forwardRef((e,a)=>{let{className:s,sideOffset:n=4,...i}=e;return(0,t.jsx)(r.ZL,{children:(0,t.jsx)(r.UC,{ref:a,sideOffset:n,className:(0,d.cn)("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-white p-1 text-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",s),...i})})});m.displayName=r.UC.displayName;let f=n.forwardRef((e,a)=>{let{className:s,inset:n,...i}=e;return(0,t.jsx)(r.q7,{ref:a,className:(0,d.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",s),...i})});f.displayName=r.q7.displayName,n.forwardRef((e,a)=>{let{className:s,children:n,checked:i,...o}=e;return(0,t.jsxs)(r.H_,{ref:a,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:i,...o,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(r.VF,{children:(0,t.jsx)(l.A,{className:"h-4 w-4"})})}),n]})}).displayName=r.H_.displayName,n.forwardRef((e,a)=>{let{className:s,children:n,...i}=e;return(0,t.jsxs)(r.hN,{ref:a,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...i,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(r.VF,{children:(0,t.jsx)(o.A,{className:"h-2 w-2 fill-current"})})}),n]})}).displayName=r.hN.displayName;let x=n.forwardRef((e,a)=>{let{className:s,inset:n,...i}=e;return(0,t.jsx)(r.JU,{ref:a,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",s),...i})});x.displayName=r.JU.displayName;let g=n.forwardRef((e,a)=>{let{className:s,...n}=e;return(0,t.jsx)(r.wv,{ref:a,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",s),...n})});g.displayName=r.wv.displayName},33789:(e,a,s)=>{s.d(a,{p:()=>i});var t=s(95155),n=s(12115),r=s(25016);let i=n.forwardRef((e,a)=>{let{className:s,type:n,...i}=e;return(0,t.jsx)("input",{type:n,className:(0,r.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:a,...i})});i.displayName="Input"},54679:(e,a,s)=>{s.d(a,{Cf:()=>h,Es:()=>f,L3:()=>x,c7:()=>m,lG:()=>o,rr:()=>g,zM:()=>d});var t=s(95155),n=s(12115),r=s(76297),i=s(65229),l=s(25016);let o=r.bL,d=r.l9,c=r.ZL;r.bm;let u=n.forwardRef((e,a)=>{let{className:s,...n}=e;return(0,t.jsx)(r.hJ,{ref:a,className:(0,l.cn)("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...n})});u.displayName=r.hJ.displayName;let h=n.forwardRef((e,a)=>{let{className:s,children:n,...o}=e;return(0,t.jsxs)(c,{children:[(0,t.jsx)(u,{}),(0,t.jsxs)(r.UC,{ref:a,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
1nded-lg",s),...o,children:[n,(0,t.jsxs)(r.bm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(i.A,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});h.displayName=r.UC.displayName;let m=e=>{let{className:a,...s}=e;return(0,t.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",a),...s})};m.displayName="DialogHeader";let f=e=>{let{className:a,...s}=e;return(0,t.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...s})};f.displayName="DialogFooter";let x=n.forwardRef((e,a)=>{let{className:s,...n}=e;return(0,t.jsx)(r.hE,{ref:a,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",s),...n})});x.displayName=r.hE.displayName;let g=n.forwardRef((e,a)=>{let{className:s,...n}=e;return(0,t.jsx)(r.VY,{ref:a,className:(0,l.cn)("text-sm text-muted-foreground",s),...n})});g.displayName=r.VY.displayName},64993:(e,a,s)=>{s.r(a),s.d(a,{default:()=>H});var t=s(95155),n=s(154),r=s(50758),i=s(56135),l=s(63660),o=s(77004),d=s(75699),c=s(78336),u=s(22984),h=s(79371),m=s(12115),f=s(97003),x=s(7220),g=s(54679),p=s(33789),b=s(90235),j=s(40949),y=s(90651),v=s(67048),w=s(44615),N=s(50859),k=s(42196),C=s(41669),z=s(80003),A=s(97239),_=s(45833),R=s(40583),L=s(18720),$=s(25016);function H(e){let{value:a,onChange:s,placeholder:H="Write somethingâ¦",className:I,minHeight:E="120px",contentHeight:T,disabled:P=!1,variant:U="default"}=e,M=(0,m.useRef)(!1),B=(0,m.useRef)(null),[D,O]=(0,m.useState)(!1),[J,S]=(0,m.useState)(""),F=(0,m.useCallback)(async e=>{let a=new FormData;a.append("file",e);let s=await fetch("/api/cms/upload",{method:"POST",body:a});if(!s.ok)throw Error((await s.json()).message||"Upload failed");let{url:t}=await s.json();return t},[]),Z=(0,n.hG)({immediatelyRender:!1,extensions:[r.A.configure({heading:{levels:[1,2,3,4,5,6]}}),i.Ay.configure({openOnClick:!1,HTMLAttributes:{class:"text-primary underline"}}),l.Ay.configure({HTMLAttributes:{class:"rounded-lg max-w-full h-auto"}}),o.A.configure({placeholder:H}),d.XI.configure({resizable:!0}),c.A,h.h,u.A],content:a||"",editable:!P,editorProps:{attributes:{class:"prose prose-sm max-w-none min-h-[80px] px-3 py-2 focus:outline-none"},handleDOMEvents:{blur:()=>{if(Z&&!M.current){let e=Z.getHTML();e!==a&&s(e)}}}},onUpdate:e=>{let{editor:a}=e;if(M.current)return;let t=a.getHTML();s("<p></p>"===t?"":t)}});(0,m.useEffect)(()=>{Z&&a!==Z.getHTML()&&(M.current=!0,Z.commands.setContent(a||"",{emitUpdate:!1}),M.current=!1)},[a,Z]),(0,m.useEffect)(()=>{Z&&Z.setEditable(!P)},[P,Z]);let G=()=>{S((null==Z?void 0:Z.getAttributes("link").href)||""),O(!0)},Q=()=>{""===J?null==Z||Z.chain().focus().unsetLink().run():null==Z||Z.chain().focus().setLink({href:J}).run(),O(!1),S("")},V=()=>{var e;null==(e=B.current)||e.click()},Y=async e=>{var a;let s=null==(a=e.target.files)?void 0:a[0];if(s&&s.type.startsWith("image/")){try{let e=await F(s);null==Z||Z.chain().focus().setImage({src:e}).run(),L.oR.success("Image added")}catch(e){L.oR.error(e instanceof Error?e.message:"Failed to upload image")}e.target.value=""}};return Z?"docs"===U?(0,t.jsxs)("div",{className:(0,$.cn)("flex flex-col h-full bg-[#f8f9fa] dark:bg-zinc-900/50 overflow-hidden",I),children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1 border-b border-gray-200 dark:border-zinc-800 bg-[#f0f4f9] dark:bg-zinc-950 px-3 py-1.5 shrink-0 select-none",children:[(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",onClick:()=>Z.chain().focus().undo().run(),disabled:P||!Z.can().undo(),title:"Undo",children:(0,t.jsx)(j.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",onClick:()=>Z.chain().focus().redo().run(),disabled:P||!Z.can().redo(),title:"Redo",children:(0,t.jsx)(y.A,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"w-px h-5 bg-gray-300 dark:bg-zinc-700 mx-1"}),(0,t.jsxs)(x.rI,{children:[(0,t.jsx)(x.ty,{asChild:!0,children:(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs font-medium rounded hover:bg-gray-200 dark:hover:bg-zinc-800",disabled:P,children:Z.isActive("heading",{level:1})?"Heading 1":Z.isActive("heading",{level:2})?"Heading 2":Z.isActive("heading",{level:3})?"Heading 3":"Normal text"})}),(0,t.jsxs)(x.SQ,{align:"start",children:[(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().setParagraph().run(),children:"Normal text"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().toggleHeading({level:1}).run(),children:"Heading 1"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().toggleHeading({level:2}).run(),children:"Heading 2"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().toggleHeading({level:3}).run(),children:"Heading 3"})]})]}),(0,t.jsx)("span",{className:"w-px h-5 bg-gray-300 dark:bg-zinc-700 mx-1"}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:(0,$.cn)("h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",Z.isActive("bold")&&"bg-gray-200 dark:bg-zinc-800 text-primary"),onClick:()=>Z.chain().focus().toggleBold().run(),disabled:P,title:"Bold",children:(0,t.jsx)(v.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:(0,$.cn)("h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",Z.isActive("italic")&&"bg-gray-200 dark:bg-zinc-800 text-primary"),onClick:()=>Z.chain().focus().toggleItalic().run(),disabled:P,title:"Italic",children:(0,t.jsx)(w.A,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"w-px h-5 bg-gray-300 dark:bg-zinc-700 mx-1"}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:(0,$.cn)("h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",Z.isActive("link")&&"bg-gray-200 dark:bg-zinc-800 text-primary"),onClick:G,disabled:P,title:"Link",children:(0,t.jsx)(N.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",onClick:V,disabled:P,title:"Image",children:(0,t.jsx)(k.A,{className:"h-4 w-4"})}),(0,t.jsx)("input",{ref:B,type:"file",accept:"image/*",className:"hidden",onChange:Y}),(0,t.jsxs)(x.rI,{children:[(0,t.jsx)(x.ty,{asChild:!0,children:(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",disabled:P,title:"Table",children:(0,t.jsx)(C.A,{className:"h-4 w-4"})})}),(0,t.jsxs)(x.SQ,{align:"start",children:[(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:"Insert 3\xd73 table"}),(0,t.jsx)(x._2,{onClick:()=>
1Z.chain().focus().insertTable({rows:4,cols:4,withHeaderRow:!0}).run(),children:"Insert 4\xd74 table"}),(0,t.jsx)(x.mB,{}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().addColumnAfter().run(),disabled:!Z.can().addColumnAfter(),children:"Add Column After"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().addRowAfter().run(),disabled:!Z.can().addRowAfter(),children:"Add Row After"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().deleteTable().run(),disabled:!Z.can().deleteTable(),className:"text-destructive focus:text-destructive",children:"Delete Table"})]})]}),(0,t.jsx)("span",{className:"w-px h-5 bg-gray-300 dark:bg-zinc-700 mx-1"}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:(0,$.cn)("h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",Z.isActive("bulletList")&&"bg-gray-200 dark:bg-zinc-800 text-primary"),onClick:()=>Z.chain().focus().toggleBulletList().run(),disabled:P,title:"Bullet list",children:(0,t.jsx)(z.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:(0,$.cn)("h-8 w-8 rounded hover:bg-gray-200 dark:hover:bg-zinc-800",Z.isActive("orderedList")&&"bg-gray-200 dark:bg-zinc-800 text-primary"),onClick:()=>Z.chain().focus().toggleOrderedList().run(),disabled:P,title:"Numbered list",children:(0,t.jsx)(A.A,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"h-6 bg-[#f8f9fa] dark:bg-zinc-950 border-b border-gray-200 dark:border-zinc-800 flex items-center select-none relative px-20 shrink-0",children:(0,t.jsxs)("div",{className:"w-full relative h-full flex items-center justify-between text-[9px] text-gray-400",children:[(0,t.jsx)("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-blue-600 rounded-full cursor-col-resize shadow-sm"}),(0,t.jsx)("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-2.5 h-2.5 bg-blue-600 rounded-full cursor-col-resize shadow-sm"}),Array.from({length:11}).map((e,a)=>(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)("span",{children:a+1}),(0,t.jsx)("div",{className:"h-1 w-[1px] bg-gray-300 dark:bg-zinc-700"})]},a))]})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto bg-[#f8f9fa] dark:bg-zinc-900/50 p-6 sm:p-10 flex justify-center",children:(0,t.jsx)("div",{className:"w-full max-w-[800px] min-h-[1000px] bg-white dark:bg-zinc-950 shadow-md border border-gray-200/80 dark:border-zinc-800 px-12 py-16 focus-within:ring-1 focus-within:ring-primary/20 transition-all rounded-sm",children:(0,t.jsx)(n.$Z,{editor:Z,className:"prose prose-sm dark:prose-invert max-w-none focus:outline-none min-h-[900px]"})})}),(0,t.jsx)(g.lG,{open:D,onOpenChange:O,children:(0,t.jsxs)(g.Cf,{className:"sm:max-w-md",children:[(0,t.jsxs)(g.c7,{children:[(0,t.jsx)(g.L3,{children:"Insert Link"}),(0,t.jsx)(g.rr,{children:"Enter the URL for the selected text."})]}),(0,t.jsx)("div",{className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.J,{children:"URL"}),(0,t.jsx)(p.p,{placeholder:"https://example.com",value:J,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Q()}})]})}),(0,t.jsxs)(g.Es,{children:[(0,t.jsx)(f.$,{variant:"outline",onClick:()=>O(!1),children:"Cancel"}),(0,t.jsx)(f.$,{onClick:Q,children:"Insert"})]})]})})]}):(0,t.jsxs)("div",{className:(0,$.cn)("rounded-md border border-input bg-background overflow-hidden",I),children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-input bg-muted/40 px-1 py-1",children:[(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>Z.chain().focus().toggleHeading({level:1}).run(),disabled:P,title:"Heading 1",children:(0,t.jsx)(_.A,{className:"h-4 w-4"})}),(0,t.jsxs)(x.rI,{children:[(0,t.jsx)(x.ty,{asChild:!0,children:(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs",disabled:P,children:"H2âH6"})}),(0,t.jsx)(x.SQ,{align:"start",children:[2,3,4,5,6].map(e=>(0,t.jsxs)(x._2,{onClick:()=>Z.chain().focus().toggleHeading({level:e}).run(),children:["H",e]},e))})]}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>Z.chain().focus().setParagraph().run(),disabled:P,title:"Auto / Paragraph",children:(0,t.jsx)(R.A,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"w-px h-6 bg-border mx-0.5"}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>Z.chain().focus().toggleBold().run(),disabled:P||!Z.can().chain().focus().toggleBold().run(),children:(0,t.jsx)(v.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>Z.chain().focus().toggleItalic().run(),disabled:P||!Z.can().chain().focus().toggleItalic().run(),children:(0,t.jsx)(w.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:G,disabled:P,title:"Link",children:(0,t.jsx)(N.A,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"w-px h-6 bg-border mx-0.5"}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>Z.chain().focus().toggleBulletList().run(),disabled:P||!Z.can().chain().focus().toggleBulletList().run(),children:(0,t.jsx)(z.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>Z.chain().focus().toggleOrderedList().run(),disabled:P||!Z.can().chain().focus().toggleOrderedList().run(),children:(0,t.jsx)(A.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:V,disabled:P,title:"Insert image",children:(0,t.jsx)(k.A,{className:"h-4 w-4"})}),(0,t.jsx)("input",{ref:B,type:"file",accept:"image/*",className:"hidden",onChange:Y}),(0,t.jsxs)(x.rI,{children:[(0,t.jsx)(x.ty,{asChild:!0,children:(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",disabled:P,title:"Insert table",children:(0,t.jsx)(C.A,{className:"h-4 w-4"})})}),(0,t.jsxs)(x.SQ,{align:"start",children:[(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:"Insert 3\xd73 table"}),(0,t.jsx)(x._2,{onClick:()=>
1Z.chain().focus().insertTable({rows:4,cols:4,withHeaderRow:!0}).run(),children:"Insert 4\xd74 table"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().addColumnAfter().run(),disabled:!Z.can().addColumnAfter(),children:"Add column after"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().addRowAfter().run(),disabled:!Z.can().addRowAfter(),children:"Add row after"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().deleteColumn().run(),disabled:!Z.can().deleteColumn(),children:"Delete column"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().deleteRow().run(),disabled:!Z.can().deleteRow(),children:"Delete row"}),(0,t.jsx)(x._2,{onClick:()=>Z.chain().focus().deleteTable().run(),disabled:!Z.can().deleteTable(),children:"Delete table"})]})]}),(0,t.jsx)("span",{className:"w-px h-6 bg-border mx-0.5"}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>Z.chain().focus().undo().run(),disabled:P||!Z.can().chain().focus().undo().run(),children:(0,t.jsx)(j.A,{className:"h-4 w-4"})}),(0,t.jsx)(f.$,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>Z.chain().focus().redo().run(),disabled:P||!Z.can().chain().focus().redo().run(),children:(0,t.jsx)(y.A,{className:"h-4 w-4"})})]}),(0,t.jsx)(n.$Z,{editor:Z,style:{minHeight:E,height:T,overflowY:T?"auto":void 0},className:"rounded-b-md [&_.ProseMirror]:min-h-[80px] [&_.ProseMirror]:p-3 [&_.ProseMirror]:outline-none [&_.tiptap p.is-editor-empty:first-child::before]:text-muted-foreground [&_.tiptap p.is-editor-empty:first-child::before]:float-left [&_.tiptap p.is-editor-empty:first-child::before]:h-0 [&_.tiptap p.is-editor-empty:first-child::before]:pointer-events-none [&_.ProseMirror_img]:rounded-lg [&_.ProseMirror_img]:max-w-full [&_.ProseMirror_img]:h-auto"}),(0,t.jsx)(g.lG,{open:D,onOpenChange:O,children:(0,t.jsxs)(g.Cf,{className:"sm:max-w-md",children:[(0,t.jsxs)(g.c7,{children:[(0,t.jsx)(g.L3,{children:"Insert Link"}),(0,t.jsx)(g.rr,{children:"Enter the URL for the selected text."})]}),(0,t.jsx)("div",{className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.J,{children:"URL"}),(0,t.jsx)(p.p,{placeholder:"https://example.com",value:J,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Q()}})]})}),(0,t.jsxs)(g.Es,{children:[(0,t.jsx)(f.$,{variant:"outline",onClick:()=>O(!1),children:"Cancel"}),(0,t.jsx)(f.$,{onClick:Q,children:"Insert"})]})]})})]}):null}},90235:(e,a,s)=>{s.d(a,{J:()=>d});var t=s(95155),n=s(12115),r=s(10489),i=s(83101),l=s(25016);let o=(0,i.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=n.forwardRef((e,a)=>{let{className:s,...n}=e;return(0,t.jsx)(r.b,{ref:a,className:(0,l.cn)(o(),s),...n})});d.displayName=r.b.displayName},97003:(e,a,s)=>{s.d(a,{$:()=>d,r:()=>o});var t=s(95155),n=s(12115),r=s(32467),i=s(83101),l=s(25016);let o=(0,i.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-semibold transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 active:scale-[0.98]",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-2xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-xl px-3 text-xs",lg:"h-10 rounded-xl px-6",icon:"h-9 w-9 rounded-xl"}},defaultVariants:{variant:"default",size:"default"}}),d=n.forwardRef((e,a)=>{let{className:s,variant:n,size:i,asChild:d=!1,...c}=e,u=d?r.DX:"button";return(0,t.jsx)(u,{className:(0,l.cn)(o({variant:n,size:i,className:s})),ref:a,...c})});d.displayName="Button"}}]);
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.