1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[253],{14413:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(95551).A)("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]])},20167:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(95551).A)("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]])},26952:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(95551).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},33673:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(95551).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},79734:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/publish/pro-prompt/[publishId]",function(){return a(82126)}])},82126:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>T});var r=a(37876),s=a(14232),d=a(95313),l=a(63480),i=a(33673),n=a(92297),o=a(43275),x=a(26952),c=a(20167),h=a(14413),m=a(2580),b=a(31777),u=a(89099),p=a(25418),g=a(27802),y=a(24948),v=a(10953),k=a(41928),w=a(87876),f=a(59470),j=a(96886),N=a(24755);let A={title:"Untitled",description:"",sharedBy:"",date:"",time:"",models:[],variables:[],fileData:[],promptText:"",outputs:[]},M=e=>{let{content:t}=e,{t:a}=(0,N.Bd)("pro-prompt"),s=(null!=t?t:"").trim();return s?(0,r.jsx)("div",{className:"prose max-w-none text-gray-800 dark:text-white/80",children:(0,r.jsx)(y.oz,{remarkPlugins:[v.A,k.A],rehypePlugins:[w.A,f.A],components:{div:e=>{let{className:t,children:a,...s}=e;return"model-output-section"===t?(0,r.jsx)("div",{className:"mb-10 border-b border-gray-200 dark:border-white/10 last:border-0 pb-8",...s,children:a}):(0,r.jsx)("div",{className:t,...s,children:a})},h1:e=>(0,r.jsx)("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white/90 mb-4 mt-6",...e}),h2:e=>(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-900 dark:text-white/90 mb-3 mt-5",...e}),h3:e=>(0,r.jsx)("h3",{className:"text-lg font-bold text-gray-800 dark:text-white/80 mb-2 mt-4",...e}),p:e=>(0,r.jsx)("p",{className:"text-sm leading-relaxed text-gray-700 dark:text-white/70 mb-4",...e}),table:e=>(0,r.jsx)("div",{className:"overflow-hidden border border-gray-200 dark:border-white/10 rounded-lg my-6",children:(0,r.jsx)("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-white/10",...e})}),thead:e=>(0,r.jsx)("thead",{className:"bg-gray-50 dark:bg-white/5",...e}),th:e=>(0,r.jsx)("th",{className:"px-4 py-3 text-left text-xs font-semibold text-gray-600 dark:text-white/50 uppercase tracking-wider border-b border-gray-200 dark:border-white/10",...e}),tr:e=>(0,r.jsx)("tr",{className:"bg-white dark:bg-transparent border-b border-gray-100 dark:border-white/5 last:border-0 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors",...e}),td:e=>(0,r.jsx)("td",{className:"px-4 py-3 text-sm text-gray-700 dark:text-white/70 whitespace-pre-wrap",...e}),ul:e=>(0,r.jsx)("ul",{className:"list-disc list-inside mb-4 text-sm text-gray-700 dark:text-white/70 space-y-1",...e}),ol:e=>(0,r.jsx)("ol",{className:"list-decimal list-inside mb-4 text-sm text-gray-700 dark:text-white/70 space-y-1",...e}),code:e=>{var t,a;let{className:s,children:d,...l}=e;return(null===(a=l.node)||void 0===a?void 0:null===(t=a.position)||void 0===t?void 0:t.start.line)?(0,r.jsx)("div",{className:"bg-gray-50 dark:bg-[#1e1e1b] border border-gray-200 dark:border-white/10 rounded-lg p-4 my-4 overflow-x-auto",children:(0,r.jsx)("code",{className:"text-sm font-mono text-gray-800 dark:text-white/80",...l,children:d})}):(0,r.jsx)("code",{className:"bg-gray-100 dark:bg-white/10 text-red-600 dark:text-orange-400 px-1 py-0.5 rounded text-xs font-mono",...l,children:d})},blockquote:e=>(0,r.jsx)("blockquote",{className:"border-l-4 border-gray-300 dark:border-white/20 pl-4 italic text-gray-600 dark:text-white/50 my-4",...e})},children:s})}):(0,r.jsx)("div",{className:"text-sm text-gray-500 dark:text-white/40 italic",children:a("published.noContent")})},T=()=>{let{t:e,i18n:t}=(0,N.Bd)("pro-prompt"),a=(0,u.useRouter)(),{publishId:y}=a.query,v=(0,b.d4)(e=>
1e.user),[k,w]=(0,s.useState)(!1),[f,T]=(0,s.useState)(!1),z=(0,s.useRef)(!1),[C,P]=(0,s.useState)(A);(0,s.useEffect)(()=>{y&&"string"==typeof y&&(async()=>{try{w(!0);let e=await (0,p.Ld)("PROMPT",y);P(E(e))}catch(e){console.error("Failed to load shared pro prompt:",e),P(A)}finally{w(!1)}})()},[y,null==v?void 0:v.token]);let S=async()=>{if(!z.current)try{if(!(null==v?void 0:v.token)){y&&(sessionStorage.setItem("pendingPublishId",String(y)),sessionStorage.setItem("pendingPublishType","PROMPT")),a.push("/login");return}z.current=!0,T(!0);let e=await (0,p.mB)("PROMPT",y,v.token),t=window.location.origin;a.push("".concat(t,"/pro-prompt/").concat(e.data))}catch(e){console.error("Customize failed:",e),z.current=!1,T(!1)}},E=a=>{var r,s,d,l,i,n,o,x,c,h,m,b;let u=(()=>{try{var e;let t=null==a?void 0:null===(e=a.data)||void 0===e?void 0:e.report;if(!t)return[];return"string"==typeof t?JSON.parse(t):t}catch(e){return[]}})(),p=Array.isArray(null==a?void 0:null===(r=a.data)||void 0===r?void 0:r.aiModels)?a.data.aiModels:[],g=null!==(x=null==u?void 0:u.map(e=>e.modelName||e.model).filter(Boolean))&&void 0!==x?x:[],y=p.length>0?p:g,v=null!==(c=null==u?void 0:u.map(t=>({modelName:t.modelName||t.model||e("published.fallbackModel"),content:t.output_text||t.output||t.content||""})))&&void 0!==c?c:[],k=Array.isArray(null==a?void 0:null===(s=a.data)||void 0===s?void 0:s.fileData)?a.data.fileData.map(e=>({fileName:e.fileName||e.name,fileLink:e.link||e.url})):[],w=(null==a?void 0:null===(d=a.data)||void 0===d?void 0:d.updatedAt)?new Date(a.data.updatedAt):null;return{title:null!==(h=null==a?void 0:null===(l=a.data)||void 0===l?void 0:l.name)&&void 0!==h?h:e("published.untitled"),description:null!==(m=null==a?void 0:null===(i=a.data)||void 0===i?void 0:i.description)&&void 0!==m?m:"",sharedBy:"",date:w?w.toLocaleDateString(t.language):"",time:w?w.toLocaleTimeString(t.language,{hour:"2-digit",minute:"2-digit"}):"",models:y,variables:Object.entries((null==a?void 0:null===(n=a.data)||void 0===n?void 0:n.variables)||{}).map(t=>{let[a,r]=t;return{name:a,value:String(null!=r?r:""),placeholder:e("published.variablePlaceholder",{name:a})}}),fileData:k,promptText:null!==(b=null==a?void 0:null===(o=a.data)||void 0===o?void 0:o.prompt)&&void 0!==b?b:"",outputs:v}},{categoryText:D,tagsText:_,baseDesc:L}=(()=>{let e=C.description||"",t="",a="",r=e.match(/^Category: (.+?)(\n|$)/m);r&&(t=r[0].replace("Category:","").trim(),e=e.replace(/Category: .+?(\n\n?|$)/,""));let s=e.match(/^Tags: (.+?)(\n|$)/m);return s&&(a=s[0].replace("Tags:","").trim(),e=e.replace(/Tags: .+?(\n\n?|$)/,"")),{categoryText:t,tagsText:a,baseDesc:e.trim()}})();return(0,r.jsxs)("div",{className:"flex h-screen w-full bg-[#faf9f6] dark:bg-[#1a1a18] font-sans",children:[(0,r.jsx)(g.A,{sharedContentType:"proPrompt"}),(0,r.jsxs)("div",{className:"flex h-screen w-full overflow-hidden flex-col",children:[(0,r.jsxs)("header",{className:"sticky top-0 z-20 bg-[#faf9f6] dark:bg-[#1e1e1b] border-b border-gray-200 dark:border-white/10 px-6 py-3 flex items-center justify-between shadow-sm",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold text-gray-800 dark:text-white/90",children:e("published.promptCreation")}),(0,r.jsx)("div",{className:"flex gap-2",children:(0,r.jsxs)("button",{onClick:S,disabled:f,className:"inline-flex ml-auto items-center gap-2 px-4 py-2 rounded-lg bg-gray-900 dark:bg-orange-500 hover:bg-gray-800 dark:hover:bg-orange-600 text-white text-sm font-medium transition-colors mr-4 disabled:opacity-50 disabled:cursor-not-allowed",children:[f?(0,r.jsx)(d.A,{size:16,className:"animate-spin"}):(0,r.jsx)(l.A,{size:16}),e("published.customize")]})})]}),(0,r.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,r.jsxs)("div",{className:"w-1/2 h-full overflow-y-auto p-6 space-y-6 bg-[#faf9f6] dark:bg-[#1a1a18] border-r border-gray-200 dark:border-white/10",children:[(0,r.jsxs)("div",{className:"bg-white dark:bg-[#262624] rounded-xl border border-gray-200 dark:border-white/10 shadow-sm p-6",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2 mb-2",children:[(0,r.jsx)("span",{className:"text-yellow-400 mt-1",children:"â
"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white/90 leading-tight",children:C.title}),(0,r.jsxs)("div",{className:"text-xs text-gray-400 dark:text-white/40 mt-1 flex flex-wrap gap-2 items-center",children:[(0,r.jsx)("span",{children:e("published.newPrompt")}),(0,r.jsx)("span",{children:"â¢"}),(0,r.jsxs)("span",{children:[e("published.modelsLabel")," ",C.models.join(", ")
1]})]})]})]}),(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-white/70 mb-1",children:["Description"," ",(0,r.jsx)("div",{className:"p-1 bg-gray-100 dark:bg-white/10 rounded",children:(0,r.jsx)(i.A,{size:12})})]}),(0,r.jsxs)("div",{className:"text-sm text-gray-600 dark:text-white/60",children:[D&&(0,r.jsxs)("span",{className:"text-gray-500 dark:text-white/40",children:["Category: ",D," |"," "]}),_&&(0,r.jsxs)("span",{className:"text-gray-500 dark:text-white/40",children:["Tags: ",_]}),L&&(0,r.jsx)("p",{className:"mt-1",children:L})]})]})]}),(0,r.jsxs)("div",{className:"bg-white dark:bg-[#262624] rounded-xl border border-gray-200 dark:border-white/10 shadow-sm p-6",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,r.jsx)("h3",{className:"text-base font-semibold text-gray-800 dark:text-white/90",children:e("published.templateVariables")}),(0,r.jsxs)("button",{disabled:!0,style:{cursor:"default"},className:"text-blue-600 dark:text-orange-400 text-sm font-medium flex items-center gap-1 opacity-50 cursor-default",children:[(0,r.jsx)(n.A,{size:14})," Add Variable"]})]}),(0,r.jsxs)("p",{className:"text-xs text-gray-500 dark:text-white/40 mb-4",children:[e("published.variablesHint"),"Variables: ",C.variables.length]}),(0,r.jsx)("div",{className:"space-y-3",children:0===C.variables.length?(0,r.jsx)("div",{className:"text-sm text-gray-400 dark:text-white/30 italic text-center py-2",children:e("published.noVariables")}):C.variables.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-32 flex-shrink-0",children:(0,r.jsx)("div",{className:"px-3 py-2 bg-white dark:bg-[#1e1e1b] border border-gray-300 dark:border-white/10 rounded-lg text-sm font-medium text-gray-700 dark:text-white/70 shadow-sm truncate",children:e.name})}),(0,r.jsxs)("div",{className:"flex-1 relative",children:[(0,r.jsx)("input",{disabled:!0,type:"text",value:e.value,placeholder:"Enter ".concat(e.name.toLowerCase(),"..."),className:"w-full px-3 py-2 bg-white dark:bg-[#1e1e1b] border border-gray-300 dark:border-white/10 rounded-lg text-sm text-gray-600 dark:text-white/60 focus:outline-none cursor-default placeholder:text-gray-300 dark:placeholder:text-white/20"}),(0,r.jsx)("button",{style:{cursor:"default"},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-300 dark:text-white/20 pointer-events-none",children:(0,r.jsx)(o.A,{size:14})})]})]},t))})]}),(0,r.jsxs)("div",{className:"bg-white dark:bg-[#262624] rounded-xl border border-gray-200 dark:border-white/10 shadow-sm p-6",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,r.jsxs)("h3",{className:"text-sm font-semibold text-gray-700 dark:text-white/70",children:["Uploaded Files"," ",(0,r.jsx)("span",{className:"text-gray-400 dark:text-white/30 font-normal",children:"(0)"})]}),(0,r.jsxs)("button",{disabled:!0,style:{cursor:"default"},className:"text-blue-600 dark:text-orange-400 text-sm font-medium flex items-center gap-1 opacity-50",children:[(0,r.jsx)(x.A,{size:14})," Upload File"]})]}),(0,r.jsx)("div",{className:"text-xs text-center text-gray-400 dark:text-white/30 py-4 border-b border-gray-100 dark:border-white/10 mb-4",children:e("published.noFiles")}),(0,r.jsxs)("h3",{className:"text-sm font-semibold text-gray-700 dark:text-white/70 mb-3",children:["Saved Files"," ",(0,r.jsxs)("span",{className:"text-gray-400 dark:text-white/30 font-normal",children:["(",C.fileData.length,")"]})]}),(0,r.jsx)("div",{className:"space-y-2",children:C.fileData.length>0?C.fileData.map((t,a)=>(0,r.jsx)("div",{className:"flex items-center justify-between p-2 bg-blue-50 dark:bg-blue-900/20 border border-blue-100 dark:border-blue-500/20 rounded-lg group",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(c.A,{size:16,className:"text-blue-500 dark:text-blue-400 flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm text-blue-700 dark:text-blue-300 truncate",children:t.fileName}
1),(0,r.jsx)("span",{className:"text-[10px] bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-1.5 py-0.5 rounded",children:e("published.savedBadge")})]})},a)):(0,r.jsx)("div",{className:"text-xs text-gray-400 dark:text-white/30 italic",children:e("published.noSavedFiles")})})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2 px-1",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-gray-800 dark:text-white/80",children:e("published.prompt")}),(0,r.jsx)("p",{className:"text-[10px] text-gray-500 dark:text-white/40",children:"Write your instructions and use [variables] for dynamic content"})]}),(0,r.jsxs)("button",{disabled:!0,style:{cursor:"default"},className:"text-blue-600 dark:text-orange-400 text-xs font-medium flex items-center gap-1 px-2 py-1 rounded hover:bg-blue-50 dark:hover:bg-orange-900/20 opacity-70 cursor-not-allowed",children:[(0,r.jsx)(h.A,{size:12})," Enhance Prompt"]})]}),(0,r.jsx)(j.A,{promptText:C.promptText,variables:C.variables,disabledPublishTextArea:!0})]})]}),(0,r.jsxs)("div",{className:"w-1/2 h-full overflow-y-auto bg-white dark:bg-[#1e1e1b] flex flex-col",children:[(0,r.jsxs)("div",{className:"px-8 py-6 border-b border-gray-100 dark:border-white/10 bg-white dark:bg-[#1e1e1b]",children:[(0,r.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,r.jsx)("span",{className:"text-lg font-bold text-gray-800 dark:text-white/90",children:e("published.outputTitle")}),(0,r.jsxs)("button",{style:{cursor:"default"},className:"text-xs border border-gray-300 dark:border-white/10 rounded px-2 py-1 text-gray-600 dark:text-white/50 flex items-center gap-1 hover:bg-gray-50 dark:hover:bg-white/5",children:[(0,r.jsx)(m.A,{size:12})," Copy"]})]}),(0,r.jsxs)("div",{className:"flex items-start gap-2 mb-2",children:[(0,r.jsx)("span",{className:"text-gray-300 dark:text-white/20 mt-1",children:"â
"}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h1",{className:"text-base font-bold text-gray-700 dark:text-white/80 flex items-center gap-2",children:[C.title,(0,r.jsx)("span",{className:"text-gray-400 dark:text-white/30 font-normal text-xs",children:"v"})]}),(0,r.jsxs)("div",{className:"text-[10px] text-gray-500 dark:text-white/40 mt-1",children:[e("published.outputMeta")," ",C.date," ",C.time," ⢠",e("published.modelsLabel")," ",C.models.join(" - ")]})]})]}),(0,r.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-50 dark:border-white/5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-500 dark:text-white/40",children:["Description"," ",(0,r.jsx)("div",{className:"p-0.5 bg-gray-100 dark:bg-white/10 rounded",children:(0,r.jsx)(i.A,{size:10})})]}),(0,r.jsxs)("div",{className:"text-xs text-gray-500 dark:text-white/40 mt-1",children:["Category: ",D||"Business"," | Tags:"," ",_||"#analysis"]})]})]}),(0,r.jsx)("div",{className:"p-8 flex-1",children:k?(0,r.jsxs)("div",{className:"flex justify-center items-center h-40 text-gray-500 dark:text-white/40 gap-2",children:[(0,r.jsx)(d.A,{className:"animate-spin"})," ",e("published.loadingReport")]}):C.outputs.length>0?C.outputs.map((e,t)=>(0,r.jsxs)("div",{className:"mb-12",children:[(0,r.jsx)("h3",{className:"text-xl font-bold text-gray-900 dark:text-white/90 mb-4",children:e.modelName}),(0,r.jsx)(M,{content:e.content})]},t)):(0,r.jsx)("div",{className:"flex flex-col items-center justify-center h-64 text-gray-400 dark:text-white/30 border-2 border-dashed border-gray-100 dark:border-white/10 rounded-xl",children:(0,r.jsx)("p",{children:e("published.noOutput")})})})]})]}),(0,r.jsxs)("div",{className:"bg-white dark:bg-[#1e1e1b] border-t border-gray-200 dark:border-white/10 px-6 py-2 text-[10px] text-gray-500 dark:text-white/40",children:[e("published.selectedModels")," ",C.models.join(", ")]})]})]})}},87113:(e,t,a)=>{"use strict";a.d(t,{D:()=>n});var r=a(14232);let s="darkMode",d="darkmodechange",l=()=>{try{let e=window.localStorage.getItem(s);if(null===e)return!0;return"true"===e}catch(e){return!0}},i=e=>{"undefined"!=typeof document&&document.documentElement.classList.toggle("dark",e)},n=()=>{let[e,t]=(0,r.useState)(l);(0,r.useEffect)(()=>{i(e)},[]),(0,r.useEffect)(()=>{let e=e=>{t(e.detail)};return window.addEventListener(d,e),()=>window.removeEventListener(d,e)},[]);let a=(0,r.useCallback)(e=>{try{window.localStorage.setItem(s,String(e))}catch(e){}i(e),t(e),window.dispatchEvent(new CustomEvent(d,{detail:e}))},[]),n=(0,r.useCallback)(()=>{a(!e)},[e,a]);return{isDark:e,toggle:n,setDark:a}}}},e=>{var t=t=>e(e.s=t);e.O(0,[6593,2333,4948,6304,6455,5810,6886,9845,636,8792],()=>t(79734)),_N_E=e.O()}]);
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.