1import{j as e}from"./vendor-query-CKtLK1dq.js";import{i as W,c as E,u as z,d as A,r as H}from"./vendor-react-jvDhuP46.js";import{r as C,m as q,cv as D,G as n,aB as F,d as P,w as g,I as _}from"./index-CvWaq0wg.js";import{I as O,g as G,c as R,a as U,b as V,l as K,m as Y}from"./IdeaEditForm-C5TcSsR-.js";import{E as $}from"./EmptyState-DE5cxFiM.js";import{B as i}from"./Badge-BsLOczm3.js";import{u as J}from"./vendor-i18n-DMkF1ssK.js";import"./vendor-axios-DEWho_Gc.js";import"./AutoGrowTextarea-IR9FaccU.js";function le(){var b,N,L,y;const{t}=J("ideas"),{id:d}=W(),c=E(),M=z(),[B]=A(),k=d?C(d,"idea show page id"):"",{canEdit:h}=q(),{data:x,isLoading:S,isError:T}=D(k,!!k),[I,m]=H.useState(h&&B.get("edit")==="1"),s=x==null?void 0:x.data;if(S)return e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-violet-500 border-t-transparent"})});if(T||!s)return e.jsx(n,{children:e.jsx($,{icon:e.jsx("svg",{className:"h-16 w-16",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),title:t("showPage.notFoundTitle"),description:t("showPage.notFoundDescription"),action:{label:t("showPage.backToIdeas"),onClick:()=>c("/ideas")}})});const r=s.metadata,u=r==null?void 0:r.evaluation,w=(r==null?void 0:r.similar_titles)??[],p=r==null?void 0:r.generation_method,v=r&&Array.isArray(r.selected_sources)?r.selected_sources:[],j=s.content_type??(r==null?void 0:r.content_type)??null,f=j?((b=F.find(a=>a.value===j))==null?void 0:b.label)??j.replace(/_/g," "):null,Z=()=>{const a=new URLSearchParams;a.set("idea_id",C(s.id,"idea show convert id")),c(`/content/generate?${a.toString()}`)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("button",{type:"button",onClick:()=>
1M.key!=="default"?c(-1):c("/ideas"),className:"inline-flex items-center gap-1 text-sm text-slate-500 transition-colors hover:text-violet-500 dark:text-slate-400",children:[e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),t("showPage.backToIdeas")]}),I?e.jsx(n,{children:e.jsx(O,{idea:s,onCancel:()=>m(!1),onSaved:()=>m(!1)})}):e.jsxs(e.Fragment,{children:[e.jsx(n,{children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-2.5",children:[e.jsx("span",{className:"mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-amber-400/15 text-amber-500 dark:text-amber-400",children:e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.7,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-1m0 1a6 6 0 0 0 1.5-.19m-1.5.19a6 6 0 0 1-1.5-.19m0 0A6 6 0 0 1 6 12a6 6 0 1 1 12 0 6 6 0 0 1-4.5 5.81M9.75 21h4.5"})})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h1",{className:"break-words text-2xl font-bold text-slate-900 dark:text-white",children:s.title}),((N=s.website)==null?void 0:N.name)&&e.jsx("p",{className:"mt-1.5 text-sm text-slate-500 dark:text-slate-400",children:s.website.name})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2 sm:flex-wrap",children:[h&&e.jsxs(P,{variant:"secondary",size:"sm",className:"whitespace-nowrap",onClick:()=>m(!0),children:[e.jsx("svg",{className:"h-4 w-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Z"})}),t("hubCard.edit")]}),h&&!s.is_used&&e.jsxs(P,{size:"sm",className:"whitespace-nowrap",onClick:Z,children:[e.jsx("svg",{className:"h-4 w-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.456-2.456L14.25 6l1.035-.259a3.375 3.375 0 0 0 2.456-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456Z"})}),e.jsx("span",{className:"sm:hidden",children:t("showPage.convert")}),e.jsx("span",{className:"hidden sm:inline",children:t("showPage.convertToContent")})]})]})]}),s.description&&e.jsx("p",{className:"break-words text-sm leading-relaxed text-slate-600 dark:text-slate-400",children:s.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(i,{variant:s.source==="ai"?"info":"neutral",size:"md",dot:!0,title:t("hubCard.ideaOrigin"),children:G(s.source)}),s.is_used&&e.jsxs(i,{variant:"success",size:"md",title:t("showPage.usedTooltip"),children:[e.jsx("svg",{className:"h-3 w-3 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),t("stats.used")]}),s.priority&&e.jsxs(e.Fragment,{children:[e.jsx(i,{variant:"warning",size:"md",title:t("hubCard.aiPriorityRank"),children:s.priority.rank===1?t("showPage.topPick"):t("showPage.rank",{rank:s.priority.rank}
1)}),(()=>{const a=R(s.priority.tag);return a?e.jsx("span",{className:g("inline-flex items-center rounded-full px-2.5 py-1 text-xs font-medium",a.className),children:a.label}):null})()]}),(r==null?void 0:r.uniqueness_score)!=null&&e.jsx("span",{className:g("inline-flex items-center rounded-full px-2.5 py-1 text-xs font-medium",U(r.uniqueness_score)),children:t("hubCard.uniquePercent",{score:r.uniqueness_score})}),s.score!=null&&e.jsxs("span",{className:g("inline-flex items-center gap-1 rounded-md bg-slate-100 px-1.5 py-0.5 text-[11px] font-semibold tabular-nums dark:bg-white/[0.06]",V(s.score)),title:t("hubCard.aiIdeaScore"),children:[e.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M10 15l-5.878 3.09 1.123-6.545L.489 6.91l6.572-.955L10 0l2.939 5.955 6.572.955-4.756 4.635 1.123 6.545z"})}),s.score]}),((L=s.category)==null?void 0:L.name)&&e.jsxs(i,{variant:"neutral",title:t("hubCard.category"),children:[e.jsxs("svg",{className:"h-3 w-3 shrink-0 opacity-70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,"aria-hidden":"true",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6h.008v.008H6V6Z"})]}),s.category.name]}),f&&e.jsxs(i,{variant:"neutral",className:"capitalize",title:t("hubCard.contentType"),children:[e.jsx("svg",{className:"h-3 w-3 shrink-0 opacity-70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),f]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-t border-slate-200 pt-4 text-xs text-slate-500 dark:border-white/10 dark:text-slate-400",children:[e.jsx("span",{title:new Date(s.created_at).toLocaleString(),children:t("hubCard.createdAt",{date:_(s.created_at)})}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("span",{title:new Date(s.updated_at).toLocaleString(),children:t("showPage.updated",{date:_(s.updated_at)})}),s.share_date&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("span",{children:t("showPage.shareDate",{date:s.share_date})})]})]})]})}),s.target_keywords&&s.target_keywords.length>0&&e.jsxs(n,{children:[e.jsx(o,{icon:e.jsxs("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6h.008v.008H6V6Z"})]}),children:t("showPage.targetKeywords")}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.target_keywords.map(a=>e.jsx(i,{variant:"neutral",children:a},a))})]}),((y=s.priority)==null?void 0:y.reason)&&e.jsxs(n,{children:[e.jsx(o,{icon:e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.48 3.499-6.347 11.07c-.546.951.18 2.131 1.27 2.131h12.69c1.09 0 1.816-1.18 1.27-2.131L13.52 3.5c-.526-.916-1.514-.916-2.04 0ZM12 9v3.75m0 3.75h.008v.008H12v-.008Z"})}),children:t("showPage.aiPriorityRationale")}),e.jsx("p",{className:"text-sm italic text-slate-500 dark:text-slate-400",children:s.priority.reason})]}),u&&Object.keys(u).length>0&&e.jsxs(n,{children:[e.jsx(o,{icon:e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})}),children:t("showPage.roleEvaluation")}),e.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:Object.entries(u).map(([a,l])=>e.jsxs("div",{className:"rounded-lg bg-slate-50 px-3 py-2 dark:bg-white/[0.03]",children:[e.jsx("p",{className:"text-xs font-medium text-slate-700 dark:text-slate-200",children:l.role_name}),e.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:t("showPage.importanceClickability",{importance:l.importance,clickability:l.clickability})}),l.reasoning&&e.jsx("p",{className:"mt-1 text-xs italic text-slate-500 dark:text-slate-400",children:l.reasoning})]},a))})]}),w.length>0&&e.jsxs(n,{children:[e.jsx(o,{icon:e.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}),children:t("showPage.similarTitles")}
1),e.jsx("div",{className:"space-y-2",children:w.map((a,l)=>e.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg bg-slate-50 px-3 py-2 dark:bg-white/[0.03]",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[a.type==="content"&&a.url?e.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"break-words text-xs text-blue-600 hover:underline dark:text-blue-400",children:a.title}):e.jsx("span",{className:"break-words text-xs text-slate-600 dark:text-slate-400",children:a.title}),e.jsx("span",{className:"text-[10px] text-slate-400 dark:text-slate-500",children:a.type==="content"?t("showPage.publishedContent"):t("hubCard.idea")})]}),typeof a.similarity=="number"&&e.jsxs("span",{className:"shrink-0 text-xs font-medium tabular-nums text-rose-400",children:[a.similarity,"%"]})]},l))})]}),(p||v.length>0)&&e.jsxs(n,{children:[e.jsx(o,{icon:e.jsxs("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),children:t("showPage.generationDetails")}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[p&&e.jsx(i,{variant:"info",size:"md",title:t("showPage.generationMethod"),children:K(p)}),v.map(a=>e.jsx(i,{variant:"primary",size:"md",title:t("showPage.source"),children:Y(String(a))},String(a)))]})]})]})]})}function o({icon:t,children:d}){return e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("span",{className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-slate-100 text-slate-500 dark:bg-white/[0.06] dark:text-slate-400",children:t}),e.jsx("h2",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:d})]})}export{le 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.