PageSourceSearch

https://login.captncoffee.com/_nuxt/CoPnkisM.js

js captncoffee.com collected 2026-10-07 08:33:01 UTC 9,497 bytes, 1 lines download raw bytes

1import{x as w,e as x,d as $,Q as X,a as h,o as l,i as c,v as f,R as E,m as d,b as e,j as n,c as g,w as i,G as b,S as L,F as B,U as Y,J as Z,h as z,O as ee,V as te,W as ae,k as se,T as oe,X as ne,Y as O,E as T,D as re,Z as le,_ as ce,u as ie,C as de,H as C}from"./B9oWe0kA.js";import{A as me}from"./BDdTrmZu.js";import{o as ue,s as M,_ as _e}from"./BB_0VghX.js";import{u as pe}from"./CzeaQf1h.js";import{u as Q}from"./CdZGGUX7.js";import{t as fe}from"./Co3GVCgs.js";import{u as he}from"./sUVELnaS.js";import"./VmlG8DTU.js";import{o as be,e as ye}from"./B3tGsU4_.js";import{u as ve}from"./DeYpLH94.js";import{u as ge,g as ke}from"./C5EzMNd4.js";import{u as R}from"./C15-cQB8.js";import{_ as xe}from"./Cm9sIrc3.js";import{u as we}from"./DDg1mhGH.js";import{u as D}from"./B28oXfFo.js";import{_ as $e}from"./BmOsXh2n.js";import{_ as Ce}from"./B3leYi_Z.js";import{_ as Me}from"./BdlwaBkS.js";import{u as Ue}from"./CZqapPBo.js";import{u as Le}from"./BQ5jjAOI.js";import"./x_rD_Ya3.js";import"./DJURBEDC.js";function Ae(){const{item:y,isLoading:o}=Q(),{company:r}=R(),{locale:_}=w();return{paymentMethodUpdateUrl:x(()=>{const{checkout_frontend_url:m,api_key:a}=r.value??{},{hash:p,uid:t}=y.value??{};if(!m||!a||!t||!p)return"";const s=new URL(`/${_.value}/${a}/update-payment-method`,m);return s.searchParams.append("customer_id",t),s.searchParams.append("hash",p),s.searchParams.append("update_all","true"),s.href}),isLoading:o}}const Se={class:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-700 dark:bg-neutral-900"},Fe={class:"flex items-center gap-4 p-5"},Ne={class:"flex size-12 shrink-0 items-center justify-center rounded-full bg-accent-100 font-semibold text-accent-700 dark:bg-accent-900 dark:text-accent-200"},Pe={class:"min-w-0 flex-1"},je={key:0,class:"grid grid-cols-1 border-t border-neutral-200 md:grid-cols-2 dark:border-neutral-700"},Ee={key:0,class:"border-t border-neutral-200 md:border-l md:border-t-0 dark:border-neutral-700"},Te={key:1,class:"flex flex-col gap-1 border-t border-neutral-200 px-5 py-3 dark:border-neutral-700"},Be={class:"font-semibold text-neutral-700 dark:text-neutral-300"},Ve={class:"font-semibold text-neutral-700 dark:text-neutral-300"},ze=$({__name:"address-card",props:{name:{default:""},email:{default:""},initials:{default:""},phone:{default:""},phoneLabel:{default:""},vatNumber:{default:""},vatNumberLabel:{default:""}},setup(y){const o=y,r=X(),_=x(()=>o.initials?o.initials:o.name?o.name.split(/\s+/).filter(Boolean).slice(0,2).map(a=>a[0]?.toUpperCase()??"").join(""):""),u=x(()=>!!(r.shipping||r.billing)),m=x(()=>!!(o.phone||o.vatNumber));return(a,p)=>{const t=L;return l(),h("div",Se,[c("div",Fe,[c("div",Ne,d(e(_)||"—"),1),c("div",Pe,[n(t,{variant:"subtitle",class:"block truncate"},{default:i(()=>[b(d(a.name||"—"),1)]),_:1}),a.email?(l(),g(t,{key:0,variant:"caption",class:"block truncate"},{default:i(()=>[b(d(a.email),1)]),_:1})):f("",!0)]),E(a.$slots,"header-actions")]),e(u)?(l(),h("div",je,[E(a.$slots,"shipping"),a.$slots.billing?(l(),h("div",Ee,[E(a.$slots,"billing")])):f("",!0)])):f("",!0),e(m)?(l(),h("div",Te,[a.phone?(l(),g(t,{key:0,variant:"caption"},{default:i(()=>[a.phoneLabel?(l(),h(B,{key:0},[b(d(a.phoneLabel)+": ",1)],64)):f("",!0),c("span",Be,d(a.phone),1)]),_:1})):f("",!0),a.vatNumber?(l(),g(t,{key:1,variant:"caption"},{default:i(()=>[a.vatNumberLabel?(l(),h(B,{key:0},[b(d(a.vatNumberLabel)+": ",1)],64)):f("",!0),c("span",Ve,d(a.vatNumber),1)]),_:1})):f("",!0)])):f("",!0)])}}}),Oe=Object.assign(ze,{__name:"TwAddressCard"}),Qe={class:"grid grid-cols-12 gap-x-2"},Re={key:1,class:"flex justify-end space-x-2"},De=$({__name:"customer-edit",props:{allowEdit:{type:Boolean,default:!1}},emits:["submit","reset","refetch"],setup(y){const{merge:o}=Y,{t:r}=w(),_=he(),{setMessage:u}=ve(),{item:m}=Q(),a=pe(),{session:p}=Z(),t=z({validForm:!1,editMode:!1,processing:!1}),s=z({email:"",first_name:"",last_name:"",phone:""}),A=ue({email:M().email(),first_name:M(),last_name:M(),phone:M()}),S=[{key:"first_name",label:r("forms.firstname")+" *"},{key:"last_name",label:r("forms.lastname")+" *"},{key:"email",label:r("forms.email")+" *"},{key:"phone",label:r("forms.phone")+" *"}];ee(m,v=>{t.value.editMode||(s.value=Object.assign({},s.value,v))},{immediate:!0});const F=()=>a.invalidateQueries({queryKey:[fe.auth.user,p.value.id]});async function N(){t.value.processing=!0;try{await _.auth.updateMe(be(m.value,s.value)),t.value.editMode=!1,await F()}catch(v){console.error(v),u(!0,ye(v))}t.value.processing=!1}function P(){m.value&&(s.value=o({},s.value,m.value)),t.value.editMode=!1}return(v,V)=>{const I=oe,K=O,j=re,q=Oe,G=L,H=me,J=_e;return l(),g(J,{state:e(s),schema:e(A),onSubmit:N},{default:i(()=>[te(c("div",Qe,[(l(),h(B,null,se(S,k=>n(I,{key:k.key,modelValue:e(s)[k.key],"onUpdate:modelValue":W=>e(s)[k.key]=W,label:k.label,path:k.key,class:"col-span-12 md:col-span-6"},null,8,["modelValue","onUpdate:modelValue","label","path"])),64))],512),[[ae,e(t).editMode]]),e(t).editMode?f("",!0):(l(),g(q,{key:0,name:`${e(s).first_name??""} ${e(s).last_name??""}`.trim(),email:e(s).email,phone:e(s).phone,"phone-label":e(r)("forms.phone")},ne({_:2},[v.allowEdit?{name:"header-actions",fn:i(()=>[n(j,{"data-cy":"btn-customer-edit-toggle","theme-id":e(T).icon,color:"primary","aria-label":"Edit customer",onClick:V[0]||(V[0]=k=>e(t).editMode=!0)},{default:i(()=>[n(K,{icon:"pencil"})]),_:1},8,["theme-id"])]),key:"0"}:void 0]),1032,["name","email","phone","phone-label"])),e(t).editMode?(l(),h("div",Re,[
1n(j,{"data-cy":"btn-cancel","theme-id":e(T).tonal,color:"secondary",disabled:e(t).processing,onClick:P},{default:i(()=>[b(d(e(r)("buttons.cancel")),1)]),_:1},8,["theme-id","disabled"]),n(j,{"data-cy":"btn-customer-edit-submit","theme-id":e(T).default,color:"primary",type:"submit",loading:e(t).processing},{default:i(()=>[b(d(e(r)("buttons.saveChanges")),1)]),_:1},8,["theme-id","loading"])])):f("",!0),v.allowEdit?f("",!0):(l(),g(H,{key:2,class:"mt-5",type:"info"},{default:i(()=>[n(G,{variant:"description",html:e(r)("customer.contactCustomerSupportForAddressEdit")},null,8,["html"])]),_:1}))]),_:1},8,["state","schema"])}}}),Ie=Object.assign(De,{__name:"CustomerEdit"}),Ke=$({__name:"locale-selector",setup(y){const{locale:o,setLocale:r}=w(),{setSelectedLocale:_}=R(),{availableLocales:u}=ge(),m=x(()=>u.value?.map(a=>({title:ke(a),value:a})));return(a,p)=>{const t=le;return l(),h("div",null,[n(t,{"model-value":e(o),class:"capitalize",items:e(m),"item-title":"title","item-value":"value","onUpdate:modelValue":p[0]||(p[0]=s=>{e(r)(s),e(_)(s)})},null,8,["model-value","items"])])}}}),qe=Object.assign(Ke,{__name:"LocaleSelector"}),Ge={key:0,class:"space-y-1"},He={class:"font-mono text-3xl tabular-nums text-neutral-900"},Je=$({__name:"refer-a-friend-account-credit",setup(y){const{credit:o,loading:r}=D(),{t:_}=w(),{toCurrency:u}=we();return(m,a)=>{const p=ce,t=L;return l(),h("div",null,[n(p,{active:e(r),indeterminate:""},null,8,["active"]),e(r)?f("",!0):(l(),h("div",Ge,[c("p",He,d(e(u)(e(o))),1),n(t,{variant:"caption",class:"block",html:e(_)("referAFriend.redeemedAutomatically")},null,8,["html"])]))])}}}),We=Object.assign(Je,{__name:"ReferAFriendAccountCredit"}),Xe={class:"text-xs"},Ye=$({__name:"customer-payment-method-update",setup(y){const{t:o}=w(),r=ie(),{paymentMethodUpdateUrl:_}=Ae(),u=de("cssNativePaymentMethodUpdate"),m=x(()=>u.value?r({name:"css-update-payment-method"}):_.value);return(a,p)=>{const t=$e,s=Ce;return l(),h("div",null,[n(s,{gap:"5px"},{default:i(()=>[n(t,{color:"info",variant:"text",external:!e(u),href:e(m),target:e(u)?void 0:"_blank",class:"text-info"},{default:i(()=>[b(d(e(o)("payments.updatePaymentMethods")),1)]),_:1},8,["external","href","target"]),c("p",Xe,d(e(o)("payments.updatePaymentMethods-hint")),1)]),_:1})])}}}),Ze=Object.assign(Ye,{__name:"CustomerPaymentMethodUpdate"}),et={class:"py-6"},tt={class:"flex gap-4 py-6"},at={class:"min-w-0 flex-1"},st={key:0,class:"flex gap-4 py-6"},ot={class:"min-w-0 flex-1"},nt={class:"flex gap-4 py-6"},rt={class:"min-w-0 flex-1"},lt={class:"flex gap-4 py-6"},ct={class:"min-w-0 flex-1"},U="mt-0.5 shrink-0 text-neutral-400",Ft=$({__name:"profile",setup(y){Le("profile");const{t:o}=w(),{enabled:r,activeCode:_}=D(),{allowedFeatures:u}=Ue();return(m,a)=>{const p=Ie,t=O,s=L,A=qe,S=xe,F=We,N=Ze,P=Me;return l(),g(P,{title:e(o)("header.yourProfile"),description:e(o)("profile.subtitle"),"back-title":e(o)("routes.dashboard.title"),"back-to":{name:"css-dashboard"},"container-class":"mx-auto w-full max-w-4xl"},{default:i(()=>[c("div",null,[c("section",et,[n(p,{"allow-edit":e(u).allowCustomerAddressEdit},null,8,["allow-edit"])]),c("section",tt,[n(t,{icon:"globe",size:"large",class:C(U)}),c("div",at,[n(s,{variant:"subtitle",class:"mb-3 block"},{default:i(()=>[b(d(e(o)("profile.language")),1)]),_:1}),n(A)])]),e(r)&&e(_)?(l(),h("section",st,[n(t,{icon:"gift",size:"large",class:C(U)}),c("div",ot,[n(s,{variant:"subtitle",class:"mb-3 block"},{default:i(()=>[b(d(e(o)("referAFriend.yourReferralCode")),1)]),_:1}),n(S,{align:"start"})])])):f("",!0),c("section",nt,[n(t,{icon:"banknote",size:"large",class:C(U)}),c("div",rt,[n(s,{variant:"subtitle",class:"mb-3 block"},{default:i(()=>[b(d(e(o)("referAFriend.yourAccountCredit")),1)]),_:1}),n(F)])]),c("section",lt,[n(t,{icon:"credit-card",size:"large",class:C(U)}),c("div",ct,[n(s,{variant:"subtitle",class:"mb-3 block"},{default:i(()=>[b(d(e(o)("payments.paymentMethod")),1)]),_:1}),n(N)])])])]),_:1},8,["title","description","back-title"])}}});export{Ft 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.