1import{_ as X}from"./C2a92Tni.js";import{_ as Z}from"./3EBg3iUg.js";import{_ as ee}from"./BZQy6ovt.js";import{u as te,s as se,d as ae}from"./DtaMcMgl.js";import{c as I}from"./D_rngVSp.js";import{I as j}from"./pnh8EOCJ.js";import{I as M}from"./GRymhyKZ.js";import{I as P}from"./DYb25-Kp.js";import{I as N}from"./DzENRkTT.js";import{I as ne}from"./DlZaLOuR.js";import{I as R}from"./DxIERjcP.js";import{I as oe}from"./DzA_gxR7.js";import{I as ie}from"./BRJAA2SD.js";import{I as $}from"./CecOVL8Q.js";import{I as le}from"./BdbZa608.js";import{u as re}from"./CbqWd3-v.js";import{u as ce}from"./J59qyXmU.js";import{f as de,u as me,c as ue,r as pe,q as E,z as r,v as e,B as n,C as t,F as T,A as D,D as a,s as b,G as c,E as y,t as _,M as he,x as m,i as L,y as i,a0 as ge,$ as fe}from"./D5MLA-hU.js";import{f as be}from"./RsnzuqlS.js";import"./B1_oImu8.js";import"./CuyeCgjt.js";import"./BsSRCWlq.js";(function(){try{var p=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new p.Error().stack;s&&(p._sentryDebugIds=p._sentryDebugIds||{},p._sentryDebugIds[s]="7b844a99-868b-4e42-9217-94646abed24f",p._sentryDebugIdIdentifier="sentry-dbid-7b844a99-868b-4e42-9217-94646abed24f")}catch{}})();var _e=I("outline","camera","Camera",[["path",{d:"M5 7h1a2 2 0 0 0 2 -2a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1a2 2 0 0 0 2 2h1a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-9a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M9 13a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);var xe=I("outline","crown","Crown",[["path",{d:"M12 6l4 6l5 -4l-2 10h-14l-2 -10l5 4l4 -6",key:"svg-0"}]]);var ke=I("outline","logout","Logout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]);var ve=I("outline","shield-lock","ShieldLock",[["path",{d:"M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3",key:"svg-0"}],["path",{d:"M11 11a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M12 12l0 2.5",key:"svg-2"}]]);const we={class:"px-6 pb-20 pt-28 sm:pt-32"},ye={key:0,class:"mx-auto max-w-6xl space-y-6"},Ie={class:"grid gap-4 sm:grid-cols-2"},Ce={key:1,class:"mx-auto max-w-6xl"},Me={class:"rounded-[1.75rem] border border-slate-100 bg-gradient-to-br from-white to-brand-50/50 p-8 shadow-sm ring-1 ring-black/[0.02] sm:p-10"},Te={class:"flex flex-wrap items-center justify-between gap-5"},De={class:"flex min-w-0 items-center gap-4"},Le={class:"relative shrink-0"},Se=["src","alt"],Ae={key:1,class:"grid h-16 w-16 place-items-center rounded-2xl bg-brand-50 text-2xl font-bold text-brand-600 ring-1 ring-brand-100"},Be=["disabled","aria-label"],Ve={class:"min-w-0"},je={class:"text-xs font-semibold uppercase tracking-wide text-brand-600"},Pe={class:"display mt-1 text-3xl leading-tight text-ink-900 sm:text-4xl"},Ne={class:"mt-2.5 flex flex-wrap items-center gap-x-3 gap-y-2 text-sm text-ink-700"},Re={class:"inline-flex min-w-0 items-center gap-1.5 font-medium"},$e={class:"truncate"},Ee={key:0,class:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-brand-50 px-3 py-1 text-xs font-semibold text-brand-700 ring-1 ring-inset ring-brand-100"},ze={key:0,class:"mt-2 text-xs font-medium text-red-600"},Ue={class:"mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3"},Fe={class:"lg:col-span-2"},Ge={class:"flex items-center gap-2 text-lg font-semibold text-ink-900"},qe={class:"mt-4 space-y-3"},He={class:"grid h-12 w-12 shrink-0 place-items-center rounded-xl bg-brand-50 text-brand-600"},Oe={class:"min-w-0 flex-1"},We={class:"flex min-w-0 items-center gap-2"},Ye={class:"min-w-0 truncate font-semibold text-ink-900"},Je={class:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-slate-100 px-2.5 py-0.5 text-xs font-semibold text-slate-600"},Ke={class:"mt-0.5 truncate text-sm text-slate-500"},Qe={class:"mt-0.5 text-xs text-slate-500"},Xe={key:0,class:"flex flex-col items-center rounded-2xl border border-dashed border-slate-200 bg-slate-50/60 px-6 py-14 text-center"},Ze={class:"grid h-12 w-12 place-items-center rounded-2xl bg-white text-slate-300 shadow-sm ring-1 ring-slate-100"},et={class:"mt-4 text-sm text-slate-500"},tt={class:"space-y-6"},st={class:"inline-flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-white/80"},at={class:"mt-1 text-2xl font-bold leading-none"},nt={class:"text-sm font-semibold text-white/80"},ot={class:"mt-1.5 inline-flex items-center gap-1 text-xs font-semibold text-white/90"},it={class:"rounded-2xl border border-slate-100 bg-white p-6 shadow-sm ring-1 ring-black/[0.02]"},lt={class:"text-lg font-semibold text-ink-900"},rt={class:"mt-4 space-y-3 text-sm"},ct={class:"flex items-center gap-2.5 text-ink-900"},dt={class:"grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-brand-50 text-brand-500"},mt={class:"truncate font-medium"},ut={class:"flex items-center gap-2.5 text-ink-900"},pt={class:"grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-brand-50 text-brand-500"},ht={class:"truncate font-medium"},gt={class:"rounded-2xl border border-slate-100 bg-white p-6 shadow-sm ring-1 ring-black/[0.02]"},ft={class:"text-lg font-semibold text-ink-900"},bt={class:"mt-4 space-y-2.5"},_t={class:"rounded-2xl border border-slate-100 bg-white p-6 shadow-sm ring-1 ring-black/[0.02]"},xt={class:"text-lg font-semibold text-ink-900"},kt={class:"mt-4 space-y-2.5"},Gt=de({__name:"index",setup(p){const{t:s}=me();
1re({title:s("akun.seoTitle"),description:s("akun.seoDesc"),robots:"noindex, nofollow"});const S=ce(),{user:h,fetchMe:z,logout:U,uploadAvatar:F}=ue(),{repairs:G,rewardPoints:q}=te(),x=m([]),k=m(null),A=m(!0),C=L(()=>be(h.value?.name)),H=L(()=>(C.value[0]||"R").toUpperCase()),B=m(),v=m(!1),g=m(""),O=["image/jpeg","image/png","image/webp"];async function W(d){const l=d.target,u=l.files?.[0];if(l.value="",!!u){if(g.value="",!O.includes(u.type)){g.value=s("akun.avatarType");return}if(u.size>2*1024*1024){g.value=s("akun.avatarSize");return}v.value=!0;try{await F(u)}catch{g.value=s("akun.avatarFailed")}finally{v.value=!1}}}const Y=d=>d?new Date(d).toLocaleDateString("id-ID",{day:"numeric",month:"short",year:"numeric"}):"";pe(async()=>{if(!await z()){await E("/masuk");return}try{x.value=(await G()).data??[]}catch{}try{const l=(await q()).data;l?.enabled&&(k.value={name:l.name,balance:l.balance,tier:l.tier.key})}catch{}finally{A.value=!1}});const w=m(!1),V=m(!1);async function J(){V.value=!0,await U(),await E("/")}const K=L(()=>[{to:"/akun/poin",icon:P,label:s("akun.managePoints")},{to:"/akun/alamat",icon:oe,label:s("akun.manageAddresses")},{to:"/akun/perangkat",icon:M,label:s("akun.manageGadgets")},{to:"/akun/keamanan",icon:ve,label:s("akun.manageSecurity")}]);return(d,l)=>{const u=X,f=Z,Q=ee;return i(),r("section",we,[e(A)?(i(),r("div",ye,[n(u,{class:"h-44 w-full rounded-[1.75rem]"}),t("div",Ie,[(i(),r(T,null,D(4,o=>n(u,{key:o,class:"h-32 w-full rounded-2xl"})),64))])])):(i(),r("div",Ce,[t("div",Me,[t("div",Te,[t("div",De,[t("div",Le,[e(h)?.avatar?(i(),r("img",{key:0,src:e(h).avatar,alt:e(C),class:"h-16 w-16 rounded-2xl object-cover ring-1 ring-brand-100"},null,8,Se)):(i(),r("span",Ae,a(e(H)),1)),t("button",{type:"button",disabled:e(v),class:"absolute -bottom-1.5 -right-1.5 grid h-7 w-7 place-items-center rounded-full bg-brand-500 text-white shadow-md ring-2 ring-white transition-colors hover:bg-brand-600 disabled:opacity-60","aria-label":e(s)("akun.avatarUpload"),onClick:l[0]||(l[0]=o=>e(B)?.click())},[e(v)?(i(),b(e(ne),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(i(),b(e(_e),{key:1,class:"h-3.5 w-3.5"}))],8,Be),t("input",{ref_key:"avatarInput",ref:B,type:"file",accept:"image/jpeg,image/png,image/webp",class:"hidden",onChange:W},null,544)]),t("div",Ve,[t("p",je,a(e(s)("akun.eyebrow")),1),t("h1",Pe,a(e(s)("akun.greeting",{name:e(C)})),1),t("div",Ne,[t("span",Re,[n(e(R),{class:"h-4 w-4 shrink-0 text-brand-500"}),t("span",$e,a(e(h)?.email||"-"),1)]),e(x).length?(i(),r("span",Ee,[n(e(N),{class:"h-3.5 w-3.5"}),c(" "+a(e(s)("akun.repairsCount",{count:e(x).length})),1)])):y("",!0)]),e(g)?(i(),r("p",ze,a(e(g)),1)):y("",!0)])]),t("button",{class:"inline-flex items-center gap-2 rounded-full border border-slate-200 px-5 py-2.5 text-sm font-semibold text-ink-700 transition-colors duration-300 hover:bg-slate-50 active:scale-95",onClick:l[1]||(l[1]=o=>w.value=!0)},[n(e(ke),{class:"h-4 w-4"}),c(" "+a(e(s)("akun.logout")),1)])])]),t("div",Ue,[t("div",Fe,[t("h2",Ge,[n(e(N),{class:"h-5 w-5 text-brand-500"}),c(" "+a(e(s)("akun.historyTitle")),1)]),t("div",qe,[(i(!0),r(T,null,D(e(x),o=>(i(),b(f,{key:o.id,to:`/akun/servis/${o.id}
1`,class:"group flex items-center gap-4 rounded-2xl border border-slate-100 bg-white p-5 shadow-sm ring-1 ring-black/[0.02] transition-all duration-300 hover:-translate-y-0.5 hover:border-brand-200 hover:shadow-lg hover:shadow-ink-900/5"},{default:_(()=>[t("span",He,[n(e(M),{class:"h-6 w-6","stroke-width":1.75})]),t("div",Oe,[t("div",We,[t("p",Ye,a(o.device||"-"),1),t("span",Je,[t("span",{class:"h-1.5 w-1.5 rounded-full bg-current",style:ge({color:("safeColor"in d?d.safeColor:e(se))(o.status_color)})},null,4),c(" "+a(o.status),1)])]),t("p",Ke,a([("defectsText"in d?d.defectsText:e(ae))(o.defects),e(S)(o.service_type)].filter(Boolean).join(" · ")),1),t("p",Qe,a([o.job_sheet_no,Y(o.created_at)].filter(Boolean).join(" · ")),1)]),n(e(j),{class:"h-5 w-5 shrink-0 text-slate-300 transition-all group-hover:translate-x-0.5 group-hover:text-brand-500"})]),_:2},1032,["to"]))),128)),e(x).length?y("",!0):(i(),r("div",Xe,[t("span",Ze,[n(e(M),{class:"h-6 w-6"})]),t("p",et,a(e(s)("akun.emptyHistory")),1),n(f,{to:"/perbaikan",class:"mt-4 inline-flex items-center gap-1.5 text-sm font-semibold text-brand-600 transition-colors hover:text-brand-700"},{default:_(()=>[n(e($),{class:"h-4 w-4"}),c(" "+a(e(s)("akun.newBooking")),1)]),_:1})]))])]),t("div",tt,[e(k)?(i(),b(f,{key:0,to:"/akun/poin",class:"group flex items-center justify-between gap-3 rounded-2xl bg-gradient-to-br from-brand-600 to-brand-800 p-5 text-white shadow-sm transition-transform hover:-translate-y-0.5"},{default:_(()=>[t("div",null,[t("p",st,[n(e(P),{class:"h-4 w-4"}),c(" "+a(e(k).name),1)]),t("p",at,[c(a(e(k).balance.toLocaleString("id-ID"))+" ",1),t("span",nt,a(e(s)("poin.unit")),1)]),t("p",ot,[n(e(xe),{class:"h-3.5 w-3.5"}),c(" "+a(e(s)(`poin.tier.${e(k).tier}`)),1)])]),n(e(j),{class:"h-5 w-5 shrink-0 text-white/70 transition-transform group-hover:translate-x-0.5"})]),_:1})):y("",!0),t("div",it,[t("h2",lt,a(e(s)("akun.profileTitle")),1),t("dl",rt,[t("div",ct,[t("span",dt,[n(e(R),{class:"h-4 w-4"})]),t("span",mt,a(e(h)?.email||"-"),1)]),t("div",ut,[t("span",pt,[n(e(ie),{class:"h-4 w-4"})]),t("span",ht,a(e(h)?.mobile||"-"),1)])])]),t("div",gt,[t("h2",ft,a(e(s)("akun.manageTitle")),1),t("div",bt,[(i(!0),r(T,null,D(e(K),o=>(i(),b(f,{key:o.to,to:o.to,class:"flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-semibold text-ink-700 transition-colors hover:bg-slate-50"},{default:_(()=>[(i(),b(fe(o.icon),{class:"h-5 w-5 text-slate-400"})),c(" "+a(o.label),1)]),_:2},1032,["to"]))),128))])]),t("div",_t,[t("h2",xt,a(e(s)("akun.quickActionsTitle")),1),t("div",kt,[n(f,{to:"/perbaikan",class:"flex items-center gap-3 rounded-xl bg-brand-50 px-4 py-3 text-sm font-semibold text-brand-700 transition-colors hover:bg-brand-100"},{default:_(()=>[n(e($),{class:"h-5 w-5"}),c(" "+a(e(s)("akun.newBooking")),1)]),_:1}),n(f,{to:"/tracking",class:"flex items-center gap-3 rounded-xl px-4 py-3 text-sm font-semibold text-ink-700 transition-colors hover:bg-slate-50"},{default:_(()=>[n(e(le),{class:"h-5 w-5 text-slate-400"}),c(" "+a(e(s)("akun.trackRepair")),1)]),_:1})])])])])])),n(Q,{modelValue:e(w),"onUpdate:modelValue":l[2]||(l[2]=o=>he(w)?w.value=o:null),title:e(s)("akun.logoutConfirmTitle"),message:e(s)("akun.logoutConfirmMessage"),"confirm-label":e(s)("akun.logoutConfirm"),"cancel-label":e(s)("akun.logoutCancel"),loading:e(V),onConfirm:J},null,8,["modelValue","title","message","confirm-label","cancel-label","loading"])])}}});export{Gt 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.