1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c5d64d55-80d2-4ac6-96b4-cbb0c91333e6",e._sentryDebugIdIdentifier="sentry-dbid-c5d64d55-80d2-4ac6-96b4-cbb0c91333e6")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5274],{45119:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var a=s(37876),r=s(22529),d=s(59459),n=s(61473),i=s(14232);function l(e){let{total:t,page:s,pageSize:r,onPageChange:d}=e,n=Math.ceil(t/r);if(n<=1)return null;let i=Math.min(s*r,t),l=[];for(let e=1;e<=n;e++)1===e||e===n||e>=s-1&&e<=s+1?l.push(e):"..."!==l[l.length-1]&&l.push("...");return(0,a.jsxs)("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white px-6 py-4",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-700",children:["Showing"," ",(0,a.jsxs)("span",{className:"font-medium",children:[(s-1)*r+1,"â",i]})," ","of ",(0,a.jsx)("span",{className:"font-medium",children:t})," sessions"]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{onClick:()=>d(s-1),disabled:1===s,className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-700 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-40",children:"â Prev"}),l.map((e,t)=>"..."===e?(0,a.jsx)("span",{className:"px-2 text-sm text-gray-500",children:"â¦"},"ellipsis-".concat(t)):(0,a.jsx)("button",{onClick:()=>d(e),className:"rounded-md border px-3 py-1.5 text-sm font-medium transition-colors ".concat(e===s?"border-dark-green bg-dark-green text-white":"border-gray-300 bg-white text-gray-700 hover:bg-gray-50"),children:e},e)),(0,a.jsx)("button",{onClick:()=>d(s+1),disabled:s===n,className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-medium text-gray-700 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-40",children:"Next â"})]})]})}function o(){let[e,t]=(0,i.useState)(1),[s,o]=(0,i.useState)(""),[c,m]=(0,i.useState)(""),[x,u]=(0,i.useState)(""),[g,h]=(0,i.useState)(""),[p,f]=(0,i.useState)(""),[b,y]=(0,i.useState)({}),{data:j,isLoading:N,error:k}=(0,n.i)({...b,skip:(e-1)*20,limit:20}),v=Object.values(b).some(e=>void 0!==e);return(0,a.jsx)(r.A,{title:"Sessions",children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Sessions"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:"View and manage coaching sessions"})]}),(0,a.jsxs)("div",{className:"rounded-lg bg-white p-4 shadow-sm",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3 lg:grid-cols-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"status",className:"block text-sm font-medium text-gray-700",children:"Status"}),(0,a.jsx)("select",{id:"status",value:s,onChange:e=>o(e.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-dark-green focus:ring-dark-green sm:text-sm",children:d.yZ.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"startDate",className:"block text-sm font-medium text-gray-700",children:"From Date"}),(0,a.jsx)("input",{type:"date",id:"startDate",value:g,onChange:e=>h(e.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-dark-green focus:ring-dark-green sm:text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"endDate",className:"block text-sm font-medium text-gray-700",children:"To Date"}),(0,a.jsx)("input",{type:"date",id:"endDate",value:p,onChange:e=>f(e.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-dark-green focus:ring-dark-green sm:text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"coachId",className:"block text-sm font-medium text-gray-700",children:"Coach ID"}),(0,a.jsx)("input",{type:"text",id:"coachId",value:c,onChange:e=>m(e.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-dark-green focus:ring-dark-green sm:text-sm",placeholder:"UUID..."})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"userId",className:"block text-sm font-medium text-gray-700",children:"Attendee ID"}),(0,a.jsx)("input",{type:"number",id:"userId",value:x,onChange:e=>u(e.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-dark-green focus:ring-dark-green sm:text-sm",placeholder:"User ID..."})]}),(0,a.jsxs)("div",{className:"flex items-end gap-2",children:[(0,a.jsx)("button",{onClick:()=>{t(1),y({status:s||void 0,coach_id:c||void 0,attendee_user_id:(()=>{let e=parseInt(x,10);return Number.isFinite(e)?e:void 0})(),start_date:g||void 0,end_date:p||void 0})},className:"flex-1 rounded-md bg-dark-green px-4 py-2 text-sm font-medium text-white hover:bg-opacity-90 focus:outline-none focus:ring-2 focus:ring-dark-green focus:ring-offset-2",children:"Apply"}),v&&(0,a.jsx)("button",{onClick:()=>{o(""),m(""),u(""),h(""),f(""),y({}),t(1)},className:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-dark-green focus:ring-offset-2",children:"Clear"})]})]}),v&&(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[b.status&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-dark-green/10 px-2.5 py-1 text-xs font-medium text-dark-green",children:["Status: ",b.status]}),b.start_date&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-dark-green/10 px-2.5 py-1 text-xs font-medium text-dark-green",children:["From: ",b.start_date]}),b.end_date&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-dark-green/10 px-2.5 py-1 text-xs font-medium text-dark-green",children:["To: ",b.end_date]}),b.coach_id&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-dark-green/10 px-2.5 py-1 text-xs font-medium text-dark-green",children:["Coach: ",b.coach_id.slice(0,8),"â¦"]}),b.attendee_user_id&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-dark-green/10 px-2.5 py-1 text-xs font-medium text-dark-green",children:["User: ",b.attendee_user_id]})]})]}),(0,a.jsxs)("div",{className:"overflow-hidden rounded-lg bg-white shadow",children:[N?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-dark-green border-t-transparent"})}):k?(0,a.jsx)("div",{className:"px-6 py-12 text-center text-red-600",children:"Failed to load sessions. Please try again."}
1):j&&0!==j.items.length?(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Date/Time"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Coach"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Attendee"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Status"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Price"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Actions"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-gray-200 bg-white",children:j.items.map(e=>(0,a.jsx)(d.xu,{session:e},e.id))})]})}):(0,a.jsxs)("div",{className:"px-6 py-12 text-center",children:[(0,a.jsx)("svg",{className:"mx-auto h-10 w-10 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,a.jsx)("p",{className:"mt-3 text-sm text-gray-500",children:"No sessions found matching the filters."})]}),j&&(0,a.jsx)(l,{total:j.total,page:e,pageSize:20,onPageChange:t})]})]})})}},71794:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/gi-admin/sessions",function(){return s(45119)}])}},e=>{e.O(0,[7115,636,6593,8792],()=>e(e.s=71794)),_N_E=e.O()}]);
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.