1import{f as v,j as e}from"./index-RDDra8gW.js";import{r as l}from"./react-vendor-CxxQRYkG.js";import{w as k}from"./firebase-C_kwqSDf.js";import{s as P}from"./scenesafe_logo_header-Bkp1gynr.js";import{L as C,T,C as A,aT as R,a6 as E,aw as L}from"./icons-ALDxYxrn.js";import"./deepgram-BnSEPMF1.js";const D=[{value:1,label:"P1 â Critical / time-sensitive"},{value:2,label:"P2 â Standard"},{value:3,label:"P3 â Discharge / routine"}],q={facilityName:"",contactName:"",contactPhone:"",contactEmail:"",patientName:"",patientDOB:"",pickupFacility:"",pickupAddress:"",roomNumber:"",dropoffFacility:"",dropoffAddress:"",requestedTime:"",priority:2,mobility:"",isolation:"",notes:"",website:""},a="w-full bg-paper border border-hairline rounded-xl px-3.5 py-2.5 text-sm text-ink placeholder:text-ink-faint focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40",z="block text-xs font-semibold text-ink-soft mb-1.5";function i({label:n,required:o,children:d}){return e.jsxs("label",{className:"block",children:[n&&e.jsxs("span",{className:z,children:[n,o&&e.jsx("span",{className:"text-accent",children:" *"})]}),d]})}function x({children:n}){return e.jsxs("div",{className:"min-h-[100dvh] bg-paper text-ink overflow-x-hidden font-sans antialiased",children:[e.jsx("nav",{className:"border-b border-hairline bg-paper/80 backdrop-blur-xl",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-5 sm:px-8 h-16 flex items-center justify-between",children:[e.jsx("a",{href:"/",className:"hover:opacity-80 transition-opacity",children:e.jsx("img",{src:P,alt:"SceneSafe",className:"h-10 w-auto"})}),e.jsxs("a",{href:"/",className:"inline-flex items-center gap-1.5 text-ink-soft hover:text-ink text-sm font-medium px-3 py-2 rounded-full hover:bg-paper-sunken transition-all",children:[e.jsx(L,{size:15})," scenesafe.ai"]})]})}),e.jsx("main",{className:"max-w-2xl mx-auto px-5 sm:px-8 py-12",children:n})]})}function _({slug:n}){const[o,d]=l.useState("loading"),[h,w]=l.useState(""),[t,b]=l.useState(q),[f,j]=l.useState(!1),[g,p]=l.useState(""),[y,N]=l.useState(null);l.useEffect(()=>{const r=document.body.style.backgroundColor,c=document.body.classList.contains("light-mode");return document.body.style.backgroundColor="#FBFAF7",document.body.classList.add("light-mode"),()=>{document.body.style.backgroundColor=r,c||document.body.classList.remove("light-mode")}},[]),l.useEffect(()=>{let r=!1;return(async()=>{try{const m=await k(v,"getTransferPortalInfo")({slug:n});if(r)return;w(m.data?.agencyName||"this agency"),d("ready")}catch{r||d("unavailable")}})(),()=>{r=!0}},[n]);const s=r=>c=>b(m=>({...m,[r]:c.target.value})),S=async r=>{if(r.preventDefault(),p(""),["contactName","contactPhone","pickupFacility","pickupAddress","dropoffFacility","requestedTime"].filter(u=>!String(t[u]).trim()).length>0){p("Please fill in all required fields.");return}j(!0);try{const F=await k(v,"submitTransferRequest")({slug:n,...t,requestedTime:new Date(t.requestedTime).getTime(),priority:Number(t.priority)});N(F.data?.confirmationNumber||null)}catch(u){p(u?.message||"Something went wrong submitting this request. Please call the agency directly.")}finally{j(!1)}};return o==="loading"?e.jsx(x,{children:e.jsx("div",{className:"flex justify-center py-24",children:e.jsx(C,{size:22,className:"animate-spin text-ink-faint"})})}):o==="unavailable"?e.jsx(x,{children:e.jsxs("div",{className:"ss-card p-8 text-center space-y-3",children:[e.jsx("span",{className:"w-12 h-12 rounded-2xl bg-paper-sunken border border-hairline flex items-center justify-center text-ink-faint mx-auto",children:e.jsx(T,{size:22})}),e.jsx("h1",{className:"text-lg font-semibold text-ink",children:"This link isn't available"}),e.jsx("p",{className:"text-sm text-ink-soft",children:"It may have been rotated or the portal may no longer be active. Please contact the agency directly to arrange this transfer."})]})}):y?e.jsx(x,{children:e.jsxs("div",{className:"ss-card p-8 text-center space-y-3",children:[e.jsx("span",{className:"w-12 h-12 rounded-2xl bg-emerald-500/10 border border-emerald-500/25 flex items-center justify-center text-emerald-700 mx-auto",children:e.jsx(A,{size:22})}),e.jsx("h1",{className:"text-lg font-semibold text-ink",children:"Request submitted"}),e.jsxs("p",{className:"text-sm text-ink-soft",children:[h," has received your transfer request and will review it. Reference this confirmation number if you call to follow up:"]}),e.jsx("p",{className:"text-lg font-mono font-bold text-accent",children:y}),e.jsx("button",{onClick:()=>{N(null),b(q)},className:"ss-btn-ghost text-sm px-5 py-2.5 mt-2",children:"Submit another request"})]})}):e.jsxs(x,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 mb-3 px-2.5 py-1 rounded-full border border-hairline bg-paper-sunken",children:[e.jsx(R,{size:13,className:"text-accent"}),e.jsx("span",{className:"ss-label",children:"Scheduled Transfer Request"})]}),e.jsxs("h1",{className:"text-2xl font-semibold tracking-[-0.02em] text-ink",children:["Request a transfer with ",h]}),e.jsx("p",{className:"mt-2 text-sm text-ink-soft",children:"This is a request only â it's reviewed by a dispatcher before it's scheduled. For an urgent or time-critical transfer, please call the agency directly instead of using this form."})]}),e.jsxs("form",{onSubmit:S,className:"ss-card p-6 space-y-5",children:[e.jsx("div",{className:"absolute -left-[9999px]","aria-hidden":"true",children:e.jsxs("label",{children:["Website",e.jsx("input",{tabIndex:-1,autoComplete:"off",value:t.website,onChange:s("website")})]})}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"Your name",required:!0,children:e.jsx("input",{value:t.contactName,onChange:s("contactName"),className:a,required:!0})}),e.jsx(i,{label:"Callback phone",required:!0,children:e.jsx("input",{type:"tel",value:t.contactPhone,onChange:s("contactPhone"),className:a,required:!0})}),e.jsx(i,{label:"Email",children:e.jsx("input",{type:"email",value:t.contactEmail,onChange:s("contactEmail"),className:a})}),e.jsx(i,{label:"Facility / department",children:e.jsx("input",{value:t.facilityName,onChange:s("facilityName"),className:a})})]}),e.jsxs("div",{className:"border-t border-hairline pt-5 grid sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"Patient name",children:e.jsx("input",{value:t.patientName,onChange:s("patientName"),className:a})}),e.jsx(i,{label:"Patient date of birth",children:e.jsx("input",{type:"date",value:t.patientDOB,onChange:s("patientDOB"),
1className:a})})]}),e.jsxs("div",{className:"border-t border-hairline pt-5 grid sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"Pickup facility",required:!0,children:e.jsx("input",{value:t.pickupFacility,onChange:s("pickupFacility"),className:a,required:!0})}),e.jsx(i,{label:"Room #",children:e.jsx("input",{value:t.roomNumber,onChange:s("roomNumber"),className:a})}),e.jsx("div",{className:"sm:col-span-2",children:e.jsx(i,{label:"Pickup address",required:!0,children:e.jsx("input",{value:t.pickupAddress,onChange:s("pickupAddress"),className:a,required:!0})})}),e.jsx(i,{label:"Destination facility",required:!0,children:e.jsx("input",{value:t.dropoffFacility,onChange:s("dropoffFacility"),className:a,required:!0})}),e.jsx(i,{label:"Destination address",children:e.jsx("input",{value:t.dropoffAddress,onChange:s("dropoffAddress"),className:a})})]}),e.jsxs("div",{className:"border-t border-hairline pt-5 grid sm:grid-cols-2 gap-4",children:[e.jsx(i,{label:"Requested pickup time",required:!0,children:e.jsx("input",{type:"datetime-local",value:t.requestedTime,onChange:s("requestedTime"),className:a,required:!0})}),e.jsx(i,{label:"Priority",children:e.jsx("select",{value:t.priority,onChange:s("priority"),className:a,children:D.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})}),e.jsx(i,{label:"Mobility needs",children:e.jsx("input",{value:t.mobility,onChange:s("mobility"),placeholder:"Stretcher, wheelchair, ambulatoryâ¦",className:a})}),e.jsx(i,{label:"Isolation precautions",children:e.jsx("input",{value:t.isolation,onChange:s("isolation"),className:a})})]}),e.jsx("div",{className:"border-t border-hairline pt-5",children:e.jsx(i,{label:"Additional notes",children:e.jsx("textarea",{value:t.notes,onChange:s("notes"),rows:3,className:a})})}),g&&e.jsx("div",{className:"text-sm text-red-700 bg-red-500/5 border border-red-500/20 rounded-xl px-4 py-2.5",children:g}),e.jsx("button",{type:"submit",disabled:f,className:"ss-btn-primary w-full justify-center text-sm px-6 py-3 disabled:opacity-60",children:f?e.jsxs(e.Fragment,{children:[e.jsx(C,{size:15,className:"animate-spin"})," Submittingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{size:15})," Submit request"]})})]})]})}export{_ as TransferRequestPortal,_ 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.