feat(i18n + export + guide): locale-aware scenarios/debrief; CSV export; how-to-use page

Backend:
- SCENARIOS localized (th/en): scenario preamble + persona tone adaptation follow the
  trainee's locale; start accepts {locale} and stores it on the session; send/auto-finish
  use it so debrief text (why/coaching/turning points) is in the active language.
- /api/analytics/export returns per-trainee finished-session CSV (admin).

Frontend:
- Scenario picker labels localize by i18n.locale.
- New /guide page (non-IT how-to), linked from Training.
- Analytics: date-filter bar uses line icon + 'Download CSV' button (fetch w/ auth).
Rebuilt dist.
This commit is contained in:
Macky
2026-08-08 15:06:48 +07:00
parent aa2eb8dd37
commit 15c60ae400
40 changed files with 302 additions and 107 deletions

View File

@@ -1,4 +1,4 @@
import{k as w,_ as h,l as U,c as r,a as e,m,u as o,j as l,t as n,i as u,w as p,v,D as b,e as f,F as V,q as M,s as k,r as y,o as i,A as C}from"./index-Dv9XjhnS.js";import{U as z}from"./users-CFr5Kj99.js";/**
import{k as w,_ as h,l as U,c as r,a as e,m,u as o,j as l,t as n,i as u,w as p,v,E as b,e as f,F as V,q as M,s as k,r as y,o as i,A as C}from"./index-Dm2VwslH.js";import{U as z}from"./users-ksNXFlzl.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{k as w,_ as h,l as U,c as r,a as e,m,u as o,j as l,t as n,i as u,w as p,v
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const N=w("user-plus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),A={class:"card guide"},B={class:"card",style:{"margin-bottom":"16px"}},D={style:{"margin-top":"0"}},I={class:"row"},j={class:"row",style:{"margin-top":"10px"}},q=["disabled"],F={key:0,class:"error"},S={key:0,class:"card empty-state"},T={style:{flex:"1"}},E={class:"badge"},H={__name:"AdminUsers",setup(P){const c=y([]),d=y(""),t=y({username:"",name:"",password:"",role:"user"});async function g(){c.value=(await k.adminListUsers()).users}async function _(){d.value="";try{await k.adminCreateUser({...t.value}),t.value={username:"",name:"",password:"",role:"user"},await g()}catch(x){d.value=x.message}}return U(g),(x,s)=>(i(),r("div",null,[e("h2",null,[m(o(z),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),l(" "+n(o(u).t("users")),1)]),e("div",A,[e("strong",null,[m(o(L),{size:17,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),s[4]||(s[4]=l(" ",-1))]),s[5]||(s[5]=e("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[e("li",null,[l(" "),e("strong",null," ()"),l(", , ")]),e("li",null,[l(": "),e("strong",null,"user"),l(" = , "),e("strong",null,"admin"),l(" = ")]),e("li",null,[l(" "),e("strong",null,""),l(" + ")])],-1))]),e("div",B,[e("h4",D,[m(o(N),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),l(" "+n(o(u).t("create"))+" "+n(o(u).t("users").toLowerCase()),1)]),e("div",I,[p(e("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>t.value.username=a),placeholder:" ()",style:{flex:"1"}},null,512),[[v,t.value.username]]),p(e("input",{"onUpdate:modelValue":s[1]||(s[1]=a=>t.value.name=a),placeholder:"",style:{flex:"1"}},null,512),[[v,t.value.name]]),p(e("input",{"onUpdate:modelValue":s[2]||(s[2]=a=>t.value.password=a),type:"password",placeholder:"",style:{flex:"1"}},null,512),[[v,t.value.password]])]),e("div",j,[p(e("select",{"onUpdate:modelValue":s[3]||(s[3]=a=>t.value.role=a),style:{flex:"1"}},[...s[6]||(s[6]=[e("option",{value:"user"},"🙂 user ",-1),e("option",{value:"admin"},"🛠 admin ",-1)])],512),[[b,t.value.role]]),e("button",{class:"primary",onClick:_,disabled:!t.value.username||!t.value.password}," "+n(o(u).t("create")),9,q)]),d.value?(i(),r("div",F,n(d.value),1)):f("",!0)]),c.value.length===0?(i(),r("div",S,[...s[7]||(s[7]=[e("strong",null,"",-1),e("span",null,"",-1)])])):f("",!0),(i(!0),r(V,null,M(c.value,a=>(i(),r("div",{class:"card",key:a.id,style:{"margin-bottom":"8px",display:"flex","align-items":"center",gap:"12px"}},[e("strong",T,n(a.name)+" ("+n(a.username)+")",1),e("span",E,n(a.role),1),e("span",{class:C(["badge",a.active?"won":"lost"])},n(a.active?"active":"inactive"),3)]))),128))]))}},K=h(H,[["__scopeId","data-v-924406be"]]);export{K as default};
*/const N=w("user-plus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),A={class:"card guide"},B={class:"card",style:{"margin-bottom":"16px"}},I={style:{"margin-top":"0"}},j={class:"row"},q={class:"row",style:{"margin-top":"10px"}},D=["disabled"],E={key:0,class:"error"},F={key:0,class:"card empty-state"},S={style:{flex:"1"}},T={class:"badge"},H={__name:"AdminUsers",setup(P){const c=y([]),d=y(""),t=y({username:"",name:"",password:"",role:"user"});async function g(){c.value=(await k.adminListUsers()).users}async function _(){d.value="";try{await k.adminCreateUser({...t.value}),t.value={username:"",name:"",password:"",role:"user"},await g()}catch(x){d.value=x.message}}return U(g),(x,s)=>(i(),r("div",null,[e("h2",null,[m(o(z),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),l(" "+n(o(u).t("users")),1)]),e("div",A,[e("strong",null,[m(o(L),{size:17,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),s[4]||(s[4]=l(" ",-1))]),s[5]||(s[5]=e("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[e("li",null,[l(" "),e("strong",null," ()"),l(", , ")]),e("li",null,[l(": "),e("strong",null,"user"),l(" = , "),e("strong",null,"admin"),l(" = ")]),e("li",null,[l(" "),e("strong",null,""),l(" + ")])],-1))]),e("div",B,[e("h4",I,[m(o(N),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),l(" "+n(o(u).t("create"))+" "+n(o(u).t("users").toLowerCase()),1)]),e("div",j,[p(e("input",{"onUpdate:modelValue":s[0]||(s[0]=a=>t.value.username=a),placeholder:" ()",style:{flex:"1"}},null,512),[[v,t.value.username]]),p(e("input",{"onUpdate:modelValue":s[1]||(s[1]=a=>t.value.name=a),placeholder:"",style:{flex:"1"}},null,512),[[v,t.value.name]]),p(e("input",{"onUpdate:modelValue":s[2]||(s[2]=a=>t.value.password=a),type:"password",placeholder:"",style:{flex:"1"}},null,512),[[v,t.value.password]])]),e("div",q,[p(e("select",{"onUpdate:modelValue":s[3]||(s[3]=a=>t.value.role=a),style:{flex:"1"}},[...s[6]||(s[6]=[e("option",{value:"user"},"🙂 user ",-1),e("option",{value:"admin"},"🛠 admin ",-1)])],512),[[b,t.value.role]]),e("button",{class:"primary",onClick:_,disabled:!t.value.username||!t.value.password}," "+n(o(u).t("create")),9,D)]),d.value?(i(),r("div",E,n(d.value),1)):f("",!0)]),c.value.length===0?(i(),r("div",F,[...s[7]||(s[7]=[e("strong",null,"",-1),e("span",null,"",-1)])])):f("",!0),(i(!0),r(V,null,M(c.value,a=>(i(),r("div",{class:"card",key:a.id,style:{"margin-bottom":"8px",display:"flex","align-items":"center",gap:"12px"}},[e("strong",S,n(a.name)+" ("+n(a.username)+")",1),e("span",T,n(a.role),1),e("span",{class:C(["badge",a.active?"won":"lost"])},n(a.active?"active":"inactive"),3)]))),128))]))}},K=h(H,[["__scopeId","data-v-924406be"]]);export{K as default};

View File

