1import{c as Re,r as p,j as e,R as te}from"./index-C2E42PDV.js";import{C as Ge}from"./copy-7spqKeKh.js";import{D as ar,R as lr}from"./RandomGroupTagDialog-R5b6_W_S.js";import{T as nr}from"./trash-2-TW6-1cfI.js";import{a as er,C as rr}from"./chevron-up-JKmKexDt.js";import{L as ir,a as or}from"./lock-open-DTzCREvX.js";const cr=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],dr=Re("box",cr);const xr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],gr=Re("image",xr);const pr=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],br=Re("map",pr);const mr=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hr=Re("search",mr);const ur=[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]],yr=Re("sliders-horizontal",ur);const fr=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],vr=Re("star",fr);const jr=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],wr=Re("user",jr);function Xe({t:r,insertTargetText:y,activeInsertMode:b,previewMode:A,onPreviewModeChange:C,positiveOptions:_,negativeOptions:D,selectedPositiveTargetId:U,selectedNegativeTargetId:J,onPositiveTargetChange:B,onNegativeTargetChange:Q,previewText:fe,previewSections:oe=[],onCopyFocused:$e,onCopyAll:ce,onCopyPositiveAll:de,onCopyNegativeAll:xe,inspectedEntry:o,onInspectedJpChange:ve,onInspectedMemoChange:je,onInspectedKeyPromptChange:we,onCopyInspectedKeyPrompt:Ne,onCreateInspectedTriggerTag:G,onCopyInspectedKeyPromptGroup:T,triggerCategoryOptions:ke=[],onOpenInspectedCivitai:ge,onDeleteInspectedEntry:I,canDeleteInspectedEntry:$}){const pe=b==="positive",Ce=b==="negative",[z,be]=p.useState(56),[se,X]=p.useState(!1),[H,ae]=p.useState(680),[O,R]=p.useState(!1),[q,E]=p.useState(""),[me,Y]=p.useState(""),[Se,le]=p.useState(""),[ee,ne]=p.useState(!1),[he,re]=p.useState(!1),[ue,V]=p.useState(""),[s,l]=p.useState(""),[c,u]=p.useState(""),S=p.useRef({startY:0,startRatio:56}),j=p.useRef({startY:0,startHeight:680}),f=p.useRef(null),W=p.useRef(null),L=a=>typeof a?.clientY=="number"?a.clientY:a?.touches?.[0]&&typeof a.touches[0].clientY=="number"?a.touches[0].clientY:a?.changedTouches?.[0]&&typeof a.changedTouches[0].clientY=="number"?a.changedTouches[0].clientY:null;p.useEffect(()=>{o&&(typeof window<"u"&&typeof window.matchMedia=="function"&&!window.matchMedia("(min-width: 1280px)").matches||typeof f.current?.scrollIntoView=="function"&&f.current.scrollIntoView({behavior:"smooth",block:"nearest"}))},[o?.id]),p.useEffect(()=>{if(!o){E(""),Y(""),le(""),ne(!1),re(!1),V(""),l(""),u("");return}const a=String(o.jp||o.en||"").trim();E(a?r("liveWorkspace.triggerTagDefaultName",{name:a}):"");const n=String(o.type||"").toLowerCase();Y(n==="lora"?"LoRA":n==="embedding"?"Embedding":String(o.category||"").trim()||"Style"),le(""),ne(!1),re(!1),V(""),l(""),u("")},[o?.id,r]),p.useEffect(()=>{if(!se)return;const a=m=>{const g=L(m);if(g==null)return;const w=W.current?.getBoundingClientRect?.();if(!w?.height)return;const P=(g-S.current.startY)/w.height*100,ye=S.current.startRatio+P;be(Math.max(5,Math.min(95,ye))),typeof m?.preventDefault=="function"&&m.preventDefault()},n=()=>X(!1);return window.addEventListener("mousemove",a),window.addEventListener("mouseup",n),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",n),window.addEventListener("touchcancel",n),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",n),window.removeEventListener("touchmove",a,{passive:!1}),window.removeEventListener("touchend",n),window.removeEventListener("touchcancel",n)}},[se]),p.useEffect(()=>{if(!O)return;const a=m=>{const g=L(m);if(g==null)return;const w=j.current.startHeight+(g-j.current.startY);ae(Math.max(200,Math.min(2200,w))),typeof m?.preventDefault=="function"&&m.preventDefault()},n=()=>R(!1);return window.addEventListener("mousemove",a),window.addEventListener("mouseup",n),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",n),window.addEventListener("touchcancel",n),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",n),window.removeEventListener("touchmove",a,{passive:!1}),window.removeEventListener("touchend",n),window.removeEventListener("touchcancel",n)}},[O]);const We=a=>{const n=L(a);n!=null&&(S.current={startY:n,startRatio:z},X(!0),typeof a?.preventDefault=="function"&&a.preventDefault())},x=a=>{const n=L(a);n!=null&&(j.current={startY:n,startHeight:H},R(!0),typeof a?.preventDefault=="function"&&a.preventDefault())},Le=[{id:"focused",label:r("liveWorkspace.modeFocused")},{id:"all",label:r("liveWorkspace.modeAll")},{id:"positive_all",label:r("liveWorkspace.modePositiveAll")},{id:"negative_all",label:r("liveWorkspace.modeNegativeAll")}],Z=Array.isArray(ke)?ke.filter(Boolean):[],i=String(me||"").trim(),Ae=i&&!Z.includes(i)?[...Z,i]:Z,De=String(Se||"").trim(),_e=String(o?.type||"").toLowerCase(),Qe=_e==="lora"||_e==="embedding"?_e:"normal",Ie=()=>{if(_e==="lora")return"LoRA";if(_e==="embedding")return"Embedding";const a=String(o?.category||"").trim();return a||(Z.includes("LoRA")?"LoRA":Z.length>0?Z[0]:"Style")},qe=(a="",n)=>{const m=String(o?.jp||o?.en||"").trim(),g=String(a||"").split(",")[0].trim();if(g){const ye=m&&m.toLowerCase()!==g.toLowerCase()?`${m} - ${g}`:g;return typeof n=="number"?`${ye} ${n+1}`.trim():ye}const w=String(m||"").trim(),P=w?r("liveWorkspace.triggerTagDefaultName",{name:w}):r("liveWorkspace.triggerTagDefaultName",{name:"Trigger"});return typeof n=="number"?`${P} ${n+1}`.trim():P},Me=({triggerText:a,sourceLabel:n,index:m})=>{const g=String(a||"").trim();g&&(l(g),u(String(n||"").trim()),E(qe(g,m)),Y(Ie()),le(""),ne(!1),V(""),re(!0))},Te=()=>{re(!1),V("")},Ze=()=>{const a=String(q||"").trim();if(!a){V(r("toast.inputCheck"));return}let m=String(me||"").trim()||Ie();if(De){if(!Ae.includes(De)&&!ee){V(r("liveWorkspace.triggerTagRequireCreateCheck"));return}m=De}const g=G?.({triggerText:s,name:a,category:m});g===!1||g?.ok===!1||Te()};p.useEffect(()=>{if(!he)return;const a=n=>{n.key==="Escape"&&(n.preventDefault(),Te())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[he]);const Ue=a=>{const n=String(a||"").trim();if(!/^#?[0-9a-fA-F]{6}$/.test(n))return"#38bdf8";const m=n.startsWith("#")?n:`#${n}`,g=Number.parseInt(m.slice(1,3),16),w=Number.parseInt(m.slice(3,5),16),P=Number.parseInt(m.slice(5,7),16),ye=(.2126*g+.7152*w+.0722*P)/255,ie=(Ye,Je,Be=0)=>{const t=Math.round(Ye*Je+Be);return Math.max(0,Math.min(255,t))},[Ee,He,Oe]=ye>.72?[ie(g,.45),ie(w,.45),ie(P,.45)]:ye<.2?[ie(g,.75,64),ie(w,.75,64),ie(P,.75,64)]:[g,w,P];return`rgb(${Ee}, ${He}, ${Oe})`};return e.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 xl:p-5 space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-bold text-sky-300",children:r("liveWorkspace.title")}),e.jsxs("p",{className:"text-xs font-semibold text-sky-100 live-workspace-current",children:[r("liveWorkspace.currentTarget"),": ",y]})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-1 2xl:grid-cols-2",children:[e.jsxs("label",{className:`text-xs flex flex-col gap-1 live-target-label ${pe?"text-sky-200":"text-gray-300"}`,children:[e.jsx("span",{children:r("liveWorkspace.positiveTarget")}),e.jsx("select",{value:U,onChange:a=>B(a.target.value),className:`live-target-select bg-gray-900 border rounded px-2 py-1 text-xs ${pe?"border-sky-500 ring-1 ring-sky-500/40":"border-gray-700"}`,children:_.map(a=>e.jsx("option",{value:a.id,children:a.label},a.id))})]}),e.jsxs("label",{className:`text-xs flex flex-col gap-1 live-target-label ${Ce?"text-sky-200":"text-gray-300"}`,children:[e.jsx("span",{children:r("liveWorkspace.negativeTarget")}),e.jsx("select",{value:J,onChange:a=>Q(a.target.value),className:`live-target-select bg-gray-900 border rounded px-2 py-1 text-xs ${Ce?"border-sky-500 ring-1 ring-sky-500/40":"border-gray-700"}`,children:D.map(a=>e.jsx("option",{value:a.id,children:a.label},a.id))})]})]}),e.jsxs("div",{ref:W,className:"h-auto xl:h-[var(--live-panel-height)] min-h-0 xl:min-h-[200px] flex flex-col gap-2",style:{"--l
1ive-panel-height":`${H}px`},children:[e.jsxs("div",{className:"bg-sky-900/20 border border-sky-700 rounded-lg p-3 space-y-2 live-preview-panel min-h-[58px] flex flex-col",style:{flexBasis:`${z}%`},children:[e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2",children:e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:Le.map(a=>e.jsx("button",{onClick:()=>C(a.id),className:`text-xs px-2 py-1 rounded border ${A===a.id?"bg-sky-700 text-white border-sky-600":"bg-gray-900 text-gray-200 border-gray-700 hover:bg-gray-800"}`,children:a.label},a.id))})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-semibold text-sky-200 live-preview-title",children:r("liveWorkspace.previewTitle")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{onClick:de,className:"text-xs px-2 py-1 rounded bg-emerald-700 hover:bg-emerald-600 text-white border border-emerald-600 flex items-center gap-1 whitespace-nowrap",children:[e.jsx(Ge,{size:12}),r("liveWorkspace.copyPositiveAll")]}),e.jsxs("button",{onClick:xe,className:"text-xs px-2 py-1 rounded bg-rose-700 hover:bg-rose-600 text-white border border-rose-600 flex items-center gap-1 whitespace-nowrap",children:[e.jsx(Ge,{size:12}),r("liveWorkspace.copyNegativeAll")]}),e.jsxs("button",{onClick:$e,className:"text-xs px-2 py-1 rounded bg-sky-700 hover:bg-sky-600 text-white border border-sky-600 flex items-center gap-1 whitespace-nowrap",children:[e.jsx(Ge,{size:12}),r("liveWorkspace.copyFocused")]}),e.jsxs("button",{onClick:ce,className:"text-xs px-2 py-1 rounded bg-gray-900 hover:bg-gray-800 text-gray-100 border border-gray-700 flex items-center gap-1 whitespace-nowrap",children:[e.jsx(Ge,{size:12}),r("liveWorkspace.copyAll")]})]})]}),e.jsxs("div",{className:"w-full min-h-0 flex-1 overflow-auto bg-gray-900 border border-sky-700 rounded p-2 text-xs font-mono text-gray-100 live-preview-textarea",children:[(Array.isArray(oe)?oe:[]).map((a,n)=>{const m=String(a?.title||"").trim(),g=String(a?.text||"").trim(),w=!g,P=w?"-":g;return e.jsxs("div",{className:n>0?"mt-3":"",children:[e.jsx("div",{className:"font-bold",style:{color:Ue(a?.color)},children:`/*${m}*/`}),e.jsx("div",{className:`mt-1 whitespace-pre-wrap break-words ${w?"select-none pointer-events-none text-gray-500/80":""}`,children:P})]},a?.id||`${m}_${n}`)}),!fe&&e.jsx("div",{className:"whitespace-pre-wrap break-words select-none pointer-events-none text-gray-500/80",children:"-"})]})]}),e.jsx("div",{role:"separator","aria-label":r("liveWorkspace.resizePreview"),onMouseDown:We,onTouchStart:We,className:"hidden xl:flex h-3 rounded border border-sky-800/60 bg-sky-900/20 cursor-row-resize items-center justify-center live-resize-handle",children:e.jsx("div",{className:"h-1 w-16 rounded-full bg-sky-500/70"})}),e.jsxs("div",{ref:f,className:"bg-emerald-900/20 border border-emerald-700 rounded-lg p-3 space-y-2 live-info-panel min-h-[58px] overflow-auto",style:{flexBasis:`${100-z}%`},children:[e.jsx("div",{className:"text-xs font-semibold text-emerald-200 live-info-title",children:r("liveWorkspace.infoTitle")}),e.jsx("div",{className:"text-[11px] text-emerald-200/80 live-info-text",children:r("liveWorkspace.infoHintLastClicked")}),o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-[11px] text-gray-300 live-info-text",children:[r("liveWorkspace.infoType"),": ",o.type||"-"," | ",r("liveWorkspace.infoCategory"),": ",o.category||"-"]}),e.jsxs("div",{className:"text-[11px] text-gray-300 live-info-text",children:[r("liveWorkspace.infoBaseModel"),": ",o.baseModel||"-"]}),e.jsxs("div",{className:"text-[11px] text-gray-300 live-info-text",children:[r("liveWorkspace.infoUsageTips"),": ",o.usageTips||"-"]}),e.jsxs("div",{className:"text-[11px] text-gray-300 break-all live-info-text",children:[r("liveWorkspace.infoSource"),": ",o.sourcePath||"-"]}),o.civitaiUrl&&e.jsx("button",{onClick:ge,className:"text-xs px-2 py-1 rounded bg-indigo-700 hover:bg-indigo-600 text-white border border-indigo-600",children:r("liveWorkspace.openCivitai")}),e.jsxs("label",{className:"text-xs flex flex-col gap-1",children:[e.jsx("span",{className:"text-emerald-200 live-info-title",children:r("liveWorkspace.infoDisplayName")}),e.jsx("input",{type:"text",value:o.jp||"",onChange:a=>ve(a.target.value),className:"w-full bg-gray-900 border border-emerald-700 rounded px-2 py-1 text-xs live-info-textarea"})]}),e.jsxs("label",{className:"text-xs flex flex-col gap-1",children:[e.jsx("span",{className:"text-emerald-200 live-info-title",children:r("liveWorkspace.infoUserMemo")}),e.jsx("textarea",{rows:1,value:o.memo||"",onChange:a=>je(a.target.value),className:"w-full min-h-[2.1rem] max-h-56 resize-y bg-gray-900 border border-emerald-700 rounded p-2 text-xs live-info-textarea"})]}),e.jsxs("label",{className:"text-xs flex flex-col gap-1",children:[e.jsx("span",{className:"text-emerald-200 live-info-title",children:r("liveWorkspace.infoCreatorMemo")}),e.jsx("textarea",{value:o.creatorMemo||"",readOnly:!0,className:"w-full h-24 bg-gray-900 border border-emerald-700 rounded p-2 text-xs live-info-textarea"})]}),e.jsxs("label",{className:"text-xs flex flex-col gap-1",children:[e.jsx("span",{className:"text-emerald-200 live-info-title",children:r("liveWorkspace.infoKeyPrompt")}),e.jsx("textarea",{value:o.keyPrompt||"",onChange:a=>we(a.target.value),className:"w-full h-24 bg-gray-900 border border-emerald-700 rounded p-2 text-xs font-mono live-info-textarea"})]}),e.jsx("div",{className:"text-[11px] text-emerald-200/80 live-info-text",children:r("liveWorkspace.triggerTagHint")}),e.jsxs("div",{className:"text-[11px] text-emerald-200/80 live-info-text",children:[r("liveWorkspace.triggerTagDialogType"),": ",r(`tagType.${Qe}`)]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("button",{onClick:()=>Me({triggerText:o?.keyPrompt||"",sourceLabel:r("liveWorkspace.triggerTagFromKeyPrompt")}),disabled:!o?.keyPrompt,className:"text-xs px-2 py-1 rounded bg-emerald-700 hover:bg-emerald-600 text-white border border-emerald-600",children:r("liveWorkspace.triggerTagOpenBuilder")})}),Array.isArray(o.keyPromptGroups)&&o.keyPromptGroups.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-emerald-200 text-xs font-semibold live-info-title",children:r("liveWorkspace.infoKeyPromptGroups")}),e.jsx("div",{className:"space-y-1",children:o.keyPromptGroups.map((a,n)=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("button",{onClick:()=>T(a,n),className:"flex-1 text-left text-[11px] px-2 py-1 rounded bg-gray-900 border border-emerald-700 hover:bg-gray-800 live-info-text",title:a,children:[n+1,". ",a]}),e.jsx("button",{onClick:()=>Me({triggerText:a,sourceLabel:`${r("liveWorkspace.triggerTagFromGroup")} #${n+1}`,index:n}),className:"shrink-0 text-[11px] px-2 py-1 rounded bg-sky-700 hover:bg-sky-600 text-white border border-sky-600",children:r("liveWorkspace.triggerTagFromGroup")})]},`${o.id}_group_${n}`))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:Ne,disabled:!o?.keyPrompt,className:"text-xs px-2 py-1 rounded bg-emerald-700 hover:bg-emerald-600 text-white border border-emerald-600 flex items-center gap-1",children:[e.jsx(Ge,{size:12}),r("liveWorkspace.copyKeyPrompt")]}),e.jsx("button",{onClick:I,disabled:!$,className:"text-xs px-2 py-1 rounded bg-red-700 hover:bg-red-600 text-white border border-red-600",children:r("liveWorkspace.deleteTag")})]})]}):e.jsx("div",{className:"text-xs text-gray-300 live-info-text",children:r("liveWorkspace.infoEmpty")})]}),e.jsx("div",{role:"separator","aria-label":r("liveWorkspace.resizePreview"),onMouseDown:x,onTouchStart:x,className:"hidden xl:flex h-3 rounded border border-emerald-800/60 bg-emerald-900/20 cursor-row-resize items-center justify-center live-resize-handle",children:e.jsx("div",{className:"h-1 w-24 rounded-full bg-emerald-400/70"})})]}),he&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 p-4 flex items-center justify-center",onClick:Te,children:e.jsxs("div",{className:"live-trigger-dialog w-full max-w-lg rounded-xl border border-emerald-700 bg-gray-900 text-gray-100 p-4 space-y-3 shadow-2xl",onClick:a=>a.stopPropagation(),children:[e.jsx("div",{className:"live-trigger-title text-sm font-bold text-emerald-200",children:r("liveWorkspace.triggerTagDialogTitle")}),e.jsxs("div",{className:"live-trigger-source text-[11px] text-gray-300",children:[r("liveWorkspace.triggerTagDialogSource"),": ",c||"-"]}),e.jsx("textarea",{value:s,readOnly:!0,className:"live-trigger-input live-trigger-source-text w-full h-20 bg-gray-950 border border-emerald-800 rounded p-2 text-xs font-mono text-gray-100"}),e.jsxs("label",{className:"text-xs flex flex-col gap-1",children:[e.jsx("span",{className:"live-trigger-label text-emerald-200",children:r("liveWorkspace.triggerTagName")}
1),e.jsx("input",{type:"text",value:q,onChange:a=>E(a.target.value),className:"live-trigger-input w-full bg-gray-950 border border-emerald-700 rounded px-2 py-1.5 text-xs"})]}),e.jsxs("label",{className:"text-xs flex flex-col gap-1",children:[e.jsx("span",{className:"live-trigger-label text-emerald-200",children:r("liveWorkspace.triggerTagCategory")}),e.jsxs("select",{value:i,onChange:a=>Y(a.target.value),className:"live-trigger-input w-full bg-gray-950 border border-emerald-700 rounded px-2 py-1.5 text-xs",children:[Ae.length===0&&e.jsx("option",{value:"Style",children:"Style"}),Ae.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("label",{className:"text-xs flex flex-col gap-1",children:[e.jsx("span",{className:"live-trigger-label text-emerald-200",children:r("liveWorkspace.triggerTagCustomCategory")}),e.jsx("input",{type:"text",value:Se,onChange:a=>{le(a.target.value),V("")},placeholder:r("csv.newCategoryPlaceholder"),className:"live-trigger-input w-full bg-gray-950 border border-emerald-700 rounded px-2 py-1.5 text-xs"})]}),e.jsxs("label",{className:"live-trigger-check text-xs text-gray-200 flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",checked:ee,onChange:a=>ne(a.target.checked),className:"accent-emerald-500"}),r("liveWorkspace.triggerTagAllowCreateCategory")]}),ue&&e.jsx("div",{className:"live-trigger-error text-xs text-rose-300",children:ue}),e.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[e.jsx("button",{onClick:Te,className:"px-3 py-1.5 rounded border border-gray-600 bg-gray-800 text-xs text-gray-100 hover:bg-gray-700",children:r("actions.close")}),e.jsx("button",{onClick:Ze,className:"px-3 py-1.5 rounded border border-emerald-600 bg-emerald-700 text-xs text-white hover:bg-emerald-600",children:r("actions.save")})]})]})})]})}function Ke(r,y){if(!r||typeof r!="string")return`rgba(59, 130, 246, ${y})`;const b=r.replace("#","");if(b.length!==6)return`rgba(59, 130, 246, ${y})`;const A=Number.parseInt(b.slice(0,2),16),C=Number.parseInt(b.slice(2,4),16),_=Number.parseInt(b.slice(4,6),16);return[A,C,_].some(D=>Number.isNaN(D))?`rgba(59, 130, 246, ${y})`:`rgba(${A}, ${C}, ${_}, ${y})`}function Nr(r,y){if(!Array.isArray(r)||r.length===0)return;const b=[...new Set(r.map(C=>C.color).filter(Boolean))];if(b.length===0)return;const A=b.length===1?{borderColor:b[0],backgroundColor:Ke(b[0],.24)}:{borderColor:b[0],backgroundImage:`linear-gradient(135deg, ${b.map((C,_)=>{const D=100/b.length,U=(D*_).toFixed(2),J=(D*(_+1)).toFixed(2);return`${Ke(C,.3)} ${U}% ${J}%`}).join(", ")})`,backgroundColor:"#1f2937"};return y?{...A,boxShadow:`0 0 0 2px ${Ke(b[0],.8)} inset`}:A}function kr({t:r,mainCategories:y,worldCategories:b,contextCategories:A,typeOptions:C,categoryLabels:_,selectedMainCategories:D,selectedWorldCategories:U,selectedContextCategories:J,selectedTypes:B,selectedMainCategoryValue:Q="",selectedWorldCategoryValue:fe="",selectedContextCategoryValue:oe="",selectedTypeValue:$e="",onToggleMainCategory:ce,onToggleWorldCategory:de,onToggleContextCategory:xe,onClearMainCategories:o,onClearWorldCategories:ve,onClearContextCategories:je,onToggleType:we,onClearTypes:Ne,onChangeMainCategoryValue:G,onChangeWorldCategoryValue:T,onChangeContextCategoryValue:ke,onChangeTypeValue:ge,language:I,words:$,selectedPositiveIds:pe,selectedNegativeIds:Ce,randomBuildMode:z,randomDraftIds:be,blockMatchesByWordId:se,activeInsertTarget:X,activeInsertSummary:H="",onToggle:ae,onToggleNg:O,ngMode:R=!1,onToggleNgMode:q,onToggleRandomBuildMode:E,onCreateRandomizedTag:me,sfwOnly:Y=!0,safetyViewMode:Se="both",onSafetyViewModeChange:le,dictionarySortMode:ee="default",onDictionarySortModeChange:ne,ngBlockedIds:he,favoriteIds:re,onToggleFavorite:ue,onInspect:V,onDelete:s,mobileColumns:l=2,onMobileColumnsChange:c}){const u=p.useRef(null),[S,j]=p.useState(0),[f,W]=p.useState(0),[L,We]=p.useState(typeof window<"u"?window.innerWidth:1280);p.useEffect(()=>{if(typeof window>"u")return;const t=()=>We(window.innerWidth);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),p.useEffect(()=>{const t=u.current;if(!t)return;const d=()=>{W(t.clientHeight||0)};d();const h=()=>{j(t.scrollTop||0)};t.addEventListener("scroll",h,{passive:!0});let k;return typeof ResizeObserver<"u"?(k=new ResizeObserver(d),k.observe(t)):typeof window<"u"&&window.addEventListener("resize",d),()=>{t.removeEventListener("scroll",h),k?k.disconnect():typeof window<"u"&&window.removeEventListener("resize",d)}},[]);const x=t=>String(t||"").trim(),Le=(t,d)=>{const h=t?.labels;if(h&&typeof h=="object"){const k=x(h[d]);if(k)return k;if(d==="ja"){const N=x(h.jp);if(N)return N}if(d==="en"){const N=x(h.tag);if(N)return N}
1const F=x(h.en)||x(h.ja)||x(h["zh-CN"])||x(h["zh-TW"]);if(F)return F}return""},Z=t=>{const d=String(t?.type||"").toLowerCase();return d==="lora"||d==="embedding"},i=t=>{const d=x(t?.jp),h=x(t?.en);return!!d&&!!h&&d.toLowerCase()!==h.toLowerCase()},Ae=t=>{const d=x(t?.sourcePath);if(d){const F=d.replace(/\\/g,"/").split("/").map(N=>x(N)).filter(Boolean);if(F.length>1){const N=F.slice(0,-1),K=new Set(["lora","embedding","models","model"]),Pe=N.length>1&&K.has(N[0].toLowerCase())?N.slice(1):N;if(Pe.length>0)return Pe.join(" > ")}}const k=(Array.isArray(t?.categories)?t.categories:[]).map(F=>x(F)).filter(F=>F&&!["lora","embedding"].includes(F.toLowerCase()));return k.length>0?k.join(" > "):x(t?.sourceFolder)||(String(t?.type||"").toLowerCase()==="embedding"?"Embedding":"LoRA")},De=t=>{if(Z(t))return i(t)?x(t.jp):x(t.en)||x(t.jp);const d=Le(t,I);return d||(I==="ja"?x(t.jp)||x(t.en):x(t.displayEn)||x(t.en))},_e=t=>{if(Z(t)){const d=Ae(t);return d||(i(t)?x(t.en):x(t?.sourceFolder)||(String(t?.type||"").toLowerCase()==="embedding"?"Embedding":"LoRA"))}return I==="ja"?x(t.en)||Le(t,"en"):Le(t,"ja")||x(t.jp)||x(t.en)},Qe=new Set(D),Ie=new Set(U),qe=new Set(J),Me=new Set(B),Te=[2,3,4].includes(Number(l))?Number(l):2,Ze=ee==="name_asc"?"name_desc":"name_asc",Ue=r(ee==="name_desc"?"tagGrid.nameSortDesc":"tagGrid.nameSortAsc"),a=ee==="name_asc"||ee==="name_desc",n=p.useMemo(()=>L>=1536?7:L>=1280?6:L>=768?5:L>=640?4:Te,[L,Te]),m=Math.max(1,n);p.useEffect(()=>{const t=u.current;if(!t)return;const d=Math.max(0,t.scrollHeight-t.clientHeight);(t.scrollTop||0)>d&&(t.scrollTop=0,j(0))},[$,m,f]);const g=160,w=2,P=Math.ceil($.length/m),ye=f>0?f:640,ie=P===0?0:Math.max(0,Math.floor(S/g)-w),Ee=P===0?-1:Math.max(ie,Math.min(P-1,Math.ceil((S+ye)/g)+w)),He=ie*g,Oe=Math.max(0,(P-Ee-1)*g),Ye=[];for(let t=ie;t<=Ee;t+=1)Ye.push(t);const Je=t=>{const d=pe.has(t.id),h=Ce.has(t.id),k=z&&be.includes(t.id),F=he?.has?.(t.id),N=re?.has?.(t.id)||!!t.favorite,K=se?.get?.(t.id)||[],Pe=K.length>0,Ve=X?.kind==="block"&&K.some(M=>M.mode===X.mode&&M.blockId===X.blockId),ze=!k&&!d&&!h&&Pe?Nr(K,Ve):void 0,v=!ze&&Ve?{boxShadow:`0 0 0 2px ${Ke(K[0]?.color||"#60a5fa",.75)} inset`}:void 0,tr=t.category==="ãã£ã©ã¯ã¿ã¼"?wr:t.category==="風æ¯ã»èæ¯"?br:t.type==="random"?ar:t.type==="lora"?dr:gr,sr=t.id.startsWith("custom")||t.id.startsWith("lora_")||t.id.startsWith("embedding_")||t.id.startsWith("wild_")||t.id.startsWith("imp_");return e.jsxs("button",{onClick:()=>{if(V?.(t.id),R){O?.(t.id);return}ae(t.id)},className:`relative h-full p-3 rounded-lg border-2 text-left transition-all ${k?"bg-amber-900/40 border-amber-500":R&&F?"bg-rose-900/50 border-rose-500":d?"bg-green-900/50 border-green-500":h?"bg-red-900/50 border-red-500":"bg-gray-700 border-transparent hover:border-gray-500"}`,style:ze||v,children:[e.jsxs("div",{className:"flex justify-between items-center text-xs font-bold mb-1",children:[e.jsx("span",{children:De(t)}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{role:"button",tabIndex:-1,title:r(N?"tagGrid.favoriteOn":"tagGrid.favoriteOff"),onMouseDown:M=>M.preventDefault(),onClick:M=>{M.preventDefault(),M.stopPropagation(),ue?.(t.id)},className:`p-0.5 rounded border transition-colors ${N?"bg-amber-500/20 border-amber-400 text-amber-300":"bg-gray-900/40 border-gray-600 text-gray-400 hover:text-amber-300 hover:border-amber-400"}`,children:e.jsx(vr,{size:11,fill:N?"currentColor":"none"})}),e.jsx(tr,{size:12})]})]}),e.jsx("div",{className:"text-[10px] text-gray-400 truncate tag-secondary-label",children:_e(t)}),R&&F&&e.jsx("div",{className:"mt-2 text-[10px] font-semibold text-rose-200",children:r("tagGrid.ngBlocked")}),K.length>0&&e.jsxs("div",{className:"mt-2 flex items-center gap-1 flex-wrap",children:[K.slice(0,6).map(M=>e.jsx("span",{title:r("tagGrid.mappingTitle",{mode:M.mode==="positive"?r("mode.positive"):r("mode.negative"),name:M.name}),className:"w-2.5 h-2.5 rounded-sm border border-black/30",style:{backgroundColor:M.color||"#60a5fa"}},`${t.id}_${M.mode}_${M.blockId}`)),K.length>6&&e.jsxs("span",{className:"text-[9px] px-1 py-px rounded bg-gray-900/70 border border-gray-600 text-gray-200",children:["+",K.length-6]})]}),sr&&e.jsx("div",{onClick:M=>{M.stopPropagation(),s?.(t.id)},className:"absolute -top-2 -right-2 bg-red-600 text-white p-1 rounded-full hover:scale-110 border border-red-300/40",children:e.jsx(nr,{size:10})})]},t.id)},Be=({axisKey:t,title:d,options:h,selected:k,selectedSet:F,onClear:N,onToggle:K,singleValue:Pe,onChangeSingleValue:Ve,activeClass:ze})=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sm:hidden flex items-center gap-2 overflow-x-auto px-4 pb-2",children:[e.jsx("span",{className:"text-[11px] text-gray-400 whitespace-nowrap flex-shrink-0",children:d}),e.jsx("button",{onClick:N,className:`px-3 py-1 rounded-full text-xs whitespace-nowrap flex-shrink-0 ${k.length===0?ze:"bg-gray-700 text-gray-400"}`,children:r("tagGrid.filterAll")}),h.map(v=>e.jsx("button",{onClick:()=>K(v),className:`px-3 py-1 rounded-full text-xs whitespace-nowrap flex-shrink-0 ${F.has(v)?ze:"bg-gray-700 text-gray-400"}`,children:_?.[v]||v},`${t}_${v}`))]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-2 flex-wrap px-4",children:[e.jsx("span",{className:"text-[11px] text-gray-400",children:d}),e.jsxs("select",{value:Pe,onChange:v=>Ve?.(v.target.value),className:"bg-gray-900 border border-gray-700 rounded px-2 py-1 text-xs min-w-[180px]",children:[e.jsx("option",{value:"",children:r("tagGrid.filterAll")}),h.map(v=>e.jsx("option",{value:v,children:_?.[v]||v},`${t}_opt_${v}`))]}),e.jsx("button",{onClick:N,className:`px-3 py-1 rounded-full text-xs whitespace-nowrap ${k.length===0?ze:"bg-gray-700 text-gray-400"}`,children:r("tagGrid.filterAll")}),h.map(v=>e.jsx("button",{onClick:()=>K(v),className:`px-3 py-1 rounded-full text-xs whitespace-nowrap ${F.has(v)?ze:"bg-gray-700 text-gray-400"}`,children:_?.[v]||v},`${t}_chip_${v}`))]})]});return e.jsxs("div",{className:`bg-gray-800 rounded-xl border overflow-hidden shadow-2xl ${z?"border-amber-500":"border-gray-700"}`,children:[e.jsx("div",{className:"bg-gray-900 p-4 border-b border-gray-700",children:e.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[e.jsx("div",{className:"text-xs text-gray-300",children:r("tagGrid.activeInsertHint")}),H&&e.jsx("div",{className:"max-w-full sm:max-w-[36rem] text-[11px] text-sky-200 bg-slate-900/80 border border-slate-600 rounded px-2 py-1 truncate",children:H}),e.jsx("button",{onClick:()=>me?.(),className:`text-[11px] px-2 py-1 rounded border font-semibold ${z?"bg-amber-600 text-amber-50 border-amber-400 hover:bg-amber-500":"bg-gray-800 text-gray-500 border-gray-700 cursor-not-allowed"}`,disabled:!z,children:r("random.addRandomized")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!Y&&e.jsxs("label",{className:"text-[11px] text-gray-300 flex items-center gap-1",children:[e.jsx("span",{children:r("search.safetyFilterLabel")}),e.jsxs("select",{value:Se,onChange:t=>le?.(t.target.value),className:"bg-gray-900 border border-gray-700 rounded px-2 py-1 text-[11px]",children:[e.jsx("option",{value:"both",children:r("search.safetyFilterBoth")}),e.jsx("option",{value:"sfw",children:r("search.safetyFilterSfw")}),e.jsx("option",{value:"nsfw",children:r("search.safetyFilterNsfw")})]})]}),e.jsx("button",{onClick:()=>ne?.(Ze),className:`text-[11px] px-2 py-1 rounded border ${a?"bg-vi
1olet-700 text-violet-50 border-violet-500":"bg-gray-800 text-gray-200 border-gray-700 hover:bg-gray-700"}`,children:Ue}),e.jsx("button",{onClick:()=>q?.(),className:`text-[11px] px-2 py-1 rounded border ${R?"bg-rose-700 text-rose-50 border-rose-500":"bg-gray-800 text-gray-200 border-gray-700 hover:bg-gray-700"}`,children:r(R?"tagGrid.ngRegisterOn":"tagGrid.ngRegisterOff")}),e.jsx("button",{onClick:()=>E?.(),className:`text-[11px] px-2 py-1 rounded border ${z?"bg-amber-700 text-amber-50 border-amber-500":"bg-gray-800 text-gray-200 border-gray-700 hover:bg-gray-700"}`,children:r(z?"random.stop":"random.start")}),R&&e.jsx("span",{className:"text-[11px] px-2 py-1 rounded bg-rose-600 text-rose-50",children:r("tagGrid.ngMode")}),z&&e.jsx("span",{className:"text-[11px] px-2 py-1 rounded bg-amber-600 text-amber-50",children:r("tagGrid.randomMode")})]})]})}),e.jsxs("div",{className:"py-4 space-y-3 border-b border-gray-700 w-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:hidden",children:[e.jsx("span",{className:"text-[11px] text-gray-400 px-4",children:r("tagGrid.mobileColumns")}),e.jsxs("select",{value:Te,onChange:t=>c?.(Number(t.target.value)),className:"bg-gray-900 border border-gray-700 rounded px-2 py-1 text-xs",children:[e.jsx("option",{value:2,children:"2"}),e.jsx("option",{value:3,children:"3"}),e.jsx("option",{value:4,children:"4"})]})]}),Be({axisKey:"main",title:r("tagGrid.mainFilterTitle"),options:y,selected:D,selectedSet:Qe,onClear:o,onToggle:ce,singleValue:Q,onChangeSingleValue:G,activeClass:"bg-blue-600 text-white font-semibold ring-1 ring-blue-300/60"}),Be({axisKey:"world",title:r("tagGrid.worldFilterTitle"),options:b,selected:U,selectedSet:Ie,onClear:ve,onToggle:de,singleValue:fe,onChangeSingleValue:T,activeClass:"bg-violet-600 text-white font-semibold ring-1 ring-violet-300/60"}),Be({axisKey:"context",title:r("tagGrid.contextFilterTitle"),options:A,selected:J,selectedSet:qe,onClear:je,onToggle:xe,singleValue:oe,onChangeSingleValue:ke,activeClass:"bg-emerald-600 text-white font-semibold ring-1 ring-emerald-300/60"}),e.jsxs("div",{className:"sm:hidden flex items-center gap-2 overflow-x-auto px-4 pb-2",children:[e.jsx("span",{className:"text-[11px] text-gray-400 whitespace-nowrap flex-shrink-0",children:r("tagGrid.typeFilterTitle")}),e.jsx("button",{onClick:Ne,className:`px-3 py-1 rounded-full text-xs whitespace-nowrap flex-shrink-0 ${B.length===0?"bg-cyan-600 text-white font-semibold ring-1 ring-cyan-300/60":"bg-gray-700 text-gray-400"}`,children:r("tagGrid.filterAll")}),C.map(t=>e.jsx("button",{onClick:()=>we(t),className:`px-3 py-1 rounded-full text-xs whitespace-nowrap flex-shrink-0 ${Me.has(t)?"bg-cyan-600 text-white font-semibold ring-1 ring-cyan-300/60":"bg-gray-700 text-gray-400"}`,children:r(`tagType.${t}`)},t))]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-2 flex-wrap px-4",children:[e.jsx("span",{className:"text-[11px] text-gray-400",children:r("tagGrid.typeFilterTitle")}),e.jsx("button",{onClick:Ne,className:`px-3 py-1 rounded-full text-xs whitespace-nowrap ${B.length===0?"bg-cyan-600 text-white font-semibold ring-1 ring-cyan-300/60":"bg-gray-700 text-gray-400"}`,children:r("tagGrid.filterAll")}),C.map(t=>e.jsx("button",{onClick:()=>we(t),className:`px-3 py-1 rounded-full text-xs whitespace-nowrap ${Me.has(t)?"bg-cyan-600 text-white font-semibold ring-1 ring-cyan-300/60":"bg-gray-700 text-gray-400"}`,children:r(`tagType.${t}`)},t))]})]}),e.jsxs("div",{ref:u,className:"p-4 max-h-[22rem] xl:max-h-[68vh] 2xl:max-h-[72vh] overflow-y-auto",children:[He>0&&e.jsx("div",{style:{height:`${He}px`}}),Ye.map(t=>{const d=t*m,h=$.slice(d,d+m);return e.jsx("div",{className:"grid gap-3 mb-3",style:{gridTemplateColumns:`repeat(${m}, minmax(0, 1fr))`,minHeight:`${g-12}px`},children:h.map(k=>Je(k))},`row_${t}`)}),Oe>0&&e.jsx("div",{style:{height:`${Oe}px`}})]})]})}function Fe(r,y){const b=Number.parseFloat(r),A=Number.isFinite(b)?b:1;return(Math.round((A+y)*10)/10).toFixed(1)}function Cr(r){const y=String(r||"").trim(),b=y.match(/^\((.+):([0-9]+(?:\.[0-9]+)?)\)$/);return b?{token:String(b[1]||"").trim(),weight:Number.parseFloat(b[2])||1}:{token:y,weight:1}}function Tr({t:r,language:y,dictionary:b,selectedPositive:A,selectedNegative:C,positiveTextBlocks:_=[],negativeTextBlocks:D=[],positiveTargetOptions:U=[],negativeTargetOptions:J=[],selectedPositiveTargetId:B="",selectedNegativeTargetId:Q="",mainTargetId:fe="",noneTargetId:oe="",onPositiveTargetChange:$e,onNegativeTargetChange:ce,onUpdateWeight:de,onUpdateTargetWeight:xe,onUpdateRandomEntryCandidateWeight:o,onAdjustAllWeights:ve,onAdjustTargetWeights:je,onResetAllWeights:we,onToggleLock:Ne,onToggleTargetBlockLock:G}){const T=Array.isArray(b)?b:[],ke=Array.isArray(_)?_:[],ge=Array.isArray(D)?D:[],[I,$]=te.useState("both"),[pe,Ce]=te.useState(()=>new Set),z=te.useMemo(()=>{const s=new Map;return T.forEach(l=>{l?.id&&s.set(l.id,l)}),s},[T]),be=te.useMemo(()=>{const s=new Map;return T.forEach(l=>{const c=String(l?.en||"").trim().toLowerCase();!c||s.has(c)||s.set(c,l)}),s},[T]),se=te.useCallback(s=>{const l=String(s||"").trim(),c=l.match(/^\((.+):([0-9]+(?:\.[0-9]+)?)\)$/);return c?{baseToken:String(c[1]||"").trim(),weight:Number.parseFloat(c[2])||1}:{baseToken:l,weight:1}},[]),X=te.useCallback(s=>String(s||"").split(",").map(l=>
1l.trim()).filter(Boolean),[]),H=te.useCallback(s=>(Array.isArray(s)?s:[]).map(l=>{const c=z.get(l.dictId),u=y==="ja"?c?.jp:c?.displayEn||c?.en||l.dictId,S=String(c?.type||"").toLowerCase()==="random"?String(c?.en||"").split("|").map(j=>j.trim()).filter(Boolean).map(Cr):[];return{key:`main-${l.dictId}`,dictId:l.dictId,label:u||l.dictId,weight:l.weight,lock:!!l.lock,isBlockToken:!1,randomCandidates:S}}),[z,y]),ae=te.useCallback((s,l)=>s?X(s.text).map((u,S)=>{const{baseToken:j,weight:f}=se(u),W=be.get(String(j).trim().toLowerCase()),L=y==="ja"?W?.jp||j:W?.displayEn||W?.en||j;return{key:`block-${l}-${s.id}-${S}`,dictId:W?.id||"",tokenIndex:S,label:L||j,weight:f,lock:!!s.lock,isBlockToken:!0}}):[],[be,y,se,X]),O=!B||B===fe||B===oe,R=O?null:ke.find(s=>s.id===B)||null,q=!Q||Q===fe||Q===oe,E=q?null:ge.find(s=>s.id===Q)||null,me=te.useMemo(()=>O?H(A):ae(R,"positive"),[R,ae,H,O,A]),Y=te.useMemo(()=>q?H(C):ae(E,"negative"),[E,ae,H,q,C]),le=te.useMemo(()=>[{type:"positive",label:r("mode.positive"),list:me,badgeClass:"bg-slate-700 text-slate-100",targetOptions:U,selectedTargetId:B,onTargetChange:$e,isMainTarget:O,activeBlockId:R?.id||""},{type:"negative",label:r("mode.negative"),list:Y,badgeClass:"bg-rose-700 text-rose-100",targetOptions:J,selectedTargetId:Q,onTargetChange:ce,isMainTarget:q,activeBlockId:E?.id||""}],[r,me,U,B,$e,O,R?.id,Y,J,Q,ce,q,E?.id]).filter(s=>I==="both"||s.type===I),ee=(()=>{const s=r("weight.showBoth");return s==="weight.showBoth"?"両æ¹":s})(),ne=(()=>{const s=r("weight.showPositive");return s==="weight.showPositive"?r("mode.positive"):s})(),he=(()=>{const s=r("weight.showNegative");return s==="weight.showNegative"?r("mode.negative"):s})(),re=(()=>{const s=r("weight.randomEditCandidates");return s==="weight.randomEditCandidates"?"åè£ãã¨ã«èª¿æ´":s})(),ue=(()=>{const s=r("weight.randomCloseCandidates");return s==="weight.randomCloseCandidates"?"åè£èª¿æ´ãéãã":s})(),V=s=>{s&&Ce(l=>{const c=new Set(l);return c.has(s)?c.delete(s):c.add(s),c})};return e.jsxs("div",{className:"bg-gray-800 p-5 rounded-xl border border-gray-700",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-2",children:[e.jsxs("h3",{className:"text-sm font-bold text-gray-400 flex items-center gap-2",children:[e.jsx(yr,{size:16}),r("weight.title")]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("button",{onClick:we,className:"text-xs px-2 py-1 rounded bg-gray-700 border border-gray-600",children:r("weight.resetAll")})})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>$("both"),className:`px-2 py-1 rounded text-[11px] border ${I==="both"?"bg-sky-700 border-sky-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:ee}),e.jsx("button",{type:"button",onClick:()=>$("positive"),className:`px-2 py-1 rounded text-[11px] border ${I==="positive"?"bg-emerald-700 border-emerald-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:ne}),e.jsx("button",{type:"button",onClick:()=>$("negative"),className:`px-2 py-1 rounded text-[11px] border ${I==="negative"?"bg-rose-700 border-rose-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:he})]}),e.jsx("div",{className:"space-y-4",children:le.map(s=>e.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded p-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"min-w-0 pr-2",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-300",children:s.label}),Array.isArray(s.targetOptions)&&s.targetOptions.length>0&&e.jsx("select",{value:s.selectedTargetId,onChange:l=>s.onTargetChange?.(l.target.value),className:"mt-1 w-full bg-gray-800 border border-gray-700 rounded px-2 py-1 text-[11px] text-gray-100",children:s.targetOptions.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>s.isMainTarget?ve(s.type,-.1):je?.(s.type,s.activeBlockId,-.1),disabled:!s.isMainTarget&&!s.activeBlockId,className:"text-xs px-2 py-1 rounded bg-gray-700 border border-gray-600",children:"-0.1"}),e.jsx("button",{onClick:()=>s.isMainTarget?ve(s.type,.1):je?.(s.type,s.activeBlockId,.1),disabled:!s.isMainTarget&&!s.activeBlockId,className:"text-xs px-2 py-1 rounded bg-gray-700 border border-gray-600",children:"+0.1"})]})]}),e.jsx("div",{className:"max-h-56 overflow-y-auto pr-1",children:s.list.length===0?e.jsx("div",{className:"text-[11px] text-gray-500",children:r("weight.unselected")}):e.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-2",children:s.list.map(l=>{const c=!!l.lock,u=s.isMainTarget?!!l.dictId:!!s.activeBlockId,S=s.isMainTarget&&Array.isArray(l.randomCandidates)&&l.randomCandidates.length>1,j=S&&pe.has(l.dictId);return e.jsxs("div",{className:"bg-gray-800 p-2 rounded text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-semibold ${s.badgeClass}`,children:s.label}),e.jsx("span",{className:"flex-1 truncate",children:l.label}),S&&e.jsxs("button",{type:"button",onClick:()=>V(l.dictId),className:"px-2 py-1 rounded bg-indigo-700/70 border border-indigo-500 text-indigo-100 text-[11px] inline-flex items-center gap-1",children:[j?ue:re,j?e.jsx(er,{size:12}):e.jsx(rr,{size:12})]}),e.jsx("button",{onClick:()=>s.isMainTarget?Ne(s.type,l.dictId):G?.(s.type,s.activeBlockId),disabled:!u,className:`px-2 py-1 rounded border ${c?"bg-amber-700/50 border-amber-500 text-amber-100":"bg-gray-700 border-gray-600 text-gray-200"}`,title:r(c?"weight.unlock":"weight.lock"),"aria-label":r(c?"weight.unlock":"weight.lock"),children:c?e.jsx(ir,{size:12}):e.jsx(or,{size:12})}),e.jsx("button",{onClick:()=>s.isMainTarget?de(s.type,l.dictId,Fe(l.weight,-.1)):xe?.(s.type,s.activeBlockId,l.tokenIndex,Fe(l.weight,-.1)),disabled:!u||c,className:"px-2 py-1 rounded bg-gray-700 border border-gray-600",children:"-"}),e.jsx("input",{type:"number",step:"0.1",min:"0.1",max:"3",value:l.weight,onChange:f=>s.isMainTarget?de(s.type,l.dictId,f.target.value):xe?.(s.type,s.activeBlockId,l.tokenIndex,f.target.value),disabled:!u||c,className:"w-14 bg-gray-700 rounded text-center"}),e.jsx("button",{onClick:()=>s.isMainTarget?de(s.type,l.dictId,Fe(l.weight,.1)):xe?.(s.type,s.activeBlockId,l.tokenIndex,Fe(l.weight,.1)),disabled:!u||c,className:"px-2 py-1 rounded bg-gray-700 border border-gray-600",children:"+"})]}),j&&e.jsx("div",{className:"mt-2 rounded border border-indigo-500/40 bg-slate-900/70 p-2 space-y-1.5",children:l.randomCandidates.map((f,W)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex-1 truncate text-[11px] text-gray-200",children:f.token}),e.jsx("button",{onClick:()=>o?.(l.dictId,W,Fe(f.weight,-.1)),disabled:!u||c,className:"px-2 py-1 rounded bg-gray-700 border border-gray-600 text-[11px]",children:"-"}),e.jsx("input",{type:"number",step:"0.1",min:"0.1",max:"3",value:f.weight,onChange:L=>o?.(l.dictId,W,L.target.value),disabled:!u||c,className:"w-14 bg-gray-700 rounded text-center text-[11px]"}),e.jsx("button",{onClick:()=>o?.(l.dictId,W,Fe(f.weight,.1)),disabled:!u||c,className:"px-2 py-1 rounded bg-gray-700 border border-gray-600 text-[11px]",children:"+"})]},`${l.key}_candidate_${W}`))})]},l.key)})})})]},s.type))})]})}
1function Rr({t:r,workspaceCollapsed:y,onToggleWorkspaceCollapsed:b,workspaceContainerRef:A,workspaceSplitPercent:C,workspaceResizing:_,onStartWorkspaceResize:D,insertTargetText:U,onClearAllPrompts:J,onClearPositivePrompts:B,onClearNegativePrompts:Q,onClearUnlockedPrompts:fe,onRequestClearAll:oe,weightAdjusterProps:$e,searchQuery:ce,onSearchQueryChange:de,onClearSearch:xe,entrySourceFilter:o,onEntrySourceFilterChange:ve,sfwOnly:je,safetyViewMode:we,onSafetyViewModeChange:Ne,dictionarySortMode:G,onDictionarySortModeChange:T,filteredDictionaryCount:ke,ngMode:ge,onToggleNgMode:I,randomBuildMode:$,onToggleRandomBuildMode:pe,onCreateRandomizedTag:Ce,onUndo:z,canUndo:be,ngFilterEnabled:se,onToggleNgFilterEnabled:X,favoriteOnly:H,onToggleFavoriteOnly:ae,ngWords:O,ngWordGroups:R,ngGroupOptions:q,ngWordInput:E,onNgWordInputChange:me,ngWordGroupInput:Y,onNgWordGroupInputChange:Se,ngListSearch:le,onNgListSearchChange:ee,ngListGroupFilter:ne,onNgListGroupFilterChange:he,filteredNgWords:re,onAddNgWord:ue,onClearNgWordInput:V,onRemoveNgWord:s,onUpdateNgWordGroup:l,onClearNgWords:c,overlapBehavior:u,onOverlapBehaviorChange:S,randomDraftWords:j=[],randomCategoryOptions:f=[],tagGridProps:W,liveWorkspaceProps:L}){const[We,x]=p.useState(!1),Le=p.useMemo(()=>{const i=Array.isArray(f)?f:[];return[...new Set(["UserAdded",...i])]},[f]),Z=()=>{$&&x(!0)};return e.jsxs("div",{className:"bg-gray-800 rounded-xl border border-gray-700 overflow-hidden xl:overflow-visible",children:[e.jsx("div",{className:"p-4",children:e.jsxs("div",{ref:A,className:"space-y-6 xl:space-y-0 xl:flex xl:items-start",children:[e.jsxs("div",{className:"space-y-6 min-w-0",style:{flexBasis:`${C}%`,flexGrow:0,flexShrink:0},children:[e.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-xl p-4 flex flex-wrap justify-between items-center gap-3",children:[e.jsx("div",{className:"text-xs text-gray-400",children:U}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e.jsx("button",{onClick:I,className:`px-3 py-2 rounded text-xs font-semibold border ${ge?"bg-rose-700 hover:bg-rose-600 border-rose-500 text-white":"bg-gray-700 hover:bg-gray-600 border-gray-600 text-gray-100"}`,children:r(ge?"search.switchToNormalMode":"search.switchToNgMode")}),e.jsx("button",{onClick:pe,className:`px-3 py-2 rounded text-xs font-semibold border ${$?"bg-amber-700 hover:bg-amber-600 border-amber-500 text-white":"bg-gray-700 hover:bg-gray-600 border-gray-600 text-gray-100"}`,children:r($?"random.stop":"random.start")}),e.jsx("button",{onClick:Z,className:`px-3 py-2 rounded text-xs font-semibold border ${$?"bg-amber-600 hover:bg-amber-500 border-amber-400 text-white":"bg-gray-800 border-gray-700 text-gray-500 cursor-not-allowed"}`,disabled:!$,children:r("random.addRandomized")}),e.jsx("button",{onClick:z,disabled:!be,className:`px-3 py-2 rounded text-xs font-semibold border ${be?"bg-gray-700 hover:bg-gray-600 border-gray-600 text-gray-100":"bg-gray-800 border-gray-700 text-gray-500 cursor-not-allowed"}`,title:"Ctrl/â + Z",children:r("actions.undo")}),e.jsx("button",{onClick:J,className:"px-3 py-2 rounded bg-gray-700 hover:bg-gray-600 text-xs font-semibold",children:r("actions.clearAllPrompts")}),e.jsx("button",{onClick:B,className:"px-3 py-2 rounded bg-emerald-700 hover:bg-emerald-600 text-xs font-semibold text-white",children:r("actions.clearPositivePrompts")}),e.jsx("button",{onClick:Q,className:"px-3 py-2 rounded bg-rose-700 hover:bg-rose-600 text-xs font-semibold text-white",children:r("actions.clearNegativePrompts")}),e.jsx("button",{onClick:fe,className:"px-3 py-2 rounded bg-amber-700 hover:bg-amber-600 text-xs font-semibold text-white",children:r("actions.clearUnlockedPrompts")}),e.jsx("button",{onClick:oe,className:"px-4 py-2 rounded bg-red-700 hover:bg-red-600 text-sm font-bold text-white",children:r("actions.clearAll")})]})]}),e.jsx(Tr,{...$e}),e.jsxs("div",{className:"bg-gray-800 rounded-xl border border-gray-700 p-4",children:[e.jsxs("label",{className:"text-xs text-gray-300 mb-2 flex items-center gap-2",children:[e.jsx(hr,{size:14}),r("search.label")]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:ce,onChange:i=>de(i.target.value),placeholder:r("search.placeholder"),className:"flex-1 bg-gray-900 border border-gray-700 rounded px-3 py-2 text-sm"}),ce&&e.jsx("button",{onClick:xe,className:"text-xs px-3 py-2 rounded bg-gray-700 border border-gray-600",children:r("actions.clear")})]}),e.jsxs("div",{className:"ng-panel mt-3 rounded-lg border border-gray-700 bg-gray-900/60 p-3 space-y-2",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("span",{className:"ng-panel-title text-[11px] text-gray-300",children:r("search.ngTitle")}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:items-center sm:gap-2",children:[e.jsx("span",{className:"hidden sm:inline ng-panel-sh
1ortcut text-[10px] text-gray-400",children:r("search.favoriteShortcut")}),e.jsx("button",{onClick:ae,className:`w-full sm:w-auto px-2.5 py-1 rounded text-[11px] font-semibold border ${H?"bg-amber-700 border-amber-500 text-white":"bg-gray-800 border-gray-600 text-gray-200"}`,children:r(H?"search.favoriteFilterOn":"search.favoriteFilterOff")}),e.jsx("span",{className:"hidden sm:inline ng-panel-shortcut text-[10px] text-gray-400",children:r("search.ngShortcut")}),e.jsx("button",{onClick:X,className:`w-full sm:w-auto px-2.5 py-1 rounded text-[11px] font-semibold border ${se?"bg-emerald-700 border-emerald-500 text-white":"bg-gray-800 border-gray-600 text-gray-200"}`,children:r(se?"search.ngFilterOn":"search.ngFilterOff")}),e.jsx("button",{onClick:I,className:`w-full sm:w-auto px-2.5 py-1 rounded text-[11px] font-semibold border ${ge?"bg-rose-700 border-rose-500 text-white":"bg-gray-800 border-gray-600 text-gray-200"}`,children:r(ge?"search.switchToNormalMode":"search.switchToNgMode")}),e.jsx("button",{onClick:pe,className:`w-full sm:w-auto px-2.5 py-1 rounded text-[11px] font-semibold border ${$?"bg-amber-700 border-amber-500 text-white":"bg-gray-800 border-gray-600 text-gray-200"}`,children:r($?"random.stop":"random.start")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[minmax(0,1fr)_9rem_auto_auto]",children:[e.jsx("input",{value:E,onChange:i=>me(i.target.value),placeholder:r("search.ngPlaceholder"),className:"flex-1 bg-gray-900 border border-gray-700 rounded px-3 py-2 text-xs",onKeyDown:i=>{i.key==="Enter"&&(i.preventDefault(),ue())}}),e.jsx("input",{value:Y,onChange:i=>Se(i.target.value),placeholder:r("search.ngGroupPlaceholder"),className:"w-full bg-gray-900 border border-gray-700 rounded px-3 py-2 text-xs"}),e.jsx("button",{onClick:ue,className:"w-full sm:w-auto px-3 py-2 rounded bg-rose-700 hover:bg-rose-600 text-xs font-semibold text-white",children:r("search.ngAdd")}),E&&e.jsx("button",{onClick:V,className:"w-full sm:w-auto px-3 py-2 rounded bg-gray-700 hover:bg-gray-600 text-xs font-semibold",children:r("actions.clear")})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsx("input",{value:le,onChange:i=>ee(i.target.value),placeholder:r("search.ngListSearchPlaceholder"),className:"bg-gray-900 border border-gray-700 rounded px-3 py-2 text-xs"}),e.jsxs("select",{value:ne,onChange:i=>he(i.target.value),className:"bg-gray-900 border border-gray-700 rounded px-2 py-2 text-xs",children:[e.jsx("option",{value:"all",children:r("search.ngGroupAll")}),(q||[]).map(i=>e.jsx("option",{value:i,children:i},i))]})]}),e.jsx("div",{className:"max-h-40 overflow-auto rounded border border-gray-700 p-2 space-y-2",children:O.length===0?e.jsx("span",{className:"ng-panel-empty text-[11px] text-gray-500",children:r("search.ngEmpty")}):re.length===0?e.jsx("span",{className:"ng-panel-empty text-[11px] text-gray-500",children:r("search.ngNoMatch")}):re.map(i=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>s(i),className:"px-2 py-1 rounded border border-rose-500/50 bg-rose-900/40 text-rose-100 text-[11px]",title:r("search.ngHint"),children:[i," Ã"]}),e.jsx("input",{value:R?.[i]||"general",onChange:Ae=>l(i,Ae.target.value),className:"min-w-0 flex-1 bg-gray-900 border border-gray-700 rounded px-2 py-1 text-[11px]",placeholder:r("search.ngGroupPlaceholder")})]},i))}),O.length>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:c,className:"px-2 py-1 rounded bg-gray-700 hover:bg-gray-600 text-[11px] font-semibold",children:r("search.ngClearAll")})})]}),e.jsxs("div",{className:"mt-2 grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsxs("label",{className:"text-[11px] text-gray-400 flex items-center gap-2",children:[e.jsx("span",{children:r("search.sourceFilterLabel")}),e.jsxs("select",{value:o,onChange:i=>ve(i.target.value),className:"bg-gray-900 border border-gray-700 rounded px-2 py-1 text-xs",children:[e.jsx("option",{value:"all",children:r("search.sourceFilterAll")}),e.jsx("option",{value:"default",children:r("search.sourceFilterDefault")}),e.jsx("option",{value:"user",children:r("search.sourceFilterUser")})]})]}),!je&&e.jsxs("label",{className:"text-[11px] text-gray-400 flex items-center gap-2",children:[e.jsx("span",{children:r("search.safetyFilterLabel")}),e.jsxs("select",{value:we,onChange:i=>Ne(i.target.value),className:"bg-gray-900 border border-gray-700 rounded px-2 py-1 text-xs",children:[e.jsx("option",{value:"both",children:r("search.safetyFilterBoth")}),e.jsx("option",{value:"sfw",children:r("search.safetyFilterSfw")}),e.jsx("option",{value:"nsfw",children:r("search.safetyFilterNsfw")})]})]}),e.jsxs("label",{className:"text-[11px] text-gray-400 flex items-center gap-2",children:[e.jsx("span",{children:r("search.sortLabel")}),e.jsxs("select",{value:G,onChange:i=>T(i.target.value),className:"bg-gray-900 border border-gray-700 rounded px-2 py-1 text-xs",children:[e.jsx("option",{value:"default",children:r("search.sortDefault")}
1),e.jsx("option",{value:"name_asc",children:r("search.sortNameAsc")}),e.jsx("option",{value:"name_desc",children:r("search.sortNameDesc")}),e.jsx("option",{value:"category_asc",children:r("search.sortCategoryAsc")}),e.jsx("option",{value:"category_desc",children:r("search.sortCategoryDesc")}),e.jsx("option",{value:"selected_first",children:r("search.sortSelectedFirst")}),e.jsx("option",{value:"selected_last",children:r("search.sortSelectedLast")}),e.jsx("option",{value:"positive_first",children:r("search.sortPositiveFirst")}),e.jsx("option",{value:"positive_last",children:r("search.sortPositiveLast")}),e.jsx("option",{value:"negative_first",children:r("search.sortNegativeFirst")}),e.jsx("option",{value:"negative_last",children:r("search.sortNegativeLast")})]})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[e.jsx("button",{onClick:()=>T("default"),className:`px-2 py-1 rounded text-[11px] border ${G==="default"?"bg-slate-700 border-slate-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:r("search.sortQuickNormal")}),e.jsx("button",{onClick:()=>T("selected_first"),className:`px-2 py-1 rounded text-[11px] border ${G==="selected_first"?"bg-indigo-700 border-indigo-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:r("search.sortQuickAllTop")}),e.jsx("button",{onClick:()=>T("selected_last"),className:`px-2 py-1 rounded text-[11px] border ${G==="selected_last"?"bg-indigo-700 border-indigo-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:r("search.sortQuickAllBottom")}),e.jsx("button",{onClick:()=>T("positive_first"),className:`px-2 py-1 rounded text-[11px] border ${G==="positive_first"?"bg-emerald-700 border-emerald-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:r("search.sortQuickPositiveTop")}),e.jsx("button",{onClick:()=>T("positive_last"),className:`px-2 py-1 rounded text-[11px] border ${G==="positive_last"?"bg-emerald-700 border-emerald-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:r("search.sortQuickPositiveBottom")}),e.jsx("button",{onClick:()=>T("negative_first"),className:`px-2 py-1 rounded text-[11px] border ${G==="negative_first"?"bg-rose-700 border-rose-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:r("search.sortQuickNegativeTop")}),e.jsx("button",{onClick:()=>T("negative_last"),className:`px-2 py-1 rounded text-[11px] border ${G==="negative_last"?"bg-rose-700 border-rose-500 text-white":"bg-gray-700 border-gray-600 text-gray-200"}`,children:r("search.sortQuickNegativeBottom")})]}),e.jsx("div",{className:"mt-2 text-[11px] text-gray-400",children:r("search.hits",{count:ke})})]}),e.jsx("div",{className:"bg-gray-800 p-4 rounded-xl border border-gray-700",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsx("span",{className:"text-xs text-gray-400",children:r("settings.overlapWhen")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("select",{"data-testid":"overlap-behavior-select-main",value:u,onChange:i=>S(i.target.value),className:"bg-gray-900 border border-gray-700 rounded px-2 py-1 text-xs",children:[e.jsx("option",{value:"allow-both",children:r("settings.overlap.allowBoth")}),e.jsx("option",{value:"keep-original",children:r("settings.overlap.keepOriginal")}),e.jsx("option",{value:"move",children:r("settings.overlap.move")}),e.jsx("option",{value:"remove",children:r("settings.overlap.remove")})]}),e.jsx("button",{onClick:()=>S(u==="remove"?"move":"remove"),className:`px-2.5 py-1 rounded text-xs font-semibold border ${u==="remove"?"bg-rose-700 border-rose-500 text-white":"bg-gray-700 border-gray-600 text-gray-100 hover:bg-gray-600"}`,children:r(u==="remove"?"settings.deleteModeOn":"settings.deleteModeOff")})]})]})}),e.jsx(kr,{...W,onCreateRandomizedTag:Z})]}),e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":r("liveWorkspace.resizeColumns"),onMouseDown:D,onTouchStart:D,className:`hidden xl:flex w-3 mx-1 self-stretch cursor-col-resize items-center justify-center ${_?"opacity-100":"opacity-70 hover:opacity-100"}`,children:e.jsx("div",{className:"h-20 w-1 rounded-full bg-sky-500/50 workspace-resize-divider"})}),e.jsx("div",{className:"xl:hidden min-w-0",children:e.jsxs("div",{className:"bg-gray-800 rounded-xl border border-gray-700 overflow-hidden",children:[e.jsxs("button",{onClick:b,className:"w-full px-4 py-3 bg-gray-900 border-b border-gray-700 flex items-center justify-between text-left",children:[e.jsx("span",{className:"text-sm font-bold text-sky-300",children:r("liveWorkspace.title")}),y?e.jsx(rr,{size:16}):e.jsx(er,{size:16})]}),!y&&e.jsx("div",{className:"p-3",children:e.jsx(Xe,{...L})})]})}),e.jsx("div",{className:"hidden xl:block xl:sticky xl:top-6 min-w-0 xl:pl-2",style:{flexBasis:`${100-C}%`,flexGrow:1},children:e.jsx(Xe,{...L})})]})}),e.jsx(lr,{t:r,open:We,onClose:()=>x(!1),onSubmit:Ce,categoryOptions:Le,randomDraftWords:j})]})}export{Rr as default};
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.