1import{a as A}from"./chunk-RX4HRYSW.js";import{a as I}from"./chunk-HYXPAYDZ.js";import{b as L}from"./chunk-GGY6QDTV.js";import"./chunk-5IJU7MQ2.js";import"./chunk-LM6BYTWK.js";import"./chunk-7DHSGR33.js";import"./chunk-4MYWE7CD.js";import{i as k,n as O}from"./chunk-EWPP756Y.js";import"./chunk-I5EQON52.js";import"./chunk-G6PWMA7J.js";import{Jd as S,Qb as s,Rb as t,Sb as e,Tb as b,Wc as P,ac as _,cc as f,db as a,ec as p,fd as y,mb as g,oa as w,oc as v,pa as x,sb as u,sc as n,tc as d,uc as C,wd as E,xd as M,yb as c}from"./chunk-IQ6SK2BU.js";import"./chunk-FE7444LI.js";import"./chunk-OXDKANHF.js";import"./chunk-XUHYVR5R.js";function T(o,l){if(o&1&&(t(0,"div",19),n(1),e()),o&2){let i=p();a(),C(" ",i.errorMessage,` 2`)}}function D(o,l){o&1&&(t(0,"span",25),n(1," Draft "),e())}function F(o,l){o&1&&(t(0,"span",26),n(1,"Published"),e())}function G(o,l){if(o&1&&(t(0,"div"),n(1),e()),o&2){let i=p().$implicit;a(),d(i.lastEditorEmail)}}function j(o,l){if(o&1){let i=_();t(0,"tr",20),f("click",function(){let r=w(i).$implicit,h=p();return x(h.openGemini(r))}),t(1,"td")(2,"div",21),n(3),e(),t(4,"div",22),n(5),e(),t(6,"code",23),n(7),e()(),t(8,"td"),c(9,D,2,0,"span",24)(10,F,2,0,"ng-template",null,0,P),e(),t(12,"td",22)(13,"div"),n(14),e(),c(15,G,2,1,"div",15),e(),t(16,"td",22),n(17),e(),t(18,"td",22),n(19),e()()}if(o&2){let i=l.$implicit,m=v(11),r=p();a(3),d(i.title),a(2),d(i.description),a(2),d(i.key),a(2),s("ngIf",i.hasUnpublishedChanges)("ngIfElse",m),a(5),d(r.relative(i.draftUpdatedAt)),a(),s("ngIf",i.lastEditorEmail),a(2),d(r.relative(i.publishedAt)),a(2),d(i.versionCount)}}function R(o,l){o&1&&(t(0,"tr")(1,"td",27),n(2," No Gemini prompts. Run scripts/gemini-prompts.sql then restart the backend to seed. "),e()())}function $(o,l){o&1&&(t(0,"tr")(1,"td",27),n(2," Loading\u2026 "),e()())}var K=(()=>{class o{constructor(i,m,r){this.adminPrompts=i,this.router=m,this.cdr=r,this.isLoading=!0,this.errorMessage=null,this.geminiPrompts=[]}ngOnInit(){this.refresh()}refresh(){this.isLoading=!0,this.errorMessage=null,this.cdr.markForCheck(),this.adminPrompts.listGemini().subscribe({next:i=>{this.geminiPrompts=i,this.isLoading=!1,this.cdr.markForCheck()},error:()=>{this.errorMessage="Couldn't load Gemini prompts. Has scripts/gemini-prompts.sql been applied?",this.isLoading=!1,this.cdr.markForCheck()}})}openGemini(i){this.router.navigate(["/v2/admin/prompts/gemini",i.key])}openLegacy(){this.router.navigate(["/v2/admin/prompts/legacy"])}relative(i){if(!i)return"never";let m=L(i);if(!m)return"\u2014";let r=(Date.now()-m.getTime())/1e3;return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<30*86400?`${Math.floor(r/86400)}d ago`:m.toLocaleDateString()}static{this.\u0275fac=function(m){return new(m||o)(g(A),g(k),g(y))}}static{this.\u0275cmp=u({type:o,selectors:[["app-admin-prompts-list"]],decls:49,vars:5,consts:[["publishedBadge",""],[1,"tw-flex","tw-items-center","tw-justify-between","tw-mb-6"],[1,"tw-text-xl","tw-font-semibold","tw-text-mech-dark","tw-m-0"],[1,"tw-text-sm","tw-text-mech-dark-500","tw-m-0","tw-mt-1"],["type","button",1,"tw-inline-flex","tw-items-center","tw-gap-2","tw-px-3","tw-h-10","tw-rounded-lg","tw-text-sm","tw-font-medium","tw-bg-mech-surface","tw-text-mech-dark","tw-border","tw-border-mech-border-strong","hover:tw-border-mech-primary","tw-cursor-pointer","disabled:tw-opacity-60",3,"click","disabled"],[1,"tw-w-4","tw-h-4","tw-flex","tw-items-center","tw-justify-center","tw-text-mech-primary"],["name","refresh"],["class","error-banner tw-mb-4 tw-p-3 tw-rounded-lg tw-text-sm",4,"ngIf"],[1,"tw-mb-8"],[1,"tw-mb-3"],[1,"tw-text-sm","tw-font-semibold","tw-uppercase","tw-tracking-widest","tw-text-mech-text-secondary","tw-m-0"],[1,"tw-text-xs","tw-text-mech-dark-500","tw-m-0","tw-mt-1"],[1,"tw-bg-mech-surface","tw-rounded-2xl","tw-border","tw-border-mech-border","tw-shadow-sm","tw-overflow-hidden"],[1,"prompts-table","tw-w-full"],[3,"click",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"legacy-card","tw-bg-mech-surface","tw-rounded-2xl","tw-border","tw-border-mech-border","tw-shadow-sm","tw-p-5","tw-flex","tw-items-center","tw-justify-between","tw-cursor-pointer",3,"click"],[1,"tw-text-sm","tw-font-medium","tw-text-mech-dark","tw-m-0"],[1,"tw-text-mech-primary","tw-text-sm","tw-font-medium"],[1,"error-banner","tw-mb-4","tw-p-3","tw-rounded-lg","tw-text-sm"],[3,"click"],[1,"tw-text-sm","tw-font-medium","tw-text-mech-dark"],[1,"tw-text-xs","tw-text-mech-dark-500"],[1,"tw-text-[11px]","tw-text-mech-text-muted"],["class","badge badge-draft",4,"ngIf","ngIfElse"],[1,"badge","badge-draft"],[1,"badge","badge-published"],["colspan","5",1,"tw-text-center","tw-py-12","tw-text-sm","tw-text-mech-dark-500"]],template:function(m,r){m&1&&(t(0,"div",1)(1,"div")(2,"h2",2),n(3,"Prompts"),e(),t(4,"p",3),n(5," Edit the AI system prompts that drive every Gemini-powered feature, plus the legacy chat templates. "),e()(),t(6,"button",4),f("click",function(){return r.refresh()}),t(7,"span",5),b(8,"app-admin-icon",6),e(),n(9," Refresh "),e()(),c(10,T,2,1,"div",7),t(11,"section",8)(12,"header",9)(13,"h3",10),n(14," Gemini system prompts "),e(),t(15,"p",11),n(16," Active in production. Edits go to a draft until you Publish; the cache invalidates within 5 min. "),e()(),t(17,"div",12)(18,"table",13)(19,"thead")(20,"tr")(21,"th"),n(22,"Prompt"),e(),t(23,"th"),n(24,"Status"),e(),t(25,"th"),n(26,"Last edited"),e(),t(27,"th"),n(28,"Last published"),e(),t(29,"th"),n(30,"Versions"),e()()(),t(31,"tbody"),c(32,j,20,9,"tr",14)(33,R,3,0,"tr",15)(34,$,3,0,"tr",15),e()()()(),t(35,"section")(36,"header",9)(37,"h3",10),n(38," Legacy ChatGPT templates "),e(),t(39,"p",11),n(40," Used by the v1 chat path. Most v2 features are on Gemini now \u2014 these mostly exist for historical edge cases. "),e()(),t(41,"div",16),f("click",function(){return r.openLegacy()}),t(42,"div")(43,"p",17),n(44,"Legacy chat prompt"),e(),t(45,"p",11),n(46," Off-topic response, similar cases, step clarification, repair steps, language, find trim, determine category. "),e()(),t(47,"span",18),n(48,"Open editor \u2192"),e()()()),m&2&&(a(6),s("disabled",r.isLoading),a(4),s("ngIf",r.errorMessage),a(22),s("ngForOf",r.geminiPrompts),a(),s("ngIf",!r.isLoading&&r.geminiPrompts.length===0),a(),s("ngIf",r.isLoading&&r.geminiPrompts.length===0))},dependencies:[S,E,M,O,I],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block}.error-banner[_ngcontent-%COMP%]{background:rgb(var(--color-danger-rgb)/.1);color:var(--color-danger-text);border:1px solid rgb(var(--color-danger-rgb)/.28)}.prompts-table[_ngcontent-%COMP%]{border-collapse:collapse}.prompts-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-faint);font-weight:600;padding:12px 16px;background:var(--color-surface-2);border-bottom:1px solid var(--color-border-strong)}.prompts-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:12px 16px;border-bottom:1px solid var(--color-border);vertical-align:top}.prompts-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{cursor:pointer;transition:background-color .1s ease}.prompts-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:var(--color-surface-2)}.prompts-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}.badge.badge-draft[_ngcontent-%COMP%]{background:rgb(var(--color-warning-rgb)/.16);color:var(--color-warning-text)}.badge.badge-published[_ngcontent-%COMP%]{background:rgb(var(--color-success-rgb)/.12);color:var(--color-success-text)}.legacy-card[_ngcontent-%COMP%]{transition:border-color .1s ease}.legacy-card[_ngcontent-%COMP%]:hover{border-color:var(--color-primary)}'],changeDetection:0})}}return o}
2)();export{K as AdminPromptsListComponent};
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.