PageSourceSearch

https://freesnaps.co.uk/build/assets/Edit-hwJtLj1V.js

js freesnaps.co.uk collected 2026-10-09 23:50:50 UTC 5,136 bytes, 1 lines download raw bytes

1import{m as R,aq as k,at as E,y as u,r as c,Z as t,D as s,v as e,an as V,w as o,aj as p,E as d,a5 as f,G as n,ac as A,a3 as U,z as B,aa as S}from"./app-CPrWn9JI.js";import{_}from"./Card.vue_vue_type_script_setup_true_lang-DUeyNVQa.js";import{_ as x}from"./CardContent.vue_vue_type_script_setup_true_lang-CZRylO73.js";import{_ as N}from"./CardDescription.vue_vue_type_script_setup_true_lang-8csDnVdd.js";import{_ as C,a as g}from"./CardTitle.vue_vue_type_script_setup_true_lang-Tul7AEwF.js";import{_ as T}from"./Input.vue_vue_type_script_setup_true_lang-BdYDugS-.js";import{_ as v}from"./Label.vue_vue_type_script_setup_true_lang-BzqpSdGW.js";import{_ as q}from"./Switch.vue_vue_type_script_setup_true_lang-CAQ-Go38.js";import D from"./arrow-left-MK5u4LgF.js";import j from"./trash-2-CWIim3Ev.js";import b from"./hash-Dvwi7HQ1.js";import z from"./save-CGS4HMPE.js";import"./useFormControl-DB1-YR_r.js";import"./VisuallyHiddenInput-B2a6CKzE.js";const F={class:"container mx-auto px-4 py-6"},M={class:"space-y-6"},G={class:"flex items-center justify-between"},H={class:"flex items-center space-x-2"},I={class:"grid gap-4 md:grid-cols-2"},L={class:"font-mono text-lg"},O={class:"text-lg"},Z={class:"text-sm text-muted-foreground"},J={class:"space-y-2"},K={key:0,class:"text-sm text-red-500"},P={class:"flex items-center space-x-2"},Q={class:"flex items-center space-x-4"},me=R({__name:"Edit",props:{referralCode:{}},setup(y){const l=y,h=[{title:"Admin",href:route("admin.dashboard")},{title:"Referral Management",href:route("admin.referral.default-milestones.index")},{title:"Referral Codes",href:route("admin.referrals.index")},{title:`Edit ${l.referralCode.code}`,href:route("admin.referrals.edit",{referralCode:l.referralCode.id})}],a=k({code:l.referralCode.code,name:l.referralCode.name,description:l.referralCode.description,is_active:l.referralCode.is_active}),w=()=>{a.put(route("admin.referrals.update",{referralCode:l.referralCode.id}))},$=()=>{confirm("Are you sure you want to delete this referral code? This action cannot be undone.")&&a.delete(route("admin.referrals.destroy",{referralCode:l.referralCode.id}))};return E(h),(i,r)=>(c(),u(S,null,[t(e(V),{title:`Edit Referral Code: ${i.referralCode.code}`},null,8,["title"]),s("div",F,[s("div",M,[s("div",G,[r[4]||(r[4]=s("div",null,[s("h1",{class:"text-3xl font-bold tracking-tight"},"Edit Referral Code"),s("p",{class:"text-muted-foreground"},"Update the referral code settings and configuration")],-1)),s("div",H,[t(e(f),{variant:"outline","as-child":""},{default:o(()=>[t(e(p),{href:i.route("admin.referrals.index")},{default:o(()=>[t(e(D),{class:"mr-2 h-4 w-4"}),r[2]||(r[2]=d(" Back to Referral Codes "))]),_:1,__:[2]},8,["href"])]),_:1}),t(e(f),{variant:"destructive",onClick:$,disabled:e(a).processing},{default:o(()=>[t(e(j),{class:"mr-2 h-4 w-4"}),r[3]||(r[3]=d(" Delete Code "))]),_:1,__:[3]},8,["disabled"])])]),t(e(_),null,{default:o(()=>[t(e(C),null,{default:o(()=>[t(e(g),{class:"flex items-center"},{default:o(()=>[t(e(b),{class:"mr-2 h-5 w-5"}),r[5]||(r[5]=d(" Code Information "))]),_:1,__:[5]})]),_:1}),t(e(x),null,{default:o(()=>[s("div",I,[s("div",null,[r[6]||(r[6]=s("p",{class:"text-sm font-medium text-muted-foreground"},"Referral Code",-1)),s("p",L,n(i.referralCode.code),1)]),s("div",null,[r[7]||(r[7]=s("p",{class:"text-sm font-medium text-muted-foreground"},"Owner",-1)),s("p",O,n(i.referralCode.user.name),1),s("p",Z,n(i.referralCode.user.email),1)])])]),_:1})]),_:1}),t(e(_),null,{default:o(()=>[t(e(C),null,{default:o(()=>[t(e(g),{class:"flex items-center"},{default:o(()=>[t(e(b),{class:"mr-2 h-5 w-5"}),r[8]||(r[8]=d(" Edit Settings "))]),_:1,__:[8]}),t(e(N),null,{default:o(()=>r[9]||(r[9]=[d(" Update the referral code configuration ")])),_:1,__:[9]})]),_:1}),t(e(x),null,{default:o(()=>[s("form",{onSubmit:A(w,["prevent"]),class:"space-y-6"},[s("div",J,[t(e(v),{for:"code"},{default:o(()=>r[10]||(r[10]=[d("Referral Code")])),_:1,__:[10]}),t(e(T),{id:"code",modelValue:e(a).code,"onUpdate:modelValue":r[0]||(r[0]=m=>e(a).code=m),type:"text",placeholder:"e.g., REF12345",class:B(["font-mono",{"border-red-500":e(a).errors.code}]),required:""},null,8,["modelValue","class"]),e(a).errors.code?(c(),u("p",K,n(e(a).errors.code),1)):U("",!0),r[11]||(r[11]=s("p",{class:"text-xs text-muted-foreground"},"The referral code should be unique and easy to remember",-1))]),s("div",P,[t(e(q),{id:"is_active",checked:e(a).is_active,"onUpdate:checked":r[1]||(r[1]=m=>e(a).is_active=m)},null,8,["checked"]),t(e(v),{for:"is_active"},{default:o(()=>r[12]||(r[12]=[d("Active")])),_:1,__:[12]})]),r[14]||(r[14]=s("p",{class:"text-xs text-muted-foreground"},"Active referral codes can be used by customers",-1)),s("div",Q,[t(e(f),{type:"submit",disabled:e(a).processing},{default:o(()=>[t(e(z),{class:"mr-2 h-4 w-4"}
1),d(" "+n(e(a).processing?"Updating...":"Update Referral Code"),1)]),_:1},8,["disabled"]),t(e(f),{type:"button",variant:"outline","as-child":""},{default:o(()=>[t(e(p),{href:i.route("admin.referrals.index")},{default:o(()=>r[13]||(r[13]=[d(" Cancel ")])),_:1,__:[13]},8,["href"])]),_:1})])],32)]),_:1})]),_:1})])])],64))}});export{me 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.