PageSourceSearch

https://seedance2.live/_next/static/chunks/7799.37fff6ac24efde02.js

js seedance2.live collected 2026-10-04 02:18:47 UTC 25,074 bytes, 4 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7799],{8439:(e,t,s)=>{s.d(t,{SQ:()=>o,_2:()=>d,lp:()=>c,mB:()=>u,rI:()=>i,ty:()=>r});var a=s(2100),l=s(50436);s(49016);var n=s(37001);function i({...e}){return(0,a.jsx)(l.bL,{"data-slot":"dropdown-menu",...e})}function r({...e}){return(0,a.jsx)(l.l9,{"data-slot":"dropdown-menu-trigger",...e})}function o({className:e,sideOffset:t=4,...s}){return(0,a.jsx)(l.ZL,{children:(0,a.jsx)(l.UC,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,n.cn)("bg-background text-foreground border-border 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto border p-1 shadow-lg [will-change:transform,opacity] [contain:layout_style]",e),...s})})}function d({className:e,inset:t,variant:s="default",...i}){return(0,a.jsx)(l.q7,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":s,className:(0,n.cn)("focus:bg-primary/10 focus:text-primary data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 px-2 py-1.5 font-mono text-xs tracking-wide outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 transition-colors",e),...i})}function c({className:e,inset:t,...s}){return(0,a.jsx)(l.JU,{"data-slot":"dropdown-menu-label","data-inset":t,className:(0,n.cn)("px-2 py-1.5 font-mono text-[10px] tracking-widest text-muted-foreground uppercase data-[inset]:pl-8",e),...s})}function u({className:e,...t}){return(0,a.jsx)(l.wv,{"data-slot":"dropdown-menu-separator",className:(0,n.cn)("bg-border -mx-1 my-1 h-px",e),...t})}},47799:(e,t,s)=>{s.r(t),s.d(t,{TiptapEditor:()=>ed});var a=s(2100),l=s(58426),n=s(28094),i=s(74518),r=s(11766),o=s(2882),d=s(89742),c=s(32951),u=s(43102),m=s(20889),h=s(55940),x=s(46834),p=s(36363),g=s(48235),f=s(52206),b=s(43780),j=s(84055),v=s(63643),y=s(65766),w=s(20312),N=s(92050),k=s(3676),A=s(62036),C=s(53849),R=s(5786),z=s(64794),$=s(4164),L=s(6299),U=s(17785),I=s(12004),T=s(42231),E=s(69982),S=s(41927),_=s(46027),M=s(27641),O=s(45502),B=s(7337),H=s(79439),P=s(46121),q=s(41096),F=s(54204),D=s(50742),G=s(27977),W=s(89078),K=s(49016),Y=s(72161),Z=s(81812),V=s(6106),Q=s(86154),J=s(49209),X=s(36301),ee=s(85281),et=s(82611),es=s(39436);function ea({editor:e}){let[t,s]=(0,K.useState)(!1);return((0,K.useEffect)(()=>{let t=()=>{s(e.isActive("table"))};return e.on("selectionUpdate",t),e.on("transaction",t),t(),()=>{e.off("selectionUpdate",t),e.off("transaction",t)}},[e]),t)?(0,a.jsxs)("div",{className:"absolute right-2 top-2 z-50 flex items-center gap-1 rounded-md border bg-background p-1 shadow-lg",children:[(0,a.jsxs)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>e.chain().focus().addRowBefore().run(),title:"Add Row Above",className:"h-8 px-2",children:[(0,a.jsx)(et.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"text-xs ml-1",children:"Row↑"})]}),(0,a.jsxs)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>e.chain().focus().addRowAfter().run(),title:"Add Row Below",className:"h-8 px-2",children:[(0,a.jsx)(et.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"text-xs ml-1",children:"Row↓"})]}),(0,a.jsxs)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>e.chain().focus().addColumnBefore().run(),title:"Add Column Left",className:"h-8 px-2",children:[(0,a.jsx)(et.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"text-xs ml-1",children:"Column←"})]}),(0,a.jsxs)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>e.chain().focus().addColumnAfter().run(),title:"Add Column Right",className:"h-8 px-2",children:[(0,a.jsx)(et.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"text-xs ml-1",children:"Column→"})]}),(0,a.jsx)("div",{className:"w-px h-6 bg-border mx-1"}),(0,a.jsxs)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>e.chain().focus().deleteRow().run(),title:"Delete Row",className:"h-8 px-2",children:[(0,a.jsx)(es.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"text-xs ml-1",children:"Row"})]}),(0,a.jsxs)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>e.chain().focus().deleteColumn().run(),title:"Delete Column",className:"h-8 px-2",children:[(0,a.jsx)(es.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"text-xs ml-1",children:"Column"})]}),(0,a.jsxs)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>e.chain().focus().deleteTable().run(),title:"Delete Table",className:"h-8 px-2",children:[(0,a.jsx)(es.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{className:"text-xs ml-1",children:"Table"})]})]}):null}var el=s(28609),en=s(67631),ei=s(88699),er=(s(82698),s(8439),s(89507));function eo({editor:e,disabled:t=!1,postType:s="blog"}){let l=(0,K.useRef)(null),{completion:n,isLoading:i,complete:r}=(0,en.sQ)({api:"/api/admin/translate",streamProtocol:"text",experimental_throttle:300,body:{modelId:"",provider:""},onError:t=>{let s;l.current&&e&&(e.commands.setContent(l.current),l.current=null);try{s=JSON.parse(t.message).error||"Translation failed"}catch{s=t.message||"Translation failed"}Y.oR.error(s)}});return(0,K.useEffect)(()=>{n&&e&&(e.commands.setContent(n),l.current=null)},[n,e]),(0,K.useEffect)(()=>{e&&e.setEditable(!t&&!i)},[t,i,e]),(0,K.useCallback)(async t=>{if(!e)return;let a=e.storage.markdown.getMarkdown();if(!a||""===a.trim())return void Y.oR.info("Content is empty. Please add some content before translating.");l.current=a,e.commands.setContent("");let n=el.kf[t]||t,i=`Translate the following ${s} post content to ${n}. Ensure the translation is natural, maintains the original meaning and tone, SEO friendly, and is suitable for a ${s} post. Only return the translated text itself, without any additional commentary or explanations before or after the translated content. Preserve markdown formatting if present.
2
3Original content:
4${a}`;try{await r(i)}catch(t){l.current&&e&&(e.commands.setContent(l.current),l.current=null)}},[e,s,r]),(0,a.jsx)(er.Bc,{children:(0,a.jsxs)(er.m_,{children:[(0,a.jsx)(er.k$,{asChild:!0,className:"flex items-center justify-center",children:(0,a.jsx)("div",{children:(0,a.jsx)(ei.A,{className:"h-4 w-4 text-muted-foreground"})})}),(0,a.jsx)(er.ZI,{children:(0,a.jsx)("p",{children:"AI translation requires AI model configuration"})})]})})}
4function ed({content:e,onChange:t,placeholder:s="Start writing...",disabled:et=!1,enableYoutube:es=!0,enableImage:el=!0,enableCodeBlock:en=!0,enableTable:ei=!0,enableBlockquote:er=!0,enableHorizontalRule:ed=!0,enableR2Selector:ec=!1,r2PublicUrl:eu,imageUploadConfig:em,enableTranslation:eh=!1,postType:ex="blog",outputFormat:ep="markdown"}){let[eg,ef]=(0,K.useState)(""),[eb,ej]=(0,K.useState)(!1),[ev,ey]=(0,K.useState)(!1),[ew,eN]=(0,K.useState)(""),[ek,eA]=(0,K.useState)(!1),[eC,eR]=(0,K.useState)(""),[ez,e$]=(0,K.useState)(!1),[eL,eU]=(0,K.useState)(!1),[eI,eT]=(0,K.useState)([]),[eE,eS]=(0,K.useState)([]),[e_,eM]=(0,K.useState)(!1),[eO,eB]=(0,K.useState)(2),[eH,eP]=(0,K.useState)([]),[eq,eF]=(0,K.useState)([]),eD=(0,A.hG)({immediatelyRender:!1,extensions:[C.A.configure({heading:!1,bold:!1,italic:!1,bulletList:!1,orderedList:!1,listItem:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),u.A.configure({levels:[2,3,4]}),o.Ay,x.Ay,N.A,p.Ay.configure({openOnClick:!1,HTMLAttributes:{class:"text-primary underline cursor-pointer"}}),...el?[h.Ay.configure({HTMLAttributes:{class:"rounded-lg max-w-full h-auto"}})]:[],d.A,f.A,g.A,...er?[r.Ay]:[],...en?[c.A.configure({lowlight:(0,R.$)(z.l),defaultLanguage:"plaintext",HTMLAttributes:{class:"bg-muted border border-border rounded-none p-4 my-4 overflow-x-auto"}})]:[],...ed?[m.A]:[],...ei?[j.XI.configure({resizable:!0,HTMLAttributes:{class:"border-collapse table-auto w-full"}}),w.H,y.A.configure({HTMLAttributes:{class:"border border-border bg-muted font-bold p-2"}}),v.n.configure({HTMLAttributes:{class:"border border-border p-2"}})]:[],b.A.configure({placeholder:s}),Z.o.configure({html:!0,transformPastedText:!0,transformCopiedText:!0}),...es?[k.A.configure({controls:!0,nocookie:!0,HTMLAttributes:{class:"rounded-lg my-4"}})]:[],X.K],content:e,editable:!et,onUpdate:({editor:e})=>{let s;switch(ep){case"text":s=e.getText();break;case"html":s=e.getHTML();break;default:s=e.storage.markdown.getMarkdown()}t(s)}});(0,K.useEffect)(()=>{eD&&e!==eD.storage.markdown.getMarkdown()&&eD.commands.setContent(e)},[e,eD]),(0,K.useEffect)(()=>{eD&&eD.setEditable(!et)},[et,eD]);let eG=(0,K.useCallback)(async e=>{if(!e.type.startsWith("image/"))return void Y.oR.error("Upload failed",{description:"Please select an image file."});let t=em?.maxSize??0xa00000;if(e.size>t)return void Y.oR.error("Upload failed",{description:`File size limit: ${t/1024/1024}MB`});eA(!0);try{let t=em?.filenamePrefix,s=em?.path??n.os,a=await (0,l.i)({fileName:e.name,contentType:e.type,prefix:t,path:s});if(!a.success||!a.data)return void Y.oR.error("Upload failed",{description:a.error||"Failed to generate presigned URL"});let{presignedUrl:i,publicObjectUrl:r}=a.data,o=await fetch(i,{method:"PUT",body:e,headers:{"Content-Type":e.type}});if(!o.ok){let e="";try{e=await o.text()}catch{}throw console.error("R2 Upload Error:",e,o),Error(e)}eD?.chain().focus().setImage({src:r}).run(),ey(!1),eN(""),Y.oR.success("Image uploaded successfully")}catch(e){console.error("Image Upload failed:",e),Y.oR.error((0,i.u)(e)||"An unexpected error occurred.")}finally{eA(!1)}},[eD,em]),eW=(0,K.useCallback)(()=>{eg?(eD?.chain().focus().extendMarkRange("link").setLink({href:eg}).run(),ef(""),ej(!1)):eD?.chain().focus().unsetLink().run()},[eD,eg]),eK=(0,K.useCallback)(()=>{ew&&(eD?.chain().focus().setImage({src:ew}).run(),eN(""),ey(!1))},[eD,ew]),eY=(0,K.useCallback)(()=>{eC&&(eD?.commands.setYoutubeVideo({src:eC,width:640,height:360}),eR(""),e$(!1))},[eD,eC]),eZ=(0,K.useCallback)((e,t=!1)=>{if(t){let t=[...eI,...e],s=e.map(e=>URL.createObjectURL(e)),a=[...eH,...Array(e.length).fill("")],l=[...eq,...Array(e.length).fill("")];eT(t),eS([...eE,...s]),eP(a),eF(l)}else{eE.forEach(e=>URL.revokeObjectURL(e));let t=e.map(e=>URL.createObjectURL(e));eT(e),eS(t),eP(Array(e.length).fill("")),eF(Array(e.length).fill(""))}},[eI,eE,eH,eq]),eV=(0,K.useCallback)(e=>{let t=eI.filter((t,s)=>s!==e),s=eE.filter((t,s)=>s!==e),a=eH.filter((t,s)=>s!==e),l=eq.filter((t,s)=>s!==e);URL.revokeObjectURL(eE[e]),eT(t),eS(s),eP(a),eF(l)},[eI,eE,eH,eq]),eQ=(0,K.useCallback)((e,t)=>{let s=[...eH];s[e]=t,eP(s)},[eH]),eJ=(0,K.useCallback)((e,t)=>{let s=[...eq];s[e]=t,eF(s)},[eq]),eX=(0,K.useCallback)(async()=>
4{if(0===eI.length)return void Y.oR.error("Please select at least one image");if(eI.length>12)return void Y.oR.error("Maximum 12 images allowed in a grid");eM(!0);try{let e=[],t=em?.filenamePrefix||"grid-image",s=em?.path??n.os,a=em?.maxSize??0xa00000;for(let n of eI){if(!n.type.startsWith("image/")){Y.oR.error(`${n.name} is not an image file`);continue}if(n.size>a){Y.oR.error(`${n.name} exceeds size limit: ${a/1024/1024}MB`);continue}let i=await (0,l.i)({fileName:n.name,contentType:n.type,prefix:t,path:s});if(!i.success||!i.data){Y.oR.error(`Failed to upload ${n.name}: ${i.error||"Unknown error"}`);continue}let{presignedUrl:r,publicObjectUrl:o}=i.data,d=await fetch(r,{method:"PUT",body:n,headers:{"Content-Type":n.type}});if(!d.ok){let e="";try{e=await d.text()}catch{}console.error("R2 Upload Error:",e,d),Y.oR.error(`Failed to upload ${n.name}`);continue}e.push({src:o,alt:n.name,caption:eH[eI.indexOf(n)]||"",link:eq[eI.indexOf(n)]||""})}e.length>0?(eD?.commands.setImageGrid({images:e,columns:eO}),Y.oR.success(`Successfully uploaded ${e.length} image${e.length>1?"s":""}`),eE.forEach(e=>URL.revokeObjectURL(e)),eT([]),eS([]),eP([]),eF([]),eU(!1)):Y.oR.error("No images were uploaded successfully")}catch(e){console.error("Image Grid Upload failed:",e),Y.oR.error((0,i.u)(e)||"An unexpected error occurred.")}finally{eM(!1)}},[eD,eI,eO,em,eE,eH,eq]);return eD?(0,a.jsxs)("div",{className:"border rounded-md",children:[(0,a.jsxs)("div",{className:"border-b bg-muted/30 p-2 flex items-center flex-wrap gap-1",children:[(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("bold")?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleBold().run(),disabled:et,title:"Bold",children:(0,a.jsx)($.A,{className:"h-4 w-4"})}),(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("italic")?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleItalic().run(),disabled:et,title:"Italic",children:(0,a.jsx)(L.A,{className:"h-4 w-4"})}),(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("underline")?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleUnderline().run(),disabled:et,title:"Underline",children:(0,a.jsx)(U.A,{className:"h-4 w-4"})}),(0,a.jsx)("div",{className:"w-px h-6 bg-border mx-1"}),(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("heading",{level:2})?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleHeading({level:2}).run(),disabled:et,title:"Heading 2",children:(0,a.jsx)(I.A,{className:"h-4 w-4"})}),(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("heading",{level:3})?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleHeading({level:3}).run(),disabled:et,title:"Heading 3",children:(0,a.jsx)(T.A,{className:"h-4 w-4"})}),(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("heading",{level:4})?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleHeading({level:4}).run(),disabled:et,title:"Heading 4",children:(0,a.jsx)(E.A,{className:"h-4 w-4"})}),(0,a.jsx)("div",{className:"w-px h-6 bg-border mx-1"}),(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("bulletList")?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleBulletList().run(),disabled:et,title:"Bullet List",children:(0,a.jsx)(S.A,{className:"h-4 w-4"})}),(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("orderedList")?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleOrderedList().run(),disabled:et,title:"Ordered List",children:(0,a.jsx)(_.A,{className:"h-4 w-4"})}),er&&(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("blockquote")?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleBlockquote().run(),disabled:et,title:"Quote",children:(0,a.jsx)(M.A,{className:"h-4 w-4"})}),en&&(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("codeBlock")?"secondary":"ghost",size:"sm",onClick:()=>eD.chain().focus().toggleCodeBlock().run(),disabled:et,title:"Code Block",children:(0,a.jsx)(O.A,{className:"h-4 w-4"})}),ed&&(0,a.jsx)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>eD.chain().focus().setHorizontalRule().run(),disabled:et,title:"Horizontal Rule",children:(0,a.jsx)(B.A,{className:"h-4 w-4"})}),(0,a.jsxs)(J.AM,{open:eb,onOpenChange:ej,children:[(0,a.jsx)(J.Wv,{asChild:!0,children:(0,a.jsx)(V.$,{type:"button",variant:eD.isActive("link")?"secondary":"ghost",size:"sm",disabled:et,title:"Link",children:(0,a.jsx)(H.A,{className:"h-4 w-4"})})}),(0,a.jsx)(J.hl,{className:"w-80",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"font-medium text-sm",children:"Insert Link"}),(0,a.jsx)(Q.p,{placeholder:"https://example.com",value:eg,onChange:e=>ef(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eW())}}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(V.$,{type:"button",size:"sm",onClick:eW,className:"flex-1",children:"Insert"}),eD.isActive("link")&&(0,a.jsx)(V.$,{type:"button",size:"sm",variant:"outline",onClick:()=>{eD.chain().focus().unsetLink().run(),ej(!1)},children:"Remove"})]})]})})]}),ei&&(0,a.jsx)(V.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>eD.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),disabled:et,title:"Insert Table",children:(0,a.jsx)(P.A,{className:"h-4 w-4"})}),(el||es)&&(0,a.jsx)("div",{className:"w-px h-6 bg-border mx-1"}),el&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(J.AM,{open:ev,onOpenChange:e
4y,children:[(0,a.jsx)(J.Wv,{asChild:!0,children:(0,a.jsx)(V.$,{type:"button",variant:"ghost",size:"sm",disabled:et,title:"Image",children:(0,a.jsx)(q.A,{className:"h-4 w-4"})})}),(0,a.jsx)(J.hl,{className:"w-80",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"font-medium text-sm",children:"Insert Image"}),(0,a.jsx)(Q.p,{placeholder:"Image URL",value:ew,onChange:e=>eN(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eK())}}),(0,a.jsx)(V.$,{type:"button",size:"sm",onClick:eK,className:"w-full",disabled:!ew,children:"Insert from URL"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,a.jsx)("span",{className:"w-full border-t"})}),(0,a.jsx)("div",{className:"relative flex justify-center text-xs uppercase",children:(0,a.jsx)("span",{className:"bg-background px-2 text-muted-foreground",children:"Or"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{type:"file",accept:"image/*",onChange:e=>{let t=e.target.files?.[0];t&&eG(t)},className:"hidden",id:"image-upload",disabled:et||ek}),(0,a.jsx)("label",{htmlFor:"image-upload",children:(0,a.jsx)(V.$,{type:"button",size:"sm",variant:"outline",className:"w-full",disabled:et||ek,onClick:()=>document.getElementById("image-upload")?.click(),children:ek?"Uploading...":"Upload Image"})})]})]})})]}),ec&&eu&&(0,a.jsx)(ee.q,{onSelect:e=>{if(Array.isArray(e)&&e.length>1){let t=e.map(e=>({src:e,alt:e.split("/").pop()||""}));eD?.commands.setImageGrid({images:t,columns:2})}else eD?.chain().focus().setImage({src:e[0]}).run()},r2PublicUrl:eu,fileTypeFilter:"image",multiple:!0,children:(0,a.jsx)(V.$,{type:"button",variant:"ghost",size:"sm",disabled:et,title:"Select from R2",children:(0,a.jsx)(F.A,{className:"h-4 w-4"})})})]}),el&&(0,a.jsxs)(J.AM,{open:eL,onOpenChange:e=>{eU(e),e||(eE.forEach(e=>URL.revokeObjectURL(e)),eT([]),eS([]),eP([]),eF([]))},children:[(0,a.jsx)(J.Wv,{asChild:!0,children:(0,a.jsx)(V.$,{type:"button",variant:"ghost",size:"sm",disabled:et,title:"Image Grid",children:(0,a.jsx)(D.A,{className:"h-4 w-4"})})}),(0,a.jsx)(J.hl,{className:"w-[500px] h-[450px] overflow-y-auto",children:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("h4",{className:"font-medium text-sm",children:"Insert Image Grid"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm text-muted-foreground",children:"Columns"}),(0,a.jsx)("div",{className:"flex gap-2",children:[2,3,4].map(e=>(0,a.jsx)(V.$,{type:"button",size:"sm",variant:eO===e?"default":"outline",onClick:()=>eB(e),className:"flex-1",children:e},e))})]}),eE.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"text-sm text-muted-foreground",children:["Preview (",eE.length," images)"]}),(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto p-2 border rounded-md bg-muted/30 space-y-3",children:eE.map((e,t)=>(0,a.jsxs)("div",{className:"flex gap-3 p-2 border rounded-md bg-background",children:[(0,a.jsxs)("div",{className:"relative group h-[100px] w-[100px] shrink-0 overflow-hidden rounded border bg-muted",children:[(0,a.jsx)("img",{src:e,alt:`Preview ${t+1}`,className:"w-full h-full object-contain"}),(0,a.jsx)("button",{type:"button",onClick:()=>eV(t),className:"absolute top-1 right-1 bg-destructive text-destructive-foreground rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity shadow-md",disabled:e_,children:(0,a.jsx)(G.A,{className:"h-3 w-3"})})]}),(0,a.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",children:"Caption (optional)"}),(0,a.jsx)(Q.p,{placeholder:"Enter caption",value:eH[t]||"",onChange:e=>eQ(t,e.target.value),disabled:e_,className:"h-8 text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-xs text-muted-foreground",children:"Link (optional)"}),(0,a.jsx)(Q.p,{placeholder:"https://example.com",value:eq[t]||"",onChange:e=>eJ(t,e.target.value),disabled:e_,className:"h-8 text-sm"})]})]})]},e))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"file",accept:"image/*",multiple:!0,onChange:e=>{eZ(Array.from(e.target.files||[]),!1),e.target.value=""},className:"hidden",id:"image-grid-upload",disabled:et||e_}),(0,a.jsx)("input",{type:"file",accept:"image/*",multiple:!0,onChange:e=>{let t=Array.from(e.target.files||[]);eI.length+t.length>12?Y.oR.error("Maximum 12 images allowed in total"):(eZ(t,!0),e.target.value="")},className:"hidden",id:"image-grid-add",disabled:et||e_}),0===eI.length?(0,a.jsx)("label",{htmlFor:"image-grid-upload",className:"flex-1",children:(0,a.jsx)(V.$,{type:"button",size:"sm",variant:"outline",className:"w-full",disabled:et||e_,onClick:()=>document.getElementById("image-grid-upload")?.click(),children:"Select Images"})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"image-grid-add",className:"flex-1",children:(0,a.jsx)(V.$,{type:"button",size:"sm",variant:"outline",className:"w-full",disabled:et||e_||eI.length>=12,onClick:()=>document.getElementById("image-grid-add")?.click(),children:"Add More"})}),(0,a.jsx)("label",{htmlFor:"image-grid-upload",className:"flex-1",children:(0,a.jsx)(V.$,{type:"button",size:"sm",variant:"outline",className:"w-full",disabled:et||e_,onClick:()=>document.getElementById("image-grid-upload")?.click(),children:"Replace All"})})]})]}),(0,a.jsx)(V.$,{type:"button",size:"sm",onClick:eX,className:"w-full",disabled:!eI.length||e_||et,children:e_?"Uploading...":"Upload Image Grid"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Select 2-12 images for a responsive grid layout"})]})})]}),es&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(J.AM,{open:ez,onOpenChange:e$,children:[(0,a.jsx)(J.Wv,{asChild:!0,children:(0,a.jsx)(V.$,{type:"button",variant:"ghost",size:"sm",disabled:et,title:"YouTube Video",children:(0,a.jsx)(W.A,{className:"h-4 w-4"})})}),(0,a.jsx)(J.hl,{className:"w-80",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"font-medium text-sm",children:"Insert YouTube Video"}),(0,a.jsx)(Q.p,{placeholder:"YouTube URL",value:eC,onChange:e=>eR(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eY())}}),(0,a.jsx)(V.$,{type:"button",size:"sm",onClick:eY,className:"w-full",disabled:!eC,children:"Insert Video"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Paste a YouTube URL (e.g., https://www.youtube.com/watch?v=...)"})]})})]})}),eh&&eD&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"w-px h-6 bg-border mx-1"}),(0,a.jsx)(eo,{editor:eD,disabled:et,postType:ex})]})]}),(0,a.jsxs)("div",{className:"relative px-4 py-0 min-h-[400px] max-h-[600px] overflow-y-auto cursor-text",onClick:()=>eD?.chain().focus().run(),children:[(0,a.jsx)(A.$Z,{editor:eD,className:"prose dark:prose-invert max-w-none focus:outline-none  [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[350px] prose-p:leading-normal prose-p:my-2 prose-headings:font-semibold prose-headings:tracking-tight prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl prose-li:my-0.5 prose-blockquote:not-italic prose-blockquote:font-normal prose-blockquote:text-muted-foreground prose-blockquote:border-l-4 prose-blockquote:border-primary/50 [&_blockquote_p]:before:content-none [&_blockquote_p]:after:content-none [&_td_p]:my-0 [&_th_p]:my-0 "}),ei&&(0,a.jsx)(ea,{editor:eD})]})]}):null}},89507:(e,t,s)=>{s.d(t,{Bc:()=>i,ZI:()=>d,k$:()=>o,m_:()=>r});var a=s(2100);s(49016);var l=s(5698),n=s(37001);function i({delayDuration:e=0,...t}){return(0,a.jsx)(l.Kq,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function r({...e}){return(0,a.jsx)(i,{children:(0,a.jsx)(l.bL,{"data-slot":"tooltip",...e})})}function o({...e}){return(0,a.jsx)(l.l9,{"data-slot":"tooltip-trigger",...e})}function d({className:e,sideOffset:t=0,children:s,...i}){return(0,a.jsx)(l.ZL,{children:(0,a.jsxs)(l.UC,{"data-slot":"tooltip-content",sideOffset:t,className:(0,n.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
4de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...i,children:[s,(0,a.jsx)(l.i3,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-sm"})]})})}}}]);

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.