@@ -0,0 +1,11 @@
import{k as x,_ as L,l as M,c as p,a as s,m as i,u as a,j as c,t as e,i as n,n as w,w as f,v as b,p as U,e as N,F as R,q as j,s as A,x as B,r as m,f as E,o as y}from"./index-Dm2VwslH.js";import{U as P}from"./users-ksNXFlzl.js";import{P as S}from"./plus-CAyBY_kw.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const D=x("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const k=x("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),O={class:"row",style:{"align-items":"center","margin-bottom":"16px"}},T={style:{margin:"0"}},F={class:"row",style:{"margin-left":"auto",gap:"10px"}},I={class:"users-btn"},W={class:"primary"},q={class:"card filter-bar"},H={class:"muted"},$=["disabled"],G=["disabled"],J={class:"row",style:{gap:"16px",margin:"16px 0"}},K={class:"card stat"},Q={class:"card stat"},X={style:{color:"var(--green)"}},Y={class:"card stat"},Z={style:{color:"var(--red)"}},ss={class:"card stat"},ts={class:"card stat"},es={class:"card"},as={class:"row",style:{"justify-content":"space-between","align-items":"center"}},os={class:"bar"},ls={class:"muted",style:{"font-size":"12px","margin-top":"6px"}},ns={style:{"margin-top":"20px"}},is={key:0,class:"card empty-state"},rs={class:"grid"},ds={class:"row",style:{"justify-content":"space-between"}},cs={class:"muted"},us={class:"row",style:{"margin-top":"10px",gap:"8px"}},vs={class:"badge won"},_s={class:"badge lost"},ps={class:"badge not_tried"},ms={class:"muted",style:{"margin-top":"8px"}},ys={__name:"Analytics",setup(hs){const l=m({overall:{total_sessions:0,wins:0,losses:0,close_rate:0,avg_score:0},trainee_count:0,hardest_personas:[]}),u=m(""),v=m(""),_=m(!1);async function h(){_.value=!0;try{l.value=await A.analytics({from:u.value,to:v.value})}finally{_.value=!1}}function C(){h()}function V(){u.value="",v.value="",h()}async function z(){try{const r=await fetch("/api/analytics/export",{headers:{Authorization:`Bearer ${E.token}`}});if(!r.ok)throw new Error("export failed");const t=await r.blob(),d=URL.createObjectURL(t),o=document.createElement("a");o.href=d,o.download="sales-trainer-results.csv",o.click(),URL.revokeObjectURL(d)}catch(r){alert(r.message)}}return M(h),(r,t)=>{const d=B("router-link");return y(),p("div",null,[s("div",O,[s("div",null,[s("h2",T,[i(a(D),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),c(" "+e(a(n).t("adminOverview")),1)]),t[2]||(t[2]=s("div",{class:"muted",style:{"margin-top":"4px"}},"ภาพรวมผลการฝึกของทีมทั้งหมด — เลือกช่วงเวลาเพื่อดูสถิติ",-1))]),s("div",F,[i(d,{to:"/admin/users"},{default:w(()=>[s("button",I,[i(a(P),{size:18,"stroke-width":2}),c(" "+e(a(n).t("users")),1)])]),_:1}),i(d,{to:"/admin/new-group"},{default:w(()=>[s("button",W,[i(a(S),{size:18,"stroke-width":2}),c(" "+e(a(n).t("addProduct")),1)])]),_:1})])]),s("div",q,[s("span",H,[i(a(k),{size:15,"stroke-width":1.8,style:{"vertical-align":"-2px"}}),c(" "+e(a(n).t("dateRange")),1)]),f(s("input",{type:"date","onUpdate:modelValue":t[0]||(t[0]=o=>u.value=o)},null,512),[[b,u.value]]),t[4]||(t[4]=s("span",null,"",-1)),f(s("input",{type:"date","onUpdate:modelValue":t[1]||(t[1]=o=>v.value=o)},null,512),[[b,v.value]]),s("button",{class:"primary",onClick:C,disabled:_.value},"→ "+e(a(n).t("apply")),9,$),s("button",{onClick:V,disabled:_.value},e(a(n).t("clear")),9,G),s("button",{class:"soft",onClick:z},[i(a(k),{size:16,"stroke-width":1.8}),t[3]||(t[3]=c(" CSV",-1))])]),s("div",J,[s("div",K,[t[5]||(t[5]=s("div",null,"Sessions",-1)),s("strong",null,e(l.value.overall.total_sessions),1)]),s("div",Q,[t[6]||(t[6]=s("div",null,"Wins",-1)),s("strong",X,e(l.value.overall.wins),1)]),s("div",Y,[t[7]||(t[7]=s("div",null,"Losses",-1)),s("strong",Z,e(l.value.overall.losses),1)]),s("div",ss,[t[8]||(t[8]=s("div",null,"Avg score",-1)),s("strong",null,e(l.value.overall.avg_score),1)]),s("div",ts,[t[9]||(t[9]=s("div",null,"Trainees",-1)),s("strong",null,e(l.value.trainee_count),1)])]),s("div",es,[s("div",as,[s("strong",null,e(a(n).t("closeRate")),1),s("strong",null,e(l.value.overall.close_rate)+"%",1)]),s("div",os,[s("div",{class:"bar-fill",style:U({width:(l.value.overall.close_rate||0)+"%"})},null,4)]),s("div",ls,e(l.value.overall.wins)+" "+e(a(n).t("won").toLowerCase())+" / "+e(l.value.overall.total_sessions)+" sessions ",1)]),s("h3",ns,e(a(n).t("hardestPersonas")),1),l.value.hardest_personas.length===0?(y(),p("div",is,[...t[10]||(t[10]=[s("strong",null,"No data",-1),s("span",null,"No sessions in this date range.",-1)])])):N("",!0),s("div",rs,[(y(!0),p(R,null,j(l.value.hardest_personas,(o,g)=>(y(),p("div",{key:g,class:"card lift tier-card"},[s("div",ds,[s("strong",null,e(o.persona_name),1),s("span",cs,"#"+e(g+1),1)]),s("div",us,[s("span",vs,e(o.wins)+"W",1),s("span",_s,e(o.losses)+"L",1),s("span",ps,e(o.plays)+" plays",1)]),s("div",ms,e(a(n).t("score"))+": "+e(o.avg_score),1)]))),128))])])}}},bs=L(ys,[["__scopeId","data-v-6eb0872b"]]);export{bs as default};

View File

@@ -0,0 +1 @@
.stat[data-v-6eb0872b]{text-align:center;min-width:110px}.stat div[data-v-6eb0872b]{color:var(--muted);font-size:12px}.stat strong[data-v-6eb0872b]{font-size:20px}.filter-bar[data-v-6eb0872b]{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.filter-bar input[type=date][data-v-6eb0872b]{width:auto}.grid[data-v-6eb0872b]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.tier-card[data-v-6eb0872b]{display:flex;flex-direction:column}.badge.won[data-v-6eb0872b]{background:#dcfce7;color:#166534}.badge.lost[data-v-6eb0872b]{background:#fee2e2;color:#991b1b}.badge.not_tried[data-v-6eb0872b]{background:#eef2ff;color:#4338ca}.bar[data-v-6eb0872b]{background:#eef0f5;border-radius:999px;height:10px;overflow:hidden;margin-top:10px}.bar-fill[data-v-6eb0872b]{background:linear-gradient(90deg,var(--accent),var(--accent-2));height:100%;border-radius:999px;transition:width .4s ease}.users-btn[data-v-6eb0872b]{display:inline-flex;align-items:center;gap:6px;background:#0ea5e9;border-color:transparent;color:#fff;font-weight:600}.users-btn[data-v-6eb0872b]:not(:disabled):hover{background:#0284c7;box-shadow:0 6px 16px #0ea5e959}

View File

@@ -1 +0,0 @@
.stat[data-v-f2feb744]{text-align:center;min-width:110px}.stat div[data-v-f2feb744]{color:var(--muted);font-size:12px}.stat strong[data-v-f2feb744]{font-size:20px}.filter-bar[data-v-f2feb744]{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.filter-bar input[type=date][data-v-f2feb744]{width:auto}.grid[data-v-f2feb744]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.tier-card[data-v-f2feb744]{display:flex;flex-direction:column}.badge.won[data-v-f2feb744]{background:#dcfce7;color:#166534}.badge.lost[data-v-f2feb744]{background:#fee2e2;color:#991b1b}.badge.not_tried[data-v-f2feb744]{background:#eef2ff;color:#4338ca}.bar[data-v-f2feb744]{background:#eef0f5;border-radius:999px;height:10px;overflow:hidden;margin-top:10px}.bar-fill[data-v-f2feb744]{background:linear-gradient(90deg,var(--accent),var(--accent-2));height:100%;border-radius:999px;transition:width .4s ease}.users-btn[data-v-f2feb744]{display:inline-flex;align-items:center;gap:6px;background:#0ea5e9;border-color:transparent;color:#fff;font-weight:600}.users-btn[data-v-f2feb744]:not(:disabled):hover{background:#0284c7;box-shadow:0 6px 16px #0ea5e959}

View File

@@ -1,6 +0,0 @@
import{k,_ as C,l as V,c as u,a as s,m as i,u as a,j as m,t,i as l,n as h,w as f,v as w,p as z,e as M,F as N,q as L,s as P,x as U,r as v,o as _}from"./index-Dv9XjhnS.js";import{U as j}from"./users-CFr5Kj99.js";import{P as A}from"./plus-Dg6sDA5g.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const B=k("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),S={class:"row",style:{"align-items":"center","margin-bottom":"16px"}},T={style:{margin:"0"}},D={class:"row",style:{"margin-left":"auto",gap:"10px"}},F={class:"users-btn"},I={class:"primary"},R={class:"card filter-bar"},W={class:"muted"},q=["disabled"],E=["disabled"],O={class:"row",style:{gap:"16px",margin:"16px 0"}},G={class:"card stat"},H={class:"card stat"},J={style:{color:"var(--green)"}},K={class:"card stat"},Q={style:{color:"var(--red)"}},X={class:"card stat"},Y={class:"card stat"},Z={class:"card"},$={class:"row",style:{"justify-content":"space-between","align-items":"center"}},ss={class:"bar"},ts={class:"muted",style:{"font-size":"12px","margin-top":"6px"}},es={style:{"margin-top":"20px"}},as={key:0,class:"card empty-state"},os={class:"grid"},ls={class:"row",style:{"justify-content":"space-between"}},ns={class:"muted"},is={class:"row",style:{"margin-top":"10px",gap:"8px"}},rs={class:"badge won"},ds={class:"badge lost"},cs={class:"badge not_tried"},us={class:"muted",style:{"margin-top":"8px"}},vs={__name:"Analytics",setup(_s){const o=v({overall:{total_sessions:0,wins:0,losses:0,close_rate:0,avg_score:0},trainee_count:0,hardest_personas:[]}),r=v(""),d=v(""),c=v(!1);async function p(){c.value=!0;try{o.value=await P.analytics({from:r.value,to:d.value})}finally{c.value=!1}}function b(){p()}function x(){r.value="",d.value="",p()}return V(p),(ps,e)=>{const g=U("router-link");return _(),u("div",null,[s("div",S,[s("div",null,[s("h2",T,[i(a(B),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),m(" "+t(a(l).t("adminOverview")),1)]),e[2]||(e[2]=s("div",{class:"muted",style:{"margin-top":"4px"}},"ภาพรวมผลการฝึกของทีมทั้งหมด — เลือกช่วงเวลาเพื่อดูสถิติ",-1))]),s("div",D,[i(g,{to:"/admin/users"},{default:h(()=>[s("button",F,[i(a(j),{size:18,"stroke-width":2}),m(" "+t(a(l).t("users")),1)])]),_:1}),i(g,{to:"/admin/new-group"},{default:h(()=>[s("button",I,[i(a(A),{size:18,"stroke-width":2}),m(" "+t(a(l).t("addProduct")),1)])]),_:1})])]),s("div",R,[s("span",W,"🗓 "+t(a(l).t("dateRange")),1),f(s("input",{type:"date","onUpdate:modelValue":e[0]||(e[0]=n=>r.value=n)},null,512),[[w,r.value]]),e[3]||(e[3]=s("span",null,"",-1)),f(s("input",{type:"date","onUpdate:modelValue":e[1]||(e[1]=n=>d.value=n)},null,512),[[w,d.value]]),s("button",{class:"primary",onClick:b,disabled:c.value},"→ "+t(a(l).t("apply")),9,q),s("button",{onClick:x,disabled:c.value},t(a(l).t("clear")),9,E)]),s("div",O,[s("div",G,[e[4]||(e[4]=s("div",null,"Sessions",-1)),s("strong",null,t(o.value.overall.total_sessions),1)]),s("div",H,[e[5]||(e[5]=s("div",null,"Wins",-1)),s("strong",J,t(o.value.overall.wins),1)]),s("div",K,[e[6]||(e[6]=s("div",null,"Losses",-1)),s("strong",Q,t(o.value.overall.losses),1)]),s("div",X,[e[7]||(e[7]=s("div",null,"Avg score",-1)),s("strong",null,t(o.value.overall.avg_score),1)]),s("div",Y,[e[8]||(e[8]=s("div",null,"Trainees",-1)),s("strong",null,t(o.value.trainee_count),1)])]),s("div",Z,[s("div",$,[s("strong",null,t(a(l).t("closeRate")),1),s("strong",null,t(o.value.overall.close_rate)+"%",1)]),s("div",ss,[s("div",{class:"bar-fill",style:z({width:(o.value.overall.close_rate||0)+"%"})},null,4)]),s("div",ts,t(o.value.overall.wins)+" "+t(a(l).t("won").toLowerCase())+" / "+t(o.value.overall.total_sessions)+" sessions ",1)]),s("h3",es,t(a(l).t("hardestPersonas")),1),o.value.hardest_personas.length===0?(_(),u("div",as,[...e[9]||(e[9]=[s("strong",null,"No data",-1),s("span",null,"No sessions in this date range.",-1)])])):M("",!0),s("div",os,[(_(!0),u(N,null,L(o.value.hardest_personas,(n,y)=>(_(),u("div",{key:y,class:"card lift tier-card"},[s("div",ls,[s("strong",null,t(n.persona_name),1),s("span",ns,"#"+t(y+1),1)]),s("div",is,[s("span",rs,t(n.wins)+"W",1),s("span",ds,t(n.losses)+"L",1),s("span",cs,t(n.plays)+" plays",1)]),s("div",us,t(a(l).t("score"))+": "+t(n.avg_score),1)]))),128))])])}}},hs=C(vs,[["__scopeId","data-v-f2feb744"]]);export{hs as default};

6
frontend/dist/assets/Chat-C6Malw3d.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
.thread[data-v-4da228fb]{background:#eceff4;border:1px solid var(--border);border-radius:var(--radius);padding:16px;min-height:320px;max-height:52vh;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.bubble[data-v-4da228fb]{max-width:72%;padding:10px 14px;white-space:pre-wrap;word-break:break-word}.msg-system[data-v-4da228fb]{align-self:center;background:#fef3c7;color:#92400e;font-size:12px;max-width:88%;border-radius:999px}.composer[data-v-4da228fb]{display:flex;gap:8px;margin-top:12px}.task[data-v-4da228fb]{margin-bottom:12px;background:#fff7ed;border-color:#fed7aa}.debrief[data-v-4da228fb]{margin-top:16px}button.danger[data-v-4da228fb]{background:var(--red);color:#fff;border:none}.guide[data-v-4da228fb]{background:#eef2ff;border-color:#c7d2fe;margin-bottom:12px}.scenario[data-v-4da228fb]{border:2px solid var(--border);border-radius:12px;padding:12px 14px;margin:10px 0;cursor:pointer;transition:border-color .15s ease,background .15s ease}.scenario[data-v-4da228fb]:hover{border-color:var(--accent)}.scenario.sel[data-v-4da228fb]{border-color:var(--accent);background:#eef2ff}.reveal-grid[data-v-4da228fb]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.rev[data-v-4da228fb]{display:flex;flex-direction:column;background:#f8fafc;border:1px solid var(--border);border-radius:8px;padding:8px 10px}.rk[data-v-4da228fb]{font-size:12px;color:var(--muted)}.rv[data-v-4da228fb]{font-size:13px;color:var(--ink);margin-top:2px}@media (max-width: 640px){.reveal-grid[data-v-4da228fb]{grid-template-columns:1fr}}

View File

@@ -0,0 +1 @@
.thread[data-v-19840301]{background:#eceff4;border:1px solid var(--border);border-radius:var(--radius);padding:16px;min-height:320px;max-height:52vh;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.bubble[data-v-19840301]{max-width:72%;padding:10px 14px;white-space:pre-wrap;word-break:break-word}.msg-system[data-v-19840301]{align-self:center;background:#fef3c7;color:#92400e;font-size:12px;max-width:88%;border-radius:999px}.composer[data-v-19840301]{display:flex;gap:8px;margin-top:12px}.task[data-v-19840301]{margin-bottom:12px;background:#fff7ed;border-color:#fed7aa}.debrief[data-v-19840301]{margin-top:16px}button.danger[data-v-19840301]{background:var(--red);color:#fff;border:none}.guide[data-v-19840301]{background:#eef2ff;border-color:#c7d2fe;margin-bottom:12px}.scenario[data-v-19840301]{border:2px solid var(--border);border-radius:12px;padding:12px 14px;margin:10px 0;cursor:pointer;transition:border-color .15s ease,background .15s ease}.scenario[data-v-19840301]:hover{border-color:var(--accent)}.scenario.sel[data-v-19840301]{border-color:var(--accent);background:#eef2ff}.reveal-grid[data-v-19840301]{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.rev[data-v-19840301]{display:flex;flex-direction:column;background:#f8fafc;border:1px solid var(--border);border-radius:8px;padding:8px 10px}.rk[data-v-19840301]{font-size:12px;color:var(--muted)}.rv[data-v-19840301]{font-size:13px;color:var(--ink);margin-top:2px}@media (max-width: 640px){.reveal-grid[data-v-19840301]{grid-template-columns:1fr}}

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
import{k as g,_ as M,c as f,m as d,n as V,a as e,u as l,j as r,t as s,i as o,w as u,v as y,D as k,e as C,x as z,r as v,s as B,g as A,o as x}from"./index-Dv9XjhnS.js";import{A as P}from"./arrow-left-haz-8IhO.js";/**
import{k as g,_ as M,c as f,m as d,n as V,a as e,u as l,j as r,t as s,i as o,w as u,v as y,E as k,e as C,x as z,r as v,s as B,g as A,o as x}from"./index-Dm2VwslH.js";import{A as P}from"./arrow-left-Cm4VHcqz.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -18,4 +18,4 @@ import{k as g,_ as M,c as f,m as d,n as V,a as e,u as l,j as r,t as s,i as o,w a
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const D=g("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),N={class:"card guide"},E={class:"card"},G={style:{"margin-top":"0"}},L={class:"row"},j={style:{flex:"1"}},F={value:"facebook"},I={value:"line"},O={style:{flex:"1"}},T={value:"th"},R={value:"en"},Z={key:0,class:"error"},$=["disabled"],H={__name:"GroupBuilder",setup(J){const _=A(),a=v({product:"",segment:"",description:"",channel:"facebook",language:"th"}),h=v([]),p=v(""),c=v(!1);function b(n){h.value=Array.from(n.target.files||[])}async function w(){c.value=!0,p.value="";try{const n=new FormData;n.append("product",a.value.product),n.append("segment",a.value.segment),n.append("description",a.value.description),n.append("channel",a.value.channel),n.append("language",a.value.language),h.value.forEach(i=>n.append("files",i));const m=(await B.createGroup(n)).group.id;_.push(`/admin/groups/${m}/edit`)}catch(n){p.value=n.message}finally{c.value=!1}}return(n,t)=>{const m=z("router-link");return x(),f("div",null,[d(m,{to:"/training",class:"btn-back"},{default:V(()=>[d(l(P),{size:16,"stroke-width":2}),r(" "+s(l(o).t("training")),1)]),_:1}),e("div",N,[e("strong",null,[d(l(q),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[5]||(t[5]=r(" ",-1))]),t[6]||(t[6]=e("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[e("li",null,[r(" "),e("strong",null,"/"),r(" ()")]),e("li",null,"() .pdf/.md/.txt"),e("li",null,[r(" "),e("strong",null,""),r(" ()")])],-1))]),e("div",E,[e("h2",G,[d(l(S),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),r(" "+s(l(o).t("addProduct")),1)]),e("label",null,[r(s(l(o).t("product"))+" ",1),t[7]||(t[7]=e("span",{class:"req"},"*",-1))]),u(e("textarea",{"onUpdate:modelValue":t[0]||(t[0]=i=>a.value.product=i),rows:"3",placeholder:" POS Cloud POS for small restaurants"},null,512),[[y,a.value.product]]),e("label",null,s(l(o).t("segment")),1),u(e("input",{"onUpdate:modelValue":t[1]||(t[1]=i=>a.value.segment=i),placeholder:" SMEs "},null,512),[[y,a.value.segment]]),e("label",null,s(l(o).t("description")),1),u(e("textarea",{"onUpdate:modelValue":t[2]||(t[2]=i=>a.value.description=i),rows:"3",placeholder:" ()"},null,512),[[y,a.value.description]]),e("div",L,[e("div",j,[e("label",null,s(l(o).t("channel")),1),u(e("select",{"onUpdate:modelValue":t[3]||(t[3]=i=>a.value.channel=i)},[e("option",F,s(l(o).t("facebook")),1),e("option",I,s(l(o).t("line")),1)],512),[[k,a.value.channel]])]),e("div",O,[e("label",null,s(l(o).t("language")),1),u(e("select",{"onUpdate:modelValue":t[4]||(t[4]=i=>a.value.language=i)},[e("option",T,s(l(o).t("thai")),1),e("option",R,s(l(o).t("english")),1)],512),[[k,a.value.language]])])]),e("label",null,[d(l(D),{size:15,"stroke-width":1.8,style:{"vertical-align":"-2px"}}),t[8]||(t[8]=r(" (.pdf/.md/.txt) ",-1))]),e("input",{type:"file",multiple:"",accept:".pdf,.md,.txt",onChange:b},null,32),p.value?(x(),f("div",Z,s(p.value),1)):C("",!0),e("button",{class:"primary",style:{"margin-top":"16px",display:"inline-flex","align-items":"center",gap:"6px"},disabled:c.value||!a.value.product&&!h.value.length,onClick:w},[d(l(U),{size:18,"stroke-width":2}),r(" "+s(c.value?"":l(o).t("create")),1)],8,$)])])}}},W=M(H,[["__scopeId","data-v-d513596d"]]);export{W as default};
*/const E=g("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),N={class:"card guide"},D={class:"card"},G={style:{"margin-top":"0"}},L={class:"row"},j={style:{flex:"1"}},F={value:"facebook"},I={value:"line"},O={style:{flex:"1"}},T={value:"th"},R={value:"en"},Z={key:0,class:"error"},$=["disabled"],H={__name:"GroupBuilder",setup(J){const _=A(),a=v({product:"",segment:"",description:"",channel:"facebook",language:"th"}),h=v([]),p=v(""),c=v(!1);function b(n){h.value=Array.from(n.target.files||[])}async function w(){c.value=!0,p.value="";try{const n=new FormData;n.append("product",a.value.product),n.append("segment",a.value.segment),n.append("description",a.value.description),n.append("channel",a.value.channel),n.append("language",a.value.language),h.value.forEach(i=>n.append("files",i));const m=(await B.createGroup(n)).group.id;_.push(`/admin/groups/${m}/edit`)}catch(n){p.value=n.message}finally{c.value=!1}}return(n,t)=>{const m=z("router-link");return x(),f("div",null,[d(m,{to:"/training",class:"btn-back"},{default:V(()=>[d(l(P),{size:16,"stroke-width":2}),r(" "+s(l(o).t("training")),1)]),_:1}),e("div",N,[e("strong",null,[d(l(q),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[5]||(t[5]=r(" ",-1))]),t[6]||(t[6]=e("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[e("li",null,[r(" "),e("strong",null,"/"),r(" ()")]),e("li",null,"() .pdf/.md/.txt"),e("li",null,[r(" "),e("strong",null,""),r(" ()")])],-1))]),e("div",D,[e("h2",G,[d(l(S),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),r(" "+s(l(o).t("addProduct")),1)]),e("label",null,[r(s(l(o).t("product"))+" ",1),t[7]||(t[7]=e("span",{class:"req"},"*",-1))]),u(e("textarea",{"onUpdate:modelValue":t[0]||(t[0]=i=>a.value.product=i),rows:"3",placeholder:" POS Cloud POS for small restaurants"},null,512),[[y,a.value.product]]),e("label",null,s(l(o).t("segment")),1),u(e("input",{"onUpdate:modelValue":t[1]||(t[1]=i=>a.value.segment=i),placeholder:" SMEs "},null,512),[[y,a.value.segment]]),e("label",null,s(l(o).t("description")),1),u(e("textarea",{"onUpdate:modelValue":t[2]||(t[2]=i=>a.value.description=i),rows:"3",placeholder:" ()"},null,512),[[y,a.value.description]]),e("div",L,[e("div",j,[e("label",null,s(l(o).t("channel")),1),u(e("select",{"onUpdate:modelValue":t[3]||(t[3]=i=>a.value.channel=i)},[e("option",F,s(l(o).t("facebook")),1),e("option",I,s(l(o).t("line")),1)],512),[[k,a.value.channel]])]),e("div",O,[e("label",null,s(l(o).t("language")),1),u(e("select",{"onUpdate:modelValue":t[4]||(t[4]=i=>a.value.language=i)},[e("option",T,s(l(o).t("thai")),1),e("option",R,s(l(o).t("english")),1)],512),[[k,a.value.language]])])]),e("label",null,[d(l(E),{size:15,"stroke-width":1.8,style:{"vertical-align":"-2px"}}),t[8]||(t[8]=r(" (.pdf/.md/.txt) ",-1))]),e("input",{type:"file",multiple:"",accept:".pdf,.md,.txt",onChange:b},null,32),p.value?(x(),f("div",Z,s(p.value),1)):C("",!0),e("button",{class:"primary",style:{"margin-top":"16px",display:"inline-flex","align-items":"center",gap:"6px"},disabled:c.value||!a.value.product&&!h.value.length,onClick:w},[d(l(U),{size:18,"stroke-width":2}),r(" "+s(c.value?"":l(o).t("create")),1)],8,$)])])}}},W=M(H,[["__scopeId","data-v-d513596d"]]);export{W as default};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
import{k as e,c as o,a as l,m as n,u as i,j as s,t as r,i as a,D as u,o as d}from"./index-Dm2VwslH.js";import{B as g}from"./book-open-x8tSBc1t.js";import{L as p}from"./layout-dashboard-LQG3ldGP.js";import{T as m}from"./target-CliUY7kC.js";import{S as y}from"./sparkles-BXnC3-RA.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h=e("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),k={class:"card"},v={style:{"margin-top":"0"}},x={class:"card"},f={style:{"margin-top":"0"}},c={class:"card"},w={style:{"margin-top":"0"}},z={class:"card"},_={style:{"margin-top":"0"}},b={__name:"Guide",setup(B){return(S,t)=>(d(),o("div",null,[l("h2",null,[n(i(g),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),s(" "+r(i(a).t("guideTitle")),1)]),t[8]||(t[8]=l("p",{class:"muted"},"คู่มือสั้นๆ สำหรับพนักงานใหม่ — เข้าใจระบบได้ใน 5 นาที",-1)),l("div",k,[l("h3",v,[n(i(p),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[0]||(t[0]=s(" 1. หน้า 3 แท็บ (menu ด้านบน)",-1))]),t[1]||(t[1]=l("ul",{style:{"line-height":"1.9"}},[l("li",null,[l("strong",null,"ภาพรวมผู้ดูแล"),s(" — เฉพาะ admin ดูสถิติผลการฝึกของทีม + กรองตามช่วงเวลา")]),l("li",null,[l("strong",null,"ภาพรวมผลการฝึก"),s(" — ของตัวคุณเอง: ชนะ/แพ้/ยังไม่ได้ฝึก")]),l("li",null,[l("strong",null,"การฝึก"),s(" — เลือกสินค้า → เลือกลูกค้า (บุคคลต้นแบบ) → เริ่มแชท")]),l("li",null,[l("strong",null,"การตั้งค่า (⚙︎)"),s(" — แก้ชื่อ/อีเมล, เปลี่ยนรหัสผ่าน, เปลี่ยนภาษา")])],-1))]),l("div",x,[l("h3",f,[n(i(m),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[2]||(t[2]=s(" 2. วิธีฝึก (start a session)",-1))]),t[3]||(t[3]=l("ol",{style:{"line-height":"1.9","padding-left":"20px"}},[l("li",null,[s("เข้าแท็บ "),l("strong",null,"การฝึก"),s(" → เลือกสินค้าที่อยากฝึก")]),l("li",null,"เลือกลูกค้า (บุคคลต้นแบบ) — ระดับ A ง่ายสุด / C ยากสุด (ดูดาวความยาก)"),l("li",null,[s("เลือก "),l("strong",null,"สถานการณ์"),s(": โซเชียล (ลูกค้าทักก่อน) / พบหน้า-โทร (คุณทักก่อน) / กลับมาติดต่อ")]),l("li",null,"แชทกับลูกค้า — ฝึกปิดการขาย ลูกค้าจะตัดสินใจเองว่าซื้อหรือไม่ซื้อ"),l("li",null,"หลังจบ ดูผล + ข้อเสนอแนะ + ข้อมูลลูกค้าที่ถูกซ่อนไว้")],-1))]),l("div",c,[l("h3",w,[n(i(y),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[4]||(t[4]=s(" 3. เคล็ดลับ",-1))]),t[5]||(t[5]=l("ul",{style:{"line-height":"1.9"}},[l("li",null,[s('ลูกค้าแต่ละคน หรือ "บุคคลต้นแบบ" ฝึกได้ '),l("strong",null,"คนละครั้ง"),s(" (one-shot) — ฝึกจนจบแล้วลองคนอื่น")]),l("li",null,"ถ้าออกกลางคัน กลับมาได้ คุยต่อจากเดิม (ยังไม่นับว่าจบ)"),l("li",null,"ปิดการขาย = แก้ปัญหาจริงของลูกค้า + รับมือข้อโต้แย้ง + ปิดราคา")],-1))]),l("div",z,[l("h3",_,[n(i(h),{size:18,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),t[6]||(t[6]=s(" 4. สำหรับ Admin",-1))]),t[7]||(t[7]=u('<ul style="line-height:1.9;"><li>ปุ่ม <strong>เพิ่มสินค้า</strong> (หน้า การฝึก) → สร้างกลุ่มบุคคลต้นแบบใหม่</li><li>หน้า <strong>จัดการบุคคลต้นแบบ</strong> → แก้ไขรายละเอียดลูกค้าแต่ละคน แล้วเปิดใช้งาน</li><li>หน้า <strong>ผู้ใช้งาน</strong> → สร้างบัญชีให้ทีม (username + รหัสผ่านเริ่มต้น)</li><li>ปุ่ม <strong>CSV</strong> (หน้า ภาพรวม) → ดาวน์โหลดผลการฝึกทั้งหมด</li></ul>',1))])]))}};export{b as default};

View File

@@ -1 +1 @@
import{_ as b,c as d,a as e,t as s,u as c,i as o,w as y,v as x,b as w,d as k,e as S,r as l,f,g as V,h as B,o as v}from"./index-Dv9XjhnS.js";const C={class:"login-wrap"},D={class:"card login-card"},K={class:"pw-wrap"},E=["type"],L=["aria-label"],M={key:0,class:"error",role:"alert"},N=["disabled"],R={key:0,class:"spinner"},U={key:1},q={__name:"Login",setup(H){const g=B(),_=V(),n=l(""),u=l(""),a=l(!1),r=l(""),i=l(!1);async function m(){r.value="",i.value=!0;try{await f.login(n.value.trim(),u.value),f.mustSetup?_.push({path:"/setup"}):_.push(g.query.redirect||"/")}catch{r.value=o.t("loginError")}finally{i.value=!1}}return(h,t)=>(v(),d("div",C,[e("div",D,[e("h1",null,"🎯 "+s(c(o).t("app")),1),t[3]||(t[3]=e("p",{class:"muted",style:{"margin-top":"-8px"}},"Sales training simulator",-1)),e("label",null,s(c(o).t("username")),1),y(e("input",{"onUpdate:modelValue":t[0]||(t[0]=p=>n.value=p),type:"text",autocomplete:"username",onKeyup:w(m,["enter"])},null,544),[[x,n.value]]),e("label",null,s(c(o).t("password")),1),e("div",K,[y(e("input",{"onUpdate:modelValue":t[1]||(t[1]=p=>u.value=p),type:a.value?"text":"password",autocomplete:"current-password",onKeyup:w(m,["enter"])},null,40,E),[[k,u.value]]),e("button",{type:"button",class:"pw-toggle",onClick:t[2]||(t[2]=p=>a.value=!a.value),"aria-label":a.value?"Hide password":"Show password"},s(a.value?"🙈":"👁"),9,L)]),r.value?(v(),d("div",M,s(r.value),1)):S("",!0),e("button",{class:"primary",style:{width:"100%","margin-top":"16px"},disabled:i.value||!n.value||!u.value,onClick:m},[i.value?(v(),d("span",R)):(v(),d("span",U,s(c(o).t("login")),1))],8,N)])]))}},P=b(q,[["__scopeId","data-v-f7904d9f"]]);export{P as default};
import{_ as b,c as d,a as e,t as s,u as c,i as o,w as y,v as x,b as w,d as k,e as S,r as l,f,g as V,h as B,o as v}from"./index-Dm2VwslH.js";const C={class:"login-wrap"},D={class:"card login-card"},K={class:"pw-wrap"},E=["type"],L=["aria-label"],M={key:0,class:"error",role:"alert"},N=["disabled"],R={key:0,class:"spinner"},U={key:1},q={__name:"Login",setup(H){const g=B(),_=V(),n=l(""),u=l(""),a=l(!1),r=l(""),i=l(!1);async function m(){r.value="",i.value=!0;try{await f.login(n.value.trim(),u.value),f.mustSetup?_.push({path:"/setup"}):_.push(g.query.redirect||"/")}catch{r.value=o.t("loginError")}finally{i.value=!1}}return(h,t)=>(v(),d("div",C,[e("div",D,[e("h1",null,"🎯 "+s(c(o).t("app")),1),t[3]||(t[3]=e("p",{class:"muted",style:{"margin-top":"-8px"}},"Sales training simulator",-1)),e("label",null,s(c(o).t("username")),1),y(e("input",{"onUpdate:modelValue":t[0]||(t[0]=p=>n.value=p),type:"text",autocomplete:"username",onKeyup:w(m,["enter"])},null,544),[[x,n.value]]),e("label",null,s(c(o).t("password")),1),e("div",K,[y(e("input",{"onUpdate:modelValue":t[1]||(t[1]=p=>u.value=p),type:a.value?"text":"password",autocomplete:"current-password",onKeyup:w(m,["enter"])},null,40,E),[[k,u.value]]),e("button",{type:"button",class:"pw-toggle",onClick:t[2]||(t[2]=p=>a.value=!a.value),"aria-label":a.value?"Hide password":"Show password"},s(a.value?"🙈":"👁"),9,L)]),r.value?(v(),d("div",M,s(r.value),1)):S("",!0),e("button",{class:"primary",style:{width:"100%","margin-top":"16px"},disabled:i.value||!n.value||!u.value,onClick:m},[i.value?(v(),d("span",R)):(v(),d("span",U,s(c(o).t("login")),1))],8,N)])]))}},P=b(q,[["__scopeId","data-v-f7904d9f"]]);export{P as default};

View File

@@ -1,6 +0,0 @@
import{k as x,_ as f,l as k,s as p,c as r,a as t,m as b,u as e,j as B,t as s,i as a,e as v,w as N,y as D,F as S,q as T,r as h,z as c,o as i,A as V}from"./index-Dv9XjhnS.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const z=x("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),L={style:{margin:"0"}},M={key:0,class:"row stat-row"},j={class:"card stat"},C={class:"card stat won"},F={class:"card stat lost"},I={class:"card stat"},q={key:1,class:"card"},A={key:2,class:"card empty-state"},E={class:"card",style:{"margin-top":"20px"}},G={style:{"margin-top":"0"}},H={__name:"MyBoard",setup(J){const o=h([]),u=h([]),y=h(!0),m=c(()=>o.value.length),_=c(()=>o.value.filter(n=>n.my_outcome==="won").length),g=c(()=>o.value.filter(n=>n.my_outcome==="lost").length),w=c(()=>o.value.filter(n=>n.my_outcome==="not_tried").length);return k(async()=>{try{o.value=(await p.myBoard()).board||[],u.value=(await p.mySessions()).sessions||[]}finally{y.value=!1}}),(n,l)=>(i(),r("div",null,[t("div",null,[t("h2",L,[b(e(z),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),B(" "+s(e(a).t("myDashboard")),1)]),l[0]||(l[0]=t("div",{class:"muted",style:{"margin-top":"4px","margin-bottom":"16px"}},"สรุปผลการฝึกของตัวคุณเอง — ดูว่าปิดการขายได้กี่ครั้ง ยังฝึกกับใครบ้าง",-1))]),y.value?v("",!0):(i(),r("div",M,[t("div",j,[t("span",null,s(e(a).t("total")),1),t("strong",null,s(m.value),1)]),t("div",C,[t("span",null,s(e(a).t("won")),1),t("strong",null,s(_.value),1)]),t("div",F,[t("span",null,s(e(a).t("lost")),1),t("strong",null,s(g.value),1)]),t("div",I,[t("span",null,s(e(a).t("notTried")),1),t("strong",null,s(w.value),1)])])),y.value?(i(),r("div",q,[...l[1]||(l[1]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):o.value.length===0?(i(),r("div",A,[...l[2]||(l[2]=[t("strong",null,"No practice yet",-1),t("span",null,"Go to Training and try closing a sale with a persona.",-1)])])):v("",!0),N(t("div",E,[t("h3",G,s(e(a).t("mySessions")),1),(i(!0),r(S,null,T(u.value,d=>(i(),r("div",{key:d.id,style:{display:"flex","justify-content":"space-between",padding:"8px 0","border-bottom":"1px solid var(--border)"}},[t("span",null,s(d.persona_name),1),t("span",{class:V(["badge",d.outcome])},s(d.outcome==="won"?e(a).t("won"):e(a).t("lost")),3)]))),128))],512),[[D,u.value.length]])]))}},O=f(H,[["__scopeId","data-v-6767b6b8"]]);export{O as default};

View File

@@ -0,0 +1 @@
import{_ as f,l as x,s as v,c as r,a as t,m as b,u as e,j as k,t as s,i as a,e as _,w as B,y as N,F as D,q as S,r as p,z as c,o as i,A as T}from"./index-Dm2VwslH.js";import{L as V}from"./layout-dashboard-LQG3ldGP.js";const z={style:{margin:"0"}},L={key:0,class:"row stat-row"},M={class:"card stat"},j={class:"card stat won"},C={class:"card stat lost"},F={class:"card stat"},q={key:1,class:"card"},A={key:2,class:"card empty-state"},E={class:"card",style:{"margin-top":"20px"}},G={style:{"margin-top":"0"}},I={__name:"MyBoard",setup(H){const o=p([]),u=p([]),m=p(!0),y=c(()=>o.value.length),g=c(()=>o.value.filter(n=>n.my_outcome==="won").length),h=c(()=>o.value.filter(n=>n.my_outcome==="lost").length),w=c(()=>o.value.filter(n=>n.my_outcome==="not_tried").length);return x(async()=>{try{o.value=(await v.myBoard()).board||[],u.value=(await v.mySessions()).sessions||[]}finally{m.value=!1}}),(n,l)=>(i(),r("div",null,[t("div",null,[t("h2",z,[b(e(V),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),k(" "+s(e(a).t("myDashboard")),1)]),l[0]||(l[0]=t("div",{class:"muted",style:{"margin-top":"4px","margin-bottom":"16px"}},"สรุปผลการฝึกของตัวคุณเอง — ดูว่าปิดการขายได้กี่ครั้ง ยังฝึกกับใครบ้าง",-1))]),m.value?_("",!0):(i(),r("div",L,[t("div",M,[t("span",null,s(e(a).t("total")),1),t("strong",null,s(y.value),1)]),t("div",j,[t("span",null,s(e(a).t("won")),1),t("strong",null,s(g.value),1)]),t("div",C,[t("span",null,s(e(a).t("lost")),1),t("strong",null,s(h.value),1)]),t("div",F,[t("span",null,s(e(a).t("notTried")),1),t("strong",null,s(w.value),1)])])),m.value?(i(),r("div",q,[...l[1]||(l[1]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):o.value.length===0?(i(),r("div",A,[...l[2]||(l[2]=[t("strong",null,"No practice yet",-1),t("span",null,"Go to Training and try closing a sale with a persona.",-1)])])):_("",!0),B(t("div",E,[t("h3",G,s(e(a).t("mySessions")),1),(i(!0),r(D,null,S(u.value,d=>(i(),r("div",{key:d.id,style:{display:"flex","justify-content":"space-between",padding:"8px 0","border-bottom":"1px solid var(--border)"}},[t("span",null,s(d.persona_name),1),t("span",{class:T(["badge",d.outcome])},s(d.outcome==="won"?e(a).t("won"):e(a).t("lost")),3)]))),128))],512),[[N,u.value.length]])]))}},O=f(I,[["__scopeId","data-v-6767b6b8"]]);export{O as default};

View File

@@ -1 +1 @@
import{_ as T,l as $,c as r,m as d,n as m,a as t,t as s,u as e,i as n,f as g,j as _,e as w,F as y,q as p,h as L,s as N,x as V,r as b,o as a,S as I,A as h,B as A}from"./index-Dv9XjhnS.js";import{T as S}from"./target-Do-370k4.js";import{A as j}from"./arrow-left-haz-8IhO.js";const F={class:"row",style:{"align-items":"center"}},q={style:{margin:"0"}},D={class:"muted",style:{"margin-left":"auto"}},E={key:0,class:"card guide"},M={key:1,class:"row",style:{margin:"12px 0",gap:"10px"}},R={class:"primary"},G={class:"grid"},H={class:"row",style:{"justify-content":"space-between"}},J={class:"diff"},K={class:"muted"},O={class:"muted"},Q={class:"muted"},U={class:"muted",style:{"margin-top":"6px"}},W={class:"primary",style:{width:"100%"}},X={class:"primary",style:{width:"100%"}},Y={key:1,class:"muted",style:{"margin-top":"auto","font-size":"12px"}},Z={__name:"Personas",setup(tt){const c=L().params.gid,k=b([]),B=b(!0);async function C(){try{k.value=(await N.listPersonas(c)).personas}finally{B.value=!1}}function z(l){return k.value.filter(i=>i.tier===l)}function P(l){return n.t(l==="A"?"tierA":l==="B"?"tierB":"tierC")}function v(l){return l==="won"?n.t("won"):l==="lost"?n.t("lost"):n.t("notTried")}return $(C),(l,i)=>{const u=V("router-link");return a(),r("div",null,[d(u,{to:"/training",class:"btn-back"},{default:m(()=>[d(e(j),{size:16,"stroke-width":2}),_(" "+s(e(n).t("training")),1)]),_:1}),t("div",F,[t("h2",q,s(e(n).t("personas")),1),t("span",D,s(e(n).t("selectPersona")),1)]),e(g).isAdmin?w("",!0):(a(),r("div",E,[t("strong",null,[d(e(S),{size:17,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),i[0]||(i[0]=_(" วิธีฝึก",-1))]),i[1]||(i[1]=t("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[t("li",null,"เลือกลูกค้าจำลอง (บุคคลต้นแบบ) คนหนึ่งที่อยากฝึกด้วย"),t("li",null,"ระดับ A ง่ายสุด → ระดับ C ยากสุด (ดูจากดาว ★ ความยาก)"),t("li",null,"กดปุ่มสำหรับฝึกแชทกับลูกค้าคนนั้น (ฝึกได้คนละครั้งเท่านั้น)")],-1))])),e(g).isAdmin?(a(),r("div",M,[d(u,{to:`/admin/groups/${e(c)}/edit`},{default:m(()=>[t("button",R,[d(e(I),{size:18,"stroke-width":1.8}),_(" "+s(e(n).t("managePersonas")),1)])]),_:1},8,["to"]),i[2]||(i[2]=t("span",{class:"muted"},"Admin: จัดการรายละเอียดบุคคลต้นแบบได้ที่นี่",-1))])):w("",!0),(a(),r(y,null,p(["A","B","C"],f=>t("div",{key:f,style:{margin:"20px 0"}},[t("h4",null,s(P(f)),1),t("div",G,[(a(!0),r(y,null,p(z(f),o=>(a(),r("div",{key:o.id,class:"card pcard lift"},[t("div",H,[t("strong",null,s(o.name),1),t("span",{class:h(["badge",o.my_outcome])},s(v(o.my_outcome)),3)]),t("div",J,[(a(),r(y,null,p(5,x=>t("span",{key:x,class:h(["star",{on:x<=(o.difficulty||1)}])},"★",2)),64)),t("span",K,s(e(n).t("difficulty"))+" "+s(o.difficulty||1)+"/5",1)]),t("div",O,[_(s(o.profession)+" · "+s(o.age_group)+" · "+s(o.location),1),i[3]||(i[3]=t("br",null,null,-1)),t("span",{class:h(["badge",o.channel])},s(o.channel),3),t("span",Q," · "+s(o.initiation_mode==="seller"?e(n).t("sellerInitiated"):e(n).t("customerInitiated")),1)]),t("div",U,s(o.product_context),1),e(g).isAdmin?(a(),A(u,{key:0,to:`/groups/${e(c)}/chat/${o.id}`,style:{"margin-top":"auto"}},{default:m(()=>[t("button",W,s(e(n).t("chat")),1)]),_:1},8,["to"])):(a(),r(y,{key:1},[o.my_outcome==="not_tried"?(a(),A(u,{key:0,to:`/groups/${e(c)}/chat/${o.id}`,style:{"margin-top":"auto"}},{default:m(()=>[t("button",X,s(e(n).t("chat")),1)]),_:1},8,["to"])):(a(),r("div",Y,"✓ "+s(e(n).t("trained"))+" ("+s(v(o.my_outcome))+")",1))],64))]))),128))])])),64))])}}},at=T(Z,[["__scopeId","data-v-46d50c99"]]);export{at as default};
import{_ as T,l as $,c as r,m as d,n as m,a as t,t as s,u as e,i as n,f as g,j as _,e as w,F as y,q as p,h as L,s as N,x as V,r as b,o as a,S as I,A as h,B as A}from"./index-Dm2VwslH.js";import{T as S}from"./target-CliUY7kC.js";import{A as j}from"./arrow-left-Cm4VHcqz.js";const F={class:"row",style:{"align-items":"center"}},q={style:{margin:"0"}},D={class:"muted",style:{"margin-left":"auto"}},E={key:0,class:"card guide"},M={key:1,class:"row",style:{margin:"12px 0",gap:"10px"}},R={class:"primary"},G={class:"grid"},H={class:"row",style:{"justify-content":"space-between"}},J={class:"diff"},K={class:"muted"},O={class:"muted"},Q={class:"muted"},U={class:"muted",style:{"margin-top":"6px"}},W={class:"primary",style:{width:"100%"}},X={class:"primary",style:{width:"100%"}},Y={key:1,class:"muted",style:{"margin-top":"auto","font-size":"12px"}},Z={__name:"Personas",setup(tt){const c=L().params.gid,k=b([]),B=b(!0);async function C(){try{k.value=(await N.listPersonas(c)).personas}finally{B.value=!1}}function z(l){return k.value.filter(i=>i.tier===l)}function P(l){return n.t(l==="A"?"tierA":l==="B"?"tierB":"tierC")}function v(l){return l==="won"?n.t("won"):l==="lost"?n.t("lost"):n.t("notTried")}return $(C),(l,i)=>{const u=V("router-link");return a(),r("div",null,[d(u,{to:"/training",class:"btn-back"},{default:m(()=>[d(e(j),{size:16,"stroke-width":2}),_(" "+s(e(n).t("training")),1)]),_:1}),t("div",F,[t("h2",q,s(e(n).t("personas")),1),t("span",D,s(e(n).t("selectPersona")),1)]),e(g).isAdmin?w("",!0):(a(),r("div",E,[t("strong",null,[d(e(S),{size:17,"stroke-width":1.8,style:{"vertical-align":"-3px"}}),i[0]||(i[0]=_(" วิธีฝึก",-1))]),i[1]||(i[1]=t("ol",{style:{margin:"8px 0 0","padding-left":"20px","line-height":"1.8"}},[t("li",null,"เลือกลูกค้าจำลอง (บุคคลต้นแบบ) คนหนึ่งที่อยากฝึกด้วย"),t("li",null,"ระดับ A ง่ายสุด → ระดับ C ยากสุด (ดูจากดาว ★ ความยาก)"),t("li",null,"กดปุ่มสำหรับฝึกแชทกับลูกค้าคนนั้น (ฝึกได้คนละครั้งเท่านั้น)")],-1))])),e(g).isAdmin?(a(),r("div",M,[d(u,{to:`/admin/groups/${e(c)}/edit`},{default:m(()=>[t("button",R,[d(e(I),{size:18,"stroke-width":1.8}),_(" "+s(e(n).t("managePersonas")),1)])]),_:1},8,["to"]),i[2]||(i[2]=t("span",{class:"muted"},"Admin: จัดการรายละเอียดบุคคลต้นแบบได้ที่นี่",-1))])):w("",!0),(a(),r(y,null,p(["A","B","C"],f=>t("div",{key:f,style:{margin:"20px 0"}},[t("h4",null,s(P(f)),1),t("div",G,[(a(!0),r(y,null,p(z(f),o=>(a(),r("div",{key:o.id,class:"card pcard lift"},[t("div",H,[t("strong",null,s(o.name),1),t("span",{class:h(["badge",o.my_outcome])},s(v(o.my_outcome)),3)]),t("div",J,[(a(),r(y,null,p(5,x=>t("span",{key:x,class:h(["star",{on:x<=(o.difficulty||1)}])},"★",2)),64)),t("span",K,s(e(n).t("difficulty"))+" "+s(o.difficulty||1)+"/5",1)]),t("div",O,[_(s(o.profession)+" · "+s(o.age_group)+" · "+s(o.location),1),i[3]||(i[3]=t("br",null,null,-1)),t("span",{class:h(["badge",o.channel])},s(o.channel),3),t("span",Q," · "+s(o.initiation_mode==="seller"?e(n).t("sellerInitiated"):e(n).t("customerInitiated")),1)]),t("div",U,s(o.product_context),1),e(g).isAdmin?(a(),A(u,{key:0,to:`/groups/${e(c)}/chat/${o.id}`,style:{"margin-top":"auto"}},{default:m(()=>[t("button",W,s(e(n).t("chat")),1)]),_:1},8,["to"])):(a(),r(y,{key:1},[o.my_outcome==="not_tried"?(a(),A(u,{key:0,to:`/groups/${e(c)}/chat/${o.id}`,style:{"margin-top":"auto"}},{default:m(()=>[t("button",X,s(e(n).t("chat")),1)]),_:1},8,["to"])):(a(),r("div",Y,"✓ "+s(e(n).t("trained"))+" ("+s(v(o.my_outcome))+")",1))],64))]))),128))])])),64))])}}},at=T(Z,[["__scopeId","data-v-46d50c99"]]);export{at as default};

View File

@@ -1,4 +1,4 @@
import{k as z,_ as T,r as c,f as i,c as h,a as e,m as k,u as a,S as $,j as v,t as o,i as s,w as x,v as b,e as V,A as S,s as U,o as w}from"./index-Dv9XjhnS.js";/**
import{k as z,_ as T,r as c,f as i,c as h,a as e,m as k,u as a,S as $,j as v,t as o,i as s,w as x,v as b,e as V,A as S,s as U,o as w}from"./index-Dm2VwslH.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.

View File

@@ -1 +1 @@
import{_ as x,c as v,a as e,t,u as s,i as a,j as S,f as _,w,v as f,b as y,e as V,r,g as K,o as m}from"./index-Dv9XjhnS.js";const T={class:"setup-wrap"},B={class:"card setup-card"},N={class:"muted"},U={key:0,class:"error",role:"alert"},C=["disabled"],D={key:0,class:"spinner"},M={key:1},P={__name:"Setup",setup(j){const k=K(),i=r(""),l=r(""),p=r(""),o=r(""),d=r(!1);async function c(){if(o.value="",l.value.length<4){o.value=a.t("passwordTooShort");return}if(l.value!==p.value){o.value=a.t("passwordMismatch");return}d.value=!0;try{await _.finishSetup(i.value.trim(),l.value),k.push("/")}catch(h){o.value=h.message}finally{d.value=!1}}return(h,u)=>{var b,g;return m(),v("div",T,[e("div",B,[e("h1",null,"🔐 "+t(s(a).t("setupTitle")),1),e("p",N,[S(t(s(a).t("setupSubtitle"))+" ",1),e("strong",null,t(((b=s(_).user)==null?void 0:b.name)||((g=s(_).user)==null?void 0:g.username)),1)]),e("label",null,t(s(a).t("email")),1),w(e("input",{"onUpdate:modelValue":u[0]||(u[0]=n=>i.value=n),type:"email",autocomplete:"email",onKeyup:y(c,["enter"])},null,544),[[f,i.value]]),e("label",null,t(s(a).t("newPassword")),1),w(e("input",{"onUpdate:modelValue":u[1]||(u[1]=n=>l.value=n),type:"password",autocomplete:"new-password",onKeyup:y(c,["enter"])},null,544),[[f,l.value]]),e("label",null,t(s(a).t("confirmPassword")),1),w(e("input",{"onUpdate:modelValue":u[2]||(u[2]=n=>p.value=n),type:"password",autocomplete:"new-password",onKeyup:y(c,["enter"])},null,544),[[f,p.value]]),o.value?(m(),v("div",U,t(o.value),1)):V("",!0),e("button",{class:"primary",style:{width:"100%","margin-top":"16px"},disabled:d.value||!i.value||!l.value||l.value!==p.value,onClick:c},[d.value?(m(),v("span",D)):(m(),v("span",M,t(s(a).t("save")),1))],8,C)])])}}},I=x(P,[["__scopeId","data-v-f190e120"]]);export{I as default};
import{_ as x,c as v,a as e,t,u as s,i as a,j as S,f as _,w,v as f,b as y,e as V,r,g as K,o as m}from"./index-Dm2VwslH.js";const T={class:"setup-wrap"},B={class:"card setup-card"},N={class:"muted"},U={key:0,class:"error",role:"alert"},C=["disabled"],D={key:0,class:"spinner"},M={key:1},P={__name:"Setup",setup(j){const k=K(),i=r(""),l=r(""),p=r(""),o=r(""),d=r(!1);async function c(){if(o.value="",l.value.length<4){o.value=a.t("passwordTooShort");return}if(l.value!==p.value){o.value=a.t("passwordMismatch");return}d.value=!0;try{await _.finishSetup(i.value.trim(),l.value),k.push("/")}catch(h){o.value=h.message}finally{d.value=!1}}return(h,u)=>{var b,g;return m(),v("div",T,[e("div",B,[e("h1",null,"🔐 "+t(s(a).t("setupTitle")),1),e("p",N,[S(t(s(a).t("setupSubtitle"))+" ",1),e("strong",null,t(((b=s(_).user)==null?void 0:b.name)||((g=s(_).user)==null?void 0:g.username)),1)]),e("label",null,t(s(a).t("email")),1),w(e("input",{"onUpdate:modelValue":u[0]||(u[0]=n=>i.value=n),type:"email",autocomplete:"email",onKeyup:y(c,["enter"])},null,544),[[f,i.value]]),e("label",null,t(s(a).t("newPassword")),1),w(e("input",{"onUpdate:modelValue":u[1]||(u[1]=n=>l.value=n),type:"password",autocomplete:"new-password",onKeyup:y(c,["enter"])},null,544),[[f,l.value]]),e("label",null,t(s(a).t("confirmPassword")),1),w(e("input",{"onUpdate:modelValue":u[2]||(u[2]=n=>p.value=n),type:"password",autocomplete:"new-password",onKeyup:y(c,["enter"])},null,544),[[f,p.value]]),o.value?(m(),v("div",U,t(o.value),1)):V("",!0),e("button",{class:"primary",style:{width:"100%","margin-top":"16px"},disabled:d.value||!i.value||!l.value||l.value!==p.value,onClick:c},[d.value?(m(),v("span",D)):(m(),v("span",M,t(s(a).t("save")),1))],8,C)])])}}},I=x(P,[["__scopeId","data-v-f190e120"]]);export{I as default};

View File

@@ -0,0 +1 @@
import{_ as w,l as b,s as A,f as d,c as l,a as t,m as c,u as s,j as _,t as e,i as n,n as m,B as h,e as f,F as B,q as C,r as g,x as N,o as i,A as k}from"./index-Dm2VwslH.js";import{T as P}from"./target-CliUY7kC.js";import{B as T}from"./book-open-x8tSBc1t.js";import{P as z}from"./plus-CAyBY_kw.js";const V={class:"row",style:{"align-items":"center","margin-bottom":"16px"}},j={style:{margin:"0"}},F={class:"row",style:{"margin-left":"auto",gap:"10px"}},L={class:"soft"},S={class:"primary"},$={class:"muted"},q={key:0,class:"card",style:{"min-height":"80px"}},D={key:1,class:"card empty-state"},E={key:0},G={key:1},I={class:"grid"},M={class:"card lift train-card"},O={class:"row",style:{"justify-content":"space-between"}},H={class:"muted",style:{margin:"6px 0 12px"}},J={class:"row",style:{gap:"8px"}},K={class:"muted"},Q={class:"primary",style:{width:"100%","margin-top":"12px"}},R={__name:"Training",setup(U){const u=g([]),y=g(!0);function v(a){return a.sales_kit&&a.sales_kit.productName||a.input&&a.input.product||""}function x(a){return a.personas||a.persona_count||0}return b(async()=>{try{const a=(await A.listGroups()).groups||[];u.value=d.isAdmin?a:a.filter(r=>r.status==="ready")}finally{y.value=!1}}),(a,r)=>{const p=N("router-link");return i(),l("div",null,[t("div",V,[t("h2",j,[c(s(P),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),_(" "+e(s(n).t("training")),1)]),t("div",F,[c(p,{to:"/guide"},{default:m(()=>[t("button",L,[c(s(T),{size:18,"stroke-width":1.8}),r[0]||(r[0]=_(" คู่มือ",-1))])]),_:1}),s(d).isAdmin?(i(),h(p,{key:0,to:"/admin/new-group"},{default:m(()=>[t("button",S,[c(s(z),{size:18,"stroke-width":2}),_(" "+e(s(n).t("addProduct")),1)])]),_:1})):f("",!0)])]),t("p",$,e(s(n).t("trainingSubtitle")),1),y.value?(i(),l("div",q,[...r[1]||(r[1]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):u.value.length===0?(i(),l("div",D,[t("strong",null,e(s(n).t("noTraining")),1),s(d).isAdmin?(i(),l("span",E,'Click "'+e(s(n).t("addProduct"))+'" to create a persona group.',1)):(i(),l("span",G,"Ask an admin to create a persona group first."))])):f("",!0),t("div",I,[(i(!0),l(B,null,C(u.value,o=>(i(),h(p,{key:o.id,to:s(d).isAdmin?`/admin/groups/${o.id}/edit`:`/groups/${o.id}/personas`,style:{"text-decoration":"none"}},{default:m(()=>[t("div",M,[t("div",O,[t("strong",null,e(o.title),1),t("span",{class:k(["badge",o.status==="ready"?"ready":"draft"])},e(o.status),3)]),t("div",H,e(v(o)),1),t("div",J,[t("span",{class:k(["badge",o.channel||"line"])},e(o.channel||"line"),3),t("span",K,e(x(o))+" "+e(s(n).t("personas").toLowerCase()),1)]),t("button",Q,e(s(d).isAdmin?o.status==="ready"?s(n).t("managePersonas"):s(n).t("analyze"):s(n).t("selectPersona")),1)])]),_:2},1032,["to"]))),128))])])}}},tt=w(R,[["__scopeId","data-v-e39df241"]]);export{tt as default};

View File

@@ -0,0 +1 @@
.grid[data-v-e39df241]{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}.train-card[data-v-e39df241]{display:flex;flex-direction:column;height:100%}.badge.ready[data-v-e39df241]{background:#dcfce7;color:#166534}.badge.draft[data-v-e39df241]{background:#fef9c3;color:#854d0e}button.soft[data-v-e39df241]{background:#f1f3f9;border-color:transparent}.badge.facebook[data-v-e39df241]{background:#e0f2fe;color:#0369a1}.badge.line[data-v-e39df241]{background:#dcfce7;color:#15803d}

View File

@@ -1 +0,0 @@
.grid[data-v-1e5bd92b]{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}.train-card[data-v-1e5bd92b]{display:flex;flex-direction:column;height:100%}.badge.ready[data-v-1e5bd92b]{background:#dcfce7;color:#166534}.badge.draft[data-v-1e5bd92b]{background:#fef9c3;color:#854d0e}button.soft[data-v-1e5bd92b]{background:#f1f3f9;border-color:transparent}.badge.facebook[data-v-1e5bd92b]{background:#e0f2fe;color:#0369a1}.badge.line[data-v-1e5bd92b]{background:#dcfce7;color:#15803d}

View File

@@ -1 +0,0 @@
import{_ as w,l as b,s as A,f as l,c as r,a as t,m as _,u as s,j as m,t as e,i as o,B as y,n as h,e as f,F as C,q as N,r as g,x as P,o as i,A as v}from"./index-Dv9XjhnS.js";import{T}from"./target-Do-370k4.js";import{P as B}from"./plus-Dg6sDA5g.js";const z={class:"row",style:{"align-items":"center","margin-bottom":"16px"}},V={style:{margin:"0"}},j={style:{"margin-left":"auto"}},F={class:"primary"},L={class:"muted"},S={key:0,class:"card",style:{"min-height":"80px"}},$={key:1,class:"card empty-state"},q={key:0},D={key:1},E={class:"grid"},G={class:"card lift train-card"},I={class:"row",style:{"justify-content":"space-between"}},M={class:"muted",style:{margin:"6px 0 12px"}},H={class:"row",style:{gap:"8px"}},J={class:"muted"},K={class:"primary",style:{width:"100%","margin-top":"12px"}},O={__name:"Training",setup(Q){const c=g([]),u=g(!0);function k(a){return a.sales_kit&&a.sales_kit.productName||a.input&&a.input.product||""}function x(a){return a.personas||a.persona_count||0}return b(async()=>{try{const a=(await A.listGroups()).groups||[];c.value=l.isAdmin?a:a.filter(d=>d.status==="ready")}finally{u.value=!1}}),(a,d)=>{const p=P("router-link");return i(),r("div",null,[t("div",z,[t("h2",V,[_(s(T),{size:22,"stroke-width":1.8,style:{"vertical-align":"-4px"}}),m(" "+e(s(o).t("training")),1)]),t("div",j,[s(l).isAdmin?(i(),y(p,{key:0,to:"/admin/new-group"},{default:h(()=>[t("button",F,[_(s(B),{size:18,"stroke-width":2}),m(" "+e(s(o).t("addProduct")),1)])]),_:1})):f("",!0)])]),t("p",L,e(s(o).t("trainingSubtitle")),1),u.value?(i(),r("div",S,[...d[0]||(d[0]=[t("div",{class:"skeleton",style:{height:"50px"}},null,-1)])])):c.value.length===0?(i(),r("div",$,[t("strong",null,e(s(o).t("noTraining")),1),s(l).isAdmin?(i(),r("span",q,'Click "'+e(s(o).t("addProduct"))+'" to create a persona group.',1)):(i(),r("span",D,"Ask an admin to create a persona group first."))])):f("",!0),t("div",E,[(i(!0),r(C,null,N(c.value,n=>(i(),y(p,{key:n.id,to:s(l).isAdmin?`/admin/groups/${n.id}/edit`:`/groups/${n.id}/personas`,style:{"text-decoration":"none"}},{default:h(()=>[t("div",G,[t("div",I,[t("strong",null,e(n.title),1),t("span",{class:v(["badge",n.status==="ready"?"ready":"draft"])},e(n.status),3)]),t("div",M,e(k(n)),1),t("div",H,[t("span",{class:v(["badge",n.channel||"line"])},e(n.channel||"line"),3),t("span",J,e(x(n))+" "+e(s(o).t("personas").toLowerCase()),1)]),t("button",K,e(s(l).isAdmin?n.status==="ready"?s(o).t("managePersonas"):s(o).t("analyze"):s(o).t("selectPersona")),1)])]),_:2},1032,["to"]))),128))])])}}},X=w(O,[["__scopeId","data-v-1e5bd92b"]]);export{X as default};

View File

@@ -1,4 +1,4 @@
import{k as e}from"./index-Dv9XjhnS.js";/**
import{k as e}from"./index-Dm2VwslH.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.

View File

@@ -0,0 +1,6 @@
import{k as a}from"./index-Dm2VwslH.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const e=a("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);export{e as B};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
import{k as t}from"./index-Dm2VwslH.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h=t("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);export{h as L};

View File

@@ -1,4 +1,4 @@
import{k as e}from"./index-Dv9XjhnS.js";/**
import{k as e}from"./index-Dm2VwslH.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.

View File

@@ -0,0 +1,6 @@
import{k as a}from"./index-Dm2VwslH.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const l=a("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);export{l as S};

View File

@@ -1,4 +1,4 @@
import{k as c}from"./index-Dv9XjhnS.js";/**
import{k as c}from"./index-Dm2VwslH.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.

View File

@@ -1,4 +1,4 @@
import{k as e}from"./index-Dv9XjhnS.js";/**
import{k as e}from"./index-Dm2VwslH.js";/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sales Trainer</title>
<script type="module" crossorigin src="/assets/index-Dv9XjhnS.js"></script>
<script type="module" crossorigin src="/assets/index-Dm2VwslH.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bu7f-IE2.css">
</head>
<body>