1import{r as n,b as M,c as S,j as e}from"./vendor-react-Dxo5VVMX.js";import{c as I}from"./firebase-BVnSfmn9.js";import{a as z,c as E}from"./vendor-firebase-firestore-BI8UjDC3.js";import{E as G,b as W}from"./index-BVSicd2K.js";import{c as p,H as D}from"./index-6F7UmCCt.js";import{mixpanel as o}from"./mixpanel-BhrQiLh9.js";import{u as _}from"./useAdminAuth-Ck7uF-ZB.js";import{C as $}from"./circle-check-big-BbcL8Pz6.js";import{S as Z}from"./shield-check-Be7VJ7xQ.js";import{E as R}from"./eye-DGMR1-RS.js";import"./vendor-analytics-BolNmaul.js";import"./vendor-firebase-extras-Butzwarm.js";import"./vendor-firebase-core-Bea8MryS.js";import"./firebaseCore-DdWO-lul.js";import"./vendor-query-BGDNI3Fe.js";import"./adminAuth-CriM6pkW.js";const U=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],T=p("KeyRound",U);const V=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],F=p("Lock",V);const H=[["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"}]],B=p("UserPlus",H),ce=({title:l})=>{const t={appColor:"#edff8d",darkGrey:"#212121",darkGrey2:"#424242",successPurple:"#a855f7"},{isAuthenticated:y,loading:c,error:m,signInWithGoogle:w}=_("agent_admin"),[a,d]=n.useState({userId:"",password:""}),[i,f]=n.useState(!1),[k,b]=n.useState([]),[u,h]=n.useState(""),A=M(),{city:g}=S();g==null||g.trim(),n.useEffect(()=>{o.track("Page Viewed",{Page:"MasterAgentLogin",Title:l,Path:window.location.pathname})},[l]),n.useEffect(()=>{document.title=l},[l]);const j=async s=>{s.preventDefault(),o.track("Master Login Attempted",{Page:"MasterAgentLogin",Path:window.location.pathname}),await w()?o.track("Master Login Succeeded",{Page:"MasterAgentLogin",Path:window.location.pathname}):o.track("Master Login Failed",{Page:"MasterAgentLogin",Reason:"Not authorized",Path:window.location.pathname})},C=async s=>{s.preventDefault(),o.track("Create Agent Attempted",{Page:"MasterAgentLogin",UserId:a.userId,Path:window.location.pathname});try{const r=await W.hash(a.password,10),x=await z(E(I,"AgentLogin"),{userId:a.userId,password:r,createdAt:new Date});b(L=>[...L,{id:x.id,userId:a.userId,password:a.password}]),h(`Agent ${a.userId} created successfully!`),d({userId:"",password:""}),o.track("Create Agent Succeeded",{Page:"MasterAgentLogin",AgentId:x.id,UserId:a.userId,Path:window.location.pathname}),setTimeout(()=>{h("")},3e3)}catch(r){console.error("Error creating agent:",r),o.track("Create Agent Failed",{Page:"MasterAgentLogin",Error:r instanceof Error?r.message:String(r),Path:window.location.pathname})}},v=()=>{f(!i),o.track("Show Password Toggled",{Page:"MasterAgentLogin",ShowPassword:!i,Path:window.location.pathname})},N=()=>{o.track("Agent List Viewed",{Page:"MasterAgentLogin",Path:window.location.pathname}),A("/agent-list",{state:{createdAgents:k}})},P={"@context":"https://schema.org","@type":"WebPage",name:"Master Agent Login - Zymo",description:"Secure Master Agent login portal for Zymo agent management",url:"https://zymo.app/master-agent"};return e.jsxs(e.Fragment,{children:[e.jsxs(D,{children:[e.jsx("title",{children:"Master Agent Login - Zymo"}),e.jsx("meta",{name:"description",content:"Log in as a Master Agent to oversee and manage Zymo's agent network, bookings, and operations."}),e.jsx("meta",{property:"og:title",content:"Master Agent Login - Zymo"}),e.jsx("meta",{property:"og:description",content:"Secure access for Zymo Master Agents to manage agents, bookings, and platform settings."}),e.jsx("link",{rel:"canonical",href:"https://zymo.app/master-agent"}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(P)})]}),e.jsx("div",{className:"flex items-center justify-center min-h-screen p-4",style:{backgroundColor:t.darkGrey,backgroundImage:"linear-gradient(to right bottom, rgba(33, 33, 33, 0.9), rgba(66, 66, 66, 0.9))"},children:e.jsxs("div",{className:"w-full max-w-md p-8 rounded-2xl shadow-2xl transform transition-all duration-500 hover:scale-105",style:{backgroundColor:t.darkGrey2,border:`2px solid ${t.appColor}`,boxShadow:`0 0 20px ${t.appColor}33`},children:[u&&e.jsxs("div",{className:"flex items-center justify-center p-3 rounded-lg mb-4 animate-pulse",style:{backgroundColor:t.successPurple+"22",color:t.successPurple},children:[e.jsx($,{size:24,className:"mr-2"}),u]}),y?e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx(B,{size:64,color:t.appColor,strokeWidth:1.5})}),e.jsx("h2",{className:"text-3xl font-bold text-center mb-6",style:{color:t.appColor},children:"Create New Agent"}),e.jsxs("form",{onSubmit:C,className:"space-y-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(T,{size:20,color:t.appColor,strokeWidth:1.5})}),e.jsx("input",{type:"text",placeholder:"Agent User ID",value:a.userId,onChange:s=>d({...a,userId:s.target.value}),className:"w-full p-3 pl-10 rounded-lg text-lg transition-all duration-300 focus:ring-2 focus:ring-yellow-500",style:{backgroundColor:t.darkGrey,color:t.appColor,border:`1px solid ${t.appColor}`}})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(F,{size:20,color:t.appColor,strokeWidth:1.5})}),e.jsx("input",{type:i?"text":"password",placeholder:"Agent Password",value:a.password,onChange:s=>d({...a,password:s.target.value}),className:"w-full p-3 pl-10 rounded-lg text-lg transition-all duration-300 focus:ring-2 focus:ring-yellow-500",style:{backgroundColor:t.darkGrey,color:t.appColor,border:`1px solid ${t.appColor}`}}),e.jsx("button",{type:"button",onClick:v,className:"absolute inset-y-0 right-0 pr-3 flex items-center",children:i?e.jsx(G,{size:20,color:t.appColor,strokeWidth:1.5}):e.jsx(R,{size:20,color:t.appColor,strokeWidth:1.5})})]}),e.jsx("button",{type:"submit",className:"w-full p-3 rounded-lg text-lg font-bold uppercase tracking-wider transform transition-all duration-300 hover:scale-105 hover:shadow-lg",style:{backgroundColor:t.appColor,color:t.darkGrey},children:"Create Agent"})]}),e.jsx("button",{onClick:N,className:"mt-4 w-full p-3 rounded-lg text-lg font-bold uppercase tracking-wider transform transition-all duration-300 hover:scale-105 hover:shadow-lg",style:{backgroundColor:t.appColor,color:t.darkGrey},children:"Agent List"})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx(Z,{size:64,color:t.appColor,strokeWidth:1.5})}),e.jsx("h2",{className:"text-3xl font-bold text-center mb-6",style:{color:t.appColor},children:"Master Agent Login"}),e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[c&&e.jsx("div",{className:"text-center text-sm",style:{color:t.appColor},children:"Authenticating..."}),m&&e.jsx("div",{className:"text-center text-sm text-red-500",children:m}
1),e.jsx("button",{type:"submit",disabled:c,className:"w-full p-3 rounded-lg text-lg font-bold uppercase tracking-wider transform transition-all duration-300 hover:scale-105 hover:shadow-lg disabled:opacity-50",style:{backgroundColor:t.appColor,color:t.darkGrey},children:c?"Authenticating...":"Sign in with Google"})]})]})]})})]})};export{ce 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.